dist/ember-spade.js in ember-source-1.0.0.rc1.3 vs dist/ember-spade.js in ember-source-1.0.0.rc1.4
- old
+ new
@@ -27,6 +27,6 @@
var value = callback.apply(this, reified);
return seen[name] = exports || value;
};
})();
-minispade.register('container', "(function() {define(\"container\",\n [],\n function() {\n\n function InheritingDict(parent) {\n this.parent = parent;\n this.dict = {};\n }\n\n InheritingDict.prototype = {\n get: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return dict[key];\n }\n\n if (this.parent) {\n return this.parent.get(key);\n }\n },\n\n set: function(key, value) {\n this.dict[key] = value;\n },\n\n has: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return true;\n }\n\n if (this.parent) {\n return this.parent.has(key);\n }\n\n return false;\n },\n\n eachLocal: function(callback, binding) {\n var dict = this.dict;\n\n for (var prop in dict) {\n if (dict.hasOwnProperty(prop)) {\n callback.call(binding, prop, dict[prop]);\n }\n }\n }\n };\n\n function Container(parent) {\n this.parent = parent;\n this.children = [];\n\n this.resolver = parent && parent.resolver || function() {};\n this.registry = new InheritingDict(parent && parent.registry);\n this.cache = new InheritingDict(parent && parent.cache);\n this.typeInjections = new InheritingDict(parent && parent.typeInjections);\n this.injections = {};\n this._options = new InheritingDict(parent && parent._options);\n this._typeOptions = new InheritingDict(parent && parent._typeOptions);\n }\n\n Container.prototype = {\n child: function() {\n var container = new Container(this);\n this.children.push(container);\n return container;\n },\n\n set: function(object, key, value) {\n object[key] = value;\n },\n\n register: function(type, name, factory, options) {\n var fullName;\n\n if (type.indexOf(':') !== -1){\n options = factory;\n factory = name;\n fullName = type;\n } else {\n Ember.deprecate('register(\"'+type +'\", \"'+ name+'\") is now deprecated in-favour of register(\"'+type+':'+name+'\");', true);\n fullName = type + \":\" + name;\n }\n\n var normalizedName = this.normalize(fullName);\n\n this.registry.set(normalizedName, factory);\n this._options.set(normalizedName, options || {});\n },\n\n resolve: function(fullName) {\n return this.resolver(fullName) || this.registry.get(fullName);\n },\n\n normalize: function(fullName) {\n return fullName;\n },\n\n lookup: function(fullName, options) {\n fullName = this.normalize(fullName);\n\n options = options || {};\n\n if (this.cache.has(fullName) && options.singleton !== false) {\n return this.cache.get(fullName);\n }\n\n var value = instantiate(this, fullName);\n\n if (!value) { return; }\n\n if (isSingleton(this, fullName) && options.singleton !== false) {\n this.cache.set(fullName, value);\n }\n\n return value;\n },\n\n has: function(fullName) {\n if (this.cache.has(fullName)) {\n return true;\n }\n\n return !!factoryFor(this, fullName);\n },\n\n optionsForType: function(type, options) {\n if (this.parent) { illegalChildOperation('optionsForType'); }\n\n this._typeOptions.set(type, options);\n },\n\n options: function(type, options) {\n this.optionsForType(type, options);\n },\n\n typeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('typeInjection'); }\n\n var injections = this.typeInjections.get(type);\n if (!injections) {\n injections = [];\n this.typeInjections.set(type, injections);\n }\n injections.push({ property: property, fullName: fullName });\n },\n\n injection: function(factoryName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n if (factoryName.indexOf(':') === -1) {\n return this.typeInjection(factoryName, property, injectionName);\n }\n\n var injections = this.injections[factoryName] = this.injections[factoryName] || [];\n injections.push({ property: property, fullName: injectionName });\n },\n\n destroy: function() {\n this.isDestroyed = true;\n\n for (var i=0, l=this.children.length; i<l; i++) {\n this.children[i].destroy();\n }\n\n this.children = [];\n\n eachDestroyable(this, function(item) {\n item.isDestroying = true;\n });\n\n eachDestroyable(this, function(item) {\n item.destroy();\n });\n\n delete this.parent;\n this.isDestroyed = true;\n },\n\n reset: function() {\n for (var i=0, l=this.children.length; i<l; i++) {\n resetCache(this.children[i]);\n }\n resetCache(this);\n }\n };\n\n function illegalChildOperation(operation) {\n throw new Error(operation + \" is not currently supported on child containers\");\n }\n\n function isSingleton(container, fullName) {\n var singleton = option(container, fullName, 'singleton');\n\n return singleton !== false;\n }\n\n function buildInjections(container, injections) {\n var hash = {};\n\n if (!injections) { return hash; }\n\n var injection, lookup;\n\n for (var i=0, l=injections.length; i<l; i++) {\n injection = injections[i];\n lookup = container.lookup(injection.fullName);\n hash[injection.property] = lookup;\n }\n\n return hash;\n }\n\n function option(container, fullName, optionName) {\n var options = container._options.get(fullName);\n\n if (options && options[optionName] !== undefined) {\n return options[optionName];\n }\n\n var type = fullName.split(\":\")[0];\n options = container._typeOptions.get(type);\n\n if (options) {\n return options[optionName];\n }\n }\n\n function factoryFor(container, fullName) {\n var name = container.normalize(fullName);\n return container.resolve(name);\n }\n\n function instantiate(container, fullName) {\n var factory = factoryFor(container, fullName);\n\n var splitName = fullName.split(\":\"),\n type = splitName[0], name = splitName[1],\n value;\n\n if (option(container, fullName, 'instantiate') === false) {\n return factory;\n }\n\n if (factory) {\n var injections = [];\n injections = injections.concat(container.typeInjections.get(type) || []);\n injections = injections.concat(container.injections[fullName] || []);\n\n var hash = buildInjections(container, injections);\n hash.container = container;\n hash._debugContainerKey = fullName;\n\n value = factory.create(hash);\n\n return value;\n }\n }\n\n function eachDestroyable(container, callback) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n callback(value);\n });\n }\n\n function resetCache(container) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n value.destroy();\n });\n container.cache.dict = {};\n }\n\n return Container;\n});\n\n})();\n//@ sourceURL=container");minispade.register('ember-application/ext', "(function() {minispade.require('ember-application/ext/controller');\n\n})();\n//@ sourceURL=ember-application/ext");minispade.register('ember-application/ext/controller', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar ControllersProxy = Ember.Object.extend({\n controller: null,\n\n unknownProperty: function(controllerName) {\n var controller = get(this, 'controller'),\n needs = get(controller, 'needs'),\n container = controller.get('container'),\n dependency;\n\n for (var i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency === controllerName) {\n return container.lookup('controller:' + controllerName);\n }\n }\n }\n});\n\nfunction verifyDependencies(controller) {\n var needs = get(controller, 'needs'),\n container = get(controller, 'container'),\n dependency, satisfied = true;\n\n for (var i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency.indexOf(':') === -1) {\n dependency = \"controller:\" + dependency;\n }\n\n if (!container.has(dependency)) {\n satisfied = false;\n Ember.assert(controller + \" needs \" + dependency + \" but it does not exist\", false);\n }\n }\n\n return satisfied;\n}\n\nEmber.ControllerMixin.reopen({\n concatenatedProperties: ['needs'],\n needs: [],\n\n init: function() {\n this._super.apply(this, arguments);\n\n // Structure asserts to still do verification but not string concat in production\n if(!verifyDependencies(this)) {\n Ember.assert(\"Missing dependencies\", false);\n }\n },\n\n controllerFor: function(controllerName) {\n Ember.deprecate(\"Controller#controllerFor is deprecated, please use Controller#needs instead\");\n var container = get(this, 'container');\n return container.lookup('controller:' + controllerName);\n },\n\n controllers: Ember.computed(function() {\n return ControllersProxy.create({ controller: this });\n })\n});\n\n})();\n//@ sourceURL=ember-application/ext/controller");minispade.register('ember-application', "(function() {minispade.require('ember-views');\nminispade.require('ember-routing');\nminispade.require('ember-application/system');\nminispade.require('ember-application/ext');\n\n/**\nEmber Application\n\n@module ember\n@submodule ember-application\n@requires ember-views, ember-states, ember-routing\n*/\n\n})();\n//@ sourceURL=ember-application");minispade.register('ember-application/system', "(function() {minispade.require('ember-application/system/dag');\nminispade.require('ember-application/system/application');\n\n})();\n//@ sourceURL=ember-application/system");minispade.register('ember-application/system/application', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get, set = Ember.set,\n classify = Ember.String.classify,\n capitalize = Ember.String.capitalize,\n decamelize = Ember.String.decamelize;\n\n/**\n An instance of `Ember.Application` is the starting point for every Ember\n application. It helps to instantiate, initialize and coordinate the many\n objects that make up your app.\n\n Each Ember app has one and only one `Ember.Application` object. In fact, the\n very first thing you should do in your application is create the instance:\n\n ```javascript\n window.App = Ember.Application.create();\n ```\n\n Typically, the application object is the only global variable. All other\n classes in your app should be properties on the `Ember.Application` instance,\n which highlights its first role: a global namespace.\n\n For example, if you define a view class, it might look like this:\n\n ```javascript\n App.MyView = Ember.View.extend();\n ```\n\n By default, calling `Ember.Application.create()` will automatically initialize\n your application by calling the `Ember.Application.initialize()` method. If\n you need to delay initialization, you can call your app's `deferReadiness()`\n method. When you are ready for your app to be initialized, call its\n `advanceReadiness()` method.\n\n You can define a `ready` method on the `Ember.Application` instance, which\n will be run by Ember when the application is initialized.\n\n Because `Ember.Application` inherits from `Ember.Namespace`, any classes\n you create will have useful string representations when calling `toString()`.\n See the `Ember.Namespace` documentation for more information.\n\n While you can think of your `Ember.Application` as a container that holds the\n other classes in your application, there are several other responsibilities\n going on under-the-hood that you may want to understand.\n\n ### Event Delegation\n\n Ember uses a technique called _event delegation_. This allows the framework\n to set up a global, shared event listener instead of requiring each view to\n do it manually. For example, instead of each view registering its own\n `mousedown` listener on its associated element, Ember sets up a `mousedown`\n listener on the `body`.\n\n If a `mousedown` event occurs, Ember will look at the target of the event and\n start walking up the DOM node tree, finding corresponding views and invoking\n their `mouseDown` method as it goes.\n\n `Ember.Application` has a number of default events that it listens for, as\n well as a mapping from lowercase events to camel-cased view method names. For\n example, the `keypress` event causes the `keyPress` method on the view to be\n called, the `dblclick` event causes `doubleClick` to be called, and so on.\n\n If there is a browser event that Ember does not listen for by default, you\n can specify custom events and their corresponding view method names by\n setting the application's `customEvents` property:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the loadedmetadata media\n // player event\n 'loadedmetadata': \"loadedMetadata\"\n }\n });\n ```\n\n By default, the application sets up these event listeners on the document\n body. However, in cases where you are embedding an Ember application inside\n an existing page, you may want it to set up the listeners on an element\n inside the body.\n\n For example, if only events inside a DOM element with the ID of `ember-app`\n should be delegated, set your application's `rootElement` property:\n\n ```javascript\n window.App = Ember.Application.create({\n rootElement: '#ember-app'\n });\n ```\n\n The `rootElement` can be either a DOM element or a jQuery-compatible selector\n string. Note that *views appended to the DOM outside the root element will\n not receive events.* If you specify a custom root element, make sure you only\n append views inside it!\n\n To learn more about the advantages of event delegation and the Ember view\n layer, and a list of the event listeners that are setup by default, visit the\n [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation).\n\n ### Initializers\n\n Libraries on top of Ember can register additional initializers, like so:\n\n ```javascript\n Ember.Application.initializer({\n name: \"store\",\n\n initialize: function(container, application) {\n container.register('store', 'main', application.Store);\n }\n });\n ```\n\n ### Routing\n\n In addition to creating your application's router, `Ember.Application` is\n also responsible for telling the router when to start routing. Transitions\n between routes can be logged with the LOG_TRANSITIONS flag:\n\n ```javascript\n window.App = Ember.Application.create({\n LOG_TRANSITIONS: true\n });\n ```\n\n By default, the router will begin trying to translate the current URL into\n application state once the browser emits the `DOMContentReady` event. If you\n need to defer routing, you can call the application's `deferReadiness()`\n method. Once routing can begin, call the `advanceReadiness()` method.\n\n If there is any setup required before routing begins, you can implement a\n `ready()` method on your app that will be invoked immediately before routing\n begins.\n\n To begin routing, you must have at a minimum a top-level controller and view.\n You define these as `App.ApplicationController` and `App.ApplicationView`,\n respectively. Your application will not work if you do not define these two\n mandatory classes. For example:\n\n ```javascript\n App.ApplicationView = Ember.View.extend({\n templateName: 'application'\n });\n App.ApplicationController = Ember.Controller.extend();\n ```\n\n @class Application\n @namespace Ember\n @extends Ember.Namespace\n*/\nvar Application = Ember.Application = Ember.Namespace.extend({\n\n /**\n The root DOM element of the Application. This can be specified as an\n element or a\n [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).\n\n This is the element that will be passed to the Application's,\n `eventDispatcher`, which sets up the listeners for event delegation. Every\n view in your application should be a child of the element you specify here.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n The `Ember.EventDispatcher` responsible for delegating events to this\n application's views.\n\n The event dispatcher is created by the application at initialization time\n and sets up event listeners on the DOM element described by the\n application's `rootElement` property.\n\n See the documentation for `Ember.EventDispatcher` for more information.\n\n @property eventDispatcher\n @type Ember.EventDispatcher\n @default null\n */\n eventDispatcher: null,\n\n /**\n The DOM events for which the event dispatcher should listen.\n\n By default, the application's `Ember.EventDispatcher` listens\n for a set of standard DOM events, such as `mousedown` and\n `keyup`, and delegates them to your application's `Ember.View`\n instances.\n\n If you would like additional events to be delegated to your\n views, set your `Ember.Application`'s `customEvents` property\n to a hash containing the DOM event name as the key and the\n corresponding view method name as the value. For example:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the loadedmetadata media\n // player event\n 'loadedmetadata': \"loadedMetadata\"\n }\n });\n ```\n\n @property customEvents\n @type Object\n @default null\n */\n customEvents: null,\n\n isInitialized: false,\n\n // Start off the number of deferrals at 1. This will be\n // decremented by the Application's own `initialize` method.\n _readinessDeferrals: 1,\n\n init: function() {\n if (!this.$) { this.$ = Ember.$; }\n this.__container__ = this.buildContainer();\n\n this.Router = this.Router || this.defaultRouter();\n if (this.Router) { this.Router.namespace = this; }\n\n this._super();\n\n if (!Ember.testing || Ember.testingDeferred) {\n this.scheduleInitialize();\n }\n\n if ( Ember.LOG_VERSION ) {\n Ember.LOG_VERSION = false; // we only need to see this once per Application#init\n Ember.debug('-------------------------------');\n Ember.debug('Ember.VERSION : ' + Ember.VERSION);\n Ember.debug('Handlebars.VERSION : ' + Ember.Handlebars.VERSION);\n Ember.debug('jQuery.VERSION : ' + Ember.$().jquery);\n Ember.debug('-------------------------------');\n }\n },\n\n /**\n @private\n\n Build the container for the current application.\n\n Also register a default application view in case the application\n itself does not.\n\n @method buildContainer\n @return {Ember.Container} the configured container\n */\n buildContainer: function() {\n var container = this.__container__ = Application.buildContainer(this);\n\n return container;\n },\n\n /**\n @private\n\n If the application has not opted out of routing and has not explicitly\n defined a router, supply a default router for the application author\n to configure.\n\n This allows application developers to do:\n\n ```javascript\n App = Ember.Application.create();\n\n App.Router.map(function(match) {\n match(\"/\").to(\"index\");\n });\n ```\n\n @method defaultRouter\n @return {Ember.Router} the default router\n */\n defaultRouter: function() {\n // Create a default App.Router if one was not supplied to make\n // it possible to do App.Router.map(...) without explicitly\n // creating a router first.\n if (this.router === undefined) {\n return Ember.Router.extend();\n }\n },\n\n /**\n @private\n\n Automatically initialize the application once the DOM has\n become ready.\n\n The initialization itself is scheduled on the actions queue\n which ensures that application loading finishes before\n booting.\n\n If you are asynchronously loading code, you should call\n `deferReadiness()` to defer booting, and then call\n `advanceReadiness()` once all of your code has finished\n loading.\n\n @method scheduleInitialize\n */\n scheduleInitialize: function() {\n var self = this;\n this.$().ready(function() {\n if (self.isDestroyed || self.isInitialized) { return; }\n Ember.run.schedule('actions', self, 'initialize');\n });\n },\n\n /**\n Use this to defer readiness until some condition is true.\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n App.deferReadiness();\n\n jQuery.getJSON(\"/auth-token\", function(token) {\n App.token = token;\n App.advanceReadiness();\n });\n ```\n\n This allows you to perform asynchronous setup logic and defer\n booting your application until the setup has finished.\n\n However, if the setup requires a loading UI, it might be better\n to use the router for this purpose.\n\n @method deferReadiness\n */\n deferReadiness: function() {\n Ember.assert(\"You cannot defer readiness since the `ready()` hook has already been called.\", this._readinessDeferrals > 0);\n this._readinessDeferrals++;\n },\n\n /**\n @method advanceReadiness\n @see {Ember.Application#deferReadiness}\n */\n advanceReadiness: function() {\n this._readinessDeferrals--;\n\n if (this._readinessDeferrals === 0) {\n Ember.run.once(this, this.didBecomeReady);\n }\n },\n\n /**\n registers a factory for later injection\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n\n App.Person = Ember.Object.extend({});\n App.Orange = Ember.Object.extend({});\n App.Email = Ember.Object.extend({});\n\n App.register('model:user', App.Person, {singleton: false });\n App.register('fruit:favorite', App.Orange);\n App.register('communication:main', App.Email, {singleton: false});\n ```\n\n @method register\n @param type {String}\n @param name {String}\n @param factory {String}\n @param options {String} (optional)\n **/\n register: function() {\n var container = this.__container__;\n container.register.apply(container, arguments);\n },\n /**\n defines an injection or typeInjection\n\n Example:\n\n ```javascript\n App.inject(<full_name or type>, <property name>, <full_name>)\n App.inject('model:user', 'email', 'model:email')\n App.inject('model', 'source', 'source:main')\n ```\n\n @method inject\n @param factoryNameOrType {String}\n @param property {String}\n @param injectionName {String}\n **/\n inject: function(){\n var container = this.__container__;\n container.injection.apply(container, arguments);\n },\n\n /**\n @private\n\n Initialize the application. This happens automatically.\n\n Run any initializers and run the application load hook. These hooks may\n choose to defer readiness. For example, an authentication hook might want\n to defer readiness until the auth token has been retrieved.\n\n @method initialize\n */\n initialize: function() {\n Ember.assert(\"Application initialize may only be called once\", !this.isInitialized);\n Ember.assert(\"Cannot initialize a destroyed application\", !this.isDestroyed);\n this.isInitialized = true;\n\n // At this point, the App.Router must already be assigned\n this.register('router', 'main', this.Router);\n\n this.runInitializers();\n Ember.runLoadHooks('application', this);\n\n // At this point, any initializers or load hooks that would have wanted\n // to defer readiness have fired. In general, advancing readiness here\n // will proceed to didBecomeReady.\n this.advanceReadiness();\n\n return this;\n },\n\n reset: function() {\n get(this, '__container__').destroy();\n this.buildContainer();\n\n this.isInitialized = false;\n this.initialize();\n this.startRouting();\n },\n\n /**\n @private\n @method runInitializers\n */\n runInitializers: function() {\n var initializers = get(this.constructor, 'initializers'),\n container = this.__container__,\n graph = new Ember.DAG(),\n namespace = this,\n i, initializer;\n\n for (i=0; i<initializers.length; i++) {\n initializer = initializers[i];\n graph.addEdges(initializer.name, initializer.initialize, initializer.before, initializer.after);\n }\n\n graph.topsort(function (vertex) {\n var initializer = vertex.value;\n Ember.assert(\"No application initializer named '\"+vertex.name+\"'\", initializer);\n initializer(container, namespace);\n });\n },\n\n /**\n @private\n @method didBecomeReady\n */\n didBecomeReady: function() {\n this.setupEventDispatcher();\n this.ready(); // user hook\n this.startRouting();\n\n if (!Ember.testing) {\n // Eagerly name all classes that are already loaded\n Ember.Namespace.processAll();\n Ember.BOOTED = true;\n }\n },\n\n /**\n @private\n\n Setup up the event dispatcher to receive events on the\n application's `rootElement` with any registered\n `customEvents`.\n\n @method setupEventDispatcher\n */\n setupEventDispatcher: function() {\n var eventDispatcher = this.createEventDispatcher(),\n customEvents = get(this, 'customEvents');\n\n eventDispatcher.setup(customEvents);\n },\n\n /**\n @private\n\n Create an event dispatcher for the application's `rootElement`.\n\n @method createEventDispatcher\n */\n createEventDispatcher: function() {\n var rootElement = get(this, 'rootElement'),\n eventDispatcher = Ember.EventDispatcher.create({\n rootElement: rootElement\n });\n\n set(this, 'eventDispatcher', eventDispatcher);\n return eventDispatcher;\n },\n\n /**\n @private\n\n If the application has a router, use it to route to the current URL, and\n trigger a new call to `route` whenever the URL changes.\n\n @method startRouting\n @property router {Ember.Router}\n */\n startRouting: function() {\n var router = this.__container__.lookup('router:main');\n if (!router) { return; }\n\n router.startRouting();\n },\n\n handleURL: function(url) {\n var router = this.__container__.lookup('router:main');\n\n router.handleURL(url);\n },\n\n /**\n Called when the Application has become ready.\n The call will be delayed until the DOM has become ready.\n\n @event ready\n */\n ready: Ember.K,\n\n willDestroy: function() {\n Ember.BOOTED = false;\n\n var eventDispatcher = get(this, 'eventDispatcher');\n if (eventDispatcher) { eventDispatcher.destroy(); }\n\n get(this, '__container__').destroy();\n },\n\n initializer: function(options) {\n this.constructor.initializer(options);\n }\n});\n\nEmber.Application.reopenClass({\n concatenatedProperties: ['initializers'],\n initializers: Ember.A(),\n initializer: function(initializer) {\n var initializers = get(this, 'initializers');\n\n Ember.assert(\"The initializer '\" + initializer.name + \"' has already been registered\", !initializers.findProperty('name', initializers.name));\n Ember.assert(\"An injection cannot be registered with both a before and an after\", !(initializer.before && initializer.after));\n Ember.assert(\"An injection cannot be registered without an injection function\", Ember.canInvoke(initializer, 'initialize'));\n\n initializers.push(initializer);\n },\n\n /**\n @private\n\n This creates a container with the default Ember naming conventions.\n\n It also configures the container:\n\n * registered views are created every time they are looked up (they are\n not singletons)\n * registered templates are not factories; the registered value is\n returned directly.\n * the router receives the application as its `namespace` property\n * all controllers receive the router as their `target` and `controllers`\n properties\n * all controllers receive the application as their `namespace` property\n * the application view receives the application controller as its\n `controller` property\n * the application view receives the application template as its\n `defaultTemplate` property\n\n @method buildContainer\n @static\n @param {Ember.Application} namespace the application to build the\n container for.\n @return {Ember.Container} the built container\n */\n buildContainer: function(namespace) {\n var container = new Ember.Container();\n Ember.Container.defaultContainer = Ember.Container.defaultContainer || container;\n\n container.set = Ember.set;\n container.normalize = normalize;\n container.resolver = resolverFor(namespace);\n container.optionsForType('view', { singleton: false });\n container.optionsForType('template', { instantiate: false });\n container.register('application', 'main', namespace, { instantiate: false });\n\n container.register('controller:basic', Ember.Controller, { instantiate: false });\n container.register('controller:object', Ember.ObjectController, { instantiate: false });\n container.register('controller:array', Ember.ArrayController, { instantiate: false });\n container.register('route:basic', Ember.Route, { instantiate: false });\n\n container.injection('router:main', 'namespace', 'application:main');\n\n container.typeInjection('controller', 'target', 'router:main');\n container.typeInjection('controller', 'namespace', 'application:main');\n\n container.typeInjection('route', 'router', 'router:main');\n\n return container;\n }\n});\n\n/**\n @private\n\n This function defines the default lookup rules for container lookups:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after classifying the name.\n For example, `controller:post` looks up `App.PostController` by default.\n * if the default lookup fails, look for registered classes on the container\n\n This allows the application to register default injections in the container\n that could be overridden by the normal naming convention.\n\n @param {Ember.Namespace} namespace the namespace to look for classes\n @return {any} the resolved value for a given lookup\n*/\nfunction resolverFor(namespace) {\n return function(fullName) {\n var nameParts = fullName.split(\":\"),\n type = nameParts[0], name = nameParts[1],\n root = namespace;\n\n if (type === 'template') {\n var templateName = name.replace(/\\./g, '/');\n\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n\n templateName = decamelize(templateName);\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n }\n\n if (type === 'controller' || type === 'route' || type === 'view') {\n name = name.replace(/\\./g, '_');\n if (name === 'basic') {\n name = '';\n }\n }\n\n if (type !== 'template' && name.indexOf('/') !== -1) {\n var parts = name.split('/');\n name = parts[parts.length - 1];\n var namespaceName = capitalize(parts.slice(0, -1).join('.'));\n root = Ember.Namespace.byName(namespaceName);\n\n Ember.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but it could not be found', root);\n }\n\n var className = classify(name) + classify(type);\n var factory = get(root, className);\n\n if (factory) { return factory; }\n };\n}\n\nfunction normalize(fullName) {\n var split = fullName.split(':'),\n type = split[0],\n name = split[1];\n\n\n if (type !== 'template') {\n var result = name;\n\n if (result.indexOf('.') > -1) {\n result = result.replace(/\\.(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n if (name.indexOf('_') > -1) {\n result = result.replace(/_(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n return type + ':' + result;\n } else {\n return fullName;\n }\n}\n\nEmber.runLoadHooks('Ember.Application', Ember.Application);\n\n})();\n//@ sourceURL=ember-application/system/application");minispade.register('ember-application/system/dag', "(function() {function visit(vertex, fn, visited, path) {\n var name = vertex.name,\n vertices = vertex.incoming,\n names = vertex.incomingNames,\n len = names.length,\n i;\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n}\n\nfunction DAG() {\n this.names = [];\n this.vertices = {};\n}\n\nDAG.prototype.add = function(name) {\n if (!name) { return; }\n if (this.vertices.hasOwnProperty(name)) {\n return this.vertices[name];\n }\n var vertex = {\n name: name, incoming: {}, incomingNames: [], hasOutgoing: false, value: null\n };\n this.vertices[name] = vertex;\n this.names.push(name);\n return vertex;\n};\n\nDAG.prototype.map = function(name, value) {\n this.add(name).value = value;\n};\n\nDAG.prototype.addEdge = function(fromName, toName) {\n if (!fromName || !toName || fromName === toName) {\n return;\n }\n var from = this.add(fromName), to = this.add(toName);\n if (to.incoming.hasOwnProperty(fromName)) {\n return;\n }\n function checkCycle(vertex, path) {\n if (vertex.name === toName) {\n throw new Error(\"cycle detected: \" + toName + \" <- \" + path.join(\" <- \"));\n }\n }\n visit(from, checkCycle);\n from.hasOutgoing = true;\n to.incoming[fromName] = from;\n to.incomingNames.push(fromName);\n};\n\nDAG.prototype.topsort = function(fn) {\n var visited = {},\n vertices = this.vertices,\n names = this.names,\n len = names.length,\n i, vertex;\n for (i = 0; i < len; i++) {\n vertex = vertices[names[i]];\n if (!vertex.hasOutgoing) {\n visit(vertex, fn, visited);\n }\n }\n};\n\nDAG.prototype.addEdges = function(name, value, before, after) {\n var i;\n this.map(name, value);\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n for (i = 0; i < before.length; i++) {\n this.addEdge(name, before[i]);\n }\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n for (i = 0; i < after.length; i++) {\n this.addEdge(after[i], name);\n }\n }\n }\n};\n\nEmber.DAG = DAG;\n\n})();\n//@ sourceURL=ember-application/system/dag");minispade.register('ember-debug', "(function() {/*global __fail__*/\n\n/**\nEmber Debug\n\n@module ember\n@submodule ember-debug\n*/\n\n/**\n@class Ember\n*/\n\nif ('undefined' === typeof Ember) {\n Ember = {};\n\n if ('undefined' !== typeof window) {\n window.Em = window.Ember = Em = Ember;\n }\n}\n\nEmber.ENV = 'undefined' === typeof ENV ? {} : ENV;\n\nif (!('MANDATORY_SETTER' in Ember.ENV)) {\n Ember.ENV.MANDATORY_SETTER = true; // default to true for debug dist\n}\n\n/**\n Define an assertion that will throw an exception if the condition is not\n met. Ember build tools will remove any calls to `Ember.assert()` when\n doing a production build. Example:\n\n ```javascript\n // Test for truthiness\n Ember.assert('Must pass a valid object', obj);\n // Fail unconditionally\n Ember.assert('This code path should never be run')\n ```\n\n @method assert\n @param {String} desc A description of the assertion. This will become\n the text of the Error thrown if the assertion fails.\n @param {Boolean} test Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.\n*/\nEmber.assert = function(desc, test) {\n if (!test) throw new Error(\"assertion failed: \"+desc);\n};\n\n\n/**\n Display a warning with the provided message. Ember build tools will\n remove any calls to `Ember.warn()` when doing a production build.\n\n @method warn\n @param {String} message A warning to display.\n @param {Boolean} test An optional boolean. If falsy, the warning\n will be displayed.\n*/\nEmber.warn = function(message, test) {\n if (!test) {\n Ember.Logger.warn(\"WARNING: \"+message);\n if ('trace' in Ember.Logger) Ember.Logger.trace();\n }\n};\n\n/**\n Display a debug notice. Ember build tools will remove any calls to\n `Ember.debug()` when doing a production build.\n\n ```javascript\n Ember.debug(\"I'm a debug notice!\");\n ```\n\n @method debug\n @param {String} message A debug message to display.\n*/\nEmber.debug = function(message) {\n Ember.Logger.debug(\"DEBUG: \"+message);\n};\n\n/**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only). Ember build tools will remove any calls to\n `Ember.deprecate()` when doing a production build.\n\n @method deprecate\n @param {String} message A description of the deprecation.\n @param {Boolean} test An optional boolean. If falsy, the deprecation\n will be displayed.\n*/\nEmber.deprecate = function(message, test) {\n if (Ember && Ember.TESTING_DEPRECATION) { return; }\n\n if (arguments.length === 1) { test = false; }\n if (test) { return; }\n\n if (Ember && Ember.ENV.RAISE_ON_DEPRECATION) { throw new Error(message); }\n\n var error;\n\n // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome\n try { __fail__.fail(); } catch (e) { error = e; }\n\n if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {\n var stack, stackStr = '';\n if (error['arguments']) {\n // Chrome\n stack = error.stack.replace(/^\\s+at\\s+/gm, '').\n replace(/^([^\\(]+?)([\\n$])/gm, '{anonymous}($1)$2').\n replace(/^Object.<anonymous>\\s*\\(([^\\)]+)\\)/gm, '{anonymous}($1)').split('\\n');\n stack.shift();\n } else {\n // Firefox\n stack = error.stack.replace(/(?:\\n@:0)?\\s+$/m, '').\n replace(/^\\(/gm, '{anonymous}(').split('\\n');\n }\n\n stackStr = \"\\n \" + stack.slice(2).join(\"\\n \");\n message = message + stackStr;\n }\n\n Ember.Logger.warn(\"DEPRECATION: \"+message);\n};\n\n\n\n/**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only) when the wrapped method is called.\n\n Ember build tools will not remove calls to `Ember.deprecateFunc()`, though\n no warnings will be shown in production.\n\n @method deprecateFunc\n @param {String} message A description of the deprecation.\n @param {Function} func The function to be deprecated.\n*/\nEmber.deprecateFunc = function(message, func) {\n return function() {\n Ember.deprecate(message);\n return func.apply(this, arguments);\n };\n};\n\n})();\n//@ sourceURL=ember-debug");minispade.register('ember-handlebars-compiler', "(function() {/**\n@module ember\n@submodule ember-handlebars-compiler\n*/\n\n// Eliminate dependency on any Ember to simplify precompilation workflow\nvar objectCreate = Object.create || function(parent) {\n function F() {}\n F.prototype = parent;\n return new F();\n};\n\nvar Handlebars = this.Handlebars || (Ember.imports && Ember.imports.Handlebars);\nif(!Handlebars && typeof require === 'function') {\n Handlebars = require('handlebars');\n}\n\nEmber.assert(\"Ember Handlebars requires Handlebars 1.0.0-rc.3 or greater\", Handlebars && Handlebars.VERSION.match(/^1\\.0\\.[0-9](\\.rc\\.[23456789]+)?/));\n\n/**\n Prepares the Handlebars templating library for use inside Ember's view\n system.\n\n The `Ember.Handlebars` object is the standard Handlebars library, extended to\n use Ember's `get()` method instead of direct property access, which allows\n computed properties to be used inside templates.\n\n To create an `Ember.Handlebars` template, call `Ember.Handlebars.compile()`.\n This will return a function that can be used by `Ember.View` for rendering.\n\n @class Handlebars\n @namespace Ember\n*/\nEmber.Handlebars = objectCreate(Handlebars);\n\n/**\n@class helpers\n@namespace Ember.Handlebars\n*/\nEmber.Handlebars.helpers = objectCreate(Handlebars.helpers);\n\n/**\n Override the the opcode compiler and JavaScript compiler for Handlebars.\n\n @class Compiler\n @namespace Ember.Handlebars\n @private\n @constructor\n*/\nEmber.Handlebars.Compiler = function() {};\n\n// Handlebars.Compiler doesn't exist in runtime-only\nif (Handlebars.Compiler) {\n Ember.Handlebars.Compiler.prototype = objectCreate(Handlebars.Compiler.prototype);\n}\n\nEmber.Handlebars.Compiler.prototype.compiler = Ember.Handlebars.Compiler;\n\n/**\n @class JavaScriptCompiler\n @namespace Ember.Handlebars\n @private\n @constructor\n*/\nEmber.Handlebars.JavaScriptCompiler = function() {};\n\n// Handlebars.JavaScriptCompiler doesn't exist in runtime-only\nif (Handlebars.JavaScriptCompiler) {\n Ember.Handlebars.JavaScriptCompiler.prototype = objectCreate(Handlebars.JavaScriptCompiler.prototype);\n Ember.Handlebars.JavaScriptCompiler.prototype.compiler = Ember.Handlebars.JavaScriptCompiler;\n}\n\n\nEmber.Handlebars.JavaScriptCompiler.prototype.namespace = \"Ember.Handlebars\";\n\n\nEmber.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {\n return \"''\";\n};\n\n/**\n @private\n\n Override the default buffer for Ember Handlebars. By default, Handlebars\n creates an empty String at the beginning of each invocation and appends to\n it. Ember's Handlebars overrides this to append to a single shared buffer.\n\n @method appendToBuffer\n @param string {String}\n*/\nEmber.Handlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {\n return \"data.buffer.push(\"+string+\");\";\n};\n\nvar prefix = \"ember\" + (+new Date()), incr = 1;\n\n/**\n @private\n\n Rewrite simple mustaches from `{{foo}}` to `{{bind \"foo\"}}`. This means that\n all simple mustaches in Ember's Handlebars will also set up an observer to\n keep the DOM up to date when the underlying property changes.\n\n @method mustache\n @for Ember.Handlebars.Compiler\n @param mustache\n*/\nEmber.Handlebars.Compiler.prototype.mustache = function(mustache) {\n if (mustache.isHelper && mustache.id.string === 'control') {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"controlID\", new Handlebars.AST.StringNode(prefix + incr++)]);\n } else if (mustache.params.length || mustache.hash) {\n // no changes required\n } else {\n var id = new Handlebars.AST.IdNode(['_triageMustache']);\n\n // Update the mustache node to include a hash value indicating whether the original node\n // was escaped. This will allow us to properly escape values when the underlying value\n // changes and we need to re-render the value.\n if(!mustache.escaped) {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"unescaped\", new Handlebars.AST.StringNode(\"true\")]);\n }\n mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);\n }\n\n return Handlebars.Compiler.prototype.mustache.call(this, mustache);\n};\n\n/**\n Used for precompilation of Ember Handlebars templates. This will not be used\n during normal app execution.\n\n @method precompile\n @for Ember.Handlebars\n @static\n @param {String} string The template to precompile\n*/\nEmber.Handlebars.precompile = function(string) {\n var ast = Handlebars.parse(string);\n\n var options = {\n knownHelpers: {\n action: true,\n unbound: true,\n bindAttr: true,\n template: true,\n view: true,\n _triageMustache: true\n },\n data: true,\n stringParams: true\n };\n\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n};\n\n// We don't support this for Handlebars runtime-only\nif (Handlebars.compile) {\n /**\n The entry point for Ember Handlebars. This replaces the default\n `Handlebars.compile` and turns on template-local data and String\n parameters.\n\n @method compile\n @for Ember.Handlebars\n @static\n @param {String} string The template to compile\n @return {Function}\n */\n Ember.Handlebars.compile = function(string) {\n var ast = Handlebars.parse(string);\n var options = { data: true, stringParams: true };\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n var templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n\n return Ember.Handlebars.template(templateSpec);\n };\n}\n\n\n})();\n//@ sourceURL=ember-handlebars-compiler");minispade.register('ember-handlebars/controls', "(function() {minispade.require(\"ember-handlebars/controls/checkbox\");\nminispade.require(\"ember-handlebars/controls/text_field\");\nminispade.require(\"ember-handlebars/controls/button\");\nminispade.require(\"ember-handlebars/controls/text_area\");\nminispade.require(\"ember-handlebars/controls/select\");\n\n})();\n//@ sourceURL=ember-handlebars/controls");minispade.register('ember-handlebars/controls/button', "(function() {minispade.require('ember-runtime/mixins/target_action_support');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n @class Button\n @namespace Ember\n @extends Ember.View\n @uses Ember.TargetActionSupport\n @deprecated\n*/\nEmber.Button = Ember.View.extend(Ember.TargetActionSupport, {\n classNames: ['ember-button'],\n classNameBindings: ['isActive'],\n\n tagName: 'button',\n\n propagateEvents: false,\n\n attributeBindings: ['type', 'disabled', 'href', 'tabindex'],\n\n /**\n @private\n\n Overrides `TargetActionSupport`'s `targetObject` computed\n property to use Handlebars-specific path resolution.\n\n @property targetObject\n */\n targetObject: Ember.computed(function() {\n var target = get(this, 'target'),\n root = get(this, 'context'),\n data = get(this, 'templateData');\n\n if (typeof target !== 'string') { return target; }\n\n return Ember.Handlebars.get(root, target, { data: data });\n }).property('target'),\n\n // Defaults to 'button' if tagName is 'input' or 'button'\n type: Ember.computed(function(key) {\n var tagName = this.tagName;\n if (tagName === 'input' || tagName === 'button') { return 'button'; }\n }),\n\n disabled: false,\n\n // Allow 'a' tags to act like buttons\n href: Ember.computed(function() {\n return this.tagName === 'a' ? '#' : null;\n }),\n\n mouseDown: function() {\n if (!get(this, 'disabled')) {\n set(this, 'isActive', true);\n this._mouseDown = true;\n this._mouseEntered = true;\n }\n return get(this, 'propagateEvents');\n },\n\n mouseLeave: function() {\n if (this._mouseDown) {\n set(this, 'isActive', false);\n this._mouseEntered = false;\n }\n },\n\n mouseEnter: function() {\n if (this._mouseDown) {\n set(this, 'isActive', true);\n this._mouseEntered = true;\n }\n },\n\n mouseUp: function(event) {\n if (get(this, 'isActive')) {\n // Actually invoke the button's target and action.\n // This method comes from the Ember.TargetActionSupport mixin.\n this.triggerAction();\n set(this, 'isActive', false);\n }\n\n this._mouseDown = false;\n this._mouseEntered = false;\n return get(this, 'propagateEvents');\n },\n\n keyDown: function(event) {\n // Handle space or enter\n if (event.keyCode === 13 || event.keyCode === 32) {\n this.mouseDown();\n }\n },\n\n keyUp: function(event) {\n // Handle space or enter\n if (event.keyCode === 13 || event.keyCode === 32) {\n this.mouseUp();\n }\n },\n\n // TODO: Handle proper touch behavior. Including should make inactive when\n // finger moves more than 20x outside of the edge of the button (vs mouse\n // which goes inactive as soon as mouse goes out of edges.)\n\n touchStart: function(touch) {\n return this.mouseDown(touch);\n },\n\n touchEnd: function(touch) {\n return this.mouseUp(touch);\n },\n\n init: function() {\n Ember.deprecate(\"Ember.Button is deprecated and will be removed from future releases. Consider using the `{{action}}` helper.\");\n this._super();\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/button");minispade.register('ember-handlebars/controls/checkbox', "(function() {minispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/ext\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set, get = Ember.get;\n\n/**\n The `Ember.Checkbox` view class renders a checkbox\n [input](https://developer.mozilla.org/en/HTML/Element/Input) element. It\n allows for binding an Ember property (`checked`) to the status of the\n checkbox.\n\n Example:\n\n ```handlebars\n {{view Ember.Checkbox checkedBinding=\"receiveEmail\"}}\n ```\n\n You can add a `label` tag yourself in the template where the `Ember.Checkbox`\n is being used.\n\n ```html\n <label>\n {{view Ember.Checkbox classNames=\"applicaton-specific-checkbox\"}}\n Some Title\n </label>\n ```\n\n The `checked` attribute of an `Ember.Checkbox` object should always be set\n through the Ember object or by interacting with its rendered element\n representation via the mouse, keyboard, or touch. Updating the value of the\n checkbox via jQuery will result in the checked value of the object and its\n element losing synchronization.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See `Ember.View`'s layout section for more\n information.\n\n @class Checkbox\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Checkbox = Ember.View.extend({\n classNames: ['ember-checkbox'],\n\n tagName: 'input',\n\n attributeBindings: ['type', 'checked', 'disabled', 'tabindex'],\n\n type: \"checkbox\",\n checked: false,\n disabled: false,\n\n init: function() {\n this._super();\n this.on(\"change\", this, this._updateElementValue);\n },\n\n _updateElementValue: function() {\n set(this, 'checked', this.$().prop('checked'));\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/checkbox");minispade.register('ember-handlebars/controls/select', "(function() {/*jshint eqeqeq:false */\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set,\n get = Ember.get,\n indexOf = Ember.EnumerableUtils.indexOf,\n indexesOf = Ember.EnumerableUtils.indexesOf,\n replace = Ember.EnumerableUtils.replace,\n isArray = Ember.isArray,\n precompileTemplate = Ember.Handlebars.compile;\n\n/**\n The `Ember.Select` view class renders a\n [select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,\n allowing the user to choose from a list of options.\n\n The text and `value` property of each `<option>` element within the\n `<select>` element are populated from the objects in the `Element.Select`'s\n `content` property. The underlying data object of the selected `<option>` is\n stored in the `Element.Select`'s `value` property.\n\n ### `content` as an array of Strings\n\n The simplest version of an `Ember.Select` takes an array of strings as its\n `content` property. The string will be used as both the `value` property and\n the inner text of each `<option>` element inside the rendered `<select>`.\n\n Example:\n\n ```javascript\n App.names = [\"Yehuda\", \"Tom\"];\n ```\n\n ```handlebars\n {{view Ember.Select contentBinding=\"App.names\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n You can control which `<option>` is selected through the `Ember.Select`'s\n `value` property directly or as a binding:\n\n ```javascript\n App.names = Ember.Object.create({\n selected: 'Tom',\n content: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.names.content\"\n valueBinding=\"App.names.selected\"\n }}\n ```\n\n Would result in the following HTML with the `<option>` for 'Tom' selected:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n A user interacting with the rendered `<select>` to choose \"Yehuda\" would\n update the value of `App.names.selected` to \"Yehuda\".\n\n ### `content` as an Array of Objects\n\n An `Ember.Select` can also take an array of JavaScript or Ember objects as\n its `content` property.\n\n When using objects you need to tell the `Ember.Select` which property should\n be accessed on each object to supply the `value` attribute of the `<option>`\n and which property should be used to supply the element text.\n\n The `optionValuePath` option is used to specify the path on each object to\n the desired property for the `value` attribute. The `optionLabelPath`\n specifies the path on each object to the desired property for the\n element's text. Both paths must reference each object itself as `content`:\n\n ```javascript\n App.programmers = [\n Ember.Object.create({firstName: \"Yehuda\", id: 1}),\n Ember.Object.create({firstName: \"Tom\", id: 2})\n ];\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.programmers\"\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value>Please Select</option>\n <option value=\"1\">Yehuda</option>\n <option value=\"2\">Tom</option>\n </select>\n ```\n\n The `value` attribute of the selected `<option>` within an `Ember.Select`\n can be bound to a property on another object by providing a\n `valueBinding` option:\n\n ```javascript\n App.programmers = [\n Ember.Object.create({firstName: \"Yehuda\", id: 1}),\n Ember.Object.create({firstName: \"Tom\", id: 2})\n ];\n\n App.currentProgrammer = Ember.Object.create({\n id: 2\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.programmers\"\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n valueBinding=\"App.currentProgrammer.id\"}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value>Please Select</option>\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `id` value of `App.currentProgrammer`\n to match the `value` property of the newly selected `<option>`.\n\n Alternatively, you can control selection through the underlying objects\n used to render each object providing a `selectionBinding`. When the selected\n `<option>` is changed, the property path provided to `selectionBinding`\n will be updated to match the content object of the rendered `<option>`\n element:\n\n ```javascript\n App.controller = Ember.Object.create({\n selectedPerson: null,\n content: [\n Ember.Object.create({firstName: \"Yehuda\", id: 1}),\n Ember.Object.create({firstName: \"Tom\", id: 2})\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.controller.content\"\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n selectionBinding=\"App.controller.selectedPerson\"}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value>Please Select</option>\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `selectedPerson` value of `App.controller`\n to match the content object of the newly selected `<option>`. In this\n case it is the first object in the `App.content.content`\n\n ### Supplying a Prompt\n\n A `null` value for the `Ember.Select`'s `value` or `selection` property\n results in there being no `<option>` with a `selected` attribute:\n\n ```javascript\n App.controller = Ember.Object.create({\n selected: null,\n content: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ``` handlebars\n {{view Ember.Select\n contentBinding=\"App.controller.content\"\n valueBinding=\"App.controller.selected\"\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n Although `App.controller.selected` is `null` and no `<option>`\n has a `selected` attribute the rendered HTML will display the\n first item as though it were selected. You can supply a string\n value for the `Ember.Select` to display when there is no selection\n with the `prompt` option:\n\n ```javascript\n App.controller = Ember.Object.create({\n selected: null,\n content: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.controller.content\"\n valueBinding=\"App.controller.selected\"\n prompt=\"Please select a name\"\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option>Please select a name</option>\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n @class Select\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Select = Ember.View.extend(\n /** @scope Ember.Select.prototype */ {\n\n tagName: 'select',\n classNames: ['ember-select'],\n defaultTemplate: precompileTemplate('{{#if view.prompt}}<option value=\"\">{{view.prompt}}</option>{{/if}}{{#each view.content}}{{view Ember.SelectOption contentBinding=\"this\"}}{{/each}}'),\n attributeBindings: ['multiple', 'disabled', 'tabindex'],\n\n /**\n The `multiple` attribute of the select element. Indicates whether multiple\n options can be selected.\n\n @property multiple\n @type Boolean\n @default false\n */\n multiple: false,\n\n disabled: false,\n\n /**\n The list of options.\n\n If `optionLabelPath` and `optionValuePath` are not overridden, this should\n be a list of strings, which will serve simultaneously as labels and values.\n\n Otherwise, this should be a list of objects. For instance:\n\n ```javascript\n Ember.Select.create({\n content: Ember.A([\n { id: 1, firstName: 'Yehuda' },\n { id: 2, firstName: 'Tom' }\n ]),\n optionLabelPath: 'content.firstName',\n optionValuePath: 'content.id'\n });\n ```\n\n @property content\n @type Array\n @default null\n */\n content: null,\n\n /**\n When `multiple` is `false`, the element of `content` that is currently\n selected, if any.\n\n When `multiple` is `true`, an array of such elements.\n\n @property selection\n @type Object or Array\n @default null\n */\n selection: null,\n\n /**\n In single selection mode (when `multiple` is `false`), value can be used to\n get the current selection's value or set the selection by it's value.\n\n It is not currently supported in multiple selection mode.\n\n @property value\n @type String\n @default null\n */\n value: Ember.computed(function(key, value) {\n if (arguments.length === 2) { return value; }\n var valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, '');\n return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection');\n }).property('selection'),\n\n /**\n If given, a top-most dummy option will be rendered to serve as a user\n prompt.\n\n @property prompt\n @type String\n @default null\n */\n prompt: null,\n\n /**\n The path of the option labels. See `content`.\n\n @property optionLabelPath\n @type String\n @default 'content'\n */\n optionLabelPath: 'content',\n\n /**\n The path of the option values. See `content`.\n\n @property optionValuePath\n @type String\n @default 'content'\n */\n optionValuePath: 'content',\n\n _change: function() {\n if (get(this, 'multiple')) {\n this._changeMultiple();\n } else {\n this._changeSingle();\n }\n },\n\n selectionDidChange: Ember.observer(function() {\n var selection = get(this, 'selection');\n if (get(this, 'multiple')) {\n if (!isArray(selection)) {\n set(this, 'selection', Ember.A([selection]));\n return;\n }\n this._selectionDidChangeMultiple();\n } else {\n this._selectionDidChangeSingle();\n }\n }, 'selection.@each'),\n\n valueDidChange: Ember.observer(function() {\n var content = get(this, 'content'),\n value = get(this, 'value'),\n valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, ''),\n selectedValue = (valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection')),\n selection;\n\n if (value !== selectedValue) {\n selection = content.find(function(obj) {\n return value === (valuePath ? get(obj, valuePath) : obj);\n });\n\n this.set('selection', selection);\n }\n }, 'value'),\n\n\n _triggerChange: function() {\n var selection = get(this, 'selection');\n var value = get(this, 'value');\n\n if (selection) { this.selectionDidChange(); }\n if (value) { this.valueDidChange(); }\n\n this._change();\n },\n\n _changeSingle: function() {\n var selectedIndex = this.$()[0].selectedIndex,\n content = get(this, 'content'),\n prompt = get(this, 'prompt');\n\n if (!get(content, 'length')) { return; }\n if (prompt && selectedIndex === 0) { set(this, 'selection', null); return; }\n\n if (prompt) { selectedIndex -= 1; }\n set(this, 'selection', content.objectAt(selectedIndex));\n },\n\n\n _changeMultiple: function() {\n var options = this.$('option:selected'),\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n content = get(this, 'content'),\n selection = get(this, 'selection');\n\n if (!content){ return; }\n if (options) {\n var selectedIndexes = options.map(function(){\n return this.index - offset;\n }).toArray();\n var newSelection = content.objectsAt(selectedIndexes);\n\n if (isArray(selection)) {\n replace(selection, 0, get(selection, 'length'), newSelection);\n } else {\n set(this, 'selection', newSelection);\n }\n }\n },\n\n _selectionDidChangeSingle: function() {\n var el = this.get('element');\n if (!el) { return; }\n\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectionIndex = content ? indexOf(content, selection) : -1,\n prompt = get(this, 'prompt');\n\n if (prompt) { selectionIndex += 1; }\n if (el) { el.selectedIndex = selectionIndex; }\n },\n\n _selectionDidChangeMultiple: function() {\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectedIndexes = content ? indexesOf(content, selection) : [-1],\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n options = this.$('option'),\n adjusted;\n\n if (options) {\n options.each(function() {\n adjusted = this.index > -1 ? this.index - offset : -1;\n this.selected = indexOf(selectedIndexes, adjusted) > -1;\n });\n }\n },\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._triggerChange);\n this.on(\"change\", this, this._change);\n }\n});\n\nEmber.SelectOption = Ember.View.extend({\n tagName: 'option',\n attributeBindings: ['value', 'selected'],\n\n defaultTemplate: function(context, options) {\n options = { data: options.data, hash: {} };\n Ember.Handlebars.helpers.bind.call(context, \"view.label\", options);\n },\n\n init: function() {\n this.labelPathDidChange();\n this.valuePathDidChange();\n\n this._super();\n },\n\n selected: Ember.computed(function() {\n var content = get(this, 'content'),\n selection = get(this, 'parentView.selection');\n if (get(this, 'parentView.multiple')) {\n return selection && indexOf(selection, content.valueOf()) > -1;\n } else {\n // Primitives get passed through bindings as objects... since\n // `new Number(4) !== 4`, we use `==` below\n return content == selection;\n }\n }).property('content', 'parentView.selection').volatile(),\n\n labelPathDidChange: Ember.observer(function() {\n var labelPath = get(this, 'parentView.optionLabelPath');\n\n if (!labelPath) { return; }\n\n Ember.defineProperty(this, 'label', Ember.computed(function() {\n return get(this, labelPath);\n }).property(labelPath));\n }, 'parentView.optionLabelPath'),\n\n valuePathDidChange: Ember.observer(function() {\n var valuePath = get(this, 'parentView.optionValuePath');\n\n if (!valuePath) { return; }\n\n Ember.defineProperty(this, 'value', Ember.computed(function() {\n return get(this, valuePath);\n }).property(valuePath));\n }, 'parentView.optionValuePath')\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/select");minispade.register('ember-handlebars/controls/text_area', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/controls/text_support\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.TextArea` view class renders a\n [textarea](https://developer.mozilla.org/en/HTML/Element/textarea) element.\n It allows for binding Ember properties to the text area contents (`value`),\n live-updating as the user inputs text.\n\n ## Layout and LayoutName properties\n\n Because HTML `textarea` elements do not contain inner HTML the `layout` and\n `layoutName` properties will not be applied. See `Ember.View`'s layout\n section for more information.\n\n ## HTML Attributes\n\n By default `Ember.TextArea` provides support for `rows`, `cols`,\n `placeholder`, `disabled`, `maxlength` and `tabindex` attributes on a\n textarea. If you need to support more attributes have a look at the\n `attributeBindings` property in `Ember.View`'s HTML Attributes section.\n\n To globally add support for additional attributes you can reopen\n `Ember.TextArea` or `Ember.TextSupport`.\n\n ```javascript\n Ember.TextSupport.reopen({\n attributeBindings: [\"required\"]\n })\n ```\n\n @class TextArea\n @namespace Ember\n @extends Ember.View\n @uses Ember.TextSupport\n*/\nEmber.TextArea = Ember.View.extend(Ember.TextSupport, {\n classNames: ['ember-text-area'],\n\n tagName: \"textarea\",\n attributeBindings: ['rows', 'cols'],\n rows: null,\n cols: null,\n\n _updateElementValue: Ember.observer(function() {\n // We do this check so cursor position doesn't get affected in IE\n var value = get(this, 'value'),\n $el = this.$();\n if ($el && value !== $el.val()) {\n $el.val(value);\n }\n }, 'value'),\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._updateElementValue);\n }\n\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_area");minispade.register('ember-handlebars/controls/text_field', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/controls/text_support\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.TextField` view class renders a text\n [input](https://developer.mozilla.org/en/HTML/Element/Input) element. It\n allows for binding Ember properties to the text field contents (`value`),\n live-updating as the user inputs text.\n\n Example:\n\n ```handlebars\n {{view Ember.TextField valueBinding=\"firstName\"}}\n ```\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See `Ember.View`'s layout section for more\n information.\n\n ## HTML Attributes\n\n By default `Ember.TextField` provides support for `type`, `value`, `size`,\n `placeholder`, `disabled`, `maxlength` and `tabindex` attributes on a\n test field. If you need to support more attributes have a look at the\n `attributeBindings` property in `Ember.View`'s HTML Attributes section.\n\n To globally add support for additional attributes you can reopen\n `Ember.TextField` or `Ember.TextSupport`.\n\n ```javascript\n Ember.TextSupport.reopen({\n attributeBindings: [\"required\"]\n })\n ```\n\n @class TextField\n @namespace Ember\n @extends Ember.View\n @uses Ember.TextSupport\n*/\nEmber.TextField = Ember.View.extend(Ember.TextSupport,\n /** @scope Ember.TextField.prototype */ {\n\n classNames: ['ember-text-field'],\n tagName: \"input\",\n attributeBindings: ['type', 'value', 'size', 'pattern'],\n\n /**\n The `value` attribute of the input element. As the user inputs text, this\n property is updated live.\n\n @property value\n @type String\n @default \"\"\n */\n value: \"\",\n\n /**\n The `type` attribute of the input element.\n\n @property type\n @type String\n @default \"text\"\n */\n type: \"text\",\n\n /**\n The `size` of the text field in characters.\n\n @property size\n @type String\n @default null\n */\n size: null,\n\n /**\n The `pattern` the pattern attribute of input element.\n\n @property pattern\n @type String\n @default null\n */\n pattern: null,\n\n /**\n The action to be sent when the user presses the return key.\n\n This is similar to the `{{action}}` helper, but is fired when\n the user presses the return key when editing a text field, and sends\n the value of the field as the context.\n\n @property action\n @type String\n @default null\n */\n action: null,\n\n /**\n Whether they `keyUp` event that triggers an `action` to be sent continues\n propagating to other views.\n\n By default, when the user presses the return key on their keyboard and\n the text field has an `action` set, the action will be sent to the view's\n controller and the key event will stop propagating.\n\n If you would like parent views to receive the `keyUp` event even after an\n action has been dispatched, set `bubbles` to true.\n\n @property bubbles\n @type Boolean\n @default false\n */\n bubbles: false,\n\n insertNewline: function(event) {\n var controller = get(this, 'controller'),\n action = get(this, 'action');\n\n if (action) {\n controller.send(action, get(this, 'value'), this);\n\n if (!get(this, 'bubbles')) {\n event.stopPropagation();\n }\n }\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_field");minispade.register('ember-handlebars/controls/text_support', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Shared mixin used by `Ember.TextField` and `Ember.TextArea`.\n\n @class TextSupport\n @namespace Ember\n @extends Ember.Mixin\n @private\n*/\nEmber.TextSupport = Ember.Mixin.create({\n value: \"\",\n\n attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex'],\n placeholder: null,\n disabled: false,\n maxlength: null,\n\n insertNewline: Ember.K,\n cancel: Ember.K,\n\n init: function() {\n this._super();\n this.on(\"focusOut\", this, this._elementValueDidChange);\n this.on(\"change\", this, this._elementValueDidChange);\n this.on(\"paste\", this, this._elementValueDidChange);\n this.on(\"cut\", this, this._elementValueDidChange);\n this.on(\"input\", this, this._elementValueDidChange);\n this.on(\"keyUp\", this, this.interpretKeyEvents);\n },\n\n interpretKeyEvents: function(event) {\n var map = Ember.TextSupport.KEY_EVENTS;\n var method = map[event.keyCode];\n\n this._elementValueDidChange();\n if (method) { return this[method](event); }\n },\n\n _elementValueDidChange: function() {\n set(this, 'value', this.$().val());\n }\n\n});\n\nEmber.TextSupport.KEY_EVENTS = {\n 13: 'insertNewline',\n 27: 'cancel'\n};\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_support");minispade.register('ember-handlebars/ext', "(function() {minispade.require('ember-handlebars-compiler');\n\nvar slice = Array.prototype.slice;\n\n/**\n @private\n\n If a path starts with a reserved keyword, returns the root\n that should be used.\n\n @method normalizePath\n @for Ember\n @param root {Object}\n @param path {String}\n @param data {Hash}\n*/\nvar normalizePath = Ember.Handlebars.normalizePath = function(root, path, data) {\n var keywords = (data && data.keywords) || {},\n keyword, isKeyword;\n\n // Get the first segment of the path. For example, if the\n // path is \"foo.bar.baz\", returns \"foo\".\n keyword = path.split('.', 1)[0];\n\n // Test to see if the first path is a keyword that has been\n // passed along in the view's data hash. If so, we will treat\n // that object as the new root.\n if (keywords.hasOwnProperty(keyword)) {\n // Look up the value in the template's data hash.\n root = keywords[keyword];\n isKeyword = true;\n\n // Handle cases where the entire path is the reserved\n // word. In that case, return the object itself.\n if (path === keyword) {\n path = '';\n } else {\n // Strip the keyword from the path and look up\n // the remainder from the newly found root.\n path = path.substr(keyword.length+1);\n }\n }\n\n return { root: root, path: path, isKeyword: isKeyword };\n};\n\n\n/**\n Lookup both on root and on window. If the path starts with\n a keyword, the corresponding object will be looked up in the\n template's data hash and used to resolve the path.\n\n @method get\n @for Ember.Handlebars\n @param {Object} root The object to look up the property on\n @param {String} path The path to be lookedup\n @param {Object} options The template's option hash\n*/\nvar handlebarsGet = Ember.Handlebars.get = function(root, path, options) {\n var data = options && options.data,\n normalizedPath = normalizePath(root, path, data),\n value;\n\n // In cases where the path begins with a keyword, change the\n // root to the value represented by that keyword, and ensure\n // the path is relative to it.\n root = normalizedPath.root;\n path = normalizedPath.path;\n\n value = Ember.get(root, path);\n\n // If the path starts with a capital letter, look it up on Ember.lookup,\n // which defaults to the `window` object in browsers.\n if (value === undefined && root !== Ember.lookup && Ember.isGlobalPath(path)) {\n value = Ember.get(Ember.lookup, path);\n }\n return value;\n};\nEmber.Handlebars.getPath = Ember.deprecateFunc('`Ember.Handlebars.getPath` has been changed to `Ember.Handlebars.get` for consistency.', Ember.Handlebars.get);\n\nEmber.Handlebars.resolveParams = function(context, params, options) {\n var resolvedParams = [], types = options.types, param, type;\n\n for (var i=0, l=params.length; i<l; i++) {\n param = params[i];\n type = types[i];\n\n if (type === 'ID') {\n resolvedParams.push(handlebarsGet(context, param, options));\n } else {\n resolvedParams.push(param);\n }\n }\n\n return resolvedParams;\n};\n\nEmber.Handlebars.resolveHash = function(context, hash, options) {\n var resolvedHash = {}, types = options.hashTypes, type;\n\n for (var key in hash) {\n if (!hash.hasOwnProperty(key)) { continue; }\n\n type = types[key];\n\n if (type === 'ID') {\n resolvedHash[key] = handlebarsGet(context, hash[key], options);\n } else {\n resolvedHash[key] = hash[key];\n }\n }\n\n return resolvedHash;\n};\n\n/**\n @private\n\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('helperMissing', function(path, options) {\n var error, view = \"\";\n\n error = \"%@ Handlebars error: Could not find property '%@' on object %@.\";\n if (options.data){\n view = options.data.view;\n }\n throw new Ember.Error(Ember.String.fmt(error, [view, path, this]));\n});\n\n/**\n Register a bound handlebars helper. Bound helpers behave similarly to regular\n handlebars helpers, with the added ability to re-render when the underlying data\n changes.\n\n ## Simple example\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalize', function(value) {\n return value.toUpperCase();\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n ## Example with options\n\n Like normal handlebars helpers, bound helpers have access to the options\n passed into the helper call.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('repeat', function(value, options) {\n var count = options.hash.count;\n var a = [];\n while(a.length < count){\n a.push(value);\n }\n return a.join('');\n });\n ```\n\n This helper could be used in a template as follows:\n\n ```handlebars\n {{repeat text count=3}}\n ```\n\n ## Example with bound options\n\n Bound hash options are also supported. Example:\n\n ```handlebars\n {{repeat text countBinding=\"numRepeats\"}}\n ```\n\n In this example, count will be bound to the value of\n the `numRepeats` property on the context. If that property\n changes, the helper will be re-rendered.\n\n ## Example with extra dependencies\n\n The `Ember.Handlebars.registerBoundHelper` method takes a variable length\n third parameter which indicates extra dependencies on the passed in value.\n This allows the handlebars helper to update when these dependencies change.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalizeName', function(value) {\n return value.get('name').toUpperCase();\n }, 'name');\n ```\n\n ## Example with multiple bound properties\n\n `Ember.Handlebars.registerBoundHelper` supports binding to\n multiple properties, e.g.:\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('concatenate', function() {\n var values = arguments[arguments.length - 1];\n return values.join('||');\n });\n ```\n\n Which allows for template syntax such as {{concatenate prop1 prop2}} or\n {{concatenate prop1 prop2 prop3}}. If any of the properties change,\n the helpr will re-render. Note that dependency keys cannot be\n using in conjunction with multi-property helpers, since it is ambiguous\n which property the dependent keys would belong to.\n\n ## Use with unbound helper\n\n The {{unbound}} helper can be used with bound helper invocations\n to render them in their unbound form, e.g.\n\n ```handlebars\n {{unbound capitalize name}}\n ```\n\n In this example, if the name property changes, the helper\n will not re-render.\n\n\n @method registerBoundHelper\n @for Ember.Handlebars\n @param {String} name\n @param {Function} function\n @param {String} dependentKeys*\n*/\nEmber.Handlebars.registerBoundHelper = function(name, fn) {\n var dependentKeys = slice.call(arguments, 2);\n\n function helper() {\n var properties = slice.call(arguments, 0, -1),\n numProperties = properties.length,\n options = arguments[arguments.length - 1],\n normalizedProperties = [],\n data = options.data,\n hash = options.hash,\n view = data.view,\n currentContext = (options.contexts && options.contexts[0]) || this,\n normalized,\n pathRoot, path,\n loc, hashOption;\n\n // Detect bound options (e.g. countBinding=\"otherCount\")\n hash.boundOptions = {};\n for (hashOption in hash) {\n if (!hash.hasOwnProperty(hashOption)) { continue; }\n\n if (Ember.IS_BINDING.test(hashOption) && typeof hash[hashOption] === 'string') {\n // Lop off 'Binding' suffix.\n hash.boundOptions[hashOption.slice(0, -7)] = hash[hashOption];\n }\n }\n\n // Expose property names on data.properties object.\n data.properties = [];\n for (loc = 0; loc < numProperties; ++loc) {\n data.properties.push(properties[loc]);\n normalizedProperties.push(normalizePath(currentContext, properties[loc], data));\n }\n\n if (data.isUnbound) {\n return evaluateUnboundHelper(this, fn, normalizedProperties, options);\n }\n\n if (dependentKeys.length === 0) {\n return evaluateMultiPropertyBoundHelper(currentContext, fn, normalizedProperties, options);\n }\n\n Ember.assert(\"Dependent keys can only be used with single-property helpers.\", properties.length === 1);\n\n normalized = normalizedProperties[0];\n\n pathRoot = normalized.root;\n path = normalized.path;\n\n var bindView = new Ember._SimpleHandlebarsView(\n path, pathRoot, !options.hash.unescaped, options.data\n );\n\n bindView.normalizedValue = function() {\n var value = Ember._SimpleHandlebarsView.prototype.normalizedValue.call(bindView);\n return fn.call(view, value, options);\n };\n\n view.appendChild(bindView);\n\n view.registerObserver(pathRoot, path, bindView, rerenderBoundHelperView);\n\n for (var i=0, l=dependentKeys.length; i<l; i++) {\n view.registerObserver(pathRoot, path + '.' + dependentKeys[i], bindView, rerenderBoundHelperView);\n }\n }\n\n helper._rawFunction = fn;\n Ember.Handlebars.registerHelper(name, helper);\n};\n\n/**\n @private\n\n Renders the unbound form of an otherwise bound helper function.\n\n @param {Function} fn\n @param {Object} context\n @param {Array} normalizedProperties\n @param {String} options\n*/\nfunction evaluateMultiPropertyBoundHelper(context, fn, normalizedProperties, options) {\n var numProperties = normalizedProperties.length,\n self = this,\n data = options.data,\n view = data.view,\n hash = options.hash,\n boundOptions = hash.boundOptions,\n watchedProperties,\n boundOption, bindView, loc, property, len;\n\n bindView = new Ember._SimpleHandlebarsView(null, null, !hash.unescaped, data);\n bindView.normalizedValue = function() {\n var args = [], value, boundOption;\n\n // Copy over bound options.\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n property = normalizePath(context, boundOptions[boundOption], data);\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n hash[boundOption] = Ember._SimpleHandlebarsView.prototype.normalizedValue.call(bindView);\n }\n\n for (loc = 0; loc < numProperties; ++loc) {\n property = normalizedProperties[loc];\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n args.push(Ember._SimpleHandlebarsView.prototype.normalizedValue.call(bindView));\n }\n args.push(options);\n return fn.apply(context, args);\n };\n\n view.appendChild(bindView);\n\n // Assemble liast of watched properties that'll re-render this helper.\n watchedProperties = [];\n for (boundOption in boundOptions) {\n if (boundOptions.hasOwnProperty(boundOption)) {\n watchedProperties.push(normalizePath(context, boundOptions[boundOption], data));\n }\n }\n watchedProperties = watchedProperties.concat(normalizedProperties);\n\n // Observe each property.\n for (loc = 0, len = watchedProperties.length; loc < len; ++loc) {\n property = watchedProperties[loc];\n view.registerObserver(property.root, property.path, bindView, rerenderBoundHelperView);\n }\n\n}\n\n/**\n @private\n\n An observer function used with bound helpers which\n will schedule a re-render of the _SimpleHandlebarsView\n connected with the helper.\n*/\nfunction rerenderBoundHelperView() {\n Ember.run.scheduleOnce('render', this, 'rerender');\n}\n\n/**\n @private\n\n Renders the unbound form of an otherwise bound helper function.\n\n @param {Function} fn\n @param {Object} context\n @param {Array} normalizedProperties\n @param {String} options\n*/\nfunction evaluateUnboundHelper(context, fn, normalizedProperties, options) {\n var args = [], hash = options.hash, boundOptions = hash.boundOptions, loc, len, property, boundOption;\n\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n hash[boundOption] = Ember.Handlebars.get(context, boundOptions[boundOption], options);\n }\n\n for(loc = 0, len = normalizedProperties.length; loc < len; ++loc) {\n property = normalizedProperties[loc];\n args.push(Ember.Handlebars.get(context, property.path, options));\n }\n args.push(options);\n return fn.apply(context, args);\n}\n\n/**\n @private\n\n Overrides Handlebars.template so that we can distinguish\n user-created, top-level templates from inner contexts.\n\n @method template\n @for Ember.Handlebars\n @param {String} template spec\n*/\nEmber.Handlebars.template = function(spec){\n var t = Handlebars.template(spec);\n t.isTop = true;\n return t;\n};\n\n\n})();\n//@ sourceURL=ember-handlebars/ext");minispade.register('ember-handlebars/helpers', "(function() {minispade.require(\"ember-handlebars/helpers/shared\");\nminispade.require(\"ember-handlebars/helpers/binding\");\nminispade.require(\"ember-handlebars/helpers/collection\");\nminispade.require(\"ember-handlebars/helpers/view\");\nminispade.require(\"ember-handlebars/helpers/unbound\");\nminispade.require(\"ember-handlebars/helpers/debug\");\nminispade.require(\"ember-handlebars/helpers/each\");\nminispade.require(\"ember-handlebars/helpers/template\");\nminispade.require(\"ember-handlebars/helpers/partial\");\nminispade.require(\"ember-handlebars/helpers/yield\");\n\n})();\n//@ sourceURL=ember-handlebars/helpers");minispade.register('ember-handlebars/helpers/binding', "(function() {minispade.require('ember-handlebars/ext');\nminispade.require('ember-handlebars/views/handlebars_bound_view');\nminispade.require('ember-handlebars/views/metamorph_view');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\nvar handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\nvar forEach = Ember.ArrayPolyfills.forEach;\n\nvar EmberHandlebars = Ember.Handlebars, helpers = EmberHandlebars.helpers;\n\n// Binds a property into the DOM. This will create a hook in DOM that the\n// KVO system will look for and update if the property changes.\nfunction bind(property, options, preserveContext, shouldDisplay, valueNormalizer, childProperties) {\n var data = options.data,\n fn = options.fn,\n inverse = options.inverse,\n view = data.view,\n currentContext = this,\n normalized, observer, i;\n\n normalized = normalizePath(currentContext, property, data);\n\n // Set up observers for observable objects\n if ('object' === typeof this) {\n if (data.insideGroup) {\n observer = function() {\n Ember.run.once(view, 'rerender');\n };\n\n var template, context, result = handlebarsGet(currentContext, property, options);\n\n result = valueNormalizer(result);\n\n context = preserveContext ? currentContext : result;\n if (shouldDisplay(result)) {\n template = fn;\n } else if (inverse) {\n template = inverse;\n }\n\n template(context, { data: options.data });\n } else {\n // Create the view that will wrap the output of this template/property\n // and add it to the nearest view's childViews array.\n // See the documentation of Ember._HandlebarsBoundView for more.\n var bindView = view.createChildView(Ember._HandlebarsBoundView, {\n preserveContext: preserveContext,\n shouldDisplayFunc: shouldDisplay,\n valueNormalizerFunc: valueNormalizer,\n displayTemplate: fn,\n inverseTemplate: inverse,\n path: property,\n pathRoot: currentContext,\n previousContext: currentContext,\n isEscaped: !options.hash.unescaped,\n templateData: options.data\n });\n\n view.appendChild(bindView);\n\n observer = function() {\n Ember.run.scheduleOnce('render', bindView, 'rerenderIfNeeded');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n if (childProperties) {\n for (i=0; i<childProperties.length; i++) {\n view.registerObserver(normalized.root, normalized.path+'.'+childProperties[i], observer);\n }\n }\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n data.buffer.push(handlebarsGet(currentContext, property, options));\n }\n}\n\nfunction simpleBind(property, options) {\n var data = options.data,\n view = data.view,\n currentContext = this,\n normalized, observer;\n\n normalized = normalizePath(currentContext, property, data);\n\n // Set up observers for observable objects\n if ('object' === typeof this) {\n if (data.insideGroup) {\n observer = function() {\n Ember.run.once(view, 'rerender');\n };\n\n var result = handlebarsGet(currentContext, property, options);\n if (result === null || result === undefined) { result = \"\"; }\n data.buffer.push(result);\n } else {\n var bindView = new Ember._SimpleHandlebarsView(\n property, currentContext, !options.hash.unescaped, options.data\n );\n\n bindView._parentView = view;\n view.appendChild(bindView);\n\n observer = function() {\n Ember.run.scheduleOnce('render', bindView, 'rerender');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n data.buffer.push(handlebarsGet(currentContext, property, options));\n }\n}\n\n/**\n @private\n\n '_triageMustache' is used internally select between a binding and helper for\n the given context. Until this point, it would be hard to determine if the\n mustache is a property reference or a regular helper reference. This triage\n helper resolves that.\n\n This would not be typically invoked by directly.\n\n @method _triageMustache\n @for Ember.Handlebars.helpers\n @param {String} property Property/helperID to triage\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('_triageMustache', function(property, fn) {\n Ember.assert(\"You cannot pass more than one argument to the _triageMustache helper\", arguments.length <= 2);\n if (helpers[property]) {\n return helpers[property].call(this, fn);\n }\n else {\n return helpers.bind.apply(this, arguments);\n }\n});\n\n/**\n @private\n\n `bind` can be used to display a value, then update that value if it\n changes. For example, if you wanted to print the `title` property of\n `content`:\n\n ```handlebars\n {{bind \"content.title\"}}\n ```\n\n This will return the `title` property as a string, then create a new observer\n at the specified path. If it changes, it will update the value in DOM. Note\n that if you need to support IE7 and IE8 you must modify the model objects\n properties using `Ember.get()` and `Ember.set()` for this to work as it\n relies on Ember's KVO system. For all other browsers this will be handled for\n you automatically.\n\n @method bind\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bind', function(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the bind helper\", arguments.length <= 2);\n\n var context = (options.contexts && options.contexts[0]) || this;\n\n if (!options.fn) {\n return simpleBind.call(context, property, options);\n }\n\n return bind.call(context, property, options, false, function(result) {\n return !Ember.isNone(result);\n });\n});\n\n/**\n @private\n\n Use the `boundIf` helper to create a conditional that re-evaluates\n whenever the truthiness of the bound value changes.\n\n ```handlebars\n {{#boundIf \"content.shouldDisplayTitle\"}}\n {{content.title}}\n {{/boundIf}}\n ```\n\n @method boundIf\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('boundIf', function(property, fn) {\n var context = (fn.contexts && fn.contexts[0]) || this;\n var func = function(result) {\n var truthy = result && get(result, 'isTruthy');\n if (typeof truthy === 'boolean') { return truthy; }\n\n if (Ember.isArray(result)) {\n return get(result, 'length') !== 0;\n } else {\n return !!result;\n }\n };\n\n return bind.call(context, property, fn, true, func, func, ['isTruthy', 'length']);\n});\n\n/**\n @method with\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('with', function(context, options) {\n if (arguments.length === 4) {\n var keywordName, path, rootPath, normalized;\n\n Ember.assert(\"If you pass more than one argument to the with helper, it must be in the form #with foo as bar\", arguments[1] === \"as\");\n options = arguments[3];\n keywordName = arguments[2];\n path = arguments[0];\n\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n if (Ember.isGlobalPath(path)) {\n Ember.bind(options.data.keywords, keywordName, path);\n } else {\n normalized = normalizePath(this, path, options.data);\n path = normalized.path;\n rootPath = normalized.root;\n\n // This is a workaround for the fact that you cannot bind separate objects\n // together. When we implement that functionality, we should use it here.\n var contextKey = Ember.$.expando + Ember.guidFor(rootPath);\n options.data.keywords[contextKey] = rootPath;\n\n // if the path is '' (\"this\"), just bind directly to the current context\n var contextPath = path ? contextKey + '.' + path : contextKey;\n Ember.bind(options.data.keywords, keywordName, contextPath);\n }\n\n return bind.call(this, path, options, true, function(result) {\n return !Ember.isNone(result);\n });\n } else {\n Ember.assert(\"You must pass exactly one argument to the with helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n return helpers.bind.call(options.contexts[0], context, options);\n }\n});\n\n\n/**\n See `boundIf`\n\n @method if\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('if', function(context, options) {\n Ember.assert(\"You must pass exactly one argument to the if helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the if helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n return helpers.boundIf.call(options.contexts[0], context, options);\n});\n\n/**\n @method unless\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('unless', function(context, options) {\n Ember.assert(\"You must pass exactly one argument to the unless helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the unless helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n var fn = options.fn, inverse = options.inverse;\n\n options.fn = inverse;\n options.inverse = fn;\n\n return helpers.boundIf.call(options.contexts[0], context, options);\n});\n\n/**\n `bindAttr` allows you to create a binding between DOM element attributes and\n Ember objects. For example:\n\n ```handlebars\n <img {{bindAttr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n The above handlebars template will fill the `<img>`'s `src` attribute will\n the value of the property referenced with `\"imageUrl\"` and its `alt`\n attribute with the value of the property referenced with `\"imageTitle\"`.\n\n If the rendering context of this template is the following object:\n\n ```javascript\n {\n imageUrl: 'http://lolcats.info/haz-a-funny',\n imageTitle: 'A humorous image of a cat'\n }\n ```\n\n The resulting HTML output will be:\n\n ```html\n <img src=\"http://lolcats.info/haz-a-funny\" alt=\"A humorous image of a cat\">\n ```\n\n `bindAttr` cannot redeclare existing DOM element attributes. The use of `src`\n in the following `bindAttr` example will be ignored and the hard coded value\n of `src=\"/failwhale.gif\"` will take precedence:\n\n ```handlebars\n <img src=\"/failwhale.gif\" {{bindAttr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n ### `bindAttr` and the `class` attribute\n\n `bindAttr` supports a special syntax for handling a number of cases unique\n to the `class` DOM element attribute. The `class` attribute combines\n multiple discreet values into a single attribute as a space-delimited\n list of strings. Each string can be:\n\n * a string return value of an object's property.\n * a boolean return value of an object's property\n * a hard-coded value\n\n A string return value works identically to other uses of `bindAttr`. The\n return value of the property will become the value of the attribute. For\n example, the following view and template:\n\n ```javascript\n AView = Ember.View.extend({\n someProperty: function(){\n return \"aValue\";\n }.property()\n })\n ```\n\n ```handlebars\n <img {{bindAttr class=\"view.someProperty}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"aValue\">\n ```\n\n A boolean return value will insert a specified class name if the property\n returns `true` and remove the class name if the property returns `false`.\n\n A class name is provided via the syntax\n `somePropertyName:class-name-if-true`.\n\n ```javascript\n AView = Ember.View.extend({\n someBool: true\n })\n ```\n\n ```handlebars\n <img {{bindAttr class=\"view.someBool:class-name-if-true\"}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"class-name-if-true\">\n ```\n\n An additional section of the binding can be provided if you want to\n replace the existing class instead of removing it when the boolean\n value changes:\n\n ```handlebars\n <img {{bindAttr class=\"view.someBool:class-name-if-true:class-name-if-false\"}}>\n ```\n\n A hard-coded value can be used by prepending `:` to the desired\n class name: `:class-name-to-always-apply`.\n\n ```handlebars\n <img {{bindAttr class=\":class-name-to-always-apply\"}}>\n ```\n\n Results in the following rendered output:\n\n ```html\n <img class=\":class-name-to-always-apply\">\n ```\n\n All three strategies - string return value, boolean return value, and\n hard-coded value – can be combined in a single declaration:\n\n ```handlebars\n <img {{bindAttr class=\":class-name-to-always-apply view.someBool:class-name-if-true view.someProperty\"}}>\n ```\n\n @method bindAttr\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bindAttr', function(options) {\n\n var attrs = options.hash;\n\n Ember.assert(\"You must specify at least one hash argument to bindAttr\", !!Ember.keys(attrs).length);\n\n var view = options.data.view;\n var ret = [];\n var ctx = this;\n\n // Generate a unique id for this element. This will be added as a\n // data attribute to the element so it can be looked up when\n // the bound property changes.\n var dataId = ++Ember.uuid;\n\n // Handle classes differently, as we can bind multiple classes\n var classBindings = attrs['class'];\n if (classBindings !== null && classBindings !== undefined) {\n var classResults = EmberHandlebars.bindClasses(this, classBindings, view, dataId, options);\n\n ret.push('class=\"' + Handlebars.Utils.escapeExpression(classResults.join(' ')) + '\"');\n delete attrs['class'];\n }\n\n var attrKeys = Ember.keys(attrs);\n\n // For each attribute passed, create an observer and emit the\n // current value of the property as an attribute.\n forEach.call(attrKeys, function(attr) {\n var path = attrs[attr],\n normalized;\n\n Ember.assert(fmt(\"You must provide a String for a bound attribute, not %@\", [path]), typeof path === 'string');\n\n normalized = normalizePath(ctx, path, options.data);\n\n var value = (path === 'this') ? normalized.root : handlebarsGet(ctx, path, options),\n type = Ember.typeOf(value);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [value]), value === null || value === undefined || type === 'number' || type === 'string' || type === 'boolean');\n\n var observer, invoker;\n\n observer = function observer() {\n var result = handlebarsGet(ctx, path, options);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [result]), result === null || result === undefined || typeof result === 'number' || typeof result === 'string' || typeof result === 'boolean');\n\n var elem = view.$(\"[data-bindattr-\" + dataId + \"='\" + dataId + \"']\");\n\n // If we aren't able to find the element, it means the element\n // to which we were bound has been removed from the view.\n // In that case, we can assume the template has been re-rendered\n // and we need to clean up the observer.\n if (!elem || elem.length === 0) {\n Ember.removeObserver(normalized.root, normalized.path, invoker);\n return;\n }\n\n Ember.View.applyAttributeBindings(elem, attr, result);\n };\n\n invoker = function() {\n Ember.run.scheduleOnce('render', observer);\n };\n\n // Add an observer to the view for when the property changes.\n // When the observer fires, find the element using the\n // unique data id and update the attribute to the new value.\n // Note: don't add observer when path is 'this' or path\n // is whole keyword e.g. {{#each x in list}} ... {{bindAttr attr=\"x\"}}\n if (path !== 'this' && !(normalized.isKeyword && normalized.path === '' )) {\n view.registerObserver(normalized.root, normalized.path, invoker);\n }\n\n // if this changes, also change the logic in ember-views/lib/views/view.js\n if ((type === 'string' || (type === 'number' && !isNaN(value)))) {\n ret.push(attr + '=\"' + Handlebars.Utils.escapeExpression(value) + '\"');\n } else if (value && type === 'boolean') {\n // The developer controls the attr name, so it should always be safe\n ret.push(attr + '=\"' + attr + '\"');\n }\n }, this);\n\n // Add the unique identifier\n // NOTE: We use all lower-case since Firefox has problems with mixed case in SVG\n ret.push('data-bindattr-' + dataId + '=\"' + dataId + '\"');\n return new EmberHandlebars.SafeString(ret.join(' '));\n});\n\n/**\n @private\n\n Helper that, given a space-separated string of property paths and a context,\n returns an array of class names. Calling this method also has the side\n effect of setting up observers at those property paths, such that if they\n change, the correct class name will be reapplied to the DOM element.\n\n For example, if you pass the string \"fooBar\", it will first look up the\n \"fooBar\" value of the context. If that value is true, it will add the\n \"foo-bar\" class to the current element (i.e., the dasherized form of\n \"fooBar\"). If the value is a string, it will add that string as the class.\n Otherwise, it will not add any new class name.\n\n @method bindClasses\n @for Ember.Handlebars\n @param {Ember.Object} context The context from which to lookup properties\n @param {String} classBindings A string, space-separated, of class bindings\n to use\n @param {Ember.View} view The view in which observers should look for the\n element to update\n @param {Srting} bindAttrId Optional bindAttr id used to lookup elements\n @return {Array} An array of class names to add\n*/\nEmberHandlebars.bindClasses = function(context, classBindings, view, bindAttrId, options) {\n var ret = [], newClass, value, elem;\n\n // Helper method to retrieve the property from the context and\n // determine which class string to return, based on whether it is\n // a Boolean or not.\n var classStringForPath = function(root, parsedPath, options) {\n var val,\n path = parsedPath.path;\n\n if (path === 'this') {\n val = root;\n } else if (path === '') {\n val = true;\n } else {\n val = handlebarsGet(root, path, options);\n }\n\n return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n };\n\n // For each property passed, loop through and setup\n // an observer.\n forEach.call(classBindings.split(' '), function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n\n var observer, invoker;\n\n var parsedPath = Ember.View._parsePropertyPath(binding),\n path = parsedPath.path,\n pathRoot = context,\n normalized;\n\n if (path !== '' && path !== 'this') {\n normalized = normalizePath(context, path, options.data);\n\n pathRoot = normalized.root;\n path = normalized.path;\n }\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n observer = function() {\n // Get the current value of the property\n newClass = classStringForPath(context, parsedPath, options);\n elem = bindAttrId ? view.$(\"[data-bindattr-\" + bindAttrId + \"='\" + bindAttrId + \"']\") : view.$();\n\n // If we can't find the element anymore, a parent template has been\n // re-rendered and we've been nuked. Remove the observer.\n if (!elem || elem.length === 0) {\n Ember.removeObserver(pathRoot, path, invoker);\n } else {\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n }\n };\n\n invoker = function() {\n Ember.run.scheduleOnce('render', observer);\n };\n\n if (path !== '' && path !== 'this') {\n view.registerObserver(pathRoot, path, invoker);\n }\n\n // We've already setup the observer; now we just need to figure out the\n // correct behavior right now on the first pass through.\n value = classStringForPath(context, parsedPath, options);\n\n if (value) {\n ret.push(value);\n\n // Make sure we save the current value so that it can be removed if the\n // observer fires.\n oldClass = value;\n }\n });\n\n return ret;\n};\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/binding");minispade.register('ember-handlebars/helpers/collection', "(function() {/*globals Handlebars */\n\n// TODO: Don't require all of this module\nminispade.require('ember-handlebars');\nminispade.require('ember-handlebars/helpers/view');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, handlebarsGet = Ember.Handlebars.get, fmt = Ember.String.fmt;\n\n/**\n `{{collection}}` is a `Ember.Handlebars` helper for adding instances of\n `Ember.CollectionView` to a template. See `Ember.CollectionView` for\n additional information on how a `CollectionView` functions.\n\n `{{collection}}`'s primary use is as a block helper with a `contentBinding`\n option pointing towards an `Ember.Array`-compatible object. An `Ember.View`\n instance will be created for each item in its `content` property. Each view\n will have its own `content` property set to the appropriate item in the\n collection.\n\n The provided block will be applied as the template for each item's view.\n\n Given an empty `<body>` the following template:\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n And the following application code\n\n ```javascript\n App = Ember.Application.create()\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Hi Dave</div>\n <div class=\"ember-view\">Hi Mary</div>\n <div class=\"ember-view\">Hi Sara</div>\n </div>\n ```\n\n ### Blockless Use\n\n If you provide an `itemViewClass` option that has its own `template` you can\n omit the block.\n\n The following template:\n\n ```handlebars\n {{collection contentBinding=\"App.items\" itemViewClass=\"App.AnItemView\"}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create();\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ];\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{view.content.name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n ### Specifying a CollectionView subclass\n\n By default the `{{collection}}` helper will create an instance of\n `Ember.CollectionView`. You can supply a `Ember.CollectionView` subclass to\n the helper by passing it as the first argument:\n\n ```handlebars\n {{#collection App.MyCustomCollectionClass contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n ### Forwarded `item.*`-named Options\n\n As with the `{{view}}`, helper options passed to the `{{collection}}` will be\n set on the resulting `Ember.CollectionView` as properties. Additionally,\n options prefixed with `item` will be applied to the views rendered for each\n item (note the camelcasing):\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"\n itemTagName=\"p\"\n itemClassNames=\"greeting\"}}\n Howdy {{view.content.name}}\n {{/collection}}\n ```\n\n Will result in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <p class=\"ember-view greeting\">Howdy Dave</p>\n <p class=\"ember-view greeting\">Howdy Mary</p>\n <p class=\"ember-view greeting\">Howdy Sara</p>\n </div>\n ```\n\n @method collection\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n @deprecated Use `{{each}}` helper instead.\n*/\nEmber.Handlebars.registerHelper('collection', function(path, options) {\n Ember.deprecate(\"Using the {{collection}} helper without specifying a class has been deprecated as the {{each}} helper now supports the same functionality.\", path !== 'collection');\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = undefined;\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 1);\n } else {\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 2);\n }\n\n var fn = options.fn;\n var data = options.data;\n var inverse = options.inverse;\n var view = options.data.view;\n\n // If passed a path string, convert that into an object.\n // Otherwise, just default to the standard class.\n var collectionClass;\n collectionClass = path ? handlebarsGet(this, path, options) : Ember.CollectionView;\n Ember.assert(fmt(\"%@ #collection: Could not find collection class %@\", [data.view, path]), !!collectionClass);\n\n var hash = options.hash, itemHash = {}, match;\n\n // Extract item view class if provided else default to the standard class\n var itemViewClass, itemViewPath = hash.itemViewClass;\n var collectionPrototype = collectionClass.proto();\n delete hash.itemViewClass;\n itemViewClass = itemViewPath ? handlebarsGet(collectionPrototype, itemViewPath, options) : collectionPrototype.itemViewClass;\n Ember.assert(fmt(\"%@ #collection: Could not find itemViewClass %@\", [data.view, itemViewPath]), !!itemViewClass);\n\n // Go through options passed to the {{collection}} helper and extract options\n // that configure item views instead of the collection itself.\n for (var prop in hash) {\n if (hash.hasOwnProperty(prop)) {\n match = prop.match(/^item(.)(.*)$/);\n\n if(match && prop !== 'itemController') {\n // Convert itemShouldFoo -> shouldFoo\n itemHash[match[1].toLowerCase() + match[2]] = hash[prop];\n // Delete from hash as this will end up getting passed to the\n // {{view}} helper method.\n delete hash[prop];\n }\n }\n }\n\n var tagName = hash.tagName || collectionPrototype.tagName;\n\n if (fn) {\n itemHash.template = fn;\n delete options.fn;\n }\n\n var emptyViewClass;\n if (inverse && inverse !== Handlebars.VM.noop) {\n emptyViewClass = get(collectionPrototype, 'emptyViewClass');\n emptyViewClass = emptyViewClass.extend({\n template: inverse,\n tagName: itemHash.tagName\n });\n } else if (hash.emptyViewClass) {\n emptyViewClass = handlebarsGet(this, hash.emptyViewClass, options);\n }\n if (emptyViewClass) { hash.emptyView = emptyViewClass; }\n\n if(!hash.keyword){\n itemHash._context = Ember.computed.alias('content');\n }\n\n var viewString = view.toString();\n\n var viewOptions = Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);\n hash.itemViewClass = itemViewClass.extend(viewOptions);\n\n return Ember.Handlebars.helpers.view.call(this, collectionClass, options);\n});\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/collection");minispade.register('ember-handlebars/helpers/debug', "(function() {/*jshint debug:true*/\nminispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\n\n/**\n `log` allows you to output the value of a value in the current rendering\n context.\n\n ```handlebars\n {{log myVariable}}\n ```\n\n @method log\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('log', function(property, options) {\n var context = (options.contexts && options.contexts[0]) || this,\n normalized = normalizePath(context, property, options.data),\n pathRoot = normalized.root,\n path = normalized.path,\n value = (path === 'this') ? pathRoot : handlebarsGet(pathRoot, path, options);\n Ember.Logger.log(value);\n});\n\n/**\n Execute the `debugger` statement in the current context.\n\n ```handlebars\n {{debugger}}\n ```\n\n @method debugger\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('debugger', function() {\n debugger;\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/debug");minispade.register('ember-handlebars/helpers/each', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/collection_view\");\nminispade.require(\"ember-handlebars/views/metamorph_view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, {\n init: function() {\n var itemController = get(this, 'itemController');\n var binding;\n\n if (itemController) {\n var controller = Ember.ArrayController.create();\n set(controller, 'itemController', itemController);\n set(controller, 'container', get(this, 'controller.container'));\n set(controller, '_eachView', this);\n set(controller, 'target', get(this, 'controller'));\n\n this.disableContentObservers(function() {\n set(this, 'content', controller);\n binding = new Ember.Binding('content', '_eachView.dataSource').oneWay();\n binding.connect(controller);\n });\n\n set(this, '_arrayController', controller);\n } else {\n this.disableContentObservers(function() {\n binding = new Ember.Binding('content', 'dataSource').oneWay();\n binding.connect(this);\n });\n }\n\n return this._super();\n },\n\n disableContentObservers: function(callback) {\n Ember.removeBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.removeObserver(this, 'content', null, '_contentDidChange');\n\n callback.apply(this);\n\n Ember.addBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.addObserver(this, 'content', null, '_contentDidChange');\n },\n\n itemViewClass: Ember._MetamorphView,\n emptyViewClass: Ember._MetamorphView,\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n // At the moment, if a container view subclass wants\n // to insert keywords, it is responsible for cloning\n // the keywords hash. This will be fixed momentarily.\n var keyword = get(this, 'keyword');\n var content = get(view, 'content');\n\n if (keyword) {\n var data = get(view, 'templateData');\n\n data = Ember.copy(data);\n data.keywords = view.cloneKeywords();\n set(view, 'templateData', data);\n\n // In this case, we do not bind, because the `content` of\n // a #each item cannot change.\n data.keywords[keyword] = content;\n }\n\n // If {{#each}} is looping over an array of controllers,\n // point each child view at their respective controller.\n if (content && get(content, 'isController')) {\n set(view, 'controller', content);\n }\n\n return view;\n },\n\n willDestroy: function() {\n var arrayController = get(this, '_arrayController');\n\n if (arrayController) {\n arrayController.destroy();\n }\n\n return this._super();\n }\n});\n\nvar GroupedEach = Ember.Handlebars.GroupedEach = function(context, path, options) {\n var self = this,\n normalized = Ember.Handlebars.normalizePath(context, path, options.data);\n\n this.context = context;\n this.path = path;\n this.options = options;\n this.template = options.fn;\n this.containingView = options.data.view;\n this.normalizedRoot = normalized.root;\n this.normalizedPath = normalized.path;\n this.content = this.lookupContent();\n\n this.addContentObservers();\n this.addArrayObservers();\n\n this.containingView.on('willClearRender', function() {\n self.destroy();\n });\n};\n\nGroupedEach.prototype = {\n contentWillChange: function() {\n this.removeArrayObservers();\n },\n\n contentDidChange: function() {\n this.content = this.lookupContent();\n this.addArrayObservers();\n this.rerenderContainingView();\n },\n\n contentArrayWillChange: Ember.K,\n\n contentArrayDidChange: function() {\n this.rerenderContainingView();\n },\n\n lookupContent: function() {\n return Ember.Handlebars.get(this.normalizedRoot, this.normalizedPath, this.options);\n },\n\n addArrayObservers: function() {\n this.content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n removeArrayObservers: function() {\n this.content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n addContentObservers: function() {\n Ember.addBeforeObserver(this.normalizedRoot, this.normalizedPath, this, this.contentWillChange);\n Ember.addObserver(this.normalizedRoot, this.normalizedPath, this, this.contentDidChange);\n },\n\n removeContentObservers: function() {\n Ember.removeBeforeObserver(this.normalizedRoot, this.normalizedPath, this.contentWillChange);\n Ember.removeObserver(this.normalizedRoot, this.normalizedPath, this.contentDidChange);\n },\n\n render: function() {\n var content = this.content,\n contentLength = get(content, 'length'),\n data = this.options.data,\n template = this.template;\n\n data.insideEach = true;\n for (var i = 0; i < contentLength; i++) {\n template(content.objectAt(i), { data: data });\n }\n },\n\n rerenderContainingView: function() {\n Ember.run.scheduleOnce('render', this.containingView, 'rerender');\n },\n\n destroy: function() {\n this.removeContentObservers();\n this.removeArrayObservers();\n }\n};\n\n/**\n The `{{#each}}` helper loops over elements in a collection, rendering its\n block once for each item. It is an extension of the base Handlebars `{{#each}}`\n helper:\n\n ```javascript\n Developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}];\n ```\n\n ```handlebars\n {{#each Developers}}\n {{name}}\n {{/each}}\n ```\n\n `{{each}}` supports an alternative syntax with element naming:\n\n ```handlebars\n {{#each person in Developers}}\n {{person.name}}\n {{/each}}\n ```\n\n When looping over objects that do not have properties, `{{this}}` can be used\n to render the object:\n\n ```javascript\n DeveloperNames = ['Yehuda', 'Tom', 'Paul']\n ```\n\n ```handlebars\n {{#each DeveloperNames}}\n {{this}}\n {{/each}}\n ```\n ### {{else}} condition\n `{{#each}}` can have a matching `{{else}}`. The contents of this block will render\n if the collection is empty.\n\n ```\n {{#each person in Developers}}\n {{person.name}}\n {{else}}\n <p>Sorry, nobody is available for this task.</p>\n {{/each}}\n ```\n ### Specifying a View class for items\n If you provide an `itemViewClass` option that references a view class\n with its own `template` you can omit the block.\n\n The following template:\n\n ```handlebars\n {{#view App.MyView }}\n {{each view.items itemViewClass=\"App.AnItemView\"}}\n {{/view}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create({\n MyView: Ember.View.extend({\n items: [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n })\n });\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n ### Representing each item with a Controller.\n By default the controller lookup within an `{{#each}}` block will be\n the controller of the template where the `{{#each}}` was used. If each\n item needs to be presented by a custom controller you can provide a\n `itemController` option which references a controller by lookup name.\n Each item in the loop will be wrapped in an instance of this controller\n and the item itself will be set to the `content` property of that controller.\n\n This is useful in cases where properties of model objects need transformation\n or synthesis for display:\n\n ```javascript\n App.DeveloperController = Ember.ObjectController.extend({\n isAvailableForHire: function(){\n return !this.get('content.isEmployed') && this.get('content.isSeekingWork');\n }.property('isEmployed', 'isSeekingWork')\n })\n ```\n\n ```handlebars\n {{#each person in developers itemController=\"developer\"}}\n {{person.name}} {{#if person.isAvailableForHire}}Hire me!{{/if}}\n {{/each}}\n ```\n\n @method each\n @for Ember.Handlebars.helpers\n @param [name] {String} name for item (used with `in`)\n @param [path] {String} path\n @param [options] {Object} Handlebars key/value pairs of options\n @param [options.itemViewClass] {String} a path to a view class used for each item\n @param [options.itemController] {String} name of a controller to be created for each item\n*/\nEmber.Handlebars.registerHelper('each', function(path, options) {\n if (arguments.length === 4) {\n Ember.assert(\"If you pass more than one argument to the each helper, it must be in the form #each foo in bar\", arguments[1] === \"in\");\n\n var keywordName = arguments[0];\n\n options = arguments[3];\n path = arguments[2];\n if (path === '') { path = \"this\"; }\n\n options.hash.keyword = keywordName;\n }\n\n options.hash.dataSourceBinding = path;\n // Set up emptyView as a metamorph with no tag\n //options.hash.emptyViewClass = Ember._MetamorphView;\n\n if (options.data.insideGroup && !options.hash.groupedRows && !options.hash.itemViewClass) {\n new Ember.Handlebars.GroupedEach(this, path, options).render();\n } else {\n return Ember.Handlebars.helpers.collection.call(this, 'Ember.Handlebars.EachView', options);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/each");minispade.register('ember-handlebars/helpers/partial', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `partial` renders a template directly using the current context.\n If needed the context can be set using the `{{#with foo}}` helper. \n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"header_bar\">\n {{#with currentUser}}\n {{partial user_info}}\n {{/with}}\n </script>\n\n The `data-template-name` attribute of a partial template\n is prefixed with an underscore.\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"_user_info\">\n <span>Hello {{username}}!</span>\n </script>\n ```\n\n @method partial\n @for Ember.Handlebars.helpers\n @param {String} partialName the name of the template to render minus the leading underscore\n*/\n\nEmber.Handlebars.registerHelper('partial', function(name, options) {\n var nameParts = name.split(\"/\"),\n lastPart = nameParts[nameParts.length - 1];\n\n nameParts[nameParts.length - 1] = \"_\" + lastPart;\n\n var underscoredName = nameParts.join(\"/\");\n\n var template = Ember.TEMPLATES[underscoredName],\n deprecatedTemplate = Ember.TEMPLATES[name];\n\n Ember.deprecate(\"You tried to render the partial \" + name + \", which should be at '\" + underscoredName + \"', but Ember found '\" + name + \"'. Please use a leading underscore in your partials\", template);\n Ember.assert(\"Unable to find partial with name '\"+name+\"'.\", template || deprecatedTemplate);\n\n template = template || deprecatedTemplate;\n\n template(this, { data: options.data });\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/partial");minispade.register('ember-handlebars/helpers/shared', "(function() {Ember.Handlebars.resolvePaths = function(options) {\n var ret = [],\n contexts = options.contexts,\n roots = options.roots,\n data = options.data;\n\n for (var i=0, l=contexts.length; i<l; i++) {\n ret.push( Ember.Handlebars.get(roots[i], contexts[i], { data: data }) );\n }\n\n return ret;\n};\n\n})();\n//@ sourceURL=ember-handlebars/helpers/shared");minispade.register('ember-handlebars/helpers/template', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `template` allows you to render a template from inside another template.\n This allows you to re-use the same template in multiple places. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"logged_in_user\">\n {{#with loggedInUser}}\n Last Login: {{lastLogin}}\n User Info: {{template \"user_info\"}}\n {{/with}}\n </script>\n ```\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"user_info\">\n Name: <em>{{name}}</em>\n Karma: <em>{{karma}}</em>\n </script>\n ```\n\n ```handlebars\n {{#if isUser}}\n {{template \"user_info\"}}\n {{else}}\n {{template \"unlogged_user_info\"}}\n {{/if}}\n ```\n\n This helper looks for templates in the global `Ember.TEMPLATES` hash. If you\n add `<script>` tags to your page with the `data-template-name` attribute set,\n they will be compiled and placed in this hash automatically.\n\n You can also manually register templates by adding them to the hash:\n\n ```javascript\n Ember.TEMPLATES[\"my_cool_template\"] = Ember.Handlebars.compile('<b>{{user}}</b>');\n ```\n\n @method template\n @for Ember.Handlebars.helpers\n @param {String} templateName the template to render\n*/\n\nEmber.Handlebars.registerHelper('template', function(name, options) {\n var template = Ember.TEMPLATES[name];\n\n Ember.assert(\"Unable to find template with name '\"+name+\"'.\", !!template);\n\n Ember.TEMPLATES[name](this, { data: options.data });\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/template");minispade.register('ember-handlebars/helpers/unbound', "(function() {/*globals Handlebars */\nminispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar handlebarsGet = Ember.Handlebars.get;\n\n/**\n `unbound` allows you to output a property without binding. *Important:* The\n output will not be updated if the property changes. Use with caution.\n\n ```handlebars\n <div>{{unbound somePropertyThatDoesntChange}}</div>\n ```\n\n `unbound` can also be used in conjunction with a bound helper to\n render it in its unbound form:\n\n ```handlebars\n <div>{{unbound helperName somePropertyThatDoesntChange}}</div>\n ```\n\n @method unbound\n @for Ember.Handlebars.helpers\n @param {String} property\n @return {String} HTML string\n*/\nEmber.Handlebars.registerHelper('unbound', function(property, fn) {\n var options = arguments[arguments.length - 1], helper, context, out;\n\n if(arguments.length > 2) {\n // Unbound helper call.\n options.data.isUnbound = true;\n helper = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing;\n out = helper.apply(this, Array.prototype.slice.call(arguments, 1));\n delete options.data.isUnbound;\n return out;\n }\n\n context = (fn.contexts && fn.contexts[0]) || this;\n return handlebarsGet(context, property, fn);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/unbound");minispade.register('ember-handlebars/helpers/view', "(function() {/*globals Handlebars */\n\n// TODO: Don't require the entire module\nminispade.require(\"ember-handlebars\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar PARENT_VIEW_PATH = /^parentView\\./;\nvar EmberHandlebars = Ember.Handlebars;\n\nEmberHandlebars.ViewHelper = Ember.Object.create({\n\n propertiesFromHTMLOptions: function(options, thisContext) {\n var hash = options.hash, data = options.data;\n var extensions = {},\n classes = hash['class'],\n dup = false;\n\n if (hash.id) {\n extensions.elementId = hash.id;\n dup = true;\n }\n\n if (hash.tag) {\n extensions.tagName = hash.tag;\n dup = true;\n }\n\n if (classes) {\n classes = classes.split(' ');\n extensions.classNames = classes;\n dup = true;\n }\n\n if (hash.classBinding) {\n extensions.classNameBindings = hash.classBinding.split(' ');\n dup = true;\n }\n\n if (hash.classNameBindings) {\n if (extensions.classNameBindings === undefined) extensions.classNameBindings = [];\n extensions.classNameBindings = extensions.classNameBindings.concat(hash.classNameBindings.split(' '));\n dup = true;\n }\n\n if (hash.attributeBindings) {\n Ember.assert(\"Setting 'attributeBindings' via Handlebars is not allowed. Please subclass Ember.View and set it there instead.\");\n extensions.attributeBindings = null;\n dup = true;\n }\n\n if (dup) {\n hash = Ember.$.extend({}, hash);\n delete hash.id;\n delete hash.tag;\n delete hash['class'];\n delete hash.classBinding;\n }\n\n // Set the proper context for all bindings passed to the helper. This applies to regular attribute bindings\n // as well as class name bindings. If the bindings are local, make them relative to the current context\n // instead of the view.\n var path;\n\n // Evaluate the context of regular attribute bindings:\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n\n // Test if the property ends in \"Binding\"\n if (Ember.IS_BINDING.test(prop) && typeof hash[prop] === 'string') {\n path = this.contextualizeBindingPath(hash[prop], data);\n if (path) { hash[prop] = path; }\n }\n }\n\n // Evaluate the context of class name bindings:\n if (extensions.classNameBindings) {\n for (var b in extensions.classNameBindings) {\n var full = extensions.classNameBindings[b];\n if (typeof full === 'string') {\n // Contextualize the path of classNameBinding so this:\n //\n // classNameBinding=\"isGreen:green\"\n //\n // is converted to this:\n //\n // classNameBinding=\"_parentView.context.isGreen:green\"\n var parsedPath = Ember.View._parsePropertyPath(full);\n path = this.contextualizeBindingPath(parsedPath.path, data);\n if (path) { extensions.classNameBindings[b] = path + parsedPath.classNames; }\n }\n }\n }\n\n return Ember.$.extend(hash, extensions);\n },\n\n // Transform bindings from the current context to a context that can be evaluated within the view.\n // Returns null if the path shouldn't be changed.\n //\n // TODO: consider the addition of a prefix that would allow this method to return `path`.\n contextualizeBindingPath: function(path, data) {\n var normalized = Ember.Handlebars.normalizePath(null, path, data);\n if (normalized.isKeyword) {\n return 'templateData.keywords.' + path;\n } else if (Ember.isGlobalPath(path)) {\n return null;\n } else if (path === 'this') {\n return '_parentView.context';\n } else {\n return '_parentView.context.' + path;\n }\n },\n\n helper: function(thisContext, path, options) {\n var inverse = options.inverse,\n data = options.data,\n view = data.view,\n fn = options.fn,\n hash = options.hash,\n newView;\n\n if ('string' === typeof path) {\n newView = EmberHandlebars.get(thisContext, path, options);\n Ember.assert(\"Unable to find view at path '\" + path + \"'\", !!newView);\n } else {\n newView = path;\n }\n\n Ember.assert(Ember.String.fmt('You must pass a view to the #view helper, not %@ (%@)', [path, newView]), Ember.View.detect(newView) || Ember.View.detectInstance(newView));\n\n var viewOptions = this.propertiesFromHTMLOptions(options, thisContext);\n var currentView = data.view;\n viewOptions.templateData = options.data;\n var newViewProto = newView.proto ? newView.proto() : newView;\n\n if (fn) {\n Ember.assert(\"You cannot provide a template block if you also specified a templateName\", !get(viewOptions, 'templateName') && !get(newViewProto, 'templateName'));\n viewOptions.template = fn;\n }\n\n // We only want to override the `_context` computed property if there is\n // no specified controller. See View#_context for more information.\n if (!newViewProto.controller && !newViewProto.controllerBinding && !viewOptions.controller && !viewOptions.controllerBinding) {\n viewOptions._context = thisContext;\n }\n\n currentView.appendChild(newView, viewOptions);\n }\n});\n\n/**\n `{{view}}` inserts a new instance of `Ember.View` into a template passing its\n options to the `Ember.View`'s `create` method and using the supplied block as\n the view's own template.\n\n An empty `<body>` and the following template:\n\n ```handlebars\n A span:\n {{#view tagName=\"span\"}}\n hello.\n {{/view}}\n ```\n\n Will result in HTML structure:\n\n ```html\n <body>\n <!-- Note: the handlebars template script\n also results in a rendered Ember.View\n which is the outer <div> here -->\n\n <div class=\"ember-view\">\n A span:\n <span id=\"ember1\" class=\"ember-view\">\n Hello.\n </span>\n </div>\n </body>\n ```\n\n ### `parentView` setting\n\n The `parentView` property of the new `Ember.View` instance created through\n `{{view}}` will be set to the `Ember.View` instance of the template where\n `{{view}}` was called.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile(\"{{#view}} my parent: {{parentView.elementId}} {{/view}}\")\n });\n\n aView.appendTo('body');\n ```\n\n Will result in HTML structure:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view\">\n my parent: ember1\n </div>\n </div>\n ```\n\n ### Setting CSS id and class attributes\n\n The HTML `id` attribute can be set on the `{{view}}`'s resulting element with\n the `id` option. This option will _not_ be passed to `Ember.View.create`.\n\n ```handlebars\n {{#view tagName=\"span\" id=\"a-custom-id\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"a-custom-id\" class=\"ember-view\">\n hello.\n </span>\n </div>\n ```\n\n The HTML `class` attribute can be set on the `{{view}}`'s resulting element\n with the `class` or `classNameBindings` options. The `class` option will\n directly set the CSS `class` attribute and will not be passed to\n `Ember.View.create`. `classNameBindings` will be passed to `create` and use\n `Ember.View`'s class name binding functionality:\n\n ```handlebars\n {{#view tagName=\"span\" class=\"a-custom-class\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"ember2\" class=\"ember-view a-custom-class\">\n hello.\n </span>\n </div>\n ```\n\n ### Supplying a different view class\n\n `{{view}}` can take an optional first argument before its supplied options to\n specify a path to a custom view class.\n\n ```handlebars\n {{#view \"MyApp.CustomView\"}}\n hello.\n {{/view}}\n ```\n\n The first argument can also be a relative path. Ember will search for the\n view class starting at the `Ember.View` of the template where `{{view}}` was\n used as the root object:\n\n ```javascript\n MyApp = Ember.Application.create({});\n MyApp.OuterView = Ember.View.extend({\n innerViewClass: Ember.View.extend({\n classNames: ['a-custom-view-class-as-property']\n }),\n template: Ember.Handlebars.compile('{{#view \"innerViewClass\"}} hi {{/view}}')\n });\n\n MyApp.OuterView.create().appendTo('body');\n ```\n\n Will result in the following HTML:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view a-custom-view-class-as-property\">\n hi\n </div>\n </div>\n ```\n\n ### Blockless use\n\n If you supply a custom `Ember.View` subclass that specifies its own template\n or provide a `templateName` option to `{{view}}` it can be used without\n supplying a block. Attempts to use both a `templateName` option and supply a\n block will throw an error.\n\n ```handlebars\n {{view \"MyApp.ViewWithATemplateDefined\"}}\n ```\n\n ### `viewName` property\n\n You can supply a `viewName` option to `{{view}}`. The `Ember.View` instance\n will be referenced as a property of its parent view by this name.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile('{{#view viewName=\"aChildByName\"}} hi {{/view}}')\n });\n\n aView.appendTo('body');\n aView.get('aChildByName') // the instance of Ember.View created by {{view}} helper\n ```\n\n @method view\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('view', function(path, options) {\n Ember.assert(\"The view helper only takes a single argument\", arguments.length <= 2);\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = \"Ember.View\";\n }\n\n return EmberHandlebars.ViewHelper.helper(this, path, options);\n});\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/view");minispade.register('ember-handlebars/helpers/yield', "(function() {/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n When used in a Handlebars template that is assigned to an `Ember.View`\n instance's `layout` property Ember will render the layout template first,\n inserting the view's own rendered output at the `{{yield}}` location.\n\n An empty `<body>` and the following application code:\n\n ```javascript\n AView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n layout: Ember.Handlebars.compile('<div class=\"wrapper\">{{yield}}</div>'),\n template: Ember.Handlebars.compile('<span>I am wrapped</span>')\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will result in the following HTML output:\n\n ```html\n <body>\n <div class='ember-view a-view-with-layout'>\n <div class=\"wrapper\">\n <span>I am wrapped</span>\n </div>\n </div>\n </body>\n ```\n\n The `yield` helper cannot be used outside of a template assigned to an\n `Ember.View`'s `layout` property and will throw an error if attempted.\n\n ```javascript\n BView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n template: Ember.Handlebars.compile('{{yield}}')\n });\n\n bView = BView.create();\n bView.appendTo('body');\n\n // throws\n // Uncaught Error: assertion failed: You called yield in a template that was not a layout\n ```\n\n @method yield\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmber.Handlebars.registerHelper('yield', function(options) {\n var view = options.data.view, template;\n\n while (view && !get(view, 'layout')) {\n view = get(view, 'parentView');\n }\n\n Ember.assert(\"You called yield in a template that was not a layout\", !!view);\n\n template = get(view, 'template');\n\n if (template) { template(this, options); }\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/yield");minispade.register('ember-handlebars/loader', "(function() {/*globals Handlebars */\nminispade.require(\"ember-handlebars/ext\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n @private\n\n Find templates stored in the head tag as script tags and make them available\n to `Ember.CoreView` in the global `Ember.TEMPLATES` object. This will be run\n as as jQuery DOM-ready callback.\n\n Script tags with `text/x-handlebars` will be compiled\n with Ember's Handlebars and are suitable for use as a view's template.\n Those with type `text/x-raw-handlebars` will be compiled with regular\n Handlebars and are suitable for use in views' computed properties.\n\n @method bootstrap\n @for Ember.Handlebars\n @static\n @param ctx\n*/\nEmber.Handlebars.bootstrap = function(ctx) {\n var selectors = 'script[type=\"text/x-handlebars\"], script[type=\"text/x-raw-handlebars\"]';\n\n Ember.$(selectors, ctx)\n .each(function() {\n // Get a reference to the script tag\n var script = Ember.$(this);\n\n var compile = (script.attr('type') === 'text/x-raw-handlebars') ?\n Ember.$.proxy(Handlebars.compile, Handlebars) :\n Ember.$.proxy(Ember.Handlebars.compile, Ember.Handlebars),\n // Get the name of the script, used by Ember.View's templateName property.\n // First look for data-template-name attribute, then fall back to its\n // id if no name is found.\n templateName = script.attr('data-template-name') || script.attr('id') || 'application',\n template = compile(script.html());\n\n // For templates which have a name, we save them and then remove them from the DOM\n Ember.TEMPLATES[templateName] = template;\n\n // Remove script tag from DOM\n script.remove();\n });\n};\n\nfunction bootstrap() {\n Ember.Handlebars.bootstrap( Ember.$(document) );\n}\n\n/*\n We tie this to application.load to ensure that we've at least\n attempted to bootstrap at the point that the application is loaded.\n\n We also tie this to document ready since we're guaranteed that all\n the inline templates are present at this point.\n\n There's no harm to running this twice, since we remove the templates\n from the DOM after processing.\n*/\n\nEmber.onLoad('application', bootstrap);\n\n})();\n//@ sourceURL=ember-handlebars/loader");minispade.register('ember-handlebars', "(function() {minispade.require(\"ember-handlebars-compiler\");\nminispade.require(\"ember-runtime\");\nminispade.require(\"ember-views\");\nminispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-handlebars/string\");\nminispade.require(\"ember-handlebars/helpers\");\nminispade.require(\"ember-handlebars/views\");\nminispade.require(\"ember-handlebars/controls\");\nminispade.require(\"ember-handlebars/loader\");\n\n/**\nEmber Handlebars\n\n@module ember\n@submodule ember-handlebars\n@requires ember-views\n*/\n\nEmber.runLoadHooks('Ember.Handlebars', Ember.Handlebars);\n\n})();\n//@ sourceURL=ember-handlebars");minispade.register('ember-handlebars/string', "(function() {/**\n @method htmlSafe\n @for Ember.String\n @static\n*/\nEmber.String.htmlSafe = function(str) {\n return new Handlebars.SafeString(str);\n};\n\nvar htmlSafe = Ember.String.htmlSafe;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n See {{#crossLink \"Ember.String/htmlSafe\"}}{{/crossLink}}\n\n @method htmlSafe\n @for String\n */\n String.prototype.htmlSafe = function() {\n return htmlSafe(this);\n };\n}\n\n})();\n//@ sourceURL=ember-handlebars/string");minispade.register('ember-handlebars/views', "(function() {minispade.require(\"ember-handlebars/views/handlebars_bound_view\");\nminispade.require(\"ember-handlebars/views/metamorph_view\");\n\n})();\n//@ sourceURL=ember-handlebars/views");minispade.register('ember-handlebars/views/handlebars_bound_view', "(function() {/*globals Handlebars */\n/*jshint newcap:false*/\nminispade.require(\"metamorph\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set, handlebarsGet = Ember.Handlebars.get;\nvar Metamorph = requireModule('metamorph');\nminispade.require('ember-views/views/view');\nminispade.require('ember-handlebars/views/metamorph_view');\n\nfunction SimpleHandlebarsView(path, pathRoot, isEscaped, templateData) {\n this.path = path;\n this.pathRoot = pathRoot;\n this.isEscaped = isEscaped;\n this.templateData = templateData;\n\n this.morph = Metamorph();\n this.state = 'preRender';\n this.updateId = null;\n}\n\nEmber._SimpleHandlebarsView = SimpleHandlebarsView;\n\nSimpleHandlebarsView.prototype = {\n isVirtual: true,\n isView: true,\n\n destroy: function () {\n if (this.updateId) {\n Ember.run.cancel(this.updateId);\n this.updateId = null;\n }\n this.morph = null;\n },\n\n propertyDidChange: Ember.K,\n\n normalizedValue: function() {\n var path = this.path,\n pathRoot = this.pathRoot,\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = this.templateData;\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return result;\n },\n\n renderToBuffer: function(buffer) {\n var string = '';\n\n string += this.morph.startTag();\n string += this.render();\n string += this.morph.endTag();\n\n buffer.push(string);\n },\n\n render: function() {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = this.isEscaped;\n var result = this.normalizedValue();\n\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n return result;\n },\n\n rerender: function() {\n switch(this.state) {\n case 'preRender':\n case 'destroyed':\n break;\n case 'inBuffer':\n throw new Ember.Error(\"Something you did tried to replace an {{expression}} before it was inserted into the DOM.\");\n case 'hasElement':\n case 'inDOM':\n this.updateId = Ember.run.scheduleOnce('render', this, 'update');\n break;\n }\n\n return this;\n },\n\n update: function () {\n this.updateId = null;\n this.morph.html(this.render());\n },\n\n transitionTo: function(state) {\n this.state = state;\n }\n};\n\nvar states = Ember.View.cloneStates(Ember.View.states), merge = Ember.merge;\n\nmerge(states._default, {\n rerenderIfNeeded: Ember.K\n});\n\nmerge(states.inDOM, {\n rerenderIfNeeded: function(view) {\n if (get(view, 'normalizedValue') !== view._lastNormalizedValue) {\n view.rerender();\n }\n }\n});\n\n/**\n `Ember._HandlebarsBoundView` is a private view created by the Handlebars\n `{{bind}}` helpers that is used to keep track of bound properties.\n\n Every time a property is bound using a `{{mustache}}`, an anonymous subclass\n of `Ember._HandlebarsBoundView` is created with the appropriate sub-template\n and context set up. When the associated property changes, just the template\n for this view will re-render.\n\n @class _HandlebarsBoundView\n @namespace Ember\n @extends Ember._MetamorphView\n @private\n*/\nEmber._HandlebarsBoundView = Ember._MetamorphView.extend({\n instrumentName: 'render.boundHandlebars',\n states: states,\n\n /**\n The function used to determine if the `displayTemplate` or\n `inverseTemplate` should be rendered. This should be a function that takes\n a value and returns a Boolean.\n\n @property shouldDisplayFunc\n @type Function\n @default null\n */\n shouldDisplayFunc: null,\n\n /**\n Whether the template rendered by this view gets passed the context object\n of its parent template, or gets passed the value of retrieving `path`\n from the `pathRoot`.\n\n For example, this is true when using the `{{#if}}` helper, because the\n template inside the helper should look up properties relative to the same\n object as outside the block. This would be `false` when used with `{{#with\n foo}}` because the template should receive the object found by evaluating\n `foo`.\n\n @property preserveContext\n @type Boolean\n @default false\n */\n preserveContext: false,\n\n /**\n If `preserveContext` is true, this is the object that will be used\n to render the template.\n\n @property previousContext\n @type Object\n */\n previousContext: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `true`.\n\n @property displayTemplate\n @type Function\n @default null\n */\n displayTemplate: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `false`.\n\n @property inverseTemplate\n @type Function\n @default null\n */\n inverseTemplate: null,\n\n\n /**\n The path to look up on `pathRoot` that is passed to\n `shouldDisplayFunc` to determine which template to render.\n\n In addition, if `preserveContext` is `false,` the object at this path will\n be passed to the template when rendering.\n\n @property path\n @type String\n @default null\n */\n path: null,\n\n /**\n The object from which the `path` will be looked up. Sometimes this is the\n same as the `previousContext`, but in cases where this view has been\n generated for paths that start with a keyword such as `view` or\n `controller`, the path root will be that resolved object.\n\n @property pathRoot\n @type Object\n */\n pathRoot: null,\n\n normalizedValue: Ember.computed(function() {\n var path = get(this, 'path'),\n pathRoot = get(this, 'pathRoot'),\n valueNormalizer = get(this, 'valueNormalizerFunc'),\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = get(this, 'templateData');\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return valueNormalizer ? valueNormalizer(result) : result;\n }).property('path', 'pathRoot', 'valueNormalizerFunc').volatile(),\n\n rerenderIfNeeded: function() {\n this.currentState.rerenderIfNeeded(this);\n },\n\n /**\n Determines which template to invoke, sets up the correct state based on\n that logic, then invokes the default `Ember.View` `render` implementation.\n\n This method will first look up the `path` key on `pathRoot`,\n then pass that value to the `shouldDisplayFunc` function. If that returns\n `true,` the `displayTemplate` function will be rendered to DOM. Otherwise,\n `inverseTemplate`, if specified, will be rendered.\n\n For example, if this `Ember._HandlebarsBoundView` represented the `{{#with\n foo}}` helper, it would look up the `foo` property of its context, and\n `shouldDisplayFunc` would always return true. The object found by looking\n up `foo` would be passed to `displayTemplate`.\n\n @method render\n @param {Ember.RenderBuffer} buffer\n */\n render: function(buffer) {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = get(this, 'isEscaped');\n\n var shouldDisplay = get(this, 'shouldDisplayFunc'),\n preserveContext = get(this, 'preserveContext'),\n context = get(this, 'previousContext');\n\n var inverseTemplate = get(this, 'inverseTemplate'),\n displayTemplate = get(this, 'displayTemplate');\n\n var result = get(this, 'normalizedValue');\n this._lastNormalizedValue = result;\n\n // First, test the conditional to see if we should\n // render the template or not.\n if (shouldDisplay(result)) {\n set(this, 'template', displayTemplate);\n\n // If we are preserving the context (for example, if this\n // is an #if block, call the template with the same object.\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n // Otherwise, determine if this is a block bind or not.\n // If so, pass the specified object to the template\n if (displayTemplate) {\n set(this, '_context', result);\n } else {\n // This is not a bind block, just push the result of the\n // expression to the render context and return.\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n buffer.push(result);\n return;\n }\n }\n } else if (inverseTemplate) {\n set(this, 'template', inverseTemplate);\n\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n set(this, '_context', result);\n }\n } else {\n set(this, 'template', function() { return ''; });\n }\n\n return this._super(buffer);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/views/handlebars_bound_view");minispade.register('ember-handlebars/views/metamorph_view', "(function() {/*jshint newcap:false*/\nminispade.require(\"metamorph\");\nminispade.require(\"ember-views/views/view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set, get = Ember.get;\nvar Metamorph = requireModule('metamorph');\n\nfunction notifyMutationListeners() {\n Ember.run.once(Ember.View, 'notifyMutationListeners');\n}\n\n// DOMManager should just abstract dom manipulation between jquery and metamorph\nvar DOMManager = {\n remove: function(view) {\n view.morph.remove();\n notifyMutationListeners();\n },\n\n prepend: function(view, html) {\n view.morph.prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.morph.after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.morph.html(html);\n notifyMutationListeners();\n },\n\n // This is messed up.\n replace: function(view) {\n var morph = view.morph;\n\n view.transitionTo('preRender');\n\n Ember.run.schedule('render', this, function() {\n if (view.isDestroying) { return; }\n\n view.clearRenderedChildren();\n var buffer = view.renderToBuffer();\n\n view.invokeRecursively(function(view) {\n view.propertyDidChange('element');\n });\n\n view.triggerRecursively('willInsertElement');\n morph.replaceWith(buffer.string());\n view.transitionTo('inDOM');\n view.triggerRecursively('didInsertElement');\n notifyMutationListeners();\n });\n },\n\n empty: function(view) {\n view.morph.html(\"\");\n notifyMutationListeners();\n }\n};\n\n// The `morph` and `outerHTML` properties are internal only\n// and not observable.\n\n/**\n @class _Metamorph\n @namespace Ember\n @extends Ember.Mixin\n @private\n*/\nEmber._Metamorph = Ember.Mixin.create({\n isVirtual: true,\n tagName: '',\n\n instrumentName: 'render.metamorph',\n\n init: function() {\n this._super();\n this.morph = Metamorph();\n Ember.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated. You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName);\n },\n\n beforeRender: function(buffer) {\n buffer.push(this.morph.startTag());\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n buffer.push(this.morph.endTag());\n },\n\n createElement: function() {\n var buffer = this.renderToBuffer();\n this.outerHTML = buffer.string();\n this.clearBuffer();\n },\n\n domManager: DOMManager\n});\n\n/**\n @class _MetamorphView\n @namespace Ember\n @extends Ember.View\n @uses Ember._Metamorph\n @private\n*/\nEmber._MetamorphView = Ember.View.extend(Ember._Metamorph);\n\n/**\n @class _SimpleMetamorphView\n @namespace Ember\n @extends Ember.View\n @uses Ember._Metamorph\n @private\n*/\nEmber._SimpleMetamorphView = Ember.CoreView.extend(Ember._Metamorph);\n\n\n})();\n//@ sourceURL=ember-handlebars/views/metamorph_view");minispade.register('ember-metal/accessors', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\n\n/**\n@module ember-metal\n*/\n\nvar META_KEY = Ember.META_KEY, get, set;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\nvar IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;\nvar IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\\.\\*]/;\nvar HAS_THIS = /^this[\\.\\*]/;\nvar FIRST_KEY = /^([^\\.\\*]+)/;\n\n// ..........................................................\n// GET AND SET\n//\n// If we are on a platform that supports accessors we can use those.\n// Otherwise simulate accessors by looking up the property directly on the\n// object.\n\n/**\n Gets the value of a property on an object. If the property is computed,\n the function will be invoked. If the property is not defined but the\n object implements the `unknownProperty` method then that will be invoked.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to retrieve a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to retrieve\n properties if the property might not be defined on the object and you want\n to respect the `unknownProperty` handler. Otherwise you can ignore this\n method.\n\n Note that if the object itself is `undefined`, this method will throw\n an error.\n\n @method get\n @for Ember\n @param {Object} obj The object to retrieve from.\n @param {String} keyName The property key to retrieve\n @return {Object} the property value or `null`.\n*/\nget = function get(obj, keyName) {\n // Helpers that operate with 'this' within an #each\n if (keyName === '') {\n return obj;\n }\n\n if (!keyName && 'string'===typeof obj) {\n keyName = obj;\n obj = null;\n }\n\n if (!obj || keyName.indexOf('.') !== -1) {\n Ember.assert(\"Cannot call get with '\"+ keyName +\"' on an undefined object.\", obj !== undefined);\n return getPath(obj, keyName);\n }\n\n Ember.assert(\"You need to provide an object and key to `get`.\", !!obj && keyName);\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;\n if (desc) {\n return desc.get(obj, keyName);\n } else {\n if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {\n ret = meta.values[keyName];\n } else {\n ret = obj[keyName];\n }\n\n if (ret === undefined &&\n 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {\n return obj.unknownProperty(keyName);\n }\n\n return ret;\n }\n};\n\n/**\n Sets the value of a property on an object, respecting computed properties\n and notifying observers and other listeners of the change. If the\n property is not defined but the object implements the `unknownProperty`\n method then that will be invoked as well.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to set a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to set\n properties if the property might not be defined on the object and you want\n to respect the `unknownProperty` handler. Otherwise you can ignore this\n method.\n\n @method set\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} keyName The property key to set\n @param {Object} value The value to set\n @return {Object} the passed value.\n*/\nset = function set(obj, keyName, value, tolerant) {\n if (typeof obj === 'string') {\n Ember.assert(\"Path '\" + obj + \"' must be global if no obj is given.\", IS_GLOBAL.test(obj));\n value = keyName;\n keyName = obj;\n obj = null;\n }\n\n if (!obj || keyName.indexOf('.') !== -1) {\n return setPath(obj, keyName, value, tolerant);\n }\n\n Ember.assert(\"You need to provide an object and key to `set`.\", !!obj && keyName !== undefined);\n Ember.assert('calling set on destroyed object', !obj.isDestroyed);\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName],\n isUnknown, currentValue;\n if (desc) {\n desc.set(obj, keyName, value);\n } else {\n isUnknown = 'object' === typeof obj && !(keyName in obj);\n\n // setUnknownProperty is called if `obj` is an object,\n // the property does not already exist, and the\n // `setUnknownProperty` method exists on the object\n if (isUnknown && 'function' === typeof obj.setUnknownProperty) {\n obj.setUnknownProperty(keyName, value);\n } else if (meta && meta.watching[keyName] > 0) {\n if (MANDATORY_SETTER) {\n currentValue = meta.values[keyName];\n } else {\n currentValue = obj[keyName];\n }\n // only trigger a change if the value has changed\n if (value !== currentValue) {\n Ember.propertyWillChange(obj, keyName);\n if (MANDATORY_SETTER) {\n if (currentValue === undefined && !(keyName in obj)) {\n Ember.defineProperty(obj, keyName, null, value); // setup mandatory setter\n } else {\n meta.values[keyName] = value;\n }\n } else {\n obj[keyName] = value;\n }\n Ember.propertyDidChange(obj, keyName);\n }\n } else {\n obj[keyName] = value;\n }\n }\n return value;\n};\n\n// Currently used only by Ember Data tests\nif (Ember.config.overrideAccessors) {\n Ember.get = get;\n Ember.set = set;\n Ember.config.overrideAccessors();\n get = Ember.get;\n set = Ember.set;\n}\n\nfunction firstKey(path) {\n return path.match(FIRST_KEY)[0];\n}\n\n// assumes path is already normalized\nfunction normalizeTuple(target, path) {\n var hasThis = HAS_THIS.test(path),\n isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),\n key;\n\n if (!target || isGlobal) target = Ember.lookup;\n if (hasThis) path = path.slice(5);\n\n if (target === Ember.lookup) {\n key = firstKey(path);\n target = get(target, key);\n path = path.slice(key.length+1);\n }\n\n // must return some kind of path to be valid else other things will break.\n if (!path || path.length===0) throw new Error('Invalid Path');\n\n return [ target, path ];\n}\n\nfunction getPath(root, path) {\n var hasThis, parts, tuple, idx, len;\n\n // If there is no root and path is a key name, return that\n // property from the global object.\n // E.g. get('Ember') -> Ember\n if (root === null && path.indexOf('.') === -1) { return get(Ember.lookup, path); }\n\n // detect complicated paths and normalize them\n hasThis = HAS_THIS.test(path);\n\n if (!root || hasThis) {\n tuple = normalizeTuple(root, path);\n root = tuple[0];\n path = tuple[1];\n tuple.length = 0;\n }\n\n parts = path.split(\".\");\n len = parts.length;\n for (idx=0; root && idx<len; idx++) {\n root = get(root, parts[idx], true);\n if (root && root.isDestroyed) { return undefined; }\n }\n return root;\n}\n\nfunction setPath(root, path, value, tolerant) {\n var keyName;\n\n // get the last part of the path\n keyName = path.slice(path.lastIndexOf('.') + 1);\n\n // get the first part of the part\n path = path.slice(0, path.length-(keyName.length+1));\n\n // unless the path is this, look up the first part to\n // get the root\n if (path !== 'this') {\n root = getPath(root, path);\n }\n\n if (!keyName || keyName.length === 0) {\n throw new Error('You passed an empty path');\n }\n\n if (!root) {\n if (tolerant) { return; }\n else { throw new Error('Object in path '+path+' could not be found or was destroyed.'); }\n }\n\n return set(root, keyName, value);\n}\n\n/**\n @private\n\n Normalizes a target/path pair to reflect that actual target/path that should\n be observed, etc. This takes into account passing in global property\n paths (i.e. a path beginning with a captial letter not defined on the\n target) and * separators.\n\n @method normalizeTuple\n @for Ember\n @param {Object} target The current target. May be `null`.\n @param {String} path A path on the target or a global property path.\n @return {Array} a temporary array with the normalized target/path pair.\n*/\nEmber.normalizeTuple = function(target, path) {\n return normalizeTuple(target, path);\n};\n\nEmber.getWithDefault = function(root, key, defaultValue) {\n var value = get(root, key);\n\n if (value === undefined) { return defaultValue; }\n return value;\n};\n\n\nEmber.get = get;\nEmber.getPath = Ember.deprecateFunc('getPath is deprecated since get now supports paths', Ember.get);\n\nEmber.set = set;\nEmber.setPath = Ember.deprecateFunc('setPath is deprecated since set now supports paths', Ember.set);\n\n/**\n Error-tolerant form of `Ember.set`. Will not blow up if any part of the\n chain is `undefined`, `null`, or destroyed.\n\n This is primarily used when syncing bindings, which may try to update after\n an object has been destroyed.\n\n @method trySet\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} path The property path to set\n @param {Object} value The value to set\n*/\nEmber.trySet = function(root, path, value) {\n return set(root, path, value, true);\n};\nEmber.trySetPath = Ember.deprecateFunc('trySetPath has been renamed to trySet', Ember.trySet);\n\n/**\n Returns true if the provided path is global (e.g., `MyApp.fooController.bar`)\n instead of local (`foo.bar.baz`).\n\n @method isGlobalPath\n @for Ember\n @private\n @param {String} path\n @return Boolean\n*/\nEmber.isGlobalPath = function(path) {\n return IS_GLOBAL.test(path);\n};\n\n\n})();\n//@ sourceURL=ember-metal/accessors");minispade.register('ember-metal/array', "(function() {/*jshint newcap:false*/\nminispade.require('ember-metal/enumerable_utils');\n\n/**\n@module ember-metal\n*/\n\n// NOTE: There is a bug in jshint that doesn't recognize `Object()` without `new`\n// as being ok unless both `newcap:false` and not `use strict`.\n// https://github.com/jshint/jshint/issues/392\n\n// Testing this is not ideal, but we want to use native functions\n// if available, but not to use versions created by libraries like Prototype\nvar isNativeFunc = function(func) {\n // This should probably work in all browsers likely to have ES5 array methods\n return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1;\n};\n\n// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/map\nvar arrayMap = isNativeFunc(Array.prototype.map) ? Array.prototype.map : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var res = new Array(len);\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n res[i] = fun.call(thisp, t[i], i, t);\n }\n }\n\n return res;\n};\n\n// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach\nvar arrayForEach = isNativeFunc(Array.prototype.forEach) ? Array.prototype.forEach : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n fun.call(thisp, t[i], i, t);\n }\n }\n};\n\nvar arrayIndexOf = isNativeFunc(Array.prototype.indexOf) ? Array.prototype.indexOf : function (obj, fromIndex) {\n if (fromIndex === null || fromIndex === undefined) { fromIndex = 0; }\n else if (fromIndex < 0) { fromIndex = Math.max(0, this.length + fromIndex); }\n for (var i = fromIndex, j = this.length; i < j; i++) {\n if (this[i] === obj) { return i; }\n }\n return -1;\n};\n\nEmber.ArrayPolyfills = {\n map: arrayMap,\n forEach: arrayForEach,\n indexOf: arrayIndexOf\n};\n\nif (Ember.SHIM_ES5) {\n if (!Array.prototype.map) {\n Array.prototype.map = arrayMap;\n }\n\n if (!Array.prototype.forEach) {\n Array.prototype.forEach = arrayForEach;\n }\n\n if (!Array.prototype.indexOf) {\n Array.prototype.indexOf = arrayIndexOf;\n }\n}\n\n})();\n//@ sourceURL=ember-metal/array");minispade.register('ember-metal/binding', "(function() {minispade.require('ember-metal/core'); // Ember.Logger\nminispade.require('ember-metal/accessors'); // get, set, trySet\nminispade.require('ember-metal/utils'); // guidFor, isArray, meta\nminispade.require('ember-metal/observer'); // addObserver, removeObserver\nminispade.require('ember-metal/run_loop'); // Ember.run.schedule\nminispade.require('ember-metal/map');\n\n/**\n@module ember-metal\n*/\n\n// ..........................................................\n// CONSTANTS\n//\n\n/**\n Debug parameter you can turn on. This will log all bindings that fire to\n the console. This should be disabled in production code. Note that you\n can also enable this from the console or temporarily.\n\n @property LOG_BINDINGS\n @for Ember\n @type Boolean\n @default false\n*/\nEmber.LOG_BINDINGS = false || !!Ember.ENV.LOG_BINDINGS;\n\nvar get = Ember.get,\n set = Ember.set,\n guidFor = Ember.guidFor,\n isGlobalPath = Ember.isGlobalPath;\n\n\nfunction getWithGlobals(obj, path) {\n return get(isGlobalPath(path) ? Ember.lookup : obj, path);\n}\n\n// ..........................................................\n// BINDING\n//\n\nvar Binding = function(toPath, fromPath) {\n this._direction = 'fwd';\n this._from = fromPath;\n this._to = toPath;\n this._directionMap = Ember.Map.create();\n};\n\n/**\n@class Binding\n@namespace Ember\n*/\n\nBinding.prototype = {\n /**\n This copies the Binding so it can be connected to another object.\n\n @method copy\n @return {Ember.Binding}\n */\n copy: function () {\n var copy = new Binding(this._to, this._from);\n if (this._oneWay) { copy._oneWay = true; }\n return copy;\n },\n\n // ..........................................................\n // CONFIG\n //\n\n /**\n This will set `from` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method from\n @param {String} path the property path to connect to\n @return {Ember.Binding} `this`\n */\n from: function(path) {\n this._from = path;\n return this;\n },\n\n /**\n This will set the `to` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method to\n @param {String|Tuple} path A property path or tuple\n @return {Ember.Binding} `this`\n */\n to: function(path) {\n this._to = path;\n return this;\n },\n\n /**\n Configures the binding as one way. A one-way binding will relay changes\n on the `from` side to the `to` side, but not the other way around. This\n means that if you change the `to` side directly, the `from` side may have\n a different value.\n\n @method oneWay\n @return {Ember.Binding} `this`\n */\n oneWay: function() {\n this._oneWay = true;\n return this;\n },\n\n toString: function() {\n var oneWay = this._oneWay ? '[oneWay]' : '';\n return \"Ember.Binding<\" + guidFor(this) + \">(\" + this._from + \" -> \" + this._to + \")\" + oneWay;\n },\n\n // ..........................................................\n // CONNECT AND SYNC\n //\n\n /**\n Attempts to connect this binding instance so that it can receive and relay\n changes. This method will raise an exception if you have not set the\n from/to properties yet.\n\n @method connect\n @param {Object} obj The root object for this binding.\n @return {Ember.Binding} `this`\n */\n connect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);\n\n var fromPath = this._from, toPath = this._to;\n Ember.trySet(obj, toPath, getWithGlobals(obj, fromPath));\n\n // add an observer on the object to be notified when the binding should be updated\n Ember.addObserver(obj, fromPath, this, this.fromDidChange);\n\n // if the binding is a two-way binding, also set up an observer on the target\n if (!this._oneWay) { Ember.addObserver(obj, toPath, this, this.toDidChange); }\n\n this._readyToSync = true;\n\n return this;\n },\n\n /**\n Disconnects the binding instance. Changes will no longer be relayed. You\n will not usually need to call this method.\n\n @method disconnect\n @param {Object} obj The root object you passed when connecting the binding.\n @return {Ember.Binding} `this`\n */\n disconnect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);\n\n var twoWay = !this._oneWay;\n\n // remove an observer on the object so we're no longer notified of\n // changes that should update bindings.\n Ember.removeObserver(obj, this._from, this, this.fromDidChange);\n\n // if the binding is two-way, remove the observer from the target as well\n if (twoWay) { Ember.removeObserver(obj, this._to, this, this.toDidChange); }\n\n this._readyToSync = false; // disable scheduled syncs...\n return this;\n },\n\n // ..........................................................\n // PRIVATE\n //\n\n /* called when the from side changes */\n fromDidChange: function(target) {\n this._scheduleSync(target, 'fwd');\n },\n\n /* called when the to side changes */\n toDidChange: function(target) {\n this._scheduleSync(target, 'back');\n },\n\n _scheduleSync: function(obj, dir) {\n var directionMap = this._directionMap;\n var existingDir = directionMap.get(obj);\n\n // if we haven't scheduled the binding yet, schedule it\n if (!existingDir) {\n Ember.run.schedule('sync', this, this._sync, obj);\n directionMap.set(obj, dir);\n }\n\n // If both a 'back' and 'fwd' sync have been scheduled on the same object,\n // default to a 'fwd' sync so that it remains deterministic.\n if (existingDir === 'back' && dir === 'fwd') {\n directionMap.set(obj, 'fwd');\n }\n },\n\n _sync: function(obj) {\n var log = Ember.LOG_BINDINGS;\n\n // don't synchronize destroyed objects or disconnected bindings\n if (obj.isDestroyed || !this._readyToSync) { return; }\n\n // get the direction of the binding for the object we are\n // synchronizing from\n var directionMap = this._directionMap;\n var direction = directionMap.get(obj);\n\n var fromPath = this._from, toPath = this._to;\n\n directionMap.remove(obj);\n\n // if we're synchronizing from the remote object...\n if (direction === 'fwd') {\n var fromValue = getWithGlobals(obj, this._from);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '->', fromValue, obj);\n }\n if (this._oneWay) {\n Ember.trySet(obj, toPath, fromValue);\n } else {\n Ember._suspendObserver(obj, toPath, this, this.toDidChange, function () {\n Ember.trySet(obj, toPath, fromValue);\n });\n }\n // if we're synchronizing *to* the remote object\n } else if (direction === 'back') {\n var toValue = get(obj, this._to);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '<-', toValue, obj);\n }\n Ember._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {\n Ember.trySet(Ember.isGlobalPath(fromPath) ? Ember.lookup : obj, fromPath, toValue);\n });\n }\n }\n\n};\n\nfunction mixinProperties(to, from) {\n for (var key in from) {\n if (from.hasOwnProperty(key)) {\n to[key] = from[key];\n }\n }\n}\n\nmixinProperties(Binding, {\n\n /**\n See {{#crossLink \"Ember.Binding/from\"}}{{/crossLink}}\n\n @method from\n @static\n */\n from: function() {\n var C = this, binding = new C();\n return binding.from.apply(binding, arguments);\n },\n\n /**\n See {{#crossLink \"Ember.Binding/to\"}}{{/crossLink}}\n\n @method to\n @static\n */\n to: function() {\n var C = this, binding = new C();\n return binding.to.apply(binding, arguments);\n },\n\n /**\n Creates a new Binding instance and makes it apply in a single direction.\n A one-way binding will relay changes on the `from` side object (supplied\n as the `from` argument) the `to` side, but not the other way around.\n This means that if you change the \"to\" side directly, the \"from\" side may have\n a different value.\n\n See {{#crossLink \"Binding/oneWay\"}}{{/crossLink}}\n\n @method oneWay\n @param {String} from from path.\n @param {Boolean} [flag] (Optional) passing nothing here will make the\n binding `oneWay`. You can instead pass `false` to disable `oneWay`, making the\n binding two way again.\n */\n oneWay: function(from, flag) {\n var C = this, binding = new C(null, from);\n return binding.oneWay(flag);\n }\n\n});\n\n/**\n An `Ember.Binding` connects the properties of two objects so that whenever\n the value of one property changes, the other property will be changed also.\n\n ## Automatic Creation of Bindings with `/^*Binding/`-named Properties\n\n You do not usually create Binding objects directly but instead describe\n bindings in your class or object definition using automatic binding\n detection.\n\n Properties ending in a `Binding` suffix will be converted to `Ember.Binding`\n instances. The value of this property should be a string representing a path\n to another object or a custom binding instanced created using Binding helpers\n (see \"Customizing Your Bindings\"):\n\n ```\n valueBinding: \"MyApp.someController.title\"\n ```\n\n This will create a binding from `MyApp.someController.title` to the `value`\n property of your object instance automatically. Now the two values will be\n kept in sync.\n\n ## One Way Bindings\n\n One especially useful binding customization you can use is the `oneWay()`\n helper. This helper tells Ember that you are only interested in\n receiving changes on the object you are binding from. For example, if you\n are binding to a preference and you want to be notified if the preference\n has changed, but your object will not be changing the preference itself, you\n could do:\n\n ```\n bigTitlesBinding: Ember.Binding.oneWay(\"MyApp.preferencesController.bigTitles\")\n ```\n\n This way if the value of `MyApp.preferencesController.bigTitles` changes the\n `bigTitles` property of your object will change also. However, if you\n change the value of your `bigTitles` property, it will not update the\n `preferencesController`.\n\n One way bindings are almost twice as fast to setup and twice as fast to\n execute because the binding only has to worry about changes to one side.\n\n You should consider using one way bindings anytime you have an object that\n may be created frequently and you do not intend to change a property; only\n to monitor it for changes. (such as in the example above).\n\n ## Adding Bindings Manually\n\n All of the examples above show you how to configure a custom binding, but the\n result of these customizations will be a binding template, not a fully active\n Binding instance. The binding will actually become active only when you\n instantiate the object the binding belongs to. It is useful however, to\n understand what actually happens when the binding is activated.\n\n For a binding to function it must have at least a `from` property and a `to`\n property. The `from` property path points to the object/key that you want to\n bind from while the `to` path points to the object/key you want to bind to.\n\n When you define a custom binding, you are usually describing the property\n you want to bind from (such as `MyApp.someController.value` in the examples\n above). When your object is created, it will automatically assign the value\n you want to bind `to` based on the name of your binding key. In the\n examples above, during init, Ember objects will effectively call\n something like this on your binding:\n\n ```javascript\n binding = Ember.Binding.from(this.valueBinding).to(\"value\");\n ```\n\n This creates a new binding instance based on the template you provide, and\n sets the to path to the `value` property of the new object. Now that the\n binding is fully configured with a `from` and a `to`, it simply needs to be\n connected to become active. This is done through the `connect()` method:\n\n ```javascript\n binding.connect(this);\n ```\n\n Note that when you connect a binding you pass the object you want it to be\n connected to. This object will be used as the root for both the from and\n to side of the binding when inspecting relative paths. This allows the\n binding to be automatically inherited by subclassed objects as well.\n\n Now that the binding is connected, it will observe both the from and to side\n and relay changes.\n\n If you ever needed to do so (you almost never will, but it is useful to\n understand this anyway), you could manually create an active binding by\n using the `Ember.bind()` helper method. (This is the same method used by\n to setup your bindings on objects):\n\n ```javascript\n Ember.bind(MyApp.anotherObject, \"value\", \"MyApp.someController.value\");\n ```\n\n Both of these code fragments have the same effect as doing the most friendly\n form of binding creation like so:\n\n ```javascript\n MyApp.anotherObject = Ember.Object.create({\n valueBinding: \"MyApp.someController.value\",\n\n // OTHER CODE FOR THIS OBJECT...\n });\n ```\n\n Ember's built in binding creation method makes it easy to automatically\n create bindings for you. You should always use the highest-level APIs\n available, even if you understand how it works underneath.\n\n @class Binding\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Binding = Binding;\n\n\n/**\n Global helper method to create a new binding. Just pass the root object\n along with a `to` and `from` path to create and connect the binding.\n\n @method bind\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n*/\nEmber.bind = function(obj, to, from) {\n return new Ember.Binding(to, from).connect(obj);\n};\n\n/**\n @method oneWay\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n*/\nEmber.oneWay = function(obj, to, from) {\n return new Ember.Binding(to, from).oneWay().connect(obj);\n};\n\n})();\n//@ sourceURL=ember-metal/binding");minispade.register('ember-metal/computed', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/watching');\n\n/**\n@module ember-metal\n*/\n\nEmber.warn(\"The CP_DEFAULT_CACHEABLE flag has been removed and computed properties are always cached by default. Use `volatile` if you don't want caching.\", Ember.ENV.CP_DEFAULT_CACHEABLE !== false);\n\n\nvar get = Ember.get,\n set = Ember.set,\n metaFor = Ember.meta,\n a_slice = [].slice,\n o_create = Ember.create,\n META_KEY = Ember.META_KEY,\n watch = Ember.watch,\n unwatch = Ember.unwatch;\n\n// ..........................................................\n// DEPENDENT KEYS\n//\n\n// data structure:\n// meta.deps = {\n// 'depKey': {\n// 'keyName': count,\n// }\n// }\n\n/*\n This function returns a map of unique dependencies for a\n given object and key.\n*/\nfunction keysForDep(obj, depsMeta, depKey) {\n var keys = depsMeta[depKey];\n if (!keys) {\n // if there are no dependencies yet for a the given key\n // create a new empty list of dependencies for the key\n keys = depsMeta[depKey] = {};\n } else if (!depsMeta.hasOwnProperty(depKey)) {\n // otherwise if the dependency list is inherited from\n // a superclass, clone the hash\n keys = depsMeta[depKey] = o_create(keys);\n }\n return keys;\n}\n\nfunction metaForDeps(obj, meta) {\n return keysForDep(obj, meta, 'deps');\n}\n\nfunction addDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(obj, meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(obj, depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) + 1;\n // Watch the depKey\n watch(obj, depKey);\n }\n}\n\nfunction removeDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(obj, meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(obj, depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) - 1;\n // Watch the depKey\n unwatch(obj, depKey);\n }\n}\n\n// ..........................................................\n// COMPUTED PROPERTY\n//\n\n/**\n @class ComputedProperty\n @namespace Ember\n @extends Ember.Descriptor\n @constructor\n*/\nfunction ComputedProperty(func, opts) {\n this.func = func;\n\n this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;\n this._dependentKeys = opts && opts.dependentKeys;\n this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly);\n}\n\nEmber.ComputedProperty = ComputedProperty;\nComputedProperty.prototype = new Ember.Descriptor();\n\nvar ComputedPropertyPrototype = ComputedProperty.prototype;\n\n/**\n Call on a computed property to set it into cacheable mode. When in this\n mode the computed property will automatically cache the return value of\n your function until one of the dependent keys changes.\n\n ```javascript\n MyApp.president = Ember.Object.create({\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // After calculating the value of this function, Ember will\n // return that value without re-executing this function until\n // one of the dependent properties change.\n }.property('firstName', 'lastName')\n });\n ```\n\n Properties are cacheable by default.\n\n @method cacheable\n @param {Boolean} aFlag optional set to `false` to disable caching\n @chainable\n*/\nComputedPropertyPrototype.cacheable = function(aFlag) {\n this._cacheable = aFlag !== false;\n return this;\n};\n\n/**\n Call on a computed property to set it into non-cached mode. When in this\n mode the computed property will not automatically cache the return value.\n\n ```javascript\n MyApp.outsideService = Ember.Object.create({\n value: function() {\n return OutsideService.getValue();\n }.property().volatile()\n });\n ```\n\n @method volatile\n @chainable\n*/\nComputedPropertyPrototype.volatile = function() {\n return this.cacheable(false);\n};\n\n/**\n Call on a computed property to set it into read-only mode. When in this\n mode the computed property will throw an error when set.\n\n ```javascript\n MyApp.person = Ember.Object.create({\n guid: function() {\n return 'guid-guid-guid';\n }.property().readOnly()\n });\n\n MyApp.person.set('guid', 'new-guid'); // will throw an exception\n ```\n\n @method readOnly\n @chainable\n*/\nComputedPropertyPrototype.readOnly = function(readOnly) {\n this._readOnly = readOnly === undefined || !!readOnly;\n return this;\n};\n\n/**\n Sets the dependent keys on this computed property. Pass any number of\n arguments containing key paths that this computed property depends on.\n\n ```javascript\n MyApp.president = Ember.Object.create({\n fullName: Ember.computed(function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember that this computed property depends on firstName\n // and lastName\n }).property('firstName', 'lastName')\n });\n ```\n\n @method property\n @param {String} path* zero or more property paths\n @chainable\n*/\nComputedPropertyPrototype.property = function() {\n var args = [];\n for (var i = 0, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n this._dependentKeys = args;\n return this;\n};\n\n/**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For example,\n computed property functions may close over variables that are then no longer\n available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n The hash that you pass to the `meta()` function will be saved on the\n computed property descriptor under the `_meta` key. Ember runtime\n exposes a public API for retrieving these values from classes,\n via the `metaForProperty()` function.\n\n @method meta\n @param {Hash} meta\n @chainable\n*/\n\nComputedPropertyPrototype.meta = function(meta) {\n if (arguments.length === 0) {\n return this._meta || {};\n } else {\n this._meta = meta;\n return this;\n }\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.willWatch = function(obj, keyName) {\n // watch already creates meta for this instance\n var meta = obj[META_KEY];\n Ember.assert('watch should have setup meta to be writable', meta.source === obj);\n if (!(keyName in meta.cache)) {\n addDependentKeys(this, obj, keyName, meta);\n }\n};\n\nComputedPropertyPrototype.didUnwatch = function(obj, keyName) {\n var meta = obj[META_KEY];\n Ember.assert('unwatch should have setup meta to be writable', meta.source === obj);\n if (!(keyName in meta.cache)) {\n // unwatch already creates meta for this instance\n removeDependentKeys(this, obj, keyName, meta);\n }\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.didChange = function(obj, keyName) {\n // _suspended is set via a CP.set to ensure we don't clear\n // the cached value set by the setter\n if (this._cacheable && this._suspended !== obj) {\n var meta = metaFor(obj);\n if (keyName in meta.cache) {\n delete meta.cache[keyName];\n if (!meta.watching[keyName]) {\n removeDependentKeys(this, obj, keyName, meta);\n }\n }\n }\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.get = function(obj, keyName) {\n var ret, cache, meta;\n if (this._cacheable) {\n meta = metaFor(obj);\n cache = meta.cache;\n if (keyName in cache) { return cache[keyName]; }\n ret = cache[keyName] = this.func.call(obj, keyName);\n if (!meta.watching[keyName]) {\n addDependentKeys(this, obj, keyName, meta);\n }\n } else {\n ret = this.func.call(obj, keyName);\n }\n return ret;\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.set = function(obj, keyName, value) {\n var cacheable = this._cacheable,\n func = this.func,\n meta = metaFor(obj, cacheable),\n watched = meta.watching[keyName],\n oldSuspended = this._suspended,\n hadCachedValue = false,\n cache = meta.cache,\n cachedValue, ret;\n\n if (this._readOnly) {\n throw new Error('Cannot Set: ' + keyName + ' on: ' + obj.toString() );\n }\n\n this._suspended = obj;\n\n try {\n\n if (cacheable && cache.hasOwnProperty(keyName)) {\n cachedValue = cache[keyName];\n hadCachedValue = true;\n }\n\n // Check if the CP has been wrapped\n if (func.wrappedFunction) { func = func.wrappedFunction; }\n\n // For backwards-compatibility with computed properties\n // that check for arguments.length === 2 to determine if\n // they are being get or set, only pass the old cached\n // value if the computed property opts into a third\n // argument.\n if (func.length === 3) {\n ret = func.call(obj, keyName, value, cachedValue);\n } else if (func.length === 2) {\n ret = func.call(obj, keyName, value);\n } else {\n Ember.defineProperty(obj, keyName, null, cachedValue);\n Ember.set(obj, keyName, value);\n return;\n }\n\n if (hadCachedValue && cachedValue === ret) { return; }\n\n if (watched) { Ember.propertyWillChange(obj, keyName); }\n\n if (hadCachedValue) {\n delete cache[keyName];\n }\n\n if (cacheable) {\n if (!watched && !hadCachedValue) {\n addDependentKeys(this, obj, keyName, meta);\n }\n cache[keyName] = ret;\n }\n\n if (watched) { Ember.propertyDidChange(obj, keyName); }\n } finally {\n this._suspended = oldSuspended;\n }\n return ret;\n};\n\n/* called when property is defined */\nComputedPropertyPrototype.setup = function(obj, keyName) {\n var meta = obj[META_KEY];\n if (meta && meta.watching[keyName]) {\n addDependentKeys(this, obj, keyName, metaFor(obj));\n }\n};\n\n/* called before property is overridden */\nComputedPropertyPrototype.teardown = function(obj, keyName) {\n var meta = metaFor(obj);\n\n if (meta.watching[keyName] || keyName in meta.cache) {\n removeDependentKeys(this, obj, keyName, meta);\n }\n\n if (this._cacheable) { delete meta.cache[keyName]; }\n\n return null; // no value to restore\n};\n\n\n/**\n This helper returns a new property descriptor that wraps the passed\n computed property function. You can use this helper to define properties\n with mixins or via `Ember.defineProperty()`.\n\n The function you pass will be used to both get and set property values.\n The function should accept two parameters, key and value. If value is not\n undefined you should set the value first. In either case return the\n current value of the property.\n\n @method computed\n @for Ember\n @param {Function} func The computed property function.\n @return {Ember.ComputedProperty} property descriptor instance\n*/\nEmber.computed = function(func) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n func = a_slice.call(arguments, -1)[0];\n }\n\n if ( typeof func !== \"function\" ) {\n throw new Error(\"Computed Property declared without a property function\");\n }\n\n var cp = new ComputedProperty(func);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n};\n\n/**\n Returns the cached value for a property, if one exists.\n This can be useful for peeking at the value of a computed\n property that is generated lazily, without accidentally causing\n it to be created.\n\n @method cacheFor\n @for Ember\n @param {Object} obj the object whose property you want to check\n @param {String} key the name of the property whose cached value you want\n to return\n*/\nEmber.cacheFor = function cacheFor(obj, key) {\n var cache = metaFor(obj, false).cache;\n\n if (cache && key in cache) {\n return cache[key];\n }\n};\n\n/**\n @method computed.not\n @for Ember\n @param {String} dependentKey\n*/\nEmber.computed.not = function(dependentKey) {\n return Ember.computed(dependentKey, function(key) {\n return !get(this, dependentKey);\n });\n};\n\n/**\n @method computed.none\n @for Ember\n @param {String} dependentKey\n*/\nEmber.computed.none = function(dependentKey) {\n return Ember.computed(dependentKey, function(key) {\n var val = get(this, dependentKey);\n return Ember.isNone(val);\n });\n};\n\n/**\n @method computed.empty\n @for Ember\n @param {String} dependentKey\n*/\nEmber.computed.empty = function(dependentKey) {\n return Ember.computed(dependentKey, function(key) {\n var val = get(this, dependentKey);\n return Ember.isEmpty(val);\n });\n};\n\n/**\n @method computed.bool\n @for Ember\n @param {String} dependentKey\n*/\nEmber.computed.bool = function(dependentKey) {\n return Ember.computed(dependentKey, function(key) {\n return !!get(this, dependentKey);\n });\n};\n\n/**\n @method computed.alias\n @for Ember\n\n @param {String} dependentKey\n*/\nEmber.computed.alias = function(dependentKey) {\n return Ember.computed(dependentKey, function(key, value){\n if (arguments.length > 1) {\n set(this, dependentKey, value);\n return value;\n } else {\n return get(this, dependentKey);\n }\n });\n};\n\n})();\n//@ sourceURL=ember-metal/computed");minispade.register('ember-metal/core', "(function() {/*globals Em:true ENV */\n\n/**\n@module ember\n@submodule ember-metal\n*/\n\n/**\n All Ember methods and functions are defined inside of this namespace. You\n generally should not add new properties to this namespace as it may be\n overwritten by future versions of Ember.\n\n You can also use the shorthand `Em` instead of `Ember`.\n\n Ember-Runtime is a framework that provides core functions for Ember including\n cross-platform functions, support for property observing and objects. Its\n focus is on small size and performance. You can use this in place of or\n along-side other cross-platform libraries such as jQuery.\n\n The core Runtime framework is based on the jQuery API with a number of\n performance optimizations.\n\n @class Ember\n @static\n @version 1.0.0-rc.1\n*/\n\nif ('undefined' === typeof Ember) {\n // Create core object. Make it act like an instance of Ember.Namespace so that\n // objects assigned to it are given a sane string representation.\n Ember = {};\n}\n\n// Default imports, exports and lookup to the global object;\nvar imports = Ember.imports = Ember.imports || this;\nvar exports = Ember.exports = Ember.exports || this;\nvar lookup = Ember.lookup = Ember.lookup || this;\n\n// aliases needed to keep minifiers from removing the global context\nexports.Em = exports.Ember = Em = Ember;\n\n// Make sure these are set whether Ember was already defined or not\n\nEmber.isNamespace = true;\n\nEmber.toString = function() { return \"Ember\"; };\n\n\n/**\n @property VERSION\n @type String\n @default '1.0.0-rc.1'\n @final\n*/\nEmber.VERSION = '1.0.0-rc.1';\n\n/**\n Standard environmental variables. You can define these in a global `ENV`\n variable before loading Ember to control various configuration\n settings.\n\n @property ENV\n @type Hash\n*/\nEmber.ENV = Ember.ENV || ('undefined' === typeof ENV ? {} : ENV);\n\nEmber.config = Ember.config || {};\n\n// ..........................................................\n// BOOTSTRAP\n//\n\n/**\n Determines whether Ember should enhances some built-in object prototypes to\n provide a more friendly API. If enabled, a few methods will be added to\n `Function`, `String`, and `Array`. `Object.prototype` will not be enhanced,\n which is the one that causes most trouble for people.\n\n In general we recommend leaving this option set to true since it rarely\n conflicts with other code. If you need to turn it off however, you can\n define an `ENV.EXTEND_PROTOTYPES` config to disable it.\n\n @property EXTEND_PROTOTYPES\n @type Boolean\n @default true\n*/\nEmber.EXTEND_PROTOTYPES = Ember.ENV.EXTEND_PROTOTYPES;\n\nif (typeof Ember.EXTEND_PROTOTYPES === 'undefined') {\n Ember.EXTEND_PROTOTYPES = true;\n}\n\n/**\n Determines whether Ember logs a full stack trace during deprecation warnings\n\n @property LOG_STACKTRACE_ON_DEPRECATION\n @type Boolean\n @default true\n*/\nEmber.LOG_STACKTRACE_ON_DEPRECATION = (Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== false);\n\n/**\n Determines whether Ember should add ECMAScript 5 shims to older browsers.\n\n @property SHIM_ES5\n @type Boolean\n @default Ember.EXTEND_PROTOTYPES\n*/\nEmber.SHIM_ES5 = (Ember.ENV.SHIM_ES5 === false) ? false : Ember.EXTEND_PROTOTYPES;\n\n/**\n Determines whether Ember logs info about version of used libraries\n\n @property LOG_VERSION\n @type Boolean\n @default true\n*/\nEmber.LOG_VERSION = (Ember.ENV.LOG_VERSION === false) ? false : true;\n\n/**\n Empty function. Useful for some operations.\n\n @method K\n @private\n @return {Object}\n*/\nEmber.K = function() { return this; };\n\n\n// Stub out the methods defined by the ember-debug package in case it's not loaded\n\nif ('undefined' === typeof Ember.assert) { Ember.assert = Ember.K; }\nif ('undefined' === typeof Ember.warn) { Ember.warn = Ember.K; }\nif ('undefined' === typeof Ember.debug) { Ember.debug = Ember.K; }\nif ('undefined' === typeof Ember.deprecate) { Ember.deprecate = Ember.K; }\nif ('undefined' === typeof Ember.deprecateFunc) {\n Ember.deprecateFunc = function(_, func) { return func; };\n}\n\n/**\n Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from\n jQuery master. We'll just bootstrap our own uuid now.\n\n @property uuid\n @type Number\n @private\n*/\nEmber.uuid = 0;\n\n// ..........................................................\n// LOGGER\n//\n\nfunction consoleMethod(name) {\n if (imports.console && imports.console[name]) {\n // Older IE doesn't support apply, but Chrome needs it\n if (imports.console[name].apply) {\n return function() {\n imports.console[name].apply(imports.console, arguments);\n };\n } else {\n return function() {\n var message = Array.prototype.join.call(arguments, ', ');\n imports.console[name](message);\n };\n }\n }\n}\n\n/**\n Inside Ember-Metal, simply uses the methods from `imports.console`.\n Override this to provide more robust logging functionality.\n\n @class Logger\n @namespace Ember\n*/\nEmber.Logger = {\n log: consoleMethod('log') || Ember.K,\n warn: consoleMethod('warn') || Ember.K,\n error: consoleMethod('error') || Ember.K,\n info: consoleMethod('info') || Ember.K,\n debug: consoleMethod('debug') || consoleMethod('info') || Ember.K\n};\n\n\n// ..........................................................\n// ERROR HANDLING\n//\n\n/**\n A function may be assigned to `Ember.onerror` to be called when Ember\n internals encounter an error. This is useful for specialized error handling\n and reporting code.\n\n @event onerror\n @for Ember\n @param {Exception} error the error object\n*/\nEmber.onerror = null;\n\n/**\n @private\n\n Wrap code block in a try/catch if {{#crossLink \"Ember/onerror\"}}{{/crossLink}} is set.\n\n @method handleErrors\n @for Ember\n @param {Function} func\n @param [context]\n*/\nEmber.handleErrors = function(func, context) {\n // Unfortunately in some browsers we lose the backtrace if we rethrow the existing error,\n // so in the event that we don't have an `onerror` handler we don't wrap in a try/catch\n if ('function' === typeof Ember.onerror) {\n try {\n return func.apply(context || this);\n } catch (error) {\n Ember.onerror(error);\n }\n } else {\n return func.apply(context || this);\n }\n};\n\nEmber.merge = function(original, updates) {\n for (var prop in updates) {\n if (!updates.hasOwnProperty(prop)) { continue; }\n original[prop] = updates[prop];\n }\n};\n\n/**\n Returns true if the passed value is null or undefined. This avoids errors\n from JSLint complaining about use of ==, which can be technically\n confusing.\n\n ```javascript\n Ember.isNone(); // true\n Ember.isNone(null); // true\n Ember.isNone(undefined); // true\n Ember.isNone(''); // false\n Ember.isNone([]); // false\n Ember.isNone(function(){}); // false\n ```\n\n @method isNone\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n*/\nEmber.isNone = function(obj) {\n return obj === null || obj === undefined;\n};\nEmber.none = Ember.deprecateFunc(\"Ember.none is deprecated. Please use Ember.isNone instead.\", Ember.isNone);\n\n/**\n Verifies that a value is `null` or an empty string, empty array,\n or empty function.\n\n Constrains the rules on `Ember.isNone` by returning false for empty\n string and empty arrays.\n\n ```javascript\n Ember.isEmpty(); // true\n Ember.isEmpty(null); // true\n Ember.isEmpty(undefined); // true\n Ember.isEmpty(''); // true\n Ember.isEmpty([]); // true\n Ember.isEmpty('Adam Hawkins'); // false\n Ember.isEmpty([0,1,2]); // false\n ```\n\n @method isEmpty\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n*/\nEmber.isEmpty = function(obj) {\n return obj === null || obj === undefined || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);\n};\nEmber.empty = Ember.deprecateFunc(\"Ember.empty is deprecated. Please use Ember.isEmpty instead.\", Ember.isEmpty) ;\n\n\n})();\n//@ sourceURL=ember-metal/core");minispade.register('ember-metal/enumerable_utils', "(function() {var utils = Ember.EnumerableUtils = {\n map: function(obj, callback, thisArg) {\n return obj.map ? obj.map.call(obj, callback, thisArg) : Array.prototype.map.call(obj, callback, thisArg);\n },\n\n forEach: function(obj, callback, thisArg) {\n return obj.forEach ? obj.forEach.call(obj, callback, thisArg) : Array.prototype.forEach.call(obj, callback, thisArg);\n },\n\n indexOf: function(obj, element, index) {\n return obj.indexOf ? obj.indexOf.call(obj, element, index) : Array.prototype.indexOf.call(obj, element, index);\n },\n\n indexesOf: function(obj, elements) {\n return elements === undefined ? [] : utils.map(elements, function(item) {\n return utils.indexOf(obj, item);\n });\n },\n\n addObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index === -1) { array.push(item); }\n },\n\n removeObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index !== -1) { array.splice(index, 1); }\n },\n\n replace: function(array, idx, amt, objects) {\n if (array.replace) {\n return array.replace(idx, amt, objects);\n } else {\n var args = Array.prototype.concat.apply([idx, amt], objects);\n return array.splice.apply(array, args);\n }\n },\n\n intersection: function(array1, array2) {\n var intersection = [];\n\n array1.forEach(function(element) {\n if (array2.indexOf(element) >= 0) {\n intersection.push(element);\n }\n });\n\n return intersection;\n }\n};\n\n})();\n//@ sourceURL=ember-metal/enumerable_utils");minispade.register('ember-metal/events', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\n\n/**\n@module ember-metal\n*/\n\nvar o_create = Ember.create,\n metaFor = Ember.meta,\n META_KEY = Ember.META_KEY;\n\n/*\n The event system uses a series of nested hashes to store listeners on an\n object. When a listener is registered, or when an event arrives, these\n hashes are consulted to determine which target and action pair to invoke.\n\n The hashes are stored in the object's meta hash, and look like this:\n\n // Object's meta hash\n {\n listeners: { // variable name: `listenerSet`\n \"foo:changed\": [ // variable name: `actions`\n [target, method, onceFlag, suspendedFlag]\n ]\n }\n }\n\n*/\n\nfunction indexOf(array, target, method) {\n var index = -1;\n for (var i = 0, l = array.length; i < l; i++) {\n if (target === array[i][0] && method === array[i][1]) { index = i; break; }\n }\n return index;\n}\n\nfunction actionsFor(obj, eventName) {\n var meta = metaFor(obj, true),\n actions;\n\n if (!meta.listeners) { meta.listeners = {}; }\n\n if (!meta.hasOwnProperty('listeners')) {\n // setup inherited copy of the listeners object\n meta.listeners = o_create(meta.listeners);\n }\n\n actions = meta.listeners[eventName];\n\n // if there are actions, but the eventName doesn't exist in our listeners, then copy them from the prototype\n if (actions && !meta.listeners.hasOwnProperty(eventName)) {\n actions = meta.listeners[eventName] = meta.listeners[eventName].slice();\n } else if (!actions) {\n actions = meta.listeners[eventName] = [];\n }\n\n return actions;\n}\n\nfunction actionsUnion(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 1; i >= 0; i--) {\n var target = actions[i][0],\n method = actions[i][1],\n once = actions[i][2],\n suspended = actions[i][3],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex === -1) {\n otherActions.push([target, method, once, suspended]);\n }\n }\n}\n\nfunction actionsDiff(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName],\n diffActions = [];\n\n if (!actions) { return; }\n for (var i = actions.length - 1; i >= 0; i--) {\n var target = actions[i][0],\n method = actions[i][1],\n once = actions[i][2],\n suspended = actions[i][3],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex !== -1) { continue; }\n\n otherActions.push([target, method, once, suspended]);\n diffActions.push([target, method, once, suspended]);\n }\n\n return diffActions;\n}\n\n/**\n Add an event listener\n\n @method addListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Boolean} once A flag whether a function should only be called once\n*/\nfunction addListener(obj, eventName, target, method, once) {\n Ember.assert(\"You must pass at least an object and event name to Ember.addListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) { return; }\n\n actions.push([target, method, once, undefined]);\n\n if ('function' === typeof obj.didAddListener) {\n obj.didAddListener(eventName, target, method);\n }\n}\n\n/**\n Remove an event listener\n\n Arguments should match those passed to {{#crossLink \"Ember/addListener\"}}{{/crossLink}}\n\n @method removeListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n*/\nfunction removeListener(obj, eventName, target, method) {\n Ember.assert(\"You must pass at least an object and event name to Ember.removeListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n function _removeListener(target, method, once) {\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n // action doesn't exist, give up silently\n if (actionIndex === -1) { return; }\n\n actions.splice(actionIndex, 1);\n\n if ('function' === typeof obj.didRemoveListener) {\n obj.didRemoveListener(eventName, target, method);\n }\n }\n\n if (method) {\n _removeListener(target, method);\n } else {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 1; i >= 0; i--) {\n _removeListener(actions[i][0], actions[i][1]);\n }\n }\n}\n\n/**\n @private\n\n Suspend listener during callback.\n\n This should only be used by the target of the event listener\n when it is taking an action that would cause the event, e.g.\n an object might suspend its property change listener while it is\n setting that property.\n\n @method suspendListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n*/\nfunction suspendListener(obj, eventName, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method),\n action;\n\n if (actionIndex !== -1) {\n action = actions[actionIndex].slice(); // copy it, otherwise we're modifying a shared object\n action[3] = true; // mark the action as suspended\n actions[actionIndex] = action; // replace the shared object with our copy\n }\n\n function tryable() { return callback.call(target); }\n function finalizer() { if (action) { action[3] = undefined; } }\n\n return Ember.tryFinally(tryable, finalizer);\n}\n\n/**\n @private\n\n Suspend listener during callback.\n\n This should only be used by the target of the event listener\n when it is taking an action that would cause the event, e.g.\n an object might suspend its property change listener while it is\n setting that property.\n\n @method suspendListener\n @for Ember\n @param obj\n @param {Array} eventName Array of event names\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n*/\nfunction suspendListeners(obj, eventNames, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var suspendedActions = [],\n eventName, actions, action, i, l;\n\n for (i=0, l=eventNames.length; i<l; i++) {\n eventName = eventNames[i];\n actions = actionsFor(obj, eventName);\n var actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n action = actions[actionIndex].slice();\n action[3] = true;\n actions[actionIndex] = action;\n suspendedActions.push(action);\n }\n }\n\n function tryable() { return callback.call(target); }\n\n function finalizer() {\n for (i = 0, l = suspendedActions.length; i < l; i++) {\n suspendedActions[i][3] = undefined;\n }\n }\n\n return Ember.tryFinally(tryable, finalizer);\n}\n\n/**\n @private\n\n Return a list of currently watched events\n\n @method watchedEvents\n @for Ember\n @param obj\n*/\nfunction watchedEvents(obj) {\n var listeners = obj[META_KEY].listeners, ret = [];\n\n if (listeners) {\n for(var eventName in listeners) {\n if (listeners[eventName]) { ret.push(eventName); }\n }\n }\n return ret;\n}\n\n/**\n @method sendEvent\n @for Ember\n @param obj\n @param {String} eventName\n @param {Array} params\n @param {Array} actions\n @return true\n*/\nfunction sendEvent(obj, eventName, params, actions) {\n // first give object a chance to handle it\n if (obj !== Ember && 'function' === typeof obj.sendEvent) {\n obj.sendEvent(eventName, params);\n }\n\n if (!actions) {\n var meta = obj[META_KEY];\n actions = meta && meta.listeners && meta.listeners[eventName];\n }\n\n if (!actions) { return; }\n\n for (var i = actions.length - 1; i >= 0; i--) { // looping in reverse for once listeners\n if (!actions[i] || actions[i][3] === true) { continue; }\n\n var target = actions[i][0],\n method = actions[i][1],\n once = actions[i][2];\n\n if (once) { removeListener(obj, eventName, target, method); }\n if (!target) { target = obj; }\n if ('string' === typeof method) { method = target[method]; }\n if (params) {\n method.apply(target, params);\n } else {\n method.apply(target);\n }\n }\n return true;\n}\n\n/**\n @private\n @method hasListeners\n @for Ember\n @param obj\n @param {String} eventName\n*/\nfunction hasListeners(obj, eventName) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n return !!(actions && actions.length);\n}\n\n/**\n @private\n @method listenersFor\n @for Ember\n @param obj\n @param {String} eventName\n*/\nfunction listenersFor(obj, eventName) {\n var ret = [];\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return ret; }\n\n for (var i = 0, l = actions.length; i < l; i++) {\n var target = actions[i][0],\n method = actions[i][1];\n ret.push([target, method]);\n }\n\n return ret;\n}\n\nEmber.addListener = addListener;\nEmber.removeListener = removeListener;\nEmber._suspendListener = suspendListener;\nEmber._suspendListeners = suspendListeners;\nEmber.sendEvent = sendEvent;\nEmber.hasListeners = hasListeners;\nEmber.watchedEvents = watchedEvents;\nEmber.listenersFor = listenersFor;\nEmber.listenersDiff = actionsDiff;\nEmber.listenersUnion = actionsUnion;\n\n})();\n//@ sourceURL=ember-metal/events");minispade.register('ember-metal/instrumentation', "(function() {minispade.require('ember-metal/utils'); // Ember.tryCatchFinally\n\n/**\n The purpose of the Ember Instrumentation module is\n to provide efficient, general-purpose instrumentation\n for Ember.\n\n Subscribe to a listener by using `Ember.subscribe`:\n\n ```javascript\n Ember.subscribe(\"render\", {\n before: function(name, timestamp, payload) {\n\n },\n\n after: function(name, timestamp, payload) {\n\n }\n });\n ```\n\n If you return a value from the `before` callback, that same\n value will be passed as a fourth parameter to the `after`\n callback.\n\n Instrument a block of code by using `Ember.instrument`:\n\n ```javascript\n Ember.instrument(\"render.handlebars\", payload, function() {\n // rendering logic\n }, binding);\n ```\n\n Event names passed to `Ember.instrument` are namespaced\n by periods, from more general to more specific. Subscribers\n can listen for events by whatever level of granularity they\n are interested in.\n\n In the above example, the event is `render.handlebars`,\n and the subscriber listened for all events beginning with\n `render`. It would receive callbacks for events named\n `render`, `render.handlebars`, `render.container`, or\n even `render.handlebars.layout`.\n\n @class Instrumentation\n @namespace Ember\n @static\n*/\nEmber.Instrumentation = {};\n\nvar subscribers = [], cache = {};\n\nvar populateListeners = function(name) {\n var listeners = [], subscriber;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n subscriber = subscribers[i];\n if (subscriber.regex.test(name)) {\n listeners.push(subscriber.object);\n }\n }\n\n cache[name] = listeners;\n return listeners;\n};\n\nvar time = (function() {\n\tvar perf = 'undefined' !== typeof window ? window.performance || {} : {};\n\tvar fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow;\n\t// fn.bind will be available in all the browsers that support the advanced window.performance... ;-)\n\treturn fn ? fn.bind(perf) : function() { return +new Date(); };\n})();\n\n\nEmber.Instrumentation.instrument = function(name, payload, callback, binding) {\n var listeners = cache[name], timeName, ret;\n\n if (Ember.STRUCTURED_PROFILE) {\n timeName = name + \": \" + payload.object;\n console.time(timeName);\n }\n\n if (!listeners) {\n listeners = populateListeners(name);\n }\n\n if (listeners.length === 0) {\n ret = callback.call(binding);\n if (Ember.STRUCTURED_PROFILE) { console.timeEnd(timeName); }\n return ret;\n }\n\n var beforeValues = [], listener, i, l;\n\n function tryable(){\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n }\n\n function catchable(e){\n payload = payload || {};\n payload.exception = e;\n }\n\n function finalizer() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n\n if (Ember.STRUCTURED_PROFILE) {\n console.timeEnd(timeName);\n }\n }\n\n return Ember.tryCatchFinally(tryable, catchable, finalizer);\n};\n\nEmber.Instrumentation.subscribe = function(pattern, object) {\n var paths = pattern.split(\".\"), path, regex = [];\n\n for (var i=0, l=paths.length; i<l; i++) {\n path = paths[i];\n if (path === \"*\") {\n regex.push(\"[^\\\\.]*\");\n } else {\n regex.push(path);\n }\n }\n\n regex = regex.join(\"\\\\.\");\n regex = regex + \"(\\\\..*)?\";\n\n var subscriber = {\n pattern: pattern,\n regex: new RegExp(\"^\" + regex + \"$\"),\n object: object\n };\n\n subscribers.push(subscriber);\n cache = {};\n\n return subscriber;\n};\n\nEmber.Instrumentation.unsubscribe = function(subscriber) {\n var index;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n if (subscribers[i] === subscriber) {\n index = i;\n }\n }\n\n subscribers.splice(index, 1);\n cache = {};\n};\n\nEmber.Instrumentation.reset = function() {\n subscribers = [];\n cache = {};\n};\n\nEmber.instrument = Ember.Instrumentation.instrument;\nEmber.subscribe = Ember.Instrumentation.subscribe;\n\n})();\n//@ sourceURL=ember-metal/instrumentation");minispade.register('ember-metal', "(function() {/**\nEmber Metal\n\n@module ember\n@submodule ember-metal\n*/\nminispade.require('ember-metal/core');\nminispade.require('ember-metal/instrumentation');\nminispade.require('ember-metal/map');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/accessors');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/computed');\nminispade.require('ember-metal/watching');\nminispade.require('ember-metal/events');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/mixin');\nminispade.require('ember-metal/binding');\nminispade.require('ember-metal/run_loop');\n\n})();\n//@ sourceURL=ember-metal");minispade.register('ember-metal/map', "(function() {/**\n@module ember-metal\n*/\n\n/*\n JavaScript (before ES6) does not have a Map implementation. Objects,\n which are often used as dictionaries, may only have Strings as keys.\n\n Because Ember has a way to get a unique identifier for every object\n via `Ember.guidFor`, we can implement a performant Map with arbitrary\n keys. Because it is commonly used in low-level bookkeeping, Map is\n implemented as a pure JavaScript object for performance.\n\n This implementation follows the current iteration of the ES6 proposal for\n maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),\n with two exceptions. First, because we need our implementation to be pleasant\n on older browsers, we do not use the `delete` name (using `remove` instead).\n Second, as we do not have the luxury of in-VM iteration, we implement a\n forEach method for iteration.\n\n Map is mocked out to look like an Ember object, so you can do\n `Ember.Map.create()` for symmetry with other Ember classes.\n*/\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/core');\n\nvar guidFor = Ember.guidFor,\n indexOf = Ember.ArrayPolyfills.indexOf;\n\nvar copy = function(obj) {\n var output = {};\n\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) { output[prop] = obj[prop]; }\n }\n\n return output;\n};\n\nvar copyMap = function(original, newObject) {\n var keys = original.keys.copy(),\n values = copy(original.values);\n\n newObject.keys = keys;\n newObject.values = values;\n\n return newObject;\n};\n\n/**\n This class is used internally by Ember and Ember Data.\n Please do not use it at this time. We plan to clean it up\n and add many tests soon.\n\n @class OrderedSet\n @namespace Ember\n @constructor\n @private\n*/\nvar OrderedSet = Ember.OrderedSet = function() {\n this.clear();\n};\n\n/**\n @method create\n @static\n @return {Ember.OrderedSet}\n*/\nOrderedSet.create = function() {\n return new OrderedSet();\n};\n\n\nOrderedSet.prototype = {\n /**\n @method clear\n */\n clear: function() {\n this.presenceSet = {};\n this.list = [];\n },\n\n /**\n @method add\n @param obj\n */\n add: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n if (guid in presenceSet) { return; }\n\n presenceSet[guid] = true;\n list.push(obj);\n },\n\n /**\n @method remove\n @param obj\n */\n remove: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n delete presenceSet[guid];\n\n var index = indexOf.call(list, obj);\n if (index > -1) {\n list.splice(index, 1);\n }\n },\n\n /**\n @method isEmpty\n @return {Boolean}\n */\n isEmpty: function() {\n return this.list.length === 0;\n },\n\n /**\n @method has\n @param obj\n @return {Boolean}\n */\n has: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet;\n\n return guid in presenceSet;\n },\n\n /**\n @method forEach\n @param {Function} fn\n @param self\n */\n forEach: function(fn, self) {\n // allow mutation during iteration\n var list = this.list.slice();\n\n for (var i = 0, j = list.length; i < j; i++) {\n fn.call(self, list[i]);\n }\n },\n\n /**\n @method toArray\n @return {Array}\n */\n toArray: function() {\n return this.list.slice();\n },\n\n /**\n @method copy\n @return {Ember.OrderedSet}\n */\n copy: function() {\n var set = new OrderedSet();\n\n set.presenceSet = copy(this.presenceSet);\n set.list = this.list.slice();\n\n return set;\n }\n};\n\n/**\n A Map stores values indexed by keys. Unlike JavaScript's\n default Objects, the keys of a Map can be any JavaScript\n object.\n\n Internally, a Map has two data structures:\n\n 1. `keys`: an OrderedSet of all of the existing keys\n 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)`\n\n When a key/value pair is added for the first time, we\n add the key to the `keys` OrderedSet, and create or\n replace an entry in `values`. When an entry is deleted,\n we delete its entry in `keys` and `values`.\n\n @class Map\n @namespace Ember\n @private\n @constructor\n*/\nvar Map = Ember.Map = function() {\n this.keys = Ember.OrderedSet.create();\n this.values = {};\n};\n\n/**\n @method create\n @static\n*/\nMap.create = function() {\n return new Map();\n};\n\nMap.prototype = {\n /**\n Retrieve the value associated with a given key.\n\n @method get\n @param {anything} key\n @return {anything} the value associated with the key, or `undefined`\n */\n get: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values[guid];\n },\n\n /**\n Adds a value to the map. If a value for the given key has already been\n provided, the new value will replace the old value.\n\n @method set\n @param {anything} key\n @param {anything} value\n */\n set: function(key, value) {\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n keys.add(key);\n values[guid] = value;\n },\n\n /**\n Removes a value from the map for an associated key.\n\n @method remove\n @param {anything} key\n @return {Boolean} true if an item was removed, false otherwise\n */\n remove: function(key) {\n // don't use ES6 \"delete\" because it will be annoying\n // to use in browsers that are not ES6 friendly;\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key),\n value;\n\n if (values.hasOwnProperty(guid)) {\n keys.remove(key);\n value = values[guid];\n delete values[guid];\n return true;\n } else {\n return false;\n }\n },\n\n /**\n Check whether a key is present.\n\n @method has\n @param {anything} key\n @return {Boolean} true if the item was present, false otherwise\n */\n has: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values.hasOwnProperty(guid);\n },\n\n /**\n Iterate over all the keys and values. Calls the function once\n for each key, passing in the key and value, in that order.\n\n The keys are guaranteed to be iterated over in insertion order.\n\n @method forEach\n @param {Function} callback\n @param {anything} self if passed, the `this` value inside the\n callback. By default, `this` is the map.\n */\n forEach: function(callback, self) {\n var keys = this.keys,\n values = this.values;\n\n keys.forEach(function(key) {\n var guid = guidFor(key);\n callback.call(self, key, values[guid]);\n });\n },\n\n /**\n @method copy\n @return {Ember.Map}\n */\n copy: function() {\n return copyMap(this, new Map());\n }\n};\n\n/**\n @class MapWithDefault\n @namespace Ember\n @extends Ember.Map\n @private\n @constructor\n @param [options]\n @param {anything} [options.defaultValue]\n*/\nvar MapWithDefault = Ember.MapWithDefault = function(options) {\n Map.call(this);\n this.defaultValue = options.defaultValue;\n};\n\n/**\n @method create\n @static\n @param [options]\n @param {anything} [options.defaultValue]\n @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns\n `Ember.MapWithDefault` otherwise returns `Ember.Map`\n*/\nMapWithDefault.create = function(options) {\n if (options) {\n return new MapWithDefault(options);\n } else {\n return new Map();\n }\n};\n\nMapWithDefault.prototype = Ember.create(Map.prototype);\n\n/**\n Retrieve the value associated with a given key.\n\n @method get\n @param {anything} key\n @return {anything} the value associated with the key, or the default value\n*/\nMapWithDefault.prototype.get = function(key) {\n var hasValue = this.has(key);\n\n if (hasValue) {\n return Map.prototype.get.call(this, key);\n } else {\n var defaultValue = this.defaultValue(key);\n this.set(key, defaultValue);\n return defaultValue;\n }\n};\n\n/**\n @method copy\n @return {Ember.MapWithDefault}\n*/\nMapWithDefault.prototype.copy = function() {\n return copyMap(this, new MapWithDefault({\n defaultValue: this.defaultValue\n }));\n};\n\n})();\n//@ sourceURL=ember-metal/map");minispade.register('ember-metal/mixin', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/accessors');\nminispade.require('ember-metal/computed');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/binding');\n\n/**\n@module ember-metal\n*/\n\nvar Mixin, REQUIRED, Alias,\n a_map = Ember.ArrayPolyfills.map,\n a_indexOf = Ember.ArrayPolyfills.indexOf,\n a_forEach = Ember.ArrayPolyfills.forEach,\n a_slice = [].slice,\n o_create = Ember.create,\n defineProperty = Ember.defineProperty,\n guidFor = Ember.guidFor;\n\nfunction mixinsMeta(obj) {\n var m = Ember.meta(obj, true), ret = m.mixins;\n if (!ret) {\n ret = m.mixins = {};\n } else if (!m.hasOwnProperty('mixins')) {\n ret = m.mixins = o_create(ret);\n }\n return ret;\n}\n\nfunction initMixin(mixin, args) {\n if (args && args.length > 0) {\n mixin.mixins = a_map.call(args, function(x) {\n if (x instanceof Mixin) { return x; }\n\n // Note: Manually setup a primitive mixin here. This is the only\n // way to actually get a primitive mixin. This way normal creation\n // of mixins will give you combined mixins...\n var mixin = new Mixin();\n mixin.properties = x;\n return mixin;\n });\n }\n return mixin;\n}\n\nfunction isMethod(obj) {\n return 'function' === typeof obj &&\n obj.isMethod !== false &&\n obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;\n}\n\nvar CONTINUE = {};\n\nfunction mixinProperties(mixinsMeta, mixin) {\n var guid;\n\n if (mixin instanceof Mixin) {\n guid = guidFor(mixin);\n if (mixinsMeta[guid]) { return CONTINUE; }\n mixinsMeta[guid] = mixin;\n return mixin.properties;\n } else {\n return mixin; // apply anonymous mixin properties\n }\n}\n\nfunction concatenatedProperties(props, values, base) {\n var concats;\n\n // reset before adding each new mixin to pickup concats from previous\n concats = values.concatenatedProperties || base.concatenatedProperties;\n if (props.concatenatedProperties) {\n concats = concats ? concats.concat(props.concatenatedProperties) : props.concatenatedProperties;\n }\n\n return concats;\n}\n\nfunction giveDescriptorSuper(meta, key, property, values, descs) {\n var superProperty;\n\n // Computed properties override methods, and do not call super to them\n if (values[key] === undefined) {\n // Find the original descriptor in a parent mixin\n superProperty = descs[key];\n }\n\n // If we didn't find the original descriptor in a parent mixin, find\n // it on the original object.\n superProperty = superProperty || meta.descs[key];\n\n if (!superProperty || !(superProperty instanceof Ember.ComputedProperty)) {\n return property;\n }\n\n // Since multiple mixins may inherit from the same parent, we need\n // to clone the computed property so that other mixins do not receive\n // the wrapped version.\n property = o_create(property);\n property.func = Ember.wrap(property.func, superProperty.func);\n\n return property;\n}\n\nfunction giveMethodSuper(obj, key, method, values, descs) {\n var superMethod;\n\n // Methods overwrite computed properties, and do not call super to them.\n if (descs[key] === undefined) {\n // Find the original method in a parent mixin\n superMethod = values[key];\n }\n\n // If we didn't find the original value in a parent mixin, find it in\n // the original object\n superMethod = superMethod || obj[key];\n\n // Only wrap the new method if the original method was a function\n if ('function' !== typeof superMethod) {\n return method;\n }\n\n return Ember.wrap(method, superMethod);\n}\n\nfunction applyConcatenatedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n return baseValue.concat(value);\n } else {\n return Ember.makeArray(baseValue).concat(value);\n }\n } else {\n return Ember.makeArray(value);\n }\n}\n\nfunction addNormalizedProperty(base, key, value, meta, descs, values, concats) {\n if (value instanceof Ember.Descriptor) {\n if (value === REQUIRED && descs[key]) { return CONTINUE; }\n\n // Wrap descriptor function to implement\n // _super() if needed\n if (value.func) {\n value = giveDescriptorSuper(meta, key, value, values, descs);\n }\n\n descs[key] = value;\n values[key] = undefined;\n } else {\n // impl super if needed...\n if (isMethod(value)) {\n value = giveMethodSuper(base, key, value, values, descs);\n } else if ((concats && a_indexOf.call(concats, key) >= 0) || key === 'concatenatedProperties') {\n value = applyConcatenatedProperties(base, key, value, values);\n }\n\n descs[key] = undefined;\n values[key] = value;\n }\n}\n\nfunction mergeMixins(mixins, m, descs, values, base) {\n var mixin, props, key, concats, meta;\n\n function removeKeys(keyName) {\n delete descs[keyName];\n delete values[keyName];\n }\n\n for(var i=0, l=mixins.length; i<l; i++) {\n mixin = mixins[i];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n props = mixinProperties(m, mixin);\n if (props === CONTINUE) { continue; }\n\n if (props) {\n meta = Ember.meta(base);\n concats = concatenatedProperties(props, values, base);\n\n for (key in props) {\n if (!props.hasOwnProperty(key)) { continue; }\n addNormalizedProperty(base, key, props[key], meta, descs, values, concats);\n }\n\n // manually copy toString() because some JS engines do not enumerate it\n if (props.hasOwnProperty('toString')) { base.toString = props.toString; }\n } else if (mixin.mixins) {\n mergeMixins(mixin.mixins, m, descs, values, base);\n if (mixin._without) { a_forEach.call(mixin._without, removeKeys); }\n }\n }\n}\n\nfunction writableReq(obj) {\n var m = Ember.meta(obj), req = m.required;\n if (!req || !m.hasOwnProperty('required')) {\n req = m.required = req ? o_create(req) : {};\n }\n return req;\n}\n\nvar IS_BINDING = Ember.IS_BINDING = /^.+Binding$/;\n\nfunction detectBinding(obj, key, value, m) {\n if (IS_BINDING.test(key)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[key] = value;\n }\n}\n\nfunction connectBindings(obj, m) {\n // TODO Mixin.apply(instance) should disconnect binding if exists\n var bindings = m.bindings, key, binding, to;\n if (bindings) {\n for (key in bindings) {\n binding = bindings[key];\n if (binding) {\n to = key.slice(0, -7); // strip Binding off end\n if (binding instanceof Ember.Binding) {\n binding = binding.copy(); // copy prototypes' instance\n binding.to(to);\n } else { // binding is string path\n binding = new Ember.Binding(to, binding);\n }\n binding.connect(obj);\n obj[key] = binding;\n }\n }\n // mark as applied\n m.bindings = {};\n }\n}\n\nfunction finishPartial(obj, m) {\n connectBindings(obj, m || Ember.meta(obj));\n return obj;\n}\n\nfunction followAlias(obj, desc, m, descs, values) {\n var altKey = desc.methodName, value;\n if (descs[altKey] || values[altKey]) {\n value = values[altKey];\n desc = descs[altKey];\n } else if (m.descs[altKey]) {\n desc = m.descs[altKey];\n value = undefined;\n } else {\n desc = undefined;\n value = obj[altKey];\n }\n\n return { desc: desc, value: value };\n}\n\nfunction updateObservers(obj, key, observer, observerKey, method) {\n if ('function' !== typeof observer) { return; }\n\n var paths = observer[observerKey];\n\n if (paths) {\n for (var i=0, l=paths.length; i<l; i++) {\n Ember[method](obj, paths[i], null, key);\n }\n }\n}\n\nfunction replaceObservers(obj, key, observer) {\n var prevObserver = obj[key];\n\n updateObservers(obj, key, prevObserver, '__ember_observesBefore__', 'removeBeforeObserver');\n updateObservers(obj, key, prevObserver, '__ember_observes__', 'removeObserver');\n\n updateObservers(obj, key, observer, '__ember_observesBefore__', 'addBeforeObserver');\n updateObservers(obj, key, observer, '__ember_observes__', 'addObserver');\n}\n\nfunction applyMixin(obj, mixins, partial) {\n var descs = {}, values = {}, m = Ember.meta(obj),\n key, value, desc;\n\n // Go through all mixins and hashes passed in, and:\n //\n // * Handle concatenated properties\n // * Set up _super wrapping if necessary\n // * Set up computed property descriptors\n // * Copying `toString` in broken browsers\n mergeMixins(mixins, mixinsMeta(obj), descs, values, obj);\n\n for(key in values) {\n if (key === 'contructor' || !values.hasOwnProperty(key)) { continue; }\n\n desc = descs[key];\n value = values[key];\n\n if (desc === REQUIRED) { continue; }\n\n while (desc && desc instanceof Alias) {\n var followed = followAlias(obj, desc, m, descs, values);\n desc = followed.desc;\n value = followed.value;\n }\n\n if (desc === undefined && value === undefined) { continue; }\n\n replaceObservers(obj, key, value);\n detectBinding(obj, key, value, m);\n defineProperty(obj, key, desc, value, m);\n }\n\n if (!partial) { // don't apply to prototype\n finishPartial(obj, m);\n }\n\n return obj;\n}\n\n/**\n @method mixin\n @for Ember\n @param obj\n @param mixins*\n @return obj\n*/\nEmber.mixin = function(obj) {\n var args = a_slice.call(arguments, 1);\n applyMixin(obj, args, false);\n return obj;\n};\n\n/**\n The `Ember.Mixin` class allows you to create mixins, whose properties can be\n added to other classes. For instance,\n\n ```javascript\n App.Editable = Ember.Mixin.create({\n edit: function() {\n console.log('starting to edit');\n this.set('isEditing', true);\n },\n isEditing: false\n });\n\n // Mix mixins into classes by passing them as the first arguments to\n // .extend or .create.\n App.CommentView = Ember.View.extend(App.Editable, {\n template: Ember.Handlebars.compile('{{#if isEditing}}...{{else}}...{{/if}}')\n });\n\n commentView = App.CommentView.create();\n commentView.edit(); // outputs 'starting to edit'\n ```\n\n Note that Mixins are created with `Ember.Mixin.create`, not\n `Ember.Mixin.extend`.\n\n @class Mixin\n @namespace Ember\n*/\nEmber.Mixin = function() { return initMixin(this, arguments); };\n\nMixin = Ember.Mixin;\n\nMixin._apply = applyMixin;\n\nMixin.applyPartial = function(obj) {\n var args = a_slice.call(arguments, 1);\n return applyMixin(obj, args, true);\n};\n\nMixin.finishPartial = finishPartial;\n\nEmber.anyUnprocessedMixins = false;\n\n/**\n Creates an instance of a class. Accepts either no arguments, or an object\n containing values to initialize the newly instantiated object with.\n\n ```javascript\n App.Person = Ember.Object.extend({\n helloWorld: function() {\n alert(\"Hi, my name is \" + this.get('name'));\n }\n });\n\n var tom = App.Person.create({\n name: 'Tom Dale'\n });\n\n tom.helloWorld(); // alerts \"Hi, my name is Tom Dale\".\n ```\n\n `create` will call the `init` function if defined during\n `Ember.AnyObject.extend`\n\n If no arguments are passed to `create`, it will not set values to the new\n instance during initialization:\n\n ```javascript\n var noName = App.Person.create();\n noName.helloWorld(); // alerts undefined\n ```\n\n NOTE: For performance reasons, you cannot declare methods or computed\n properties during `create`. You should instead declare methods and computed\n properties when using `extend`.\n\n @method create\n @static\n @param arguments*\n*/\nMixin.create = function() {\n Ember.anyUnprocessedMixins = true;\n var M = this;\n return initMixin(new M(), arguments);\n};\n\nvar MixinPrototype = Mixin.prototype;\n\n/**\n @method reopen\n @param arguments*\n*/\nMixinPrototype.reopen = function() {\n var mixin, tmp;\n\n if (this.properties) {\n mixin = Mixin.create();\n mixin.properties = this.properties;\n delete this.properties;\n this.mixins = [mixin];\n } else if (!this.mixins) {\n this.mixins = [];\n }\n\n var len = arguments.length, mixins = this.mixins, idx;\n\n for(idx=0; idx < len; idx++) {\n mixin = arguments[idx];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n if (mixin instanceof Mixin) {\n mixins.push(mixin);\n } else {\n tmp = Mixin.create();\n tmp.properties = mixin;\n mixins.push(tmp);\n }\n }\n\n return this;\n};\n\n/**\n @method apply\n @param obj\n @return applied object\n*/\nMixinPrototype.apply = function(obj) {\n return applyMixin(obj, [this], false);\n};\n\nMixinPrototype.applyPartial = function(obj) {\n return applyMixin(obj, [this], true);\n};\n\nfunction _detect(curMixin, targetMixin, seen) {\n var guid = guidFor(curMixin);\n\n if (seen[guid]) { return false; }\n seen[guid] = true;\n\n if (curMixin === targetMixin) { return true; }\n var mixins = curMixin.mixins, loc = mixins ? mixins.length : 0;\n while (--loc >= 0) {\n if (_detect(mixins[loc], targetMixin, seen)) { return true; }\n }\n return false;\n}\n\n/**\n @method detect\n @param obj\n @return {Boolean}\n*/\nMixinPrototype.detect = function(obj) {\n if (!obj) { return false; }\n if (obj instanceof Mixin) { return _detect(obj, this, {}); }\n var mixins = Ember.meta(obj, false).mixins;\n if (mixins) {\n return !!mixins[guidFor(this)];\n }\n return false;\n};\n\nMixinPrototype.without = function() {\n var ret = new Mixin(this);\n ret._without = a_slice.call(arguments);\n return ret;\n};\n\nfunction _keys(ret, mixin, seen) {\n if (seen[guidFor(mixin)]) { return; }\n seen[guidFor(mixin)] = true;\n\n if (mixin.properties) {\n var props = mixin.properties;\n for (var key in props) {\n if (props.hasOwnProperty(key)) { ret[key] = true; }\n }\n } else if (mixin.mixins) {\n a_forEach.call(mixin.mixins, function(x) { _keys(ret, x, seen); });\n }\n}\n\nMixinPrototype.keys = function() {\n var keys = {}, seen = {}, ret = [];\n _keys(keys, this, seen);\n for(var key in keys) {\n if (keys.hasOwnProperty(key)) { ret.push(key); }\n }\n return ret;\n};\n\n// returns the mixins currently applied to the specified object\n// TODO: Make Ember.mixin\nMixin.mixins = function(obj) {\n var mixins = Ember.meta(obj, false).mixins, ret = [];\n\n if (!mixins) { return ret; }\n\n for (var key in mixins) {\n var mixin = mixins[key];\n\n // skip primitive mixins since these are always anonymous\n if (!mixin.properties) { ret.push(mixin); }\n }\n\n return ret;\n};\n\nREQUIRED = new Ember.Descriptor();\nREQUIRED.toString = function() { return '(Required Property)'; };\n\n/**\n Denotes a required property for a mixin\n\n @method required\n @for Ember\n*/\nEmber.required = function() {\n return REQUIRED;\n};\n\nAlias = function(methodName) {\n this.methodName = methodName;\n};\nAlias.prototype = new Ember.Descriptor();\n\n/**\n Makes a property or method available via an additional name.\n\n ```javascript\n App.PaintSample = Ember.Object.extend({\n color: 'red',\n colour: Ember.alias('color'),\n name: function(){\n return \"Zed\";\n },\n moniker: Ember.alias(\"name\")\n });\n\n var paintSample = App.PaintSample.create()\n paintSample.get('colour'); // 'red'\n paintSample.moniker(); // 'Zed'\n ```\n\n @method alias\n @for Ember\n @param {String} methodName name of the method or property to alias\n @return {Ember.Descriptor}\n @deprecated Use `Ember.aliasMethod` or `Ember.computed.alias` instead\n*/\nEmber.alias = function(methodName) {\n return new Alias(methodName);\n};\n\nEmber.deprecateFunc(\"Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.\", Ember.alias);\n\n/**\n Makes a method available via an additional name.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name: function(){\n return 'Tomhuda Katzdale';\n },\n moniker: Ember.aliasMethod('name')\n });\n\n var goodGuy = App.Person.create()\n ```\n\n @method aliasMethod\n @for Ember\n @param {String} methodName name of the method to alias\n @return {Ember.Descriptor}\n*/\nEmber.aliasMethod = function(methodName) {\n return new Alias(methodName);\n};\n\n// ..........................................................\n// OBSERVER HELPER\n//\n\n/**\n @method observer\n @for Ember\n @param {Function} func\n @param {String} propertyNames*\n @return func\n*/\nEmber.observer = function(func) {\n var paths = a_slice.call(arguments, 1);\n func.__ember_observes__ = paths;\n return func;\n};\n\n// If observers ever become asynchronous, Ember.immediateObserver\n// must remain synchronous.\n/**\n @method immediateObserver\n @for Ember\n @param {Function} func\n @param {String} propertyNames*\n @return func\n*/\nEmber.immediateObserver = function() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", typeof arg !== \"string\" || arg.indexOf('.') === -1);\n }\n\n return Ember.observer.apply(this, arguments);\n};\n\n/**\n @method beforeObserver\n @for Ember\n @param {Function} func\n @param {String} propertyNames*\n @return func\n*/\nEmber.beforeObserver = function(func) {\n var paths = a_slice.call(arguments, 1);\n func.__ember_observesBefore__ = paths;\n return func;\n};\n\n})();\n//@ sourceURL=ember-metal/mixin");minispade.register('ember-metal/observer', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils'); // Ember.tryFinally\nminispade.require('ember-metal/accessors');\nminispade.require('ember-metal/array');\n\n/**\n@module ember-metal\n*/\n\nvar AFTER_OBSERVERS = ':change';\nvar BEFORE_OBSERVERS = ':before';\n\nvar guidFor = Ember.guidFor;\n\nvar deferred = 0;\n\n/*\n this.observerSet = {\n [senderGuid]: { // variable name: `keySet`\n [keyName]: listIndex\n }\n },\n this.observers = [\n {\n sender: obj,\n keyName: keyName,\n eventName: eventName,\n listeners: [\n [target, method, onceFlag, suspendedFlag]\n ]\n },\n ...\n ]\n*/\nfunction ObserverSet() {\n this.clear();\n}\n\nObserverSet.prototype.add = function(sender, keyName, eventName) {\n var observerSet = this.observerSet,\n observers = this.observers,\n senderGuid = Ember.guidFor(sender),\n keySet = observerSet[senderGuid],\n index;\n\n if (!keySet) {\n observerSet[senderGuid] = keySet = {};\n }\n index = keySet[keyName];\n if (index === undefined) {\n index = observers.push({\n sender: sender,\n keyName: keyName,\n eventName: eventName,\n listeners: []\n }) - 1;\n keySet[keyName] = index;\n }\n return observers[index].listeners;\n};\n\nObserverSet.prototype.flush = function() {\n var observers = this.observers, i, len, observer, sender;\n this.clear();\n for (i=0, len=observers.length; i < len; ++i) {\n observer = observers[i];\n sender = observer.sender;\n if (sender.isDestroying || sender.isDestroyed) { continue; }\n Ember.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners);\n }\n};\n\nObserverSet.prototype.clear = function() {\n this.observerSet = {};\n this.observers = [];\n};\n\nvar beforeObserverSet = new ObserverSet(), observerSet = new ObserverSet();\n\n/**\n @method beginPropertyChanges\n @chainable\n*/\nEmber.beginPropertyChanges = function() {\n deferred++;\n};\n\n/**\n @method endPropertyChanges\n*/\nEmber.endPropertyChanges = function() {\n deferred--;\n if (deferred<=0) {\n beforeObserverSet.clear();\n observerSet.flush();\n }\n};\n\n/**\n Make a series of property changes together in an\n exception-safe way.\n\n ```javascript\n Ember.changeProperties(function() {\n obj1.set('foo', mayBlowUpWhenSet);\n obj2.set('bar', baz);\n });\n ```\n\n @method changeProperties\n @param {Function} callback\n @param [binding]\n*/\nEmber.changeProperties = function(cb, binding){\n Ember.beginPropertyChanges();\n Ember.tryFinally(cb, Ember.endPropertyChanges, binding);\n};\n\n/**\n Set a list of properties on an object. These properties are set inside\n a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n observers will be buffered.\n\n @method setProperties\n @param target\n @param {Hash} properties\n @return target\n*/\nEmber.setProperties = function(self, hash) {\n Ember.changeProperties(function(){\n for(var prop in hash) {\n if (hash.hasOwnProperty(prop)) Ember.set(self, prop, hash[prop]);\n }\n });\n return self;\n};\n\n\nfunction changeEvent(keyName) {\n return keyName+AFTER_OBSERVERS;\n}\n\nfunction beforeEvent(keyName) {\n return keyName+BEFORE_OBSERVERS;\n}\n\n/**\n @method addObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.addObserver = function(obj, path, target, method) {\n Ember.addListener(obj, changeEvent(path), target, method);\n Ember.watch(obj, path);\n return this;\n};\n\nEmber.observersFor = function(obj, path) {\n return Ember.listenersFor(obj, changeEvent(path));\n};\n\n/**\n @method removeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.removeObserver = function(obj, path, target, method) {\n Ember.unwatch(obj, path);\n Ember.removeListener(obj, changeEvent(path), target, method);\n return this;\n};\n\n/**\n @method addBeforeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.addBeforeObserver = function(obj, path, target, method) {\n Ember.addListener(obj, beforeEvent(path), target, method);\n Ember.watch(obj, path);\n return this;\n};\n\n// Suspend observer during callback.\n//\n// This should only be used by the target of the observer\n// while it is setting the observed path.\nEmber._suspendBeforeObserver = function(obj, path, target, method, callback) {\n return Ember._suspendListener(obj, beforeEvent(path), target, method, callback);\n};\n\nEmber._suspendObserver = function(obj, path, target, method, callback) {\n return Ember._suspendListener(obj, changeEvent(path), target, method, callback);\n};\n\nvar map = Ember.ArrayPolyfills.map;\n\nEmber._suspendBeforeObservers = function(obj, paths, target, method, callback) {\n var events = map.call(paths, beforeEvent);\n return Ember._suspendListeners(obj, events, target, method, callback);\n};\n\nEmber._suspendObservers = function(obj, paths, target, method, callback) {\n var events = map.call(paths, changeEvent);\n return Ember._suspendListeners(obj, events, target, method, callback);\n};\n\nEmber.beforeObserversFor = function(obj, path) {\n return Ember.listenersFor(obj, beforeEvent(path));\n};\n\n/**\n @method removeBeforeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.removeBeforeObserver = function(obj, path, target, method) {\n Ember.unwatch(obj, path);\n Ember.removeListener(obj, beforeEvent(path), target, method);\n return this;\n};\n\nEmber.notifyBeforeObservers = function(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = beforeEvent(keyName), listeners, listenersDiff;\n if (deferred) {\n listeners = beforeObserverSet.add(obj, keyName, eventName);\n listenersDiff = Ember.listenersDiff(obj, eventName, listeners);\n Ember.sendEvent(obj, eventName, [obj, keyName], listenersDiff);\n } else {\n Ember.sendEvent(obj, eventName, [obj, keyName]);\n }\n};\n\nEmber.notifyObservers = function(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = changeEvent(keyName), listeners;\n if (deferred) {\n listeners = observerSet.add(obj, keyName, eventName);\n Ember.listenersUnion(obj, eventName, listeners);\n } else {\n Ember.sendEvent(obj, eventName, [obj, keyName]);\n }\n};\n\n})();\n//@ sourceURL=ember-metal/observer");minispade.register('ember-metal/platform', "(function() {/*globals Node */\nminispade.require('ember-metal/core');\n\n/**\n@module ember-metal\n*/\n\n/**\n Platform specific methods and feature detectors needed by the framework.\n\n @class platform\n @namespace Ember\n @static\n*/\nvar platform = Ember.platform = {};\n\n\n/**\n Identical to `Object.create()`. Implements if not available natively.\n\n @method create\n @for Ember\n*/\nEmber.create = Object.create;\n\n// STUB_OBJECT_CREATE allows us to override other libraries that stub\n// Object.create different than we would prefer\nif (!Ember.create || Ember.ENV.STUB_OBJECT_CREATE) {\n var K = function() {};\n\n Ember.create = function(obj, props) {\n K.prototype = obj;\n obj = new K();\n if (props) {\n K.prototype = obj;\n for (var prop in props) {\n K.prototype[prop] = props[prop].value;\n }\n obj = new K();\n }\n K.prototype = null;\n\n return obj;\n };\n\n Ember.create.isSimulated = true;\n}\n\nvar defineProperty = Object.defineProperty;\nvar canRedefineProperties, canDefinePropertyOnDOM;\n\n// Catch IE8 where Object.defineProperty exists but only works on DOM elements\nif (defineProperty) {\n try {\n defineProperty({}, 'a',{get:function(){}});\n } catch (e) {\n defineProperty = null;\n }\n}\n\nif (defineProperty) {\n // Detects a bug in Android <3.2 where you cannot redefine a property using\n // Object.defineProperty once accessors have already been set.\n canRedefineProperties = (function() {\n var obj = {};\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n get: function() { },\n set: function() { }\n });\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: true\n });\n\n return obj.a === true;\n })();\n\n // This is for Safari 5.0, which supports Object.defineProperty, but not\n // on DOM nodes.\n canDefinePropertyOnDOM = (function(){\n try {\n defineProperty(document.createElement('div'), 'definePropertyOnDOM', {});\n return true;\n } catch(e) { }\n\n return false;\n })();\n\n if (!canRedefineProperties) {\n defineProperty = null;\n } else if (!canDefinePropertyOnDOM) {\n defineProperty = function(obj, keyName, desc){\n var isNode;\n\n if (typeof Node === \"object\") {\n isNode = obj instanceof Node;\n } else {\n isNode = typeof obj === \"object\" && typeof obj.nodeType === \"number\" && typeof obj.nodeName === \"string\";\n }\n\n if (isNode) {\n // TODO: Should we have a warning here?\n return (obj[keyName] = desc.value);\n } else {\n return Object.defineProperty(obj, keyName, desc);\n }\n };\n }\n}\n\n/**\n@class platform\n@namespace Ember\n*/\n\n/**\n Identical to `Object.defineProperty()`. Implements as much functionality\n as possible if not available natively.\n\n @method defineProperty\n @param {Object} obj The object to modify\n @param {String} keyName property name to modify\n @param {Object} desc descriptor hash\n @return {void}\n*/\nplatform.defineProperty = defineProperty;\n\n/**\n Set to true if the platform supports native getters and setters.\n\n @property hasPropertyAccessors\n @final\n*/\nplatform.hasPropertyAccessors = true;\n\nif (!platform.defineProperty) {\n platform.hasPropertyAccessors = false;\n\n platform.defineProperty = function(obj, keyName, desc) {\n if (!desc.get) { obj[keyName] = desc.value; }\n };\n\n platform.defineProperty.isSimulated = true;\n}\n\nif (Ember.ENV.MANDATORY_SETTER && !platform.hasPropertyAccessors) {\n Ember.ENV.MANDATORY_SETTER = false;\n}\n\n})();\n//@ sourceURL=ember-metal/platform");minispade.register('ember-metal/properties', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/accessors');\n\n/**\n@module ember-metal\n*/\n\nvar META_KEY = Ember.META_KEY,\n metaFor = Ember.meta,\n objectDefineProperty = Ember.platform.defineProperty;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n// ..........................................................\n// DESCRIPTOR\n//\n\n/**\n Objects of this type can implement an interface to responds requests to\n get and set. The default implementation handles simple properties.\n\n You generally won't need to create or subclass this directly.\n\n @class Descriptor\n @namespace Ember\n @private\n @constructor\n*/\nvar Descriptor = Ember.Descriptor = function() {};\n\n// ..........................................................\n// DEFINING PROPERTIES API\n//\n\nvar MANDATORY_SETTER_FUNCTION = Ember.MANDATORY_SETTER_FUNCTION = function(value) {\n Ember.assert(\"You must use Ember.set() to access this property (of \" + this + \")\", false);\n};\n\nvar DEFAULT_GETTER_FUNCTION = Ember.DEFAULT_GETTER_FUNCTION = function(name) {\n return function() {\n var meta = this[META_KEY];\n return meta && meta.values[name];\n };\n};\n\n/**\n @private\n\n NOTE: This is a low-level method used by other parts of the API. You almost\n never want to call this method directly. Instead you should use\n `Ember.mixin()` to define new properties.\n\n Defines a property on an object. This method works much like the ES5\n `Object.defineProperty()` method except that it can also accept computed\n properties and other special descriptors.\n\n Normally this method takes only three parameters. However if you pass an\n instance of `Ember.Descriptor` as the third param then you can pass an\n optional value as the fourth parameter. This is often more efficient than\n creating new descriptor hashes for each property.\n\n ## Examples\n\n ```javascript\n // ES5 compatible mode\n Ember.defineProperty(contact, 'firstName', {\n writable: true,\n configurable: false,\n enumerable: true,\n value: 'Charles'\n });\n\n // define a simple property\n Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');\n\n // define a computed property\n Ember.defineProperty(contact, 'fullName', Ember.computed(function() {\n return this.firstName+' '+this.lastName;\n }).property('firstName', 'lastName'));\n ```\n\n @method defineProperty\n @for Ember\n @param {Object} obj the object to define this property on. This may be a prototype.\n @param {String} keyName the name of the property\n @param {Ember.Descriptor} [desc] an instance of `Ember.Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.\n @param {anything} [data] something other than a descriptor, that will\n become the explicit value of this property.\n*/\nEmber.defineProperty = function(obj, keyName, desc, data, meta) {\n var descs, existingDesc, watching, value;\n\n if (!meta) meta = metaFor(obj);\n descs = meta.descs;\n existingDesc = meta.descs[keyName];\n watching = meta.watching[keyName] > 0;\n\n if (existingDesc instanceof Ember.Descriptor) {\n existingDesc.teardown(obj, keyName);\n }\n\n if (desc instanceof Ember.Descriptor) {\n value = desc;\n\n descs[keyName] = desc;\n if (MANDATORY_SETTER && watching) {\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: undefined // make enumerable\n });\n } else {\n obj[keyName] = undefined; // make enumerable\n }\n desc.setup(obj, keyName);\n } else {\n descs[keyName] = undefined; // shadow descriptor in proto\n if (desc == null) {\n value = data;\n\n if (MANDATORY_SETTER && watching) {\n meta.values[keyName] = data;\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: MANDATORY_SETTER_FUNCTION,\n get: DEFAULT_GETTER_FUNCTION(keyName)\n });\n } else {\n obj[keyName] = data;\n }\n } else {\n value = desc;\n\n // compatibility with ES5\n objectDefineProperty(obj, keyName, desc);\n }\n }\n\n // if key is being watched, override chains that\n // were initialized with the prototype\n if (watching) { Ember.overrideChains(obj, keyName, meta); }\n\n // The `value` passed to the `didDefineProperty` hook is\n // either the descriptor or data, whichever was passed.\n if (obj.didDefineProperty) { obj.didDefineProperty(obj, keyName, value); }\n\n return this;\n};\n\n\n})();\n//@ sourceURL=ember-metal/properties");minispade.register('ember-metal/run_loop', "(function() {minispade.require('ember-metal/core'); // Ember.Logger\nminispade.require('ember-metal/watching'); // Ember.watch.flushPending\nminispade.require('ember-metal/observer'); // Ember.beginPropertyChanges, Ember.endPropertyChanges\nminispade.require('ember-metal/utils'); // Ember.guidFor, Ember.tryFinally\n\n/**\n@module ember-metal\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar slice = [].slice,\n forEach = Ember.ArrayPolyfills.forEach;\n\n// invokes passed params - normalizing so you can pass target/func,\n// target/string or just func\nfunction invoke(target, method, args, ignore) {\n\n if (method === undefined) {\n method = target;\n target = undefined;\n }\n\n if ('string' === typeof method) { method = target[method]; }\n if (args && ignore > 0) {\n args = args.length > ignore ? slice.call(args, ignore) : null;\n }\n\n return Ember.handleErrors(function() {\n // IE8's Function.prototype.apply doesn't accept undefined/null arguments.\n return method.apply(target || this, args || []);\n }, this);\n}\n\n\n// ..........................................................\n// RUNLOOP\n//\n\nvar timerMark; // used by timers...\n\n/**\nEmber RunLoop (Private)\n\n@class RunLoop\n@namespace Ember\n@private\n@constructor\n*/\nvar RunLoop = function(prev) {\n this._prev = prev || null;\n this.onceTimers = {};\n};\n\nRunLoop.prototype = {\n /**\n @method end\n */\n end: function() {\n this.flush();\n },\n\n /**\n @method prev\n */\n prev: function() {\n return this._prev;\n },\n\n // ..........................................................\n // Delayed Actions\n //\n\n /**\n @method schedule\n @param {String} queueName\n @param target\n @param method\n */\n schedule: function(queueName, target, method) {\n var queues = this._queues, queue;\n if (!queues) { queues = this._queues = {}; }\n queue = queues[queueName];\n if (!queue) { queue = queues[queueName] = []; }\n\n var args = arguments.length > 3 ? slice.call(arguments, 3) : null;\n queue.push({ target: target, method: method, args: args });\n return this;\n },\n\n /**\n @method flush\n @param {String} queueName\n */\n flush: function(queueName) {\n var queueNames, idx, len, queue, log;\n\n if (!this._queues) { return this; } // nothing to do\n\n function iter(item) {\n invoke(item.target, item.method, item.args);\n }\n\n function tryable() {\n forEach.call(queue, iter);\n }\n\n Ember.watch.flushPending(); // make sure all chained watchers are setup\n\n if (queueName) {\n while (this._queues && (queue = this._queues[queueName])) {\n this._queues[queueName] = null;\n\n // the sync phase is to allow property changes to propagate. don't\n // invoke observers until that is finished.\n if (queueName === 'sync') {\n log = Ember.LOG_BINDINGS;\n if (log) { Ember.Logger.log('Begin: Flush Sync Queue'); }\n\n Ember.beginPropertyChanges();\n\n Ember.tryFinally(tryable, Ember.endPropertyChanges);\n\n if (log) { Ember.Logger.log('End: Flush Sync Queue'); }\n\n } else {\n forEach.call(queue, iter);\n }\n }\n\n } else {\n queueNames = Ember.run.queues;\n len = queueNames.length;\n idx = 0;\n\n outerloop:\n while (idx < len) {\n queueName = queueNames[idx];\n queue = this._queues && this._queues[queueName];\n delete this._queues[queueName];\n\n if (queue) {\n // the sync phase is to allow property changes to propagate. don't\n // invoke observers until that is finished.\n if (queueName === 'sync') {\n log = Ember.LOG_BINDINGS;\n if (log) { Ember.Logger.log('Begin: Flush Sync Queue'); }\n\n Ember.beginPropertyChanges();\n\n Ember.tryFinally(tryable, Ember.endPropertyChanges);\n\n if (log) { Ember.Logger.log('End: Flush Sync Queue'); }\n } else {\n forEach.call(queue, iter);\n }\n }\n\n // Loop through prior queues\n for (var i = 0; i <= idx; i++) {\n if (this._queues && this._queues[queueNames[i]]) {\n // Start over at the first queue with contents\n idx = i;\n continue outerloop;\n }\n }\n\n idx++;\n }\n }\n\n timerMark = null;\n\n return this;\n }\n\n};\n\nEmber.RunLoop = RunLoop;\n\n// ..........................................................\n// Ember.run - this is ideally the only public API the dev sees\n//\n\n/**\n Runs the passed target and method inside of a RunLoop, ensuring any\n deferred actions including bindings and views updates are flushed at the\n end.\n\n Normally you should not need to invoke this method yourself. However if\n you are implementing raw event handlers when interfacing with other\n libraries or plugins, you should probably wrap all of your code inside this\n call.\n\n ```javascript\n Ember.run(function(){\n // code to be execute within a RunLoop\n });\n ```\n\n @class run\n @namespace Ember\n @static\n @constructor\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function.\n*/\nEmber.run = function(target, method) {\n var args = arguments;\n run.begin();\n\n function tryable() {\n if (target || method) {\n return invoke(target, method, args, 2);\n }\n }\n\n return Ember.tryFinally(tryable, run.end);\n};\n\nvar run = Ember.run;\n\n\n/**\n Begins a new RunLoop. Any deferred actions invoked after the begin will\n be buffered until you invoke a matching call to `Ember.run.end()`. This is\n a lower-level way to use a RunLoop instead of using `Ember.run()`.\n\n ```javascript\n Ember.run.begin();\n // code to be execute within a RunLoop\n Ember.run.end();\n ```\n\n @method begin\n @return {void}\n*/\nEmber.run.begin = function() {\n run.currentRunLoop = new RunLoop(run.currentRunLoop);\n};\n\n/**\n Ends a RunLoop. This must be called sometime after you call\n `Ember.run.begin()` to flush any deferred actions. This is a lower-level way\n to use a RunLoop instead of using `Ember.run()`.\n\n ```javascript\n Ember.run.begin();\n // code to be execute within a RunLoop\n Ember.run.end();\n ```\n\n @method end\n @return {void}\n*/\nEmber.run.end = function() {\n Ember.assert('must have a current run loop', run.currentRunLoop);\n\n function tryable() { run.currentRunLoop.end(); }\n function finalizer() { run.currentRunLoop = run.currentRunLoop.prev(); }\n\n Ember.tryFinally(tryable, finalizer);\n};\n\n/**\n Array of named queues. This array determines the order in which queues\n are flushed at the end of the RunLoop. You can define your own queues by\n simply adding the queue name to this array. Normally you should not need\n to inspect or modify this property.\n\n @property queues\n @type Array\n @default ['sync', 'actions', 'destroy']\n*/\nEmber.run.queues = ['sync', 'actions', 'destroy'];\n\n/**\n Adds the passed target/method and any optional arguments to the named\n queue to be executed at the end of the RunLoop. If you have not already\n started a RunLoop when calling this method one will be started for you\n automatically.\n\n At the end of a RunLoop, any methods scheduled in this way will be invoked.\n Methods will be invoked in an order matching the named queues defined in\n the `run.queues` property.\n\n ```javascript\n Ember.run.schedule('sync', this, function(){\n // this will be executed in the first RunLoop queue, when bindings are synced\n console.log(\"scheduled on sync queue\");\n });\n\n Ember.run.schedule('actions', this, function(){\n // this will be executed in the 'actions' queue, after bindings have synced.\n console.log(\"scheduled on actions queue\");\n });\n\n // Note the functions will be run in order based on the run queues order. Output would be:\n // scheduled on sync queue\n // scheduled on actions queue\n ```\n\n @method schedule\n @param {String} queue The name of the queue to schedule against.\n Default queues are 'sync' and 'actions'\n @param {Object} [target] target object to use as the context when invoking a method.\n @param {String|Function} method The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.\n @param {Object} [arguments*] Optional arguments to be passed to the queued method.\n @return {void}\n*/\nEmber.run.schedule = function(queue, target, method) {\n var loop = run.autorun();\n loop.schedule.apply(loop, arguments);\n};\n\nvar scheduledAutorun;\nfunction autorun() {\n scheduledAutorun = null;\n if (run.currentRunLoop) { run.end(); }\n}\n\n// Used by global test teardown\nEmber.run.hasScheduledTimers = function() {\n return !!(scheduledAutorun || scheduledLater);\n};\n\n// Used by global test teardown\nEmber.run.cancelTimers = function () {\n if (scheduledAutorun) {\n clearTimeout(scheduledAutorun);\n scheduledAutorun = null;\n }\n if (scheduledLater) {\n clearTimeout(scheduledLater);\n scheduledLater = null;\n }\n timers = {};\n};\n\n/**\n Begins a new RunLoop if necessary and schedules a timer to flush the\n RunLoop at a later time. This method is used by parts of Ember to\n ensure the RunLoop always finishes. You normally do not need to call this\n method directly. Instead use `Ember.run()`\n\n @method autorun\n @example\n Ember.run.autorun();\n @return {Ember.RunLoop} the new current RunLoop\n*/\nEmber.run.autorun = function() {\n if (!run.currentRunLoop) {\n Ember.assert(\"You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run\", !Ember.testing);\n\n run.begin();\n\n if (!scheduledAutorun) {\n scheduledAutorun = setTimeout(autorun, 1);\n }\n }\n\n return run.currentRunLoop;\n};\n\n/**\n Immediately flushes any events scheduled in the 'sync' queue. Bindings\n use this queue so this method is a useful way to immediately force all\n bindings in the application to sync.\n\n You should call this method anytime you need any changed state to propagate\n throughout the app immediately without repainting the UI (which happens\n in the later 'render' queue added by the `ember-views` package).\n\n ```javascript\n Ember.run.sync();\n ```\n\n @method sync\n @return {void}\n*/\nEmber.run.sync = function() {\n run.autorun();\n run.currentRunLoop.flush('sync');\n};\n\n// ..........................................................\n// TIMERS\n//\n\nvar timers = {}; // active timers...\n\nvar scheduledLater, scheduledLaterExpires;\nfunction invokeLaterTimers() {\n scheduledLater = null;\n run(function() {\n var now = (+ new Date()), earliest = -1;\n for (var key in timers) {\n if (!timers.hasOwnProperty(key)) { continue; }\n var timer = timers[key];\n if (timer && timer.expires) {\n if (now >= timer.expires) {\n delete timers[key];\n invoke(timer.target, timer.method, timer.args, 2);\n } else {\n if (earliest < 0 || (timer.expires < earliest)) { earliest = timer.expires; }\n }\n }\n }\n\n // schedule next timeout to fire when the earliest timer expires\n if (earliest > 0) {\n scheduledLater = setTimeout(invokeLaterTimers, earliest - now);\n scheduledLaterExpires = earliest;\n }\n });\n}\n\n/**\n Invokes the passed target/method and optional arguments after a specified\n period if time. The last parameter of this method must always be a number\n of milliseconds.\n\n You should use this method whenever you need to run some action after a\n period of time instead of using `setTimeout()`. This method will ensure that\n items that expire during the same script execution cycle all execute\n together, which is often more efficient than using a real setTimeout.\n\n ```javascript\n Ember.run.later(myContext, function(){\n // code here will execute within a RunLoop in about 500ms with this == myContext\n }, 500);\n ```\n\n @method later\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait\n Number of milliseconds to wait.\n @return {String} a string you can use to cancel the timer in\n {{#crossLink \"Ember/run.cancel\"}}{{/crossLink}} later.\n*/\nEmber.run.later = function(target, method) {\n var args, expires, timer, guid, wait;\n\n // setTimeout compatibility...\n if (arguments.length===2 && 'function' === typeof target) {\n wait = method;\n method = target;\n target = undefined;\n args = [target, method];\n } else {\n args = slice.call(arguments);\n wait = args.pop();\n }\n\n expires = (+ new Date()) + wait;\n timer = { target: target, method: method, expires: expires, args: args };\n guid = Ember.guidFor(timer);\n timers[guid] = timer;\n\n if(scheduledLater && expires < scheduledLaterExpires) {\n // Cancel later timer (then reschedule earlier timer below)\n clearTimeout(scheduledLater);\n scheduledLater = null;\n }\n\n if (!scheduledLater) {\n // Schedule later timers to be run.\n scheduledLater = setTimeout(invokeLaterTimers, wait);\n scheduledLaterExpires = expires;\n }\n\n return guid;\n};\n\nfunction invokeOnceTimer(guid, onceTimers) {\n if (onceTimers[this.tguid]) { delete onceTimers[this.tguid][this.mguid]; }\n if (timers[guid]) { invoke(this.target, this.method, this.args); }\n delete timers[guid];\n}\n\nfunction scheduleOnce(queue, target, method, args) {\n var tguid = Ember.guidFor(target),\n mguid = Ember.guidFor(method),\n onceTimers = run.autorun().onceTimers,\n guid = onceTimers[tguid] && onceTimers[tguid][mguid],\n timer;\n\n if (guid && timers[guid]) {\n timers[guid].args = args; // replace args\n } else {\n timer = {\n target: target,\n method: method,\n args: args,\n tguid: tguid,\n mguid: mguid\n };\n\n guid = Ember.guidFor(timer);\n timers[guid] = timer;\n if (!onceTimers[tguid]) { onceTimers[tguid] = {}; }\n onceTimers[tguid][mguid] = guid; // so it isn't scheduled more than once\n\n run.schedule(queue, timer, invokeOnceTimer, guid, onceTimers);\n }\n\n return guid;\n}\n\n/**\n Schedules an item to run one time during the current RunLoop. Calling\n this method with the same target/method combination will have no effect.\n\n Note that although you can pass optional arguments these will not be\n considered when looking for duplicates. New arguments will replace previous\n calls.\n\n ```javascript\n Ember.run(function(){\n var doFoo = function() { foo(); }\n Ember.run.once(myContext, doFoo);\n Ember.run.once(myContext, doFoo);\n // doFoo will only be executed once at the end of the RunLoop\n });\n ```\n\n Also note that passing an anonymous function to `Ember.run.once` will\n not prevent additional calls with an identical anonymous function from\n scheduling the items multiple times, e.g.:\n\n ```javascript\n function scheduleIt() {\n Ember.run.once(myContext, function() { console.log(\"Closure\"); });\n }\n scheduleIt();\n scheduleIt();\n // \"Closure\" will print twice, even though we're using `Ember.run.once`,\n // because the function we pass to it is anonymous and won't match the\n // previously scheduled operation.\n ```\n\n @method once\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.once = function(target, method) {\n return scheduleOnce('actions', target, method, slice.call(arguments, 2));\n};\n\nEmber.run.scheduleOnce = function(queue, target, method, args) {\n return scheduleOnce(queue, target, method, slice.call(arguments, 3));\n};\n\n/**\n Schedules an item to run after control has been returned to the system.\n This is equivalent to calling `Ember.run.later` with a wait time of 1ms.\n\n ```javascript\n Ember.run.next(myContext, function(){\n // code to be executed in the next RunLoop, which will be scheduled after the current one\n });\n ```\n\n @method next\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.next = function() {\n var args = slice.call(arguments);\n args.push(1); // 1 millisecond wait\n return run.later.apply(this, args);\n};\n\n/**\n Cancels a scheduled item. Must be a value returned by `Ember.run.later()`,\n `Ember.run.once()`, or `Ember.run.next()`.\n\n ```javascript\n var runNext = Ember.run.next(myContext, function(){\n // will not be executed\n });\n Ember.run.cancel(runNext);\n\n var runLater = Ember.run.later(myContext, function(){\n // will not be executed\n }, 500);\n Ember.run.cancel(runLater);\n\n var runOnce = Ember.run.once(myContext, function(){\n // will not be executed\n });\n Ember.run.cancel(runOnce);\n ```\n\n @method cancel\n @param {Object} timer Timer object to cancel\n @return {void}\n*/\nEmber.run.cancel = function(timer) {\n delete timers[timer];\n};\n\n})();\n//@ sourceURL=ember-metal/run_loop");minispade.register('ember-metal/utils', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\n\n/**\n@module ember-metal\n*/\n\n\nvar o_defineProperty = Ember.platform.defineProperty,\n o_create = Ember.create,\n // Used for guid generation...\n GUID_KEY = '__ember'+ (+ new Date()),\n uuid = 0,\n numberCache = [],\n stringCache = {};\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n/**\n @private\n\n A unique key used to assign guids and other private metadata to objects.\n If you inspect an object in your browser debugger you will often see these.\n They can be safely ignored.\n\n On browsers that support it, these properties are added with enumeration\n disabled so they won't show up when you iterate over your properties.\n\n @property GUID_KEY\n @for Ember\n @type String\n @final\n*/\nEmber.GUID_KEY = GUID_KEY;\n\nvar GUID_DESC = {\n writable: false,\n configurable: false,\n enumerable: false,\n value: null\n};\n\n/**\n @private\n\n Generates a new guid, optionally saving the guid to the object that you\n pass in. You will rarely need to use this method. Instead you should\n call `Ember.guidFor(obj)`, which return an existing guid if available.\n\n @method generateGuid\n @for Ember\n @param {Object} [obj] Object the guid will be used for. If passed in, the guid will\n be saved on the object and reused whenever you pass the same object\n again.\n\n If no object is passed, just generate a new guid.\n @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to\n separate the guid into separate namespaces.\n @return {String} the guid\n*/\nEmber.generateGuid = function generateGuid(obj, prefix) {\n if (!prefix) prefix = 'ember';\n var ret = (prefix + (uuid++));\n if (obj) {\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n }\n return ret ;\n};\n\n/**\n @private\n\n Returns a unique id for the object. If the object does not yet have a guid,\n one will be assigned to it. You can call this on any object,\n `Ember.Object`-based or not, but be aware that it will add a `_guid`\n property.\n\n You can also use this method on DOM Element objects.\n\n @method guidFor\n @for Ember\n @param {Object} obj any object, string, number, Element, or primitive\n @return {String} the unique guid for this instance.\n*/\nEmber.guidFor = function guidFor(obj) {\n\n // special cases where we don't want to add a key to object\n if (obj === undefined) return \"(undefined)\";\n if (obj === null) return \"(null)\";\n\n var cache, ret;\n var type = typeof obj;\n\n // Don't allow prototype changes to String etc. to change the guidFor\n switch(type) {\n case 'number':\n ret = numberCache[obj];\n if (!ret) ret = numberCache[obj] = 'nu'+obj;\n return ret;\n\n case 'string':\n ret = stringCache[obj];\n if (!ret) ret = stringCache[obj] = 'st'+(uuid++);\n return ret;\n\n case 'boolean':\n return obj ? '(true)' : '(false)';\n\n default:\n if (obj[GUID_KEY]) return obj[GUID_KEY];\n if (obj === Object) return '(Object)';\n if (obj === Array) return '(Array)';\n ret = 'ember'+(uuid++);\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n return ret;\n }\n};\n\n// ..........................................................\n// META\n//\n\nvar META_DESC = {\n writable: true,\n configurable: false,\n enumerable: false,\n value: null\n};\n\nvar META_KEY = Ember.GUID_KEY+'_meta';\n\n/**\n The key used to store meta information on object for property observing.\n\n @property META_KEY\n @for Ember\n @private\n @final\n @type String\n*/\nEmber.META_KEY = META_KEY;\n\n// Placeholder for non-writable metas.\nvar EMPTY_META = {\n descs: {},\n watching: {}\n};\n\nif (MANDATORY_SETTER) { EMPTY_META.values = {}; }\n\nEmber.EMPTY_META = EMPTY_META;\n\nif (Object.freeze) Object.freeze(EMPTY_META);\n\nvar isDefinePropertySimulated = Ember.platform.defineProperty.isSimulated;\n\nfunction Meta(obj) {\n this.descs = {};\n this.watching = {};\n this.cache = {};\n this.source = obj;\n}\n\nif (isDefinePropertySimulated) {\n // on platforms that don't support enumerable false\n // make meta fail jQuery.isPlainObject() to hide from\n // jQuery.extend() by having a property that fails\n // hasOwnProperty check.\n Meta.prototype.__preventPlainObject__ = true;\n\n // Without non-enumerable properties, meta objects will be output in JSON\n // unless explicitly suppressed\n Meta.prototype.toJSON = function () { };\n}\n\n/**\n Retrieves the meta hash for an object. If `writable` is true ensures the\n hash is writable for this object as well.\n\n The meta object contains information about computed property descriptors as\n well as any watched properties and other information. You generally will\n not access this information directly but instead work with higher level\n methods that manipulate this hash indirectly.\n\n @method meta\n @for Ember\n @private\n\n @param {Object} obj The object to retrieve meta for\n @param {Boolean} [writable=true] Pass `false` if you do not intend to modify\n the meta hash, allowing the method to avoid making an unnecessary copy.\n @return {Hash}\n*/\nEmber.meta = function meta(obj, writable) {\n\n var ret = obj[META_KEY];\n if (writable===false) return ret || EMPTY_META;\n\n if (!ret) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = new Meta(obj);\n\n if (MANDATORY_SETTER) { ret.values = {}; }\n\n obj[META_KEY] = ret;\n\n // make sure we don't accidentally try to create constructor like desc\n ret.descs.constructor = null;\n\n } else if (ret.source !== obj) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = o_create(ret);\n ret.descs = o_create(ret.descs);\n ret.watching = o_create(ret.watching);\n ret.cache = {};\n ret.source = obj;\n\n if (MANDATORY_SETTER) { ret.values = o_create(ret.values); }\n\n obj[META_KEY] = ret;\n }\n return ret;\n};\n\nEmber.getMeta = function getMeta(obj, property) {\n var meta = Ember.meta(obj, false);\n return meta[property];\n};\n\nEmber.setMeta = function setMeta(obj, property, value) {\n var meta = Ember.meta(obj, true);\n meta[property] = value;\n return value;\n};\n\n/**\n @private\n\n In order to store defaults for a class, a prototype may need to create\n a default meta object, which will be inherited by any objects instantiated\n from the class's constructor.\n\n However, the properties of that meta object are only shallow-cloned,\n so if a property is a hash (like the event system's `listeners` hash),\n it will by default be shared across all instances of that class.\n\n This method allows extensions to deeply clone a series of nested hashes or\n other complex objects. For instance, the event system might pass\n `['listeners', 'foo:change', 'ember157']` to `prepareMetaPath`, which will\n walk down the keys provided.\n\n For each key, if the key does not exist, it is created. If it already\n exists and it was inherited from its constructor, the constructor's\n key is cloned.\n\n You can also pass false for `writable`, which will simply return\n undefined if `prepareMetaPath` discovers any part of the path that\n shared or undefined.\n\n @method metaPath\n @for Ember\n @param {Object} obj The object whose meta we are examining\n @param {Array} path An array of keys to walk down\n @param {Boolean} writable whether or not to create a new meta\n (or meta property) if one does not already exist or if it's\n shared with its constructor\n*/\nEmber.metaPath = function metaPath(obj, path, writable) {\n var meta = Ember.meta(obj, writable), keyName, value;\n\n for (var i=0, l=path.length; i<l; i++) {\n keyName = path[i];\n value = meta[keyName];\n\n if (!value) {\n if (!writable) { return undefined; }\n value = meta[keyName] = { __ember_source__: obj };\n } else if (value.__ember_source__ !== obj) {\n if (!writable) { return undefined; }\n value = meta[keyName] = o_create(value);\n value.__ember_source__ = obj;\n }\n\n meta = value;\n }\n\n return value;\n};\n\n/**\n @private\n\n Wraps the passed function so that `this._super` will point to the superFunc\n when the function is invoked. This is the primitive we use to implement\n calls to super.\n\n @method wrap\n @for Ember\n @param {Function} func The function to call\n @param {Function} superFunc The super function.\n @return {Function} wrapped function.\n*/\nEmber.wrap = function(func, superFunc) {\n function K() {}\n\n function superWrapper() {\n var ret, sup = this._super;\n this._super = superFunc || K;\n ret = func.apply(this, arguments);\n this._super = sup;\n return ret;\n }\n\n superWrapper.wrappedFunction = func;\n superWrapper.__ember_observes__ = func.__ember_observes__;\n superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__;\n\n return superWrapper;\n};\n\n/**\n Returns true if the passed object is an array or Array-like.\n\n Ember Array Protocol:\n\n - the object has an objectAt property\n - the object is a native Array\n - the object is an Object, and has a length property\n\n Unlike `Ember.typeOf` this method returns true even if the passed object is\n not formally array but appears to be array-like (i.e. implements `Ember.Array`)\n\n ```javascript\n Ember.isArray(); // false\n Ember.isArray([]); // true\n Ember.isArray( Ember.ArrayProxy.create({ content: [] }) ); // true\n ```\n\n @method isArray\n @for Ember\n @param {Object} obj The object to test\n @return {Boolean}\n*/\nEmber.isArray = function(obj) {\n if (!obj || obj.setInterval) { return false; }\n if (Array.isArray && Array.isArray(obj)) { return true; }\n if (Ember.Array && Ember.Array.detect(obj)) { return true; }\n if ((obj.length !== undefined) && 'object'===typeof obj) { return true; }\n return false;\n};\n\n/**\n Forces the passed object to be part of an array. If the object is already\n an array or array-like, returns the object. Otherwise adds the object to\n an array. If obj is `null` or `undefined`, returns an empty array.\n\n ```javascript\n Ember.makeArray(); // []\n Ember.makeArray(null); // []\n Ember.makeArray(undefined); // []\n Ember.makeArray('lindsay'); // ['lindsay']\n Ember.makeArray([1,2,42]); // [1,2,42]\n\n var controller = Ember.ArrayProxy.create({ content: [] });\n Ember.makeArray(controller) === controller; // true\n ```\n\n @method makeArray\n @for Ember\n @param {Object} obj the object\n @return {Array}\n*/\nEmber.makeArray = function(obj) {\n if (obj === null || obj === undefined) { return []; }\n return Ember.isArray(obj) ? obj : [obj];\n};\n\nfunction canInvoke(obj, methodName) {\n return !!(obj && typeof obj[methodName] === 'function');\n}\n\n/**\n Checks to see if the `methodName` exists on the `obj`.\n\n @method canInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n*/\nEmber.canInvoke = canInvoke;\n\n/**\n Checks to see if the `methodName` exists on the `obj`,\n and if it does, invokes it with the arguments passed.\n\n @method tryInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @param {Array} [args] The arguments to pass to the method\n @return {anything} the return value of the invoked method or undefined if it cannot be invoked\n*/\nEmber.tryInvoke = function(obj, methodName, args) {\n if (canInvoke(obj, methodName)) {\n return obj[methodName].apply(obj, args || []);\n }\n};\n\n// https://github.com/emberjs/ember.js/pull/1617\nvar needsFinallyFix = (function() {\n var count = 0;\n try{\n try { }\n finally {\n count++;\n throw new Error('needsFinallyFixTest');\n }\n } catch (e) {}\n\n return count !== 1;\n})();\n\n/**\n Provides try { } finally { } functionality, while working\n around Safari's double finally bug.\n\n @method tryFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} finalizer The function to run the finally callback\n @param [binding]\n @return {anything} The return value is the that of the finalizer,\n unless that valueis undefined, in which case it is the return value\n of the tryable\n*/\n\nif (needsFinallyFix) {\n Ember.tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e){\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n} else {\n Ember.tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n}\n\n/**\n Provides try { } catch finally { } functionality, while working\n around Safari's double finally bug.\n\n @method tryCatchFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} catchable The function to run the catchable callback\n @param {Function} finalizer The function to run the finally callback\n @param [binding]\n @return {anything} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable.\n*/\nif (needsFinallyFix) {\n Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult, finalError, finalReturn;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e){\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n} else {\n Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n}\n\n})();\n//@ sourceURL=ember-metal/utils");minispade.register('ember-metal/watching', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/accessors');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/array');\n\n/**\n@module ember-metal\n*/\n\nvar guidFor = Ember.guidFor, // utils.js\n metaFor = Ember.meta, // utils.js\n get = Ember.get, // accessors.js\n set = Ember.set, // accessors.js\n normalizeTuple = Ember.normalizeTuple, // accessors.js\n GUID_KEY = Ember.GUID_KEY, // utils.js\n META_KEY = Ember.META_KEY, // utils.js\n // circular reference observer depends on Ember.watch\n // we should move change events to this file or its own property_events.js\n forEach = Ember.ArrayPolyfills.forEach, // array.js\n FIRST_KEY = /^([^\\.\\*]+)/,\n IS_PATH = /[\\.\\*]/;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\no_defineProperty = Ember.platform.defineProperty;\n\nfunction firstKey(path) {\n return path.match(FIRST_KEY)[0];\n}\n\n// returns true if the passed path is just a keyName\nfunction isKeyName(path) {\n return path==='*' || !IS_PATH.test(path);\n}\n\n// ..........................................................\n// DEPENDENT KEYS\n//\n\nfunction iterDeps(method, obj, depKey, seen, meta) {\n\n var guid = guidFor(obj);\n if (!seen[guid]) seen[guid] = {};\n if (seen[guid][depKey]) return;\n seen[guid][depKey] = true;\n\n var deps = meta.deps;\n deps = deps && deps[depKey];\n if (deps) {\n for(var key in deps) {\n var desc = meta.descs[key];\n if (desc && desc._suspended === obj) continue;\n method(obj, key);\n }\n }\n}\n\n\nvar WILL_SEEN, DID_SEEN;\n\n// called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...)\nfunction dependentKeysWillChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = WILL_SEEN, top = !seen;\n if (top) { seen = WILL_SEEN = {}; }\n iterDeps(propertyWillChange, obj, depKey, seen, meta);\n if (top) { WILL_SEEN = null; }\n}\n\n// called whenever a property has just changed to update dependent keys\nfunction dependentKeysDidChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = DID_SEEN, top = !seen;\n if (top) { seen = DID_SEEN = {}; }\n iterDeps(propertyDidChange, obj, depKey, seen, meta);\n if (top) { DID_SEEN = null; }\n}\n\n// ..........................................................\n// CHAIN\n//\n\nfunction addChainWatcher(obj, keyName, node) {\n if (!obj || ('object' !== typeof obj)) { return; } // nothing to do\n\n var m = metaFor(obj), nodes = m.chainWatchers;\n\n if (!m.hasOwnProperty('chainWatchers')) {\n nodes = m.chainWatchers = {};\n }\n\n if (!nodes[keyName]) { nodes[keyName] = []; }\n nodes[keyName].push(node);\n Ember.watch(obj, keyName);\n}\n\nfunction removeChainWatcher(obj, keyName, node) {\n if (!obj || 'object' !== typeof obj) { return; } // nothing to do\n\n var m = metaFor(obj, false);\n if (!m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m.chainWatchers;\n\n if (nodes[keyName]) {\n nodes = nodes[keyName];\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i] === node) { nodes.splice(i, 1); }\n }\n }\n Ember.unwatch(obj, keyName);\n}\n\nvar pendingQueue = [];\n\n// attempts to add the pendingQueue chains again. If some of them end up\n// back in the queue and reschedule is true, schedules a timeout to try\n// again.\nfunction flushPendingChains() {\n if (pendingQueue.length === 0) { return; } // nothing to do\n\n var queue = pendingQueue;\n pendingQueue = [];\n\n forEach.call(queue, function(q) { q[0].add(q[1]); });\n\n Ember.warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);\n}\n\nfunction isProto(pvalue) {\n return metaFor(pvalue, false).proto === pvalue;\n}\n\n// A ChainNode watches a single key on an object. If you provide a starting\n// value for the key then the node won't actually watch it. For a root node\n// pass null for parent and key and object for value.\nvar ChainNode = function(parent, key, value) {\n var obj;\n this._parent = parent;\n this._key = key;\n\n // _watching is true when calling get(this._parent, this._key) will\n // return the value of this node.\n //\n // It is false for the root of a chain (because we have no parent)\n // and for global paths (because the parent node is the object with\n // the observer on it)\n this._watching = value===undefined;\n\n this._value = value;\n this._paths = {};\n if (this._watching) {\n this._object = parent.value();\n if (this._object) { addChainWatcher(this._object, this._key, this); }\n }\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n //\n // TODO: Replace this with an efficient callback that the EachProxy\n // can implement.\n if (this._parent && this._parent._key === '@each') {\n this.value();\n }\n};\n\nvar ChainNodePrototype = ChainNode.prototype;\n\nChainNodePrototype.value = function() {\n if (this._value === undefined && this._watching) {\n var obj = this._parent.value();\n this._value = (obj && !isProto(obj)) ? get(obj, this._key) : undefined;\n }\n return this._value;\n};\n\nChainNodePrototype.destroy = function() {\n if (this._watching) {\n var obj = this._object;\n if (obj) { removeChainWatcher(obj, this._key, this); }\n this._watching = false; // so future calls do nothing\n }\n};\n\n// copies a top level object only\nChainNodePrototype.copy = function(obj) {\n var ret = new ChainNode(null, null, obj),\n paths = this._paths, path;\n for (path in paths) {\n if (paths[path] <= 0) { continue; } // this check will also catch non-number vals.\n ret.add(path);\n }\n return ret;\n};\n\n// called on the root node of a chain to setup watchers on the specified\n// path.\nChainNodePrototype.add = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n paths[path] = (paths[path] || 0) + 1;\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n\n // the path was a local path\n if (tuple[0] && tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n\n // global path, but object does not exist yet.\n // put into a queue and try to connect later.\n } else if (!tuple[0]) {\n pendingQueue.push([this, path]);\n tuple.length = 0;\n return;\n\n // global path, and object already exists\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.chain(key, path, src);\n};\n\n// called on the root node of a chain to teardown watcher on the specified\n// path\nChainNodePrototype.remove = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n if (paths[path] > 0) { paths[path]--; }\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n if (tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.unchain(key, path);\n};\n\nChainNodePrototype.count = 0;\n\nChainNodePrototype.chain = function(key, path, src) {\n var chains = this._chains, node;\n if (!chains) { chains = this._chains = {}; }\n\n node = chains[key];\n if (!node) { node = chains[key] = new ChainNode(this, key, src); }\n node.count++; // count chains...\n\n // chain rest of path if there is one\n if (path && path.length>0) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.chain(key, path); // NOTE: no src means it will observe changes...\n }\n};\n\nChainNodePrototype.unchain = function(key, path) {\n var chains = this._chains, node = chains[key];\n\n // unchain rest of path first...\n if (path && path.length>1) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.unchain(key, path);\n }\n\n // delete node if needed.\n node.count--;\n if (node.count<=0) {\n delete chains[node._key];\n node.destroy();\n }\n\n};\n\nChainNodePrototype.willChange = function() {\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].willChange();\n }\n }\n\n if (this._parent) { this._parent.chainWillChange(this, this._key, 1); }\n};\n\nChainNodePrototype.chainWillChange = function(chain, path, depth) {\n if (this._key) { path = this._key + '.' + path; }\n\n if (this._parent) {\n this._parent.chainWillChange(this, path, depth+1);\n } else {\n if (depth > 1) { Ember.propertyWillChange(this.value(), path); }\n path = 'this.' + path;\n if (this._paths[path] > 0) { Ember.propertyWillChange(this.value(), path); }\n }\n};\n\nChainNodePrototype.chainDidChange = function(chain, path, depth) {\n if (this._key) { path = this._key + '.' + path; }\n if (this._parent) {\n this._parent.chainDidChange(this, path, depth+1);\n } else {\n if (depth > 1) { Ember.propertyDidChange(this.value(), path); }\n path = 'this.' + path;\n if (this._paths[path] > 0) { Ember.propertyDidChange(this.value(), path); }\n }\n};\n\nChainNodePrototype.didChange = function(suppressEvent) {\n // invalidate my own value first.\n if (this._watching) {\n var obj = this._parent.value();\n if (obj !== this._object) {\n removeChainWatcher(this._object, this._key, this);\n this._object = obj;\n addChainWatcher(obj, this._key, this);\n }\n this._value = undefined;\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n if (this._parent && this._parent._key === '@each')\n this.value();\n }\n\n // then notify chains...\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].didChange(suppressEvent);\n }\n }\n\n if (suppressEvent) { return; }\n\n // and finally tell parent about my path changing...\n if (this._parent) { this._parent.chainDidChange(this, this._key, 1); }\n};\n\n// get the chains for the current object. If the current object has\n// chains inherited from the proto they will be cloned and reconfigured for\n// the current object.\nfunction chainsFor(obj) {\n var m = metaFor(obj), ret = m.chains;\n if (!ret) {\n ret = m.chains = new ChainNode(null, null, obj);\n } else if (ret.value() !== obj) {\n ret = m.chains = ret.copy(obj);\n }\n return ret;\n}\n\nEmber.overrideChains = function(obj, keyName, m) {\n chainsDidChange(obj, keyName, m, true);\n};\n\nfunction chainsWillChange(obj, keyName, m, arg) {\n if (!m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m.chainWatchers;\n\n nodes = nodes[keyName];\n if (!nodes) { return; }\n\n for(var i = 0, l = nodes.length; i < l; i++) {\n nodes[i].willChange(arg);\n }\n}\n\nfunction chainsDidChange(obj, keyName, m, arg) {\n if (!m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m.chainWatchers;\n\n nodes = nodes[keyName];\n if (!nodes) { return; }\n\n // looping in reverse because the chainWatchers array can be modified inside didChange\n for (var i = nodes.length - 1; i >= 0; i--) {\n nodes[i].didChange(arg);\n }\n}\n\n// ..........................................................\n// WATCH\n//\n\n/**\n @private\n\n Starts watching a property on an object. Whenever the property changes,\n invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the\n primitive used by observers and dependent keys; usually you will never call\n this method directly but instead use higher level methods like\n `Ember.addObserver()`\n\n @method watch\n @for Ember\n @param obj\n @param {String} keyName\n*/\nEmber.watch = function(obj, keyName) {\n // can't watch length on Array - it is special...\n if (keyName === 'length' && Ember.typeOf(obj) === 'array') { return this; }\n\n var m = metaFor(obj), watching = m.watching, desc;\n\n // activate watching first time\n if (!watching[keyName]) {\n watching[keyName] = 1;\n if (isKeyName(keyName)) {\n desc = m.descs[keyName];\n if (desc && desc.willWatch) { desc.willWatch(obj, keyName); }\n\n if ('function' === typeof obj.willWatchProperty) {\n obj.willWatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n m.values[keyName] = obj[keyName];\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: Ember.MANDATORY_SETTER_FUNCTION,\n get: Ember.DEFAULT_GETTER_FUNCTION(keyName)\n });\n }\n } else {\n chainsFor(obj).add(keyName);\n }\n\n } else {\n watching[keyName] = (watching[keyName] || 0) + 1;\n }\n return this;\n};\n\nEmber.isWatching = function isWatching(obj, key) {\n var meta = obj[META_KEY];\n return (meta && meta.watching[key]) > 0;\n};\n\nEmber.watch.flushPending = flushPendingChains;\n\nEmber.unwatch = function(obj, keyName) {\n // can't watch length on Array - it is special...\n if (keyName === 'length' && Ember.typeOf(obj) === 'array') { return this; }\n\n var m = metaFor(obj), watching = m.watching, desc;\n\n if (watching[keyName] === 1) {\n watching[keyName] = 0;\n\n if (isKeyName(keyName)) {\n desc = m.descs[keyName];\n if (desc && desc.didUnwatch) { desc.didUnwatch(obj, keyName); }\n\n if ('function' === typeof obj.didUnwatchProperty) {\n obj.didUnwatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: m.values[keyName]\n });\n delete m.values[keyName];\n }\n } else {\n chainsFor(obj).remove(keyName);\n }\n\n } else if (watching[keyName]>1) {\n watching[keyName]--;\n }\n\n return this;\n};\n\n/**\n @private\n\n Call on an object when you first beget it from another object. This will\n setup any chained watchers on the object instance as needed. This method is\n safe to call multiple times.\n\n @method rewatch\n @for Ember\n @param obj\n*/\nEmber.rewatch = function(obj) {\n var m = metaFor(obj, false), chains = m.chains;\n\n // make sure the object has its own guid.\n if (GUID_KEY in obj && !obj.hasOwnProperty(GUID_KEY)) {\n Ember.generateGuid(obj, 'ember');\n }\n\n // make sure any chained watchers update.\n if (chains && chains.value() !== obj) {\n m.chains = chains.copy(obj);\n }\n\n return this;\n};\n\nEmber.finishChains = function(obj) {\n var m = metaFor(obj, false), chains = m.chains;\n if (chains) {\n if (chains.value() !== obj) {\n m.chains = chains = chains.copy(obj);\n }\n chains.didChange(true);\n }\n};\n\n// ..........................................................\n// PROPERTY CHANGES\n//\n\n/**\n This function is called just before an object property is about to change.\n It will notify any before observers and prepare caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyDidChange()` which you should call just\n after the property value changes.\n\n @method propertyWillChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n*/\nfunction propertyWillChange(obj, keyName) {\n var m = metaFor(obj, false),\n watching = m.watching[keyName] > 0 || keyName === 'length',\n proto = m.proto,\n desc = m.descs[keyName];\n\n if (!watching) { return; }\n if (proto === obj) { return; }\n if (desc && desc.willChange) { desc.willChange(obj, keyName); }\n dependentKeysWillChange(obj, keyName, m);\n chainsWillChange(obj, keyName, m);\n Ember.notifyBeforeObservers(obj, keyName);\n}\n\nEmber.propertyWillChange = propertyWillChange;\n\n/**\n This function is called just after an object property has changed.\n It will notify any observers and clear caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyWilLChange()` which you should call just\n before the property value changes.\n\n @method propertyDidChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n*/\nfunction propertyDidChange(obj, keyName) {\n var m = metaFor(obj, false),\n watching = m.watching[keyName] > 0 || keyName === 'length',\n proto = m.proto,\n desc = m.descs[keyName];\n\n if (proto === obj) { return; }\n\n // shouldn't this mean that we're watching this key?\n if (desc && desc.didChange) { desc.didChange(obj, keyName); }\n if (!watching && keyName !== 'length') { return; }\n\n dependentKeysDidChange(obj, keyName, m);\n chainsDidChange(obj, keyName, m);\n Ember.notifyObservers(obj, keyName);\n}\n\nEmber.propertyDidChange = propertyDidChange;\n\nvar NODE_STACK = [];\n\n/**\n Tears down the meta on an object so that it can be garbage collected.\n Multiple calls will have no effect.\n\n @method destroy\n @for Ember\n @param {Object} obj the object to destroy\n @return {void}\n*/\nEmber.destroy = function (obj) {\n var meta = obj[META_KEY], node, nodes, key, nodeObject;\n if (meta) {\n obj[META_KEY] = null;\n // remove chainWatchers to remove circular references that would prevent GC\n node = meta.chains;\n if (node) {\n NODE_STACK.push(node);\n // process tree\n while (NODE_STACK.length > 0) {\n node = NODE_STACK.pop();\n // push children\n nodes = node._chains;\n if (nodes) {\n for (key in nodes) {\n if (nodes.hasOwnProperty(key)) {\n NODE_STACK.push(nodes[key]);\n }\n }\n }\n // remove chainWatcher in node object\n if (node._watching) {\n nodeObject = node._object;\n if (nodeObject) {\n removeChainWatcher(nodeObject, node._key, node);\n }\n }\n }\n }\n }\n};\n\n})();\n//@ sourceURL=ember-metal/watching");minispade.register('ember-old-router/application', "(function() {minispade.require('ember-views');\nminispade.require('ember-states');\nminispade.require('ember-old-router/application/system');\n\n/**\nEmber Application\n\n@module ember\n@submodule ember-old-router\n@requires ember-views, ember-states, ember-routing\n*/\n\n})();\n//@ sourceURL=ember-old-router/application");minispade.register('ember-old-router/application/system', "(function() {minispade.require('ember-old-router/application/system/dag');\nminispade.require('ember-old-router/application/system/application');\n\n})();\n//@ sourceURL=ember-old-router/application/system");minispade.register('ember-old-router/application/system/application', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n An instance of `Ember.Application` is the starting point for every Ember\n application. It helps to instantiate, initialize and coordinate the many\n objects that make up your app.\n\n Each Ember app has one and only one `Ember.Application` object. In fact, the\n very first thing you should do in your application is create the instance:\n\n ```javascript\n window.App = Ember.Application.create();\n ```\n\n Typically, the application object is the only global variable. All other\n classes in your app should be properties on the `Ember.Application` instance,\n which highlights its first role: a global namespace.\n\n For example, if you define a view class, it might look like this:\n\n ```javascript\n App.MyView = Ember.View.extend();\n ```\n\n Calling `Ember.Application.create()` will automatically initialize your\n application by calling the `Ember.Application.initialize()` method. If you\n need to delay initialization, you can pass `{autoinit: false}` to the\n `Ember.Application.create()` method, and call `App.initialize()`\n later.\n\n Because `Ember.Application` inherits from `Ember.Namespace`, any classes\n you create will have useful string representations when calling `toString()`.\n See the `Ember.Namespace` documentation for more information.\n\n While you can think of your `Ember.Application` as a container that holds the\n other classes in your application, there are several other responsibilities\n going on under-the-hood that you may want to understand.\n\n ### Event Delegation\n\n Ember uses a technique called _event delegation_. This allows the framework\n to set up a global, shared event listener instead of requiring each view to\n do it manually. For example, instead of each view registering its own\n `mousedown` listener on its associated element, Ember sets up a `mousedown`\n listener on the `body`.\n\n If a `mousedown` event occurs, Ember will look at the target of the event and\n start walking up the DOM node tree, finding corresponding views and invoking\n their `mouseDown` method as it goes.\n\n `Ember.Application` has a number of default events that it listens for, as\n well as a mapping from lowercase events to camel-cased view method names. For\n example, the `keypress` event causes the `keyPress` method on the view to be\n called, the `dblclick` event causes `doubleClick` to be called, and so on.\n\n If there is a browser event that Ember does not listen for by default, you\n can specify custom events and their corresponding view method names by\n setting the application's `customEvents` property:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the loadedmetadata media\n // player event\n 'loadedmetadata': \"loadedMetadata\"\n }\n });\n ```\n\n By default, the application sets up these event listeners on the document\n body. However, in cases where you are embedding an Ember application inside\n an existing page, you may want it to set up the listeners on an element\n inside the body.\n\n For example, if only events inside a DOM element with the ID of `ember-app`\n should be delegated, set your application's `rootElement` property:\n\n ```javascript\n window.App = Ember.Application.create({\n rootElement: '#ember-app'\n });\n ```\n\n The `rootElement` can be either a DOM element or a jQuery-compatible selector\n string. Note that *views appended to the DOM outside the root element will\n not receive events.* If you specify a custom root element, make sure you only\n append views inside it!\n\n To learn more about the advantages of event delegation and the Ember view\n layer, and a list of the event listeners that are setup by default, visit the\n [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation).\n\n ### Dependency Injection\n\n One thing you may have noticed while using Ember is that you define\n *classes*, not *instances*. When your application loads, all of the instances\n are created for you. Creating these instances is the responsibility of\n `Ember.Application`.\n\n When the `Ember.Application` initializes, it will look for an `Ember.Router`\n class defined on the applications's `Router` property, like this:\n\n ```javascript\n App.Router = Ember.Router.extend({\n // ...\n });\n ```\n\n If found, the router is instantiated and saved on the application's `router`\n property (note the lowercase 'r'). While you should *not* reference this\n router instance directly from your application code, having access to\n `App.router` from the console can be useful during debugging.\n\n After the router is created, the application loops through all of the\n registered _injections_ and invokes them once for each property on the\n `Ember.Application` object.\n\n An injection is a function that is responsible for instantiating objects from\n classes defined on the application. By default, the only injection registered\n instantiates controllers and makes them available on the router.\n\n For example, if you define a controller class:\n\n ```javascript\n App.MyController = Ember.Controller.extend({\n // ...\n });\n ```\n\n Your router will receive an instance of `App.MyController` saved on its\n `myController` property.\n\n Libraries on top of Ember can register additional injections. For example,\n if your application is using Ember Data, it registers an injection that\n instantiates `DS.Store`:\n\n ```javascript\n Ember.Application.registerInjection({\n name: 'store',\n before: 'controllers',\n\n injection: function(app, router, property) {\n if (property === 'Store') {\n set(router, 'store', app[property].create());\n }\n }\n });\n ```\n\n ### Routing\n\n In addition to creating your application's router, `Ember.Application` is\n also responsible for telling the router when to start routing.\n\n By default, the router will begin trying to translate the current URL into\n application state once the browser emits the `DOMContentReady` event. If you\n need to defer routing, you can call the application's `deferReadiness()`\n method. Once routing can begin, call the `advanceReadiness()` method.\n\n If there is any setup required before routing begins, you can implement a\n `ready()` method on your app that will be invoked immediately before routing\n begins:\n\n ```javascript\n window.App = Ember.Application.create({\n ready: function() {\n this.set('router.enableLogging', true);\n }\n });\n\n To begin routing, you must have at a minimum a top-level controller and view.\n You define these as `App.ApplicationController` and `App.ApplicationView`,\n respectively. Your application will not work if you do not define these two\n mandatory classes. For example:\n\n ```javascript\n App.ApplicationView = Ember.View.extend({\n templateName: 'application'\n });\n App.ApplicationController = Ember.Controller.extend();\n ```\n\n @class Application\n @namespace Ember\n @extends Ember.Namespace\n*/\nEmber.Application = Ember.Namespace.extend(\n/** @scope Ember.Application.prototype */{\n\n /**\n The root DOM element of the Application. This can be specified as an\n element or a\n [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).\n\n This is the element that will be passed to the Application's,\n `eventDispatcher`, which sets up the listeners for event delegation. Every\n view in your application should be a child of the element you specify here.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n The `Ember.EventDispatcher` responsible for delegating events to this\n application's views.\n\n The event dispatcher is created by the application at initialization time\n and sets up event listeners on the DOM element described by the\n application's `rootElement` property.\n\n See the documentation for `Ember.EventDispatcher` for more information.\n\n @property eventDispatcher\n @type Ember.EventDispatcher\n @default null\n */\n eventDispatcher: null,\n\n /**\n The DOM events for which the event dispatcher should listen.\n\n By default, the application's `Ember.EventDispatcher` listens\n for a set of standard DOM events, such as `mousedown` and\n `keyup`, and delegates them to your application's `Ember.View`\n instances.\n\n If you would like additional events to be delegated to your\n views, set your `Ember.Application`'s `customEvents` property\n to a hash containing the DOM event name as the key and the\n corresponding view method name as the value. For example:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the loadedmetadata media\n // player event\n 'loadedmetadata': \"loadedMetadata\"\n }\n });\n ```\n\n @property customEvents\n @type Object\n @default null\n */\n customEvents: null,\n\n /**\n Should the application initialize itself after it's created. You can\n set this to `false` if you'd like to choose when to initialize your\n application. This defaults to `!Ember.testing`\n\n @property autoinit\n @type Boolean\n */\n autoinit: !Ember.testing,\n\n isInitialized: false,\n\n init: function() {\n if (!this.$) { this.$ = Ember.$; }\n\n this._super();\n\n this.createEventDispatcher();\n\n // Start off the number of deferrals at 1. This will be\n // decremented by the Application's own `initialize` method.\n this._readinessDeferrals = 1;\n\n this.waitForDOMContentLoaded();\n\n if (this.autoinit) {\n var self = this;\n this.$().ready(function() {\n if (self.isDestroyed || self.isInitialized) return;\n self.initialize();\n });\n }\n },\n\n /** @private */\n createEventDispatcher: function() {\n var rootElement = get(this, 'rootElement'),\n eventDispatcher = Ember.EventDispatcher.create({\n rootElement: rootElement\n });\n\n set(this, 'eventDispatcher', eventDispatcher);\n },\n\n waitForDOMContentLoaded: function() {\n this.deferReadiness();\n\n var self = this;\n this.$().ready(function() {\n self.advanceReadiness();\n });\n },\n\n deferReadiness: function() {\n Ember.assert(\"You cannot defer readiness since the `ready()` hook has already been called.\", this._readinessDeferrals > 0);\n this._readinessDeferrals++;\n },\n\n advanceReadiness: function() {\n this._readinessDeferrals--;\n\n if (this._readinessDeferrals === 0) {\n Ember.run.once(this, this.didBecomeReady);\n }\n },\n\n /**\n Instantiate all controllers currently available on the namespace\n and inject them onto a router.\n\n Example:\n\n ```javascript\n App.PostsController = Ember.ArrayController.extend();\n App.CommentsController = Ember.ArrayController.extend();\n\n var router = Ember.Router.create({\n ...\n });\n\n App.initialize(router);\n\n router.get('postsController'); // <App.PostsController:ember1234>\n router.get('commentsController'); // <App.CommentsController:ember1235>\n ```\n\n @method initialize\n @param router {Ember.Router}\n */\n initialize: function(router) {\n Ember.assert(\"Application initialize may only be called once\", !this.isInitialized);\n Ember.assert(\"Application not destroyed\", !this.isDestroyed);\n\n router = this.setupRouter(router);\n\n this.runInjections(router);\n\n Ember.runLoadHooks('application', this);\n\n this.isInitialized = true;\n\n // At this point, any injections or load hooks that would have wanted\n // to defer readiness have fired.\n this.advanceReadiness();\n\n return this;\n },\n\n /** @private */\n runInjections: function(router) {\n var injections = get(this.constructor, 'injections'),\n graph = new Ember.DAG(),\n namespace = this,\n properties, i, injection;\n\n for (i=0; i<injections.length; i++) {\n injection = injections[i];\n graph.addEdges(injection.name, injection.injection, injection.before, injection.after);\n }\n\n graph.topsort(function (vertex) {\n var injection = vertex.value,\n properties = Ember.A(Ember.keys(namespace));\n properties.forEach(function(property) {\n injection(namespace, router, property);\n });\n });\n },\n\n /** @private */\n setupRouter: function(router) {\n if (!router && Ember.Router.detect(this.Router)) {\n router = this.Router.create();\n this._createdRouter = router;\n }\n\n if (router) {\n set(this, 'router', router);\n\n // By default, the router's namespace is the current application.\n //\n // This allows it to find model classes when a state has a\n // route like `/posts/:post_id`. In that case, it would first\n // convert `post_id` into `Post`, and then look it up on its\n // namespace.\n set(router, 'namespace', this);\n }\n\n return router;\n },\n\n /** @private */\n didBecomeReady: function() {\n var eventDispatcher = get(this, 'eventDispatcher'),\n customEvents = get(this, 'customEvents'),\n router;\n\n eventDispatcher.setup(customEvents);\n\n this.ready();\n\n\n router = get(this, 'router');\n\n this.createApplicationView(router);\n\n if (router && router instanceof Ember.Router) {\n this.startRouting(router);\n }\n\n Ember.BOOTED = true;\n },\n\n createApplicationView: function (router) {\n var rootElement = get(this, 'rootElement'),\n applicationViewOptions = {},\n applicationViewClass = this.ApplicationView,\n applicationTemplate = Ember.TEMPLATES.application,\n applicationController, applicationView;\n\n // don't do anything unless there is an ApplicationView or application template\n if (!applicationViewClass && !applicationTemplate) return;\n\n if (router) {\n applicationController = get(router, 'applicationController');\n if (applicationController) {\n applicationViewOptions.controller = applicationController;\n }\n }\n\n if (applicationTemplate) {\n applicationViewOptions.template = applicationTemplate;\n }\n\n if (!applicationViewClass) {\n applicationViewClass = Ember.View;\n }\n\n applicationView = applicationViewClass.create(applicationViewOptions);\n\n this._createdApplicationView = applicationView;\n\n if (router) {\n set(router, 'applicationView', applicationView);\n }\n\n applicationView.appendTo(rootElement);\n },\n\n /**\n @private\n\n If the application has a router, use it to route to the current URL, and\n trigger a new call to `route` whenever the URL changes.\n\n @method startRouting\n @property router {Ember.Router}\n */\n startRouting: function(router) {\n var location = get(router, 'location');\n\n Ember.assert(\"You must have an application template or ApplicationView defined on your application\", get(router, 'applicationView') );\n Ember.assert(\"You must have an ApplicationController defined on your application\", get(router, 'applicationController') );\n\n router.route(location.getURL());\n location.onUpdateURL(function(url) {\n router.route(url);\n });\n },\n\n /**\n Called when the Application has become ready.\n The call will be delayed until the DOM has become ready.\n\n @event ready\n */\n ready: Ember.K,\n\n willDestroy: function() {\n get(this, 'eventDispatcher').destroy();\n if (this._createdRouter) { this._createdRouter.destroy(); }\n if (this._createdApplicationView) { this._createdApplicationView.destroy(); }\n },\n\n registerInjection: function(options) {\n this.constructor.registerInjection(options);\n }\n});\n\nEmber.Application.reopenClass({\n concatenatedProperties: ['injections'],\n injections: Ember.A(),\n registerInjection: function(injection) {\n var injections = get(this, 'injections');\n\n Ember.assert(\"The injection '\" + injection.name + \"' has already been registered\", !injections.findProperty('name', injection.name));\n Ember.assert(\"An injection cannot be registered with both a before and an after\", !(injection.before && injection.after));\n Ember.assert(\"An injection cannot be registered without an injection function\", Ember.canInvoke(injection, 'injection'));\n\n injections.push(injection);\n }\n});\n\nEmber.Application.registerInjection({\n name: 'controllers',\n injection: function(app, router, property) {\n if (!router) { return; }\n if (!/^[A-Z].*Controller$/.test(property)) { return; }\n\n var name = property.charAt(0).toLowerCase() + property.substr(1),\n controllerClass = app[property], controller;\n\n if(!Ember.Object.detect(controllerClass)){ return; }\n controller = app[property].create();\n\n router.set(name, controller);\n\n controller.setProperties({\n target: router,\n controllers: router,\n namespace: app\n });\n }\n});\n\nEmber.runLoadHooks('Ember.Application', Ember.Application);\n\n\n})();\n//@ sourceURL=ember-old-router/application/system/application");minispade.register('ember-old-router/application/system/dag', "(function() {function visit(vertex, fn, visited, path) {\n var name = vertex.name,\n vertices = vertex.incoming,\n names = vertex.incomingNames,\n len = names.length,\n i;\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n}\n\nfunction DAG() {\n this.names = [];\n this.vertices = {};\n}\n\nDAG.prototype.add = function(name) {\n if (!name) { return; }\n if (this.vertices.hasOwnProperty(name)) {\n return this.vertices[name];\n }\n var vertex = {\n name: name, incoming: {}, incomingNames: [], hasOutgoing: false, value: null\n };\n this.vertices[name] = vertex;\n this.names.push(name);\n return vertex;\n};\n\nDAG.prototype.map = function(name, value) {\n this.add(name).value = value;\n};\n\nDAG.prototype.addEdge = function(fromName, toName) {\n if (!fromName || !toName || fromName === toName) {\n return;\n }\n var from = this.add(fromName), to = this.add(toName);\n if (to.incoming.hasOwnProperty(fromName)) {\n return;\n }\n function checkCycle(vertex, path) {\n if (vertex.name === toName) {\n throw new Error(\"cycle detected: \" + toName + \" <- \" + path.join(\" <- \"));\n }\n }\n visit(from, checkCycle);\n from.hasOutgoing = true;\n to.incoming[fromName] = from;\n to.incomingNames.push(fromName);\n};\n\nDAG.prototype.topsort = function(fn) {\n var visited = {},\n vertices = this.vertices,\n names = this.names,\n len = names.length,\n i, vertex;\n for (i = 0; i < len; i++) {\n vertex = vertices[names[i]];\n if (!vertex.hasOutgoing) {\n visit(vertex, fn, visited);\n }\n }\n};\n\nDAG.prototype.addEdges = function(name, value, before, after) {\n var i;\n this.map(name, value);\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n for (i = 0; i < before.length; i++) {\n this.addEdge(name, before[i]);\n }\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n for (i = 0; i < after.length; i++) {\n this.addEdge(after[i], name);\n }\n }\n }\n};\n\nEmber.DAG = DAG;\n\n})();\n//@ sourceURL=ember-old-router/application/system/dag");minispade.register('ember-old-router/controller_ext', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\nAdditional methods for the ControllerMixin\n\n@class ControllerMixin\n@namespace Ember\n*/\nEmber.ControllerMixin.reopen({\n controllers: null,\n\n /**\n `connectOutlet` creates a new instance of a provided view\n class, wires it up to its associated controller, and\n assigns the new view to a property on the current controller.\n\n The purpose of this method is to enable views that use\n outlets to quickly assign new views for a given outlet.\n\n For example, an application view's template may look like\n this:\n\n ``` handlebars\n <h1>My Blog</h1>\n {{outlet}}\n ```\n\n The view for this outlet is specified by assigning a\n `view` property to the application's controller. The\n following code will assign a new `App.PostsView` to\n that outlet:\n\n ``` javascript\n applicationController.connectOutlet('posts');\n ```\n\n In general, you will also want to assign a controller\n to the newly created view. By convention, a controller\n named `postsController` will be assigned as the view's\n controller.\n\n In an application initialized using `app.initialize(router)`,\n `connectOutlet` will look for `postsController` on the\n router. The initialization process will automatically\n create an instance of `App.PostsController` called\n `postsController`, so you don't need to do anything\n beyond `connectOutlet` to assign your view and wire it\n up to its associated controller.\n\n You can supply a `content` for the controller by supplying\n a final argument after the view class:\n\n ``` javascript\n applicationController.connectOutlet('posts', App.Post.find());\n ```\n\n You can specify a particular outlet to use. For example, if your main\n template looks like:\n\n ``` handlebars\n <h1>My Blog</h1>\n {{outlet masterView}}\n {{outlet detailView}}\n ```\n\n You can assign an `App.PostsView` to the masterView outlet:\n\n ``` javascript\n applicationController.connectOutlet({\n outletName: 'masterView',\n name: 'posts',\n context: App.Post.find()\n });\n ```\n\n You can write this as:\n\n ``` javascript\n applicationController.connectOutlet('masterView', 'posts', App.Post.find());\n ```\n\n\n @method connectOutlet\n @param {String} outletName a name for the outlet to set\n @param {String} name a view/controller pair name\n @param {Object} context a context object to assign to the\n controller's `content` property, if a controller can be\n found (optional)\n */\n connectOutlet: function(name, context) {\n // Normalize arguments. Supported arguments:\n //\n // name\n // name, context\n // outletName, name\n // outletName, name, context\n // options\n //\n // The options hash has the following keys:\n //\n // name: the name of the controller and view\n // to use. If this is passed, the name\n // determines the view and controller.\n // outletName: the name of the outlet to\n // fill in. default: 'view'\n // viewClass: the class of the view to instantiate\n // controller: the controller instance to pass\n // to the view\n // context: an object that should become the\n // controller's `content` and thus the\n // template's context.\n\n var outletName, viewClass, view, controller, options;\n\n if (Ember.typeOf(context) === 'string') {\n outletName = name;\n name = context;\n context = arguments[2];\n }\n\n if (arguments.length === 1) {\n if (Ember.typeOf(name) === 'object') {\n options = name;\n outletName = options.outletName;\n name = options.name;\n viewClass = options.viewClass;\n controller = options.controller;\n context = options.context;\n }\n } else {\n options = {};\n }\n\n outletName = outletName || 'view';\n\n Ember.assert(\"The viewClass is either missing or the one provided did not resolve to a view\", !!name || (!name && !!viewClass));\n\n Ember.assert(\"You must supply a name or a viewClass to connectOutlet, but not both\", (!!name && !viewClass && !controller) || (!name && !!viewClass));\n\n if (name) {\n var namespace = get(this, 'namespace'),\n controllers = get(this, 'controllers');\n\n var viewClassName = name.charAt(0).toUpperCase() + name.substr(1) + \"View\";\n viewClass = get(namespace, viewClassName);\n controller = get(controllers, name + 'Controller');\n\n Ember.assert(\"The name you supplied '\" + name + \"' did not resolve to a view \" + viewClassName, !!viewClass);\n Ember.assert(\"The name you supplied '\" + name + \"' did not resolve to a controller \" + name + 'Controller', (!!controller && !!context) || !context);\n }\n\n if (controller && context) { set(controller, 'content', context); }\n\n view = this.createOutletView(outletName, viewClass);\n\n if (controller) { set(view, 'controller', controller); }\n set(this, outletName, view);\n\n return view;\n },\n\n /**\n Convenience method to connect controllers. This method makes other controllers\n available on the controller the method was invoked on.\n\n For example, to make the `personController` and the `postController` available\n on the `overviewController`, you would call:\n\n ```javascript\n overviewController.connectControllers('person', 'post');\n ```\n\n @method connectControllers\n @param {String...} controllerNames the controllers to make available\n */\n connectControllers: function() {\n var controllers = get(this, 'controllers'),\n controllerNames = Array.prototype.slice.apply(arguments),\n controllerName;\n\n for (var i=0, l=controllerNames.length; i<l; i++) {\n controllerName = controllerNames[i] + 'Controller';\n set(this, controllerName, get(controllers, controllerName));\n }\n },\n\n /**\n `disconnectOutlet` removes previously attached view from given outlet.\n\n @method disconnectOutlet\n @param {String} outletName the outlet name. (optional)\n */\n disconnectOutlet: function(outletName) {\n outletName = outletName || 'view';\n\n set(this, outletName, null);\n },\n\n /**\n `createOutletView` is a hook you may want to override if you need to do\n something special with the view created for the outlet. For example\n you may want to implement views sharing across outlets.\n\n @method createOutletView\n @param outletName {String}\n @param viewClass {Ember.View}\n */\n createOutletView: function(outletName, viewClass) {\n return viewClass.create();\n },\n\n urlForEvent: function(event, context) {\n var target = get(this, 'target');\n\n if (target) {\n return target.urlForEvent(event, context);\n }\n }\n});\n\n\n})();\n//@ sourceURL=ember-old-router/controller_ext");minispade.register('ember-old-router/handlebars_ext', "(function() {minispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n /**\n @module ember\n @submodule ember-old-router\n */\n\n Handlebars.OutletView = Ember.ContainerView.extend(Ember._Metamorph);\n\n /**\n The `outlet` helper allows you to specify that the current\n view's controller will fill in the view for a given area.\n\n ``` handlebars\n {{outlet}}\n ```\n\n By default, when the the current controller's `view` property changes, the\n outlet will replace its current view with the new view. You can set the\n `view` property directly, but it's normally best to use `connectOutlet`.\n\n ``` javascript\n # Instantiate App.PostsView and assign to `view`, so as to render into outlet.\n controller.connectOutlet('posts');\n ```\n\n You can also specify a particular name other than `view`:\n\n ``` handlebars\n {{outlet masterView}}\n {{outlet detailView}}\n ```\n\n Then, you can control several outlets from a single controller.\n\n ``` javascript\n # Instantiate App.PostsView and assign to controller.masterView.\n controller.connectOutlet('masterView', 'posts');\n # Also, instantiate App.PostInfoView and assign to controller.detailView.\n controller.connectOutlet('detailView', 'postInfo');\n ```\n\n @method outlet\n @for Ember.Handlebars.helpers\n @param {String} property the property on the controller\n that holds the view for this outlet\n */\n Handlebars.registerHelper('outlet', function(property, options) {\n if (property && property.data && property.data.isRenderData) {\n options = property;\n property = 'view';\n }\n\n options.hash.currentViewBinding = \"view.context.\" + property;\n\n return Handlebars.helpers.view.call(this, Handlebars.OutletView, options);\n });\n\n});\n\n})();\n//@ sourceURL=ember-old-router/handlebars_ext");minispade.register('ember-old-router/helpers', "(function() {minispade.require('ember-old-router/helpers/action');\n\n})();\n//@ sourceURL=ember-old-router/helpers");minispade.register('ember-old-router/helpers/action', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar EmberHandlebars = Ember.Handlebars,\n handlebarsGet = EmberHandlebars.get,\n get = Ember.get,\n a_slice = Array.prototype.slice;\n\nvar ActionHelper = EmberHandlebars.ActionHelper = {\n registeredActions: {}\n};\n\nActionHelper.registerAction = function(actionName, options) {\n var actionId = (++Ember.uuid).toString();\n\n ActionHelper.registeredActions[actionId] = {\n eventName: options.eventName,\n handler: function(event) {\n var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,\n secondaryClick = event.which > 1, // IE9 may return undefined\n nonStandard = modifier || secondaryClick;\n\n if (options.link && nonStandard) {\n // Allow the browser to handle special link clicks normally\n return;\n }\n\n event.preventDefault();\n\n event.view = options.view;\n\n if (options.hasOwnProperty('context')) {\n event.context = options.context;\n }\n\n if (options.hasOwnProperty('contexts')) {\n event.contexts = options.contexts;\n }\n\n var target = options.target;\n\n // Check for StateManager (or compatible object)\n if (typeof target.send === 'function') {\n return target.send(actionName, event);\n } else {\n Ember.assert(Ember.String.fmt('Target %@ does not have action %@', [target, actionName]), target[actionName]);\n return target[actionName].call(target, event);\n }\n }\n };\n\n options.view.on('willClearRender', function() {\n delete ActionHelper.registeredActions[actionId];\n });\n\n return actionId;\n};\n\n/**\n The `{{action}}` helper registers an HTML element within a template for DOM\n event handling and forwards that interaction to the view's\n `controller.target` or supplied `target` option (see 'Specifying a Target').\n By default the `controller.target` is set to the application's router.\n\n User interaction with that element will invoke the supplied action name on\n the appropriate target.\n\n Given the following Handlebars template on the page\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName target=\"view\"}}>\n click me\n </div>\n </script>\n ```\n\n And application code\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'a-template',\n anActionName: function(event){}\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will results in the following rendered HTML\n\n ```html\n <div class=\"ember-view\">\n <div data-ember-action=\"1\">\n click me\n </div>\n </div>\n ```\n\n Clicking \"click me\" will trigger the `anActionName` method of the `aView`\n object with a `jQuery.Event` object as its argument. The `jQuery.Event`\n object will be extended to include a `view` property that is set to the\n original view interacted with (in this case the `aView` object).\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers. To stop propagation of the event, simply return `false` from your\n handler.\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See `Ember.View`\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName on=\"doubleClick\"}}>\n click me\n </div>\n </script>\n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n Because `{{action}}` depends on Ember's event dispatch system it will only\n function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new\n `Ember.Application` is created. Having an instance of `Ember.Application`\n will satisfy this requirement.\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical `Ember.Router`-backed Application where views are managed\n through use of the `{{outlet}}` helper, actions will be forwarded to the\n current state of the Applications's Router. See `Ember.Router` 'Responding\n to User-initiated Events' for more information.\n\n If you manually set the `target` property on the controller of a template's\n `Ember.View` instance, the specifed `controller.target` will become the\n target for any actions. Likely custom values for a controller's `target` are\n the controller itself or a StateManager other than the Application's\n router.\n\n If the templates's view lacks a controller property the view itself is the\n target.\n\n Finally, a `target` option can be provided to the helper to change which\n object will receive the method call. This option must be a string\n representing a path to an object:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName target=\"MyApplication.someObject\"}}>\n click me\n </div>\n </script>\n ```\n\n Clicking \"click me\" in the rendered HTML of the above template will trigger\n the `anActionName` method of the object at `MyApplication.someObject`.\n The first argument to this method will be a `jQuery.Event` extended to\n include a `view` property that is set to the original view interacted with.\n\n A path relative to the template's `Ember.View` instance can also be used as\n a target:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName target=\"parentView\"}}>\n click me\n </div>\n </script>\n ```\n\n Clicking \"click me\" in the rendered HTML of the above template will trigger\n the `anActionName` method of the view's parent view.\n\n The `{{action}}` helper is `Ember.StateManager` aware. If the target of the\n action is an `Ember.StateManager` instance `{{action}}` will use the `send`\n functionality of StateManagers. The documentation for `Ember.StateManager`\n has additional information about this use.\n\n If an action's target does not implement a method that matches the supplied\n action name an error will be thrown.\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action aMethodNameThatIsMissing}}>\n click me\n </div>\n </script>\n ```\n\n With the following application code\n\n ```javascript\n AView = Ember.View.extend({\n templateName; 'a-template',\n // note: no method 'aMethodNameThatIsMissing'\n anActionName: function(event){}\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when\n \"click me\" is clicked.\n\n ### Specifying a context\n\n You may optionally specify objects to pass as contexts to the `{{action}}`\n helper by providing property paths as the subsequent parameters. These\n objects are made available as the `contexts` (also `context` if there is only\n one) properties in the `jQuery.Event` object:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n {{#each person in people}}\n <div {{action edit person}}>\n click me\n </div>\n {{/each}}\n </script>\n ```\n\n Clicking \"click me\" will trigger the `edit` method of the view's context with\n a `jQuery.Event` object containing the person object as its context.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object...} contexts\n @param {Hash} options\n*/\nEmberHandlebars.registerHelper('action', function(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n view = options.data.view,\n target, controller, link;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\"\n };\n\n action.view = view = get(view, 'concreteView');\n\n if (hash.target) {\n target = handlebarsGet(this, hash.target, options);\n } else if (controller = options.data.keywords.controller) {\n target = controller;\n }\n\n action.target = target = target || view;\n\n if (contexts.length) {\n action.contexts = contexts = Ember.EnumerableUtils.map(contexts, function(context) {\n return handlebarsGet(this, context, options);\n }, this);\n action.context = contexts[0];\n }\n\n var output = [], url;\n\n if (hash.href && target.urlForEvent) {\n url = target.urlForEvent.apply(target, [actionName].concat(contexts));\n output.push('href=\"' + url + '\"');\n action.link = true;\n }\n\n var actionId = ActionHelper.registerAction(actionName, action);\n output.push('data-ember-action=\"' + actionId + '\"');\n\n return new EmberHandlebars.SafeString(output.join(\" \"));\n});\n\n})();\n//@ sourceURL=ember-old-router/helpers/action");minispade.register('ember-old-router/location', "(function() {minispade.require('ember-views');\nminispade.require('ember-old-router/location/api');\nminispade.require('ember-old-router/location/none_location');\nminispade.require('ember-old-router/location/hash_location');\nminispade.require('ember-old-router/location/history_location');\n\n})();\n//@ sourceURL=ember-old-router/location");minispade.register('ember-old-router/location/api', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n This file implements the `location` API used by Ember's router.\n\n That API is:\n\n getURL: returns the current URL\n setURL(path): sets the current URL\n onUpdateURL(callback): triggers the callback when the URL changes\n formatURL(url): formats `url` to be placed into `href` attribute\n\n Calling setURL will not trigger onUpdateURL callbacks.\n\n TODO: This should perhaps be moved so that it's visible in the doc output.\n*/\n\n/**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n You can pass it a `implementation` (`hash`, `history`, `none`) to force a\n particular implementation.\n\n @class Location\n @namespace Ember\n @static\n*/\nEmber.Location = {\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n registerImplementation: function(name, implementation) {\n this.implementations[name] = implementation;\n },\n\n implementations: {}\n};\n\n})();\n//@ sourceURL=ember-old-router/location/api");minispade.register('ember-old-router/location/hash_location', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n `Ember.HashLocation` implements the location API using the browser's\n hash. At present, it relies on a hashchange event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HashLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n },\n\n /**\n @private\n\n Returns the current `location.hash`, minus the '#' at the front.\n\n @method getURL\n */\n getURL: function() {\n return get(this, 'location').hash.substr(1);\n },\n\n /**\n @private\n\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = Ember.guidFor(this);\n\n Ember.$(window).bind('hashchange.ember-location-'+guid, function() {\n var path = location.hash.substr(1);\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(location.hash.substr(1));\n });\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the `{{action}}` helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('hashchange.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('hash', Ember.HashLocation);\n\n})();\n//@ sourceURL=ember-old-router/location/hash_location");minispade.register('ember-old-router/location/history_location', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar popstateReady = false;\n\n/**\n `Ember.HistoryLocation` implements the location API using the browser's\n `history.pushState` API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HistoryLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n this.initState();\n },\n\n /**\n @private\n\n Used to set state on first call to `setURL`\n\n @method initState\n */\n initState: function() {\n this.replaceState(get(this, 'location').pathname);\n set(this, 'history', window.history);\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Returns the current `location.pathname`.\n\n @method getURL\n */\n getURL: function() {\n return get(this, 'location').pathname;\n },\n\n /**\n @private\n\n Uses `history.pushState` to update the url without a page reload.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n path = this.formatURL(path);\n\n if (this.getState() && this.getState().path !== path) {\n popstateReady = true;\n this.pushState(path);\n }\n },\n\n /**\n @private\n\n Get the current `history.state`\n\n @method getState\n */\n getState: function() {\n return get(this, 'history').state;\n },\n\n /**\n @private\n\n Pushes a new state\n\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n window.history.pushState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Replaces the current state\n\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n window.history.replaceState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).bind('popstate.ember-location-'+guid, function(e) {\n if(!popstateReady) {\n return;\n }\n callback(location.pathname);\n });\n },\n\n /**\n @private\n\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n }\n\n return rootURL + url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('popstate.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('history', Ember.HistoryLocation);\n\n})();\n//@ sourceURL=ember-old-router/location/history_location");minispade.register('ember-old-router/location/none_location', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n `Ember.NoneLocation` does not interact with the browser. It is useful for\n testing, or when you need to manage state with your router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.NoneLocation = Ember.Object.extend({\n path: '',\n\n getURL: function() {\n return get(this, 'path');\n },\n\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n onUpdateURL: function(callback) {\n // We are not wired up to the browser, so we'll never trigger the callback.\n },\n\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n});\n\nEmber.Location.registerImplementation('none', Ember.NoneLocation);\n\n})();\n//@ sourceURL=ember-old-router/location/none_location");minispade.register('ember-old-router', "(function() {minispade.require('ember-states');\nminispade.require('ember-old-router/promise_chain');\nminispade.require('ember-old-router/application');\nminispade.require('ember-old-router/route');\nminispade.require('ember-old-router/router');\nminispade.require('ember-old-router/helpers');\nminispade.require('ember-old-router/handlebars_ext');\nminispade.require('ember-old-router/controller_ext');\nminispade.require('ember-old-router/view_ext');\n\n/**\nEmber Old Router\n\n@module ember\n@submodule ember-old-router\n@requires ember-states\n*/\n\n})();\n//@ sourceURL=ember-old-router");minispade.register('ember-old-router/promise_chain', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber._PromiseChain = Ember.Object.extend({\n promises: null,\n failureCallback: Ember.K,\n successCallback: Ember.K,\n abortCallback: Ember.K,\n promiseSuccessCallback: Ember.K,\n\n runNextPromise: function() {\n if (get(this, 'isDestroyed')) { return; }\n\n var item = get(this, 'promises').shiftObject();\n if (item) {\n var promise = get(item, 'promise') || item;\n Ember.assert(\"Cannot find promise to invoke\", Ember.canInvoke(promise, 'then'));\n\n var self = this;\n\n var successCallback = function() {\n self.promiseSuccessCallback.call(this, item, arguments);\n self.runNextPromise();\n };\n\n var failureCallback = get(self, 'failureCallback');\n\n promise.then(successCallback, failureCallback);\n } else {\n this.successCallback();\n }\n },\n\n start: function() {\n this.runNextPromise();\n return this;\n },\n\n abort: function() {\n this.abortCallback();\n this.destroy();\n },\n\n init: function() {\n set(this, 'promises', Ember.A(get(this, 'promises')));\n this._super();\n }\n});\n\n\n})();\n//@ sourceURL=ember-old-router/promise_chain");minispade.register('ember-old-router/resolved_state', "(function() {var get = Ember.get;\n\nEmber._ResolvedState = Ember.Object.extend({\n manager: null,\n state: null,\n match: null,\n\n object: Ember.computed(function(key) {\n if (this._object) {\n return this._object;\n } else {\n var state = get(this, 'state'),\n match = get(this, 'match'),\n manager = get(this, 'manager');\n return state.deserialize(manager, match.hash);\n }\n }),\n\n hasPromise: Ember.computed(function() {\n return Ember.canInvoke(get(this, 'object'), 'then');\n }).property('object'),\n\n promise: Ember.computed(function() {\n var object = get(this, 'object');\n if (Ember.canInvoke(object, 'then')) {\n return object;\n } else {\n return {\n then: function(success) { success(object); }\n };\n }\n }).property('object'),\n\n transition: function() {\n var manager = get(this, 'manager'),\n path = get(this, 'state.path'),\n object = get(this, 'object');\n manager.transitionTo(path, object);\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/resolved_state");minispade.register('ember-old-router/routable', "(function() {minispade.require('ember-old-router/resolved_state');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get;\n\n// The Ember Routable mixin assumes the existance of a simple\n// routing shim that supports the following three behaviors:\n//\n// * .getURL() - this is called when the page loads\n// * .setURL(newURL) - this is called from within the state\n// manager when the state changes to a routable state\n// * .onURLChange(callback) - this happens when the user presses\n// the back or forward button\n\nvar paramForClass = function(classObject) {\n var className = classObject.toString(),\n parts = className.split(\".\"),\n last = parts[parts.length - 1];\n\n return Ember.String.underscore(last) + \"_id\";\n};\n\nvar merge = function(original, hash) {\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n if (original.hasOwnProperty(prop)) { continue; }\n\n original[prop] = hash[prop];\n }\n};\n\n/**\n @class Routable\n @namespace Ember\n @extends Ember.Mixin\n*/\nEmber.Routable = Ember.Mixin.create({\n init: function() {\n var redirection;\n this.on('setup', this, this.stashContext);\n\n if (redirection = get(this, 'redirectsTo')) {\n Ember.assert(\"You cannot use `redirectsTo` if you already have a `connectOutlets` method\", this.connectOutlets === Ember.K);\n\n this.connectOutlets = function(router) {\n router.transitionTo(redirection);\n };\n }\n\n // normalize empty route to '/'\n var route = get(this, 'route');\n if (route === '') {\n route = '/';\n }\n\n this._super();\n\n Ember.assert(\"You cannot use `redirectsTo` on a state that has child states\", !redirection || (!!redirection && !!get(this, 'isLeaf')));\n },\n\n setup: function() {\n return this.connectOutlets.apply(this, arguments);\n },\n\n /**\n @private\n\n Whenever a routable state is entered, the context it was entered with\n is stashed so that we can regenerate the state's `absoluteURL` on\n demand.\n\n @method stashContext\n @param manager {Ember.StateManager}\n @param context\n */\n stashContext: function(manager, context) {\n this.router = manager;\n\n var serialized = this.serialize(manager, context);\n Ember.assert('serialize must return a hash', !serialized || typeof serialized === 'object');\n\n manager.setStateMeta(this, 'context', context);\n manager.setStateMeta(this, 'serialized', serialized);\n\n if (get(this, 'isRoutable') && !get(manager, 'isRouting')) {\n this.updateRoute(manager, get(manager, 'location'));\n }\n },\n\n /**\n @private\n\n Whenever a routable state is entered, the router's location object\n is notified to set the URL to the current absolute path.\n\n In general, this will update the browser's URL.\n\n @method updateRoute\n @param manager {Ember.StateManager}\n @param location {Ember.Location}\n */\n updateRoute: function(manager, location) {\n if (get(this, 'isLeafRoute')) {\n var path = this.absoluteRoute(manager);\n location.setURL(path);\n }\n },\n\n /**\n @private\n\n Get the absolute route for the current state and a given\n hash.\n\n This method is private, as it expects a serialized hash,\n not the original context object.\n\n @method absoluteRoute\n @param manager {Ember.StateManager}\n @param hashes {Array}\n */\n absoluteRoute: function(manager, hashes) {\n var parentState = get(this, 'parentState'),\n path = '',\n generated,\n currentHash;\n\n // check if object passed instead of array\n // in this case set currentHash = hashes\n // this allows hashes to be a single hash\n // (it will be applied to state and all parents)\n currentHash = null;\n if (hashes) {\n if (hashes instanceof Array) {\n if (hashes.length > 0) {\n currentHash = hashes.shift();\n }\n } else {\n currentHash = hashes;\n }\n }\n\n // If the parent state is routable, use its current path\n // as this route's prefix.\n if (get(parentState, 'isRoutable')) {\n path = parentState.absoluteRoute(manager, hashes);\n }\n\n var matcher = get(this, 'routeMatcher'),\n serialized = manager.getStateMeta(this, 'serialized');\n\n // merge the existing serialized object in with the passed\n // in hash.\n currentHash = currentHash || {};\n merge(currentHash, serialized);\n\n generated = matcher && matcher.generate(currentHash);\n\n if (generated) {\n path = path + '/' + generated;\n }\n\n return path;\n },\n\n /**\n @private\n\n At the moment, a state is routable if it has a string `route`\n property. This heuristic may change.\n\n @property isRoutable\n @type Boolean\n */\n isRoutable: Ember.computed(function() {\n return typeof get(this, 'route') === 'string';\n }),\n\n /**\n @private\n\n Determine if this is the last routeable state\n\n @property isLeafRoute\n @type Boolean\n */\n isLeafRoute: Ember.computed(function() {\n if (get(this, 'isLeaf')) { return true; }\n return !get(this, 'childStates').findProperty('isRoutable');\n }),\n\n /**\n @private\n\n A `_RouteMatcher` object generated from the current route's `route`\n string property.\n\n @property routeMatcher\n @type Ember._RouteMatcher\n */\n routeMatcher: Ember.computed(function() {\n var route = get(this, 'route');\n if (route) {\n return Ember._RouteMatcher.create({ route: route });\n }\n }),\n\n /**\n @private\n\n Check whether the route has dynamic segments and therefore takes\n a context.\n\n @property hasContext\n @type Boolean\n */\n hasContext: Ember.computed(function() {\n var routeMatcher = get(this, 'routeMatcher');\n if (routeMatcher) {\n return routeMatcher.identifiers.length > 0;\n }\n }),\n\n /**\n @private\n\n The model class associated with the current state. This property\n uses the `modelType` property, in order to allow it to be\n specified as a String.\n\n @property modelClass\n @type Ember.Object\n */\n modelClass: Ember.computed(function() {\n var modelType = get(this, 'modelType');\n\n if (typeof modelType === 'string') {\n return Ember.get(Ember.lookup, modelType);\n } else {\n return modelType;\n }\n }),\n\n /**\n @private\n\n Get the model class for the state. The heuristic is:\n\n * The state must have a single dynamic segment\n * The dynamic segment must end in `_id`\n * A dynamic segment like `blog_post_id` is converted into `BlogPost`\n * The name is then looked up on the passed in namespace\n\n The process of initializing an application with a router will\n pass the application's namespace into the router, which will be\n used here.\n\n @method modelClassFor\n @param namespace {Ember.Namespace}\n */\n modelClassFor: function(namespace) {\n var modelClass, routeMatcher, identifiers, match, className;\n\n // if an explicit modelType was specified, use that\n if (modelClass = get(this, 'modelClass')) { return modelClass; }\n\n // if the router has no lookup namespace, we won't be able to guess\n // the modelType\n if (!namespace) { return; }\n\n // make sure this state is actually a routable state\n routeMatcher = get(this, 'routeMatcher');\n if (!routeMatcher) { return; }\n\n // only guess modelType for states with a single dynamic segment\n // (no more, no fewer)\n identifiers = routeMatcher.identifiers;\n if (identifiers.length !== 2) { return; }\n\n // extract the `_id` from the end of the dynamic segment; if the\n // dynamic segment does not end in `_id`, we can't guess the\n // modelType\n match = identifiers[1].match(/^(.*)_id$/);\n if (!match) { return; }\n\n // convert the underscored type into a class form and look it up\n // on the router's namespace\n className = Ember.String.classify(match[1]);\n return get(namespace, className);\n },\n\n /**\n The default method that takes a `params` object and converts\n it into an object.\n\n By default, a params hash that looks like `{ post_id: 1 }`\n will be looked up as `namespace.Post.find(1)`. This is\n designed to work seamlessly with Ember Data, but will work\n fine with any class that has a `find` method.\n\n @method deserialize\n @param manager {Ember.StateManager}\n @param params {Hash}\n */\n deserialize: function(manager, params) {\n var modelClass, routeMatcher, param;\n\n if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {\n Ember.assert(\"Expected \"+modelClass.toString()+\" to implement `find` for use in '\"+this.get('path')+\"' `deserialize`. Please implement the `find` method or overwrite `deserialize`.\", modelClass.find);\n return modelClass.find(params[paramForClass(modelClass)]);\n }\n\n return params;\n },\n\n /**\n The default method that takes an object and converts it into\n a params hash.\n\n By default, if there is a single dynamic segment named\n `blog_post_id` and the object is a `BlogPost` with an\n `id` of `12`, the serialize method will produce:\n\n ```javascript\n { blog_post_id: 12 }\n ```\n\n @method serialize\n @param manager {Ember.StateManager}\n @param context\n */\n serialize: function(manager, context) {\n var modelClass, routeMatcher, namespace, param, id;\n\n if (Ember.isEmpty(context)) { return ''; }\n\n if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {\n param = paramForClass(modelClass);\n id = get(context, 'id');\n context = {};\n context[param] = id;\n }\n\n return context;\n },\n\n /**\n @private\n @method resolvePath\n @param manager {Ember.StateManager}\n @param path {String}\n */\n resolvePath: function(manager, path) {\n if (get(this, 'isLeafRoute')) { return Ember.A(); }\n\n var childStates = get(this, 'childStates'), match;\n\n childStates = Ember.A(childStates.filterProperty('isRoutable'));\n\n childStates = childStates.sort(function(a, b) {\n var aDynamicSegments = get(a, 'routeMatcher.identifiers.length'),\n bDynamicSegments = get(b, 'routeMatcher.identifiers.length'),\n aRoute = get(a, 'route'),\n bRoute = get(b, 'route');\n\n if (aRoute.indexOf(bRoute) === 0) {\n return -1;\n } else if (bRoute.indexOf(aRoute) === 0) {\n return 1;\n }\n\n if (aDynamicSegments !== bDynamicSegments) {\n return aDynamicSegments - bDynamicSegments;\n }\n\n return get(b, 'route.length') - get(a, 'route.length');\n });\n\n var state = childStates.find(function(state) {\n var matcher = get(state, 'routeMatcher');\n if (match = matcher.match(path)) { return true; }\n });\n\n Ember.assert(\"Could not find state for path \" + path, !!state);\n\n var resolvedState = Ember._ResolvedState.create({\n manager: manager,\n state: state,\n match: match\n });\n\n var states = state.resolvePath(manager, match.remaining);\n\n return Ember.A([resolvedState]).pushObjects(states);\n },\n\n /**\n @private\n\n Once `unroute` has finished unwinding, `routePath` will be called\n with the remainder of the route.\n\n For example, if you were in the `/posts/1/comments` state, and you\n moved into the `/posts/2/comments` state, `routePath` will be called\n on the state whose path is `/posts` with the path `/2/comments`.\n\n @method routePath\n @param manager {Ember.StateManager}\n @param path {String}\n */\n routePath: function(manager, path) {\n if (get(this, 'isLeafRoute')) { return; }\n\n var resolvedStates = this.resolvePath(manager, path),\n hasPromises = resolvedStates.some(function(s) { return get(s, 'hasPromise'); });\n\n function runTransition() {\n resolvedStates.forEach(function(rs) { rs.transition(); });\n }\n\n if (hasPromises) {\n manager.transitionTo('loading');\n\n Ember.assert('Loading state should be the child of a route', Ember.Routable.detect(get(manager, 'currentState.parentState')));\n Ember.assert('Loading state should not be a route', !Ember.Routable.detect(get(manager, 'currentState')));\n\n manager.handleStatePromises(resolvedStates, runTransition);\n } else {\n runTransition();\n }\n },\n\n /**\n @private\n\n When you move to a new route by pressing the back\n or forward button, this method is called first.\n\n Its job is to move the state manager into a parent\n state of the state it will eventually move into.\n\n @method unroutePath\n @param router {Ember.Router}\n @param path {String}\n */\n unroutePath: function(router, path) {\n var parentState = get(this, 'parentState');\n\n // If we're at the root state, we're done\n if (parentState === router) {\n return;\n }\n\n path = path.replace(/^(?=[^\\/])/, \"/\");\n var absolutePath = this.absoluteRoute(router);\n\n var route = get(this, 'route');\n\n // If the current path is empty, move up one state,\n // because the index ('/') state must be a leaf node.\n if (route !== '/') {\n // If the current path is a prefix of the path we're trying\n // to go to, we're done.\n var index = path.indexOf(absolutePath),\n next = path.charAt(absolutePath.length);\n\n if (index === 0 && (next === \"/\" || next === \"\")) {\n return;\n }\n }\n\n // Transition to the parent and call unroute again.\n router.enterState({\n exitStates: [this],\n enterStates: [],\n finalState: parentState\n });\n\n router.send('unroutePath', path);\n },\n\n parentTemplate: Ember.computed(function() {\n var state = this, parentState, template;\n\n while (state = get(state, 'parentState')) {\n if (template = get(state, 'template')) {\n return template;\n }\n }\n\n return 'application';\n }),\n\n _template: Ember.computed(function(key) {\n var value = get(this, 'template');\n\n if (value) { return value; }\n\n // If no template was explicitly supplied convert\n // the class name into a template name. For example,\n // App.PostRoute will return `post`.\n var className = this.constructor.toString(), baseName;\n if (/^[^\\[].*Route$/.test(className)) {\n baseName = className.match(/([^\\.]+\\.)*([^\\.]+)/)[2];\n baseName = baseName.replace(/Route$/, '');\n return baseName.charAt(0).toLowerCase() + baseName.substr(1);\n }\n }),\n\n render: function(options) {\n options = options || {};\n\n var template = options.template || get(this, '_template'),\n parentTemplate = options.into || get(this, 'parentTemplate'),\n controller = get(this.router, parentTemplate + \"Controller\");\n\n var viewName = Ember.String.classify(template) + \"View\",\n viewClass = get(get(this.router, 'namespace'), viewName);\n\n viewClass = (viewClass || Ember.View).extend({\n templateName: template\n });\n\n controller.set('view', viewClass.create());\n },\n\n /**\n The `connectOutlets` event will be triggered once a\n state has been entered. It will be called with the\n route's context.\n\n @event connectOutlets\n @param router {Ember.Router}\n @param [context*]\n */\n connectOutlets: Ember.K,\n\n /**\n The `navigateAway` event will be triggered when the\n URL changes due to the back/forward button\n\n @event navigateAway\n */\n navigateAway: Ember.K\n});\n\n})();\n//@ sourceURL=ember-old-router/routable");minispade.register('ember-old-router/route', "(function() {minispade.require('ember-old-router/routable');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\n/**\n @class Route\n @namespace Ember\n @extends Ember.State\n @uses Ember.Routable\n*/\nEmber.Route = Ember.State.extend(Ember.Routable);\n\n})();\n//@ sourceURL=ember-old-router/route");minispade.register('ember-old-router/route_matcher', "(function() {var escapeForRegex = function(text) {\n return text.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^\\$|#\\s]/g, \"\\\\$&\");\n};\n\n/**\n @class _RouteMatcher\n @namespace Ember\n @private\n @extends Ember.Object\n*/\nEmber._RouteMatcher = Ember.Object.extend({\n state: null,\n\n init: function() {\n var route = this.route,\n identifiers = [],\n count = 1,\n escaped;\n\n // Strip off leading slash if present\n if (route.charAt(0) === '/') {\n route = this.route = route.substr(1);\n }\n\n escaped = escapeForRegex(route);\n\n var regex = escaped.replace(/(:|(?:\\\\\\*))([a-z_]+)(?=$|\\/)/gi, function(match, type, id) {\n identifiers[count++] = id;\n switch (type) {\n case \":\":\n return \"([^/]+)\";\n case \"\\\\*\":\n return \"(.+)\";\n }\n });\n\n this.identifiers = identifiers;\n this.regex = new RegExp(\"^/?\" + regex);\n },\n\n match: function(path) {\n var match = path.match(this.regex);\n\n if (match) {\n var identifiers = this.identifiers,\n hash = {};\n\n for (var i=1, l=identifiers.length; i<l; i++) {\n hash[identifiers[i]] = match[i];\n }\n\n return {\n remaining: path.substr(match[0].length),\n hash: identifiers.length > 0 ? hash : null\n };\n }\n },\n\n generate: function(hash) {\n var identifiers = this.identifiers, route = this.route, id;\n for (var i=1, l=identifiers.length; i<l; i++) {\n id = identifiers[i];\n route = route.replace(new RegExp(\"(:|(\\\\*))\" + id), hash[id]);\n }\n return route;\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/route_matcher");minispade.register('ember-old-router/router', "(function() {minispade.require('ember-old-router/route_matcher');\nminispade.require('ember-old-router/routable');\nminispade.require('ember-old-router/location');\nminispade.require('ember-metal/utils'); // Ember.tryFinally\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar merge = function(original, hash) {\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n if (original.hasOwnProperty(prop)) { continue; }\n\n original[prop] = hash[prop];\n }\n};\n\n/**\n `Ember.Router` is the subclass of `Ember.StateManager` responsible for\n providing URL-based application state detection. The `Ember.Router` instance\n of an application detects the browser URL at application load time and\n attempts to match it to a specific application state. Additionally the router\n will update the URL to reflect an application's state changes over time.\n\n ## Adding a Router Instance to Your Application\n\n An instance of `Ember.Router` can be associated with an instance of\n `Ember.Application` in one of two ways:\n\n You can provide a subclass of `Ember.Router` as the `Router` property of your\n application. An instance of this `Router` class will be instantiated and\n route detection will be enabled when the application's `initialize` method is\n called. The `Router` instance will be available as the `router` property of\n the application:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({ ... })\n });\n\n App.initialize();\n App.get('router') // an instance of App.Router\n ```\n\n If you want to define a `Router` instance elsewhere, you can pass the\n instance to the application's `initialize` method:\n\n ```javascript\n App = Ember.Application.create();\n aRouter = Ember.Router.create({ ... });\n\n App.initialize(aRouter);\n App.get('router') // aRouter\n ```\n\n ## Adding Routes to a Router\n\n The `initialState` property of `Ember.Router` instances is named `root`. The\n state stored in this property must be a subclass of `Ember.Route`. The `root`\n route acts as the container for the set of routable states but is not\n routable itself. It should have states that are also subclasses of\n `Ember.Route` which each have a `route` property describing the URL pattern\n you would like to detect.\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n index: Ember.Route.extend({\n route: '/'\n }),\n ... additional Ember.Routes ...\n })\n })\n });\n App.initialize();\n ```\n\n When an application loads, Ember will parse the URL and attempt to find an\n Ember.Route within the application's states that matches. (The example\n URL-matching below will use the default 'hash syntax' provided by\n `Ember.HashLocation`.)\n\n In the following route structure:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/'\n }),\n bRoute: Ember.Route.extend({\n route: '/alphabeta'\n })\n })\n })\n });\n App.initialize();\n ```\n\n Loading the page at the URL '#/' will detect the route property of\n `root.aRoute` ('/') and transition the router first to the state named `root`\n and then to the substate `aRoute`.\n\n Respectively, loading the page at the URL '#/alphabeta' would detect the\n route property of `root.bRoute` ('/alphabeta') and transition the router\n first to the state named `root` and then to the substate `bRoute`.\n\n ## Adding Nested Routes to a Router\n\n Routes can contain nested subroutes each with their own `route` property\n describing the nested portion of the URL they would like to detect and\n handle. `Router`, like all instances of `StateManager`, cannot call\n `transitonTo` with an intermediary state. To avoid transitioning the Router\n into an intermediary state when detecting URLs, a Route with nested routes\n must define both a base `route` property for itself and a child Route with a\n `route` property of `'/'` which will be transitioned to when the base route\n is detected in the URL:\n\n Given the following application code:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/theBaseRouteForThisSet',\n\n indexSubRoute: Ember.Route.extend({\n route: '/'\n }),\n\n subRouteOne: Ember.Route.extend({\n route: '/subroute1'\n }),\n\n subRouteTwo: Ember.Route.extend({\n route: '/subRoute2'\n })\n\n })\n })\n })\n });\n App.initialize();\n ```\n\n When the application is loaded at '/theBaseRouteForThisSet' the Router will\n transition to the route at path `root.aRoute` and then transition to state\n `indexSubRoute`.\n\n When the application is loaded at '/theBaseRouteForThisSet/subRoute1' the\n Router will transition to the route at path `root.aRoute` and then transition\n to state `subRouteOne`.\n\n ## Route Transition Events\n\n Transitioning between `Ember.Route` instances (including the transition into\n the detected route when loading the application) triggers the same\n transition events as state transitions for base `Ember.State`s. However, the\n default `setup` transition event is named `connectOutlets` on `Ember.Router`\n instances (see 'Changing View Hierarchy in Response To State Change').\n\n The following route structure when loaded with the URL \"#/\"\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n enter: function(router) {\n console.log(\"entering root.aRoute from\", router.get('currentState.name'));\n },\n connectOutlets: function(router) {\n console.log(\"entered root.aRoute, fully transitioned to\", router.get('currentState.path'));\n }\n })\n })\n })\n });\n App.initialize();\n ```\n\n Will result in console output of:\n\n ```\n 'entering root.aRoute from root'\n 'entered root.aRoute, fully transitioned to root.aRoute '\n ```\n\n `Ember.Route` has two additional callbacks for handling URL serialization and\n deserialization. See 'Serializing/Deserializing URLs'\n\n ## Routes With Dynamic Segments\n\n An `Ember.Route`'s `route` property can reference dynamic sections of the URL\n by prefacing a URL segment with the ':' character. The values of these\n dynamic segments will be passed as a hash to the `deserialize` method of the\n matching `Route` (see 'Serializing/Deserializing URLs').\n\n ## Serializing/Deserializing URLs\n\n `Ember.Route` has two callbacks for associating a particular object context\n with a URL: `serialize` for converting an object into a parameters hash to\n fill dynamic segments of a URL and `deserialize` for converting a hash of\n dynamic segments from the URL into the appropriate object.\n\n ### Deserializing A URL's Dynamic Segments\n\n When an application is first loaded or the URL is changed manually (e.g.\n through the browser's back button) the `deserialize` method of the URL's\n matching `Ember.Route` will be called with the application's router as its\n first argument and a hash of the URL's dynamic segments and values as its\n second argument.\n\n The following route structure when loaded with the URL\n \"#/fixed/thefirstvalue/anotherFixed/thesecondvalue\":\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/fixed/:dynamicSectionA/anotherFixed/:dynamicSectionB',\n deserialize: function(router, params) {}\n })\n })\n })\n });\n App.initialize();\n ```\n\n Will call the `deserialize` method of the Route instance at the path\n `root.aRoute` with the following hash as its second argument:\n\n ```javascript\n {\n dynamicSectionA: 'thefirstvalue',\n dynamicSectionB: 'thesecondvalue'\n }\n ```\n\n Within `deserialize` you should use this information to retrieve or create an\n appropriate context object for the given URL (e.g. by loading from a remote\n API or accessing the browser's `localStorage`). This object must be the\n `return` value of `deserialize` and will be passed to the `Route`'s\n `connectOutlets` and `serialize` methods.\n\n When an application's state is changed from within the application itself,\n the context provided for the transition will be passed and `deserialize` is\n not called (see 'Transitions Between States').\n\n ### Serializing An Object For URLs with Dynamic Segments\n\n When transitioning into a Route whose `route` property contains dynamic\n segments the route's `serialize` method is called with the route's router as\n the first argument and the route's context as the second argument. The return\n value of `serialize` will be used to populate the dynamic segments and should\n be an object with keys that match the names of the dynamic sections.\n\n Given the following route structure:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/'\n }),\n bRoute: Ember.Route.extend({\n route: '/staticSection/:someDynamicSegment',\n serialize: function(router, context) {\n return {\n someDynamicSegment: context.get('name')\n }\n }\n })\n })\n })\n });\n App.initialize();\n ```\n\n Transitioning to `root.bRoute` with a context of\n `Object.create({name: 'Yehuda'})` will call the `Route`'s `serialize`\n method with the context as its second argument and update the URL to\n '#/staticSection/Yehuda'.\n\n ## Transitions Between States\n\n Once a routed application has initialized its state based on the entry URL,\n subsequent transitions to other states will update the URL if the entered\n Route has a `route` property. Given the following route structure loaded at\n the URL '#/':\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n moveElsewhere: Ember.Route.transitionTo('bRoute')\n }),\n bRoute: Ember.Route.extend({\n route: '/someOtherLocation'\n })\n })\n })\n });\n App.initialize();\n ```\n\n And application code:\n\n ```javascript\n App.get('router').send('moveElsewhere');\n ```\n\n Will transition the application's state to `root.bRoute` and trigger an\n update of the URL to `#/someOtherLocation`.\n\n For URL patterns with dynamic segments a context can be supplied as the\n second argument to `send`. The router will match dynamic segments names to\n keys on this object and fill in the URL with the supplied values. Given the\n following state structure loaded at the URL `#/`:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n moveElsewhere: Ember.Route.transitionTo('bRoute')\n }),\n bRoute: Ember.Route.extend({\n route: '/a/route/:dynamicSection/:anotherDynamicSection',\n connectOutlets: function(router, context) {},\n })\n })\n })\n });\n App.initialize();\n ```\n\n And application code:\n\n ```javascript\n App.get('router').send('moveElsewhere', {\n dynamicSection: '42',\n anotherDynamicSection: 'Life'\n });\n ```\n\n Will transition the application's state to `root.bRoute` and trigger an\n update of the URL to `#/a/route/42/Life`.\n\n The context argument will also be passed as the second argument to the\n `serialize` method call.\n\n ## Injection of Controller Singletons\n\n During application initialization Ember will detect properties of the\n application ending in 'Controller', create singleton instances of each class,\n and assign them as properties on the router. The property name will be the\n UpperCamel name converted to lowerCamel format. These controller classes\n should be subclasses of `Ember.ObjectController`, `Ember.ArrayController`,\n `Ember.Controller`, or a custom `Ember.Object` that includes the\n `Ember.ControllerMixin` mixin.\n\n ```javascript\n App = Ember.Application.create({\n FooController: Ember.Object.create(Ember.ControllerMixin),\n Router: Ember.Router.extend({ ... })\n });\n\n App.get('router.fooController'); // instance of App.FooController\n ```\n\n The controller singletons will have their `namespace` property set to the\n application and their `target` property set to the application's router\n singleton for easy integration with Ember's user event system. See 'Changing\n View Hierarchy in Response To State Change' and 'Responding to User-initiated\n Events.'\n\n ## Responding to User-initiated Events\n\n Controller instances injected into the router at application initialization\n have their `target` property set to the application's router instance. These\n controllers will also be the default `context` for their associated views.\n Uses of the `{{action}}` helper will automatically target the application's\n router.\n\n Given the following application entered at the URL `#/`:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n anActionOnTheRouter: function(router, context) {\n router.transitionTo('anotherState', context);\n }\n })\n anotherState: Ember.Route.extend({\n route: '/differentUrl',\n connectOutlets: function(router, context) {\n\n }\n })\n })\n })\n });\n App.initialize();\n ```\n\n The following template:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"aView\">\n <h1><a {{action anActionOnTheRouter}}>{{title}}</a></h1>\n </script>\n ```\n\n Will delegate `click` events on the rendered `h1` to the application's router\n instance. In this case the `anActionOnTheRouter` method of the state at\n 'root.aRoute' will be called with the view's controller as the context\n argument. This context will be passed to the `connectOutlets` as its second\n argument.\n\n Different `context` can be supplied from within the `{{action}}` helper,\n allowing specific context passing between application states:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"photos\">\n {{#each photo in controller}}\n <h1><a {{action showPhoto photo}}>{{title}}</a></h1>\n {{/each}}\n </script>\n ```\n\n See `Handlebars.helpers.action` for additional usage examples.\n\n ## Changing View Hierarchy in Response To State Change\n\n Changes in application state that change the URL should be accompanied by\n associated changes in view hierarchy. This can be accomplished by calling\n `connectOutlet` on the injected controller singletons from within the\n 'connectOutlets' event of an `Ember.Route`:\n\n ```javascript\n App = Ember.Application.create({\n OneController: Ember.ObjectController.extend(),\n OneView: Ember.View.extend(),\n\n AnotherController: Ember.ObjectController.extend(),\n AnotherView: Ember.View.extend(),\n\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n connectOutlets: function(router, context) {\n router.get('oneController').connectOutlet('another');\n },\n })\n })\n })\n });\n App.initialize();\n ```\n\n This will detect the `{{outlet}}` portion of `oneController`'s view (an\n instance of `App.OneView`) and fill it with a rendered instance of\n `App.AnotherView` whose `context` will be the single instance of\n `App.AnotherController` stored on the router in the `anotherController`\n property.\n\n For more information about Outlets, see `Ember.Handlebars.helpers.outlet`.\n For additional information on the `connectOutlet` method, see\n `Ember.Controller.connectOutlet`. For more information on controller\n injections, see `Ember.Application#initialize()`. For additional information\n about view context, see `Ember.View`.\n\n @class Router\n @namespace Ember\n @extends Ember.StateManager\n*/\nEmber.Router = Ember.StateManager.extend(\n/** @scope Ember.Router.prototype */ {\n\n /**\n @property initialState\n @type String\n @default 'root'\n */\n initialState: 'root',\n\n /**\n The `Ember.Location` implementation to be used to manage the application\n URL state. The following values are supported:\n\n * `hash`: Uses URL fragment identifiers (like #/blog/1) for routing.\n * `history`: Uses the browser's history.pushstate API for routing. Only\n works in modern browsers with pushstate support.\n * `none`: Does not read or set the browser URL, but still allows for\n routing to happen. Useful for testing.\n\n @property location\n @type String\n @default 'hash'\n */\n location: 'hash',\n\n /**\n This is only used when a history location is used so that applications that\n don't live at the root of the domain can append paths to their root.\n\n @property rootURL\n @type String\n @default '/'\n */\n\n rootURL: '/',\n\n transitionTo: function() {\n this.abortRoutingPromises();\n this._super.apply(this, arguments);\n },\n\n route: function(path) {\n this.abortRoutingPromises();\n\n set(this, 'isRouting', true);\n\n var routableState;\n function tryable() {\n path = path.replace(get(this, 'rootURL'), '');\n path = path.replace(/^(?=[^\\/])/, \"/\");\n\n this.send('navigateAway');\n this.send('unroutePath', path);\n\n routableState = get(this, 'currentState');\n while (routableState && !routableState.get('isRoutable')) {\n routableState = get(routableState, 'parentState');\n }\n var currentURL = routableState ? routableState.absoluteRoute(this) : '';\n var rest = path.substr(currentURL.length);\n\n this.send('routePath', rest);\n }\n\n function finalizer() {\n set(this, 'isRouting', false);\n }\n\n Ember.tryFinally(tryable, finalizer, this);\n\n routableState = get(this, 'currentState');\n while (routableState && !routableState.get('isRoutable')) {\n routableState = get(routableState, 'parentState');\n }\n\n if (routableState) {\n routableState.updateRoute(this, get(this, 'location'));\n }\n },\n\n urlFor: function(path, hashes) {\n var currentState = get(this, 'currentState') || this,\n state = this.findStateByPath(currentState, path);\n\n Ember.assert(Ember.String.fmt(\"Could not find route with path '%@'\", [path]), state);\n Ember.assert(Ember.String.fmt(\"To get a URL for the state '%@', it must have a `route` property.\", [path]), get(state, 'routeMatcher'));\n\n var location = get(this, 'location'),\n absoluteRoute = state.absoluteRoute(this, hashes);\n\n return location.formatURL(absoluteRoute);\n },\n\n urlForEvent: function(eventName) {\n var contexts = Array.prototype.slice.call(arguments, 1),\n currentState = get(this, 'currentState'),\n targetStateName = currentState.lookupEventTransition(eventName),\n targetState,\n hashes;\n\n Ember.assert(Ember.String.fmt(\"You must specify a target state for event '%@' in order to link to it in the current state '%@'.\", [eventName, get(currentState, 'path')]), targetStateName);\n\n targetState = this.findStateByPath(currentState, targetStateName);\n\n Ember.assert(\"Your target state name \" + targetStateName + \" for event \" + eventName + \" did not resolve to a state\", targetState);\n\n\n hashes = this.serializeRecursively(targetState, contexts, []);\n\n return this.urlFor(targetStateName, hashes);\n },\n\n serializeRecursively: function(state, contexts, hashes) {\n var parentState,\n\t\t\tcontext = get(state, 'hasContext') ? contexts.pop() : null,\n hash = context ? state.serialize(this, context) : null;\n\n\t\thashes.push(hash);\n\t\tparentState = state.get(\"parentState\");\n\n\t\tif (parentState && parentState instanceof Ember.Route) {\n return this.serializeRecursively(parentState, contexts, hashes);\n } else {\n return hashes;\n }\n },\n\n abortRoutingPromises: function() {\n if (this._routingPromises) {\n this._routingPromises.abort();\n this._routingPromises = null;\n }\n },\n\n handleStatePromises: function(states, complete) {\n this.abortRoutingPromises();\n\n this.set('isLocked', true);\n\n var manager = this;\n\n this._routingPromises = Ember._PromiseChain.create({\n promises: states.slice(),\n\n successCallback: function() {\n manager.set('isLocked', false);\n complete();\n },\n\n failureCallback: function() {\n throw \"Unable to load object\";\n },\n\n promiseSuccessCallback: function(item, args) {\n set(item, 'object', args[0]);\n },\n\n abortCallback: function() {\n manager.set('isLocked', false);\n }\n }).start();\n },\n\n moveStatesIntoRoot: function() {\n this.root = Ember.Route.extend();\n\n for (var name in this) {\n if (name === \"constructor\") { continue; }\n\n var state = this[name];\n\n if (state instanceof Ember.Route || Ember.Route.detect(state)) {\n this.root[name] = state;\n delete this[name];\n }\n }\n },\n\n init: function() {\n if (!this.root) {\n this.moveStatesIntoRoot();\n }\n\n this._super();\n\n var location = get(this, 'location'),\n rootURL = get(this, 'rootURL');\n\n if ('string' === typeof location) {\n set(this, 'location', Ember.Location.create({\n implementation: location,\n rootURL: rootURL\n }));\n }\n\n this.assignRouter(this, this);\n },\n\n assignRouter: function(state, router) {\n state.router = router;\n\n var childStates = state.states;\n\n if (childStates) {\n for (var stateName in childStates) {\n if (!childStates.hasOwnProperty(stateName)) { continue; }\n this.assignRouter(childStates[stateName], router);\n }\n }\n },\n\n willDestroy: function() {\n get(this, 'location').destroy();\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/router");minispade.register('ember-old-router/view_ext', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\nOverride functionality for Ember.View use in old-router\n\n@class View\n@namespace Ember\n*/\nEmber.View.reopen({\n templateForName: function(name, type) {\n if (!name) { return; }\n\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n var templates = get(this, 'templates'),\n template = get(templates, name);\n\n if (!template) {\n throw new Ember.Error(fmt('%@ - Unable to find %@ \"%@\".', [this, type, name]));\n }\n\n return template;\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/view_ext");minispade.register('ember-routing/ext', "(function() {minispade.require('ember-routing/ext/controller');\nminispade.require('ember-routing/ext/view');\n\n})();\n//@ sourceURL=ember-routing/ext");minispade.register('ember-routing/ext/controller', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.ControllerMixin.reopen({\n transitionToRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.transitionToRoute || target.transitionTo;\n return method.apply(target, arguments);\n },\n\n transitionTo: function() {\n Ember.deprecate(\"transitionTo is deprecated. Please use transitionToRoute.\");\n return this.transitionToRoute.apply(this, arguments);\n },\n\n replaceRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.replaceRoute || target.replaceWith;\n return method.apply(target, arguments);\n },\n\n replaceWith: function() {\n Ember.deprecate(\"replaceWith is deprecated. Please use replaceRoute.\");\n return this.replaceRoute.apply(this, arguments);\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/controller");minispade.register('ember-routing/ext/view', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.View.reopen({\n init: function() {\n set(this, '_outlets', {});\n this._super();\n },\n\n connectOutlet: function(outletName, view) {\n var outlets = get(this, '_outlets'),\n container = get(this, 'container'),\n router = container && container.lookup('router:main'),\n renderedName = get(view, 'renderedName');\n\n set(outlets, outletName, view);\n\n if (router && renderedName) {\n router._connectActiveView(renderedName, view);\n }\n },\n\n disconnectOutlet: function(outletName) {\n var outlets = get(this, '_outlets');\n\n set(outlets, outletName, null);\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/view");minispade.register('ember-routing/helpers', "(function() {minispade.require('ember-routing/helpers/shared');\nminispade.require('ember-routing/helpers/link_to');\nminispade.require('ember-routing/helpers/outlet');\nminispade.require('ember-routing/helpers/render');\nminispade.require('ember-routing/helpers/action');\nminispade.require('ember-routing/helpers/control');\n\n})();\n//@ sourceURL=ember-routing/helpers");minispade.register('ember-routing/helpers/action', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\nminispade.require('ember-handlebars/ext');\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n var EmberHandlebars = Ember.Handlebars,\n handlebarsGet = EmberHandlebars.get,\n SafeString = EmberHandlebars.SafeString,\n get = Ember.get,\n a_slice = Array.prototype.slice;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return ret.concat(resolveParams(options.context, options.params, { types: types, data: data }));\n }\n\n var ActionHelper = EmberHandlebars.ActionHelper = {\n registeredActions: {}\n };\n\n var keys = [\"alt\", \"shift\", \"meta\", \"ctrl\"];\n\n var isAllowedClick = function(event, allowedKeys) {\n if (typeof allowedKeys === \"undefined\") {\n return isSimpleClick(event);\n }\n\n var allowed = true;\n\n keys.forEach(function(key) {\n if (event[key + \"Key\"] && allowedKeys.indexOf(key) === -1) {\n allowed = false;\n }\n });\n\n return allowed;\n };\n\n ActionHelper.registerAction = function(actionName, options, allowedKeys) {\n var actionId = (++Ember.uuid).toString();\n\n ActionHelper.registeredActions[actionId] = {\n eventName: options.eventName,\n handler: function(event) {\n if (!isAllowedClick(event, allowedKeys)) { return true; }\n\n event.preventDefault();\n\n if (options.bubbles === false) {\n event.stopPropagation();\n }\n\n var target = options.target;\n\n if (target.target) {\n target = handlebarsGet(target.root, target.target, target.options);\n } else {\n target = target.root;\n }\n\n Ember.run(function() {\n if (target.send) {\n target.send.apply(target, args(options.parameters, actionName));\n } else {\n Ember.assert(\"The action '\" + actionName + \"' did not exist on \" + target, typeof target[actionName] === 'function');\n target[actionName].apply(target, args(options.parameters));\n }\n });\n }\n };\n\n options.view.on('willClearRender', function() {\n delete ActionHelper.registeredActions[actionId];\n });\n\n return actionId;\n };\n\n /**\n The `{{action}}` helper registers an HTML element within a template for DOM\n event handling and forwards that interaction to the view's controller\n or supplied `target` option (see 'Specifying a Target').\n\n If the view's controller does not implement the event, the event is sent\n to the current route, and it bubbles up the route hierarchy from there.\n\n User interaction with that element will invoke the supplied action name on\n the appropriate target.\n\n Given the following Handlebars template on the page\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName}}>\n click me\n </div>\n </script>\n ```\n\n And application code\n\n ```javascript\n AController = Ember.Controller.extend({\n anActionName: function() {}\n });\n\n AView = Ember.View.extend({\n controller: AController.create(),\n templateName: 'a-template'\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will results in the following rendered HTML\n\n ```html\n <div class=\"ember-view\">\n <div data-ember-action=\"1\">\n click me\n </div>\n </div>\n ```\n\n Clicking \"click me\" will trigger the `anActionName` method of the\n `AController`. In this case, no additional parameters will be passed.\n\n If you provide additional parameters to the helper:\n\n ```handlebars\n <button {{action 'edit' post}}>Edit</button>\n ```\n\n Those parameters will be passed along as arguments to the JavaScript\n function implementing the action.\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers.\n\n To also disable bubbling, pass `bubbles=false` to the helper:\n\n ```handlebars\n <button {{action 'edit' post bubbles=false}}>Edit</button>\n ```\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See `Ember.View`\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName on=\"doubleClick\"}}>\n click me\n </div>\n </script>\n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n NOTE: Because `{{action}}` depends on Ember's event dispatch system it will\n only function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new `Ember.Application`\n is created. Having an instance of `Ember.Application` will satisfy this\n requirement.\n\n ### Specifying whitelisted modifier keys\n\n By default the `{{action}}` helper will ignore click event with pressed modifier\n keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName allowedKeys=\"alt\"}}>\n click me\n </div>\n </script>\n ```\n\n This way the `{{action}}` will fire when clicking with the alt key pressed down.\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical Ember application, where views are managed through use of the\n `{{outlet}}` helper, actions will bubble to the current controller, then\n to the current route, and then up the route hierarchy.\n\n Alternatively, a `target` option can be provided to the helper to change\n which object will receive the method call. This option must be a path\n path to an object, accessible in the current context:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName target=\"MyApplication.someObject\"}}>\n click me\n </div>\n </script>\n ```\n\n Clicking \"click me\" in the rendered HTML of the above template will trigger\n the `anActionName` method of the object at `MyApplication.someObject`.\n\n If an action's target does not implement a method that matches the supplied\n action name an error will be thrown.\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action aMethodNameThatIsMissing}}>\n click me\n </div>\n </script>\n ```\n\n With the following application code\n\n ```javascript\n AView = Ember.View.extend({\n templateName; 'a-template',\n // note: no method 'aMethodNameThatIsMissing'\n anActionName: function(event) {}\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when\n \"click me\" is clicked.\n\n ### Additional Parameters\n\n You may specify additional parameters to the `{{action}}` helper. These\n parameters are passed along as the arguments to the JavaScript function\n implementing the action.\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n {{#each person in people}}\n <div {{action edit person}}>\n click me\n </div>\n {{/each}}\n </script>\n ```\n\n Clicking \"click me\" will trigger the `edit` method on the current view's\n controller with the current person as a parameter.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object} [context]*\n @param {Hash} options\n */\n EmberHandlebars.registerHelper('action', function(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n view = options.data.view,\n controller;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\"\n };\n\n action.parameters = {\n context: this,\n options: options,\n params: contexts\n };\n\n action.view = view = get(view, 'concreteView');\n\n var root, target;\n\n if (hash.target) {\n root = this;\n target = hash.target;\n } else if (controller = options.data.keywords.controller) {\n root = controller;\n }\n\n action.target = { root: root, target: target, options: options };\n action.bubbles = hash.bubbles;\n\n var actionId = ActionHelper.registerAction(actionName, action, hash.allowedKeys);\n return new SafeString('data-ember-action=\"' + actionId + '\"');\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/action");minispade.register('ember-routing/helpers/control', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nif (Ember.ENV.EXPERIMENTAL_CONTROL_HELPER) {\n var get = Ember.get, set = Ember.set;\n\n /**\n The control helper is currently under development and is considered experimental.\n To enable it, set `ENV.EXPERIMENTAL_CONTROL_HELPER = true` before requiring Ember.\n\n @method control\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {String} modelPath\n @param {Hash} options\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('control', function(path, modelPath, options) {\n if (arguments.length === 2) {\n options = modelPath;\n modelPath = undefined;\n }\n\n var model;\n\n if (modelPath) {\n model = Ember.Handlebars.get(this, modelPath, options);\n }\n\n var controller = options.data.keywords.controller,\n view = options.data.keywords.view,\n children = get(controller, '_childContainers'),\n controlID = options.hash.controlID,\n container, subContainer;\n\n if (children.hasOwnProperty(controlID)) {\n subContainer = children[controlID];\n } else {\n container = get(controller, 'container'),\n subContainer = container.child();\n children[controlID] = subContainer;\n }\n\n var normalizedPath = path.replace(/\\//g, '.');\n\n var childView = subContainer.lookup('view:' + normalizedPath) || subContainer.lookup('view:default'),\n childController = subContainer.lookup('controller:' + normalizedPath),\n childTemplate = subContainer.lookup('template:' + path);\n\n Ember.assert(\"Could not find controller for path: \" + normalizedPath, childController);\n Ember.assert(\"Could not find view for path: \" + normalizedPath, childView);\n\n set(childController, 'target', controller);\n set(childController, 'model', model);\n\n options.hash.template = childTemplate;\n options.hash.controller = childController;\n\n function observer() {\n var model = Ember.Handlebars.get(this, modelPath, options);\n set(childController, 'model', model);\n childView.rerender();\n }\n\n Ember.addObserver(this, modelPath, observer);\n childView.one('willDestroyElement', this, function() {\n Ember.removeObserver(this, modelPath, observer);\n });\n\n Ember.Handlebars.helpers.view.call(this, childView, options);\n });\n}\n\n})();\n//@ sourceURL=ember-routing/helpers/control");minispade.register('ember-routing/helpers/link_to', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n function fullRouteName(router, name) {\n if (!router.hasRoute(name)) {\n name = name + '.index';\n }\n\n return name;\n }\n\n function resolvedPaths(options) {\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return resolveParams(options.context, options.params, { types: types, data: data });\n }\n\n function args(linkView, router, route) {\n var passedRouteName = route || linkView.namedRoute, routeName;\n\n routeName = fullRouteName(router, passedRouteName);\n\n Ember.assert(\"The route \" + passedRouteName + \" was not found\", router.hasRoute(routeName));\n\n var ret = [ routeName ];\n return ret.concat(resolvedPaths(linkView.parameters));\n }\n\n var LinkView = Ember.View.extend({\n tagName: 'a',\n namedRoute: null,\n currentWhen: null,\n title: null,\n activeClass: 'active',\n replace: false,\n attributeBindings: ['href', 'title'],\n classNameBindings: 'active',\n\n // Even though this isn't a virtual view, we want to treat it as if it is\n // so that you can access the parent with {{view.prop}}\n concreteView: Ember.computed(function() {\n return get(this, 'parentView');\n }).property('parentView').volatile(),\n\n active: Ember.computed(function() {\n var router = this.get('router'),\n params = resolvedPaths(this.parameters),\n currentWithIndex = this.currentWhen + '.index',\n isActive = router.isActive.apply(router, [this.currentWhen].concat(params)) ||\n router.isActive.apply(router, [currentWithIndex].concat(params));\n\n if (isActive) { return get(this, 'activeClass'); }\n }).property('namedRoute', 'router.url'),\n\n router: Ember.computed(function() {\n return this.get('controller').container.lookup('router:main');\n }),\n\n click: function(event) {\n if (!isSimpleClick(event)) { return true; }\n\n event.preventDefault();\n if (this.bubbles === false) { event.stopPropagation(); }\n\n var router = this.get('router');\n\n if (this.get('replace')) {\n router.replaceWith.apply(router, args(this, router));\n } else {\n router.transitionTo.apply(router, args(this, router));\n }\n },\n\n href: Ember.computed(function() {\n var router = this.get('router');\n return router.generate.apply(router, args(this, router));\n })\n });\n\n LinkView.toString = function() { return \"LinkView\"; };\n\n /**\n @method linkTo\n @for Ember.Handlebars.helpers\n @param {String} routeName\n @param {Object} [context]*\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('linkTo', function(name) {\n var options = [].slice.call(arguments, -1)[0];\n var params = [].slice.call(arguments, 1, -1);\n\n var hash = options.hash;\n\n hash.namedRoute = name;\n hash.currentWhen = hash.currentWhen || name;\n\n hash.parameters = {\n context: this,\n options: options,\n params: params\n };\n\n return Ember.Handlebars.helpers.view.call(this, LinkView, options);\n });\n\n});\n\n\n})();\n//@ sourceURL=ember-routing/helpers/link_to");minispade.register('ember-routing/helpers/outlet', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n /**\n @module ember\n @submodule ember-routing\n */\n\n Handlebars.OutletView = Ember.ContainerView.extend(Ember._Metamorph);\n\n /**\n The `outlet` helper is a placeholder that the router will fill in with\n the appropriate template based on the current state of the application.\n\n ``` handlebars\n {{outlet}}\n ```\n\n By default, a template based on Ember's naming conventions will be rendered\n into the `outlet` (e.g. `App.PostsRoute` will render the `posts` template).\n\n You can render a different template by using the `render()` method in the\n route's `renderTemplate` hook. The following will render the `favoritePost`\n template into the `outlet`.\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost');\n }\n });\n ```\n\n You can create custom named outlets for more control.\n\n ``` handlebars\n {{outlet favoritePost}}\n {{outlet posts}}\n ```\n\n Then you can define what template is rendered into each outlet in your\n route.\n\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost', { outlet: 'favoritePost' });\n this.render('posts', { outlet: 'posts' });\n }\n });\n ```\n\n @method outlet\n @for Ember.Handlebars.helpers\n @param {String} property the property on the controller\n that holds the view for this outlet\n */\n Handlebars.registerHelper('outlet', function(property, options) {\n var outletSource;\n\n if (property && property.data && property.data.isRenderData) {\n options = property;\n property = 'main';\n }\n\n outletSource = options.data.view;\n while (!(outletSource.get('template.isTop'))){\n outletSource = outletSource.get('_parentView');\n }\n\n options.data.view.set('outletSource', outletSource);\n options.hash.currentViewBinding = '_view.outletSource._outlets.' + property;\n\n return Handlebars.helpers.view.call(this, Handlebars.OutletView, options);\n });\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/outlet");minispade.register('ember-routing/helpers/render', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n /**\n Renders the named template in the current context using the singleton\n instance of the same-named controller.\n\n If a view class with the same name exists, uses the view class.\n\n If a `model` is specified, it becomes the model for that controller.\n\n The default target for `{{action}}`s in the rendered template is the\n named controller.\n\n @method render\n @for Ember.Handlebars.helpers\n @param {String} name\n @param {Object?} contextString\n @param {Hash} options\n */\n Ember.Handlebars.registerHelper('render', function(name, contextString, options) {\n Ember.assert(\"You must pass a template to render\", arguments.length >= 2);\n var container, router, controller, view, context, lookupOptions;\n\n if (arguments.length === 2) {\n options = contextString;\n contextString = undefined;\n }\n\n if (typeof contextString === 'string') {\n context = Ember.Handlebars.get(options.contexts[1], contextString, options);\n lookupOptions = { singleton: false };\n }\n\n name = name.replace(/\\//g, '.');\n container = options.data.keywords.controller.container;\n router = container.lookup('router:main');\n\n Ember.assert(\"This view is already rendered\", !router || !router._lookupActiveView(name));\n\n view = container.lookup('view:' + name) || container.lookup('view:default');\n\n if (controller = options.hash.controller) {\n controller = container.lookup('controller:' + controller, lookupOptions);\n } else {\n controller = Ember.controllerFor(container, name, context, lookupOptions);\n }\n\n if (controller && context) {\n controller.set('model', context);\n }\n\n var root = options.contexts[1];\n\n if (root) {\n view.registerObserver(root, contextString, function() {\n controller.set('model', Ember.Handlebars.get(root, contextString, options));\n });\n }\n\n controller.set('target', options.data.keywords.controller);\n\n options.hash.viewName = Ember.String.camelize(name);\n options.hash.template = container.lookup('template:' + name);\n options.hash.controller = controller;\n\n if (router) {\n router._connectActiveView(name, view);\n }\n\n Ember.Handlebars.helpers.view.call(this, view, options);\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/render");minispade.register('ember-routing/helpers/shared', "(function() {minispade.require('ember-routing/system/router');\n\nEmber.onLoad('Ember.Handlebars', function() {\n var handlebarsResolve = Ember.Handlebars.resolveParams,\n map = Ember.ArrayPolyfills.map,\n get = Ember.get;\n\n function resolveParams(context, params, options) {\n var resolved = handlebarsResolve(context, params, options);\n return map.call(resolved, unwrap);\n\n function unwrap(object, i) {\n if (params[i] === 'controller') { return object; }\n\n if (Ember.ControllerMixin.detect(object)) {\n return unwrap(get(object, 'model'));\n } else {\n return object;\n }\n }\n }\n\n Ember.Router.resolveParams = resolveParams;\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/shared");minispade.register('ember-routing/location', "(function() {minispade.require('ember-views');\nminispade.require('ember-routing/location/api');\nminispade.require('ember-routing/location/none_location');\nminispade.require('ember-routing/location/hash_location');\nminispade.require('ember-routing/location/history_location');\n\n})();\n//@ sourceURL=ember-routing/location");minispade.register('ember-routing/location/api', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n This file implements the `location` API used by Ember's router.\n\n That API is:\n\n getURL: returns the current URL\n setURL(path): sets the current URL\n replaceURL(path): replace the current URL (optional)\n onUpdateURL(callback): triggers the callback when the URL changes\n formatURL(url): formats `url` to be placed into `href` attribute\n\n Calling setURL or replaceURL will not trigger onUpdateURL callbacks.\n\n TODO: This should perhaps be moved so that it's visible in the doc output.\n*/\n\n/**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n You can pass it a `implementation` ('hash', 'history', 'none') to force a\n particular implementation.\n\n @class Location\n @namespace Ember\n @static\n*/\nEmber.Location = {\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n registerImplementation: function(name, implementation) {\n this.implementations[name] = implementation;\n },\n\n implementations: {}\n};\n\n})();\n//@ sourceURL=ember-routing/location/api");minispade.register('ember-routing/location/hash_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.HashLocation implements the location API using the browser's\n hash. At present, it relies on a hashchange event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HashLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n },\n\n /**\n @private\n\n Returns the current `location.hash`, minus the '#' at the front.\n\n @method getURL\n */\n getURL: function() {\n return get(this, 'location').hash.substr(1);\n },\n\n /**\n @private\n\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = Ember.guidFor(this);\n\n Ember.$(window).bind('hashchange.ember-location-'+guid, function() {\n Ember.run(function() {\n var path = location.hash.substr(1);\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(path);\n });\n });\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('hashchange.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('hash', Ember.HashLocation);\n\n})();\n//@ sourceURL=ember-routing/location/hash_location");minispade.register('ember-routing/location/history_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar popstateFired = false;\n\n/**\n Ember.HistoryLocation implements the location API using the browser's\n history.pushState API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HistoryLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n this._initialUrl = this.getURL();\n this.initState();\n },\n\n /**\n @private\n\n Used to set state on first call to setURL\n\n @method initState\n */\n initState: function() {\n this.replaceState(this.formatURL(this.getURL()));\n set(this, 'history', window.history);\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Returns the current `location.pathname` without rootURL\n\n @method getURL\n */\n getURL: function() {\n var rootURL = get(this, 'rootURL'),\n url = get(this, 'location').pathname;\n\n rootURL = rootURL.replace(/\\/$/, '');\n url = url.replace(rootURL, '');\n\n return url;\n },\n\n /**\n @private\n\n Uses `history.pushState` to update the url without a page reload.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n path = this.formatURL(path);\n\n if (this.getState() && this.getState().path !== path) {\n this.pushState(path);\n }\n },\n\n /**\n @private\n\n Uses `history.replaceState` to update the url without a page reload\n or history modification.\n\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n path = this.formatURL(path);\n\n if (this.getState() && this.getState().path !== path) {\n this.replaceState(path);\n }\n },\n\n /**\n @private\n\n Get the current `history.state`\n\n @method getState\n */\n getState: function() {\n return get(this, 'history').state;\n },\n\n /**\n @private\n\n Pushes a new state\n\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n window.history.pushState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Replaces the current state\n\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n window.history.replaceState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = Ember.guidFor(this),\n self = this;\n\n Ember.$(window).bind('popstate.ember-location-'+guid, function(e) {\n // Ignore initial page load popstate event in Chrome\n if(!popstateFired) {\n popstateFired = true;\n if (self.getURL() === self._initialUrl) { return; }\n }\n callback(self.getURL());\n });\n },\n\n /**\n @private\n\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n }\n\n return rootURL + url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('popstate.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('history', Ember.HistoryLocation);\n\n})();\n//@ sourceURL=ember-routing/location/history_location");minispade.register('ember-routing/location/none_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.NoneLocation does not interact with the browser. It is useful for\n testing, or when you need to manage state with your Router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.NoneLocation = Ember.Object.extend({\n path: '',\n\n getURL: function() {\n return get(this, 'path');\n },\n\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n onUpdateURL: function(callback) {\n this.updateCallback = callback;\n },\n\n handleURL: function(url) {\n set(this, 'path', url);\n this.updateCallback(url);\n },\n\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n});\n\nEmber.Location.registerImplementation('none', Ember.NoneLocation);\n\n})();\n//@ sourceURL=ember-routing/location/none_location");minispade.register('ember-routing', "(function() {minispade.require('ember-runtime');\nminispade.require('ember-views');\nminispade.require('ember-handlebars');\nminispade.require('ember-routing/vendor/route-recognizer');\nminispade.require('ember-routing/vendor/router');\nminispade.require('ember-routing/system');\nminispade.require('ember-routing/helpers');\nminispade.require('ember-routing/ext');\nminispade.require('ember-routing/location');\n\n/**\nEmber Routing\n\n@module ember\n@submodule ember-routing\n@requires ember-states\n@requires ember-views\n*/\n\n})();\n//@ sourceURL=ember-routing");minispade.register('ember-routing/system', "(function() {minispade.require('ember-routing/system/dsl');\nminispade.require('ember-routing/system/controller_for');\nminispade.require('ember-routing/system/router');\nminispade.require('ember-routing/system/route');\n\n})();\n//@ sourceURL=ember-routing/system");minispade.register('ember-routing/system/controller_for', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nEmber.controllerFor = function(container, controllerName, context, lookupOptions) {\n return container.lookup('controller:' + controllerName, lookupOptions) ||\n Ember.generateController(container, controllerName, context);\n};\n/**\n Generates a controller automatically if none was provided.\n The type of generated controller depends on the context.\n You can customize your generated controllers by defining\n `App.ObjectController` and `App.ArrayController`\n*/\nEmber.generateController = function(container, controllerName, context) {\n var controller, DefaultController;\n\n if (context && Ember.isArray(context)) {\n DefaultController = container.resolve('controller:array');\n controller = DefaultController.extend({\n content: context\n });\n } else if (context) {\n DefaultController = container.resolve('controller:object');\n controller = DefaultController.extend({\n content: context\n });\n } else {\n DefaultController = container.resolve('controller:basic');\n controller = DefaultController.extend();\n }\n\n controller.toString = function() {\n return \"(generated \" + controllerName + \" controller)\";\n };\n\n container.register('controller', controllerName, controller);\n return container.lookup('controller:' + controllerName);\n};\n\n})();\n//@ sourceURL=ember-routing/system/controller_for");minispade.register('ember-routing/system/dsl', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nfunction DSL(name) {\n this.parent = name;\n this.matches = [];\n}\n\nDSL.prototype = {\n resource: function(name, options, callback) {\n if (arguments.length === 2 && typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n if (arguments.length === 1) {\n options = {};\n }\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (callback) {\n var dsl = new DSL(name);\n callback.call(dsl);\n this.push(options.path, name, dsl.generate());\n } else {\n this.push(options.path, name);\n }\n },\n\n push: function(url, name, callback) {\n if (url === \"\" || url === \"/\") { this.explicitIndex = true; }\n\n this.matches.push([url, name, callback]);\n },\n\n route: function(name, options) {\n Ember.assert(\"You must use `this.resource` to nest\", typeof options !== 'function');\n\n options = options || {};\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (this.parent && this.parent !== 'application') {\n name = this.parent + \".\" + name;\n }\n\n this.push(options.path, name);\n },\n\n generate: function() {\n var dslMatches = this.matches;\n\n if (!this.explicitIndex) {\n this.route(\"index\", { path: \"/\" });\n }\n\n return function(match) {\n for (var i=0, l=dslMatches.length; i<l; i++) {\n var dslMatch = dslMatches[i];\n match(dslMatch[0]).to(dslMatch[1], dslMatch[2]);\n }\n };\n }\n};\n\nDSL.map = function(callback) {\n var dsl = new DSL();\n callback.call(dsl);\n return dsl;\n};\n\nEmber.RouterDSL = DSL;\n\n})();\n//@ sourceURL=ember-routing/system/dsl");minispade.register('ember-routing/system/route', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set,\n classify = Ember.String.classify;\n\n/**\n The `Ember.Route` class is used to define individual routes. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Route\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.Route = Ember.Object.extend({\n /**\n @private\n\n @method exit\n */\n exit: function() {\n this.deactivate();\n teardownView(this);\n },\n\n /**\n @private\n\n @method enter\n */\n enter: function() {\n this.activate();\n },\n\n /**\n The collection of functions keyed by name available on this route as\n action targets.\n\n These functions will be invoked when a matching `{{action}}` is triggered\n from within a template and the application's current route is this route.\n\n Events can also be invoked from other parts of your application via `Route#send`.\n\n The context of event will be the this route.\n\n @see {Ember.Route#send}\n @see {Handlebars.helpers.action}\n\n @property events\n @type Hash\n @default null\n */\n events: null,\n\n /**\n This hook is executed when the router completely exits this route. It is\n not executed when the model for the route changes.\n\n @method deactivate\n */\n deactivate: Ember.K,\n\n /**\n This hook is executed when the router enters the route for the first time.\n It is not executed when the model for the route changes.\n\n @method activate\n */\n activate: Ember.K,\n\n /**\n Transition into another route. Optionally supply a model for the\n route in question. The model will be serialized into the URL\n using the `serialize` hook.\n\n @method transitionTo\n @param {String} name the name of the route\n @param {...Object} models the\n */\n transitionTo: function() {\n if (this._checkingRedirect) { this.redirected = true; }\n return this.router.transitionTo.apply(this.router, arguments);\n },\n\n /**\n Transition into another route while replacing the current URL if\n possible. Identical to `transitionTo` in all other respects.\n\n @method replaceWith\n @param {String} name the name of the route\n @param {...Object} models the\n */\n replaceWith: function() {\n if (this._checkingRedirect) { this.redirected = true; }\n return this.router.replaceWith.apply(this.router, arguments);\n },\n\n send: function() {\n return this.router.send.apply(this.router, arguments);\n },\n\n /**\n @private\n\n This hook is the entry point for router.js\n\n @method setup\n */\n setup: function(context) {\n this.redirected = false;\n this._checkingRedirect = true;\n\n this.redirect(context);\n\n this._checkingRedirect = false;\n if (this.redirected) { return false; }\n\n var controller = this.controllerFor(this.routeName, context);\n\n if (controller) {\n this.controller = controller;\n set(controller, 'model', context);\n }\n\n if (this.setupControllers) {\n Ember.deprecate(\"Ember.Route.setupControllers is deprecated. Please use Ember.Route.setupController(controller, model) instead.\");\n this.setupControllers(controller, context);\n } else {\n this.setupController(controller, context);\n }\n\n if (this.renderTemplates) {\n Ember.deprecate(\"Ember.Route.renderTemplates is deprecated. Please use Ember.Route.renderTemplate(controller, model) instead.\");\n this.renderTemplates(context);\n } else {\n this.renderTemplate(controller, context);\n }\n },\n\n /**\n A hook you can implement to optionally redirect to another route.\n\n If you call `this.transitionTo` from inside of this hook, this route\n will not be entered in favor of the other hook.\n\n @method redirect\n @param {Object} model the model for this route\n */\n redirect: Ember.K,\n\n /**\n @private\n\n The hook called by `router.js` to convert parameters into the context\n for this handler. The public Ember hook is `model`.\n\n @method deserialize\n */\n deserialize: function(params) {\n var model = this.model(params);\n return this.currentModel = model;\n },\n\n /**\n @private\n\n Called when the context is changed by router.js.\n */\n contextDidChange: function() {\n this.currentModel = this.context;\n },\n\n /**\n A hook you can implement to convert the URL into the model for\n this route.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n The model for the `post` route is `App.Post.find(params.post_id)`.\n\n By default, if your route has a dynamic segment ending in `_id`:\n\n * The model class is determined from the segment (`post_id`'s\n class is `App.Post`)\n * The find method is called on the model class with the value of\n the dynamic segment.\n\n @method model\n @param {Object} params the parameters extracted from the URL\n */\n model: function(params) {\n var match, name, sawParams, value;\n\n for (var prop in params) {\n if (match = prop.match(/^(.*)_id$/)) {\n name = match[1];\n value = params[prop];\n }\n sawParams = true;\n }\n\n if (!name && sawParams) { return params; }\n else if (!name) { return; }\n\n var className = classify(name),\n namespace = this.router.namespace,\n modelClass = namespace[className];\n\n Ember.assert(\"You used the dynamic segment \" + name + \"_id in your router, but \" + namespace + \".\" + className + \" did not exist and you did not override your route's `model` hook.\", modelClass);\n return modelClass.find(value);\n },\n\n /**\n A hook you can implement to convert the route's model into parameters\n for the URL.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n // the server returns `{ id: 12 }`\n return jQuery.getJSON(\"/posts/\" + params.post_id);\n },\n\n serialize: function(model) {\n // this will make the URL `/posts/12`\n return { post_id: model.id };\n }\n });\n ```\n\n The default `serialize` method inserts the model's `id` into the\n route's dynamic segment (in this case, `:post_id`).\n\n This method is called when `transitionTo` is called with a context\n in order to populate the URL.\n\n @method serialize\n @param {Object} model the route's model\n @param {Array} params an Array of parameter names for the current\n route (in the example, `['post_id']`.\n @return {Object} the serialized parameters\n */\n serialize: function(model, params) {\n if (params.length !== 1) { return; }\n\n var name = params[0], object = {};\n\n if (/_id$/.test(name)) {\n object[name] = get(model, 'id');\n } else {\n object[name] = model;\n }\n\n return object;\n },\n\n /**\n A hook you can use to setup the controller for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n For the `post` route, the controller is `App.PostController`.\n\n By default, the `setupController` hook sets the `content` property of\n the controller to the `model`.\n\n If no explicit controller is defined, the route will automatically create\n an appropriate controller for the model:\n\n * if the model is an `Ember.Array` (including record arrays from Ember\n Data), the controller is an `Ember.ArrayController`.\n * otherwise, the controller is an `Ember.ObjectController`.\n\n This means that your template will get a proxy for the model as its\n context, and you can act as though the model itself was the context.\n\n @method setupController\n */\n setupController: Ember.K,\n\n /**\n Returns the controller for a particular route.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.controllerFor('posts').set('currentPost', post);\n }\n });\n ```\n\n By default, the controller for `post` is the shared instance of\n `App.PostController`.\n\n @method controllerFor\n @param {String} name the name of the route\n @param {Object} model the model associated with the route (optional)\n @return {Ember.Controller}\n */\n controllerFor: function(name, model) {\n var container = this.router.container,\n controller = container.lookup('controller:' + name);\n\n if (!controller) {\n model = model || this.modelFor(name);\n\n Ember.assert(\"You are trying to look up a controller that you did not define, and for which Ember does not know the model.\\n\\nThis is not a controller for a route, so you must explicitly define the controller (\"+this.router.namespace.toString() + \".\" + Ember.String.capitalize(Ember.String.camelize(name))+\"Controller) or pass a model as the second parameter to `controllerFor`, so that Ember knows which type of controller to create for you.\", model || this.container.lookup('route:' + name));\n\n controller = Ember.generateController(container, name, model);\n }\n\n return controller;\n },\n\n /**\n Returns the current model for a given route.\n\n This is the object returned by the `model` hook of the route\n in question.\n\n @method modelFor\n @param {String} name the name of the route\n @return {Object} the model object\n */\n modelFor: function(name) {\n var route = this.container.lookup('route:' + name);\n return route && route.currentModel;\n },\n\n /**\n A hook you can use to render the template for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook. By default, it renders the route's\n template, configured with the controller for the route.\n\n This method can be overridden to set up and render additional or\n alternative templates.\n\n @method renderTemplate\n @param {Object} controller the route's controller\n @param {Object} model the route's model\n */\n renderTemplate: function(controller, model) {\n this.render();\n },\n\n /**\n Renders a template into an outlet.\n\n This method has a number of defaults, based on the name of the\n route specified in the router.\n\n For example:\n\n ```js\n App.Router.map(function() {\n this.route('index');\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render();\n }\n });\n ```\n\n The name of the `PostRoute`, as defined by the router, is `post`.\n\n By default, render will:\n\n * render the `post` template\n * with the `post` view (`PostView`) for event handling, if one exists\n * and the `post` controller (`PostController`), if one exists\n * into the `main` outlet of the `application` template\n\n You can override this behavior:\n\n ```js\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render('myPost', { // the template to render\n into: 'index', // the template to render into\n outlet: 'detail', // the name of the outlet in that template\n controller: 'blogPost' // the controller to use for the template\n });\n }\n });\n ```\n\n Remember that the controller's `content` will be the route's model. In\n this case, the default model will be `App.Post.find(params.post_id)`.\n\n @method render\n @param {String} name the name of the template to render\n @param {Object} options the options\n */\n render: function(name, options) {\n Ember.assert(\"The name in the given arguments is undefined\", arguments.length > 0 ? !Ember.isNone(arguments[0]) : true);\n\n if (typeof name === 'object' && !options) {\n options = name;\n name = this.routeName;\n }\n\n name = name ? name.replace(/\\//g, '.') : this.routeName;\n\n var container = this.container,\n view = container.lookup('view:' + name),\n template = container.lookup('template:' + name);\n\n if (!view && !template) { return; }\n\n options = normalizeOptions(this, name, template, options);\n view = setupView(view, container, options);\n\n if (options.outlet === 'main') { this.lastRenderedTemplate = name; }\n\n appendView(this, view, options);\n },\n\n willDestroy: function() {\n teardownView(this);\n }\n});\n\nfunction parentRoute(route) {\n var handlerInfos = route.router.router.currentHandlerInfos;\n\n var parent, current;\n\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n current = handlerInfos[i].handler;\n if (current === route) { return parent; }\n parent = current;\n }\n}\n\nfunction parentTemplate(route, isRecursive) {\n var parent = parentRoute(route), template;\n\n if (!parent) { return; }\n\n Ember.warn(\"The immediate parent route did not render into the main outlet and the default 'into' option may not be expected\", !isRecursive);\n\n if (template = parent.lastRenderedTemplate) {\n return template;\n } else {\n return parentTemplate(parent, true);\n }\n}\n\nfunction normalizeOptions(route, name, template, options) {\n options = options || {};\n options.into = options.into ? options.into.replace(/\\//g, '.') : parentTemplate(route);\n options.outlet = options.outlet || 'main';\n options.name = name;\n options.template = template;\n\n Ember.assert(\"An outlet (\"+options.outlet+\") was specified but this view will render at the root level.\", options.outlet === 'main' || options.into);\n\n var controller = options.controller, namedController;\n\n if (options.controller) {\n controller = options.controller;\n } else if (namedController = route.container.lookup('controller:' + name)) {\n controller = namedController;\n } else {\n controller = route.routeName;\n }\n\n if (typeof controller === 'string') {\n controller = route.container.lookup('controller:' + controller);\n }\n\n options.controller = controller;\n\n return options;\n}\n\nfunction setupView(view, container, options) {\n var defaultView = options.into ? 'view:default' : 'view:toplevel';\n\n view = view || container.lookup(defaultView);\n\n if (!get(view, 'templateName')) {\n set(view, 'template', options.template);\n\n set(view, '_debugTemplateName', options.name);\n }\n\n set(view, 'renderedName', options.name);\n set(view, 'controller', options.controller);\n\n return view;\n}\n\nfunction appendView(route, view, options) {\n if (options.into) {\n var parentView = route.router._lookupActiveView(options.into);\n route.teardownView = teardownOutlet(parentView, options.outlet);\n parentView.connectOutlet(options.outlet, view);\n } else {\n var rootElement = get(route, 'router.namespace.rootElement');\n route.router._connectActiveView(options.name, view);\n route.teardownView = teardownTopLevel(view);\n view.appendTo(rootElement);\n }\n}\n\nfunction teardownTopLevel(view) {\n return function() { view.destroy(); };\n}\n\nfunction teardownOutlet(parentView, outlet) {\n return function() { parentView.disconnectOutlet(outlet); };\n}\n\nfunction teardownView(route) {\n if (route.teardownView) { route.teardownView(); }\n\n delete route.teardownView;\n delete route.lastRenderedTemplate;\n}\n\n})();\n//@ sourceURL=ember-routing/system/route");minispade.register('ember-routing/system/router', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar Router = requireModule(\"router\");\nvar get = Ember.get, set = Ember.set;\n\nvar DefaultView = Ember._MetamorphView;\nminispade.require(\"ember-routing/system/dsl\");\n\nfunction setupLocation(router) {\n var location = get(router, 'location'),\n rootURL = get(router, 'rootURL');\n\n if ('string' === typeof location) {\n location = set(router, 'location', Ember.Location.create({\n implementation: location\n }));\n\n if (typeof rootURL === 'string') {\n set(location, 'rootURL', rootURL);\n }\n }\n}\n\n/**\n The `Ember.Router` class manages the application state and URLs. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Router\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.Router = Ember.Object.extend({\n location: 'hash',\n\n init: function() {\n this.router = this.constructor.router;\n this._activeViews = {};\n setupLocation(this);\n },\n\n url: Ember.computed(function() {\n return get(this, 'location').getURL();\n }),\n\n startRouting: function() {\n this.router = this.router || this.constructor.map(Ember.K);\n\n var router = this.router,\n location = get(this, 'location'),\n container = this.container,\n self = this;\n\n setupRouter(this, router, location);\n\n container.register('view', 'default', DefaultView);\n container.register('view', 'toplevel', Ember.View.extend());\n\n location.onUpdateURL(function(url) {\n self.handleURL(url);\n });\n\n this.handleURL(location.getURL());\n },\n\n didTransition: function(infos) {\n // Don't do any further action here if we redirected\n for (var i=0, l=infos.length; i<l; i++) {\n if (infos[i].handler.redirected) { return; }\n }\n\n var appController = this.container.lookup('controller:application'),\n path = routePath(infos);\n\n set(appController, 'currentPath', path);\n this.notifyPropertyChange('url');\n\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Transitioned into '\" + path + \"'\");\n }\n },\n\n handleURL: function(url) {\n this.router.handleURL(url);\n this.notifyPropertyChange('url');\n },\n\n transitionTo: function(name) {\n var args = [].slice.call(arguments);\n doTransition(this, 'transitionTo', args);\n },\n\n replaceWith: function() {\n var args = [].slice.call(arguments);\n doTransition(this, 'replaceWith', args);\n },\n\n generate: function() {\n var url = this.router.generate.apply(this.router, arguments);\n return this.location.formatURL(url);\n },\n\n isActive: function(routeName) {\n var router = this.router;\n return router.isActive.apply(router, arguments);\n },\n\n send: function(name, context) {\n this.router.trigger.apply(this.router, arguments);\n },\n\n hasRoute: function(route) {\n return this.router.hasRoute(route);\n },\n\n _lookupActiveView: function(templateName) {\n var active = this._activeViews[templateName];\n return active && active[0];\n },\n\n _connectActiveView: function(templateName, view) {\n var existing = this._activeViews[templateName];\n\n if (existing) {\n existing[0].off('willDestroyElement', this, existing[1]);\n }\n\n var disconnect = function() {\n delete this._activeViews[templateName];\n };\n\n this._activeViews[templateName] = [view, disconnect];\n view.one('willDestroyElement', this, disconnect);\n }\n});\n\nEmber.Router.reopenClass({\n defaultFailureHandler: {\n setup: function(error) {\n Ember.Logger.error('Error while loading route:', error);\n\n // Using setTimeout allows us to escape from the Promise's try/catch block\n setTimeout(function() { throw error; });\n }\n }\n});\n\nfunction getHandlerFunction(router) {\n var seen = {}, container = router.container,\n DefaultRoute = container.resolve('route:basic');\n\n return function(name) {\n var handler = container.lookup('route:' + name);\n if (seen[name]) { return handler; }\n\n seen[name] = true;\n\n if (!handler) {\n if (name === 'loading') { return {}; }\n if (name === 'failure') { return router.constructor.defaultFailureHandler; }\n\n container.register('route', name, DefaultRoute.extend());\n handler = container.lookup('route:' + name);\n }\n\n handler.routeName = name;\n return handler;\n };\n}\n\nfunction handlerIsActive(router, handlerName) {\n var handler = router.container.lookup('route:' + handlerName),\n currentHandlerInfos = router.router.currentHandlerInfos,\n handlerInfo;\n\n for (var i=0, l=currentHandlerInfos.length; i<l; i++) {\n handlerInfo = currentHandlerInfos[i];\n if (handlerInfo.handler === handler) { return true; }\n }\n\n return false;\n}\n\nfunction routePath(handlerInfos) {\n var path = [];\n\n for (var i=1, l=handlerInfos.length; i<l; i++) {\n var name = handlerInfos[i].name,\n nameParts = name.split(\".\");\n\n path.push(nameParts[nameParts.length - 1]);\n }\n\n return path.join(\".\");\n}\n\nfunction setupRouter(emberRouter, router, location) {\n var lastURL;\n\n router.getHandler = getHandlerFunction(emberRouter);\n\n var doUpdateURL = function() {\n location.setURL(lastURL);\n };\n\n router.updateURL = function(path) {\n lastURL = path;\n Ember.run.once(doUpdateURL);\n };\n\n if (location.replaceURL) {\n var doReplaceURL = function() {\n location.replaceURL(lastURL);\n };\n\n router.replaceURL = function(path) {\n lastURL = path;\n Ember.run.once(doReplaceURL);\n };\n }\n\n router.didTransition = function(infos) {\n emberRouter.didTransition(infos);\n };\n}\n\nfunction doTransition(router, method, args) {\n var passedName = args[0], name;\n\n if (!router.router.hasRoute(args[0])) {\n name = args[0] = passedName + '.index';\n } else {\n name = passedName;\n }\n\n Ember.assert(\"The route \" + passedName + \" was not found\", router.router.hasRoute(name));\n\n router.router[method].apply(router.router, args);\n router.notifyPropertyChange('url');\n}\n\nEmber.Router.reopenClass({\n map: function(callback) {\n var router = this.router = new Router();\n\n var dsl = Ember.RouterDSL.map(function() {\n this.resource('application', { path: \"/\" }, function() {\n callback.call(this);\n });\n });\n\n router.map(dsl.generate());\n return router;\n }\n});\n\n})();\n//@ sourceURL=ember-routing/system/router");minispade.register('ember-routing/vendor/route-recognizer', "(function() {define(\"route-recognizer\",\n [],\n function() {\n \"use strict\";\n var specials = [\n '/', '.', '*', '+', '?', '|',\n '(', ')', '[', ']', '{', '}', '\\\\'\n ];\n\n var escapeRegex = new RegExp('(\\\\' + specials.join('|\\\\') + ')', 'g');\n\n // A Segment represents a segment in the original route description.\n // Each Segment type provides an `eachChar` and `regex` method.\n //\n // The `eachChar` method invokes the callback with one or more character\n // specifications. A character specification consumes one or more input\n // characters.\n //\n // The `regex` method returns a regex fragment for the segment. If the\n // segment is a dynamic of star segment, the regex fragment also includes\n // a capture.\n //\n // A character specification contains:\n //\n // * `validChars`: a String with a list of all valid characters, or\n // * `invalidChars`: a String with a list of all invalid characters\n // * `repeat`: true if the character specification can repeat\n\n function StaticSegment(string) { this.string = string; }\n StaticSegment.prototype = {\n eachChar: function(callback) {\n var string = this.string, char;\n\n for (var i=0, l=string.length; i<l; i++) {\n char = string.charAt(i);\n callback({ validChars: char });\n }\n },\n\n regex: function() {\n return this.string.replace(escapeRegex, '\\\\$1');\n },\n\n generate: function() {\n return this.string;\n }\n };\n\n function DynamicSegment(name) { this.name = name; }\n DynamicSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"/\", repeat: true });\n },\n\n regex: function() {\n return \"([^/]+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function StarSegment(name) { this.name = name; }\n StarSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"\", repeat: true });\n },\n\n regex: function() {\n return \"(.+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function EpsilonSegment() {}\n EpsilonSegment.prototype = {\n eachChar: function() {},\n regex: function() { return \"\"; },\n generate: function() { return \"\"; }\n };\n\n function parse(route, names, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.charAt(0) === \"/\") { route = route.substr(1); }\n\n var segments = route.split(\"/\"), results = [];\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i], match;\n\n if (match = segment.match(/^:([^\\/]+)$/)) {\n results.push(new DynamicSegment(match[1]));\n names.push(match[1]);\n types.dynamics++;\n } else if (match = segment.match(/^\\*([^\\/]+)$/)) {\n results.push(new StarSegment(match[1]));\n names.push(match[1]);\n types.stars++;\n } else if(segment === \"\") {\n results.push(new EpsilonSegment());\n } else {\n results.push(new StaticSegment(segment));\n types.statics++;\n }\n }\n\n return results;\n }\n\n // A State has a character specification and (`charSpec`) and a list of possible\n // subsequent states (`nextStates`).\n //\n // If a State is an accepting state, it will also have several additional\n // properties:\n //\n // * `regex`: A regular expression that is used to extract parameters from paths\n // that reached this accepting state.\n // * `handlers`: Information on how to convert the list of captures into calls\n // to registered handlers with the specified parameters\n // * `types`: How many static, dynamic or star segments in this route. Used to\n // decide which route to use if multiple registered routes match a path.\n //\n // Currently, State is implemented naively by looping over `nextStates` and\n // comparing a character specification against a character. A more efficient\n // implementation would use a hash of keys pointing at one or more next states.\n\n function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }\n\n State.prototype = {\n get: function(charSpec) {\n var nextStates = this.nextStates;\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n var child = nextStates[i];\n\n var isEqual = child.charSpec.validChars === charSpec.validChars;\n isEqual = isEqual && child.charSpec.invalidChars === charSpec.invalidChars;\n\n if (isEqual) { return child; }\n }\n },\n\n put: function(charSpec) {\n var state;\n\n // If the character specification already exists in a child of the current\n // state, just return that state.\n if (state = this.get(charSpec)) { return state; }\n\n // Make a new state for the character spec\n state = new State(charSpec);\n\n // Insert the new state as a child of the current state\n this.nextStates.push(state);\n\n // If this character specification repeats, insert the new state as a child\n // of itself. Note that this will not trigger an infinite loop because each\n // transition during recognition consumes a character.\n if (charSpec.repeat) {\n state.nextStates.push(state);\n }\n\n // Return the new state\n return state;\n },\n\n // Find a list of child states matching the next character\n match: function(char) {\n // DEBUG \"Processing `\" + char + \"`:\"\n var nextStates = this.nextStates,\n child, charSpec, chars;\n\n // DEBUG \" \" + debugState(this)\n var returned = [];\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n child = nextStates[i];\n\n charSpec = child.charSpec;\n\n if (typeof (chars = charSpec.validChars) !== 'undefined') {\n if (chars.indexOf(char) !== -1) { returned.push(child); }\n } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') {\n if (chars.indexOf(char) === -1) { returned.push(child); }\n }\n }\n\n return returned;\n }\n\n /** IF DEBUG\n , debug: function() {\n var charSpec = this.charSpec,\n debug = \"[\",\n chars = charSpec.validChars || charSpec.invalidChars;\n\n if (charSpec.invalidChars) { debug += \"^\"; }\n debug += chars;\n debug += \"]\";\n\n if (charSpec.repeat) { debug += \"+\"; }\n\n return debug;\n }\n END IF **/\n };\n\n /** IF DEBUG\n function debug(log) {\n console.log(log);\n }\n\n function debugState(state) {\n return state.nextStates.map(function(n) {\n if (n.nextStates.length === 0) { return \"( \" + n.debug() + \" [accepting] )\"; }\n return \"( \" + n.debug() + \" <then> \" + n.nextStates.map(function(s) { return s.debug() }).join(\" or \") + \" )\";\n }).join(\", \")\n }\n END IF **/\n\n // This is a somewhat naive strategy, but should work in a lot of cases\n // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id\n function sortSolutions(states) {\n return states.sort(function(a, b) {\n if (a.types.stars !== b.types.stars) { return a.types.stars - b.types.stars; }\n if (a.types.dynamics !== b.types.dynamics) { return a.types.dynamics - b.types.dynamics; }\n if (a.types.statics !== b.types.statics) { return a.types.statics - b.types.statics; }\n\n return 0;\n });\n }\n\n function recognizeChar(states, char) {\n var nextStates = [];\n\n for (var i=0, l=states.length; i<l; i++) {\n var state = states[i];\n\n nextStates = nextStates.concat(state.match(char));\n }\n\n return nextStates;\n }\n\n function findHandler(state, path) {\n var handlers = state.handlers, regex = state.regex;\n var captures = path.match(regex), currentCapture = 1;\n var result = [];\n\n for (var i=0, l=handlers.length; i<l; i++) {\n var handler = handlers[i], names = handler.names, params = {};\n\n for (var j=0, m=names.length; j<m; j++) {\n params[names[j]] = captures[currentCapture++];\n }\n\n result.push({ handler: handler.handler, params: params, isDynamic: !!names.length });\n }\n\n return result;\n }\n\n function addSegment(currentState, segment) {\n segment.eachChar(function(char) {\n var state;\n\n currentState = currentState.put(char);\n });\n\n return currentState;\n }\n\n // The main interface\n\n var RouteRecognizer = function() {\n this.rootState = new State();\n this.names = {};\n };\n\n\n RouteRecognizer.prototype = {\n add: function(routes, options) {\n var currentState = this.rootState, regex = \"^\",\n types = { statics: 0, dynamics: 0, stars: 0 },\n handlers = [], allSegments = [], name;\n\n var isEmpty = true;\n\n for (var i=0, l=routes.length; i<l; i++) {\n var route = routes[i], names = [];\n\n var segments = parse(route.path, names, types);\n\n allSegments = allSegments.concat(segments);\n\n for (var j=0, m=segments.length; j<m; j++) {\n var segment = segments[j];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n isEmpty = false;\n\n // Add a \"/\" for the new segment\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n\n // Add a representation of the segment to the NFA and regex\n currentState = addSegment(currentState, segment);\n regex += segment.regex();\n }\n\n handlers.push({ handler: route.handler, names: names });\n }\n\n if (isEmpty) {\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n }\n\n currentState.handlers = handlers;\n currentState.regex = new RegExp(regex + \"$\");\n currentState.types = types;\n\n if (name = options && options.as) {\n this.names[name] = {\n segments: allSegments,\n handlers: handlers\n };\n }\n },\n\n handlersFor: function(name) {\n var route = this.names[name], result = [];\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n for (var i=0, l=route.handlers.length; i<l; i++) {\n result.push(route.handlers[i]);\n }\n\n return result;\n },\n\n hasRoute: function(name) {\n return !!this.names[name];\n },\n\n generate: function(name, params) {\n var route = this.names[name], output = \"\";\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n var segments = route.segments;\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n output += \"/\";\n output += segment.generate(params);\n }\n\n if (output.charAt(0) !== '/') { output = '/' + output; }\n\n return output;\n },\n\n recognize: function(path) {\n var states = [ this.rootState ], i, l;\n\n // DEBUG GROUP path\n\n var pathLen = path.length;\n\n if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\n if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n path = path.substr(0, pathLen - 1);\n }\n\n for (i=0, l=path.length; i<l; i++) {\n states = recognizeChar(states, path.charAt(i));\n if (!states.length) { break; }\n }\n\n // END DEBUG GROUP\n\n var solutions = [];\n for (i=0, l=states.length; i<l; i++) {\n if (states[i].handlers) { solutions.push(states[i]); }\n }\n\n states = sortSolutions(solutions);\n\n var state = solutions[0];\n\n if (state && state.handlers) {\n return findHandler(state, path);\n }\n }\n };\n\n function Target(path, matcher, delegate) {\n this.path = path;\n this.matcher = matcher;\n this.delegate = delegate;\n }\n\n Target.prototype = {\n to: function(target, callback) {\n var delegate = this.delegate;\n\n if (delegate && delegate.willAddRoute) {\n target = delegate.willAddRoute(this.matcher.target, target);\n }\n\n this.matcher.add(this.path, target);\n\n if (callback) {\n if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n this.matcher.addChild(this.path, target, callback, this.delegate);\n }\n }\n };\n\n function Matcher(target) {\n this.routes = {};\n this.children = {};\n this.target = target;\n }\n\n Matcher.prototype = {\n add: function(path, handler) {\n this.routes[path] = handler;\n },\n\n addChild: function(path, target, callback, delegate) {\n var matcher = new Matcher(target);\n this.children[path] = matcher;\n\n var match = generateMatch(path, matcher, delegate);\n\n if (delegate && delegate.contextEntered) {\n delegate.contextEntered(target, match);\n }\n\n callback(match);\n }\n };\n\n function generateMatch(startingPath, matcher, delegate) {\n return function(path, nestedCallback) {\n var fullPath = startingPath + path;\n\n if (nestedCallback) {\n nestedCallback(generateMatch(fullPath, matcher, delegate));\n } else {\n return new Target(startingPath + path, matcher, delegate);\n }\n };\n }\n\n function addRoute(routeArray, path, handler) {\n var len = 0;\n for (var i=0, l=routeArray.length; i<l; i++) {\n len += routeArray[i].path.length;\n }\n\n path = path.substr(len);\n routeArray.push({ path: path, handler: handler });\n }\n\n function eachRoute(baseRoute, matcher, callback, binding) {\n var routes = matcher.routes;\n\n for (var path in routes) {\n if (routes.hasOwnProperty(path)) {\n var routeArray = baseRoute.slice();\n addRoute(routeArray, path, routes[path]);\n\n if (matcher.children[path]) {\n eachRoute(routeArray, matcher.children[path], callback, binding);\n } else {\n callback.call(binding, routeArray);\n }\n }\n }\n }\n\n RouteRecognizer.prototype.map = function(callback, addRouteCallback) {\n var matcher = new Matcher();\n\n callback(generateMatch(\"\", matcher, this.delegate));\n\n eachRoute([], matcher, function(route) {\n if (addRouteCallback) { addRouteCallback(this, route); }\n else { this.add(route); }\n }, this);\n };\n return RouteRecognizer;\n });\n\n})();\n//@ sourceURL=ember-routing/vendor/route-recognizer");minispade.register('ember-routing/vendor/router', "(function() {define(\"router\",\n [\"route-recognizer\"],\n function(RouteRecognizer) {\n \"use strict\";\n /**\n @private\n\n This file references several internal structures:\n\n ## `RecognizedHandler`\n\n * `{String} handler`: A handler name\n * `{Object} params`: A hash of recognized parameters\n\n ## `UnresolvedHandlerInfo`\n\n * `{Boolean} isDynamic`: whether a handler has any dynamic segments\n * `{String} name`: the name of a handler\n * `{Object} context`: the active context for the handler\n\n ## `HandlerInfo`\n\n * `{Boolean} isDynamic`: whether a handler has any dynamic segments\n * `{String} name`: the original unresolved handler name\n * `{Object} handler`: a handler object\n * `{Object} context`: the active context for the handler\n */\n\n\n function Router() {\n this.recognizer = new RouteRecognizer();\n }\n\n\n Router.prototype = {\n /**\n The main entry point into the router. The API is essentially\n the same as the `map` method in `route-recognizer`.\n\n This method extracts the String handler at the last `.to()`\n call and uses it as the name of the whole route.\n\n @param {Function} callback\n */\n map: function(callback) {\n this.recognizer.delegate = this.delegate;\n\n this.recognizer.map(callback, function(recognizer, route) {\n var lastHandler = route[route.length - 1].handler;\n var args = [route, { as: lastHandler }];\n recognizer.add.apply(recognizer, args);\n });\n },\n\n hasRoute: function(route) {\n return this.recognizer.hasRoute(route);\n },\n\n /**\n The entry point for handling a change to the URL (usually\n via the back and forward button).\n\n Returns an Array of handlers and the parameters associated\n with those parameters.\n\n @param {String} url a URL to process\n\n @return {Array} an Array of `[handler, parameter]` tuples\n */\n handleURL: function(url) {\n var results = this.recognizer.recognize(url),\n objects = [];\n\n if (!results) {\n throw new Error(\"No route matched the URL '\" + url + \"'\");\n }\n\n collectObjects(this, results, 0, []);\n },\n\n /**\n Hook point for updating the URL.\n\n @param {String} url a URL to update to\n */\n updateURL: function() {\n throw \"updateURL is not implemented\";\n },\n\n /**\n Hook point for replacing the current URL, i.e. with replaceState\n\n By default this behaves the same as `updateURL`\n\n @param {String} url a URL to update to\n */\n replaceURL: function(url) {\n this.updateURL(url);\n },\n\n /**\n Transition into the specified named route.\n\n If necessary, trigger the exit callback on any handlers\n that are no longer represented by the target route.\n\n @param {String} name the name of the route\n */\n transitionTo: function(name) {\n var args = Array.prototype.slice.call(arguments, 1);\n doTransition(this, name, this.updateURL, args);\n },\n\n /**\n Identical to `transitionTo` except that the current URL will be replaced\n if possible.\n\n This method is intended primarily for use with `replaceState`.\n\n @param {String} name the name of the route\n */\n replaceWith: function(name) {\n var args = Array.prototype.slice.call(arguments, 1);\n doTransition(this, name, this.replaceURL, args);\n },\n\n /**\n @private\n\n This method takes a handler name and a list of contexts and returns\n a serialized parameter hash suitable to pass to `recognizer.generate()`.\n\n @param {String} handlerName\n @param {Array[Object]} contexts\n @return {Object} a serialized parameter hash\n */\n paramsForHandler: function(handlerName, callback) {\n var output = this._paramsForHandler(handlerName, [].slice.call(arguments, 1));\n return output.params;\n },\n\n /**\n Take a named route and context objects and generate a\n URL.\n\n @param {String} name the name of the route to generate\n a URL for\n @param {...Object} objects a list of objects to serialize\n\n @return {String} a URL\n */\n generate: function(handlerName) {\n var params = this.paramsForHandler.apply(this, arguments);\n return this.recognizer.generate(handlerName, params);\n },\n\n /**\n @private\n\n Used internally by `generate` and `transitionTo`.\n */\n _paramsForHandler: function(handlerName, objects, doUpdate) {\n var handlers = this.recognizer.handlersFor(handlerName),\n params = {},\n toSetup = [],\n startIdx = handlers.length,\n objectsToMatch = objects.length,\n object, objectChanged, handlerObj, handler, names, i, len;\n\n // Find out which handler to start matching at\n for (i=handlers.length-1; i>=0 && objectsToMatch>0; i--) {\n if (handlers[i].names.length) {\n objectsToMatch--;\n startIdx = i;\n }\n }\n\n if (objectsToMatch > 0) {\n throw \"More objects were passed than dynamic segments\";\n }\n\n // Connect the objects to the routes\n for (i=0, len=handlers.length; i<len; i++) {\n handlerObj = handlers[i];\n handler = this.getHandler(handlerObj.handler);\n names = handlerObj.names;\n objectChanged = false;\n\n // If it's a dynamic segment\n if (names.length) {\n // If we have objects, use them\n if (i >= startIdx) {\n object = objects.shift();\n objectChanged = true;\n // Otherwise use existing context\n } else {\n object = handler.context;\n }\n\n // Serialize to generate params\n if (handler.serialize) {\n merge(params, handler.serialize(object, names));\n }\n // If it's not a dynamic segment and we're updating\n } else if (doUpdate) {\n // If we've passed the match point we need to deserialize again\n // or if we never had a context\n if (i > startIdx || !handler.hasOwnProperty('context')) {\n if (handler.deserialize) {\n object = handler.deserialize({});\n objectChanged = true;\n }\n // Otherwise use existing context\n } else {\n object = handler.context;\n }\n }\n\n // Make sure that we update the context here so it's available to\n // subsequent deserialize calls\n if (doUpdate && objectChanged) {\n // TODO: It's a bit awkward to set the context twice, see if we can DRY things up\n setContext(handler, object);\n }\n\n toSetup.push({\n isDynamic: !!handlerObj.names.length,\n handler: handlerObj.handler,\n name: handlerObj.name,\n context: object\n });\n }\n\n return { params: params, toSetup: toSetup };\n },\n\n isActive: function(handlerName) {\n var contexts = [].slice.call(arguments, 1);\n\n var currentHandlerInfos = this.currentHandlerInfos,\n found = false, names, object, handlerInfo, handlerObj;\n\n for (var i=currentHandlerInfos.length-1; i>=0; i--) {\n handlerInfo = currentHandlerInfos[i];\n if (handlerInfo.name === handlerName) { found = true; }\n\n if (found) {\n if (contexts.length === 0) { break; }\n\n if (handlerInfo.isDynamic) {\n object = contexts.pop();\n if (handlerInfo.context !== object) { return false; }\n }\n }\n }\n\n return contexts.length === 0 && found;\n },\n\n trigger: function(name) {\n var args = [].slice.call(arguments);\n trigger(this, args);\n }\n };\n\n function merge(hash, other) {\n for (var prop in other) {\n if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; }\n }\n }\n\n function isCurrent(currentHandlerInfos, handlerName) {\n return currentHandlerInfos[currentHandlerInfos.length - 1].name === handlerName;\n }\n\n /**\n @private\n\n This function is called the first time the `collectObjects`\n function encounters a promise while converting URL parameters\n into objects.\n\n It triggers the `enter` and `setup` methods on the `loading`\n handler.\n\n @param {Router} router\n */\n function loading(router) {\n if (!router.isLoading) {\n router.isLoading = true;\n var handler = router.getHandler('loading');\n\n if (handler) {\n if (handler.enter) { handler.enter(); }\n if (handler.setup) { handler.setup(); }\n }\n }\n }\n\n /**\n @private\n\n This function is called if a promise was previously\n encountered once all promises are resolved.\n\n It triggers the `exit` method on the `loading` handler.\n\n @param {Router} router\n */\n function loaded(router) {\n router.isLoading = false;\n var handler = router.getHandler('loading');\n if (handler && handler.exit) { handler.exit(); }\n }\n\n /**\n @private\n\n This function is called if any encountered promise\n is rejected.\n\n It triggers the `exit` method on the `loading` handler,\n the `enter` method on the `failure` handler, and the\n `setup` method on the `failure` handler with the\n `error`.\n\n @param {Router} router\n @param {Object} error the reason for the promise\n rejection, to pass into the failure handler's\n `setup` method.\n */\n function failure(router, error) {\n loaded(router);\n var handler = router.getHandler('failure');\n if (handler && handler.setup) { handler.setup(error); }\n }\n\n /**\n @private\n */\n function doTransition(router, name, method, args) {\n var output = router._paramsForHandler(name, args, true);\n var params = output.params, toSetup = output.toSetup;\n\n var url = router.recognizer.generate(name, params);\n method.call(router, url);\n\n setupContexts(router, toSetup);\n }\n\n /**\n @private\n\n This function is called after a URL change has been handled\n by `router.handleURL`.\n\n Takes an Array of `RecognizedHandler`s, and converts the raw\n params hashes into deserialized objects by calling deserialize\n on the handlers. This process builds up an Array of\n `HandlerInfo`s. It then calls `setupContexts` with the Array.\n\n If the `deserialize` method on a handler returns a promise\n (i.e. has a method called `then`), this function will pause\n building up the `HandlerInfo` Array until the promise is\n resolved. It will use the resolved value as the context of\n `HandlerInfo`.\n */\n function collectObjects(router, results, index, objects) {\n if (results.length === index) {\n loaded(router);\n setupContexts(router, objects);\n return;\n }\n\n var result = results[index];\n var handler = router.getHandler(result.handler);\n var object = handler.deserialize && handler.deserialize(result.params);\n\n if (object && typeof object.then === 'function') {\n loading(router);\n\n // The chained `then` means that we can also catch errors that happen in `proceed`\n object.then(proceed).then(null, function(error) {\n failure(router, error);\n });\n } else {\n proceed(object);\n }\n\n function proceed(value) {\n if (handler.context !== object) {\n setContext(handler, object);\n }\n\n var updatedObjects = objects.concat([{\n context: value,\n handler: result.handler,\n isDynamic: result.isDynamic\n }]);\n collectObjects(router, results, index + 1, updatedObjects);\n }\n }\n\n /**\n @private\n\n Takes an Array of `UnresolvedHandlerInfo`s, resolves the handler names\n into handlers, and then figures out what to do with each of the handlers.\n\n For example, consider the following tree of handlers. Each handler is\n followed by the URL segment it handles.\n\n ```\n |~index (\"/\")\n | |~posts (\"/posts\")\n | | |-showPost (\"/:id\")\n | | |-newPost (\"/new\")\n | | |-editPost (\"/edit\")\n | |~about (\"/about/:id\")\n ```\n\n Consider the following transitions:\n\n 1. A URL transition to `/posts/1`.\n 1. Triggers the `deserialize` callback on the\n `index`, `posts`, and `showPost` handlers\n 2. Triggers the `enter` callback on the same\n 3. Triggers the `setup` callback on the same\n 2. A direct transition to `newPost`\n 1. Triggers the `exit` callback on `showPost`\n 2. Triggers the `enter` callback on `newPost`\n 3. Triggers the `setup` callback on `newPost`\n 3. A direct transition to `about` with a specified\n context object\n 1. Triggers the `exit` callback on `newPost`\n and `posts`\n 2. Triggers the `serialize` callback on `about`\n 3. Triggers the `enter` callback on `about`\n 4. Triggers the `setup` callback on `about`\n\n @param {Router} router\n @param {Array[UnresolvedHandlerInfo]} handlerInfos\n */\n function setupContexts(router, handlerInfos) {\n resolveHandlers(router, handlerInfos);\n\n var partition =\n partitionHandlers(router.currentHandlerInfos || [], handlerInfos);\n\n router.currentHandlerInfos = handlerInfos;\n\n eachHandler(partition.exited, function(handler, context) {\n delete handler.context;\n if (handler.exit) { handler.exit(); }\n });\n\n eachHandler(partition.updatedContext, function(handler, context) {\n setContext(handler, context);\n if (handler.setup) { handler.setup(context); }\n });\n\n var aborted = false;\n eachHandler(partition.entered, function(handler, context) {\n if (aborted) { return; }\n if (handler.enter) { handler.enter(); }\n setContext(handler, context);\n if (handler.setup) {\n if (false === handler.setup(context)) {\n aborted = true;\n }\n }\n });\n\n if (router.didTransition) {\n router.didTransition(handlerInfos);\n }\n }\n\n /**\n @private\n\n Iterates over an array of `HandlerInfo`s, passing the handler\n and context into the callback.\n\n @param {Array[HandlerInfo]} handlerInfos\n @param {Function(Object, Object)} callback\n */\n function eachHandler(handlerInfos, callback) {\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler,\n context = handlerInfo.context;\n\n callback(handler, context);\n }\n }\n\n /**\n @private\n\n Updates the `handler` field in each element in an Array of\n `UnresolvedHandlerInfo`s from a handler name to a resolved handler.\n\n When done, the Array will contain `HandlerInfo` structures.\n\n @param {Router} router\n @param {Array[UnresolvedHandlerInfo]} handlerInfos\n */\n function resolveHandlers(router, handlerInfos) {\n var handlerInfo;\n\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n handlerInfo = handlerInfos[i];\n\n handlerInfo.name = handlerInfo.handler;\n handlerInfo.handler = router.getHandler(handlerInfo.handler);\n }\n }\n\n /**\n @private\n\n This function is called when transitioning from one URL to\n another to determine which handlers are not longer active,\n which handlers are newly active, and which handlers remain\n active but have their context changed.\n\n Take a list of old handlers and new handlers and partition\n them into four buckets:\n\n * unchanged: the handler was active in both the old and\n new URL, and its context remains the same\n * updated context: the handler was active in both the\n old and new URL, but its context changed. The handler's\n `setup` method, if any, will be called with the new\n context.\n * exited: the handler was active in the old URL, but is\n no longer active.\n * entered: the handler was not active in the old URL, but\n is now active.\n\n The PartitionedHandlers structure has three fields:\n\n * `updatedContext`: a list of `HandlerInfo` objects that\n represent handlers that remain active but have a changed\n context\n * `entered`: a list of `HandlerInfo` objects that represent\n handlers that are newly active\n * `exited`: a list of `HandlerInfo` objects that are no\n longer active.\n\n @param {Array[HandlerInfo]} oldHandlers a list of the handler\n information for the previous URL (or `[]` if this is the\n first handled transition)\n @param {Array[HandlerInfo]} newHandlers a list of the handler\n information for the new URL\n\n @return {Partition}\n */\n function partitionHandlers(oldHandlers, newHandlers) {\n var handlers = {\n updatedContext: [],\n exited: [],\n entered: []\n };\n\n var handlerChanged, contextChanged, i, l;\n\n for (i=0, l=newHandlers.length; i<l; i++) {\n var oldHandler = oldHandlers[i], newHandler = newHandlers[i];\n\n if (!oldHandler || oldHandler.handler !== newHandler.handler) {\n handlerChanged = true;\n }\n\n if (handlerChanged) {\n handlers.entered.push(newHandler);\n if (oldHandler) { handlers.exited.unshift(oldHandler); }\n } else if (contextChanged || oldHandler.context !== newHandler.context) {\n contextChanged = true;\n handlers.updatedContext.push(newHandler);\n }\n }\n\n for (i=newHandlers.length, l=oldHandlers.length; i<l; i++) {\n handlers.exited.unshift(oldHandlers[i]);\n }\n\n return handlers;\n }\n\n function trigger(router, args) {\n var currentHandlerInfos = router.currentHandlerInfos;\n\n var name = args.shift();\n\n if (!currentHandlerInfos) {\n throw new Error(\"Could not trigger event '\" + name + \"'. There are no active handlers\");\n }\n\n for (var i=currentHandlerInfos.length-1; i>=0; i--) {\n var handlerInfo = currentHandlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler.events && handler.events[name]) {\n handler.events[name].apply(handler, args);\n return;\n }\n }\n\n throw new Error(\"Nothing handled the event '\" + name + \"'.\");\n }\n\n function setContext(handler, context) {\n handler.context = context;\n if (handler.contextDidChange) { handler.contextDidChange(); }\n }\n return Router;\n });\n\n})();\n//@ sourceURL=ember-routing/vendor/router");minispade.register('ember-runtime/controllers', "(function() {minispade.require('ember-runtime/controllers/array_controller');\nminispade.require('ember-runtime/controllers/object_controller');\nminispade.require('ember-runtime/controllers/controller');\n\n})();\n//@ sourceURL=ember-runtime/controllers");minispade.register('ember-runtime/controllers/array_controller', "(function() {minispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/controllers/controller');\nminispade.require('ember-runtime/mixins/sortable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach,\n replace = Ember.EnumerableUtils.replace;\n\n/**\n `Ember.ArrayController` provides a way for you to publish a collection of\n objects so that you can easily bind to the collection from a Handlebars\n `#each` helper, an `Ember.CollectionView`, or other controllers.\n\n The advantage of using an `ArrayController` is that you only have to set up\n your view bindings once; to change what's displayed, simply swap out the\n `content` property on the controller.\n\n For example, imagine you wanted to display a list of items fetched via an XHR\n request. Create an `Ember.ArrayController` and set its `content` property:\n\n ```javascript\n MyApp.listController = Ember.ArrayController.create();\n\n $.get('people.json', function(data) {\n MyApp.listController.set('content', data);\n });\n ```\n\n Then, create a view that binds to your new controller:\n\n ```handlebars\n {{#each MyApp.listController}}\n {{firstName}} {{lastName}}\n {{/each}}\n ```\n\n Although you are binding to the controller, the behavior of this controller\n is to pass through any methods or properties to the underlying array. This\n capability comes from `Ember.ArrayProxy`, which this class inherits from.\n\n Sometimes you want to display computed properties within the body of an\n `#each` helper that depend on the underlying items in `content`, but are not\n present on those items. To do this, set `itemController` to the name of a\n controller (probably an `ObjectController`) that will wrap each individual item.\n\n For example:\n\n ```handlebars\n {{#each post in controller}}\n <li>{{title}} ({{titleLength}} characters)</li>\n {{/each}}\n ```\n\n ```javascript\n App.PostsController = Ember.ArrayController.extend({\n itemController: 'post'\n });\n\n App.PostController = Ember.ObjectController.extend({\n // the `title` property will be proxied to the underlying post.\n\n titleLength: function() {\n return this.get('title').length;\n }.property('title')\n });\n ```\n\n In some cases it is helpful to return a different `itemController` depending\n on the particular item. Subclasses can do this by overriding\n `lookupItemController`.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @class ArrayController\n @namespace Ember\n @extends Ember.ArrayProxy\n @uses Ember.SortableMixin\n @uses Ember.ControllerMixin\n*/\n\nEmber.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,\n Ember.SortableMixin, {\n\n /**\n The controller used to wrap items, if any.\n\n @property itemController\n @type String\n @default null\n */\n itemController: null,\n\n /**\n Return the name of the controller to wrap items, or `null` if items should\n be returned directly. The default implementation simply returns the\n `itemController` property, but subclasses can override this method to return\n different controllers for different objects.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @method\n @type String\n @default null\n */\n lookupItemController: function(object) {\n return get(this, 'itemController');\n },\n\n objectAtContent: function(idx) {\n var length = get(this, 'length'),\n arrangedContent = get(this,'arrangedContent'),\n object = arrangedContent && arrangedContent.objectAt(idx);\n\n if (idx >= 0 && idx < length) {\n var controllerClass = this.lookupItemController(object);\n if (controllerClass) {\n return this.controllerAt(idx, object, controllerClass);\n }\n }\n\n // When `controllerClass` is falsy, we have not opted in to using item\n // controllers, so return the object directly.\n\n // When the index is out of range, we want to return the \"out of range\"\n // value, whatever that might be. Rather than make assumptions\n // (e.g. guessing `null` or `undefined`) we defer this to `arrangedContent`.\n return object;\n },\n\n arrangedContentDidChange: function() {\n this._super();\n this._resetSubControllers();\n },\n\n arrayContentDidChange: function(idx, removedCnt, addedCnt) {\n var subControllers = get(this, '_subControllers'),\n subControllersToRemove = subControllers.slice(idx, idx+removedCnt);\n\n forEach(subControllersToRemove, function(subController) {\n if (subController) { subController.destroy(); }\n });\n\n replace(subControllers, idx, removedCnt, new Array(addedCnt));\n\n // The shadow array of subcontrollers must be updated before we trigger\n // observers, otherwise observers will get the wrong subcontainer when\n // calling `objectAt`\n this._super(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n if (!this.get('content')) { Ember.defineProperty(this, 'content', undefined, Ember.A()); }\n this.set('_subControllers', Ember.A());\n },\n\n controllerAt: function(idx, object, controllerClass) {\n var container = get(this, 'container'),\n subControllers = get(this, '_subControllers'),\n subController = subControllers[idx];\n\n if (!subController) {\n subController = container.lookup(\"controller:\" + controllerClass, { singleton: false });\n subControllers[idx] = subController;\n }\n\n if (!subController) {\n throw new Error('Could not resolve itemController: \"' + controllerClass + '\"');\n }\n\n subController.set('target', this);\n subController.set('content', object);\n\n return subController;\n },\n\n _subControllers: null,\n\n _resetSubControllers: function() {\n var subControllers = get(this, '_subControllers');\n\n forEach(subControllers, function(subController) {\n if (subController) { subController.destroy(); }\n });\n\n this.set('_subControllers', Ember.A());\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/controllers/array_controller");minispade.register('ember-runtime/controllers/controller', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/string');\n\nvar get = Ember.get;\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ControllerMixin` provides a standard interface for all classes that\n compose Ember's controller layer: `Ember.Controller`,\n `Ember.ArrayController`, and `Ember.ObjectController`.\n\n Within an `Ember.Router`-managed application single shared instaces of every\n Controller object in your application's namespace will be added to the\n application's `Ember.Router` instance. See `Ember.Application#initialize`\n for additional information.\n\n ## Views\n\n By default a controller instance will be the rendering context\n for its associated `Ember.View.` This connection is made during calls to\n `Ember.ControllerMixin#connectOutlet`.\n\n Within the view's template, the `Ember.View` instance can be accessed\n through the controller with `{{view}}`.\n\n ## Target Forwarding\n\n By default a controller will target your application's `Ember.Router`\n instance. Calls to `{{action}}` within the template of a controller's view\n are forwarded to the router. See `Ember.Handlebars.helpers.action` for\n additional information.\n\n @class ControllerMixin\n @namespace Ember\n @extends Ember.Mixin\n*/\nEmber.ControllerMixin = Ember.Mixin.create({\n /* ducktype as a controller */\n isController: true,\n\n /**\n The object to which events from the view should be sent.\n\n For example, when a Handlebars template uses the `{{action}}` helper,\n it will attempt to send the event to the view's controller's `target`.\n\n By default, a controller's `target` is set to the router after it is\n instantiated by `Ember.Application#initialize`.\n\n @property target\n @default null\n */\n target: null,\n\n container: null,\n\n store: null,\n\n model: Ember.computed.alias('content'),\n\n send: function(actionName) {\n var args = [].slice.call(arguments, 1), target;\n\n if (this[actionName]) {\n Ember.assert(\"The controller \" + this + \" does not have the action \" + actionName, typeof this[actionName] === 'function');\n this[actionName].apply(this, args);\n } else if(target = get(this, 'target')) {\n Ember.assert(\"The target for controller \" + this + \" (\" + target + \") did not define a `send` method\", typeof target.send === 'function');\n target.send.apply(target, arguments);\n }\n }\n});\n\n/**\n @class Controller\n @namespace Ember\n @extends Ember.Object\n @uses Ember.ControllerMixin\n*/\nEmber.Controller = Ember.Object.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/controller");minispade.register('ember-runtime/controllers/object_controller', "(function() {minispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/controllers/controller');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ObjectController` is part of Ember's Controller layer. A single shared\n instance of each `Ember.ObjectController` subclass in your application's\n namespace will be created at application initialization and be stored on your\n application's `Ember.Router` instance.\n\n `Ember.ObjectController` derives its functionality from its superclass\n `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin.\n\n @class ObjectController\n @namespace Ember\n @extends Ember.ObjectProxy\n @uses Ember.ControllerMixin\n**/\nEmber.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/object_controller");minispade.register('ember-runtime/core', "(function() {/*globals ENV */\nminispade.require('ember-metal');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar indexOf = Ember.EnumerableUtils.indexOf;\n\n// ........................................\n// TYPING & ARRAY MESSAGING\n//\n\nvar TYPE_MAP = {};\nvar t = \"Boolean Number String Function Array Date RegExp Object\".split(\" \");\nEmber.ArrayPolyfills.forEach.call(t, function(name) {\n TYPE_MAP[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\nvar toString = Object.prototype.toString;\n\n/**\n Returns a consistent type for the passed item.\n\n Use this instead of the built-in `typeof` to get the type of an item.\n It will return the same result across all browsers and includes a bit\n more detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive |\n | 'number' | Number primitive |\n | 'boolean' | Boolean primitive |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'class' | An Ember class (created using Ember.Object.extend()) |\n | 'instance' | An Ember object instance |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object not inheriting from Ember.Object |\n\n Examples:\n\n ```javascript\n Ember.typeOf(); // 'undefined'\n Ember.typeOf(null); // 'null'\n Ember.typeOf(undefined); // 'undefined'\n Ember.typeOf('michael'); // 'string'\n Ember.typeOf(101); // 'number'\n Ember.typeOf(true); // 'boolean'\n Ember.typeOf(Ember.makeArray); // 'function'\n Ember.typeOf([1,2,90]); // 'array'\n Ember.typeOf(Ember.Object.extend()); // 'class'\n Ember.typeOf(Ember.Object.create()); // 'instance'\n Ember.typeOf(new Error('teamocil')); // 'error'\n\n // \"normal\" JavaScript object\n Ember.typeOf({a: 'b'}); // 'object'\n ```\n\n @method typeOf\n @for Ember\n @param {Object} item the item to check\n @return {String} the type\n*/\nEmber.typeOf = function(item) {\n var ret;\n\n ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object';\n\n if (ret === 'function') {\n if (Ember.Object && Ember.Object.detect(item)) ret = 'class';\n } else if (ret === 'object') {\n if (item instanceof Error) ret = 'error';\n else if (Ember.Object && item instanceof Ember.Object) ret = 'instance';\n else ret = 'object';\n }\n\n return ret;\n};\n\n/**\n This will compare two javascript values of possibly different types.\n It will tell you which one is greater than the other by returning:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n The order is calculated based on `Ember.ORDER_DEFINITION`, if types are different.\n In case they have the same type an appropriate comparison for this type is made.\n\n ```javascript\n Ember.compare('hello', 'hello'); // 0\n Ember.compare('abc', 'dfg'); // -1\n Ember.compare(2, 1); // 1\n ```\n\n @method compare\n @for Ember\n @param {Object} v First value to compare\n @param {Object} w Second value to compare\n @return {Number} -1 if v < w, 0 if v = w and 1 if v > w.\n*/\nEmber.compare = function compare(v, w) {\n if (v === w) { return 0; }\n\n var type1 = Ember.typeOf(v);\n var type2 = Ember.typeOf(w);\n\n var Comparable = Ember.Comparable;\n if (Comparable) {\n if (type1==='instance' && Comparable.detect(v.constructor)) {\n return v.constructor.compare(v, w);\n }\n\n if (type2 === 'instance' && Comparable.detect(w.constructor)) {\n return 1-w.constructor.compare(w, v);\n }\n }\n\n // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION,\n // do so now.\n var mapping = Ember.ORDER_DEFINITION_MAPPING;\n if (!mapping) {\n var order = Ember.ORDER_DEFINITION;\n mapping = Ember.ORDER_DEFINITION_MAPPING = {};\n var idx, len;\n for (idx = 0, len = order.length; idx < len; ++idx) {\n mapping[order[idx]] = idx;\n }\n\n // We no longer need Ember.ORDER_DEFINITION.\n delete Ember.ORDER_DEFINITION;\n }\n\n var type1Index = mapping[type1];\n var type2Index = mapping[type2];\n\n if (type1Index < type2Index) { return -1; }\n if (type1Index > type2Index) { return 1; }\n\n // types are equal - so we have to check values now\n switch (type1) {\n case 'boolean':\n case 'number':\n if (v < w) { return -1; }\n if (v > w) { return 1; }\n return 0;\n\n case 'string':\n var comp = v.localeCompare(w);\n if (comp < 0) { return -1; }\n if (comp > 0) { return 1; }\n return 0;\n\n case 'array':\n var vLen = v.length;\n var wLen = w.length;\n var l = Math.min(vLen, wLen);\n var r = 0;\n var i = 0;\n while (r === 0 && i < l) {\n r = compare(v[i],w[i]);\n i++;\n }\n if (r !== 0) { return r; }\n\n // all elements are equal now\n // shorter array should be ordered first\n if (vLen < wLen) { return -1; }\n if (vLen > wLen) { return 1; }\n // arrays are equal now\n return 0;\n\n case 'instance':\n if (Ember.Comparable && Ember.Comparable.detect(v)) {\n return v.compare(v, w);\n }\n return 0;\n\n case 'date':\n var vNum = v.getTime();\n var wNum = w.getTime();\n if (vNum < wNum) { return -1; }\n if (vNum > wNum) { return 1; }\n return 0;\n\n default:\n return 0;\n }\n};\n\nfunction _copy(obj, deep, seen, copies) {\n var ret, loc, key;\n\n // primitive data types are immutable, just return them.\n if ('object' !== typeof obj || obj===null) return obj;\n\n // avoid cyclical loops\n if (deep && (loc=indexOf(seen, obj))>=0) return copies[loc];\n\n Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof Ember.Object) || (Ember.Copyable && Ember.Copyable.detect(obj)));\n\n // IMPORTANT: this specific test will detect a native array only. Any other\n // object will need to implement Copyable.\n if (Ember.typeOf(obj) === 'array') {\n ret = obj.slice();\n if (deep) {\n loc = ret.length;\n while(--loc>=0) ret[loc] = _copy(ret[loc], deep, seen, copies);\n }\n } else if (Ember.Copyable && Ember.Copyable.detect(obj)) {\n ret = obj.copy(deep, seen, copies);\n } else {\n ret = {};\n for(key in obj) {\n if (!obj.hasOwnProperty(key)) continue;\n\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') continue;\n\n ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];\n }\n }\n\n if (deep) {\n seen.push(obj);\n copies.push(ret);\n }\n\n return ret;\n}\n\n/**\n Creates a clone of the passed object. This function can take just about\n any type of object and create a clone of it, including primitive values\n (which are not actually cloned because they are immutable).\n\n If the passed object implements the `clone()` method, then this function\n will simply call that method and return the result.\n\n @method copy\n @for Ember\n @param {Object} obj The object to clone\n @param {Boolean} deep If true, a deep copy of the object is made\n @return {Object} The cloned object\n*/\nEmber.copy = function(obj, deep) {\n // fast paths\n if ('object' !== typeof obj || obj===null) return obj; // can't copy primitives\n if (Ember.Copyable && Ember.Copyable.detect(obj)) return obj.copy(deep);\n return _copy(obj, deep, deep ? [] : null, deep ? [] : null);\n};\n\n/**\n Convenience method to inspect an object. This method will attempt to\n convert the object into a useful string description.\n\n It is a pretty simple implementation. If you want something more robust,\n use something like JSDump: https://github.com/NV/jsDump\n\n @method inspect\n @for Ember\n @param {Object} obj The object you want to inspect.\n @return {String} A description of the object\n*/\nEmber.inspect = function(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj + '';\n }\n\n var v, ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) {\n v = obj[key];\n if (v === 'toString') { continue; } // ignore useless items\n if (Ember.typeOf(v) === 'function') { v = \"function() { ... }\"; }\n ret.push(key + \": \" + v);\n }\n }\n return \"{\" + ret.join(\", \") + \"}\";\n};\n\n/**\n Compares two objects, returning true if they are logically equal. This is\n a deeper comparison than a simple triple equal. For sets it will compare the\n internal objects. For any other object that implements `isEqual()` it will\n respect that method.\n\n ```javascript\n Ember.isEqual('hello', 'hello'); // true\n Ember.isEqual(1, 2); // false\n Ember.isEqual([4,2], [4,2]); // false\n ```\n\n @method isEqual\n @for Ember\n @param {Object} a first object to compare\n @param {Object} b second object to compare\n @return {Boolean}\n*/\nEmber.isEqual = function(a, b) {\n if (a && 'function'===typeof a.isEqual) return a.isEqual(b);\n return a === b;\n};\n\n// Used by Ember.compare\nEmber.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [\n 'undefined',\n 'null',\n 'boolean',\n 'number',\n 'string',\n 'array',\n 'object',\n 'instance',\n 'function',\n 'class',\n 'date'\n];\n\n/**\n Returns all of the keys defined on an object or hash. This is useful\n when inspecting objects for debugging. On browsers that support it, this\n uses the native `Object.keys` implementation.\n\n @method keys\n @for Ember\n @param {Object} obj\n @return {Array} Array containing keys of obj\n*/\nEmber.keys = Object.keys;\n\nif (!Ember.keys) {\n Ember.keys = function(obj) {\n var ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) { ret.push(key); }\n }\n return ret;\n };\n}\n\n// ..........................................................\n// ERROR\n//\n\nvar errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];\n\n/**\n A subclass of the JavaScript Error object for use in Ember.\n\n @class Error\n @namespace Ember\n @extends Error\n @constructor\n*/\nEmber.Error = function() {\n var tmp = Error.prototype.constructor.apply(this, arguments);\n\n // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n for (var idx = 0; idx < errorProps.length; idx++) {\n this[errorProps[idx]] = tmp[errorProps[idx]];\n }\n};\n\nEmber.Error.prototype = Ember.create(Error.prototype);\n\n})();\n//@ sourceURL=ember-runtime/core");minispade.register('ember-runtime/ext', "(function() {minispade.require('ember-runtime/ext/ember');\nminispade.require('ember-runtime/ext/string');\nminispade.require('ember-runtime/ext/function');\n\n})();\n//@ sourceURL=ember-runtime/ext");minispade.register('ember-runtime/ext/ember', "(function() {/**\n Expose RSVP implementation\n\n @class RSVP\n @namespace Ember\n @constructor\n*/\nEmber.RSVP = requireModule('rsvp');\n\n})();\n//@ sourceURL=ember-runtime/ext/ember");minispade.register('ember-runtime/ext/function', "(function() {minispade.require('ember-runtime/core');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar a_slice = Array.prototype.slice;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {\n\n /**\n The `property` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n `true`, which is the default.\n\n Computed properties allow you to treat a function like a property:\n\n ```javascript\n MyApp.president = Ember.Object.create({\n firstName: \"Barack\",\n lastName: \"Obama\",\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Call this flag to mark the function as a property\n }.property()\n });\n\n MyApp.president.get('fullName'); // \"Barack Obama\"\n ```\n\n Treating a function like a property is useful because they can work with\n bindings, just like any other property.\n\n Many computed properties have dependencies on other properties. For\n example, in the above example, the `fullName` property depends on\n `firstName` and `lastName` to determine its value. You can tell Ember\n about these dependencies like this:\n\n ```javascript\n MyApp.president = Ember.Object.create({\n firstName: \"Barack\",\n lastName: \"Obama\",\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember.js that this computed property depends on firstName\n // and lastName\n }.property('firstName', 'lastName')\n });\n ```\n\n Make sure you list these dependencies so Ember knows when to update\n bindings that connect to a computed property. Changing a dependency\n will not immediately trigger an update of the computed property, but\n will instead clear the cache so that it is updated when the next `get`\n is called on the property.\n\n See {{#crossLink \"Ember.ComputedProperty\"}}{{/crossLink}},\n {{#crossLink \"Ember/computed\"}}{{/crossLink}}\n\n @method property\n @for Function\n */\n Function.prototype.property = function() {\n var ret = Ember.computed(this);\n return ret.property.apply(ret, arguments);\n };\n\n /**\n The `observes` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.create({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n See {{#crossLink \"Ember.Observable/observes\"}}{{/crossLink}}\n\n @method observes\n @for Function\n */\n Function.prototype.observes = function() {\n this.__ember_observes__ = a_slice.call(arguments);\n return this;\n };\n\n /**\n The `observesBefore` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can get notified when a property changes is about to happen by\n by adding the `observesBefore` call to the end of your method\n declarations in classes that you write. For example:\n\n ```javascript\n Ember.Object.create({\n valueObserver: function() {\n // Executes whenever the \"value\" property is about to change\n }.observesBefore('value')\n });\n ```\n\n See {{#crossLink \"Ember.Observable/observesBefore\"}}{{/crossLink}}\n\n @method observesBefore\n @for Function\n */\n Function.prototype.observesBefore = function() {\n this.__ember_observesBefore__ = a_slice.call(arguments);\n return this;\n };\n\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/function");minispade.register('ember-runtime/ext/string', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar fmt = Ember.String.fmt,\n w = Ember.String.w,\n loc = Ember.String.loc,\n camelize = Ember.String.camelize,\n decamelize = Ember.String.decamelize,\n dasherize = Ember.String.dasherize,\n underscore = Ember.String.underscore,\n capitalize = Ember.String.capitalize,\n classify = Ember.String.classify;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n See {{#crossLink \"Ember.String/fmt\"}}{{/crossLink}}\n\n @method fmt\n @for String\n */\n String.prototype.fmt = function() {\n return fmt(this, arguments);\n };\n\n /**\n See {{#crossLink \"Ember.String/w\"}}{{/crossLink}}\n\n @method w\n @for String\n */\n String.prototype.w = function() {\n return w(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/loc\"}}{{/crossLink}}\n\n @method loc\n @for String\n */\n String.prototype.loc = function() {\n return loc(this, arguments);\n };\n\n /**\n See {{#crossLink \"Ember.String/camelize\"}}{{/crossLink}}\n\n @method camelize\n @for String\n */\n String.prototype.camelize = function() {\n return camelize(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/decamelize\"}}{{/crossLink}}\n\n @method decamelize\n @for String\n */\n String.prototype.decamelize = function() {\n return decamelize(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/dasherize\"}}{{/crossLink}}\n\n @method dasherize\n @for String\n */\n String.prototype.dasherize = function() {\n return dasherize(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/underscore\"}}{{/crossLink}}\n\n @method underscore\n @for String\n */\n String.prototype.underscore = function() {\n return underscore(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/classify\"}}{{/crossLink}}\n\n @method classify\n @for String\n */\n String.prototype.classify = function() {\n return classify(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/capitalize\"}}{{/crossLink}}\n\n @method capitalize\n @for String\n */\n String.prototype.capitalize = function() {\n return capitalize(this);\n };\n\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/string");minispade.register('ember-runtime', "(function() {/**\nEmber Runtime\n\n@module ember\n@submodule ember-runtime\n@requires ember-metal\n*/\nminispade.require('container');\nminispade.require('ember-metal');\nminispade.require('ember-runtime/core');\nminispade.require('ember-runtime/ext');\nminispade.require('ember-runtime/mixins');\nminispade.require('ember-runtime/system');\nminispade.require('ember-runtime/controllers');\n\n})();\n//@ sourceURL=ember-runtime");minispade.register('ember-runtime/mixins', "(function() {minispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/comparable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/enumerable');\nminispade.require('ember-runtime/mixins/freezable');\nminispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/mixins/target_action_support');\nminispade.require('ember-runtime/mixins/evented');\nminispade.require('ember-runtime/mixins/deferred');\n\n})();\n//@ sourceURL=ember-runtime/mixins");minispade.register('ember-runtime/mixins/array', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;\n\nfunction none(obj) { return obj===null || obj===undefined; }\n\n// ..........................................................\n// ARRAY\n//\n/**\n This module implements Observer-friendly Array-like behavior. This mixin is\n picked up by the Array class as well as other controllers, etc. that want to\n appear to be arrays.\n\n Unlike `Ember.Enumerable,` this mixin defines methods specifically for\n collections that provide index-ordered access to their contents. When you\n are designing code that needs to accept any kind of Array-like object, you\n should use these methods instead of Array primitives because these will\n properly notify observers of changes to the array.\n\n Although these methods are efficient, they do add a layer of indirection to\n your application so it is a good idea to use them only when you need the\n flexibility of using both true JavaScript arrays and \"virtual\" arrays such\n as controllers and collections.\n\n You can use the methods defined in this module to access and modify array\n contents in a KVO-friendly way. You can also be notified whenever the\n membership if an array changes by changing the syntax of the property to\n `.observes('*myProperty.[]')`.\n\n To support `Ember.Array` in your own class, you must override two\n primitives to use it: `replace()` and `objectAt()`.\n\n Note that the Ember.Array mixin also incorporates the `Ember.Enumerable`\n mixin. All `Ember.Array`-like objects are also enumerable.\n\n @class Array\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.Enumerable\n @since Ember 0.9.0\n*/\nEmber.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.prototype */ {\n\n // compatibility\n isSCArray: true,\n\n /**\n Your array must support the `length` property. Your replace methods should\n set this property whenever it changes.\n\n @property {Number} length\n */\n length: Ember.required(),\n\n /**\n Returns the object at the given `index`. If the given `index` is negative\n or is greater or equal than the array length, returns `undefined`.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n If your object supports retrieving the value of an array item using `get()`\n (i.e. `myArray.get(0)`), then you do not need to implement this method\n yourself.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectAt(0); // \"a\"\n arr.objectAt(3); // \"d\"\n arr.objectAt(-1); // undefined\n arr.objectAt(4); // undefined\n arr.objectAt(5); // undefined\n ```\n\n @method objectAt\n @param {Number} idx The index of the item to return.\n */\n objectAt: function(idx) {\n if ((idx < 0) || (idx>=get(this, 'length'))) return undefined ;\n return get(this, idx);\n },\n\n /**\n This returns the objects at the specified indexes, using `objectAt`.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectsAt([0, 1, 2]); // [\"a\", \"b\", \"c\"]\n arr.objectsAt([2, 3, 4]); // [\"c\", \"d\", undefined]\n ```\n\n @method objectsAt\n @param {Array} indexes An array of indexes of items to return.\n */\n objectsAt: function(indexes) {\n var self = this;\n return map(indexes, function(idx){ return self.objectAt(idx); });\n },\n\n // overrides Ember.Enumerable version\n nextObject: function(idx) {\n return this.objectAt(idx);\n },\n\n /**\n This is the handler for the special array content property. If you get\n this property, it will return this. If you set this property it a new\n array, it will replace the current content.\n\n This property overrides the default property defined in `Ember.Enumerable`.\n\n @property []\n */\n '[]': Ember.computed(function(key, value) {\n if (value !== undefined) this.replace(0, get(this, 'length'), value) ;\n return this ;\n }),\n\n firstObject: Ember.computed(function() {\n return this.objectAt(0);\n }),\n\n lastObject: Ember.computed(function() {\n return this.objectAt(get(this, 'length')-1);\n }),\n\n // optimized version from Enumerable\n contains: function(obj){\n return this.indexOf(obj) >= 0;\n },\n\n // Add any extra methods to Ember.Array that are native to the built-in Array.\n /**\n Returns a new array that is a slice of the receiver. This implementation\n uses the observable array methods to retrieve the objects for the new\n slice.\n\n ```javascript\n var arr = ['red', 'green', 'blue'];\n arr.slice(0); // ['red', 'green', 'blue']\n arr.slice(0, 2); // ['red', 'green']\n arr.slice(1, 100); // ['green', 'blue']\n ```\n\n @method slice\n @param {Integer} beginIndex (Optional) index to begin slicing from.\n @param {Integer} endIndex (Optional) index to end the slice at.\n @return {Array} New array with specified slice\n */\n slice: function(beginIndex, endIndex) {\n var ret = Ember.A([]);\n var length = get(this, 'length') ;\n if (none(beginIndex)) beginIndex = 0 ;\n if (none(endIndex) || (endIndex > length)) endIndex = length ;\n\n if (beginIndex < 0) beginIndex = length + beginIndex;\n if (endIndex < 0) endIndex = length + endIndex;\n\n while(beginIndex < endIndex) {\n ret[ret.length] = this.objectAt(beginIndex++) ;\n }\n return ret ;\n },\n\n /**\n Returns the index of the given object's first occurrence.\n If no `startAt` argument is given, the starting location to\n search is 0. If it's negative, will count backward from\n the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.indexOf(\"a\"); // 0\n arr.indexOf(\"z\"); // -1\n arr.indexOf(\"a\", 2); // 4\n arr.indexOf(\"a\", -1); // 4\n arr.indexOf(\"b\", 3); // -1\n arr.indexOf(\"a\", 100); // -1\n ```\n\n @method indexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n indexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined) startAt = 0;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this.objectAt(idx, true) === object) return idx ;\n }\n return -1;\n },\n\n /**\n Returns the index of the given object's last occurrence.\n If no `startAt` argument is given, the search starts from\n the last position. If it's negative, will count backward\n from the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.lastIndexOf(\"a\"); // 4\n arr.lastIndexOf(\"z\"); // -1\n arr.lastIndexOf(\"a\", 2); // 0\n arr.lastIndexOf(\"a\", -1); // 4\n arr.lastIndexOf(\"b\", 3); // 1\n arr.lastIndexOf(\"a\", 100); // 4\n ```\n\n @method lastIndexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n lastIndexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined || startAt >= len) startAt = len-1;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this.objectAt(idx) === object) return idx ;\n }\n return -1;\n },\n\n // ..........................................................\n // ARRAY OBSERVERS\n //\n\n /**\n Adds an array observer to the receiving array. The array observer object\n normally must implement two methods:\n\n * `arrayWillChange(start, removeCount, addCount)` - This method will be\n called just before the array is modified.\n * `arrayDidChange(start, removeCount, addCount)` - This method will be\n called just after the array is modified.\n\n Both callbacks will be passed the starting index of the change as well a\n a count of the items to be removed and added. You can use these callbacks\n to optionally inspect the array during the change, clear caches, or do\n any other bookkeeping necessary.\n\n In addition to passing a target, you can also include an options hash\n which you can use to override the method names that will be invoked on the\n target.\n\n @method addArrayObserver\n @param {Object} target The observer object.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n addArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.addListener(this, '@array:before', target, willChange);\n Ember.addListener(this, '@array:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Removes an array observer from the object if the observer is current\n registered. Calling this method multiple times with the same object will\n have no effect.\n\n @method removeArrayObserver\n @param {Object} target The object observing the array.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n removeArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.removeListener(this, '@array:before', target, willChange);\n Ember.removeListener(this, '@array:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property Boolean\n */\n hasArrayObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@array:change') || Ember.hasListeners(this, '@array:before');\n }),\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just before the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentWillChange\n @param {Number} startIdx The starting index in the array that will change.\n @param {Number} removeAmt The number of items that will be removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that will be added If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentWillChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n // Make sure the @each proxy is set up if anyone is observing @each\n if (Ember.isWatching(this, '@each')) { get(this, '@each'); }\n\n Ember.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);\n\n var removing, lim;\n if (startIdx>=0 && removeAmt>=0 && get(this, 'hasEnumerableObservers')) {\n removing = [];\n lim = startIdx+removeAmt;\n for(var idx=startIdx;idx<lim;idx++) removing.push(this.objectAt(idx));\n } else {\n removing = removeAmt;\n }\n\n this.enumerableContentWillChange(removing, addAmt);\n\n return this;\n },\n\n arrayContentDidChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n var adding, lim;\n if (startIdx>=0 && addAmt>=0 && get(this, 'hasEnumerableObservers')) {\n adding = [];\n lim = startIdx+addAmt;\n for(var idx=startIdx;idx<lim;idx++) adding.push(this.objectAt(idx));\n } else {\n adding = addAmt;\n }\n\n this.enumerableContentDidChange(removeAmt, adding);\n Ember.sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]);\n\n var length = get(this, 'length'),\n cachedFirst = cacheFor(this, 'firstObject'),\n cachedLast = cacheFor(this, 'lastObject');\n if (this.objectAt(0) !== cachedFirst) {\n Ember.propertyWillChange(this, 'firstObject');\n Ember.propertyDidChange(this, 'firstObject');\n }\n if (this.objectAt(length-1) !== cachedLast) {\n Ember.propertyWillChange(this, 'lastObject');\n Ember.propertyDidChange(this, 'lastObject');\n }\n\n return this;\n },\n\n // ..........................................................\n // ENUMERATED PROPERTIES\n //\n\n /**\n Returns a special object that can be used to observe individual properties\n on the array. Just get an equivalent property on this object and it will\n return an enumerable that maps automatically to the named key on the\n member objects.\n\n @property @each\n */\n '@each': Ember.computed(function() {\n if (!this.__each) this.__each = new Ember.EachProxy(this);\n return this.__each;\n })\n\n}) ;\n\n})();\n//@ sourceURL=ember-runtime/mixins/array");minispade.register('ember-runtime/mixins/comparable', "(function() {minispade.require('ember-runtime/core');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n/**\n Implements some standard methods for comparing objects. Add this mixin to\n any class you create that can compare its instances.\n\n You should implement the `compare()` method.\n\n @class Comparable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Comparable = Ember.Mixin.create( /** @scope Ember.Comparable.prototype */{\n\n /**\n walk like a duck. Indicates that the object can be compared.\n\n @property isComparable\n @type Boolean\n @default true\n */\n isComparable: true,\n\n /**\n Override to return the result of the comparison of the two parameters. The\n compare method should return:\n\n - `-1` if `a < b`\n - `0` if `a == b`\n - `1` if `a > b`\n\n Default implementation raises an exception.\n\n @method compare\n @param a {Object} the first object to compare\n @param b {Object} the second object to compare\n @return {Integer} the result of the comparison\n */\n compare: Ember.required(Function)\n\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/comparable");minispade.register('ember-runtime/mixins/copyable', "(function() {minispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Implements some standard methods for copying an object. Add this mixin to\n any object you create that can create a copy of itself. This mixin is\n added automatically to the built-in array.\n\n You should generally implement the `copy()` method to return a copy of the\n receiver.\n\n Note that `frozenCopy()` will only work if you also implement\n `Ember.Freezable`.\n\n @class Copyable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Copyable = Ember.Mixin.create(\n/** @scope Ember.Copyable.prototype */ {\n\n /**\n Override to return a copy of the receiver. Default implementation raises\n an exception.\n\n @method copy\n @param {Boolean} deep if `true`, a deep copy of the object should be made\n @return {Object} copy of receiver\n */\n copy: Ember.required(Function),\n\n /**\n If the object implements `Ember.Freezable`, then this will return a new\n copy if the object is not frozen and the receiver if the object is frozen.\n\n Raises an exception if you try to call this method on a object that does\n not support freezing.\n\n You should use this method whenever you want a copy of a freezable object\n since a freezable object can simply return itself without actually\n consuming more memory.\n\n @method frozenCopy\n @return {Object} copy of receiver or receiver\n */\n frozenCopy: function() {\n if (Ember.Freezable && Ember.Freezable.detect(this)) {\n return get(this, 'isFrozen') ? this : this.copy().freeze();\n } else {\n throw new Error(Ember.String.fmt(\"%@ does not support freezing\", [this]));\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/copyable");minispade.register('ember-runtime/mixins/deferred', "(function() {var RSVP = requireModule(\"rsvp\");\n\nRSVP.async = function(callback, binding) {\n Ember.run.schedule('actions', binding, callback);\n};\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get;\n\n/**\n @class Deferred\n @namespace Ember\n @extends Ember.Mixin\n */\nEmber.DeferredMixin = Ember.Mixin.create({\n /**\n Add handlers to be called when the Deferred object is resolved or rejected.\n\n @method then\n @param {Function} doneCallback a callback function to be called when done\n @param {Function} failCallback a callback function to be called when failed\n */\n then: function(doneCallback, failCallback) {\n var promise = get(this, 'promise');\n return promise.then.apply(promise, arguments);\n },\n\n /**\n Resolve a Deferred object and call any `doneCallbacks` with the given args.\n\n @method resolve\n */\n resolve: function(value) {\n get(this, 'promise').resolve(value);\n },\n\n /**\n Reject a Deferred object and call any `failCallbacks` with the given args.\n\n @method reject\n */\n reject: function(value) {\n get(this, 'promise').reject(value);\n },\n\n promise: Ember.computed(function() {\n return new RSVP.Promise();\n })\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/deferred");minispade.register('ember-runtime/mixins/enumerable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\nvar a_slice = Array.prototype.slice;\nvar a_indexOf = Ember.EnumerableUtils.indexOf;\n\nvar contexts = [];\n\nfunction popCtx() {\n return contexts.length===0 ? {} : contexts.pop();\n}\n\nfunction pushCtx(ctx) {\n contexts.push(ctx);\n return null;\n}\n\nfunction iter(key, value) {\n var valueProvided = arguments.length === 2;\n\n function i(item) {\n var cur = get(item, key);\n return valueProvided ? value===cur : !!cur;\n }\n return i ;\n}\n\n/**\n This mixin defines the common interface implemented by enumerable objects\n in Ember. Most of these methods follow the standard Array iteration\n API defined up to JavaScript 1.8 (excluding language-specific features that\n cannot be emulated in older versions of JavaScript).\n\n This mixin is applied automatically to the Array class on page load, so you\n can use any of these methods on simple arrays. If Array already implements\n one of these methods, the mixin will not override them.\n\n ## Writing Your Own Enumerable\n\n To make your own custom class enumerable, you need two items:\n\n 1. You must have a length property. This property should change whenever\n the number of items in your enumerable object changes. If you using this\n with an `Ember.Object` subclass, you should be sure to change the length\n property using `set().`\n\n 2. If you must implement `nextObject().` See documentation.\n\n Once you have these two methods implement, apply the `Ember.Enumerable` mixin\n to your class and you will be able to enumerate the contents of your object\n like any other collection.\n\n ## Using Ember Enumeration with Other Libraries\n\n Many other libraries provide some kind of iterator or enumeration like\n facility. This is often where the most common API conflicts occur.\n Ember's API is designed to be as friendly as possible with other\n libraries by implementing only methods that mostly correspond to the\n JavaScript 1.8 API.\n\n @class Enumerable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Enumerable = Ember.Mixin.create({\n\n // compatibility\n isEnumerable: true,\n\n /**\n Implement this method to make your class enumerable.\n\n This method will be call repeatedly during enumeration. The index value\n will always begin with 0 and increment monotonically. You don't have to\n rely on the index value to determine what object to return, but you should\n always check the value and start from the beginning when you see the\n requested index is 0.\n\n The `previousObject` is the object that was returned from the last call\n to `nextObject` for the current iteration. This is a useful way to\n manage iteration if you are tracing a linked list, for example.\n\n Finally the context parameter will always contain a hash you can use as\n a \"scratchpad\" to maintain any other state you need in order to iterate\n properly. The context object is reused and is not reset between\n iterations so make sure you setup the context with a fresh state whenever\n the index parameter is 0.\n\n Generally iterators will continue to call `nextObject` until the index\n reaches the your current length-1. If you run out of data before this\n time for some reason, you should simply return undefined.\n\n The default implementation of this method simply looks up the index.\n This works great on any Array-like objects.\n\n @method nextObject\n @param {Number} index the current index of the iteration\n @param {Object} previousObject the value returned by the last call to\n `nextObject`.\n @param {Object} context a context object you can use to maintain state.\n @return {Object} the next object in the iteration or undefined\n */\n nextObject: Ember.required(Function),\n\n /**\n Helper method returns the first object from a collection. This is usually\n used by bindings and other parts of the framework to extract a single\n object if the enumerable contains only one item.\n\n If you override this method, you should implement it so that it will\n always return the same value each time it is called. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('firstObject'); // \"a\"\n\n var arr = [];\n arr.get('firstObject'); // undefined\n ```\n\n @property firstObject\n @return {Object} the object or undefined\n */\n firstObject: Ember.computed(function() {\n if (get(this, 'length')===0) return undefined ;\n\n // handle generic enumerables\n var context = popCtx(), ret;\n ret = this.nextObject(0, null, context);\n pushCtx(context);\n return ret ;\n }).property('[]'),\n\n /**\n Helper method returns the last object from a collection. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('lastObject'); // \"c\"\n\n var arr = [];\n arr.get('lastObject'); // undefined\n ```\n\n @property lastObject\n @return {Object} the last object or undefined\n */\n lastObject: Ember.computed(function() {\n var len = get(this, 'length');\n if (len===0) return undefined ;\n var context = popCtx(), idx=0, cur, last = null;\n do {\n last = cur;\n cur = this.nextObject(idx++, last, context);\n } while (cur !== undefined);\n pushCtx(context);\n return last;\n }).property('[]'),\n\n /**\n Returns `true` if the passed object can be found in the receiver. The\n default version will iterate through the enumerable until the object\n is found. You may want to override this with a more efficient version.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.contains(\"a\"); // true\n arr.contains(\"z\"); // false\n ```\n\n @method contains\n @param {Object} obj The object to search for.\n @return {Boolean} `true` if object is found in enumerable.\n */\n contains: function(obj) {\n return this.find(function(item) { return item===obj; }) !== undefined;\n },\n\n /**\n Iterates through the enumerable, calling the passed function on each\n item. This method corresponds to the `forEach()` method defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method forEach\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} receiver\n */\n forEach: function(callback, target) {\n if (typeof callback !== \"function\") throw new TypeError() ;\n var len = get(this, 'length'), last = null, context = popCtx();\n\n if (target === undefined) target = null;\n\n for(var idx=0;idx<len;idx++) {\n var next = this.nextObject(idx, last, context) ;\n callback.call(target, next, idx, this);\n last = next ;\n }\n last = null ;\n context = pushCtx(context);\n return this ;\n },\n\n /**\n Alias for `mapProperty`\n\n @method getEach\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n getEach: function(key) {\n return this.mapProperty(key);\n },\n\n /**\n Sets the value on the named property for each member. This is more\n efficient than using other methods defined on this helper. If the object\n implements Ember.Observable, the value will be changed to `set(),` otherwise\n it will be set directly. `null` objects are skipped.\n\n @method setEach\n @param {String} key The key to set\n @param {Object} value The object to set\n @return {Object} receiver\n */\n setEach: function(key, value) {\n return this.forEach(function(item) {\n set(item, key, value);\n });\n },\n\n /**\n Maps all of the items in the enumeration to another value, returning\n a new array. This method corresponds to `map()` defined in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the mapped value.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method map\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} The mapped array.\n */\n map: function(callback, target) {\n var ret = Ember.A([]);\n this.forEach(function(x, idx, i) {\n ret[idx] = callback.call(target, x, idx,i);\n });\n return ret ;\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapProperty\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n mapProperty: function(key) {\n return this.map(function(next) {\n return get(next, key);\n });\n },\n\n /**\n Returns an array with all of the items in the enumeration that the passed\n function returns true for. This method corresponds to `filter()` defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method filter\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A filtered array.\n */\n filter: function(callback, target) {\n var ret = Ember.A([]);\n this.forEach(function(x, idx, i) {\n if (callback.call(target, x, idx, i)) ret.push(x);\n });\n return ret ;\n },\n\n /**\n Returns an array with all of the items in the enumeration where the passed\n function returns false for. This method is the inverse of filter().\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n function(item, index, enumerable);\n\n - *item* is the current item in the iteration.\n - *index* is the current index in the iteration\n - *enumerable* is the enumerable object itself.\n\n It should return the a falsey value to include the item in the results.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as \"this\" on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method reject\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A rejected array.\n */\n reject: function(callback, target) {\n return this.filter(function() {\n return !(callback.apply(target, arguments));\n });\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} filtered array\n */\n filterProperty: function(key, value) {\n return this.filter(iter.apply(this, arguments));\n },\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n */\n rejectProperty: function(key, value) {\n var exactValue = function(item) { return get(item, key) === value; },\n hasValue = function(item) { return !!get(item, key); },\n use = (arguments.length === 2 ? exactValue : hasValue);\n\n return this.reject(use);\n },\n\n /**\n Returns the first item in the array for which the callback returns true.\n This method works similar to the `filter()` method defined in JavaScript 1.6\n except that it will stop working on the array once a match is found.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method find\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} Found item or `undefined`.\n */\n find: function(callback, target) {\n var len = get(this, 'length') ;\n if (target === undefined) target = null;\n\n var last = null, next, found = false, ret ;\n var context = popCtx();\n for(var idx=0;idx<len && !found;idx++) {\n next = this.nextObject(idx, last, context) ;\n if (found = callback.call(target, next, idx, this)) ret = next ;\n last = next ;\n }\n next = last = null ;\n context = pushCtx(context);\n return ret ;\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n */\n findProperty: function(key, value) {\n return this.find(iter.apply(this, arguments));\n },\n\n /**\n Returns `true` if the passed function returns true for every item in the\n enumeration. This corresponds with the `every()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` or `false`.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Example Usage:\n\n ```javascript\n if (people.every(isEngineer)) { Paychecks.addBigBonus(); }\n ```\n\n @method every\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean}\n */\n every: function(callback, target) {\n return !this.find(function(x, idx, i) {\n return !callback.call(target, x, idx, i);\n });\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for all items in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method everyProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean}\n */\n everyProperty: function(key, value) {\n return this.every(iter.apply(this, arguments));\n },\n\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.some(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method some\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A filtered array.\n */\n some: function(callback, target) {\n return !!this.find(function(x, idx, i) {\n return !!callback.call(target, x, idx, i);\n });\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for any item in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method someProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true`\n */\n someProperty: function(key, value) {\n return this.some(iter.apply(this, arguments));\n },\n\n /**\n This will combine the values of the enumerator into a single value. It\n is a useful way to collect a summary value from an enumeration. This\n corresponds to the `reduce()` method defined in JavaScript 1.8.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(previousValue, item, index, enumerable);\n ```\n\n - `previousValue` is the value returned by the last call to the iterator.\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Return the new cumulative value.\n\n In addition to the callback you can also pass an `initialValue`. An error\n will be raised if you do not pass an initial value and the enumerator is\n empty.\n\n Note that unlike the other methods, this method does not allow you to\n pass a target object to set as this for the callback. It's part of the\n spec. Sorry.\n\n @method reduce\n @param {Function} callback The callback to execute\n @param {Object} initialValue Initial value for the reduce\n @param {String} reducerProperty internal use only.\n @return {Object} The reduced value.\n */\n reduce: function(callback, initialValue, reducerProperty) {\n if (typeof callback !== \"function\") { throw new TypeError(); }\n\n var ret = initialValue;\n\n this.forEach(function(item, i) {\n ret = callback.call(null, ret, item, i, this, reducerProperty);\n }, this);\n\n return ret;\n },\n\n /**\n Invokes the named method on every object in the receiver that\n implements it. This method corresponds to the implementation in\n Prototype 1.6.\n\n @method invoke\n @param {String} methodName the name of the method\n @param {Object...} args optional arguments to pass as well.\n @return {Array} return values from calling invoke.\n */\n invoke: function(methodName) {\n var args, ret = Ember.A([]);\n if (arguments.length>1) args = a_slice.call(arguments, 1);\n\n this.forEach(function(x, idx) {\n var method = x && x[methodName];\n if ('function' === typeof method) {\n ret[idx] = args ? method.apply(x, args) : method.call(x);\n }\n }, this);\n\n return ret;\n },\n\n /**\n Simply converts the enumerable into a genuine array. The order is not\n guaranteed. Corresponds to the method implemented by Prototype.\n\n @method toArray\n @return {Array} the enumerable as an array.\n */\n toArray: function() {\n var ret = Ember.A([]);\n this.forEach(function(o, idx) { ret[idx] = o; });\n return ret ;\n },\n\n /**\n Returns a copy of the array with all null elements removed.\n\n ```javascript\n var arr = [\"a\", null, \"c\", null];\n arr.compact(); // [\"a\", \"c\"]\n ```\n\n @method compact\n @return {Array} the array without null elements.\n */\n compact: function() { return this.without(null); },\n\n /**\n Returns a new enumerable that excludes the passed value. The default\n implementation returns an array regardless of the receiver type unless\n the receiver does not contain the value.\n\n ```javascript\n var arr = [\"a\", \"b\", \"a\", \"c\"];\n arr.without(\"a\"); // [\"b\", \"c\"]\n ```\n\n @method without\n @param {Object} value\n @return {Ember.Enumerable}\n */\n without: function(value) {\n if (!this.contains(value)) return this; // nothing to do\n var ret = Ember.A([]);\n this.forEach(function(k) {\n if (k !== value) ret[ret.length] = k;\n }) ;\n return ret ;\n },\n\n /**\n Returns a new enumerable that contains only unique values. The default\n implementation returns an array regardless of the receiver type.\n\n ```javascript\n var arr = [\"a\", \"a\", \"b\", \"b\"];\n arr.uniq(); // [\"a\", \"b\"]\n ```\n\n @method uniq\n @return {Ember.Enumerable}\n */\n uniq: function() {\n var ret = Ember.A([]);\n this.forEach(function(k){\n if (a_indexOf(ret, k)<0) ret.push(k);\n });\n return ret;\n },\n\n /**\n This property will trigger anytime the enumerable's content changes.\n You can observe this property to be notified of changes to the enumerables\n content.\n\n For plain enumerables, this property is read only. `Ember.Array` overrides\n this method.\n\n @property []\n @type Ember.Array\n */\n '[]': Ember.computed(function(key, value) {\n return this;\n }),\n\n // ..........................................................\n // ENUMERABLE OBSERVERS\n //\n\n /**\n Registers an enumerable observer. Must implement `Ember.EnumerableObserver`\n mixin.\n\n @method addEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n */\n addEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.addListener(this, '@enumerable:before', target, willChange);\n Ember.addListener(this, '@enumerable:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Removes a registered enumerable observer.\n\n @method removeEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n */\n removeEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.removeListener(this, '@enumerable:before', target, willChange);\n Ember.removeListener(this, '@enumerable:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property hasEnumerableObservers\n @type Boolean\n */\n hasEnumerableObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@enumerable:change') || Ember.hasListeners(this, '@enumerable:before');\n }),\n\n\n /**\n Invoke this method just before the contents of your enumerable will\n change. You can either omit the parameters completely or pass the objects\n to be removed or added if available or just a count.\n\n @method enumerableContentWillChange\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to be\n added or the number of items to be added.\n @chainable\n */\n enumerableContentWillChange: function(removing, adding) {\n\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding,'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.propertyWillChange(this, '[]');\n if (hasDelta) Ember.propertyWillChange(this, 'length');\n Ember.sendEvent(this, '@enumerable:before', [this, removing, adding]);\n\n return this;\n },\n\n /**\n Invoke this method when the contents of your enumerable has changed.\n This will notify any observers watching for content changes. If your are\n implementing an ordered enumerable (such as an array), also pass the\n start and end values where the content changed so that it can be used to\n notify range observers.\n\n @method enumerableContentDidChange\n @param {Number} [start] optional start offset for the content change.\n For unordered enumerables, you should always pass -1.\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to\n be added or the number of items to be added.\n @chainable\n */\n enumerableContentDidChange: function(removing, adding) {\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding, 'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.sendEvent(this, '@enumerable:change', [this, removing, adding]);\n if (hasDelta) Ember.propertyDidChange(this, 'length');\n Ember.propertyDidChange(this, '[]');\n\n return this ;\n }\n\n}) ;\n\n})();\n//@ sourceURL=ember-runtime/mixins/enumerable");minispade.register('ember-runtime/mixins/evented', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n This mixin allows for Ember objects to subscribe to and emit events.\n\n ```javascript\n App.Person = Ember.Object.extend(Ember.Evented, {\n greet: function() {\n // ...\n this.trigger('greet');\n }\n });\n\n var person = App.Person.create();\n\n person.on('greet', function() {\n console.log('Our person has greeted');\n });\n\n person.greet();\n\n // outputs: 'Our person has greeted'\n ```\n\n You can also chain multiple event subscriptions:\n\n ```javascript\n person.on('greet', function() {\n console.log('Our person has greeted');\n }).one('greet', function() {\n console.log('Offer one-time special');\n }).off('event', this, forgetThis);\n ```\n\n @class Evented\n @namespace Ember\n @extends Ember.Mixin\n */\nEmber.Evented = Ember.Mixin.create({\n\n /**\n Subscribes to a named event with given function.\n\n ```javascript\n person.on('didLoad', function() {\n // fired once the person has loaded\n });\n ```\n\n An optional target can be passed in as the 2nd argument that will\n be set as the \"this\" for the callback. This is a good way to give your\n function access to the object triggering the event. When the target\n parameter is used the callback becomes the third argument.\n\n @method on\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n */\n on: function(name, target, method) {\n Ember.addListener(this, name, target, method);\n return this;\n },\n\n /**\n Subscribes a function to a named event and then cancels the subscription\n after the first time the event is triggered. It is good to use ``one`` when\n you only care about the first time an event has taken place.\n\n This function takes an optional 2nd argument that will become the \"this\"\n value for the callback. If this argument is passed then the 3rd argument\n becomes the function.\n\n @method one\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n */\n one: function(name, target, method) {\n if (!method) {\n method = target;\n target = null;\n }\n\n Ember.addListener(this, name, target, method, true);\n return this;\n },\n\n /**\n Triggers a named event for the object. Any additional arguments\n will be passed as parameters to the functions that are subscribed to the\n event.\n\n ```javascript\n person.on('didEat', function(food) {\n console.log('person ate some ' + food);\n });\n\n person.trigger('didEat', 'broccoli');\n\n // outputs: person ate some broccoli\n ```\n @method trigger\n @param {String} name The name of the event\n @param {Object...} args Optional arguments to pass on\n */\n trigger: function(name) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n Ember.sendEvent(this, name, args);\n },\n\n fire: function(name) {\n Ember.deprecate(\"Ember.Evented#fire() has been deprecated in favor of trigger() for compatibility with jQuery. It will be removed in 1.0. Please update your code to call trigger() instead.\");\n this.trigger.apply(this, arguments);\n },\n\n /**\n Cancels subscription for give name, target, and method.\n\n @method off\n @param {String} name The name of the event\n @param {Object} target The target of the subscription\n @param {Function} method The function of the subscription\n */\n off: function(name, target, method) {\n Ember.removeListener(this, name, target, method);\n return this;\n },\n\n /**\n Checks to see if object has any subscriptions for named event.\n\n @method has\n @param {String} name The name of the event\n @return {Boolean} does the object have a subscription for event\n */\n has: function(name) {\n return Ember.hasListeners(this, name);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/evented");minispade.register('ember-runtime/mixins/freezable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.Freezable` mixin implements some basic methods for marking an\n object as frozen. Once an object is frozen it should be read only. No changes\n may be made the internal state of the object.\n\n ## Enforcement\n\n To fully support freezing in your subclass, you must include this mixin and\n override any method that might alter any property on the object to instead\n raise an exception. You can check the state of an object by checking the\n `isFrozen` property.\n\n Although future versions of JavaScript may support language-level freezing\n object objects, that is not the case today. Even if an object is freezable,\n it is still technically possible to modify the object, even though it could\n break other parts of your application that do not expect a frozen object to\n change. It is, therefore, very important that you always respect the\n `isFrozen` property on all freezable objects.\n\n ## Example Usage\n\n The example below shows a simple object that implement the `Ember.Freezable`\n protocol.\n\n ```javascript\n Contact = Ember.Object.extend(Ember.Freezable, {\n firstName: null,\n lastName: null,\n\n // swaps the names\n swapNames: function() {\n if (this.get('isFrozen')) throw Ember.FROZEN_ERROR;\n var tmp = this.get('firstName');\n this.set('firstName', this.get('lastName'));\n this.set('lastName', tmp);\n return this;\n }\n\n });\n\n c = Context.create({ firstName: \"John\", lastName: \"Doe\" });\n c.swapNames(); // returns c\n c.freeze();\n c.swapNames(); // EXCEPTION\n ```\n\n ## Copying\n\n Usually the `Ember.Freezable` protocol is implemented in cooperation with the\n `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will\n return a frozen object, if the object implements this method as well.\n\n @class Freezable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Freezable = Ember.Mixin.create(\n/** @scope Ember.Freezable.prototype */ {\n\n /**\n Set to `true` when the object is frozen. Use this property to detect\n whether your object is frozen or not.\n\n @property isFrozen\n @type Boolean\n */\n isFrozen: false,\n\n /**\n Freezes the object. Once this method has been called the object should\n no longer allow any properties to be edited.\n\n @method freeze\n @return {Object} receiver\n */\n freeze: function() {\n if (get(this, 'isFrozen')) return this;\n set(this, 'isFrozen', true);\n return this;\n }\n\n});\n\nEmber.FROZEN_ERROR = \"Frozen object cannot be modified.\";\n\n})();\n//@ sourceURL=ember-runtime/mixins/freezable");minispade.register('ember-runtime/mixins/mutable_array', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\nminispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\n\n// ..........................................................\n// CONSTANTS\n//\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\" ;\nvar EMPTY = [];\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n This mixin defines the API for modifying array-like objects. These methods\n can be applied only to a collection that keeps its items in an ordered set.\n\n Note that an Array can change even if it does not implement this mixin.\n For example, one might implement a SparseArray that cannot be directly\n modified, but if its underlying enumerable changes, it will change also.\n\n @class MutableArray\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.Array\n @uses Ember.MutableEnumerable\n*/\nEmber.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,\n /** @scope Ember.MutableArray.prototype */ {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n You should replace amt objects started at idx with the objects in the\n passed array. You should also call `this.enumerableContentDidChange()`\n\n @method replace\n @param {Number} idx Starting index in the array to replace. If\n idx >= length, then append to the end of the array.\n @param {Number} amt Number of elements that should be removed from\n the array, starting at *idx*.\n @param {Array} objects An array of zero or more objects that should be\n inserted into the array at *idx*\n */\n replace: Ember.required(),\n\n /**\n Remove all elements from self. This is useful if you\n want to reuse an existing array without having to recreate it.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n color.length(); // 3\n colors.clear(); // []\n colors.length(); // 0\n ```\n\n @method clear\n @return {Ember.Array} An empty Array.\n */\n clear: function () {\n var len = get(this, 'length');\n if (len === 0) return this;\n this.replace(0, len, EMPTY);\n return this;\n },\n\n /**\n This will use the primitive `replace()` method to insert an object at the\n specified index.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.insertAt(2, \"yellow\"); // [\"red\", \"green\", \"yellow\", \"blue\"]\n colors.insertAt(5, \"orange\"); // Error: Index out of range\n ```\n\n @method insertAt\n @param {Number} idx index of insert the object at.\n @param {Object} object object to insert\n */\n insertAt: function(idx, object) {\n if (idx > get(this, 'length')) throw new Error(OUT_OF_RANGE_EXCEPTION) ;\n this.replace(idx, 0, [object]) ;\n return this ;\n },\n\n /**\n Remove an object at the specified index using the `replace()` primitive\n method. You can pass either a single index, or a start and a length.\n\n If you pass a start and length that is beyond the\n length this method will throw an `Ember.OUT_OF_RANGE_EXCEPTION`\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\", \"yellow\", \"orange\"];\n colors.removeAt(0); // [\"green\", \"blue\", \"yellow\", \"orange\"]\n colors.removeAt(2, 2); // [\"green\", \"blue\"]\n colors.removeAt(4, 2); // Error: Index out of range\n ```\n\n @method removeAt\n @param {Number} start index, start of range\n @param {Number} len length of passing range\n @return {Object} receiver\n */\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n // fast case\n if (len === undefined) len = 1;\n this.replace(start, len, EMPTY);\n }\n\n return this ;\n },\n\n /**\n Push the object onto the end of the array. Works just like `push()` but it\n is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObject(\"black\"); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObject([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", [\"yellow\", \"orange\"]]\n ```\n\n @method pushObject\n @param {anything} obj object to push\n */\n pushObject: function(obj) {\n this.insertAt(get(this, 'length'), obj) ;\n return obj ;\n },\n\n /**\n Add the objects in the passed numerable to the end of the array. Defers\n notifying observers of the change until all objects are added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObjects(\"black\"); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObjects([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", \"yellow\", \"orange\"]\n ```\n\n @method pushObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n pushObjects: function(objects) {\n this.replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n /**\n Pop object from array or nil if none are left. Works just like `pop()` but\n it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.popObject(); // \"blue\"\n console.log(colors); // [\"red\", \"green\"]\n ```\n\n @method popObject\n @return object\n */\n popObject: function() {\n var len = get(this, 'length') ;\n if (len === 0) return null ;\n\n var ret = this.objectAt(len-1) ;\n this.removeAt(len-1, 1) ;\n return ret ;\n },\n\n /**\n Shift an object from start of array or nil if none are left. Works just\n like `shift()` but it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.shiftObject(); // \"red\"\n console.log(colors); // [\"green\", \"blue\"]\n ```\n\n @method shiftObject\n @return object\n */\n shiftObject: function() {\n if (get(this, 'length') === 0) return null ;\n var ret = this.objectAt(0) ;\n this.removeAt(0) ;\n return ret ;\n },\n\n /**\n Unshift an object to start of array. Works just like `unshift()` but it is\n KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObject(\"yellow\"); // [\"yellow\", \"red\", \"green\", \"blue\"]\n colors.unshiftObject([\"black\", \"white\"]); // [[\"black\", \"white\"], \"yellow\", \"red\", \"green\", \"blue\"]\n ```\n\n @method unshiftObject\n @param {anything} obj object to unshift\n */\n unshiftObject: function(obj) {\n this.insertAt(0, obj) ;\n return obj ;\n },\n\n /**\n Adds the named objects to the beginning of the array. Defers notifying\n observers until all objects have been added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObjects([\"black\", \"white\"]); // [\"black\", \"white\", \"red\", \"green\", \"blue\"]\n colors.unshiftObjects(\"yellow\"); // Type Error: 'undefined' is not a function\n ```\n\n @method unshiftObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n unshiftObjects: function(objects) {\n this.replace(0, 0, objects);\n return this;\n },\n\n /**\n Reverse objects in the array. Works just like `reverse()` but it is\n KVO-compliant.\n\n @method reverseObjects\n @return {Ember.Array} receiver\n */\n reverseObjects: function() {\n var len = get(this, 'length');\n if (len === 0) return this;\n var objects = this.toArray().reverse();\n this.replace(0, len, objects);\n return this;\n },\n\n /**\n Replace all the the receiver's content with content of the argument.\n If argument is an empty array receiver will be cleared.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.setObjects([\"black\", \"white\"]); // [\"black\", \"white\"]\n colors.setObjects([]); // []\n ```\n\n @method setObjects\n @param {Ember.Array} objects array whose content will be used for replacing\n the content of the receiver\n @return {Ember.Array} receiver with the new content\n */\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this.replace(0, len, objects);\n return this;\n },\n\n // ..........................................................\n // IMPLEMENT Ember.MutableEnumerable\n //\n\n removeObject: function(obj) {\n var loc = get(this, 'length') || 0;\n while(--loc >= 0) {\n var curObject = this.objectAt(loc) ;\n if (curObject === obj) this.removeAt(loc) ;\n }\n return this ;\n },\n\n addObject: function(obj) {\n if (!this.contains(obj)) this.pushObject(obj);\n return this ;\n }\n\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_array");minispade.register('ember-runtime/mixins/mutable_enumerable', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar forEach = Ember.EnumerableUtils.forEach;\n\n/**\n This mixin defines the API for modifying generic enumerables. These methods\n can be applied to an object regardless of whether it is ordered or\n unordered.\n\n Note that an Enumerable can change even if it does not implement this mixin.\n For example, a MappedEnumerable cannot be directly modified but if its\n underlying enumerable changes, it will change also.\n\n ## Adding Objects\n\n To add an object to an enumerable, use the `addObject()` method. This\n method will only add the object to the enumerable if the object is not\n already present and the object if of a type supported by the enumerable.\n\n ```javascript\n set.addObject(contact);\n ```\n\n ## Removing Objects\n\n To remove an object form an enumerable, use the `removeObject()` method. This\n will only remove the object if it is already in the enumerable, otherwise\n this method has no effect.\n\n ```javascript\n set.removeObject(contact);\n ```\n\n ## Implementing In Your Own Code\n\n If you are implementing an object and want to support this API, just include\n this mixin in your class and implement the required methods. In your unit\n tests, be sure to apply the Ember.MutableEnumerableTests to your object.\n\n @class MutableEnumerable\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.Enumerable\n*/\nEmber.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable, {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to add the passed object to the receiver if the object is not\n already present in the collection. If the object is present, this method\n has no effect.\n\n If the passed object is of a type not supported by the receiver\n then this method should raise an exception.\n\n @method addObject\n @param {Object} object The object to add to the enumerable.\n @return {Object} the passed object\n */\n addObject: Ember.required(Function),\n\n /**\n Adds each object in the passed enumerable to the receiver.\n\n @method addObjects\n @param {Ember.Enumerable} objects the objects to add.\n @return {Object} receiver\n */\n addObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.addObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n },\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to remove the passed object from the receiver collection if the\n object is in present in the collection. If the object is not present,\n this method has no effect.\n\n If the passed object is of a type not supported by the receiver\n then this method should raise an exception.\n\n @method removeObject\n @param {Object} object The object to remove from the enumerable.\n @return {Object} the passed object\n */\n removeObject: Ember.required(Function),\n\n\n /**\n Removes each objects in the passed enumerable from the receiver.\n\n @method removeObjects\n @param {Ember.Enumerable} objects the objects to remove\n @return {Object} receiver\n */\n removeObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.removeObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_enumerable");minispade.register('ember-runtime/mixins/observable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n ## Overview\n\n This mixin provides properties and property observing functionality, core\n features of the Ember object model.\n\n Properties and observers allow one object to observe changes to a\n property on another object. This is one of the fundamental ways that\n models, controllers and views communicate with each other in an Ember\n application.\n\n Any object that has this mixin applied can be used in observer\n operations. That includes `Ember.Object` and most objects you will\n interact with as you write your Ember application.\n\n Note that you will not generally apply this mixin to classes yourself,\n but you will use the features provided by this module frequently, so it\n is important to understand how to use it.\n\n ## Using `get()` and `set()`\n\n Because of Ember's support for bindings and observers, you will always\n access properties using the get method, and set properties using the\n set method. This allows the observing objects to be notified and\n computed properties to be handled properly.\n\n More documentation about `get` and `set` are below.\n\n ## Observing Property Changes\n\n You typically observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.create({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n Although this is the most common way to add an observer, this capability\n is actually built into the `Ember.Object` class on top of two methods\n defined in this mixin: `addObserver` and `removeObserver`. You can use\n these two methods to add and remove observers yourself if you need to\n do so at runtime.\n\n To add an observer for a property, call:\n\n ```javascript\n object.addObserver('propertyKey', targetObject, targetAction)\n ```\n\n This will call the `targetAction` method on the `targetObject` to be called\n whenever the value of the `propertyKey` changes.\n\n Note that if `propertyKey` is a computed property, the observer will be\n called when any of the property dependencies are changed, even if the\n resulting value of the computed property is unchanged. This is necessary\n because computed properties are not computed until `get` is called.\n\n @class Observable\n @namespace Ember\n @extends Ember.Mixin\n*/\nEmber.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {\n\n /**\n Retrieves the value of a property from the object.\n\n This method is usually similar to using `object[keyName]` or `object.keyName`,\n however it supports both computed properties and the unknownProperty\n handler.\n\n Because `get` unifies the syntax for accessing all these kinds\n of properties, it can make many refactorings easier, such as replacing a\n simple property with a computed property, or vice versa.\n\n ### Computed Properties\n\n Computed properties are methods defined with the `property` modifier\n declared at the end, such as:\n\n ```javascript\n fullName: function() {\n return this.getEach('firstName', 'lastName').compact().join(' ');\n }.property('firstName', 'lastName')\n ```\n\n When you call `get` on a computed property, the function will be\n called and the return value will be returned instead of the function\n itself.\n\n ### Unknown Properties\n\n Likewise, if you try to call `get` on a property whose value is\n `undefined`, the `unknownProperty()` method will be called on the object.\n If this method returns any value other than `undefined`, it will be returned\n instead. This allows you to implement \"virtual\" properties that are\n not defined upfront.\n\n @method get\n @param {String} keyName The property to retrieve\n @return {Object} The property value or undefined.\n */\n get: function(keyName) {\n return get(this, keyName);\n },\n\n /**\n To get multiple properties at once, call `getProperties`\n with a list of strings or an array:\n\n ```javascript\n record.getProperties('firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n record.getProperties(['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param {String...|Array} list of keys to get\n @return {Hash}\n */\n getProperties: function() {\n var ret = {};\n var propertyNames = arguments;\n if (arguments.length === 1 && Ember.typeOf(arguments[0]) === 'array') {\n propertyNames = arguments[0];\n }\n for(var i = 0; i < propertyNames.length; i++) {\n ret[propertyNames[i]] = get(this, propertyNames[i]);\n }\n return ret;\n },\n\n /**\n Sets the provided key or path to the value.\n\n This method is generally very similar to calling `object[key] = value` or\n `object.key = value`, except that it provides support for computed\n properties, the `unknownProperty()` method and property observers.\n\n ### Computed Properties\n\n If you try to set a value on a key that has a computed property handler\n defined (see the `get()` method for an example), then `set()` will call\n that method, passing both the value and key instead of simply changing\n the value itself. This is useful for those times when you need to\n implement a property that is composed of one or more member\n properties.\n\n ### Unknown Properties\n\n If you try to set a value on a key that is undefined in the target\n object, then the `unknownProperty()` handler will be called instead. This\n gives you an opportunity to implement complex \"virtual\" properties that\n are not predefined on the object. If `unknownProperty()` returns\n undefined, then `set()` will simply set the value on the object.\n\n ### Property Observers\n\n In addition to changing the property, `set()` will also register a property\n change with the object. Unless you have placed this call inside of a\n `beginPropertyChanges()` and `endPropertyChanges(),` any \"local\" observers\n (i.e. observer methods declared on the same object), will be called\n immediately. Any \"remote\" observers (i.e. observer methods declared on\n another object) will be placed in a queue and called at a later time in a\n coalesced manner.\n\n ### Chaining\n\n In addition to property changes, `set()` returns the value of the object\n itself so you can do chaining like this:\n\n ```javascript\n record.set('firstName', 'Charles').set('lastName', 'Jolley');\n ```\n\n @method set\n @param {String} keyName The property to set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n set: function(keyName, value) {\n set(this, keyName, value);\n return this;\n },\n\n /**\n To set multiple properties at once, call `setProperties`\n with a Hash:\n\n ```javascript\n record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });\n ```\n\n @method setProperties\n @param {Hash} hash the hash of keys and values to set\n @return {Ember.Observable}\n */\n setProperties: function(hash) {\n return Ember.setProperties(this, hash);\n },\n\n /**\n Begins a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call this\n method at the beginning of the changes to begin deferring change\n notifications. When you are done making changes, call\n `endPropertyChanges()` to deliver the deferred change notifications and end\n deferring.\n\n @method beginPropertyChanges\n @return {Ember.Observable}\n */\n beginPropertyChanges: function() {\n Ember.beginPropertyChanges();\n return this;\n },\n\n /**\n Ends a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call\n `beginPropertyChanges()` at the beginning of the changes to defer change\n notifications. When you are done making changes, call this method to\n deliver the deferred change notifications and end deferring.\n\n @method endPropertyChanges\n @return {Ember.Observable}\n */\n endPropertyChanges: function() {\n Ember.endPropertyChanges();\n return this;\n },\n\n /**\n Notify the observer system that a property is about to change.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyDidChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyWillChange\n @param {String} keyName The property key that is about to change.\n @return {Ember.Observable}\n */\n propertyWillChange: function(keyName){\n Ember.propertyWillChange(this, keyName);\n return this;\n },\n\n /**\n Notify the observer system that a property has just changed.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyWillChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyDidChange\n @param {String} keyName The property key that has just changed.\n @return {Ember.Observable}\n */\n propertyDidChange: function(keyName) {\n Ember.propertyDidChange(this, keyName);\n return this;\n },\n\n /**\n Convenience method to call `propertyWillChange` and `propertyDidChange` in\n succession.\n\n @method notifyPropertyChange\n @param {String} keyName The property key to be notified about.\n @return {Ember.Observable}\n */\n notifyPropertyChange: function(keyName) {\n this.propertyWillChange(keyName);\n this.propertyDidChange(keyName);\n return this;\n },\n\n addBeforeObserver: function(key, target, method) {\n Ember.addBeforeObserver(this, key, target, method);\n },\n\n /**\n Adds an observer on a property.\n\n This is the core method used to register an observer for a property.\n\n Once you call this method, anytime the key's value is set, your observer\n will be notified. Note that the observers are triggered anytime the\n value is set, regardless of whether it has actually changed. Your\n observer should be prepared to handle that.\n\n You can also pass an optional context parameter to this method. The\n context will be passed to your observer method whenever it is triggered.\n Note that if you add the same target/method pair on a key multiple times\n with different context parameters, your observer will only be called once\n with the last context you passed.\n\n ### Observer Methods\n\n Observer methods you pass should generally have the following signature if\n you do not pass a `context` parameter:\n\n ```javascript\n fooDidChange: function(sender, key, value, rev) { };\n ```\n\n The sender is the object that changed. The key is the property that\n changes. The value property is currently reserved and unused. The rev\n is the last property revision of the object when it changed, which you can\n use to detect if the key value has really changed or not.\n\n If you pass a `context` parameter, the context will be passed before the\n revision like so:\n\n ```javascript\n fooDidChange: function(sender, key, value, context, rev) { };\n ```\n\n Usually you will not need the value, context or revision parameters at\n the end. In this case, it is common to write observer methods that take\n only a sender and key value as parameters or, if you aren't interested in\n any of these values, to write an observer that has no parameters at all.\n\n @method addObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Object} self\n */\n addObserver: function(key, target, method) {\n Ember.addObserver(this, key, target, method);\n },\n\n /**\n Remove an observer you have previously registered on this object. Pass\n the same key, target, and method you passed to `addObserver()` and your\n target will no longer receive notifications.\n\n @method removeObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Observable} receiver\n */\n removeObserver: function(key, target, method) {\n Ember.removeObserver(this, key, target, method);\n },\n\n /**\n Returns `true` if the object currently has observers registered for a\n particular key. You can use this method to potentially defer performing\n an expensive action until someone begins observing a particular property\n on the object.\n\n @method hasObserverFor\n @param {String} key Key to check\n @return {Boolean}\n */\n hasObserverFor: function(key) {\n return Ember.hasListeners(this, key+':change');\n },\n\n /**\n @deprecated\n @method getPath\n @param {String} path The property path to retrieve\n @return {Object} The property value or undefined.\n */\n getPath: function(path) {\n Ember.deprecate(\"getPath is deprecated since get now supports paths\");\n return this.get(path);\n },\n\n /**\n @deprecated\n @method setPath\n @param {String} path The path to the property that will be set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n setPath: function(path, value) {\n Ember.deprecate(\"setPath is deprecated since set now supports paths\");\n return this.set(path, value);\n },\n\n /**\n Retrieves the value of a property, or a default value in the case that the\n property returns `undefined`.\n\n ```javascript\n person.getWithDefault('lastName', 'Doe');\n ```\n\n @method getWithDefault\n @param {String} keyName The name of the property to retrieve\n @param {Object} defaultValue The value to return if the property value is undefined\n @return {Object} The property value or the defaultValue.\n */\n getWithDefault: function(keyName, defaultValue) {\n return Ember.getWithDefault(this, keyName, defaultValue);\n },\n\n /**\n Set the value of a property to the current value plus some amount.\n\n ```javascript\n person.incrementProperty('age');\n team.incrementProperty('score', 2);\n ```\n\n @method incrementProperty\n @param {String} keyName The name of the property to increment\n @param {Object} increment The amount to increment by. Defaults to 1\n @return {Object} The new property value\n */\n incrementProperty: function(keyName, increment) {\n if (!increment) { increment = 1; }\n set(this, keyName, (get(this, keyName) || 0)+increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a property to the current value minus some amount.\n\n ```javascript\n player.decrementProperty('lives');\n orc.decrementProperty('health', 5);\n ```\n\n @method decrementProperty\n @param {String} keyName The name of the property to decrement\n @param {Object} increment The amount to decrement by. Defaults to 1\n @return {Object} The new property value\n */\n decrementProperty: function(keyName, increment) {\n if (!increment) { increment = 1; }\n set(this, keyName, (get(this, keyName) || 0)-increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a boolean property to the opposite of it's\n current value.\n\n ```javascript\n starship.toggleProperty('warpDriveEnaged');\n ```\n\n @method toggleProperty\n @param {String} keyName The name of the property to toggle\n @return {Object} The new property value\n */\n toggleProperty: function(keyName) {\n set(this, keyName, !get(this, keyName));\n return get(this, keyName);\n },\n\n /**\n Returns the cached value of a computed property, if it exists.\n This allows you to inspect the value of a computed property\n without accidentally invoking it if it is intended to be\n generated lazily.\n\n @method cacheFor\n @param {String} keyName\n @return {Object} The cached value of the computed property, if any\n */\n cacheFor: function(keyName) {\n return Ember.cacheFor(this, keyName);\n },\n\n // intended for debugging purposes\n observersForKey: function(keyName) {\n return Ember.observersFor(this, keyName);\n }\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/observable");minispade.register('ember-runtime/mixins/sortable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach;\n\n/**\n `Ember.SortableMixin` provides a standard interface for array proxies\n to specify a sort order and maintain this sorting when objects are added,\n removed, or updated without changing the implicit order of their underlying\n content array:\n\n ```javascript\n songs = [\n {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'},\n {trackNumber: 2, title: 'Back in the U.S.S.R.'},\n {trackNumber: 3, title: 'Glass Onion'},\n ];\n\n songsController = Ember.ArrayController.create({\n content: songs,\n sortProperties: ['trackNumber'],\n sortAscending: true\n });\n\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.addObject({trackNumber: 1, title: 'Dear Prudence'});\n songsController.get('firstObject'); // {trackNumber: 1, title: 'Dear Prudence'}\n ```\n\n @class SortableMixin\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.MutableEnumerable\n*/\nEmber.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {\n\n /**\n Specifies which properties dictate the arrangedContent's sort order.\n\n @property {Array} sortProperties\n */\n sortProperties: null,\n\n /**\n Specifies the arrangedContent's sort direction\n\n @property {Boolean} sortAscending\n */\n sortAscending: true,\n\n orderBy: function(item1, item2) {\n var result = 0,\n sortProperties = get(this, 'sortProperties'),\n sortAscending = get(this, 'sortAscending');\n\n Ember.assert(\"you need to define `sortProperties`\", !!sortProperties);\n\n forEach(sortProperties, function(propertyName) {\n if (result === 0) {\n result = Ember.compare(get(item1, propertyName), get(item2, propertyName));\n if ((result !== 0) && !sortAscending) {\n result = (-1) * result;\n }\n }\n });\n\n return result;\n },\n\n destroy: function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super();\n },\n\n isSorted: Ember.computed.bool('sortProperties'),\n\n arrangedContent: Ember.computed('content', 'sortProperties.@each', function(key, value) {\n var content = get(this, 'content'),\n isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties'),\n self = this;\n\n if (content && isSorted) {\n content = content.slice();\n content.sort(function(item1, item2) {\n return self.orderBy(item1, item2);\n });\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n return Ember.A(content);\n }\n\n return content;\n }),\n\n _contentWillChange: Ember.beforeObserver(function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n this._super();\n }, 'content'),\n\n sortAscendingWillChange: Ember.beforeObserver(function() {\n this._lastSortAscending = get(this, 'sortAscending');\n }, 'sortAscending'),\n\n sortAscendingDidChange: Ember.observer(function() {\n if (get(this, 'sortAscending') !== this._lastSortAscending) {\n var arrangedContent = get(this, 'arrangedContent');\n arrangedContent.reverseObjects();\n }\n }, 'sortAscending'),\n\n contentArrayWillChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted');\n\n if (isSorted) {\n var arrangedContent = get(this, 'arrangedContent');\n var removedObjects = array.slice(idx, idx+removedCount);\n var sortProperties = get(this, 'sortProperties');\n\n forEach(removedObjects, function(item) {\n arrangedContent.removeObject(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n contentArrayDidChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties');\n\n if (isSorted) {\n var addedObjects = array.slice(idx, idx+addedCount);\n\n forEach(addedObjects, function(item) {\n this.insertItemSorted(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n insertItemSorted: function(item) {\n var arrangedContent = get(this, 'arrangedContent');\n var length = get(arrangedContent, 'length');\n\n var idx = this._binarySearch(item, 0, length);\n arrangedContent.insertAt(idx, item);\n },\n\n contentItemSortPropertyDidChange: function(item) {\n var arrangedContent = get(this, 'arrangedContent'),\n oldIndex = arrangedContent.indexOf(item),\n leftItem = arrangedContent.objectAt(oldIndex - 1),\n rightItem = arrangedContent.objectAt(oldIndex + 1),\n leftResult = leftItem && this.orderBy(item, leftItem),\n rightResult = rightItem && this.orderBy(item, rightItem);\n\n if (leftResult < 0 || rightResult > 0) {\n arrangedContent.removeObject(item);\n this.insertItemSorted(item);\n }\n },\n\n _binarySearch: function(item, low, high) {\n var mid, midItem, res, arrangedContent;\n\n if (low === high) {\n return low;\n }\n\n arrangedContent = get(this, 'arrangedContent');\n\n mid = low + Math.floor((high - low) / 2);\n midItem = arrangedContent.objectAt(mid);\n\n res = this.orderBy(midItem, item);\n\n if (res < 0) {\n return this._binarySearch(item, mid+1, high);\n } else if (res > 0) {\n return this._binarySearch(item, low, mid);\n }\n\n return mid;\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/sortable");minispade.register('ember-runtime/mixins/target_action_support', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n@class TargetActionSupport\n@namespace Ember\n@extends Ember.Mixin\n*/\nEmber.TargetActionSupport = Ember.Mixin.create({\n target: null,\n action: null,\n\n targetObject: Ember.computed(function() {\n var target = get(this, 'target');\n\n if (Ember.typeOf(target) === \"string\") {\n var value = get(this, target);\n if (value === undefined) { value = get(Ember.lookup, target); }\n return value;\n } else {\n return target;\n }\n }).property('target'),\n\n triggerAction: function() {\n var action = get(this, 'action'),\n target = get(this, 'targetObject');\n\n if (target && action) {\n var ret;\n\n if (typeof target.send === 'function') {\n ret = target.send(action, this);\n } else {\n if (typeof action === 'string') {\n action = target[action];\n }\n ret = action.call(target, this);\n }\n if (ret !== false) ret = true;\n\n return ret;\n } else {\n return false;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/target_action_support");minispade.register('ember-runtime/system', "(function() {minispade.require('ember-runtime/system/container');\nminispade.require('ember-runtime/system/application');\nminispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/system/each_proxy');\nminispade.require('ember-runtime/system/namespace');\nminispade.require('ember-runtime/system/native_array');\nminispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/set');\nminispade.require('ember-runtime/system/string');\nminispade.require('ember-runtime/system/deferred');\nminispade.require('ember-runtime/system/lazy_load');\n\n})();\n//@ sourceURL=ember-runtime/system");minispade.register('ember-runtime/system/application', "(function() {minispade.require('ember-runtime/system/namespace');\n\nEmber.Application = Ember.Namespace.extend();\n\n})();\n//@ sourceURL=ember-runtime/system/application");minispade.register('ember-runtime/system/array_proxy', "(function() {minispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\";\nvar EMPTY = [];\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n An ArrayProxy wraps any other object that implements `Ember.Array` and/or\n `Ember.MutableArray,` forwarding all requests. This makes it very useful for\n a number of binding use cases or other cases where being able to swap\n out the underlying array is useful.\n\n A simple example of usage:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });\n\n ap.get('firstObject'); // 'dog'\n ap.set('content', ['amoeba', 'paramecium']);\n ap.get('firstObject'); // 'amoeba'\n ```\n\n This class can also be useful as a layer to transform the contents of\n an array, as they are accessed. This can be done by overriding\n `objectAtContent`:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({\n content: Ember.A(pets),\n objectAtContent: function(idx) {\n return this.get('content').objectAt(idx).toUpperCase();\n }\n });\n\n ap.get('firstObject'); // . 'DOG'\n ```\n\n @class ArrayProxy\n @namespace Ember\n @extends Ember.Object\n @uses Ember.MutableArray\n*/\nEmber.ArrayProxy = Ember.Object.extend(Ember.MutableArray,\n/** @scope Ember.ArrayProxy.prototype */ {\n\n /**\n The content array. Must be an object that implements `Ember.Array` and/or\n `Ember.MutableArray.`\n\n @property content\n @type Ember.Array\n */\n content: null,\n\n /**\n The array that the proxy pretends to be. In the default `ArrayProxy`\n implementation, this and `content` are the same. Subclasses of `ArrayProxy`\n can override this property to provide things like sorting and filtering.\n\n @property arrangedContent\n */\n arrangedContent: Ember.computed.alias('content'),\n\n /**\n Should actually retrieve the object at the specified index from the\n content. You can override this method in subclasses to transform the\n content item to something new.\n\n This method will only be called if content is non-`null`.\n\n @method objectAtContent\n @param {Number} idx The index to retrieve.\n @return {Object} the value or undefined if none found\n */\n objectAtContent: function(idx) {\n return get(this, 'arrangedContent').objectAt(idx);\n },\n\n /**\n Should actually replace the specified objects on the content array.\n You can override this method in subclasses to transform the content item\n into something new.\n\n This method will only be called if content is non-`null`.\n\n @method replaceContent\n @param {Number} idx The starting index\n @param {Number} amt The number of items to remove from the content.\n @param {Array} objects Optional array of objects to insert or null if no\n objects.\n @return {void}\n */\n replaceContent: function(idx, amt, objects) {\n get(this, 'content').replace(idx, amt, objects);\n },\n\n /**\n @private\n\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @method _contentWillChange\n */\n _contentWillChange: Ember.beforeObserver(function() {\n this._teardownContent();\n }, 'content'),\n\n _teardownContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n contentArrayWillChange: Ember.K,\n contentArrayDidChange: Ember.K,\n\n /**\n @private\n\n Invoked when the content property changes. Notifies observers that the\n entire array content has changed.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer(function() {\n var content = get(this, 'content');\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", content !== this);\n\n this._setupContent();\n }, 'content'),\n\n _setupContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n _arrangedContentWillChange: Ember.beforeObserver(function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n this.arrangedContentArrayWillChange(this, 0, len, undefined);\n this.arrangedContentWillChange(this);\n\n this._teardownArrangedContent(arrangedContent);\n }, 'arrangedContent'),\n\n _arrangedContentDidChange: Ember.observer(function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", arrangedContent !== this);\n\n this._setupArrangedContent();\n\n this.arrangedContentDidChange(this);\n this.arrangedContentArrayDidChange(this, 0, undefined, len);\n }, 'arrangedContent'),\n\n _setupArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.addArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n _teardownArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.removeArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n arrangedContentWillChange: Ember.K,\n arrangedContentDidChange: Ember.K,\n\n objectAt: function(idx) {\n return get(this, 'content') && this.objectAtContent(idx);\n },\n\n length: Ember.computed(function() {\n var arrangedContent = get(this, 'arrangedContent');\n return arrangedContent ? get(arrangedContent, 'length') : 0;\n // No dependencies since Enumerable notifies length of change\n }),\n\n _replace: function(idx, amt, objects) {\n var content = get(this, 'content');\n Ember.assert('The content property of '+ this.constructor + ' should be set before modifying it', content);\n if (content) this.replaceContent(idx, amt, objects);\n return this;\n },\n\n replace: function() {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n this._replace.apply(this, arguments);\n } else {\n throw new Ember.Error(\"Using replace on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n _insertAt: function(idx, object) {\n if (idx > get(this, 'content.length')) throw new Error(OUT_OF_RANGE_EXCEPTION);\n this._replace(idx, 0, [object]);\n return this;\n },\n\n insertAt: function(idx, object) {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n return this._insertAt(idx, object);\n } else {\n throw new Ember.Error(\"Using insertAt on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n var content = get(this, 'content'),\n arrangedContent = get(this, 'arrangedContent'),\n indices = [], i;\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n if (len === undefined) len = 1;\n\n // Get a list of indices in original content to remove\n for (i=start; i<start+len; i++) {\n // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent\n indices.push(content.indexOf(arrangedContent.objectAt(i)));\n }\n\n // Replace in reverse order since indices will change\n indices.sort(function(a,b) { return b - a; });\n\n Ember.beginPropertyChanges();\n for (i=0; i<indices.length; i++) {\n this._replace(indices[i], 1, EMPTY);\n }\n Ember.endPropertyChanges();\n }\n\n return this ;\n },\n\n pushObject: function(obj) {\n this._insertAt(get(this, 'content.length'), obj) ;\n return obj ;\n },\n\n pushObjects: function(objects) {\n this._replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this._replace(0, len, objects);\n return this;\n },\n\n unshiftObject: function(obj) {\n this._insertAt(0, obj) ;\n return obj ;\n },\n\n unshiftObjects: function(objects) {\n this._replace(0, 0, objects);\n return this;\n },\n\n slice: function() {\n var arr = this.toArray();\n return arr.slice.apply(arr, arguments);\n },\n\n arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentWillChange(idx, removedCnt, addedCnt);\n },\n\n arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentDidChange(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n this._setupContent();\n this._setupArrangedContent();\n },\n\n willDestroy: function() {\n this._teardownArrangedContent();\n this._teardownContent();\n }\n});\n\n\n})();\n//@ sourceURL=ember-runtime/system/array_proxy");minispade.register('ember-runtime/system/container', "(function() {Ember.Container = requireModule('container');\nEmber.Container.set = Ember.set;\n\n})();\n//@ sourceURL=ember-runtime/system/container");minispade.register('ember-runtime/system/core_object', "(function() {minispade.require('ember-runtime/system/namespace');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n// NOTE: this object should never be included directly. Instead use Ember.\n// Ember.Object. We only define this separately so that Ember.Set can depend on it\n\n\nvar set = Ember.set, get = Ember.get,\n o_create = Ember.create,\n o_defineProperty = Ember.platform.defineProperty,\n GUID_KEY = Ember.GUID_KEY,\n guidFor = Ember.guidFor,\n generateGuid = Ember.generateGuid,\n meta = Ember.meta,\n rewatch = Ember.rewatch,\n finishChains = Ember.finishChains,\n destroy = Ember.destroy,\n schedule = Ember.run.schedule,\n Mixin = Ember.Mixin,\n applyMixin = Mixin._apply,\n finishPartial = Mixin.finishPartial,\n reopen = Mixin.prototype.reopen,\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n indexOf = Ember.EnumerableUtils.indexOf;\n\nvar undefinedDescriptor = {\n configurable: true,\n writable: true,\n enumerable: false,\n value: undefined\n};\n\nfunction makeCtor() {\n\n // Note: avoid accessing any properties on the object since it makes the\n // method a lot faster. This is glue code so we want it to be as fast as\n // possible.\n\n var wasApplied = false, initMixins, initProperties;\n\n var Class = function() {\n if (!wasApplied) {\n Class.proto(); // prepare prototype...\n }\n o_defineProperty(this, GUID_KEY, undefinedDescriptor);\n o_defineProperty(this, '_super', undefinedDescriptor);\n var m = meta(this);\n m.proto = this;\n if (initMixins) {\n // capture locally so we can clear the closed over variable\n var mixins = initMixins;\n initMixins = null;\n this.reopen.apply(this, mixins);\n }\n if (initProperties) {\n // capture locally so we can clear the closed over variable\n var props = initProperties;\n initProperties = null;\n\n var concatenatedProperties = this.concatenatedProperties;\n\n for (var i = 0, l = props.length; i < l; i++) {\n var properties = props[i];\n for (var keyName in properties) {\n if (!properties.hasOwnProperty(keyName)) { continue; }\n\n var value = properties[keyName],\n IS_BINDING = Ember.IS_BINDING;\n\n if (IS_BINDING.test(keyName)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[keyName] = value;\n }\n\n var desc = m.descs[keyName];\n\n Ember.assert(\"Ember.Object.create no longer supports defining computed properties.\", !(value instanceof Ember.ComputedProperty));\n Ember.assert(\"Ember.Object.create no longer supports defining methods that call _super.\", !(typeof value === 'function' && value.toString().indexOf('._super') !== -1));\n\n if (concatenatedProperties && indexOf(concatenatedProperties, keyName) >= 0) {\n var baseValue = this[keyName];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n value = baseValue.concat(value);\n } else {\n value = Ember.makeArray(baseValue).concat(value);\n }\n } else {\n value = Ember.makeArray(value);\n }\n }\n\n if (desc) {\n desc.set(this, keyName, value);\n } else {\n if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) {\n this.setUnknownProperty(keyName, value);\n } else if (MANDATORY_SETTER) {\n Ember.defineProperty(this, keyName, null, value); // setup mandatory setter\n } else {\n this[keyName] = value;\n }\n }\n }\n }\n }\n finishPartial(this, m);\n delete m.proto;\n finishChains(this);\n this.init.apply(this, arguments);\n };\n\n Class.toString = Mixin.prototype.toString;\n Class.willReopen = function() {\n if (wasApplied) {\n Class.PrototypeMixin = Mixin.create(Class.PrototypeMixin);\n }\n\n wasApplied = false;\n };\n Class._initMixins = function(args) { initMixins = args; };\n Class._initProperties = function(args) { initProperties = args; };\n\n Class.proto = function() {\n var superclass = Class.superclass;\n if (superclass) { superclass.proto(); }\n\n if (!wasApplied) {\n wasApplied = true;\n Class.PrototypeMixin.applyPartial(Class.prototype);\n rewatch(Class.prototype);\n }\n\n return this.prototype;\n };\n\n return Class;\n\n}\n\nvar CoreObject = makeCtor();\nCoreObject.toString = function() { return \"Ember.CoreObject\"; };\n\nCoreObject.PrototypeMixin = Mixin.create({\n reopen: function() {\n applyMixin(this, arguments, true);\n return this;\n },\n\n isInstance: true,\n\n /**\n An overridable method called when objects are instantiated. By default,\n does nothing unless it is overridden during class definition.\n\n Example:\n\n ```javascript\n App.Person = Ember.Object.extend({\n init: function() {\n this._super();\n alert('Name is ' + this.get('name'));\n }\n });\n\n var steve = App.Person.create({\n name: \"Steve\"\n });\n\n // alerts 'Name is Steve'.\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n ```\n\n @method init\n */\n init: function() {},\n\n /**\n Defines the properties that will be concatenated from the superclass\n (instead of overridden).\n\n By default, when you extend an Ember class a property defined in\n the subclass overrides a property with the same name that is defined\n in the superclass. However, there are some cases where it is preferable\n to build up a property's value by combining the superclass' property\n value with the subclass' value. An example of this in use within Ember\n is the `classNames` property of `Ember.View`.\n\n Here is some sample code showing the difference between a concatenated\n property and a normal one:\n\n ```javascript\n App.BarView = Ember.View.extend({\n someNonConcatenatedProperty: ['bar'],\n classNames: ['bar']\n });\n\n App.FooBarView = App.BarView.extend({\n someNonConcatenatedProperty: ['foo'],\n classNames: ['foo'],\n });\n\n var fooBarView = App.FooBarView.create();\n fooBarView.get('someNonConcatenatedProperty'); // ['foo']\n fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']\n ```\n\n This behavior extends to object creation as well. Continuing the\n above example:\n\n ```javascript\n var view = App.FooBarView.create({\n someNonConcatenatedProperty: ['baz'],\n classNames: ['baz']\n })\n view.get('someNonConcatenatedProperty'); // ['baz']\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n Adding a single property that is not an array will just add it in the array:\n\n ```javascript\n var view = App.FooBarView.create({\n classNames: 'baz'\n })\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n\n Using the `concatenatedProperties` property, we can tell to Ember that mix\n the content of the properties.\n\n In `Ember.View` the `classNameBindings` and `attributeBindings` properties\n are also concatenated, in addition to `classNames`.\n\n This feature is available for you to use throughout the Ember object model,\n although typical app developers are likely to use it infrequently.\n\n @property concatenatedProperties\n @type Array\n @default null\n */\n concatenatedProperties: null,\n\n /**\n @property isDestroyed\n @default false\n */\n isDestroyed: false,\n\n /**\n @property isDestroying\n @default false\n */\n isDestroying: false,\n\n /**\n Destroys an object by setting the `isDestroyed` flag and removing its\n metadata, which effectively destroys observers and bindings.\n\n If you try to set a property on a destroyed object, an exception will be\n raised.\n\n Note that destruction is scheduled for the end of the run loop and does not\n happen immediately.\n\n @method destroy\n @return {Ember.Object} receiver\n */\n destroy: function() {\n if (this._didCallDestroy) { return; }\n\n this.isDestroying = true;\n this._didCallDestroy = true;\n\n if (this.willDestroy) { this.willDestroy(); }\n\n schedule('destroy', this, this._scheduledDestroy);\n return this;\n },\n\n /**\n @private\n\n Invoked by the run loop to actually destroy the object. This is\n scheduled for execution by the `destroy` method.\n\n @method _scheduledDestroy\n */\n _scheduledDestroy: function() {\n destroy(this);\n set(this, 'isDestroyed', true);\n\n if (this.didDestroy) { this.didDestroy(); }\n },\n\n bind: function(to, from) {\n if (!(from instanceof Ember.Binding)) { from = Ember.Binding.from(from); }\n from.to(to).connect(this);\n return from;\n },\n\n /**\n Returns a string representation which attempts to provide more information\n than Javascript's `toString` typically does, in a generic way for all Ember\n objects.\n\n App.Person = Em.Object.extend()\n person = App.Person.create()\n person.toString() //=> \"<App.Person:ember1024>\"\n\n If the object's class is not defined on an Ember namespace, it will\n indicate it is a subclass of the registered superclass:\n\n Student = App.Person.extend()\n student = Student.create()\n student.toString() //=> \"<(subclass of App.Person):ember1025>\"\n\n If the method `toStringExtension` is defined, its return value will be\n included in the output.\n\n App.Teacher = App.Person.extend({\n toStringExtension: function(){\n return this.get('fullName');\n }\n });\n teacher = App.Teacher.create()\n teacher.toString(); //=> \"<App.Teacher:ember1026:Tom Dale>\"\n\n @method toString\n @return {String} string representation\n */\n toString: function toString() {\n var hasToStringExtension = typeof this.toStringExtension === 'function',\n extension = hasToStringExtension ? \":\" + this.toStringExtension() : '';\n var ret = '<'+this.constructor.toString()+':'+guidFor(this)+extension+'>';\n this.toString = makeToString(ret);\n return ret;\n }\n});\n\nCoreObject.PrototypeMixin.ownerConstructor = CoreObject;\n\nfunction makeToString(ret) {\n return function() { return ret; };\n}\n\nif (Ember.config.overridePrototypeMixin) {\n Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);\n}\n\nCoreObject.__super__ = null;\n\nvar ClassMixin = Mixin.create({\n\n ClassMixin: Ember.required(),\n\n PrototypeMixin: Ember.required(),\n\n isClass: true,\n\n isMethod: false,\n\n extend: function() {\n var Class = makeCtor(), proto;\n Class.ClassMixin = Mixin.create(this.ClassMixin);\n Class.PrototypeMixin = Mixin.create(this.PrototypeMixin);\n\n Class.ClassMixin.ownerConstructor = Class;\n Class.PrototypeMixin.ownerConstructor = Class;\n\n reopen.apply(Class.PrototypeMixin, arguments);\n\n Class.superclass = this;\n Class.__super__ = this.prototype;\n\n proto = Class.prototype = o_create(this.prototype);\n proto.constructor = Class;\n generateGuid(proto, 'ember');\n meta(proto).proto = proto; // this will disable observers on prototype\n\n Class.ClassMixin.apply(Class);\n return Class;\n },\n\n createWithMixins: function() {\n var C = this;\n if (arguments.length>0) { this._initMixins(arguments); }\n return new C();\n },\n\n create: function() {\n var C = this;\n if (arguments.length>0) { this._initProperties(arguments); }\n return new C();\n },\n\n reopen: function() {\n this.willReopen();\n reopen.apply(this.PrototypeMixin, arguments);\n return this;\n },\n\n reopenClass: function() {\n reopen.apply(this.ClassMixin, arguments);\n applyMixin(this, arguments, false);\n return this;\n },\n\n detect: function(obj) {\n if ('function' !== typeof obj) { return false; }\n while(obj) {\n if (obj===this) { return true; }\n obj = obj.superclass;\n }\n return false;\n },\n\n detectInstance: function(obj) {\n return obj instanceof this;\n },\n\n /**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For\n example, computed property functions may close over variables that are then\n no longer available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```javascript\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n Once you've done this, you can retrieve the values saved to the computed\n property from your class like this:\n\n ```javascript\n MyClass.metaForProperty('person');\n ```\n\n This will return the original hash that was passed to `meta()`.\n\n @method metaForProperty\n @param key {String} property name\n */\n metaForProperty: function(key) {\n var desc = meta(this.proto(), false).descs[key];\n\n Ember.assert(\"metaForProperty() could not find a computed property with key '\"+key+\"'.\", !!desc && desc instanceof Ember.ComputedProperty);\n return desc._meta || {};\n },\n\n /**\n Iterate over each computed property for the class, passing its name\n and any associated metadata (see `metaForProperty`) to the callback.\n\n @method eachComputedProperty\n @param {Function} callback\n @param {Object} binding\n */\n eachComputedProperty: function(callback, binding) {\n var proto = this.proto(),\n descs = meta(proto).descs,\n empty = {},\n property;\n\n for (var name in descs) {\n property = descs[name];\n\n if (property instanceof Ember.ComputedProperty) {\n callback.call(binding || this, name, property._meta || empty);\n }\n }\n }\n\n});\n\nClassMixin.ownerConstructor = CoreObject;\n\nif (Ember.config.overrideClassMixin) {\n Ember.config.overrideClassMixin(ClassMixin);\n}\n\nCoreObject.ClassMixin = ClassMixin;\nClassMixin.apply(CoreObject);\n\n/**\n @class CoreObject\n @namespace Ember\n*/\nEmber.CoreObject = CoreObject;\n\n})();\n//@ sourceURL=ember-runtime/system/core_object");minispade.register('ember-runtime/system/deferred', "(function() {minispade.require(\"ember-runtime/mixins/deferred\");\nminispade.require(\"ember-runtime/system/object\");\n\nvar DeferredMixin = Ember.DeferredMixin, // mixins/deferred\n get = Ember.get;\n\nvar Deferred = Ember.Object.extend(DeferredMixin);\n\nDeferred.reopenClass({\n promise: function(callback, binding) {\n var deferred = Deferred.create();\n callback.call(binding, deferred);\n return get(deferred, 'promise');\n }\n});\n\nEmber.Deferred = Deferred;\n\n})();\n//@ sourceURL=ember-runtime/system/deferred");minispade.register('ember-runtime/system/each_proxy', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/mixins/array');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar set = Ember.set, get = Ember.get, guidFor = Ember.guidFor;\nvar forEach = Ember.EnumerableUtils.forEach;\n\nvar EachArray = Ember.Object.extend(Ember.Array, {\n\n init: function(content, keyName, owner) {\n this._super();\n this._keyName = keyName;\n this._owner = owner;\n this._content = content;\n },\n\n objectAt: function(idx) {\n var item = this._content.objectAt(idx);\n return item && get(item, this._keyName);\n },\n\n length: Ember.computed(function() {\n var content = this._content;\n return content ? get(content, 'length') : 0;\n })\n\n});\n\nvar IS_OBSERVER = /^.+:(before|change)$/;\n\nfunction addObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects, guid;\n if (!objects) objects = proxy._objects = {};\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n // keep track of the index each item was found at so we can map\n // it back when the obj changes.\n guid = guidFor(item);\n if (!objects[guid]) objects[guid] = [];\n objects[guid].push(loc);\n }\n }\n}\n\nfunction removeObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects;\n if (!objects) objects = proxy._objects = {};\n var indicies, guid;\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n guid = guidFor(item);\n indicies = objects[guid];\n indicies[indicies.indexOf(loc)] = null;\n }\n }\n}\n\n/**\n This is the object instance returned when you get the `@each` property on an\n array. It uses the unknownProperty handler to automatically create\n EachArray instances for property names.\n\n @private\n @class EachProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.EachProxy = Ember.Object.extend({\n\n init: function(content) {\n this._super();\n this._content = content;\n content.addArrayObserver(this);\n\n // in case someone is already observing some keys make sure they are\n // added\n forEach(Ember.watchedEvents(this), function(eventName) {\n this.didAddListener(eventName);\n }, this);\n },\n\n /**\n You can directly access mapped properties by simply requesting them.\n The `unknownProperty` handler will generate an EachArray of each item.\n\n @method unknownProperty\n @param keyName {String}\n @param value {anything}\n */\n unknownProperty: function(keyName, value) {\n var ret;\n ret = new EachArray(this._content, keyName, this);\n Ember.defineProperty(this, keyName, null, ret);\n this.beginObservingContentKey(keyName);\n return ret;\n },\n\n // ..........................................................\n // ARRAY CHANGES\n // Invokes whenever the content array itself changes.\n\n arrayWillChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = removedCnt>0 ? idx+removedCnt : -1;\n Ember.beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) removeObserverForContentKey(content, key, this, idx, lim);\n\n Ember.propertyWillChange(this, key);\n }\n\n Ember.propertyWillChange(this._content, '@each');\n Ember.endPropertyChanges(this);\n },\n\n arrayDidChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = addedCnt>0 ? idx+addedCnt : -1;\n Ember.beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) addObserverForContentKey(content, key, this, idx, lim);\n\n Ember.propertyDidChange(this, key);\n }\n\n Ember.propertyDidChange(this._content, '@each');\n Ember.endPropertyChanges(this);\n },\n\n // ..........................................................\n // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS\n // Start monitoring keys based on who is listening...\n\n didAddListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.beginObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n didRemoveListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.stopObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n // ..........................................................\n // CONTENT KEY OBSERVING\n // Actual watch keys on the source content.\n\n beginObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (!keys) keys = this._keys = {};\n if (!keys[keyName]) {\n keys[keyName] = 1;\n var content = this._content,\n len = get(content, 'length');\n addObserverForContentKey(content, keyName, this, 0, len);\n } else {\n keys[keyName]++;\n }\n },\n\n stopObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {\n var content = this._content,\n len = get(content, 'length');\n removeObserverForContentKey(content, keyName, this, 0, len);\n }\n },\n\n contentKeyWillChange: function(obj, keyName) {\n Ember.propertyWillChange(this, keyName);\n },\n\n contentKeyDidChange: function(obj, keyName) {\n Ember.propertyDidChange(this, keyName);\n }\n\n});\n\n\n\n})();\n//@ sourceURL=ember-runtime/system/each_proxy");minispade.register('ember-runtime/system/lazy_load', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar loadHooks = Ember.ENV.EMBER_LOAD_HOOKS || {};\nvar loaded = {};\n\n/**\n@method onLoad\n@for Ember\n@param name {String} name of hook\n@param callback {Function} callback to be called\n*/\nEmber.onLoad = function(name, callback) {\n var object;\n\n loadHooks[name] = loadHooks[name] || Ember.A();\n loadHooks[name].pushObject(callback);\n\n if (object = loaded[name]) {\n callback(object);\n }\n};\n\n/**\n@method runLoadHooks\n@for Ember\n@param name {String} name of hook\n@param object {Object} object to pass to callbacks\n*/\nEmber.runLoadHooks = function(name, object) {\n var hooks;\n\n loaded[name] = object;\n\n if (hooks = loadHooks[name]) {\n loadHooks[name].forEach(function(callback) {\n callback(object);\n });\n }\n};\n\n})();\n//@ sourceURL=ember-runtime/system/lazy_load");minispade.register('ember-runtime/system/namespace', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, indexOf = Ember.ArrayPolyfills.indexOf;\n\n/**\n A Namespace is an object usually used to contain other objects or methods\n such as an application or framework. Create a namespace anytime you want\n to define one of these new containers.\n\n # Example Usage\n\n ```javascript\n MyFramework = Ember.Namespace.create({\n VERSION: '1.0.0'\n });\n ```\n\n @class Namespace\n @namespace Ember\n @extends Ember.Object\n*/\nvar Namespace = Ember.Namespace = Ember.Object.extend({\n isNamespace: true,\n\n init: function() {\n Ember.Namespace.NAMESPACES.push(this);\n Ember.Namespace.PROCESSED = false;\n },\n\n toString: function() {\n var name = get(this, 'name');\n if (name) { return name; }\n\n findNamespaces();\n return this[Ember.GUID_KEY+'_name'];\n },\n\n nameClasses: function() {\n processNamespace([this.toString()], this, {});\n },\n\n destroy: function() {\n var namespaces = Ember.Namespace.NAMESPACES;\n Ember.lookup[this.toString()] = undefined;\n namespaces.splice(indexOf.call(namespaces, this), 1);\n this._super();\n }\n});\n\nNamespace.reopenClass({\n NAMESPACES: [Ember],\n NAMESPACES_BY_ID: {},\n PROCESSED: false,\n processAll: processAllNamespaces,\n byName: function(name) {\n if (!Ember.BOOTED) {\n processAllNamespaces();\n }\n\n return NAMESPACES_BY_ID[name];\n }\n});\n\nvar NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;\n\nvar hasOwnProp = ({}).hasOwnProperty,\n guidFor = Ember.guidFor;\n\nfunction processNamespace(paths, root, seen) {\n var idx = paths.length;\n\n NAMESPACES_BY_ID[paths.join('.')] = root;\n\n // Loop over all of the keys in the namespace, looking for classes\n for(var key in root) {\n if (!hasOwnProp.call(root, key)) { continue; }\n var obj = root[key];\n\n // If we are processing the `Ember` namespace, for example, the\n // `paths` will start with `[\"Ember\"]`. Every iteration through\n // the loop will update the **second** element of this list with\n // the key, so processing `Ember.View` will make the Array\n // `['Ember', 'View']`.\n paths[idx] = key;\n\n // If we have found an unprocessed class\n if (obj && obj.toString === classToString) {\n // Replace the class' `toString` with the dot-separated path\n // and set its `NAME_KEY`\n obj.toString = makeToString(paths.join('.'));\n obj[NAME_KEY] = paths.join('.');\n\n // Support nested namespaces\n } else if (obj && obj.isNamespace) {\n // Skip aliased namespaces\n if (seen[guidFor(obj)]) { continue; }\n seen[guidFor(obj)] = true;\n\n // Process the child namespace\n processNamespace(paths, obj, seen);\n }\n }\n\n paths.length = idx; // cut out last item\n}\n\nfunction findNamespaces() {\n var Namespace = Ember.Namespace, lookup = Ember.lookup, obj, isNamespace;\n\n if (Namespace.PROCESSED) { return; }\n\n for (var prop in lookup) {\n // These don't raise exceptions but can cause warnings\n if (prop === \"parent\" || prop === \"top\" || prop === \"frameElement\") { continue; }\n\n // get(window.globalStorage, 'isNamespace') would try to read the storage for domain isNamespace and cause exception in Firefox.\n // globalStorage is a storage obsoleted by the WhatWG storage specification. See https://developer.mozilla.org/en/DOM/Storage#globalStorage\n if (prop === \"globalStorage\" && lookup.StorageList && lookup.globalStorage instanceof lookup.StorageList) { continue; }\n // Unfortunately, some versions of IE don't support window.hasOwnProperty\n if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }\n\n // At times we are not allowed to access certain properties for security reasons.\n // There are also times where even if we can access them, we are not allowed to access their properties.\n try {\n obj = Ember.lookup[prop];\n isNamespace = obj && obj.isNamespace;\n } catch (e) {\n continue;\n }\n\n if (isNamespace) {\n Ember.deprecate(\"Namespaces should not begin with lowercase.\", /^[A-Z]/.test(prop));\n obj[NAME_KEY] = prop;\n }\n }\n}\n\nvar NAME_KEY = Ember.NAME_KEY = Ember.GUID_KEY + '_name';\n\nfunction superClassString(mixin) {\n var superclass = mixin.superclass;\n if (superclass) {\n if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }\n else { return superClassString(superclass); }\n } else {\n return;\n }\n}\n\nfunction classToString() {\n if (!Ember.BOOTED && !this[NAME_KEY]) {\n processAllNamespaces();\n }\n\n var ret;\n\n if (this[NAME_KEY]) {\n ret = this[NAME_KEY];\n } else {\n var str = superClassString(this);\n if (str) {\n ret = \"(subclass of \" + str + \")\";\n } else {\n ret = \"(unknown mixin)\";\n }\n this.toString = makeToString(ret);\n }\n\n return ret;\n}\n\nfunction processAllNamespaces() {\n var unprocessedNamespaces = !Namespace.PROCESSED,\n unprocessedMixins = Ember.anyUnprocessedMixins;\n\n if (unprocessedNamespaces) {\n findNamespaces();\n Namespace.PROCESSED = true;\n }\n\n if (unprocessedNamespaces || unprocessedMixins) {\n var namespaces = Namespace.NAMESPACES, namespace;\n for (var i=0, l=namespaces.length; i<l; i++) {\n namespace = namespaces[i];\n processNamespace([namespace.toString()], namespace, {});\n }\n\n Ember.anyUnprocessedMixins = false;\n }\n}\n\nfunction makeToString(ret) {\n return function() { return ret; };\n}\n\nEmber.Mixin.prototype.toString = classToString;\n\n})();\n//@ sourceURL=ember-runtime/system/namespace");minispade.register('ember-runtime/system/native_array', "(function() {minispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/mixins/copyable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar get = Ember.get, set = Ember.set;\n\n// Add Ember.Array to Array.prototype. Remove methods with native\n// implementations and supply some more optimized versions of generic methods\n// because they are so common.\nvar NativeArray = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember.Copyable, {\n\n // because length is a built-in property we need to know to just get the\n // original property.\n get: function(key) {\n if (key==='length') return this.length;\n else if ('number' === typeof key) return this[key];\n else return this._super(key);\n },\n\n objectAt: function(idx) {\n return this[idx];\n },\n\n // primitive for array support.\n replace: function(idx, amt, objects) {\n\n if (this.isFrozen) throw Ember.FROZEN_ERROR ;\n\n // if we replaced exactly the same number of items, then pass only the\n // replaced range. Otherwise, pass the full remaining array length\n // since everything has shifted\n var len = objects ? get(objects, 'length') : 0;\n this.arrayContentWillChange(idx, amt, len);\n\n if (!objects || objects.length === 0) {\n this.splice(idx, amt) ;\n } else {\n var args = [idx, amt].concat(objects) ;\n this.splice.apply(this,args) ;\n }\n\n this.arrayContentDidChange(idx, amt, len);\n return this ;\n },\n\n // If you ask for an unknown property, then try to collect the value\n // from member items.\n unknownProperty: function(key, value) {\n var ret;// = this.reducedProperty(key, value) ;\n if ((value !== undefined) && ret === undefined) {\n ret = this[key] = value;\n }\n return ret ;\n },\n\n // If browser did not implement indexOf natively, then override with\n // specialized version\n indexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = 0;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n lastIndexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = len-1;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n copy: function(deep) {\n if (deep) {\n return this.map(function(item){ return Ember.copy(item, true); });\n }\n\n return this.slice();\n }\n});\n\n// Remove any methods implemented natively so we don't override them\nvar ignore = ['length'];\nEmber.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {\n if (Array.prototype[methodName]) ignore.push(methodName);\n});\n\nif (ignore.length>0) {\n NativeArray = NativeArray.without.apply(NativeArray, ignore);\n}\n\n/**\n The NativeArray mixin contains the properties needed to to make the native\n Array support Ember.MutableArray and all of its dependent APIs. Unless you\n have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to\n false, this will be applied automatically. Otherwise you can apply the mixin\n at anytime by calling `Ember.NativeArray.activate`.\n\n @class NativeArray\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.MutableArray\n @uses Ember.MutableEnumerable\n @uses Ember.Copyable\n @uses Ember.Freezable\n*/\nEmber.NativeArray = NativeArray;\n\n/**\n Creates an `Ember.NativeArray` from an Array like object.\n Does not modify the original object.\n\n @method A\n @for Ember\n @return {Ember.NativeArray}\n*/\nEmber.A = function(arr){\n if (arr === undefined) { arr = []; }\n return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);\n};\n\n/**\n Activates the mixin on the Array.prototype if not already applied. Calling\n this method more than once is safe.\n\n @method activate\n @for Ember.NativeArray\n @static\n @return {void}\n*/\nEmber.NativeArray.activate = function() {\n NativeArray.apply(Array.prototype);\n\n Ember.A = function(arr) { return arr || []; };\n};\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n Ember.NativeArray.activate();\n}\n\n\n})();\n//@ sourceURL=ember-runtime/system/native_array");minispade.register('ember-runtime/system/object', "(function() {minispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/system/core_object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.Object` is the main base class for all Ember objects. It is a subclass\n of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,\n see the documentation for each of these.\n\n @class Object\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.Observable\n*/\nEmber.Object = Ember.CoreObject.extend(Ember.Observable);\nEmber.Object.toString = function() { return \"Ember.Object\"; };\n\n})();\n//@ sourceURL=ember-runtime/system/object");minispade.register('ember-runtime/system/object_proxy', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get,\n set = Ember.set,\n fmt = Ember.String.fmt,\n addBeforeObserver = Ember.addBeforeObserver,\n addObserver = Ember.addObserver,\n removeBeforeObserver = Ember.removeBeforeObserver,\n removeObserver = Ember.removeObserver,\n propertyWillChange = Ember.propertyWillChange,\n propertyDidChange = Ember.propertyDidChange;\n\nfunction contentPropertyWillChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyWillChange(this, key);\n}\n\nfunction contentPropertyDidChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyDidChange(this, key);\n}\n\n/**\n `Ember.ObjectProxy` forwards all properties not defined by the proxy itself\n to a proxied `content` object.\n\n ```javascript\n object = Ember.Object.create({\n name: 'Foo'\n });\n\n proxy = Ember.ObjectProxy.create({\n content: object\n });\n\n // Access and change existing properties\n proxy.get('name') // 'Foo'\n proxy.set('name', 'Bar');\n object.get('name') // 'Bar'\n\n // Create new 'description' property on `object`\n proxy.set('description', 'Foo is a whizboo baz');\n object.get('description') // 'Foo is a whizboo baz'\n ```\n\n While `content` is unset, setting a property to be delegated will throw an\n Error.\n\n ```javascript\n proxy = Ember.ObjectProxy.create({\n content: null,\n flag: null\n });\n proxy.set('flag', true);\n proxy.get('flag'); // true\n proxy.get('foo'); // undefined\n proxy.set('foo', 'data'); // throws Error\n ```\n\n Delegated properties can be bound to and will change when content is updated.\n\n Computed properties on the proxy itself can depend on delegated properties.\n\n ```javascript\n ProxyWithComputedProperty = Ember.ObjectProxy.extend({\n fullName: function () {\n var firstName = this.get('firstName'),\n lastName = this.get('lastName');\n if (firstName && lastName) {\n return firstName + ' ' + lastName;\n }\n return firstName || lastName;\n }.property('firstName', 'lastName')\n });\n\n proxy = ProxyWithComputedProperty.create();\n\n proxy.get('fullName'); // undefined\n proxy.set('content', {\n firstName: 'Tom', lastName: 'Dale'\n }); // triggers property change for fullName on proxy\n\n proxy.get('fullName'); // 'Tom Dale'\n ```\n\n @class ObjectProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.ObjectProxy = Ember.Object.extend(\n/** @scope Ember.ObjectProxy.prototype */ {\n /**\n The object whose properties will be forwarded.\n\n @property content\n @type Ember.Object\n @default null\n */\n content: null,\n _contentDidChange: Ember.observer(function() {\n Ember.assert(\"Can't set ObjectProxy's content to itself\", this.get('content') !== this);\n }, 'content'),\n\n isTruthy: Ember.computed.bool('content'),\n\n _debugContainerKey: null,\n\n willWatchProperty: function (key) {\n var contentKey = 'content.' + key;\n addBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n addObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n didUnwatchProperty: function (key) {\n var contentKey = 'content.' + key;\n removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n removeObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n unknownProperty: function (key) {\n var content = get(this, 'content');\n if (content) {\n return get(content, key);\n }\n },\n\n setUnknownProperty: function (key, value) {\n var content = get(this, 'content');\n Ember.assert(fmt(\"Cannot delegate set('%@', %@) to the 'content' property of object proxy %@: its 'content' is undefined.\", [key, value, this]), content);\n return set(content, key, value);\n }\n});\n\nEmber.ObjectProxy.reopenClass({\n create: function () {\n var mixin, prototype, i, l, properties, keyName;\n if (arguments.length) {\n prototype = this.proto();\n for (i = 0, l = arguments.length; i < l; i++) {\n properties = arguments[i];\n for (keyName in properties) {\n if (!properties.hasOwnProperty(keyName) || keyName in prototype) { continue; }\n if (!mixin) mixin = {};\n mixin[keyName] = null;\n }\n }\n if (mixin) this._initMixins([mixin]);\n }\n return this._super.apply(this, arguments);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/system/object_proxy");minispade.register('ember-runtime/system/set', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/freezable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, none = Ember.isNone, fmt = Ember.String.fmt;\n\n/**\n An unordered collection of objects.\n\n A Set works a bit like an array except that its items are not ordered. You\n can create a set to efficiently test for membership for an object. You can\n also iterate through a set just like an array, even accessing objects by\n index, however there is no guarantee as to their order.\n\n All Sets are observable via the Enumerable Observer API - which works\n on any enumerable object including both Sets and Arrays.\n\n ## Creating a Set\n\n You can create a set like you would most objects using\n `new Ember.Set()`. Most new sets you create will be empty, but you can\n also initialize the set with some content by passing an array or other\n enumerable of objects to the constructor.\n\n Finally, you can pass in an existing set and the set will be copied. You\n can also create a copy of a set by calling `Ember.Set#copy()`.\n\n ```javascript\n // creates a new empty set\n var foundNames = new Ember.Set();\n\n // creates a set with four names in it.\n var names = new Ember.Set([\"Charles\", \"Tom\", \"Juan\", \"Alex\"]); // :P\n\n // creates a copy of the names set.\n var namesCopy = new Ember.Set(names);\n\n // same as above.\n var anotherNamesCopy = names.copy();\n ```\n\n ## Adding/Removing Objects\n\n You generally add or remove objects from a set using `add()` or\n `remove()`. You can add any type of object including primitives such as\n numbers, strings, and booleans.\n\n Unlike arrays, objects can only exist one time in a set. If you call `add()`\n on a set with the same object multiple times, the object will only be added\n once. Likewise, calling `remove()` with the same object multiple times will\n remove the object the first time and have no effect on future calls until\n you add the object to the set again.\n\n NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do\n so will be ignored.\n\n In addition to add/remove you can also call `push()`/`pop()`. Push behaves\n just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary\n object, remove it and return it. This is a good way to use a set as a job\n queue when you don't care which order the jobs are executed in.\n\n ## Testing for an Object\n\n To test for an object's presence in a set you simply call\n `Ember.Set#contains()`.\n\n ## Observing changes\n\n When using `Ember.Set`, you can observe the `\"[]\"` property to be\n alerted whenever the content changes. You can also add an enumerable\n observer to the set to be notified of specific objects that are added and\n removed from the set. See `Ember.Enumerable` for more information on\n enumerables.\n\n This is often unhelpful. If you are filtering sets of objects, for instance,\n it is very inefficient to re-filter all of the items each time the set\n changes. It would be better if you could just adjust the filtered set based\n on what was changed on the original set. The same issue applies to merging\n sets, as well.\n\n ## Other Methods\n\n `Ember.Set` primary implements other mixin APIs. For a complete reference\n on the methods you will use with `Ember.Set`, please consult these mixins.\n The most useful ones will be `Ember.Enumerable` and\n `Ember.MutableEnumerable` which implement most of the common iterator\n methods you are used to on Array.\n\n Note that you can also use the `Ember.Copyable` and `Ember.Freezable`\n APIs on `Ember.Set` as well. Once a set is frozen it can no longer be\n modified. The benefit of this is that when you call `frozenCopy()` on it,\n Ember will avoid making copies of the set. This allows you to write\n code that can know with certainty when the underlying set data will or\n will not be modified.\n\n @class Set\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.MutableEnumerable\n @uses Ember.Copyable\n @uses Ember.Freezable\n @since Ember 0.9\n*/\nEmber.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,\n /** @scope Ember.Set.prototype */ {\n\n // ..........................................................\n // IMPLEMENT ENUMERABLE APIS\n //\n\n /**\n This property will change as the number of objects in the set changes.\n\n @property length\n @type number\n @default 0\n */\n length: 0,\n\n /**\n Clears the set. This is useful if you want to reuse an existing set\n without having to recreate it.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.length; // 3\n colors.clear();\n colors.length; // 0\n ```\n\n @method clear\n @return {Ember.Set} An empty Set\n */\n clear: function() {\n if (this.isFrozen) { throw new Error(Ember.FROZEN_ERROR); }\n\n var len = get(this, 'length');\n if (len === 0) { return this; }\n\n var guid;\n\n this.enumerableContentWillChange(len, 0);\n Ember.propertyWillChange(this, 'firstObject');\n Ember.propertyWillChange(this, 'lastObject');\n\n for (var i=0; i < len; i++){\n guid = guidFor(this[i]);\n delete this[guid];\n delete this[i];\n }\n\n set(this, 'length', 0);\n\n Ember.propertyDidChange(this, 'firstObject');\n Ember.propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(len, 0);\n\n return this;\n },\n\n /**\n Returns true if the passed object is also an enumerable that contains the\n same objects as the receiver.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"],\n same_colors = new Ember.Set(colors);\n\n same_colors.isEqual(colors); // true\n same_colors.isEqual([\"purple\", \"brown\"]); // false\n ```\n\n @method isEqual\n @param {Ember.Set} obj the other object.\n @return {Boolean}\n */\n isEqual: function(obj) {\n // fail fast\n if (!Ember.Enumerable.detect(obj)) return false;\n\n var loc = get(this, 'length');\n if (get(obj, 'length') !== loc) return false;\n\n while(--loc >= 0) {\n if (!obj.contains(this[loc])) return false;\n }\n\n return true;\n },\n\n /**\n Adds an object to the set. Only non-`null` objects can be added to a set\n and those can only be added once. If the object is already in the set or\n the passed value is null this method will have no effect.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"red\"); // [\"blue\", \"red\"]\n colors.add(null); // [\"blue\", \"red\"]\n colors.add(undefined); // [\"blue\", \"red\"]\n ```\n\n @method add\n @param {Object} obj The object to add.\n @return {Ember.Set} The set itself.\n */\n add: Ember.aliasMethod('addObject'),\n\n /**\n Removes the object from the set if it is found. If you pass a `null` value\n or an object that is already not in the set, this method will have no\n effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.remove(\"red\"); // [\"blue\", \"green\"]\n colors.remove(\"purple\"); // [\"blue\", \"green\"]\n colors.remove(null); // [\"blue\", \"green\"]\n ```\n\n @method remove\n @param {Object} obj The object to remove\n @return {Ember.Set} The set itself.\n */\n remove: Ember.aliasMethod('removeObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.pop(); // \"blue\"\n colors.pop(); // \"green\"\n colors.pop(); // null\n ```\n\n @method pop\n @return {Object} The removed object from the set or null.\n */\n pop: function() {\n if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);\n var obj = this.length > 0 ? this[this.length-1] : null;\n this.remove(obj);\n return obj;\n },\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.push(\"red\"); // [\"red\"]\n colors.push(\"green\"); // [\"red\", \"green\"]\n colors.push(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method push\n @return {Ember.Set} The set itself.\n */\n push: Ember.aliasMethod('addObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n This is an alias for `Ember.Set.pop()`.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.shift(); // \"blue\"\n colors.shift(); // \"green\"\n colors.shift(); // null\n ```\n\n @method shift\n @return {Object} The removed object from the set or null.\n */\n shift: Ember.aliasMethod('pop'),\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias of `Ember.Set.push()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.unshift(\"red\"); // [\"red\"]\n colors.unshift(\"green\"); // [\"red\", \"green\"]\n colors.unshift(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method unshift\n @return {Ember.Set} The set itself.\n */\n unshift: Ember.aliasMethod('push'),\n\n /**\n Adds each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.addObjects()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.addEach([\"red\", \"green\", \"blue\"]); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method addEach\n @param {Ember.Enumerable} objects the objects to add.\n @return {Ember.Set} The set itself.\n */\n addEach: Ember.aliasMethod('addObjects'),\n\n /**\n Removes each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.removeObjects()`\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.removeEach([\"red\", \"blue\"]); // [\"green\"]\n ```\n\n @method removeEach\n @param {Ember.Enumerable} objects the objects to remove.\n @return {Ember.Set} The set itself.\n */\n removeEach: Ember.aliasMethod('removeObjects'),\n\n // ..........................................................\n // PRIVATE ENUMERABLE SUPPORT\n //\n\n init: function(items) {\n this._super();\n if (items) this.addObjects(items);\n },\n\n // implement Ember.Enumerable\n nextObject: function(idx) {\n return this[idx];\n },\n\n // more optimized version\n firstObject: Ember.computed(function() {\n return this.length > 0 ? this[0] : undefined;\n }),\n\n // more optimized version\n lastObject: Ember.computed(function() {\n return this.length > 0 ? this[this.length-1] : undefined;\n }),\n\n // implements Ember.MutableEnumerable\n addObject: function(obj) {\n if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);\n if (none(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n added ;\n\n if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added\n\n added = [obj];\n\n this.enumerableContentWillChange(null, added);\n Ember.propertyWillChange(this, 'lastObject');\n\n len = get(this, 'length');\n this[guid] = len;\n this[len] = obj;\n set(this, 'length', len+1);\n\n Ember.propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(null, added);\n\n return this;\n },\n\n // implements Ember.MutableEnumerable\n removeObject: function(obj) {\n if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);\n if (none(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n isFirst = idx === 0,\n isLast = idx === len-1,\n last, removed;\n\n\n if (idx>=0 && idx<len && (this[idx] === obj)) {\n removed = [obj];\n\n this.enumerableContentWillChange(removed, null);\n if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }\n if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }\n\n // swap items - basically move the item to the end so it can be removed\n if (idx < len-1) {\n last = this[len-1];\n this[idx] = last;\n this[guidFor(last)] = idx;\n }\n\n delete this[guid];\n delete this[len-1];\n set(this, 'length', len-1);\n\n if (isFirst) { Ember.propertyDidChange(this, 'firstObject'); }\n if (isLast) { Ember.propertyDidChange(this, 'lastObject'); }\n this.enumerableContentDidChange(removed, null);\n }\n\n return this;\n },\n\n // optimized version\n contains: function(obj) {\n return this[guidFor(obj)]>=0;\n },\n\n copy: function() {\n var C = this.constructor, ret = new C(), loc = get(this, 'length');\n set(ret, 'length', loc);\n while(--loc>=0) {\n ret[loc] = this[loc];\n ret[guidFor(this[loc])] = loc;\n }\n return ret;\n },\n\n toString: function() {\n var len = this.length, idx, array = [];\n for(idx = 0; idx < len; idx++) {\n array[idx] = this[idx];\n }\n return fmt(\"Ember.Set<%@>\", [array.join(',')]);\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/system/set");minispade.register('ember-runtime/system/string', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar STRING_DASHERIZE_REGEXP = (/[ _]/g);\nvar STRING_DASHERIZE_CACHE = {};\nvar STRING_DECAMELIZE_REGEXP = (/([a-z])([A-Z])/g);\nvar STRING_CAMELIZE_REGEXP = (/(\\-|_|\\.|\\s)+(.)?/g);\nvar STRING_UNDERSCORE_REGEXP_1 = (/([a-z\\d])([A-Z]+)/g);\nvar STRING_UNDERSCORE_REGEXP_2 = (/\\-|\\s+/g);\n\n/**\n Defines the hash of localized strings for the current language. Used by\n the `Ember.String.loc()` helper. To localize, add string values to this\n hash.\n\n @property STRINGS\n @for Ember\n @type Hash\n*/\nEmber.STRINGS = {};\n\n/**\n Defines string helper methods including string formatting and localization.\n Unless `Ember.EXTEND_PROTOTYPES.String` is `false` these methods will also be\n added to the `String.prototype` as well.\n\n @class String\n @namespace Ember\n @static\n*/\nEmber.String = {\n\n /**\n Apply formatting options to the string. This will look for occurrences\n of \"%@\" in your string and substitute them with the arguments you pass into\n this method. If you want to control the specific order of replacement,\n you can add a number after the key as well to indicate which argument\n you want to insert.\n\n Ordered insertions are most useful when building loc strings where values\n you need to insert may appear in different orders.\n\n ```javascript\n \"Hello %@ %@\".fmt('John', 'Doe'); // \"Hello John Doe\"\n \"Hello %@2, %@1\".fmt('John', 'Doe'); // \"Hello Doe, John\"\n ```\n\n @method fmt\n @param {Object...} [args]\n @return {String} formatted string\n */\n fmt: function(str, formats) {\n // first, replace any ORDERED replacements.\n var idx = 0; // the current index for non-numerical replacements\n return str.replace(/%@([0-9]+)?/g, function(s, argIndex) {\n argIndex = (argIndex) ? parseInt(argIndex,0) - 1 : idx++ ;\n s = formats[argIndex];\n return ((s === null) ? '(null)' : (s === undefined) ? '' : s).toString();\n }) ;\n },\n\n /**\n Formats the passed string, but first looks up the string in the localized\n strings hash. This is a convenient way to localize text. See\n `Ember.String.fmt()` for more information on formatting.\n\n Note that it is traditional but not required to prefix localized string\n keys with an underscore or other character so you can easily identify\n localized strings.\n\n ```javascript\n Ember.STRINGS = {\n '_Hello World': 'Bonjour le monde',\n '_Hello %@ %@': 'Bonjour %@ %@'\n };\n\n Ember.String.loc(\"_Hello World\"); // 'Bonjour le monde';\n Ember.String.loc(\"_Hello %@ %@\", [\"John\", \"Smith\"]); // \"Bonjour John Smith\";\n ```\n\n @method loc\n @param {String} str The string to format\n @param {Array} formats Optional array of parameters to interpolate into string.\n @return {String} formatted string\n */\n loc: function(str, formats) {\n str = Ember.STRINGS[str] || str;\n return Ember.String.fmt(str, formats) ;\n },\n\n /**\n Splits a string into separate units separated by spaces, eliminating any\n empty strings in the process. This is a convenience method for split that\n is mostly useful when applied to the `String.prototype`.\n\n ```javascript\n Ember.String.w(\"alpha beta gamma\").forEach(function(key) {\n console.log(key);\n });\n\n // > alpha\n // > beta\n // > gamma\n ```\n\n @method w\n @param {String} str The string to split\n @return {String} split string\n */\n w: function(str) { return str.split(/\\s+/); },\n\n /**\n Converts a camelized string into all lower case separated by underscores.\n\n ```javascript\n 'innerHTML'.decamelize(); // 'inner_html'\n 'action_name'.decamelize(); // 'action_name'\n 'css-class-name'.decamelize(); // 'css-class-name'\n 'my favorite items'.decamelize(); // 'my favorite items'\n ```\n\n @method decamelize\n @param {String} str The string to decamelize.\n @return {String} the decamelized string.\n */\n decamelize: function(str) {\n return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();\n },\n\n /**\n Replaces underscores or spaces with dashes.\n\n ```javascript\n 'innerHTML'.dasherize(); // 'inner-html'\n 'action_name'.dasherize(); // 'action-name'\n 'css-class-name'.dasherize(); // 'css-class-name'\n 'my favorite items'.dasherize(); // 'my-favorite-items'\n ```\n\n @method dasherize\n @param {String} str The string to dasherize.\n @return {String} the dasherized string.\n */\n dasherize: function(str) {\n var cache = STRING_DASHERIZE_CACHE,\n hit = cache.hasOwnProperty(str),\n ret;\n\n if (hit) {\n return cache[str];\n } else {\n ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');\n cache[str] = ret;\n }\n\n return ret;\n },\n\n /**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.camelize(); // 'innerHTML'\n 'action_name'.camelize(); // 'actionName'\n 'css-class-name'.camelize(); // 'cssClassName'\n 'my favorite items'.camelize(); // 'myFavoriteItems'\n 'My Favorite Items'.camelize(); // 'myFavoriteItems'\n ```\n\n @method camelize\n @param {String} str The string to camelize.\n @return {String} the camelized string.\n */\n camelize: function(str) {\n return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) {\n return chr ? chr.toUpperCase() : '';\n }).replace(/^([A-Z])/, function(match, separator, chr) {\n return match.toLowerCase();\n });\n },\n\n /**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.classify(); // 'InnerHTML'\n 'action_name'.classify(); // 'ActionName'\n 'css-class-name'.classify(); // 'CssClassName'\n 'my favorite items'.classify(); // 'MyFavoriteItems'\n ```\n\n @method classify\n @param {String} str the string to classify\n @return {String} the classified string\n */\n classify: function(str) {\n var parts = str.split(\".\"),\n out = [];\n\n for (var i=0, l=parts.length; i<l; i++) {\n var camelized = Ember.String.camelize(parts[i]);\n out.push(camelized.charAt(0).toUpperCase() + camelized.substr(1));\n }\n\n return out.join(\".\");\n },\n\n /**\n More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n form of a string.\n\n ```javascript\n 'innerHTML'.underscore(); // 'inner_html'\n 'action_name'.underscore(); // 'action_name'\n 'css-class-name'.underscore(); // 'css_class_name'\n 'my favorite items'.underscore(); // 'my_favorite_items'\n ```\n\n @method underscore\n @param {String} str The string to underscore.\n @return {String} the underscored string.\n */\n underscore: function(str) {\n return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').\n replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase();\n },\n\n /**\n Returns the Capitalized form of a string\n\n 'innerHTML'.capitalize() // 'InnerHTML'\n 'action_name'.capitalize() // 'Action_name'\n 'css-class-name'.capitalize() // 'Css-class-name'\n 'my favorite items'.capitalize() // 'My favorite items'\n\n @method capitalize\n @param {String} str\n @return {String}\n */\n capitalize: function(str) {\n return str.charAt(0).toUpperCase() + str.substr(1);\n }\n\n};\n\n})();\n//@ sourceURL=ember-runtime/system/string");minispade.register('ember-states', "(function() {minispade.require('ember-runtime');\n\n/**\nEmber States\n\n@module ember\n@submodule ember-states\n@requires ember-runtime\n*/\nminispade.require('ember-states/state_manager');\nminispade.require('ember-states/state');\n\n})();\n//@ sourceURL=ember-states");minispade.register('ember-states/state', "(function() {var get = Ember.get, set = Ember.set;\n\n/**\n@module ember\n@submodule ember-states\n*/\n\n/**\n @class State\n @namespace Ember\n @extends Ember.Object\n @uses Ember.Evented\n*/\nEmber.State = Ember.Object.extend(Ember.Evented,\n/** @scope Ember.State.prototype */{\n isState: true,\n\n /**\n A reference to the parent state.\n\n @property parentState\n @type Ember.State\n */\n parentState: null,\n start: null,\n\n /**\n The name of this state.\n\n @property name\n @type String\n */\n name: null,\n\n /**\n The full path to this state.\n\n @property path\n @type String\n */\n path: Ember.computed(function() {\n var parentPath = get(this, 'parentState.path'),\n path = get(this, 'name');\n\n if (parentPath) {\n path = parentPath + '.' + path;\n }\n\n return path;\n }),\n\n /**\n @private\n\n Override the default event firing from `Ember.Evented` to\n also call methods with the given name.\n\n @method trigger\n @param name\n */\n trigger: function(name) {\n if (this[name]) {\n this[name].apply(this, [].slice.call(arguments, 1));\n }\n this._super.apply(this, arguments);\n },\n\n init: function() {\n var states = get(this, 'states');\n set(this, 'childStates', Ember.A());\n set(this, 'eventTransitions', get(this, 'eventTransitions') || {});\n\n var name, value, transitionTarget;\n\n // As a convenience, loop over the properties\n // of this state and look for any that are other\n // Ember.State instances or classes, and move them\n // to the `states` hash. This avoids having to\n // create an explicit separate hash.\n\n if (!states) {\n states = {};\n\n for (name in this) {\n if (name === \"constructor\") { continue; }\n\n if (value = this[name]) {\n if (transitionTarget = value.transitionTarget) {\n this.eventTransitions[name] = transitionTarget;\n }\n\n this.setupChild(states, name, value);\n }\n }\n\n set(this, 'states', states);\n } else {\n for (name in states) {\n this.setupChild(states, name, states[name]);\n }\n }\n\n set(this, 'pathsCache', {});\n set(this, 'pathsCacheNoContext', {});\n },\n\n setupChild: function(states, name, value) {\n if (!value) { return false; }\n\n if (value.isState) {\n set(value, 'name', name);\n } else if (Ember.State.detect(value)) {\n value = value.create({\n name: name\n });\n }\n\n if (value.isState) {\n set(value, 'parentState', this);\n get(this, 'childStates').pushObject(value);\n states[name] = value;\n return value;\n }\n },\n\n lookupEventTransition: function(name) {\n var path, state = this;\n\n while(state && !path) {\n path = state.eventTransitions[name];\n state = state.get('parentState');\n }\n\n return path;\n },\n\n /**\n A Boolean value indicating whether the state is a leaf state\n in the state hierarchy. This is `false` if the state has child\n states; otherwise it is true.\n\n @property isLeaf\n @type Boolean\n */\n isLeaf: Ember.computed(function() {\n return !get(this, 'childStates').length;\n }),\n\n /**\n A boolean value indicating whether the state takes a context.\n By default we assume all states take contexts.\n\n @property hasContext\n @default true\n */\n hasContext: true,\n\n /**\n This is the default transition event.\n\n @event setup\n @param {Ember.StateManager} manager\n @param context\n @see Ember.StateManager#transitionEvent\n */\n setup: Ember.K,\n\n /**\n This event fires when the state is entered.\n\n @event enter\n @param {Ember.StateManager} manager\n */\n enter: Ember.K,\n\n /**\n This event fires when the state is exited.\n\n @event exit\n @param {Ember.StateManager} manager\n */\n exit: Ember.K\n});\n\nEmber.State.reopenClass({\n\n /**\n Creates an action function for transitioning to the named state while\n preserving context.\n\n The following example StateManagers are equivalent:\n\n ```javascript\n aManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: Ember.State.transitionTo('stateTwo')\n }),\n stateTwo: Ember.State.create({})\n })\n\n bManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: function(manager, context){\n manager.transitionTo('stateTwo', context)\n }\n }),\n stateTwo: Ember.State.create({})\n })\n ```\n\n @method transitionTo\n @static\n @param {String} target\n */\n\n transitionTo: function(target) {\n\n var transitionFunction = function(stateManager, contextOrEvent) {\n var contexts = [],\n Event = Ember.$ && Ember.$.Event;\n\n if (contextOrEvent && (Event && contextOrEvent instanceof Event)) {\n if (contextOrEvent.hasOwnProperty('contexts')) {\n contexts = contextOrEvent.contexts.slice();\n }\n }\n else {\n contexts = [].slice.call(arguments, 1);\n }\n\n contexts.unshift(target);\n stateManager.transitionTo.apply(stateManager, contexts);\n };\n\n transitionFunction.transitionTarget = target;\n\n return transitionFunction;\n }\n\n});\n\n})();\n//@ sourceURL=ember-states/state");minispade.register('ember-states/state_manager', "(function() {/**\n@module ember\n@submodule ember-states\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\nvar arrayForEach = Ember.ArrayPolyfills.forEach;\nminispade.require('ember-states/state');\n\n/**\n A Transition takes the enter, exit and resolve states and normalizes\n them:\n\n * takes any passed in contexts into consideration\n * adds in `initialState`s\n\n @class Transition\n @private\n*/\nvar Transition = function(raw) {\n this.enterStates = raw.enterStates.slice();\n this.exitStates = raw.exitStates.slice();\n this.resolveState = raw.resolveState;\n\n this.finalState = raw.enterStates[raw.enterStates.length - 1] || raw.resolveState;\n};\n\nTransition.prototype = {\n /**\n Normalize the passed in enter, exit and resolve states.\n\n This process also adds `finalState` and `contexts` to the Transition object.\n\n @method normalize\n @param {Ember.StateManager} manager the state manager running the transition\n @param {Array} contexts a list of contexts passed into `transitionTo`\n */\n normalize: function(manager, contexts) {\n this.matchContextsToStates(contexts);\n this.addInitialStates();\n this.removeUnchangedContexts(manager);\n return this;\n },\n\n /**\n Match each of the contexts passed to `transitionTo` to a state.\n This process may also require adding additional enter and exit\n states if there are more contexts than enter states.\n\n @method matchContextsToStates\n @param {Array} contexts a list of contexts passed into `transitionTo`\n */\n matchContextsToStates: function(contexts) {\n var stateIdx = this.enterStates.length - 1,\n matchedContexts = [],\n state,\n context;\n\n // Next, we will match the passed in contexts to the states they\n // represent.\n //\n // First, assign a context to each enter state in reverse order. If\n // any contexts are left, add a parent state to the list of states\n // to enter and exit, and assign a context to the parent state.\n //\n // If there are still contexts left when the state manager is\n // reached, raise an exception.\n //\n // This allows the following:\n //\n // |- root\n // | |- post\n // | | |- comments\n // | |- about (* current state)\n //\n // For `transitionTo('post.comments', post, post.get('comments')`,\n // the first context (`post`) will be assigned to `root.post`, and\n // the second context (`post.get('comments')`) will be assigned\n // to `root.post.comments`.\n //\n // For the following:\n //\n // |- root\n // | |- post\n // | | |- index (* current state)\n // | | |- comments\n //\n // For `transitionTo('post.comments', otherPost, otherPost.get('comments')`,\n // the `<root.post>` state will be added to the list of enter and exit\n // states because its context has changed.\n\n while (contexts.length > 0) {\n if (stateIdx >= 0) {\n state = this.enterStates[stateIdx--];\n } else {\n if (this.enterStates.length) {\n state = get(this.enterStates[0], 'parentState');\n if (!state) { throw \"Cannot match all contexts to states\"; }\n } else {\n // If re-entering the current state with a context, the resolve\n // state will be the current state.\n state = this.resolveState;\n }\n\n this.enterStates.unshift(state);\n this.exitStates.unshift(state);\n }\n\n // in routers, only states with dynamic segments have a context\n if (get(state, 'hasContext')) {\n context = contexts.pop();\n } else {\n context = null;\n }\n\n matchedContexts.unshift(context);\n }\n\n this.contexts = matchedContexts;\n },\n\n /**\n Add any `initialState`s to the list of enter states.\n\n @method addInitialStates\n */\n addInitialStates: function() {\n var finalState = this.finalState, initialState;\n\n while(true) {\n initialState = get(finalState, 'initialState') || 'start';\n finalState = get(finalState, 'states.' + initialState);\n\n if (!finalState) { break; }\n\n this.finalState = finalState;\n this.enterStates.push(finalState);\n this.contexts.push(undefined);\n }\n },\n\n /**\n Remove any states that were added because the number of contexts\n exceeded the number of explicit enter states, but the context has\n not changed since the last time the state was entered.\n\n @method removeUnchangedContexts\n @param {Ember.StateManager} manager passed in to look up the last\n context for a states\n */\n removeUnchangedContexts: function(manager) {\n // Start from the beginning of the enter states. If the state was added\n // to the list during the context matching phase, make sure the context\n // has actually changed since the last time the state was entered.\n while (this.enterStates.length > 0) {\n if (this.enterStates[0] !== this.exitStates[0]) { break; }\n\n if (this.enterStates.length === this.contexts.length) {\n if (manager.getStateMeta(this.enterStates[0], 'context') !== this.contexts[0]) { break; }\n this.contexts.shift();\n }\n\n this.resolveState = this.enterStates.shift();\n this.exitStates.shift();\n }\n }\n};\n\nvar sendRecursively = function(event, currentState, isUnhandledPass) {\n var log = this.enableLogging,\n eventName = isUnhandledPass ? 'unhandledEvent' : event,\n action = currentState[eventName],\n contexts, sendRecursiveArguments, actionArguments;\n\n contexts = [].slice.call(arguments, 3);\n\n // Test to see if the action is a method that\n // can be invoked. Don't blindly check just for\n // existence, because it is possible the state\n // manager has a child state of the given name,\n // and we should still raise an exception in that\n // case.\n if (typeof action === 'function') {\n if (log) {\n if (isUnhandledPass) {\n Ember.Logger.log(fmt(\"STATEMANAGER: Unhandled event '%@' being sent to state %@.\", [event, get(currentState, 'path')]));\n } else {\n Ember.Logger.log(fmt(\"STATEMANAGER: Sending event '%@' to state %@.\", [event, get(currentState, 'path')]));\n }\n }\n\n actionArguments = contexts;\n if (isUnhandledPass) {\n actionArguments.unshift(event);\n }\n actionArguments.unshift(this);\n\n return action.apply(currentState, actionArguments);\n } else {\n var parentState = get(currentState, 'parentState');\n if (parentState) {\n\n sendRecursiveArguments = contexts;\n sendRecursiveArguments.unshift(event, parentState, isUnhandledPass);\n\n return sendRecursively.apply(this, sendRecursiveArguments);\n } else if (!isUnhandledPass) {\n return sendEvent.call(this, event, contexts, true);\n }\n }\n};\n\nvar sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {\n sendRecursiveArguments.unshift(eventName, get(this, 'currentState'), isUnhandledPass);\n return sendRecursively.apply(this, sendRecursiveArguments);\n};\n\n/**\n StateManager is part of Ember's implementation of a finite state machine. A\n StateManager instance manages a number of properties that are instances of\n `Ember.State`,\n tracks the current active state, and triggers callbacks when states have changed.\n\n ## Defining States\n\n The states of StateManager can be declared in one of two ways. First, you can\n define a `states` property that contains all the states:\n\n ```javascript\n managerA = Ember.StateManager.create({\n states: {\n stateOne: Ember.State.create(),\n stateTwo: Ember.State.create()\n }\n })\n\n managerA.get('states')\n // {\n // stateOne: Ember.State.create(),\n // stateTwo: Ember.State.create()\n // }\n ```\n\n You can also add instances of `Ember.State` (or an `Ember.State` subclass)\n directly as properties of a StateManager. These states will be collected into\n the `states` property for you.\n\n ```javascript\n managerA = Ember.StateManager.create({\n stateOne: Ember.State.create(),\n stateTwo: Ember.State.create()\n })\n\n managerA.get('states')\n // {\n // stateOne: Ember.State.create(),\n // stateTwo: Ember.State.create()\n // }\n ```\n\n ## The Initial State\n\n When created a StateManager instance will immediately enter into the state\n defined as its `start` property or the state referenced by name in its\n `initialState` property:\n\n ```javascript\n managerA = Ember.StateManager.create({\n start: Ember.State.create({})\n })\n\n managerA.get('currentState.name') // 'start'\n\n managerB = Ember.StateManager.create({\n initialState: 'beginHere',\n beginHere: Ember.State.create({})\n })\n\n managerB.get('currentState.name') // 'beginHere'\n ```\n\n Because it is a property you may also provide a computed function if you wish\n to derive an `initialState` programmatically:\n\n ```javascript\n managerC = Ember.StateManager.create({\n initialState: function(){\n if (someLogic) {\n return 'active';\n } else {\n return 'passive';\n }\n }.property(),\n active: Ember.State.create({}),\n passive: Ember.State.create({})\n })\n ```\n\n ## Moving Between States\n\n A StateManager can have any number of `Ember.State` objects as properties\n and can have a single one of these states as its current state.\n\n Calling `transitionTo` transitions between states:\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({}),\n poweredUp: Ember.State.create({})\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n robotManager.transitionTo('poweredUp')\n robotManager.get('currentState.name') // 'poweredUp'\n ```\n\n Before transitioning into a new state the existing `currentState` will have\n its `exit` method called with the StateManager instance as its first argument\n and an object representing the transition as its second argument.\n\n After transitioning into a new state the new `currentState` will have its\n `enter` method called with the StateManager instance as its first argument\n and an object representing the transition as its second argument.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n exit: function(stateManager){\n console.log(\"exiting the poweredDown state\")\n }\n }),\n poweredUp: Ember.State.create({\n enter: function(stateManager){\n console.log(\"entering the poweredUp state. Destroy all humans.\")\n }\n })\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n robotManager.transitionTo('poweredUp')\n\n // will log\n // 'exiting the poweredDown state'\n // 'entering the poweredUp state. Destroy all humans.'\n ```\n\n Once a StateManager is already in a state, subsequent attempts to enter that\n state will not trigger enter or exit method calls. Attempts to transition\n into a state that the manager does not have will result in no changes in the\n StateManager's current state:\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n exit: function(stateManager){\n console.log(\"exiting the poweredDown state\")\n }\n }),\n poweredUp: Ember.State.create({\n enter: function(stateManager){\n console.log(\"entering the poweredUp state. Destroy all humans.\")\n }\n })\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n robotManager.transitionTo('poweredUp')\n // will log\n // 'exiting the poweredDown state'\n // 'entering the poweredUp state. Destroy all humans.'\n robotManager.transitionTo('poweredUp') // no logging, no state change\n\n robotManager.transitionTo('someUnknownState') // silently fails\n robotManager.get('currentState.name') // 'poweredUp'\n ```\n\n Each state property may itself contain properties that are instances of\n `Ember.State`. The StateManager can transition to specific sub-states in a\n series of transitionTo method calls or via a single transitionTo with the\n full path to the specific state. The StateManager will also keep track of the\n full path to its currentState\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n charging: Ember.State.create(),\n charged: Ember.State.create()\n }),\n poweredUp: Ember.State.create({\n mobile: Ember.State.create(),\n stationary: Ember.State.create()\n })\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n\n robotManager.transitionTo('poweredUp')\n robotManager.get('currentState.name') // 'poweredUp'\n\n robotManager.transitionTo('mobile')\n robotManager.get('currentState.name') // 'mobile'\n\n // transition via a state path\n robotManager.transitionTo('poweredDown.charging')\n robotManager.get('currentState.name') // 'charging'\n\n robotManager.get('currentState.path') // 'poweredDown.charging'\n ```\n\n Enter transition methods will be called for each state and nested child state\n in their hierarchical order. Exit methods will be called for each state and\n its nested states in reverse hierarchical order.\n\n Exit transitions for a parent state are not called when entering into one of\n its child states, only when transitioning to a new section of possible states\n in the hierarchy.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n enter: function(){},\n exit: function(){\n console.log(\"exited poweredDown state\")\n },\n charging: Ember.State.create({\n enter: function(){},\n exit: function(){}\n }),\n charged: Ember.State.create({\n enter: function(){\n console.log(\"entered charged state\")\n },\n exit: function(){\n console.log(\"exited charged state\")\n }\n })\n }),\n poweredUp: Ember.State.create({\n enter: function(){\n console.log(\"entered poweredUp state\")\n },\n exit: function(){},\n mobile: Ember.State.create({\n enter: function(){\n console.log(\"entered mobile state\")\n },\n exit: function(){}\n }),\n stationary: Ember.State.create({\n enter: function(){},\n exit: function(){}\n })\n })\n })\n\n\n robotManager.get('currentState.path') // 'poweredDown'\n robotManager.transitionTo('charged')\n // logs 'entered charged state'\n // but does *not* log 'exited poweredDown state'\n robotManager.get('currentState.name') // 'charged\n\n robotManager.transitionTo('poweredUp.mobile')\n // logs\n // 'exited charged state'\n // 'exited poweredDown state'\n // 'entered poweredUp state'\n // 'entered mobile state'\n ```\n\n During development you can set a StateManager's `enableLogging` property to\n `true` to receive console messages of state transitions.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n enableLogging: true\n })\n ```\n\n ## Managing currentState with Actions\n\n To control which transitions are possible for a given state, and\n appropriately handle external events, the StateManager can receive and\n route action messages to its states via the `send` method. Calling to\n `send` with an action name will begin searching for a method with the same\n name starting at the current state and moving up through the parent states\n in a state hierarchy until an appropriate method is found or the StateManager\n instance itself is reached.\n\n If an appropriately named method is found it will be called with the state\n manager as the first argument and an optional `context` object as the second\n argument.\n\n ```javascript\n managerA = Ember.StateManager.create({\n initialState: 'stateOne.substateOne.subsubstateOne',\n stateOne: Ember.State.create({\n substateOne: Ember.State.create({\n anAction: function(manager, context){\n console.log(\"an action was called\")\n },\n subsubstateOne: Ember.State.create({})\n })\n })\n })\n\n managerA.get('currentState.name') // 'subsubstateOne'\n managerA.send('anAction')\n // 'stateOne.substateOne.subsubstateOne' has no anAction method\n // so the 'anAction' method of 'stateOne.substateOne' is called\n // and logs \"an action was called\"\n // with managerA as the first argument\n // and no second argument\n\n someObject = {}\n managerA.send('anAction', someObject)\n // the 'anAction' method of 'stateOne.substateOne' is called again\n // with managerA as the first argument and\n // someObject as the second argument.\n ```\n\n If the StateManager attempts to send an action but does not find an appropriately named\n method in the current state or while moving upwards through the state hierarchy, it will\n repeat the process looking for a `unhandledEvent` method. If an `unhandledEvent` method is\n found, it will be called with the original event name as the second argument. If an\n `unhandledEvent` method is not found, the StateManager will throw a new Ember.Error.\n\n ```javascript\n managerB = Ember.StateManager.create({\n initialState: 'stateOne.substateOne.subsubstateOne',\n stateOne: Ember.State.create({\n substateOne: Ember.State.create({\n subsubstateOne: Ember.State.create({}),\n unhandledEvent: function(manager, eventName, context) {\n console.log(\"got an unhandledEvent with name \" + eventName);\n }\n })\n })\n })\n\n managerB.get('currentState.name') // 'subsubstateOne'\n managerB.send('anAction')\n // neither `stateOne.substateOne.subsubstateOne` nor any of it's\n // parent states have a handler for `anAction`. `subsubstateOne`\n // also does not have a `unhandledEvent` method, but its parent\n // state, `substateOne`, does, and it gets fired. It will log\n // \"got an unhandledEvent with name anAction\"\n ```\n\n Action detection only moves upwards through the state hierarchy from the current state.\n It does not search in other portions of the hierarchy.\n\n ```javascript\n managerC = Ember.StateManager.create({\n initialState: 'stateOne.substateOne.subsubstateOne',\n stateOne: Ember.State.create({\n substateOne: Ember.State.create({\n subsubstateOne: Ember.State.create({})\n })\n }),\n stateTwo: Ember.State.create({\n anAction: function(manager, context){\n // will not be called below because it is\n // not a parent of the current state\n }\n })\n })\n\n managerC.get('currentState.name') // 'subsubstateOne'\n managerC.send('anAction')\n // Error: <Ember.StateManager:ember132> could not\n // respond to event anAction in state stateOne.substateOne.subsubstateOne.\n ```\n\n Inside of an action method the given state should delegate `transitionTo` calls on its\n StateManager.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown.charging',\n poweredDown: Ember.State.create({\n charging: Ember.State.create({\n chargeComplete: function(manager, context){\n manager.transitionTo('charged')\n }\n }),\n charged: Ember.State.create({\n boot: function(manager, context){\n manager.transitionTo('poweredUp')\n }\n })\n }),\n poweredUp: Ember.State.create({\n beginExtermination: function(manager, context){\n manager.transitionTo('rampaging')\n },\n rampaging: Ember.State.create()\n })\n })\n\n robotManager.get('currentState.name') // 'charging'\n robotManager.send('boot') // throws error, no boot action\n // in current hierarchy\n robotManager.get('currentState.name') // remains 'charging'\n\n robotManager.send('beginExtermination') // throws error, no beginExtermination\n // action in current hierarchy\n robotManager.get('currentState.name') // remains 'charging'\n\n robotManager.send('chargeComplete')\n robotManager.get('currentState.name') // 'charged'\n\n robotManager.send('boot')\n robotManager.get('currentState.name') // 'poweredUp'\n\n robotManager.send('beginExtermination', allHumans)\n robotManager.get('currentState.name') // 'rampaging'\n ```\n\n Transition actions can also be created using the `transitionTo` method of the `Ember.State` class. The\n following example StateManagers are equivalent:\n\n ```javascript\n aManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: Ember.State.transitionTo('stateTwo')\n }),\n stateTwo: Ember.State.create({})\n })\n\n bManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: function(manager, context){\n manager.transitionTo('stateTwo', context)\n }\n }),\n stateTwo: Ember.State.create({})\n })\n ```\n\n @class StateManager\n @namespace Ember\n @extends Ember.State\n**/\nEmber.StateManager = Ember.State.extend({\n /**\n @private\n\n When creating a new statemanager, look for a default state to transition\n into. This state can either be named `start`, or can be specified using the\n `initialState` property.\n\n @method init\n */\n init: function() {\n this._super();\n\n set(this, 'stateMeta', Ember.Map.create());\n\n var initialState = get(this, 'initialState');\n\n if (!initialState && get(this, 'states.start')) {\n initialState = 'start';\n }\n\n if (initialState) {\n this.transitionTo(initialState);\n Ember.assert('Failed to transition to initial state \"' + initialState + '\"', !!get(this, 'currentState'));\n }\n },\n\n stateMetaFor: function(state) {\n var meta = get(this, 'stateMeta'),\n stateMeta = meta.get(state);\n\n if (!stateMeta) {\n stateMeta = {};\n meta.set(state, stateMeta);\n }\n\n return stateMeta;\n },\n\n setStateMeta: function(state, key, value) {\n return set(this.stateMetaFor(state), key, value);\n },\n\n getStateMeta: function(state, key) {\n return get(this.stateMetaFor(state), key);\n },\n\n /**\n The current state from among the manager's possible states. This property should\n not be set directly. Use `transitionTo` to move between states by name.\n\n @property currentState\n @type Ember.State\n */\n currentState: null,\n\n /**\n The path of the current state. Returns a string representation of the current\n state.\n\n @property currentPath\n @type String\n */\n currentPath: Ember.computed.alias('currentState.path'),\n\n /**\n The name of transitionEvent that this stateManager will dispatch\n\n @property transitionEvent\n @type String\n @default 'setup'\n */\n transitionEvent: 'setup',\n\n /**\n If set to true, `errorOnUnhandledEvents` will cause an exception to be\n raised if you attempt to send an event to a state manager that is not\n handled by the current state or any of its parent states.\n\n @property errorOnUnhandledEvents\n @type Boolean\n @default true\n */\n errorOnUnhandledEvent: true,\n\n send: function(event) {\n var contexts = [].slice.call(arguments, 1);\n Ember.assert('Cannot send event \"' + event + '\" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));\n return sendEvent.call(this, event, contexts, false);\n },\n unhandledEvent: function(manager, event) {\n if (get(this, 'errorOnUnhandledEvent')) {\n throw new Ember.Error(this.toString() + \" could not respond to event \" + event + \" in state \" + get(this, 'currentState.path') + \".\");\n }\n },\n\n /**\n Finds a state by its state path.\n\n Example:\n\n ```javascript\n manager = Ember.StateManager.create({\n root: Ember.State.create({\n dashboard: Ember.State.create()\n })\n });\n\n manager.getStateByPath(manager, \"root.dashboard\")\n\n // returns the dashboard state\n ```\n\n @method getStateByPath\n @param {Ember.State} root the state to start searching from\n @param {String} path the state path to follow\n @return {Ember.State} the state at the end of the path\n */\n getStateByPath: function(root, path) {\n var parts = path.split('.'),\n state = root;\n\n for (var i=0, len=parts.length; i<len; i++) {\n state = get(get(state, 'states'), parts[i]);\n if (!state) { break; }\n }\n\n return state;\n },\n\n findStateByPath: function(state, path) {\n var possible;\n\n while (!possible && state) {\n possible = this.getStateByPath(state, path);\n state = get(state, 'parentState');\n }\n\n return possible;\n },\n\n /**\n A state stores its child states in its `states` hash.\n This code takes a path like `posts.show` and looks\n up `root.states.posts.states.show`.\n\n It returns a list of all of the states from the\n root, which is the list of states to call `enter`\n on.\n\n @method getStatesInPath\n @param root\n @param path\n */\n getStatesInPath: function(root, path) {\n if (!path || path === \"\") { return undefined; }\n var parts = path.split('.'),\n result = [],\n states,\n state;\n\n for (var i=0, len=parts.length; i<len; i++) {\n states = get(root, 'states');\n if (!states) { return undefined; }\n state = get(states, parts[i]);\n if (state) { root = state; result.push(state); }\n else { return undefined; }\n }\n\n return result;\n },\n\n goToState: function() {\n // not deprecating this yet so people don't constantly need to\n // make trivial changes for little reason.\n return this.transitionTo.apply(this, arguments);\n },\n\n transitionTo: function(path, context) {\n // XXX When is transitionTo called with no path\n if (Ember.isEmpty(path)) { return; }\n\n // The ES6 signature of this function is `path, ...contexts`\n var contexts = context ? Array.prototype.slice.call(arguments, 1) : [],\n currentState = get(this, 'currentState') || this;\n\n // First, get the enter, exit and resolve states for the current state\n // and specified path. If possible, use an existing cache.\n var hash = this.contextFreeTransition(currentState, path);\n\n // Next, process the raw state information for the contexts passed in.\n var transition = new Transition(hash).normalize(this, contexts);\n\n this.enterState(transition);\n this.triggerSetupContext(transition);\n },\n\n contextFreeTransition: function(currentState, path) {\n var cache = currentState.pathsCache[path];\n if (cache) { return cache; }\n\n var enterStates = this.getStatesInPath(currentState, path),\n exitStates = [],\n resolveState = currentState;\n\n // Walk up the states. For each state, check whether a state matching\n // the `path` is nested underneath. This will find the closest\n // parent state containing `path`.\n //\n // This allows the user to pass in a relative path. For example, for\n // the following state hierarchy:\n //\n // | |root\n // | |- posts\n // | | |- show (* current)\n // | |- comments\n // | | |- show\n //\n // If the current state is `<root.posts.show>`, an attempt to\n // transition to `comments.show` will match `<root.comments.show>`.\n //\n // First, this code will look for root.posts.show.comments.show.\n // Next, it will look for root.posts.comments.show. Finally,\n // it will look for `root.comments.show`, and find the state.\n //\n // After this process, the following variables will exist:\n //\n // * resolveState: a common parent state between the current\n // and target state. In the above example, `<root>` is the\n // `resolveState`.\n // * enterStates: a list of all of the states represented\n // by the path from the `resolveState`. For example, for\n // the path `root.comments.show`, `enterStates` would have\n // `[<root.comments>, <root.comments.show>]`\n // * exitStates: a list of all of the states from the\n // `resolveState` to the `currentState`. In the above\n // example, `exitStates` would have\n // `[<root.posts>`, `<root.posts.show>]`.\n while (resolveState && !enterStates) {\n exitStates.unshift(resolveState);\n\n resolveState = get(resolveState, 'parentState');\n if (!resolveState) {\n enterStates = this.getStatesInPath(this, path);\n if (!enterStates) {\n Ember.assert('Could not find state for path: \"'+path+'\"');\n return;\n }\n }\n enterStates = this.getStatesInPath(resolveState, path);\n }\n\n // If the path contains some states that are parents of both the\n // current state and the target state, remove them.\n //\n // For example, in the following hierarchy:\n //\n // |- root\n // | |- post\n // | | |- index (* current)\n // | | |- show\n //\n // If the `path` is `root.post.show`, the three variables will\n // be:\n //\n // * resolveState: `<state manager>`\n // * enterStates: `[<root>, <root.post>, <root.post.show>]`\n // * exitStates: `[<root>, <root.post>, <root.post.index>]`\n //\n // The goal of this code is to remove the common states, so we\n // have:\n //\n // * resolveState: `<root.post>`\n // * enterStates: `[<root.post.show>]`\n // * exitStates: `[<root.post.index>]`\n //\n // This avoid unnecessary calls to the enter and exit transitions.\n while (enterStates.length > 0 && enterStates[0] === exitStates[0]) {\n resolveState = enterStates.shift();\n exitStates.shift();\n }\n\n // Cache the enterStates, exitStates, and resolveState for the\n // current state and the `path`.\n var transitions = currentState.pathsCache[path] = {\n exitStates: exitStates,\n enterStates: enterStates,\n resolveState: resolveState\n };\n\n return transitions;\n },\n\n triggerSetupContext: function(transitions) {\n var contexts = transitions.contexts,\n offset = transitions.enterStates.length - contexts.length,\n enterStates = transitions.enterStates,\n transitionEvent = get(this, 'transitionEvent');\n\n Ember.assert(\"More contexts provided than states\", offset >= 0);\n\n arrayForEach.call(enterStates, function(state, idx) {\n state.trigger(transitionEvent, this, contexts[idx-offset]);\n }, this);\n },\n\n getState: function(name) {\n var state = get(this, name),\n parentState = get(this, 'parentState');\n\n if (state) {\n return state;\n } else if (parentState) {\n return parentState.getState(name);\n }\n },\n\n enterState: function(transition) {\n var log = this.enableLogging;\n\n var exitStates = transition.exitStates.slice(0).reverse();\n arrayForEach.call(exitStates, function(state) {\n state.trigger('exit', this);\n }, this);\n\n arrayForEach.call(transition.enterStates, function(state) {\n if (log) { Ember.Logger.log(\"STATEMANAGER: Entering \" + get(state, 'path')); }\n state.trigger('enter', this);\n }, this);\n\n set(this, 'currentState', transition.finalState);\n }\n});\n\n})();\n//@ sourceURL=ember-states/state_manager");minispade.register('ember-views/core', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar jQuery = Ember.imports.jQuery;\nEmber.assert(\"Ember Views require jQuery 1.8 or 1.9\", jQuery && (jQuery().jquery.match(/^1\\.(8|9)(\\.\\d+)?(pre|rc\\d?)?/) || Ember.ENV.FORCE_JQUERY));\n\n/**\n Alias for jQuery\n\n @method $\n @for Ember\n*/\nEmber.$ = jQuery;\n\n})();\n//@ sourceURL=ember-views/core");minispade.register('ember-views', "(function() {/*globals jQuery*/\nminispade.require(\"ember-runtime\");\nminispade.require(\"container\");\n\n/**\nEmber Views\n\n@module ember\n@submodule ember-views\n@requires ember-runtime\n@main ember-views\n*/\nminispade.require(\"ember-views/core\");\nminispade.require(\"ember-views/system\");\nminispade.require(\"ember-views/views\");\n\n})();\n//@ sourceURL=ember-views");minispade.register('ember-views/system', "(function() {minispade.require(\"ember-views/system/jquery_ext\");\nminispade.require(\"ember-views/system/utils\");\nminispade.require(\"ember-views/system/render_buffer\");\nminispade.require(\"ember-views/system/event_dispatcher\");\nminispade.require(\"ember-views/system/ext\");\nminispade.require(\"ember-views/system/controller\");\n\n})();\n//@ sourceURL=ember-views/system");minispade.register('ember-views/system/controller', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n// Original class declaration and documentation in runtime/lib/controllers/controller.js\n// NOTE: It may be possible with YUIDoc to combine docs in two locations\n\n/**\nAdditional methods for the ControllerMixin\n\n@class ControllerMixin\n@namespace Ember\n*/\nEmber.ControllerMixin.reopen({\n target: null,\n namespace: null,\n view: null,\n container: null,\n _childContainers: null,\n\n init: function() {\n this._super();\n set(this, '_childContainers', {});\n },\n\n _modelDidChange: Ember.observer(function() {\n var containers = get(this, '_childContainers');\n\n for (var prop in containers) {\n if (!containers.hasOwnProperty(prop)) { continue; }\n containers[prop].destroy();\n }\n\n set(this, '_childContainers', {});\n }, 'model')\n});\n\n})();\n//@ sourceURL=ember-views/system/controller");minispade.register('ember-views/system/event_dispatcher', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.EventDispatcher` handles delegating browser events to their\n corresponding `Ember.Views.` For example, when you click on a view,\n `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets\n called.\n\n @class EventDispatcher\n @namespace Ember\n @private\n @extends Ember.Object\n*/\nEmber.EventDispatcher = Ember.Object.extend(\n/** @scope Ember.EventDispatcher.prototype */{\n\n /**\n @private\n\n The root DOM element to which event listeners should be attached. Event\n listeners will be attached to the document unless this is overridden.\n\n Can be specified as a DOMElement or a selector string.\n\n The default body is a string since this may be evaluated before document.body\n exists in the DOM.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n @private\n\n Sets up event listeners for standard browser events.\n\n This will be called after the browser sends a `DOMContentReady` event. By\n default, it will set up all of the listeners on the document body. If you\n would like to register the listeners on a different element, set the event\n dispatcher's `root` property.\n\n @method setup\n @param addedEvents {Hash}\n */\n setup: function(addedEvents) {\n var event, events = {\n touchstart : 'touchStart',\n touchmove : 'touchMove',\n touchend : 'touchEnd',\n touchcancel : 'touchCancel',\n keydown : 'keyDown',\n keyup : 'keyUp',\n keypress : 'keyPress',\n mousedown : 'mouseDown',\n mouseup : 'mouseUp',\n contextmenu : 'contextMenu',\n click : 'click',\n dblclick : 'doubleClick',\n mousemove : 'mouseMove',\n focusin : 'focusIn',\n focusout : 'focusOut',\n mouseenter : 'mouseEnter',\n mouseleave : 'mouseLeave',\n submit : 'submit',\n input : 'input',\n change : 'change',\n dragstart : 'dragStart',\n drag : 'drag',\n dragenter : 'dragEnter',\n dragleave : 'dragLeave',\n dragover : 'dragOver',\n drop : 'drop',\n dragend : 'dragEnd'\n };\n\n Ember.$.extend(events, addedEvents || {});\n\n var rootElement = Ember.$(get(this, 'rootElement'));\n\n Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));\n Ember.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length);\n Ember.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length);\n\n rootElement.addClass('ember-application');\n\n Ember.assert('Unable to add \"ember-application\" class to rootElement. Make sure you set rootElement to the body or an element in the body.', rootElement.is('.ember-application'));\n\n for (event in events) {\n if (events.hasOwnProperty(event)) {\n this.setupHandler(rootElement, event, events[event]);\n }\n }\n },\n\n /**\n @private\n\n Registers an event listener on the document. If the given event is\n triggered, the provided event handler will be triggered on the target view.\n\n If the target view does not implement the event handler, or if the handler\n returns `false`, the parent view will be called. The event will continue to\n bubble to each successive parent view until it reaches the top.\n\n For example, to have the `mouseDown` method called on the target view when\n a `mousedown` event is received from the browser, do the following:\n\n ```javascript\n setupHandler('mousedown', 'mouseDown');\n ```\n\n @method setupHandler\n @param {Element} rootElement\n @param {String} event the browser-originated event to listen to\n @param {String} eventName the name of the method to call on the view\n */\n setupHandler: function(rootElement, event, eventName) {\n var self = this;\n\n rootElement.delegate('.ember-view', event + '.ember', function(evt, triggeringManager) {\n return Ember.handleErrors(function() {\n var view = Ember.View.views[this.id],\n result = true, manager = null;\n\n manager = self._findNearestEventManager(view,eventName);\n\n if (manager && manager !== triggeringManager) {\n result = self._dispatchEvent(manager, evt, eventName, view);\n } else if (view) {\n result = self._bubbleEvent(view,evt,eventName);\n } else {\n evt.stopPropagation();\n }\n\n return result;\n }, this);\n });\n\n rootElement.delegate('[data-ember-action]', event + '.ember', function(evt) {\n return Ember.handleErrors(function() {\n var actionId = Ember.$(evt.currentTarget).attr('data-ember-action'),\n action = Ember.Handlebars.ActionHelper.registeredActions[actionId];\n\n // We have to check for action here since in some cases, jQuery will trigger\n // an event on `removeChild` (i.e. focusout) after we've already torn down the\n // action handlers for the view.\n if (action && action.eventName === eventName) {\n return action.handler(evt);\n }\n }, this);\n });\n },\n\n _findNearestEventManager: function(view, eventName) {\n var manager = null;\n\n while (view) {\n manager = get(view, 'eventManager');\n if (manager && manager[eventName]) { break; }\n\n view = get(view, 'parentView');\n }\n\n return manager;\n },\n\n _dispatchEvent: function(object, evt, eventName, view) {\n var result = true;\n\n var handler = object[eventName];\n if (Ember.typeOf(handler) === 'function') {\n result = handler.call(object, evt, view);\n // Do not preventDefault in eventManagers.\n evt.stopPropagation();\n }\n else {\n result = this._bubbleEvent(view, evt, eventName);\n }\n\n return result;\n },\n\n _bubbleEvent: function(view, evt, eventName) {\n return Ember.run(function() {\n return view.handleEvent(eventName, evt);\n });\n },\n\n destroy: function() {\n var rootElement = get(this, 'rootElement');\n Ember.$(rootElement).undelegate('.ember').removeClass('ember-application');\n return this._super();\n }\n});\n\n})();\n//@ sourceURL=ember-views/system/event_dispatcher");minispade.register('ember-views/system/ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n// Add a new named queue for rendering views that happens\n// after bindings have synced, and a queue for scheduling actions\n// that that should occur after view rendering.\nvar queues = Ember.run.queues,\n indexOf = Ember.ArrayPolyfills.indexOf;\nqueues.splice(indexOf.call(queues, 'actions')+1, 0, 'render', 'afterRender');\n\n})();\n//@ sourceURL=ember-views/system/ext");minispade.register('ember-views/system/jquery_ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\nif (Ember.$) {\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents\n var dragEvents = Ember.String.w('dragstart drag dragenter dragleave dragover drop dragend');\n\n // Copies the `dataTransfer` property from a browser event object onto the\n // jQuery event object for the specified events\n Ember.EnumerableUtils.forEach(dragEvents, function(eventName) {\n Ember.$.event.fixHooks[eventName] = { props: ['dataTransfer'] };\n });\n}\n\n})();\n//@ sourceURL=ember-views/system/jquery_ext");minispade.register('ember-views/system/render_buffer', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar ClassSet = function() {\n this.seen = {};\n this.list = [];\n};\n\nClassSet.prototype = {\n add: function(string) {\n if (string in this.seen) { return; }\n this.seen[string] = true;\n\n this.list.push(string);\n },\n\n toDOM: function() {\n return this.list.join(\" \");\n }\n};\n\n/**\n `Ember.RenderBuffer` gathers information regarding the a view and generates the\n final representation. `Ember.RenderBuffer` will generate HTML which can be pushed\n to the DOM.\n\n @class RenderBuffer\n @namespace Ember\n @constructor\n*/\nEmber.RenderBuffer = function(tagName) {\n return new Ember._RenderBuffer(tagName);\n};\n\nEmber._RenderBuffer = function(tagName) {\n this.tagNames = [tagName || null];\n this.buffer = [];\n};\n\nEmber._RenderBuffer.prototype =\n/** @scope Ember.RenderBuffer.prototype */ {\n\n // The root view's element\n _element: null,\n\n /**\n @private\n\n An internal set used to de-dupe class names when `addClass()` is\n used. After each call to `addClass()`, the `classes` property\n will be updated.\n\n @property elementClasses\n @type Array\n @default []\n */\n elementClasses: null,\n\n /**\n Array of class names which will be applied in the class attribute.\n\n You can use `setClasses()` to set this property directly. If you\n use `addClass()`, it will be maintained for you.\n\n @property classes\n @type Array\n @default []\n */\n classes: null,\n\n /**\n The id in of the element, to be applied in the id attribute.\n\n You should not set this property yourself, rather, you should use\n the `id()` method of `Ember.RenderBuffer`.\n\n @property elementId\n @type String\n @default null\n */\n elementId: null,\n\n /**\n A hash keyed on the name of the attribute and whose value will be\n applied to that attribute. For example, if you wanted to apply a\n `data-view=\"Foo.bar\"` property to an element, you would set the\n elementAttributes hash to `{'data-view':'Foo.bar'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `attr()` method of `Ember.RenderBuffer`.\n\n @property elementAttributes\n @type Hash\n @default {}\n */\n elementAttributes: null,\n\n /**\n A hash keyed on the name of the properties and whose value will be\n applied to that property. For example, if you wanted to apply a\n `checked=true` property to an element, you would set the\n elementProperties hash to `{'checked':true}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `prop()` method of `Ember.RenderBuffer`.\n\n @property elementProperties\n @type Hash\n @default {}\n */\n elementProperties: null,\n\n /**\n The tagname of the element an instance of `Ember.RenderBuffer` represents.\n\n Usually, this gets set as the first parameter to `Ember.RenderBuffer`. For\n example, if you wanted to create a `p` tag, then you would call\n\n ```javascript\n Ember.RenderBuffer('p')\n ```\n\n @property elementTag\n @type String\n @default null\n */\n elementTag: null,\n\n /**\n A hash keyed on the name of the style attribute and whose value will\n be applied to that attribute. For example, if you wanted to apply a\n `background-color:black;` style to an element, you would set the\n elementStyle hash to `{'background-color':'black'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `style()` method of `Ember.RenderBuffer`.\n\n @property elementStyle\n @type Hash\n @default {}\n */\n elementStyle: null,\n\n /**\n Nested `RenderBuffers` will set this to their parent `RenderBuffer`\n instance.\n\n @property parentBuffer\n @type Ember._RenderBuffer\n */\n parentBuffer: null,\n\n /**\n Adds a string of HTML to the `RenderBuffer`.\n\n @method push\n @param {String} string HTML to push into the buffer\n @chainable\n */\n push: function(string) {\n this.buffer.push(string);\n return this;\n },\n\n /**\n Adds a class to the buffer, which will be rendered to the class attribute.\n\n @method addClass\n @param {String} className Class name to add to the buffer\n @chainable\n */\n addClass: function(className) {\n // lazily create elementClasses\n this.elementClasses = (this.elementClasses || new ClassSet());\n this.elementClasses.add(className);\n this.classes = this.elementClasses.list;\n\n return this;\n },\n\n setClasses: function(classNames) {\n this.classes = classNames;\n },\n\n /**\n Sets the elementID to be used for the element.\n\n @method id\n @param {String} id\n @chainable\n */\n id: function(id) {\n this.elementId = id;\n return this;\n },\n\n // duck type attribute functionality like jQuery so a render buffer\n // can be used like a jQuery object in attribute binding scenarios.\n\n /**\n Adds an attribute which will be rendered to the element.\n\n @method attr\n @param {String} name The name of the attribute\n @param {String} value The value to add to the attribute\n @chainable\n @return {Ember.RenderBuffer|String} this or the current attribute value\n */\n attr: function(name, value) {\n var attributes = this.elementAttributes = (this.elementAttributes || {});\n\n if (arguments.length === 1) {\n return attributes[name];\n } else {\n attributes[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an attribute from the list of attributes to render.\n\n @method removeAttr\n @param {String} name The name of the attribute\n @chainable\n */\n removeAttr: function(name) {\n var attributes = this.elementAttributes;\n if (attributes) { delete attributes[name]; }\n\n return this;\n },\n\n /**\n Adds an property which will be rendered to the element.\n\n @method prop\n @param {String} name The name of the property\n @param {String} value The value to add to the property\n @chainable\n @return {Ember.RenderBuffer|String} this or the current property value\n */\n prop: function(name, value) {\n var properties = this.elementProperties = (this.elementProperties || {});\n\n if (arguments.length === 1) {\n return properties[name];\n } else {\n properties[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an property from the list of properties to render.\n\n @method removeProp\n @param {String} name The name of the property\n @chainable\n */\n removeProp: function(name) {\n var properties = this.elementProperties;\n if (properties) { delete properties[name]; }\n\n return this;\n },\n\n /**\n Adds a style to the style attribute which will be rendered to the element.\n\n @method style\n @param {String} name Name of the style\n @param {String} value\n @chainable\n */\n style: function(name, value) {\n this.elementStyle = (this.elementStyle || {});\n\n this.elementStyle[name] = value;\n return this;\n },\n\n begin: function(tagName) {\n this.tagNames.push(tagName || null);\n return this;\n },\n\n pushOpeningTag: function() {\n var tagName = this.currentTagName();\n if (!tagName) { return; }\n\n if (!this._element && this.buffer.length === 0) {\n this._element = this.generateElement();\n return;\n }\n\n var buffer = this.buffer,\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n attr, prop;\n\n buffer.push('<' + tagName);\n\n if (id) {\n buffer.push(' id=\"' + this._escapeAttribute(id) + '\"');\n this.elementId = null;\n }\n if (classes) {\n buffer.push(' class=\"' + this._escapeAttribute(classes.join(' ')) + '\"');\n this.classes = null;\n }\n\n if (style) {\n buffer.push(' style=\"');\n\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n buffer.push(prop + ':' + this._escapeAttribute(style[prop]) + ';');\n }\n }\n\n buffer.push('\"');\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n buffer.push(' ' + attr + '=\"' + this._escapeAttribute(attrs[attr]) + '\"');\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n var value = props[prop];\n if (value || typeof(value) === 'number') {\n if (value === true) {\n buffer.push(' ' + prop + '=\"' + prop + '\"');\n } else {\n buffer.push(' ' + prop + '=\"' + this._escapeAttribute(props[prop]) + '\"');\n }\n }\n }\n }\n\n this.elementProperties = null;\n }\n\n buffer.push('>');\n },\n\n pushClosingTag: function() {\n var tagName = this.tagNames.pop();\n if (tagName) { this.buffer.push('</' + tagName + '>'); }\n },\n\n currentTagName: function() {\n return this.tagNames[this.tagNames.length-1];\n },\n\n generateElement: function() {\n var tagName = this.tagNames.pop(), // pop since we don't need to close\n element = document.createElement(tagName),\n $element = Ember.$(element),\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n styleBuffer = '', attr, prop;\n\n if (id) {\n $element.attr('id', id);\n this.elementId = null;\n }\n if (classes) {\n $element.attr('class', classes.join(' '));\n this.classes = null;\n }\n\n if (style) {\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n styleBuffer += (prop + ':' + style[prop] + ';');\n }\n }\n\n $element.attr('style', styleBuffer);\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n $element.attr(attr, attrs[attr]);\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n $element.prop(prop, props[prop]);\n }\n }\n\n this.elementProperties = null;\n }\n\n return element;\n },\n\n /**\n @method element\n @return {DOMElement} The element corresponding to the generated HTML\n of this buffer\n */\n element: function() {\n var html = this.innerString();\n\n if (html) {\n this._element = Ember.ViewUtils.setInnerHTML(this._element, html);\n }\n\n return this._element;\n },\n\n /**\n Generates the HTML content for this buffer.\n\n @method string\n @return {String} The generated HTML\n */\n string: function() {\n if (this._element) {\n return this.element().outerHTML;\n } else {\n return this.innerString();\n }\n },\n\n innerString: function() {\n return this.buffer.join('');\n },\n\n _escapeAttribute: function(value) {\n // Stolen shamelessly from Handlebars\n\n var escape = {\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n \"`\": \"`\"\n };\n\n var badChars = /&(?!\\w+;)|[<>\"'`]/g;\n var possible = /[&<>\"'`]/;\n\n var escapeChar = function(chr) {\n return escape[chr] || \"&\";\n };\n\n var string = value.toString();\n\n if(!possible.test(string)) { return string; }\n return string.replace(badChars, escapeChar);\n }\n\n};\n\n})();\n//@ sourceURL=ember-views/system/render_buffer");minispade.register('ember-views/system/utils', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n/*** BEGIN METAMORPH HELPERS ***/\n\n// Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n// is a \"zero-scope\" element. This problem can be worked around by making\n// the first node an invisible text node. We, like Modernizr, use ­\n\nvar needsShy = this.document && (function(){\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n})();\n\n// IE 8 (and likely earlier) likes to move whitespace preceeding\n// a script tag to appear after it. This means that we can\n// accidentally remove whitespace when updating a morph.\nvar movesWhitespace = this.document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n})();\n\n// Use this to find children by ID instead of using jQuery\nvar findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n};\n\nvar setInnerHTMLWithoutFix = function(element, html) {\n if (needsShy) {\n html = '­' + html;\n }\n\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n\n if (needsShy) {\n var shyElement = element.firstChild;\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n};\n\n/*** END METAMORPH HELPERS */\n\n\nvar innerHTMLTags = {};\nvar canSetInnerHTML = function(tagName) {\n if (innerHTMLTags[tagName] !== undefined) {\n return innerHTMLTags[tagName];\n }\n\n var canSet = true;\n\n // IE 8 and earlier don't allow us to do innerHTML on select\n if (tagName.toLowerCase() === 'select') {\n var el = document.createElement('select');\n setInnerHTMLWithoutFix(el, '<option value=\"test\">Test</option>');\n canSet = el.options.length === 1;\n }\n\n innerHTMLTags[tagName] = canSet;\n\n return canSet;\n};\n\nvar setInnerHTML = function(element, html) {\n var tagName = element.tagName;\n\n if (canSetInnerHTML(tagName)) {\n setInnerHTMLWithoutFix(element, html);\n } else {\n Ember.assert(\"Can't set innerHTML on \"+element.tagName+\" in this browser\", element.outerHTML);\n\n var startTag = element.outerHTML.match(new RegExp(\"<\"+tagName+\"([^>]*)>\", 'i'))[0],\n endTag = '</'+tagName+'>';\n\n var wrapper = document.createElement('div');\n setInnerHTMLWithoutFix(wrapper, startTag + html + endTag);\n element = wrapper.firstChild;\n while (element.tagName !== tagName) {\n element = element.nextSibling;\n }\n }\n\n return element;\n};\n\nfunction isSimpleClick(event) {\n var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,\n secondaryClick = event.which > 1; // IE9 may return undefined\n\n return !modifier && !secondaryClick;\n}\n\nEmber.ViewUtils = {\n setInnerHTML: setInnerHTML,\n isSimpleClick: isSimpleClick\n};\n\n})();\n//@ sourceURL=ember-views/system/utils");minispade.register('ember-views/views', "(function() {minispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-views/views/states\");\nminispade.require(\"ember-views/views/container_view\");\nminispade.require(\"ember-views/views/collection_view\");\n\n})();\n//@ sourceURL=ember-views/views");minispade.register('ember-views/views/collection_view', "(function() {minispade.require('ember-views/views/container_view');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.CollectionView` is an `Ember.View` descendent responsible for managing\n a collection (an array or array-like object) by maintaing a child view object\n and associated DOM representation for each item in the array and ensuring\n that child views and their associated rendered HTML are updated when items in\n the array are added, removed, or replaced.\n\n ## Setting content\n\n The managed collection of objects is referenced as the `Ember.CollectionView`\n instance's `content` property.\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n content: ['A', 'B','C']\n })\n ```\n\n The view for each item in the collection will have its `content` property set\n to the item.\n\n ## Specifying itemViewClass\n\n By default the view class for each item in the managed collection will be an\n instance of `Ember.View`. You can supply a different class by setting the\n `CollectionView`'s `itemViewClass` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n classNames: ['a-collection'],\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n someItemsView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view a-collection\">\n <div class=\"ember-view\">the letter: A</div>\n <div class=\"ember-view\">the letter: B</div>\n <div class=\"ember-view\">the letter: C</div>\n </div>\n ```\n\n ## Automatic matching of parent/child tagNames\n\n Setting the `tagName` property of a `CollectionView` to any of\n \"ul\", \"ol\", \"table\", \"thead\", \"tbody\", \"tfoot\", \"tr\", or \"select\" will result\n in the item views receiving an appropriately matched `tagName` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n anUndorderedListView = Ember.CollectionView.create({\n tagName: 'ul',\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n anUndorderedListView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <ul class=\"ember-view a-collection\">\n <li class=\"ember-view\">the letter: A</li>\n <li class=\"ember-view\">the letter: B</li>\n <li class=\"ember-view\">the letter: C</li>\n </ul>\n ```\n\n Additional `tagName` pairs can be provided by adding to\n `Ember.CollectionView.CONTAINER_MAP `\n\n ```javascript\n Ember.CollectionView.CONTAINER_MAP['article'] = 'section'\n ```\n\n ## Programatic creation of child views\n\n For cases where additional customization beyond the use of a single\n `itemViewClass` or `tagName` matching is required CollectionView's\n `createChildView` method can be overidden:\n\n ```javascript\n CustomCollectionView = Ember.CollectionView.extend({\n createChildView: function(viewClass, attrs) {\n if (attrs.content.kind == 'album') {\n viewClass = App.AlbumView;\n } else {\n viewClass = App.SongView;\n }\n return this._super(viewClass, attrs);\n }\n });\n ```\n\n ## Empty View\n\n You can provide an `Ember.View` subclass to the `Ember.CollectionView`\n instance as its `emptyView` property. If the `content` property of a\n `CollectionView` is set to `null` or an empty array, an instance of this view\n will be the `CollectionView`s only child.\n\n ```javascript\n aListWithNothing = Ember.CollectionView.create({\n classNames: ['nothing']\n content: null,\n emptyView: Ember.View.extend({\n template: Ember.Handlebars.compile(\"The collection is empty\")\n })\n });\n\n aListWithNothing.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view nothing\">\n <div class=\"ember-view\">\n The collection is empty\n </div>\n </div>\n ```\n\n ## Adding and Removing items\n\n The `childViews` property of a `CollectionView` should not be directly\n manipulated. Instead, add, remove, replace items from its `content` property.\n This will trigger appropriate changes to its rendered HTML.\n\n ## Use in templates via the `{{collection}}` `Ember.Handlebars` helper\n\n `Ember.Handlebars` provides a helper specifically for adding\n `CollectionView`s to templates. See `Ember.Handlebars.collection` for more\n details\n\n @class CollectionView\n @namespace Ember\n @extends Ember.ContainerView\n @since Ember 0.9\n*/\nEmber.CollectionView = Ember.ContainerView.extend(\n/** @scope Ember.CollectionView.prototype */ {\n\n /**\n A list of items to be displayed by the `Ember.CollectionView`.\n\n @property content\n @type Ember.Array\n @default null\n */\n content: null,\n\n /**\n @private\n\n This provides metadata about what kind of empty view class this\n collection would like if it is being instantiated from another\n system (like Handlebars)\n\n @property emptyViewClass\n */\n emptyViewClass: Ember.View,\n\n /**\n An optional view to display if content is set to an empty array.\n\n @property emptyView\n @type Ember.View\n @default null\n */\n emptyView: null,\n\n /**\n @property itemViewClass\n @type Ember.View\n @default Ember.View\n */\n itemViewClass: Ember.View,\n\n init: function() {\n var ret = this._super();\n this._contentDidChange();\n return ret;\n },\n\n _contentWillChange: Ember.beforeObserver(function() {\n var content = this.get('content');\n\n if (content) { content.removeArrayObserver(this); }\n var len = content ? get(content, 'length') : 0;\n this.arrayWillChange(content, 0, len);\n }, 'content'),\n\n /**\n @private\n\n Check to make sure that the content has changed, and if so,\n update the children directly. This is always scheduled\n asynchronously, to allow the element to be created before\n bindings have synchronized and vice versa.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer(function() {\n var content = get(this, 'content');\n\n if (content) {\n Ember.assert(fmt(\"an Ember.CollectionView's content must implement Ember.Array. You passed %@\", [content]), Ember.Array.detect(content));\n content.addArrayObserver(this);\n }\n\n var len = content ? get(content, 'length') : 0;\n this.arrayDidChange(content, 0, null, len);\n }, 'content'),\n\n willDestroy: function() {\n var content = get(this, 'content');\n if (content) { content.removeArrayObserver(this); }\n\n this._super();\n\n if (this._createdEmptyView) {\n this._createdEmptyView.destroy();\n }\n },\n\n arrayWillChange: function(content, start, removedCount) {\n // If the contents were empty before and this template collection has an\n // empty view remove it now.\n var emptyView = get(this, 'emptyView');\n if (emptyView && emptyView instanceof Ember.View) {\n emptyView.removeFromParent();\n }\n\n // Loop through child views that correspond with the removed items.\n // Note that we loop from the end of the array to the beginning because\n // we are mutating it as we go.\n var childViews = this._childViews, childView, idx, len;\n\n len = this._childViews.length;\n\n var removingAll = removedCount === len;\n\n if (removingAll) {\n this.currentState.empty(this);\n }\n\n for (idx = start + removedCount - 1; idx >= start; idx--) {\n childView = childViews[idx];\n if (removingAll) { childView.removedFromDOM = true; }\n childView.destroy();\n }\n },\n\n /**\n Called when a mutation to the underlying content array occurs.\n\n This method will replay that mutation against the views that compose the\n `Ember.CollectionView`, ensuring that the view reflects the model.\n\n This array observer is added in `contentDidChange`.\n\n @method arrayDidChange\n @param {Array} addedObjects the objects that were added to the content\n @param {Array} removedObjects the objects that were removed from the content\n @param {Number} changeIndex the index at which the changes occurred\n */\n arrayDidChange: function(content, start, removed, added) {\n var itemViewClass = get(this, 'itemViewClass'),\n addedViews = [], view, item, idx, len;\n\n if ('string' === typeof itemViewClass) {\n itemViewClass = get(itemViewClass);\n }\n\n Ember.assert(fmt(\"itemViewClass must be a subclass of Ember.View, not %@\", [itemViewClass]), Ember.View.detect(itemViewClass));\n\n len = content ? get(content, 'length') : 0;\n if (len) {\n for (idx = start; idx < start+added; idx++) {\n item = content.objectAt(idx);\n\n view = this.createChildView(itemViewClass, {\n content: item,\n contentIndex: idx\n });\n\n addedViews.push(view);\n }\n } else {\n var emptyView = get(this, 'emptyView');\n if (!emptyView) { return; }\n\n var isClass = Ember.CoreView.detect(emptyView);\n\n emptyView = this.createChildView(emptyView);\n addedViews.push(emptyView);\n set(this, 'emptyView', emptyView);\n\n if (isClass) { this._createdEmptyView = emptyView; }\n }\n this.replace(start, 0, addedViews);\n },\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n var itemTagName = get(view, 'tagName');\n var tagName = (itemTagName === null || itemTagName === undefined) ? Ember.CollectionView.CONTAINER_MAP[get(this, 'tagName')] : itemTagName;\n\n set(view, 'tagName', tagName);\n\n return view;\n }\n});\n\n/**\n A map of parent tags to their default child tags. You can add\n additional parent tags if you want collection views that use\n a particular parent tag to default to a child tag.\n\n @property CONTAINER_MAP\n @type Hash\n @static\n @final\n*/\nEmber.CollectionView.CONTAINER_MAP = {\n ul: 'li',\n ol: 'li',\n table: 'tr',\n thead: 'tr',\n tbody: 'tr',\n tfoot: 'tr',\n tr: 'td',\n select: 'option'\n};\n\n})();\n//@ sourceURL=ember-views/views/collection_view");minispade.register('ember-views/views/container_view', "(function() {minispade.require('ember-views/views/view');\nminispade.require('ember-views/views/states');\nminispade.require('ember-runtime/mixins/mutable_array');\n\nvar states = Ember.View.cloneStates(Ember.View.states);\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar forEach = Ember.EnumerableUtils.forEach;\n\n/**\n A `ContainerView` is an `Ember.View` subclass that implements `Ember.MutableArray`\n allowing programatic management of its child views.\n\n ## Setting Initial Child Views\n\n The initial array of child views can be set in one of two ways. You can\n provide a `childViews` property at creation time that contains instance of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: [Ember.View.create(), Ember.View.create()]\n });\n ```\n\n You can also provide a list of property names whose values are instances of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', 'bView', 'cView'],\n aView: Ember.View.create(),\n bView: Ember.View.create(),\n cView: Ember.View.create()\n });\n ```\n\n The two strategies can be combined:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', Ember.View.create()],\n aView: Ember.View.create()\n });\n ```\n\n Each child view's rendering will be inserted into the container's rendered\n HTML in the same order as its position in the `childViews` property.\n\n ## Adding and Removing Child Views\n\n The container view implements `Ember.MutableArray` allowing programatic management of its child views.\n\n To remove a view, pass that view into a `removeObject` call on the container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Removing a view\n\n ```javascript\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.removeObject(aContainer.get('bView'));\n aContainer.toArray(); // [aContainer.aView]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n </div>\n ```\n\n Similarly, adding a child view is accomplished by adding `Ember.View` instances to the\n container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Adding a view\n\n ```javascript\n AnotherViewClass = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Another view\")\n });\n\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.pushObject(AnotherViewClass.create());\n aContainer.toArray(); // [aContainer.aView, aContainer.bView, <AnotherViewClass instance>]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n <div class=\"ember-view\">Another view</div>\n </div>\n ```\n\n ## Templates and Layout\n\n A `template`, `templateName`, `defaultTemplate`, `layout`, `layoutName` or\n `defaultLayout` property on a container view will not result in the template\n or layout being rendered. The HTML contents of a `Ember.ContainerView`'s DOM\n representation will only be the rendered HTML of its child views.\n\n ## Binding a View to Display\n\n If you would like to display a single view in your ContainerView, you can set\n its `currentView` property. When the `currentView` property is set to a view\n instance, it will be added to the ContainerView. If the `currentView` property\n is later changed to a different view, the new view will replace the old view.\n If `currentView` is set to `null`, the last `currentView` will be removed.\n\n This functionality is useful for cases where you want to bind the display of\n a ContainerView to a controller or state manager. For example, you can bind\n the `currentView` of a container to a controller like this:\n\n ```javascript\n App.appController = Ember.Object.create({\n view: Ember.View.create({\n templateName: 'person_template'\n })\n });\n ```\n\n ```handlebars\n {{view Ember.ContainerView currentViewBinding=\"App.appController.view\"}}\n ```\n\n @class ContainerView\n @namespace Ember\n @extends Ember.View\n*/\nEmber.ContainerView = Ember.View.extend(Ember.MutableArray, {\n states: states,\n\n init: function() {\n this._super();\n\n var childViews = get(this, 'childViews');\n\n // redefine view's childViews property that was obliterated\n Ember.defineProperty(this, 'childViews', Ember.View.childViewsProperty);\n\n var _childViews = this._childViews;\n\n forEach(childViews, function(viewName, idx) {\n var view;\n\n if ('string' === typeof viewName) {\n view = get(this, viewName);\n view = this.createChildView(view);\n set(this, viewName, view);\n } else {\n view = this.createChildView(viewName);\n }\n\n _childViews[idx] = view;\n }, this);\n\n var currentView = get(this, 'currentView');\n if (currentView) {\n _childViews.push(this.createChildView(currentView));\n }\n },\n\n replace: function(idx, removedCount, addedViews) {\n var addedCount = addedViews ? get(addedViews, 'length') : 0;\n\n this.arrayContentWillChange(idx, removedCount, addedCount);\n this.childViewsWillChange(this._childViews, idx, removedCount);\n\n if (addedCount === 0) {\n this._childViews.splice(idx, removedCount) ;\n } else {\n var args = [idx, removedCount].concat(addedViews);\n this._childViews.splice.apply(this._childViews, args);\n }\n\n this.arrayContentDidChange(idx, removedCount, addedCount);\n this.childViewsDidChange(this._childViews, idx, removedCount, addedCount);\n\n return this;\n },\n\n objectAt: function(idx) {\n return this._childViews[idx];\n },\n\n length: Ember.computed(function () {\n return this._childViews.length;\n }),\n\n /**\n @private\n\n Instructs each child view to render to the passed render buffer.\n\n @method render\n @param {Ember.RenderBuffer} buffer the buffer to render to\n */\n render: function(buffer) {\n this.forEachChildView(function(view) {\n view.renderToBuffer(buffer);\n });\n },\n\n instrumentName: 'render.container',\n\n /**\n @private\n\n When a child view is removed, destroy its element so that\n it is removed from the DOM.\n\n The array observer that triggers this action is set up in the\n `renderToBuffer` method.\n\n @method childViewsWillChange\n @param {Ember.Array} views the child views array before mutation\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n **/\n childViewsWillChange: function(views, start, removed) {\n this.propertyWillChange('childViews');\n\n if (removed > 0) {\n var changedViews = views.slice(start, start+removed);\n // transition to preRender before clearing parentView\n this.currentState.childViewsWillChange(this, views, start, removed);\n this.initializeViews(changedViews, null, null);\n }\n },\n\n removeChild: function(child) {\n this.removeObject(child);\n return this;\n },\n\n /**\n @private\n\n When a child view is added, make sure the DOM gets updated appropriately.\n\n If the view has already rendered an element, we tell the child view to\n create an element and insert it into the DOM. If the enclosing container\n view has already written to a buffer, but not yet converted that buffer\n into an element, we insert the string representation of the child into the\n appropriate place in the buffer.\n\n @method childViewsDidChange\n @param {Ember.Array} views the array of child views afte the mutation has occurred\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n @param {Number} the number of child views added\n */\n childViewsDidChange: function(views, start, removed, added) {\n if (added > 0) {\n var changedViews = views.slice(start, start+added);\n this.initializeViews(changedViews, this, get(this, 'templateData'));\n this.currentState.childViewsDidChange(this, views, start, added);\n }\n this.propertyDidChange('childViews');\n },\n\n initializeViews: function(views, parentView, templateData) {\n forEach(views, function(view) {\n set(view, '_parentView', parentView);\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', templateData);\n }\n });\n },\n\n currentView: null,\n\n _currentViewWillChange: Ember.beforeObserver(function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n currentView.destroy();\n }\n }, 'currentView'),\n\n _currentViewDidChange: Ember.observer(function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n this.pushObject(currentView);\n }\n }, 'currentView'),\n\n _ensureChildrenAreInDOM: function () {\n this.currentState.ensureChildrenAreInDOM(this);\n }\n});\n\nEmber.merge(states._default, {\n childViewsWillChange: Ember.K,\n childViewsDidChange: Ember.K,\n ensureChildrenAreInDOM: Ember.K\n});\n\nEmber.merge(states.inBuffer, {\n childViewsDidChange: function(parentView, views, start, added) {\n throw new Error('You cannot modify child views while in the inBuffer state');\n }\n});\n\nEmber.merge(states.hasElement, {\n childViewsWillChange: function(view, views, start, removed) {\n for (var i=start; i<start+removed; i++) {\n views[i].remove();\n }\n },\n\n childViewsDidChange: function(view, views, start, added) {\n Ember.run.scheduleOnce('render', view, '_ensureChildrenAreInDOM');\n },\n\n ensureChildrenAreInDOM: function(view) {\n var childViews = view._childViews, i, len, childView, previous, buffer;\n for (i = 0, len = childViews.length; i < len; i++) {\n childView = childViews[i];\n buffer = childView.renderToBufferIfNeeded();\n if (buffer) {\n childView.triggerRecursively('willInsertElement');\n if (previous) {\n previous.domManager.after(previous, buffer.string());\n } else {\n view.domManager.prepend(view, buffer.string());\n }\n childView.transitionTo('inDOM');\n childView.propertyDidChange('element');\n childView.triggerRecursively('didInsertElement');\n }\n previous = childView;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/container_view");minispade.register('ember-views/views/states', "(function() {minispade.require(\"ember-views/views/states/default\");\nminispade.require(\"ember-views/views/states/pre_render\");\nminispade.require(\"ember-views/views/states/in_buffer\");\nminispade.require(\"ember-views/views/states/in_dom\");\nminispade.require(\"ember-views/views/states/destroyed\");\n\nEmber.View.cloneStates = function(from) {\n var into = {};\n\n into._default = {};\n into.preRender = Ember.create(into._default);\n into.destroyed = Ember.create(into._default);\n into.inBuffer = Ember.create(into._default);\n into.hasElement = Ember.create(into._default);\n into.inDOM = Ember.create(into.hasElement);\n\n for (var stateName in from) {\n if (!from.hasOwnProperty(stateName)) { continue; }\n Ember.merge(into[stateName], from[stateName]);\n }\n\n return into;\n};\n\n})();\n//@ sourceURL=ember-views/views/states");minispade.register('ember-views/views/states/default', "(function() {minispade.require('ember-views/views/view');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.View.states._default = {\n // appendChild is only legal while rendering the buffer.\n appendChild: function() {\n throw \"You can't use appendChild outside of the rendering process\";\n },\n\n $: function() {\n return undefined;\n },\n\n getElement: function() {\n return null;\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function() {\n return true; // continue event propagation\n },\n\n destroyElement: function(view) {\n set(view, 'element', null);\n if (view._scheduledInsert) {\n Ember.run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n renderToBufferIfNeeded: function () {\n return false;\n },\n\n rerender: Ember.K,\n invokeObserver: Ember.K\n};\n\n})();\n//@ sourceURL=ember-views/views/states/default");minispade.register('ember-views/views/states/destroyed', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar destroyedError = \"You can't call %@ on a destroyed view\", fmt = Ember.String.fmt;\n\nvar destroyed = Ember.View.states.destroyed = Ember.create(Ember.View.states._default);\n\nEmber.merge(destroyed, {\n appendChild: function() {\n throw fmt(destroyedError, ['appendChild']);\n },\n rerender: function() {\n throw fmt(destroyedError, ['rerender']);\n },\n destroyElement: function() {\n throw fmt(destroyedError, ['destroyElement']);\n },\n empty: function() {\n throw fmt(destroyedError, ['empty']);\n },\n\n setElement: function() {\n throw fmt(destroyedError, [\"set('element', ...)\"]);\n },\n\n renderToBufferIfNeeded: function() {\n throw fmt(destroyedError, [\"renderToBufferIfNeeded\"]);\n },\n\n // Since element insertion is scheduled, don't do anything if\n // the view has been destroyed between scheduling and execution\n insertElement: Ember.K\n});\n\n\n})();\n//@ sourceURL=ember-views/views/states/destroyed");minispade.register('ember-views/views/states/in_buffer', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar inBuffer = Ember.View.states.inBuffer = Ember.create(Ember.View.states._default);\n\nEmber.merge(inBuffer, {\n $: function(view, sel) {\n // if we don't have an element yet, someone calling this.$() is\n // trying to update an element that isn't in the DOM. Instead,\n // rerender the view to allow the render method to reflect the\n // changes.\n view.rerender();\n return Ember.$();\n },\n\n // when a view is rendered in a buffer, rerendering it simply\n // replaces the existing buffer with a new one\n rerender: function(view) {\n throw new Ember.Error(\"Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.\");\n },\n\n // when a view is rendered in a buffer, appending a child\n // view will render that view and append the resulting\n // buffer into its buffer.\n appendChild: function(view, childView, options) {\n var buffer = view.buffer;\n\n childView = view.createChildView(childView, options);\n view._childViews.push(childView);\n\n childView.renderToBuffer(buffer);\n\n view.propertyDidChange('childViews');\n\n return childView;\n },\n\n // when a view is rendered in a buffer, destroying the\n // element will simply destroy the buffer and put the\n // state back into the preRender state.\n destroyElement: function(view) {\n view.clearBuffer();\n view._notifyWillDestroyElement();\n view.transitionTo('preRender');\n\n return view;\n },\n\n empty: function() {\n Ember.assert(\"Emptying a view in the inBuffer state is not allowed and should not happen under normal circumstances. Most likely there is a bug in your application. This may be due to excessive property change notifications.\");\n },\n\n renderToBufferIfNeeded: function (view) {\n return view.buffer;\n },\n\n // It should be impossible for a rendered view to be scheduled for\n // insertion.\n insertElement: function() {\n throw \"You can't insert an element that has already been rendered\";\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n view.clearBuffer();\n view.transitionTo('hasElement');\n }\n\n return value;\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n});\n\n\n})();\n//@ sourceURL=ember-views/views/states/in_buffer");minispade.register('ember-views/views/states/in_dom', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar hasElement = Ember.View.states.hasElement = Ember.create(Ember.View.states._default);\n\nEmber.merge(hasElement, {\n $: function(view, sel) {\n var elem = get(view, 'element');\n return sel ? Ember.$(sel, elem) : Ember.$(elem);\n },\n\n getElement: function(view) {\n var parent = get(view, 'parentView');\n if (parent) { parent = get(parent, 'element'); }\n if (parent) { return view.findElementInParentElement(parent); }\n return Ember.$(\"#\" + get(view, 'elementId'))[0];\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n throw \"You cannot set an element to a non-null value when the element is already in the DOM.\";\n }\n\n return value;\n },\n\n // once the view has been inserted into the DOM, rerendering is\n // deferred to allow bindings to synchronize.\n rerender: function(view) {\n view.triggerRecursively('willClearRender');\n\n view.clearRenderedChildren();\n\n view.domManager.replace(view);\n return view;\n },\n\n // once the view is already in the DOM, destroying it removes it\n // from the DOM, nukes its element, and puts it back into the\n // preRender state if inDOM.\n\n destroyElement: function(view) {\n view._notifyWillDestroyElement();\n view.domManager.remove(view);\n set(view, 'element', null);\n if (view._scheduledInsert) {\n Ember.run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n empty: function(view) {\n var _childViews = view._childViews, len, idx;\n if (_childViews) {\n len = _childViews.length;\n for (idx = 0; idx < len; idx++) {\n _childViews[idx]._notifyWillDestroyElement();\n }\n }\n view.domManager.empty(view);\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function(view, eventName, evt) {\n if (view.has(eventName)) {\n // Handler should be able to re-dispatch events, so we don't\n // preventDefault or stopPropagation.\n return view.trigger(eventName, evt);\n } else {\n return true; // continue event propagation\n }\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n});\n\nvar inDOM = Ember.View.states.inDOM = Ember.create(hasElement);\n\nEmber.merge(inDOM, {\n insertElement: function(view, fn) {\n throw \"You can't insert an element into the DOM that has already been inserted\";\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/states/in_dom");minispade.register('ember-views/views/states/pre_render', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar preRender = Ember.View.states.preRender = Ember.create(Ember.View.states._default);\n\nEmber.merge(preRender, {\n // a view leaves the preRender state once its element has been\n // created (createElement).\n insertElement: function(view, fn) {\n view.createElement();\n view.triggerRecursively('willInsertElement');\n // after createElement, the view will be in the hasElement state.\n fn.call(view);\n view.transitionTo('inDOM');\n view.triggerRecursively('didInsertElement');\n },\n\n renderToBufferIfNeeded: function(view) {\n return view.renderToBuffer();\n },\n\n empty: Ember.K,\n\n setElement: function(view, value) {\n if (value !== null) {\n view.transitionTo('hasElement');\n }\n return value;\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/states/pre_render");minispade.register('ember-views/views/view', "(function() {minispade.require(\"ember-views/system/render_buffer\");\n\nvar states = {};\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar guidFor = Ember.guidFor;\nvar a_forEach = Ember.EnumerableUtils.forEach;\nvar a_addObject = Ember.EnumerableUtils.addObject;\n\nvar childViewsProperty = Ember.computed(function() {\n var childViews = this._childViews, ret = Ember.A(), view = this;\n\n a_forEach(childViews, function(view) {\n if (view.isVirtual) {\n ret.pushObjects(get(view, 'childViews'));\n } else {\n ret.push(view);\n }\n });\n\n ret.replace = function (idx, removedCount, addedViews) {\n if (view instanceof Ember.ContainerView) {\n Ember.deprecate(\"Manipulating an Ember.ContainerView through its childViews property is deprecated. Please use the ContainerView instance itself as an Ember.MutableArray.\");\n return view.replace(idx, removedCount, addedViews);\n }\n throw new Error(\"childViews is immutable\");\n };\n\n return ret;\n});\n\nEmber.warn(\"The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.\", Ember.ENV.VIEW_PRESERVES_CONTEXT !== false);\n\n/**\n Global hash of shared templates. This will automatically be populated\n by the build tools so that you can store your Handlebars templates in\n separate files that get loaded into JavaScript at buildtime.\n\n @property TEMPLATES\n @for Ember\n @type Hash\n*/\nEmber.TEMPLATES = {};\n\nEmber.CoreView = Ember.Object.extend(Ember.Evented, {\n isView: true,\n\n states: states,\n\n init: function() {\n this._super();\n\n // Register the view for event handling. This hash is used by\n // Ember.EventDispatcher to dispatch incoming events.\n if (!this.isVirtual) {\n Ember.assert(\"Attempted to register a view with an id already in use: \"+this.elementId, !Ember.View.views[this.elementId]);\n Ember.View.views[this.elementId] = this;\n }\n\n this.addBeforeObserver('elementId', function() {\n throw new Error(\"Changing a view's elementId after creation is not allowed\");\n });\n\n this.transitionTo('preRender');\n },\n\n /**\n If the view is currently inserted into the DOM of a parent view, this\n property will point to the parent of the view.\n\n @property parentView\n @type Ember.View\n @default null\n */\n parentView: Ember.computed(function() {\n var parent = this._parentView;\n\n if (parent && parent.isVirtual) {\n return get(parent, 'parentView');\n } else {\n return parent;\n }\n }).property('_parentView'),\n\n state: null,\n\n _parentView: null,\n\n // return the current view, not including virtual views\n concreteView: Ember.computed(function() {\n if (!this.isVirtual) { return this; }\n else { return get(this, 'parentView'); }\n }).property('parentView').volatile(),\n\n instrumentName: 'core_view',\n\n instrumentDetails: function(hash) {\n hash.object = this.toString();\n },\n\n /**\n @private\n\n Invoked by the view system when this view needs to produce an HTML\n representation. This method will create a new render buffer, if needed,\n then apply any default attributes, such as class names and visibility.\n Finally, the `render()` method is invoked, which is responsible for\n doing the bulk of the rendering.\n\n You should not need to override this method; instead, implement the\n `template` property, or if you need more control, override the `render`\n method.\n\n @method renderToBuffer\n @param {Ember.RenderBuffer} buffer the render buffer. If no buffer is\n passed, a default buffer, using the current view's `tagName`, will\n be used.\n */\n renderToBuffer: function(parentBuffer, bufferOperation) {\n var name = 'render.' + this.instrumentName,\n details = {};\n\n this.instrumentDetails(details);\n\n return Ember.instrument(name, details, function() {\n return this._renderToBuffer(parentBuffer, bufferOperation);\n }, this);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n Ember.run.sync();\n\n // If this is the top-most view, start a new buffer. Otherwise,\n // create a new buffer relative to the original using the\n // provided buffer operation (for example, `insertAfter` will\n // insert a new buffer after the \"parent buffer\").\n var tagName = this.tagName;\n\n if (tagName === null || tagName === undefined) {\n tagName = 'div';\n }\n\n var buffer = this.buffer = parentBuffer && parentBuffer.begin(tagName) || Ember.RenderBuffer(tagName);\n this.transitionTo('inBuffer', false);\n\n this.beforeRender(buffer);\n this.render(buffer);\n this.afterRender(buffer);\n\n return buffer;\n },\n\n /**\n @private\n\n Override the default event firing from `Ember.Evented` to\n also call methods with the given name.\n\n @method trigger\n @param name {String}\n */\n trigger: function(name) {\n this._super.apply(this, arguments);\n var method = this[name];\n if (method) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n return method.apply(this, args);\n }\n },\n\n has: function(name) {\n return Ember.typeOf(this[name]) === 'function' || this._super(name);\n },\n\n willDestroy: function() {\n var parent = this._parentView;\n\n // destroy the element -- this will avoid each child view destroying\n // the element over and over again...\n if (!this.removedFromDOM) { this.destroyElement(); }\n\n // remove from parent if found. Don't call removeFromParent,\n // as removeFromParent will try to remove the element from\n // the DOM again.\n if (parent) { parent.removeChild(this); }\n\n this.transitionTo('destroyed');\n\n // next remove view from global hash\n if (!this.isVirtual) delete Ember.View.views[this.elementId];\n },\n\n clearRenderedChildren: Ember.K,\n triggerRecursively: Ember.K,\n invokeRecursively: Ember.K,\n transitionTo: Ember.K,\n destroyElement: Ember.K\n});\n\n/**\n `Ember.View` is the class in Ember responsible for encapsulating templates of\n HTML content, combining templates with data to render as sections of a page's\n DOM, and registering and responding to user-initiated events.\n\n ## HTML Tag\n\n The default HTML tag name used for a view's DOM representation is `div`. This\n can be customized by setting the `tagName` property. The following view\nclass:\n\n ```javascript\n ParagraphView = Ember.View.extend({\n tagName: 'em'\n });\n ```\n\n Would result in instances with the following HTML:\n\n ```html\n <em id=\"ember1\" class=\"ember-view\"></em>\n ```\n\n ## HTML `class` Attribute\n\n The HTML `class` attribute of a view's tag can be set by providing a\n `classNames` property that is set to an array of strings:\n\n ```javascript\n MyView = Ember.View.extend({\n classNames: ['my-class', 'my-other-class']\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view my-class my-other-class\"></div>\n ```\n\n `class` attribute values can also be set by providing a `classNameBindings`\n property set to an array of properties names for the view. The return value\n of these properties will be added as part of the value for the view's `class`\n attribute. These properties can be computed properties:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['propertyA', 'propertyB'],\n propertyA: 'from-a',\n propertyB: function(){\n if(someLogic){ return 'from-b'; }\n }.property()\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view from-a from-b\"></div>\n ```\n\n If the value of a class name binding returns a boolean the property name\n itself will be used as the class name if the property is true. The class name\n will not be added if the value is `false` or `undefined`.\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['hovered'],\n hovered: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view hovered\"></div>\n ```\n\n When using boolean class name bindings you can supply a string value other\n than the property name for use as the `class` HTML attribute by appending the\n preferred value after a \":\" character when defining the binding:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['awesome:so-very-cool'],\n awesome: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view so-very-cool\"></div>\n ```\n\n Boolean value class name bindings whose property names are in a\n camelCase-style format will be converted to a dasherized format:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['isUrgent'],\n isUrgent: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view is-urgent\"></div>\n ```\n\n Class name bindings can also refer to object values that are found by\n traversing a path relative to the view itself:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['messages.empty']\n messages: Ember.Object.create({\n empty: true\n })\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view empty\"></div>\n ```\n\n If you want to add a class name for a property which evaluates to true and\n and a different class name if it evaluates to false, you can pass a binding\n like this:\n\n ```javascript\n // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false\n Ember.View.create({\n classNameBindings: ['isEnabled:enabled:disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view enabled\"></div>\n ```\n\n When isEnabled is `false`, the resulting HTML reprensentation looks like\n this:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n This syntax offers the convenience to add a class if a property is `false`:\n\n ```javascript\n // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\n Ember.View.create({\n classNameBindings: ['isEnabled::disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\"></div>\n ```\n\n When the `isEnabled` property on the view is set to `false`, it will result\n in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n Updates to the the value of a class name binding will result in automatic\n update of the HTML `class` attribute in the view's rendered HTML\n representation. If the value becomes `false` or `undefined` the class name\n will be removed.\n\n Both `classNames` and `classNameBindings` are concatenated properties. See\n `Ember.Object` documentation for more information about concatenated\n properties.\n\n ## HTML Attributes\n\n The HTML attribute section of a view's tag can be set by providing an\n `attributeBindings` property set to an array of property names on the view.\n The return value of these properties will be used as the value of the view's\n HTML associated attribute:\n\n ```javascript\n AnchorView = Ember.View.extend({\n tagName: 'a',\n attributeBindings: ['href'],\n href: 'http://google.com'\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n ```\n\n If the return value of an `attributeBindings` monitored property is a boolean\n the property will follow HTML's pattern of repeating the attribute's name as\n its value:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <input id=\"ember1\" class=\"ember-view\" disabled=\"disabled\" />\n ```\n\n `attributeBindings` can refer to computed properties:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: function(){\n if (someLogic) {\n return true;\n } else {\n return false;\n }\n }.property()\n });\n ```\n\n Updates to the the property of an attribute binding will result in automatic\n update of the HTML attribute in the view's rendered HTML representation.\n\n `attributeBindings` is a concatenated property. See `Ember.Object`\n documentation for more information about concatenated properties.\n\n ## Templates\n\n The HTML contents of a view's rendered representation are determined by its\n template. Templates can be any function that accepts an optional context\n parameter and returns a string of HTML that will be inserted within the\n view's tag. Most typically in Ember this function will be a compiled\n `Ember.Handlebars` template.\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('I am the template')\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I am the template</div>\n ```\n\n Within an Ember application is more common to define a Handlebars templates as\n part of a page:\n\n ```html\n <script type='text/x-handlebars' data-template-name='some-template'>\n Hello\n </script>\n ```\n\n And associate it by name using a view's `templateName` property:\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'some-template'\n });\n ```\n\n Using a value for `templateName` that does not have a Handlebars template\n with a matching `data-template-name` attribute will throw an error.\n\n Assigning a value to both `template` and `templateName` properties will throw\n an error.\n\n For views classes that may have a template later defined (e.g. as the block\n portion of a `{{view}}` Handlebars helper call in another template or in\n a subclass), you can provide a `defaultTemplate` property set to compiled\n template function. If a template is not later provided for the view instance\n the `defaultTemplate` value will be used:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default'),\n template: null,\n templateName: null\n });\n ```\n\n Will result in instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the default</div>\n ```\n\n If a `template` or `templateName` is provided it will take precedence over\n `defaultTemplate`:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default')\n });\n\n aView = AView.create({\n template: Ember.Handlebars.compile('I was the template, not default')\n });\n ```\n\n Will result in the following HTML representation when rendered:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the template, not default</div>\n ```\n\n ## View Context\n\n The default context of the compiled template is the view's controller:\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('Hello {{excitedGreeting}}')\n });\n\n aController = Ember.Object.create({\n firstName: 'Barry',\n excitedGreeting: function(){\n return this.get(\"content.firstName\") + \"!!!\"\n }.property()\n });\n\n aView = AView.create({\n controller: aController,\n });\n ```\n\n Will result in an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">Hello Barry!!!</div>\n ```\n\n A context can also be explicitly supplied through the view's `context`\n property. If the view has neither `context` nor `controller` properties, the\n `parentView`'s context will be used.\n\n ## Layouts\n\n Views can have a secondary template that wraps their main template. Like\n primary templates, layouts can be any function that accepts an optional\n context parameter and returns a string of HTML that will be inserted inside\n view's tag. Views whose HTML element is self closing (e.g. `<input />`)\n cannot have a layout and this property will be ignored.\n\n Most typically in Ember a layout will be a compiled `Ember.Handlebars`\n template.\n\n A view's layout can be set directly with the `layout` property or reference\n an existing Handlebars template by name with the `layoutName` property.\n\n A template used as a layout must contain a single use of the Handlebars\n `{{yield}}` helper. The HTML contents of a view's rendered `template` will be\n inserted at this location:\n\n ```javascript\n AViewWithLayout = Ember.View.extend({\n layout: Ember.Handlebars.compile(\"<div class='my-decorative-class'>{{yield}}</div>\")\n template: Ember.Handlebars.compile(\"I got wrapped\"),\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div class=\"my-decorative-class\">\n I got wrapped\n </div>\n </div>\n ```\n\n See `Handlebars.helpers.yield` for more information.\n\n ## Responding to Browser Events\n\n Views can respond to user-initiated events in one of three ways: method\n implementation, through an event manager, and through `{{action}}` helper use\n in their template or layout.\n\n ### Method Implementation\n\n Views can respond to user-initiated events by implementing a method that\n matches the event name. A `jQuery.Event` object will be passed as the\n argument to this method.\n\n ```javascript\n AView = Ember.View.extend({\n click: function(event){\n // will be called when when an instance's\n // rendered element is clicked\n }\n });\n ```\n\n ### Event Managers\n\n Views can define an object as their `eventManager` property. This object can\n then implement methods that match the desired event names. Matching events\n that occur on the view's rendered HTML or the rendered HTML of any of its DOM\n descendants will trigger this method. A `jQuery.Event` object will be passed\n as the first argument to the method and an `Ember.View` object as the\n second. The `Ember.View` will be the view whose rendered HTML was interacted\n with. This may be the view with the `eventManager` property or one of its\n descendent views.\n\n ```javascript\n AView = Ember.View.extend({\n eventManager: Ember.Object.create({\n doubleClick: function(event, view){\n // will be called when when an instance's\n // rendered element or any rendering\n // of this views's descendent\n // elements is clicked\n }\n })\n });\n ```\n\n An event defined for an event manager takes precedence over events of the\n same name handled through methods on the view.\n\n ```javascript\n AView = Ember.View.extend({\n mouseEnter: function(event){\n // will never trigger.\n },\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view){\n // takes presedence over AView#mouseEnter\n }\n })\n });\n ```\n\n Similarly a view's event manager will take precedence for events of any views\n rendered as a descendent. A method name that matches an event name will not\n be called if the view instance was rendered inside the HTML representation of\n a view that has an `eventManager` property defined that handles events of the\n name. Events not handled by the event manager will still trigger method calls\n on the descendent.\n\n ```javascript\n OuterView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"outer {{#view InnerView}}inner{{/view}} outer\"),\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view){\n // view might be instance of either\n // OutsideView or InnerView depending on\n // where on the page the user interaction occured\n }\n })\n });\n\n InnerView = Ember.View.extend({\n click: function(event){\n // will be called if rendered inside\n // an OuterView because OuterView's\n // eventManager doesn't handle click events\n },\n mouseEnter: function(event){\n // will never be called if rendered inside\n // an OuterView.\n }\n });\n ```\n\n ### Handlebars `{{action}}` Helper\n\n See `Handlebars.helpers.action`.\n\n ### Event Names\n\n Possible events names for any of the responding approaches described above\n are:\n\n Touch events:\n\n * `touchStart`\n * `touchMove`\n * `touchEnd`\n * `touchCancel`\n\n Keyboard events\n\n * `keyDown`\n * `keyUp`\n * `keyPress`\n\n Mouse events\n\n * `mouseDown`\n * `mouseUp`\n * `contextMenu`\n * `click`\n * `doubleClick`\n * `mouseMove`\n * `focusIn`\n * `focusOut`\n * `mouseEnter`\n * `mouseLeave`\n\n Form events:\n\n * `submit`\n * `change`\n * `focusIn`\n * `focusOut`\n * `input`\n\n HTML5 drag and drop events:\n\n * `dragStart`\n * `drag`\n * `dragEnter`\n * `dragLeave`\n * `drop`\n * `dragEnd`\n\n ## Handlebars `{{view}}` Helper\n\n Other `Ember.View` instances can be included as part of a view's template by\n using the `{{view}}` Handlebars helper. See `Handlebars.helpers.view` for\n additional information.\n\n @class View\n @namespace Ember\n @extends Ember.Object\n @uses Ember.Evented\n*/\nEmber.View = Ember.CoreView.extend(\n/** @scope Ember.View.prototype */ {\n\n concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'],\n\n /**\n @property isView\n @type Boolean\n @default true\n @final\n */\n isView: true,\n\n // ..........................................................\n // TEMPLATE SUPPORT\n //\n\n /**\n The name of the template to lookup if no template is provided.\n\n `Ember.View` will look for a template with this name in this view's\n `templates` object. By default, this will be a global object\n shared in `Ember.TEMPLATES`.\n\n @property templateName\n @type String\n @default null\n */\n templateName: null,\n\n /**\n The name of the layout to lookup if no layout is provided.\n\n `Ember.View` will look for a template with this name in this view's\n `templates` object. By default, this will be a global object\n shared in `Ember.TEMPLATES`.\n\n @property layoutName\n @type String\n @default null\n */\n layoutName: null,\n\n /**\n The hash in which to look for `templateName`.\n\n @property templates\n @type Ember.Object\n @default Ember.TEMPLATES\n */\n templates: Ember.TEMPLATES,\n\n /**\n The template used to render the view. This should be a function that\n accepts an optional context parameter and returns a string of HTML that\n will be inserted into the DOM relative to its parent view.\n\n In general, you should set the `templateName` property instead of setting\n the template yourself.\n\n @property template\n @type Function\n */\n template: Ember.computed(function(key, value) {\n if (value !== undefined) { return value; }\n\n var templateName = get(this, 'templateName'),\n template = this.templateForName(templateName, 'template');\n\n Ember.assert(\"You specified the templateName \" + templateName + \" for \" + this + \", but it did not exist.\", !templateName || template);\n\n return template || get(this, 'defaultTemplate');\n }).property('templateName'),\n\n container: Ember.computed(function() {\n var parentView = get(this, '_parentView');\n\n if (parentView) { return get(parentView, 'container'); }\n\n return Ember.Container && Ember.Container.defaultContainer;\n }),\n\n /**\n The controller managing this view. If this property is set, it will be\n made available for use by the template.\n\n @property controller\n @type Object\n */\n controller: Ember.computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n A view may contain a layout. A layout is a regular template but\n supersedes the `template` property during rendering. It is the\n responsibility of the layout template to retrieve the `template`\n property from the view (or alternatively, call `Handlebars.helpers.yield`,\n `{{yield}}`) to render it in the correct location.\n\n This is useful for a view that has a shared wrapper, but which delegates\n the rendering of the contents of the wrapper to the `template` property\n on a subclass.\n\n @property layout\n @type Function\n */\n layout: Ember.computed(function(key) {\n var layoutName = get(this, 'layoutName'),\n layout = this.templateForName(layoutName, 'layout');\n\n Ember.assert(\"You specified the layoutName \" + layoutName + \" for \" + this + \", but it did not exist.\", !layoutName || layout);\n\n return layout || get(this, 'defaultLayout');\n }).property('layoutName'),\n\n templateForName: function(name, type) {\n if (!name) { return; }\n\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n var container = get(this, 'container');\n\n if (container) {\n return container.lookup('template:' + name);\n }\n },\n\n /**\n The object from which templates should access properties.\n\n This object will be passed to the template function each time the render\n method is called, but it is up to the individual function to decide what\n to do with it.\n\n By default, this will be the view's controller.\n\n @property context\n @type Object\n */\n context: Ember.computed(function(key, value) {\n if (arguments.length === 2) {\n set(this, '_context', value);\n return value;\n } else {\n return get(this, '_context');\n }\n }).volatile(),\n\n /**\n @private\n\n Private copy of the view's template context. This can be set directly\n by Handlebars without triggering the observer that causes the view\n to be re-rendered.\n\n The context of a view is looked up as follows:\n\n 1. Supplied context (usually by Handlebars)\n 2. Specified controller\n 3. `parentView`'s context (for a child of a ContainerView)\n\n The code in Handlebars that overrides the `_context` property first\n checks to see whether the view has a specified controller. This is\n something of a hack and should be revisited.\n\n @property _context\n */\n _context: Ember.computed(function(key) {\n var parentView, controller;\n\n if (controller = get(this, 'controller')) {\n return controller;\n }\n\n parentView = this._parentView;\n if (parentView) {\n return get(parentView, '_context');\n }\n\n return null;\n }),\n\n /**\n @private\n\n If a value that affects template rendering changes, the view should be\n re-rendered to reflect the new value.\n\n @method _displayPropertyDidChange\n */\n _contextDidChange: Ember.observer(function() {\n this.rerender();\n }, 'context'),\n\n /**\n If `false`, the view will appear hidden in DOM.\n\n @property isVisible\n @type Boolean\n @default null\n */\n isVisible: true,\n\n /**\n @private\n\n Array of child views. You should never edit this array directly.\n Instead, use `appendChild` and `removeFromParent`.\n\n @property childViews\n @type Array\n @default []\n */\n childViews: childViewsProperty,\n\n _childViews: [],\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews will change.\n _childViewsWillChange: Ember.beforeObserver(function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyWillChange(parentView, 'childViews'); }\n }\n }, 'childViews'),\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews did change.\n _childViewsDidChange: Ember.observer(function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyDidChange(parentView, 'childViews'); }\n }\n }, 'childViews'),\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class.\n\n @property nearestInstanceOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n @deprecated\n */\n nearestInstanceOf: function(klass) {\n Ember.deprecate(\"nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.\");\n var view = get(this, 'parentView');\n\n while (view) {\n if(view instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class or mixin.\n\n @property nearestOfType\n @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself),\n or an instance of Ember.Mixin.\n @return Ember.View\n */\n nearestOfType: function(klass) {\n var view = get(this, 'parentView'),\n isOfType = klass instanceof Ember.Mixin ?\n function(view) { return klass.detect(view); } :\n function(view) { return klass.detect(view.constructor); };\n\n while (view) {\n if( isOfType(view) ) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that has a given property.\n\n @property nearestWithProperty\n @param {String} property A property name\n @return Ember.View\n */\n nearestWithProperty: function(property) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (property in view) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor whose parent is an instance of\n `klass`.\n\n @property nearestChildOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n */\n nearestChildOf: function(klass) {\n var view = get(this, 'parentView');\n\n while (view) {\n if(get(view, 'parentView') instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n @private\n\n When the parent view changes, recursively invalidate `controller`\n\n @method _parentViewDidChange\n */\n _parentViewDidChange: Ember.observer(function() {\n if (this.isDestroying) { return; }\n\n if (get(this, 'parentView.controller') && !get(this, 'controller')) {\n this.notifyPropertyChange('controller');\n }\n }, '_parentView'),\n\n _controllerDidChange: Ember.observer(function() {\n if (this.isDestroying) { return; }\n\n this.rerender();\n\n this.forEachChildView(function(view) {\n view.propertyDidChange('controller');\n });\n }, 'controller'),\n\n cloneKeywords: function() {\n var templateData = get(this, 'templateData');\n\n var keywords = templateData ? Ember.copy(templateData.keywords) : {};\n set(keywords, 'view', get(this, 'concreteView'));\n set(keywords, '_view', this);\n set(keywords, 'controller', get(this, 'controller'));\n\n return keywords;\n },\n\n /**\n Called on your view when it should push strings of HTML into a\n `Ember.RenderBuffer`. Most users will want to override the `template`\n or `templateName` properties instead of this method.\n\n By default, `Ember.View` will look for a function in the `template`\n property and invoke it with the value of `context`. The value of\n `context` will be the view's controller unless you override it.\n\n @method render\n @param {Ember.RenderBuffer} buffer The render buffer\n */\n render: function(buffer) {\n // If this view has a layout, it is the responsibility of the\n // the layout to render the view's template. Otherwise, render the template\n // directly.\n var template = get(this, 'layout') || get(this, 'template');\n\n if (template) {\n var context = get(this, 'context');\n var keywords = this.cloneKeywords();\n var output;\n\n var data = {\n view: this,\n buffer: buffer,\n isRenderData: true,\n keywords: keywords,\n insideGroup: get(this, 'templateData.insideGroup')\n };\n\n // Invoke the template with the provided template context, which\n // is the view's controller by default. A hash of data is also passed that provides\n // the template with access to the view and render buffer.\n\n Ember.assert('template must be a function. Did you mean to call Ember.Handlebars.compile(\"...\") or specify templateName instead?', typeof template === 'function');\n // The template should write directly to the render buffer instead\n // of returning a string.\n output = template(context, { data: data });\n\n // If the template returned a string instead of writing to the buffer,\n // push the string onto the buffer.\n if (output !== undefined) { buffer.push(output); }\n }\n },\n\n /**\n Renders the view again. This will work regardless of whether the\n view is already in the DOM or not. If the view is in the DOM, the\n rendering process will be deferred to give bindings a chance\n to synchronize.\n\n If children were added during the rendering process using `appendChild`,\n `rerender` will remove them, because they will be added again\n if needed by the next `render`.\n\n In general, if the display of your view changes, you should modify\n the DOM element directly instead of manually calling `rerender`, which can\n be slow.\n\n @method rerender\n */\n rerender: function() {\n return this.currentState.rerender(this);\n },\n\n clearRenderedChildren: function() {\n var lengthBefore = this.lengthBeforeRender,\n lengthAfter = this.lengthAfterRender;\n\n // If there were child views created during the last call to render(),\n // remove them under the assumption that they will be re-created when\n // we re-render.\n\n // VIEW-TODO: Unit test this path.\n var childViews = this._childViews;\n for (var i=lengthAfter-1; i>=lengthBefore; i--) {\n if (childViews[i]) { childViews[i].destroy(); }\n }\n },\n\n /**\n @private\n\n Iterates over the view's `classNameBindings` array, inserts the value\n of the specified property into the `classNames` array, then creates an\n observer to update the view's element if the bound property ever changes\n in the future.\n\n @method _applyClassNameBindings\n */\n _applyClassNameBindings: function(classBindings) {\n var classNames = this.classNames,\n elem, newClass, dasherizedClass;\n\n // Loop through all of the configured bindings. These will be either\n // property names ('isUrgent') or property paths relative to the view\n // ('content.isUrgent')\n a_forEach(classBindings, function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n // Extract just the property name from bindings like 'foo:bar'\n var parsedPath = Ember.View._parsePropertyPath(binding);\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n var observer = function() {\n // Get the current value of the property\n newClass = this._classStringForProperty(binding);\n elem = this.$();\n\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n // Also remove from classNames so that if the view gets rerendered,\n // the class doesn't get added back to the DOM.\n classNames.removeObject(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n };\n\n // Get the class name for the property at its current value\n dasherizedClass = this._classStringForProperty(binding);\n\n if (dasherizedClass) {\n // Ensure that it gets into the classNames array\n // so it is displayed when we render.\n a_addObject(classNames, dasherizedClass);\n\n // Save a reference to the class name so we can remove it\n // if the observer fires. Remember that this variable has\n // been closed over by the observer.\n oldClass = dasherizedClass;\n }\n\n this.registerObserver(this, parsedPath.path, observer);\n // Remove className so when the view is rerendered,\n // the className is added based on binding reevaluation\n this.one('willClearRender', function() {\n if (oldClass) {\n classNames.removeObject(oldClass);\n oldClass = null;\n }\n });\n\n }, this);\n },\n\n /**\n @private\n\n Iterates through the view's attribute bindings, sets up observers for each,\n then applies the current value of the attributes to the passed render buffer.\n\n @method _applyAttributeBindings\n @param {Ember.RenderBuffer} buffer\n */\n _applyAttributeBindings: function(buffer, attributeBindings) {\n var attributeValue, elem, type;\n\n a_forEach(attributeBindings, function(binding) {\n var split = binding.split(':'),\n property = split[0],\n attributeName = split[1] || property;\n\n // Create an observer to add/remove/change the attribute if the\n // JavaScript property changes.\n var observer = function() {\n elem = this.$();\n\n attributeValue = get(this, property);\n\n Ember.View.applyAttributeBindings(elem, attributeName, attributeValue);\n };\n\n this.registerObserver(this, property, observer);\n\n // Determine the current value and add it to the render buffer\n // if necessary.\n attributeValue = get(this, property);\n Ember.View.applyAttributeBindings(buffer, attributeName, attributeValue);\n }, this);\n },\n\n /**\n @private\n\n Given a property name, returns a dasherized version of that\n property name if the property evaluates to a non-falsy value.\n\n For example, if the view has property `isUrgent` that evaluates to true,\n passing `isUrgent` to this method will return `\"is-urgent\"`.\n\n @method _classStringForProperty\n @param property\n */\n _classStringForProperty: function(property) {\n var parsedPath = Ember.View._parsePropertyPath(property);\n var path = parsedPath.path;\n\n var val = get(this, path);\n if (val === undefined && Ember.isGlobalPath(path)) {\n val = get(Ember.lookup, path);\n }\n\n return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n },\n\n // ..........................................................\n // ELEMENT SUPPORT\n //\n\n /**\n Returns the current DOM element for the view.\n\n @property element\n @type DOMElement\n */\n element: Ember.computed(function(key, value) {\n if (value !== undefined) {\n return this.currentState.setElement(this, value);\n } else {\n return this.currentState.getElement(this);\n }\n }).property('_parentView'),\n\n /**\n Returns a jQuery object for this view's element. If you pass in a selector\n string, this method will return a jQuery object, using the current element\n as its buffer.\n\n For example, calling `view.$('li')` will return a jQuery object containing\n all of the `li` elements inside the DOM element of this view.\n\n @property $\n @param {String} [selector] a jQuery-compatible selector string\n @return {jQuery} the CoreQuery object for the DOM node\n */\n $: function(sel) {\n return this.currentState.$(this, sel);\n },\n\n mutateChildViews: function(callback) {\n var childViews = this._childViews,\n idx = childViews.length,\n view;\n\n while(--idx >= 0) {\n view = childViews[idx];\n callback.call(this, view, idx);\n }\n\n return this;\n },\n\n forEachChildView: function(callback) {\n var childViews = this._childViews;\n\n if (!childViews) { return this; }\n\n var len = childViews.length,\n view, idx;\n\n for(idx = 0; idx < len; idx++) {\n view = childViews[idx];\n callback.call(this, view);\n }\n\n return this;\n },\n\n /**\n Appends the view's element to the specified parent element.\n\n If the view does not have an HTML representation yet, `createElement()`\n will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing.\n\n This is not typically a function that you will need to call directly when\n building your application. You might consider using `Ember.ContainerView`\n instead. If you do need to use `appendTo`, be sure that the target element\n you are providing is associated with an `Ember.Application` and does not\n have an ancestor element that is associated with an Ember view.\n\n @method appendTo\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} receiver\n */\n appendTo: function(target) {\n // Schedule the DOM element to be created and appended to the given\n // element after bindings have synchronized.\n this._insertElementLater(function() {\n Ember.assert(\"You cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n Replaces the content of the specified parent element with this view's\n element. If the view does not have an HTML representation yet,\n `createElement()` will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing\n\n @method replaceIn\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} received\n */\n replaceIn: function(target) {\n Ember.assert(\"You cannot replace an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n\n this._insertElementLater(function() {\n Ember.$(target).empty();\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n @private\n\n Schedules a DOM operation to occur during the next render phase. This\n ensures that all bindings have finished synchronizing before the view is\n rendered.\n\n To use, pass a function that performs a DOM operation.\n\n Before your function is called, this view and all child views will receive\n the `willInsertElement` event. After your function is invoked, this view\n and all of its child views will receive the `didInsertElement` event.\n\n ```javascript\n view._insertElementLater(function() {\n this.createElement();\n this.$().appendTo('body');\n });\n ```\n\n @method _insertElementLater\n @param {Function} fn the function that inserts the element into the DOM\n */\n _insertElementLater: function(fn) {\n this._scheduledInsert = Ember.run.scheduleOnce('render', this, '_insertElement', fn);\n },\n\n _insertElement: function (fn) {\n this._scheduledInsert = null;\n this.currentState.insertElement(this, fn);\n },\n\n /**\n Appends the view's element to the document body. If the view does\n not have an HTML representation yet, `createElement()` will be called\n automatically.\n\n If your application uses the `rootElement` property, you must append\n the view within that element. Rendering views outside of the `rootElement`\n is not supported.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the document body until all bindings have\n finished synchronizing.\n\n @method append\n @return {Ember.View} receiver\n */\n append: function() {\n return this.appendTo(document.body);\n },\n\n /**\n Removes the view's element from the element to which it is attached.\n\n @method remove\n @return {Ember.View} receiver\n */\n remove: function() {\n // What we should really do here is wait until the end of the run loop\n // to determine if the element has been re-appended to a different\n // element.\n // In the interim, we will just re-render if that happens. It is more\n // important than elements get garbage collected.\n if (!this.removedFromDOM) { this.destroyElement(); }\n this.invokeRecursively(function(view) {\n if (view.clearRenderedChildren) { view.clearRenderedChildren(); }\n });\n },\n\n elementId: null,\n\n /**\n Attempts to discover the element in the parent element. The default\n implementation looks for an element with an ID of `elementId` (or the\n view's guid if `elementId` is null). You can override this method to\n provide your own form of lookup. For example, if you want to discover your\n element using a CSS class name instead of an ID.\n\n @method findElementInParentElement\n @param {DOMElement} parentElement The parent's DOM element\n @return {DOMElement} The discovered element\n */\n findElementInParentElement: function(parentElem) {\n var id = \"#\" + this.elementId;\n return Ember.$(id)[0] || Ember.$(id, parentElem)[0];\n },\n\n /**\n Creates a DOM representation of the view and all of its\n child views by recursively calling the `render()` method.\n\n After the element has been created, `didInsertElement` will\n be called on this view and all of its child views.\n\n @method createElement\n @return {Ember.View} receiver\n */\n createElement: function() {\n if (get(this, 'element')) { return this; }\n\n var buffer = this.renderToBuffer();\n set(this, 'element', buffer.element());\n\n return this;\n },\n\n /**\n Called when a view is going to insert an element into the DOM.\n\n @event willInsertElement\n */\n willInsertElement: Ember.K,\n\n /**\n Called when the element of the view has been inserted into the DOM.\n Override this function to do any set up that requires an element in the\n document body.\n\n @event didInsertElement\n */\n didInsertElement: Ember.K,\n\n /**\n Called when the view is about to rerender, but before anything has\n been torn down. This is a good opportunity to tear down any manual\n observers you have installed based on the DOM state\n\n @event willClearRender\n */\n willClearRender: Ember.K,\n\n /**\n @private\n\n Run this callback on the current view and recursively on child views.\n\n @method invokeRecursively\n @param fn {Function}\n */\n invokeRecursively: function(fn) {\n var childViews = [this], currentViews, view;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n fn.call(view, view);\n if (view._childViews) {\n childViews.push.apply(childViews, view._childViews);\n }\n }\n }\n },\n\n triggerRecursively: function(eventName) {\n var childViews = [this], currentViews, view;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n if (view.trigger) { view.trigger(eventName); }\n if (view._childViews) {\n childViews.push.apply(childViews, view._childViews);\n }\n }\n }\n },\n\n /**\n Destroys any existing element along with the element for any child views\n as well. If the view does not currently have a element, then this method\n will do nothing.\n\n If you implement `willDestroyElement()` on your view, then this method will\n be invoked on your view before your element is destroyed to give you a\n chance to clean up any event handlers, etc.\n\n If you write a `willDestroyElement()` handler, you can assume that your\n `didInsertElement()` handler was called earlier for the same element.\n\n Normally you will not call or override this method yourself, but you may\n want to implement the above callbacks when it is run.\n\n @method destroyElement\n @return {Ember.View} receiver\n */\n destroyElement: function() {\n return this.currentState.destroyElement(this);\n },\n\n /**\n Called when the element of the view is going to be destroyed. Override\n this function to do any teardown that requires an element, like removing\n event listeners.\n\n @event willDestroyElement\n */\n willDestroyElement: function() {},\n\n /**\n @private\n\n Triggers the `willDestroyElement` event (which invokes the\n `willDestroyElement()` method if it exists) on this view and all child\n views.\n\n Before triggering `willDestroyElement`, it first triggers the\n `willClearRender` event recursively.\n\n @method _notifyWillDestroyElement\n */\n _notifyWillDestroyElement: function() {\n this.triggerRecursively('willClearRender');\n this.triggerRecursively('willDestroyElement');\n },\n\n _elementWillChange: Ember.beforeObserver(function() {\n this.forEachChildView(function(view) {\n Ember.propertyWillChange(view, 'element');\n });\n }, 'element'),\n\n /**\n @private\n\n If this view's element changes, we need to invalidate the caches of our\n child views so that we do not retain references to DOM elements that are\n no longer needed.\n\n @method _elementDidChange\n */\n _elementDidChange: Ember.observer(function() {\n this.forEachChildView(function(view) {\n Ember.propertyDidChange(view, 'element');\n });\n }, 'element'),\n\n /**\n Called when the parentView property has changed.\n\n @event parentViewDidChange\n */\n parentViewDidChange: Ember.K,\n\n instrumentName: 'view',\n\n instrumentDetails: function(hash) {\n hash.template = get(this, 'templateName');\n this._super(hash);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n this.lengthBeforeRender = this._childViews.length;\n var buffer = this._super(parentBuffer, bufferOperation);\n this.lengthAfterRender = this._childViews.length;\n\n return buffer;\n },\n\n renderToBufferIfNeeded: function () {\n return this.currentState.renderToBufferIfNeeded(this, this);\n },\n\n beforeRender: function(buffer) {\n this.applyAttributesToBuffer(buffer);\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n },\n\n applyAttributesToBuffer: function(buffer) {\n // Creates observers for all registered class name and attribute bindings,\n // then adds them to the element.\n var classNameBindings = get(this, 'classNameBindings');\n if (classNameBindings.length) {\n this._applyClassNameBindings(classNameBindings);\n }\n\n // Pass the render buffer so the method can apply attributes directly.\n // This isn't needed for class name bindings because they use the\n // existing classNames infrastructure.\n var attributeBindings = get(this, 'attributeBindings');\n if (attributeBindings.length) {\n this._applyAttributeBindings(buffer, attributeBindings);\n }\n\n buffer.setClasses(this.classNames);\n buffer.id(this.elementId);\n\n var role = get(this, 'ariaRole');\n if (role) {\n buffer.attr('role', role);\n }\n\n if (get(this, 'isVisible') === false) {\n buffer.style('display', 'none');\n }\n },\n\n // ..........................................................\n // STANDARD RENDER PROPERTIES\n //\n\n /**\n Tag name for the view's outer element. The tag name is only used when an\n element is first created. If you change the `tagName` for an element, you\n must destroy and recreate the view element.\n\n By default, the render buffer will use a `<div>` tag for views.\n\n @property tagName\n @type String\n @default null\n */\n\n // We leave this null by default so we can tell the difference between\n // the default case and a user-specified tag.\n tagName: null,\n\n /**\n The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.\n\n The full list of valid WAI-ARIA roles is available at:\n http://www.w3.org/TR/wai-aria/roles#roles_categorization\n\n @property ariaRole\n @type String\n @default null\n */\n ariaRole: null,\n\n /**\n Standard CSS class names to apply to the view's outer element. This\n property automatically inherits any class names defined by the view's\n superclasses as well.\n\n @property classNames\n @type Array\n @default ['ember-view']\n */\n classNames: ['ember-view'],\n\n /**\n A list of properties of the view to apply as class names. If the property\n is a string value, the value of that string will be applied as a class\n name.\n\n ```javascript\n // Applies the 'high' class to the view element\n Ember.View.create({\n classNameBindings: ['priority']\n priority: 'high'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as a dasherized class name.\n\n ```javascript\n // Applies the 'is-urgent' class to the view element\n Ember.View.create({\n classNameBindings: ['isUrgent']\n isUrgent: true\n });\n ```\n\n If you would prefer to use a custom value instead of the dasherized\n property name, you can pass a binding like this:\n\n ```javascript\n // Applies the 'urgent' class to the view element\n Ember.View.create({\n classNameBindings: ['isUrgent:urgent']\n isUrgent: true\n });\n ```\n\n This list of properties is inherited from the view's superclasses as well.\n\n @property classNameBindings\n @type Array\n @default []\n */\n classNameBindings: [],\n\n /**\n A list of properties of the view to apply as attributes. If the property is\n a string value, the value of that string will be applied as the attribute.\n\n ```javascript\n // Applies the type attribute to the element\n // with the value \"button\", like <div type=\"button\">\n Ember.View.create({\n attributeBindings: ['type'],\n type: 'button'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as an attribute.\n\n ```javascript\n // Renders something like <div enabled=\"enabled\">\n Ember.View.create({\n attributeBindings: ['enabled'],\n enabled: true\n });\n ```\n\n @property attributeBindings\n */\n attributeBindings: [],\n\n // .......................................................\n // CORE DISPLAY METHODS\n //\n\n /**\n @private\n\n Setup a view, but do not finish waking it up.\n - configure `childViews`\n - register the view with the global views hash, which is used for event\n dispatch\n\n @method init\n */\n init: function() {\n this.elementId = this.elementId || guidFor(this);\n\n this._super();\n\n // setup child views. be sure to clone the child views array first\n this._childViews = this._childViews.slice();\n\n Ember.assert(\"Only arrays are allowed for 'classNameBindings'\", Ember.typeOf(this.classNameBindings) === 'array');\n this.classNameBindings = Ember.A(this.classNameBindings.slice());\n\n Ember.assert(\"Only arrays are allowed for 'classNames'\", Ember.typeOf(this.classNames) === 'array');\n this.classNames = Ember.A(this.classNames.slice());\n\n var viewController = get(this, 'viewController');\n if (viewController) {\n viewController = get(viewController);\n if (viewController) {\n set(viewController, 'view', this);\n }\n }\n },\n\n appendChild: function(view, options) {\n return this.currentState.appendChild(this, view, options);\n },\n\n /**\n Removes the child view from the parent view.\n\n @method removeChild\n @param {Ember.View} view\n @return {Ember.View} receiver\n */\n removeChild: function(view) {\n // If we're destroying, the entire subtree will be\n // freed, and the DOM will be handled separately,\n // so no need to mess with childViews.\n if (this.isDestroying) { return; }\n\n // update parent node\n set(view, '_parentView', null);\n\n // remove view from childViews array.\n var childViews = this._childViews;\n\n Ember.EnumerableUtils.removeObject(childViews, view);\n\n this.propertyDidChange('childViews'); // HUH?! what happened to will change?\n\n return this;\n },\n\n /**\n Removes all children from the `parentView`.\n\n @method removeAllChildren\n @return {Ember.View} receiver\n */\n removeAllChildren: function() {\n return this.mutateChildViews(function(view) {\n this.removeChild(view);\n });\n },\n\n destroyAllChildren: function() {\n return this.mutateChildViews(function(view) {\n view.destroy();\n });\n },\n\n /**\n Removes the view from its `parentView`, if one is found. Otherwise\n does nothing.\n\n @method removeFromParent\n @return {Ember.View} receiver\n */\n removeFromParent: function() {\n var parent = this._parentView;\n\n // Remove DOM element from parent\n this.remove();\n\n if (parent) { parent.removeChild(this); }\n return this;\n },\n\n /**\n You must call `destroy` on a view to destroy the view (and all of its\n child views). This will remove the view from any parent node, then make\n sure that the DOM element managed by the view can be released by the\n memory manager.\n\n @method willDestroy\n */\n willDestroy: function() {\n // calling this._super() will nuke computed properties and observers,\n // so collect any information we need before calling super.\n var childViews = this._childViews,\n parent = this._parentView,\n childLen, i;\n\n // destroy the element -- this will avoid each child view destroying\n // the element over and over again...\n if (!this.removedFromDOM) { this.destroyElement(); }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].removedFromDOM = true;\n }\n\n // remove from non-virtual parent view if viewName was specified\n if (this.viewName) {\n var nonVirtualParentView = get(this, 'parentView');\n if (nonVirtualParentView) {\n set(nonVirtualParentView, this.viewName, null);\n }\n }\n\n // remove from parent if found. Don't call removeFromParent,\n // as removeFromParent will try to remove the element from\n // the DOM again.\n if (parent) { parent.removeChild(this); }\n\n this.transitionTo('destroyed');\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].destroy();\n }\n\n // next remove view from global hash\n if (!this.isVirtual) delete Ember.View.views[get(this, 'elementId')];\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n @method createChildView\n @param {Class} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n if (view.isView && view._parentView === this) { return view; }\n\n if (Ember.CoreView.detect(view)) {\n attrs = attrs || {};\n attrs._parentView = this;\n attrs.templateData = attrs.templateData || get(this, 'templateData');\n\n view = view.create(attrs);\n\n // don't set the property on a virtual view, as they are invisible to\n // consumers of the view API\n if (view.viewName) { set(get(this, 'concreteView'), view.viewName, view); }\n } else {\n Ember.assert('You must pass instance or subclass of View', view.isView);\n\n if (attrs) {\n view.setProperties(attrs);\n }\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', get(this, 'templateData'));\n }\n\n set(view, '_parentView', this);\n }\n\n return view;\n },\n\n becameVisible: Ember.K,\n becameHidden: Ember.K,\n\n /**\n @private\n\n When the view's `isVisible` property changes, toggle the visibility\n element of the actual DOM element.\n\n @method _isVisibleDidChange\n */\n _isVisibleDidChange: Ember.observer(function() {\n var $el = this.$();\n if (!$el) { return; }\n\n var isVisible = get(this, 'isVisible');\n\n $el.toggle(isVisible);\n\n if (this._isAncestorHidden()) { return; }\n\n if (isVisible) {\n this._notifyBecameVisible();\n } else {\n this._notifyBecameHidden();\n }\n }, 'isVisible'),\n\n _notifyBecameVisible: function() {\n this.trigger('becameVisible');\n\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameVisible();\n }\n });\n },\n\n _notifyBecameHidden: function() {\n this.trigger('becameHidden');\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameHidden();\n }\n });\n },\n\n _isAncestorHidden: function() {\n var parent = get(this, 'parentView');\n\n while (parent) {\n if (get(parent, 'isVisible') === false) { return true; }\n\n parent = get(parent, 'parentView');\n }\n\n return false;\n },\n\n clearBuffer: function() {\n this.invokeRecursively(function(view) {\n view.buffer = null;\n });\n },\n\n transitionTo: function(state, children) {\n this.currentState = this.states[state];\n this.state = state;\n\n if (children !== false) {\n this.forEachChildView(function(view) {\n view.transitionTo(state);\n });\n }\n },\n\n // .......................................................\n // EVENT HANDLING\n //\n\n /**\n @private\n\n Handle events from `Ember.EventDispatcher`\n\n @method handleEvent\n @param eventName {String}\n @param evt {Event}\n */\n handleEvent: function(eventName, evt) {\n return this.currentState.handleEvent(this, eventName, evt);\n },\n\n registerObserver: function(root, path, target, observer) {\n if (!observer && 'function' === typeof target) {\n observer = target;\n target = null;\n }\n var view = this,\n stateCheckedObserver = function(){\n view.currentState.invokeObserver(this, observer);\n };\n Ember.addObserver(root, path, target, stateCheckedObserver);\n\n this.one('willClearRender', function() {\n Ember.removeObserver(root, path, target, stateCheckedObserver);\n });\n }\n\n});\n\n/*\n Describe how the specified actions should behave in the various\n states that a view can exist in. Possible states:\n\n * preRender: when a view is first instantiated, and after its\n element was destroyed, it is in the preRender state\n * inBuffer: once a view has been rendered, but before it has\n been inserted into the DOM, it is in the inBuffer state\n * inDOM: once a view has been inserted into the DOM it is in\n the inDOM state. A view spends the vast majority of its\n existence in this state.\n * destroyed: once a view has been destroyed (using the destroy\n method), it is in this state. No further actions can be invoked\n on a destroyed view.\n*/\n\n // in the destroyed state, everything is illegal\n\n // before rendering has begun, all legal manipulations are noops.\n\n // inside the buffer, legal manipulations are done on the buffer\n\n // once the view has been inserted into the DOM, legal manipulations\n // are done on the DOM element.\n\nfunction notifyMutationListeners() {\n Ember.run.once(Ember.View, 'notifyMutationListeners');\n}\n\nvar DOMManager = {\n prepend: function(view, html) {\n view.$().prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.$().after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.$().html(html);\n notifyMutationListeners();\n },\n\n replace: function(view) {\n var element = get(view, 'element');\n\n set(view, 'element', null);\n\n view._insertElementLater(function() {\n Ember.$(element).replaceWith(get(view, 'element'));\n notifyMutationListeners();\n });\n },\n\n remove: function(view) {\n view.$().remove();\n notifyMutationListeners();\n },\n\n empty: function(view) {\n view.$().empty();\n notifyMutationListeners();\n }\n};\n\nEmber.View.reopen({\n domManager: DOMManager\n});\n\nEmber.View.reopenClass({\n\n /**\n @private\n\n Parse a path and return an object which holds the parsed properties.\n\n For example a path like \"content.isEnabled:enabled:disabled\" wil return the\n following object:\n\n ```javascript\n {\n path: \"content.isEnabled\",\n className: \"enabled\",\n falsyClassName: \"disabled\",\n classNames: \":enabled:disabled\"\n }\n ```\n\n @method _parsePropertyPath\n @static\n */\n _parsePropertyPath: function(path) {\n var split = path.split(':'),\n propertyPath = split[0],\n classNames = \"\",\n className,\n falsyClassName;\n\n // check if the property is defined as prop:class or prop:trueClass:falseClass\n if (split.length > 1) {\n className = split[1];\n if (split.length === 3) { falsyClassName = split[2]; }\n\n classNames = ':' + className;\n if (falsyClassName) { classNames += \":\" + falsyClassName; }\n }\n\n return {\n path: propertyPath,\n classNames: classNames,\n className: (className === '') ? undefined : className,\n falsyClassName: falsyClassName\n };\n },\n\n /**\n @private\n\n Get the class name for a given value, based on the path, optional\n `className` and optional `falsyClassName`.\n\n - if a `className` or `falsyClassName` has been specified:\n - if the value is truthy and `className` has been specified,\n `className` is returned\n - if the value is falsy and `falsyClassName` has been specified,\n `falsyClassName` is returned\n - otherwise `null` is returned\n - if the value is `true`, the dasherized last part of the supplied path\n is returned\n - if the value is not `false`, `undefined` or `null`, the `value`\n is returned\n - if none of the above rules apply, `null` is returned\n\n @method _classStringForValue\n @param path\n @param val\n @param className\n @param falsyClassName\n @static\n */\n _classStringForValue: function(path, val, className, falsyClassName) {\n // When using the colon syntax, evaluate the truthiness or falsiness\n // of the value to determine which className to return\n if (className || falsyClassName) {\n if (className && !!val) {\n return className;\n\n } else if (falsyClassName && !val) {\n return falsyClassName;\n\n } else {\n return null;\n }\n\n // If value is a Boolean and true, return the dasherized property\n // name.\n } else if (val === true) {\n // Normalize property path to be suitable for use\n // as a class name. For exaple, content.foo.barBaz\n // becomes bar-baz.\n var parts = path.split('.');\n return Ember.String.dasherize(parts[parts.length-1]);\n\n // If the value is not false, undefined, or null, return the current\n // value of the property.\n } else if (val !== false && val !== undefined && val !== null) {\n return val;\n\n // Nothing to display. Return null so that the old class is removed\n // but no new class is added.\n } else {\n return null;\n }\n }\n});\n\nvar mutation = Ember.Object.extend(Ember.Evented).create();\n\nEmber.View.addMutationListener = function(callback) {\n mutation.on('change', callback);\n};\n\nEmber.View.removeMutationListener = function(callback) {\n mutation.off('change', callback);\n};\n\nEmber.View.notifyMutationListeners = function() {\n mutation.trigger('change');\n};\n\n/**\n Global views hash\n\n @property views\n @static\n @type Hash\n*/\nEmber.View.views = {};\n\n// If someone overrides the child views computed property when\n// defining their class, we want to be able to process the user's\n// supplied childViews and then restore the original computed property\n// at view initialization time. This happens in Ember.ContainerView's init\n// method.\nEmber.View.childViewsProperty = childViewsProperty;\n\nEmber.View.applyAttributeBindings = function(elem, name, value) {\n var type = Ember.typeOf(value);\n\n // if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js\n if (name !== 'value' && (type === 'string' || (type === 'number' && !isNaN(value)))) {\n if (value !== elem.attr(name)) {\n elem.attr(name, value);\n }\n } else if (name === 'value' || type === 'boolean') {\n // We can't set properties to undefined\n if (value === undefined) { value = null; }\n\n if (value !== elem.prop(name)) {\n // value and booleans should always be properties\n elem.prop(name, value);\n }\n } else if (!value) {\n elem.removeAttr(name);\n }\n};\n\nEmber.View.states = states;\n\n})();\n//@ sourceURL=ember-views/views/view");minispade.register('ember', "(function() {minispade.require('ember-application');\n\n/**\nEmber\n\n@module ember\n*/\n\n})();\n//@ sourceURL=ember");minispade.register('loader', "(function() {var define, requireModule;\n\n(function() {\n var registry = {}, seen = {};\n\n define = function(name, deps, callback) {\n registry[name] = { deps: deps, callback: callback };\n };\n\n requireModule = function(name) {\n if (seen[name]) { return seen[name]; }\n seen[name] = {};\n\n var mod = registry[name],\n deps = mod.deps,\n callback = mod.callback,\n reified = [],\n exports;\n\n for (var i=0, l=deps.length; i<l; i++) {\n if (deps[i] === 'exports') {\n reified.push(exports = {});\n } else {\n reified.push(requireModule(deps[i]));\n }\n }\n\n var value = callback.apply(this, reified);\n return seen[name] = exports || value;\n };\n})();\n\n})();\n//@ sourceURL=loader");minispade.register('metamorph', "(function() {define(\"metamorph\",\n [],\n function() {\n \"use strict\";\n // ==========================================================================\n // Project: metamorph\n // Copyright: ©2011 My Company Inc. All rights reserved.\n // ==========================================================================\n\n var K = function(){},\n guid = 0,\n document = this.document,\n\n // Feature-detect the W3C range API, the extended check is for IE9 which only partially supports ranges\n supportsRange = document && ('createRange' in document) && (typeof Range !== 'undefined') && Range.prototype.createContextualFragment,\n\n // Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n // is a \"zero-scope\" element. This problem can be worked around by making\n // the first node an invisible text node. We, like Modernizr, use ­\n needsShy = document && (function(){\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n })(),\n\n\n // IE 8 (and likely earlier) likes to move whitespace preceeding\n // a script tag to appear after it. This means that we can\n // accidentally remove whitespace when updating a morph.\n movesWhitespace = document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n })();\n\n // Constructor that supports either Metamorph('foo') or new\n // Metamorph('foo');\n //\n // Takes a string of HTML as the argument.\n\n var Metamorph = function(html) {\n var self;\n\n if (this instanceof Metamorph) {\n self = this;\n } else {\n self = new K();\n }\n\n self.innerHTML = html;\n var myGuid = 'metamorph-'+(guid++);\n self.start = myGuid + '-start';\n self.end = myGuid + '-end';\n\n return self;\n };\n\n K.prototype = Metamorph.prototype;\n\n var rangeFor, htmlFunc, removeFunc, outerHTMLFunc, appendToFunc, afterFunc, prependFunc, startTagFunc, endTagFunc;\n\n outerHTMLFunc = function() {\n return this.startTag() + this.innerHTML + this.endTag();\n };\n\n startTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.start + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n endTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.end + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n // If we have the W3C range API, this process is relatively straight forward.\n if (supportsRange) {\n\n // Get a range for the current morph. Optionally include the starting and\n // ending placeholders.\n rangeFor = function(morph, outerToo) {\n var range = document.createRange();\n var before = document.getElementById(morph.start);\n var after = document.getElementById(morph.end);\n\n if (outerToo) {\n range.setStartBefore(before);\n range.setEndAfter(after);\n } else {\n range.setStartAfter(before);\n range.setEndBefore(after);\n }\n\n return range;\n };\n\n htmlFunc = function(html, outerToo) {\n // get a range for the current metamorph object\n var range = rangeFor(this, outerToo);\n\n // delete the contents of the range, which will be the\n // nodes between the starting and ending placeholder.\n range.deleteContents();\n\n // create a new document fragment for the HTML\n var fragment = range.createContextualFragment(html);\n\n // insert the fragment into the range\n range.insertNode(fragment);\n };\n\n removeFunc = function() {\n // get a range for the current metamorph object including\n // the starting and ending placeholders.\n var range = rangeFor(this, true);\n\n // delete the entire range.\n range.deleteContents();\n };\n\n appendToFunc = function(node) {\n var range = document.createRange();\n range.setStart(node);\n range.collapse(false);\n var frag = range.createContextualFragment(this.outerHTML());\n node.appendChild(frag);\n };\n\n afterFunc = function(html) {\n var range = document.createRange();\n var after = document.getElementById(this.end);\n\n range.setStartAfter(after);\n range.setEndAfter(after);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n prependFunc = function(html) {\n var range = document.createRange();\n var start = document.getElementById(this.start);\n\n range.setStartAfter(start);\n range.setEndAfter(start);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n } else {\n /**\n * This code is mostly taken from jQuery, with one exception. In jQuery's case, we\n * have some HTML and we need to figure out how to convert it into some nodes.\n *\n * In this case, jQuery needs to scan the HTML looking for an opening tag and use\n * that as the key for the wrap map. In our case, we know the parent node, and\n * can use its type as the key for the wrap map.\n **/\n var wrapMap = {\n select: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n fieldset: [ 1, \"<fieldset>\", \"</fieldset>\" ],\n table: [ 1, \"<table>\", \"</table>\" ],\n tbody: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n tr: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n colgroup: [ 2, \"<table><tbody></tbody><colgroup>\", \"</colgroup></table>\" ],\n map: [ 1, \"<map>\", \"</map>\" ],\n _default: [ 0, \"\", \"\" ]\n };\n\n var findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n };\n\n var setInnerHTML = function(element, html) {\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n };\n\n /**\n * Given a parent node and some HTML, generate a set of nodes. Return the first\n * node, which will allow us to traverse the rest using nextSibling.\n *\n * We need to do this because innerHTML in IE does not really parse the nodes.\n **/\n var firstNodeFor = function(parentNode, html) {\n var arr = wrapMap[parentNode.tagName.toLowerCase()] || wrapMap._default;\n var depth = arr[0], start = arr[1], end = arr[2];\n\n if (needsShy) { html = '­'+html; }\n\n var element = document.createElement('div');\n\n setInnerHTML(element, start + html + end);\n\n for (var i=0; i<=depth; i++) {\n element = element.firstChild;\n }\n\n // Look for ­ to remove it.\n if (needsShy) {\n var shyElement = element;\n\n // Sometimes we get nameless elements with the shy inside\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n\n // At this point it's the actual unicode character.\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n\n return element;\n };\n\n /**\n * In some cases, Internet Explorer can create an anonymous node in\n * the hierarchy with no tagName. You can create this scenario via:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table>­<script></script><tr><td>hi</td></tr></table>\";\n * div.firstChild.firstChild.tagName //=> \"\"\n *\n * If our script markers are inside such a node, we need to find that\n * node and use *it* as the marker.\n **/\n var realNode = function(start) {\n while (start.parentNode.tagName === \"\") {\n start = start.parentNode;\n }\n\n return start;\n };\n\n /**\n * When automatically adding a tbody, Internet Explorer inserts the\n * tbody immediately before the first <tr>. Other browsers create it\n * before the first node, no matter what.\n *\n * This means the the following code:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table><script id='first'></script><tr><td>hi</td></tr><script id='last'></script></table>\n *\n * Generates the following DOM in IE:\n *\n * + div\n * + table\n * - script id='first'\n * + tbody\n * + tr\n * + td\n * - \"hi\"\n * - script id='last'\n *\n * Which means that the two script tags, even though they were\n * inserted at the same point in the hierarchy in the original\n * HTML, now have different parents.\n *\n * This code reparents the first script tag by making it the tbody's\n * first child.\n **/\n var fixParentage = function(start, end) {\n if (start.parentNode !== end.parentNode) {\n end.parentNode.insertBefore(start, end.parentNode.firstChild);\n }\n };\n\n htmlFunc = function(html, outerToo) {\n // get the real starting node. see realNode for details.\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n var parentNode = end.parentNode;\n var node, nextSibling, last;\n\n // make sure that the start and end nodes share the same\n // parent. If not, fix it.\n fixParentage(start, end);\n\n // remove all of the nodes after the starting placeholder and\n // before the ending placeholder.\n node = start.nextSibling;\n while (node) {\n nextSibling = node.nextSibling;\n last = node === end;\n\n // if this is the last node, and we want to remove it as well,\n // set the `end` node to the next sibling. This is because\n // for the rest of the function, we insert the new nodes\n // before the end (note that insertBefore(node, null) is\n // the same as appendChild(node)).\n //\n // if we do not want to remove it, just break.\n if (last) {\n if (outerToo) { end = node.nextSibling; } else { break; }\n }\n\n node.parentNode.removeChild(node);\n\n // if this is the last node and we didn't break before\n // (because we wanted to remove the outer nodes), break\n // now.\n if (last) { break; }\n\n node = nextSibling;\n }\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(start.parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, end);\n node = nextSibling;\n }\n };\n\n // remove the nodes in the DOM representing this metamorph.\n //\n // this includes the starting and ending placeholders.\n removeFunc = function() {\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n\n this.html('');\n start.parentNode.removeChild(start);\n end.parentNode.removeChild(end);\n };\n\n appendToFunc = function(parentNode) {\n var node = firstNodeFor(parentNode, this.outerHTML());\n var nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.appendChild(node);\n node = nextSibling;\n }\n };\n\n afterFunc = function(html) {\n // get the real starting node. see realNode for details.\n var end = document.getElementById(this.end);\n var insertBefore = end.nextSibling;\n var parentNode = end.parentNode;\n var nextSibling;\n var node;\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n\n prependFunc = function(html) {\n var start = document.getElementById(this.start);\n var parentNode = start.parentNode;\n var nextSibling;\n var node;\n\n node = firstNodeFor(parentNode, html);\n var insertBefore = start.nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n }\n\n Metamorph.prototype.html = function(html) {\n this.checkRemoved();\n if (html === undefined) { return this.innerHTML; }\n\n htmlFunc.call(this, html);\n\n this.innerHTML = html;\n };\n\n Metamorph.prototype.replaceWith = function(html) {\n this.checkRemoved();\n htmlFunc.call(this, html, true);\n };\n\n Metamorph.prototype.remove = removeFunc;\n Metamorph.prototype.outerHTML = outerHTMLFunc;\n Metamorph.prototype.appendTo = appendToFunc;\n Metamorph.prototype.after = afterFunc;\n Metamorph.prototype.prepend = prependFunc;\n Metamorph.prototype.startTag = startTagFunc;\n Metamorph.prototype.endTag = endTagFunc;\n\n Metamorph.prototype.isRemoved = function() {\n var before = document.getElementById(this.start);\n var after = document.getElementById(this.end);\n\n return !before || !after;\n };\n\n Metamorph.prototype.checkRemoved = function() {\n if (this.isRemoved()) {\n throw new Error(\"Cannot perform operations on a Metamorph that is not in the DOM.\");\n }\n };\n\n return Metamorph;\n });\n\n})();\n//@ sourceURL=metamorph");minispade.register('rsvp', "(function() {define(\"rsvp\",\n [],\n function() {\n \"use strict\";\n var browserGlobal = (typeof window !== 'undefined') ? window : {};\n\n var MutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n var RSVP, async;\n\n if (typeof process !== 'undefined' &&\n {}.toString.call(process) === '[object process]') {\n async = function(callback, binding) {\n process.nextTick(function() {\n callback.call(binding);\n });\n };\n } else if (MutationObserver) {\n var queue = [];\n\n var observer = new MutationObserver(function() {\n var toProcess = queue.slice();\n queue = [];\n\n toProcess.forEach(function(tuple) {\n var callback = tuple[0], binding = tuple[1];\n callback.call(binding);\n });\n });\n\n var element = document.createElement('div');\n observer.observe(element, { attributes: true });\n\n // Chrome Memory Leak: https://bugs.webkit.org/show_bug.cgi?id=93661\n window.addEventListener('unload', function(){\n observer.disconnect();\n observer = null;\n });\n\n async = function(callback, binding) {\n queue.push([callback, binding]);\n element.setAttribute('drainQueue', 'drainQueue');\n };\n } else {\n async = function(callback, binding) {\n setTimeout(function() {\n callback.call(binding);\n }, 1);\n };\n }\n\n var Event = function(type, options) {\n this.type = type;\n\n for (var option in options) {\n if (!options.hasOwnProperty(option)) { continue; }\n\n this[option] = options[option];\n }\n };\n\n var indexOf = function(callbacks, callback) {\n for (var i=0, l=callbacks.length; i<l; i++) {\n if (callbacks[i][0] === callback) { return i; }\n }\n\n return -1;\n };\n\n var callbacksFor = function(object) {\n var callbacks = object._promiseCallbacks;\n\n if (!callbacks) {\n callbacks = object._promiseCallbacks = {};\n }\n\n return callbacks;\n };\n\n var EventTarget = {\n mixin: function(object) {\n object.on = this.on;\n object.off = this.off;\n object.trigger = this.trigger;\n return object;\n },\n\n on: function(eventNames, callback, binding) {\n var allCallbacks = callbacksFor(this), callbacks, eventName;\n eventNames = eventNames.split(/\\s+/);\n binding = binding || this;\n\n while (eventName = eventNames.shift()) {\n callbacks = allCallbacks[eventName];\n\n if (!callbacks) {\n callbacks = allCallbacks[eventName] = [];\n }\n\n if (indexOf(callbacks, callback) === -1) {\n callbacks.push([callback, binding]);\n }\n }\n },\n\n off: function(eventNames, callback) {\n var allCallbacks = callbacksFor(this), callbacks, eventName, index;\n eventNames = eventNames.split(/\\s+/);\n\n while (eventName = eventNames.shift()) {\n if (!callback) {\n allCallbacks[eventName] = [];\n continue;\n }\n\n callbacks = allCallbacks[eventName];\n\n index = indexOf(callbacks, callback);\n\n if (index !== -1) { callbacks.splice(index, 1); }\n }\n },\n\n trigger: function(eventName, options) {\n var allCallbacks = callbacksFor(this),\n callbacks, callbackTuple, callback, binding, event;\n\n if (callbacks = allCallbacks[eventName]) {\n // Don't cache the callbacks.length since it may grow\n for (var i=0; i<callbacks.length; i++) {\n callbackTuple = callbacks[i];\n callback = callbackTuple[0];\n binding = callbackTuple[1];\n\n if (typeof options !== 'object') {\n options = { detail: options };\n }\n\n event = new Event(eventName, options);\n callback.call(binding, event);\n }\n }\n }\n };\n\n var Promise = function() {\n this.on('promise:resolved', function(event) {\n this.trigger('success', { detail: event.detail });\n }, this);\n\n this.on('promise:failed', function(event) {\n this.trigger('error', { detail: event.detail });\n }, this);\n };\n\n var noop = function() {};\n\n var invokeCallback = function(type, promise, callback, event) {\n var hasCallback = typeof callback === 'function',\n value, error, succeeded, failed;\n\n if (hasCallback) {\n try {\n value = callback(event.detail);\n succeeded = true;\n } catch(e) {\n failed = true;\n error = e;\n }\n } else {\n value = event.detail;\n succeeded = true;\n }\n\n if (value && typeof value.then === 'function') {\n value.then(function(value) {\n promise.resolve(value);\n }, function(error) {\n promise.reject(error);\n });\n } else if (hasCallback && succeeded) {\n promise.resolve(value);\n } else if (failed) {\n promise.reject(error);\n } else {\n promise[type](value);\n }\n };\n\n Promise.prototype = {\n then: function(done, fail) {\n var thenPromise = new Promise();\n\n if (this.isResolved) {\n RSVP.async(function() {\n invokeCallback('resolve', thenPromise, done, { detail: this.resolvedValue });\n }, this);\n }\n\n if (this.isRejected) {\n RSVP.async(function() {\n invokeCallback('reject', thenPromise, fail, { detail: this.rejectedValue });\n }, this);\n }\n\n this.on('promise:resolved', function(event) {\n invokeCallback('resolve', thenPromise, done, event);\n });\n\n this.on('promise:failed', function(event) {\n invokeCallback('reject', thenPromise, fail, event);\n });\n\n return thenPromise;\n },\n\n resolve: function(value) {\n resolve(this, value);\n\n this.resolve = noop;\n this.reject = noop;\n },\n\n reject: function(value) {\n reject(this, value);\n\n this.resolve = noop;\n this.reject = noop;\n }\n };\n\n function resolve(promise, value) {\n RSVP.async(function() {\n promise.trigger('promise:resolved', { detail: value });\n promise.isResolved = true;\n promise.resolvedValue = value;\n });\n }\n\n function reject(promise, value) {\n RSVP.async(function() {\n promise.trigger('promise:failed', { detail: value });\n promise.isRejected = true;\n promise.rejectedValue = value;\n });\n }\n\n function all(promises) {\n var i, results = [];\n var allPromise = new Promise();\n var remaining = promises.length;\n\n if (remaining === 0) {\n allPromise.resolve([]);\n }\n\n var resolver = function(index) {\n return function(value) {\n resolve(index, value);\n };\n };\n\n var resolve = function(index, value) {\n results[index] = value;\n if (--remaining === 0) {\n allPromise.resolve(results);\n }\n };\n\n var reject = function(error) {\n allPromise.reject(error);\n };\n\n for (i = 0; i < remaining; i++) {\n promises[i].then(resolver(i), reject);\n }\n return allPromise;\n }\n\n EventTarget.mixin(Promise.prototype);\n\n RSVP = { async: async, Promise: Promise, Event: Event, EventTarget: EventTarget, all: all, raiseOnUncaughtExceptions: true };\n return RSVP;\n });\n\n})();\n//@ sourceURL=rsvp");
+minispade.register('container', "(function() {define(\"container\",\n [],\n function() {\n\n function InheritingDict(parent) {\n this.parent = parent;\n this.dict = {};\n }\n\n InheritingDict.prototype = {\n get: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return dict[key];\n }\n\n if (this.parent) {\n return this.parent.get(key);\n }\n },\n\n set: function(key, value) {\n this.dict[key] = value;\n },\n\n has: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return true;\n }\n\n if (this.parent) {\n return this.parent.has(key);\n }\n\n return false;\n },\n\n eachLocal: function(callback, binding) {\n var dict = this.dict;\n\n for (var prop in dict) {\n if (dict.hasOwnProperty(prop)) {\n callback.call(binding, prop, dict[prop]);\n }\n }\n }\n };\n\n function Container(parent) {\n this.parent = parent;\n this.children = [];\n\n this.resolver = parent && parent.resolver || function() {};\n this.registry = new InheritingDict(parent && parent.registry);\n this.cache = new InheritingDict(parent && parent.cache);\n this.typeInjections = new InheritingDict(parent && parent.typeInjections);\n this.injections = {};\n this._options = new InheritingDict(parent && parent._options);\n this._typeOptions = new InheritingDict(parent && parent._typeOptions);\n }\n\n Container.prototype = {\n child: function() {\n var container = new Container(this);\n this.children.push(container);\n return container;\n },\n\n set: function(object, key, value) {\n object[key] = value;\n },\n\n register: function(type, name, factory, options) {\n var fullName;\n\n if (type.indexOf(':') !== -1){\n options = factory;\n factory = name;\n fullName = type;\n } else {\n Ember.deprecate('register(\"'+type +'\", \"'+ name+'\") is now deprecated in-favour of register(\"'+type+':'+name+'\");', true);\n fullName = type + \":\" + name;\n }\n\n var normalizedName = this.normalize(fullName);\n\n this.registry.set(normalizedName, factory);\n this._options.set(normalizedName, options || {});\n },\n\n resolve: function(fullName) {\n return this.resolver(fullName) || this.registry.get(fullName);\n },\n\n normalize: function(fullName) {\n return fullName;\n },\n\n lookup: function(fullName, options) {\n fullName = this.normalize(fullName);\n\n options = options || {};\n\n if (this.cache.has(fullName) && options.singleton !== false) {\n return this.cache.get(fullName);\n }\n\n var value = instantiate(this, fullName);\n\n if (!value) { return; }\n\n if (isSingleton(this, fullName) && options.singleton !== false) {\n this.cache.set(fullName, value);\n }\n\n return value;\n },\n\n has: function(fullName) {\n if (this.cache.has(fullName)) {\n return true;\n }\n\n return !!factoryFor(this, fullName);\n },\n\n optionsForType: function(type, options) {\n if (this.parent) { illegalChildOperation('optionsForType'); }\n\n this._typeOptions.set(type, options);\n },\n\n options: function(type, options) {\n this.optionsForType(type, options);\n },\n\n typeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('typeInjection'); }\n\n var injections = this.typeInjections.get(type);\n if (!injections) {\n injections = [];\n this.typeInjections.set(type, injections);\n }\n injections.push({ property: property, fullName: fullName });\n },\n\n injection: function(factoryName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n if (factoryName.indexOf(':') === -1) {\n return this.typeInjection(factoryName, property, injectionName);\n }\n\n var injections = this.injections[factoryName] = this.injections[factoryName] || [];\n injections.push({ property: property, fullName: injectionName });\n },\n\n destroy: function() {\n this.isDestroyed = true;\n\n for (var i=0, l=this.children.length; i<l; i++) {\n this.children[i].destroy();\n }\n\n this.children = [];\n\n eachDestroyable(this, function(item) {\n item.isDestroying = true;\n });\n\n eachDestroyable(this, function(item) {\n item.destroy();\n });\n\n delete this.parent;\n this.isDestroyed = true;\n },\n\n reset: function() {\n for (var i=0, l=this.children.length; i<l; i++) {\n resetCache(this.children[i]);\n }\n resetCache(this);\n }\n };\n\n function illegalChildOperation(operation) {\n throw new Error(operation + \" is not currently supported on child containers\");\n }\n\n function isSingleton(container, fullName) {\n var singleton = option(container, fullName, 'singleton');\n\n return singleton !== false;\n }\n\n function buildInjections(container, injections) {\n var hash = {};\n\n if (!injections) { return hash; }\n\n var injection, lookup;\n\n for (var i=0, l=injections.length; i<l; i++) {\n injection = injections[i];\n lookup = container.lookup(injection.fullName);\n hash[injection.property] = lookup;\n }\n\n return hash;\n }\n\n function option(container, fullName, optionName) {\n var options = container._options.get(fullName);\n\n if (options && options[optionName] !== undefined) {\n return options[optionName];\n }\n\n var type = fullName.split(\":\")[0];\n options = container._typeOptions.get(type);\n\n if (options) {\n return options[optionName];\n }\n }\n\n function factoryFor(container, fullName) {\n var name = container.normalize(fullName);\n return container.resolve(name);\n }\n\n function instantiate(container, fullName) {\n var factory = factoryFor(container, fullName);\n\n var splitName = fullName.split(\":\"),\n type = splitName[0], name = splitName[1],\n value;\n\n if (option(container, fullName, 'instantiate') === false) {\n return factory;\n }\n\n if (factory) {\n var injections = [];\n injections = injections.concat(container.typeInjections.get(type) || []);\n injections = injections.concat(container.injections[fullName] || []);\n\n var hash = buildInjections(container, injections);\n hash.container = container;\n hash._debugContainerKey = fullName;\n\n value = factory.create(hash);\n\n return value;\n }\n }\n\n function eachDestroyable(container, callback) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n callback(value);\n });\n }\n\n function resetCache(container) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n value.destroy();\n });\n container.cache.dict = {};\n }\n\n return Container;\n});\n\n})();\n//@ sourceURL=container");minispade.register('ember-application/ext', "(function() {minispade.require('ember-application/ext/controller');\n\n})();\n//@ sourceURL=ember-application/ext");minispade.register('ember-application/ext/controller', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar ControllersProxy = Ember.Object.extend({\n controller: null,\n\n unknownProperty: function(controllerName) {\n var controller = get(this, 'controller'),\n needs = get(controller, 'needs'),\n container = controller.get('container'),\n dependency;\n\n for (var i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency === controllerName) {\n return container.lookup('controller:' + controllerName);\n }\n }\n }\n});\n\nfunction verifyDependencies(controller) {\n var needs = get(controller, 'needs'),\n container = get(controller, 'container'),\n dependency, satisfied = true;\n\n for (var i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency.indexOf(':') === -1) {\n dependency = \"controller:\" + dependency;\n }\n\n if (!container.has(dependency)) {\n satisfied = false;\n Ember.assert(controller + \" needs \" + dependency + \" but it does not exist\", false);\n }\n }\n\n return satisfied;\n}\n\nEmber.ControllerMixin.reopen({\n concatenatedProperties: ['needs'],\n needs: [],\n\n init: function() {\n this._super.apply(this, arguments);\n\n // Structure asserts to still do verification but not string concat in production\n if(!verifyDependencies(this)) {\n Ember.assert(\"Missing dependencies\", false);\n }\n },\n\n controllerFor: function(controllerName) {\n Ember.deprecate(\"Controller#controllerFor is deprecated, please use Controller#needs instead\");\n var container = get(this, 'container');\n return container.lookup('controller:' + controllerName);\n },\n\n controllers: Ember.computed(function() {\n return ControllersProxy.create({ controller: this });\n })\n});\n\n})();\n//@ sourceURL=ember-application/ext/controller");minispade.register('ember-application', "(function() {minispade.require('ember-views');\nminispade.require('ember-routing');\nminispade.require('ember-application/system');\nminispade.require('ember-application/ext');\n\n/**\nEmber Application\n\n@module ember\n@submodule ember-application\n@requires ember-views, ember-states, ember-routing\n*/\n\n})();\n//@ sourceURL=ember-application");minispade.register('ember-application/system', "(function() {minispade.require('ember-application/system/dag');\nminispade.require('ember-application/system/resolver');\nminispade.require('ember-application/system/application');\n\n})();\n//@ sourceURL=ember-application/system");minispade.register('ember-application/system/application', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get, set = Ember.set,\n classify = Ember.String.classify,\n capitalize = Ember.String.capitalize,\n decamelize = Ember.String.decamelize;\n\n/**\n An instance of `Ember.Application` is the starting point for every Ember\n application. It helps to instantiate, initialize and coordinate the many\n objects that make up your app.\n\n Each Ember app has one and only one `Ember.Application` object. In fact, the\n very first thing you should do in your application is create the instance:\n\n ```javascript\n window.App = Ember.Application.create();\n ```\n\n Typically, the application object is the only global variable. All other\n classes in your app should be properties on the `Ember.Application` instance,\n which highlights its first role: a global namespace.\n\n For example, if you define a view class, it might look like this:\n\n ```javascript\n App.MyView = Ember.View.extend();\n ```\n\n By default, calling `Ember.Application.create()` will automatically initialize\n your application by calling the `Ember.Application.initialize()` method. If\n you need to delay initialization, you can call your app's `deferReadiness()`\n method. When you are ready for your app to be initialized, call its\n `advanceReadiness()` method.\n\n You can define a `ready` method on the `Ember.Application` instance, which\n will be run by Ember when the application is initialized.\n\n Because `Ember.Application` inherits from `Ember.Namespace`, any classes\n you create will have useful string representations when calling `toString()`.\n See the `Ember.Namespace` documentation for more information.\n\n While you can think of your `Ember.Application` as a container that holds the\n other classes in your application, there are several other responsibilities\n going on under-the-hood that you may want to understand.\n\n ### Event Delegation\n\n Ember uses a technique called _event delegation_. This allows the framework\n to set up a global, shared event listener instead of requiring each view to\n do it manually. For example, instead of each view registering its own\n `mousedown` listener on its associated element, Ember sets up a `mousedown`\n listener on the `body`.\n\n If a `mousedown` event occurs, Ember will look at the target of the event and\n start walking up the DOM node tree, finding corresponding views and invoking\n their `mouseDown` method as it goes.\n\n `Ember.Application` has a number of default events that it listens for, as\n well as a mapping from lowercase events to camel-cased view method names. For\n example, the `keypress` event causes the `keyPress` method on the view to be\n called, the `dblclick` event causes `doubleClick` to be called, and so on.\n\n If there is a browser event that Ember does not listen for by default, you\n can specify custom events and their corresponding view method names by\n setting the application's `customEvents` property:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the loadedmetadata media\n // player event\n 'loadedmetadata': \"loadedMetadata\"\n }\n });\n ```\n\n By default, the application sets up these event listeners on the document\n body. However, in cases where you are embedding an Ember application inside\n an existing page, you may want it to set up the listeners on an element\n inside the body.\n\n For example, if only events inside a DOM element with the ID of `ember-app`\n should be delegated, set your application's `rootElement` property:\n\n ```javascript\n window.App = Ember.Application.create({\n rootElement: '#ember-app'\n });\n ```\n\n The `rootElement` can be either a DOM element or a jQuery-compatible selector\n string. Note that *views appended to the DOM outside the root element will\n not receive events.* If you specify a custom root element, make sure you only\n append views inside it!\n\n To learn more about the advantages of event delegation and the Ember view\n layer, and a list of the event listeners that are setup by default, visit the\n [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation).\n\n ### Initializers\n\n Libraries on top of Ember can register additional initializers, like so:\n\n ```javascript\n Ember.Application.initializer({\n name: \"store\",\n\n initialize: function(container, application) {\n container.register('store', 'main', application.Store);\n }\n });\n ```\n\n ### Routing\n\n In addition to creating your application's router, `Ember.Application` is\n also responsible for telling the router when to start routing. Transitions\n between routes can be logged with the LOG_TRANSITIONS flag:\n\n ```javascript\n window.App = Ember.Application.create({\n LOG_TRANSITIONS: true\n });\n ```\n\n By default, the router will begin trying to translate the current URL into\n application state once the browser emits the `DOMContentReady` event. If you\n need to defer routing, you can call the application's `deferReadiness()`\n method. Once routing can begin, call the `advanceReadiness()` method.\n\n If there is any setup required before routing begins, you can implement a\n `ready()` method on your app that will be invoked immediately before routing\n begins.\n\n To begin routing, you must have at a minimum a top-level controller and view.\n You define these as `App.ApplicationController` and `App.ApplicationView`,\n respectively. Your application will not work if you do not define these two\n mandatory classes. For example:\n\n ```javascript\n App.ApplicationView = Ember.View.extend({\n templateName: 'application'\n });\n App.ApplicationController = Ember.Controller.extend();\n ```\n\n @class Application\n @namespace Ember\n @extends Ember.Namespace\n*/\nvar Application = Ember.Application = Ember.Namespace.extend({\n\n /**\n The root DOM element of the Application. This can be specified as an\n element or a\n [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).\n\n This is the element that will be passed to the Application's,\n `eventDispatcher`, which sets up the listeners for event delegation. Every\n view in your application should be a child of the element you specify here.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n The `Ember.EventDispatcher` responsible for delegating events to this\n application's views.\n\n The event dispatcher is created by the application at initialization time\n and sets up event listeners on the DOM element described by the\n application's `rootElement` property.\n\n See the documentation for `Ember.EventDispatcher` for more information.\n\n @property eventDispatcher\n @type Ember.EventDispatcher\n @default null\n */\n eventDispatcher: null,\n\n /**\n The DOM events for which the event dispatcher should listen.\n\n By default, the application's `Ember.EventDispatcher` listens\n for a set of standard DOM events, such as `mousedown` and\n `keyup`, and delegates them to your application's `Ember.View`\n instances.\n\n If you would like additional events to be delegated to your\n views, set your `Ember.Application`'s `customEvents` property\n to a hash containing the DOM event name as the key and the\n corresponding view method name as the value. For example:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the loadedmetadata media\n // player event\n 'loadedmetadata': \"loadedMetadata\"\n }\n });\n ```\n\n @property customEvents\n @type Object\n @default null\n */\n customEvents: null,\n\n isInitialized: false,\n\n // Start off the number of deferrals at 1. This will be\n // decremented by the Application's own `initialize` method.\n _readinessDeferrals: 1,\n\n init: function() {\n if (!this.$) { this.$ = Ember.$; }\n this.__container__ = this.buildContainer();\n\n this.Router = this.Router || this.defaultRouter();\n if (this.Router) { this.Router.namespace = this; }\n\n this._super();\n\n this.scheduleInitialize();\n\n if ( Ember.LOG_VERSION ) {\n Ember.LOG_VERSION = false; // we only need to see this once per Application#init\n Ember.debug('-------------------------------');\n Ember.debug('Ember.VERSION : ' + Ember.VERSION);\n Ember.debug('Handlebars.VERSION : ' + Ember.Handlebars.VERSION);\n Ember.debug('jQuery.VERSION : ' + Ember.$().jquery);\n Ember.debug('-------------------------------');\n }\n },\n\n /**\n @private\n\n Build the container for the current application.\n\n Also register a default application view in case the application\n itself does not.\n\n @method buildContainer\n @return {Ember.Container} the configured container\n */\n buildContainer: function() {\n var container = this.__container__ = Application.buildContainer(this);\n\n return container;\n },\n\n /**\n @private\n\n If the application has not opted out of routing and has not explicitly\n defined a router, supply a default router for the application author\n to configure.\n\n This allows application developers to do:\n\n ```javascript\n App = Ember.Application.create();\n\n App.Router.map(function(match) {\n match(\"/\").to(\"index\");\n });\n ```\n\n @method defaultRouter\n @return {Ember.Router} the default router\n */\n defaultRouter: function() {\n // Create a default App.Router if one was not supplied to make\n // it possible to do App.Router.map(...) without explicitly\n // creating a router first.\n if (this.router === undefined) {\n return Ember.Router.extend();\n }\n },\n\n /**\n @private\n\n Automatically initialize the application once the DOM has\n become ready.\n\n The initialization itself is scheduled on the actions queue\n which ensures that application loading finishes before\n booting.\n\n If you are asynchronously loading code, you should call\n `deferReadiness()` to defer booting, and then call\n `advanceReadiness()` once all of your code has finished\n loading.\n\n @method scheduleInitialize\n */\n scheduleInitialize: function() {\n var self = this;\n this.$().ready(function() {\n if (self.isDestroyed || self.isInitialized) { return; }\n Ember.run.schedule('actions', self, 'initialize');\n });\n },\n\n /**\n Use this to defer readiness until some condition is true.\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n App.deferReadiness();\n\n jQuery.getJSON(\"/auth-token\", function(token) {\n App.token = token;\n App.advanceReadiness();\n });\n ```\n\n This allows you to perform asynchronous setup logic and defer\n booting your application until the setup has finished.\n\n However, if the setup requires a loading UI, it might be better\n to use the router for this purpose.\n\n @method deferReadiness\n */\n deferReadiness: function() {\n Ember.assert(\"You cannot defer readiness since the `ready()` hook has already been called.\", this._readinessDeferrals > 0);\n this._readinessDeferrals++;\n },\n\n /**\n @method advanceReadiness\n @see {Ember.Application#deferReadiness}\n */\n advanceReadiness: function() {\n this._readinessDeferrals--;\n\n if (this._readinessDeferrals === 0) {\n Ember.run.once(this, this.didBecomeReady);\n }\n },\n\n /**\n registers a factory for later injection\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n\n App.Person = Ember.Object.extend({});\n App.Orange = Ember.Object.extend({});\n App.Email = Ember.Object.extend({});\n\n App.register('model:user', App.Person, {singleton: false });\n App.register('fruit:favorite', App.Orange);\n App.register('communication:main', App.Email, {singleton: false});\n ```\n\n @method register\n @param type {String}\n @param name {String}\n @param factory {String}\n @param options {String} (optional)\n **/\n register: function() {\n var container = this.__container__;\n container.register.apply(container, arguments);\n },\n /**\n defines an injection or typeInjection\n\n Example:\n\n ```javascript\n App.inject(<full_name or type>, <property name>, <full_name>)\n App.inject('model:user', 'email', 'model:email')\n App.inject('model', 'source', 'source:main')\n ```\n\n @method inject\n @param factoryNameOrType {String}\n @param property {String}\n @param injectionName {String}\n **/\n inject: function(){\n var container = this.__container__;\n container.injection.apply(container, arguments);\n },\n\n /**\n @private\n\n Initialize the application. This happens automatically.\n\n Run any initializers and run the application load hook. These hooks may\n choose to defer readiness. For example, an authentication hook might want\n to defer readiness until the auth token has been retrieved.\n\n @method initialize\n */\n initialize: function() {\n Ember.assert(\"Application initialize may only be called once\", !this.isInitialized);\n Ember.assert(\"Cannot initialize a destroyed application\", !this.isDestroyed);\n this.isInitialized = true;\n\n // At this point, the App.Router must already be assigned\n this.register('router', 'main', this.Router);\n\n this.runInitializers();\n Ember.runLoadHooks('application', this);\n\n // At this point, any initializers or load hooks that would have wanted\n // to defer readiness have fired. In general, advancing readiness here\n // will proceed to didBecomeReady.\n this.advanceReadiness();\n\n return this;\n },\n\n reset: function() {\n get(this, '__container__').destroy();\n this.buildContainer();\n\n this.isInitialized = false;\n this.initialize();\n this.startRouting();\n },\n\n /**\n @private\n @method runInitializers\n */\n runInitializers: function() {\n var initializers = get(this.constructor, 'initializers'),\n container = this.__container__,\n graph = new Ember.DAG(),\n namespace = this,\n i, initializer;\n\n for (i=0; i<initializers.length; i++) {\n initializer = initializers[i];\n graph.addEdges(initializer.name, initializer.initialize, initializer.before, initializer.after);\n }\n\n graph.topsort(function (vertex) {\n var initializer = vertex.value;\n Ember.assert(\"No application initializer named '\"+vertex.name+\"'\", initializer);\n initializer(container, namespace);\n });\n },\n\n /**\n @private\n @method didBecomeReady\n */\n didBecomeReady: function() {\n this.setupEventDispatcher();\n this.ready(); // user hook\n this.startRouting();\n\n if (!Ember.testing) {\n // Eagerly name all classes that are already loaded\n Ember.Namespace.processAll();\n Ember.BOOTED = true;\n }\n },\n\n /**\n @private\n\n Setup up the event dispatcher to receive events on the\n application's `rootElement` with any registered\n `customEvents`.\n\n @method setupEventDispatcher\n */\n setupEventDispatcher: function() {\n var eventDispatcher = this.createEventDispatcher(),\n customEvents = get(this, 'customEvents');\n\n eventDispatcher.setup(customEvents);\n },\n\n /**\n @private\n\n Create an event dispatcher for the application's `rootElement`.\n\n @method createEventDispatcher\n */\n createEventDispatcher: function() {\n var rootElement = get(this, 'rootElement'),\n eventDispatcher = Ember.EventDispatcher.create({\n rootElement: rootElement\n });\n\n set(this, 'eventDispatcher', eventDispatcher);\n return eventDispatcher;\n },\n\n /**\n @private\n\n If the application has a router, use it to route to the current URL, and\n trigger a new call to `route` whenever the URL changes.\n\n @method startRouting\n @property router {Ember.Router}\n */\n startRouting: function() {\n var router = this.__container__.lookup('router:main');\n if (!router) { return; }\n\n router.startRouting();\n },\n\n handleURL: function(url) {\n var router = this.__container__.lookup('router:main');\n\n router.handleURL(url);\n },\n\n /**\n Called when the Application has become ready.\n The call will be delayed until the DOM has become ready.\n\n @event ready\n */\n ready: Ember.K,\n\n /**\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n @property resolver\n */\n resolver: null,\n\n willDestroy: function() {\n Ember.BOOTED = false;\n\n var eventDispatcher = get(this, 'eventDispatcher');\n if (eventDispatcher) { eventDispatcher.destroy(); }\n\n get(this, '__container__').destroy();\n },\n\n initializer: function(options) {\n this.constructor.initializer(options);\n }\n});\n\nEmber.Application.reopenClass({\n concatenatedProperties: ['initializers'],\n initializers: Ember.A(),\n initializer: function(initializer) {\n var initializers = get(this, 'initializers');\n\n Ember.assert(\"The initializer '\" + initializer.name + \"' has already been registered\", !initializers.findProperty('name', initializers.name));\n Ember.assert(\"An injection cannot be registered with both a before and an after\", !(initializer.before && initializer.after));\n Ember.assert(\"An injection cannot be registered without an injection function\", Ember.canInvoke(initializer, 'initialize'));\n\n initializers.push(initializer);\n },\n\n /**\n @private\n\n This creates a container with the default Ember naming conventions.\n\n It also configures the container:\n\n * registered views are created every time they are looked up (they are\n not singletons)\n * registered templates are not factories; the registered value is\n returned directly.\n * the router receives the application as its `namespace` property\n * all controllers receive the router as their `target` and `controllers`\n properties\n * all controllers receive the application as their `namespace` property\n * the application view receives the application controller as its\n `controller` property\n * the application view receives the application template as its\n `defaultTemplate` property\n\n @method buildContainer\n @static\n @param {Ember.Application} namespace the application to build the\n container for.\n @return {Ember.Container} the built container\n */\n buildContainer: function(namespace) {\n var container = new Ember.Container();\n Ember.Container.defaultContainer = Ember.Container.defaultContainer || container;\n\n container.set = Ember.set;\n container.normalize = normalize;\n container.resolver = resolverFor(namespace);\n container.optionsForType('view', { singleton: false });\n container.optionsForType('template', { instantiate: false });\n container.register('application', 'main', namespace, { instantiate: false });\n\n container.register('controller:basic', Ember.Controller, { instantiate: false });\n container.register('controller:object', Ember.ObjectController, { instantiate: false });\n container.register('controller:array', Ember.ArrayController, { instantiate: false });\n container.register('route:basic', Ember.Route, { instantiate: false });\n\n container.injection('router:main', 'namespace', 'application:main');\n\n container.typeInjection('controller', 'target', 'router:main');\n container.typeInjection('controller', 'namespace', 'application:main');\n\n container.typeInjection('route', 'router', 'router:main');\n\n return container;\n }\n});\n\n/**\n @private\n\n This function defines the default lookup rules for container lookups:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after classifying the name.\n For example, `controller:post` looks up `App.PostController` by default.\n * if the default lookup fails, look for registered classes on the container\n\n This allows the application to register default injections in the container\n that could be overridden by the normal naming convention.\n\n @param {Ember.Namespace} namespace the namespace to look for classes\n @return {any} the resolved value for a given lookup\n*/\nfunction resolverFor(namespace) {\n var resolverClass = namespace.get('resolver') || Ember.DefaultResolver;\n var resolver = resolverClass.create({\n namespace: namespace\n });\n return function(fullName) {\n return resolver.resolve(fullName);\n };\n}\n\nfunction normalize(fullName) {\n var split = fullName.split(':'),\n type = split[0],\n name = split[1];\n\n\n if (type !== 'template') {\n var result = name;\n\n if (result.indexOf('.') > -1) {\n result = result.replace(/\\.(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n if (name.indexOf('_') > -1) {\n result = result.replace(/_(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n return type + ':' + result;\n } else {\n return fullName;\n }\n}\n\nEmber.runLoadHooks('Ember.Application', Ember.Application);\n\n})();\n//@ sourceURL=ember-application/system/application");minispade.register('ember-application/system/dag', "(function() {function visit(vertex, fn, visited, path) {\n var name = vertex.name,\n vertices = vertex.incoming,\n names = vertex.incomingNames,\n len = names.length,\n i;\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n}\n\nfunction DAG() {\n this.names = [];\n this.vertices = {};\n}\n\nDAG.prototype.add = function(name) {\n if (!name) { return; }\n if (this.vertices.hasOwnProperty(name)) {\n return this.vertices[name];\n }\n var vertex = {\n name: name, incoming: {}, incomingNames: [], hasOutgoing: false, value: null\n };\n this.vertices[name] = vertex;\n this.names.push(name);\n return vertex;\n};\n\nDAG.prototype.map = function(name, value) {\n this.add(name).value = value;\n};\n\nDAG.prototype.addEdge = function(fromName, toName) {\n if (!fromName || !toName || fromName === toName) {\n return;\n }\n var from = this.add(fromName), to = this.add(toName);\n if (to.incoming.hasOwnProperty(fromName)) {\n return;\n }\n function checkCycle(vertex, path) {\n if (vertex.name === toName) {\n throw new Error(\"cycle detected: \" + toName + \" <- \" + path.join(\" <- \"));\n }\n }\n visit(from, checkCycle);\n from.hasOutgoing = true;\n to.incoming[fromName] = from;\n to.incomingNames.push(fromName);\n};\n\nDAG.prototype.topsort = function(fn) {\n var visited = {},\n vertices = this.vertices,\n names = this.names,\n len = names.length,\n i, vertex;\n for (i = 0; i < len; i++) {\n vertex = vertices[names[i]];\n if (!vertex.hasOutgoing) {\n visit(vertex, fn, visited);\n }\n }\n};\n\nDAG.prototype.addEdges = function(name, value, before, after) {\n var i;\n this.map(name, value);\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n for (i = 0; i < before.length; i++) {\n this.addEdge(name, before[i]);\n }\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n for (i = 0; i < after.length; i++) {\n this.addEdge(after[i], name);\n }\n }\n }\n};\n\nEmber.DAG = DAG;\n\n})();\n//@ sourceURL=ember-application/system/dag");minispade.register('ember-application/system/resolver', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get,\n classify = Ember.String.classify,\n capitalize = Ember.String.capitalize,\n decamelize = Ember.String.decamelize;\n\n/**\n The DefaultResolver defines the default lookup rules to resolve\n container lookups before consulting the container for registered\n items:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after converting\n the name. For example, `controller:post` looks up\n `App.PostController` by default.\n * there are some nuances (see examples below)\n\n ### How Resolving Works\n\n The container calls this object's `resolve` method with the\n `fullName` argument.\n\n It first parses the fullName into an object using `parseName`.\n\n Then it checks for the presence of a type-specific instance\n method of the form `resolve[Type]` and calls it if it exists.\n For example if it was resolving 'template:post', it would call\n the `resolveTemplate` method.\n\n Its last resort is to call the `resolveOther` method.\n\n The methods of this object are designed to be easy to override\n in a subclass. For example, you could enhance how a template\n is resolved like so:\n\n ```javascript\n App = Ember.Application.create({\n resolver: Ember.DefaultResolver.extend({\n resolveTemplate: function(parsedName) {\n var resolvedTemplate = this._super(parsedName);\n if (resolvedTemplate) { return resolvedTemplate; }\n return Ember.TEMPLATES['not_found'];\n }\n })\n });\n ```\n\n Some examples of how names are resolved:\n\n ```\n 'template:post' //=> Ember.TEMPLATES['post']\n 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:blogPost' //=> Ember.TEMPLATES['blogPost']\n // OR\n // Ember.TEMPLATES['blog_post']\n 'controller:post' //=> App.PostController\n 'controller:posts.index' //=> App.PostsIndexController\n 'controller:blog/post' //=> Blog.PostController\n 'controller:basic' //=> Ember.Controller\n 'route:post' //=> App.PostRoute\n 'route:posts.index' //=> App.PostsIndexRoute\n 'route:blog/post' //=> Blog.PostRoute\n 'route:basic' //=> Ember.Route\n 'view:post' //=> App.PostView\n 'view:posts.index' //=> App.PostsIndexView\n 'view:blog/post' //=> Blog.PostView\n 'view:basic' //=> Ember.View\n 'foo:post' //=> App.PostFoo\n ```\n\n @class DefaultResolver\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.DefaultResolver = Ember.Object.extend({\n /**\n This will be set to the Application instance when it is\n created.\n\n @property namespace\n */\n namespace: null,\n /**\n This method is called via the container's resolver method.\n It parses the provided `fullName` and then looks up and\n returns the appropriate template or class.\n\n @method resolve\n @param {String} fullName the lookup string\n @return {Object} the resolved factory\n */\n resolve: function(fullName) {\n var parsedName = this.parseName(fullName),\n typeSpecificResolveMethod = this[parsedName.resolveMethodName];\n if (typeSpecificResolveMethod) {\n var resolved = typeSpecificResolveMethod.call(this, parsedName);\n if (resolved) { return resolved; }\n }\n return this.resolveOther(parsedName);\n },\n /**\n Convert the string name of the form \"type:name\" to\n a Javascript object with the parsed aspects of the name\n broken out.\n\n @protected\n @method parseName\n */\n parseName: function(fullName) {\n var nameParts = fullName.split(\":\"),\n type = nameParts[0], fullNameWithoutType = nameParts[1],\n name = fullNameWithoutType,\n namespace = get(this, 'namespace'),\n root = namespace;\n\n if (type !== 'template' && name.indexOf('/') !== -1) {\n var parts = name.split('/');\n name = parts[parts.length - 1];\n var namespaceName = capitalize(parts.slice(0, -1).join('.'));\n root = Ember.Namespace.byName(namespaceName);\n\n Ember.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root);\n }\n\n return {\n fullName: fullName,\n type: type,\n fullNameWithoutType: fullNameWithoutType,\n name: name,\n root: root,\n resolveMethodName: \"resolve\" + classify(type)\n };\n },\n /**\n Look up the template in Ember.TEMPLATES\n\n @protected\n @method resolveTemplate\n */\n resolveTemplate: function(parsedName) {\n var templateName = parsedName.fullNameWithoutType.replace(/\\./g, '/');\n\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n\n templateName = decamelize(templateName);\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n },\n /**\n Given a parseName object (output from `parseName`), apply\n the conventions expected by `Ember.Router`\n\n @protected\n @method useRouterNaming\n */\n useRouterNaming: function(parsedName) {\n parsedName.name = parsedName.name.replace(/\\./g, '_');\n if (parsedName.name === 'basic') {\n parsedName.name = '';\n }\n },\n /**\n @protected\n @method resolveController\n */\n resolveController: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n @protected\n @method resolveRoute\n */\n resolveRoute: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n @protected\n @method resolveView\n */\n resolveView: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Look up the specified object (from parsedName) on the appropriate\n namespace (usually on the Application)\n\n @protected\n @method resolveOther\n */\n resolveOther: function(parsedName) {\n var className = classify(parsedName.name) + classify(parsedName.type),\n factory = get(parsedName.root, className);\n if (factory) { return factory; }\n }\n});\n\n})();\n//@ sourceURL=ember-application/system/resolver");minispade.register('ember-debug', "(function() {/*global __fail__*/\n\n/**\nEmber Debug\n\n@module ember\n@submodule ember-debug\n*/\n\n/**\n@class Ember\n*/\n\nif ('undefined' === typeof Ember) {\n Ember = {};\n\n if ('undefined' !== typeof window) {\n window.Em = window.Ember = Em = Ember;\n }\n}\n\nEmber.ENV = 'undefined' === typeof ENV ? {} : ENV;\n\nif (!('MANDATORY_SETTER' in Ember.ENV)) {\n Ember.ENV.MANDATORY_SETTER = true; // default to true for debug dist\n}\n\n/**\n Define an assertion that will throw an exception if the condition is not\n met. Ember build tools will remove any calls to `Ember.assert()` when\n doing a production build. Example:\n\n ```javascript\n // Test for truthiness\n Ember.assert('Must pass a valid object', obj);\n // Fail unconditionally\n Ember.assert('This code path should never be run')\n ```\n\n @method assert\n @param {String} desc A description of the assertion. This will become\n the text of the Error thrown if the assertion fails.\n @param {Boolean} test Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.\n*/\nEmber.assert = function(desc, test) {\n if (!test) throw new Error(\"assertion failed: \"+desc);\n};\n\n\n/**\n Display a warning with the provided message. Ember build tools will\n remove any calls to `Ember.warn()` when doing a production build.\n\n @method warn\n @param {String} message A warning to display.\n @param {Boolean} test An optional boolean. If falsy, the warning\n will be displayed.\n*/\nEmber.warn = function(message, test) {\n if (!test) {\n Ember.Logger.warn(\"WARNING: \"+message);\n if ('trace' in Ember.Logger) Ember.Logger.trace();\n }\n};\n\n/**\n Display a debug notice. Ember build tools will remove any calls to\n `Ember.debug()` when doing a production build.\n\n ```javascript\n Ember.debug(\"I'm a debug notice!\");\n ```\n\n @method debug\n @param {String} message A debug message to display.\n*/\nEmber.debug = function(message) {\n Ember.Logger.debug(\"DEBUG: \"+message);\n};\n\n/**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only). Ember build tools will remove any calls to\n `Ember.deprecate()` when doing a production build.\n\n @method deprecate\n @param {String} message A description of the deprecation.\n @param {Boolean} test An optional boolean. If falsy, the deprecation\n will be displayed.\n*/\nEmber.deprecate = function(message, test) {\n if (Ember && Ember.TESTING_DEPRECATION) { return; }\n\n if (arguments.length === 1) { test = false; }\n if (test) { return; }\n\n if (Ember && Ember.ENV.RAISE_ON_DEPRECATION) { throw new Error(message); }\n\n var error;\n\n // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome\n try { __fail__.fail(); } catch (e) { error = e; }\n\n if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {\n var stack, stackStr = '';\n if (error['arguments']) {\n // Chrome\n stack = error.stack.replace(/^\\s+at\\s+/gm, '').\n replace(/^([^\\(]+?)([\\n$])/gm, '{anonymous}($1)$2').\n replace(/^Object.<anonymous>\\s*\\(([^\\)]+)\\)/gm, '{anonymous}($1)').split('\\n');\n stack.shift();\n } else {\n // Firefox\n stack = error.stack.replace(/(?:\\n@:0)?\\s+$/m, '').\n replace(/^\\(/gm, '{anonymous}(').split('\\n');\n }\n\n stackStr = \"\\n \" + stack.slice(2).join(\"\\n \");\n message = message + stackStr;\n }\n\n Ember.Logger.warn(\"DEPRECATION: \"+message);\n};\n\n\n\n/**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only) when the wrapped method is called.\n\n Ember build tools will not remove calls to `Ember.deprecateFunc()`, though\n no warnings will be shown in production.\n\n @method deprecateFunc\n @param {String} message A description of the deprecation.\n @param {Function} func The function to be deprecated.\n*/\nEmber.deprecateFunc = function(message, func) {\n return function() {\n Ember.deprecate(message);\n return func.apply(this, arguments);\n };\n};\n\n})();\n//@ sourceURL=ember-debug");minispade.register('ember-handlebars-compiler', "(function() {/**\n@module ember\n@submodule ember-handlebars-compiler\n*/\n\n// Eliminate dependency on any Ember to simplify precompilation workflow\nvar objectCreate = Object.create || function(parent) {\n function F() {}\n F.prototype = parent;\n return new F();\n};\n\nvar Handlebars = this.Handlebars || (Ember.imports && Ember.imports.Handlebars);\nif(!Handlebars && typeof require === 'function') {\n Handlebars = require('handlebars');\n}\n\nEmber.assert(\"Ember Handlebars requires Handlebars 1.0.0-rc.3 or greater\", Handlebars && Handlebars.VERSION.match(/^1\\.0\\.[0-9](\\.rc\\.[23456789]+)?/));\n\n/**\n Prepares the Handlebars templating library for use inside Ember's view\n system.\n\n The `Ember.Handlebars` object is the standard Handlebars library, extended to\n use Ember's `get()` method instead of direct property access, which allows\n computed properties to be used inside templates.\n\n To create an `Ember.Handlebars` template, call `Ember.Handlebars.compile()`.\n This will return a function that can be used by `Ember.View` for rendering.\n\n @class Handlebars\n @namespace Ember\n*/\nEmber.Handlebars = objectCreate(Handlebars);\n\n/**\n@class helpers\n@namespace Ember.Handlebars\n*/\nEmber.Handlebars.helpers = objectCreate(Handlebars.helpers);\n\n/**\n Override the the opcode compiler and JavaScript compiler for Handlebars.\n\n @class Compiler\n @namespace Ember.Handlebars\n @private\n @constructor\n*/\nEmber.Handlebars.Compiler = function() {};\n\n// Handlebars.Compiler doesn't exist in runtime-only\nif (Handlebars.Compiler) {\n Ember.Handlebars.Compiler.prototype = objectCreate(Handlebars.Compiler.prototype);\n}\n\nEmber.Handlebars.Compiler.prototype.compiler = Ember.Handlebars.Compiler;\n\n/**\n @class JavaScriptCompiler\n @namespace Ember.Handlebars\n @private\n @constructor\n*/\nEmber.Handlebars.JavaScriptCompiler = function() {};\n\n// Handlebars.JavaScriptCompiler doesn't exist in runtime-only\nif (Handlebars.JavaScriptCompiler) {\n Ember.Handlebars.JavaScriptCompiler.prototype = objectCreate(Handlebars.JavaScriptCompiler.prototype);\n Ember.Handlebars.JavaScriptCompiler.prototype.compiler = Ember.Handlebars.JavaScriptCompiler;\n}\n\n\nEmber.Handlebars.JavaScriptCompiler.prototype.namespace = \"Ember.Handlebars\";\n\n\nEmber.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {\n return \"''\";\n};\n\n/**\n @private\n\n Override the default buffer for Ember Handlebars. By default, Handlebars\n creates an empty String at the beginning of each invocation and appends to\n it. Ember's Handlebars overrides this to append to a single shared buffer.\n\n @method appendToBuffer\n @param string {String}\n*/\nEmber.Handlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {\n return \"data.buffer.push(\"+string+\");\";\n};\n\nvar prefix = \"ember\" + (+new Date()), incr = 1;\n\n/**\n @private\n\n Rewrite simple mustaches from `{{foo}}` to `{{bind \"foo\"}}`. This means that\n all simple mustaches in Ember's Handlebars will also set up an observer to\n keep the DOM up to date when the underlying property changes.\n\n @method mustache\n @for Ember.Handlebars.Compiler\n @param mustache\n*/\nEmber.Handlebars.Compiler.prototype.mustache = function(mustache) {\n if (mustache.isHelper && mustache.id.string === 'control') {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"controlID\", new Handlebars.AST.StringNode(prefix + incr++)]);\n } else if (mustache.params.length || mustache.hash) {\n // no changes required\n } else {\n var id = new Handlebars.AST.IdNode(['_triageMustache']);\n\n // Update the mustache node to include a hash value indicating whether the original node\n // was escaped. This will allow us to properly escape values when the underlying value\n // changes and we need to re-render the value.\n if(!mustache.escaped) {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"unescaped\", new Handlebars.AST.StringNode(\"true\")]);\n }\n mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);\n }\n\n return Handlebars.Compiler.prototype.mustache.call(this, mustache);\n};\n\n/**\n Used for precompilation of Ember Handlebars templates. This will not be used\n during normal app execution.\n\n @method precompile\n @for Ember.Handlebars\n @static\n @param {String} string The template to precompile\n*/\nEmber.Handlebars.precompile = function(string) {\n var ast = Handlebars.parse(string);\n\n var options = {\n knownHelpers: {\n action: true,\n unbound: true,\n bindAttr: true,\n template: true,\n view: true,\n _triageMustache: true\n },\n data: true,\n stringParams: true\n };\n\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n};\n\n// We don't support this for Handlebars runtime-only\nif (Handlebars.compile) {\n /**\n The entry point for Ember Handlebars. This replaces the default\n `Handlebars.compile` and turns on template-local data and String\n parameters.\n\n @method compile\n @for Ember.Handlebars\n @static\n @param {String} string The template to compile\n @return {Function}\n */\n Ember.Handlebars.compile = function(string) {\n var ast = Handlebars.parse(string);\n var options = { data: true, stringParams: true };\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n var templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n\n return Ember.Handlebars.template(templateSpec);\n };\n}\n\n\n})();\n//@ sourceURL=ember-handlebars-compiler");minispade.register('ember-handlebars/controls', "(function() {minispade.require(\"ember-handlebars/controls/checkbox\");\nminispade.require(\"ember-handlebars/controls/text_field\");\nminispade.require(\"ember-handlebars/controls/button\");\nminispade.require(\"ember-handlebars/controls/text_area\");\nminispade.require(\"ember-handlebars/controls/select\");\n\n})();\n//@ sourceURL=ember-handlebars/controls");minispade.register('ember-handlebars/controls/button', "(function() {minispade.require('ember-runtime/mixins/target_action_support');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n @class Button\n @namespace Ember\n @extends Ember.View\n @uses Ember.TargetActionSupport\n @deprecated\n*/\nEmber.Button = Ember.View.extend(Ember.TargetActionSupport, {\n classNames: ['ember-button'],\n classNameBindings: ['isActive'],\n\n tagName: 'button',\n\n propagateEvents: false,\n\n attributeBindings: ['type', 'disabled', 'href', 'tabindex'],\n\n /**\n @private\n\n Overrides `TargetActionSupport`'s `targetObject` computed\n property to use Handlebars-specific path resolution.\n\n @property targetObject\n */\n targetObject: Ember.computed(function() {\n var target = get(this, 'target'),\n root = get(this, 'context'),\n data = get(this, 'templateData');\n\n if (typeof target !== 'string') { return target; }\n\n return Ember.Handlebars.get(root, target, { data: data });\n }).property('target'),\n\n // Defaults to 'button' if tagName is 'input' or 'button'\n type: Ember.computed(function(key) {\n var tagName = this.tagName;\n if (tagName === 'input' || tagName === 'button') { return 'button'; }\n }),\n\n disabled: false,\n\n // Allow 'a' tags to act like buttons\n href: Ember.computed(function() {\n return this.tagName === 'a' ? '#' : null;\n }),\n\n mouseDown: function() {\n if (!get(this, 'disabled')) {\n set(this, 'isActive', true);\n this._mouseDown = true;\n this._mouseEntered = true;\n }\n return get(this, 'propagateEvents');\n },\n\n mouseLeave: function() {\n if (this._mouseDown) {\n set(this, 'isActive', false);\n this._mouseEntered = false;\n }\n },\n\n mouseEnter: function() {\n if (this._mouseDown) {\n set(this, 'isActive', true);\n this._mouseEntered = true;\n }\n },\n\n mouseUp: function(event) {\n if (get(this, 'isActive')) {\n // Actually invoke the button's target and action.\n // This method comes from the Ember.TargetActionSupport mixin.\n this.triggerAction();\n set(this, 'isActive', false);\n }\n\n this._mouseDown = false;\n this._mouseEntered = false;\n return get(this, 'propagateEvents');\n },\n\n keyDown: function(event) {\n // Handle space or enter\n if (event.keyCode === 13 || event.keyCode === 32) {\n this.mouseDown();\n }\n },\n\n keyUp: function(event) {\n // Handle space or enter\n if (event.keyCode === 13 || event.keyCode === 32) {\n this.mouseUp();\n }\n },\n\n // TODO: Handle proper touch behavior. Including should make inactive when\n // finger moves more than 20x outside of the edge of the button (vs mouse\n // which goes inactive as soon as mouse goes out of edges.)\n\n touchStart: function(touch) {\n return this.mouseDown(touch);\n },\n\n touchEnd: function(touch) {\n return this.mouseUp(touch);\n },\n\n init: function() {\n Ember.deprecate(\"Ember.Button is deprecated and will be removed from future releases. Consider using the `{{action}}` helper.\");\n this._super();\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/button");minispade.register('ember-handlebars/controls/checkbox', "(function() {minispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/ext\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set, get = Ember.get;\n\n/**\n The `Ember.Checkbox` view class renders a checkbox\n [input](https://developer.mozilla.org/en/HTML/Element/Input) element. It\n allows for binding an Ember property (`checked`) to the status of the\n checkbox.\n\n Example:\n\n ```handlebars\n {{view Ember.Checkbox checkedBinding=\"receiveEmail\"}}\n ```\n\n You can add a `label` tag yourself in the template where the `Ember.Checkbox`\n is being used.\n\n ```html\n <label>\n {{view Ember.Checkbox classNames=\"applicaton-specific-checkbox\"}}\n Some Title\n </label>\n ```\n\n The `checked` attribute of an `Ember.Checkbox` object should always be set\n through the Ember object or by interacting with its rendered element\n representation via the mouse, keyboard, or touch. Updating the value of the\n checkbox via jQuery will result in the checked value of the object and its\n element losing synchronization.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See `Ember.View`'s layout section for more\n information.\n\n @class Checkbox\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Checkbox = Ember.View.extend({\n classNames: ['ember-checkbox'],\n\n tagName: 'input',\n\n attributeBindings: ['type', 'checked', 'disabled', 'tabindex'],\n\n type: \"checkbox\",\n checked: false,\n disabled: false,\n\n init: function() {\n this._super();\n this.on(\"change\", this, this._updateElementValue);\n },\n\n _updateElementValue: function() {\n set(this, 'checked', this.$().prop('checked'));\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/checkbox");minispade.register('ember-handlebars/controls/select', "(function() {/*jshint eqeqeq:false */\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set,\n get = Ember.get,\n indexOf = Ember.EnumerableUtils.indexOf,\n indexesOf = Ember.EnumerableUtils.indexesOf,\n replace = Ember.EnumerableUtils.replace,\n isArray = Ember.isArray,\n precompileTemplate = Ember.Handlebars.compile;\n\n/**\n The `Ember.Select` view class renders a\n [select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,\n allowing the user to choose from a list of options.\n\n The text and `value` property of each `<option>` element within the\n `<select>` element are populated from the objects in the `Element.Select`'s\n `content` property. The underlying data object of the selected `<option>` is\n stored in the `Element.Select`'s `value` property.\n\n ### `content` as an array of Strings\n\n The simplest version of an `Ember.Select` takes an array of strings as its\n `content` property. The string will be used as both the `value` property and\n the inner text of each `<option>` element inside the rendered `<select>`.\n\n Example:\n\n ```javascript\n App.names = [\"Yehuda\", \"Tom\"];\n ```\n\n ```handlebars\n {{view Ember.Select contentBinding=\"App.names\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n You can control which `<option>` is selected through the `Ember.Select`'s\n `value` property directly or as a binding:\n\n ```javascript\n App.names = Ember.Object.create({\n selected: 'Tom',\n content: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.names.content\"\n valueBinding=\"App.names.selected\"\n }}\n ```\n\n Would result in the following HTML with the `<option>` for 'Tom' selected:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n A user interacting with the rendered `<select>` to choose \"Yehuda\" would\n update the value of `App.names.selected` to \"Yehuda\".\n\n ### `content` as an Array of Objects\n\n An `Ember.Select` can also take an array of JavaScript or Ember objects as\n its `content` property.\n\n When using objects you need to tell the `Ember.Select` which property should\n be accessed on each object to supply the `value` attribute of the `<option>`\n and which property should be used to supply the element text.\n\n The `optionValuePath` option is used to specify the path on each object to\n the desired property for the `value` attribute. The `optionLabelPath`\n specifies the path on each object to the desired property for the\n element's text. Both paths must reference each object itself as `content`:\n\n ```javascript\n App.programmers = [\n Ember.Object.create({firstName: \"Yehuda\", id: 1}),\n Ember.Object.create({firstName: \"Tom\", id: 2})\n ];\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.programmers\"\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value>Please Select</option>\n <option value=\"1\">Yehuda</option>\n <option value=\"2\">Tom</option>\n </select>\n ```\n\n The `value` attribute of the selected `<option>` within an `Ember.Select`\n can be bound to a property on another object by providing a\n `valueBinding` option:\n\n ```javascript\n App.programmers = [\n Ember.Object.create({firstName: \"Yehuda\", id: 1}),\n Ember.Object.create({firstName: \"Tom\", id: 2})\n ];\n\n App.currentProgrammer = Ember.Object.create({\n id: 2\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.programmers\"\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n valueBinding=\"App.currentProgrammer.id\"}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value>Please Select</option>\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `id` value of `App.currentProgrammer`\n to match the `value` property of the newly selected `<option>`.\n\n Alternatively, you can control selection through the underlying objects\n used to render each object providing a `selectionBinding`. When the selected\n `<option>` is changed, the property path provided to `selectionBinding`\n will be updated to match the content object of the rendered `<option>`\n element:\n\n ```javascript\n App.controller = Ember.Object.create({\n selectedPerson: null,\n content: [\n Ember.Object.create({firstName: \"Yehuda\", id: 1}),\n Ember.Object.create({firstName: \"Tom\", id: 2})\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.controller.content\"\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n selectionBinding=\"App.controller.selectedPerson\"}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value>Please Select</option>\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `selectedPerson` value of `App.controller`\n to match the content object of the newly selected `<option>`. In this\n case it is the first object in the `App.content.content`\n\n ### Supplying a Prompt\n\n A `null` value for the `Ember.Select`'s `value` or `selection` property\n results in there being no `<option>` with a `selected` attribute:\n\n ```javascript\n App.controller = Ember.Object.create({\n selected: null,\n content: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ``` handlebars\n {{view Ember.Select\n contentBinding=\"App.controller.content\"\n valueBinding=\"App.controller.selected\"\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n Although `App.controller.selected` is `null` and no `<option>`\n has a `selected` attribute the rendered HTML will display the\n first item as though it were selected. You can supply a string\n value for the `Ember.Select` to display when there is no selection\n with the `prompt` option:\n\n ```javascript\n App.controller = Ember.Object.create({\n selected: null,\n content: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n contentBinding=\"App.controller.content\"\n valueBinding=\"App.controller.selected\"\n prompt=\"Please select a name\"\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option>Please select a name</option>\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n @class Select\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Select = Ember.View.extend(\n /** @scope Ember.Select.prototype */ {\n\n tagName: 'select',\n classNames: ['ember-select'],\n defaultTemplate: precompileTemplate('{{#if view.prompt}}<option value=\"\">{{view.prompt}}</option>{{/if}}{{#each view.content}}{{view Ember.SelectOption contentBinding=\"this\"}}{{/each}}'),\n attributeBindings: ['multiple', 'disabled', 'tabindex'],\n\n /**\n The `multiple` attribute of the select element. Indicates whether multiple\n options can be selected.\n\n @property multiple\n @type Boolean\n @default false\n */\n multiple: false,\n\n disabled: false,\n\n /**\n The list of options.\n\n If `optionLabelPath` and `optionValuePath` are not overridden, this should\n be a list of strings, which will serve simultaneously as labels and values.\n\n Otherwise, this should be a list of objects. For instance:\n\n ```javascript\n Ember.Select.create({\n content: Ember.A([\n { id: 1, firstName: 'Yehuda' },\n { id: 2, firstName: 'Tom' }\n ]),\n optionLabelPath: 'content.firstName',\n optionValuePath: 'content.id'\n });\n ```\n\n @property content\n @type Array\n @default null\n */\n content: null,\n\n /**\n When `multiple` is `false`, the element of `content` that is currently\n selected, if any.\n\n When `multiple` is `true`, an array of such elements.\n\n @property selection\n @type Object or Array\n @default null\n */\n selection: null,\n\n /**\n In single selection mode (when `multiple` is `false`), value can be used to\n get the current selection's value or set the selection by it's value.\n\n It is not currently supported in multiple selection mode.\n\n @property value\n @type String\n @default null\n */\n value: Ember.computed(function(key, value) {\n if (arguments.length === 2) { return value; }\n var valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, '');\n return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection');\n }).property('selection'),\n\n /**\n If given, a top-most dummy option will be rendered to serve as a user\n prompt.\n\n @property prompt\n @type String\n @default null\n */\n prompt: null,\n\n /**\n The path of the option labels. See `content`.\n\n @property optionLabelPath\n @type String\n @default 'content'\n */\n optionLabelPath: 'content',\n\n /**\n The path of the option values. See `content`.\n\n @property optionValuePath\n @type String\n @default 'content'\n */\n optionValuePath: 'content',\n\n _change: function() {\n if (get(this, 'multiple')) {\n this._changeMultiple();\n } else {\n this._changeSingle();\n }\n },\n\n selectionDidChange: Ember.observer(function() {\n var selection = get(this, 'selection');\n if (get(this, 'multiple')) {\n if (!isArray(selection)) {\n set(this, 'selection', Ember.A([selection]));\n return;\n }\n this._selectionDidChangeMultiple();\n } else {\n this._selectionDidChangeSingle();\n }\n }, 'selection.@each'),\n\n valueDidChange: Ember.observer(function() {\n var content = get(this, 'content'),\n value = get(this, 'value'),\n valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, ''),\n selectedValue = (valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection')),\n selection;\n\n if (value !== selectedValue) {\n selection = content.find(function(obj) {\n return value === (valuePath ? get(obj, valuePath) : obj);\n });\n\n this.set('selection', selection);\n }\n }, 'value'),\n\n\n _triggerChange: function() {\n var selection = get(this, 'selection');\n var value = get(this, 'value');\n\n if (selection) { this.selectionDidChange(); }\n if (value) { this.valueDidChange(); }\n\n this._change();\n },\n\n _changeSingle: function() {\n var selectedIndex = this.$()[0].selectedIndex,\n content = get(this, 'content'),\n prompt = get(this, 'prompt');\n\n if (!get(content, 'length')) { return; }\n if (prompt && selectedIndex === 0) { set(this, 'selection', null); return; }\n\n if (prompt) { selectedIndex -= 1; }\n set(this, 'selection', content.objectAt(selectedIndex));\n },\n\n\n _changeMultiple: function() {\n var options = this.$('option:selected'),\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n content = get(this, 'content'),\n selection = get(this, 'selection');\n\n if (!content){ return; }\n if (options) {\n var selectedIndexes = options.map(function(){\n return this.index - offset;\n }).toArray();\n var newSelection = content.objectsAt(selectedIndexes);\n\n if (isArray(selection)) {\n replace(selection, 0, get(selection, 'length'), newSelection);\n } else {\n set(this, 'selection', newSelection);\n }\n }\n },\n\n _selectionDidChangeSingle: function() {\n var el = this.get('element');\n if (!el) { return; }\n\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectionIndex = content ? indexOf(content, selection) : -1,\n prompt = get(this, 'prompt');\n\n if (prompt) { selectionIndex += 1; }\n if (el) { el.selectedIndex = selectionIndex; }\n },\n\n _selectionDidChangeMultiple: function() {\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectedIndexes = content ? indexesOf(content, selection) : [-1],\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n options = this.$('option'),\n adjusted;\n\n if (options) {\n options.each(function() {\n adjusted = this.index > -1 ? this.index - offset : -1;\n this.selected = indexOf(selectedIndexes, adjusted) > -1;\n });\n }\n },\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._triggerChange);\n this.on(\"change\", this, this._change);\n }\n});\n\nEmber.SelectOption = Ember.View.extend({\n tagName: 'option',\n attributeBindings: ['value', 'selected'],\n\n defaultTemplate: function(context, options) {\n options = { data: options.data, hash: {} };\n Ember.Handlebars.helpers.bind.call(context, \"view.label\", options);\n },\n\n init: function() {\n this.labelPathDidChange();\n this.valuePathDidChange();\n\n this._super();\n },\n\n selected: Ember.computed(function() {\n var content = get(this, 'content'),\n selection = get(this, 'parentView.selection');\n if (get(this, 'parentView.multiple')) {\n return selection && indexOf(selection, content.valueOf()) > -1;\n } else {\n // Primitives get passed through bindings as objects... since\n // `new Number(4) !== 4`, we use `==` below\n return content == selection;\n }\n }).property('content', 'parentView.selection').volatile(),\n\n labelPathDidChange: Ember.observer(function() {\n var labelPath = get(this, 'parentView.optionLabelPath');\n\n if (!labelPath) { return; }\n\n Ember.defineProperty(this, 'label', Ember.computed(function() {\n return get(this, labelPath);\n }).property(labelPath));\n }, 'parentView.optionLabelPath'),\n\n valuePathDidChange: Ember.observer(function() {\n var valuePath = get(this, 'parentView.optionValuePath');\n\n if (!valuePath) { return; }\n\n Ember.defineProperty(this, 'value', Ember.computed(function() {\n return get(this, valuePath);\n }).property(valuePath));\n }, 'parentView.optionValuePath')\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/select");minispade.register('ember-handlebars/controls/text_area', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/controls/text_support\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.TextArea` view class renders a\n [textarea](https://developer.mozilla.org/en/HTML/Element/textarea) element.\n It allows for binding Ember properties to the text area contents (`value`),\n live-updating as the user inputs text.\n\n ## Layout and LayoutName properties\n\n Because HTML `textarea` elements do not contain inner HTML the `layout` and\n `layoutName` properties will not be applied. See `Ember.View`'s layout\n section for more information.\n\n ## HTML Attributes\n\n By default `Ember.TextArea` provides support for `rows`, `cols`,\n `placeholder`, `disabled`, `maxlength` and `tabindex` attributes on a\n textarea. If you need to support more attributes have a look at the\n `attributeBindings` property in `Ember.View`'s HTML Attributes section.\n\n To globally add support for additional attributes you can reopen\n `Ember.TextArea` or `Ember.TextSupport`.\n\n ```javascript\n Ember.TextSupport.reopen({\n attributeBindings: [\"required\"]\n })\n ```\n\n @class TextArea\n @namespace Ember\n @extends Ember.View\n @uses Ember.TextSupport\n*/\nEmber.TextArea = Ember.View.extend(Ember.TextSupport, {\n classNames: ['ember-text-area'],\n\n tagName: \"textarea\",\n attributeBindings: ['rows', 'cols'],\n rows: null,\n cols: null,\n\n _updateElementValue: Ember.observer(function() {\n // We do this check so cursor position doesn't get affected in IE\n var value = get(this, 'value'),\n $el = this.$();\n if ($el && value !== $el.val()) {\n $el.val(value);\n }\n }, 'value'),\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._updateElementValue);\n }\n\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_area");minispade.register('ember-handlebars/controls/text_field', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/controls/text_support\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.TextField` view class renders a text\n [input](https://developer.mozilla.org/en/HTML/Element/Input) element. It\n allows for binding Ember properties to the text field contents (`value`),\n live-updating as the user inputs text.\n\n Example:\n\n ```handlebars\n {{view Ember.TextField valueBinding=\"firstName\"}}\n ```\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See `Ember.View`'s layout section for more\n information.\n\n ## HTML Attributes\n\n By default `Ember.TextField` provides support for `type`, `value`, `size`,\n `pattern`, `placeholder`, `disabled`, `maxlength` and `tabindex` attributes\n on a test field. If you need to support more attributes have a look at the\n `attributeBindings` property in `Ember.View`'s HTML Attributes section.\n\n To globally add support for additional attributes you can reopen\n `Ember.TextField` or `Ember.TextSupport`.\n\n ```javascript\n Ember.TextSupport.reopen({\n attributeBindings: [\"required\"]\n })\n ```\n\n @class TextField\n @namespace Ember\n @extends Ember.View\n @uses Ember.TextSupport\n*/\nEmber.TextField = Ember.View.extend(Ember.TextSupport,\n /** @scope Ember.TextField.prototype */ {\n\n classNames: ['ember-text-field'],\n tagName: \"input\",\n attributeBindings: ['type', 'value', 'size', 'pattern'],\n\n /**\n The `value` attribute of the input element. As the user inputs text, this\n property is updated live.\n\n @property value\n @type String\n @default \"\"\n */\n value: \"\",\n\n /**\n The `type` attribute of the input element.\n\n @property type\n @type String\n @default \"text\"\n */\n type: \"text\",\n\n /**\n The `size` of the text field in characters.\n\n @property size\n @type String\n @default null\n */\n size: null,\n\n /**\n The `pattern` the pattern attribute of input element.\n\n @property pattern\n @type String\n @default null\n */\n pattern: null,\n\n /**\n The action to be sent when the user presses the return key.\n\n This is similar to the `{{action}}` helper, but is fired when\n the user presses the return key when editing a text field, and sends\n the value of the field as the context.\n\n @property action\n @type String\n @default null\n */\n action: null,\n\n /**\n Whether they `keyUp` event that triggers an `action` to be sent continues\n propagating to other views.\n\n By default, when the user presses the return key on their keyboard and\n the text field has an `action` set, the action will be sent to the view's\n controller and the key event will stop propagating.\n\n If you would like parent views to receive the `keyUp` event even after an\n action has been dispatched, set `bubbles` to true.\n\n @property bubbles\n @type Boolean\n @default false\n */\n bubbles: false,\n\n insertNewline: function(event) {\n var controller = get(this, 'controller'),\n action = get(this, 'action');\n\n if (action) {\n controller.send(action, get(this, 'value'), this);\n\n if (!get(this, 'bubbles')) {\n event.stopPropagation();\n }\n }\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_field");minispade.register('ember-handlebars/controls/text_support', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Shared mixin used by `Ember.TextField` and `Ember.TextArea`.\n\n @class TextSupport\n @namespace Ember\n @extends Ember.Mixin\n @private\n*/\nEmber.TextSupport = Ember.Mixin.create({\n value: \"\",\n\n attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex'],\n placeholder: null,\n disabled: false,\n maxlength: null,\n\n insertNewline: Ember.K,\n cancel: Ember.K,\n\n init: function() {\n this._super();\n this.on(\"focusOut\", this, this._elementValueDidChange);\n this.on(\"change\", this, this._elementValueDidChange);\n this.on(\"paste\", this, this._elementValueDidChange);\n this.on(\"cut\", this, this._elementValueDidChange);\n this.on(\"input\", this, this._elementValueDidChange);\n this.on(\"keyUp\", this, this.interpretKeyEvents);\n },\n\n interpretKeyEvents: function(event) {\n var map = Ember.TextSupport.KEY_EVENTS;\n var method = map[event.keyCode];\n\n this._elementValueDidChange();\n if (method) { return this[method](event); }\n },\n\n _elementValueDidChange: function() {\n set(this, 'value', this.$().val());\n }\n\n});\n\nEmber.TextSupport.KEY_EVENTS = {\n 13: 'insertNewline',\n 27: 'cancel'\n};\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_support");minispade.register('ember-handlebars/ext', "(function() {minispade.require('ember-handlebars-compiler');\n\nvar slice = Array.prototype.slice;\n\n/**\n @private\n\n If a path starts with a reserved keyword, returns the root\n that should be used.\n\n @method normalizePath\n @for Ember\n @param root {Object}\n @param path {String}\n @param data {Hash}\n*/\nvar normalizePath = Ember.Handlebars.normalizePath = function(root, path, data) {\n var keywords = (data && data.keywords) || {},\n keyword, isKeyword;\n\n // Get the first segment of the path. For example, if the\n // path is \"foo.bar.baz\", returns \"foo\".\n keyword = path.split('.', 1)[0];\n\n // Test to see if the first path is a keyword that has been\n // passed along in the view's data hash. If so, we will treat\n // that object as the new root.\n if (keywords.hasOwnProperty(keyword)) {\n // Look up the value in the template's data hash.\n root = keywords[keyword];\n isKeyword = true;\n\n // Handle cases where the entire path is the reserved\n // word. In that case, return the object itself.\n if (path === keyword) {\n path = '';\n } else {\n // Strip the keyword from the path and look up\n // the remainder from the newly found root.\n path = path.substr(keyword.length+1);\n }\n }\n\n return { root: root, path: path, isKeyword: isKeyword };\n};\n\n\n/**\n Lookup both on root and on window. If the path starts with\n a keyword, the corresponding object will be looked up in the\n template's data hash and used to resolve the path.\n\n @method get\n @for Ember.Handlebars\n @param {Object} root The object to look up the property on\n @param {String} path The path to be lookedup\n @param {Object} options The template's option hash\n*/\nvar handlebarsGet = Ember.Handlebars.get = function(root, path, options) {\n var data = options && options.data,\n normalizedPath = normalizePath(root, path, data),\n value;\n\n // In cases where the path begins with a keyword, change the\n // root to the value represented by that keyword, and ensure\n // the path is relative to it.\n root = normalizedPath.root;\n path = normalizedPath.path;\n\n value = Ember.get(root, path);\n\n // If the path starts with a capital letter, look it up on Ember.lookup,\n // which defaults to the `window` object in browsers.\n if (value === undefined && root !== Ember.lookup && Ember.isGlobalPath(path)) {\n value = Ember.get(Ember.lookup, path);\n }\n return value;\n};\nEmber.Handlebars.getPath = Ember.deprecateFunc('`Ember.Handlebars.getPath` has been changed to `Ember.Handlebars.get` for consistency.', Ember.Handlebars.get);\n\nEmber.Handlebars.resolveParams = function(context, params, options) {\n var resolvedParams = [], types = options.types, param, type;\n\n for (var i=0, l=params.length; i<l; i++) {\n param = params[i];\n type = types[i];\n\n if (type === 'ID') {\n resolvedParams.push(handlebarsGet(context, param, options));\n } else {\n resolvedParams.push(param);\n }\n }\n\n return resolvedParams;\n};\n\nEmber.Handlebars.resolveHash = function(context, hash, options) {\n var resolvedHash = {}, types = options.hashTypes, type;\n\n for (var key in hash) {\n if (!hash.hasOwnProperty(key)) { continue; }\n\n type = types[key];\n\n if (type === 'ID') {\n resolvedHash[key] = handlebarsGet(context, hash[key], options);\n } else {\n resolvedHash[key] = hash[key];\n }\n }\n\n return resolvedHash;\n};\n\n/**\n @private\n\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('helperMissing', function(path, options) {\n var error, view = \"\";\n\n error = \"%@ Handlebars error: Could not find property '%@' on object %@.\";\n if (options.data){\n view = options.data.view;\n }\n throw new Ember.Error(Ember.String.fmt(error, [view, path, this]));\n});\n\n/**\n Register a bound handlebars helper. Bound helpers behave similarly to regular\n handlebars helpers, with the added ability to re-render when the underlying data\n changes.\n\n ## Simple example\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalize', function(value) {\n return value.toUpperCase();\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n ## Example with options\n\n Like normal handlebars helpers, bound helpers have access to the options\n passed into the helper call.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('repeat', function(value, options) {\n var count = options.hash.count;\n var a = [];\n while(a.length < count){\n a.push(value);\n }\n return a.join('');\n });\n ```\n\n This helper could be used in a template as follows:\n\n ```handlebars\n {{repeat text count=3}}\n ```\n\n ## Example with bound options\n\n Bound hash options are also supported. Example:\n\n ```handlebars\n {{repeat text countBinding=\"numRepeats\"}}\n ```\n\n In this example, count will be bound to the value of\n the `numRepeats` property on the context. If that property\n changes, the helper will be re-rendered.\n\n ## Example with extra dependencies\n\n The `Ember.Handlebars.registerBoundHelper` method takes a variable length\n third parameter which indicates extra dependencies on the passed in value.\n This allows the handlebars helper to update when these dependencies change.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalizeName', function(value) {\n return value.get('name').toUpperCase();\n }, 'name');\n ```\n\n ## Example with multiple bound properties\n\n `Ember.Handlebars.registerBoundHelper` supports binding to\n multiple properties, e.g.:\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('concatenate', function() {\n var values = arguments[arguments.length - 1];\n return values.join('||');\n });\n ```\n\n Which allows for template syntax such as {{concatenate prop1 prop2}} or\n {{concatenate prop1 prop2 prop3}}. If any of the properties change,\n the helpr will re-render. Note that dependency keys cannot be\n using in conjunction with multi-property helpers, since it is ambiguous\n which property the dependent keys would belong to.\n\n ## Use with unbound helper\n\n The {{unbound}} helper can be used with bound helper invocations\n to render them in their unbound form, e.g.\n\n ```handlebars\n {{unbound capitalize name}}\n ```\n\n In this example, if the name property changes, the helper\n will not re-render.\n\n\n @method registerBoundHelper\n @for Ember.Handlebars\n @param {String} name\n @param {Function} function\n @param {String} dependentKeys*\n*/\nEmber.Handlebars.registerBoundHelper = function(name, fn) {\n var dependentKeys = slice.call(arguments, 2);\n\n function helper() {\n var properties = slice.call(arguments, 0, -1),\n numProperties = properties.length,\n options = arguments[arguments.length - 1],\n normalizedProperties = [],\n data = options.data,\n hash = options.hash,\n view = data.view,\n currentContext = (options.contexts && options.contexts[0]) || this,\n normalized,\n pathRoot, path,\n loc, hashOption;\n\n // Detect bound options (e.g. countBinding=\"otherCount\")\n hash.boundOptions = {};\n for (hashOption in hash) {\n if (!hash.hasOwnProperty(hashOption)) { continue; }\n\n if (Ember.IS_BINDING.test(hashOption) && typeof hash[hashOption] === 'string') {\n // Lop off 'Binding' suffix.\n hash.boundOptions[hashOption.slice(0, -7)] = hash[hashOption];\n }\n }\n\n // Expose property names on data.properties object.\n data.properties = [];\n for (loc = 0; loc < numProperties; ++loc) {\n data.properties.push(properties[loc]);\n normalizedProperties.push(normalizePath(currentContext, properties[loc], data));\n }\n\n if (data.isUnbound) {\n return evaluateUnboundHelper(this, fn, normalizedProperties, options);\n }\n\n if (dependentKeys.length === 0) {\n return evaluateMultiPropertyBoundHelper(currentContext, fn, normalizedProperties, options);\n }\n\n Ember.assert(\"Dependent keys can only be used with single-property helpers.\", properties.length === 1);\n\n normalized = normalizedProperties[0];\n\n pathRoot = normalized.root;\n path = normalized.path;\n\n var bindView = new Ember._SimpleHandlebarsView(\n path, pathRoot, !options.hash.unescaped, options.data\n );\n\n bindView.normalizedValue = function() {\n var value = Ember._SimpleHandlebarsView.prototype.normalizedValue.call(bindView);\n return fn.call(view, value, options);\n };\n\n view.appendChild(bindView);\n\n view.registerObserver(pathRoot, path, bindView, rerenderBoundHelperView);\n\n for (var i=0, l=dependentKeys.length; i<l; i++) {\n view.registerObserver(pathRoot, path + '.' + dependentKeys[i], bindView, rerenderBoundHelperView);\n }\n }\n\n helper._rawFunction = fn;\n Ember.Handlebars.registerHelper(name, helper);\n};\n\n/**\n @private\n\n Renders the unbound form of an otherwise bound helper function.\n\n @param {Function} fn\n @param {Object} context\n @param {Array} normalizedProperties\n @param {String} options\n*/\nfunction evaluateMultiPropertyBoundHelper(context, fn, normalizedProperties, options) {\n var numProperties = normalizedProperties.length,\n data = options.data,\n view = data.view,\n hash = options.hash,\n boundOptions = hash.boundOptions,\n watchedProperties,\n boundOption, bindView, loc, property, len;\n\n bindView = new Ember._SimpleHandlebarsView(null, null, !hash.unescaped, data);\n bindView.normalizedValue = function() {\n var args = [], value, boundOption;\n\n // Copy over bound options.\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n property = normalizePath(context, boundOptions[boundOption], data);\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n hash[boundOption] = Ember._SimpleHandlebarsView.prototype.normalizedValue.call(bindView);\n }\n\n for (loc = 0; loc < numProperties; ++loc) {\n property = normalizedProperties[loc];\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n args.push(Ember._SimpleHandlebarsView.prototype.normalizedValue.call(bindView));\n }\n args.push(options);\n return fn.apply(context, args);\n };\n\n view.appendChild(bindView);\n\n // Assemble liast of watched properties that'll re-render this helper.\n watchedProperties = [];\n for (boundOption in boundOptions) {\n if (boundOptions.hasOwnProperty(boundOption)) {\n watchedProperties.push(normalizePath(context, boundOptions[boundOption], data));\n }\n }\n watchedProperties = watchedProperties.concat(normalizedProperties);\n\n // Observe each property.\n for (loc = 0, len = watchedProperties.length; loc < len; ++loc) {\n property = watchedProperties[loc];\n view.registerObserver(property.root, property.path, bindView, rerenderBoundHelperView);\n }\n\n}\n\n/**\n @private\n\n An observer function used with bound helpers which\n will schedule a re-render of the _SimpleHandlebarsView\n connected with the helper.\n*/\nfunction rerenderBoundHelperView() {\n Ember.run.scheduleOnce('render', this, 'rerender');\n}\n\n/**\n @private\n\n Renders the unbound form of an otherwise bound helper function.\n\n @param {Function} fn\n @param {Object} context\n @param {Array} normalizedProperties\n @param {String} options\n*/\nfunction evaluateUnboundHelper(context, fn, normalizedProperties, options) {\n var args = [], hash = options.hash, boundOptions = hash.boundOptions, loc, len, property, boundOption;\n\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n hash[boundOption] = Ember.Handlebars.get(context, boundOptions[boundOption], options);\n }\n\n for(loc = 0, len = normalizedProperties.length; loc < len; ++loc) {\n property = normalizedProperties[loc];\n args.push(Ember.Handlebars.get(context, property.path, options));\n }\n args.push(options);\n return fn.apply(context, args);\n}\n\n/**\n @private\n\n Overrides Handlebars.template so that we can distinguish\n user-created, top-level templates from inner contexts.\n\n @method template\n @for Ember.Handlebars\n @param {String} template spec\n*/\nEmber.Handlebars.template = function(spec){\n var t = Handlebars.template(spec);\n t.isTop = true;\n return t;\n};\n\n\n})();\n//@ sourceURL=ember-handlebars/ext");minispade.register('ember-handlebars/helpers', "(function() {minispade.require(\"ember-handlebars/helpers/shared\");\nminispade.require(\"ember-handlebars/helpers/binding\");\nminispade.require(\"ember-handlebars/helpers/collection\");\nminispade.require(\"ember-handlebars/helpers/view\");\nminispade.require(\"ember-handlebars/helpers/unbound\");\nminispade.require(\"ember-handlebars/helpers/debug\");\nminispade.require(\"ember-handlebars/helpers/each\");\nminispade.require(\"ember-handlebars/helpers/template\");\nminispade.require(\"ember-handlebars/helpers/partial\");\nminispade.require(\"ember-handlebars/helpers/yield\");\n\n})();\n//@ sourceURL=ember-handlebars/helpers");minispade.register('ember-handlebars/helpers/binding', "(function() {minispade.require('ember-handlebars/ext');\nminispade.require('ember-handlebars/views/handlebars_bound_view');\nminispade.require('ember-handlebars/views/metamorph_view');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\nvar handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\nvar forEach = Ember.ArrayPolyfills.forEach;\n\nvar EmberHandlebars = Ember.Handlebars, helpers = EmberHandlebars.helpers;\n\n// Binds a property into the DOM. This will create a hook in DOM that the\n// KVO system will look for and update if the property changes.\nfunction bind(property, options, preserveContext, shouldDisplay, valueNormalizer, childProperties) {\n var data = options.data,\n fn = options.fn,\n inverse = options.inverse,\n view = data.view,\n currentContext = this,\n normalized, observer, i;\n\n normalized = normalizePath(currentContext, property, data);\n\n // Set up observers for observable objects\n if ('object' === typeof this) {\n if (data.insideGroup) {\n observer = function() {\n Ember.run.once(view, 'rerender');\n };\n\n var template, context, result = handlebarsGet(currentContext, property, options);\n\n result = valueNormalizer(result);\n\n context = preserveContext ? currentContext : result;\n if (shouldDisplay(result)) {\n template = fn;\n } else if (inverse) {\n template = inverse;\n }\n\n template(context, { data: options.data });\n } else {\n // Create the view that will wrap the output of this template/property\n // and add it to the nearest view's childViews array.\n // See the documentation of Ember._HandlebarsBoundView for more.\n var bindView = view.createChildView(Ember._HandlebarsBoundView, {\n preserveContext: preserveContext,\n shouldDisplayFunc: shouldDisplay,\n valueNormalizerFunc: valueNormalizer,\n displayTemplate: fn,\n inverseTemplate: inverse,\n path: property,\n pathRoot: currentContext,\n previousContext: currentContext,\n isEscaped: !options.hash.unescaped,\n templateData: options.data\n });\n\n view.appendChild(bindView);\n\n observer = function() {\n Ember.run.scheduleOnce('render', bindView, 'rerenderIfNeeded');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n if (childProperties) {\n for (i=0; i<childProperties.length; i++) {\n view.registerObserver(normalized.root, normalized.path+'.'+childProperties[i], observer);\n }\n }\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n data.buffer.push(handlebarsGet(currentContext, property, options));\n }\n}\n\nfunction simpleBind(property, options) {\n var data = options.data,\n view = data.view,\n currentContext = this,\n normalized, observer;\n\n normalized = normalizePath(currentContext, property, data);\n\n // Set up observers for observable objects\n if ('object' === typeof this) {\n if (data.insideGroup) {\n observer = function() {\n Ember.run.once(view, 'rerender');\n };\n\n var result = handlebarsGet(currentContext, property, options);\n if (result === null || result === undefined) { result = \"\"; }\n data.buffer.push(result);\n } else {\n var bindView = new Ember._SimpleHandlebarsView(\n property, currentContext, !options.hash.unescaped, options.data\n );\n\n bindView._parentView = view;\n view.appendChild(bindView);\n\n observer = function() {\n Ember.run.scheduleOnce('render', bindView, 'rerender');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n data.buffer.push(handlebarsGet(currentContext, property, options));\n }\n}\n\n/**\n @private\n\n '_triageMustache' is used internally select between a binding and helper for\n the given context. Until this point, it would be hard to determine if the\n mustache is a property reference or a regular helper reference. This triage\n helper resolves that.\n\n This would not be typically invoked by directly.\n\n @method _triageMustache\n @for Ember.Handlebars.helpers\n @param {String} property Property/helperID to triage\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('_triageMustache', function(property, fn) {\n Ember.assert(\"You cannot pass more than one argument to the _triageMustache helper\", arguments.length <= 2);\n if (helpers[property]) {\n return helpers[property].call(this, fn);\n }\n else {\n return helpers.bind.apply(this, arguments);\n }\n});\n\n/**\n @private\n\n `bind` can be used to display a value, then update that value if it\n changes. For example, if you wanted to print the `title` property of\n `content`:\n\n ```handlebars\n {{bind \"content.title\"}}\n ```\n\n This will return the `title` property as a string, then create a new observer\n at the specified path. If it changes, it will update the value in DOM. Note\n that if you need to support IE7 and IE8 you must modify the model objects\n properties using `Ember.get()` and `Ember.set()` for this to work as it\n relies on Ember's KVO system. For all other browsers this will be handled for\n you automatically.\n\n @method bind\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bind', function(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the bind helper\", arguments.length <= 2);\n\n var context = (options.contexts && options.contexts[0]) || this;\n\n if (!options.fn) {\n return simpleBind.call(context, property, options);\n }\n\n return bind.call(context, property, options, false, function(result) {\n return !Ember.isNone(result);\n });\n});\n\n/**\n @private\n\n Use the `boundIf` helper to create a conditional that re-evaluates\n whenever the truthiness of the bound value changes.\n\n ```handlebars\n {{#boundIf \"content.shouldDisplayTitle\"}}\n {{content.title}}\n {{/boundIf}}\n ```\n\n @method boundIf\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('boundIf', function(property, fn) {\n var context = (fn.contexts && fn.contexts[0]) || this;\n var func = function(result) {\n var truthy = result && get(result, 'isTruthy');\n if (typeof truthy === 'boolean') { return truthy; }\n\n if (Ember.isArray(result)) {\n return get(result, 'length') !== 0;\n } else {\n return !!result;\n }\n };\n\n return bind.call(context, property, fn, true, func, func, ['isTruthy', 'length']);\n});\n\n/**\n @method with\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('with', function(context, options) {\n if (arguments.length === 4) {\n var keywordName, path, rootPath, normalized;\n\n Ember.assert(\"If you pass more than one argument to the with helper, it must be in the form #with foo as bar\", arguments[1] === \"as\");\n options = arguments[3];\n keywordName = arguments[2];\n path = arguments[0];\n\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n if (Ember.isGlobalPath(path)) {\n Ember.bind(options.data.keywords, keywordName, path);\n } else {\n normalized = normalizePath(this, path, options.data);\n path = normalized.path;\n rootPath = normalized.root;\n\n // This is a workaround for the fact that you cannot bind separate objects\n // together. When we implement that functionality, we should use it here.\n var contextKey = Ember.$.expando + Ember.guidFor(rootPath);\n options.data.keywords[contextKey] = rootPath;\n\n // if the path is '' (\"this\"), just bind directly to the current context\n var contextPath = path ? contextKey + '.' + path : contextKey;\n Ember.bind(options.data.keywords, keywordName, contextPath);\n }\n\n return bind.call(this, path, options, true, function(result) {\n return !Ember.isNone(result);\n });\n } else {\n Ember.assert(\"You must pass exactly one argument to the with helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n return helpers.bind.call(options.contexts[0], context, options);\n }\n});\n\n\n/**\n See `boundIf`\n\n @method if\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('if', function(context, options) {\n Ember.assert(\"You must pass exactly one argument to the if helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the if helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n return helpers.boundIf.call(options.contexts[0], context, options);\n});\n\n/**\n @method unless\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('unless', function(context, options) {\n Ember.assert(\"You must pass exactly one argument to the unless helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the unless helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n var fn = options.fn, inverse = options.inverse;\n\n options.fn = inverse;\n options.inverse = fn;\n\n return helpers.boundIf.call(options.contexts[0], context, options);\n});\n\n/**\n `bindAttr` allows you to create a binding between DOM element attributes and\n Ember objects. For example:\n\n ```handlebars\n <img {{bindAttr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n The above handlebars template will fill the `<img>`'s `src` attribute will\n the value of the property referenced with `\"imageUrl\"` and its `alt`\n attribute with the value of the property referenced with `\"imageTitle\"`.\n\n If the rendering context of this template is the following object:\n\n ```javascript\n {\n imageUrl: 'http://lolcats.info/haz-a-funny',\n imageTitle: 'A humorous image of a cat'\n }\n ```\n\n The resulting HTML output will be:\n\n ```html\n <img src=\"http://lolcats.info/haz-a-funny\" alt=\"A humorous image of a cat\">\n ```\n\n `bindAttr` cannot redeclare existing DOM element attributes. The use of `src`\n in the following `bindAttr` example will be ignored and the hard coded value\n of `src=\"/failwhale.gif\"` will take precedence:\n\n ```handlebars\n <img src=\"/failwhale.gif\" {{bindAttr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n ### `bindAttr` and the `class` attribute\n\n `bindAttr` supports a special syntax for handling a number of cases unique\n to the `class` DOM element attribute. The `class` attribute combines\n multiple discreet values into a single attribute as a space-delimited\n list of strings. Each string can be:\n\n * a string return value of an object's property.\n * a boolean return value of an object's property\n * a hard-coded value\n\n A string return value works identically to other uses of `bindAttr`. The\n return value of the property will become the value of the attribute. For\n example, the following view and template:\n\n ```javascript\n AView = Ember.View.extend({\n someProperty: function(){\n return \"aValue\";\n }.property()\n })\n ```\n\n ```handlebars\n <img {{bindAttr class=\"view.someProperty}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"aValue\">\n ```\n\n A boolean return value will insert a specified class name if the property\n returns `true` and remove the class name if the property returns `false`.\n\n A class name is provided via the syntax\n `somePropertyName:class-name-if-true`.\n\n ```javascript\n AView = Ember.View.extend({\n someBool: true\n })\n ```\n\n ```handlebars\n <img {{bindAttr class=\"view.someBool:class-name-if-true\"}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"class-name-if-true\">\n ```\n\n An additional section of the binding can be provided if you want to\n replace the existing class instead of removing it when the boolean\n value changes:\n\n ```handlebars\n <img {{bindAttr class=\"view.someBool:class-name-if-true:class-name-if-false\"}}>\n ```\n\n A hard-coded value can be used by prepending `:` to the desired\n class name: `:class-name-to-always-apply`.\n\n ```handlebars\n <img {{bindAttr class=\":class-name-to-always-apply\"}}>\n ```\n\n Results in the following rendered output:\n\n ```html\n <img class=\":class-name-to-always-apply\">\n ```\n\n All three strategies - string return value, boolean return value, and\n hard-coded value – can be combined in a single declaration:\n\n ```handlebars\n <img {{bindAttr class=\":class-name-to-always-apply view.someBool:class-name-if-true view.someProperty\"}}>\n ```\n\n @method bindAttr\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bindAttr', function(options) {\n\n var attrs = options.hash;\n\n Ember.assert(\"You must specify at least one hash argument to bindAttr\", !!Ember.keys(attrs).length);\n\n var view = options.data.view;\n var ret = [];\n var ctx = this;\n\n // Generate a unique id for this element. This will be added as a\n // data attribute to the element so it can be looked up when\n // the bound property changes.\n var dataId = ++Ember.uuid;\n\n // Handle classes differently, as we can bind multiple classes\n var classBindings = attrs['class'];\n if (classBindings !== null && classBindings !== undefined) {\n var classResults = EmberHandlebars.bindClasses(this, classBindings, view, dataId, options);\n\n ret.push('class=\"' + Handlebars.Utils.escapeExpression(classResults.join(' ')) + '\"');\n delete attrs['class'];\n }\n\n var attrKeys = Ember.keys(attrs);\n\n // For each attribute passed, create an observer and emit the\n // current value of the property as an attribute.\n forEach.call(attrKeys, function(attr) {\n var path = attrs[attr],\n normalized;\n\n Ember.assert(fmt(\"You must provide a String for a bound attribute, not %@\", [path]), typeof path === 'string');\n\n normalized = normalizePath(ctx, path, options.data);\n\n var value = (path === 'this') ? normalized.root : handlebarsGet(ctx, path, options),\n type = Ember.typeOf(value);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [value]), value === null || value === undefined || type === 'number' || type === 'string' || type === 'boolean');\n\n var observer, invoker;\n\n observer = function observer() {\n var result = handlebarsGet(ctx, path, options);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [result]), result === null || result === undefined || typeof result === 'number' || typeof result === 'string' || typeof result === 'boolean');\n\n var elem = view.$(\"[data-bindattr-\" + dataId + \"='\" + dataId + \"']\");\n\n // If we aren't able to find the element, it means the element\n // to which we were bound has been removed from the view.\n // In that case, we can assume the template has been re-rendered\n // and we need to clean up the observer.\n if (!elem || elem.length === 0) {\n Ember.removeObserver(normalized.root, normalized.path, invoker);\n return;\n }\n\n Ember.View.applyAttributeBindings(elem, attr, result);\n };\n\n invoker = function() {\n Ember.run.scheduleOnce('render', observer);\n };\n\n // Add an observer to the view for when the property changes.\n // When the observer fires, find the element using the\n // unique data id and update the attribute to the new value.\n // Note: don't add observer when path is 'this' or path\n // is whole keyword e.g. {{#each x in list}} ... {{bindAttr attr=\"x\"}}\n if (path !== 'this' && !(normalized.isKeyword && normalized.path === '' )) {\n view.registerObserver(normalized.root, normalized.path, invoker);\n }\n\n // if this changes, also change the logic in ember-views/lib/views/view.js\n if ((type === 'string' || (type === 'number' && !isNaN(value)))) {\n ret.push(attr + '=\"' + Handlebars.Utils.escapeExpression(value) + '\"');\n } else if (value && type === 'boolean') {\n // The developer controls the attr name, so it should always be safe\n ret.push(attr + '=\"' + attr + '\"');\n }\n }, this);\n\n // Add the unique identifier\n // NOTE: We use all lower-case since Firefox has problems with mixed case in SVG\n ret.push('data-bindattr-' + dataId + '=\"' + dataId + '\"');\n return new EmberHandlebars.SafeString(ret.join(' '));\n});\n\n/**\n @private\n\n Helper that, given a space-separated string of property paths and a context,\n returns an array of class names. Calling this method also has the side\n effect of setting up observers at those property paths, such that if they\n change, the correct class name will be reapplied to the DOM element.\n\n For example, if you pass the string \"fooBar\", it will first look up the\n \"fooBar\" value of the context. If that value is true, it will add the\n \"foo-bar\" class to the current element (i.e., the dasherized form of\n \"fooBar\"). If the value is a string, it will add that string as the class.\n Otherwise, it will not add any new class name.\n\n @method bindClasses\n @for Ember.Handlebars\n @param {Ember.Object} context The context from which to lookup properties\n @param {String} classBindings A string, space-separated, of class bindings\n to use\n @param {Ember.View} view The view in which observers should look for the\n element to update\n @param {Srting} bindAttrId Optional bindAttr id used to lookup elements\n @return {Array} An array of class names to add\n*/\nEmberHandlebars.bindClasses = function(context, classBindings, view, bindAttrId, options) {\n var ret = [], newClass, value, elem;\n\n // Helper method to retrieve the property from the context and\n // determine which class string to return, based on whether it is\n // a Boolean or not.\n var classStringForPath = function(root, parsedPath, options) {\n var val,\n path = parsedPath.path;\n\n if (path === 'this') {\n val = root;\n } else if (path === '') {\n val = true;\n } else {\n val = handlebarsGet(root, path, options);\n }\n\n return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n };\n\n // For each property passed, loop through and setup\n // an observer.\n forEach.call(classBindings.split(' '), function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n\n var observer, invoker;\n\n var parsedPath = Ember.View._parsePropertyPath(binding),\n path = parsedPath.path,\n pathRoot = context,\n normalized;\n\n if (path !== '' && path !== 'this') {\n normalized = normalizePath(context, path, options.data);\n\n pathRoot = normalized.root;\n path = normalized.path;\n }\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n observer = function() {\n // Get the current value of the property\n newClass = classStringForPath(context, parsedPath, options);\n elem = bindAttrId ? view.$(\"[data-bindattr-\" + bindAttrId + \"='\" + bindAttrId + \"']\") : view.$();\n\n // If we can't find the element anymore, a parent template has been\n // re-rendered and we've been nuked. Remove the observer.\n if (!elem || elem.length === 0) {\n Ember.removeObserver(pathRoot, path, invoker);\n } else {\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n }\n };\n\n invoker = function() {\n Ember.run.scheduleOnce('render', observer);\n };\n\n if (path !== '' && path !== 'this') {\n view.registerObserver(pathRoot, path, invoker);\n }\n\n // We've already setup the observer; now we just need to figure out the\n // correct behavior right now on the first pass through.\n value = classStringForPath(context, parsedPath, options);\n\n if (value) {\n ret.push(value);\n\n // Make sure we save the current value so that it can be removed if the\n // observer fires.\n oldClass = value;\n }\n });\n\n return ret;\n};\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/binding");minispade.register('ember-handlebars/helpers/collection', "(function() {/*globals Handlebars */\n\n// TODO: Don't require all of this module\nminispade.require('ember-handlebars');\nminispade.require('ember-handlebars/helpers/view');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, handlebarsGet = Ember.Handlebars.get, fmt = Ember.String.fmt;\n\n/**\n `{{collection}}` is a `Ember.Handlebars` helper for adding instances of\n `Ember.CollectionView` to a template. See `Ember.CollectionView` for\n additional information on how a `CollectionView` functions.\n\n `{{collection}}`'s primary use is as a block helper with a `contentBinding`\n option pointing towards an `Ember.Array`-compatible object. An `Ember.View`\n instance will be created for each item in its `content` property. Each view\n will have its own `content` property set to the appropriate item in the\n collection.\n\n The provided block will be applied as the template for each item's view.\n\n Given an empty `<body>` the following template:\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n And the following application code\n\n ```javascript\n App = Ember.Application.create()\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Hi Dave</div>\n <div class=\"ember-view\">Hi Mary</div>\n <div class=\"ember-view\">Hi Sara</div>\n </div>\n ```\n\n ### Blockless Use\n\n If you provide an `itemViewClass` option that has its own `template` you can\n omit the block.\n\n The following template:\n\n ```handlebars\n {{collection contentBinding=\"App.items\" itemViewClass=\"App.AnItemView\"}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create();\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ];\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{view.content.name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n ### Specifying a CollectionView subclass\n\n By default the `{{collection}}` helper will create an instance of\n `Ember.CollectionView`. You can supply a `Ember.CollectionView` subclass to\n the helper by passing it as the first argument:\n\n ```handlebars\n {{#collection App.MyCustomCollectionClass contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n ### Forwarded `item.*`-named Options\n\n As with the `{{view}}`, helper options passed to the `{{collection}}` will be\n set on the resulting `Ember.CollectionView` as properties. Additionally,\n options prefixed with `item` will be applied to the views rendered for each\n item (note the camelcasing):\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"\n itemTagName=\"p\"\n itemClassNames=\"greeting\"}}\n Howdy {{view.content.name}}\n {{/collection}}\n ```\n\n Will result in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <p class=\"ember-view greeting\">Howdy Dave</p>\n <p class=\"ember-view greeting\">Howdy Mary</p>\n <p class=\"ember-view greeting\">Howdy Sara</p>\n </div>\n ```\n\n @method collection\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n @deprecated Use `{{each}}` helper instead.\n*/\nEmber.Handlebars.registerHelper('collection', function(path, options) {\n Ember.deprecate(\"Using the {{collection}} helper without specifying a class has been deprecated as the {{each}} helper now supports the same functionality.\", path !== 'collection');\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = undefined;\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 1);\n } else {\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 2);\n }\n\n var fn = options.fn;\n var data = options.data;\n var inverse = options.inverse;\n var view = options.data.view;\n\n // If passed a path string, convert that into an object.\n // Otherwise, just default to the standard class.\n var collectionClass;\n collectionClass = path ? handlebarsGet(this, path, options) : Ember.CollectionView;\n Ember.assert(fmt(\"%@ #collection: Could not find collection class %@\", [data.view, path]), !!collectionClass);\n\n var hash = options.hash, itemHash = {}, match;\n\n // Extract item view class if provided else default to the standard class\n var itemViewClass, itemViewPath = hash.itemViewClass;\n var collectionPrototype = collectionClass.proto();\n delete hash.itemViewClass;\n itemViewClass = itemViewPath ? handlebarsGet(collectionPrototype, itemViewPath, options) : collectionPrototype.itemViewClass;\n Ember.assert(fmt(\"%@ #collection: Could not find itemViewClass %@\", [data.view, itemViewPath]), !!itemViewClass);\n\n // Go through options passed to the {{collection}} helper and extract options\n // that configure item views instead of the collection itself.\n for (var prop in hash) {\n if (hash.hasOwnProperty(prop)) {\n match = prop.match(/^item(.)(.*)$/);\n\n if(match && prop !== 'itemController') {\n // Convert itemShouldFoo -> shouldFoo\n itemHash[match[1].toLowerCase() + match[2]] = hash[prop];\n // Delete from hash as this will end up getting passed to the\n // {{view}} helper method.\n delete hash[prop];\n }\n }\n }\n\n var tagName = hash.tagName || collectionPrototype.tagName;\n\n if (fn) {\n itemHash.template = fn;\n delete options.fn;\n }\n\n var emptyViewClass;\n if (inverse && inverse !== Handlebars.VM.noop) {\n emptyViewClass = get(collectionPrototype, 'emptyViewClass');\n emptyViewClass = emptyViewClass.extend({\n template: inverse,\n tagName: itemHash.tagName\n });\n } else if (hash.emptyViewClass) {\n emptyViewClass = handlebarsGet(this, hash.emptyViewClass, options);\n }\n if (emptyViewClass) { hash.emptyView = emptyViewClass; }\n\n if(!hash.keyword){\n itemHash._context = Ember.computed.alias('content');\n }\n\n var viewString = view.toString();\n\n var viewOptions = Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);\n hash.itemViewClass = itemViewClass.extend(viewOptions);\n\n return Ember.Handlebars.helpers.view.call(this, collectionClass, options);\n});\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/collection");minispade.register('ember-handlebars/helpers/debug', "(function() {/*jshint debug:true*/\nminispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\n\n/**\n `log` allows you to output the value of a value in the current rendering\n context.\n\n ```handlebars\n {{log myVariable}}\n ```\n\n @method log\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('log', function(property, options) {\n var context = (options.contexts && options.contexts[0]) || this,\n normalized = normalizePath(context, property, options.data),\n pathRoot = normalized.root,\n path = normalized.path,\n value = (path === 'this') ? pathRoot : handlebarsGet(pathRoot, path, options);\n Ember.Logger.log(value);\n});\n\n/**\n Execute the `debugger` statement in the current context.\n\n ```handlebars\n {{debugger}}\n ```\n\n @method debugger\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('debugger', function() {\n debugger;\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/debug");minispade.register('ember-handlebars/helpers/each', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/collection_view\");\nminispade.require(\"ember-handlebars/views/metamorph_view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, {\n init: function() {\n var itemController = get(this, 'itemController');\n var binding;\n\n if (itemController) {\n var controller = Ember.ArrayController.create();\n set(controller, 'itemController', itemController);\n set(controller, 'container', get(this, 'controller.container'));\n set(controller, '_eachView', this);\n set(controller, 'target', get(this, 'controller'));\n\n this.disableContentObservers(function() {\n set(this, 'content', controller);\n binding = new Ember.Binding('content', '_eachView.dataSource').oneWay();\n binding.connect(controller);\n });\n\n set(this, '_arrayController', controller);\n } else {\n this.disableContentObservers(function() {\n binding = new Ember.Binding('content', 'dataSource').oneWay();\n binding.connect(this);\n });\n }\n\n return this._super();\n },\n\n disableContentObservers: function(callback) {\n Ember.removeBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.removeObserver(this, 'content', null, '_contentDidChange');\n\n callback.call(this);\n\n Ember.addBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.addObserver(this, 'content', null, '_contentDidChange');\n },\n\n itemViewClass: Ember._MetamorphView,\n emptyViewClass: Ember._MetamorphView,\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n // At the moment, if a container view subclass wants\n // to insert keywords, it is responsible for cloning\n // the keywords hash. This will be fixed momentarily.\n var keyword = get(this, 'keyword');\n var content = get(view, 'content');\n\n if (keyword) {\n var data = get(view, 'templateData');\n\n data = Ember.copy(data);\n data.keywords = view.cloneKeywords();\n set(view, 'templateData', data);\n\n // In this case, we do not bind, because the `content` of\n // a #each item cannot change.\n data.keywords[keyword] = content;\n }\n\n // If {{#each}} is looping over an array of controllers,\n // point each child view at their respective controller.\n if (content && get(content, 'isController')) {\n set(view, 'controller', content);\n }\n\n return view;\n },\n\n willDestroy: function() {\n var arrayController = get(this, '_arrayController');\n\n if (arrayController) {\n arrayController.destroy();\n }\n\n return this._super();\n }\n});\n\nvar GroupedEach = Ember.Handlebars.GroupedEach = function(context, path, options) {\n var self = this,\n normalized = Ember.Handlebars.normalizePath(context, path, options.data);\n\n this.context = context;\n this.path = path;\n this.options = options;\n this.template = options.fn;\n this.containingView = options.data.view;\n this.normalizedRoot = normalized.root;\n this.normalizedPath = normalized.path;\n this.content = this.lookupContent();\n\n this.addContentObservers();\n this.addArrayObservers();\n\n this.containingView.on('willClearRender', function() {\n self.destroy();\n });\n};\n\nGroupedEach.prototype = {\n contentWillChange: function() {\n this.removeArrayObservers();\n },\n\n contentDidChange: function() {\n this.content = this.lookupContent();\n this.addArrayObservers();\n this.rerenderContainingView();\n },\n\n contentArrayWillChange: Ember.K,\n\n contentArrayDidChange: function() {\n this.rerenderContainingView();\n },\n\n lookupContent: function() {\n return Ember.Handlebars.get(this.normalizedRoot, this.normalizedPath, this.options);\n },\n\n addArrayObservers: function() {\n this.content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n removeArrayObservers: function() {\n this.content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n addContentObservers: function() {\n Ember.addBeforeObserver(this.normalizedRoot, this.normalizedPath, this, this.contentWillChange);\n Ember.addObserver(this.normalizedRoot, this.normalizedPath, this, this.contentDidChange);\n },\n\n removeContentObservers: function() {\n Ember.removeBeforeObserver(this.normalizedRoot, this.normalizedPath, this.contentWillChange);\n Ember.removeObserver(this.normalizedRoot, this.normalizedPath, this.contentDidChange);\n },\n\n render: function() {\n var content = this.content,\n contentLength = get(content, 'length'),\n data = this.options.data,\n template = this.template;\n\n data.insideEach = true;\n for (var i = 0; i < contentLength; i++) {\n template(content.objectAt(i), { data: data });\n }\n },\n\n rerenderContainingView: function() {\n Ember.run.scheduleOnce('render', this.containingView, 'rerender');\n },\n\n destroy: function() {\n this.removeContentObservers();\n this.removeArrayObservers();\n }\n};\n\n/**\n The `{{#each}}` helper loops over elements in a collection, rendering its\n block once for each item. It is an extension of the base Handlebars `{{#each}}`\n helper:\n\n ```javascript\n Developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}];\n ```\n\n ```handlebars\n {{#each Developers}}\n {{name}}\n {{/each}}\n ```\n\n `{{each}}` supports an alternative syntax with element naming:\n\n ```handlebars\n {{#each person in Developers}}\n {{person.name}}\n {{/each}}\n ```\n\n When looping over objects that do not have properties, `{{this}}` can be used\n to render the object:\n\n ```javascript\n DeveloperNames = ['Yehuda', 'Tom', 'Paul']\n ```\n\n ```handlebars\n {{#each DeveloperNames}}\n {{this}}\n {{/each}}\n ```\n ### {{else}} condition\n `{{#each}}` can have a matching `{{else}}`. The contents of this block will render\n if the collection is empty.\n\n ```\n {{#each person in Developers}}\n {{person.name}}\n {{else}}\n <p>Sorry, nobody is available for this task.</p>\n {{/each}}\n ```\n ### Specifying a View class for items\n If you provide an `itemViewClass` option that references a view class\n with its own `template` you can omit the block.\n\n The following template:\n\n ```handlebars\n {{#view App.MyView }}\n {{each view.items itemViewClass=\"App.AnItemView\"}}\n {{/view}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create({\n MyView: Ember.View.extend({\n items: [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n })\n });\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n ### Representing each item with a Controller.\n By default the controller lookup within an `{{#each}}` block will be\n the controller of the template where the `{{#each}}` was used. If each\n item needs to be presented by a custom controller you can provide a\n `itemController` option which references a controller by lookup name.\n Each item in the loop will be wrapped in an instance of this controller\n and the item itself will be set to the `content` property of that controller.\n\n This is useful in cases where properties of model objects need transformation\n or synthesis for display:\n\n ```javascript\n App.DeveloperController = Ember.ObjectController.extend({\n isAvailableForHire: function(){\n return !this.get('content.isEmployed') && this.get('content.isSeekingWork');\n }.property('isEmployed', 'isSeekingWork')\n })\n ```\n\n ```handlebars\n {{#each person in developers itemController=\"developer\"}}\n {{person.name}} {{#if person.isAvailableForHire}}Hire me!{{/if}}\n {{/each}}\n ```\n\n @method each\n @for Ember.Handlebars.helpers\n @param [name] {String} name for item (used with `in`)\n @param [path] {String} path\n @param [options] {Object} Handlebars key/value pairs of options\n @param [options.itemViewClass] {String} a path to a view class used for each item\n @param [options.itemController] {String} name of a controller to be created for each item\n*/\nEmber.Handlebars.registerHelper('each', function(path, options) {\n if (arguments.length === 4) {\n Ember.assert(\"If you pass more than one argument to the each helper, it must be in the form #each foo in bar\", arguments[1] === \"in\");\n\n var keywordName = arguments[0];\n\n options = arguments[3];\n path = arguments[2];\n if (path === '') { path = \"this\"; }\n\n options.hash.keyword = keywordName;\n }\n\n options.hash.dataSourceBinding = path;\n // Set up emptyView as a metamorph with no tag\n //options.hash.emptyViewClass = Ember._MetamorphView;\n\n if (options.data.insideGroup && !options.hash.groupedRows && !options.hash.itemViewClass) {\n new Ember.Handlebars.GroupedEach(this, path, options).render();\n } else {\n return Ember.Handlebars.helpers.collection.call(this, 'Ember.Handlebars.EachView', options);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/each");minispade.register('ember-handlebars/helpers/partial', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `partial` renders a template directly using the current context.\n If needed the context can be set using the `{{#with foo}}` helper. \n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"header_bar\">\n {{#with currentUser}}\n {{partial user_info}}\n {{/with}}\n </script>\n\n The `data-template-name` attribute of a partial template\n is prefixed with an underscore.\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"_user_info\">\n <span>Hello {{username}}!</span>\n </script>\n ```\n\n @method partial\n @for Ember.Handlebars.helpers\n @param {String} partialName the name of the template to render minus the leading underscore\n*/\n\nEmber.Handlebars.registerHelper('partial', function(name, options) {\n var nameParts = name.split(\"/\"),\n lastPart = nameParts[nameParts.length - 1];\n\n nameParts[nameParts.length - 1] = \"_\" + lastPart;\n\n var underscoredName = nameParts.join(\"/\");\n\n var template = Ember.TEMPLATES[underscoredName],\n deprecatedTemplate = Ember.TEMPLATES[name];\n\n Ember.deprecate(\"You tried to render the partial \" + name + \", which should be at '\" + underscoredName + \"', but Ember found '\" + name + \"'. Please use a leading underscore in your partials\", template);\n Ember.assert(\"Unable to find partial with name '\"+name+\"'.\", template || deprecatedTemplate);\n\n template = template || deprecatedTemplate;\n\n template(this, { data: options.data });\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/partial");minispade.register('ember-handlebars/helpers/shared', "(function() {Ember.Handlebars.resolvePaths = function(options) {\n var ret = [],\n contexts = options.contexts,\n roots = options.roots,\n data = options.data;\n\n for (var i=0, l=contexts.length; i<l; i++) {\n ret.push( Ember.Handlebars.get(roots[i], contexts[i], { data: data }) );\n }\n\n return ret;\n};\n\n})();\n//@ sourceURL=ember-handlebars/helpers/shared");minispade.register('ember-handlebars/helpers/template', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `template` allows you to render a template from inside another template.\n This allows you to re-use the same template in multiple places. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"logged_in_user\">\n {{#with loggedInUser}}\n Last Login: {{lastLogin}}\n User Info: {{template \"user_info\"}}\n {{/with}}\n </script>\n ```\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"user_info\">\n Name: <em>{{name}}</em>\n Karma: <em>{{karma}}</em>\n </script>\n ```\n\n ```handlebars\n {{#if isUser}}\n {{template \"user_info\"}}\n {{else}}\n {{template \"unlogged_user_info\"}}\n {{/if}}\n ```\n\n This helper looks for templates in the global `Ember.TEMPLATES` hash. If you\n add `<script>` tags to your page with the `data-template-name` attribute set,\n they will be compiled and placed in this hash automatically.\n\n You can also manually register templates by adding them to the hash:\n\n ```javascript\n Ember.TEMPLATES[\"my_cool_template\"] = Ember.Handlebars.compile('<b>{{user}}</b>');\n ```\n\n @method template\n @for Ember.Handlebars.helpers\n @param {String} templateName the template to render\n*/\n\nEmber.Handlebars.registerHelper('template', function(name, options) {\n var template = Ember.TEMPLATES[name];\n\n Ember.assert(\"Unable to find template with name '\"+name+\"'.\", !!template);\n\n Ember.TEMPLATES[name](this, { data: options.data });\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/template");minispade.register('ember-handlebars/helpers/unbound', "(function() {/*globals Handlebars */\nminispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar handlebarsGet = Ember.Handlebars.get;\n\n/**\n `unbound` allows you to output a property without binding. *Important:* The\n output will not be updated if the property changes. Use with caution.\n\n ```handlebars\n <div>{{unbound somePropertyThatDoesntChange}}</div>\n ```\n\n `unbound` can also be used in conjunction with a bound helper to\n render it in its unbound form:\n\n ```handlebars\n <div>{{unbound helperName somePropertyThatDoesntChange}}</div>\n ```\n\n @method unbound\n @for Ember.Handlebars.helpers\n @param {String} property\n @return {String} HTML string\n*/\nEmber.Handlebars.registerHelper('unbound', function(property, fn) {\n var options = arguments[arguments.length - 1], helper, context, out;\n\n if(arguments.length > 2) {\n // Unbound helper call.\n options.data.isUnbound = true;\n helper = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing;\n out = helper.apply(this, Array.prototype.slice.call(arguments, 1));\n delete options.data.isUnbound;\n return out;\n }\n\n context = (fn.contexts && fn.contexts[0]) || this;\n return handlebarsGet(context, property, fn);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/unbound");minispade.register('ember-handlebars/helpers/view', "(function() {/*globals Handlebars */\n\n// TODO: Don't require the entire module\nminispade.require(\"ember-handlebars\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar EmberHandlebars = Ember.Handlebars;\n\nEmberHandlebars.ViewHelper = Ember.Object.create({\n\n propertiesFromHTMLOptions: function(options, thisContext) {\n var hash = options.hash, data = options.data;\n var extensions = {},\n classes = hash['class'],\n dup = false;\n\n if (hash.id) {\n extensions.elementId = hash.id;\n dup = true;\n }\n\n if (hash.tag) {\n extensions.tagName = hash.tag;\n dup = true;\n }\n\n if (classes) {\n classes = classes.split(' ');\n extensions.classNames = classes;\n dup = true;\n }\n\n if (hash.classBinding) {\n extensions.classNameBindings = hash.classBinding.split(' ');\n dup = true;\n }\n\n if (hash.classNameBindings) {\n if (extensions.classNameBindings === undefined) extensions.classNameBindings = [];\n extensions.classNameBindings = extensions.classNameBindings.concat(hash.classNameBindings.split(' '));\n dup = true;\n }\n\n if (hash.attributeBindings) {\n Ember.assert(\"Setting 'attributeBindings' via Handlebars is not allowed. Please subclass Ember.View and set it there instead.\");\n extensions.attributeBindings = null;\n dup = true;\n }\n\n if (dup) {\n hash = Ember.$.extend({}, hash);\n delete hash.id;\n delete hash.tag;\n delete hash['class'];\n delete hash.classBinding;\n }\n\n // Set the proper context for all bindings passed to the helper. This applies to regular attribute bindings\n // as well as class name bindings. If the bindings are local, make them relative to the current context\n // instead of the view.\n var path;\n\n // Evaluate the context of regular attribute bindings:\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n\n // Test if the property ends in \"Binding\"\n if (Ember.IS_BINDING.test(prop) && typeof hash[prop] === 'string') {\n path = this.contextualizeBindingPath(hash[prop], data);\n if (path) { hash[prop] = path; }\n }\n }\n\n // Evaluate the context of class name bindings:\n if (extensions.classNameBindings) {\n for (var b in extensions.classNameBindings) {\n var full = extensions.classNameBindings[b];\n if (typeof full === 'string') {\n // Contextualize the path of classNameBinding so this:\n //\n // classNameBinding=\"isGreen:green\"\n //\n // is converted to this:\n //\n // classNameBinding=\"_parentView.context.isGreen:green\"\n var parsedPath = Ember.View._parsePropertyPath(full);\n path = this.contextualizeBindingPath(parsedPath.path, data);\n if (path) { extensions.classNameBindings[b] = path + parsedPath.classNames; }\n }\n }\n }\n\n return Ember.$.extend(hash, extensions);\n },\n\n // Transform bindings from the current context to a context that can be evaluated within the view.\n // Returns null if the path shouldn't be changed.\n //\n // TODO: consider the addition of a prefix that would allow this method to return `path`.\n contextualizeBindingPath: function(path, data) {\n var normalized = Ember.Handlebars.normalizePath(null, path, data);\n if (normalized.isKeyword) {\n return 'templateData.keywords.' + path;\n } else if (Ember.isGlobalPath(path)) {\n return null;\n } else if (path === 'this') {\n return '_parentView.context';\n } else {\n return '_parentView.context.' + path;\n }\n },\n\n helper: function(thisContext, path, options) {\n var inverse = options.inverse,\n data = options.data,\n view = data.view,\n fn = options.fn,\n hash = options.hash,\n newView;\n\n if ('string' === typeof path) {\n newView = EmberHandlebars.get(thisContext, path, options);\n Ember.assert(\"Unable to find view at path '\" + path + \"'\", !!newView);\n } else {\n newView = path;\n }\n\n Ember.assert(Ember.String.fmt('You must pass a view to the #view helper, not %@ (%@)', [path, newView]), Ember.View.detect(newView) || Ember.View.detectInstance(newView));\n\n var viewOptions = this.propertiesFromHTMLOptions(options, thisContext);\n var currentView = data.view;\n viewOptions.templateData = options.data;\n var newViewProto = newView.proto ? newView.proto() : newView;\n\n if (fn) {\n Ember.assert(\"You cannot provide a template block if you also specified a templateName\", !get(viewOptions, 'templateName') && !get(newViewProto, 'templateName'));\n viewOptions.template = fn;\n }\n\n // We only want to override the `_context` computed property if there is\n // no specified controller. See View#_context for more information.\n if (!newViewProto.controller && !newViewProto.controllerBinding && !viewOptions.controller && !viewOptions.controllerBinding) {\n viewOptions._context = thisContext;\n }\n\n currentView.appendChild(newView, viewOptions);\n }\n});\n\n/**\n `{{view}}` inserts a new instance of `Ember.View` into a template passing its\n options to the `Ember.View`'s `create` method and using the supplied block as\n the view's own template.\n\n An empty `<body>` and the following template:\n\n ```handlebars\n A span:\n {{#view tagName=\"span\"}}\n hello.\n {{/view}}\n ```\n\n Will result in HTML structure:\n\n ```html\n <body>\n <!-- Note: the handlebars template script\n also results in a rendered Ember.View\n which is the outer <div> here -->\n\n <div class=\"ember-view\">\n A span:\n <span id=\"ember1\" class=\"ember-view\">\n Hello.\n </span>\n </div>\n </body>\n ```\n\n ### `parentView` setting\n\n The `parentView` property of the new `Ember.View` instance created through\n `{{view}}` will be set to the `Ember.View` instance of the template where\n `{{view}}` was called.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile(\"{{#view}} my parent: {{parentView.elementId}} {{/view}}\")\n });\n\n aView.appendTo('body');\n ```\n\n Will result in HTML structure:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view\">\n my parent: ember1\n </div>\n </div>\n ```\n\n ### Setting CSS id and class attributes\n\n The HTML `id` attribute can be set on the `{{view}}`'s resulting element with\n the `id` option. This option will _not_ be passed to `Ember.View.create`.\n\n ```handlebars\n {{#view tagName=\"span\" id=\"a-custom-id\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"a-custom-id\" class=\"ember-view\">\n hello.\n </span>\n </div>\n ```\n\n The HTML `class` attribute can be set on the `{{view}}`'s resulting element\n with the `class` or `classNameBindings` options. The `class` option will\n directly set the CSS `class` attribute and will not be passed to\n `Ember.View.create`. `classNameBindings` will be passed to `create` and use\n `Ember.View`'s class name binding functionality:\n\n ```handlebars\n {{#view tagName=\"span\" class=\"a-custom-class\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"ember2\" class=\"ember-view a-custom-class\">\n hello.\n </span>\n </div>\n ```\n\n ### Supplying a different view class\n\n `{{view}}` can take an optional first argument before its supplied options to\n specify a path to a custom view class.\n\n ```handlebars\n {{#view \"MyApp.CustomView\"}}\n hello.\n {{/view}}\n ```\n\n The first argument can also be a relative path. Ember will search for the\n view class starting at the `Ember.View` of the template where `{{view}}` was\n used as the root object:\n\n ```javascript\n MyApp = Ember.Application.create({});\n MyApp.OuterView = Ember.View.extend({\n innerViewClass: Ember.View.extend({\n classNames: ['a-custom-view-class-as-property']\n }),\n template: Ember.Handlebars.compile('{{#view \"innerViewClass\"}} hi {{/view}}')\n });\n\n MyApp.OuterView.create().appendTo('body');\n ```\n\n Will result in the following HTML:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view a-custom-view-class-as-property\">\n hi\n </div>\n </div>\n ```\n\n ### Blockless use\n\n If you supply a custom `Ember.View` subclass that specifies its own template\n or provide a `templateName` option to `{{view}}` it can be used without\n supplying a block. Attempts to use both a `templateName` option and supply a\n block will throw an error.\n\n ```handlebars\n {{view \"MyApp.ViewWithATemplateDefined\"}}\n ```\n\n ### `viewName` property\n\n You can supply a `viewName` option to `{{view}}`. The `Ember.View` instance\n will be referenced as a property of its parent view by this name.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile('{{#view viewName=\"aChildByName\"}} hi {{/view}}')\n });\n\n aView.appendTo('body');\n aView.get('aChildByName') // the instance of Ember.View created by {{view}} helper\n ```\n\n @method view\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('view', function(path, options) {\n Ember.assert(\"The view helper only takes a single argument\", arguments.length <= 2);\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = \"Ember.View\";\n }\n\n return EmberHandlebars.ViewHelper.helper(this, path, options);\n});\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/view");minispade.register('ember-handlebars/helpers/yield', "(function() {/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n When used in a Handlebars template that is assigned to an `Ember.View`\n instance's `layout` property Ember will render the layout template first,\n inserting the view's own rendered output at the `{{yield}}` location.\n\n An empty `<body>` and the following application code:\n\n ```javascript\n AView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n layout: Ember.Handlebars.compile('<div class=\"wrapper\">{{yield}}</div>'),\n template: Ember.Handlebars.compile('<span>I am wrapped</span>')\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will result in the following HTML output:\n\n ```html\n <body>\n <div class='ember-view a-view-with-layout'>\n <div class=\"wrapper\">\n <span>I am wrapped</span>\n </div>\n </div>\n </body>\n ```\n\n The `yield` helper cannot be used outside of a template assigned to an\n `Ember.View`'s `layout` property and will throw an error if attempted.\n\n ```javascript\n BView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n template: Ember.Handlebars.compile('{{yield}}')\n });\n\n bView = BView.create();\n bView.appendTo('body');\n\n // throws\n // Uncaught Error: assertion failed: You called yield in a template that was not a layout\n ```\n\n @method yield\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmber.Handlebars.registerHelper('yield', function(options) {\n var view = options.data.view, template;\n\n while (view && !get(view, 'layout')) {\n view = get(view, 'parentView');\n }\n\n Ember.assert(\"You called yield in a template that was not a layout\", !!view);\n\n template = get(view, 'template');\n\n if (template) { template(this, options); }\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/yield");minispade.register('ember-handlebars/loader', "(function() {/*globals Handlebars */\nminispade.require(\"ember-handlebars/ext\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n @private\n\n Find templates stored in the head tag as script tags and make them available\n to `Ember.CoreView` in the global `Ember.TEMPLATES` object. This will be run\n as as jQuery DOM-ready callback.\n\n Script tags with `text/x-handlebars` will be compiled\n with Ember's Handlebars and are suitable for use as a view's template.\n Those with type `text/x-raw-handlebars` will be compiled with regular\n Handlebars and are suitable for use in views' computed properties.\n\n @method bootstrap\n @for Ember.Handlebars\n @static\n @param ctx\n*/\nEmber.Handlebars.bootstrap = function(ctx) {\n var selectors = 'script[type=\"text/x-handlebars\"], script[type=\"text/x-raw-handlebars\"]';\n\n Ember.$(selectors, ctx)\n .each(function() {\n // Get a reference to the script tag\n var script = Ember.$(this);\n\n var compile = (script.attr('type') === 'text/x-raw-handlebars') ?\n Ember.$.proxy(Handlebars.compile, Handlebars) :\n Ember.$.proxy(Ember.Handlebars.compile, Ember.Handlebars),\n // Get the name of the script, used by Ember.View's templateName property.\n // First look for data-template-name attribute, then fall back to its\n // id if no name is found.\n templateName = script.attr('data-template-name') || script.attr('id') || 'application',\n template = compile(script.html());\n\n // For templates which have a name, we save them and then remove them from the DOM\n Ember.TEMPLATES[templateName] = template;\n\n // Remove script tag from DOM\n script.remove();\n });\n};\n\nfunction bootstrap() {\n Ember.Handlebars.bootstrap( Ember.$(document) );\n}\n\n/*\n We tie this to application.load to ensure that we've at least\n attempted to bootstrap at the point that the application is loaded.\n\n We also tie this to document ready since we're guaranteed that all\n the inline templates are present at this point.\n\n There's no harm to running this twice, since we remove the templates\n from the DOM after processing.\n*/\n\nEmber.onLoad('application', bootstrap);\n\n})();\n//@ sourceURL=ember-handlebars/loader");minispade.register('ember-handlebars', "(function() {minispade.require(\"ember-handlebars-compiler\");\nminispade.require(\"ember-runtime\");\nminispade.require(\"ember-views\");\nminispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-handlebars/string\");\nminispade.require(\"ember-handlebars/helpers\");\nminispade.require(\"ember-handlebars/views\");\nminispade.require(\"ember-handlebars/controls\");\nminispade.require(\"ember-handlebars/loader\");\n\n/**\nEmber Handlebars\n\n@module ember\n@submodule ember-handlebars\n@requires ember-views\n*/\n\nEmber.runLoadHooks('Ember.Handlebars', Ember.Handlebars);\n\n})();\n//@ sourceURL=ember-handlebars");minispade.register('ember-handlebars/string', "(function() {/**\n @method htmlSafe\n @for Ember.String\n @static\n*/\nEmber.String.htmlSafe = function(str) {\n return new Handlebars.SafeString(str);\n};\n\nvar htmlSafe = Ember.String.htmlSafe;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n See {{#crossLink \"Ember.String/htmlSafe\"}}{{/crossLink}}\n\n @method htmlSafe\n @for String\n */\n String.prototype.htmlSafe = function() {\n return htmlSafe(this);\n };\n}\n\n})();\n//@ sourceURL=ember-handlebars/string");minispade.register('ember-handlebars/views', "(function() {minispade.require(\"ember-handlebars/views/handlebars_bound_view\");\nminispade.require(\"ember-handlebars/views/metamorph_view\");\n\n})();\n//@ sourceURL=ember-handlebars/views");minispade.register('ember-handlebars/views/handlebars_bound_view', "(function() {/*globals Handlebars */\n/*jshint newcap:false*/\nminispade.require(\"metamorph\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set, handlebarsGet = Ember.Handlebars.get;\nvar Metamorph = requireModule('metamorph');\nminispade.require('ember-views/views/view');\nminispade.require('ember-handlebars/views/metamorph_view');\n\nfunction SimpleHandlebarsView(path, pathRoot, isEscaped, templateData) {\n this.path = path;\n this.pathRoot = pathRoot;\n this.isEscaped = isEscaped;\n this.templateData = templateData;\n\n this.morph = Metamorph();\n this.state = 'preRender';\n this.updateId = null;\n}\n\nEmber._SimpleHandlebarsView = SimpleHandlebarsView;\n\nSimpleHandlebarsView.prototype = {\n isVirtual: true,\n isView: true,\n\n destroy: function () {\n if (this.updateId) {\n Ember.run.cancel(this.updateId);\n this.updateId = null;\n }\n this.morph = null;\n },\n\n propertyDidChange: Ember.K,\n\n normalizedValue: function() {\n var path = this.path,\n pathRoot = this.pathRoot,\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = this.templateData;\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return result;\n },\n\n renderToBuffer: function(buffer) {\n var string = '';\n\n string += this.morph.startTag();\n string += this.render();\n string += this.morph.endTag();\n\n buffer.push(string);\n },\n\n render: function() {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = this.isEscaped;\n var result = this.normalizedValue();\n\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n return result;\n },\n\n rerender: function() {\n switch(this.state) {\n case 'preRender':\n case 'destroyed':\n break;\n case 'inBuffer':\n throw new Ember.Error(\"Something you did tried to replace an {{expression}} before it was inserted into the DOM.\");\n case 'hasElement':\n case 'inDOM':\n this.updateId = Ember.run.scheduleOnce('render', this, 'update');\n break;\n }\n\n return this;\n },\n\n update: function () {\n this.updateId = null;\n this.morph.html(this.render());\n },\n\n transitionTo: function(state) {\n this.state = state;\n }\n};\n\nvar states = Ember.View.cloneStates(Ember.View.states), merge = Ember.merge;\n\nmerge(states._default, {\n rerenderIfNeeded: Ember.K\n});\n\nmerge(states.inDOM, {\n rerenderIfNeeded: function(view) {\n if (get(view, 'normalizedValue') !== view._lastNormalizedValue) {\n view.rerender();\n }\n }\n});\n\n/**\n `Ember._HandlebarsBoundView` is a private view created by the Handlebars\n `{{bind}}` helpers that is used to keep track of bound properties.\n\n Every time a property is bound using a `{{mustache}}`, an anonymous subclass\n of `Ember._HandlebarsBoundView` is created with the appropriate sub-template\n and context set up. When the associated property changes, just the template\n for this view will re-render.\n\n @class _HandlebarsBoundView\n @namespace Ember\n @extends Ember._MetamorphView\n @private\n*/\nEmber._HandlebarsBoundView = Ember._MetamorphView.extend({\n instrumentName: 'render.boundHandlebars',\n states: states,\n\n /**\n The function used to determine if the `displayTemplate` or\n `inverseTemplate` should be rendered. This should be a function that takes\n a value and returns a Boolean.\n\n @property shouldDisplayFunc\n @type Function\n @default null\n */\n shouldDisplayFunc: null,\n\n /**\n Whether the template rendered by this view gets passed the context object\n of its parent template, or gets passed the value of retrieving `path`\n from the `pathRoot`.\n\n For example, this is true when using the `{{#if}}` helper, because the\n template inside the helper should look up properties relative to the same\n object as outside the block. This would be `false` when used with `{{#with\n foo}}` because the template should receive the object found by evaluating\n `foo`.\n\n @property preserveContext\n @type Boolean\n @default false\n */\n preserveContext: false,\n\n /**\n If `preserveContext` is true, this is the object that will be used\n to render the template.\n\n @property previousContext\n @type Object\n */\n previousContext: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `true`.\n\n @property displayTemplate\n @type Function\n @default null\n */\n displayTemplate: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `false`.\n\n @property inverseTemplate\n @type Function\n @default null\n */\n inverseTemplate: null,\n\n\n /**\n The path to look up on `pathRoot` that is passed to\n `shouldDisplayFunc` to determine which template to render.\n\n In addition, if `preserveContext` is `false,` the object at this path will\n be passed to the template when rendering.\n\n @property path\n @type String\n @default null\n */\n path: null,\n\n /**\n The object from which the `path` will be looked up. Sometimes this is the\n same as the `previousContext`, but in cases where this view has been\n generated for paths that start with a keyword such as `view` or\n `controller`, the path root will be that resolved object.\n\n @property pathRoot\n @type Object\n */\n pathRoot: null,\n\n normalizedValue: Ember.computed(function() {\n var path = get(this, 'path'),\n pathRoot = get(this, 'pathRoot'),\n valueNormalizer = get(this, 'valueNormalizerFunc'),\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = get(this, 'templateData');\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return valueNormalizer ? valueNormalizer(result) : result;\n }).property('path', 'pathRoot', 'valueNormalizerFunc').volatile(),\n\n rerenderIfNeeded: function() {\n this.currentState.rerenderIfNeeded(this);\n },\n\n /**\n Determines which template to invoke, sets up the correct state based on\n that logic, then invokes the default `Ember.View` `render` implementation.\n\n This method will first look up the `path` key on `pathRoot`,\n then pass that value to the `shouldDisplayFunc` function. If that returns\n `true,` the `displayTemplate` function will be rendered to DOM. Otherwise,\n `inverseTemplate`, if specified, will be rendered.\n\n For example, if this `Ember._HandlebarsBoundView` represented the `{{#with\n foo}}` helper, it would look up the `foo` property of its context, and\n `shouldDisplayFunc` would always return true. The object found by looking\n up `foo` would be passed to `displayTemplate`.\n\n @method render\n @param {Ember.RenderBuffer} buffer\n */\n render: function(buffer) {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = get(this, 'isEscaped');\n\n var shouldDisplay = get(this, 'shouldDisplayFunc'),\n preserveContext = get(this, 'preserveContext'),\n context = get(this, 'previousContext');\n\n var inverseTemplate = get(this, 'inverseTemplate'),\n displayTemplate = get(this, 'displayTemplate');\n\n var result = get(this, 'normalizedValue');\n this._lastNormalizedValue = result;\n\n // First, test the conditional to see if we should\n // render the template or not.\n if (shouldDisplay(result)) {\n set(this, 'template', displayTemplate);\n\n // If we are preserving the context (for example, if this\n // is an #if block, call the template with the same object.\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n // Otherwise, determine if this is a block bind or not.\n // If so, pass the specified object to the template\n if (displayTemplate) {\n set(this, '_context', result);\n } else {\n // This is not a bind block, just push the result of the\n // expression to the render context and return.\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n buffer.push(result);\n return;\n }\n }\n } else if (inverseTemplate) {\n set(this, 'template', inverseTemplate);\n\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n set(this, '_context', result);\n }\n } else {\n set(this, 'template', function() { return ''; });\n }\n\n return this._super(buffer);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/views/handlebars_bound_view");minispade.register('ember-handlebars/views/metamorph_view', "(function() {/*jshint newcap:false*/\nminispade.require(\"metamorph\");\nminispade.require(\"ember-views/views/view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set, get = Ember.get;\nvar Metamorph = requireModule('metamorph');\n\nfunction notifyMutationListeners() {\n Ember.run.once(Ember.View, 'notifyMutationListeners');\n}\n\n// DOMManager should just abstract dom manipulation between jquery and metamorph\nvar DOMManager = {\n remove: function(view) {\n view.morph.remove();\n notifyMutationListeners();\n },\n\n prepend: function(view, html) {\n view.morph.prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.morph.after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.morph.html(html);\n notifyMutationListeners();\n },\n\n // This is messed up.\n replace: function(view) {\n var morph = view.morph;\n\n view.transitionTo('preRender');\n\n Ember.run.schedule('render', this, function() {\n if (view.isDestroying) { return; }\n\n view.clearRenderedChildren();\n var buffer = view.renderToBuffer();\n\n view.invokeRecursively(function(view) {\n view.propertyDidChange('element');\n });\n\n view.triggerRecursively('willInsertElement');\n morph.replaceWith(buffer.string());\n view.transitionTo('inDOM');\n view.triggerRecursively('didInsertElement');\n notifyMutationListeners();\n });\n },\n\n empty: function(view) {\n view.morph.html(\"\");\n notifyMutationListeners();\n }\n};\n\n// The `morph` and `outerHTML` properties are internal only\n// and not observable.\n\n/**\n @class _Metamorph\n @namespace Ember\n @extends Ember.Mixin\n @private\n*/\nEmber._Metamorph = Ember.Mixin.create({\n isVirtual: true,\n tagName: '',\n\n instrumentName: 'render.metamorph',\n\n init: function() {\n this._super();\n this.morph = Metamorph();\n Ember.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated. You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName);\n },\n\n beforeRender: function(buffer) {\n buffer.push(this.morph.startTag());\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n buffer.push(this.morph.endTag());\n },\n\n createElement: function() {\n var buffer = this.renderToBuffer();\n this.outerHTML = buffer.string();\n this.clearBuffer();\n },\n\n domManager: DOMManager\n});\n\n/**\n @class _MetamorphView\n @namespace Ember\n @extends Ember.View\n @uses Ember._Metamorph\n @private\n*/\nEmber._MetamorphView = Ember.View.extend(Ember._Metamorph);\n\n/**\n @class _SimpleMetamorphView\n @namespace Ember\n @extends Ember.View\n @uses Ember._Metamorph\n @private\n*/\nEmber._SimpleMetamorphView = Ember.CoreView.extend(Ember._Metamorph);\n\n\n})();\n//@ sourceURL=ember-handlebars/views/metamorph_view");minispade.register('ember-metal/accessors', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\n\n/**\n@module ember-metal\n*/\n\nvar META_KEY = Ember.META_KEY, get, set;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\nvar IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;\nvar IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\\.\\*]/;\nvar HAS_THIS = /^this[\\.\\*]/;\nvar FIRST_KEY = /^([^\\.\\*]+)/;\n\n// ..........................................................\n// GET AND SET\n//\n// If we are on a platform that supports accessors we can use those.\n// Otherwise simulate accessors by looking up the property directly on the\n// object.\n\n/**\n Gets the value of a property on an object. If the property is computed,\n the function will be invoked. If the property is not defined but the\n object implements the `unknownProperty` method then that will be invoked.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to retrieve a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to retrieve\n properties if the property might not be defined on the object and you want\n to respect the `unknownProperty` handler. Otherwise you can ignore this\n method.\n\n Note that if the object itself is `undefined`, this method will throw\n an error.\n\n @method get\n @for Ember\n @param {Object} obj The object to retrieve from.\n @param {String} keyName The property key to retrieve\n @return {Object} the property value or `null`.\n*/\nget = function get(obj, keyName) {\n // Helpers that operate with 'this' within an #each\n if (keyName === '') {\n return obj;\n }\n\n if (!keyName && 'string'===typeof obj) {\n keyName = obj;\n obj = null;\n }\n\n if (!obj || keyName.indexOf('.') !== -1) {\n Ember.assert(\"Cannot call get with '\"+ keyName +\"' on an undefined object.\", obj !== undefined);\n return getPath(obj, keyName);\n }\n\n Ember.assert(\"You need to provide an object and key to `get`.\", !!obj && keyName);\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;\n if (desc) {\n return desc.get(obj, keyName);\n } else {\n if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {\n ret = meta.values[keyName];\n } else {\n ret = obj[keyName];\n }\n\n if (ret === undefined &&\n 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {\n return obj.unknownProperty(keyName);\n }\n\n return ret;\n }\n};\n\n/**\n Sets the value of a property on an object, respecting computed properties\n and notifying observers and other listeners of the change. If the\n property is not defined but the object implements the `unknownProperty`\n method then that will be invoked as well.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to set a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to set\n properties if the property might not be defined on the object and you want\n to respect the `unknownProperty` handler. Otherwise you can ignore this\n method.\n\n @method set\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} keyName The property key to set\n @param {Object} value The value to set\n @return {Object} the passed value.\n*/\nset = function set(obj, keyName, value, tolerant) {\n if (typeof obj === 'string') {\n Ember.assert(\"Path '\" + obj + \"' must be global if no obj is given.\", IS_GLOBAL.test(obj));\n value = keyName;\n keyName = obj;\n obj = null;\n }\n\n if (!obj || keyName.indexOf('.') !== -1) {\n return setPath(obj, keyName, value, tolerant);\n }\n\n Ember.assert(\"You need to provide an object and key to `set`.\", !!obj && keyName !== undefined);\n Ember.assert('calling set on destroyed object', !obj.isDestroyed);\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName],\n isUnknown, currentValue;\n if (desc) {\n desc.set(obj, keyName, value);\n } else {\n isUnknown = 'object' === typeof obj && !(keyName in obj);\n\n // setUnknownProperty is called if `obj` is an object,\n // the property does not already exist, and the\n // `setUnknownProperty` method exists on the object\n if (isUnknown && 'function' === typeof obj.setUnknownProperty) {\n obj.setUnknownProperty(keyName, value);\n } else if (meta && meta.watching[keyName] > 0) {\n if (MANDATORY_SETTER) {\n currentValue = meta.values[keyName];\n } else {\n currentValue = obj[keyName];\n }\n // only trigger a change if the value has changed\n if (value !== currentValue) {\n Ember.propertyWillChange(obj, keyName);\n if (MANDATORY_SETTER) {\n if (currentValue === undefined && !(keyName in obj)) {\n Ember.defineProperty(obj, keyName, null, value); // setup mandatory setter\n } else {\n meta.values[keyName] = value;\n }\n } else {\n obj[keyName] = value;\n }\n Ember.propertyDidChange(obj, keyName);\n }\n } else {\n obj[keyName] = value;\n }\n }\n return value;\n};\n\n// Currently used only by Ember Data tests\nif (Ember.config.overrideAccessors) {\n Ember.get = get;\n Ember.set = set;\n Ember.config.overrideAccessors();\n get = Ember.get;\n set = Ember.set;\n}\n\nfunction firstKey(path) {\n return path.match(FIRST_KEY)[0];\n}\n\n// assumes path is already normalized\nfunction normalizeTuple(target, path) {\n var hasThis = HAS_THIS.test(path),\n isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),\n key;\n\n if (!target || isGlobal) target = Ember.lookup;\n if (hasThis) path = path.slice(5);\n\n if (target === Ember.lookup) {\n key = firstKey(path);\n target = get(target, key);\n path = path.slice(key.length+1);\n }\n\n // must return some kind of path to be valid else other things will break.\n if (!path || path.length===0) throw new Error('Invalid Path');\n\n return [ target, path ];\n}\n\nfunction getPath(root, path) {\n var hasThis, parts, tuple, idx, len;\n\n // If there is no root and path is a key name, return that\n // property from the global object.\n // E.g. get('Ember') -> Ember\n if (root === null && path.indexOf('.') === -1) { return get(Ember.lookup, path); }\n\n // detect complicated paths and normalize them\n hasThis = HAS_THIS.test(path);\n\n if (!root || hasThis) {\n tuple = normalizeTuple(root, path);\n root = tuple[0];\n path = tuple[1];\n tuple.length = 0;\n }\n\n parts = path.split(\".\");\n len = parts.length;\n for (idx=0; root && idx<len; idx++) {\n root = get(root, parts[idx], true);\n if (root && root.isDestroyed) { return undefined; }\n }\n return root;\n}\n\nfunction setPath(root, path, value, tolerant) {\n var keyName;\n\n // get the last part of the path\n keyName = path.slice(path.lastIndexOf('.') + 1);\n\n // get the first part of the part\n path = path.slice(0, path.length-(keyName.length+1));\n\n // unless the path is this, look up the first part to\n // get the root\n if (path !== 'this') {\n root = getPath(root, path);\n }\n\n if (!keyName || keyName.length === 0) {\n throw new Error('You passed an empty path');\n }\n\n if (!root) {\n if (tolerant) { return; }\n else { throw new Error('Object in path '+path+' could not be found or was destroyed.'); }\n }\n\n return set(root, keyName, value);\n}\n\n/**\n @private\n\n Normalizes a target/path pair to reflect that actual target/path that should\n be observed, etc. This takes into account passing in global property\n paths (i.e. a path beginning with a captial letter not defined on the\n target) and * separators.\n\n @method normalizeTuple\n @for Ember\n @param {Object} target The current target. May be `null`.\n @param {String} path A path on the target or a global property path.\n @return {Array} a temporary array with the normalized target/path pair.\n*/\nEmber.normalizeTuple = function(target, path) {\n return normalizeTuple(target, path);\n};\n\nEmber.getWithDefault = function(root, key, defaultValue) {\n var value = get(root, key);\n\n if (value === undefined) { return defaultValue; }\n return value;\n};\n\n\nEmber.get = get;\nEmber.getPath = Ember.deprecateFunc('getPath is deprecated since get now supports paths', Ember.get);\n\nEmber.set = set;\nEmber.setPath = Ember.deprecateFunc('setPath is deprecated since set now supports paths', Ember.set);\n\n/**\n Error-tolerant form of `Ember.set`. Will not blow up if any part of the\n chain is `undefined`, `null`, or destroyed.\n\n This is primarily used when syncing bindings, which may try to update after\n an object has been destroyed.\n\n @method trySet\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} path The property path to set\n @param {Object} value The value to set\n*/\nEmber.trySet = function(root, path, value) {\n return set(root, path, value, true);\n};\nEmber.trySetPath = Ember.deprecateFunc('trySetPath has been renamed to trySet', Ember.trySet);\n\n/**\n Returns true if the provided path is global (e.g., `MyApp.fooController.bar`)\n instead of local (`foo.bar.baz`).\n\n @method isGlobalPath\n @for Ember\n @private\n @param {String} path\n @return Boolean\n*/\nEmber.isGlobalPath = function(path) {\n return IS_GLOBAL.test(path);\n};\n\n\n})();\n//@ sourceURL=ember-metal/accessors");minispade.register('ember-metal/array', "(function() {/*jshint newcap:false*/\nminispade.require('ember-metal/enumerable_utils');\n\n/**\n@module ember-metal\n*/\n\n// NOTE: There is a bug in jshint that doesn't recognize `Object()` without `new`\n// as being ok unless both `newcap:false` and not `use strict`.\n// https://github.com/jshint/jshint/issues/392\n\n// Testing this is not ideal, but we want to use native functions\n// if available, but not to use versions created by libraries like Prototype\nvar isNativeFunc = function(func) {\n // This should probably work in all browsers likely to have ES5 array methods\n return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1;\n};\n\n// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/map\nvar arrayMap = isNativeFunc(Array.prototype.map) ? Array.prototype.map : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var res = new Array(len);\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n res[i] = fun.call(thisp, t[i], i, t);\n }\n }\n\n return res;\n};\n\n// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach\nvar arrayForEach = isNativeFunc(Array.prototype.forEach) ? Array.prototype.forEach : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n fun.call(thisp, t[i], i, t);\n }\n }\n};\n\nvar arrayIndexOf = isNativeFunc(Array.prototype.indexOf) ? Array.prototype.indexOf : function (obj, fromIndex) {\n if (fromIndex === null || fromIndex === undefined) { fromIndex = 0; }\n else if (fromIndex < 0) { fromIndex = Math.max(0, this.length + fromIndex); }\n for (var i = fromIndex, j = this.length; i < j; i++) {\n if (this[i] === obj) { return i; }\n }\n return -1;\n};\n\nEmber.ArrayPolyfills = {\n map: arrayMap,\n forEach: arrayForEach,\n indexOf: arrayIndexOf\n};\n\nif (Ember.SHIM_ES5) {\n if (!Array.prototype.map) {\n Array.prototype.map = arrayMap;\n }\n\n if (!Array.prototype.forEach) {\n Array.prototype.forEach = arrayForEach;\n }\n\n if (!Array.prototype.indexOf) {\n Array.prototype.indexOf = arrayIndexOf;\n }\n}\n\n})();\n//@ sourceURL=ember-metal/array");minispade.register('ember-metal/binding', "(function() {minispade.require('ember-metal/core'); // Ember.Logger\nminispade.require('ember-metal/accessors'); // get, set, trySet\nminispade.require('ember-metal/utils'); // guidFor, isArray, meta\nminispade.require('ember-metal/observer'); // addObserver, removeObserver\nminispade.require('ember-metal/run_loop'); // Ember.run.schedule\nminispade.require('ember-metal/map');\n\n/**\n@module ember-metal\n*/\n\n// ..........................................................\n// CONSTANTS\n//\n\n/**\n Debug parameter you can turn on. This will log all bindings that fire to\n the console. This should be disabled in production code. Note that you\n can also enable this from the console or temporarily.\n\n @property LOG_BINDINGS\n @for Ember\n @type Boolean\n @default false\n*/\nEmber.LOG_BINDINGS = false || !!Ember.ENV.LOG_BINDINGS;\n\nvar get = Ember.get,\n set = Ember.set,\n guidFor = Ember.guidFor,\n isGlobalPath = Ember.isGlobalPath;\n\n\nfunction getWithGlobals(obj, path) {\n return get(isGlobalPath(path) ? Ember.lookup : obj, path);\n}\n\n// ..........................................................\n// BINDING\n//\n\nvar Binding = function(toPath, fromPath) {\n this._direction = 'fwd';\n this._from = fromPath;\n this._to = toPath;\n this._directionMap = Ember.Map.create();\n};\n\n/**\n@class Binding\n@namespace Ember\n*/\n\nBinding.prototype = {\n /**\n This copies the Binding so it can be connected to another object.\n\n @method copy\n @return {Ember.Binding}\n */\n copy: function () {\n var copy = new Binding(this._to, this._from);\n if (this._oneWay) { copy._oneWay = true; }\n return copy;\n },\n\n // ..........................................................\n // CONFIG\n //\n\n /**\n This will set `from` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method from\n @param {String} path the property path to connect to\n @return {Ember.Binding} `this`\n */\n from: function(path) {\n this._from = path;\n return this;\n },\n\n /**\n This will set the `to` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method to\n @param {String|Tuple} path A property path or tuple\n @return {Ember.Binding} `this`\n */\n to: function(path) {\n this._to = path;\n return this;\n },\n\n /**\n Configures the binding as one way. A one-way binding will relay changes\n on the `from` side to the `to` side, but not the other way around. This\n means that if you change the `to` side directly, the `from` side may have\n a different value.\n\n @method oneWay\n @return {Ember.Binding} `this`\n */\n oneWay: function() {\n this._oneWay = true;\n return this;\n },\n\n toString: function() {\n var oneWay = this._oneWay ? '[oneWay]' : '';\n return \"Ember.Binding<\" + guidFor(this) + \">(\" + this._from + \" -> \" + this._to + \")\" + oneWay;\n },\n\n // ..........................................................\n // CONNECT AND SYNC\n //\n\n /**\n Attempts to connect this binding instance so that it can receive and relay\n changes. This method will raise an exception if you have not set the\n from/to properties yet.\n\n @method connect\n @param {Object} obj The root object for this binding.\n @return {Ember.Binding} `this`\n */\n connect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);\n\n var fromPath = this._from, toPath = this._to;\n Ember.trySet(obj, toPath, getWithGlobals(obj, fromPath));\n\n // add an observer on the object to be notified when the binding should be updated\n Ember.addObserver(obj, fromPath, this, this.fromDidChange);\n\n // if the binding is a two-way binding, also set up an observer on the target\n if (!this._oneWay) { Ember.addObserver(obj, toPath, this, this.toDidChange); }\n\n this._readyToSync = true;\n\n return this;\n },\n\n /**\n Disconnects the binding instance. Changes will no longer be relayed. You\n will not usually need to call this method.\n\n @method disconnect\n @param {Object} obj The root object you passed when connecting the binding.\n @return {Ember.Binding} `this`\n */\n disconnect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);\n\n var twoWay = !this._oneWay;\n\n // remove an observer on the object so we're no longer notified of\n // changes that should update bindings.\n Ember.removeObserver(obj, this._from, this, this.fromDidChange);\n\n // if the binding is two-way, remove the observer from the target as well\n if (twoWay) { Ember.removeObserver(obj, this._to, this, this.toDidChange); }\n\n this._readyToSync = false; // disable scheduled syncs...\n return this;\n },\n\n // ..........................................................\n // PRIVATE\n //\n\n /* called when the from side changes */\n fromDidChange: function(target) {\n this._scheduleSync(target, 'fwd');\n },\n\n /* called when the to side changes */\n toDidChange: function(target) {\n this._scheduleSync(target, 'back');\n },\n\n _scheduleSync: function(obj, dir) {\n var directionMap = this._directionMap;\n var existingDir = directionMap.get(obj);\n\n // if we haven't scheduled the binding yet, schedule it\n if (!existingDir) {\n Ember.run.schedule('sync', this, this._sync, obj);\n directionMap.set(obj, dir);\n }\n\n // If both a 'back' and 'fwd' sync have been scheduled on the same object,\n // default to a 'fwd' sync so that it remains deterministic.\n if (existingDir === 'back' && dir === 'fwd') {\n directionMap.set(obj, 'fwd');\n }\n },\n\n _sync: function(obj) {\n var log = Ember.LOG_BINDINGS;\n\n // don't synchronize destroyed objects or disconnected bindings\n if (obj.isDestroyed || !this._readyToSync) { return; }\n\n // get the direction of the binding for the object we are\n // synchronizing from\n var directionMap = this._directionMap;\n var direction = directionMap.get(obj);\n\n var fromPath = this._from, toPath = this._to;\n\n directionMap.remove(obj);\n\n // if we're synchronizing from the remote object...\n if (direction === 'fwd') {\n var fromValue = getWithGlobals(obj, this._from);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '->', fromValue, obj);\n }\n if (this._oneWay) {\n Ember.trySet(obj, toPath, fromValue);\n } else {\n Ember._suspendObserver(obj, toPath, this, this.toDidChange, function () {\n Ember.trySet(obj, toPath, fromValue);\n });\n }\n // if we're synchronizing *to* the remote object\n } else if (direction === 'back') {\n var toValue = get(obj, this._to);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '<-', toValue, obj);\n }\n Ember._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {\n Ember.trySet(Ember.isGlobalPath(fromPath) ? Ember.lookup : obj, fromPath, toValue);\n });\n }\n }\n\n};\n\nfunction mixinProperties(to, from) {\n for (var key in from) {\n if (from.hasOwnProperty(key)) {\n to[key] = from[key];\n }\n }\n}\n\nmixinProperties(Binding, {\n\n /**\n See {{#crossLink \"Ember.Binding/from\"}}{{/crossLink}}\n\n @method from\n @static\n */\n from: function() {\n var C = this, binding = new C();\n return binding.from.apply(binding, arguments);\n },\n\n /**\n See {{#crossLink \"Ember.Binding/to\"}}{{/crossLink}}\n\n @method to\n @static\n */\n to: function() {\n var C = this, binding = new C();\n return binding.to.apply(binding, arguments);\n },\n\n /**\n Creates a new Binding instance and makes it apply in a single direction.\n A one-way binding will relay changes on the `from` side object (supplied\n as the `from` argument) the `to` side, but not the other way around.\n This means that if you change the \"to\" side directly, the \"from\" side may have\n a different value.\n\n See {{#crossLink \"Binding/oneWay\"}}{{/crossLink}}\n\n @method oneWay\n @param {String} from from path.\n @param {Boolean} [flag] (Optional) passing nothing here will make the\n binding `oneWay`. You can instead pass `false` to disable `oneWay`, making the\n binding two way again.\n */\n oneWay: function(from, flag) {\n var C = this, binding = new C(null, from);\n return binding.oneWay(flag);\n }\n\n});\n\n/**\n An `Ember.Binding` connects the properties of two objects so that whenever\n the value of one property changes, the other property will be changed also.\n\n ## Automatic Creation of Bindings with `/^*Binding/`-named Properties\n\n You do not usually create Binding objects directly but instead describe\n bindings in your class or object definition using automatic binding\n detection.\n\n Properties ending in a `Binding` suffix will be converted to `Ember.Binding`\n instances. The value of this property should be a string representing a path\n to another object or a custom binding instanced created using Binding helpers\n (see \"Customizing Your Bindings\"):\n\n ```\n valueBinding: \"MyApp.someController.title\"\n ```\n\n This will create a binding from `MyApp.someController.title` to the `value`\n property of your object instance automatically. Now the two values will be\n kept in sync.\n\n ## One Way Bindings\n\n One especially useful binding customization you can use is the `oneWay()`\n helper. This helper tells Ember that you are only interested in\n receiving changes on the object you are binding from. For example, if you\n are binding to a preference and you want to be notified if the preference\n has changed, but your object will not be changing the preference itself, you\n could do:\n\n ```\n bigTitlesBinding: Ember.Binding.oneWay(\"MyApp.preferencesController.bigTitles\")\n ```\n\n This way if the value of `MyApp.preferencesController.bigTitles` changes the\n `bigTitles` property of your object will change also. However, if you\n change the value of your `bigTitles` property, it will not update the\n `preferencesController`.\n\n One way bindings are almost twice as fast to setup and twice as fast to\n execute because the binding only has to worry about changes to one side.\n\n You should consider using one way bindings anytime you have an object that\n may be created frequently and you do not intend to change a property; only\n to monitor it for changes. (such as in the example above).\n\n ## Adding Bindings Manually\n\n All of the examples above show you how to configure a custom binding, but the\n result of these customizations will be a binding template, not a fully active\n Binding instance. The binding will actually become active only when you\n instantiate the object the binding belongs to. It is useful however, to\n understand what actually happens when the binding is activated.\n\n For a binding to function it must have at least a `from` property and a `to`\n property. The `from` property path points to the object/key that you want to\n bind from while the `to` path points to the object/key you want to bind to.\n\n When you define a custom binding, you are usually describing the property\n you want to bind from (such as `MyApp.someController.value` in the examples\n above). When your object is created, it will automatically assign the value\n you want to bind `to` based on the name of your binding key. In the\n examples above, during init, Ember objects will effectively call\n something like this on your binding:\n\n ```javascript\n binding = Ember.Binding.from(this.valueBinding).to(\"value\");\n ```\n\n This creates a new binding instance based on the template you provide, and\n sets the to path to the `value` property of the new object. Now that the\n binding is fully configured with a `from` and a `to`, it simply needs to be\n connected to become active. This is done through the `connect()` method:\n\n ```javascript\n binding.connect(this);\n ```\n\n Note that when you connect a binding you pass the object you want it to be\n connected to. This object will be used as the root for both the from and\n to side of the binding when inspecting relative paths. This allows the\n binding to be automatically inherited by subclassed objects as well.\n\n Now that the binding is connected, it will observe both the from and to side\n and relay changes.\n\n If you ever needed to do so (you almost never will, but it is useful to\n understand this anyway), you could manually create an active binding by\n using the `Ember.bind()` helper method. (This is the same method used by\n to setup your bindings on objects):\n\n ```javascript\n Ember.bind(MyApp.anotherObject, \"value\", \"MyApp.someController.value\");\n ```\n\n Both of these code fragments have the same effect as doing the most friendly\n form of binding creation like so:\n\n ```javascript\n MyApp.anotherObject = Ember.Object.create({\n valueBinding: \"MyApp.someController.value\",\n\n // OTHER CODE FOR THIS OBJECT...\n });\n ```\n\n Ember's built in binding creation method makes it easy to automatically\n create bindings for you. You should always use the highest-level APIs\n available, even if you understand how it works underneath.\n\n @class Binding\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Binding = Binding;\n\n\n/**\n Global helper method to create a new binding. Just pass the root object\n along with a `to` and `from` path to create and connect the binding.\n\n @method bind\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n*/\nEmber.bind = function(obj, to, from) {\n return new Ember.Binding(to, from).connect(obj);\n};\n\n/**\n @method oneWay\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n*/\nEmber.oneWay = function(obj, to, from) {\n return new Ember.Binding(to, from).oneWay().connect(obj);\n};\n\n})();\n//@ sourceURL=ember-metal/binding");minispade.register('ember-metal/computed', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/watching');\n\n/**\n@module ember-metal\n*/\n\nEmber.warn(\"The CP_DEFAULT_CACHEABLE flag has been removed and computed properties are always cached by default. Use `volatile` if you don't want caching.\", Ember.ENV.CP_DEFAULT_CACHEABLE !== false);\n\n\nvar get = Ember.get,\n set = Ember.set,\n metaFor = Ember.meta,\n a_slice = [].slice,\n o_create = Ember.create,\n META_KEY = Ember.META_KEY,\n watch = Ember.watch,\n unwatch = Ember.unwatch;\n\n// ..........................................................\n// DEPENDENT KEYS\n//\n\n// data structure:\n// meta.deps = {\n// 'depKey': {\n// 'keyName': count,\n// }\n// }\n\n/*\n This function returns a map of unique dependencies for a\n given object and key.\n*/\nfunction keysForDep(obj, depsMeta, depKey) {\n var keys = depsMeta[depKey];\n if (!keys) {\n // if there are no dependencies yet for a the given key\n // create a new empty list of dependencies for the key\n keys = depsMeta[depKey] = {};\n } else if (!depsMeta.hasOwnProperty(depKey)) {\n // otherwise if the dependency list is inherited from\n // a superclass, clone the hash\n keys = depsMeta[depKey] = o_create(keys);\n }\n return keys;\n}\n\nfunction metaForDeps(obj, meta) {\n return keysForDep(obj, meta, 'deps');\n}\n\nfunction addDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(obj, meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(obj, depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) + 1;\n // Watch the depKey\n watch(obj, depKey);\n }\n}\n\nfunction removeDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(obj, meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(obj, depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) - 1;\n // Watch the depKey\n unwatch(obj, depKey);\n }\n}\n\n// ..........................................................\n// COMPUTED PROPERTY\n//\n\n/**\n @class ComputedProperty\n @namespace Ember\n @extends Ember.Descriptor\n @constructor\n*/\nfunction ComputedProperty(func, opts) {\n this.func = func;\n\n this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;\n this._dependentKeys = opts && opts.dependentKeys;\n this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly);\n}\n\nEmber.ComputedProperty = ComputedProperty;\nComputedProperty.prototype = new Ember.Descriptor();\n\nvar ComputedPropertyPrototype = ComputedProperty.prototype;\n\n/**\n Call on a computed property to set it into cacheable mode. When in this\n mode the computed property will automatically cache the return value of\n your function until one of the dependent keys changes.\n\n ```javascript\n MyApp.president = Ember.Object.create({\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // After calculating the value of this function, Ember will\n // return that value without re-executing this function until\n // one of the dependent properties change.\n }.property('firstName', 'lastName')\n });\n ```\n\n Properties are cacheable by default.\n\n @method cacheable\n @param {Boolean} aFlag optional set to `false` to disable caching\n @chainable\n*/\nComputedPropertyPrototype.cacheable = function(aFlag) {\n this._cacheable = aFlag !== false;\n return this;\n};\n\n/**\n Call on a computed property to set it into non-cached mode. When in this\n mode the computed property will not automatically cache the return value.\n\n ```javascript\n MyApp.outsideService = Ember.Object.create({\n value: function() {\n return OutsideService.getValue();\n }.property().volatile()\n });\n ```\n\n @method volatile\n @chainable\n*/\nComputedPropertyPrototype.volatile = function() {\n return this.cacheable(false);\n};\n\n/**\n Call on a computed property to set it into read-only mode. When in this\n mode the computed property will throw an error when set.\n\n ```javascript\n MyApp.person = Ember.Object.create({\n guid: function() {\n return 'guid-guid-guid';\n }.property().readOnly()\n });\n\n MyApp.person.set('guid', 'new-guid'); // will throw an exception\n ```\n\n @method readOnly\n @chainable\n*/\nComputedPropertyPrototype.readOnly = function(readOnly) {\n this._readOnly = readOnly === undefined || !!readOnly;\n return this;\n};\n\n/**\n Sets the dependent keys on this computed property. Pass any number of\n arguments containing key paths that this computed property depends on.\n\n ```javascript\n MyApp.president = Ember.Object.create({\n fullName: Ember.computed(function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember that this computed property depends on firstName\n // and lastName\n }).property('firstName', 'lastName')\n });\n ```\n\n @method property\n @param {String} path* zero or more property paths\n @chainable\n*/\nComputedPropertyPrototype.property = function() {\n var args = [];\n for (var i = 0, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n this._dependentKeys = args;\n return this;\n};\n\n/**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For example,\n computed property functions may close over variables that are then no longer\n available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n The hash that you pass to the `meta()` function will be saved on the\n computed property descriptor under the `_meta` key. Ember runtime\n exposes a public API for retrieving these values from classes,\n via the `metaForProperty()` function.\n\n @method meta\n @param {Hash} meta\n @chainable\n*/\n\nComputedPropertyPrototype.meta = function(meta) {\n if (arguments.length === 0) {\n return this._meta || {};\n } else {\n this._meta = meta;\n return this;\n }\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.willWatch = function(obj, keyName) {\n // watch already creates meta for this instance\n var meta = obj[META_KEY];\n Ember.assert('watch should have setup meta to be writable', meta.source === obj);\n if (!(keyName in meta.cache)) {\n addDependentKeys(this, obj, keyName, meta);\n }\n};\n\nComputedPropertyPrototype.didUnwatch = function(obj, keyName) {\n var meta = obj[META_KEY];\n Ember.assert('unwatch should have setup meta to be writable', meta.source === obj);\n if (!(keyName in meta.cache)) {\n // unwatch already creates meta for this instance\n removeDependentKeys(this, obj, keyName, meta);\n }\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.didChange = function(obj, keyName) {\n // _suspended is set via a CP.set to ensure we don't clear\n // the cached value set by the setter\n if (this._cacheable && this._suspended !== obj) {\n var meta = metaFor(obj);\n if (keyName in meta.cache) {\n delete meta.cache[keyName];\n if (!meta.watching[keyName]) {\n removeDependentKeys(this, obj, keyName, meta);\n }\n }\n }\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.get = function(obj, keyName) {\n var ret, cache, meta;\n if (this._cacheable) {\n meta = metaFor(obj);\n cache = meta.cache;\n if (keyName in cache) { return cache[keyName]; }\n ret = cache[keyName] = this.func.call(obj, keyName);\n if (!meta.watching[keyName]) {\n addDependentKeys(this, obj, keyName, meta);\n }\n } else {\n ret = this.func.call(obj, keyName);\n }\n return ret;\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.set = function(obj, keyName, value) {\n var cacheable = this._cacheable,\n func = this.func,\n meta = metaFor(obj, cacheable),\n watched = meta.watching[keyName],\n oldSuspended = this._suspended,\n hadCachedValue = false,\n cache = meta.cache,\n cachedValue, ret;\n\n if (this._readOnly) {\n throw new Error('Cannot Set: ' + keyName + ' on: ' + obj.toString() );\n }\n\n this._suspended = obj;\n\n try {\n\n if (cacheable && cache.hasOwnProperty(keyName)) {\n cachedValue = cache[keyName];\n hadCachedValue = true;\n }\n\n // Check if the CP has been wrapped\n if (func.wrappedFunction) { func = func.wrappedFunction; }\n\n // For backwards-compatibility with computed properties\n // that check for arguments.length === 2 to determine if\n // they are being get or set, only pass the old cached\n // value if the computed property opts into a third\n // argument.\n if (func.length === 3) {\n ret = func.call(obj, keyName, value, cachedValue);\n } else if (func.length === 2) {\n ret = func.call(obj, keyName, value);\n } else {\n Ember.defineProperty(obj, keyName, null, cachedValue);\n Ember.set(obj, keyName, value);\n return;\n }\n\n if (hadCachedValue && cachedValue === ret) { return; }\n\n if (watched) { Ember.propertyWillChange(obj, keyName); }\n\n if (hadCachedValue) {\n delete cache[keyName];\n }\n\n if (cacheable) {\n if (!watched && !hadCachedValue) {\n addDependentKeys(this, obj, keyName, meta);\n }\n cache[keyName] = ret;\n }\n\n if (watched) { Ember.propertyDidChange(obj, keyName); }\n } finally {\n this._suspended = oldSuspended;\n }\n return ret;\n};\n\n/* called when property is defined */\nComputedPropertyPrototype.setup = function(obj, keyName) {\n var meta = obj[META_KEY];\n if (meta && meta.watching[keyName]) {\n addDependentKeys(this, obj, keyName, metaFor(obj));\n }\n};\n\n/* called before property is overridden */\nComputedPropertyPrototype.teardown = function(obj, keyName) {\n var meta = metaFor(obj);\n\n if (meta.watching[keyName] || keyName in meta.cache) {\n removeDependentKeys(this, obj, keyName, meta);\n }\n\n if (this._cacheable) { delete meta.cache[keyName]; }\n\n return null; // no value to restore\n};\n\n\n/**\n This helper returns a new property descriptor that wraps the passed\n computed property function. You can use this helper to define properties\n with mixins or via `Ember.defineProperty()`.\n\n The function you pass will be used to both get and set property values.\n The function should accept two parameters, key and value. If value is not\n undefined you should set the value first. In either case return the\n current value of the property.\n\n @method computed\n @for Ember\n @param {Function} func The computed property function.\n @return {Ember.ComputedProperty} property descriptor instance\n*/\nEmber.computed = function(func) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n func = a_slice.call(arguments, -1)[0];\n }\n\n if ( typeof func !== \"function\" ) {\n throw new Error(\"Computed Property declared without a property function\");\n }\n\n var cp = new ComputedProperty(func);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n};\n\n/**\n Returns the cached value for a property, if one exists.\n This can be useful for peeking at the value of a computed\n property that is generated lazily, without accidentally causing\n it to be created.\n\n @method cacheFor\n @for Ember\n @param {Object} obj the object whose property you want to check\n @param {String} key the name of the property whose cached value you want\n to return\n*/\nEmber.cacheFor = function cacheFor(obj, key) {\n var cache = metaFor(obj, false).cache;\n\n if (cache && key in cache) {\n return cache[key];\n }\n};\n\n/**\n @method computed.not\n @for Ember\n @param {String} dependentKey\n*/\nEmber.computed.not = function(dependentKey) {\n return Ember.computed(dependentKey, function(key) {\n return !get(this, dependentKey);\n });\n};\n\n/**\n @method computed.none\n @for Ember\n @param {String} dependentKey\n*/\nEmber.computed.none = function(dependentKey) {\n return Ember.computed(dependentKey, function(key) {\n var val = get(this, dependentKey);\n return Ember.isNone(val);\n });\n};\n\n/**\n @method computed.empty\n @for Ember\n @param {String} dependentKey\n*/\nEmber.computed.empty = function(dependentKey) {\n return Ember.computed(dependentKey, function(key) {\n var val = get(this, dependentKey);\n return Ember.isEmpty(val);\n });\n};\n\n/**\n @method computed.bool\n @for Ember\n @param {String} dependentKey\n*/\nEmber.computed.bool = function(dependentKey) {\n return Ember.computed(dependentKey, function(key) {\n return !!get(this, dependentKey);\n });\n};\n\n/**\n @method computed.alias\n @for Ember\n\n @param {String} dependentKey\n*/\nEmber.computed.alias = function(dependentKey) {\n return Ember.computed(dependentKey, function(key, value){\n if (arguments.length > 1) {\n set(this, dependentKey, value);\n return value;\n } else {\n return get(this, dependentKey);\n }\n });\n};\n\n})();\n//@ sourceURL=ember-metal/computed");minispade.register('ember-metal/core', "(function() {/*globals Em:true ENV */\n\n/**\n@module ember\n@submodule ember-metal\n*/\n\n/**\n All Ember methods and functions are defined inside of this namespace. You\n generally should not add new properties to this namespace as it may be\n overwritten by future versions of Ember.\n\n You can also use the shorthand `Em` instead of `Ember`.\n\n Ember-Runtime is a framework that provides core functions for Ember including\n cross-platform functions, support for property observing and objects. Its\n focus is on small size and performance. You can use this in place of or\n along-side other cross-platform libraries such as jQuery.\n\n The core Runtime framework is based on the jQuery API with a number of\n performance optimizations.\n\n @class Ember\n @static\n @version 1.0.0-rc.1\n*/\n\nif ('undefined' === typeof Ember) {\n // Create core object. Make it act like an instance of Ember.Namespace so that\n // objects assigned to it are given a sane string representation.\n Ember = {};\n}\n\n// Default imports, exports and lookup to the global object;\nvar imports = Ember.imports = Ember.imports || this;\nvar exports = Ember.exports = Ember.exports || this;\nvar lookup = Ember.lookup = Ember.lookup || this;\n\n// aliases needed to keep minifiers from removing the global context\nexports.Em = exports.Ember = Em = Ember;\n\n// Make sure these are set whether Ember was already defined or not\n\nEmber.isNamespace = true;\n\nEmber.toString = function() { return \"Ember\"; };\n\n\n/**\n @property VERSION\n @type String\n @default '1.0.0-rc.1'\n @final\n*/\nEmber.VERSION = '1.0.0-rc.1';\n\n/**\n Standard environmental variables. You can define these in a global `ENV`\n variable before loading Ember to control various configuration\n settings.\n\n @property ENV\n @type Hash\n*/\nEmber.ENV = Ember.ENV || ('undefined' === typeof ENV ? {} : ENV);\n\nEmber.config = Ember.config || {};\n\n// ..........................................................\n// BOOTSTRAP\n//\n\n/**\n Determines whether Ember should enhances some built-in object prototypes to\n provide a more friendly API. If enabled, a few methods will be added to\n `Function`, `String`, and `Array`. `Object.prototype` will not be enhanced,\n which is the one that causes most trouble for people.\n\n In general we recommend leaving this option set to true since it rarely\n conflicts with other code. If you need to turn it off however, you can\n define an `ENV.EXTEND_PROTOTYPES` config to disable it.\n\n @property EXTEND_PROTOTYPES\n @type Boolean\n @default true\n*/\nEmber.EXTEND_PROTOTYPES = Ember.ENV.EXTEND_PROTOTYPES;\n\nif (typeof Ember.EXTEND_PROTOTYPES === 'undefined') {\n Ember.EXTEND_PROTOTYPES = true;\n}\n\n/**\n Determines whether Ember logs a full stack trace during deprecation warnings\n\n @property LOG_STACKTRACE_ON_DEPRECATION\n @type Boolean\n @default true\n*/\nEmber.LOG_STACKTRACE_ON_DEPRECATION = (Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== false);\n\n/**\n Determines whether Ember should add ECMAScript 5 shims to older browsers.\n\n @property SHIM_ES5\n @type Boolean\n @default Ember.EXTEND_PROTOTYPES\n*/\nEmber.SHIM_ES5 = (Ember.ENV.SHIM_ES5 === false) ? false : Ember.EXTEND_PROTOTYPES;\n\n/**\n Determines whether Ember logs info about version of used libraries\n\n @property LOG_VERSION\n @type Boolean\n @default true\n*/\nEmber.LOG_VERSION = (Ember.ENV.LOG_VERSION === false) ? false : true;\n\n/**\n Empty function. Useful for some operations.\n\n @method K\n @private\n @return {Object}\n*/\nEmber.K = function() { return this; };\n\n\n// Stub out the methods defined by the ember-debug package in case it's not loaded\n\nif ('undefined' === typeof Ember.assert) { Ember.assert = Ember.K; }\nif ('undefined' === typeof Ember.warn) { Ember.warn = Ember.K; }\nif ('undefined' === typeof Ember.debug) { Ember.debug = Ember.K; }\nif ('undefined' === typeof Ember.deprecate) { Ember.deprecate = Ember.K; }\nif ('undefined' === typeof Ember.deprecateFunc) {\n Ember.deprecateFunc = function(_, func) { return func; };\n}\n\n/**\n Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from\n jQuery master. We'll just bootstrap our own uuid now.\n\n @property uuid\n @type Number\n @private\n*/\nEmber.uuid = 0;\n\n// ..........................................................\n// LOGGER\n//\n\nfunction consoleMethod(name) {\n if (imports.console && imports.console[name]) {\n // Older IE doesn't support apply, but Chrome needs it\n if (imports.console[name].apply) {\n return function() {\n imports.console[name].apply(imports.console, arguments);\n };\n } else {\n return function() {\n var message = Array.prototype.join.call(arguments, ', ');\n imports.console[name](message);\n };\n }\n }\n}\n\n/**\n Inside Ember-Metal, simply uses the methods from `imports.console`.\n Override this to provide more robust logging functionality.\n\n @class Logger\n @namespace Ember\n*/\nEmber.Logger = {\n log: consoleMethod('log') || Ember.K,\n warn: consoleMethod('warn') || Ember.K,\n error: consoleMethod('error') || Ember.K,\n info: consoleMethod('info') || Ember.K,\n debug: consoleMethod('debug') || consoleMethod('info') || Ember.K\n};\n\n\n// ..........................................................\n// ERROR HANDLING\n//\n\n/**\n A function may be assigned to `Ember.onerror` to be called when Ember\n internals encounter an error. This is useful for specialized error handling\n and reporting code.\n\n @event onerror\n @for Ember\n @param {Exception} error the error object\n*/\nEmber.onerror = null;\n\n/**\n @private\n\n Wrap code block in a try/catch if {{#crossLink \"Ember/onerror\"}}{{/crossLink}} is set.\n\n @method handleErrors\n @for Ember\n @param {Function} func\n @param [context]\n*/\nEmber.handleErrors = function(func, context) {\n // Unfortunately in some browsers we lose the backtrace if we rethrow the existing error,\n // so in the event that we don't have an `onerror` handler we don't wrap in a try/catch\n if ('function' === typeof Ember.onerror) {\n try {\n return func.call(context || this);\n } catch (error) {\n Ember.onerror(error);\n }\n } else {\n return func.call(context || this);\n }\n};\n\nEmber.merge = function(original, updates) {\n for (var prop in updates) {\n if (!updates.hasOwnProperty(prop)) { continue; }\n original[prop] = updates[prop];\n }\n return original;\n};\n\n/**\n Returns true if the passed value is null or undefined. This avoids errors\n from JSLint complaining about use of ==, which can be technically\n confusing.\n\n ```javascript\n Ember.isNone(); // true\n Ember.isNone(null); // true\n Ember.isNone(undefined); // true\n Ember.isNone(''); // false\n Ember.isNone([]); // false\n Ember.isNone(function(){}); // false\n ```\n\n @method isNone\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n*/\nEmber.isNone = function(obj) {\n return obj === null || obj === undefined;\n};\nEmber.none = Ember.deprecateFunc(\"Ember.none is deprecated. Please use Ember.isNone instead.\", Ember.isNone);\n\n/**\n Verifies that a value is `null` or an empty string, empty array,\n or empty function.\n\n Constrains the rules on `Ember.isNone` by returning false for empty\n string and empty arrays.\n\n ```javascript\n Ember.isEmpty(); // true\n Ember.isEmpty(null); // true\n Ember.isEmpty(undefined); // true\n Ember.isEmpty(''); // true\n Ember.isEmpty([]); // true\n Ember.isEmpty('Adam Hawkins'); // false\n Ember.isEmpty([0,1,2]); // false\n ```\n\n @method isEmpty\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n*/\nEmber.isEmpty = function(obj) {\n return obj === null || obj === undefined || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);\n};\nEmber.empty = Ember.deprecateFunc(\"Ember.empty is deprecated. Please use Ember.isEmpty instead.\", Ember.isEmpty) ;\n\n\n})();\n//@ sourceURL=ember-metal/core");minispade.register('ember-metal/enumerable_utils', "(function() {var utils = Ember.EnumerableUtils = {\n map: function(obj, callback, thisArg) {\n return obj.map ? obj.map.call(obj, callback, thisArg) : Array.prototype.map.call(obj, callback, thisArg);\n },\n\n forEach: function(obj, callback, thisArg) {\n return obj.forEach ? obj.forEach.call(obj, callback, thisArg) : Array.prototype.forEach.call(obj, callback, thisArg);\n },\n\n indexOf: function(obj, element, index) {\n return obj.indexOf ? obj.indexOf.call(obj, element, index) : Array.prototype.indexOf.call(obj, element, index);\n },\n\n indexesOf: function(obj, elements) {\n return elements === undefined ? [] : utils.map(elements, function(item) {\n return utils.indexOf(obj, item);\n });\n },\n\n addObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index === -1) { array.push(item); }\n },\n\n removeObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index !== -1) { array.splice(index, 1); }\n },\n\n replace: function(array, idx, amt, objects) {\n if (array.replace) {\n return array.replace(idx, amt, objects);\n } else {\n var args = Array.prototype.concat.apply([idx, amt], objects);\n return array.splice.apply(array, args);\n }\n },\n\n intersection: function(array1, array2) {\n var intersection = [];\n\n array1.forEach(function(element) {\n if (array2.indexOf(element) >= 0) {\n intersection.push(element);\n }\n });\n\n return intersection;\n }\n};\n\n})();\n//@ sourceURL=ember-metal/enumerable_utils");minispade.register('ember-metal/events', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\n\n/**\n@module ember-metal\n*/\n\nvar o_create = Ember.create,\n metaFor = Ember.meta,\n META_KEY = Ember.META_KEY;\n\n/*\n The event system uses a series of nested hashes to store listeners on an\n object. When a listener is registered, or when an event arrives, these\n hashes are consulted to determine which target and action pair to invoke.\n\n The hashes are stored in the object's meta hash, and look like this:\n\n // Object's meta hash\n {\n listeners: { // variable name: `listenerSet`\n \"foo:changed\": [ // variable name: `actions`\n [target, method, onceFlag, suspendedFlag]\n ]\n }\n }\n\n*/\n\nfunction indexOf(array, target, method) {\n var index = -1;\n for (var i = 0, l = array.length; i < l; i++) {\n if (target === array[i][0] && method === array[i][1]) { index = i; break; }\n }\n return index;\n}\n\nfunction actionsFor(obj, eventName) {\n var meta = metaFor(obj, true),\n actions;\n\n if (!meta.listeners) { meta.listeners = {}; }\n\n if (!meta.hasOwnProperty('listeners')) {\n // setup inherited copy of the listeners object\n meta.listeners = o_create(meta.listeners);\n }\n\n actions = meta.listeners[eventName];\n\n // if there are actions, but the eventName doesn't exist in our listeners, then copy them from the prototype\n if (actions && !meta.listeners.hasOwnProperty(eventName)) {\n actions = meta.listeners[eventName] = meta.listeners[eventName].slice();\n } else if (!actions) {\n actions = meta.listeners[eventName] = [];\n }\n\n return actions;\n}\n\nfunction actionsUnion(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 1; i >= 0; i--) {\n var target = actions[i][0],\n method = actions[i][1],\n once = actions[i][2],\n suspended = actions[i][3],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex === -1) {\n otherActions.push([target, method, once, suspended]);\n }\n }\n}\n\nfunction actionsDiff(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName],\n diffActions = [];\n\n if (!actions) { return; }\n for (var i = actions.length - 1; i >= 0; i--) {\n var target = actions[i][0],\n method = actions[i][1],\n once = actions[i][2],\n suspended = actions[i][3],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex !== -1) { continue; }\n\n otherActions.push([target, method, once, suspended]);\n diffActions.push([target, method, once, suspended]);\n }\n\n return diffActions;\n}\n\n/**\n Add an event listener\n\n @method addListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Boolean} once A flag whether a function should only be called once\n*/\nfunction addListener(obj, eventName, target, method, once) {\n Ember.assert(\"You must pass at least an object and event name to Ember.addListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) { return; }\n\n actions.push([target, method, once, undefined]);\n\n if ('function' === typeof obj.didAddListener) {\n obj.didAddListener(eventName, target, method);\n }\n}\n\n/**\n Remove an event listener\n\n Arguments should match those passed to {{#crossLink \"Ember/addListener\"}}{{/crossLink}}\n\n @method removeListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n*/\nfunction removeListener(obj, eventName, target, method) {\n Ember.assert(\"You must pass at least an object and event name to Ember.removeListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n function _removeListener(target, method, once) {\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n // action doesn't exist, give up silently\n if (actionIndex === -1) { return; }\n\n actions.splice(actionIndex, 1);\n\n if ('function' === typeof obj.didRemoveListener) {\n obj.didRemoveListener(eventName, target, method);\n }\n }\n\n if (method) {\n _removeListener(target, method);\n } else {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 1; i >= 0; i--) {\n _removeListener(actions[i][0], actions[i][1]);\n }\n }\n}\n\n/**\n @private\n\n Suspend listener during callback.\n\n This should only be used by the target of the event listener\n when it is taking an action that would cause the event, e.g.\n an object might suspend its property change listener while it is\n setting that property.\n\n @method suspendListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n*/\nfunction suspendListener(obj, eventName, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method),\n action;\n\n if (actionIndex !== -1) {\n action = actions[actionIndex].slice(); // copy it, otherwise we're modifying a shared object\n action[3] = true; // mark the action as suspended\n actions[actionIndex] = action; // replace the shared object with our copy\n }\n\n function tryable() { return callback.call(target); }\n function finalizer() { if (action) { action[3] = undefined; } }\n\n return Ember.tryFinally(tryable, finalizer);\n}\n\n/**\n @private\n\n Suspend listener during callback.\n\n This should only be used by the target of the event listener\n when it is taking an action that would cause the event, e.g.\n an object might suspend its property change listener while it is\n setting that property.\n\n @method suspendListener\n @for Ember\n @param obj\n @param {Array} eventName Array of event names\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n*/\nfunction suspendListeners(obj, eventNames, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var suspendedActions = [],\n eventName, actions, action, i, l;\n\n for (i=0, l=eventNames.length; i<l; i++) {\n eventName = eventNames[i];\n actions = actionsFor(obj, eventName);\n var actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n action = actions[actionIndex].slice();\n action[3] = true;\n actions[actionIndex] = action;\n suspendedActions.push(action);\n }\n }\n\n function tryable() { return callback.call(target); }\n\n function finalizer() {\n for (i = 0, l = suspendedActions.length; i < l; i++) {\n suspendedActions[i][3] = undefined;\n }\n }\n\n return Ember.tryFinally(tryable, finalizer);\n}\n\n/**\n @private\n\n Return a list of currently watched events\n\n @method watchedEvents\n @for Ember\n @param obj\n*/\nfunction watchedEvents(obj) {\n var listeners = obj[META_KEY].listeners, ret = [];\n\n if (listeners) {\n for(var eventName in listeners) {\n if (listeners[eventName]) { ret.push(eventName); }\n }\n }\n return ret;\n}\n\n/**\n @method sendEvent\n @for Ember\n @param obj\n @param {String} eventName\n @param {Array} params\n @param {Array} actions\n @return true\n*/\nfunction sendEvent(obj, eventName, params, actions) {\n // first give object a chance to handle it\n if (obj !== Ember && 'function' === typeof obj.sendEvent) {\n obj.sendEvent(eventName, params);\n }\n\n if (!actions) {\n var meta = obj[META_KEY];\n actions = meta && meta.listeners && meta.listeners[eventName];\n }\n\n if (!actions) { return; }\n\n for (var i = actions.length - 1; i >= 0; i--) { // looping in reverse for once listeners\n if (!actions[i] || actions[i][3] === true) { continue; }\n\n var target = actions[i][0],\n method = actions[i][1],\n once = actions[i][2];\n\n if (once) { removeListener(obj, eventName, target, method); }\n if (!target) { target = obj; }\n if ('string' === typeof method) { method = target[method]; }\n if (params) {\n method.apply(target, params);\n } else {\n method.call(target);\n }\n }\n return true;\n}\n\n/**\n @private\n @method hasListeners\n @for Ember\n @param obj\n @param {String} eventName\n*/\nfunction hasListeners(obj, eventName) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n return !!(actions && actions.length);\n}\n\n/**\n @private\n @method listenersFor\n @for Ember\n @param obj\n @param {String} eventName\n*/\nfunction listenersFor(obj, eventName) {\n var ret = [];\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return ret; }\n\n for (var i = 0, l = actions.length; i < l; i++) {\n var target = actions[i][0],\n method = actions[i][1];\n ret.push([target, method]);\n }\n\n return ret;\n}\n\nEmber.addListener = addListener;\nEmber.removeListener = removeListener;\nEmber._suspendListener = suspendListener;\nEmber._suspendListeners = suspendListeners;\nEmber.sendEvent = sendEvent;\nEmber.hasListeners = hasListeners;\nEmber.watchedEvents = watchedEvents;\nEmber.listenersFor = listenersFor;\nEmber.listenersDiff = actionsDiff;\nEmber.listenersUnion = actionsUnion;\n\n})();\n//@ sourceURL=ember-metal/events");minispade.register('ember-metal/instrumentation', "(function() {minispade.require('ember-metal/utils'); // Ember.tryCatchFinally\n\n/**\n The purpose of the Ember Instrumentation module is\n to provide efficient, general-purpose instrumentation\n for Ember.\n\n Subscribe to a listener by using `Ember.subscribe`:\n\n ```javascript\n Ember.subscribe(\"render\", {\n before: function(name, timestamp, payload) {\n\n },\n\n after: function(name, timestamp, payload) {\n\n }\n });\n ```\n\n If you return a value from the `before` callback, that same\n value will be passed as a fourth parameter to the `after`\n callback.\n\n Instrument a block of code by using `Ember.instrument`:\n\n ```javascript\n Ember.instrument(\"render.handlebars\", payload, function() {\n // rendering logic\n }, binding);\n ```\n\n Event names passed to `Ember.instrument` are namespaced\n by periods, from more general to more specific. Subscribers\n can listen for events by whatever level of granularity they\n are interested in.\n\n In the above example, the event is `render.handlebars`,\n and the subscriber listened for all events beginning with\n `render`. It would receive callbacks for events named\n `render`, `render.handlebars`, `render.container`, or\n even `render.handlebars.layout`.\n\n @class Instrumentation\n @namespace Ember\n @static\n*/\nEmber.Instrumentation = {};\n\nvar subscribers = [], cache = {};\n\nvar populateListeners = function(name) {\n var listeners = [], subscriber;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n subscriber = subscribers[i];\n if (subscriber.regex.test(name)) {\n listeners.push(subscriber.object);\n }\n }\n\n cache[name] = listeners;\n return listeners;\n};\n\nvar time = (function() {\n\tvar perf = 'undefined' !== typeof window ? window.performance || {} : {};\n\tvar fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow;\n\t// fn.bind will be available in all the browsers that support the advanced window.performance... ;-)\n\treturn fn ? fn.bind(perf) : function() { return +new Date(); };\n})();\n\n\nEmber.Instrumentation.instrument = function(name, payload, callback, binding) {\n var listeners = cache[name], timeName, ret;\n\n if (Ember.STRUCTURED_PROFILE) {\n timeName = name + \": \" + payload.object;\n console.time(timeName);\n }\n\n if (!listeners) {\n listeners = populateListeners(name);\n }\n\n if (listeners.length === 0) {\n ret = callback.call(binding);\n if (Ember.STRUCTURED_PROFILE) { console.timeEnd(timeName); }\n return ret;\n }\n\n var beforeValues = [], listener, i, l;\n\n function tryable(){\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n }\n\n function catchable(e){\n payload = payload || {};\n payload.exception = e;\n }\n\n function finalizer() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n\n if (Ember.STRUCTURED_PROFILE) {\n console.timeEnd(timeName);\n }\n }\n\n return Ember.tryCatchFinally(tryable, catchable, finalizer);\n};\n\nEmber.Instrumentation.subscribe = function(pattern, object) {\n var paths = pattern.split(\".\"), path, regex = [];\n\n for (var i=0, l=paths.length; i<l; i++) {\n path = paths[i];\n if (path === \"*\") {\n regex.push(\"[^\\\\.]*\");\n } else {\n regex.push(path);\n }\n }\n\n regex = regex.join(\"\\\\.\");\n regex = regex + \"(\\\\..*)?\";\n\n var subscriber = {\n pattern: pattern,\n regex: new RegExp(\"^\" + regex + \"$\"),\n object: object\n };\n\n subscribers.push(subscriber);\n cache = {};\n\n return subscriber;\n};\n\nEmber.Instrumentation.unsubscribe = function(subscriber) {\n var index;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n if (subscribers[i] === subscriber) {\n index = i;\n }\n }\n\n subscribers.splice(index, 1);\n cache = {};\n};\n\nEmber.Instrumentation.reset = function() {\n subscribers = [];\n cache = {};\n};\n\nEmber.instrument = Ember.Instrumentation.instrument;\nEmber.subscribe = Ember.Instrumentation.subscribe;\n\n})();\n//@ sourceURL=ember-metal/instrumentation");minispade.register('ember-metal', "(function() {/**\nEmber Metal\n\n@module ember\n@submodule ember-metal\n*/\nminispade.require('ember-metal/core');\nminispade.require('ember-metal/instrumentation');\nminispade.require('ember-metal/map');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/accessors');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/computed');\nminispade.require('ember-metal/watching');\nminispade.require('ember-metal/events');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/mixin');\nminispade.require('ember-metal/binding');\nminispade.require('ember-metal/run_loop');\n\n})();\n//@ sourceURL=ember-metal");minispade.register('ember-metal/map', "(function() {/**\n@module ember-metal\n*/\n\n/*\n JavaScript (before ES6) does not have a Map implementation. Objects,\n which are often used as dictionaries, may only have Strings as keys.\n\n Because Ember has a way to get a unique identifier for every object\n via `Ember.guidFor`, we can implement a performant Map with arbitrary\n keys. Because it is commonly used in low-level bookkeeping, Map is\n implemented as a pure JavaScript object for performance.\n\n This implementation follows the current iteration of the ES6 proposal for\n maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),\n with two exceptions. First, because we need our implementation to be pleasant\n on older browsers, we do not use the `delete` name (using `remove` instead).\n Second, as we do not have the luxury of in-VM iteration, we implement a\n forEach method for iteration.\n\n Map is mocked out to look like an Ember object, so you can do\n `Ember.Map.create()` for symmetry with other Ember classes.\n*/\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/core');\n\nvar guidFor = Ember.guidFor,\n indexOf = Ember.ArrayPolyfills.indexOf;\n\nvar copy = function(obj) {\n var output = {};\n\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) { output[prop] = obj[prop]; }\n }\n\n return output;\n};\n\nvar copyMap = function(original, newObject) {\n var keys = original.keys.copy(),\n values = copy(original.values);\n\n newObject.keys = keys;\n newObject.values = values;\n\n return newObject;\n};\n\n/**\n This class is used internally by Ember and Ember Data.\n Please do not use it at this time. We plan to clean it up\n and add many tests soon.\n\n @class OrderedSet\n @namespace Ember\n @constructor\n @private\n*/\nvar OrderedSet = Ember.OrderedSet = function() {\n this.clear();\n};\n\n/**\n @method create\n @static\n @return {Ember.OrderedSet}\n*/\nOrderedSet.create = function() {\n return new OrderedSet();\n};\n\n\nOrderedSet.prototype = {\n /**\n @method clear\n */\n clear: function() {\n this.presenceSet = {};\n this.list = [];\n },\n\n /**\n @method add\n @param obj\n */\n add: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n if (guid in presenceSet) { return; }\n\n presenceSet[guid] = true;\n list.push(obj);\n },\n\n /**\n @method remove\n @param obj\n */\n remove: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n delete presenceSet[guid];\n\n var index = indexOf.call(list, obj);\n if (index > -1) {\n list.splice(index, 1);\n }\n },\n\n /**\n @method isEmpty\n @return {Boolean}\n */\n isEmpty: function() {\n return this.list.length === 0;\n },\n\n /**\n @method has\n @param obj\n @return {Boolean}\n */\n has: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet;\n\n return guid in presenceSet;\n },\n\n /**\n @method forEach\n @param {Function} fn\n @param self\n */\n forEach: function(fn, self) {\n // allow mutation during iteration\n var list = this.list.slice();\n\n for (var i = 0, j = list.length; i < j; i++) {\n fn.call(self, list[i]);\n }\n },\n\n /**\n @method toArray\n @return {Array}\n */\n toArray: function() {\n return this.list.slice();\n },\n\n /**\n @method copy\n @return {Ember.OrderedSet}\n */\n copy: function() {\n var set = new OrderedSet();\n\n set.presenceSet = copy(this.presenceSet);\n set.list = this.list.slice();\n\n return set;\n }\n};\n\n/**\n A Map stores values indexed by keys. Unlike JavaScript's\n default Objects, the keys of a Map can be any JavaScript\n object.\n\n Internally, a Map has two data structures:\n\n 1. `keys`: an OrderedSet of all of the existing keys\n 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)`\n\n When a key/value pair is added for the first time, we\n add the key to the `keys` OrderedSet, and create or\n replace an entry in `values`. When an entry is deleted,\n we delete its entry in `keys` and `values`.\n\n @class Map\n @namespace Ember\n @private\n @constructor\n*/\nvar Map = Ember.Map = function() {\n this.keys = Ember.OrderedSet.create();\n this.values = {};\n};\n\n/**\n @method create\n @static\n*/\nMap.create = function() {\n return new Map();\n};\n\nMap.prototype = {\n /**\n Retrieve the value associated with a given key.\n\n @method get\n @param {anything} key\n @return {anything} the value associated with the key, or `undefined`\n */\n get: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values[guid];\n },\n\n /**\n Adds a value to the map. If a value for the given key has already been\n provided, the new value will replace the old value.\n\n @method set\n @param {anything} key\n @param {anything} value\n */\n set: function(key, value) {\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n keys.add(key);\n values[guid] = value;\n },\n\n /**\n Removes a value from the map for an associated key.\n\n @method remove\n @param {anything} key\n @return {Boolean} true if an item was removed, false otherwise\n */\n remove: function(key) {\n // don't use ES6 \"delete\" because it will be annoying\n // to use in browsers that are not ES6 friendly;\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key),\n value;\n\n if (values.hasOwnProperty(guid)) {\n keys.remove(key);\n value = values[guid];\n delete values[guid];\n return true;\n } else {\n return false;\n }\n },\n\n /**\n Check whether a key is present.\n\n @method has\n @param {anything} key\n @return {Boolean} true if the item was present, false otherwise\n */\n has: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values.hasOwnProperty(guid);\n },\n\n /**\n Iterate over all the keys and values. Calls the function once\n for each key, passing in the key and value, in that order.\n\n The keys are guaranteed to be iterated over in insertion order.\n\n @method forEach\n @param {Function} callback\n @param {anything} self if passed, the `this` value inside the\n callback. By default, `this` is the map.\n */\n forEach: function(callback, self) {\n var keys = this.keys,\n values = this.values;\n\n keys.forEach(function(key) {\n var guid = guidFor(key);\n callback.call(self, key, values[guid]);\n });\n },\n\n /**\n @method copy\n @return {Ember.Map}\n */\n copy: function() {\n return copyMap(this, new Map());\n }\n};\n\n/**\n @class MapWithDefault\n @namespace Ember\n @extends Ember.Map\n @private\n @constructor\n @param [options]\n @param {anything} [options.defaultValue]\n*/\nvar MapWithDefault = Ember.MapWithDefault = function(options) {\n Map.call(this);\n this.defaultValue = options.defaultValue;\n};\n\n/**\n @method create\n @static\n @param [options]\n @param {anything} [options.defaultValue]\n @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns\n `Ember.MapWithDefault` otherwise returns `Ember.Map`\n*/\nMapWithDefault.create = function(options) {\n if (options) {\n return new MapWithDefault(options);\n } else {\n return new Map();\n }\n};\n\nMapWithDefault.prototype = Ember.create(Map.prototype);\n\n/**\n Retrieve the value associated with a given key.\n\n @method get\n @param {anything} key\n @return {anything} the value associated with the key, or the default value\n*/\nMapWithDefault.prototype.get = function(key) {\n var hasValue = this.has(key);\n\n if (hasValue) {\n return Map.prototype.get.call(this, key);\n } else {\n var defaultValue = this.defaultValue(key);\n this.set(key, defaultValue);\n return defaultValue;\n }\n};\n\n/**\n @method copy\n @return {Ember.MapWithDefault}\n*/\nMapWithDefault.prototype.copy = function() {\n return copyMap(this, new MapWithDefault({\n defaultValue: this.defaultValue\n }));\n};\n\n})();\n//@ sourceURL=ember-metal/map");minispade.register('ember-metal/mixin', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/accessors');\nminispade.require('ember-metal/computed');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/binding');\n\n/**\n@module ember-metal\n*/\n\nvar Mixin, REQUIRED, Alias,\n a_map = Ember.ArrayPolyfills.map,\n a_indexOf = Ember.ArrayPolyfills.indexOf,\n a_forEach = Ember.ArrayPolyfills.forEach,\n a_slice = [].slice,\n o_create = Ember.create,\n defineProperty = Ember.defineProperty,\n guidFor = Ember.guidFor;\n\nfunction mixinsMeta(obj) {\n var m = Ember.meta(obj, true), ret = m.mixins;\n if (!ret) {\n ret = m.mixins = {};\n } else if (!m.hasOwnProperty('mixins')) {\n ret = m.mixins = o_create(ret);\n }\n return ret;\n}\n\nfunction initMixin(mixin, args) {\n if (args && args.length > 0) {\n mixin.mixins = a_map.call(args, function(x) {\n if (x instanceof Mixin) { return x; }\n\n // Note: Manually setup a primitive mixin here. This is the only\n // way to actually get a primitive mixin. This way normal creation\n // of mixins will give you combined mixins...\n var mixin = new Mixin();\n mixin.properties = x;\n return mixin;\n });\n }\n return mixin;\n}\n\nfunction isMethod(obj) {\n return 'function' === typeof obj &&\n obj.isMethod !== false &&\n obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;\n}\n\nvar CONTINUE = {};\n\nfunction mixinProperties(mixinsMeta, mixin) {\n var guid;\n\n if (mixin instanceof Mixin) {\n guid = guidFor(mixin);\n if (mixinsMeta[guid]) { return CONTINUE; }\n mixinsMeta[guid] = mixin;\n return mixin.properties;\n } else {\n return mixin; // apply anonymous mixin properties\n }\n}\n\nfunction concatenatedProperties(props, values, base) {\n var concats;\n\n // reset before adding each new mixin to pickup concats from previous\n concats = values.concatenatedProperties || base.concatenatedProperties;\n if (props.concatenatedProperties) {\n concats = concats ? concats.concat(props.concatenatedProperties) : props.concatenatedProperties;\n }\n\n return concats;\n}\n\nfunction giveDescriptorSuper(meta, key, property, values, descs) {\n var superProperty;\n\n // Computed properties override methods, and do not call super to them\n if (values[key] === undefined) {\n // Find the original descriptor in a parent mixin\n superProperty = descs[key];\n }\n\n // If we didn't find the original descriptor in a parent mixin, find\n // it on the original object.\n superProperty = superProperty || meta.descs[key];\n\n if (!superProperty || !(superProperty instanceof Ember.ComputedProperty)) {\n return property;\n }\n\n // Since multiple mixins may inherit from the same parent, we need\n // to clone the computed property so that other mixins do not receive\n // the wrapped version.\n property = o_create(property);\n property.func = Ember.wrap(property.func, superProperty.func);\n\n return property;\n}\n\nfunction giveMethodSuper(obj, key, method, values, descs) {\n var superMethod;\n\n // Methods overwrite computed properties, and do not call super to them.\n if (descs[key] === undefined) {\n // Find the original method in a parent mixin\n superMethod = values[key];\n }\n\n // If we didn't find the original value in a parent mixin, find it in\n // the original object\n superMethod = superMethod || obj[key];\n\n // Only wrap the new method if the original method was a function\n if ('function' !== typeof superMethod) {\n return method;\n }\n\n return Ember.wrap(method, superMethod);\n}\n\nfunction applyConcatenatedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n return baseValue.concat(value);\n } else {\n return Ember.makeArray(baseValue).concat(value);\n }\n } else {\n return Ember.makeArray(value);\n }\n}\n\nfunction addNormalizedProperty(base, key, value, meta, descs, values, concats) {\n if (value instanceof Ember.Descriptor) {\n if (value === REQUIRED && descs[key]) { return CONTINUE; }\n\n // Wrap descriptor function to implement\n // _super() if needed\n if (value.func) {\n value = giveDescriptorSuper(meta, key, value, values, descs);\n }\n\n descs[key] = value;\n values[key] = undefined;\n } else {\n // impl super if needed...\n if (isMethod(value)) {\n value = giveMethodSuper(base, key, value, values, descs);\n } else if ((concats && a_indexOf.call(concats, key) >= 0) || key === 'concatenatedProperties') {\n value = applyConcatenatedProperties(base, key, value, values);\n }\n\n descs[key] = undefined;\n values[key] = value;\n }\n}\n\nfunction mergeMixins(mixins, m, descs, values, base) {\n var mixin, props, key, concats, meta;\n\n function removeKeys(keyName) {\n delete descs[keyName];\n delete values[keyName];\n }\n\n for(var i=0, l=mixins.length; i<l; i++) {\n mixin = mixins[i];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n props = mixinProperties(m, mixin);\n if (props === CONTINUE) { continue; }\n\n if (props) {\n meta = Ember.meta(base);\n concats = concatenatedProperties(props, values, base);\n\n for (key in props) {\n if (!props.hasOwnProperty(key)) { continue; }\n addNormalizedProperty(base, key, props[key], meta, descs, values, concats);\n }\n\n // manually copy toString() because some JS engines do not enumerate it\n if (props.hasOwnProperty('toString')) { base.toString = props.toString; }\n } else if (mixin.mixins) {\n mergeMixins(mixin.mixins, m, descs, values, base);\n if (mixin._without) { a_forEach.call(mixin._without, removeKeys); }\n }\n }\n}\n\nfunction writableReq(obj) {\n var m = Ember.meta(obj), req = m.required;\n if (!req || !m.hasOwnProperty('required')) {\n req = m.required = req ? o_create(req) : {};\n }\n return req;\n}\n\nvar IS_BINDING = Ember.IS_BINDING = /^.+Binding$/;\n\nfunction detectBinding(obj, key, value, m) {\n if (IS_BINDING.test(key)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[key] = value;\n }\n}\n\nfunction connectBindings(obj, m) {\n // TODO Mixin.apply(instance) should disconnect binding if exists\n var bindings = m.bindings, key, binding, to;\n if (bindings) {\n for (key in bindings) {\n binding = bindings[key];\n if (binding) {\n to = key.slice(0, -7); // strip Binding off end\n if (binding instanceof Ember.Binding) {\n binding = binding.copy(); // copy prototypes' instance\n binding.to(to);\n } else { // binding is string path\n binding = new Ember.Binding(to, binding);\n }\n binding.connect(obj);\n obj[key] = binding;\n }\n }\n // mark as applied\n m.bindings = {};\n }\n}\n\nfunction finishPartial(obj, m) {\n connectBindings(obj, m || Ember.meta(obj));\n return obj;\n}\n\nfunction followAlias(obj, desc, m, descs, values) {\n var altKey = desc.methodName, value;\n if (descs[altKey] || values[altKey]) {\n value = values[altKey];\n desc = descs[altKey];\n } else if (m.descs[altKey]) {\n desc = m.descs[altKey];\n value = undefined;\n } else {\n desc = undefined;\n value = obj[altKey];\n }\n\n return { desc: desc, value: value };\n}\n\nfunction updateObservers(obj, key, observer, observerKey, method) {\n if ('function' !== typeof observer) { return; }\n\n var paths = observer[observerKey];\n\n if (paths) {\n for (var i=0, l=paths.length; i<l; i++) {\n Ember[method](obj, paths[i], null, key);\n }\n }\n}\n\nfunction replaceObservers(obj, key, observer) {\n var prevObserver = obj[key];\n\n updateObservers(obj, key, prevObserver, '__ember_observesBefore__', 'removeBeforeObserver');\n updateObservers(obj, key, prevObserver, '__ember_observes__', 'removeObserver');\n\n updateObservers(obj, key, observer, '__ember_observesBefore__', 'addBeforeObserver');\n updateObservers(obj, key, observer, '__ember_observes__', 'addObserver');\n}\n\nfunction applyMixin(obj, mixins, partial) {\n var descs = {}, values = {}, m = Ember.meta(obj),\n key, value, desc;\n\n // Go through all mixins and hashes passed in, and:\n //\n // * Handle concatenated properties\n // * Set up _super wrapping if necessary\n // * Set up computed property descriptors\n // * Copying `toString` in broken browsers\n mergeMixins(mixins, mixinsMeta(obj), descs, values, obj);\n\n for(key in values) {\n if (key === 'contructor' || !values.hasOwnProperty(key)) { continue; }\n\n desc = descs[key];\n value = values[key];\n\n if (desc === REQUIRED) { continue; }\n\n while (desc && desc instanceof Alias) {\n var followed = followAlias(obj, desc, m, descs, values);\n desc = followed.desc;\n value = followed.value;\n }\n\n if (desc === undefined && value === undefined) { continue; }\n\n replaceObservers(obj, key, value);\n detectBinding(obj, key, value, m);\n defineProperty(obj, key, desc, value, m);\n }\n\n if (!partial) { // don't apply to prototype\n finishPartial(obj, m);\n }\n\n return obj;\n}\n\n/**\n @method mixin\n @for Ember\n @param obj\n @param mixins*\n @return obj\n*/\nEmber.mixin = function(obj) {\n var args = a_slice.call(arguments, 1);\n applyMixin(obj, args, false);\n return obj;\n};\n\n/**\n The `Ember.Mixin` class allows you to create mixins, whose properties can be\n added to other classes. For instance,\n\n ```javascript\n App.Editable = Ember.Mixin.create({\n edit: function() {\n console.log('starting to edit');\n this.set('isEditing', true);\n },\n isEditing: false\n });\n\n // Mix mixins into classes by passing them as the first arguments to\n // .extend or .create.\n App.CommentView = Ember.View.extend(App.Editable, {\n template: Ember.Handlebars.compile('{{#if isEditing}}...{{else}}...{{/if}}')\n });\n\n commentView = App.CommentView.create();\n commentView.edit(); // outputs 'starting to edit'\n ```\n\n Note that Mixins are created with `Ember.Mixin.create`, not\n `Ember.Mixin.extend`.\n\n @class Mixin\n @namespace Ember\n*/\nEmber.Mixin = function() { return initMixin(this, arguments); };\n\nMixin = Ember.Mixin;\n\nMixin._apply = applyMixin;\n\nMixin.applyPartial = function(obj) {\n var args = a_slice.call(arguments, 1);\n return applyMixin(obj, args, true);\n};\n\nMixin.finishPartial = finishPartial;\n\nEmber.anyUnprocessedMixins = false;\n\n/**\n Creates an instance of a class. Accepts either no arguments, or an object\n containing values to initialize the newly instantiated object with.\n\n ```javascript\n App.Person = Ember.Object.extend({\n helloWorld: function() {\n alert(\"Hi, my name is \" + this.get('name'));\n }\n });\n\n var tom = App.Person.create({\n name: 'Tom Dale'\n });\n\n tom.helloWorld(); // alerts \"Hi, my name is Tom Dale\".\n ```\n\n `create` will call the `init` function if defined during\n `Ember.AnyObject.extend`\n\n If no arguments are passed to `create`, it will not set values to the new\n instance during initialization:\n\n ```javascript\n var noName = App.Person.create();\n noName.helloWorld(); // alerts undefined\n ```\n\n NOTE: For performance reasons, you cannot declare methods or computed\n properties during `create`. You should instead declare methods and computed\n properties when using `extend`.\n\n @method create\n @static\n @param arguments*\n*/\nMixin.create = function() {\n Ember.anyUnprocessedMixins = true;\n var M = this;\n return initMixin(new M(), arguments);\n};\n\nvar MixinPrototype = Mixin.prototype;\n\n/**\n @method reopen\n @param arguments*\n*/\nMixinPrototype.reopen = function() {\n var mixin, tmp;\n\n if (this.properties) {\n mixin = Mixin.create();\n mixin.properties = this.properties;\n delete this.properties;\n this.mixins = [mixin];\n } else if (!this.mixins) {\n this.mixins = [];\n }\n\n var len = arguments.length, mixins = this.mixins, idx;\n\n for(idx=0; idx < len; idx++) {\n mixin = arguments[idx];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n if (mixin instanceof Mixin) {\n mixins.push(mixin);\n } else {\n tmp = Mixin.create();\n tmp.properties = mixin;\n mixins.push(tmp);\n }\n }\n\n return this;\n};\n\n/**\n @method apply\n @param obj\n @return applied object\n*/\nMixinPrototype.apply = function(obj) {\n return applyMixin(obj, [this], false);\n};\n\nMixinPrototype.applyPartial = function(obj) {\n return applyMixin(obj, [this], true);\n};\n\nfunction _detect(curMixin, targetMixin, seen) {\n var guid = guidFor(curMixin);\n\n if (seen[guid]) { return false; }\n seen[guid] = true;\n\n if (curMixin === targetMixin) { return true; }\n var mixins = curMixin.mixins, loc = mixins ? mixins.length : 0;\n while (--loc >= 0) {\n if (_detect(mixins[loc], targetMixin, seen)) { return true; }\n }\n return false;\n}\n\n/**\n @method detect\n @param obj\n @return {Boolean}\n*/\nMixinPrototype.detect = function(obj) {\n if (!obj) { return false; }\n if (obj instanceof Mixin) { return _detect(obj, this, {}); }\n var mixins = Ember.meta(obj, false).mixins;\n if (mixins) {\n return !!mixins[guidFor(this)];\n }\n return false;\n};\n\nMixinPrototype.without = function() {\n var ret = new Mixin(this);\n ret._without = a_slice.call(arguments);\n return ret;\n};\n\nfunction _keys(ret, mixin, seen) {\n if (seen[guidFor(mixin)]) { return; }\n seen[guidFor(mixin)] = true;\n\n if (mixin.properties) {\n var props = mixin.properties;\n for (var key in props) {\n if (props.hasOwnProperty(key)) { ret[key] = true; }\n }\n } else if (mixin.mixins) {\n a_forEach.call(mixin.mixins, function(x) { _keys(ret, x, seen); });\n }\n}\n\nMixinPrototype.keys = function() {\n var keys = {}, seen = {}, ret = [];\n _keys(keys, this, seen);\n for(var key in keys) {\n if (keys.hasOwnProperty(key)) { ret.push(key); }\n }\n return ret;\n};\n\n// returns the mixins currently applied to the specified object\n// TODO: Make Ember.mixin\nMixin.mixins = function(obj) {\n var mixins = Ember.meta(obj, false).mixins, ret = [];\n\n if (!mixins) { return ret; }\n\n for (var key in mixins) {\n var mixin = mixins[key];\n\n // skip primitive mixins since these are always anonymous\n if (!mixin.properties) { ret.push(mixin); }\n }\n\n return ret;\n};\n\nREQUIRED = new Ember.Descriptor();\nREQUIRED.toString = function() { return '(Required Property)'; };\n\n/**\n Denotes a required property for a mixin\n\n @method required\n @for Ember\n*/\nEmber.required = function() {\n return REQUIRED;\n};\n\nAlias = function(methodName) {\n this.methodName = methodName;\n};\nAlias.prototype = new Ember.Descriptor();\n\n/**\n Makes a property or method available via an additional name.\n\n ```javascript\n App.PaintSample = Ember.Object.extend({\n color: 'red',\n colour: Ember.alias('color'),\n name: function(){\n return \"Zed\";\n },\n moniker: Ember.alias(\"name\")\n });\n\n var paintSample = App.PaintSample.create()\n paintSample.get('colour'); // 'red'\n paintSample.moniker(); // 'Zed'\n ```\n\n @method alias\n @for Ember\n @param {String} methodName name of the method or property to alias\n @return {Ember.Descriptor}\n @deprecated Use `Ember.aliasMethod` or `Ember.computed.alias` instead\n*/\nEmber.alias = function(methodName) {\n return new Alias(methodName);\n};\n\nEmber.deprecateFunc(\"Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.\", Ember.alias);\n\n/**\n Makes a method available via an additional name.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name: function(){\n return 'Tomhuda Katzdale';\n },\n moniker: Ember.aliasMethod('name')\n });\n\n var goodGuy = App.Person.create()\n ```\n\n @method aliasMethod\n @for Ember\n @param {String} methodName name of the method to alias\n @return {Ember.Descriptor}\n*/\nEmber.aliasMethod = function(methodName) {\n return new Alias(methodName);\n};\n\n// ..........................................................\n// OBSERVER HELPER\n//\n\n/**\n @method observer\n @for Ember\n @param {Function} func\n @param {String} propertyNames*\n @return func\n*/\nEmber.observer = function(func) {\n var paths = a_slice.call(arguments, 1);\n func.__ember_observes__ = paths;\n return func;\n};\n\n// If observers ever become asynchronous, Ember.immediateObserver\n// must remain synchronous.\n/**\n @method immediateObserver\n @for Ember\n @param {Function} func\n @param {String} propertyNames*\n @return func\n*/\nEmber.immediateObserver = function() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", typeof arg !== \"string\" || arg.indexOf('.') === -1);\n }\n\n return Ember.observer.apply(this, arguments);\n};\n\n/**\n @method beforeObserver\n @for Ember\n @param {Function} func\n @param {String} propertyNames*\n @return func\n*/\nEmber.beforeObserver = function(func) {\n var paths = a_slice.call(arguments, 1);\n func.__ember_observesBefore__ = paths;\n return func;\n};\n\n})();\n//@ sourceURL=ember-metal/mixin");minispade.register('ember-metal/observer', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils'); // Ember.tryFinally\nminispade.require('ember-metal/accessors');\nminispade.require('ember-metal/array');\n\n/**\n@module ember-metal\n*/\n\nvar AFTER_OBSERVERS = ':change';\nvar BEFORE_OBSERVERS = ':before';\n\nvar guidFor = Ember.guidFor;\n\nvar deferred = 0;\n\n/*\n this.observerSet = {\n [senderGuid]: { // variable name: `keySet`\n [keyName]: listIndex\n }\n },\n this.observers = [\n {\n sender: obj,\n keyName: keyName,\n eventName: eventName,\n listeners: [\n [target, method, onceFlag, suspendedFlag]\n ]\n },\n ...\n ]\n*/\nfunction ObserverSet() {\n this.clear();\n}\n\nObserverSet.prototype.add = function(sender, keyName, eventName) {\n var observerSet = this.observerSet,\n observers = this.observers,\n senderGuid = Ember.guidFor(sender),\n keySet = observerSet[senderGuid],\n index;\n\n if (!keySet) {\n observerSet[senderGuid] = keySet = {};\n }\n index = keySet[keyName];\n if (index === undefined) {\n index = observers.push({\n sender: sender,\n keyName: keyName,\n eventName: eventName,\n listeners: []\n }) - 1;\n keySet[keyName] = index;\n }\n return observers[index].listeners;\n};\n\nObserverSet.prototype.flush = function() {\n var observers = this.observers, i, len, observer, sender;\n this.clear();\n for (i=0, len=observers.length; i < len; ++i) {\n observer = observers[i];\n sender = observer.sender;\n if (sender.isDestroying || sender.isDestroyed) { continue; }\n Ember.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners);\n }\n};\n\nObserverSet.prototype.clear = function() {\n this.observerSet = {};\n this.observers = [];\n};\n\nvar beforeObserverSet = new ObserverSet(), observerSet = new ObserverSet();\n\n/**\n @method beginPropertyChanges\n @chainable\n*/\nEmber.beginPropertyChanges = function() {\n deferred++;\n};\n\n/**\n @method endPropertyChanges\n*/\nEmber.endPropertyChanges = function() {\n deferred--;\n if (deferred<=0) {\n beforeObserverSet.clear();\n observerSet.flush();\n }\n};\n\n/**\n Make a series of property changes together in an\n exception-safe way.\n\n ```javascript\n Ember.changeProperties(function() {\n obj1.set('foo', mayBlowUpWhenSet);\n obj2.set('bar', baz);\n });\n ```\n\n @method changeProperties\n @param {Function} callback\n @param [binding]\n*/\nEmber.changeProperties = function(cb, binding){\n Ember.beginPropertyChanges();\n Ember.tryFinally(cb, Ember.endPropertyChanges, binding);\n};\n\n/**\n Set a list of properties on an object. These properties are set inside\n a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n observers will be buffered.\n\n @method setProperties\n @param target\n @param {Hash} properties\n @return target\n*/\nEmber.setProperties = function(self, hash) {\n Ember.changeProperties(function(){\n for(var prop in hash) {\n if (hash.hasOwnProperty(prop)) Ember.set(self, prop, hash[prop]);\n }\n });\n return self;\n};\n\n\nfunction changeEvent(keyName) {\n return keyName+AFTER_OBSERVERS;\n}\n\nfunction beforeEvent(keyName) {\n return keyName+BEFORE_OBSERVERS;\n}\n\n/**\n @method addObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.addObserver = function(obj, path, target, method) {\n Ember.addListener(obj, changeEvent(path), target, method);\n Ember.watch(obj, path);\n return this;\n};\n\nEmber.observersFor = function(obj, path) {\n return Ember.listenersFor(obj, changeEvent(path));\n};\n\n/**\n @method removeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.removeObserver = function(obj, path, target, method) {\n Ember.unwatch(obj, path);\n Ember.removeListener(obj, changeEvent(path), target, method);\n return this;\n};\n\n/**\n @method addBeforeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.addBeforeObserver = function(obj, path, target, method) {\n Ember.addListener(obj, beforeEvent(path), target, method);\n Ember.watch(obj, path);\n return this;\n};\n\n// Suspend observer during callback.\n//\n// This should only be used by the target of the observer\n// while it is setting the observed path.\nEmber._suspendBeforeObserver = function(obj, path, target, method, callback) {\n return Ember._suspendListener(obj, beforeEvent(path), target, method, callback);\n};\n\nEmber._suspendObserver = function(obj, path, target, method, callback) {\n return Ember._suspendListener(obj, changeEvent(path), target, method, callback);\n};\n\nvar map = Ember.ArrayPolyfills.map;\n\nEmber._suspendBeforeObservers = function(obj, paths, target, method, callback) {\n var events = map.call(paths, beforeEvent);\n return Ember._suspendListeners(obj, events, target, method, callback);\n};\n\nEmber._suspendObservers = function(obj, paths, target, method, callback) {\n var events = map.call(paths, changeEvent);\n return Ember._suspendListeners(obj, events, target, method, callback);\n};\n\nEmber.beforeObserversFor = function(obj, path) {\n return Ember.listenersFor(obj, beforeEvent(path));\n};\n\n/**\n @method removeBeforeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.removeBeforeObserver = function(obj, path, target, method) {\n Ember.unwatch(obj, path);\n Ember.removeListener(obj, beforeEvent(path), target, method);\n return this;\n};\n\nEmber.notifyBeforeObservers = function(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = beforeEvent(keyName), listeners, listenersDiff;\n if (deferred) {\n listeners = beforeObserverSet.add(obj, keyName, eventName);\n listenersDiff = Ember.listenersDiff(obj, eventName, listeners);\n Ember.sendEvent(obj, eventName, [obj, keyName], listenersDiff);\n } else {\n Ember.sendEvent(obj, eventName, [obj, keyName]);\n }\n};\n\nEmber.notifyObservers = function(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = changeEvent(keyName), listeners;\n if (deferred) {\n listeners = observerSet.add(obj, keyName, eventName);\n Ember.listenersUnion(obj, eventName, listeners);\n } else {\n Ember.sendEvent(obj, eventName, [obj, keyName]);\n }\n};\n\n})();\n//@ sourceURL=ember-metal/observer");minispade.register('ember-metal/platform', "(function() {/*globals Node */\nminispade.require('ember-metal/core');\n\n/**\n@module ember-metal\n*/\n\n/**\n Platform specific methods and feature detectors needed by the framework.\n\n @class platform\n @namespace Ember\n @static\n*/\nvar platform = Ember.platform = {};\n\n\n/**\n Identical to `Object.create()`. Implements if not available natively.\n\n @method create\n @for Ember\n*/\nEmber.create = Object.create;\n\n// STUB_OBJECT_CREATE allows us to override other libraries that stub\n// Object.create different than we would prefer\nif (!Ember.create || Ember.ENV.STUB_OBJECT_CREATE) {\n var K = function() {};\n\n Ember.create = function(obj, props) {\n K.prototype = obj;\n obj = new K();\n if (props) {\n K.prototype = obj;\n for (var prop in props) {\n K.prototype[prop] = props[prop].value;\n }\n obj = new K();\n }\n K.prototype = null;\n\n return obj;\n };\n\n Ember.create.isSimulated = true;\n}\n\nvar defineProperty = Object.defineProperty;\nvar canRedefineProperties, canDefinePropertyOnDOM;\n\n// Catch IE8 where Object.defineProperty exists but only works on DOM elements\nif (defineProperty) {\n try {\n defineProperty({}, 'a',{get:function(){}});\n } catch (e) {\n defineProperty = null;\n }\n}\n\nif (defineProperty) {\n // Detects a bug in Android <3.2 where you cannot redefine a property using\n // Object.defineProperty once accessors have already been set.\n canRedefineProperties = (function() {\n var obj = {};\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n get: function() { },\n set: function() { }\n });\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: true\n });\n\n return obj.a === true;\n })();\n\n // This is for Safari 5.0, which supports Object.defineProperty, but not\n // on DOM nodes.\n canDefinePropertyOnDOM = (function(){\n try {\n defineProperty(document.createElement('div'), 'definePropertyOnDOM', {});\n return true;\n } catch(e) { }\n\n return false;\n })();\n\n if (!canRedefineProperties) {\n defineProperty = null;\n } else if (!canDefinePropertyOnDOM) {\n defineProperty = function(obj, keyName, desc){\n var isNode;\n\n if (typeof Node === \"object\") {\n isNode = obj instanceof Node;\n } else {\n isNode = typeof obj === \"object\" && typeof obj.nodeType === \"number\" && typeof obj.nodeName === \"string\";\n }\n\n if (isNode) {\n // TODO: Should we have a warning here?\n return (obj[keyName] = desc.value);\n } else {\n return Object.defineProperty(obj, keyName, desc);\n }\n };\n }\n}\n\n/**\n@class platform\n@namespace Ember\n*/\n\n/**\n Identical to `Object.defineProperty()`. Implements as much functionality\n as possible if not available natively.\n\n @method defineProperty\n @param {Object} obj The object to modify\n @param {String} keyName property name to modify\n @param {Object} desc descriptor hash\n @return {void}\n*/\nplatform.defineProperty = defineProperty;\n\n/**\n Set to true if the platform supports native getters and setters.\n\n @property hasPropertyAccessors\n @final\n*/\nplatform.hasPropertyAccessors = true;\n\nif (!platform.defineProperty) {\n platform.hasPropertyAccessors = false;\n\n platform.defineProperty = function(obj, keyName, desc) {\n if (!desc.get) { obj[keyName] = desc.value; }\n };\n\n platform.defineProperty.isSimulated = true;\n}\n\nif (Ember.ENV.MANDATORY_SETTER && !platform.hasPropertyAccessors) {\n Ember.ENV.MANDATORY_SETTER = false;\n}\n\n})();\n//@ sourceURL=ember-metal/platform");minispade.register('ember-metal/properties', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/accessors');\n\n/**\n@module ember-metal\n*/\n\nvar META_KEY = Ember.META_KEY,\n metaFor = Ember.meta,\n objectDefineProperty = Ember.platform.defineProperty;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n// ..........................................................\n// DESCRIPTOR\n//\n\n/**\n Objects of this type can implement an interface to responds requests to\n get and set. The default implementation handles simple properties.\n\n You generally won't need to create or subclass this directly.\n\n @class Descriptor\n @namespace Ember\n @private\n @constructor\n*/\nvar Descriptor = Ember.Descriptor = function() {};\n\n// ..........................................................\n// DEFINING PROPERTIES API\n//\n\nvar MANDATORY_SETTER_FUNCTION = Ember.MANDATORY_SETTER_FUNCTION = function(value) {\n Ember.assert(\"You must use Ember.set() to access this property (of \" + this + \")\", false);\n};\n\nvar DEFAULT_GETTER_FUNCTION = Ember.DEFAULT_GETTER_FUNCTION = function(name) {\n return function() {\n var meta = this[META_KEY];\n return meta && meta.values[name];\n };\n};\n\n/**\n @private\n\n NOTE: This is a low-level method used by other parts of the API. You almost\n never want to call this method directly. Instead you should use\n `Ember.mixin()` to define new properties.\n\n Defines a property on an object. This method works much like the ES5\n `Object.defineProperty()` method except that it can also accept computed\n properties and other special descriptors.\n\n Normally this method takes only three parameters. However if you pass an\n instance of `Ember.Descriptor` as the third param then you can pass an\n optional value as the fourth parameter. This is often more efficient than\n creating new descriptor hashes for each property.\n\n ## Examples\n\n ```javascript\n // ES5 compatible mode\n Ember.defineProperty(contact, 'firstName', {\n writable: true,\n configurable: false,\n enumerable: true,\n value: 'Charles'\n });\n\n // define a simple property\n Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');\n\n // define a computed property\n Ember.defineProperty(contact, 'fullName', Ember.computed(function() {\n return this.firstName+' '+this.lastName;\n }).property('firstName', 'lastName'));\n ```\n\n @method defineProperty\n @for Ember\n @param {Object} obj the object to define this property on. This may be a prototype.\n @param {String} keyName the name of the property\n @param {Ember.Descriptor} [desc] an instance of `Ember.Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.\n @param {anything} [data] something other than a descriptor, that will\n become the explicit value of this property.\n*/\nEmber.defineProperty = function(obj, keyName, desc, data, meta) {\n var descs, existingDesc, watching, value;\n\n if (!meta) meta = metaFor(obj);\n descs = meta.descs;\n existingDesc = meta.descs[keyName];\n watching = meta.watching[keyName] > 0;\n\n if (existingDesc instanceof Ember.Descriptor) {\n existingDesc.teardown(obj, keyName);\n }\n\n if (desc instanceof Ember.Descriptor) {\n value = desc;\n\n descs[keyName] = desc;\n if (MANDATORY_SETTER && watching) {\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: undefined // make enumerable\n });\n } else {\n obj[keyName] = undefined; // make enumerable\n }\n desc.setup(obj, keyName);\n } else {\n descs[keyName] = undefined; // shadow descriptor in proto\n if (desc == null) {\n value = data;\n\n if (MANDATORY_SETTER && watching) {\n meta.values[keyName] = data;\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: MANDATORY_SETTER_FUNCTION,\n get: DEFAULT_GETTER_FUNCTION(keyName)\n });\n } else {\n obj[keyName] = data;\n }\n } else {\n value = desc;\n\n // compatibility with ES5\n objectDefineProperty(obj, keyName, desc);\n }\n }\n\n // if key is being watched, override chains that\n // were initialized with the prototype\n if (watching) { Ember.overrideChains(obj, keyName, meta); }\n\n // The `value` passed to the `didDefineProperty` hook is\n // either the descriptor or data, whichever was passed.\n if (obj.didDefineProperty) { obj.didDefineProperty(obj, keyName, value); }\n\n return this;\n};\n\n\n})();\n//@ sourceURL=ember-metal/properties");minispade.register('ember-metal/run_loop', "(function() {minispade.require('ember-metal/core'); // Ember.Logger\nminispade.require('ember-metal/watching'); // Ember.watch.flushPending\nminispade.require('ember-metal/observer'); // Ember.beginPropertyChanges, Ember.endPropertyChanges\nminispade.require('ember-metal/utils'); // Ember.guidFor, Ember.tryFinally\n\n/**\n@module ember-metal\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar slice = [].slice,\n forEach = Ember.ArrayPolyfills.forEach;\n\n// invokes passed params - normalizing so you can pass target/func,\n// target/string or just func\nfunction invoke(target, method, args, ignore) {\n\n if (method === undefined) {\n method = target;\n target = undefined;\n }\n\n if ('string' === typeof method) { method = target[method]; }\n if (args && ignore > 0) {\n args = args.length > ignore ? slice.call(args, ignore) : null;\n }\n\n return Ember.handleErrors(function() {\n // IE8's Function.prototype.apply doesn't accept undefined/null arguments.\n return method.apply(target || this, args || []);\n }, this);\n}\n\n\n// ..........................................................\n// RUNLOOP\n//\n\nvar timerMark; // used by timers...\n\n/**\nEmber RunLoop (Private)\n\n@class RunLoop\n@namespace Ember\n@private\n@constructor\n*/\nvar RunLoop = function(prev) {\n this._prev = prev || null;\n this.onceTimers = {};\n};\n\nRunLoop.prototype = {\n /**\n @method end\n */\n end: function() {\n this.flush();\n },\n\n /**\n @method prev\n */\n prev: function() {\n return this._prev;\n },\n\n // ..........................................................\n // Delayed Actions\n //\n\n /**\n @method schedule\n @param {String} queueName\n @param target\n @param method\n */\n schedule: function(queueName, target, method) {\n var queues = this._queues, queue;\n if (!queues) { queues = this._queues = {}; }\n queue = queues[queueName];\n if (!queue) { queue = queues[queueName] = []; }\n\n var args = arguments.length > 3 ? slice.call(arguments, 3) : null;\n queue.push({ target: target, method: method, args: args });\n return this;\n },\n\n /**\n @method flush\n @param {String} queueName\n */\n flush: function(queueName) {\n var queueNames, idx, len, queue, log;\n\n if (!this._queues) { return this; } // nothing to do\n\n function iter(item) {\n invoke(item.target, item.method, item.args);\n }\n\n function tryable() {\n forEach.call(queue, iter);\n }\n\n Ember.watch.flushPending(); // make sure all chained watchers are setup\n\n if (queueName) {\n while (this._queues && (queue = this._queues[queueName])) {\n this._queues[queueName] = null;\n\n // the sync phase is to allow property changes to propagate. don't\n // invoke observers until that is finished.\n if (queueName === 'sync') {\n log = Ember.LOG_BINDINGS;\n if (log) { Ember.Logger.log('Begin: Flush Sync Queue'); }\n\n Ember.beginPropertyChanges();\n\n Ember.tryFinally(tryable, Ember.endPropertyChanges);\n\n if (log) { Ember.Logger.log('End: Flush Sync Queue'); }\n\n } else {\n forEach.call(queue, iter);\n }\n }\n\n } else {\n queueNames = Ember.run.queues;\n len = queueNames.length;\n idx = 0;\n\n outerloop:\n while (idx < len) {\n queueName = queueNames[idx];\n queue = this._queues && this._queues[queueName];\n delete this._queues[queueName];\n\n if (queue) {\n // the sync phase is to allow property changes to propagate. don't\n // invoke observers until that is finished.\n if (queueName === 'sync') {\n log = Ember.LOG_BINDINGS;\n if (log) { Ember.Logger.log('Begin: Flush Sync Queue'); }\n\n Ember.beginPropertyChanges();\n\n Ember.tryFinally(tryable, Ember.endPropertyChanges);\n\n if (log) { Ember.Logger.log('End: Flush Sync Queue'); }\n } else {\n forEach.call(queue, iter);\n }\n }\n\n // Loop through prior queues\n for (var i = 0; i <= idx; i++) {\n if (this._queues && this._queues[queueNames[i]]) {\n // Start over at the first queue with contents\n idx = i;\n continue outerloop;\n }\n }\n\n idx++;\n }\n }\n\n timerMark = null;\n\n return this;\n }\n\n};\n\nEmber.RunLoop = RunLoop;\n\n// ..........................................................\n// Ember.run - this is ideally the only public API the dev sees\n//\n\n/**\n Runs the passed target and method inside of a RunLoop, ensuring any\n deferred actions including bindings and views updates are flushed at the\n end.\n\n Normally you should not need to invoke this method yourself. However if\n you are implementing raw event handlers when interfacing with other\n libraries or plugins, you should probably wrap all of your code inside this\n call.\n\n ```javascript\n Ember.run(function(){\n // code to be execute within a RunLoop\n });\n ```\n\n @class run\n @namespace Ember\n @static\n @constructor\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function.\n*/\nEmber.run = function(target, method) {\n var args = arguments;\n run.begin();\n\n function tryable() {\n if (target || method) {\n return invoke(target, method, args, 2);\n }\n }\n\n return Ember.tryFinally(tryable, run.end);\n};\n\nvar run = Ember.run;\n\n\n/**\n Begins a new RunLoop. Any deferred actions invoked after the begin will\n be buffered until you invoke a matching call to `Ember.run.end()`. This is\n a lower-level way to use a RunLoop instead of using `Ember.run()`.\n\n ```javascript\n Ember.run.begin();\n // code to be execute within a RunLoop\n Ember.run.end();\n ```\n\n @method begin\n @return {void}\n*/\nEmber.run.begin = function() {\n run.currentRunLoop = new RunLoop(run.currentRunLoop);\n};\n\n/**\n Ends a RunLoop. This must be called sometime after you call\n `Ember.run.begin()` to flush any deferred actions. This is a lower-level way\n to use a RunLoop instead of using `Ember.run()`.\n\n ```javascript\n Ember.run.begin();\n // code to be execute within a RunLoop\n Ember.run.end();\n ```\n\n @method end\n @return {void}\n*/\nEmber.run.end = function() {\n Ember.assert('must have a current run loop', run.currentRunLoop);\n\n function tryable() { run.currentRunLoop.end(); }\n function finalizer() { run.currentRunLoop = run.currentRunLoop.prev(); }\n\n Ember.tryFinally(tryable, finalizer);\n};\n\n/**\n Array of named queues. This array determines the order in which queues\n are flushed at the end of the RunLoop. You can define your own queues by\n simply adding the queue name to this array. Normally you should not need\n to inspect or modify this property.\n\n @property queues\n @type Array\n @default ['sync', 'actions', 'destroy']\n*/\nEmber.run.queues = ['sync', 'actions', 'destroy'];\n\n/**\n Adds the passed target/method and any optional arguments to the named\n queue to be executed at the end of the RunLoop. If you have not already\n started a RunLoop when calling this method one will be started for you\n automatically.\n\n At the end of a RunLoop, any methods scheduled in this way will be invoked.\n Methods will be invoked in an order matching the named queues defined in\n the `run.queues` property.\n\n ```javascript\n Ember.run.schedule('sync', this, function(){\n // this will be executed in the first RunLoop queue, when bindings are synced\n console.log(\"scheduled on sync queue\");\n });\n\n Ember.run.schedule('actions', this, function(){\n // this will be executed in the 'actions' queue, after bindings have synced.\n console.log(\"scheduled on actions queue\");\n });\n\n // Note the functions will be run in order based on the run queues order. Output would be:\n // scheduled on sync queue\n // scheduled on actions queue\n ```\n\n @method schedule\n @param {String} queue The name of the queue to schedule against.\n Default queues are 'sync' and 'actions'\n @param {Object} [target] target object to use as the context when invoking a method.\n @param {String|Function} method The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.\n @param {Object} [arguments*] Optional arguments to be passed to the queued method.\n @return {void}\n*/\nEmber.run.schedule = function(queue, target, method) {\n var loop = run.autorun();\n loop.schedule.apply(loop, arguments);\n};\n\nvar scheduledAutorun;\nfunction autorun() {\n scheduledAutorun = null;\n if (run.currentRunLoop) { run.end(); }\n}\n\n// Used by global test teardown\nEmber.run.hasScheduledTimers = function() {\n return !!(scheduledAutorun || scheduledLater);\n};\n\n// Used by global test teardown\nEmber.run.cancelTimers = function () {\n if (scheduledAutorun) {\n clearTimeout(scheduledAutorun);\n scheduledAutorun = null;\n }\n if (scheduledLater) {\n clearTimeout(scheduledLater);\n scheduledLater = null;\n }\n timers = {};\n};\n\n/**\n Begins a new RunLoop if necessary and schedules a timer to flush the\n RunLoop at a later time. This method is used by parts of Ember to\n ensure the RunLoop always finishes. You normally do not need to call this\n method directly. Instead use `Ember.run()`\n\n @method autorun\n @example\n Ember.run.autorun();\n @return {Ember.RunLoop} the new current RunLoop\n*/\nEmber.run.autorun = function() {\n if (!run.currentRunLoop) {\n Ember.assert(\"You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run\", !Ember.testing);\n\n run.begin();\n\n if (!scheduledAutorun) {\n scheduledAutorun = setTimeout(autorun, 1);\n }\n }\n\n return run.currentRunLoop;\n};\n\n/**\n Immediately flushes any events scheduled in the 'sync' queue. Bindings\n use this queue so this method is a useful way to immediately force all\n bindings in the application to sync.\n\n You should call this method anytime you need any changed state to propagate\n throughout the app immediately without repainting the UI (which happens\n in the later 'render' queue added by the `ember-views` package).\n\n ```javascript\n Ember.run.sync();\n ```\n\n @method sync\n @return {void}\n*/\nEmber.run.sync = function() {\n run.autorun();\n run.currentRunLoop.flush('sync');\n};\n\n// ..........................................................\n// TIMERS\n//\n\nvar timers = {}; // active timers...\n\nvar scheduledLater, scheduledLaterExpires;\nfunction invokeLaterTimers() {\n scheduledLater = null;\n run(function() {\n var now = (+ new Date()), earliest = -1;\n for (var key in timers) {\n if (!timers.hasOwnProperty(key)) { continue; }\n var timer = timers[key];\n if (timer && timer.expires) {\n if (now >= timer.expires) {\n delete timers[key];\n invoke(timer.target, timer.method, timer.args, 2);\n } else {\n if (earliest < 0 || (timer.expires < earliest)) { earliest = timer.expires; }\n }\n }\n }\n\n // schedule next timeout to fire when the earliest timer expires\n if (earliest > 0) {\n scheduledLater = setTimeout(invokeLaterTimers, earliest - now);\n scheduledLaterExpires = earliest;\n }\n });\n}\n\n/**\n Invokes the passed target/method and optional arguments after a specified\n period if time. The last parameter of this method must always be a number\n of milliseconds.\n\n You should use this method whenever you need to run some action after a\n period of time instead of using `setTimeout()`. This method will ensure that\n items that expire during the same script execution cycle all execute\n together, which is often more efficient than using a real setTimeout.\n\n ```javascript\n Ember.run.later(myContext, function(){\n // code here will execute within a RunLoop in about 500ms with this == myContext\n }, 500);\n ```\n\n @method later\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait\n Number of milliseconds to wait.\n @return {String} a string you can use to cancel the timer in\n {{#crossLink \"Ember/run.cancel\"}}{{/crossLink}} later.\n*/\nEmber.run.later = function(target, method) {\n var args, expires, timer, guid, wait;\n\n // setTimeout compatibility...\n if (arguments.length===2 && 'function' === typeof target) {\n wait = method;\n method = target;\n target = undefined;\n args = [target, method];\n } else {\n args = slice.call(arguments);\n wait = args.pop();\n }\n\n expires = (+ new Date()) + wait;\n timer = { target: target, method: method, expires: expires, args: args };\n guid = Ember.guidFor(timer);\n timers[guid] = timer;\n\n if(scheduledLater && expires < scheduledLaterExpires) {\n // Cancel later timer (then reschedule earlier timer below)\n clearTimeout(scheduledLater);\n scheduledLater = null;\n }\n\n if (!scheduledLater) {\n // Schedule later timers to be run.\n scheduledLater = setTimeout(invokeLaterTimers, wait);\n scheduledLaterExpires = expires;\n }\n\n return guid;\n};\n\nfunction invokeOnceTimer(guid, onceTimers) {\n if (onceTimers[this.tguid]) { delete onceTimers[this.tguid][this.mguid]; }\n if (timers[guid]) { invoke(this.target, this.method, this.args); }\n delete timers[guid];\n}\n\nfunction scheduleOnce(queue, target, method, args) {\n var tguid = Ember.guidFor(target),\n mguid = Ember.guidFor(method),\n onceTimers = run.autorun().onceTimers,\n guid = onceTimers[tguid] && onceTimers[tguid][mguid],\n timer;\n\n if (guid && timers[guid]) {\n timers[guid].args = args; // replace args\n } else {\n timer = {\n target: target,\n method: method,\n args: args,\n tguid: tguid,\n mguid: mguid\n };\n\n guid = Ember.guidFor(timer);\n timers[guid] = timer;\n if (!onceTimers[tguid]) { onceTimers[tguid] = {}; }\n onceTimers[tguid][mguid] = guid; // so it isn't scheduled more than once\n\n run.schedule(queue, timer, invokeOnceTimer, guid, onceTimers);\n }\n\n return guid;\n}\n\n/**\n Schedules an item to run one time during the current RunLoop. Calling\n this method with the same target/method combination will have no effect.\n\n Note that although you can pass optional arguments these will not be\n considered when looking for duplicates. New arguments will replace previous\n calls.\n\n ```javascript\n Ember.run(function(){\n var doFoo = function() { foo(); }\n Ember.run.once(myContext, doFoo);\n Ember.run.once(myContext, doFoo);\n // doFoo will only be executed once at the end of the RunLoop\n });\n ```\n\n Also note that passing an anonymous function to `Ember.run.once` will\n not prevent additional calls with an identical anonymous function from\n scheduling the items multiple times, e.g.:\n\n ```javascript\n function scheduleIt() {\n Ember.run.once(myContext, function() { console.log(\"Closure\"); });\n }\n scheduleIt();\n scheduleIt();\n // \"Closure\" will print twice, even though we're using `Ember.run.once`,\n // because the function we pass to it is anonymous and won't match the\n // previously scheduled operation.\n ```\n\n @method once\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.once = function(target, method) {\n return scheduleOnce('actions', target, method, slice.call(arguments, 2));\n};\n\nEmber.run.scheduleOnce = function(queue, target, method, args) {\n return scheduleOnce(queue, target, method, slice.call(arguments, 3));\n};\n\n/**\n Schedules an item to run after control has been returned to the system.\n This is equivalent to calling `Ember.run.later` with a wait time of 1ms.\n\n ```javascript\n Ember.run.next(myContext, function(){\n // code to be executed in the next RunLoop, which will be scheduled after the current one\n });\n ```\n\n @method next\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.next = function() {\n var args = slice.call(arguments);\n args.push(1); // 1 millisecond wait\n return run.later.apply(this, args);\n};\n\n/**\n Cancels a scheduled item. Must be a value returned by `Ember.run.later()`,\n `Ember.run.once()`, or `Ember.run.next()`.\n\n ```javascript\n var runNext = Ember.run.next(myContext, function(){\n // will not be executed\n });\n Ember.run.cancel(runNext);\n\n var runLater = Ember.run.later(myContext, function(){\n // will not be executed\n }, 500);\n Ember.run.cancel(runLater);\n\n var runOnce = Ember.run.once(myContext, function(){\n // will not be executed\n });\n Ember.run.cancel(runOnce);\n ```\n\n @method cancel\n @param {Object} timer Timer object to cancel\n @return {void}\n*/\nEmber.run.cancel = function(timer) {\n delete timers[timer];\n};\n\n})();\n//@ sourceURL=ember-metal/run_loop");minispade.register('ember-metal/utils', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\n\n/**\n@module ember-metal\n*/\n\n\nvar o_defineProperty = Ember.platform.defineProperty,\n o_create = Ember.create,\n // Used for guid generation...\n GUID_KEY = '__ember'+ (+ new Date()),\n uuid = 0,\n numberCache = [],\n stringCache = {};\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n/**\n @private\n\n A unique key used to assign guids and other private metadata to objects.\n If you inspect an object in your browser debugger you will often see these.\n They can be safely ignored.\n\n On browsers that support it, these properties are added with enumeration\n disabled so they won't show up when you iterate over your properties.\n\n @property GUID_KEY\n @for Ember\n @type String\n @final\n*/\nEmber.GUID_KEY = GUID_KEY;\n\nvar GUID_DESC = {\n writable: false,\n configurable: false,\n enumerable: false,\n value: null\n};\n\n/**\n @private\n\n Generates a new guid, optionally saving the guid to the object that you\n pass in. You will rarely need to use this method. Instead you should\n call `Ember.guidFor(obj)`, which return an existing guid if available.\n\n @method generateGuid\n @for Ember\n @param {Object} [obj] Object the guid will be used for. If passed in, the guid will\n be saved on the object and reused whenever you pass the same object\n again.\n\n If no object is passed, just generate a new guid.\n @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to\n separate the guid into separate namespaces.\n @return {String} the guid\n*/\nEmber.generateGuid = function generateGuid(obj, prefix) {\n if (!prefix) prefix = 'ember';\n var ret = (prefix + (uuid++));\n if (obj) {\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n }\n return ret ;\n};\n\n/**\n @private\n\n Returns a unique id for the object. If the object does not yet have a guid,\n one will be assigned to it. You can call this on any object,\n `Ember.Object`-based or not, but be aware that it will add a `_guid`\n property.\n\n You can also use this method on DOM Element objects.\n\n @method guidFor\n @for Ember\n @param {Object} obj any object, string, number, Element, or primitive\n @return {String} the unique guid for this instance.\n*/\nEmber.guidFor = function guidFor(obj) {\n\n // special cases where we don't want to add a key to object\n if (obj === undefined) return \"(undefined)\";\n if (obj === null) return \"(null)\";\n\n var cache, ret;\n var type = typeof obj;\n\n // Don't allow prototype changes to String etc. to change the guidFor\n switch(type) {\n case 'number':\n ret = numberCache[obj];\n if (!ret) ret = numberCache[obj] = 'nu'+obj;\n return ret;\n\n case 'string':\n ret = stringCache[obj];\n if (!ret) ret = stringCache[obj] = 'st'+(uuid++);\n return ret;\n\n case 'boolean':\n return obj ? '(true)' : '(false)';\n\n default:\n if (obj[GUID_KEY]) return obj[GUID_KEY];\n if (obj === Object) return '(Object)';\n if (obj === Array) return '(Array)';\n ret = 'ember'+(uuid++);\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n return ret;\n }\n};\n\n// ..........................................................\n// META\n//\n\nvar META_DESC = {\n writable: true,\n configurable: false,\n enumerable: false,\n value: null\n};\n\nvar META_KEY = Ember.GUID_KEY+'_meta';\n\n/**\n The key used to store meta information on object for property observing.\n\n @property META_KEY\n @for Ember\n @private\n @final\n @type String\n*/\nEmber.META_KEY = META_KEY;\n\n// Placeholder for non-writable metas.\nvar EMPTY_META = {\n descs: {},\n watching: {}\n};\n\nif (MANDATORY_SETTER) { EMPTY_META.values = {}; }\n\nEmber.EMPTY_META = EMPTY_META;\n\nif (Object.freeze) Object.freeze(EMPTY_META);\n\nvar isDefinePropertySimulated = Ember.platform.defineProperty.isSimulated;\n\nfunction Meta(obj) {\n this.descs = {};\n this.watching = {};\n this.cache = {};\n this.source = obj;\n}\n\nif (isDefinePropertySimulated) {\n // on platforms that don't support enumerable false\n // make meta fail jQuery.isPlainObject() to hide from\n // jQuery.extend() by having a property that fails\n // hasOwnProperty check.\n Meta.prototype.__preventPlainObject__ = true;\n\n // Without non-enumerable properties, meta objects will be output in JSON\n // unless explicitly suppressed\n Meta.prototype.toJSON = function () { };\n}\n\n/**\n Retrieves the meta hash for an object. If `writable` is true ensures the\n hash is writable for this object as well.\n\n The meta object contains information about computed property descriptors as\n well as any watched properties and other information. You generally will\n not access this information directly but instead work with higher level\n methods that manipulate this hash indirectly.\n\n @method meta\n @for Ember\n @private\n\n @param {Object} obj The object to retrieve meta for\n @param {Boolean} [writable=true] Pass `false` if you do not intend to modify\n the meta hash, allowing the method to avoid making an unnecessary copy.\n @return {Hash}\n*/\nEmber.meta = function meta(obj, writable) {\n\n var ret = obj[META_KEY];\n if (writable===false) return ret || EMPTY_META;\n\n if (!ret) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = new Meta(obj);\n\n if (MANDATORY_SETTER) { ret.values = {}; }\n\n obj[META_KEY] = ret;\n\n // make sure we don't accidentally try to create constructor like desc\n ret.descs.constructor = null;\n\n } else if (ret.source !== obj) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = o_create(ret);\n ret.descs = o_create(ret.descs);\n ret.watching = o_create(ret.watching);\n ret.cache = {};\n ret.source = obj;\n\n if (MANDATORY_SETTER) { ret.values = o_create(ret.values); }\n\n obj[META_KEY] = ret;\n }\n return ret;\n};\n\nEmber.getMeta = function getMeta(obj, property) {\n var meta = Ember.meta(obj, false);\n return meta[property];\n};\n\nEmber.setMeta = function setMeta(obj, property, value) {\n var meta = Ember.meta(obj, true);\n meta[property] = value;\n return value;\n};\n\n/**\n @private\n\n In order to store defaults for a class, a prototype may need to create\n a default meta object, which will be inherited by any objects instantiated\n from the class's constructor.\n\n However, the properties of that meta object are only shallow-cloned,\n so if a property is a hash (like the event system's `listeners` hash),\n it will by default be shared across all instances of that class.\n\n This method allows extensions to deeply clone a series of nested hashes or\n other complex objects. For instance, the event system might pass\n `['listeners', 'foo:change', 'ember157']` to `prepareMetaPath`, which will\n walk down the keys provided.\n\n For each key, if the key does not exist, it is created. If it already\n exists and it was inherited from its constructor, the constructor's\n key is cloned.\n\n You can also pass false for `writable`, which will simply return\n undefined if `prepareMetaPath` discovers any part of the path that\n shared or undefined.\n\n @method metaPath\n @for Ember\n @param {Object} obj The object whose meta we are examining\n @param {Array} path An array of keys to walk down\n @param {Boolean} writable whether or not to create a new meta\n (or meta property) if one does not already exist or if it's\n shared with its constructor\n*/\nEmber.metaPath = function metaPath(obj, path, writable) {\n var meta = Ember.meta(obj, writable), keyName, value;\n\n for (var i=0, l=path.length; i<l; i++) {\n keyName = path[i];\n value = meta[keyName];\n\n if (!value) {\n if (!writable) { return undefined; }\n value = meta[keyName] = { __ember_source__: obj };\n } else if (value.__ember_source__ !== obj) {\n if (!writable) { return undefined; }\n value = meta[keyName] = o_create(value);\n value.__ember_source__ = obj;\n }\n\n meta = value;\n }\n\n return value;\n};\n\n/**\n @private\n\n Wraps the passed function so that `this._super` will point to the superFunc\n when the function is invoked. This is the primitive we use to implement\n calls to super.\n\n @method wrap\n @for Ember\n @param {Function} func The function to call\n @param {Function} superFunc The super function.\n @return {Function} wrapped function.\n*/\nEmber.wrap = function(func, superFunc) {\n function K() {}\n\n function superWrapper() {\n var ret, sup = this._super;\n this._super = superFunc || K;\n ret = func.apply(this, arguments);\n this._super = sup;\n return ret;\n }\n\n superWrapper.wrappedFunction = func;\n superWrapper.__ember_observes__ = func.__ember_observes__;\n superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__;\n\n return superWrapper;\n};\n\n/**\n Returns true if the passed object is an array or Array-like.\n\n Ember Array Protocol:\n\n - the object has an objectAt property\n - the object is a native Array\n - the object is an Object, and has a length property\n\n Unlike `Ember.typeOf` this method returns true even if the passed object is\n not formally array but appears to be array-like (i.e. implements `Ember.Array`)\n\n ```javascript\n Ember.isArray(); // false\n Ember.isArray([]); // true\n Ember.isArray( Ember.ArrayProxy.create({ content: [] }) ); // true\n ```\n\n @method isArray\n @for Ember\n @param {Object} obj The object to test\n @return {Boolean}\n*/\nEmber.isArray = function(obj) {\n if (!obj || obj.setInterval) { return false; }\n if (Array.isArray && Array.isArray(obj)) { return true; }\n if (Ember.Array && Ember.Array.detect(obj)) { return true; }\n if ((obj.length !== undefined) && 'object'===typeof obj) { return true; }\n return false;\n};\n\n/**\n Forces the passed object to be part of an array. If the object is already\n an array or array-like, returns the object. Otherwise adds the object to\n an array. If obj is `null` or `undefined`, returns an empty array.\n\n ```javascript\n Ember.makeArray(); // []\n Ember.makeArray(null); // []\n Ember.makeArray(undefined); // []\n Ember.makeArray('lindsay'); // ['lindsay']\n Ember.makeArray([1,2,42]); // [1,2,42]\n\n var controller = Ember.ArrayProxy.create({ content: [] });\n Ember.makeArray(controller) === controller; // true\n ```\n\n @method makeArray\n @for Ember\n @param {Object} obj the object\n @return {Array}\n*/\nEmber.makeArray = function(obj) {\n if (obj === null || obj === undefined) { return []; }\n return Ember.isArray(obj) ? obj : [obj];\n};\n\nfunction canInvoke(obj, methodName) {\n return !!(obj && typeof obj[methodName] === 'function');\n}\n\n/**\n Checks to see if the `methodName` exists on the `obj`.\n\n @method canInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n*/\nEmber.canInvoke = canInvoke;\n\n/**\n Checks to see if the `methodName` exists on the `obj`,\n and if it does, invokes it with the arguments passed.\n\n @method tryInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @param {Array} [args] The arguments to pass to the method\n @return {anything} the return value of the invoked method or undefined if it cannot be invoked\n*/\nEmber.tryInvoke = function(obj, methodName, args) {\n if (canInvoke(obj, methodName)) {\n return obj[methodName].apply(obj, args || []);\n }\n};\n\n// https://github.com/emberjs/ember.js/pull/1617\nvar needsFinallyFix = (function() {\n var count = 0;\n try{\n try { }\n finally {\n count++;\n throw new Error('needsFinallyFixTest');\n }\n } catch (e) {}\n\n return count !== 1;\n})();\n\n/**\n Provides try { } finally { } functionality, while working\n around Safari's double finally bug.\n\n @method tryFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} finalizer The function to run the finally callback\n @param [binding]\n @return {anything} The return value is the that of the finalizer,\n unless that valueis undefined, in which case it is the return value\n of the tryable\n*/\n\nif (needsFinallyFix) {\n Ember.tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e){\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n} else {\n Ember.tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n}\n\n/**\n Provides try { } catch finally { } functionality, while working\n around Safari's double finally bug.\n\n @method tryCatchFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} catchable The function to run the catchable callback\n @param {Function} finalizer The function to run the finally callback\n @param [binding]\n @return {anything} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable.\n*/\nif (needsFinallyFix) {\n Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult, finalError, finalReturn;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e){\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n} else {\n Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n}\n\n})();\n//@ sourceURL=ember-metal/utils");minispade.register('ember-metal/watching', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/accessors');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/array');\n\n/**\n@module ember-metal\n*/\n\nvar guidFor = Ember.guidFor, // utils.js\n metaFor = Ember.meta, // utils.js\n get = Ember.get, // accessors.js\n set = Ember.set, // accessors.js\n normalizeTuple = Ember.normalizeTuple, // accessors.js\n GUID_KEY = Ember.GUID_KEY, // utils.js\n META_KEY = Ember.META_KEY, // utils.js\n // circular reference observer depends on Ember.watch\n // we should move change events to this file or its own property_events.js\n forEach = Ember.ArrayPolyfills.forEach, // array.js\n FIRST_KEY = /^([^\\.\\*]+)/,\n IS_PATH = /[\\.\\*]/;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\no_defineProperty = Ember.platform.defineProperty;\n\nfunction firstKey(path) {\n return path.match(FIRST_KEY)[0];\n}\n\n// returns true if the passed path is just a keyName\nfunction isKeyName(path) {\n return path==='*' || !IS_PATH.test(path);\n}\n\n// ..........................................................\n// DEPENDENT KEYS\n//\n\nfunction iterDeps(method, obj, depKey, seen, meta) {\n\n var guid = guidFor(obj);\n if (!seen[guid]) seen[guid] = {};\n if (seen[guid][depKey]) return;\n seen[guid][depKey] = true;\n\n var deps = meta.deps;\n deps = deps && deps[depKey];\n if (deps) {\n for(var key in deps) {\n var desc = meta.descs[key];\n if (desc && desc._suspended === obj) continue;\n method(obj, key);\n }\n }\n}\n\n\nvar WILL_SEEN, DID_SEEN;\n\n// called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...)\nfunction dependentKeysWillChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = WILL_SEEN, top = !seen;\n if (top) { seen = WILL_SEEN = {}; }\n iterDeps(propertyWillChange, obj, depKey, seen, meta);\n if (top) { WILL_SEEN = null; }\n}\n\n// called whenever a property has just changed to update dependent keys\nfunction dependentKeysDidChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = DID_SEEN, top = !seen;\n if (top) { seen = DID_SEEN = {}; }\n iterDeps(propertyDidChange, obj, depKey, seen, meta);\n if (top) { DID_SEEN = null; }\n}\n\n// ..........................................................\n// CHAIN\n//\n\nfunction addChainWatcher(obj, keyName, node) {\n if (!obj || ('object' !== typeof obj)) { return; } // nothing to do\n\n var m = metaFor(obj), nodes = m.chainWatchers;\n\n if (!m.hasOwnProperty('chainWatchers')) {\n nodes = m.chainWatchers = {};\n }\n\n if (!nodes[keyName]) { nodes[keyName] = []; }\n nodes[keyName].push(node);\n Ember.watch(obj, keyName);\n}\n\nfunction removeChainWatcher(obj, keyName, node) {\n if (!obj || 'object' !== typeof obj) { return; } // nothing to do\n\n var m = metaFor(obj, false);\n if (!m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m.chainWatchers;\n\n if (nodes[keyName]) {\n nodes = nodes[keyName];\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i] === node) { nodes.splice(i, 1); }\n }\n }\n Ember.unwatch(obj, keyName);\n}\n\nvar pendingQueue = [];\n\n// attempts to add the pendingQueue chains again. If some of them end up\n// back in the queue and reschedule is true, schedules a timeout to try\n// again.\nfunction flushPendingChains() {\n if (pendingQueue.length === 0) { return; } // nothing to do\n\n var queue = pendingQueue;\n pendingQueue = [];\n\n forEach.call(queue, function(q) { q[0].add(q[1]); });\n\n Ember.warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);\n}\n\nfunction isProto(pvalue) {\n return metaFor(pvalue, false).proto === pvalue;\n}\n\n// A ChainNode watches a single key on an object. If you provide a starting\n// value for the key then the node won't actually watch it. For a root node\n// pass null for parent and key and object for value.\nvar ChainNode = function(parent, key, value) {\n var obj;\n this._parent = parent;\n this._key = key;\n\n // _watching is true when calling get(this._parent, this._key) will\n // return the value of this node.\n //\n // It is false for the root of a chain (because we have no parent)\n // and for global paths (because the parent node is the object with\n // the observer on it)\n this._watching = value===undefined;\n\n this._value = value;\n this._paths = {};\n if (this._watching) {\n this._object = parent.value();\n if (this._object) { addChainWatcher(this._object, this._key, this); }\n }\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n //\n // TODO: Replace this with an efficient callback that the EachProxy\n // can implement.\n if (this._parent && this._parent._key === '@each') {\n this.value();\n }\n};\n\nvar ChainNodePrototype = ChainNode.prototype;\n\nChainNodePrototype.value = function() {\n if (this._value === undefined && this._watching) {\n var obj = this._parent.value();\n this._value = (obj && !isProto(obj)) ? get(obj, this._key) : undefined;\n }\n return this._value;\n};\n\nChainNodePrototype.destroy = function() {\n if (this._watching) {\n var obj = this._object;\n if (obj) { removeChainWatcher(obj, this._key, this); }\n this._watching = false; // so future calls do nothing\n }\n};\n\n// copies a top level object only\nChainNodePrototype.copy = function(obj) {\n var ret = new ChainNode(null, null, obj),\n paths = this._paths, path;\n for (path in paths) {\n if (paths[path] <= 0) { continue; } // this check will also catch non-number vals.\n ret.add(path);\n }\n return ret;\n};\n\n// called on the root node of a chain to setup watchers on the specified\n// path.\nChainNodePrototype.add = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n paths[path] = (paths[path] || 0) + 1;\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n\n // the path was a local path\n if (tuple[0] && tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n\n // global path, but object does not exist yet.\n // put into a queue and try to connect later.\n } else if (!tuple[0]) {\n pendingQueue.push([this, path]);\n tuple.length = 0;\n return;\n\n // global path, and object already exists\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.chain(key, path, src);\n};\n\n// called on the root node of a chain to teardown watcher on the specified\n// path\nChainNodePrototype.remove = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n if (paths[path] > 0) { paths[path]--; }\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n if (tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.unchain(key, path);\n};\n\nChainNodePrototype.count = 0;\n\nChainNodePrototype.chain = function(key, path, src) {\n var chains = this._chains, node;\n if (!chains) { chains = this._chains = {}; }\n\n node = chains[key];\n if (!node) { node = chains[key] = new ChainNode(this, key, src); }\n node.count++; // count chains...\n\n // chain rest of path if there is one\n if (path && path.length>0) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.chain(key, path); // NOTE: no src means it will observe changes...\n }\n};\n\nChainNodePrototype.unchain = function(key, path) {\n var chains = this._chains, node = chains[key];\n\n // unchain rest of path first...\n if (path && path.length>1) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.unchain(key, path);\n }\n\n // delete node if needed.\n node.count--;\n if (node.count<=0) {\n delete chains[node._key];\n node.destroy();\n }\n\n};\n\nChainNodePrototype.willChange = function() {\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].willChange();\n }\n }\n\n if (this._parent) { this._parent.chainWillChange(this, this._key, 1); }\n};\n\nChainNodePrototype.chainWillChange = function(chain, path, depth) {\n if (this._key) { path = this._key + '.' + path; }\n\n if (this._parent) {\n this._parent.chainWillChange(this, path, depth+1);\n } else {\n if (depth > 1) { Ember.propertyWillChange(this.value(), path); }\n path = 'this.' + path;\n if (this._paths[path] > 0) { Ember.propertyWillChange(this.value(), path); }\n }\n};\n\nChainNodePrototype.chainDidChange = function(chain, path, depth) {\n if (this._key) { path = this._key + '.' + path; }\n if (this._parent) {\n this._parent.chainDidChange(this, path, depth+1);\n } else {\n if (depth > 1) { Ember.propertyDidChange(this.value(), path); }\n path = 'this.' + path;\n if (this._paths[path] > 0) { Ember.propertyDidChange(this.value(), path); }\n }\n};\n\nChainNodePrototype.didChange = function(suppressEvent) {\n // invalidate my own value first.\n if (this._watching) {\n var obj = this._parent.value();\n if (obj !== this._object) {\n removeChainWatcher(this._object, this._key, this);\n this._object = obj;\n addChainWatcher(obj, this._key, this);\n }\n this._value = undefined;\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n if (this._parent && this._parent._key === '@each')\n this.value();\n }\n\n // then notify chains...\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].didChange(suppressEvent);\n }\n }\n\n if (suppressEvent) { return; }\n\n // and finally tell parent about my path changing...\n if (this._parent) { this._parent.chainDidChange(this, this._key, 1); }\n};\n\n// get the chains for the current object. If the current object has\n// chains inherited from the proto they will be cloned and reconfigured for\n// the current object.\nfunction chainsFor(obj) {\n var m = metaFor(obj), ret = m.chains;\n if (!ret) {\n ret = m.chains = new ChainNode(null, null, obj);\n } else if (ret.value() !== obj) {\n ret = m.chains = ret.copy(obj);\n }\n return ret;\n}\n\nEmber.overrideChains = function(obj, keyName, m) {\n chainsDidChange(obj, keyName, m, true);\n};\n\nfunction chainsWillChange(obj, keyName, m, arg) {\n if (!m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m.chainWatchers;\n\n nodes = nodes[keyName];\n if (!nodes) { return; }\n\n for(var i = 0, l = nodes.length; i < l; i++) {\n nodes[i].willChange(arg);\n }\n}\n\nfunction chainsDidChange(obj, keyName, m, arg) {\n if (!m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m.chainWatchers;\n\n nodes = nodes[keyName];\n if (!nodes) { return; }\n\n // looping in reverse because the chainWatchers array can be modified inside didChange\n for (var i = nodes.length - 1; i >= 0; i--) {\n nodes[i].didChange(arg);\n }\n}\n\n// ..........................................................\n// WATCH\n//\n\n/**\n @private\n\n Starts watching a property on an object. Whenever the property changes,\n invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the\n primitive used by observers and dependent keys; usually you will never call\n this method directly but instead use higher level methods like\n `Ember.addObserver()`\n\n @method watch\n @for Ember\n @param obj\n @param {String} keyName\n*/\nEmber.watch = function(obj, keyName) {\n // can't watch length on Array - it is special...\n if (keyName === 'length' && Ember.typeOf(obj) === 'array') { return this; }\n\n var m = metaFor(obj), watching = m.watching, desc;\n\n // activate watching first time\n if (!watching[keyName]) {\n watching[keyName] = 1;\n if (isKeyName(keyName)) {\n desc = m.descs[keyName];\n if (desc && desc.willWatch) { desc.willWatch(obj, keyName); }\n\n if ('function' === typeof obj.willWatchProperty) {\n obj.willWatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n m.values[keyName] = obj[keyName];\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: Ember.MANDATORY_SETTER_FUNCTION,\n get: Ember.DEFAULT_GETTER_FUNCTION(keyName)\n });\n }\n } else {\n chainsFor(obj).add(keyName);\n }\n\n } else {\n watching[keyName] = (watching[keyName] || 0) + 1;\n }\n return this;\n};\n\nEmber.isWatching = function isWatching(obj, key) {\n var meta = obj[META_KEY];\n return (meta && meta.watching[key]) > 0;\n};\n\nEmber.watch.flushPending = flushPendingChains;\n\nEmber.unwatch = function(obj, keyName) {\n // can't watch length on Array - it is special...\n if (keyName === 'length' && Ember.typeOf(obj) === 'array') { return this; }\n\n var m = metaFor(obj), watching = m.watching, desc;\n\n if (watching[keyName] === 1) {\n watching[keyName] = 0;\n\n if (isKeyName(keyName)) {\n desc = m.descs[keyName];\n if (desc && desc.didUnwatch) { desc.didUnwatch(obj, keyName); }\n\n if ('function' === typeof obj.didUnwatchProperty) {\n obj.didUnwatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: m.values[keyName]\n });\n delete m.values[keyName];\n }\n } else {\n chainsFor(obj).remove(keyName);\n }\n\n } else if (watching[keyName]>1) {\n watching[keyName]--;\n }\n\n return this;\n};\n\n/**\n @private\n\n Call on an object when you first beget it from another object. This will\n setup any chained watchers on the object instance as needed. This method is\n safe to call multiple times.\n\n @method rewatch\n @for Ember\n @param obj\n*/\nEmber.rewatch = function(obj) {\n var m = metaFor(obj, false), chains = m.chains;\n\n // make sure the object has its own guid.\n if (GUID_KEY in obj && !obj.hasOwnProperty(GUID_KEY)) {\n Ember.generateGuid(obj, 'ember');\n }\n\n // make sure any chained watchers update.\n if (chains && chains.value() !== obj) {\n m.chains = chains.copy(obj);\n }\n\n return this;\n};\n\nEmber.finishChains = function(obj) {\n var m = metaFor(obj, false), chains = m.chains;\n if (chains) {\n if (chains.value() !== obj) {\n m.chains = chains = chains.copy(obj);\n }\n chains.didChange(true);\n }\n};\n\n// ..........................................................\n// PROPERTY CHANGES\n//\n\n/**\n This function is called just before an object property is about to change.\n It will notify any before observers and prepare caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyDidChange()` which you should call just\n after the property value changes.\n\n @method propertyWillChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n*/\nfunction propertyWillChange(obj, keyName) {\n var m = metaFor(obj, false),\n watching = m.watching[keyName] > 0 || keyName === 'length',\n proto = m.proto,\n desc = m.descs[keyName];\n\n if (!watching) { return; }\n if (proto === obj) { return; }\n if (desc && desc.willChange) { desc.willChange(obj, keyName); }\n dependentKeysWillChange(obj, keyName, m);\n chainsWillChange(obj, keyName, m);\n Ember.notifyBeforeObservers(obj, keyName);\n}\n\nEmber.propertyWillChange = propertyWillChange;\n\n/**\n This function is called just after an object property has changed.\n It will notify any observers and clear caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyWilLChange()` which you should call just\n before the property value changes.\n\n @method propertyDidChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n*/\nfunction propertyDidChange(obj, keyName) {\n var m = metaFor(obj, false),\n watching = m.watching[keyName] > 0 || keyName === 'length',\n proto = m.proto,\n desc = m.descs[keyName];\n\n if (proto === obj) { return; }\n\n // shouldn't this mean that we're watching this key?\n if (desc && desc.didChange) { desc.didChange(obj, keyName); }\n if (!watching && keyName !== 'length') { return; }\n\n dependentKeysDidChange(obj, keyName, m);\n chainsDidChange(obj, keyName, m);\n Ember.notifyObservers(obj, keyName);\n}\n\nEmber.propertyDidChange = propertyDidChange;\n\nvar NODE_STACK = [];\n\n/**\n Tears down the meta on an object so that it can be garbage collected.\n Multiple calls will have no effect.\n\n @method destroy\n @for Ember\n @param {Object} obj the object to destroy\n @return {void}\n*/\nEmber.destroy = function (obj) {\n var meta = obj[META_KEY], node, nodes, key, nodeObject;\n if (meta) {\n obj[META_KEY] = null;\n // remove chainWatchers to remove circular references that would prevent GC\n node = meta.chains;\n if (node) {\n NODE_STACK.push(node);\n // process tree\n while (NODE_STACK.length > 0) {\n node = NODE_STACK.pop();\n // push children\n nodes = node._chains;\n if (nodes) {\n for (key in nodes) {\n if (nodes.hasOwnProperty(key)) {\n NODE_STACK.push(nodes[key]);\n }\n }\n }\n // remove chainWatcher in node object\n if (node._watching) {\n nodeObject = node._object;\n if (nodeObject) {\n removeChainWatcher(nodeObject, node._key, node);\n }\n }\n }\n }\n }\n};\n\n})();\n//@ sourceURL=ember-metal/watching");minispade.register('ember-old-router/application', "(function() {minispade.require('ember-views');\nminispade.require('ember-states');\nminispade.require('ember-old-router/application/system');\n\n/**\nEmber Application\n\n@module ember\n@submodule ember-old-router\n@requires ember-views, ember-states, ember-routing\n*/\n\n})();\n//@ sourceURL=ember-old-router/application");minispade.register('ember-old-router/application/system', "(function() {minispade.require('ember-old-router/application/system/dag');\nminispade.require('ember-old-router/application/system/application');\n\n})();\n//@ sourceURL=ember-old-router/application/system");minispade.register('ember-old-router/application/system/application', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n An instance of `Ember.Application` is the starting point for every Ember\n application. It helps to instantiate, initialize and coordinate the many\n objects that make up your app.\n\n Each Ember app has one and only one `Ember.Application` object. In fact, the\n very first thing you should do in your application is create the instance:\n\n ```javascript\n window.App = Ember.Application.create();\n ```\n\n Typically, the application object is the only global variable. All other\n classes in your app should be properties on the `Ember.Application` instance,\n which highlights its first role: a global namespace.\n\n For example, if you define a view class, it might look like this:\n\n ```javascript\n App.MyView = Ember.View.extend();\n ```\n\n Calling `Ember.Application.create()` will automatically initialize your\n application by calling the `Ember.Application.initialize()` method. If you\n need to delay initialization, you can pass `{autoinit: false}` to the\n `Ember.Application.create()` method, and call `App.initialize()`\n later.\n\n Because `Ember.Application` inherits from `Ember.Namespace`, any classes\n you create will have useful string representations when calling `toString()`.\n See the `Ember.Namespace` documentation for more information.\n\n While you can think of your `Ember.Application` as a container that holds the\n other classes in your application, there are several other responsibilities\n going on under-the-hood that you may want to understand.\n\n ### Event Delegation\n\n Ember uses a technique called _event delegation_. This allows the framework\n to set up a global, shared event listener instead of requiring each view to\n do it manually. For example, instead of each view registering its own\n `mousedown` listener on its associated element, Ember sets up a `mousedown`\n listener on the `body`.\n\n If a `mousedown` event occurs, Ember will look at the target of the event and\n start walking up the DOM node tree, finding corresponding views and invoking\n their `mouseDown` method as it goes.\n\n `Ember.Application` has a number of default events that it listens for, as\n well as a mapping from lowercase events to camel-cased view method names. For\n example, the `keypress` event causes the `keyPress` method on the view to be\n called, the `dblclick` event causes `doubleClick` to be called, and so on.\n\n If there is a browser event that Ember does not listen for by default, you\n can specify custom events and their corresponding view method names by\n setting the application's `customEvents` property:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the loadedmetadata media\n // player event\n 'loadedmetadata': \"loadedMetadata\"\n }\n });\n ```\n\n By default, the application sets up these event listeners on the document\n body. However, in cases where you are embedding an Ember application inside\n an existing page, you may want it to set up the listeners on an element\n inside the body.\n\n For example, if only events inside a DOM element with the ID of `ember-app`\n should be delegated, set your application's `rootElement` property:\n\n ```javascript\n window.App = Ember.Application.create({\n rootElement: '#ember-app'\n });\n ```\n\n The `rootElement` can be either a DOM element or a jQuery-compatible selector\n string. Note that *views appended to the DOM outside the root element will\n not receive events.* If you specify a custom root element, make sure you only\n append views inside it!\n\n To learn more about the advantages of event delegation and the Ember view\n layer, and a list of the event listeners that are setup by default, visit the\n [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation).\n\n ### Dependency Injection\n\n One thing you may have noticed while using Ember is that you define\n *classes*, not *instances*. When your application loads, all of the instances\n are created for you. Creating these instances is the responsibility of\n `Ember.Application`.\n\n When the `Ember.Application` initializes, it will look for an `Ember.Router`\n class defined on the applications's `Router` property, like this:\n\n ```javascript\n App.Router = Ember.Router.extend({\n // ...\n });\n ```\n\n If found, the router is instantiated and saved on the application's `router`\n property (note the lowercase 'r'). While you should *not* reference this\n router instance directly from your application code, having access to\n `App.router` from the console can be useful during debugging.\n\n After the router is created, the application loops through all of the\n registered _injections_ and invokes them once for each property on the\n `Ember.Application` object.\n\n An injection is a function that is responsible for instantiating objects from\n classes defined on the application. By default, the only injection registered\n instantiates controllers and makes them available on the router.\n\n For example, if you define a controller class:\n\n ```javascript\n App.MyController = Ember.Controller.extend({\n // ...\n });\n ```\n\n Your router will receive an instance of `App.MyController` saved on its\n `myController` property.\n\n Libraries on top of Ember can register additional injections. For example,\n if your application is using Ember Data, it registers an injection that\n instantiates `DS.Store`:\n\n ```javascript\n Ember.Application.registerInjection({\n name: 'store',\n before: 'controllers',\n\n injection: function(app, router, property) {\n if (property === 'Store') {\n set(router, 'store', app[property].create());\n }\n }\n });\n ```\n\n ### Routing\n\n In addition to creating your application's router, `Ember.Application` is\n also responsible for telling the router when to start routing.\n\n By default, the router will begin trying to translate the current URL into\n application state once the browser emits the `DOMContentReady` event. If you\n need to defer routing, you can call the application's `deferReadiness()`\n method. Once routing can begin, call the `advanceReadiness()` method.\n\n If there is any setup required before routing begins, you can implement a\n `ready()` method on your app that will be invoked immediately before routing\n begins:\n\n ```javascript\n window.App = Ember.Application.create({\n ready: function() {\n this.set('router.enableLogging', true);\n }\n });\n\n To begin routing, you must have at a minimum a top-level controller and view.\n You define these as `App.ApplicationController` and `App.ApplicationView`,\n respectively. Your application will not work if you do not define these two\n mandatory classes. For example:\n\n ```javascript\n App.ApplicationView = Ember.View.extend({\n templateName: 'application'\n });\n App.ApplicationController = Ember.Controller.extend();\n ```\n\n @class Application\n @namespace Ember\n @extends Ember.Namespace\n*/\nEmber.Application = Ember.Namespace.extend(\n/** @scope Ember.Application.prototype */{\n\n /**\n The root DOM element of the Application. This can be specified as an\n element or a\n [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).\n\n This is the element that will be passed to the Application's,\n `eventDispatcher`, which sets up the listeners for event delegation. Every\n view in your application should be a child of the element you specify here.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n The `Ember.EventDispatcher` responsible for delegating events to this\n application's views.\n\n The event dispatcher is created by the application at initialization time\n and sets up event listeners on the DOM element described by the\n application's `rootElement` property.\n\n See the documentation for `Ember.EventDispatcher` for more information.\n\n @property eventDispatcher\n @type Ember.EventDispatcher\n @default null\n */\n eventDispatcher: null,\n\n /**\n The DOM events for which the event dispatcher should listen.\n\n By default, the application's `Ember.EventDispatcher` listens\n for a set of standard DOM events, such as `mousedown` and\n `keyup`, and delegates them to your application's `Ember.View`\n instances.\n\n If you would like additional events to be delegated to your\n views, set your `Ember.Application`'s `customEvents` property\n to a hash containing the DOM event name as the key and the\n corresponding view method name as the value. For example:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the loadedmetadata media\n // player event\n 'loadedmetadata': \"loadedMetadata\"\n }\n });\n ```\n\n @property customEvents\n @type Object\n @default null\n */\n customEvents: null,\n\n /**\n Should the application initialize itself after it's created. You can\n set this to `false` if you'd like to choose when to initialize your\n application. This defaults to `!Ember.testing`\n\n @property autoinit\n @type Boolean\n */\n autoinit: !Ember.testing,\n\n isInitialized: false,\n\n init: function() {\n if (!this.$) { this.$ = Ember.$; }\n\n this._super();\n\n this.createEventDispatcher();\n\n // Start off the number of deferrals at 1. This will be\n // decremented by the Application's own `initialize` method.\n this._readinessDeferrals = 1;\n\n this.waitForDOMContentLoaded();\n\n if (this.autoinit) {\n var self = this;\n this.$().ready(function() {\n if (self.isDestroyed || self.isInitialized) return;\n self.initialize();\n });\n }\n },\n\n /** @private */\n createEventDispatcher: function() {\n var rootElement = get(this, 'rootElement'),\n eventDispatcher = Ember.EventDispatcher.create({\n rootElement: rootElement\n });\n\n set(this, 'eventDispatcher', eventDispatcher);\n },\n\n waitForDOMContentLoaded: function() {\n this.deferReadiness();\n\n var self = this;\n this.$().ready(function() {\n self.advanceReadiness();\n });\n },\n\n deferReadiness: function() {\n Ember.assert(\"You cannot defer readiness since the `ready()` hook has already been called.\", this._readinessDeferrals > 0);\n this._readinessDeferrals++;\n },\n\n advanceReadiness: function() {\n this._readinessDeferrals--;\n\n if (this._readinessDeferrals === 0) {\n Ember.run.once(this, this.didBecomeReady);\n }\n },\n\n /**\n Instantiate all controllers currently available on the namespace\n and inject them onto a router.\n\n Example:\n\n ```javascript\n App.PostsController = Ember.ArrayController.extend();\n App.CommentsController = Ember.ArrayController.extend();\n\n var router = Ember.Router.create({\n ...\n });\n\n App.initialize(router);\n\n router.get('postsController'); // <App.PostsController:ember1234>\n router.get('commentsController'); // <App.CommentsController:ember1235>\n ```\n\n @method initialize\n @param router {Ember.Router}\n */\n initialize: function(router) {\n Ember.assert(\"Application initialize may only be called once\", !this.isInitialized);\n Ember.assert(\"Application not destroyed\", !this.isDestroyed);\n\n router = this.setupRouter(router);\n\n this.runInjections(router);\n\n Ember.runLoadHooks('application', this);\n\n this.isInitialized = true;\n\n // At this point, any injections or load hooks that would have wanted\n // to defer readiness have fired.\n this.advanceReadiness();\n\n return this;\n },\n\n /** @private */\n runInjections: function(router) {\n var injections = get(this.constructor, 'injections'),\n graph = new Ember.DAG(),\n namespace = this,\n properties, i, injection;\n\n for (i=0; i<injections.length; i++) {\n injection = injections[i];\n graph.addEdges(injection.name, injection.injection, injection.before, injection.after);\n }\n\n graph.topsort(function (vertex) {\n var injection = vertex.value,\n properties = Ember.A(Ember.keys(namespace));\n properties.forEach(function(property) {\n injection(namespace, router, property);\n });\n });\n },\n\n /** @private */\n setupRouter: function(router) {\n if (!router && Ember.Router.detect(this.Router)) {\n router = this.Router.create();\n this._createdRouter = router;\n }\n\n if (router) {\n set(this, 'router', router);\n\n // By default, the router's namespace is the current application.\n //\n // This allows it to find model classes when a state has a\n // route like `/posts/:post_id`. In that case, it would first\n // convert `post_id` into `Post`, and then look it up on its\n // namespace.\n set(router, 'namespace', this);\n }\n\n return router;\n },\n\n /** @private */\n didBecomeReady: function() {\n var eventDispatcher = get(this, 'eventDispatcher'),\n customEvents = get(this, 'customEvents'),\n router;\n\n eventDispatcher.setup(customEvents);\n\n this.ready();\n\n\n router = get(this, 'router');\n\n this.createApplicationView(router);\n\n if (router && router instanceof Ember.Router) {\n this.startRouting(router);\n }\n\n Ember.BOOTED = true;\n },\n\n createApplicationView: function (router) {\n var rootElement = get(this, 'rootElement'),\n applicationViewOptions = {},\n applicationViewClass = this.ApplicationView,\n applicationTemplate = Ember.TEMPLATES.application,\n applicationController, applicationView;\n\n // don't do anything unless there is an ApplicationView or application template\n if (!applicationViewClass && !applicationTemplate) return;\n\n if (router) {\n applicationController = get(router, 'applicationController');\n if (applicationController) {\n applicationViewOptions.controller = applicationController;\n }\n }\n\n if (applicationTemplate) {\n applicationViewOptions.template = applicationTemplate;\n }\n\n if (!applicationViewClass) {\n applicationViewClass = Ember.View;\n }\n\n applicationView = applicationViewClass.create(applicationViewOptions);\n\n this._createdApplicationView = applicationView;\n\n if (router) {\n set(router, 'applicationView', applicationView);\n }\n\n applicationView.appendTo(rootElement);\n },\n\n /**\n @private\n\n If the application has a router, use it to route to the current URL, and\n trigger a new call to `route` whenever the URL changes.\n\n @method startRouting\n @property router {Ember.Router}\n */\n startRouting: function(router) {\n var location = get(router, 'location');\n\n Ember.assert(\"You must have an application template or ApplicationView defined on your application\", get(router, 'applicationView') );\n Ember.assert(\"You must have an ApplicationController defined on your application\", get(router, 'applicationController') );\n\n router.route(location.getURL());\n location.onUpdateURL(function(url) {\n router.route(url);\n });\n },\n\n /**\n Called when the Application has become ready.\n The call will be delayed until the DOM has become ready.\n\n @event ready\n */\n ready: Ember.K,\n\n willDestroy: function() {\n get(this, 'eventDispatcher').destroy();\n if (this._createdRouter) { this._createdRouter.destroy(); }\n if (this._createdApplicationView) { this._createdApplicationView.destroy(); }\n },\n\n registerInjection: function(options) {\n this.constructor.registerInjection(options);\n }\n});\n\nEmber.Application.reopenClass({\n concatenatedProperties: ['injections'],\n injections: Ember.A(),\n registerInjection: function(injection) {\n var injections = get(this, 'injections');\n\n Ember.assert(\"The injection '\" + injection.name + \"' has already been registered\", !injections.findProperty('name', injection.name));\n Ember.assert(\"An injection cannot be registered with both a before and an after\", !(injection.before && injection.after));\n Ember.assert(\"An injection cannot be registered without an injection function\", Ember.canInvoke(injection, 'injection'));\n\n injections.push(injection);\n }\n});\n\nEmber.Application.registerInjection({\n name: 'controllers',\n injection: function(app, router, property) {\n if (!router) { return; }\n if (!/^[A-Z].*Controller$/.test(property)) { return; }\n\n var name = property.charAt(0).toLowerCase() + property.substr(1),\n controllerClass = app[property], controller;\n\n if(!Ember.Object.detect(controllerClass)){ return; }\n controller = app[property].create();\n\n router.set(name, controller);\n\n controller.setProperties({\n target: router,\n controllers: router,\n namespace: app\n });\n }\n});\n\nEmber.runLoadHooks('Ember.Application', Ember.Application);\n\n\n})();\n//@ sourceURL=ember-old-router/application/system/application");minispade.register('ember-old-router/application/system/dag', "(function() {function visit(vertex, fn, visited, path) {\n var name = vertex.name,\n vertices = vertex.incoming,\n names = vertex.incomingNames,\n len = names.length,\n i;\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n}\n\nfunction DAG() {\n this.names = [];\n this.vertices = {};\n}\n\nDAG.prototype.add = function(name) {\n if (!name) { return; }\n if (this.vertices.hasOwnProperty(name)) {\n return this.vertices[name];\n }\n var vertex = {\n name: name, incoming: {}, incomingNames: [], hasOutgoing: false, value: null\n };\n this.vertices[name] = vertex;\n this.names.push(name);\n return vertex;\n};\n\nDAG.prototype.map = function(name, value) {\n this.add(name).value = value;\n};\n\nDAG.prototype.addEdge = function(fromName, toName) {\n if (!fromName || !toName || fromName === toName) {\n return;\n }\n var from = this.add(fromName), to = this.add(toName);\n if (to.incoming.hasOwnProperty(fromName)) {\n return;\n }\n function checkCycle(vertex, path) {\n if (vertex.name === toName) {\n throw new Error(\"cycle detected: \" + toName + \" <- \" + path.join(\" <- \"));\n }\n }\n visit(from, checkCycle);\n from.hasOutgoing = true;\n to.incoming[fromName] = from;\n to.incomingNames.push(fromName);\n};\n\nDAG.prototype.topsort = function(fn) {\n var visited = {},\n vertices = this.vertices,\n names = this.names,\n len = names.length,\n i, vertex;\n for (i = 0; i < len; i++) {\n vertex = vertices[names[i]];\n if (!vertex.hasOutgoing) {\n visit(vertex, fn, visited);\n }\n }\n};\n\nDAG.prototype.addEdges = function(name, value, before, after) {\n var i;\n this.map(name, value);\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n for (i = 0; i < before.length; i++) {\n this.addEdge(name, before[i]);\n }\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n for (i = 0; i < after.length; i++) {\n this.addEdge(after[i], name);\n }\n }\n }\n};\n\nEmber.DAG = DAG;\n\n})();\n//@ sourceURL=ember-old-router/application/system/dag");minispade.register('ember-old-router/controller_ext', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\nAdditional methods for the ControllerMixin\n\n@class ControllerMixin\n@namespace Ember\n*/\nEmber.ControllerMixin.reopen({\n controllers: null,\n\n /**\n `connectOutlet` creates a new instance of a provided view\n class, wires it up to its associated controller, and\n assigns the new view to a property on the current controller.\n\n The purpose of this method is to enable views that use\n outlets to quickly assign new views for a given outlet.\n\n For example, an application view's template may look like\n this:\n\n ``` handlebars\n <h1>My Blog</h1>\n {{outlet}}\n ```\n\n The view for this outlet is specified by assigning a\n `view` property to the application's controller. The\n following code will assign a new `App.PostsView` to\n that outlet:\n\n ``` javascript\n applicationController.connectOutlet('posts');\n ```\n\n In general, you will also want to assign a controller\n to the newly created view. By convention, a controller\n named `postsController` will be assigned as the view's\n controller.\n\n In an application initialized using `app.initialize(router)`,\n `connectOutlet` will look for `postsController` on the\n router. The initialization process will automatically\n create an instance of `App.PostsController` called\n `postsController`, so you don't need to do anything\n beyond `connectOutlet` to assign your view and wire it\n up to its associated controller.\n\n You can supply a `content` for the controller by supplying\n a final argument after the view class:\n\n ``` javascript\n applicationController.connectOutlet('posts', App.Post.find());\n ```\n\n You can specify a particular outlet to use. For example, if your main\n template looks like:\n\n ``` handlebars\n <h1>My Blog</h1>\n {{outlet masterView}}\n {{outlet detailView}}\n ```\n\n You can assign an `App.PostsView` to the masterView outlet:\n\n ``` javascript\n applicationController.connectOutlet({\n outletName: 'masterView',\n name: 'posts',\n context: App.Post.find()\n });\n ```\n\n You can write this as:\n\n ``` javascript\n applicationController.connectOutlet('masterView', 'posts', App.Post.find());\n ```\n\n\n @method connectOutlet\n @param {String} outletName a name for the outlet to set\n @param {String} name a view/controller pair name\n @param {Object} context a context object to assign to the\n controller's `content` property, if a controller can be\n found (optional)\n */\n connectOutlet: function(name, context) {\n // Normalize arguments. Supported arguments:\n //\n // name\n // name, context\n // outletName, name\n // outletName, name, context\n // options\n //\n // The options hash has the following keys:\n //\n // name: the name of the controller and view\n // to use. If this is passed, the name\n // determines the view and controller.\n // outletName: the name of the outlet to\n // fill in. default: 'view'\n // viewClass: the class of the view to instantiate\n // controller: the controller instance to pass\n // to the view\n // context: an object that should become the\n // controller's `content` and thus the\n // template's context.\n\n var outletName, viewClass, view, controller, options;\n\n if (Ember.typeOf(context) === 'string') {\n outletName = name;\n name = context;\n context = arguments[2];\n }\n\n if (arguments.length === 1) {\n if (Ember.typeOf(name) === 'object') {\n options = name;\n outletName = options.outletName;\n name = options.name;\n viewClass = options.viewClass;\n controller = options.controller;\n context = options.context;\n }\n } else {\n options = {};\n }\n\n outletName = outletName || 'view';\n\n Ember.assert(\"The viewClass is either missing or the one provided did not resolve to a view\", !!name || (!name && !!viewClass));\n\n Ember.assert(\"You must supply a name or a viewClass to connectOutlet, but not both\", (!!name && !viewClass && !controller) || (!name && !!viewClass));\n\n if (name) {\n var namespace = get(this, 'namespace'),\n controllers = get(this, 'controllers');\n\n var viewClassName = name.charAt(0).toUpperCase() + name.substr(1) + \"View\";\n viewClass = get(namespace, viewClassName);\n controller = get(controllers, name + 'Controller');\n\n Ember.assert(\"The name you supplied '\" + name + \"' did not resolve to a view \" + viewClassName, !!viewClass);\n Ember.assert(\"The name you supplied '\" + name + \"' did not resolve to a controller \" + name + 'Controller', (!!controller && !!context) || !context);\n }\n\n if (controller && context) { set(controller, 'content', context); }\n\n view = this.createOutletView(outletName, viewClass);\n\n if (controller) { set(view, 'controller', controller); }\n set(this, outletName, view);\n\n return view;\n },\n\n /**\n Convenience method to connect controllers. This method makes other controllers\n available on the controller the method was invoked on.\n\n For example, to make the `personController` and the `postController` available\n on the `overviewController`, you would call:\n\n ```javascript\n overviewController.connectControllers('person', 'post');\n ```\n\n @method connectControllers\n @param {String...} controllerNames the controllers to make available\n */\n connectControllers: function() {\n var controllers = get(this, 'controllers'),\n controllerNames = Array.prototype.slice.apply(arguments),\n controllerName;\n\n for (var i=0, l=controllerNames.length; i<l; i++) {\n controllerName = controllerNames[i] + 'Controller';\n set(this, controllerName, get(controllers, controllerName));\n }\n },\n\n /**\n `disconnectOutlet` removes previously attached view from given outlet.\n\n @method disconnectOutlet\n @param {String} outletName the outlet name. (optional)\n */\n disconnectOutlet: function(outletName) {\n outletName = outletName || 'view';\n\n set(this, outletName, null);\n },\n\n /**\n `createOutletView` is a hook you may want to override if you need to do\n something special with the view created for the outlet. For example\n you may want to implement views sharing across outlets.\n\n @method createOutletView\n @param outletName {String}\n @param viewClass {Ember.View}\n */\n createOutletView: function(outletName, viewClass) {\n return viewClass.create();\n },\n\n urlForEvent: function(event, context) {\n var target = get(this, 'target');\n\n if (target) {\n return target.urlForEvent(event, context);\n }\n }\n});\n\n\n})();\n//@ sourceURL=ember-old-router/controller_ext");minispade.register('ember-old-router/handlebars_ext', "(function() {minispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n /**\n @module ember\n @submodule ember-old-router\n */\n\n Handlebars.OutletView = Ember.ContainerView.extend(Ember._Metamorph);\n\n /**\n The `outlet` helper allows you to specify that the current\n view's controller will fill in the view for a given area.\n\n ``` handlebars\n {{outlet}}\n ```\n\n By default, when the the current controller's `view` property changes, the\n outlet will replace its current view with the new view. You can set the\n `view` property directly, but it's normally best to use `connectOutlet`.\n\n ``` javascript\n # Instantiate App.PostsView and assign to `view`, so as to render into outlet.\n controller.connectOutlet('posts');\n ```\n\n You can also specify a particular name other than `view`:\n\n ``` handlebars\n {{outlet masterView}}\n {{outlet detailView}}\n ```\n\n Then, you can control several outlets from a single controller.\n\n ``` javascript\n # Instantiate App.PostsView and assign to controller.masterView.\n controller.connectOutlet('masterView', 'posts');\n # Also, instantiate App.PostInfoView and assign to controller.detailView.\n controller.connectOutlet('detailView', 'postInfo');\n ```\n\n @method outlet\n @for Ember.Handlebars.helpers\n @param {String} property the property on the controller\n that holds the view for this outlet\n */\n Handlebars.registerHelper('outlet', function(property, options) {\n if (property && property.data && property.data.isRenderData) {\n options = property;\n property = 'view';\n }\n\n options.hash.currentViewBinding = \"view.context.\" + property;\n\n return Handlebars.helpers.view.call(this, Handlebars.OutletView, options);\n });\n\n});\n\n})();\n//@ sourceURL=ember-old-router/handlebars_ext");minispade.register('ember-old-router/helpers', "(function() {minispade.require('ember-old-router/helpers/action');\n\n})();\n//@ sourceURL=ember-old-router/helpers");minispade.register('ember-old-router/helpers/action', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar EmberHandlebars = Ember.Handlebars,\n handlebarsGet = EmberHandlebars.get,\n get = Ember.get,\n a_slice = Array.prototype.slice;\n\nvar ActionHelper = EmberHandlebars.ActionHelper = {\n registeredActions: {}\n};\n\nActionHelper.registerAction = function(actionName, options) {\n var actionId = (++Ember.uuid).toString();\n\n ActionHelper.registeredActions[actionId] = {\n eventName: options.eventName,\n handler: function(event) {\n var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,\n secondaryClick = event.which > 1, // IE9 may return undefined\n nonStandard = modifier || secondaryClick;\n\n if (options.link && nonStandard) {\n // Allow the browser to handle special link clicks normally\n return;\n }\n\n event.preventDefault();\n\n event.view = options.view;\n\n if (options.hasOwnProperty('context')) {\n event.context = options.context;\n }\n\n if (options.hasOwnProperty('contexts')) {\n event.contexts = options.contexts;\n }\n\n var target = options.target;\n\n // Check for StateManager (or compatible object)\n if (typeof target.send === 'function') {\n return target.send(actionName, event);\n } else {\n Ember.assert(Ember.String.fmt('Target %@ does not have action %@', [target, actionName]), target[actionName]);\n return target[actionName].call(target, event);\n }\n }\n };\n\n options.view.on('willClearRender', function() {\n delete ActionHelper.registeredActions[actionId];\n });\n\n return actionId;\n};\n\n/**\n The `{{action}}` helper registers an HTML element within a template for DOM\n event handling and forwards that interaction to the view's\n `controller.target` or supplied `target` option (see 'Specifying a Target').\n By default the `controller.target` is set to the application's router.\n\n User interaction with that element will invoke the supplied action name on\n the appropriate target.\n\n Given the following Handlebars template on the page\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName target=\"view\"}}>\n click me\n </div>\n </script>\n ```\n\n And application code\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'a-template',\n anActionName: function(event){}\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will results in the following rendered HTML\n\n ```html\n <div class=\"ember-view\">\n <div data-ember-action=\"1\">\n click me\n </div>\n </div>\n ```\n\n Clicking \"click me\" will trigger the `anActionName` method of the `aView`\n object with a `jQuery.Event` object as its argument. The `jQuery.Event`\n object will be extended to include a `view` property that is set to the\n original view interacted with (in this case the `aView` object).\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers. To stop propagation of the event, simply return `false` from your\n handler.\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See `Ember.View`\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName on=\"doubleClick\"}}>\n click me\n </div>\n </script>\n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n Because `{{action}}` depends on Ember's event dispatch system it will only\n function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new\n `Ember.Application` is created. Having an instance of `Ember.Application`\n will satisfy this requirement.\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical `Ember.Router`-backed Application where views are managed\n through use of the `{{outlet}}` helper, actions will be forwarded to the\n current state of the Applications's Router. See `Ember.Router` 'Responding\n to User-initiated Events' for more information.\n\n If you manually set the `target` property on the controller of a template's\n `Ember.View` instance, the specifed `controller.target` will become the\n target for any actions. Likely custom values for a controller's `target` are\n the controller itself or a StateManager other than the Application's\n router.\n\n If the templates's view lacks a controller property the view itself is the\n target.\n\n Finally, a `target` option can be provided to the helper to change which\n object will receive the method call. This option must be a string\n representing a path to an object:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName target=\"MyApplication.someObject\"}}>\n click me\n </div>\n </script>\n ```\n\n Clicking \"click me\" in the rendered HTML of the above template will trigger\n the `anActionName` method of the object at `MyApplication.someObject`.\n The first argument to this method will be a `jQuery.Event` extended to\n include a `view` property that is set to the original view interacted with.\n\n A path relative to the template's `Ember.View` instance can also be used as\n a target:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName target=\"parentView\"}}>\n click me\n </div>\n </script>\n ```\n\n Clicking \"click me\" in the rendered HTML of the above template will trigger\n the `anActionName` method of the view's parent view.\n\n The `{{action}}` helper is `Ember.StateManager` aware. If the target of the\n action is an `Ember.StateManager` instance `{{action}}` will use the `send`\n functionality of StateManagers. The documentation for `Ember.StateManager`\n has additional information about this use.\n\n If an action's target does not implement a method that matches the supplied\n action name an error will be thrown.\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action aMethodNameThatIsMissing}}>\n click me\n </div>\n </script>\n ```\n\n With the following application code\n\n ```javascript\n AView = Ember.View.extend({\n templateName; 'a-template',\n // note: no method 'aMethodNameThatIsMissing'\n anActionName: function(event){}\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when\n \"click me\" is clicked.\n\n ### Specifying a context\n\n You may optionally specify objects to pass as contexts to the `{{action}}`\n helper by providing property paths as the subsequent parameters. These\n objects are made available as the `contexts` (also `context` if there is only\n one) properties in the `jQuery.Event` object:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n {{#each person in people}}\n <div {{action edit person}}>\n click me\n </div>\n {{/each}}\n </script>\n ```\n\n Clicking \"click me\" will trigger the `edit` method of the view's context with\n a `jQuery.Event` object containing the person object as its context.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object...} contexts\n @param {Hash} options\n*/\nEmberHandlebars.registerHelper('action', function(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n view = options.data.view,\n target, controller, link;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\"\n };\n\n action.view = view = get(view, 'concreteView');\n\n if (hash.target) {\n target = handlebarsGet(this, hash.target, options);\n } else if (controller = options.data.keywords.controller) {\n target = controller;\n }\n\n action.target = target = target || view;\n\n if (contexts.length) {\n action.contexts = contexts = Ember.EnumerableUtils.map(contexts, function(context) {\n return handlebarsGet(this, context, options);\n }, this);\n action.context = contexts[0];\n }\n\n var output = [], url;\n\n if (hash.href && target.urlForEvent) {\n url = target.urlForEvent.apply(target, [actionName].concat(contexts));\n output.push('href=\"' + url + '\"');\n action.link = true;\n }\n\n var actionId = ActionHelper.registerAction(actionName, action);\n output.push('data-ember-action=\"' + actionId + '\"');\n\n return new EmberHandlebars.SafeString(output.join(\" \"));\n});\n\n})();\n//@ sourceURL=ember-old-router/helpers/action");minispade.register('ember-old-router/location', "(function() {minispade.require('ember-views');\nminispade.require('ember-old-router/location/api');\nminispade.require('ember-old-router/location/none_location');\nminispade.require('ember-old-router/location/hash_location');\nminispade.require('ember-old-router/location/history_location');\n\n})();\n//@ sourceURL=ember-old-router/location");minispade.register('ember-old-router/location/api', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n This file implements the `location` API used by Ember's router.\n\n That API is:\n\n getURL: returns the current URL\n setURL(path): sets the current URL\n onUpdateURL(callback): triggers the callback when the URL changes\n formatURL(url): formats `url` to be placed into `href` attribute\n\n Calling setURL will not trigger onUpdateURL callbacks.\n\n TODO: This should perhaps be moved so that it's visible in the doc output.\n*/\n\n/**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n You can pass it a `implementation` (`hash`, `history`, `none`) to force a\n particular implementation.\n\n @class Location\n @namespace Ember\n @static\n*/\nEmber.Location = {\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n registerImplementation: function(name, implementation) {\n this.implementations[name] = implementation;\n },\n\n implementations: {}\n};\n\n})();\n//@ sourceURL=ember-old-router/location/api");minispade.register('ember-old-router/location/hash_location', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n `Ember.HashLocation` implements the location API using the browser's\n hash. At present, it relies on a hashchange event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HashLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n },\n\n /**\n @private\n\n Returns the current `location.hash`, minus the '#' at the front.\n\n @method getURL\n */\n getURL: function() {\n return get(this, 'location').hash.substr(1);\n },\n\n /**\n @private\n\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = Ember.guidFor(this);\n\n Ember.$(window).bind('hashchange.ember-location-'+guid, function() {\n var path = location.hash.substr(1);\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(location.hash.substr(1));\n });\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the `{{action}}` helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('hashchange.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('hash', Ember.HashLocation);\n\n})();\n//@ sourceURL=ember-old-router/location/hash_location");minispade.register('ember-old-router/location/history_location', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar popstateReady = false;\n\n/**\n `Ember.HistoryLocation` implements the location API using the browser's\n `history.pushState` API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HistoryLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n this.initState();\n },\n\n /**\n @private\n\n Used to set state on first call to `setURL`\n\n @method initState\n */\n initState: function() {\n this.replaceState(get(this, 'location').pathname);\n set(this, 'history', window.history);\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Returns the current `location.pathname`.\n\n @method getURL\n */\n getURL: function() {\n return get(this, 'location').pathname;\n },\n\n /**\n @private\n\n Uses `history.pushState` to update the url without a page reload.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n path = this.formatURL(path);\n\n if (this.getState() && this.getState().path !== path) {\n popstateReady = true;\n this.pushState(path);\n }\n },\n\n /**\n @private\n\n Get the current `history.state`\n\n @method getState\n */\n getState: function() {\n return get(this, 'history').state;\n },\n\n /**\n @private\n\n Pushes a new state\n\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n window.history.pushState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Replaces the current state\n\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n window.history.replaceState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).bind('popstate.ember-location-'+guid, function(e) {\n if(!popstateReady) {\n return;\n }\n callback(location.pathname);\n });\n },\n\n /**\n @private\n\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n }\n\n return rootURL + url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('popstate.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('history', Ember.HistoryLocation);\n\n})();\n//@ sourceURL=ember-old-router/location/history_location");minispade.register('ember-old-router/location/none_location', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n `Ember.NoneLocation` does not interact with the browser. It is useful for\n testing, or when you need to manage state with your router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.NoneLocation = Ember.Object.extend({\n path: '',\n\n getURL: function() {\n return get(this, 'path');\n },\n\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n onUpdateURL: function(callback) {\n // We are not wired up to the browser, so we'll never trigger the callback.\n },\n\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n});\n\nEmber.Location.registerImplementation('none', Ember.NoneLocation);\n\n})();\n//@ sourceURL=ember-old-router/location/none_location");minispade.register('ember-old-router', "(function() {minispade.require('ember-states');\nminispade.require('ember-old-router/promise_chain');\nminispade.require('ember-old-router/application');\nminispade.require('ember-old-router/route');\nminispade.require('ember-old-router/router');\nminispade.require('ember-old-router/helpers');\nminispade.require('ember-old-router/handlebars_ext');\nminispade.require('ember-old-router/controller_ext');\nminispade.require('ember-old-router/view_ext');\n\n/**\nEmber Old Router\n\n@module ember\n@submodule ember-old-router\n@requires ember-states\n*/\n\n})();\n//@ sourceURL=ember-old-router");minispade.register('ember-old-router/promise_chain', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber._PromiseChain = Ember.Object.extend({\n promises: null,\n failureCallback: Ember.K,\n successCallback: Ember.K,\n abortCallback: Ember.K,\n promiseSuccessCallback: Ember.K,\n\n runNextPromise: function() {\n if (get(this, 'isDestroyed')) { return; }\n\n var item = get(this, 'promises').shiftObject();\n if (item) {\n var promise = get(item, 'promise') || item;\n Ember.assert(\"Cannot find promise to invoke\", Ember.canInvoke(promise, 'then'));\n\n var self = this;\n\n var successCallback = function() {\n self.promiseSuccessCallback.call(this, item, arguments);\n self.runNextPromise();\n };\n\n var failureCallback = get(self, 'failureCallback');\n\n promise.then(successCallback, failureCallback);\n } else {\n this.successCallback();\n }\n },\n\n start: function() {\n this.runNextPromise();\n return this;\n },\n\n abort: function() {\n this.abortCallback();\n this.destroy();\n },\n\n init: function() {\n set(this, 'promises', Ember.A(get(this, 'promises')));\n this._super();\n }\n});\n\n\n})();\n//@ sourceURL=ember-old-router/promise_chain");minispade.register('ember-old-router/resolved_state', "(function() {var get = Ember.get;\n\nEmber._ResolvedState = Ember.Object.extend({\n manager: null,\n state: null,\n match: null,\n\n object: Ember.computed(function(key) {\n if (this._object) {\n return this._object;\n } else {\n var state = get(this, 'state'),\n match = get(this, 'match'),\n manager = get(this, 'manager');\n return state.deserialize(manager, match.hash);\n }\n }),\n\n hasPromise: Ember.computed(function() {\n return Ember.canInvoke(get(this, 'object'), 'then');\n }).property('object'),\n\n promise: Ember.computed(function() {\n var object = get(this, 'object');\n if (Ember.canInvoke(object, 'then')) {\n return object;\n } else {\n return {\n then: function(success) { success(object); }\n };\n }\n }).property('object'),\n\n transition: function() {\n var manager = get(this, 'manager'),\n path = get(this, 'state.path'),\n object = get(this, 'object');\n manager.transitionTo(path, object);\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/resolved_state");minispade.register('ember-old-router/routable', "(function() {minispade.require('ember-old-router/resolved_state');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get;\n\n// The Ember Routable mixin assumes the existance of a simple\n// routing shim that supports the following three behaviors:\n//\n// * .getURL() - this is called when the page loads\n// * .setURL(newURL) - this is called from within the state\n// manager when the state changes to a routable state\n// * .onURLChange(callback) - this happens when the user presses\n// the back or forward button\n\nvar paramForClass = function(classObject) {\n var className = classObject.toString(),\n parts = className.split(\".\"),\n last = parts[parts.length - 1];\n\n return Ember.String.underscore(last) + \"_id\";\n};\n\nvar merge = function(original, hash) {\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n if (original.hasOwnProperty(prop)) { continue; }\n\n original[prop] = hash[prop];\n }\n};\n\n/**\n @class Routable\n @namespace Ember\n @extends Ember.Mixin\n*/\nEmber.Routable = Ember.Mixin.create({\n init: function() {\n var redirection;\n this.on('setup', this, this.stashContext);\n\n if (redirection = get(this, 'redirectsTo')) {\n Ember.assert(\"You cannot use `redirectsTo` if you already have a `connectOutlets` method\", this.connectOutlets === Ember.K);\n\n this.connectOutlets = function(router) {\n router.transitionTo(redirection);\n };\n }\n\n // normalize empty route to '/'\n var route = get(this, 'route');\n if (route === '') {\n route = '/';\n }\n\n this._super();\n\n Ember.assert(\"You cannot use `redirectsTo` on a state that has child states\", !redirection || (!!redirection && !!get(this, 'isLeaf')));\n },\n\n setup: function() {\n return this.connectOutlets.apply(this, arguments);\n },\n\n /**\n @private\n\n Whenever a routable state is entered, the context it was entered with\n is stashed so that we can regenerate the state's `absoluteURL` on\n demand.\n\n @method stashContext\n @param manager {Ember.StateManager}\n @param context\n */\n stashContext: function(manager, context) {\n this.router = manager;\n\n var serialized = this.serialize(manager, context);\n Ember.assert('serialize must return a hash', !serialized || typeof serialized === 'object');\n\n manager.setStateMeta(this, 'context', context);\n manager.setStateMeta(this, 'serialized', serialized);\n\n if (get(this, 'isRoutable') && !get(manager, 'isRouting')) {\n this.updateRoute(manager, get(manager, 'location'));\n }\n },\n\n /**\n @private\n\n Whenever a routable state is entered, the router's location object\n is notified to set the URL to the current absolute path.\n\n In general, this will update the browser's URL.\n\n @method updateRoute\n @param manager {Ember.StateManager}\n @param location {Ember.Location}\n */\n updateRoute: function(manager, location) {\n if (get(this, 'isLeafRoute')) {\n var path = this.absoluteRoute(manager);\n location.setURL(path);\n }\n },\n\n /**\n @private\n\n Get the absolute route for the current state and a given\n hash.\n\n This method is private, as it expects a serialized hash,\n not the original context object.\n\n @method absoluteRoute\n @param manager {Ember.StateManager}\n @param hashes {Array}\n */\n absoluteRoute: function(manager, hashes) {\n var parentState = get(this, 'parentState'),\n path = '',\n generated,\n currentHash;\n\n // check if object passed instead of array\n // in this case set currentHash = hashes\n // this allows hashes to be a single hash\n // (it will be applied to state and all parents)\n currentHash = null;\n if (hashes) {\n if (hashes instanceof Array) {\n if (hashes.length > 0) {\n currentHash = hashes.shift();\n }\n } else {\n currentHash = hashes;\n }\n }\n\n // If the parent state is routable, use its current path\n // as this route's prefix.\n if (get(parentState, 'isRoutable')) {\n path = parentState.absoluteRoute(manager, hashes);\n }\n\n var matcher = get(this, 'routeMatcher'),\n serialized = manager.getStateMeta(this, 'serialized');\n\n // merge the existing serialized object in with the passed\n // in hash.\n currentHash = currentHash || {};\n merge(currentHash, serialized);\n\n generated = matcher && matcher.generate(currentHash);\n\n if (generated) {\n path = path + '/' + generated;\n }\n\n return path;\n },\n\n /**\n @private\n\n At the moment, a state is routable if it has a string `route`\n property. This heuristic may change.\n\n @property isRoutable\n @type Boolean\n */\n isRoutable: Ember.computed(function() {\n return typeof get(this, 'route') === 'string';\n }),\n\n /**\n @private\n\n Determine if this is the last routeable state\n\n @property isLeafRoute\n @type Boolean\n */\n isLeafRoute: Ember.computed(function() {\n if (get(this, 'isLeaf')) { return true; }\n return !get(this, 'childStates').findProperty('isRoutable');\n }),\n\n /**\n @private\n\n A `_RouteMatcher` object generated from the current route's `route`\n string property.\n\n @property routeMatcher\n @type Ember._RouteMatcher\n */\n routeMatcher: Ember.computed(function() {\n var route = get(this, 'route');\n if (route) {\n return Ember._RouteMatcher.create({ route: route });\n }\n }),\n\n /**\n @private\n\n Check whether the route has dynamic segments and therefore takes\n a context.\n\n @property hasContext\n @type Boolean\n */\n hasContext: Ember.computed(function() {\n var routeMatcher = get(this, 'routeMatcher');\n if (routeMatcher) {\n return routeMatcher.identifiers.length > 0;\n }\n }),\n\n /**\n @private\n\n The model class associated with the current state. This property\n uses the `modelType` property, in order to allow it to be\n specified as a String.\n\n @property modelClass\n @type Ember.Object\n */\n modelClass: Ember.computed(function() {\n var modelType = get(this, 'modelType');\n\n if (typeof modelType === 'string') {\n return Ember.get(Ember.lookup, modelType);\n } else {\n return modelType;\n }\n }),\n\n /**\n @private\n\n Get the model class for the state. The heuristic is:\n\n * The state must have a single dynamic segment\n * The dynamic segment must end in `_id`\n * A dynamic segment like `blog_post_id` is converted into `BlogPost`\n * The name is then looked up on the passed in namespace\n\n The process of initializing an application with a router will\n pass the application's namespace into the router, which will be\n used here.\n\n @method modelClassFor\n @param namespace {Ember.Namespace}\n */\n modelClassFor: function(namespace) {\n var modelClass, routeMatcher, identifiers, match, className;\n\n // if an explicit modelType was specified, use that\n if (modelClass = get(this, 'modelClass')) { return modelClass; }\n\n // if the router has no lookup namespace, we won't be able to guess\n // the modelType\n if (!namespace) { return; }\n\n // make sure this state is actually a routable state\n routeMatcher = get(this, 'routeMatcher');\n if (!routeMatcher) { return; }\n\n // only guess modelType for states with a single dynamic segment\n // (no more, no fewer)\n identifiers = routeMatcher.identifiers;\n if (identifiers.length !== 2) { return; }\n\n // extract the `_id` from the end of the dynamic segment; if the\n // dynamic segment does not end in `_id`, we can't guess the\n // modelType\n match = identifiers[1].match(/^(.*)_id$/);\n if (!match) { return; }\n\n // convert the underscored type into a class form and look it up\n // on the router's namespace\n className = Ember.String.classify(match[1]);\n return get(namespace, className);\n },\n\n /**\n The default method that takes a `params` object and converts\n it into an object.\n\n By default, a params hash that looks like `{ post_id: 1 }`\n will be looked up as `namespace.Post.find(1)`. This is\n designed to work seamlessly with Ember Data, but will work\n fine with any class that has a `find` method.\n\n @method deserialize\n @param manager {Ember.StateManager}\n @param params {Hash}\n */\n deserialize: function(manager, params) {\n var modelClass, routeMatcher, param;\n\n if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {\n Ember.assert(\"Expected \"+modelClass.toString()+\" to implement `find` for use in '\"+this.get('path')+\"' `deserialize`. Please implement the `find` method or overwrite `deserialize`.\", modelClass.find);\n return modelClass.find(params[paramForClass(modelClass)]);\n }\n\n return params;\n },\n\n /**\n The default method that takes an object and converts it into\n a params hash.\n\n By default, if there is a single dynamic segment named\n `blog_post_id` and the object is a `BlogPost` with an\n `id` of `12`, the serialize method will produce:\n\n ```javascript\n { blog_post_id: 12 }\n ```\n\n @method serialize\n @param manager {Ember.StateManager}\n @param context\n */\n serialize: function(manager, context) {\n var modelClass, routeMatcher, namespace, param, id;\n\n if (Ember.isEmpty(context)) { return ''; }\n\n if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {\n param = paramForClass(modelClass);\n id = get(context, 'id');\n context = {};\n context[param] = id;\n }\n\n return context;\n },\n\n /**\n @private\n @method resolvePath\n @param manager {Ember.StateManager}\n @param path {String}\n */\n resolvePath: function(manager, path) {\n if (get(this, 'isLeafRoute')) { return Ember.A(); }\n\n var childStates = get(this, 'childStates'), match;\n\n childStates = Ember.A(childStates.filterProperty('isRoutable'));\n\n childStates = childStates.sort(function(a, b) {\n var aDynamicSegments = get(a, 'routeMatcher.identifiers.length'),\n bDynamicSegments = get(b, 'routeMatcher.identifiers.length'),\n aRoute = get(a, 'route'),\n bRoute = get(b, 'route');\n\n if (aRoute.indexOf(bRoute) === 0) {\n return -1;\n } else if (bRoute.indexOf(aRoute) === 0) {\n return 1;\n }\n\n if (aDynamicSegments !== bDynamicSegments) {\n return aDynamicSegments - bDynamicSegments;\n }\n\n return get(b, 'route.length') - get(a, 'route.length');\n });\n\n var state = childStates.find(function(state) {\n var matcher = get(state, 'routeMatcher');\n if (match = matcher.match(path)) { return true; }\n });\n\n Ember.assert(\"Could not find state for path \" + path, !!state);\n\n var resolvedState = Ember._ResolvedState.create({\n manager: manager,\n state: state,\n match: match\n });\n\n var states = state.resolvePath(manager, match.remaining);\n\n return Ember.A([resolvedState]).pushObjects(states);\n },\n\n /**\n @private\n\n Once `unroute` has finished unwinding, `routePath` will be called\n with the remainder of the route.\n\n For example, if you were in the `/posts/1/comments` state, and you\n moved into the `/posts/2/comments` state, `routePath` will be called\n on the state whose path is `/posts` with the path `/2/comments`.\n\n @method routePath\n @param manager {Ember.StateManager}\n @param path {String}\n */\n routePath: function(manager, path) {\n if (get(this, 'isLeafRoute')) { return; }\n\n var resolvedStates = this.resolvePath(manager, path),\n hasPromises = resolvedStates.some(function(s) { return get(s, 'hasPromise'); });\n\n function runTransition() {\n resolvedStates.forEach(function(rs) { rs.transition(); });\n }\n\n if (hasPromises) {\n manager.transitionTo('loading');\n\n Ember.assert('Loading state should be the child of a route', Ember.Routable.detect(get(manager, 'currentState.parentState')));\n Ember.assert('Loading state should not be a route', !Ember.Routable.detect(get(manager, 'currentState')));\n\n manager.handleStatePromises(resolvedStates, runTransition);\n } else {\n runTransition();\n }\n },\n\n /**\n @private\n\n When you move to a new route by pressing the back\n or forward button, this method is called first.\n\n Its job is to move the state manager into a parent\n state of the state it will eventually move into.\n\n @method unroutePath\n @param router {Ember.Router}\n @param path {String}\n */\n unroutePath: function(router, path) {\n var parentState = get(this, 'parentState');\n\n // If we're at the root state, we're done\n if (parentState === router) {\n return;\n }\n\n path = path.replace(/^(?=[^\\/])/, \"/\");\n var absolutePath = this.absoluteRoute(router);\n\n var route = get(this, 'route');\n\n // If the current path is empty, move up one state,\n // because the index ('/') state must be a leaf node.\n if (route !== '/') {\n // If the current path is a prefix of the path we're trying\n // to go to, we're done.\n var index = path.indexOf(absolutePath),\n next = path.charAt(absolutePath.length);\n\n if (index === 0 && (next === \"/\" || next === \"\")) {\n return;\n }\n }\n\n // Transition to the parent and call unroute again.\n router.enterState({\n exitStates: [this],\n enterStates: [],\n finalState: parentState\n });\n\n router.send('unroutePath', path);\n },\n\n parentTemplate: Ember.computed(function() {\n var state = this, parentState, template;\n\n while (state = get(state, 'parentState')) {\n if (template = get(state, 'template')) {\n return template;\n }\n }\n\n return 'application';\n }),\n\n _template: Ember.computed(function(key) {\n var value = get(this, 'template');\n\n if (value) { return value; }\n\n // If no template was explicitly supplied convert\n // the class name into a template name. For example,\n // App.PostRoute will return `post`.\n var className = this.constructor.toString(), baseName;\n if (/^[^\\[].*Route$/.test(className)) {\n baseName = className.match(/([^\\.]+\\.)*([^\\.]+)/)[2];\n baseName = baseName.replace(/Route$/, '');\n return baseName.charAt(0).toLowerCase() + baseName.substr(1);\n }\n }),\n\n render: function(options) {\n options = options || {};\n\n var template = options.template || get(this, '_template'),\n parentTemplate = options.into || get(this, 'parentTemplate'),\n controller = get(this.router, parentTemplate + \"Controller\");\n\n var viewName = Ember.String.classify(template) + \"View\",\n viewClass = get(get(this.router, 'namespace'), viewName);\n\n viewClass = (viewClass || Ember.View).extend({\n templateName: template\n });\n\n controller.set('view', viewClass.create());\n },\n\n /**\n The `connectOutlets` event will be triggered once a\n state has been entered. It will be called with the\n route's context.\n\n @event connectOutlets\n @param router {Ember.Router}\n @param [context*]\n */\n connectOutlets: Ember.K,\n\n /**\n The `navigateAway` event will be triggered when the\n URL changes due to the back/forward button\n\n @event navigateAway\n */\n navigateAway: Ember.K\n});\n\n})();\n//@ sourceURL=ember-old-router/routable");minispade.register('ember-old-router/route', "(function() {minispade.require('ember-old-router/routable');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\n/**\n @class Route\n @namespace Ember\n @extends Ember.State\n @uses Ember.Routable\n*/\nEmber.Route = Ember.State.extend(Ember.Routable);\n\n})();\n//@ sourceURL=ember-old-router/route");minispade.register('ember-old-router/route_matcher', "(function() {var escapeForRegex = function(text) {\n return text.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^\\$|#\\s]/g, \"\\\\$&\");\n};\n\n/**\n @class _RouteMatcher\n @namespace Ember\n @private\n @extends Ember.Object\n*/\nEmber._RouteMatcher = Ember.Object.extend({\n state: null,\n\n init: function() {\n var route = this.route,\n identifiers = [],\n count = 1,\n escaped;\n\n // Strip off leading slash if present\n if (route.charAt(0) === '/') {\n route = this.route = route.substr(1);\n }\n\n escaped = escapeForRegex(route);\n\n var regex = escaped.replace(/(:|(?:\\\\\\*))([a-z_]+)(?=$|\\/)/gi, function(match, type, id) {\n identifiers[count++] = id;\n switch (type) {\n case \":\":\n return \"([^/]+)\";\n case \"\\\\*\":\n return \"(.+)\";\n }\n });\n\n this.identifiers = identifiers;\n this.regex = new RegExp(\"^/?\" + regex);\n },\n\n match: function(path) {\n var match = path.match(this.regex);\n\n if (match) {\n var identifiers = this.identifiers,\n hash = {};\n\n for (var i=1, l=identifiers.length; i<l; i++) {\n hash[identifiers[i]] = match[i];\n }\n\n return {\n remaining: path.substr(match[0].length),\n hash: identifiers.length > 0 ? hash : null\n };\n }\n },\n\n generate: function(hash) {\n var identifiers = this.identifiers, route = this.route, id;\n for (var i=1, l=identifiers.length; i<l; i++) {\n id = identifiers[i];\n route = route.replace(new RegExp(\"(:|(\\\\*))\" + id), hash[id]);\n }\n return route;\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/route_matcher");minispade.register('ember-old-router/router', "(function() {minispade.require('ember-old-router/route_matcher');\nminispade.require('ember-old-router/routable');\nminispade.require('ember-old-router/location');\nminispade.require('ember-metal/utils'); // Ember.tryFinally\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar merge = function(original, hash) {\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n if (original.hasOwnProperty(prop)) { continue; }\n\n original[prop] = hash[prop];\n }\n};\n\n/**\n `Ember.Router` is the subclass of `Ember.StateManager` responsible for\n providing URL-based application state detection. The `Ember.Router` instance\n of an application detects the browser URL at application load time and\n attempts to match it to a specific application state. Additionally the router\n will update the URL to reflect an application's state changes over time.\n\n ## Adding a Router Instance to Your Application\n\n An instance of `Ember.Router` can be associated with an instance of\n `Ember.Application` in one of two ways:\n\n You can provide a subclass of `Ember.Router` as the `Router` property of your\n application. An instance of this `Router` class will be instantiated and\n route detection will be enabled when the application's `initialize` method is\n called. The `Router` instance will be available as the `router` property of\n the application:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({ ... })\n });\n\n App.initialize();\n App.get('router') // an instance of App.Router\n ```\n\n If you want to define a `Router` instance elsewhere, you can pass the\n instance to the application's `initialize` method:\n\n ```javascript\n App = Ember.Application.create();\n aRouter = Ember.Router.create({ ... });\n\n App.initialize(aRouter);\n App.get('router') // aRouter\n ```\n\n ## Adding Routes to a Router\n\n The `initialState` property of `Ember.Router` instances is named `root`. The\n state stored in this property must be a subclass of `Ember.Route`. The `root`\n route acts as the container for the set of routable states but is not\n routable itself. It should have states that are also subclasses of\n `Ember.Route` which each have a `route` property describing the URL pattern\n you would like to detect.\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n index: Ember.Route.extend({\n route: '/'\n }),\n ... additional Ember.Routes ...\n })\n })\n });\n App.initialize();\n ```\n\n When an application loads, Ember will parse the URL and attempt to find an\n Ember.Route within the application's states that matches. (The example\n URL-matching below will use the default 'hash syntax' provided by\n `Ember.HashLocation`.)\n\n In the following route structure:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/'\n }),\n bRoute: Ember.Route.extend({\n route: '/alphabeta'\n })\n })\n })\n });\n App.initialize();\n ```\n\n Loading the page at the URL '#/' will detect the route property of\n `root.aRoute` ('/') and transition the router first to the state named `root`\n and then to the substate `aRoute`.\n\n Respectively, loading the page at the URL '#/alphabeta' would detect the\n route property of `root.bRoute` ('/alphabeta') and transition the router\n first to the state named `root` and then to the substate `bRoute`.\n\n ## Adding Nested Routes to a Router\n\n Routes can contain nested subroutes each with their own `route` property\n describing the nested portion of the URL they would like to detect and\n handle. `Router`, like all instances of `StateManager`, cannot call\n `transitonTo` with an intermediary state. To avoid transitioning the Router\n into an intermediary state when detecting URLs, a Route with nested routes\n must define both a base `route` property for itself and a child Route with a\n `route` property of `'/'` which will be transitioned to when the base route\n is detected in the URL:\n\n Given the following application code:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/theBaseRouteForThisSet',\n\n indexSubRoute: Ember.Route.extend({\n route: '/'\n }),\n\n subRouteOne: Ember.Route.extend({\n route: '/subroute1'\n }),\n\n subRouteTwo: Ember.Route.extend({\n route: '/subRoute2'\n })\n\n })\n })\n })\n });\n App.initialize();\n ```\n\n When the application is loaded at '/theBaseRouteForThisSet' the Router will\n transition to the route at path `root.aRoute` and then transition to state\n `indexSubRoute`.\n\n When the application is loaded at '/theBaseRouteForThisSet/subRoute1' the\n Router will transition to the route at path `root.aRoute` and then transition\n to state `subRouteOne`.\n\n ## Route Transition Events\n\n Transitioning between `Ember.Route` instances (including the transition into\n the detected route when loading the application) triggers the same\n transition events as state transitions for base `Ember.State`s. However, the\n default `setup` transition event is named `connectOutlets` on `Ember.Router`\n instances (see 'Changing View Hierarchy in Response To State Change').\n\n The following route structure when loaded with the URL \"#/\"\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n enter: function(router) {\n console.log(\"entering root.aRoute from\", router.get('currentState.name'));\n },\n connectOutlets: function(router) {\n console.log(\"entered root.aRoute, fully transitioned to\", router.get('currentState.path'));\n }\n })\n })\n })\n });\n App.initialize();\n ```\n\n Will result in console output of:\n\n ```\n 'entering root.aRoute from root'\n 'entered root.aRoute, fully transitioned to root.aRoute '\n ```\n\n `Ember.Route` has two additional callbacks for handling URL serialization and\n deserialization. See 'Serializing/Deserializing URLs'\n\n ## Routes With Dynamic Segments\n\n An `Ember.Route`'s `route` property can reference dynamic sections of the URL\n by prefacing a URL segment with the ':' character. The values of these\n dynamic segments will be passed as a hash to the `deserialize` method of the\n matching `Route` (see 'Serializing/Deserializing URLs').\n\n ## Serializing/Deserializing URLs\n\n `Ember.Route` has two callbacks for associating a particular object context\n with a URL: `serialize` for converting an object into a parameters hash to\n fill dynamic segments of a URL and `deserialize` for converting a hash of\n dynamic segments from the URL into the appropriate object.\n\n ### Deserializing A URL's Dynamic Segments\n\n When an application is first loaded or the URL is changed manually (e.g.\n through the browser's back button) the `deserialize` method of the URL's\n matching `Ember.Route` will be called with the application's router as its\n first argument and a hash of the URL's dynamic segments and values as its\n second argument.\n\n The following route structure when loaded with the URL\n \"#/fixed/thefirstvalue/anotherFixed/thesecondvalue\":\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/fixed/:dynamicSectionA/anotherFixed/:dynamicSectionB',\n deserialize: function(router, params) {}\n })\n })\n })\n });\n App.initialize();\n ```\n\n Will call the `deserialize` method of the Route instance at the path\n `root.aRoute` with the following hash as its second argument:\n\n ```javascript\n {\n dynamicSectionA: 'thefirstvalue',\n dynamicSectionB: 'thesecondvalue'\n }\n ```\n\n Within `deserialize` you should use this information to retrieve or create an\n appropriate context object for the given URL (e.g. by loading from a remote\n API or accessing the browser's `localStorage`). This object must be the\n `return` value of `deserialize` and will be passed to the `Route`'s\n `connectOutlets` and `serialize` methods.\n\n When an application's state is changed from within the application itself,\n the context provided for the transition will be passed and `deserialize` is\n not called (see 'Transitions Between States').\n\n ### Serializing An Object For URLs with Dynamic Segments\n\n When transitioning into a Route whose `route` property contains dynamic\n segments the route's `serialize` method is called with the route's router as\n the first argument and the route's context as the second argument. The return\n value of `serialize` will be used to populate the dynamic segments and should\n be an object with keys that match the names of the dynamic sections.\n\n Given the following route structure:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/'\n }),\n bRoute: Ember.Route.extend({\n route: '/staticSection/:someDynamicSegment',\n serialize: function(router, context) {\n return {\n someDynamicSegment: context.get('name')\n }\n }\n })\n })\n })\n });\n App.initialize();\n ```\n\n Transitioning to `root.bRoute` with a context of\n `Object.create({name: 'Yehuda'})` will call the `Route`'s `serialize`\n method with the context as its second argument and update the URL to\n '#/staticSection/Yehuda'.\n\n ## Transitions Between States\n\n Once a routed application has initialized its state based on the entry URL,\n subsequent transitions to other states will update the URL if the entered\n Route has a `route` property. Given the following route structure loaded at\n the URL '#/':\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n moveElsewhere: Ember.Route.transitionTo('bRoute')\n }),\n bRoute: Ember.Route.extend({\n route: '/someOtherLocation'\n })\n })\n })\n });\n App.initialize();\n ```\n\n And application code:\n\n ```javascript\n App.get('router').send('moveElsewhere');\n ```\n\n Will transition the application's state to `root.bRoute` and trigger an\n update of the URL to `#/someOtherLocation`.\n\n For URL patterns with dynamic segments a context can be supplied as the\n second argument to `send`. The router will match dynamic segments names to\n keys on this object and fill in the URL with the supplied values. Given the\n following state structure loaded at the URL `#/`:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n moveElsewhere: Ember.Route.transitionTo('bRoute')\n }),\n bRoute: Ember.Route.extend({\n route: '/a/route/:dynamicSection/:anotherDynamicSection',\n connectOutlets: function(router, context) {},\n })\n })\n })\n });\n App.initialize();\n ```\n\n And application code:\n\n ```javascript\n App.get('router').send('moveElsewhere', {\n dynamicSection: '42',\n anotherDynamicSection: 'Life'\n });\n ```\n\n Will transition the application's state to `root.bRoute` and trigger an\n update of the URL to `#/a/route/42/Life`.\n\n The context argument will also be passed as the second argument to the\n `serialize` method call.\n\n ## Injection of Controller Singletons\n\n During application initialization Ember will detect properties of the\n application ending in 'Controller', create singleton instances of each class,\n and assign them as properties on the router. The property name will be the\n UpperCamel name converted to lowerCamel format. These controller classes\n should be subclasses of `Ember.ObjectController`, `Ember.ArrayController`,\n `Ember.Controller`, or a custom `Ember.Object` that includes the\n `Ember.ControllerMixin` mixin.\n\n ```javascript\n App = Ember.Application.create({\n FooController: Ember.Object.create(Ember.ControllerMixin),\n Router: Ember.Router.extend({ ... })\n });\n\n App.get('router.fooController'); // instance of App.FooController\n ```\n\n The controller singletons will have their `namespace` property set to the\n application and their `target` property set to the application's router\n singleton for easy integration with Ember's user event system. See 'Changing\n View Hierarchy in Response To State Change' and 'Responding to User-initiated\n Events.'\n\n ## Responding to User-initiated Events\n\n Controller instances injected into the router at application initialization\n have their `target` property set to the application's router instance. These\n controllers will also be the default `context` for their associated views.\n Uses of the `{{action}}` helper will automatically target the application's\n router.\n\n Given the following application entered at the URL `#/`:\n\n ```javascript\n App = Ember.Application.create({\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n anActionOnTheRouter: function(router, context) {\n router.transitionTo('anotherState', context);\n }\n })\n anotherState: Ember.Route.extend({\n route: '/differentUrl',\n connectOutlets: function(router, context) {\n\n }\n })\n })\n })\n });\n App.initialize();\n ```\n\n The following template:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"aView\">\n <h1><a {{action anActionOnTheRouter}}>{{title}}</a></h1>\n </script>\n ```\n\n Will delegate `click` events on the rendered `h1` to the application's router\n instance. In this case the `anActionOnTheRouter` method of the state at\n 'root.aRoute' will be called with the view's controller as the context\n argument. This context will be passed to the `connectOutlets` as its second\n argument.\n\n Different `context` can be supplied from within the `{{action}}` helper,\n allowing specific context passing between application states:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"photos\">\n {{#each photo in controller}}\n <h1><a {{action showPhoto photo}}>{{title}}</a></h1>\n {{/each}}\n </script>\n ```\n\n See `Handlebars.helpers.action` for additional usage examples.\n\n ## Changing View Hierarchy in Response To State Change\n\n Changes in application state that change the URL should be accompanied by\n associated changes in view hierarchy. This can be accomplished by calling\n `connectOutlet` on the injected controller singletons from within the\n 'connectOutlets' event of an `Ember.Route`:\n\n ```javascript\n App = Ember.Application.create({\n OneController: Ember.ObjectController.extend(),\n OneView: Ember.View.extend(),\n\n AnotherController: Ember.ObjectController.extend(),\n AnotherView: Ember.View.extend(),\n\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n connectOutlets: function(router, context) {\n router.get('oneController').connectOutlet('another');\n },\n })\n })\n })\n });\n App.initialize();\n ```\n\n This will detect the `{{outlet}}` portion of `oneController`'s view (an\n instance of `App.OneView`) and fill it with a rendered instance of\n `App.AnotherView` whose `context` will be the single instance of\n `App.AnotherController` stored on the router in the `anotherController`\n property.\n\n For more information about Outlets, see `Ember.Handlebars.helpers.outlet`.\n For additional information on the `connectOutlet` method, see\n `Ember.Controller.connectOutlet`. For more information on controller\n injections, see `Ember.Application#initialize()`. For additional information\n about view context, see `Ember.View`.\n\n @class Router\n @namespace Ember\n @extends Ember.StateManager\n*/\nEmber.Router = Ember.StateManager.extend(\n/** @scope Ember.Router.prototype */ {\n\n /**\n @property initialState\n @type String\n @default 'root'\n */\n initialState: 'root',\n\n /**\n The `Ember.Location` implementation to be used to manage the application\n URL state. The following values are supported:\n\n * `hash`: Uses URL fragment identifiers (like #/blog/1) for routing.\n * `history`: Uses the browser's history.pushstate API for routing. Only\n works in modern browsers with pushstate support.\n * `none`: Does not read or set the browser URL, but still allows for\n routing to happen. Useful for testing.\n\n @property location\n @type String\n @default 'hash'\n */\n location: 'hash',\n\n /**\n This is only used when a history location is used so that applications that\n don't live at the root of the domain can append paths to their root.\n\n @property rootURL\n @type String\n @default '/'\n */\n\n rootURL: '/',\n\n transitionTo: function() {\n this.abortRoutingPromises();\n this._super.apply(this, arguments);\n },\n\n route: function(path) {\n this.abortRoutingPromises();\n\n set(this, 'isRouting', true);\n\n var routableState;\n function tryable() {\n path = path.replace(get(this, 'rootURL'), '');\n path = path.replace(/^(?=[^\\/])/, \"/\");\n\n this.send('navigateAway');\n this.send('unroutePath', path);\n\n routableState = get(this, 'currentState');\n while (routableState && !routableState.get('isRoutable')) {\n routableState = get(routableState, 'parentState');\n }\n var currentURL = routableState ? routableState.absoluteRoute(this) : '';\n var rest = path.substr(currentURL.length);\n\n this.send('routePath', rest);\n }\n\n function finalizer() {\n set(this, 'isRouting', false);\n }\n\n Ember.tryFinally(tryable, finalizer, this);\n\n routableState = get(this, 'currentState');\n while (routableState && !routableState.get('isRoutable')) {\n routableState = get(routableState, 'parentState');\n }\n\n if (routableState) {\n routableState.updateRoute(this, get(this, 'location'));\n }\n },\n\n urlFor: function(path, hashes) {\n var currentState = get(this, 'currentState') || this,\n state = this.findStateByPath(currentState, path);\n\n Ember.assert(Ember.String.fmt(\"Could not find route with path '%@'\", [path]), state);\n Ember.assert(Ember.String.fmt(\"To get a URL for the state '%@', it must have a `route` property.\", [path]), get(state, 'routeMatcher'));\n\n var location = get(this, 'location'),\n absoluteRoute = state.absoluteRoute(this, hashes);\n\n return location.formatURL(absoluteRoute);\n },\n\n urlForEvent: function(eventName) {\n var contexts = Array.prototype.slice.call(arguments, 1),\n currentState = get(this, 'currentState'),\n targetStateName = currentState.lookupEventTransition(eventName),\n targetState,\n hashes;\n\n Ember.assert(Ember.String.fmt(\"You must specify a target state for event '%@' in order to link to it in the current state '%@'.\", [eventName, get(currentState, 'path')]), targetStateName);\n\n targetState = this.findStateByPath(currentState, targetStateName);\n\n Ember.assert(\"Your target state name \" + targetStateName + \" for event \" + eventName + \" did not resolve to a state\", targetState);\n\n\n hashes = this.serializeRecursively(targetState, contexts, []);\n\n return this.urlFor(targetStateName, hashes);\n },\n\n serializeRecursively: function(state, contexts, hashes) {\n var parentState,\n\t\t\tcontext = get(state, 'hasContext') ? contexts.pop() : null,\n hash = context ? state.serialize(this, context) : null;\n\n\t\thashes.push(hash);\n\t\tparentState = state.get(\"parentState\");\n\n\t\tif (parentState && parentState instanceof Ember.Route) {\n return this.serializeRecursively(parentState, contexts, hashes);\n } else {\n return hashes;\n }\n },\n\n abortRoutingPromises: function() {\n if (this._routingPromises) {\n this._routingPromises.abort();\n this._routingPromises = null;\n }\n },\n\n handleStatePromises: function(states, complete) {\n this.abortRoutingPromises();\n\n this.set('isLocked', true);\n\n var manager = this;\n\n this._routingPromises = Ember._PromiseChain.create({\n promises: states.slice(),\n\n successCallback: function() {\n manager.set('isLocked', false);\n complete();\n },\n\n failureCallback: function() {\n throw \"Unable to load object\";\n },\n\n promiseSuccessCallback: function(item, args) {\n set(item, 'object', args[0]);\n },\n\n abortCallback: function() {\n manager.set('isLocked', false);\n }\n }).start();\n },\n\n moveStatesIntoRoot: function() {\n this.root = Ember.Route.extend();\n\n for (var name in this) {\n if (name === \"constructor\") { continue; }\n\n var state = this[name];\n\n if (state instanceof Ember.Route || Ember.Route.detect(state)) {\n this.root[name] = state;\n delete this[name];\n }\n }\n },\n\n init: function() {\n if (!this.root) {\n this.moveStatesIntoRoot();\n }\n\n this._super();\n\n var location = get(this, 'location'),\n rootURL = get(this, 'rootURL');\n\n if ('string' === typeof location) {\n set(this, 'location', Ember.Location.create({\n implementation: location,\n rootURL: rootURL\n }));\n }\n\n this.assignRouter(this, this);\n },\n\n assignRouter: function(state, router) {\n state.router = router;\n\n var childStates = state.states;\n\n if (childStates) {\n for (var stateName in childStates) {\n if (!childStates.hasOwnProperty(stateName)) { continue; }\n this.assignRouter(childStates[stateName], router);\n }\n }\n },\n\n willDestroy: function() {\n get(this, 'location').destroy();\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/router");minispade.register('ember-old-router/view_ext', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\nOverride functionality for Ember.View use in old-router\n\n@class View\n@namespace Ember\n*/\nEmber.View.reopen({\n templateForName: function(name, type) {\n if (!name) { return; }\n\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n var templates = get(this, 'templates'),\n template = get(templates, name);\n\n if (!template) {\n throw new Ember.Error(fmt('%@ - Unable to find %@ \"%@\".', [this, type, name]));\n }\n\n return template;\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/view_ext");minispade.register('ember-routing/ext', "(function() {minispade.require('ember-routing/ext/controller');\nminispade.require('ember-routing/ext/view');\n\n})();\n//@ sourceURL=ember-routing/ext");minispade.register('ember-routing/ext/controller', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.ControllerMixin.reopen({\n transitionToRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.transitionToRoute || target.transitionTo;\n return method.apply(target, arguments);\n },\n\n transitionTo: function() {\n Ember.deprecate(\"transitionTo is deprecated. Please use transitionToRoute.\");\n return this.transitionToRoute.apply(this, arguments);\n },\n\n replaceRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.replaceRoute || target.replaceWith;\n return method.apply(target, arguments);\n },\n\n replaceWith: function() {\n Ember.deprecate(\"replaceWith is deprecated. Please use replaceRoute.\");\n return this.replaceRoute.apply(this, arguments);\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/controller");minispade.register('ember-routing/ext/view', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.View.reopen({\n init: function() {\n set(this, '_outlets', {});\n this._super();\n },\n\n connectOutlet: function(outletName, view) {\n var outlets = get(this, '_outlets'),\n container = get(this, 'container'),\n router = container && container.lookup('router:main'),\n renderedName = get(view, 'renderedName');\n\n set(outlets, outletName, view);\n\n if (router && renderedName) {\n router._connectActiveView(renderedName, view);\n }\n },\n\n disconnectOutlet: function(outletName) {\n var outlets = get(this, '_outlets');\n\n set(outlets, outletName, null);\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/view");minispade.register('ember-routing/helpers', "(function() {minispade.require('ember-routing/helpers/shared');\nminispade.require('ember-routing/helpers/link_to');\nminispade.require('ember-routing/helpers/outlet');\nminispade.require('ember-routing/helpers/render');\nminispade.require('ember-routing/helpers/action');\nminispade.require('ember-routing/helpers/control');\n\n})();\n//@ sourceURL=ember-routing/helpers");minispade.register('ember-routing/helpers/action', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\nminispade.require('ember-handlebars/ext');\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n var EmberHandlebars = Ember.Handlebars,\n handlebarsGet = EmberHandlebars.get,\n SafeString = EmberHandlebars.SafeString,\n get = Ember.get,\n a_slice = Array.prototype.slice;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return ret.concat(resolveParams(options.context, options.params, { types: types, data: data }));\n }\n\n var ActionHelper = EmberHandlebars.ActionHelper = {\n registeredActions: {}\n };\n\n var keys = [\"alt\", \"shift\", \"meta\", \"ctrl\"];\n\n var isAllowedClick = function(event, allowedKeys) {\n if (typeof allowedKeys === \"undefined\") {\n return isSimpleClick(event);\n }\n\n var allowed = true;\n\n keys.forEach(function(key) {\n if (event[key + \"Key\"] && allowedKeys.indexOf(key) === -1) {\n allowed = false;\n }\n });\n\n return allowed;\n };\n\n ActionHelper.registerAction = function(actionName, options, allowedKeys) {\n var actionId = (++Ember.uuid).toString();\n\n ActionHelper.registeredActions[actionId] = {\n eventName: options.eventName,\n handler: function(event) {\n if (!isAllowedClick(event, allowedKeys)) { return true; }\n\n event.preventDefault();\n\n if (options.bubbles === false) {\n event.stopPropagation();\n }\n\n var target = options.target;\n\n if (target.target) {\n target = handlebarsGet(target.root, target.target, target.options);\n } else {\n target = target.root;\n }\n\n Ember.run(function() {\n if (target.send) {\n target.send.apply(target, args(options.parameters, actionName));\n } else {\n Ember.assert(\"The action '\" + actionName + \"' did not exist on \" + target, typeof target[actionName] === 'function');\n target[actionName].apply(target, args(options.parameters));\n }\n });\n }\n };\n\n options.view.on('willClearRender', function() {\n delete ActionHelper.registeredActions[actionId];\n });\n\n return actionId;\n };\n\n /**\n The `{{action}}` helper registers an HTML element within a template for DOM\n event handling and forwards that interaction to the view's controller\n or supplied `target` option (see 'Specifying a Target').\n\n If the view's controller does not implement the event, the event is sent\n to the current route, and it bubbles up the route hierarchy from there.\n\n User interaction with that element will invoke the supplied action name on\n the appropriate target.\n\n Given the following Handlebars template on the page\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName}}>\n click me\n </div>\n </script>\n ```\n\n And application code\n\n ```javascript\n AController = Ember.Controller.extend({\n anActionName: function() {}\n });\n\n AView = Ember.View.extend({\n controller: AController.create(),\n templateName: 'a-template'\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will results in the following rendered HTML\n\n ```html\n <div class=\"ember-view\">\n <div data-ember-action=\"1\">\n click me\n </div>\n </div>\n ```\n\n Clicking \"click me\" will trigger the `anActionName` method of the\n `AController`. In this case, no additional parameters will be passed.\n\n If you provide additional parameters to the helper:\n\n ```handlebars\n <button {{action 'edit' post}}>Edit</button>\n ```\n\n Those parameters will be passed along as arguments to the JavaScript\n function implementing the action.\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers.\n\n To also disable bubbling, pass `bubbles=false` to the helper:\n\n ```handlebars\n <button {{action 'edit' post bubbles=false}}>Edit</button>\n ```\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See `Ember.View`\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName on=\"doubleClick\"}}>\n click me\n </div>\n </script>\n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n NOTE: Because `{{action}}` depends on Ember's event dispatch system it will\n only function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new `Ember.Application`\n is created. Having an instance of `Ember.Application` will satisfy this\n requirement.\n\n ### Specifying whitelisted modifier keys\n\n By default the `{{action}}` helper will ignore click event with pressed modifier\n keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName allowedKeys=\"alt\"}}>\n click me\n </div>\n </script>\n ```\n\n This way the `{{action}}` will fire when clicking with the alt key pressed down.\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical Ember application, where views are managed through use of the\n `{{outlet}}` helper, actions will bubble to the current controller, then\n to the current route, and then up the route hierarchy.\n\n Alternatively, a `target` option can be provided to the helper to change\n which object will receive the method call. This option must be a path\n path to an object, accessible in the current context:\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action anActionName target=\"MyApplication.someObject\"}}>\n click me\n </div>\n </script>\n ```\n\n Clicking \"click me\" in the rendered HTML of the above template will trigger\n the `anActionName` method of the object at `MyApplication.someObject`.\n\n If an action's target does not implement a method that matches the supplied\n action name an error will be thrown.\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n <div {{action aMethodNameThatIsMissing}}>\n click me\n </div>\n </script>\n ```\n\n With the following application code\n\n ```javascript\n AView = Ember.View.extend({\n templateName; 'a-template',\n // note: no method 'aMethodNameThatIsMissing'\n anActionName: function(event) {}\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when\n \"click me\" is clicked.\n\n ### Additional Parameters\n\n You may specify additional parameters to the `{{action}}` helper. These\n parameters are passed along as the arguments to the JavaScript function\n implementing the action.\n\n ```handlebars\n <script type=\"text/x-handlebars\" data-template-name='a-template'>\n {{#each person in people}}\n <div {{action edit person}}>\n click me\n </div>\n {{/each}}\n </script>\n ```\n\n Clicking \"click me\" will trigger the `edit` method on the current view's\n controller with the current person as a parameter.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object} [context]*\n @param {Hash} options\n */\n EmberHandlebars.registerHelper('action', function(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n view = options.data.view,\n controller;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\"\n };\n\n action.parameters = {\n context: this,\n options: options,\n params: contexts\n };\n\n action.view = view = get(view, 'concreteView');\n\n var root, target;\n\n if (hash.target) {\n root = this;\n target = hash.target;\n } else if (controller = options.data.keywords.controller) {\n root = controller;\n }\n\n action.target = { root: root, target: target, options: options };\n action.bubbles = hash.bubbles;\n\n var actionId = ActionHelper.registerAction(actionName, action, hash.allowedKeys);\n return new SafeString('data-ember-action=\"' + actionId + '\"');\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/action");minispade.register('ember-routing/helpers/control', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nif (Ember.ENV.EXPERIMENTAL_CONTROL_HELPER) {\n var get = Ember.get, set = Ember.set;\n\n /**\n The control helper is currently under development and is considered experimental.\n To enable it, set `ENV.EXPERIMENTAL_CONTROL_HELPER = true` before requiring Ember.\n\n @method control\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {String} modelPath\n @param {Hash} options\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('control', function(path, modelPath, options) {\n if (arguments.length === 2) {\n options = modelPath;\n modelPath = undefined;\n }\n\n var model;\n\n if (modelPath) {\n model = Ember.Handlebars.get(this, modelPath, options);\n }\n\n var controller = options.data.keywords.controller,\n view = options.data.keywords.view,\n children = get(controller, '_childContainers'),\n controlID = options.hash.controlID,\n container, subContainer;\n\n if (children.hasOwnProperty(controlID)) {\n subContainer = children[controlID];\n } else {\n container = get(controller, 'container'),\n subContainer = container.child();\n children[controlID] = subContainer;\n }\n\n var normalizedPath = path.replace(/\\//g, '.');\n\n var childView = subContainer.lookup('view:' + normalizedPath) || subContainer.lookup('view:default'),\n childController = subContainer.lookup('controller:' + normalizedPath),\n childTemplate = subContainer.lookup('template:' + path);\n\n Ember.assert(\"Could not find controller for path: \" + normalizedPath, childController);\n Ember.assert(\"Could not find view for path: \" + normalizedPath, childView);\n\n set(childController, 'target', controller);\n set(childController, 'model', model);\n\n options.hash.template = childTemplate;\n options.hash.controller = childController;\n\n function observer() {\n var model = Ember.Handlebars.get(this, modelPath, options);\n set(childController, 'model', model);\n childView.rerender();\n }\n\n Ember.addObserver(this, modelPath, observer);\n childView.one('willDestroyElement', this, function() {\n Ember.removeObserver(this, modelPath, observer);\n });\n\n Ember.Handlebars.helpers.view.call(this, childView, options);\n });\n}\n\n})();\n//@ sourceURL=ember-routing/helpers/control");minispade.register('ember-routing/helpers/link_to', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n function fullRouteName(router, name) {\n if (!router.hasRoute(name)) {\n name = name + '.index';\n }\n\n return name;\n }\n\n function resolvedPaths(options) {\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return resolveParams(options.context, options.params, { types: types, data: data });\n }\n\n function args(linkView, router, route) {\n var passedRouteName = route || linkView.namedRoute, routeName;\n\n routeName = fullRouteName(router, passedRouteName);\n\n Ember.assert(\"The route \" + passedRouteName + \" was not found\", router.hasRoute(routeName));\n\n var ret = [ routeName ];\n return ret.concat(resolvedPaths(linkView.parameters));\n }\n\n var LinkView = Ember.View.extend({\n tagName: 'a',\n namedRoute: null,\n currentWhen: null,\n title: null,\n activeClass: 'active',\n replace: false,\n attributeBindings: ['href', 'title'],\n classNameBindings: 'active',\n\n // Even though this isn't a virtual view, we want to treat it as if it is\n // so that you can access the parent with {{view.prop}}\n concreteView: Ember.computed(function() {\n return get(this, 'parentView');\n }).property('parentView').volatile(),\n\n active: Ember.computed(function() {\n var router = this.get('router'),\n params = resolvedPaths(this.parameters),\n currentWithIndex = this.currentWhen + '.index',\n isActive = router.isActive.apply(router, [this.currentWhen].concat(params)) ||\n router.isActive.apply(router, [currentWithIndex].concat(params));\n\n if (isActive) { return get(this, 'activeClass'); }\n }).property('namedRoute', 'router.url'),\n\n router: Ember.computed(function() {\n return this.get('controller').container.lookup('router:main');\n }),\n\n click: function(event) {\n if (!isSimpleClick(event)) { return true; }\n\n event.preventDefault();\n if (this.bubbles === false) { event.stopPropagation(); }\n\n var router = this.get('router');\n\n if (this.get('replace')) {\n router.replaceWith.apply(router, args(this, router));\n } else {\n router.transitionTo.apply(router, args(this, router));\n }\n },\n\n href: Ember.computed(function() {\n var router = this.get('router');\n return router.generate.apply(router, args(this, router));\n })\n });\n\n LinkView.toString = function() { return \"LinkView\"; };\n\n /**\n @method linkTo\n @for Ember.Handlebars.helpers\n @param {String} routeName\n @param {Object} [context]*\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('linkTo', function(name) {\n var options = [].slice.call(arguments, -1)[0];\n var params = [].slice.call(arguments, 1, -1);\n\n var hash = options.hash;\n\n hash.namedRoute = name;\n hash.currentWhen = hash.currentWhen || name;\n\n hash.parameters = {\n context: this,\n options: options,\n params: params\n };\n\n return Ember.Handlebars.helpers.view.call(this, LinkView, options);\n });\n\n});\n\n\n})();\n//@ sourceURL=ember-routing/helpers/link_to");minispade.register('ember-routing/helpers/outlet', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n /**\n @module ember\n @submodule ember-routing\n */\n\n Handlebars.OutletView = Ember.ContainerView.extend(Ember._Metamorph);\n\n /**\n The `outlet` helper is a placeholder that the router will fill in with\n the appropriate template based on the current state of the application.\n\n ``` handlebars\n {{outlet}}\n ```\n\n By default, a template based on Ember's naming conventions will be rendered\n into the `outlet` (e.g. `App.PostsRoute` will render the `posts` template).\n\n You can render a different template by using the `render()` method in the\n route's `renderTemplate` hook. The following will render the `favoritePost`\n template into the `outlet`.\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost');\n }\n });\n ```\n\n You can create custom named outlets for more control.\n\n ``` handlebars\n {{outlet favoritePost}}\n {{outlet posts}}\n ```\n\n Then you can define what template is rendered into each outlet in your\n route.\n\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost', { outlet: 'favoritePost' });\n this.render('posts', { outlet: 'posts' });\n }\n });\n ```\n\n @method outlet\n @for Ember.Handlebars.helpers\n @param {String} property the property on the controller\n that holds the view for this outlet\n */\n Handlebars.registerHelper('outlet', function(property, options) {\n var outletSource;\n\n if (property && property.data && property.data.isRenderData) {\n options = property;\n property = 'main';\n }\n\n outletSource = options.data.view;\n while (!(outletSource.get('template.isTop'))){\n outletSource = outletSource.get('_parentView');\n }\n\n options.data.view.set('outletSource', outletSource);\n options.hash.currentViewBinding = '_view.outletSource._outlets.' + property;\n\n return Handlebars.helpers.view.call(this, Handlebars.OutletView, options);\n });\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/outlet");minispade.register('ember-routing/helpers/render', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n /**\n Renders the named template in the current context using the singleton\n instance of the same-named controller.\n\n If a view class with the same name exists, uses the view class.\n\n If a `model` is specified, it becomes the model for that controller.\n\n The default target for `{{action}}`s in the rendered template is the\n named controller.\n\n @method render\n @for Ember.Handlebars.helpers\n @param {String} name\n @param {Object?} contextString\n @param {Hash} options\n */\n Ember.Handlebars.registerHelper('render', function(name, contextString, options) {\n Ember.assert(\"You must pass a template to render\", arguments.length >= 2);\n var container, router, controller, view, context, lookupOptions;\n\n if (arguments.length === 2) {\n options = contextString;\n contextString = undefined;\n }\n\n if (typeof contextString === 'string') {\n context = Ember.Handlebars.get(options.contexts[1], contextString, options);\n lookupOptions = { singleton: false };\n }\n\n name = name.replace(/\\//g, '.');\n container = options.data.keywords.controller.container;\n router = container.lookup('router:main');\n\n Ember.assert(\"This view is already rendered\", !router || !router._lookupActiveView(name));\n\n view = container.lookup('view:' + name) || container.lookup('view:default');\n\n if (controller = options.hash.controller) {\n controller = container.lookup('controller:' + controller, lookupOptions);\n } else {\n controller = Ember.controllerFor(container, name, context, lookupOptions);\n }\n\n if (controller && context) {\n controller.set('model', context);\n }\n\n var root = options.contexts[1];\n\n if (root) {\n view.registerObserver(root, contextString, function() {\n controller.set('model', Ember.Handlebars.get(root, contextString, options));\n });\n }\n\n controller.set('target', options.data.keywords.controller);\n\n options.hash.viewName = Ember.String.camelize(name);\n options.hash.template = container.lookup('template:' + name);\n options.hash.controller = controller;\n\n if (router) {\n router._connectActiveView(name, view);\n }\n\n Ember.Handlebars.helpers.view.call(this, view, options);\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/render");minispade.register('ember-routing/helpers/shared', "(function() {minispade.require('ember-routing/system/router');\n\nEmber.onLoad('Ember.Handlebars', function() {\n var handlebarsResolve = Ember.Handlebars.resolveParams,\n map = Ember.ArrayPolyfills.map,\n get = Ember.get;\n\n function resolveParams(context, params, options) {\n var resolved = handlebarsResolve(context, params, options);\n return map.call(resolved, unwrap);\n\n function unwrap(object, i) {\n if (params[i] === 'controller') { return object; }\n\n if (Ember.ControllerMixin.detect(object)) {\n return unwrap(get(object, 'model'));\n } else {\n return object;\n }\n }\n }\n\n Ember.Router.resolveParams = resolveParams;\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/shared");minispade.register('ember-routing/location', "(function() {minispade.require('ember-views');\nminispade.require('ember-routing/location/api');\nminispade.require('ember-routing/location/none_location');\nminispade.require('ember-routing/location/hash_location');\nminispade.require('ember-routing/location/history_location');\n\n})();\n//@ sourceURL=ember-routing/location");minispade.register('ember-routing/location/api', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n This file implements the `location` API used by Ember's router.\n\n That API is:\n\n getURL: returns the current URL\n setURL(path): sets the current URL\n replaceURL(path): replace the current URL (optional)\n onUpdateURL(callback): triggers the callback when the URL changes\n formatURL(url): formats `url` to be placed into `href` attribute\n\n Calling setURL or replaceURL will not trigger onUpdateURL callbacks.\n\n TODO: This should perhaps be moved so that it's visible in the doc output.\n*/\n\n/**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n You can pass it a `implementation` ('hash', 'history', 'none') to force a\n particular implementation.\n\n @class Location\n @namespace Ember\n @static\n*/\nEmber.Location = {\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n registerImplementation: function(name, implementation) {\n this.implementations[name] = implementation;\n },\n\n implementations: {}\n};\n\n})();\n//@ sourceURL=ember-routing/location/api");minispade.register('ember-routing/location/hash_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.HashLocation implements the location API using the browser's\n hash. At present, it relies on a hashchange event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HashLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n },\n\n /**\n @private\n\n Returns the current `location.hash`, minus the '#' at the front.\n\n @method getURL\n */\n getURL: function() {\n return get(this, 'location').hash.substr(1);\n },\n\n /**\n @private\n\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = Ember.guidFor(this);\n\n Ember.$(window).bind('hashchange.ember-location-'+guid, function() {\n Ember.run(function() {\n var path = location.hash.substr(1);\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(path);\n });\n });\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('hashchange.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('hash', Ember.HashLocation);\n\n})();\n//@ sourceURL=ember-routing/location/hash_location");minispade.register('ember-routing/location/history_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar popstateFired = false;\n\n/**\n Ember.HistoryLocation implements the location API using the browser's\n history.pushState API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HistoryLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n this._initialUrl = this.getURL();\n this.initState();\n },\n\n /**\n @private\n\n Used to set state on first call to setURL\n\n @method initState\n */\n initState: function() {\n this.replaceState(this.formatURL(this.getURL()));\n set(this, 'history', window.history);\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Returns the current `location.pathname` without rootURL\n\n @method getURL\n */\n getURL: function() {\n var rootURL = get(this, 'rootURL'),\n url = get(this, 'location').pathname;\n\n rootURL = rootURL.replace(/\\/$/, '');\n url = url.replace(rootURL, '');\n\n return url;\n },\n\n /**\n @private\n\n Uses `history.pushState` to update the url without a page reload.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n path = this.formatURL(path);\n\n if (this.getState() && this.getState().path !== path) {\n this.pushState(path);\n }\n },\n\n /**\n @private\n\n Uses `history.replaceState` to update the url without a page reload\n or history modification.\n\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n path = this.formatURL(path);\n\n if (this.getState() && this.getState().path !== path) {\n this.replaceState(path);\n }\n },\n\n /**\n @private\n\n Get the current `history.state`\n\n @method getState\n */\n getState: function() {\n return get(this, 'history').state;\n },\n\n /**\n @private\n\n Pushes a new state\n\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n window.history.pushState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Replaces the current state\n\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n window.history.replaceState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = Ember.guidFor(this),\n self = this;\n\n Ember.$(window).bind('popstate.ember-location-'+guid, function(e) {\n // Ignore initial page load popstate event in Chrome\n if(!popstateFired) {\n popstateFired = true;\n if (self.getURL() === self._initialUrl) { return; }\n }\n callback(self.getURL());\n });\n },\n\n /**\n @private\n\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n }\n\n return rootURL + url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('popstate.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('history', Ember.HistoryLocation);\n\n})();\n//@ sourceURL=ember-routing/location/history_location");minispade.register('ember-routing/location/none_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.NoneLocation does not interact with the browser. It is useful for\n testing, or when you need to manage state with your Router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.NoneLocation = Ember.Object.extend({\n path: '',\n\n getURL: function() {\n return get(this, 'path');\n },\n\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n onUpdateURL: function(callback) {\n this.updateCallback = callback;\n },\n\n handleURL: function(url) {\n set(this, 'path', url);\n this.updateCallback(url);\n },\n\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n});\n\nEmber.Location.registerImplementation('none', Ember.NoneLocation);\n\n})();\n//@ sourceURL=ember-routing/location/none_location");minispade.register('ember-routing', "(function() {minispade.require('ember-runtime');\nminispade.require('ember-views');\nminispade.require('ember-handlebars');\nminispade.require('ember-routing/vendor/route-recognizer');\nminispade.require('ember-routing/vendor/router');\nminispade.require('ember-routing/system');\nminispade.require('ember-routing/helpers');\nminispade.require('ember-routing/ext');\nminispade.require('ember-routing/location');\n\n/**\nEmber Routing\n\n@module ember\n@submodule ember-routing\n@requires ember-states\n@requires ember-views\n*/\n\n})();\n//@ sourceURL=ember-routing");minispade.register('ember-routing/system', "(function() {minispade.require('ember-routing/system/dsl');\nminispade.require('ember-routing/system/controller_for');\nminispade.require('ember-routing/system/router');\nminispade.require('ember-routing/system/route');\n\n})();\n//@ sourceURL=ember-routing/system");minispade.register('ember-routing/system/controller_for', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nEmber.controllerFor = function(container, controllerName, context, lookupOptions) {\n return container.lookup('controller:' + controllerName, lookupOptions) ||\n Ember.generateController(container, controllerName, context);\n};\n/**\n Generates a controller automatically if none was provided.\n The type of generated controller depends on the context.\n You can customize your generated controllers by defining\n `App.ObjectController` and `App.ArrayController`\n*/\nEmber.generateController = function(container, controllerName, context) {\n var controller, DefaultController;\n\n if (context && Ember.isArray(context)) {\n DefaultController = container.resolve('controller:array');\n controller = DefaultController.extend({\n content: context\n });\n } else if (context) {\n DefaultController = container.resolve('controller:object');\n controller = DefaultController.extend({\n content: context\n });\n } else {\n DefaultController = container.resolve('controller:basic');\n controller = DefaultController.extend();\n }\n\n controller.toString = function() {\n return \"(generated \" + controllerName + \" controller)\";\n };\n\n container.register('controller', controllerName, controller);\n return container.lookup('controller:' + controllerName);\n};\n\n})();\n//@ sourceURL=ember-routing/system/controller_for");minispade.register('ember-routing/system/dsl', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nfunction DSL(name) {\n this.parent = name;\n this.matches = [];\n}\n\nDSL.prototype = {\n resource: function(name, options, callback) {\n if (arguments.length === 2 && typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n if (arguments.length === 1) {\n options = {};\n }\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (callback) {\n var dsl = new DSL(name);\n callback.call(dsl);\n this.push(options.path, name, dsl.generate());\n } else {\n this.push(options.path, name);\n }\n },\n\n push: function(url, name, callback) {\n if (url === \"\" || url === \"/\") { this.explicitIndex = true; }\n\n this.matches.push([url, name, callback]);\n },\n\n route: function(name, options) {\n Ember.assert(\"You must use `this.resource` to nest\", typeof options !== 'function');\n\n options = options || {};\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (this.parent && this.parent !== 'application') {\n name = this.parent + \".\" + name;\n }\n\n this.push(options.path, name);\n },\n\n generate: function() {\n var dslMatches = this.matches;\n\n if (!this.explicitIndex) {\n this.route(\"index\", { path: \"/\" });\n }\n\n return function(match) {\n for (var i=0, l=dslMatches.length; i<l; i++) {\n var dslMatch = dslMatches[i];\n match(dslMatch[0]).to(dslMatch[1], dslMatch[2]);\n }\n };\n }\n};\n\nDSL.map = function(callback) {\n var dsl = new DSL();\n callback.call(dsl);\n return dsl;\n};\n\nEmber.RouterDSL = DSL;\n\n})();\n//@ sourceURL=ember-routing/system/dsl");minispade.register('ember-routing/system/route', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set,\n classify = Ember.String.classify;\n\n/**\n The `Ember.Route` class is used to define individual routes. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Route\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.Route = Ember.Object.extend({\n /**\n @private\n\n @method exit\n */\n exit: function() {\n this.deactivate();\n teardownView(this);\n },\n\n /**\n @private\n\n @method enter\n */\n enter: function() {\n this.activate();\n },\n\n /**\n The collection of functions keyed by name available on this route as\n action targets.\n\n These functions will be invoked when a matching `{{action}}` is triggered\n from within a template and the application's current route is this route.\n\n Events can also be invoked from other parts of your application via `Route#send`.\n\n The context of event will be the this route.\n\n @see {Ember.Route#send}\n @see {Handlebars.helpers.action}\n\n @property events\n @type Hash\n @default null\n */\n events: null,\n\n /**\n This hook is executed when the router completely exits this route. It is\n not executed when the model for the route changes.\n\n @method deactivate\n */\n deactivate: Ember.K,\n\n /**\n This hook is executed when the router enters the route for the first time.\n It is not executed when the model for the route changes.\n\n @method activate\n */\n activate: Ember.K,\n\n /**\n Transition into another route. Optionally supply a model for the\n route in question. The model will be serialized into the URL\n using the `serialize` hook.\n\n @method transitionTo\n @param {String} name the name of the route\n @param {...Object} models the\n */\n transitionTo: function() {\n if (this._checkingRedirect) { this.redirected = true; }\n return this.router.transitionTo.apply(this.router, arguments);\n },\n\n /**\n Transition into another route while replacing the current URL if\n possible. Identical to `transitionTo` in all other respects.\n\n @method replaceWith\n @param {String} name the name of the route\n @param {...Object} models the\n */\n replaceWith: function() {\n if (this._checkingRedirect) { this.redirected = true; }\n return this.router.replaceWith.apply(this.router, arguments);\n },\n\n send: function() {\n return this.router.send.apply(this.router, arguments);\n },\n\n /**\n @private\n\n This hook is the entry point for router.js\n\n @method setup\n */\n setup: function(context) {\n this.redirected = false;\n this._checkingRedirect = true;\n\n this.redirect(context);\n\n this._checkingRedirect = false;\n if (this.redirected) { return false; }\n\n var controller = this.controllerFor(this.routeName, context);\n\n if (controller) {\n this.controller = controller;\n set(controller, 'model', context);\n }\n\n if (this.setupControllers) {\n Ember.deprecate(\"Ember.Route.setupControllers is deprecated. Please use Ember.Route.setupController(controller, model) instead.\");\n this.setupControllers(controller, context);\n } else {\n this.setupController(controller, context);\n }\n\n if (this.renderTemplates) {\n Ember.deprecate(\"Ember.Route.renderTemplates is deprecated. Please use Ember.Route.renderTemplate(controller, model) instead.\");\n this.renderTemplates(context);\n } else {\n this.renderTemplate(controller, context);\n }\n },\n\n /**\n A hook you can implement to optionally redirect to another route.\n\n If you call `this.transitionTo` from inside of this hook, this route\n will not be entered in favor of the other hook.\n\n @method redirect\n @param {Object} model the model for this route\n */\n redirect: Ember.K,\n\n /**\n @private\n\n The hook called by `router.js` to convert parameters into the context\n for this handler. The public Ember hook is `model`.\n\n @method deserialize\n */\n deserialize: function(params) {\n var model = this.model(params);\n return this.currentModel = model;\n },\n\n /**\n @private\n\n Called when the context is changed by router.js.\n */\n contextDidChange: function() {\n this.currentModel = this.context;\n },\n\n /**\n A hook you can implement to convert the URL into the model for\n this route.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n The model for the `post` route is `App.Post.find(params.post_id)`.\n\n By default, if your route has a dynamic segment ending in `_id`:\n\n * The model class is determined from the segment (`post_id`'s\n class is `App.Post`)\n * The find method is called on the model class with the value of\n the dynamic segment.\n\n @method model\n @param {Object} params the parameters extracted from the URL\n */\n model: function(params) {\n var match, name, sawParams, value;\n\n for (var prop in params) {\n if (match = prop.match(/^(.*)_id$/)) {\n name = match[1];\n value = params[prop];\n }\n sawParams = true;\n }\n\n if (!name && sawParams) { return params; }\n else if (!name) { return; }\n\n var className = classify(name),\n namespace = this.router.namespace,\n modelClass = namespace[className];\n\n Ember.assert(\"You used the dynamic segment \" + name + \"_id in your router, but \" + namespace + \".\" + className + \" did not exist and you did not override your route's `model` hook.\", modelClass);\n return modelClass.find(value);\n },\n\n /**\n A hook you can implement to convert the route's model into parameters\n for the URL.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n // the server returns `{ id: 12 }`\n return jQuery.getJSON(\"/posts/\" + params.post_id);\n },\n\n serialize: function(model) {\n // this will make the URL `/posts/12`\n return { post_id: model.id };\n }\n });\n ```\n\n The default `serialize` method inserts the model's `id` into the\n route's dynamic segment (in this case, `:post_id`).\n\n This method is called when `transitionTo` is called with a context\n in order to populate the URL.\n\n @method serialize\n @param {Object} model the route's model\n @param {Array} params an Array of parameter names for the current\n route (in the example, `['post_id']`.\n @return {Object} the serialized parameters\n */\n serialize: function(model, params) {\n if (params.length !== 1) { return; }\n\n var name = params[0], object = {};\n\n if (/_id$/.test(name)) {\n object[name] = get(model, 'id');\n } else {\n object[name] = model;\n }\n\n return object;\n },\n\n /**\n A hook you can use to setup the controller for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n For the `post` route, the controller is `App.PostController`.\n\n By default, the `setupController` hook sets the `content` property of\n the controller to the `model`.\n\n If no explicit controller is defined, the route will automatically create\n an appropriate controller for the model:\n\n * if the model is an `Ember.Array` (including record arrays from Ember\n Data), the controller is an `Ember.ArrayController`.\n * otherwise, the controller is an `Ember.ObjectController`.\n\n This means that your template will get a proxy for the model as its\n context, and you can act as though the model itself was the context.\n\n @method setupController\n */\n setupController: Ember.K,\n\n /**\n Returns the controller for a particular route.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.controllerFor('posts').set('currentPost', post);\n }\n });\n ```\n\n By default, the controller for `post` is the shared instance of\n `App.PostController`.\n\n @method controllerFor\n @param {String} name the name of the route\n @param {Object} model the model associated with the route (optional)\n @return {Ember.Controller}\n */\n controllerFor: function(name, model) {\n var container = this.router.container,\n controller = container.lookup('controller:' + name);\n\n if (!controller) {\n model = model || this.modelFor(name);\n\n Ember.assert(\"You are trying to look up a controller that you did not define, and for which Ember does not know the model.\\n\\nThis is not a controller for a route, so you must explicitly define the controller (\"+this.router.namespace.toString() + \".\" + Ember.String.capitalize(Ember.String.camelize(name))+\"Controller) or pass a model as the second parameter to `controllerFor`, so that Ember knows which type of controller to create for you.\", model || this.container.lookup('route:' + name));\n\n controller = Ember.generateController(container, name, model);\n }\n\n return controller;\n },\n\n /**\n Returns the current model for a given route.\n\n This is the object returned by the `model` hook of the route\n in question.\n\n @method modelFor\n @param {String} name the name of the route\n @return {Object} the model object\n */\n modelFor: function(name) {\n var route = this.container.lookup('route:' + name);\n return route && route.currentModel;\n },\n\n /**\n A hook you can use to render the template for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook. By default, it renders the route's\n template, configured with the controller for the route.\n\n This method can be overridden to set up and render additional or\n alternative templates.\n\n @method renderTemplate\n @param {Object} controller the route's controller\n @param {Object} model the route's model\n */\n renderTemplate: function(controller, model) {\n this.render();\n },\n\n /**\n Renders a template into an outlet.\n\n This method has a number of defaults, based on the name of the\n route specified in the router.\n\n For example:\n\n ```js\n App.Router.map(function() {\n this.route('index');\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render();\n }\n });\n ```\n\n The name of the `PostRoute`, as defined by the router, is `post`.\n\n By default, render will:\n\n * render the `post` template\n * with the `post` view (`PostView`) for event handling, if one exists\n * and the `post` controller (`PostController`), if one exists\n * into the `main` outlet of the `application` template\n\n You can override this behavior:\n\n ```js\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render('myPost', { // the template to render\n into: 'index', // the template to render into\n outlet: 'detail', // the name of the outlet in that template\n controller: 'blogPost' // the controller to use for the template\n });\n }\n });\n ```\n\n Remember that the controller's `content` will be the route's model. In\n this case, the default model will be `App.Post.find(params.post_id)`.\n\n @method render\n @param {String} name the name of the template to render\n @param {Object} options the options\n */\n render: function(name, options) {\n Ember.assert(\"The name in the given arguments is undefined\", arguments.length > 0 ? !Ember.isNone(arguments[0]) : true);\n\n if (typeof name === 'object' && !options) {\n options = name;\n name = this.routeName;\n }\n\n name = name ? name.replace(/\\//g, '.') : this.routeName;\n\n var container = this.container,\n view = container.lookup('view:' + name),\n template = container.lookup('template:' + name);\n\n if (!view && !template) { return; }\n\n options = normalizeOptions(this, name, template, options);\n view = setupView(view, container, options);\n\n if (options.outlet === 'main') { this.lastRenderedTemplate = name; }\n\n appendView(this, view, options);\n },\n\n willDestroy: function() {\n teardownView(this);\n }\n});\n\nfunction parentRoute(route) {\n var handlerInfos = route.router.router.currentHandlerInfos;\n\n var parent, current;\n\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n current = handlerInfos[i].handler;\n if (current === route) { return parent; }\n parent = current;\n }\n}\n\nfunction parentTemplate(route, isRecursive) {\n var parent = parentRoute(route), template;\n\n if (!parent) { return; }\n\n Ember.warn(\"The immediate parent route did not render into the main outlet and the default 'into' option may not be expected\", !isRecursive);\n\n if (template = parent.lastRenderedTemplate) {\n return template;\n } else {\n return parentTemplate(parent, true);\n }\n}\n\nfunction normalizeOptions(route, name, template, options) {\n options = options || {};\n options.into = options.into ? options.into.replace(/\\//g, '.') : parentTemplate(route);\n options.outlet = options.outlet || 'main';\n options.name = name;\n options.template = template;\n\n Ember.assert(\"An outlet (\"+options.outlet+\") was specified but this view will render at the root level.\", options.outlet === 'main' || options.into);\n\n var controller = options.controller, namedController;\n\n if (options.controller) {\n controller = options.controller;\n } else if (namedController = route.container.lookup('controller:' + name)) {\n controller = namedController;\n } else {\n controller = route.routeName;\n }\n\n if (typeof controller === 'string') {\n controller = route.container.lookup('controller:' + controller);\n }\n\n options.controller = controller;\n\n return options;\n}\n\nfunction setupView(view, container, options) {\n var defaultView = options.into ? 'view:default' : 'view:toplevel';\n\n view = view || container.lookup(defaultView);\n\n if (!get(view, 'templateName')) {\n set(view, 'template', options.template);\n\n set(view, '_debugTemplateName', options.name);\n }\n\n set(view, 'renderedName', options.name);\n set(view, 'controller', options.controller);\n\n return view;\n}\n\nfunction appendView(route, view, options) {\n if (options.into) {\n var parentView = route.router._lookupActiveView(options.into);\n route.teardownView = teardownOutlet(parentView, options.outlet);\n parentView.connectOutlet(options.outlet, view);\n } else {\n var rootElement = get(route, 'router.namespace.rootElement');\n route.router._connectActiveView(options.name, view);\n route.teardownView = teardownTopLevel(view);\n view.appendTo(rootElement);\n }\n}\n\nfunction teardownTopLevel(view) {\n return function() { view.destroy(); };\n}\n\nfunction teardownOutlet(parentView, outlet) {\n return function() { parentView.disconnectOutlet(outlet); };\n}\n\nfunction teardownView(route) {\n if (route.teardownView) { route.teardownView(); }\n\n delete route.teardownView;\n delete route.lastRenderedTemplate;\n}\n\n})();\n//@ sourceURL=ember-routing/system/route");minispade.register('ember-routing/system/router', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar Router = requireModule(\"router\");\nvar get = Ember.get, set = Ember.set;\n\nvar DefaultView = Ember._MetamorphView;\nminispade.require(\"ember-routing/system/dsl\");\n\nfunction setupLocation(router) {\n var location = get(router, 'location'),\n rootURL = get(router, 'rootURL');\n\n if ('string' === typeof location) {\n location = set(router, 'location', Ember.Location.create({\n implementation: location\n }));\n\n if (typeof rootURL === 'string') {\n set(location, 'rootURL', rootURL);\n }\n }\n}\n\n/**\n The `Ember.Router` class manages the application state and URLs. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Router\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.Router = Ember.Object.extend({\n location: 'hash',\n\n init: function() {\n this.router = this.constructor.router;\n this._activeViews = {};\n setupLocation(this);\n },\n\n url: Ember.computed(function() {\n return get(this, 'location').getURL();\n }),\n\n startRouting: function() {\n this.router = this.router || this.constructor.map(Ember.K);\n\n var router = this.router,\n location = get(this, 'location'),\n container = this.container,\n self = this;\n\n setupRouter(this, router, location);\n\n container.register('view', 'default', DefaultView);\n container.register('view', 'toplevel', Ember.View.extend());\n\n location.onUpdateURL(function(url) {\n self.handleURL(url);\n });\n\n this.handleURL(location.getURL());\n },\n\n didTransition: function(infos) {\n // Don't do any further action here if we redirected\n for (var i=0, l=infos.length; i<l; i++) {\n if (infos[i].handler.redirected) { return; }\n }\n\n var appController = this.container.lookup('controller:application'),\n path = routePath(infos);\n\n set(appController, 'currentPath', path);\n this.notifyPropertyChange('url');\n\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Transitioned into '\" + path + \"'\");\n }\n },\n\n handleURL: function(url) {\n this.router.handleURL(url);\n this.notifyPropertyChange('url');\n },\n\n transitionTo: function(name) {\n var args = [].slice.call(arguments);\n doTransition(this, 'transitionTo', args);\n },\n\n replaceWith: function() {\n var args = [].slice.call(arguments);\n doTransition(this, 'replaceWith', args);\n },\n\n generate: function() {\n var url = this.router.generate.apply(this.router, arguments);\n return this.location.formatURL(url);\n },\n\n isActive: function(routeName) {\n var router = this.router;\n return router.isActive.apply(router, arguments);\n },\n\n send: function(name, context) {\n this.router.trigger.apply(this.router, arguments);\n },\n\n hasRoute: function(route) {\n return this.router.hasRoute(route);\n },\n\n _lookupActiveView: function(templateName) {\n var active = this._activeViews[templateName];\n return active && active[0];\n },\n\n _connectActiveView: function(templateName, view) {\n var existing = this._activeViews[templateName];\n\n if (existing) {\n existing[0].off('willDestroyElement', this, existing[1]);\n }\n\n var disconnect = function() {\n delete this._activeViews[templateName];\n };\n\n this._activeViews[templateName] = [view, disconnect];\n view.one('willDestroyElement', this, disconnect);\n }\n});\n\nEmber.Router.reopenClass({\n defaultFailureHandler: {\n setup: function(error) {\n Ember.Logger.error('Error while loading route:', error);\n\n // Using setTimeout allows us to escape from the Promise's try/catch block\n setTimeout(function() { throw error; });\n }\n }\n});\n\nfunction getHandlerFunction(router) {\n var seen = {}, container = router.container,\n DefaultRoute = container.resolve('route:basic');\n\n return function(name) {\n var handler = container.lookup('route:' + name);\n if (seen[name]) { return handler; }\n\n seen[name] = true;\n\n if (!handler) {\n if (name === 'loading') { return {}; }\n if (name === 'failure') { return router.constructor.defaultFailureHandler; }\n\n container.register('route', name, DefaultRoute.extend());\n handler = container.lookup('route:' + name);\n }\n\n handler.routeName = name;\n return handler;\n };\n}\n\nfunction handlerIsActive(router, handlerName) {\n var handler = router.container.lookup('route:' + handlerName),\n currentHandlerInfos = router.router.currentHandlerInfos,\n handlerInfo;\n\n for (var i=0, l=currentHandlerInfos.length; i<l; i++) {\n handlerInfo = currentHandlerInfos[i];\n if (handlerInfo.handler === handler) { return true; }\n }\n\n return false;\n}\n\nfunction routePath(handlerInfos) {\n var path = [];\n\n for (var i=1, l=handlerInfos.length; i<l; i++) {\n var name = handlerInfos[i].name,\n nameParts = name.split(\".\");\n\n path.push(nameParts[nameParts.length - 1]);\n }\n\n return path.join(\".\");\n}\n\nfunction setupRouter(emberRouter, router, location) {\n var lastURL;\n\n router.getHandler = getHandlerFunction(emberRouter);\n\n var doUpdateURL = function() {\n location.setURL(lastURL);\n };\n\n router.updateURL = function(path) {\n lastURL = path;\n Ember.run.once(doUpdateURL);\n };\n\n if (location.replaceURL) {\n var doReplaceURL = function() {\n location.replaceURL(lastURL);\n };\n\n router.replaceURL = function(path) {\n lastURL = path;\n Ember.run.once(doReplaceURL);\n };\n }\n\n router.didTransition = function(infos) {\n emberRouter.didTransition(infos);\n };\n}\n\nfunction doTransition(router, method, args) {\n var passedName = args[0], name;\n\n if (!router.router.hasRoute(args[0])) {\n name = args[0] = passedName + '.index';\n } else {\n name = passedName;\n }\n\n Ember.assert(\"The route \" + passedName + \" was not found\", router.router.hasRoute(name));\n\n router.router[method].apply(router.router, args);\n router.notifyPropertyChange('url');\n}\n\nEmber.Router.reopenClass({\n map: function(callback) {\n var router = this.router = new Router();\n\n var dsl = Ember.RouterDSL.map(function() {\n this.resource('application', { path: \"/\" }, function() {\n callback.call(this);\n });\n });\n\n router.map(dsl.generate());\n return router;\n }\n});\n\n})();\n//@ sourceURL=ember-routing/system/router");minispade.register('ember-routing/vendor/route-recognizer', "(function() {define(\"route-recognizer\",\n [],\n function() {\n \"use strict\";\n var specials = [\n '/', '.', '*', '+', '?', '|',\n '(', ')', '[', ']', '{', '}', '\\\\'\n ];\n\n var escapeRegex = new RegExp('(\\\\' + specials.join('|\\\\') + ')', 'g');\n\n // A Segment represents a segment in the original route description.\n // Each Segment type provides an `eachChar` and `regex` method.\n //\n // The `eachChar` method invokes the callback with one or more character\n // specifications. A character specification consumes one or more input\n // characters.\n //\n // The `regex` method returns a regex fragment for the segment. If the\n // segment is a dynamic of star segment, the regex fragment also includes\n // a capture.\n //\n // A character specification contains:\n //\n // * `validChars`: a String with a list of all valid characters, or\n // * `invalidChars`: a String with a list of all invalid characters\n // * `repeat`: true if the character specification can repeat\n\n function StaticSegment(string) { this.string = string; }\n StaticSegment.prototype = {\n eachChar: function(callback) {\n var string = this.string, char;\n\n for (var i=0, l=string.length; i<l; i++) {\n char = string.charAt(i);\n callback({ validChars: char });\n }\n },\n\n regex: function() {\n return this.string.replace(escapeRegex, '\\\\$1');\n },\n\n generate: function() {\n return this.string;\n }\n };\n\n function DynamicSegment(name) { this.name = name; }\n DynamicSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"/\", repeat: true });\n },\n\n regex: function() {\n return \"([^/]+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function StarSegment(name) { this.name = name; }\n StarSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"\", repeat: true });\n },\n\n regex: function() {\n return \"(.+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function EpsilonSegment() {}\n EpsilonSegment.prototype = {\n eachChar: function() {},\n regex: function() { return \"\"; },\n generate: function() { return \"\"; }\n };\n\n function parse(route, names, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.charAt(0) === \"/\") { route = route.substr(1); }\n\n var segments = route.split(\"/\"), results = [];\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i], match;\n\n if (match = segment.match(/^:([^\\/]+)$/)) {\n results.push(new DynamicSegment(match[1]));\n names.push(match[1]);\n types.dynamics++;\n } else if (match = segment.match(/^\\*([^\\/]+)$/)) {\n results.push(new StarSegment(match[1]));\n names.push(match[1]);\n types.stars++;\n } else if(segment === \"\") {\n results.push(new EpsilonSegment());\n } else {\n results.push(new StaticSegment(segment));\n types.statics++;\n }\n }\n\n return results;\n }\n\n // A State has a character specification and (`charSpec`) and a list of possible\n // subsequent states (`nextStates`).\n //\n // If a State is an accepting state, it will also have several additional\n // properties:\n //\n // * `regex`: A regular expression that is used to extract parameters from paths\n // that reached this accepting state.\n // * `handlers`: Information on how to convert the list of captures into calls\n // to registered handlers with the specified parameters\n // * `types`: How many static, dynamic or star segments in this route. Used to\n // decide which route to use if multiple registered routes match a path.\n //\n // Currently, State is implemented naively by looping over `nextStates` and\n // comparing a character specification against a character. A more efficient\n // implementation would use a hash of keys pointing at one or more next states.\n\n function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }\n\n State.prototype = {\n get: function(charSpec) {\n var nextStates = this.nextStates;\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n var child = nextStates[i];\n\n var isEqual = child.charSpec.validChars === charSpec.validChars;\n isEqual = isEqual && child.charSpec.invalidChars === charSpec.invalidChars;\n\n if (isEqual) { return child; }\n }\n },\n\n put: function(charSpec) {\n var state;\n\n // If the character specification already exists in a child of the current\n // state, just return that state.\n if (state = this.get(charSpec)) { return state; }\n\n // Make a new state for the character spec\n state = new State(charSpec);\n\n // Insert the new state as a child of the current state\n this.nextStates.push(state);\n\n // If this character specification repeats, insert the new state as a child\n // of itself. Note that this will not trigger an infinite loop because each\n // transition during recognition consumes a character.\n if (charSpec.repeat) {\n state.nextStates.push(state);\n }\n\n // Return the new state\n return state;\n },\n\n // Find a list of child states matching the next character\n match: function(char) {\n // DEBUG \"Processing `\" + char + \"`:\"\n var nextStates = this.nextStates,\n child, charSpec, chars;\n\n // DEBUG \" \" + debugState(this)\n var returned = [];\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n child = nextStates[i];\n\n charSpec = child.charSpec;\n\n if (typeof (chars = charSpec.validChars) !== 'undefined') {\n if (chars.indexOf(char) !== -1) { returned.push(child); }\n } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') {\n if (chars.indexOf(char) === -1) { returned.push(child); }\n }\n }\n\n return returned;\n }\n\n /** IF DEBUG\n , debug: function() {\n var charSpec = this.charSpec,\n debug = \"[\",\n chars = charSpec.validChars || charSpec.invalidChars;\n\n if (charSpec.invalidChars) { debug += \"^\"; }\n debug += chars;\n debug += \"]\";\n\n if (charSpec.repeat) { debug += \"+\"; }\n\n return debug;\n }\n END IF **/\n };\n\n /** IF DEBUG\n function debug(log) {\n console.log(log);\n }\n\n function debugState(state) {\n return state.nextStates.map(function(n) {\n if (n.nextStates.length === 0) { return \"( \" + n.debug() + \" [accepting] )\"; }\n return \"( \" + n.debug() + \" <then> \" + n.nextStates.map(function(s) { return s.debug() }).join(\" or \") + \" )\";\n }).join(\", \")\n }\n END IF **/\n\n // This is a somewhat naive strategy, but should work in a lot of cases\n // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id\n function sortSolutions(states) {\n return states.sort(function(a, b) {\n if (a.types.stars !== b.types.stars) { return a.types.stars - b.types.stars; }\n if (a.types.dynamics !== b.types.dynamics) { return a.types.dynamics - b.types.dynamics; }\n if (a.types.statics !== b.types.statics) { return a.types.statics - b.types.statics; }\n\n return 0;\n });\n }\n\n function recognizeChar(states, char) {\n var nextStates = [];\n\n for (var i=0, l=states.length; i<l; i++) {\n var state = states[i];\n\n nextStates = nextStates.concat(state.match(char));\n }\n\n return nextStates;\n }\n\n function findHandler(state, path) {\n var handlers = state.handlers, regex = state.regex;\n var captures = path.match(regex), currentCapture = 1;\n var result = [];\n\n for (var i=0, l=handlers.length; i<l; i++) {\n var handler = handlers[i], names = handler.names, params = {};\n\n for (var j=0, m=names.length; j<m; j++) {\n params[names[j]] = captures[currentCapture++];\n }\n\n result.push({ handler: handler.handler, params: params, isDynamic: !!names.length });\n }\n\n return result;\n }\n\n function addSegment(currentState, segment) {\n segment.eachChar(function(char) {\n var state;\n\n currentState = currentState.put(char);\n });\n\n return currentState;\n }\n\n // The main interface\n\n var RouteRecognizer = function() {\n this.rootState = new State();\n this.names = {};\n };\n\n\n RouteRecognizer.prototype = {\n add: function(routes, options) {\n var currentState = this.rootState, regex = \"^\",\n types = { statics: 0, dynamics: 0, stars: 0 },\n handlers = [], allSegments = [], name;\n\n var isEmpty = true;\n\n for (var i=0, l=routes.length; i<l; i++) {\n var route = routes[i], names = [];\n\n var segments = parse(route.path, names, types);\n\n allSegments = allSegments.concat(segments);\n\n for (var j=0, m=segments.length; j<m; j++) {\n var segment = segments[j];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n isEmpty = false;\n\n // Add a \"/\" for the new segment\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n\n // Add a representation of the segment to the NFA and regex\n currentState = addSegment(currentState, segment);\n regex += segment.regex();\n }\n\n handlers.push({ handler: route.handler, names: names });\n }\n\n if (isEmpty) {\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n }\n\n currentState.handlers = handlers;\n currentState.regex = new RegExp(regex + \"$\");\n currentState.types = types;\n\n if (name = options && options.as) {\n this.names[name] = {\n segments: allSegments,\n handlers: handlers\n };\n }\n },\n\n handlersFor: function(name) {\n var route = this.names[name], result = [];\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n for (var i=0, l=route.handlers.length; i<l; i++) {\n result.push(route.handlers[i]);\n }\n\n return result;\n },\n\n hasRoute: function(name) {\n return !!this.names[name];\n },\n\n generate: function(name, params) {\n var route = this.names[name], output = \"\";\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n var segments = route.segments;\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n output += \"/\";\n output += segment.generate(params);\n }\n\n if (output.charAt(0) !== '/') { output = '/' + output; }\n\n return output;\n },\n\n recognize: function(path) {\n var states = [ this.rootState ], i, l;\n\n // DEBUG GROUP path\n\n var pathLen = path.length;\n\n if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\n if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n path = path.substr(0, pathLen - 1);\n }\n\n for (i=0, l=path.length; i<l; i++) {\n states = recognizeChar(states, path.charAt(i));\n if (!states.length) { break; }\n }\n\n // END DEBUG GROUP\n\n var solutions = [];\n for (i=0, l=states.length; i<l; i++) {\n if (states[i].handlers) { solutions.push(states[i]); }\n }\n\n states = sortSolutions(solutions);\n\n var state = solutions[0];\n\n if (state && state.handlers) {\n return findHandler(state, path);\n }\n }\n };\n\n function Target(path, matcher, delegate) {\n this.path = path;\n this.matcher = matcher;\n this.delegate = delegate;\n }\n\n Target.prototype = {\n to: function(target, callback) {\n var delegate = this.delegate;\n\n if (delegate && delegate.willAddRoute) {\n target = delegate.willAddRoute(this.matcher.target, target);\n }\n\n this.matcher.add(this.path, target);\n\n if (callback) {\n if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n this.matcher.addChild(this.path, target, callback, this.delegate);\n }\n }\n };\n\n function Matcher(target) {\n this.routes = {};\n this.children = {};\n this.target = target;\n }\n\n Matcher.prototype = {\n add: function(path, handler) {\n this.routes[path] = handler;\n },\n\n addChild: function(path, target, callback, delegate) {\n var matcher = new Matcher(target);\n this.children[path] = matcher;\n\n var match = generateMatch(path, matcher, delegate);\n\n if (delegate && delegate.contextEntered) {\n delegate.contextEntered(target, match);\n }\n\n callback(match);\n }\n };\n\n function generateMatch(startingPath, matcher, delegate) {\n return function(path, nestedCallback) {\n var fullPath = startingPath + path;\n\n if (nestedCallback) {\n nestedCallback(generateMatch(fullPath, matcher, delegate));\n } else {\n return new Target(startingPath + path, matcher, delegate);\n }\n };\n }\n\n function addRoute(routeArray, path, handler) {\n var len = 0;\n for (var i=0, l=routeArray.length; i<l; i++) {\n len += routeArray[i].path.length;\n }\n\n path = path.substr(len);\n routeArray.push({ path: path, handler: handler });\n }\n\n function eachRoute(baseRoute, matcher, callback, binding) {\n var routes = matcher.routes;\n\n for (var path in routes) {\n if (routes.hasOwnProperty(path)) {\n var routeArray = baseRoute.slice();\n addRoute(routeArray, path, routes[path]);\n\n if (matcher.children[path]) {\n eachRoute(routeArray, matcher.children[path], callback, binding);\n } else {\n callback.call(binding, routeArray);\n }\n }\n }\n }\n\n RouteRecognizer.prototype.map = function(callback, addRouteCallback) {\n var matcher = new Matcher();\n\n callback(generateMatch(\"\", matcher, this.delegate));\n\n eachRoute([], matcher, function(route) {\n if (addRouteCallback) { addRouteCallback(this, route); }\n else { this.add(route); }\n }, this);\n };\n return RouteRecognizer;\n });\n\n})();\n//@ sourceURL=ember-routing/vendor/route-recognizer");minispade.register('ember-routing/vendor/router', "(function() {define(\"router\",\n [\"route-recognizer\"],\n function(RouteRecognizer) {\n \"use strict\";\n /**\n @private\n\n This file references several internal structures:\n\n ## `RecognizedHandler`\n\n * `{String} handler`: A handler name\n * `{Object} params`: A hash of recognized parameters\n\n ## `UnresolvedHandlerInfo`\n\n * `{Boolean} isDynamic`: whether a handler has any dynamic segments\n * `{String} name`: the name of a handler\n * `{Object} context`: the active context for the handler\n\n ## `HandlerInfo`\n\n * `{Boolean} isDynamic`: whether a handler has any dynamic segments\n * `{String} name`: the original unresolved handler name\n * `{Object} handler`: a handler object\n * `{Object} context`: the active context for the handler\n */\n\n\n function Router() {\n this.recognizer = new RouteRecognizer();\n }\n\n\n Router.prototype = {\n /**\n The main entry point into the router. The API is essentially\n the same as the `map` method in `route-recognizer`.\n\n This method extracts the String handler at the last `.to()`\n call and uses it as the name of the whole route.\n\n @param {Function} callback\n */\n map: function(callback) {\n this.recognizer.delegate = this.delegate;\n\n this.recognizer.map(callback, function(recognizer, route) {\n var lastHandler = route[route.length - 1].handler;\n var args = [route, { as: lastHandler }];\n recognizer.add.apply(recognizer, args);\n });\n },\n\n hasRoute: function(route) {\n return this.recognizer.hasRoute(route);\n },\n\n /**\n The entry point for handling a change to the URL (usually\n via the back and forward button).\n\n Returns an Array of handlers and the parameters associated\n with those parameters.\n\n @param {String} url a URL to process\n\n @return {Array} an Array of `[handler, parameter]` tuples\n */\n handleURL: function(url) {\n var results = this.recognizer.recognize(url),\n objects = [];\n\n if (!results) {\n throw new Error(\"No route matched the URL '\" + url + \"'\");\n }\n\n collectObjects(this, results, 0, []);\n },\n\n /**\n Hook point for updating the URL.\n\n @param {String} url a URL to update to\n */\n updateURL: function() {\n throw \"updateURL is not implemented\";\n },\n\n /**\n Hook point for replacing the current URL, i.e. with replaceState\n\n By default this behaves the same as `updateURL`\n\n @param {String} url a URL to update to\n */\n replaceURL: function(url) {\n this.updateURL(url);\n },\n\n /**\n Transition into the specified named route.\n\n If necessary, trigger the exit callback on any handlers\n that are no longer represented by the target route.\n\n @param {String} name the name of the route\n */\n transitionTo: function(name) {\n var args = Array.prototype.slice.call(arguments, 1);\n doTransition(this, name, this.updateURL, args);\n },\n\n /**\n Identical to `transitionTo` except that the current URL will be replaced\n if possible.\n\n This method is intended primarily for use with `replaceState`.\n\n @param {String} name the name of the route\n */\n replaceWith: function(name) {\n var args = Array.prototype.slice.call(arguments, 1);\n doTransition(this, name, this.replaceURL, args);\n },\n\n /**\n @private\n\n This method takes a handler name and a list of contexts and returns\n a serialized parameter hash suitable to pass to `recognizer.generate()`.\n\n @param {String} handlerName\n @param {Array[Object]} contexts\n @return {Object} a serialized parameter hash\n */\n paramsForHandler: function(handlerName, callback) {\n var output = this._paramsForHandler(handlerName, [].slice.call(arguments, 1));\n return output.params;\n },\n\n /**\n Take a named route and context objects and generate a\n URL.\n\n @param {String} name the name of the route to generate\n a URL for\n @param {...Object} objects a list of objects to serialize\n\n @return {String} a URL\n */\n generate: function(handlerName) {\n var params = this.paramsForHandler.apply(this, arguments);\n return this.recognizer.generate(handlerName, params);\n },\n\n /**\n @private\n\n Used internally by `generate` and `transitionTo`.\n */\n _paramsForHandler: function(handlerName, objects, doUpdate) {\n var handlers = this.recognizer.handlersFor(handlerName),\n params = {},\n toSetup = [],\n startIdx = handlers.length,\n objectsToMatch = objects.length,\n object, objectChanged, handlerObj, handler, names, i, len;\n\n // Find out which handler to start matching at\n for (i=handlers.length-1; i>=0 && objectsToMatch>0; i--) {\n if (handlers[i].names.length) {\n objectsToMatch--;\n startIdx = i;\n }\n }\n\n if (objectsToMatch > 0) {\n throw \"More objects were passed than dynamic segments\";\n }\n\n // Connect the objects to the routes\n for (i=0, len=handlers.length; i<len; i++) {\n handlerObj = handlers[i];\n handler = this.getHandler(handlerObj.handler);\n names = handlerObj.names;\n objectChanged = false;\n\n // If it's a dynamic segment\n if (names.length) {\n // If we have objects, use them\n if (i >= startIdx) {\n object = objects.shift();\n objectChanged = true;\n // Otherwise use existing context\n } else {\n object = handler.context;\n }\n\n // Serialize to generate params\n if (handler.serialize) {\n merge(params, handler.serialize(object, names));\n }\n // If it's not a dynamic segment and we're updating\n } else if (doUpdate) {\n // If we've passed the match point we need to deserialize again\n // or if we never had a context\n if (i > startIdx || !handler.hasOwnProperty('context')) {\n if (handler.deserialize) {\n object = handler.deserialize({});\n objectChanged = true;\n }\n // Otherwise use existing context\n } else {\n object = handler.context;\n }\n }\n\n // Make sure that we update the context here so it's available to\n // subsequent deserialize calls\n if (doUpdate && objectChanged) {\n // TODO: It's a bit awkward to set the context twice, see if we can DRY things up\n setContext(handler, object);\n }\n\n toSetup.push({\n isDynamic: !!handlerObj.names.length,\n handler: handlerObj.handler,\n name: handlerObj.name,\n context: object\n });\n }\n\n return { params: params, toSetup: toSetup };\n },\n\n isActive: function(handlerName) {\n var contexts = [].slice.call(arguments, 1);\n\n var currentHandlerInfos = this.currentHandlerInfos,\n found = false, names, object, handlerInfo, handlerObj;\n\n for (var i=currentHandlerInfos.length-1; i>=0; i--) {\n handlerInfo = currentHandlerInfos[i];\n if (handlerInfo.name === handlerName) { found = true; }\n\n if (found) {\n if (contexts.length === 0) { break; }\n\n if (handlerInfo.isDynamic) {\n object = contexts.pop();\n if (handlerInfo.context !== object) { return false; }\n }\n }\n }\n\n return contexts.length === 0 && found;\n },\n\n trigger: function(name) {\n var args = [].slice.call(arguments);\n trigger(this, args);\n }\n };\n\n function merge(hash, other) {\n for (var prop in other) {\n if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; }\n }\n }\n\n function isCurrent(currentHandlerInfos, handlerName) {\n return currentHandlerInfos[currentHandlerInfos.length - 1].name === handlerName;\n }\n\n /**\n @private\n\n This function is called the first time the `collectObjects`\n function encounters a promise while converting URL parameters\n into objects.\n\n It triggers the `enter` and `setup` methods on the `loading`\n handler.\n\n @param {Router} router\n */\n function loading(router) {\n if (!router.isLoading) {\n router.isLoading = true;\n var handler = router.getHandler('loading');\n\n if (handler) {\n if (handler.enter) { handler.enter(); }\n if (handler.setup) { handler.setup(); }\n }\n }\n }\n\n /**\n @private\n\n This function is called if a promise was previously\n encountered once all promises are resolved.\n\n It triggers the `exit` method on the `loading` handler.\n\n @param {Router} router\n */\n function loaded(router) {\n router.isLoading = false;\n var handler = router.getHandler('loading');\n if (handler && handler.exit) { handler.exit(); }\n }\n\n /**\n @private\n\n This function is called if any encountered promise\n is rejected.\n\n It triggers the `exit` method on the `loading` handler,\n the `enter` method on the `failure` handler, and the\n `setup` method on the `failure` handler with the\n `error`.\n\n @param {Router} router\n @param {Object} error the reason for the promise\n rejection, to pass into the failure handler's\n `setup` method.\n */\n function failure(router, error) {\n loaded(router);\n var handler = router.getHandler('failure');\n if (handler && handler.setup) { handler.setup(error); }\n }\n\n /**\n @private\n */\n function doTransition(router, name, method, args) {\n var output = router._paramsForHandler(name, args, true);\n var params = output.params, toSetup = output.toSetup;\n\n var url = router.recognizer.generate(name, params);\n method.call(router, url);\n\n setupContexts(router, toSetup);\n }\n\n /**\n @private\n\n This function is called after a URL change has been handled\n by `router.handleURL`.\n\n Takes an Array of `RecognizedHandler`s, and converts the raw\n params hashes into deserialized objects by calling deserialize\n on the handlers. This process builds up an Array of\n `HandlerInfo`s. It then calls `setupContexts` with the Array.\n\n If the `deserialize` method on a handler returns a promise\n (i.e. has a method called `then`), this function will pause\n building up the `HandlerInfo` Array until the promise is\n resolved. It will use the resolved value as the context of\n `HandlerInfo`.\n */\n function collectObjects(router, results, index, objects) {\n if (results.length === index) {\n loaded(router);\n setupContexts(router, objects);\n return;\n }\n\n var result = results[index];\n var handler = router.getHandler(result.handler);\n var object = handler.deserialize && handler.deserialize(result.params);\n\n if (object && typeof object.then === 'function') {\n loading(router);\n\n // The chained `then` means that we can also catch errors that happen in `proceed`\n object.then(proceed).then(null, function(error) {\n failure(router, error);\n });\n } else {\n proceed(object);\n }\n\n function proceed(value) {\n if (handler.context !== object) {\n setContext(handler, object);\n }\n\n var updatedObjects = objects.concat([{\n context: value,\n handler: result.handler,\n isDynamic: result.isDynamic\n }]);\n collectObjects(router, results, index + 1, updatedObjects);\n }\n }\n\n /**\n @private\n\n Takes an Array of `UnresolvedHandlerInfo`s, resolves the handler names\n into handlers, and then figures out what to do with each of the handlers.\n\n For example, consider the following tree of handlers. Each handler is\n followed by the URL segment it handles.\n\n ```\n |~index (\"/\")\n | |~posts (\"/posts\")\n | | |-showPost (\"/:id\")\n | | |-newPost (\"/new\")\n | | |-editPost (\"/edit\")\n | |~about (\"/about/:id\")\n ```\n\n Consider the following transitions:\n\n 1. A URL transition to `/posts/1`.\n 1. Triggers the `deserialize` callback on the\n `index`, `posts`, and `showPost` handlers\n 2. Triggers the `enter` callback on the same\n 3. Triggers the `setup` callback on the same\n 2. A direct transition to `newPost`\n 1. Triggers the `exit` callback on `showPost`\n 2. Triggers the `enter` callback on `newPost`\n 3. Triggers the `setup` callback on `newPost`\n 3. A direct transition to `about` with a specified\n context object\n 1. Triggers the `exit` callback on `newPost`\n and `posts`\n 2. Triggers the `serialize` callback on `about`\n 3. Triggers the `enter` callback on `about`\n 4. Triggers the `setup` callback on `about`\n\n @param {Router} router\n @param {Array[UnresolvedHandlerInfo]} handlerInfos\n */\n function setupContexts(router, handlerInfos) {\n resolveHandlers(router, handlerInfos);\n\n var partition =\n partitionHandlers(router.currentHandlerInfos || [], handlerInfos);\n\n router.currentHandlerInfos = handlerInfos;\n\n eachHandler(partition.exited, function(handler, context) {\n delete handler.context;\n if (handler.exit) { handler.exit(); }\n });\n\n eachHandler(partition.updatedContext, function(handler, context) {\n setContext(handler, context);\n if (handler.setup) { handler.setup(context); }\n });\n\n var aborted = false;\n eachHandler(partition.entered, function(handler, context) {\n if (aborted) { return; }\n if (handler.enter) { handler.enter(); }\n setContext(handler, context);\n if (handler.setup) {\n if (false === handler.setup(context)) {\n aborted = true;\n }\n }\n });\n\n if (router.didTransition) {\n router.didTransition(handlerInfos);\n }\n }\n\n /**\n @private\n\n Iterates over an array of `HandlerInfo`s, passing the handler\n and context into the callback.\n\n @param {Array[HandlerInfo]} handlerInfos\n @param {Function(Object, Object)} callback\n */\n function eachHandler(handlerInfos, callback) {\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler,\n context = handlerInfo.context;\n\n callback(handler, context);\n }\n }\n\n /**\n @private\n\n Updates the `handler` field in each element in an Array of\n `UnresolvedHandlerInfo`s from a handler name to a resolved handler.\n\n When done, the Array will contain `HandlerInfo` structures.\n\n @param {Router} router\n @param {Array[UnresolvedHandlerInfo]} handlerInfos\n */\n function resolveHandlers(router, handlerInfos) {\n var handlerInfo;\n\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n handlerInfo = handlerInfos[i];\n\n handlerInfo.name = handlerInfo.handler;\n handlerInfo.handler = router.getHandler(handlerInfo.handler);\n }\n }\n\n /**\n @private\n\n This function is called when transitioning from one URL to\n another to determine which handlers are not longer active,\n which handlers are newly active, and which handlers remain\n active but have their context changed.\n\n Take a list of old handlers and new handlers and partition\n them into four buckets:\n\n * unchanged: the handler was active in both the old and\n new URL, and its context remains the same\n * updated context: the handler was active in both the\n old and new URL, but its context changed. The handler's\n `setup` method, if any, will be called with the new\n context.\n * exited: the handler was active in the old URL, but is\n no longer active.\n * entered: the handler was not active in the old URL, but\n is now active.\n\n The PartitionedHandlers structure has three fields:\n\n * `updatedContext`: a list of `HandlerInfo` objects that\n represent handlers that remain active but have a changed\n context\n * `entered`: a list of `HandlerInfo` objects that represent\n handlers that are newly active\n * `exited`: a list of `HandlerInfo` objects that are no\n longer active.\n\n @param {Array[HandlerInfo]} oldHandlers a list of the handler\n information for the previous URL (or `[]` if this is the\n first handled transition)\n @param {Array[HandlerInfo]} newHandlers a list of the handler\n information for the new URL\n\n @return {Partition}\n */\n function partitionHandlers(oldHandlers, newHandlers) {\n var handlers = {\n updatedContext: [],\n exited: [],\n entered: []\n };\n\n var handlerChanged, contextChanged, i, l;\n\n for (i=0, l=newHandlers.length; i<l; i++) {\n var oldHandler = oldHandlers[i], newHandler = newHandlers[i];\n\n if (!oldHandler || oldHandler.handler !== newHandler.handler) {\n handlerChanged = true;\n }\n\n if (handlerChanged) {\n handlers.entered.push(newHandler);\n if (oldHandler) { handlers.exited.unshift(oldHandler); }\n } else if (contextChanged || oldHandler.context !== newHandler.context) {\n contextChanged = true;\n handlers.updatedContext.push(newHandler);\n }\n }\n\n for (i=newHandlers.length, l=oldHandlers.length; i<l; i++) {\n handlers.exited.unshift(oldHandlers[i]);\n }\n\n return handlers;\n }\n\n function trigger(router, args) {\n var currentHandlerInfos = router.currentHandlerInfos;\n\n var name = args.shift();\n\n if (!currentHandlerInfos) {\n throw new Error(\"Could not trigger event '\" + name + \"'. There are no active handlers\");\n }\n\n for (var i=currentHandlerInfos.length-1; i>=0; i--) {\n var handlerInfo = currentHandlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler.events && handler.events[name]) {\n handler.events[name].apply(handler, args);\n return;\n }\n }\n\n throw new Error(\"Nothing handled the event '\" + name + \"'.\");\n }\n\n function setContext(handler, context) {\n handler.context = context;\n if (handler.contextDidChange) { handler.contextDidChange(); }\n }\n return Router;\n });\n\n})();\n//@ sourceURL=ember-routing/vendor/router");minispade.register('ember-runtime/controllers', "(function() {minispade.require('ember-runtime/controllers/array_controller');\nminispade.require('ember-runtime/controllers/object_controller');\nminispade.require('ember-runtime/controllers/controller');\n\n})();\n//@ sourceURL=ember-runtime/controllers");minispade.register('ember-runtime/controllers/array_controller', "(function() {minispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/controllers/controller');\nminispade.require('ember-runtime/mixins/sortable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach,\n replace = Ember.EnumerableUtils.replace;\n\n/**\n `Ember.ArrayController` provides a way for you to publish a collection of\n objects so that you can easily bind to the collection from a Handlebars\n `#each` helper, an `Ember.CollectionView`, or other controllers.\n\n The advantage of using an `ArrayController` is that you only have to set up\n your view bindings once; to change what's displayed, simply swap out the\n `content` property on the controller.\n\n For example, imagine you wanted to display a list of items fetched via an XHR\n request. Create an `Ember.ArrayController` and set its `content` property:\n\n ```javascript\n MyApp.listController = Ember.ArrayController.create();\n\n $.get('people.json', function(data) {\n MyApp.listController.set('content', data);\n });\n ```\n\n Then, create a view that binds to your new controller:\n\n ```handlebars\n {{#each MyApp.listController}}\n {{firstName}} {{lastName}}\n {{/each}}\n ```\n\n Although you are binding to the controller, the behavior of this controller\n is to pass through any methods or properties to the underlying array. This\n capability comes from `Ember.ArrayProxy`, which this class inherits from.\n\n Sometimes you want to display computed properties within the body of an\n `#each` helper that depend on the underlying items in `content`, but are not\n present on those items. To do this, set `itemController` to the name of a\n controller (probably an `ObjectController`) that will wrap each individual item.\n\n For example:\n\n ```handlebars\n {{#each post in controller}}\n <li>{{title}} ({{titleLength}} characters)</li>\n {{/each}}\n ```\n\n ```javascript\n App.PostsController = Ember.ArrayController.extend({\n itemController: 'post'\n });\n\n App.PostController = Ember.ObjectController.extend({\n // the `title` property will be proxied to the underlying post.\n\n titleLength: function() {\n return this.get('title').length;\n }.property('title')\n });\n ```\n\n In some cases it is helpful to return a different `itemController` depending\n on the particular item. Subclasses can do this by overriding\n `lookupItemController`.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @class ArrayController\n @namespace Ember\n @extends Ember.ArrayProxy\n @uses Ember.SortableMixin\n @uses Ember.ControllerMixin\n*/\n\nEmber.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,\n Ember.SortableMixin, {\n\n /**\n The controller used to wrap items, if any.\n\n @property itemController\n @type String\n @default null\n */\n itemController: null,\n\n /**\n Return the name of the controller to wrap items, or `null` if items should\n be returned directly. The default implementation simply returns the\n `itemController` property, but subclasses can override this method to return\n different controllers for different objects.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @method\n @type String\n @default null\n */\n lookupItemController: function(object) {\n return get(this, 'itemController');\n },\n\n objectAtContent: function(idx) {\n var length = get(this, 'length'),\n arrangedContent = get(this,'arrangedContent'),\n object = arrangedContent && arrangedContent.objectAt(idx);\n\n if (idx >= 0 && idx < length) {\n var controllerClass = this.lookupItemController(object);\n if (controllerClass) {\n return this.controllerAt(idx, object, controllerClass);\n }\n }\n\n // When `controllerClass` is falsy, we have not opted in to using item\n // controllers, so return the object directly.\n\n // When the index is out of range, we want to return the \"out of range\"\n // value, whatever that might be. Rather than make assumptions\n // (e.g. guessing `null` or `undefined`) we defer this to `arrangedContent`.\n return object;\n },\n\n arrangedContentDidChange: function() {\n this._super();\n this._resetSubControllers();\n },\n\n arrayContentDidChange: function(idx, removedCnt, addedCnt) {\n var subControllers = get(this, '_subControllers'),\n subControllersToRemove = subControllers.slice(idx, idx+removedCnt);\n\n forEach(subControllersToRemove, function(subController) {\n if (subController) { subController.destroy(); }\n });\n\n replace(subControllers, idx, removedCnt, new Array(addedCnt));\n\n // The shadow array of subcontrollers must be updated before we trigger\n // observers, otherwise observers will get the wrong subcontainer when\n // calling `objectAt`\n this._super(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n if (!this.get('content')) { Ember.defineProperty(this, 'content', undefined, Ember.A()); }\n this.set('_subControllers', Ember.A());\n },\n\n controllerAt: function(idx, object, controllerClass) {\n var container = get(this, 'container'),\n subControllers = get(this, '_subControllers'),\n subController = subControllers[idx];\n\n if (!subController) {\n subController = container.lookup(\"controller:\" + controllerClass, { singleton: false });\n subControllers[idx] = subController;\n }\n\n if (!subController) {\n throw new Error('Could not resolve itemController: \"' + controllerClass + '\"');\n }\n\n subController.set('target', this);\n subController.set('content', object);\n\n return subController;\n },\n\n _subControllers: null,\n\n _resetSubControllers: function() {\n var subControllers = get(this, '_subControllers');\n\n forEach(subControllers, function(subController) {\n if (subController) { subController.destroy(); }\n });\n\n this.set('_subControllers', Ember.A());\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/controllers/array_controller");minispade.register('ember-runtime/controllers/controller', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/string');\n\nvar get = Ember.get;\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ControllerMixin` provides a standard interface for all classes that\n compose Ember's controller layer: `Ember.Controller`,\n `Ember.ArrayController`, and `Ember.ObjectController`.\n\n Within an `Ember.Router`-managed application single shared instaces of every\n Controller object in your application's namespace will be added to the\n application's `Ember.Router` instance. See `Ember.Application#initialize`\n for additional information.\n\n ## Views\n\n By default a controller instance will be the rendering context\n for its associated `Ember.View.` This connection is made during calls to\n `Ember.ControllerMixin#connectOutlet`.\n\n Within the view's template, the `Ember.View` instance can be accessed\n through the controller with `{{view}}`.\n\n ## Target Forwarding\n\n By default a controller will target your application's `Ember.Router`\n instance. Calls to `{{action}}` within the template of a controller's view\n are forwarded to the router. See `Ember.Handlebars.helpers.action` for\n additional information.\n\n @class ControllerMixin\n @namespace Ember\n @extends Ember.Mixin\n*/\nEmber.ControllerMixin = Ember.Mixin.create({\n /* ducktype as a controller */\n isController: true,\n\n /**\n The object to which events from the view should be sent.\n\n For example, when a Handlebars template uses the `{{action}}` helper,\n it will attempt to send the event to the view's controller's `target`.\n\n By default, a controller's `target` is set to the router after it is\n instantiated by `Ember.Application#initialize`.\n\n @property target\n @default null\n */\n target: null,\n\n container: null,\n\n store: null,\n\n model: Ember.computed.alias('content'),\n\n send: function(actionName) {\n var args = [].slice.call(arguments, 1), target;\n\n if (this[actionName]) {\n Ember.assert(\"The controller \" + this + \" does not have the action \" + actionName, typeof this[actionName] === 'function');\n this[actionName].apply(this, args);\n } else if(target = get(this, 'target')) {\n Ember.assert(\"The target for controller \" + this + \" (\" + target + \") did not define a `send` method\", typeof target.send === 'function');\n target.send.apply(target, arguments);\n }\n }\n});\n\n/**\n @class Controller\n @namespace Ember\n @extends Ember.Object\n @uses Ember.ControllerMixin\n*/\nEmber.Controller = Ember.Object.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/controller");minispade.register('ember-runtime/controllers/object_controller', "(function() {minispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/controllers/controller');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ObjectController` is part of Ember's Controller layer. A single shared\n instance of each `Ember.ObjectController` subclass in your application's\n namespace will be created at application initialization and be stored on your\n application's `Ember.Router` instance.\n\n `Ember.ObjectController` derives its functionality from its superclass\n `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin.\n\n @class ObjectController\n @namespace Ember\n @extends Ember.ObjectProxy\n @uses Ember.ControllerMixin\n**/\nEmber.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/object_controller");minispade.register('ember-runtime/core', "(function() {/*globals ENV */\nminispade.require('ember-metal');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar indexOf = Ember.EnumerableUtils.indexOf;\n\n// ........................................\n// TYPING & ARRAY MESSAGING\n//\n\nvar TYPE_MAP = {};\nvar t = \"Boolean Number String Function Array Date RegExp Object\".split(\" \");\nEmber.ArrayPolyfills.forEach.call(t, function(name) {\n TYPE_MAP[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\nvar toString = Object.prototype.toString;\n\n/**\n Returns a consistent type for the passed item.\n\n Use this instead of the built-in `typeof` to get the type of an item.\n It will return the same result across all browsers and includes a bit\n more detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive |\n | 'number' | Number primitive |\n | 'boolean' | Boolean primitive |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'class' | An Ember class (created using Ember.Object.extend()) |\n | 'instance' | An Ember object instance |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object not inheriting from Ember.Object |\n\n Examples:\n\n ```javascript\n Ember.typeOf(); // 'undefined'\n Ember.typeOf(null); // 'null'\n Ember.typeOf(undefined); // 'undefined'\n Ember.typeOf('michael'); // 'string'\n Ember.typeOf(101); // 'number'\n Ember.typeOf(true); // 'boolean'\n Ember.typeOf(Ember.makeArray); // 'function'\n Ember.typeOf([1,2,90]); // 'array'\n Ember.typeOf(Ember.Object.extend()); // 'class'\n Ember.typeOf(Ember.Object.create()); // 'instance'\n Ember.typeOf(new Error('teamocil')); // 'error'\n\n // \"normal\" JavaScript object\n Ember.typeOf({a: 'b'}); // 'object'\n ```\n\n @method typeOf\n @for Ember\n @param {Object} item the item to check\n @return {String} the type\n*/\nEmber.typeOf = function(item) {\n var ret;\n\n ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object';\n\n if (ret === 'function') {\n if (Ember.Object && Ember.Object.detect(item)) ret = 'class';\n } else if (ret === 'object') {\n if (item instanceof Error) ret = 'error';\n else if (Ember.Object && item instanceof Ember.Object) ret = 'instance';\n else ret = 'object';\n }\n\n return ret;\n};\n\n/**\n This will compare two javascript values of possibly different types.\n It will tell you which one is greater than the other by returning:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n The order is calculated based on `Ember.ORDER_DEFINITION`, if types are different.\n In case they have the same type an appropriate comparison for this type is made.\n\n ```javascript\n Ember.compare('hello', 'hello'); // 0\n Ember.compare('abc', 'dfg'); // -1\n Ember.compare(2, 1); // 1\n ```\n\n @method compare\n @for Ember\n @param {Object} v First value to compare\n @param {Object} w Second value to compare\n @return {Number} -1 if v < w, 0 if v = w and 1 if v > w.\n*/\nEmber.compare = function compare(v, w) {\n if (v === w) { return 0; }\n\n var type1 = Ember.typeOf(v);\n var type2 = Ember.typeOf(w);\n\n var Comparable = Ember.Comparable;\n if (Comparable) {\n if (type1==='instance' && Comparable.detect(v.constructor)) {\n return v.constructor.compare(v, w);\n }\n\n if (type2 === 'instance' && Comparable.detect(w.constructor)) {\n return 1-w.constructor.compare(w, v);\n }\n }\n\n // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION,\n // do so now.\n var mapping = Ember.ORDER_DEFINITION_MAPPING;\n if (!mapping) {\n var order = Ember.ORDER_DEFINITION;\n mapping = Ember.ORDER_DEFINITION_MAPPING = {};\n var idx, len;\n for (idx = 0, len = order.length; idx < len; ++idx) {\n mapping[order[idx]] = idx;\n }\n\n // We no longer need Ember.ORDER_DEFINITION.\n delete Ember.ORDER_DEFINITION;\n }\n\n var type1Index = mapping[type1];\n var type2Index = mapping[type2];\n\n if (type1Index < type2Index) { return -1; }\n if (type1Index > type2Index) { return 1; }\n\n // types are equal - so we have to check values now\n switch (type1) {\n case 'boolean':\n case 'number':\n if (v < w) { return -1; }\n if (v > w) { return 1; }\n return 0;\n\n case 'string':\n var comp = v.localeCompare(w);\n if (comp < 0) { return -1; }\n if (comp > 0) { return 1; }\n return 0;\n\n case 'array':\n var vLen = v.length;\n var wLen = w.length;\n var l = Math.min(vLen, wLen);\n var r = 0;\n var i = 0;\n while (r === 0 && i < l) {\n r = compare(v[i],w[i]);\n i++;\n }\n if (r !== 0) { return r; }\n\n // all elements are equal now\n // shorter array should be ordered first\n if (vLen < wLen) { return -1; }\n if (vLen > wLen) { return 1; }\n // arrays are equal now\n return 0;\n\n case 'instance':\n if (Ember.Comparable && Ember.Comparable.detect(v)) {\n return v.compare(v, w);\n }\n return 0;\n\n case 'date':\n var vNum = v.getTime();\n var wNum = w.getTime();\n if (vNum < wNum) { return -1; }\n if (vNum > wNum) { return 1; }\n return 0;\n\n default:\n return 0;\n }\n};\n\nfunction _copy(obj, deep, seen, copies) {\n var ret, loc, key;\n\n // primitive data types are immutable, just return them.\n if ('object' !== typeof obj || obj===null) return obj;\n\n // avoid cyclical loops\n if (deep && (loc=indexOf(seen, obj))>=0) return copies[loc];\n\n Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof Ember.Object) || (Ember.Copyable && Ember.Copyable.detect(obj)));\n\n // IMPORTANT: this specific test will detect a native array only. Any other\n // object will need to implement Copyable.\n if (Ember.typeOf(obj) === 'array') {\n ret = obj.slice();\n if (deep) {\n loc = ret.length;\n while(--loc>=0) ret[loc] = _copy(ret[loc], deep, seen, copies);\n }\n } else if (Ember.Copyable && Ember.Copyable.detect(obj)) {\n ret = obj.copy(deep, seen, copies);\n } else {\n ret = {};\n for(key in obj) {\n if (!obj.hasOwnProperty(key)) continue;\n\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') continue;\n\n ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];\n }\n }\n\n if (deep) {\n seen.push(obj);\n copies.push(ret);\n }\n\n return ret;\n}\n\n/**\n Creates a clone of the passed object. This function can take just about\n any type of object and create a clone of it, including primitive values\n (which are not actually cloned because they are immutable).\n\n If the passed object implements the `clone()` method, then this function\n will simply call that method and return the result.\n\n @method copy\n @for Ember\n @param {Object} obj The object to clone\n @param {Boolean} deep If true, a deep copy of the object is made\n @return {Object} The cloned object\n*/\nEmber.copy = function(obj, deep) {\n // fast paths\n if ('object' !== typeof obj || obj===null) return obj; // can't copy primitives\n if (Ember.Copyable && Ember.Copyable.detect(obj)) return obj.copy(deep);\n return _copy(obj, deep, deep ? [] : null, deep ? [] : null);\n};\n\n/**\n Convenience method to inspect an object. This method will attempt to\n convert the object into a useful string description.\n\n It is a pretty simple implementation. If you want something more robust,\n use something like JSDump: https://github.com/NV/jsDump\n\n @method inspect\n @for Ember\n @param {Object} obj The object you want to inspect.\n @return {String} A description of the object\n*/\nEmber.inspect = function(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj + '';\n }\n\n var v, ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) {\n v = obj[key];\n if (v === 'toString') { continue; } // ignore useless items\n if (Ember.typeOf(v) === 'function') { v = \"function() { ... }\"; }\n ret.push(key + \": \" + v);\n }\n }\n return \"{\" + ret.join(\", \") + \"}\";\n};\n\n/**\n Compares two objects, returning true if they are logically equal. This is\n a deeper comparison than a simple triple equal. For sets it will compare the\n internal objects. For any other object that implements `isEqual()` it will\n respect that method.\n\n ```javascript\n Ember.isEqual('hello', 'hello'); // true\n Ember.isEqual(1, 2); // false\n Ember.isEqual([4,2], [4,2]); // false\n ```\n\n @method isEqual\n @for Ember\n @param {Object} a first object to compare\n @param {Object} b second object to compare\n @return {Boolean}\n*/\nEmber.isEqual = function(a, b) {\n if (a && 'function'===typeof a.isEqual) return a.isEqual(b);\n return a === b;\n};\n\n// Used by Ember.compare\nEmber.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [\n 'undefined',\n 'null',\n 'boolean',\n 'number',\n 'string',\n 'array',\n 'object',\n 'instance',\n 'function',\n 'class',\n 'date'\n];\n\n/**\n Returns all of the keys defined on an object or hash. This is useful\n when inspecting objects for debugging. On browsers that support it, this\n uses the native `Object.keys` implementation.\n\n @method keys\n @for Ember\n @param {Object} obj\n @return {Array} Array containing keys of obj\n*/\nEmber.keys = Object.keys;\n\nif (!Ember.keys) {\n Ember.keys = function(obj) {\n var ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) { ret.push(key); }\n }\n return ret;\n };\n}\n\n// ..........................................................\n// ERROR\n//\n\nvar errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];\n\n/**\n A subclass of the JavaScript Error object for use in Ember.\n\n @class Error\n @namespace Ember\n @extends Error\n @constructor\n*/\nEmber.Error = function() {\n var tmp = Error.prototype.constructor.apply(this, arguments);\n\n // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n for (var idx = 0; idx < errorProps.length; idx++) {\n this[errorProps[idx]] = tmp[errorProps[idx]];\n }\n};\n\nEmber.Error.prototype = Ember.create(Error.prototype);\n\n})();\n//@ sourceURL=ember-runtime/core");minispade.register('ember-runtime/ext', "(function() {minispade.require('ember-runtime/ext/ember');\nminispade.require('ember-runtime/ext/string');\nminispade.require('ember-runtime/ext/function');\n\n})();\n//@ sourceURL=ember-runtime/ext");minispade.register('ember-runtime/ext/ember', "(function() {/**\n Expose RSVP implementation\n\n @class RSVP\n @namespace Ember\n @constructor\n*/\nEmber.RSVP = requireModule('rsvp');\n\n})();\n//@ sourceURL=ember-runtime/ext/ember");minispade.register('ember-runtime/ext/function', "(function() {minispade.require('ember-runtime/core');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar a_slice = Array.prototype.slice;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {\n\n /**\n The `property` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n `true`, which is the default.\n\n Computed properties allow you to treat a function like a property:\n\n ```javascript\n MyApp.president = Ember.Object.create({\n firstName: \"Barack\",\n lastName: \"Obama\",\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Call this flag to mark the function as a property\n }.property()\n });\n\n MyApp.president.get('fullName'); // \"Barack Obama\"\n ```\n\n Treating a function like a property is useful because they can work with\n bindings, just like any other property.\n\n Many computed properties have dependencies on other properties. For\n example, in the above example, the `fullName` property depends on\n `firstName` and `lastName` to determine its value. You can tell Ember\n about these dependencies like this:\n\n ```javascript\n MyApp.president = Ember.Object.create({\n firstName: \"Barack\",\n lastName: \"Obama\",\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember.js that this computed property depends on firstName\n // and lastName\n }.property('firstName', 'lastName')\n });\n ```\n\n Make sure you list these dependencies so Ember knows when to update\n bindings that connect to a computed property. Changing a dependency\n will not immediately trigger an update of the computed property, but\n will instead clear the cache so that it is updated when the next `get`\n is called on the property.\n\n See {{#crossLink \"Ember.ComputedProperty\"}}{{/crossLink}},\n {{#crossLink \"Ember/computed\"}}{{/crossLink}}\n\n @method property\n @for Function\n */\n Function.prototype.property = function() {\n var ret = Ember.computed(this);\n return ret.property.apply(ret, arguments);\n };\n\n /**\n The `observes` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.create({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n See {{#crossLink \"Ember.Observable/observes\"}}{{/crossLink}}\n\n @method observes\n @for Function\n */\n Function.prototype.observes = function() {\n this.__ember_observes__ = a_slice.call(arguments);\n return this;\n };\n\n /**\n The `observesBefore` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can get notified when a property changes is about to happen by\n by adding the `observesBefore` call to the end of your method\n declarations in classes that you write. For example:\n\n ```javascript\n Ember.Object.create({\n valueObserver: function() {\n // Executes whenever the \"value\" property is about to change\n }.observesBefore('value')\n });\n ```\n\n See {{#crossLink \"Ember.Observable/observesBefore\"}}{{/crossLink}}\n\n @method observesBefore\n @for Function\n */\n Function.prototype.observesBefore = function() {\n this.__ember_observesBefore__ = a_slice.call(arguments);\n return this;\n };\n\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/function");minispade.register('ember-runtime/ext/string', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar fmt = Ember.String.fmt,\n w = Ember.String.w,\n loc = Ember.String.loc,\n camelize = Ember.String.camelize,\n decamelize = Ember.String.decamelize,\n dasherize = Ember.String.dasherize,\n underscore = Ember.String.underscore,\n capitalize = Ember.String.capitalize,\n classify = Ember.String.classify;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n See {{#crossLink \"Ember.String/fmt\"}}{{/crossLink}}\n\n @method fmt\n @for String\n */\n String.prototype.fmt = function() {\n return fmt(this, arguments);\n };\n\n /**\n See {{#crossLink \"Ember.String/w\"}}{{/crossLink}}\n\n @method w\n @for String\n */\n String.prototype.w = function() {\n return w(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/loc\"}}{{/crossLink}}\n\n @method loc\n @for String\n */\n String.prototype.loc = function() {\n return loc(this, arguments);\n };\n\n /**\n See {{#crossLink \"Ember.String/camelize\"}}{{/crossLink}}\n\n @method camelize\n @for String\n */\n String.prototype.camelize = function() {\n return camelize(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/decamelize\"}}{{/crossLink}}\n\n @method decamelize\n @for String\n */\n String.prototype.decamelize = function() {\n return decamelize(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/dasherize\"}}{{/crossLink}}\n\n @method dasherize\n @for String\n */\n String.prototype.dasherize = function() {\n return dasherize(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/underscore\"}}{{/crossLink}}\n\n @method underscore\n @for String\n */\n String.prototype.underscore = function() {\n return underscore(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/classify\"}}{{/crossLink}}\n\n @method classify\n @for String\n */\n String.prototype.classify = function() {\n return classify(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/capitalize\"}}{{/crossLink}}\n\n @method capitalize\n @for String\n */\n String.prototype.capitalize = function() {\n return capitalize(this);\n };\n\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/string");minispade.register('ember-runtime', "(function() {/**\nEmber Runtime\n\n@module ember\n@submodule ember-runtime\n@requires ember-metal\n*/\nminispade.require('container');\nminispade.require('ember-metal');\nminispade.require('ember-runtime/core');\nminispade.require('ember-runtime/ext');\nminispade.require('ember-runtime/mixins');\nminispade.require('ember-runtime/system');\nminispade.require('ember-runtime/controllers');\n\n})();\n//@ sourceURL=ember-runtime");minispade.register('ember-runtime/mixins', "(function() {minispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/comparable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/enumerable');\nminispade.require('ember-runtime/mixins/freezable');\nminispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/mixins/target_action_support');\nminispade.require('ember-runtime/mixins/evented');\nminispade.require('ember-runtime/mixins/deferred');\n\n})();\n//@ sourceURL=ember-runtime/mixins");minispade.register('ember-runtime/mixins/array', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;\n\nfunction none(obj) { return obj===null || obj===undefined; }\n\n// ..........................................................\n// ARRAY\n//\n/**\n This module implements Observer-friendly Array-like behavior. This mixin is\n picked up by the Array class as well as other controllers, etc. that want to\n appear to be arrays.\n\n Unlike `Ember.Enumerable,` this mixin defines methods specifically for\n collections that provide index-ordered access to their contents. When you\n are designing code that needs to accept any kind of Array-like object, you\n should use these methods instead of Array primitives because these will\n properly notify observers of changes to the array.\n\n Although these methods are efficient, they do add a layer of indirection to\n your application so it is a good idea to use them only when you need the\n flexibility of using both true JavaScript arrays and \"virtual\" arrays such\n as controllers and collections.\n\n You can use the methods defined in this module to access and modify array\n contents in a KVO-friendly way. You can also be notified whenever the\n membership if an array changes by changing the syntax of the property to\n `.observes('*myProperty.[]')`.\n\n To support `Ember.Array` in your own class, you must override two\n primitives to use it: `replace()` and `objectAt()`.\n\n Note that the Ember.Array mixin also incorporates the `Ember.Enumerable`\n mixin. All `Ember.Array`-like objects are also enumerable.\n\n @class Array\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.Enumerable\n @since Ember 0.9.0\n*/\nEmber.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.prototype */ {\n\n // compatibility\n isSCArray: true,\n\n /**\n Your array must support the `length` property. Your replace methods should\n set this property whenever it changes.\n\n @property {Number} length\n */\n length: Ember.required(),\n\n /**\n Returns the object at the given `index`. If the given `index` is negative\n or is greater or equal than the array length, returns `undefined`.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n If your object supports retrieving the value of an array item using `get()`\n (i.e. `myArray.get(0)`), then you do not need to implement this method\n yourself.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectAt(0); // \"a\"\n arr.objectAt(3); // \"d\"\n arr.objectAt(-1); // undefined\n arr.objectAt(4); // undefined\n arr.objectAt(5); // undefined\n ```\n\n @method objectAt\n @param {Number} idx The index of the item to return.\n */\n objectAt: function(idx) {\n if ((idx < 0) || (idx>=get(this, 'length'))) return undefined ;\n return get(this, idx);\n },\n\n /**\n This returns the objects at the specified indexes, using `objectAt`.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectsAt([0, 1, 2]); // [\"a\", \"b\", \"c\"]\n arr.objectsAt([2, 3, 4]); // [\"c\", \"d\", undefined]\n ```\n\n @method objectsAt\n @param {Array} indexes An array of indexes of items to return.\n */\n objectsAt: function(indexes) {\n var self = this;\n return map(indexes, function(idx){ return self.objectAt(idx); });\n },\n\n // overrides Ember.Enumerable version\n nextObject: function(idx) {\n return this.objectAt(idx);\n },\n\n /**\n This is the handler for the special array content property. If you get\n this property, it will return this. If you set this property it a new\n array, it will replace the current content.\n\n This property overrides the default property defined in `Ember.Enumerable`.\n\n @property []\n */\n '[]': Ember.computed(function(key, value) {\n if (value !== undefined) this.replace(0, get(this, 'length'), value) ;\n return this ;\n }),\n\n firstObject: Ember.computed(function() {\n return this.objectAt(0);\n }),\n\n lastObject: Ember.computed(function() {\n return this.objectAt(get(this, 'length')-1);\n }),\n\n // optimized version from Enumerable\n contains: function(obj){\n return this.indexOf(obj) >= 0;\n },\n\n // Add any extra methods to Ember.Array that are native to the built-in Array.\n /**\n Returns a new array that is a slice of the receiver. This implementation\n uses the observable array methods to retrieve the objects for the new\n slice.\n\n ```javascript\n var arr = ['red', 'green', 'blue'];\n arr.slice(0); // ['red', 'green', 'blue']\n arr.slice(0, 2); // ['red', 'green']\n arr.slice(1, 100); // ['green', 'blue']\n ```\n\n @method slice\n @param {Integer} beginIndex (Optional) index to begin slicing from.\n @param {Integer} endIndex (Optional) index to end the slice at.\n @return {Array} New array with specified slice\n */\n slice: function(beginIndex, endIndex) {\n var ret = Ember.A([]);\n var length = get(this, 'length') ;\n if (none(beginIndex)) beginIndex = 0 ;\n if (none(endIndex) || (endIndex > length)) endIndex = length ;\n\n if (beginIndex < 0) beginIndex = length + beginIndex;\n if (endIndex < 0) endIndex = length + endIndex;\n\n while(beginIndex < endIndex) {\n ret[ret.length] = this.objectAt(beginIndex++) ;\n }\n return ret ;\n },\n\n /**\n Returns the index of the given object's first occurrence.\n If no `startAt` argument is given, the starting location to\n search is 0. If it's negative, will count backward from\n the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.indexOf(\"a\"); // 0\n arr.indexOf(\"z\"); // -1\n arr.indexOf(\"a\", 2); // 4\n arr.indexOf(\"a\", -1); // 4\n arr.indexOf(\"b\", 3); // -1\n arr.indexOf(\"a\", 100); // -1\n ```\n\n @method indexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n indexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined) startAt = 0;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this.objectAt(idx, true) === object) return idx ;\n }\n return -1;\n },\n\n /**\n Returns the index of the given object's last occurrence.\n If no `startAt` argument is given, the search starts from\n the last position. If it's negative, will count backward\n from the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.lastIndexOf(\"a\"); // 4\n arr.lastIndexOf(\"z\"); // -1\n arr.lastIndexOf(\"a\", 2); // 0\n arr.lastIndexOf(\"a\", -1); // 4\n arr.lastIndexOf(\"b\", 3); // 1\n arr.lastIndexOf(\"a\", 100); // 4\n ```\n\n @method lastIndexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n lastIndexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined || startAt >= len) startAt = len-1;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this.objectAt(idx) === object) return idx ;\n }\n return -1;\n },\n\n // ..........................................................\n // ARRAY OBSERVERS\n //\n\n /**\n Adds an array observer to the receiving array. The array observer object\n normally must implement two methods:\n\n * `arrayWillChange(start, removeCount, addCount)` - This method will be\n called just before the array is modified.\n * `arrayDidChange(start, removeCount, addCount)` - This method will be\n called just after the array is modified.\n\n Both callbacks will be passed the starting index of the change as well a\n a count of the items to be removed and added. You can use these callbacks\n to optionally inspect the array during the change, clear caches, or do\n any other bookkeeping necessary.\n\n In addition to passing a target, you can also include an options hash\n which you can use to override the method names that will be invoked on the\n target.\n\n @method addArrayObserver\n @param {Object} target The observer object.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n addArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.addListener(this, '@array:before', target, willChange);\n Ember.addListener(this, '@array:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Removes an array observer from the object if the observer is current\n registered. Calling this method multiple times with the same object will\n have no effect.\n\n @method removeArrayObserver\n @param {Object} target The object observing the array.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n removeArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.removeListener(this, '@array:before', target, willChange);\n Ember.removeListener(this, '@array:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property Boolean\n */\n hasArrayObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@array:change') || Ember.hasListeners(this, '@array:before');\n }),\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just before the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentWillChange\n @param {Number} startIdx The starting index in the array that will change.\n @param {Number} removeAmt The number of items that will be removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that will be added If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentWillChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n // Make sure the @each proxy is set up if anyone is observing @each\n if (Ember.isWatching(this, '@each')) { get(this, '@each'); }\n\n Ember.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);\n\n var removing, lim;\n if (startIdx>=0 && removeAmt>=0 && get(this, 'hasEnumerableObservers')) {\n removing = [];\n lim = startIdx+removeAmt;\n for(var idx=startIdx;idx<lim;idx++) removing.push(this.objectAt(idx));\n } else {\n removing = removeAmt;\n }\n\n this.enumerableContentWillChange(removing, addAmt);\n\n return this;\n },\n\n arrayContentDidChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n var adding, lim;\n if (startIdx>=0 && addAmt>=0 && get(this, 'hasEnumerableObservers')) {\n adding = [];\n lim = startIdx+addAmt;\n for(var idx=startIdx;idx<lim;idx++) adding.push(this.objectAt(idx));\n } else {\n adding = addAmt;\n }\n\n this.enumerableContentDidChange(removeAmt, adding);\n Ember.sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]);\n\n var length = get(this, 'length'),\n cachedFirst = cacheFor(this, 'firstObject'),\n cachedLast = cacheFor(this, 'lastObject');\n if (this.objectAt(0) !== cachedFirst) {\n Ember.propertyWillChange(this, 'firstObject');\n Ember.propertyDidChange(this, 'firstObject');\n }\n if (this.objectAt(length-1) !== cachedLast) {\n Ember.propertyWillChange(this, 'lastObject');\n Ember.propertyDidChange(this, 'lastObject');\n }\n\n return this;\n },\n\n // ..........................................................\n // ENUMERATED PROPERTIES\n //\n\n /**\n Returns a special object that can be used to observe individual properties\n on the array. Just get an equivalent property on this object and it will\n return an enumerable that maps automatically to the named key on the\n member objects.\n\n @property @each\n */\n '@each': Ember.computed(function() {\n if (!this.__each) this.__each = new Ember.EachProxy(this);\n return this.__each;\n })\n\n}) ;\n\n})();\n//@ sourceURL=ember-runtime/mixins/array");minispade.register('ember-runtime/mixins/comparable', "(function() {minispade.require('ember-runtime/core');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n/**\n Implements some standard methods for comparing objects. Add this mixin to\n any class you create that can compare its instances.\n\n You should implement the `compare()` method.\n\n @class Comparable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Comparable = Ember.Mixin.create( /** @scope Ember.Comparable.prototype */{\n\n /**\n walk like a duck. Indicates that the object can be compared.\n\n @property isComparable\n @type Boolean\n @default true\n */\n isComparable: true,\n\n /**\n Override to return the result of the comparison of the two parameters. The\n compare method should return:\n\n - `-1` if `a < b`\n - `0` if `a == b`\n - `1` if `a > b`\n\n Default implementation raises an exception.\n\n @method compare\n @param a {Object} the first object to compare\n @param b {Object} the second object to compare\n @return {Integer} the result of the comparison\n */\n compare: Ember.required(Function)\n\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/comparable");minispade.register('ember-runtime/mixins/copyable', "(function() {minispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Implements some standard methods for copying an object. Add this mixin to\n any object you create that can create a copy of itself. This mixin is\n added automatically to the built-in array.\n\n You should generally implement the `copy()` method to return a copy of the\n receiver.\n\n Note that `frozenCopy()` will only work if you also implement\n `Ember.Freezable`.\n\n @class Copyable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Copyable = Ember.Mixin.create(\n/** @scope Ember.Copyable.prototype */ {\n\n /**\n Override to return a copy of the receiver. Default implementation raises\n an exception.\n\n @method copy\n @param {Boolean} deep if `true`, a deep copy of the object should be made\n @return {Object} copy of receiver\n */\n copy: Ember.required(Function),\n\n /**\n If the object implements `Ember.Freezable`, then this will return a new\n copy if the object is not frozen and the receiver if the object is frozen.\n\n Raises an exception if you try to call this method on a object that does\n not support freezing.\n\n You should use this method whenever you want a copy of a freezable object\n since a freezable object can simply return itself without actually\n consuming more memory.\n\n @method frozenCopy\n @return {Object} copy of receiver or receiver\n */\n frozenCopy: function() {\n if (Ember.Freezable && Ember.Freezable.detect(this)) {\n return get(this, 'isFrozen') ? this : this.copy().freeze();\n } else {\n throw new Error(Ember.String.fmt(\"%@ does not support freezing\", [this]));\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/copyable");minispade.register('ember-runtime/mixins/deferred', "(function() {var RSVP = requireModule(\"rsvp\");\n\nRSVP.async = function(callback, binding) {\n Ember.run.schedule('actions', binding, callback);\n};\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get;\n\n/**\n @class Deferred\n @namespace Ember\n @extends Ember.Mixin\n */\nEmber.DeferredMixin = Ember.Mixin.create({\n /**\n Add handlers to be called when the Deferred object is resolved or rejected.\n\n @method then\n @param {Function} doneCallback a callback function to be called when done\n @param {Function} failCallback a callback function to be called when failed\n */\n then: function(doneCallback, failCallback) {\n var promise = get(this, 'promise');\n return promise.then.apply(promise, arguments);\n },\n\n /**\n Resolve a Deferred object and call any `doneCallbacks` with the given args.\n\n @method resolve\n */\n resolve: function(value) {\n get(this, 'promise').resolve(value);\n },\n\n /**\n Reject a Deferred object and call any `failCallbacks` with the given args.\n\n @method reject\n */\n reject: function(value) {\n get(this, 'promise').reject(value);\n },\n\n promise: Ember.computed(function() {\n return new RSVP.Promise();\n })\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/deferred");minispade.register('ember-runtime/mixins/enumerable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\nvar a_slice = Array.prototype.slice;\nvar a_indexOf = Ember.EnumerableUtils.indexOf;\n\nvar contexts = [];\n\nfunction popCtx() {\n return contexts.length===0 ? {} : contexts.pop();\n}\n\nfunction pushCtx(ctx) {\n contexts.push(ctx);\n return null;\n}\n\nfunction iter(key, value) {\n var valueProvided = arguments.length === 2;\n\n function i(item) {\n var cur = get(item, key);\n return valueProvided ? value===cur : !!cur;\n }\n return i ;\n}\n\n/**\n This mixin defines the common interface implemented by enumerable objects\n in Ember. Most of these methods follow the standard Array iteration\n API defined up to JavaScript 1.8 (excluding language-specific features that\n cannot be emulated in older versions of JavaScript).\n\n This mixin is applied automatically to the Array class on page load, so you\n can use any of these methods on simple arrays. If Array already implements\n one of these methods, the mixin will not override them.\n\n ## Writing Your Own Enumerable\n\n To make your own custom class enumerable, you need two items:\n\n 1. You must have a length property. This property should change whenever\n the number of items in your enumerable object changes. If you using this\n with an `Ember.Object` subclass, you should be sure to change the length\n property using `set().`\n\n 2. If you must implement `nextObject().` See documentation.\n\n Once you have these two methods implement, apply the `Ember.Enumerable` mixin\n to your class and you will be able to enumerate the contents of your object\n like any other collection.\n\n ## Using Ember Enumeration with Other Libraries\n\n Many other libraries provide some kind of iterator or enumeration like\n facility. This is often where the most common API conflicts occur.\n Ember's API is designed to be as friendly as possible with other\n libraries by implementing only methods that mostly correspond to the\n JavaScript 1.8 API.\n\n @class Enumerable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Enumerable = Ember.Mixin.create({\n\n // compatibility\n isEnumerable: true,\n\n /**\n Implement this method to make your class enumerable.\n\n This method will be call repeatedly during enumeration. The index value\n will always begin with 0 and increment monotonically. You don't have to\n rely on the index value to determine what object to return, but you should\n always check the value and start from the beginning when you see the\n requested index is 0.\n\n The `previousObject` is the object that was returned from the last call\n to `nextObject` for the current iteration. This is a useful way to\n manage iteration if you are tracing a linked list, for example.\n\n Finally the context parameter will always contain a hash you can use as\n a \"scratchpad\" to maintain any other state you need in order to iterate\n properly. The context object is reused and is not reset between\n iterations so make sure you setup the context with a fresh state whenever\n the index parameter is 0.\n\n Generally iterators will continue to call `nextObject` until the index\n reaches the your current length-1. If you run out of data before this\n time for some reason, you should simply return undefined.\n\n The default implementation of this method simply looks up the index.\n This works great on any Array-like objects.\n\n @method nextObject\n @param {Number} index the current index of the iteration\n @param {Object} previousObject the value returned by the last call to\n `nextObject`.\n @param {Object} context a context object you can use to maintain state.\n @return {Object} the next object in the iteration or undefined\n */\n nextObject: Ember.required(Function),\n\n /**\n Helper method returns the first object from a collection. This is usually\n used by bindings and other parts of the framework to extract a single\n object if the enumerable contains only one item.\n\n If you override this method, you should implement it so that it will\n always return the same value each time it is called. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('firstObject'); // \"a\"\n\n var arr = [];\n arr.get('firstObject'); // undefined\n ```\n\n @property firstObject\n @return {Object} the object or undefined\n */\n firstObject: Ember.computed(function() {\n if (get(this, 'length')===0) return undefined ;\n\n // handle generic enumerables\n var context = popCtx(), ret;\n ret = this.nextObject(0, null, context);\n pushCtx(context);\n return ret ;\n }).property('[]'),\n\n /**\n Helper method returns the last object from a collection. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('lastObject'); // \"c\"\n\n var arr = [];\n arr.get('lastObject'); // undefined\n ```\n\n @property lastObject\n @return {Object} the last object or undefined\n */\n lastObject: Ember.computed(function() {\n var len = get(this, 'length');\n if (len===0) return undefined ;\n var context = popCtx(), idx=0, cur, last = null;\n do {\n last = cur;\n cur = this.nextObject(idx++, last, context);\n } while (cur !== undefined);\n pushCtx(context);\n return last;\n }).property('[]'),\n\n /**\n Returns `true` if the passed object can be found in the receiver. The\n default version will iterate through the enumerable until the object\n is found. You may want to override this with a more efficient version.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.contains(\"a\"); // true\n arr.contains(\"z\"); // false\n ```\n\n @method contains\n @param {Object} obj The object to search for.\n @return {Boolean} `true` if object is found in enumerable.\n */\n contains: function(obj) {\n return this.find(function(item) { return item===obj; }) !== undefined;\n },\n\n /**\n Iterates through the enumerable, calling the passed function on each\n item. This method corresponds to the `forEach()` method defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method forEach\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} receiver\n */\n forEach: function(callback, target) {\n if (typeof callback !== \"function\") throw new TypeError() ;\n var len = get(this, 'length'), last = null, context = popCtx();\n\n if (target === undefined) target = null;\n\n for(var idx=0;idx<len;idx++) {\n var next = this.nextObject(idx, last, context) ;\n callback.call(target, next, idx, this);\n last = next ;\n }\n last = null ;\n context = pushCtx(context);\n return this ;\n },\n\n /**\n Alias for `mapProperty`\n\n @method getEach\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n getEach: function(key) {\n return this.mapProperty(key);\n },\n\n /**\n Sets the value on the named property for each member. This is more\n efficient than using other methods defined on this helper. If the object\n implements Ember.Observable, the value will be changed to `set(),` otherwise\n it will be set directly. `null` objects are skipped.\n\n @method setEach\n @param {String} key The key to set\n @param {Object} value The object to set\n @return {Object} receiver\n */\n setEach: function(key, value) {\n return this.forEach(function(item) {\n set(item, key, value);\n });\n },\n\n /**\n Maps all of the items in the enumeration to another value, returning\n a new array. This method corresponds to `map()` defined in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the mapped value.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method map\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} The mapped array.\n */\n map: function(callback, target) {\n var ret = Ember.A([]);\n this.forEach(function(x, idx, i) {\n ret[idx] = callback.call(target, x, idx,i);\n });\n return ret ;\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapProperty\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n mapProperty: function(key) {\n return this.map(function(next) {\n return get(next, key);\n });\n },\n\n /**\n Returns an array with all of the items in the enumeration that the passed\n function returns true for. This method corresponds to `filter()` defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method filter\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A filtered array.\n */\n filter: function(callback, target) {\n var ret = Ember.A([]);\n this.forEach(function(x, idx, i) {\n if (callback.call(target, x, idx, i)) ret.push(x);\n });\n return ret ;\n },\n\n /**\n Returns an array with all of the items in the enumeration where the passed\n function returns false for. This method is the inverse of filter().\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n function(item, index, enumerable);\n\n - *item* is the current item in the iteration.\n - *index* is the current index in the iteration\n - *enumerable* is the enumerable object itself.\n\n It should return the a falsey value to include the item in the results.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as \"this\" on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method reject\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A rejected array.\n */\n reject: function(callback, target) {\n return this.filter(function() {\n return !(callback.apply(target, arguments));\n });\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} filtered array\n */\n filterProperty: function(key, value) {\n return this.filter(iter.apply(this, arguments));\n },\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n */\n rejectProperty: function(key, value) {\n var exactValue = function(item) { return get(item, key) === value; },\n hasValue = function(item) { return !!get(item, key); },\n use = (arguments.length === 2 ? exactValue : hasValue);\n\n return this.reject(use);\n },\n\n /**\n Returns the first item in the array for which the callback returns true.\n This method works similar to the `filter()` method defined in JavaScript 1.6\n except that it will stop working on the array once a match is found.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method find\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} Found item or `undefined`.\n */\n find: function(callback, target) {\n var len = get(this, 'length') ;\n if (target === undefined) target = null;\n\n var last = null, next, found = false, ret ;\n var context = popCtx();\n for(var idx=0;idx<len && !found;idx++) {\n next = this.nextObject(idx, last, context) ;\n if (found = callback.call(target, next, idx, this)) ret = next ;\n last = next ;\n }\n next = last = null ;\n context = pushCtx(context);\n return ret ;\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n */\n findProperty: function(key, value) {\n return this.find(iter.apply(this, arguments));\n },\n\n /**\n Returns `true` if the passed function returns true for every item in the\n enumeration. This corresponds with the `every()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` or `false`.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Example Usage:\n\n ```javascript\n if (people.every(isEngineer)) { Paychecks.addBigBonus(); }\n ```\n\n @method every\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean}\n */\n every: function(callback, target) {\n return !this.find(function(x, idx, i) {\n return !callback.call(target, x, idx, i);\n });\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for all items in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method everyProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean}\n */\n everyProperty: function(key, value) {\n return this.every(iter.apply(this, arguments));\n },\n\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.some(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method some\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A filtered array.\n */\n some: function(callback, target) {\n return !!this.find(function(x, idx, i) {\n return !!callback.call(target, x, idx, i);\n });\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for any item in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method someProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true`\n */\n someProperty: function(key, value) {\n return this.some(iter.apply(this, arguments));\n },\n\n /**\n This will combine the values of the enumerator into a single value. It\n is a useful way to collect a summary value from an enumeration. This\n corresponds to the `reduce()` method defined in JavaScript 1.8.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(previousValue, item, index, enumerable);\n ```\n\n - `previousValue` is the value returned by the last call to the iterator.\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Return the new cumulative value.\n\n In addition to the callback you can also pass an `initialValue`. An error\n will be raised if you do not pass an initial value and the enumerator is\n empty.\n\n Note that unlike the other methods, this method does not allow you to\n pass a target object to set as this for the callback. It's part of the\n spec. Sorry.\n\n @method reduce\n @param {Function} callback The callback to execute\n @param {Object} initialValue Initial value for the reduce\n @param {String} reducerProperty internal use only.\n @return {Object} The reduced value.\n */\n reduce: function(callback, initialValue, reducerProperty) {\n if (typeof callback !== \"function\") { throw new TypeError(); }\n\n var ret = initialValue;\n\n this.forEach(function(item, i) {\n ret = callback.call(null, ret, item, i, this, reducerProperty);\n }, this);\n\n return ret;\n },\n\n /**\n Invokes the named method on every object in the receiver that\n implements it. This method corresponds to the implementation in\n Prototype 1.6.\n\n @method invoke\n @param {String} methodName the name of the method\n @param {Object...} args optional arguments to pass as well.\n @return {Array} return values from calling invoke.\n */\n invoke: function(methodName) {\n var args, ret = Ember.A([]);\n if (arguments.length>1) args = a_slice.call(arguments, 1);\n\n this.forEach(function(x, idx) {\n var method = x && x[methodName];\n if ('function' === typeof method) {\n ret[idx] = args ? method.apply(x, args) : method.call(x);\n }\n }, this);\n\n return ret;\n },\n\n /**\n Simply converts the enumerable into a genuine array. The order is not\n guaranteed. Corresponds to the method implemented by Prototype.\n\n @method toArray\n @return {Array} the enumerable as an array.\n */\n toArray: function() {\n var ret = Ember.A([]);\n this.forEach(function(o, idx) { ret[idx] = o; });\n return ret ;\n },\n\n /**\n Returns a copy of the array with all null elements removed.\n\n ```javascript\n var arr = [\"a\", null, \"c\", null];\n arr.compact(); // [\"a\", \"c\"]\n ```\n\n @method compact\n @return {Array} the array without null elements.\n */\n compact: function() { return this.without(null); },\n\n /**\n Returns a new enumerable that excludes the passed value. The default\n implementation returns an array regardless of the receiver type unless\n the receiver does not contain the value.\n\n ```javascript\n var arr = [\"a\", \"b\", \"a\", \"c\"];\n arr.without(\"a\"); // [\"b\", \"c\"]\n ```\n\n @method without\n @param {Object} value\n @return {Ember.Enumerable}\n */\n without: function(value) {\n if (!this.contains(value)) return this; // nothing to do\n var ret = Ember.A([]);\n this.forEach(function(k) {\n if (k !== value) ret[ret.length] = k;\n }) ;\n return ret ;\n },\n\n /**\n Returns a new enumerable that contains only unique values. The default\n implementation returns an array regardless of the receiver type.\n\n ```javascript\n var arr = [\"a\", \"a\", \"b\", \"b\"];\n arr.uniq(); // [\"a\", \"b\"]\n ```\n\n @method uniq\n @return {Ember.Enumerable}\n */\n uniq: function() {\n var ret = Ember.A([]);\n this.forEach(function(k){\n if (a_indexOf(ret, k)<0) ret.push(k);\n });\n return ret;\n },\n\n /**\n This property will trigger anytime the enumerable's content changes.\n You can observe this property to be notified of changes to the enumerables\n content.\n\n For plain enumerables, this property is read only. `Ember.Array` overrides\n this method.\n\n @property []\n @type Ember.Array\n */\n '[]': Ember.computed(function(key, value) {\n return this;\n }),\n\n // ..........................................................\n // ENUMERABLE OBSERVERS\n //\n\n /**\n Registers an enumerable observer. Must implement `Ember.EnumerableObserver`\n mixin.\n\n @method addEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n */\n addEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.addListener(this, '@enumerable:before', target, willChange);\n Ember.addListener(this, '@enumerable:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Removes a registered enumerable observer.\n\n @method removeEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n */\n removeEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.removeListener(this, '@enumerable:before', target, willChange);\n Ember.removeListener(this, '@enumerable:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property hasEnumerableObservers\n @type Boolean\n */\n hasEnumerableObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@enumerable:change') || Ember.hasListeners(this, '@enumerable:before');\n }),\n\n\n /**\n Invoke this method just before the contents of your enumerable will\n change. You can either omit the parameters completely or pass the objects\n to be removed or added if available or just a count.\n\n @method enumerableContentWillChange\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to be\n added or the number of items to be added.\n @chainable\n */\n enumerableContentWillChange: function(removing, adding) {\n\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding,'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.propertyWillChange(this, '[]');\n if (hasDelta) Ember.propertyWillChange(this, 'length');\n Ember.sendEvent(this, '@enumerable:before', [this, removing, adding]);\n\n return this;\n },\n\n /**\n Invoke this method when the contents of your enumerable has changed.\n This will notify any observers watching for content changes. If your are\n implementing an ordered enumerable (such as an array), also pass the\n start and end values where the content changed so that it can be used to\n notify range observers.\n\n @method enumerableContentDidChange\n @param {Number} [start] optional start offset for the content change.\n For unordered enumerables, you should always pass -1.\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to\n be added or the number of items to be added.\n @chainable\n */\n enumerableContentDidChange: function(removing, adding) {\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding, 'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.sendEvent(this, '@enumerable:change', [this, removing, adding]);\n if (hasDelta) Ember.propertyDidChange(this, 'length');\n Ember.propertyDidChange(this, '[]');\n\n return this ;\n }\n\n}) ;\n\n})();\n//@ sourceURL=ember-runtime/mixins/enumerable");minispade.register('ember-runtime/mixins/evented', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n This mixin allows for Ember objects to subscribe to and emit events.\n\n ```javascript\n App.Person = Ember.Object.extend(Ember.Evented, {\n greet: function() {\n // ...\n this.trigger('greet');\n }\n });\n\n var person = App.Person.create();\n\n person.on('greet', function() {\n console.log('Our person has greeted');\n });\n\n person.greet();\n\n // outputs: 'Our person has greeted'\n ```\n\n You can also chain multiple event subscriptions:\n\n ```javascript\n person.on('greet', function() {\n console.log('Our person has greeted');\n }).one('greet', function() {\n console.log('Offer one-time special');\n }).off('event', this, forgetThis);\n ```\n\n @class Evented\n @namespace Ember\n @extends Ember.Mixin\n */\nEmber.Evented = Ember.Mixin.create({\n\n /**\n Subscribes to a named event with given function.\n\n ```javascript\n person.on('didLoad', function() {\n // fired once the person has loaded\n });\n ```\n\n An optional target can be passed in as the 2nd argument that will\n be set as the \"this\" for the callback. This is a good way to give your\n function access to the object triggering the event. When the target\n parameter is used the callback becomes the third argument.\n\n @method on\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n */\n on: function(name, target, method) {\n Ember.addListener(this, name, target, method);\n return this;\n },\n\n /**\n Subscribes a function to a named event and then cancels the subscription\n after the first time the event is triggered. It is good to use ``one`` when\n you only care about the first time an event has taken place.\n\n This function takes an optional 2nd argument that will become the \"this\"\n value for the callback. If this argument is passed then the 3rd argument\n becomes the function.\n\n @method one\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n */\n one: function(name, target, method) {\n if (!method) {\n method = target;\n target = null;\n }\n\n Ember.addListener(this, name, target, method, true);\n return this;\n },\n\n /**\n Triggers a named event for the object. Any additional arguments\n will be passed as parameters to the functions that are subscribed to the\n event.\n\n ```javascript\n person.on('didEat', function(food) {\n console.log('person ate some ' + food);\n });\n\n person.trigger('didEat', 'broccoli');\n\n // outputs: person ate some broccoli\n ```\n @method trigger\n @param {String} name The name of the event\n @param {Object...} args Optional arguments to pass on\n */\n trigger: function(name) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n Ember.sendEvent(this, name, args);\n },\n\n fire: function(name) {\n Ember.deprecate(\"Ember.Evented#fire() has been deprecated in favor of trigger() for compatibility with jQuery. It will be removed in 1.0. Please update your code to call trigger() instead.\");\n this.trigger.apply(this, arguments);\n },\n\n /**\n Cancels subscription for give name, target, and method.\n\n @method off\n @param {String} name The name of the event\n @param {Object} target The target of the subscription\n @param {Function} method The function of the subscription\n */\n off: function(name, target, method) {\n Ember.removeListener(this, name, target, method);\n return this;\n },\n\n /**\n Checks to see if object has any subscriptions for named event.\n\n @method has\n @param {String} name The name of the event\n @return {Boolean} does the object have a subscription for event\n */\n has: function(name) {\n return Ember.hasListeners(this, name);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/evented");minispade.register('ember-runtime/mixins/freezable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.Freezable` mixin implements some basic methods for marking an\n object as frozen. Once an object is frozen it should be read only. No changes\n may be made the internal state of the object.\n\n ## Enforcement\n\n To fully support freezing in your subclass, you must include this mixin and\n override any method that might alter any property on the object to instead\n raise an exception. You can check the state of an object by checking the\n `isFrozen` property.\n\n Although future versions of JavaScript may support language-level freezing\n object objects, that is not the case today. Even if an object is freezable,\n it is still technically possible to modify the object, even though it could\n break other parts of your application that do not expect a frozen object to\n change. It is, therefore, very important that you always respect the\n `isFrozen` property on all freezable objects.\n\n ## Example Usage\n\n The example below shows a simple object that implement the `Ember.Freezable`\n protocol.\n\n ```javascript\n Contact = Ember.Object.extend(Ember.Freezable, {\n firstName: null,\n lastName: null,\n\n // swaps the names\n swapNames: function() {\n if (this.get('isFrozen')) throw Ember.FROZEN_ERROR;\n var tmp = this.get('firstName');\n this.set('firstName', this.get('lastName'));\n this.set('lastName', tmp);\n return this;\n }\n\n });\n\n c = Context.create({ firstName: \"John\", lastName: \"Doe\" });\n c.swapNames(); // returns c\n c.freeze();\n c.swapNames(); // EXCEPTION\n ```\n\n ## Copying\n\n Usually the `Ember.Freezable` protocol is implemented in cooperation with the\n `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will\n return a frozen object, if the object implements this method as well.\n\n @class Freezable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Freezable = Ember.Mixin.create(\n/** @scope Ember.Freezable.prototype */ {\n\n /**\n Set to `true` when the object is frozen. Use this property to detect\n whether your object is frozen or not.\n\n @property isFrozen\n @type Boolean\n */\n isFrozen: false,\n\n /**\n Freezes the object. Once this method has been called the object should\n no longer allow any properties to be edited.\n\n @method freeze\n @return {Object} receiver\n */\n freeze: function() {\n if (get(this, 'isFrozen')) return this;\n set(this, 'isFrozen', true);\n return this;\n }\n\n});\n\nEmber.FROZEN_ERROR = \"Frozen object cannot be modified.\";\n\n})();\n//@ sourceURL=ember-runtime/mixins/freezable");minispade.register('ember-runtime/mixins/mutable_array', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\nminispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\n\n// ..........................................................\n// CONSTANTS\n//\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\" ;\nvar EMPTY = [];\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n This mixin defines the API for modifying array-like objects. These methods\n can be applied only to a collection that keeps its items in an ordered set.\n\n Note that an Array can change even if it does not implement this mixin.\n For example, one might implement a SparseArray that cannot be directly\n modified, but if its underlying enumerable changes, it will change also.\n\n @class MutableArray\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.Array\n @uses Ember.MutableEnumerable\n*/\nEmber.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,\n /** @scope Ember.MutableArray.prototype */ {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n You should replace amt objects started at idx with the objects in the\n passed array. You should also call `this.enumerableContentDidChange()`\n\n @method replace\n @param {Number} idx Starting index in the array to replace. If\n idx >= length, then append to the end of the array.\n @param {Number} amt Number of elements that should be removed from\n the array, starting at *idx*.\n @param {Array} objects An array of zero or more objects that should be\n inserted into the array at *idx*\n */\n replace: Ember.required(),\n\n /**\n Remove all elements from self. This is useful if you\n want to reuse an existing array without having to recreate it.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n color.length(); // 3\n colors.clear(); // []\n colors.length(); // 0\n ```\n\n @method clear\n @return {Ember.Array} An empty Array.\n */\n clear: function () {\n var len = get(this, 'length');\n if (len === 0) return this;\n this.replace(0, len, EMPTY);\n return this;\n },\n\n /**\n This will use the primitive `replace()` method to insert an object at the\n specified index.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.insertAt(2, \"yellow\"); // [\"red\", \"green\", \"yellow\", \"blue\"]\n colors.insertAt(5, \"orange\"); // Error: Index out of range\n ```\n\n @method insertAt\n @param {Number} idx index of insert the object at.\n @param {Object} object object to insert\n */\n insertAt: function(idx, object) {\n if (idx > get(this, 'length')) throw new Error(OUT_OF_RANGE_EXCEPTION) ;\n this.replace(idx, 0, [object]) ;\n return this ;\n },\n\n /**\n Remove an object at the specified index using the `replace()` primitive\n method. You can pass either a single index, or a start and a length.\n\n If you pass a start and length that is beyond the\n length this method will throw an `Ember.OUT_OF_RANGE_EXCEPTION`\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\", \"yellow\", \"orange\"];\n colors.removeAt(0); // [\"green\", \"blue\", \"yellow\", \"orange\"]\n colors.removeAt(2, 2); // [\"green\", \"blue\"]\n colors.removeAt(4, 2); // Error: Index out of range\n ```\n\n @method removeAt\n @param {Number} start index, start of range\n @param {Number} len length of passing range\n @return {Object} receiver\n */\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n // fast case\n if (len === undefined) len = 1;\n this.replace(start, len, EMPTY);\n }\n\n return this ;\n },\n\n /**\n Push the object onto the end of the array. Works just like `push()` but it\n is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObject(\"black\"); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObject([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", [\"yellow\", \"orange\"]]\n ```\n\n @method pushObject\n @param {anything} obj object to push\n */\n pushObject: function(obj) {\n this.insertAt(get(this, 'length'), obj) ;\n return obj ;\n },\n\n /**\n Add the objects in the passed numerable to the end of the array. Defers\n notifying observers of the change until all objects are added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObjects(\"black\"); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObjects([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", \"yellow\", \"orange\"]\n ```\n\n @method pushObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n pushObjects: function(objects) {\n this.replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n /**\n Pop object from array or nil if none are left. Works just like `pop()` but\n it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.popObject(); // \"blue\"\n console.log(colors); // [\"red\", \"green\"]\n ```\n\n @method popObject\n @return object\n */\n popObject: function() {\n var len = get(this, 'length') ;\n if (len === 0) return null ;\n\n var ret = this.objectAt(len-1) ;\n this.removeAt(len-1, 1) ;\n return ret ;\n },\n\n /**\n Shift an object from start of array or nil if none are left. Works just\n like `shift()` but it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.shiftObject(); // \"red\"\n console.log(colors); // [\"green\", \"blue\"]\n ```\n\n @method shiftObject\n @return object\n */\n shiftObject: function() {\n if (get(this, 'length') === 0) return null ;\n var ret = this.objectAt(0) ;\n this.removeAt(0) ;\n return ret ;\n },\n\n /**\n Unshift an object to start of array. Works just like `unshift()` but it is\n KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObject(\"yellow\"); // [\"yellow\", \"red\", \"green\", \"blue\"]\n colors.unshiftObject([\"black\", \"white\"]); // [[\"black\", \"white\"], \"yellow\", \"red\", \"green\", \"blue\"]\n ```\n\n @method unshiftObject\n @param {anything} obj object to unshift\n */\n unshiftObject: function(obj) {\n this.insertAt(0, obj) ;\n return obj ;\n },\n\n /**\n Adds the named objects to the beginning of the array. Defers notifying\n observers until all objects have been added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObjects([\"black\", \"white\"]); // [\"black\", \"white\", \"red\", \"green\", \"blue\"]\n colors.unshiftObjects(\"yellow\"); // Type Error: 'undefined' is not a function\n ```\n\n @method unshiftObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n unshiftObjects: function(objects) {\n this.replace(0, 0, objects);\n return this;\n },\n\n /**\n Reverse objects in the array. Works just like `reverse()` but it is\n KVO-compliant.\n\n @method reverseObjects\n @return {Ember.Array} receiver\n */\n reverseObjects: function() {\n var len = get(this, 'length');\n if (len === 0) return this;\n var objects = this.toArray().reverse();\n this.replace(0, len, objects);\n return this;\n },\n\n /**\n Replace all the the receiver's content with content of the argument.\n If argument is an empty array receiver will be cleared.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.setObjects([\"black\", \"white\"]); // [\"black\", \"white\"]\n colors.setObjects([]); // []\n ```\n\n @method setObjects\n @param {Ember.Array} objects array whose content will be used for replacing\n the content of the receiver\n @return {Ember.Array} receiver with the new content\n */\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this.replace(0, len, objects);\n return this;\n },\n\n // ..........................................................\n // IMPLEMENT Ember.MutableEnumerable\n //\n\n removeObject: function(obj) {\n var loc = get(this, 'length') || 0;\n while(--loc >= 0) {\n var curObject = this.objectAt(loc) ;\n if (curObject === obj) this.removeAt(loc) ;\n }\n return this ;\n },\n\n addObject: function(obj) {\n if (!this.contains(obj)) this.pushObject(obj);\n return this ;\n }\n\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_array");minispade.register('ember-runtime/mixins/mutable_enumerable', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar forEach = Ember.EnumerableUtils.forEach;\n\n/**\n This mixin defines the API for modifying generic enumerables. These methods\n can be applied to an object regardless of whether it is ordered or\n unordered.\n\n Note that an Enumerable can change even if it does not implement this mixin.\n For example, a MappedEnumerable cannot be directly modified but if its\n underlying enumerable changes, it will change also.\n\n ## Adding Objects\n\n To add an object to an enumerable, use the `addObject()` method. This\n method will only add the object to the enumerable if the object is not\n already present and the object if of a type supported by the enumerable.\n\n ```javascript\n set.addObject(contact);\n ```\n\n ## Removing Objects\n\n To remove an object form an enumerable, use the `removeObject()` method. This\n will only remove the object if it is already in the enumerable, otherwise\n this method has no effect.\n\n ```javascript\n set.removeObject(contact);\n ```\n\n ## Implementing In Your Own Code\n\n If you are implementing an object and want to support this API, just include\n this mixin in your class and implement the required methods. In your unit\n tests, be sure to apply the Ember.MutableEnumerableTests to your object.\n\n @class MutableEnumerable\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.Enumerable\n*/\nEmber.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable, {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to add the passed object to the receiver if the object is not\n already present in the collection. If the object is present, this method\n has no effect.\n\n If the passed object is of a type not supported by the receiver\n then this method should raise an exception.\n\n @method addObject\n @param {Object} object The object to add to the enumerable.\n @return {Object} the passed object\n */\n addObject: Ember.required(Function),\n\n /**\n Adds each object in the passed enumerable to the receiver.\n\n @method addObjects\n @param {Ember.Enumerable} objects the objects to add.\n @return {Object} receiver\n */\n addObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.addObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n },\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to remove the passed object from the receiver collection if the\n object is in present in the collection. If the object is not present,\n this method has no effect.\n\n If the passed object is of a type not supported by the receiver\n then this method should raise an exception.\n\n @method removeObject\n @param {Object} object The object to remove from the enumerable.\n @return {Object} the passed object\n */\n removeObject: Ember.required(Function),\n\n\n /**\n Removes each objects in the passed enumerable from the receiver.\n\n @method removeObjects\n @param {Ember.Enumerable} objects the objects to remove\n @return {Object} receiver\n */\n removeObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.removeObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_enumerable");minispade.register('ember-runtime/mixins/observable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n ## Overview\n\n This mixin provides properties and property observing functionality, core\n features of the Ember object model.\n\n Properties and observers allow one object to observe changes to a\n property on another object. This is one of the fundamental ways that\n models, controllers and views communicate with each other in an Ember\n application.\n\n Any object that has this mixin applied can be used in observer\n operations. That includes `Ember.Object` and most objects you will\n interact with as you write your Ember application.\n\n Note that you will not generally apply this mixin to classes yourself,\n but you will use the features provided by this module frequently, so it\n is important to understand how to use it.\n\n ## Using `get()` and `set()`\n\n Because of Ember's support for bindings and observers, you will always\n access properties using the get method, and set properties using the\n set method. This allows the observing objects to be notified and\n computed properties to be handled properly.\n\n More documentation about `get` and `set` are below.\n\n ## Observing Property Changes\n\n You typically observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.create({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n Although this is the most common way to add an observer, this capability\n is actually built into the `Ember.Object` class on top of two methods\n defined in this mixin: `addObserver` and `removeObserver`. You can use\n these two methods to add and remove observers yourself if you need to\n do so at runtime.\n\n To add an observer for a property, call:\n\n ```javascript\n object.addObserver('propertyKey', targetObject, targetAction)\n ```\n\n This will call the `targetAction` method on the `targetObject` to be called\n whenever the value of the `propertyKey` changes.\n\n Note that if `propertyKey` is a computed property, the observer will be\n called when any of the property dependencies are changed, even if the\n resulting value of the computed property is unchanged. This is necessary\n because computed properties are not computed until `get` is called.\n\n @class Observable\n @namespace Ember\n @extends Ember.Mixin\n*/\nEmber.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {\n\n /**\n Retrieves the value of a property from the object.\n\n This method is usually similar to using `object[keyName]` or `object.keyName`,\n however it supports both computed properties and the unknownProperty\n handler.\n\n Because `get` unifies the syntax for accessing all these kinds\n of properties, it can make many refactorings easier, such as replacing a\n simple property with a computed property, or vice versa.\n\n ### Computed Properties\n\n Computed properties are methods defined with the `property` modifier\n declared at the end, such as:\n\n ```javascript\n fullName: function() {\n return this.getEach('firstName', 'lastName').compact().join(' ');\n }.property('firstName', 'lastName')\n ```\n\n When you call `get` on a computed property, the function will be\n called and the return value will be returned instead of the function\n itself.\n\n ### Unknown Properties\n\n Likewise, if you try to call `get` on a property whose value is\n `undefined`, the `unknownProperty()` method will be called on the object.\n If this method returns any value other than `undefined`, it will be returned\n instead. This allows you to implement \"virtual\" properties that are\n not defined upfront.\n\n @method get\n @param {String} keyName The property to retrieve\n @return {Object} The property value or undefined.\n */\n get: function(keyName) {\n return get(this, keyName);\n },\n\n /**\n To get multiple properties at once, call `getProperties`\n with a list of strings or an array:\n\n ```javascript\n record.getProperties('firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n record.getProperties(['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param {String...|Array} list of keys to get\n @return {Hash}\n */\n getProperties: function() {\n var ret = {};\n var propertyNames = arguments;\n if (arguments.length === 1 && Ember.typeOf(arguments[0]) === 'array') {\n propertyNames = arguments[0];\n }\n for(var i = 0; i < propertyNames.length; i++) {\n ret[propertyNames[i]] = get(this, propertyNames[i]);\n }\n return ret;\n },\n\n /**\n Sets the provided key or path to the value.\n\n This method is generally very similar to calling `object[key] = value` or\n `object.key = value`, except that it provides support for computed\n properties, the `unknownProperty()` method and property observers.\n\n ### Computed Properties\n\n If you try to set a value on a key that has a computed property handler\n defined (see the `get()` method for an example), then `set()` will call\n that method, passing both the value and key instead of simply changing\n the value itself. This is useful for those times when you need to\n implement a property that is composed of one or more member\n properties.\n\n ### Unknown Properties\n\n If you try to set a value on a key that is undefined in the target\n object, then the `unknownProperty()` handler will be called instead. This\n gives you an opportunity to implement complex \"virtual\" properties that\n are not predefined on the object. If `unknownProperty()` returns\n undefined, then `set()` will simply set the value on the object.\n\n ### Property Observers\n\n In addition to changing the property, `set()` will also register a property\n change with the object. Unless you have placed this call inside of a\n `beginPropertyChanges()` and `endPropertyChanges(),` any \"local\" observers\n (i.e. observer methods declared on the same object), will be called\n immediately. Any \"remote\" observers (i.e. observer methods declared on\n another object) will be placed in a queue and called at a later time in a\n coalesced manner.\n\n ### Chaining\n\n In addition to property changes, `set()` returns the value of the object\n itself so you can do chaining like this:\n\n ```javascript\n record.set('firstName', 'Charles').set('lastName', 'Jolley');\n ```\n\n @method set\n @param {String} keyName The property to set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n set: function(keyName, value) {\n set(this, keyName, value);\n return this;\n },\n\n /**\n To set multiple properties at once, call `setProperties`\n with a Hash:\n\n ```javascript\n record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });\n ```\n\n @method setProperties\n @param {Hash} hash the hash of keys and values to set\n @return {Ember.Observable}\n */\n setProperties: function(hash) {\n return Ember.setProperties(this, hash);\n },\n\n /**\n Begins a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call this\n method at the beginning of the changes to begin deferring change\n notifications. When you are done making changes, call\n `endPropertyChanges()` to deliver the deferred change notifications and end\n deferring.\n\n @method beginPropertyChanges\n @return {Ember.Observable}\n */\n beginPropertyChanges: function() {\n Ember.beginPropertyChanges();\n return this;\n },\n\n /**\n Ends a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call\n `beginPropertyChanges()` at the beginning of the changes to defer change\n notifications. When you are done making changes, call this method to\n deliver the deferred change notifications and end deferring.\n\n @method endPropertyChanges\n @return {Ember.Observable}\n */\n endPropertyChanges: function() {\n Ember.endPropertyChanges();\n return this;\n },\n\n /**\n Notify the observer system that a property is about to change.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyDidChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyWillChange\n @param {String} keyName The property key that is about to change.\n @return {Ember.Observable}\n */\n propertyWillChange: function(keyName){\n Ember.propertyWillChange(this, keyName);\n return this;\n },\n\n /**\n Notify the observer system that a property has just changed.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyWillChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyDidChange\n @param {String} keyName The property key that has just changed.\n @return {Ember.Observable}\n */\n propertyDidChange: function(keyName) {\n Ember.propertyDidChange(this, keyName);\n return this;\n },\n\n /**\n Convenience method to call `propertyWillChange` and `propertyDidChange` in\n succession.\n\n @method notifyPropertyChange\n @param {String} keyName The property key to be notified about.\n @return {Ember.Observable}\n */\n notifyPropertyChange: function(keyName) {\n this.propertyWillChange(keyName);\n this.propertyDidChange(keyName);\n return this;\n },\n\n addBeforeObserver: function(key, target, method) {\n Ember.addBeforeObserver(this, key, target, method);\n },\n\n /**\n Adds an observer on a property.\n\n This is the core method used to register an observer for a property.\n\n Once you call this method, anytime the key's value is set, your observer\n will be notified. Note that the observers are triggered anytime the\n value is set, regardless of whether it has actually changed. Your\n observer should be prepared to handle that.\n\n You can also pass an optional context parameter to this method. The\n context will be passed to your observer method whenever it is triggered.\n Note that if you add the same target/method pair on a key multiple times\n with different context parameters, your observer will only be called once\n with the last context you passed.\n\n ### Observer Methods\n\n Observer methods you pass should generally have the following signature if\n you do not pass a `context` parameter:\n\n ```javascript\n fooDidChange: function(sender, key, value, rev) { };\n ```\n\n The sender is the object that changed. The key is the property that\n changes. The value property is currently reserved and unused. The rev\n is the last property revision of the object when it changed, which you can\n use to detect if the key value has really changed or not.\n\n If you pass a `context` parameter, the context will be passed before the\n revision like so:\n\n ```javascript\n fooDidChange: function(sender, key, value, context, rev) { };\n ```\n\n Usually you will not need the value, context or revision parameters at\n the end. In this case, it is common to write observer methods that take\n only a sender and key value as parameters or, if you aren't interested in\n any of these values, to write an observer that has no parameters at all.\n\n @method addObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Object} self\n */\n addObserver: function(key, target, method) {\n Ember.addObserver(this, key, target, method);\n },\n\n /**\n Remove an observer you have previously registered on this object. Pass\n the same key, target, and method you passed to `addObserver()` and your\n target will no longer receive notifications.\n\n @method removeObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Observable} receiver\n */\n removeObserver: function(key, target, method) {\n Ember.removeObserver(this, key, target, method);\n },\n\n /**\n Returns `true` if the object currently has observers registered for a\n particular key. You can use this method to potentially defer performing\n an expensive action until someone begins observing a particular property\n on the object.\n\n @method hasObserverFor\n @param {String} key Key to check\n @return {Boolean}\n */\n hasObserverFor: function(key) {\n return Ember.hasListeners(this, key+':change');\n },\n\n /**\n @deprecated\n @method getPath\n @param {String} path The property path to retrieve\n @return {Object} The property value or undefined.\n */\n getPath: function(path) {\n Ember.deprecate(\"getPath is deprecated since get now supports paths\");\n return this.get(path);\n },\n\n /**\n @deprecated\n @method setPath\n @param {String} path The path to the property that will be set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n setPath: function(path, value) {\n Ember.deprecate(\"setPath is deprecated since set now supports paths\");\n return this.set(path, value);\n },\n\n /**\n Retrieves the value of a property, or a default value in the case that the\n property returns `undefined`.\n\n ```javascript\n person.getWithDefault('lastName', 'Doe');\n ```\n\n @method getWithDefault\n @param {String} keyName The name of the property to retrieve\n @param {Object} defaultValue The value to return if the property value is undefined\n @return {Object} The property value or the defaultValue.\n */\n getWithDefault: function(keyName, defaultValue) {\n return Ember.getWithDefault(this, keyName, defaultValue);\n },\n\n /**\n Set the value of a property to the current value plus some amount.\n\n ```javascript\n person.incrementProperty('age');\n team.incrementProperty('score', 2);\n ```\n\n @method incrementProperty\n @param {String} keyName The name of the property to increment\n @param {Object} increment The amount to increment by. Defaults to 1\n @return {Object} The new property value\n */\n incrementProperty: function(keyName, increment) {\n if (!increment) { increment = 1; }\n set(this, keyName, (get(this, keyName) || 0)+increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a property to the current value minus some amount.\n\n ```javascript\n player.decrementProperty('lives');\n orc.decrementProperty('health', 5);\n ```\n\n @method decrementProperty\n @param {String} keyName The name of the property to decrement\n @param {Object} increment The amount to decrement by. Defaults to 1\n @return {Object} The new property value\n */\n decrementProperty: function(keyName, increment) {\n if (!increment) { increment = 1; }\n set(this, keyName, (get(this, keyName) || 0)-increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a boolean property to the opposite of it's\n current value.\n\n ```javascript\n starship.toggleProperty('warpDriveEnaged');\n ```\n\n @method toggleProperty\n @param {String} keyName The name of the property to toggle\n @return {Object} The new property value\n */\n toggleProperty: function(keyName) {\n set(this, keyName, !get(this, keyName));\n return get(this, keyName);\n },\n\n /**\n Returns the cached value of a computed property, if it exists.\n This allows you to inspect the value of a computed property\n without accidentally invoking it if it is intended to be\n generated lazily.\n\n @method cacheFor\n @param {String} keyName\n @return {Object} The cached value of the computed property, if any\n */\n cacheFor: function(keyName) {\n return Ember.cacheFor(this, keyName);\n },\n\n // intended for debugging purposes\n observersForKey: function(keyName) {\n return Ember.observersFor(this, keyName);\n }\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/observable");minispade.register('ember-runtime/mixins/sortable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach;\n\n/**\n `Ember.SortableMixin` provides a standard interface for array proxies\n to specify a sort order and maintain this sorting when objects are added,\n removed, or updated without changing the implicit order of their underlying\n content array:\n\n ```javascript\n songs = [\n {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'},\n {trackNumber: 2, title: 'Back in the U.S.S.R.'},\n {trackNumber: 3, title: 'Glass Onion'},\n ];\n\n songsController = Ember.ArrayController.create({\n content: songs,\n sortProperties: ['trackNumber'],\n sortAscending: true\n });\n\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.addObject({trackNumber: 1, title: 'Dear Prudence'});\n songsController.get('firstObject'); // {trackNumber: 1, title: 'Dear Prudence'}\n ```\n\n @class SortableMixin\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.MutableEnumerable\n*/\nEmber.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {\n\n /**\n Specifies which properties dictate the arrangedContent's sort order.\n\n @property {Array} sortProperties\n */\n sortProperties: null,\n\n /**\n Specifies the arrangedContent's sort direction\n\n @property {Boolean} sortAscending\n */\n sortAscending: true,\n\n orderBy: function(item1, item2) {\n var result = 0,\n sortProperties = get(this, 'sortProperties'),\n sortAscending = get(this, 'sortAscending');\n\n Ember.assert(\"you need to define `sortProperties`\", !!sortProperties);\n\n forEach(sortProperties, function(propertyName) {\n if (result === 0) {\n result = Ember.compare(get(item1, propertyName), get(item2, propertyName));\n if ((result !== 0) && !sortAscending) {\n result = (-1) * result;\n }\n }\n });\n\n return result;\n },\n\n destroy: function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super();\n },\n\n isSorted: Ember.computed.bool('sortProperties'),\n\n arrangedContent: Ember.computed('content', 'sortProperties.@each', function(key, value) {\n var content = get(this, 'content'),\n isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties'),\n self = this;\n\n if (content && isSorted) {\n content = content.slice();\n content.sort(function(item1, item2) {\n return self.orderBy(item1, item2);\n });\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n return Ember.A(content);\n }\n\n return content;\n }),\n\n _contentWillChange: Ember.beforeObserver(function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n this._super();\n }, 'content'),\n\n sortAscendingWillChange: Ember.beforeObserver(function() {\n this._lastSortAscending = get(this, 'sortAscending');\n }, 'sortAscending'),\n\n sortAscendingDidChange: Ember.observer(function() {\n if (get(this, 'sortAscending') !== this._lastSortAscending) {\n var arrangedContent = get(this, 'arrangedContent');\n arrangedContent.reverseObjects();\n }\n }, 'sortAscending'),\n\n contentArrayWillChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted');\n\n if (isSorted) {\n var arrangedContent = get(this, 'arrangedContent');\n var removedObjects = array.slice(idx, idx+removedCount);\n var sortProperties = get(this, 'sortProperties');\n\n forEach(removedObjects, function(item) {\n arrangedContent.removeObject(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n contentArrayDidChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties');\n\n if (isSorted) {\n var addedObjects = array.slice(idx, idx+addedCount);\n\n forEach(addedObjects, function(item) {\n this.insertItemSorted(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n insertItemSorted: function(item) {\n var arrangedContent = get(this, 'arrangedContent');\n var length = get(arrangedContent, 'length');\n\n var idx = this._binarySearch(item, 0, length);\n arrangedContent.insertAt(idx, item);\n },\n\n contentItemSortPropertyDidChange: function(item) {\n var arrangedContent = get(this, 'arrangedContent'),\n oldIndex = arrangedContent.indexOf(item),\n leftItem = arrangedContent.objectAt(oldIndex - 1),\n rightItem = arrangedContent.objectAt(oldIndex + 1),\n leftResult = leftItem && this.orderBy(item, leftItem),\n rightResult = rightItem && this.orderBy(item, rightItem);\n\n if (leftResult < 0 || rightResult > 0) {\n arrangedContent.removeObject(item);\n this.insertItemSorted(item);\n }\n },\n\n _binarySearch: function(item, low, high) {\n var mid, midItem, res, arrangedContent;\n\n if (low === high) {\n return low;\n }\n\n arrangedContent = get(this, 'arrangedContent');\n\n mid = low + Math.floor((high - low) / 2);\n midItem = arrangedContent.objectAt(mid);\n\n res = this.orderBy(midItem, item);\n\n if (res < 0) {\n return this._binarySearch(item, mid+1, high);\n } else if (res > 0) {\n return this._binarySearch(item, low, mid);\n }\n\n return mid;\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/sortable");minispade.register('ember-runtime/mixins/target_action_support', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n@class TargetActionSupport\n@namespace Ember\n@extends Ember.Mixin\n*/\nEmber.TargetActionSupport = Ember.Mixin.create({\n target: null,\n action: null,\n\n targetObject: Ember.computed(function() {\n var target = get(this, 'target');\n\n if (Ember.typeOf(target) === \"string\") {\n var value = get(this, target);\n if (value === undefined) { value = get(Ember.lookup, target); }\n return value;\n } else {\n return target;\n }\n }).property('target'),\n\n triggerAction: function() {\n var action = get(this, 'action'),\n target = get(this, 'targetObject');\n\n if (target && action) {\n var ret;\n\n if (typeof target.send === 'function') {\n ret = target.send(action, this);\n } else {\n if (typeof action === 'string') {\n action = target[action];\n }\n ret = action.call(target, this);\n }\n if (ret !== false) ret = true;\n\n return ret;\n } else {\n return false;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/target_action_support");minispade.register('ember-runtime/system', "(function() {minispade.require('ember-runtime/system/container');\nminispade.require('ember-runtime/system/application');\nminispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/system/each_proxy');\nminispade.require('ember-runtime/system/namespace');\nminispade.require('ember-runtime/system/native_array');\nminispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/set');\nminispade.require('ember-runtime/system/string');\nminispade.require('ember-runtime/system/deferred');\nminispade.require('ember-runtime/system/lazy_load');\n\n})();\n//@ sourceURL=ember-runtime/system");minispade.register('ember-runtime/system/application', "(function() {minispade.require('ember-runtime/system/namespace');\n\nEmber.Application = Ember.Namespace.extend();\n\n})();\n//@ sourceURL=ember-runtime/system/application");minispade.register('ember-runtime/system/array_proxy', "(function() {minispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\";\nvar EMPTY = [];\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n An ArrayProxy wraps any other object that implements `Ember.Array` and/or\n `Ember.MutableArray,` forwarding all requests. This makes it very useful for\n a number of binding use cases or other cases where being able to swap\n out the underlying array is useful.\n\n A simple example of usage:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });\n\n ap.get('firstObject'); // 'dog'\n ap.set('content', ['amoeba', 'paramecium']);\n ap.get('firstObject'); // 'amoeba'\n ```\n\n This class can also be useful as a layer to transform the contents of\n an array, as they are accessed. This can be done by overriding\n `objectAtContent`:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({\n content: Ember.A(pets),\n objectAtContent: function(idx) {\n return this.get('content').objectAt(idx).toUpperCase();\n }\n });\n\n ap.get('firstObject'); // . 'DOG'\n ```\n\n @class ArrayProxy\n @namespace Ember\n @extends Ember.Object\n @uses Ember.MutableArray\n*/\nEmber.ArrayProxy = Ember.Object.extend(Ember.MutableArray,\n/** @scope Ember.ArrayProxy.prototype */ {\n\n /**\n The content array. Must be an object that implements `Ember.Array` and/or\n `Ember.MutableArray.`\n\n @property content\n @type Ember.Array\n */\n content: null,\n\n /**\n The array that the proxy pretends to be. In the default `ArrayProxy`\n implementation, this and `content` are the same. Subclasses of `ArrayProxy`\n can override this property to provide things like sorting and filtering.\n\n @property arrangedContent\n */\n arrangedContent: Ember.computed.alias('content'),\n\n /**\n Should actually retrieve the object at the specified index from the\n content. You can override this method in subclasses to transform the\n content item to something new.\n\n This method will only be called if content is non-`null`.\n\n @method objectAtContent\n @param {Number} idx The index to retrieve.\n @return {Object} the value or undefined if none found\n */\n objectAtContent: function(idx) {\n return get(this, 'arrangedContent').objectAt(idx);\n },\n\n /**\n Should actually replace the specified objects on the content array.\n You can override this method in subclasses to transform the content item\n into something new.\n\n This method will only be called if content is non-`null`.\n\n @method replaceContent\n @param {Number} idx The starting index\n @param {Number} amt The number of items to remove from the content.\n @param {Array} objects Optional array of objects to insert or null if no\n objects.\n @return {void}\n */\n replaceContent: function(idx, amt, objects) {\n get(this, 'content').replace(idx, amt, objects);\n },\n\n /**\n @private\n\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @method _contentWillChange\n */\n _contentWillChange: Ember.beforeObserver(function() {\n this._teardownContent();\n }, 'content'),\n\n _teardownContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n contentArrayWillChange: Ember.K,\n contentArrayDidChange: Ember.K,\n\n /**\n @private\n\n Invoked when the content property changes. Notifies observers that the\n entire array content has changed.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer(function() {\n var content = get(this, 'content');\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", content !== this);\n\n this._setupContent();\n }, 'content'),\n\n _setupContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n _arrangedContentWillChange: Ember.beforeObserver(function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n this.arrangedContentArrayWillChange(this, 0, len, undefined);\n this.arrangedContentWillChange(this);\n\n this._teardownArrangedContent(arrangedContent);\n }, 'arrangedContent'),\n\n _arrangedContentDidChange: Ember.observer(function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", arrangedContent !== this);\n\n this._setupArrangedContent();\n\n this.arrangedContentDidChange(this);\n this.arrangedContentArrayDidChange(this, 0, undefined, len);\n }, 'arrangedContent'),\n\n _setupArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.addArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n _teardownArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.removeArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n arrangedContentWillChange: Ember.K,\n arrangedContentDidChange: Ember.K,\n\n objectAt: function(idx) {\n return get(this, 'content') && this.objectAtContent(idx);\n },\n\n length: Ember.computed(function() {\n var arrangedContent = get(this, 'arrangedContent');\n return arrangedContent ? get(arrangedContent, 'length') : 0;\n // No dependencies since Enumerable notifies length of change\n }),\n\n _replace: function(idx, amt, objects) {\n var content = get(this, 'content');\n Ember.assert('The content property of '+ this.constructor + ' should be set before modifying it', content);\n if (content) this.replaceContent(idx, amt, objects);\n return this;\n },\n\n replace: function() {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n this._replace.apply(this, arguments);\n } else {\n throw new Ember.Error(\"Using replace on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n _insertAt: function(idx, object) {\n if (idx > get(this, 'content.length')) throw new Error(OUT_OF_RANGE_EXCEPTION);\n this._replace(idx, 0, [object]);\n return this;\n },\n\n insertAt: function(idx, object) {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n return this._insertAt(idx, object);\n } else {\n throw new Ember.Error(\"Using insertAt on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n var content = get(this, 'content'),\n arrangedContent = get(this, 'arrangedContent'),\n indices = [], i;\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n if (len === undefined) len = 1;\n\n // Get a list of indices in original content to remove\n for (i=start; i<start+len; i++) {\n // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent\n indices.push(content.indexOf(arrangedContent.objectAt(i)));\n }\n\n // Replace in reverse order since indices will change\n indices.sort(function(a,b) { return b - a; });\n\n Ember.beginPropertyChanges();\n for (i=0; i<indices.length; i++) {\n this._replace(indices[i], 1, EMPTY);\n }\n Ember.endPropertyChanges();\n }\n\n return this ;\n },\n\n pushObject: function(obj) {\n this._insertAt(get(this, 'content.length'), obj) ;\n return obj ;\n },\n\n pushObjects: function(objects) {\n this._replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this._replace(0, len, objects);\n return this;\n },\n\n unshiftObject: function(obj) {\n this._insertAt(0, obj) ;\n return obj ;\n },\n\n unshiftObjects: function(objects) {\n this._replace(0, 0, objects);\n return this;\n },\n\n slice: function() {\n var arr = this.toArray();\n return arr.slice.apply(arr, arguments);\n },\n\n arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentWillChange(idx, removedCnt, addedCnt);\n },\n\n arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentDidChange(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n this._setupContent();\n this._setupArrangedContent();\n },\n\n willDestroy: function() {\n this._teardownArrangedContent();\n this._teardownContent();\n }\n});\n\n\n})();\n//@ sourceURL=ember-runtime/system/array_proxy");minispade.register('ember-runtime/system/container', "(function() {Ember.Container = requireModule('container');\nEmber.Container.set = Ember.set;\n\n})();\n//@ sourceURL=ember-runtime/system/container");minispade.register('ember-runtime/system/core_object', "(function() {minispade.require('ember-runtime/system/namespace');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n// NOTE: this object should never be included directly. Instead use Ember.\n// Ember.Object. We only define this separately so that Ember.Set can depend on it\n\n\nvar set = Ember.set, get = Ember.get,\n o_create = Ember.create,\n o_defineProperty = Ember.platform.defineProperty,\n GUID_KEY = Ember.GUID_KEY,\n guidFor = Ember.guidFor,\n generateGuid = Ember.generateGuid,\n meta = Ember.meta,\n rewatch = Ember.rewatch,\n finishChains = Ember.finishChains,\n destroy = Ember.destroy,\n schedule = Ember.run.schedule,\n Mixin = Ember.Mixin,\n applyMixin = Mixin._apply,\n finishPartial = Mixin.finishPartial,\n reopen = Mixin.prototype.reopen,\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n indexOf = Ember.EnumerableUtils.indexOf;\n\nvar undefinedDescriptor = {\n configurable: true,\n writable: true,\n enumerable: false,\n value: undefined\n};\n\nfunction makeCtor() {\n\n // Note: avoid accessing any properties on the object since it makes the\n // method a lot faster. This is glue code so we want it to be as fast as\n // possible.\n\n var wasApplied = false, initMixins, initProperties;\n\n var Class = function() {\n if (!wasApplied) {\n Class.proto(); // prepare prototype...\n }\n o_defineProperty(this, GUID_KEY, undefinedDescriptor);\n o_defineProperty(this, '_super', undefinedDescriptor);\n var m = meta(this);\n m.proto = this;\n if (initMixins) {\n // capture locally so we can clear the closed over variable\n var mixins = initMixins;\n initMixins = null;\n this.reopen.apply(this, mixins);\n }\n if (initProperties) {\n // capture locally so we can clear the closed over variable\n var props = initProperties;\n initProperties = null;\n\n var concatenatedProperties = this.concatenatedProperties;\n\n for (var i = 0, l = props.length; i < l; i++) {\n var properties = props[i];\n for (var keyName in properties) {\n if (!properties.hasOwnProperty(keyName)) { continue; }\n\n var value = properties[keyName],\n IS_BINDING = Ember.IS_BINDING;\n\n if (IS_BINDING.test(keyName)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[keyName] = value;\n }\n\n var desc = m.descs[keyName];\n\n Ember.assert(\"Ember.Object.create no longer supports defining computed properties.\", !(value instanceof Ember.ComputedProperty));\n Ember.assert(\"Ember.Object.create no longer supports defining methods that call _super.\", !(typeof value === 'function' && value.toString().indexOf('._super') !== -1));\n\n if (concatenatedProperties && indexOf(concatenatedProperties, keyName) >= 0) {\n var baseValue = this[keyName];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n value = baseValue.concat(value);\n } else {\n value = Ember.makeArray(baseValue).concat(value);\n }\n } else {\n value = Ember.makeArray(value);\n }\n }\n\n if (desc) {\n desc.set(this, keyName, value);\n } else {\n if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) {\n this.setUnknownProperty(keyName, value);\n } else if (MANDATORY_SETTER) {\n Ember.defineProperty(this, keyName, null, value); // setup mandatory setter\n } else {\n this[keyName] = value;\n }\n }\n }\n }\n }\n finishPartial(this, m);\n delete m.proto;\n finishChains(this);\n this.init.apply(this, arguments);\n };\n\n Class.toString = Mixin.prototype.toString;\n Class.willReopen = function() {\n if (wasApplied) {\n Class.PrototypeMixin = Mixin.create(Class.PrototypeMixin);\n }\n\n wasApplied = false;\n };\n Class._initMixins = function(args) { initMixins = args; };\n Class._initProperties = function(args) { initProperties = args; };\n\n Class.proto = function() {\n var superclass = Class.superclass;\n if (superclass) { superclass.proto(); }\n\n if (!wasApplied) {\n wasApplied = true;\n Class.PrototypeMixin.applyPartial(Class.prototype);\n rewatch(Class.prototype);\n }\n\n return this.prototype;\n };\n\n return Class;\n\n}\n\nvar CoreObject = makeCtor();\nCoreObject.toString = function() { return \"Ember.CoreObject\"; };\n\nCoreObject.PrototypeMixin = Mixin.create({\n reopen: function() {\n applyMixin(this, arguments, true);\n return this;\n },\n\n isInstance: true,\n\n /**\n An overridable method called when objects are instantiated. By default,\n does nothing unless it is overridden during class definition.\n\n Example:\n\n ```javascript\n App.Person = Ember.Object.extend({\n init: function() {\n this._super();\n alert('Name is ' + this.get('name'));\n }\n });\n\n var steve = App.Person.create({\n name: \"Steve\"\n });\n\n // alerts 'Name is Steve'.\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n ```\n\n @method init\n */\n init: function() {},\n\n /**\n Defines the properties that will be concatenated from the superclass\n (instead of overridden).\n\n By default, when you extend an Ember class a property defined in\n the subclass overrides a property with the same name that is defined\n in the superclass. However, there are some cases where it is preferable\n to build up a property's value by combining the superclass' property\n value with the subclass' value. An example of this in use within Ember\n is the `classNames` property of `Ember.View`.\n\n Here is some sample code showing the difference between a concatenated\n property and a normal one:\n\n ```javascript\n App.BarView = Ember.View.extend({\n someNonConcatenatedProperty: ['bar'],\n classNames: ['bar']\n });\n\n App.FooBarView = App.BarView.extend({\n someNonConcatenatedProperty: ['foo'],\n classNames: ['foo'],\n });\n\n var fooBarView = App.FooBarView.create();\n fooBarView.get('someNonConcatenatedProperty'); // ['foo']\n fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']\n ```\n\n This behavior extends to object creation as well. Continuing the\n above example:\n\n ```javascript\n var view = App.FooBarView.create({\n someNonConcatenatedProperty: ['baz'],\n classNames: ['baz']\n })\n view.get('someNonConcatenatedProperty'); // ['baz']\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n Adding a single property that is not an array will just add it in the array:\n\n ```javascript\n var view = App.FooBarView.create({\n classNames: 'baz'\n })\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n\n Using the `concatenatedProperties` property, we can tell to Ember that mix\n the content of the properties.\n\n In `Ember.View` the `classNameBindings` and `attributeBindings` properties\n are also concatenated, in addition to `classNames`.\n\n This feature is available for you to use throughout the Ember object model,\n although typical app developers are likely to use it infrequently.\n\n @property concatenatedProperties\n @type Array\n @default null\n */\n concatenatedProperties: null,\n\n /**\n @property isDestroyed\n @default false\n */\n isDestroyed: false,\n\n /**\n @property isDestroying\n @default false\n */\n isDestroying: false,\n\n /**\n Destroys an object by setting the `isDestroyed` flag and removing its\n metadata, which effectively destroys observers and bindings.\n\n If you try to set a property on a destroyed object, an exception will be\n raised.\n\n Note that destruction is scheduled for the end of the run loop and does not\n happen immediately.\n\n @method destroy\n @return {Ember.Object} receiver\n */\n destroy: function() {\n if (this._didCallDestroy) { return; }\n\n this.isDestroying = true;\n this._didCallDestroy = true;\n\n if (this.willDestroy) { this.willDestroy(); }\n\n schedule('destroy', this, this._scheduledDestroy);\n return this;\n },\n\n /**\n @private\n\n Invoked by the run loop to actually destroy the object. This is\n scheduled for execution by the `destroy` method.\n\n @method _scheduledDestroy\n */\n _scheduledDestroy: function() {\n destroy(this);\n set(this, 'isDestroyed', true);\n\n if (this.didDestroy) { this.didDestroy(); }\n },\n\n bind: function(to, from) {\n if (!(from instanceof Ember.Binding)) { from = Ember.Binding.from(from); }\n from.to(to).connect(this);\n return from;\n },\n\n /**\n Returns a string representation which attempts to provide more information\n than Javascript's `toString` typically does, in a generic way for all Ember\n objects.\n\n App.Person = Em.Object.extend()\n person = App.Person.create()\n person.toString() //=> \"<App.Person:ember1024>\"\n\n If the object's class is not defined on an Ember namespace, it will\n indicate it is a subclass of the registered superclass:\n\n Student = App.Person.extend()\n student = Student.create()\n student.toString() //=> \"<(subclass of App.Person):ember1025>\"\n\n If the method `toStringExtension` is defined, its return value will be\n included in the output.\n\n App.Teacher = App.Person.extend({\n toStringExtension: function(){\n return this.get('fullName');\n }\n });\n teacher = App.Teacher.create()\n teacher.toString(); //=> \"<App.Teacher:ember1026:Tom Dale>\"\n\n @method toString\n @return {String} string representation\n */\n toString: function toString() {\n var hasToStringExtension = typeof this.toStringExtension === 'function',\n extension = hasToStringExtension ? \":\" + this.toStringExtension() : '';\n var ret = '<'+this.constructor.toString()+':'+guidFor(this)+extension+'>';\n this.toString = makeToString(ret);\n return ret;\n }\n});\n\nCoreObject.PrototypeMixin.ownerConstructor = CoreObject;\n\nfunction makeToString(ret) {\n return function() { return ret; };\n}\n\nif (Ember.config.overridePrototypeMixin) {\n Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);\n}\n\nCoreObject.__super__ = null;\n\nvar ClassMixin = Mixin.create({\n\n ClassMixin: Ember.required(),\n\n PrototypeMixin: Ember.required(),\n\n isClass: true,\n\n isMethod: false,\n\n extend: function() {\n var Class = makeCtor(), proto;\n Class.ClassMixin = Mixin.create(this.ClassMixin);\n Class.PrototypeMixin = Mixin.create(this.PrototypeMixin);\n\n Class.ClassMixin.ownerConstructor = Class;\n Class.PrototypeMixin.ownerConstructor = Class;\n\n reopen.apply(Class.PrototypeMixin, arguments);\n\n Class.superclass = this;\n Class.__super__ = this.prototype;\n\n proto = Class.prototype = o_create(this.prototype);\n proto.constructor = Class;\n generateGuid(proto, 'ember');\n meta(proto).proto = proto; // this will disable observers on prototype\n\n Class.ClassMixin.apply(Class);\n return Class;\n },\n\n createWithMixins: function() {\n var C = this;\n if (arguments.length>0) { this._initMixins(arguments); }\n return new C();\n },\n\n create: function() {\n var C = this;\n if (arguments.length>0) { this._initProperties(arguments); }\n return new C();\n },\n\n reopen: function() {\n this.willReopen();\n reopen.apply(this.PrototypeMixin, arguments);\n return this;\n },\n\n reopenClass: function() {\n reopen.apply(this.ClassMixin, arguments);\n applyMixin(this, arguments, false);\n return this;\n },\n\n detect: function(obj) {\n if ('function' !== typeof obj) { return false; }\n while(obj) {\n if (obj===this) { return true; }\n obj = obj.superclass;\n }\n return false;\n },\n\n detectInstance: function(obj) {\n return obj instanceof this;\n },\n\n /**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For\n example, computed property functions may close over variables that are then\n no longer available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```javascript\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n Once you've done this, you can retrieve the values saved to the computed\n property from your class like this:\n\n ```javascript\n MyClass.metaForProperty('person');\n ```\n\n This will return the original hash that was passed to `meta()`.\n\n @method metaForProperty\n @param key {String} property name\n */\n metaForProperty: function(key) {\n var desc = meta(this.proto(), false).descs[key];\n\n Ember.assert(\"metaForProperty() could not find a computed property with key '\"+key+\"'.\", !!desc && desc instanceof Ember.ComputedProperty);\n return desc._meta || {};\n },\n\n /**\n Iterate over each computed property for the class, passing its name\n and any associated metadata (see `metaForProperty`) to the callback.\n\n @method eachComputedProperty\n @param {Function} callback\n @param {Object} binding\n */\n eachComputedProperty: function(callback, binding) {\n var proto = this.proto(),\n descs = meta(proto).descs,\n empty = {},\n property;\n\n for (var name in descs) {\n property = descs[name];\n\n if (property instanceof Ember.ComputedProperty) {\n callback.call(binding || this, name, property._meta || empty);\n }\n }\n }\n\n});\n\nClassMixin.ownerConstructor = CoreObject;\n\nif (Ember.config.overrideClassMixin) {\n Ember.config.overrideClassMixin(ClassMixin);\n}\n\nCoreObject.ClassMixin = ClassMixin;\nClassMixin.apply(CoreObject);\n\n/**\n @class CoreObject\n @namespace Ember\n*/\nEmber.CoreObject = CoreObject;\n\n})();\n//@ sourceURL=ember-runtime/system/core_object");minispade.register('ember-runtime/system/deferred', "(function() {minispade.require(\"ember-runtime/mixins/deferred\");\nminispade.require(\"ember-runtime/system/object\");\n\nvar DeferredMixin = Ember.DeferredMixin, // mixins/deferred\n get = Ember.get;\n\nvar Deferred = Ember.Object.extend(DeferredMixin);\n\nDeferred.reopenClass({\n promise: function(callback, binding) {\n var deferred = Deferred.create();\n callback.call(binding, deferred);\n return get(deferred, 'promise');\n }\n});\n\nEmber.Deferred = Deferred;\n\n})();\n//@ sourceURL=ember-runtime/system/deferred");minispade.register('ember-runtime/system/each_proxy', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/mixins/array');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar set = Ember.set, get = Ember.get, guidFor = Ember.guidFor;\nvar forEach = Ember.EnumerableUtils.forEach;\n\nvar EachArray = Ember.Object.extend(Ember.Array, {\n\n init: function(content, keyName, owner) {\n this._super();\n this._keyName = keyName;\n this._owner = owner;\n this._content = content;\n },\n\n objectAt: function(idx) {\n var item = this._content.objectAt(idx);\n return item && get(item, this._keyName);\n },\n\n length: Ember.computed(function() {\n var content = this._content;\n return content ? get(content, 'length') : 0;\n })\n\n});\n\nvar IS_OBSERVER = /^.+:(before|change)$/;\n\nfunction addObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects, guid;\n if (!objects) objects = proxy._objects = {};\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n // keep track of the index each item was found at so we can map\n // it back when the obj changes.\n guid = guidFor(item);\n if (!objects[guid]) objects[guid] = [];\n objects[guid].push(loc);\n }\n }\n}\n\nfunction removeObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects;\n if (!objects) objects = proxy._objects = {};\n var indicies, guid;\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n guid = guidFor(item);\n indicies = objects[guid];\n indicies[indicies.indexOf(loc)] = null;\n }\n }\n}\n\n/**\n This is the object instance returned when you get the `@each` property on an\n array. It uses the unknownProperty handler to automatically create\n EachArray instances for property names.\n\n @private\n @class EachProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.EachProxy = Ember.Object.extend({\n\n init: function(content) {\n this._super();\n this._content = content;\n content.addArrayObserver(this);\n\n // in case someone is already observing some keys make sure they are\n // added\n forEach(Ember.watchedEvents(this), function(eventName) {\n this.didAddListener(eventName);\n }, this);\n },\n\n /**\n You can directly access mapped properties by simply requesting them.\n The `unknownProperty` handler will generate an EachArray of each item.\n\n @method unknownProperty\n @param keyName {String}\n @param value {anything}\n */\n unknownProperty: function(keyName, value) {\n var ret;\n ret = new EachArray(this._content, keyName, this);\n Ember.defineProperty(this, keyName, null, ret);\n this.beginObservingContentKey(keyName);\n return ret;\n },\n\n // ..........................................................\n // ARRAY CHANGES\n // Invokes whenever the content array itself changes.\n\n arrayWillChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = removedCnt>0 ? idx+removedCnt : -1;\n Ember.beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) removeObserverForContentKey(content, key, this, idx, lim);\n\n Ember.propertyWillChange(this, key);\n }\n\n Ember.propertyWillChange(this._content, '@each');\n Ember.endPropertyChanges(this);\n },\n\n arrayDidChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = addedCnt>0 ? idx+addedCnt : -1;\n Ember.beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) addObserverForContentKey(content, key, this, idx, lim);\n\n Ember.propertyDidChange(this, key);\n }\n\n Ember.propertyDidChange(this._content, '@each');\n Ember.endPropertyChanges(this);\n },\n\n // ..........................................................\n // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS\n // Start monitoring keys based on who is listening...\n\n didAddListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.beginObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n didRemoveListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.stopObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n // ..........................................................\n // CONTENT KEY OBSERVING\n // Actual watch keys on the source content.\n\n beginObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (!keys) keys = this._keys = {};\n if (!keys[keyName]) {\n keys[keyName] = 1;\n var content = this._content,\n len = get(content, 'length');\n addObserverForContentKey(content, keyName, this, 0, len);\n } else {\n keys[keyName]++;\n }\n },\n\n stopObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {\n var content = this._content,\n len = get(content, 'length');\n removeObserverForContentKey(content, keyName, this, 0, len);\n }\n },\n\n contentKeyWillChange: function(obj, keyName) {\n Ember.propertyWillChange(this, keyName);\n },\n\n contentKeyDidChange: function(obj, keyName) {\n Ember.propertyDidChange(this, keyName);\n }\n\n});\n\n\n\n})();\n//@ sourceURL=ember-runtime/system/each_proxy");minispade.register('ember-runtime/system/lazy_load', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar loadHooks = Ember.ENV.EMBER_LOAD_HOOKS || {};\nvar loaded = {};\n\n/**\n@method onLoad\n@for Ember\n@param name {String} name of hook\n@param callback {Function} callback to be called\n*/\nEmber.onLoad = function(name, callback) {\n var object;\n\n loadHooks[name] = loadHooks[name] || Ember.A();\n loadHooks[name].pushObject(callback);\n\n if (object = loaded[name]) {\n callback(object);\n }\n};\n\n/**\n@method runLoadHooks\n@for Ember\n@param name {String} name of hook\n@param object {Object} object to pass to callbacks\n*/\nEmber.runLoadHooks = function(name, object) {\n var hooks;\n\n loaded[name] = object;\n\n if (hooks = loadHooks[name]) {\n loadHooks[name].forEach(function(callback) {\n callback(object);\n });\n }\n};\n\n})();\n//@ sourceURL=ember-runtime/system/lazy_load");minispade.register('ember-runtime/system/namespace', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, indexOf = Ember.ArrayPolyfills.indexOf;\n\n/**\n A Namespace is an object usually used to contain other objects or methods\n such as an application or framework. Create a namespace anytime you want\n to define one of these new containers.\n\n # Example Usage\n\n ```javascript\n MyFramework = Ember.Namespace.create({\n VERSION: '1.0.0'\n });\n ```\n\n @class Namespace\n @namespace Ember\n @extends Ember.Object\n*/\nvar Namespace = Ember.Namespace = Ember.Object.extend({\n isNamespace: true,\n\n init: function() {\n Ember.Namespace.NAMESPACES.push(this);\n Ember.Namespace.PROCESSED = false;\n },\n\n toString: function() {\n var name = get(this, 'name');\n if (name) { return name; }\n\n findNamespaces();\n return this[Ember.GUID_KEY+'_name'];\n },\n\n nameClasses: function() {\n processNamespace([this.toString()], this, {});\n },\n\n destroy: function() {\n var namespaces = Ember.Namespace.NAMESPACES;\n Ember.lookup[this.toString()] = undefined;\n namespaces.splice(indexOf.call(namespaces, this), 1);\n this._super();\n }\n});\n\nNamespace.reopenClass({\n NAMESPACES: [Ember],\n NAMESPACES_BY_ID: {},\n PROCESSED: false,\n processAll: processAllNamespaces,\n byName: function(name) {\n if (!Ember.BOOTED) {\n processAllNamespaces();\n }\n\n return NAMESPACES_BY_ID[name];\n }\n});\n\nvar NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;\n\nvar hasOwnProp = ({}).hasOwnProperty,\n guidFor = Ember.guidFor;\n\nfunction processNamespace(paths, root, seen) {\n var idx = paths.length;\n\n NAMESPACES_BY_ID[paths.join('.')] = root;\n\n // Loop over all of the keys in the namespace, looking for classes\n for(var key in root) {\n if (!hasOwnProp.call(root, key)) { continue; }\n var obj = root[key];\n\n // If we are processing the `Ember` namespace, for example, the\n // `paths` will start with `[\"Ember\"]`. Every iteration through\n // the loop will update the **second** element of this list with\n // the key, so processing `Ember.View` will make the Array\n // `['Ember', 'View']`.\n paths[idx] = key;\n\n // If we have found an unprocessed class\n if (obj && obj.toString === classToString) {\n // Replace the class' `toString` with the dot-separated path\n // and set its `NAME_KEY`\n obj.toString = makeToString(paths.join('.'));\n obj[NAME_KEY] = paths.join('.');\n\n // Support nested namespaces\n } else if (obj && obj.isNamespace) {\n // Skip aliased namespaces\n if (seen[guidFor(obj)]) { continue; }\n seen[guidFor(obj)] = true;\n\n // Process the child namespace\n processNamespace(paths, obj, seen);\n }\n }\n\n paths.length = idx; // cut out last item\n}\n\nfunction findNamespaces() {\n var Namespace = Ember.Namespace, lookup = Ember.lookup, obj, isNamespace;\n\n if (Namespace.PROCESSED) { return; }\n\n for (var prop in lookup) {\n // These don't raise exceptions but can cause warnings\n if (prop === \"parent\" || prop === \"top\" || prop === \"frameElement\") { continue; }\n\n // get(window.globalStorage, 'isNamespace') would try to read the storage for domain isNamespace and cause exception in Firefox.\n // globalStorage is a storage obsoleted by the WhatWG storage specification. See https://developer.mozilla.org/en/DOM/Storage#globalStorage\n if (prop === \"globalStorage\" && lookup.StorageList && lookup.globalStorage instanceof lookup.StorageList) { continue; }\n // Unfortunately, some versions of IE don't support window.hasOwnProperty\n if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }\n\n // At times we are not allowed to access certain properties for security reasons.\n // There are also times where even if we can access them, we are not allowed to access their properties.\n try {\n obj = Ember.lookup[prop];\n isNamespace = obj && obj.isNamespace;\n } catch (e) {\n continue;\n }\n\n if (isNamespace) {\n Ember.deprecate(\"Namespaces should not begin with lowercase.\", /^[A-Z]/.test(prop));\n obj[NAME_KEY] = prop;\n }\n }\n}\n\nvar NAME_KEY = Ember.NAME_KEY = Ember.GUID_KEY + '_name';\n\nfunction superClassString(mixin) {\n var superclass = mixin.superclass;\n if (superclass) {\n if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }\n else { return superClassString(superclass); }\n } else {\n return;\n }\n}\n\nfunction classToString() {\n if (!Ember.BOOTED && !this[NAME_KEY]) {\n processAllNamespaces();\n }\n\n var ret;\n\n if (this[NAME_KEY]) {\n ret = this[NAME_KEY];\n } else {\n var str = superClassString(this);\n if (str) {\n ret = \"(subclass of \" + str + \")\";\n } else {\n ret = \"(unknown mixin)\";\n }\n this.toString = makeToString(ret);\n }\n\n return ret;\n}\n\nfunction processAllNamespaces() {\n var unprocessedNamespaces = !Namespace.PROCESSED,\n unprocessedMixins = Ember.anyUnprocessedMixins;\n\n if (unprocessedNamespaces) {\n findNamespaces();\n Namespace.PROCESSED = true;\n }\n\n if (unprocessedNamespaces || unprocessedMixins) {\n var namespaces = Namespace.NAMESPACES, namespace;\n for (var i=0, l=namespaces.length; i<l; i++) {\n namespace = namespaces[i];\n processNamespace([namespace.toString()], namespace, {});\n }\n\n Ember.anyUnprocessedMixins = false;\n }\n}\n\nfunction makeToString(ret) {\n return function() { return ret; };\n}\n\nEmber.Mixin.prototype.toString = classToString;\n\n})();\n//@ sourceURL=ember-runtime/system/namespace");minispade.register('ember-runtime/system/native_array', "(function() {minispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/mixins/copyable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar get = Ember.get, set = Ember.set;\n\n// Add Ember.Array to Array.prototype. Remove methods with native\n// implementations and supply some more optimized versions of generic methods\n// because they are so common.\nvar NativeArray = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember.Copyable, {\n\n // because length is a built-in property we need to know to just get the\n // original property.\n get: function(key) {\n if (key==='length') return this.length;\n else if ('number' === typeof key) return this[key];\n else return this._super(key);\n },\n\n objectAt: function(idx) {\n return this[idx];\n },\n\n // primitive for array support.\n replace: function(idx, amt, objects) {\n\n if (this.isFrozen) throw Ember.FROZEN_ERROR ;\n\n // if we replaced exactly the same number of items, then pass only the\n // replaced range. Otherwise, pass the full remaining array length\n // since everything has shifted\n var len = objects ? get(objects, 'length') : 0;\n this.arrayContentWillChange(idx, amt, len);\n\n if (!objects || objects.length === 0) {\n this.splice(idx, amt) ;\n } else {\n var args = [idx, amt].concat(objects) ;\n this.splice.apply(this,args) ;\n }\n\n this.arrayContentDidChange(idx, amt, len);\n return this ;\n },\n\n // If you ask for an unknown property, then try to collect the value\n // from member items.\n unknownProperty: function(key, value) {\n var ret;// = this.reducedProperty(key, value) ;\n if ((value !== undefined) && ret === undefined) {\n ret = this[key] = value;\n }\n return ret ;\n },\n\n // If browser did not implement indexOf natively, then override with\n // specialized version\n indexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = 0;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n lastIndexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = len-1;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n copy: function(deep) {\n if (deep) {\n return this.map(function(item){ return Ember.copy(item, true); });\n }\n\n return this.slice();\n }\n});\n\n// Remove any methods implemented natively so we don't override them\nvar ignore = ['length'];\nEmber.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {\n if (Array.prototype[methodName]) ignore.push(methodName);\n});\n\nif (ignore.length>0) {\n NativeArray = NativeArray.without.apply(NativeArray, ignore);\n}\n\n/**\n The NativeArray mixin contains the properties needed to to make the native\n Array support Ember.MutableArray and all of its dependent APIs. Unless you\n have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to\n false, this will be applied automatically. Otherwise you can apply the mixin\n at anytime by calling `Ember.NativeArray.activate`.\n\n @class NativeArray\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.MutableArray\n @uses Ember.MutableEnumerable\n @uses Ember.Copyable\n @uses Ember.Freezable\n*/\nEmber.NativeArray = NativeArray;\n\n/**\n Creates an `Ember.NativeArray` from an Array like object.\n Does not modify the original object.\n\n @method A\n @for Ember\n @return {Ember.NativeArray}\n*/\nEmber.A = function(arr){\n if (arr === undefined) { arr = []; }\n return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);\n};\n\n/**\n Activates the mixin on the Array.prototype if not already applied. Calling\n this method more than once is safe.\n\n @method activate\n @for Ember.NativeArray\n @static\n @return {void}\n*/\nEmber.NativeArray.activate = function() {\n NativeArray.apply(Array.prototype);\n\n Ember.A = function(arr) { return arr || []; };\n};\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n Ember.NativeArray.activate();\n}\n\n\n})();\n//@ sourceURL=ember-runtime/system/native_array");minispade.register('ember-runtime/system/object', "(function() {minispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/system/core_object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.Object` is the main base class for all Ember objects. It is a subclass\n of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,\n see the documentation for each of these.\n\n @class Object\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.Observable\n*/\nEmber.Object = Ember.CoreObject.extend(Ember.Observable);\nEmber.Object.toString = function() { return \"Ember.Object\"; };\n\n})();\n//@ sourceURL=ember-runtime/system/object");minispade.register('ember-runtime/system/object_proxy', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get,\n set = Ember.set,\n fmt = Ember.String.fmt,\n addBeforeObserver = Ember.addBeforeObserver,\n addObserver = Ember.addObserver,\n removeBeforeObserver = Ember.removeBeforeObserver,\n removeObserver = Ember.removeObserver,\n propertyWillChange = Ember.propertyWillChange,\n propertyDidChange = Ember.propertyDidChange;\n\nfunction contentPropertyWillChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyWillChange(this, key);\n}\n\nfunction contentPropertyDidChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyDidChange(this, key);\n}\n\n/**\n `Ember.ObjectProxy` forwards all properties not defined by the proxy itself\n to a proxied `content` object.\n\n ```javascript\n object = Ember.Object.create({\n name: 'Foo'\n });\n\n proxy = Ember.ObjectProxy.create({\n content: object\n });\n\n // Access and change existing properties\n proxy.get('name') // 'Foo'\n proxy.set('name', 'Bar');\n object.get('name') // 'Bar'\n\n // Create new 'description' property on `object`\n proxy.set('description', 'Foo is a whizboo baz');\n object.get('description') // 'Foo is a whizboo baz'\n ```\n\n While `content` is unset, setting a property to be delegated will throw an\n Error.\n\n ```javascript\n proxy = Ember.ObjectProxy.create({\n content: null,\n flag: null\n });\n proxy.set('flag', true);\n proxy.get('flag'); // true\n proxy.get('foo'); // undefined\n proxy.set('foo', 'data'); // throws Error\n ```\n\n Delegated properties can be bound to and will change when content is updated.\n\n Computed properties on the proxy itself can depend on delegated properties.\n\n ```javascript\n ProxyWithComputedProperty = Ember.ObjectProxy.extend({\n fullName: function () {\n var firstName = this.get('firstName'),\n lastName = this.get('lastName');\n if (firstName && lastName) {\n return firstName + ' ' + lastName;\n }\n return firstName || lastName;\n }.property('firstName', 'lastName')\n });\n\n proxy = ProxyWithComputedProperty.create();\n\n proxy.get('fullName'); // undefined\n proxy.set('content', {\n firstName: 'Tom', lastName: 'Dale'\n }); // triggers property change for fullName on proxy\n\n proxy.get('fullName'); // 'Tom Dale'\n ```\n\n @class ObjectProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.ObjectProxy = Ember.Object.extend(\n/** @scope Ember.ObjectProxy.prototype */ {\n /**\n The object whose properties will be forwarded.\n\n @property content\n @type Ember.Object\n @default null\n */\n content: null,\n _contentDidChange: Ember.observer(function() {\n Ember.assert(\"Can't set ObjectProxy's content to itself\", this.get('content') !== this);\n }, 'content'),\n\n isTruthy: Ember.computed.bool('content'),\n\n _debugContainerKey: null,\n\n willWatchProperty: function (key) {\n var contentKey = 'content.' + key;\n addBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n addObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n didUnwatchProperty: function (key) {\n var contentKey = 'content.' + key;\n removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n removeObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n unknownProperty: function (key) {\n var content = get(this, 'content');\n if (content) {\n return get(content, key);\n }\n },\n\n setUnknownProperty: function (key, value) {\n var content = get(this, 'content');\n Ember.assert(fmt(\"Cannot delegate set('%@', %@) to the 'content' property of object proxy %@: its 'content' is undefined.\", [key, value, this]), content);\n return set(content, key, value);\n }\n});\n\nEmber.ObjectProxy.reopenClass({\n create: function () {\n var mixin, prototype, i, l, properties, keyName;\n if (arguments.length) {\n prototype = this.proto();\n for (i = 0, l = arguments.length; i < l; i++) {\n properties = arguments[i];\n for (keyName in properties) {\n if (!properties.hasOwnProperty(keyName) || keyName in prototype) { continue; }\n if (!mixin) mixin = {};\n mixin[keyName] = null;\n }\n }\n if (mixin) this._initMixins([mixin]);\n }\n return this._super.apply(this, arguments);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/system/object_proxy");minispade.register('ember-runtime/system/set', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/freezable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, none = Ember.isNone, fmt = Ember.String.fmt;\n\n/**\n An unordered collection of objects.\n\n A Set works a bit like an array except that its items are not ordered. You\n can create a set to efficiently test for membership for an object. You can\n also iterate through a set just like an array, even accessing objects by\n index, however there is no guarantee as to their order.\n\n All Sets are observable via the Enumerable Observer API - which works\n on any enumerable object including both Sets and Arrays.\n\n ## Creating a Set\n\n You can create a set like you would most objects using\n `new Ember.Set()`. Most new sets you create will be empty, but you can\n also initialize the set with some content by passing an array or other\n enumerable of objects to the constructor.\n\n Finally, you can pass in an existing set and the set will be copied. You\n can also create a copy of a set by calling `Ember.Set#copy()`.\n\n ```javascript\n // creates a new empty set\n var foundNames = new Ember.Set();\n\n // creates a set with four names in it.\n var names = new Ember.Set([\"Charles\", \"Tom\", \"Juan\", \"Alex\"]); // :P\n\n // creates a copy of the names set.\n var namesCopy = new Ember.Set(names);\n\n // same as above.\n var anotherNamesCopy = names.copy();\n ```\n\n ## Adding/Removing Objects\n\n You generally add or remove objects from a set using `add()` or\n `remove()`. You can add any type of object including primitives such as\n numbers, strings, and booleans.\n\n Unlike arrays, objects can only exist one time in a set. If you call `add()`\n on a set with the same object multiple times, the object will only be added\n once. Likewise, calling `remove()` with the same object multiple times will\n remove the object the first time and have no effect on future calls until\n you add the object to the set again.\n\n NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do\n so will be ignored.\n\n In addition to add/remove you can also call `push()`/`pop()`. Push behaves\n just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary\n object, remove it and return it. This is a good way to use a set as a job\n queue when you don't care which order the jobs are executed in.\n\n ## Testing for an Object\n\n To test for an object's presence in a set you simply call\n `Ember.Set#contains()`.\n\n ## Observing changes\n\n When using `Ember.Set`, you can observe the `\"[]\"` property to be\n alerted whenever the content changes. You can also add an enumerable\n observer to the set to be notified of specific objects that are added and\n removed from the set. See `Ember.Enumerable` for more information on\n enumerables.\n\n This is often unhelpful. If you are filtering sets of objects, for instance,\n it is very inefficient to re-filter all of the items each time the set\n changes. It would be better if you could just adjust the filtered set based\n on what was changed on the original set. The same issue applies to merging\n sets, as well.\n\n ## Other Methods\n\n `Ember.Set` primary implements other mixin APIs. For a complete reference\n on the methods you will use with `Ember.Set`, please consult these mixins.\n The most useful ones will be `Ember.Enumerable` and\n `Ember.MutableEnumerable` which implement most of the common iterator\n methods you are used to on Array.\n\n Note that you can also use the `Ember.Copyable` and `Ember.Freezable`\n APIs on `Ember.Set` as well. Once a set is frozen it can no longer be\n modified. The benefit of this is that when you call `frozenCopy()` on it,\n Ember will avoid making copies of the set. This allows you to write\n code that can know with certainty when the underlying set data will or\n will not be modified.\n\n @class Set\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.MutableEnumerable\n @uses Ember.Copyable\n @uses Ember.Freezable\n @since Ember 0.9\n*/\nEmber.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,\n /** @scope Ember.Set.prototype */ {\n\n // ..........................................................\n // IMPLEMENT ENUMERABLE APIS\n //\n\n /**\n This property will change as the number of objects in the set changes.\n\n @property length\n @type number\n @default 0\n */\n length: 0,\n\n /**\n Clears the set. This is useful if you want to reuse an existing set\n without having to recreate it.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.length; // 3\n colors.clear();\n colors.length; // 0\n ```\n\n @method clear\n @return {Ember.Set} An empty Set\n */\n clear: function() {\n if (this.isFrozen) { throw new Error(Ember.FROZEN_ERROR); }\n\n var len = get(this, 'length');\n if (len === 0) { return this; }\n\n var guid;\n\n this.enumerableContentWillChange(len, 0);\n Ember.propertyWillChange(this, 'firstObject');\n Ember.propertyWillChange(this, 'lastObject');\n\n for (var i=0; i < len; i++){\n guid = guidFor(this[i]);\n delete this[guid];\n delete this[i];\n }\n\n set(this, 'length', 0);\n\n Ember.propertyDidChange(this, 'firstObject');\n Ember.propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(len, 0);\n\n return this;\n },\n\n /**\n Returns true if the passed object is also an enumerable that contains the\n same objects as the receiver.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"],\n same_colors = new Ember.Set(colors);\n\n same_colors.isEqual(colors); // true\n same_colors.isEqual([\"purple\", \"brown\"]); // false\n ```\n\n @method isEqual\n @param {Ember.Set} obj the other object.\n @return {Boolean}\n */\n isEqual: function(obj) {\n // fail fast\n if (!Ember.Enumerable.detect(obj)) return false;\n\n var loc = get(this, 'length');\n if (get(obj, 'length') !== loc) return false;\n\n while(--loc >= 0) {\n if (!obj.contains(this[loc])) return false;\n }\n\n return true;\n },\n\n /**\n Adds an object to the set. Only non-`null` objects can be added to a set\n and those can only be added once. If the object is already in the set or\n the passed value is null this method will have no effect.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"red\"); // [\"blue\", \"red\"]\n colors.add(null); // [\"blue\", \"red\"]\n colors.add(undefined); // [\"blue\", \"red\"]\n ```\n\n @method add\n @param {Object} obj The object to add.\n @return {Ember.Set} The set itself.\n */\n add: Ember.aliasMethod('addObject'),\n\n /**\n Removes the object from the set if it is found. If you pass a `null` value\n or an object that is already not in the set, this method will have no\n effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.remove(\"red\"); // [\"blue\", \"green\"]\n colors.remove(\"purple\"); // [\"blue\", \"green\"]\n colors.remove(null); // [\"blue\", \"green\"]\n ```\n\n @method remove\n @param {Object} obj The object to remove\n @return {Ember.Set} The set itself.\n */\n remove: Ember.aliasMethod('removeObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.pop(); // \"blue\"\n colors.pop(); // \"green\"\n colors.pop(); // null\n ```\n\n @method pop\n @return {Object} The removed object from the set or null.\n */\n pop: function() {\n if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);\n var obj = this.length > 0 ? this[this.length-1] : null;\n this.remove(obj);\n return obj;\n },\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.push(\"red\"); // [\"red\"]\n colors.push(\"green\"); // [\"red\", \"green\"]\n colors.push(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method push\n @return {Ember.Set} The set itself.\n */\n push: Ember.aliasMethod('addObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n This is an alias for `Ember.Set.pop()`.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.shift(); // \"blue\"\n colors.shift(); // \"green\"\n colors.shift(); // null\n ```\n\n @method shift\n @return {Object} The removed object from the set or null.\n */\n shift: Ember.aliasMethod('pop'),\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias of `Ember.Set.push()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.unshift(\"red\"); // [\"red\"]\n colors.unshift(\"green\"); // [\"red\", \"green\"]\n colors.unshift(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method unshift\n @return {Ember.Set} The set itself.\n */\n unshift: Ember.aliasMethod('push'),\n\n /**\n Adds each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.addObjects()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.addEach([\"red\", \"green\", \"blue\"]); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method addEach\n @param {Ember.Enumerable} objects the objects to add.\n @return {Ember.Set} The set itself.\n */\n addEach: Ember.aliasMethod('addObjects'),\n\n /**\n Removes each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.removeObjects()`\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.removeEach([\"red\", \"blue\"]); // [\"green\"]\n ```\n\n @method removeEach\n @param {Ember.Enumerable} objects the objects to remove.\n @return {Ember.Set} The set itself.\n */\n removeEach: Ember.aliasMethod('removeObjects'),\n\n // ..........................................................\n // PRIVATE ENUMERABLE SUPPORT\n //\n\n init: function(items) {\n this._super();\n if (items) this.addObjects(items);\n },\n\n // implement Ember.Enumerable\n nextObject: function(idx) {\n return this[idx];\n },\n\n // more optimized version\n firstObject: Ember.computed(function() {\n return this.length > 0 ? this[0] : undefined;\n }),\n\n // more optimized version\n lastObject: Ember.computed(function() {\n return this.length > 0 ? this[this.length-1] : undefined;\n }),\n\n // implements Ember.MutableEnumerable\n addObject: function(obj) {\n if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);\n if (none(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n added ;\n\n if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added\n\n added = [obj];\n\n this.enumerableContentWillChange(null, added);\n Ember.propertyWillChange(this, 'lastObject');\n\n len = get(this, 'length');\n this[guid] = len;\n this[len] = obj;\n set(this, 'length', len+1);\n\n Ember.propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(null, added);\n\n return this;\n },\n\n // implements Ember.MutableEnumerable\n removeObject: function(obj) {\n if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);\n if (none(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n isFirst = idx === 0,\n isLast = idx === len-1,\n last, removed;\n\n\n if (idx>=0 && idx<len && (this[idx] === obj)) {\n removed = [obj];\n\n this.enumerableContentWillChange(removed, null);\n if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }\n if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }\n\n // swap items - basically move the item to the end so it can be removed\n if (idx < len-1) {\n last = this[len-1];\n this[idx] = last;\n this[guidFor(last)] = idx;\n }\n\n delete this[guid];\n delete this[len-1];\n set(this, 'length', len-1);\n\n if (isFirst) { Ember.propertyDidChange(this, 'firstObject'); }\n if (isLast) { Ember.propertyDidChange(this, 'lastObject'); }\n this.enumerableContentDidChange(removed, null);\n }\n\n return this;\n },\n\n // optimized version\n contains: function(obj) {\n return this[guidFor(obj)]>=0;\n },\n\n copy: function() {\n var C = this.constructor, ret = new C(), loc = get(this, 'length');\n set(ret, 'length', loc);\n while(--loc>=0) {\n ret[loc] = this[loc];\n ret[guidFor(this[loc])] = loc;\n }\n return ret;\n },\n\n toString: function() {\n var len = this.length, idx, array = [];\n for(idx = 0; idx < len; idx++) {\n array[idx] = this[idx];\n }\n return fmt(\"Ember.Set<%@>\", [array.join(',')]);\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/system/set");minispade.register('ember-runtime/system/string', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar STRING_DASHERIZE_REGEXP = (/[ _]/g);\nvar STRING_DASHERIZE_CACHE = {};\nvar STRING_DECAMELIZE_REGEXP = (/([a-z])([A-Z])/g);\nvar STRING_CAMELIZE_REGEXP = (/(\\-|_|\\.|\\s)+(.)?/g);\nvar STRING_UNDERSCORE_REGEXP_1 = (/([a-z\\d])([A-Z]+)/g);\nvar STRING_UNDERSCORE_REGEXP_2 = (/\\-|\\s+/g);\n\n/**\n Defines the hash of localized strings for the current language. Used by\n the `Ember.String.loc()` helper. To localize, add string values to this\n hash.\n\n @property STRINGS\n @for Ember\n @type Hash\n*/\nEmber.STRINGS = {};\n\n/**\n Defines string helper methods including string formatting and localization.\n Unless `Ember.EXTEND_PROTOTYPES.String` is `false` these methods will also be\n added to the `String.prototype` as well.\n\n @class String\n @namespace Ember\n @static\n*/\nEmber.String = {\n\n /**\n Apply formatting options to the string. This will look for occurrences\n of \"%@\" in your string and substitute them with the arguments you pass into\n this method. If you want to control the specific order of replacement,\n you can add a number after the key as well to indicate which argument\n you want to insert.\n\n Ordered insertions are most useful when building loc strings where values\n you need to insert may appear in different orders.\n\n ```javascript\n \"Hello %@ %@\".fmt('John', 'Doe'); // \"Hello John Doe\"\n \"Hello %@2, %@1\".fmt('John', 'Doe'); // \"Hello Doe, John\"\n ```\n\n @method fmt\n @param {Object...} [args]\n @return {String} formatted string\n */\n fmt: function(str, formats) {\n // first, replace any ORDERED replacements.\n var idx = 0; // the current index for non-numerical replacements\n return str.replace(/%@([0-9]+)?/g, function(s, argIndex) {\n argIndex = (argIndex) ? parseInt(argIndex,0) - 1 : idx++ ;\n s = formats[argIndex];\n return ((s === null) ? '(null)' : (s === undefined) ? '' : s).toString();\n }) ;\n },\n\n /**\n Formats the passed string, but first looks up the string in the localized\n strings hash. This is a convenient way to localize text. See\n `Ember.String.fmt()` for more information on formatting.\n\n Note that it is traditional but not required to prefix localized string\n keys with an underscore or other character so you can easily identify\n localized strings.\n\n ```javascript\n Ember.STRINGS = {\n '_Hello World': 'Bonjour le monde',\n '_Hello %@ %@': 'Bonjour %@ %@'\n };\n\n Ember.String.loc(\"_Hello World\"); // 'Bonjour le monde';\n Ember.String.loc(\"_Hello %@ %@\", [\"John\", \"Smith\"]); // \"Bonjour John Smith\";\n ```\n\n @method loc\n @param {String} str The string to format\n @param {Array} formats Optional array of parameters to interpolate into string.\n @return {String} formatted string\n */\n loc: function(str, formats) {\n str = Ember.STRINGS[str] || str;\n return Ember.String.fmt(str, formats) ;\n },\n\n /**\n Splits a string into separate units separated by spaces, eliminating any\n empty strings in the process. This is a convenience method for split that\n is mostly useful when applied to the `String.prototype`.\n\n ```javascript\n Ember.String.w(\"alpha beta gamma\").forEach(function(key) {\n console.log(key);\n });\n\n // > alpha\n // > beta\n // > gamma\n ```\n\n @method w\n @param {String} str The string to split\n @return {String} split string\n */\n w: function(str) { return str.split(/\\s+/); },\n\n /**\n Converts a camelized string into all lower case separated by underscores.\n\n ```javascript\n 'innerHTML'.decamelize(); // 'inner_html'\n 'action_name'.decamelize(); // 'action_name'\n 'css-class-name'.decamelize(); // 'css-class-name'\n 'my favorite items'.decamelize(); // 'my favorite items'\n ```\n\n @method decamelize\n @param {String} str The string to decamelize.\n @return {String} the decamelized string.\n */\n decamelize: function(str) {\n return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();\n },\n\n /**\n Replaces underscores or spaces with dashes.\n\n ```javascript\n 'innerHTML'.dasherize(); // 'inner-html'\n 'action_name'.dasherize(); // 'action-name'\n 'css-class-name'.dasherize(); // 'css-class-name'\n 'my favorite items'.dasherize(); // 'my-favorite-items'\n ```\n\n @method dasherize\n @param {String} str The string to dasherize.\n @return {String} the dasherized string.\n */\n dasherize: function(str) {\n var cache = STRING_DASHERIZE_CACHE,\n hit = cache.hasOwnProperty(str),\n ret;\n\n if (hit) {\n return cache[str];\n } else {\n ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');\n cache[str] = ret;\n }\n\n return ret;\n },\n\n /**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.camelize(); // 'innerHTML'\n 'action_name'.camelize(); // 'actionName'\n 'css-class-name'.camelize(); // 'cssClassName'\n 'my favorite items'.camelize(); // 'myFavoriteItems'\n 'My Favorite Items'.camelize(); // 'myFavoriteItems'\n ```\n\n @method camelize\n @param {String} str The string to camelize.\n @return {String} the camelized string.\n */\n camelize: function(str) {\n return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) {\n return chr ? chr.toUpperCase() : '';\n }).replace(/^([A-Z])/, function(match, separator, chr) {\n return match.toLowerCase();\n });\n },\n\n /**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.classify(); // 'InnerHTML'\n 'action_name'.classify(); // 'ActionName'\n 'css-class-name'.classify(); // 'CssClassName'\n 'my favorite items'.classify(); // 'MyFavoriteItems'\n ```\n\n @method classify\n @param {String} str the string to classify\n @return {String} the classified string\n */\n classify: function(str) {\n var parts = str.split(\".\"),\n out = [];\n\n for (var i=0, l=parts.length; i<l; i++) {\n var camelized = Ember.String.camelize(parts[i]);\n out.push(camelized.charAt(0).toUpperCase() + camelized.substr(1));\n }\n\n return out.join(\".\");\n },\n\n /**\n More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n form of a string.\n\n ```javascript\n 'innerHTML'.underscore(); // 'inner_html'\n 'action_name'.underscore(); // 'action_name'\n 'css-class-name'.underscore(); // 'css_class_name'\n 'my favorite items'.underscore(); // 'my_favorite_items'\n ```\n\n @method underscore\n @param {String} str The string to underscore.\n @return {String} the underscored string.\n */\n underscore: function(str) {\n return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').\n replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase();\n },\n\n /**\n Returns the Capitalized form of a string\n\n 'innerHTML'.capitalize() // 'InnerHTML'\n 'action_name'.capitalize() // 'Action_name'\n 'css-class-name'.capitalize() // 'Css-class-name'\n 'my favorite items'.capitalize() // 'My favorite items'\n\n @method capitalize\n @param {String} str\n @return {String}\n */\n capitalize: function(str) {\n return str.charAt(0).toUpperCase() + str.substr(1);\n }\n\n};\n\n})();\n//@ sourceURL=ember-runtime/system/string");minispade.register('ember-states', "(function() {minispade.require('ember-runtime');\n\n/**\nEmber States\n\n@module ember\n@submodule ember-states\n@requires ember-runtime\n*/\nminispade.require('ember-states/state_manager');\nminispade.require('ember-states/state');\n\n})();\n//@ sourceURL=ember-states");minispade.register('ember-states/state', "(function() {var get = Ember.get, set = Ember.set;\n\n/**\n@module ember\n@submodule ember-states\n*/\n\n/**\n @class State\n @namespace Ember\n @extends Ember.Object\n @uses Ember.Evented\n*/\nEmber.State = Ember.Object.extend(Ember.Evented,\n/** @scope Ember.State.prototype */{\n isState: true,\n\n /**\n A reference to the parent state.\n\n @property parentState\n @type Ember.State\n */\n parentState: null,\n start: null,\n\n /**\n The name of this state.\n\n @property name\n @type String\n */\n name: null,\n\n /**\n The full path to this state.\n\n @property path\n @type String\n */\n path: Ember.computed(function() {\n var parentPath = get(this, 'parentState.path'),\n path = get(this, 'name');\n\n if (parentPath) {\n path = parentPath + '.' + path;\n }\n\n return path;\n }),\n\n /**\n @private\n\n Override the default event firing from `Ember.Evented` to\n also call methods with the given name.\n\n @method trigger\n @param name\n */\n trigger: function(name) {\n if (this[name]) {\n this[name].apply(this, [].slice.call(arguments, 1));\n }\n this._super.apply(this, arguments);\n },\n\n init: function() {\n var states = get(this, 'states');\n set(this, 'childStates', Ember.A());\n set(this, 'eventTransitions', get(this, 'eventTransitions') || {});\n\n var name, value, transitionTarget;\n\n // As a convenience, loop over the properties\n // of this state and look for any that are other\n // Ember.State instances or classes, and move them\n // to the `states` hash. This avoids having to\n // create an explicit separate hash.\n\n if (!states) {\n states = {};\n\n for (name in this) {\n if (name === \"constructor\") { continue; }\n\n if (value = this[name]) {\n if (transitionTarget = value.transitionTarget) {\n this.eventTransitions[name] = transitionTarget;\n }\n\n this.setupChild(states, name, value);\n }\n }\n\n set(this, 'states', states);\n } else {\n for (name in states) {\n this.setupChild(states, name, states[name]);\n }\n }\n\n set(this, 'pathsCache', {});\n set(this, 'pathsCacheNoContext', {});\n },\n\n setupChild: function(states, name, value) {\n if (!value) { return false; }\n\n if (value.isState) {\n set(value, 'name', name);\n } else if (Ember.State.detect(value)) {\n value = value.create({\n name: name\n });\n }\n\n if (value.isState) {\n set(value, 'parentState', this);\n get(this, 'childStates').pushObject(value);\n states[name] = value;\n return value;\n }\n },\n\n lookupEventTransition: function(name) {\n var path, state = this;\n\n while(state && !path) {\n path = state.eventTransitions[name];\n state = state.get('parentState');\n }\n\n return path;\n },\n\n /**\n A Boolean value indicating whether the state is a leaf state\n in the state hierarchy. This is `false` if the state has child\n states; otherwise it is true.\n\n @property isLeaf\n @type Boolean\n */\n isLeaf: Ember.computed(function() {\n return !get(this, 'childStates').length;\n }),\n\n /**\n A boolean value indicating whether the state takes a context.\n By default we assume all states take contexts.\n\n @property hasContext\n @default true\n */\n hasContext: true,\n\n /**\n This is the default transition event.\n\n @event setup\n @param {Ember.StateManager} manager\n @param context\n @see Ember.StateManager#transitionEvent\n */\n setup: Ember.K,\n\n /**\n This event fires when the state is entered.\n\n @event enter\n @param {Ember.StateManager} manager\n */\n enter: Ember.K,\n\n /**\n This event fires when the state is exited.\n\n @event exit\n @param {Ember.StateManager} manager\n */\n exit: Ember.K\n});\n\nEmber.State.reopenClass({\n\n /**\n Creates an action function for transitioning to the named state while\n preserving context.\n\n The following example StateManagers are equivalent:\n\n ```javascript\n aManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: Ember.State.transitionTo('stateTwo')\n }),\n stateTwo: Ember.State.create({})\n })\n\n bManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: function(manager, context){\n manager.transitionTo('stateTwo', context)\n }\n }),\n stateTwo: Ember.State.create({})\n })\n ```\n\n @method transitionTo\n @static\n @param {String} target\n */\n\n transitionTo: function(target) {\n\n var transitionFunction = function(stateManager, contextOrEvent) {\n var contexts = [],\n Event = Ember.$ && Ember.$.Event;\n\n if (contextOrEvent && (Event && contextOrEvent instanceof Event)) {\n if (contextOrEvent.hasOwnProperty('contexts')) {\n contexts = contextOrEvent.contexts.slice();\n }\n }\n else {\n contexts = [].slice.call(arguments, 1);\n }\n\n contexts.unshift(target);\n stateManager.transitionTo.apply(stateManager, contexts);\n };\n\n transitionFunction.transitionTarget = target;\n\n return transitionFunction;\n }\n\n});\n\n})();\n//@ sourceURL=ember-states/state");minispade.register('ember-states/state_manager', "(function() {/**\n@module ember\n@submodule ember-states\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\nvar arrayForEach = Ember.ArrayPolyfills.forEach;\nminispade.require('ember-states/state');\n\n/**\n A Transition takes the enter, exit and resolve states and normalizes\n them:\n\n * takes any passed in contexts into consideration\n * adds in `initialState`s\n\n @class Transition\n @private\n*/\nvar Transition = function(raw) {\n this.enterStates = raw.enterStates.slice();\n this.exitStates = raw.exitStates.slice();\n this.resolveState = raw.resolveState;\n\n this.finalState = raw.enterStates[raw.enterStates.length - 1] || raw.resolveState;\n};\n\nTransition.prototype = {\n /**\n Normalize the passed in enter, exit and resolve states.\n\n This process also adds `finalState` and `contexts` to the Transition object.\n\n @method normalize\n @param {Ember.StateManager} manager the state manager running the transition\n @param {Array} contexts a list of contexts passed into `transitionTo`\n */\n normalize: function(manager, contexts) {\n this.matchContextsToStates(contexts);\n this.addInitialStates();\n this.removeUnchangedContexts(manager);\n return this;\n },\n\n /**\n Match each of the contexts passed to `transitionTo` to a state.\n This process may also require adding additional enter and exit\n states if there are more contexts than enter states.\n\n @method matchContextsToStates\n @param {Array} contexts a list of contexts passed into `transitionTo`\n */\n matchContextsToStates: function(contexts) {\n var stateIdx = this.enterStates.length - 1,\n matchedContexts = [],\n state,\n context;\n\n // Next, we will match the passed in contexts to the states they\n // represent.\n //\n // First, assign a context to each enter state in reverse order. If\n // any contexts are left, add a parent state to the list of states\n // to enter and exit, and assign a context to the parent state.\n //\n // If there are still contexts left when the state manager is\n // reached, raise an exception.\n //\n // This allows the following:\n //\n // |- root\n // | |- post\n // | | |- comments\n // | |- about (* current state)\n //\n // For `transitionTo('post.comments', post, post.get('comments')`,\n // the first context (`post`) will be assigned to `root.post`, and\n // the second context (`post.get('comments')`) will be assigned\n // to `root.post.comments`.\n //\n // For the following:\n //\n // |- root\n // | |- post\n // | | |- index (* current state)\n // | | |- comments\n //\n // For `transitionTo('post.comments', otherPost, otherPost.get('comments')`,\n // the `<root.post>` state will be added to the list of enter and exit\n // states because its context has changed.\n\n while (contexts.length > 0) {\n if (stateIdx >= 0) {\n state = this.enterStates[stateIdx--];\n } else {\n if (this.enterStates.length) {\n state = get(this.enterStates[0], 'parentState');\n if (!state) { throw \"Cannot match all contexts to states\"; }\n } else {\n // If re-entering the current state with a context, the resolve\n // state will be the current state.\n state = this.resolveState;\n }\n\n this.enterStates.unshift(state);\n this.exitStates.unshift(state);\n }\n\n // in routers, only states with dynamic segments have a context\n if (get(state, 'hasContext')) {\n context = contexts.pop();\n } else {\n context = null;\n }\n\n matchedContexts.unshift(context);\n }\n\n this.contexts = matchedContexts;\n },\n\n /**\n Add any `initialState`s to the list of enter states.\n\n @method addInitialStates\n */\n addInitialStates: function() {\n var finalState = this.finalState, initialState;\n\n while(true) {\n initialState = get(finalState, 'initialState') || 'start';\n finalState = get(finalState, 'states.' + initialState);\n\n if (!finalState) { break; }\n\n this.finalState = finalState;\n this.enterStates.push(finalState);\n this.contexts.push(undefined);\n }\n },\n\n /**\n Remove any states that were added because the number of contexts\n exceeded the number of explicit enter states, but the context has\n not changed since the last time the state was entered.\n\n @method removeUnchangedContexts\n @param {Ember.StateManager} manager passed in to look up the last\n context for a states\n */\n removeUnchangedContexts: function(manager) {\n // Start from the beginning of the enter states. If the state was added\n // to the list during the context matching phase, make sure the context\n // has actually changed since the last time the state was entered.\n while (this.enterStates.length > 0) {\n if (this.enterStates[0] !== this.exitStates[0]) { break; }\n\n if (this.enterStates.length === this.contexts.length) {\n if (manager.getStateMeta(this.enterStates[0], 'context') !== this.contexts[0]) { break; }\n this.contexts.shift();\n }\n\n this.resolveState = this.enterStates.shift();\n this.exitStates.shift();\n }\n }\n};\n\nvar sendRecursively = function(event, currentState, isUnhandledPass) {\n var log = this.enableLogging,\n eventName = isUnhandledPass ? 'unhandledEvent' : event,\n action = currentState[eventName],\n contexts, sendRecursiveArguments, actionArguments;\n\n contexts = [].slice.call(arguments, 3);\n\n // Test to see if the action is a method that\n // can be invoked. Don't blindly check just for\n // existence, because it is possible the state\n // manager has a child state of the given name,\n // and we should still raise an exception in that\n // case.\n if (typeof action === 'function') {\n if (log) {\n if (isUnhandledPass) {\n Ember.Logger.log(fmt(\"STATEMANAGER: Unhandled event '%@' being sent to state %@.\", [event, get(currentState, 'path')]));\n } else {\n Ember.Logger.log(fmt(\"STATEMANAGER: Sending event '%@' to state %@.\", [event, get(currentState, 'path')]));\n }\n }\n\n actionArguments = contexts;\n if (isUnhandledPass) {\n actionArguments.unshift(event);\n }\n actionArguments.unshift(this);\n\n return action.apply(currentState, actionArguments);\n } else {\n var parentState = get(currentState, 'parentState');\n if (parentState) {\n\n sendRecursiveArguments = contexts;\n sendRecursiveArguments.unshift(event, parentState, isUnhandledPass);\n\n return sendRecursively.apply(this, sendRecursiveArguments);\n } else if (!isUnhandledPass) {\n return sendEvent.call(this, event, contexts, true);\n }\n }\n};\n\nvar sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {\n sendRecursiveArguments.unshift(eventName, get(this, 'currentState'), isUnhandledPass);\n return sendRecursively.apply(this, sendRecursiveArguments);\n};\n\n/**\n StateManager is part of Ember's implementation of a finite state machine. A\n StateManager instance manages a number of properties that are instances of\n `Ember.State`,\n tracks the current active state, and triggers callbacks when states have changed.\n\n ## Defining States\n\n The states of StateManager can be declared in one of two ways. First, you can\n define a `states` property that contains all the states:\n\n ```javascript\n managerA = Ember.StateManager.create({\n states: {\n stateOne: Ember.State.create(),\n stateTwo: Ember.State.create()\n }\n })\n\n managerA.get('states')\n // {\n // stateOne: Ember.State.create(),\n // stateTwo: Ember.State.create()\n // }\n ```\n\n You can also add instances of `Ember.State` (or an `Ember.State` subclass)\n directly as properties of a StateManager. These states will be collected into\n the `states` property for you.\n\n ```javascript\n managerA = Ember.StateManager.create({\n stateOne: Ember.State.create(),\n stateTwo: Ember.State.create()\n })\n\n managerA.get('states')\n // {\n // stateOne: Ember.State.create(),\n // stateTwo: Ember.State.create()\n // }\n ```\n\n ## The Initial State\n\n When created a StateManager instance will immediately enter into the state\n defined as its `start` property or the state referenced by name in its\n `initialState` property:\n\n ```javascript\n managerA = Ember.StateManager.create({\n start: Ember.State.create({})\n })\n\n managerA.get('currentState.name') // 'start'\n\n managerB = Ember.StateManager.create({\n initialState: 'beginHere',\n beginHere: Ember.State.create({})\n })\n\n managerB.get('currentState.name') // 'beginHere'\n ```\n\n Because it is a property you may also provide a computed function if you wish\n to derive an `initialState` programmatically:\n\n ```javascript\n managerC = Ember.StateManager.create({\n initialState: function(){\n if (someLogic) {\n return 'active';\n } else {\n return 'passive';\n }\n }.property(),\n active: Ember.State.create({}),\n passive: Ember.State.create({})\n })\n ```\n\n ## Moving Between States\n\n A StateManager can have any number of `Ember.State` objects as properties\n and can have a single one of these states as its current state.\n\n Calling `transitionTo` transitions between states:\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({}),\n poweredUp: Ember.State.create({})\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n robotManager.transitionTo('poweredUp')\n robotManager.get('currentState.name') // 'poweredUp'\n ```\n\n Before transitioning into a new state the existing `currentState` will have\n its `exit` method called with the StateManager instance as its first argument\n and an object representing the transition as its second argument.\n\n After transitioning into a new state the new `currentState` will have its\n `enter` method called with the StateManager instance as its first argument\n and an object representing the transition as its second argument.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n exit: function(stateManager){\n console.log(\"exiting the poweredDown state\")\n }\n }),\n poweredUp: Ember.State.create({\n enter: function(stateManager){\n console.log(\"entering the poweredUp state. Destroy all humans.\")\n }\n })\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n robotManager.transitionTo('poweredUp')\n\n // will log\n // 'exiting the poweredDown state'\n // 'entering the poweredUp state. Destroy all humans.'\n ```\n\n Once a StateManager is already in a state, subsequent attempts to enter that\n state will not trigger enter or exit method calls. Attempts to transition\n into a state that the manager does not have will result in no changes in the\n StateManager's current state:\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n exit: function(stateManager){\n console.log(\"exiting the poweredDown state\")\n }\n }),\n poweredUp: Ember.State.create({\n enter: function(stateManager){\n console.log(\"entering the poweredUp state. Destroy all humans.\")\n }\n })\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n robotManager.transitionTo('poweredUp')\n // will log\n // 'exiting the poweredDown state'\n // 'entering the poweredUp state. Destroy all humans.'\n robotManager.transitionTo('poweredUp') // no logging, no state change\n\n robotManager.transitionTo('someUnknownState') // silently fails\n robotManager.get('currentState.name') // 'poweredUp'\n ```\n\n Each state property may itself contain properties that are instances of\n `Ember.State`. The StateManager can transition to specific sub-states in a\n series of transitionTo method calls or via a single transitionTo with the\n full path to the specific state. The StateManager will also keep track of the\n full path to its currentState\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n charging: Ember.State.create(),\n charged: Ember.State.create()\n }),\n poweredUp: Ember.State.create({\n mobile: Ember.State.create(),\n stationary: Ember.State.create()\n })\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n\n robotManager.transitionTo('poweredUp')\n robotManager.get('currentState.name') // 'poweredUp'\n\n robotManager.transitionTo('mobile')\n robotManager.get('currentState.name') // 'mobile'\n\n // transition via a state path\n robotManager.transitionTo('poweredDown.charging')\n robotManager.get('currentState.name') // 'charging'\n\n robotManager.get('currentState.path') // 'poweredDown.charging'\n ```\n\n Enter transition methods will be called for each state and nested child state\n in their hierarchical order. Exit methods will be called for each state and\n its nested states in reverse hierarchical order.\n\n Exit transitions for a parent state are not called when entering into one of\n its child states, only when transitioning to a new section of possible states\n in the hierarchy.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n enter: function(){},\n exit: function(){\n console.log(\"exited poweredDown state\")\n },\n charging: Ember.State.create({\n enter: function(){},\n exit: function(){}\n }),\n charged: Ember.State.create({\n enter: function(){\n console.log(\"entered charged state\")\n },\n exit: function(){\n console.log(\"exited charged state\")\n }\n })\n }),\n poweredUp: Ember.State.create({\n enter: function(){\n console.log(\"entered poweredUp state\")\n },\n exit: function(){},\n mobile: Ember.State.create({\n enter: function(){\n console.log(\"entered mobile state\")\n },\n exit: function(){}\n }),\n stationary: Ember.State.create({\n enter: function(){},\n exit: function(){}\n })\n })\n })\n\n\n robotManager.get('currentState.path') // 'poweredDown'\n robotManager.transitionTo('charged')\n // logs 'entered charged state'\n // but does *not* log 'exited poweredDown state'\n robotManager.get('currentState.name') // 'charged\n\n robotManager.transitionTo('poweredUp.mobile')\n // logs\n // 'exited charged state'\n // 'exited poweredDown state'\n // 'entered poweredUp state'\n // 'entered mobile state'\n ```\n\n During development you can set a StateManager's `enableLogging` property to\n `true` to receive console messages of state transitions.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n enableLogging: true\n })\n ```\n\n ## Managing currentState with Actions\n\n To control which transitions are possible for a given state, and\n appropriately handle external events, the StateManager can receive and\n route action messages to its states via the `send` method. Calling to\n `send` with an action name will begin searching for a method with the same\n name starting at the current state and moving up through the parent states\n in a state hierarchy until an appropriate method is found or the StateManager\n instance itself is reached.\n\n If an appropriately named method is found it will be called with the state\n manager as the first argument and an optional `context` object as the second\n argument.\n\n ```javascript\n managerA = Ember.StateManager.create({\n initialState: 'stateOne.substateOne.subsubstateOne',\n stateOne: Ember.State.create({\n substateOne: Ember.State.create({\n anAction: function(manager, context){\n console.log(\"an action was called\")\n },\n subsubstateOne: Ember.State.create({})\n })\n })\n })\n\n managerA.get('currentState.name') // 'subsubstateOne'\n managerA.send('anAction')\n // 'stateOne.substateOne.subsubstateOne' has no anAction method\n // so the 'anAction' method of 'stateOne.substateOne' is called\n // and logs \"an action was called\"\n // with managerA as the first argument\n // and no second argument\n\n someObject = {}\n managerA.send('anAction', someObject)\n // the 'anAction' method of 'stateOne.substateOne' is called again\n // with managerA as the first argument and\n // someObject as the second argument.\n ```\n\n If the StateManager attempts to send an action but does not find an appropriately named\n method in the current state or while moving upwards through the state hierarchy, it will\n repeat the process looking for a `unhandledEvent` method. If an `unhandledEvent` method is\n found, it will be called with the original event name as the second argument. If an\n `unhandledEvent` method is not found, the StateManager will throw a new Ember.Error.\n\n ```javascript\n managerB = Ember.StateManager.create({\n initialState: 'stateOne.substateOne.subsubstateOne',\n stateOne: Ember.State.create({\n substateOne: Ember.State.create({\n subsubstateOne: Ember.State.create({}),\n unhandledEvent: function(manager, eventName, context) {\n console.log(\"got an unhandledEvent with name \" + eventName);\n }\n })\n })\n })\n\n managerB.get('currentState.name') // 'subsubstateOne'\n managerB.send('anAction')\n // neither `stateOne.substateOne.subsubstateOne` nor any of it's\n // parent states have a handler for `anAction`. `subsubstateOne`\n // also does not have a `unhandledEvent` method, but its parent\n // state, `substateOne`, does, and it gets fired. It will log\n // \"got an unhandledEvent with name anAction\"\n ```\n\n Action detection only moves upwards through the state hierarchy from the current state.\n It does not search in other portions of the hierarchy.\n\n ```javascript\n managerC = Ember.StateManager.create({\n initialState: 'stateOne.substateOne.subsubstateOne',\n stateOne: Ember.State.create({\n substateOne: Ember.State.create({\n subsubstateOne: Ember.State.create({})\n })\n }),\n stateTwo: Ember.State.create({\n anAction: function(manager, context){\n // will not be called below because it is\n // not a parent of the current state\n }\n })\n })\n\n managerC.get('currentState.name') // 'subsubstateOne'\n managerC.send('anAction')\n // Error: <Ember.StateManager:ember132> could not\n // respond to event anAction in state stateOne.substateOne.subsubstateOne.\n ```\n\n Inside of an action method the given state should delegate `transitionTo` calls on its\n StateManager.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown.charging',\n poweredDown: Ember.State.create({\n charging: Ember.State.create({\n chargeComplete: function(manager, context){\n manager.transitionTo('charged')\n }\n }),\n charged: Ember.State.create({\n boot: function(manager, context){\n manager.transitionTo('poweredUp')\n }\n })\n }),\n poweredUp: Ember.State.create({\n beginExtermination: function(manager, context){\n manager.transitionTo('rampaging')\n },\n rampaging: Ember.State.create()\n })\n })\n\n robotManager.get('currentState.name') // 'charging'\n robotManager.send('boot') // throws error, no boot action\n // in current hierarchy\n robotManager.get('currentState.name') // remains 'charging'\n\n robotManager.send('beginExtermination') // throws error, no beginExtermination\n // action in current hierarchy\n robotManager.get('currentState.name') // remains 'charging'\n\n robotManager.send('chargeComplete')\n robotManager.get('currentState.name') // 'charged'\n\n robotManager.send('boot')\n robotManager.get('currentState.name') // 'poweredUp'\n\n robotManager.send('beginExtermination', allHumans)\n robotManager.get('currentState.name') // 'rampaging'\n ```\n\n Transition actions can also be created using the `transitionTo` method of the `Ember.State` class. The\n following example StateManagers are equivalent:\n\n ```javascript\n aManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: Ember.State.transitionTo('stateTwo')\n }),\n stateTwo: Ember.State.create({})\n })\n\n bManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: function(manager, context){\n manager.transitionTo('stateTwo', context)\n }\n }),\n stateTwo: Ember.State.create({})\n })\n ```\n\n @class StateManager\n @namespace Ember\n @extends Ember.State\n**/\nEmber.StateManager = Ember.State.extend({\n /**\n @private\n\n When creating a new statemanager, look for a default state to transition\n into. This state can either be named `start`, or can be specified using the\n `initialState` property.\n\n @method init\n */\n init: function() {\n this._super();\n\n set(this, 'stateMeta', Ember.Map.create());\n\n var initialState = get(this, 'initialState');\n\n if (!initialState && get(this, 'states.start')) {\n initialState = 'start';\n }\n\n if (initialState) {\n this.transitionTo(initialState);\n Ember.assert('Failed to transition to initial state \"' + initialState + '\"', !!get(this, 'currentState'));\n }\n },\n\n stateMetaFor: function(state) {\n var meta = get(this, 'stateMeta'),\n stateMeta = meta.get(state);\n\n if (!stateMeta) {\n stateMeta = {};\n meta.set(state, stateMeta);\n }\n\n return stateMeta;\n },\n\n setStateMeta: function(state, key, value) {\n return set(this.stateMetaFor(state), key, value);\n },\n\n getStateMeta: function(state, key) {\n return get(this.stateMetaFor(state), key);\n },\n\n /**\n The current state from among the manager's possible states. This property should\n not be set directly. Use `transitionTo` to move between states by name.\n\n @property currentState\n @type Ember.State\n */\n currentState: null,\n\n /**\n The path of the current state. Returns a string representation of the current\n state.\n\n @property currentPath\n @type String\n */\n currentPath: Ember.computed.alias('currentState.path'),\n\n /**\n The name of transitionEvent that this stateManager will dispatch\n\n @property transitionEvent\n @type String\n @default 'setup'\n */\n transitionEvent: 'setup',\n\n /**\n If set to true, `errorOnUnhandledEvents` will cause an exception to be\n raised if you attempt to send an event to a state manager that is not\n handled by the current state or any of its parent states.\n\n @property errorOnUnhandledEvents\n @type Boolean\n @default true\n */\n errorOnUnhandledEvent: true,\n\n send: function(event) {\n var contexts = [].slice.call(arguments, 1);\n Ember.assert('Cannot send event \"' + event + '\" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));\n return sendEvent.call(this, event, contexts, false);\n },\n unhandledEvent: function(manager, event) {\n if (get(this, 'errorOnUnhandledEvent')) {\n throw new Ember.Error(this.toString() + \" could not respond to event \" + event + \" in state \" + get(this, 'currentState.path') + \".\");\n }\n },\n\n /**\n Finds a state by its state path.\n\n Example:\n\n ```javascript\n manager = Ember.StateManager.create({\n root: Ember.State.create({\n dashboard: Ember.State.create()\n })\n });\n\n manager.getStateByPath(manager, \"root.dashboard\")\n\n // returns the dashboard state\n ```\n\n @method getStateByPath\n @param {Ember.State} root the state to start searching from\n @param {String} path the state path to follow\n @return {Ember.State} the state at the end of the path\n */\n getStateByPath: function(root, path) {\n var parts = path.split('.'),\n state = root;\n\n for (var i=0, len=parts.length; i<len; i++) {\n state = get(get(state, 'states'), parts[i]);\n if (!state) { break; }\n }\n\n return state;\n },\n\n findStateByPath: function(state, path) {\n var possible;\n\n while (!possible && state) {\n possible = this.getStateByPath(state, path);\n state = get(state, 'parentState');\n }\n\n return possible;\n },\n\n /**\n A state stores its child states in its `states` hash.\n This code takes a path like `posts.show` and looks\n up `root.states.posts.states.show`.\n\n It returns a list of all of the states from the\n root, which is the list of states to call `enter`\n on.\n\n @method getStatesInPath\n @param root\n @param path\n */\n getStatesInPath: function(root, path) {\n if (!path || path === \"\") { return undefined; }\n var parts = path.split('.'),\n result = [],\n states,\n state;\n\n for (var i=0, len=parts.length; i<len; i++) {\n states = get(root, 'states');\n if (!states) { return undefined; }\n state = get(states, parts[i]);\n if (state) { root = state; result.push(state); }\n else { return undefined; }\n }\n\n return result;\n },\n\n goToState: function() {\n // not deprecating this yet so people don't constantly need to\n // make trivial changes for little reason.\n return this.transitionTo.apply(this, arguments);\n },\n\n transitionTo: function(path, context) {\n // XXX When is transitionTo called with no path\n if (Ember.isEmpty(path)) { return; }\n\n // The ES6 signature of this function is `path, ...contexts`\n var contexts = context ? Array.prototype.slice.call(arguments, 1) : [],\n currentState = get(this, 'currentState') || this;\n\n // First, get the enter, exit and resolve states for the current state\n // and specified path. If possible, use an existing cache.\n var hash = this.contextFreeTransition(currentState, path);\n\n // Next, process the raw state information for the contexts passed in.\n var transition = new Transition(hash).normalize(this, contexts);\n\n this.enterState(transition);\n this.triggerSetupContext(transition);\n },\n\n contextFreeTransition: function(currentState, path) {\n var cache = currentState.pathsCache[path];\n if (cache) { return cache; }\n\n var enterStates = this.getStatesInPath(currentState, path),\n exitStates = [],\n resolveState = currentState;\n\n // Walk up the states. For each state, check whether a state matching\n // the `path` is nested underneath. This will find the closest\n // parent state containing `path`.\n //\n // This allows the user to pass in a relative path. For example, for\n // the following state hierarchy:\n //\n // | |root\n // | |- posts\n // | | |- show (* current)\n // | |- comments\n // | | |- show\n //\n // If the current state is `<root.posts.show>`, an attempt to\n // transition to `comments.show` will match `<root.comments.show>`.\n //\n // First, this code will look for root.posts.show.comments.show.\n // Next, it will look for root.posts.comments.show. Finally,\n // it will look for `root.comments.show`, and find the state.\n //\n // After this process, the following variables will exist:\n //\n // * resolveState: a common parent state between the current\n // and target state. In the above example, `<root>` is the\n // `resolveState`.\n // * enterStates: a list of all of the states represented\n // by the path from the `resolveState`. For example, for\n // the path `root.comments.show`, `enterStates` would have\n // `[<root.comments>, <root.comments.show>]`\n // * exitStates: a list of all of the states from the\n // `resolveState` to the `currentState`. In the above\n // example, `exitStates` would have\n // `[<root.posts>`, `<root.posts.show>]`.\n while (resolveState && !enterStates) {\n exitStates.unshift(resolveState);\n\n resolveState = get(resolveState, 'parentState');\n if (!resolveState) {\n enterStates = this.getStatesInPath(this, path);\n if (!enterStates) {\n Ember.assert('Could not find state for path: \"'+path+'\"');\n return;\n }\n }\n enterStates = this.getStatesInPath(resolveState, path);\n }\n\n // If the path contains some states that are parents of both the\n // current state and the target state, remove them.\n //\n // For example, in the following hierarchy:\n //\n // |- root\n // | |- post\n // | | |- index (* current)\n // | | |- show\n //\n // If the `path` is `root.post.show`, the three variables will\n // be:\n //\n // * resolveState: `<state manager>`\n // * enterStates: `[<root>, <root.post>, <root.post.show>]`\n // * exitStates: `[<root>, <root.post>, <root.post.index>]`\n //\n // The goal of this code is to remove the common states, so we\n // have:\n //\n // * resolveState: `<root.post>`\n // * enterStates: `[<root.post.show>]`\n // * exitStates: `[<root.post.index>]`\n //\n // This avoid unnecessary calls to the enter and exit transitions.\n while (enterStates.length > 0 && enterStates[0] === exitStates[0]) {\n resolveState = enterStates.shift();\n exitStates.shift();\n }\n\n // Cache the enterStates, exitStates, and resolveState for the\n // current state and the `path`.\n var transitions = currentState.pathsCache[path] = {\n exitStates: exitStates,\n enterStates: enterStates,\n resolveState: resolveState\n };\n\n return transitions;\n },\n\n triggerSetupContext: function(transitions) {\n var contexts = transitions.contexts,\n offset = transitions.enterStates.length - contexts.length,\n enterStates = transitions.enterStates,\n transitionEvent = get(this, 'transitionEvent');\n\n Ember.assert(\"More contexts provided than states\", offset >= 0);\n\n arrayForEach.call(enterStates, function(state, idx) {\n state.trigger(transitionEvent, this, contexts[idx-offset]);\n }, this);\n },\n\n getState: function(name) {\n var state = get(this, name),\n parentState = get(this, 'parentState');\n\n if (state) {\n return state;\n } else if (parentState) {\n return parentState.getState(name);\n }\n },\n\n enterState: function(transition) {\n var log = this.enableLogging;\n\n var exitStates = transition.exitStates.slice(0).reverse();\n arrayForEach.call(exitStates, function(state) {\n state.trigger('exit', this);\n }, this);\n\n arrayForEach.call(transition.enterStates, function(state) {\n if (log) { Ember.Logger.log(\"STATEMANAGER: Entering \" + get(state, 'path')); }\n state.trigger('enter', this);\n }, this);\n\n set(this, 'currentState', transition.finalState);\n }\n});\n\n})();\n//@ sourceURL=ember-states/state_manager");minispade.register('ember-views/core', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar jQuery = Ember.imports.jQuery;\nEmber.assert(\"Ember Views require jQuery 1.8 or 1.9\", jQuery && (jQuery().jquery.match(/^1\\.(8|9)(\\.\\d+)?(pre|rc\\d?)?/) || Ember.ENV.FORCE_JQUERY));\n\n/**\n Alias for jQuery\n\n @method $\n @for Ember\n*/\nEmber.$ = jQuery;\n\n})();\n//@ sourceURL=ember-views/core");minispade.register('ember-views', "(function() {/*globals jQuery*/\nminispade.require(\"ember-runtime\");\nminispade.require(\"container\");\n\n/**\nEmber Views\n\n@module ember\n@submodule ember-views\n@requires ember-runtime\n@main ember-views\n*/\nminispade.require(\"ember-views/core\");\nminispade.require(\"ember-views/system\");\nminispade.require(\"ember-views/views\");\n\n})();\n//@ sourceURL=ember-views");minispade.register('ember-views/system', "(function() {minispade.require(\"ember-views/system/jquery_ext\");\nminispade.require(\"ember-views/system/utils\");\nminispade.require(\"ember-views/system/render_buffer\");\nminispade.require(\"ember-views/system/event_dispatcher\");\nminispade.require(\"ember-views/system/ext\");\nminispade.require(\"ember-views/system/controller\");\n\n})();\n//@ sourceURL=ember-views/system");minispade.register('ember-views/system/controller', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n// Original class declaration and documentation in runtime/lib/controllers/controller.js\n// NOTE: It may be possible with YUIDoc to combine docs in two locations\n\n/**\nAdditional methods for the ControllerMixin\n\n@class ControllerMixin\n@namespace Ember\n*/\nEmber.ControllerMixin.reopen({\n target: null,\n namespace: null,\n view: null,\n container: null,\n _childContainers: null,\n\n init: function() {\n this._super();\n set(this, '_childContainers', {});\n },\n\n _modelDidChange: Ember.observer(function() {\n var containers = get(this, '_childContainers');\n\n for (var prop in containers) {\n if (!containers.hasOwnProperty(prop)) { continue; }\n containers[prop].destroy();\n }\n\n set(this, '_childContainers', {});\n }, 'model')\n});\n\n})();\n//@ sourceURL=ember-views/system/controller");minispade.register('ember-views/system/event_dispatcher', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.EventDispatcher` handles delegating browser events to their\n corresponding `Ember.Views.` For example, when you click on a view,\n `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets\n called.\n\n @class EventDispatcher\n @namespace Ember\n @private\n @extends Ember.Object\n*/\nEmber.EventDispatcher = Ember.Object.extend(\n/** @scope Ember.EventDispatcher.prototype */{\n\n /**\n @private\n\n The root DOM element to which event listeners should be attached. Event\n listeners will be attached to the document unless this is overridden.\n\n Can be specified as a DOMElement or a selector string.\n\n The default body is a string since this may be evaluated before document.body\n exists in the DOM.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n @private\n\n Sets up event listeners for standard browser events.\n\n This will be called after the browser sends a `DOMContentReady` event. By\n default, it will set up all of the listeners on the document body. If you\n would like to register the listeners on a different element, set the event\n dispatcher's `root` property.\n\n @method setup\n @param addedEvents {Hash}\n */\n setup: function(addedEvents) {\n var event, events = {\n touchstart : 'touchStart',\n touchmove : 'touchMove',\n touchend : 'touchEnd',\n touchcancel : 'touchCancel',\n keydown : 'keyDown',\n keyup : 'keyUp',\n keypress : 'keyPress',\n mousedown : 'mouseDown',\n mouseup : 'mouseUp',\n contextmenu : 'contextMenu',\n click : 'click',\n dblclick : 'doubleClick',\n mousemove : 'mouseMove',\n focusin : 'focusIn',\n focusout : 'focusOut',\n mouseenter : 'mouseEnter',\n mouseleave : 'mouseLeave',\n submit : 'submit',\n input : 'input',\n change : 'change',\n dragstart : 'dragStart',\n drag : 'drag',\n dragenter : 'dragEnter',\n dragleave : 'dragLeave',\n dragover : 'dragOver',\n drop : 'drop',\n dragend : 'dragEnd'\n };\n\n Ember.$.extend(events, addedEvents || {});\n\n var rootElement = Ember.$(get(this, 'rootElement'));\n\n Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));\n Ember.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length);\n Ember.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length);\n\n rootElement.addClass('ember-application');\n\n Ember.assert('Unable to add \"ember-application\" class to rootElement. Make sure you set rootElement to the body or an element in the body.', rootElement.is('.ember-application'));\n\n for (event in events) {\n if (events.hasOwnProperty(event)) {\n this.setupHandler(rootElement, event, events[event]);\n }\n }\n },\n\n /**\n @private\n\n Registers an event listener on the document. If the given event is\n triggered, the provided event handler will be triggered on the target view.\n\n If the target view does not implement the event handler, or if the handler\n returns `false`, the parent view will be called. The event will continue to\n bubble to each successive parent view until it reaches the top.\n\n For example, to have the `mouseDown` method called on the target view when\n a `mousedown` event is received from the browser, do the following:\n\n ```javascript\n setupHandler('mousedown', 'mouseDown');\n ```\n\n @method setupHandler\n @param {Element} rootElement\n @param {String} event the browser-originated event to listen to\n @param {String} eventName the name of the method to call on the view\n */\n setupHandler: function(rootElement, event, eventName) {\n var self = this;\n\n rootElement.delegate('.ember-view', event + '.ember', function(evt, triggeringManager) {\n return Ember.handleErrors(function() {\n var view = Ember.View.views[this.id],\n result = true, manager = null;\n\n manager = self._findNearestEventManager(view,eventName);\n\n if (manager && manager !== triggeringManager) {\n result = self._dispatchEvent(manager, evt, eventName, view);\n } else if (view) {\n result = self._bubbleEvent(view,evt,eventName);\n } else {\n evt.stopPropagation();\n }\n\n return result;\n }, this);\n });\n\n rootElement.delegate('[data-ember-action]', event + '.ember', function(evt) {\n return Ember.handleErrors(function() {\n var actionId = Ember.$(evt.currentTarget).attr('data-ember-action'),\n action = Ember.Handlebars.ActionHelper.registeredActions[actionId];\n\n // We have to check for action here since in some cases, jQuery will trigger\n // an event on `removeChild` (i.e. focusout) after we've already torn down the\n // action handlers for the view.\n if (action && action.eventName === eventName) {\n return action.handler(evt);\n }\n }, this);\n });\n },\n\n _findNearestEventManager: function(view, eventName) {\n var manager = null;\n\n while (view) {\n manager = get(view, 'eventManager');\n if (manager && manager[eventName]) { break; }\n\n view = get(view, 'parentView');\n }\n\n return manager;\n },\n\n _dispatchEvent: function(object, evt, eventName, view) {\n var result = true;\n\n var handler = object[eventName];\n if (Ember.typeOf(handler) === 'function') {\n result = handler.call(object, evt, view);\n // Do not preventDefault in eventManagers.\n evt.stopPropagation();\n }\n else {\n result = this._bubbleEvent(view, evt, eventName);\n }\n\n return result;\n },\n\n _bubbleEvent: function(view, evt, eventName) {\n return Ember.run(function() {\n return view.handleEvent(eventName, evt);\n });\n },\n\n destroy: function() {\n var rootElement = get(this, 'rootElement');\n Ember.$(rootElement).undelegate('.ember').removeClass('ember-application');\n return this._super();\n }\n});\n\n})();\n//@ sourceURL=ember-views/system/event_dispatcher");minispade.register('ember-views/system/ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n// Add a new named queue for rendering views that happens\n// after bindings have synced, and a queue for scheduling actions\n// that that should occur after view rendering.\nvar queues = Ember.run.queues,\n indexOf = Ember.ArrayPolyfills.indexOf;\nqueues.splice(indexOf.call(queues, 'actions')+1, 0, 'render', 'afterRender');\n\n})();\n//@ sourceURL=ember-views/system/ext");minispade.register('ember-views/system/jquery_ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\nif (Ember.$) {\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents\n var dragEvents = Ember.String.w('dragstart drag dragenter dragleave dragover drop dragend');\n\n // Copies the `dataTransfer` property from a browser event object onto the\n // jQuery event object for the specified events\n Ember.EnumerableUtils.forEach(dragEvents, function(eventName) {\n Ember.$.event.fixHooks[eventName] = { props: ['dataTransfer'] };\n });\n}\n\n})();\n//@ sourceURL=ember-views/system/jquery_ext");minispade.register('ember-views/system/render_buffer', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar ClassSet = function() {\n this.seen = {};\n this.list = [];\n};\n\nClassSet.prototype = {\n add: function(string) {\n if (string in this.seen) { return; }\n this.seen[string] = true;\n\n this.list.push(string);\n },\n\n toDOM: function() {\n return this.list.join(\" \");\n }\n};\n\n/**\n `Ember.RenderBuffer` gathers information regarding the a view and generates the\n final representation. `Ember.RenderBuffer` will generate HTML which can be pushed\n to the DOM.\n\n @class RenderBuffer\n @namespace Ember\n @constructor\n*/\nEmber.RenderBuffer = function(tagName) {\n return new Ember._RenderBuffer(tagName);\n};\n\nEmber._RenderBuffer = function(tagName) {\n this.tagNames = [tagName || null];\n this.buffer = [];\n};\n\nEmber._RenderBuffer.prototype =\n/** @scope Ember.RenderBuffer.prototype */ {\n\n // The root view's element\n _element: null,\n\n /**\n @private\n\n An internal set used to de-dupe class names when `addClass()` is\n used. After each call to `addClass()`, the `classes` property\n will be updated.\n\n @property elementClasses\n @type Array\n @default []\n */\n elementClasses: null,\n\n /**\n Array of class names which will be applied in the class attribute.\n\n You can use `setClasses()` to set this property directly. If you\n use `addClass()`, it will be maintained for you.\n\n @property classes\n @type Array\n @default []\n */\n classes: null,\n\n /**\n The id in of the element, to be applied in the id attribute.\n\n You should not set this property yourself, rather, you should use\n the `id()` method of `Ember.RenderBuffer`.\n\n @property elementId\n @type String\n @default null\n */\n elementId: null,\n\n /**\n A hash keyed on the name of the attribute and whose value will be\n applied to that attribute. For example, if you wanted to apply a\n `data-view=\"Foo.bar\"` property to an element, you would set the\n elementAttributes hash to `{'data-view':'Foo.bar'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `attr()` method of `Ember.RenderBuffer`.\n\n @property elementAttributes\n @type Hash\n @default {}\n */\n elementAttributes: null,\n\n /**\n A hash keyed on the name of the properties and whose value will be\n applied to that property. For example, if you wanted to apply a\n `checked=true` property to an element, you would set the\n elementProperties hash to `{'checked':true}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `prop()` method of `Ember.RenderBuffer`.\n\n @property elementProperties\n @type Hash\n @default {}\n */\n elementProperties: null,\n\n /**\n The tagname of the element an instance of `Ember.RenderBuffer` represents.\n\n Usually, this gets set as the first parameter to `Ember.RenderBuffer`. For\n example, if you wanted to create a `p` tag, then you would call\n\n ```javascript\n Ember.RenderBuffer('p')\n ```\n\n @property elementTag\n @type String\n @default null\n */\n elementTag: null,\n\n /**\n A hash keyed on the name of the style attribute and whose value will\n be applied to that attribute. For example, if you wanted to apply a\n `background-color:black;` style to an element, you would set the\n elementStyle hash to `{'background-color':'black'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `style()` method of `Ember.RenderBuffer`.\n\n @property elementStyle\n @type Hash\n @default {}\n */\n elementStyle: null,\n\n /**\n Nested `RenderBuffers` will set this to their parent `RenderBuffer`\n instance.\n\n @property parentBuffer\n @type Ember._RenderBuffer\n */\n parentBuffer: null,\n\n /**\n Adds a string of HTML to the `RenderBuffer`.\n\n @method push\n @param {String} string HTML to push into the buffer\n @chainable\n */\n push: function(string) {\n this.buffer.push(string);\n return this;\n },\n\n /**\n Adds a class to the buffer, which will be rendered to the class attribute.\n\n @method addClass\n @param {String} className Class name to add to the buffer\n @chainable\n */\n addClass: function(className) {\n // lazily create elementClasses\n this.elementClasses = (this.elementClasses || new ClassSet());\n this.elementClasses.add(className);\n this.classes = this.elementClasses.list;\n\n return this;\n },\n\n setClasses: function(classNames) {\n this.classes = classNames;\n },\n\n /**\n Sets the elementID to be used for the element.\n\n @method id\n @param {String} id\n @chainable\n */\n id: function(id) {\n this.elementId = id;\n return this;\n },\n\n // duck type attribute functionality like jQuery so a render buffer\n // can be used like a jQuery object in attribute binding scenarios.\n\n /**\n Adds an attribute which will be rendered to the element.\n\n @method attr\n @param {String} name The name of the attribute\n @param {String} value The value to add to the attribute\n @chainable\n @return {Ember.RenderBuffer|String} this or the current attribute value\n */\n attr: function(name, value) {\n var attributes = this.elementAttributes = (this.elementAttributes || {});\n\n if (arguments.length === 1) {\n return attributes[name];\n } else {\n attributes[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an attribute from the list of attributes to render.\n\n @method removeAttr\n @param {String} name The name of the attribute\n @chainable\n */\n removeAttr: function(name) {\n var attributes = this.elementAttributes;\n if (attributes) { delete attributes[name]; }\n\n return this;\n },\n\n /**\n Adds an property which will be rendered to the element.\n\n @method prop\n @param {String} name The name of the property\n @param {String} value The value to add to the property\n @chainable\n @return {Ember.RenderBuffer|String} this or the current property value\n */\n prop: function(name, value) {\n var properties = this.elementProperties = (this.elementProperties || {});\n\n if (arguments.length === 1) {\n return properties[name];\n } else {\n properties[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an property from the list of properties to render.\n\n @method removeProp\n @param {String} name The name of the property\n @chainable\n */\n removeProp: function(name) {\n var properties = this.elementProperties;\n if (properties) { delete properties[name]; }\n\n return this;\n },\n\n /**\n Adds a style to the style attribute which will be rendered to the element.\n\n @method style\n @param {String} name Name of the style\n @param {String} value\n @chainable\n */\n style: function(name, value) {\n this.elementStyle = (this.elementStyle || {});\n\n this.elementStyle[name] = value;\n return this;\n },\n\n begin: function(tagName) {\n this.tagNames.push(tagName || null);\n return this;\n },\n\n pushOpeningTag: function() {\n var tagName = this.currentTagName();\n if (!tagName) { return; }\n\n if (!this._element && this.buffer.length === 0) {\n this._element = this.generateElement();\n return;\n }\n\n var buffer = this.buffer,\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n attr, prop;\n\n buffer.push('<' + tagName);\n\n if (id) {\n buffer.push(' id=\"' + this._escapeAttribute(id) + '\"');\n this.elementId = null;\n }\n if (classes) {\n buffer.push(' class=\"' + this._escapeAttribute(classes.join(' ')) + '\"');\n this.classes = null;\n }\n\n if (style) {\n buffer.push(' style=\"');\n\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n buffer.push(prop + ':' + this._escapeAttribute(style[prop]) + ';');\n }\n }\n\n buffer.push('\"');\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n buffer.push(' ' + attr + '=\"' + this._escapeAttribute(attrs[attr]) + '\"');\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n var value = props[prop];\n if (value || typeof(value) === 'number') {\n if (value === true) {\n buffer.push(' ' + prop + '=\"' + prop + '\"');\n } else {\n buffer.push(' ' + prop + '=\"' + this._escapeAttribute(props[prop]) + '\"');\n }\n }\n }\n }\n\n this.elementProperties = null;\n }\n\n buffer.push('>');\n },\n\n pushClosingTag: function() {\n var tagName = this.tagNames.pop();\n if (tagName) { this.buffer.push('</' + tagName + '>'); }\n },\n\n currentTagName: function() {\n return this.tagNames[this.tagNames.length-1];\n },\n\n generateElement: function() {\n var tagName = this.tagNames.pop(), // pop since we don't need to close\n element = document.createElement(tagName),\n $element = Ember.$(element),\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n styleBuffer = '', attr, prop;\n\n if (id) {\n $element.attr('id', id);\n this.elementId = null;\n }\n if (classes) {\n $element.attr('class', classes.join(' '));\n this.classes = null;\n }\n\n if (style) {\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n styleBuffer += (prop + ':' + style[prop] + ';');\n }\n }\n\n $element.attr('style', styleBuffer);\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n $element.attr(attr, attrs[attr]);\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n $element.prop(prop, props[prop]);\n }\n }\n\n this.elementProperties = null;\n }\n\n return element;\n },\n\n /**\n @method element\n @return {DOMElement} The element corresponding to the generated HTML\n of this buffer\n */\n element: function() {\n var html = this.innerString();\n\n if (html) {\n this._element = Ember.ViewUtils.setInnerHTML(this._element, html);\n }\n\n return this._element;\n },\n\n /**\n Generates the HTML content for this buffer.\n\n @method string\n @return {String} The generated HTML\n */\n string: function() {\n if (this._element) {\n return this.element().outerHTML;\n } else {\n return this.innerString();\n }\n },\n\n innerString: function() {\n return this.buffer.join('');\n },\n\n _escapeAttribute: function(value) {\n // Stolen shamelessly from Handlebars\n\n var escape = {\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n \"`\": \"`\"\n };\n\n var badChars = /&(?!\\w+;)|[<>\"'`]/g;\n var possible = /[&<>\"'`]/;\n\n var escapeChar = function(chr) {\n return escape[chr] || \"&\";\n };\n\n var string = value.toString();\n\n if(!possible.test(string)) { return string; }\n return string.replace(badChars, escapeChar);\n }\n\n};\n\n})();\n//@ sourceURL=ember-views/system/render_buffer");minispade.register('ember-views/system/utils', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n/*** BEGIN METAMORPH HELPERS ***/\n\n// Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n// is a \"zero-scope\" element. This problem can be worked around by making\n// the first node an invisible text node. We, like Modernizr, use ­\n\nvar needsShy = this.document && (function(){\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n})();\n\n// IE 8 (and likely earlier) likes to move whitespace preceeding\n// a script tag to appear after it. This means that we can\n// accidentally remove whitespace when updating a morph.\nvar movesWhitespace = this.document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n})();\n\n// Use this to find children by ID instead of using jQuery\nvar findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n};\n\nvar setInnerHTMLWithoutFix = function(element, html) {\n if (needsShy) {\n html = '­' + html;\n }\n\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n\n if (needsShy) {\n var shyElement = element.firstChild;\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n};\n\n/*** END METAMORPH HELPERS */\n\n\nvar innerHTMLTags = {};\nvar canSetInnerHTML = function(tagName) {\n if (innerHTMLTags[tagName] !== undefined) {\n return innerHTMLTags[tagName];\n }\n\n var canSet = true;\n\n // IE 8 and earlier don't allow us to do innerHTML on select\n if (tagName.toLowerCase() === 'select') {\n var el = document.createElement('select');\n setInnerHTMLWithoutFix(el, '<option value=\"test\">Test</option>');\n canSet = el.options.length === 1;\n }\n\n innerHTMLTags[tagName] = canSet;\n\n return canSet;\n};\n\nvar setInnerHTML = function(element, html) {\n var tagName = element.tagName;\n\n if (canSetInnerHTML(tagName)) {\n setInnerHTMLWithoutFix(element, html);\n } else {\n Ember.assert(\"Can't set innerHTML on \"+element.tagName+\" in this browser\", element.outerHTML);\n\n var startTag = element.outerHTML.match(new RegExp(\"<\"+tagName+\"([^>]*)>\", 'i'))[0],\n endTag = '</'+tagName+'>';\n\n var wrapper = document.createElement('div');\n setInnerHTMLWithoutFix(wrapper, startTag + html + endTag);\n element = wrapper.firstChild;\n while (element.tagName !== tagName) {\n element = element.nextSibling;\n }\n }\n\n return element;\n};\n\nfunction isSimpleClick(event) {\n var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,\n secondaryClick = event.which > 1; // IE9 may return undefined\n\n return !modifier && !secondaryClick;\n}\n\nEmber.ViewUtils = {\n setInnerHTML: setInnerHTML,\n isSimpleClick: isSimpleClick\n};\n\n})();\n//@ sourceURL=ember-views/system/utils");minispade.register('ember-views/views', "(function() {minispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-views/views/states\");\nminispade.require(\"ember-views/views/container_view\");\nminispade.require(\"ember-views/views/collection_view\");\n\n})();\n//@ sourceURL=ember-views/views");minispade.register('ember-views/views/collection_view', "(function() {minispade.require('ember-views/views/container_view');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.CollectionView` is an `Ember.View` descendent responsible for managing\n a collection (an array or array-like object) by maintaing a child view object\n and associated DOM representation for each item in the array and ensuring\n that child views and their associated rendered HTML are updated when items in\n the array are added, removed, or replaced.\n\n ## Setting content\n\n The managed collection of objects is referenced as the `Ember.CollectionView`\n instance's `content` property.\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n content: ['A', 'B','C']\n })\n ```\n\n The view for each item in the collection will have its `content` property set\n to the item.\n\n ## Specifying itemViewClass\n\n By default the view class for each item in the managed collection will be an\n instance of `Ember.View`. You can supply a different class by setting the\n `CollectionView`'s `itemViewClass` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n classNames: ['a-collection'],\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n someItemsView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view a-collection\">\n <div class=\"ember-view\">the letter: A</div>\n <div class=\"ember-view\">the letter: B</div>\n <div class=\"ember-view\">the letter: C</div>\n </div>\n ```\n\n ## Automatic matching of parent/child tagNames\n\n Setting the `tagName` property of a `CollectionView` to any of\n \"ul\", \"ol\", \"table\", \"thead\", \"tbody\", \"tfoot\", \"tr\", or \"select\" will result\n in the item views receiving an appropriately matched `tagName` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n anUndorderedListView = Ember.CollectionView.create({\n tagName: 'ul',\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n anUndorderedListView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <ul class=\"ember-view a-collection\">\n <li class=\"ember-view\">the letter: A</li>\n <li class=\"ember-view\">the letter: B</li>\n <li class=\"ember-view\">the letter: C</li>\n </ul>\n ```\n\n Additional `tagName` pairs can be provided by adding to\n `Ember.CollectionView.CONTAINER_MAP `\n\n ```javascript\n Ember.CollectionView.CONTAINER_MAP['article'] = 'section'\n ```\n\n ## Programatic creation of child views\n\n For cases where additional customization beyond the use of a single\n `itemViewClass` or `tagName` matching is required CollectionView's\n `createChildView` method can be overidden:\n\n ```javascript\n CustomCollectionView = Ember.CollectionView.extend({\n createChildView: function(viewClass, attrs) {\n if (attrs.content.kind == 'album') {\n viewClass = App.AlbumView;\n } else {\n viewClass = App.SongView;\n }\n return this._super(viewClass, attrs);\n }\n });\n ```\n\n ## Empty View\n\n You can provide an `Ember.View` subclass to the `Ember.CollectionView`\n instance as its `emptyView` property. If the `content` property of a\n `CollectionView` is set to `null` or an empty array, an instance of this view\n will be the `CollectionView`s only child.\n\n ```javascript\n aListWithNothing = Ember.CollectionView.create({\n classNames: ['nothing']\n content: null,\n emptyView: Ember.View.extend({\n template: Ember.Handlebars.compile(\"The collection is empty\")\n })\n });\n\n aListWithNothing.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view nothing\">\n <div class=\"ember-view\">\n The collection is empty\n </div>\n </div>\n ```\n\n ## Adding and Removing items\n\n The `childViews` property of a `CollectionView` should not be directly\n manipulated. Instead, add, remove, replace items from its `content` property.\n This will trigger appropriate changes to its rendered HTML.\n\n ## Use in templates via the `{{collection}}` `Ember.Handlebars` helper\n\n `Ember.Handlebars` provides a helper specifically for adding\n `CollectionView`s to templates. See `Ember.Handlebars.collection` for more\n details\n\n @class CollectionView\n @namespace Ember\n @extends Ember.ContainerView\n @since Ember 0.9\n*/\nEmber.CollectionView = Ember.ContainerView.extend(\n/** @scope Ember.CollectionView.prototype */ {\n\n /**\n A list of items to be displayed by the `Ember.CollectionView`.\n\n @property content\n @type Ember.Array\n @default null\n */\n content: null,\n\n /**\n @private\n\n This provides metadata about what kind of empty view class this\n collection would like if it is being instantiated from another\n system (like Handlebars)\n\n @property emptyViewClass\n */\n emptyViewClass: Ember.View,\n\n /**\n An optional view to display if content is set to an empty array.\n\n @property emptyView\n @type Ember.View\n @default null\n */\n emptyView: null,\n\n /**\n @property itemViewClass\n @type Ember.View\n @default Ember.View\n */\n itemViewClass: Ember.View,\n\n init: function() {\n var ret = this._super();\n this._contentDidChange();\n return ret;\n },\n\n _contentWillChange: Ember.beforeObserver(function() {\n var content = this.get('content');\n\n if (content) { content.removeArrayObserver(this); }\n var len = content ? get(content, 'length') : 0;\n this.arrayWillChange(content, 0, len);\n }, 'content'),\n\n /**\n @private\n\n Check to make sure that the content has changed, and if so,\n update the children directly. This is always scheduled\n asynchronously, to allow the element to be created before\n bindings have synchronized and vice versa.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer(function() {\n var content = get(this, 'content');\n\n if (content) {\n Ember.assert(fmt(\"an Ember.CollectionView's content must implement Ember.Array. You passed %@\", [content]), Ember.Array.detect(content));\n content.addArrayObserver(this);\n }\n\n var len = content ? get(content, 'length') : 0;\n this.arrayDidChange(content, 0, null, len);\n }, 'content'),\n\n willDestroy: function() {\n var content = get(this, 'content');\n if (content) { content.removeArrayObserver(this); }\n\n this._super();\n\n if (this._createdEmptyView) {\n this._createdEmptyView.destroy();\n }\n },\n\n arrayWillChange: function(content, start, removedCount) {\n // If the contents were empty before and this template collection has an\n // empty view remove it now.\n var emptyView = get(this, 'emptyView');\n if (emptyView && emptyView instanceof Ember.View) {\n emptyView.removeFromParent();\n }\n\n // Loop through child views that correspond with the removed items.\n // Note that we loop from the end of the array to the beginning because\n // we are mutating it as we go.\n var childViews = this._childViews, childView, idx, len;\n\n len = this._childViews.length;\n\n var removingAll = removedCount === len;\n\n if (removingAll) {\n this.currentState.empty(this);\n }\n\n for (idx = start + removedCount - 1; idx >= start; idx--) {\n childView = childViews[idx];\n if (removingAll) { childView.removedFromDOM = true; }\n childView.destroy();\n }\n },\n\n /**\n Called when a mutation to the underlying content array occurs.\n\n This method will replay that mutation against the views that compose the\n `Ember.CollectionView`, ensuring that the view reflects the model.\n\n This array observer is added in `contentDidChange`.\n\n @method arrayDidChange\n @param {Array} addedObjects the objects that were added to the content\n @param {Array} removedObjects the objects that were removed from the content\n @param {Number} changeIndex the index at which the changes occurred\n */\n arrayDidChange: function(content, start, removed, added) {\n var itemViewClass = get(this, 'itemViewClass'),\n addedViews = [], view, item, idx, len;\n\n if ('string' === typeof itemViewClass) {\n itemViewClass = get(itemViewClass);\n }\n\n Ember.assert(fmt(\"itemViewClass must be a subclass of Ember.View, not %@\", [itemViewClass]), Ember.View.detect(itemViewClass));\n\n len = content ? get(content, 'length') : 0;\n if (len) {\n for (idx = start; idx < start+added; idx++) {\n item = content.objectAt(idx);\n\n view = this.createChildView(itemViewClass, {\n content: item,\n contentIndex: idx\n });\n\n addedViews.push(view);\n }\n } else {\n var emptyView = get(this, 'emptyView');\n if (!emptyView) { return; }\n\n var isClass = Ember.CoreView.detect(emptyView);\n\n emptyView = this.createChildView(emptyView);\n addedViews.push(emptyView);\n set(this, 'emptyView', emptyView);\n\n if (isClass) { this._createdEmptyView = emptyView; }\n }\n this.replace(start, 0, addedViews);\n },\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n var itemTagName = get(view, 'tagName');\n var tagName = (itemTagName === null || itemTagName === undefined) ? Ember.CollectionView.CONTAINER_MAP[get(this, 'tagName')] : itemTagName;\n\n set(view, 'tagName', tagName);\n\n return view;\n }\n});\n\n/**\n A map of parent tags to their default child tags. You can add\n additional parent tags if you want collection views that use\n a particular parent tag to default to a child tag.\n\n @property CONTAINER_MAP\n @type Hash\n @static\n @final\n*/\nEmber.CollectionView.CONTAINER_MAP = {\n ul: 'li',\n ol: 'li',\n table: 'tr',\n thead: 'tr',\n tbody: 'tr',\n tfoot: 'tr',\n tr: 'td',\n select: 'option'\n};\n\n})();\n//@ sourceURL=ember-views/views/collection_view");minispade.register('ember-views/views/container_view', "(function() {minispade.require('ember-views/views/view');\nminispade.require('ember-views/views/states');\nminispade.require('ember-runtime/mixins/mutable_array');\n\nvar states = Ember.View.cloneStates(Ember.View.states);\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar forEach = Ember.EnumerableUtils.forEach;\n\n/**\n A `ContainerView` is an `Ember.View` subclass that implements `Ember.MutableArray`\n allowing programatic management of its child views.\n\n ## Setting Initial Child Views\n\n The initial array of child views can be set in one of two ways. You can\n provide a `childViews` property at creation time that contains instance of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: [Ember.View.create(), Ember.View.create()]\n });\n ```\n\n You can also provide a list of property names whose values are instances of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', 'bView', 'cView'],\n aView: Ember.View.create(),\n bView: Ember.View.create(),\n cView: Ember.View.create()\n });\n ```\n\n The two strategies can be combined:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', Ember.View.create()],\n aView: Ember.View.create()\n });\n ```\n\n Each child view's rendering will be inserted into the container's rendered\n HTML in the same order as its position in the `childViews` property.\n\n ## Adding and Removing Child Views\n\n The container view implements `Ember.MutableArray` allowing programatic management of its child views.\n\n To remove a view, pass that view into a `removeObject` call on the container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Removing a view\n\n ```javascript\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.removeObject(aContainer.get('bView'));\n aContainer.toArray(); // [aContainer.aView]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n </div>\n ```\n\n Similarly, adding a child view is accomplished by adding `Ember.View` instances to the\n container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Adding a view\n\n ```javascript\n AnotherViewClass = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Another view\")\n });\n\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.pushObject(AnotherViewClass.create());\n aContainer.toArray(); // [aContainer.aView, aContainer.bView, <AnotherViewClass instance>]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n <div class=\"ember-view\">Another view</div>\n </div>\n ```\n\n ## Templates and Layout\n\n A `template`, `templateName`, `defaultTemplate`, `layout`, `layoutName` or\n `defaultLayout` property on a container view will not result in the template\n or layout being rendered. The HTML contents of a `Ember.ContainerView`'s DOM\n representation will only be the rendered HTML of its child views.\n\n ## Binding a View to Display\n\n If you would like to display a single view in your ContainerView, you can set\n its `currentView` property. When the `currentView` property is set to a view\n instance, it will be added to the ContainerView. If the `currentView` property\n is later changed to a different view, the new view will replace the old view.\n If `currentView` is set to `null`, the last `currentView` will be removed.\n\n This functionality is useful for cases where you want to bind the display of\n a ContainerView to a controller or state manager. For example, you can bind\n the `currentView` of a container to a controller like this:\n\n ```javascript\n App.appController = Ember.Object.create({\n view: Ember.View.create({\n templateName: 'person_template'\n })\n });\n ```\n\n ```handlebars\n {{view Ember.ContainerView currentViewBinding=\"App.appController.view\"}}\n ```\n\n @class ContainerView\n @namespace Ember\n @extends Ember.View\n*/\nEmber.ContainerView = Ember.View.extend(Ember.MutableArray, {\n states: states,\n\n init: function() {\n this._super();\n\n var childViews = get(this, 'childViews');\n\n // redefine view's childViews property that was obliterated\n Ember.defineProperty(this, 'childViews', Ember.View.childViewsProperty);\n\n var _childViews = this._childViews;\n\n forEach(childViews, function(viewName, idx) {\n var view;\n\n if ('string' === typeof viewName) {\n view = get(this, viewName);\n view = this.createChildView(view);\n set(this, viewName, view);\n } else {\n view = this.createChildView(viewName);\n }\n\n _childViews[idx] = view;\n }, this);\n\n var currentView = get(this, 'currentView');\n if (currentView) {\n _childViews.push(this.createChildView(currentView));\n }\n },\n\n replace: function(idx, removedCount, addedViews) {\n var addedCount = addedViews ? get(addedViews, 'length') : 0;\n\n this.arrayContentWillChange(idx, removedCount, addedCount);\n this.childViewsWillChange(this._childViews, idx, removedCount);\n\n if (addedCount === 0) {\n this._childViews.splice(idx, removedCount) ;\n } else {\n var args = [idx, removedCount].concat(addedViews);\n this._childViews.splice.apply(this._childViews, args);\n }\n\n this.arrayContentDidChange(idx, removedCount, addedCount);\n this.childViewsDidChange(this._childViews, idx, removedCount, addedCount);\n\n return this;\n },\n\n objectAt: function(idx) {\n return this._childViews[idx];\n },\n\n length: Ember.computed(function () {\n return this._childViews.length;\n }),\n\n /**\n @private\n\n Instructs each child view to render to the passed render buffer.\n\n @method render\n @param {Ember.RenderBuffer} buffer the buffer to render to\n */\n render: function(buffer) {\n this.forEachChildView(function(view) {\n view.renderToBuffer(buffer);\n });\n },\n\n instrumentName: 'render.container',\n\n /**\n @private\n\n When a child view is removed, destroy its element so that\n it is removed from the DOM.\n\n The array observer that triggers this action is set up in the\n `renderToBuffer` method.\n\n @method childViewsWillChange\n @param {Ember.Array} views the child views array before mutation\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n **/\n childViewsWillChange: function(views, start, removed) {\n this.propertyWillChange('childViews');\n\n if (removed > 0) {\n var changedViews = views.slice(start, start+removed);\n // transition to preRender before clearing parentView\n this.currentState.childViewsWillChange(this, views, start, removed);\n this.initializeViews(changedViews, null, null);\n }\n },\n\n removeChild: function(child) {\n this.removeObject(child);\n return this;\n },\n\n /**\n @private\n\n When a child view is added, make sure the DOM gets updated appropriately.\n\n If the view has already rendered an element, we tell the child view to\n create an element and insert it into the DOM. If the enclosing container\n view has already written to a buffer, but not yet converted that buffer\n into an element, we insert the string representation of the child into the\n appropriate place in the buffer.\n\n @method childViewsDidChange\n @param {Ember.Array} views the array of child views afte the mutation has occurred\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n @param {Number} the number of child views added\n */\n childViewsDidChange: function(views, start, removed, added) {\n if (added > 0) {\n var changedViews = views.slice(start, start+added);\n this.initializeViews(changedViews, this, get(this, 'templateData'));\n this.currentState.childViewsDidChange(this, views, start, added);\n }\n this.propertyDidChange('childViews');\n },\n\n initializeViews: function(views, parentView, templateData) {\n forEach(views, function(view) {\n set(view, '_parentView', parentView);\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', templateData);\n }\n });\n },\n\n currentView: null,\n\n _currentViewWillChange: Ember.beforeObserver(function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n currentView.destroy();\n }\n }, 'currentView'),\n\n _currentViewDidChange: Ember.observer(function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n this.pushObject(currentView);\n }\n }, 'currentView'),\n\n _ensureChildrenAreInDOM: function () {\n this.currentState.ensureChildrenAreInDOM(this);\n }\n});\n\nEmber.merge(states._default, {\n childViewsWillChange: Ember.K,\n childViewsDidChange: Ember.K,\n ensureChildrenAreInDOM: Ember.K\n});\n\nEmber.merge(states.inBuffer, {\n childViewsDidChange: function(parentView, views, start, added) {\n throw new Error('You cannot modify child views while in the inBuffer state');\n }\n});\n\nEmber.merge(states.hasElement, {\n childViewsWillChange: function(view, views, start, removed) {\n for (var i=start; i<start+removed; i++) {\n views[i].remove();\n }\n },\n\n childViewsDidChange: function(view, views, start, added) {\n Ember.run.scheduleOnce('render', view, '_ensureChildrenAreInDOM');\n },\n\n ensureChildrenAreInDOM: function(view) {\n var childViews = view._childViews, i, len, childView, previous, buffer;\n for (i = 0, len = childViews.length; i < len; i++) {\n childView = childViews[i];\n buffer = childView.renderToBufferIfNeeded();\n if (buffer) {\n childView.triggerRecursively('willInsertElement');\n if (previous) {\n previous.domManager.after(previous, buffer.string());\n } else {\n view.domManager.prepend(view, buffer.string());\n }\n childView.transitionTo('inDOM');\n childView.propertyDidChange('element');\n childView.triggerRecursively('didInsertElement');\n }\n previous = childView;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/container_view");minispade.register('ember-views/views/states', "(function() {minispade.require(\"ember-views/views/states/default\");\nminispade.require(\"ember-views/views/states/pre_render\");\nminispade.require(\"ember-views/views/states/in_buffer\");\nminispade.require(\"ember-views/views/states/in_dom\");\nminispade.require(\"ember-views/views/states/destroyed\");\n\nEmber.View.cloneStates = function(from) {\n var into = {};\n\n into._default = {};\n into.preRender = Ember.create(into._default);\n into.destroyed = Ember.create(into._default);\n into.inBuffer = Ember.create(into._default);\n into.hasElement = Ember.create(into._default);\n into.inDOM = Ember.create(into.hasElement);\n\n for (var stateName in from) {\n if (!from.hasOwnProperty(stateName)) { continue; }\n Ember.merge(into[stateName], from[stateName]);\n }\n\n return into;\n};\n\n})();\n//@ sourceURL=ember-views/views/states");minispade.register('ember-views/views/states/default', "(function() {minispade.require('ember-views/views/view');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.View.states._default = {\n // appendChild is only legal while rendering the buffer.\n appendChild: function() {\n throw \"You can't use appendChild outside of the rendering process\";\n },\n\n $: function() {\n return undefined;\n },\n\n getElement: function() {\n return null;\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function() {\n return true; // continue event propagation\n },\n\n destroyElement: function(view) {\n set(view, 'element', null);\n if (view._scheduledInsert) {\n Ember.run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n renderToBufferIfNeeded: function () {\n return false;\n },\n\n rerender: Ember.K,\n invokeObserver: Ember.K\n};\n\n})();\n//@ sourceURL=ember-views/views/states/default");minispade.register('ember-views/views/states/destroyed', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar destroyedError = \"You can't call %@ on a destroyed view\", fmt = Ember.String.fmt;\n\nvar destroyed = Ember.View.states.destroyed = Ember.create(Ember.View.states._default);\n\nEmber.merge(destroyed, {\n appendChild: function() {\n throw fmt(destroyedError, ['appendChild']);\n },\n rerender: function() {\n throw fmt(destroyedError, ['rerender']);\n },\n destroyElement: function() {\n throw fmt(destroyedError, ['destroyElement']);\n },\n empty: function() {\n throw fmt(destroyedError, ['empty']);\n },\n\n setElement: function() {\n throw fmt(destroyedError, [\"set('element', ...)\"]);\n },\n\n renderToBufferIfNeeded: function() {\n throw fmt(destroyedError, [\"renderToBufferIfNeeded\"]);\n },\n\n // Since element insertion is scheduled, don't do anything if\n // the view has been destroyed between scheduling and execution\n insertElement: Ember.K\n});\n\n\n})();\n//@ sourceURL=ember-views/views/states/destroyed");minispade.register('ember-views/views/states/in_buffer', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar inBuffer = Ember.View.states.inBuffer = Ember.create(Ember.View.states._default);\n\nEmber.merge(inBuffer, {\n $: function(view, sel) {\n // if we don't have an element yet, someone calling this.$() is\n // trying to update an element that isn't in the DOM. Instead,\n // rerender the view to allow the render method to reflect the\n // changes.\n view.rerender();\n return Ember.$();\n },\n\n // when a view is rendered in a buffer, rerendering it simply\n // replaces the existing buffer with a new one\n rerender: function(view) {\n throw new Ember.Error(\"Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.\");\n },\n\n // when a view is rendered in a buffer, appending a child\n // view will render that view and append the resulting\n // buffer into its buffer.\n appendChild: function(view, childView, options) {\n var buffer = view.buffer;\n\n childView = view.createChildView(childView, options);\n view._childViews.push(childView);\n\n childView.renderToBuffer(buffer);\n\n view.propertyDidChange('childViews');\n\n return childView;\n },\n\n // when a view is rendered in a buffer, destroying the\n // element will simply destroy the buffer and put the\n // state back into the preRender state.\n destroyElement: function(view) {\n view.clearBuffer();\n view._notifyWillDestroyElement();\n view.transitionTo('preRender');\n\n return view;\n },\n\n empty: function() {\n Ember.assert(\"Emptying a view in the inBuffer state is not allowed and should not happen under normal circumstances. Most likely there is a bug in your application. This may be due to excessive property change notifications.\");\n },\n\n renderToBufferIfNeeded: function (view) {\n return view.buffer;\n },\n\n // It should be impossible for a rendered view to be scheduled for\n // insertion.\n insertElement: function() {\n throw \"You can't insert an element that has already been rendered\";\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n view.clearBuffer();\n view.transitionTo('hasElement');\n }\n\n return value;\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n});\n\n\n})();\n//@ sourceURL=ember-views/views/states/in_buffer");minispade.register('ember-views/views/states/in_dom', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar hasElement = Ember.View.states.hasElement = Ember.create(Ember.View.states._default);\n\nEmber.merge(hasElement, {\n $: function(view, sel) {\n var elem = get(view, 'element');\n return sel ? Ember.$(sel, elem) : Ember.$(elem);\n },\n\n getElement: function(view) {\n var parent = get(view, 'parentView');\n if (parent) { parent = get(parent, 'element'); }\n if (parent) { return view.findElementInParentElement(parent); }\n return Ember.$(\"#\" + get(view, 'elementId'))[0];\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n throw \"You cannot set an element to a non-null value when the element is already in the DOM.\";\n }\n\n return value;\n },\n\n // once the view has been inserted into the DOM, rerendering is\n // deferred to allow bindings to synchronize.\n rerender: function(view) {\n view.triggerRecursively('willClearRender');\n\n view.clearRenderedChildren();\n\n view.domManager.replace(view);\n return view;\n },\n\n // once the view is already in the DOM, destroying it removes it\n // from the DOM, nukes its element, and puts it back into the\n // preRender state if inDOM.\n\n destroyElement: function(view) {\n view._notifyWillDestroyElement();\n view.domManager.remove(view);\n set(view, 'element', null);\n if (view._scheduledInsert) {\n Ember.run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n empty: function(view) {\n var _childViews = view._childViews, len, idx;\n if (_childViews) {\n len = _childViews.length;\n for (idx = 0; idx < len; idx++) {\n _childViews[idx]._notifyWillDestroyElement();\n }\n }\n view.domManager.empty(view);\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function(view, eventName, evt) {\n if (view.has(eventName)) {\n // Handler should be able to re-dispatch events, so we don't\n // preventDefault or stopPropagation.\n return view.trigger(eventName, evt);\n } else {\n return true; // continue event propagation\n }\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n});\n\nvar inDOM = Ember.View.states.inDOM = Ember.create(hasElement);\n\nEmber.merge(inDOM, {\n insertElement: function(view, fn) {\n throw \"You can't insert an element into the DOM that has already been inserted\";\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/states/in_dom");minispade.register('ember-views/views/states/pre_render', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar preRender = Ember.View.states.preRender = Ember.create(Ember.View.states._default);\n\nEmber.merge(preRender, {\n // a view leaves the preRender state once its element has been\n // created (createElement).\n insertElement: function(view, fn) {\n view.createElement();\n view.triggerRecursively('willInsertElement');\n // after createElement, the view will be in the hasElement state.\n fn.call(view);\n view.transitionTo('inDOM');\n view.triggerRecursively('didInsertElement');\n },\n\n renderToBufferIfNeeded: function(view) {\n return view.renderToBuffer();\n },\n\n empty: Ember.K,\n\n setElement: function(view, value) {\n if (value !== null) {\n view.transitionTo('hasElement');\n }\n return value;\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/states/pre_render");minispade.register('ember-views/views/view', "(function() {minispade.require(\"ember-views/system/render_buffer\");\n\nvar states = {};\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar guidFor = Ember.guidFor;\nvar a_forEach = Ember.EnumerableUtils.forEach;\nvar a_addObject = Ember.EnumerableUtils.addObject;\n\nvar childViewsProperty = Ember.computed(function() {\n var childViews = this._childViews, ret = Ember.A(), view = this;\n\n a_forEach(childViews, function(view) {\n if (view.isVirtual) {\n ret.pushObjects(get(view, 'childViews'));\n } else {\n ret.push(view);\n }\n });\n\n ret.replace = function (idx, removedCount, addedViews) {\n if (view instanceof Ember.ContainerView) {\n Ember.deprecate(\"Manipulating an Ember.ContainerView through its childViews property is deprecated. Please use the ContainerView instance itself as an Ember.MutableArray.\");\n return view.replace(idx, removedCount, addedViews);\n }\n throw new Error(\"childViews is immutable\");\n };\n\n return ret;\n});\n\nEmber.warn(\"The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.\", Ember.ENV.VIEW_PRESERVES_CONTEXT !== false);\n\n/**\n Global hash of shared templates. This will automatically be populated\n by the build tools so that you can store your Handlebars templates in\n separate files that get loaded into JavaScript at buildtime.\n\n @property TEMPLATES\n @for Ember\n @type Hash\n*/\nEmber.TEMPLATES = {};\n\nEmber.CoreView = Ember.Object.extend(Ember.Evented, {\n isView: true,\n\n states: states,\n\n init: function() {\n this._super();\n\n // Register the view for event handling. This hash is used by\n // Ember.EventDispatcher to dispatch incoming events.\n if (!this.isVirtual) {\n Ember.assert(\"Attempted to register a view with an id already in use: \"+this.elementId, !Ember.View.views[this.elementId]);\n Ember.View.views[this.elementId] = this;\n }\n\n this.addBeforeObserver('elementId', function() {\n throw new Error(\"Changing a view's elementId after creation is not allowed\");\n });\n\n this.transitionTo('preRender');\n },\n\n /**\n If the view is currently inserted into the DOM of a parent view, this\n property will point to the parent of the view.\n\n @property parentView\n @type Ember.View\n @default null\n */\n parentView: Ember.computed(function() {\n var parent = this._parentView;\n\n if (parent && parent.isVirtual) {\n return get(parent, 'parentView');\n } else {\n return parent;\n }\n }).property('_parentView'),\n\n state: null,\n\n _parentView: null,\n\n // return the current view, not including virtual views\n concreteView: Ember.computed(function() {\n if (!this.isVirtual) { return this; }\n else { return get(this, 'parentView'); }\n }).property('parentView').volatile(),\n\n instrumentName: 'core_view',\n\n instrumentDetails: function(hash) {\n hash.object = this.toString();\n },\n\n /**\n @private\n\n Invoked by the view system when this view needs to produce an HTML\n representation. This method will create a new render buffer, if needed,\n then apply any default attributes, such as class names and visibility.\n Finally, the `render()` method is invoked, which is responsible for\n doing the bulk of the rendering.\n\n You should not need to override this method; instead, implement the\n `template` property, or if you need more control, override the `render`\n method.\n\n @method renderToBuffer\n @param {Ember.RenderBuffer} buffer the render buffer. If no buffer is\n passed, a default buffer, using the current view's `tagName`, will\n be used.\n */\n renderToBuffer: function(parentBuffer, bufferOperation) {\n var name = 'render.' + this.instrumentName,\n details = {};\n\n this.instrumentDetails(details);\n\n return Ember.instrument(name, details, function() {\n return this._renderToBuffer(parentBuffer, bufferOperation);\n }, this);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n Ember.run.sync();\n\n // If this is the top-most view, start a new buffer. Otherwise,\n // create a new buffer relative to the original using the\n // provided buffer operation (for example, `insertAfter` will\n // insert a new buffer after the \"parent buffer\").\n var tagName = this.tagName;\n\n if (tagName === null || tagName === undefined) {\n tagName = 'div';\n }\n\n var buffer = this.buffer = parentBuffer && parentBuffer.begin(tagName) || Ember.RenderBuffer(tagName);\n this.transitionTo('inBuffer', false);\n\n this.beforeRender(buffer);\n this.render(buffer);\n this.afterRender(buffer);\n\n return buffer;\n },\n\n /**\n @private\n\n Override the default event firing from `Ember.Evented` to\n also call methods with the given name.\n\n @method trigger\n @param name {String}\n */\n trigger: function(name) {\n this._super.apply(this, arguments);\n var method = this[name];\n if (method) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n return method.apply(this, args);\n }\n },\n\n has: function(name) {\n return Ember.typeOf(this[name]) === 'function' || this._super(name);\n },\n\n willDestroy: function() {\n var parent = this._parentView;\n\n // destroy the element -- this will avoid each child view destroying\n // the element over and over again...\n if (!this.removedFromDOM) { this.destroyElement(); }\n\n // remove from parent if found. Don't call removeFromParent,\n // as removeFromParent will try to remove the element from\n // the DOM again.\n if (parent) { parent.removeChild(this); }\n\n this.transitionTo('destroyed');\n\n // next remove view from global hash\n if (!this.isVirtual) delete Ember.View.views[this.elementId];\n },\n\n clearRenderedChildren: Ember.K,\n triggerRecursively: Ember.K,\n invokeRecursively: Ember.K,\n transitionTo: Ember.K,\n destroyElement: Ember.K\n});\n\n/**\n `Ember.View` is the class in Ember responsible for encapsulating templates of\n HTML content, combining templates with data to render as sections of a page's\n DOM, and registering and responding to user-initiated events.\n\n ## HTML Tag\n\n The default HTML tag name used for a view's DOM representation is `div`. This\n can be customized by setting the `tagName` property. The following view\nclass:\n\n ```javascript\n ParagraphView = Ember.View.extend({\n tagName: 'em'\n });\n ```\n\n Would result in instances with the following HTML:\n\n ```html\n <em id=\"ember1\" class=\"ember-view\"></em>\n ```\n\n ## HTML `class` Attribute\n\n The HTML `class` attribute of a view's tag can be set by providing a\n `classNames` property that is set to an array of strings:\n\n ```javascript\n MyView = Ember.View.extend({\n classNames: ['my-class', 'my-other-class']\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view my-class my-other-class\"></div>\n ```\n\n `class` attribute values can also be set by providing a `classNameBindings`\n property set to an array of properties names for the view. The return value\n of these properties will be added as part of the value for the view's `class`\n attribute. These properties can be computed properties:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['propertyA', 'propertyB'],\n propertyA: 'from-a',\n propertyB: function(){\n if(someLogic){ return 'from-b'; }\n }.property()\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view from-a from-b\"></div>\n ```\n\n If the value of a class name binding returns a boolean the property name\n itself will be used as the class name if the property is true. The class name\n will not be added if the value is `false` or `undefined`.\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['hovered'],\n hovered: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view hovered\"></div>\n ```\n\n When using boolean class name bindings you can supply a string value other\n than the property name for use as the `class` HTML attribute by appending the\n preferred value after a \":\" character when defining the binding:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['awesome:so-very-cool'],\n awesome: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view so-very-cool\"></div>\n ```\n\n Boolean value class name bindings whose property names are in a\n camelCase-style format will be converted to a dasherized format:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['isUrgent'],\n isUrgent: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view is-urgent\"></div>\n ```\n\n Class name bindings can also refer to object values that are found by\n traversing a path relative to the view itself:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['messages.empty']\n messages: Ember.Object.create({\n empty: true\n })\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view empty\"></div>\n ```\n\n If you want to add a class name for a property which evaluates to true and\n and a different class name if it evaluates to false, you can pass a binding\n like this:\n\n ```javascript\n // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false\n Ember.View.create({\n classNameBindings: ['isEnabled:enabled:disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view enabled\"></div>\n ```\n\n When isEnabled is `false`, the resulting HTML reprensentation looks like\n this:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n This syntax offers the convenience to add a class if a property is `false`:\n\n ```javascript\n // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\n Ember.View.create({\n classNameBindings: ['isEnabled::disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\"></div>\n ```\n\n When the `isEnabled` property on the view is set to `false`, it will result\n in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n Updates to the the value of a class name binding will result in automatic\n update of the HTML `class` attribute in the view's rendered HTML\n representation. If the value becomes `false` or `undefined` the class name\n will be removed.\n\n Both `classNames` and `classNameBindings` are concatenated properties. See\n `Ember.Object` documentation for more information about concatenated\n properties.\n\n ## HTML Attributes\n\n The HTML attribute section of a view's tag can be set by providing an\n `attributeBindings` property set to an array of property names on the view.\n The return value of these properties will be used as the value of the view's\n HTML associated attribute:\n\n ```javascript\n AnchorView = Ember.View.extend({\n tagName: 'a',\n attributeBindings: ['href'],\n href: 'http://google.com'\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n ```\n\n If the return value of an `attributeBindings` monitored property is a boolean\n the property will follow HTML's pattern of repeating the attribute's name as\n its value:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <input id=\"ember1\" class=\"ember-view\" disabled=\"disabled\" />\n ```\n\n `attributeBindings` can refer to computed properties:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: function(){\n if (someLogic) {\n return true;\n } else {\n return false;\n }\n }.property()\n });\n ```\n\n Updates to the the property of an attribute binding will result in automatic\n update of the HTML attribute in the view's rendered HTML representation.\n\n `attributeBindings` is a concatenated property. See `Ember.Object`\n documentation for more information about concatenated properties.\n\n ## Templates\n\n The HTML contents of a view's rendered representation are determined by its\n template. Templates can be any function that accepts an optional context\n parameter and returns a string of HTML that will be inserted within the\n view's tag. Most typically in Ember this function will be a compiled\n `Ember.Handlebars` template.\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('I am the template')\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I am the template</div>\n ```\n\n Within an Ember application is more common to define a Handlebars templates as\n part of a page:\n\n ```html\n <script type='text/x-handlebars' data-template-name='some-template'>\n Hello\n </script>\n ```\n\n And associate it by name using a view's `templateName` property:\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'some-template'\n });\n ```\n\n Using a value for `templateName` that does not have a Handlebars template\n with a matching `data-template-name` attribute will throw an error.\n\n Assigning a value to both `template` and `templateName` properties will throw\n an error.\n\n For views classes that may have a template later defined (e.g. as the block\n portion of a `{{view}}` Handlebars helper call in another template or in\n a subclass), you can provide a `defaultTemplate` property set to compiled\n template function. If a template is not later provided for the view instance\n the `defaultTemplate` value will be used:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default'),\n template: null,\n templateName: null\n });\n ```\n\n Will result in instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the default</div>\n ```\n\n If a `template` or `templateName` is provided it will take precedence over\n `defaultTemplate`:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default')\n });\n\n aView = AView.create({\n template: Ember.Handlebars.compile('I was the template, not default')\n });\n ```\n\n Will result in the following HTML representation when rendered:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the template, not default</div>\n ```\n\n ## View Context\n\n The default context of the compiled template is the view's controller:\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('Hello {{excitedGreeting}}')\n });\n\n aController = Ember.Object.create({\n firstName: 'Barry',\n excitedGreeting: function(){\n return this.get(\"content.firstName\") + \"!!!\"\n }.property()\n });\n\n aView = AView.create({\n controller: aController,\n });\n ```\n\n Will result in an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">Hello Barry!!!</div>\n ```\n\n A context can also be explicitly supplied through the view's `context`\n property. If the view has neither `context` nor `controller` properties, the\n `parentView`'s context will be used.\n\n ## Layouts\n\n Views can have a secondary template that wraps their main template. Like\n primary templates, layouts can be any function that accepts an optional\n context parameter and returns a string of HTML that will be inserted inside\n view's tag. Views whose HTML element is self closing (e.g. `<input />`)\n cannot have a layout and this property will be ignored.\n\n Most typically in Ember a layout will be a compiled `Ember.Handlebars`\n template.\n\n A view's layout can be set directly with the `layout` property or reference\n an existing Handlebars template by name with the `layoutName` property.\n\n A template used as a layout must contain a single use of the Handlebars\n `{{yield}}` helper. The HTML contents of a view's rendered `template` will be\n inserted at this location:\n\n ```javascript\n AViewWithLayout = Ember.View.extend({\n layout: Ember.Handlebars.compile(\"<div class='my-decorative-class'>{{yield}}</div>\")\n template: Ember.Handlebars.compile(\"I got wrapped\"),\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div class=\"my-decorative-class\">\n I got wrapped\n </div>\n </div>\n ```\n\n See `Handlebars.helpers.yield` for more information.\n\n ## Responding to Browser Events\n\n Views can respond to user-initiated events in one of three ways: method\n implementation, through an event manager, and through `{{action}}` helper use\n in their template or layout.\n\n ### Method Implementation\n\n Views can respond to user-initiated events by implementing a method that\n matches the event name. A `jQuery.Event` object will be passed as the\n argument to this method.\n\n ```javascript\n AView = Ember.View.extend({\n click: function(event){\n // will be called when when an instance's\n // rendered element is clicked\n }\n });\n ```\n\n ### Event Managers\n\n Views can define an object as their `eventManager` property. This object can\n then implement methods that match the desired event names. Matching events\n that occur on the view's rendered HTML or the rendered HTML of any of its DOM\n descendants will trigger this method. A `jQuery.Event` object will be passed\n as the first argument to the method and an `Ember.View` object as the\n second. The `Ember.View` will be the view whose rendered HTML was interacted\n with. This may be the view with the `eventManager` property or one of its\n descendent views.\n\n ```javascript\n AView = Ember.View.extend({\n eventManager: Ember.Object.create({\n doubleClick: function(event, view){\n // will be called when when an instance's\n // rendered element or any rendering\n // of this views's descendent\n // elements is clicked\n }\n })\n });\n ```\n\n An event defined for an event manager takes precedence over events of the\n same name handled through methods on the view.\n\n ```javascript\n AView = Ember.View.extend({\n mouseEnter: function(event){\n // will never trigger.\n },\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view){\n // takes presedence over AView#mouseEnter\n }\n })\n });\n ```\n\n Similarly a view's event manager will take precedence for events of any views\n rendered as a descendent. A method name that matches an event name will not\n be called if the view instance was rendered inside the HTML representation of\n a view that has an `eventManager` property defined that handles events of the\n name. Events not handled by the event manager will still trigger method calls\n on the descendent.\n\n ```javascript\n OuterView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"outer {{#view InnerView}}inner{{/view}} outer\"),\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view){\n // view might be instance of either\n // OutsideView or InnerView depending on\n // where on the page the user interaction occured\n }\n })\n });\n\n InnerView = Ember.View.extend({\n click: function(event){\n // will be called if rendered inside\n // an OuterView because OuterView's\n // eventManager doesn't handle click events\n },\n mouseEnter: function(event){\n // will never be called if rendered inside\n // an OuterView.\n }\n });\n ```\n\n ### Handlebars `{{action}}` Helper\n\n See `Handlebars.helpers.action`.\n\n ### Event Names\n\n Possible events names for any of the responding approaches described above\n are:\n\n Touch events:\n\n * `touchStart`\n * `touchMove`\n * `touchEnd`\n * `touchCancel`\n\n Keyboard events\n\n * `keyDown`\n * `keyUp`\n * `keyPress`\n\n Mouse events\n\n * `mouseDown`\n * `mouseUp`\n * `contextMenu`\n * `click`\n * `doubleClick`\n * `mouseMove`\n * `focusIn`\n * `focusOut`\n * `mouseEnter`\n * `mouseLeave`\n\n Form events:\n\n * `submit`\n * `change`\n * `focusIn`\n * `focusOut`\n * `input`\n\n HTML5 drag and drop events:\n\n * `dragStart`\n * `drag`\n * `dragEnter`\n * `dragLeave`\n * `drop`\n * `dragEnd`\n\n ## Handlebars `{{view}}` Helper\n\n Other `Ember.View` instances can be included as part of a view's template by\n using the `{{view}}` Handlebars helper. See `Handlebars.helpers.view` for\n additional information.\n\n @class View\n @namespace Ember\n @extends Ember.Object\n @uses Ember.Evented\n*/\nEmber.View = Ember.CoreView.extend(\n/** @scope Ember.View.prototype */ {\n\n concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'],\n\n /**\n @property isView\n @type Boolean\n @default true\n @final\n */\n isView: true,\n\n // ..........................................................\n // TEMPLATE SUPPORT\n //\n\n /**\n The name of the template to lookup if no template is provided.\n\n `Ember.View` will look for a template with this name in this view's\n `templates` object. By default, this will be a global object\n shared in `Ember.TEMPLATES`.\n\n @property templateName\n @type String\n @default null\n */\n templateName: null,\n\n /**\n The name of the layout to lookup if no layout is provided.\n\n `Ember.View` will look for a template with this name in this view's\n `templates` object. By default, this will be a global object\n shared in `Ember.TEMPLATES`.\n\n @property layoutName\n @type String\n @default null\n */\n layoutName: null,\n\n /**\n The hash in which to look for `templateName`.\n\n @property templates\n @type Ember.Object\n @default Ember.TEMPLATES\n */\n templates: Ember.TEMPLATES,\n\n /**\n The template used to render the view. This should be a function that\n accepts an optional context parameter and returns a string of HTML that\n will be inserted into the DOM relative to its parent view.\n\n In general, you should set the `templateName` property instead of setting\n the template yourself.\n\n @property template\n @type Function\n */\n template: Ember.computed(function(key, value) {\n if (value !== undefined) { return value; }\n\n var templateName = get(this, 'templateName'),\n template = this.templateForName(templateName, 'template');\n\n Ember.assert(\"You specified the templateName \" + templateName + \" for \" + this + \", but it did not exist.\", !templateName || template);\n\n return template || get(this, 'defaultTemplate');\n }).property('templateName'),\n\n container: Ember.computed(function() {\n var parentView = get(this, '_parentView');\n\n if (parentView) { return get(parentView, 'container'); }\n\n return Ember.Container && Ember.Container.defaultContainer;\n }),\n\n /**\n The controller managing this view. If this property is set, it will be\n made available for use by the template.\n\n @property controller\n @type Object\n */\n controller: Ember.computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n A view may contain a layout. A layout is a regular template but\n supersedes the `template` property during rendering. It is the\n responsibility of the layout template to retrieve the `template`\n property from the view (or alternatively, call `Handlebars.helpers.yield`,\n `{{yield}}`) to render it in the correct location.\n\n This is useful for a view that has a shared wrapper, but which delegates\n the rendering of the contents of the wrapper to the `template` property\n on a subclass.\n\n @property layout\n @type Function\n */\n layout: Ember.computed(function(key) {\n var layoutName = get(this, 'layoutName'),\n layout = this.templateForName(layoutName, 'layout');\n\n Ember.assert(\"You specified the layoutName \" + layoutName + \" for \" + this + \", but it did not exist.\", !layoutName || layout);\n\n return layout || get(this, 'defaultLayout');\n }).property('layoutName'),\n\n templateForName: function(name, type) {\n if (!name) { return; }\n\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n var container = get(this, 'container');\n\n if (container) {\n return container.lookup('template:' + name);\n }\n },\n\n /**\n The object from which templates should access properties.\n\n This object will be passed to the template function each time the render\n method is called, but it is up to the individual function to decide what\n to do with it.\n\n By default, this will be the view's controller.\n\n @property context\n @type Object\n */\n context: Ember.computed(function(key, value) {\n if (arguments.length === 2) {\n set(this, '_context', value);\n return value;\n } else {\n return get(this, '_context');\n }\n }).volatile(),\n\n /**\n @private\n\n Private copy of the view's template context. This can be set directly\n by Handlebars without triggering the observer that causes the view\n to be re-rendered.\n\n The context of a view is looked up as follows:\n\n 1. Supplied context (usually by Handlebars)\n 2. Specified controller\n 3. `parentView`'s context (for a child of a ContainerView)\n\n The code in Handlebars that overrides the `_context` property first\n checks to see whether the view has a specified controller. This is\n something of a hack and should be revisited.\n\n @property _context\n */\n _context: Ember.computed(function(key) {\n var parentView, controller;\n\n if (controller = get(this, 'controller')) {\n return controller;\n }\n\n parentView = this._parentView;\n if (parentView) {\n return get(parentView, '_context');\n }\n\n return null;\n }),\n\n /**\n @private\n\n If a value that affects template rendering changes, the view should be\n re-rendered to reflect the new value.\n\n @method _displayPropertyDidChange\n */\n _contextDidChange: Ember.observer(function() {\n this.rerender();\n }, 'context'),\n\n /**\n If `false`, the view will appear hidden in DOM.\n\n @property isVisible\n @type Boolean\n @default null\n */\n isVisible: true,\n\n /**\n @private\n\n Array of child views. You should never edit this array directly.\n Instead, use `appendChild` and `removeFromParent`.\n\n @property childViews\n @type Array\n @default []\n */\n childViews: childViewsProperty,\n\n _childViews: [],\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews will change.\n _childViewsWillChange: Ember.beforeObserver(function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyWillChange(parentView, 'childViews'); }\n }\n }, 'childViews'),\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews did change.\n _childViewsDidChange: Ember.observer(function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyDidChange(parentView, 'childViews'); }\n }\n }, 'childViews'),\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class.\n\n @property nearestInstanceOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n @deprecated\n */\n nearestInstanceOf: function(klass) {\n Ember.deprecate(\"nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.\");\n var view = get(this, 'parentView');\n\n while (view) {\n if(view instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class or mixin.\n\n @property nearestOfType\n @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself),\n or an instance of Ember.Mixin.\n @return Ember.View\n */\n nearestOfType: function(klass) {\n var view = get(this, 'parentView'),\n isOfType = klass instanceof Ember.Mixin ?\n function(view) { return klass.detect(view); } :\n function(view) { return klass.detect(view.constructor); };\n\n while (view) {\n if( isOfType(view) ) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that has a given property.\n\n @property nearestWithProperty\n @param {String} property A property name\n @return Ember.View\n */\n nearestWithProperty: function(property) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (property in view) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor whose parent is an instance of\n `klass`.\n\n @property nearestChildOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n */\n nearestChildOf: function(klass) {\n var view = get(this, 'parentView');\n\n while (view) {\n if(get(view, 'parentView') instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n @private\n\n When the parent view changes, recursively invalidate `controller`\n\n @method _parentViewDidChange\n */\n _parentViewDidChange: Ember.observer(function() {\n if (this.isDestroying) { return; }\n\n if (get(this, 'parentView.controller') && !get(this, 'controller')) {\n this.notifyPropertyChange('controller');\n }\n }, '_parentView'),\n\n _controllerDidChange: Ember.observer(function() {\n if (this.isDestroying) { return; }\n\n this.rerender();\n\n this.forEachChildView(function(view) {\n view.propertyDidChange('controller');\n });\n }, 'controller'),\n\n cloneKeywords: function() {\n var templateData = get(this, 'templateData');\n\n var keywords = templateData ? Ember.copy(templateData.keywords) : {};\n set(keywords, 'view', get(this, 'concreteView'));\n set(keywords, '_view', this);\n set(keywords, 'controller', get(this, 'controller'));\n\n return keywords;\n },\n\n /**\n Called on your view when it should push strings of HTML into a\n `Ember.RenderBuffer`. Most users will want to override the `template`\n or `templateName` properties instead of this method.\n\n By default, `Ember.View` will look for a function in the `template`\n property and invoke it with the value of `context`. The value of\n `context` will be the view's controller unless you override it.\n\n @method render\n @param {Ember.RenderBuffer} buffer The render buffer\n */\n render: function(buffer) {\n // If this view has a layout, it is the responsibility of the\n // the layout to render the view's template. Otherwise, render the template\n // directly.\n var template = get(this, 'layout') || get(this, 'template');\n\n if (template) {\n var context = get(this, 'context');\n var keywords = this.cloneKeywords();\n var output;\n\n var data = {\n view: this,\n buffer: buffer,\n isRenderData: true,\n keywords: keywords,\n insideGroup: get(this, 'templateData.insideGroup')\n };\n\n // Invoke the template with the provided template context, which\n // is the view's controller by default. A hash of data is also passed that provides\n // the template with access to the view and render buffer.\n\n Ember.assert('template must be a function. Did you mean to call Ember.Handlebars.compile(\"...\") or specify templateName instead?', typeof template === 'function');\n // The template should write directly to the render buffer instead\n // of returning a string.\n output = template(context, { data: data });\n\n // If the template returned a string instead of writing to the buffer,\n // push the string onto the buffer.\n if (output !== undefined) { buffer.push(output); }\n }\n },\n\n /**\n Renders the view again. This will work regardless of whether the\n view is already in the DOM or not. If the view is in the DOM, the\n rendering process will be deferred to give bindings a chance\n to synchronize.\n\n If children were added during the rendering process using `appendChild`,\n `rerender` will remove them, because they will be added again\n if needed by the next `render`.\n\n In general, if the display of your view changes, you should modify\n the DOM element directly instead of manually calling `rerender`, which can\n be slow.\n\n @method rerender\n */\n rerender: function() {\n return this.currentState.rerender(this);\n },\n\n clearRenderedChildren: function() {\n var lengthBefore = this.lengthBeforeRender,\n lengthAfter = this.lengthAfterRender;\n\n // If there were child views created during the last call to render(),\n // remove them under the assumption that they will be re-created when\n // we re-render.\n\n // VIEW-TODO: Unit test this path.\n var childViews = this._childViews;\n for (var i=lengthAfter-1; i>=lengthBefore; i--) {\n if (childViews[i]) { childViews[i].destroy(); }\n }\n },\n\n /**\n @private\n\n Iterates over the view's `classNameBindings` array, inserts the value\n of the specified property into the `classNames` array, then creates an\n observer to update the view's element if the bound property ever changes\n in the future.\n\n @method _applyClassNameBindings\n */\n _applyClassNameBindings: function(classBindings) {\n var classNames = this.classNames,\n elem, newClass, dasherizedClass;\n\n // Loop through all of the configured bindings. These will be either\n // property names ('isUrgent') or property paths relative to the view\n // ('content.isUrgent')\n a_forEach(classBindings, function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n // Extract just the property name from bindings like 'foo:bar'\n var parsedPath = Ember.View._parsePropertyPath(binding);\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n var observer = function() {\n // Get the current value of the property\n newClass = this._classStringForProperty(binding);\n elem = this.$();\n\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n // Also remove from classNames so that if the view gets rerendered,\n // the class doesn't get added back to the DOM.\n classNames.removeObject(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n };\n\n // Get the class name for the property at its current value\n dasherizedClass = this._classStringForProperty(binding);\n\n if (dasherizedClass) {\n // Ensure that it gets into the classNames array\n // so it is displayed when we render.\n a_addObject(classNames, dasherizedClass);\n\n // Save a reference to the class name so we can remove it\n // if the observer fires. Remember that this variable has\n // been closed over by the observer.\n oldClass = dasherizedClass;\n }\n\n this.registerObserver(this, parsedPath.path, observer);\n // Remove className so when the view is rerendered,\n // the className is added based on binding reevaluation\n this.one('willClearRender', function() {\n if (oldClass) {\n classNames.removeObject(oldClass);\n oldClass = null;\n }\n });\n\n }, this);\n },\n\n /**\n @private\n\n Iterates through the view's attribute bindings, sets up observers for each,\n then applies the current value of the attributes to the passed render buffer.\n\n @method _applyAttributeBindings\n @param {Ember.RenderBuffer} buffer\n */\n _applyAttributeBindings: function(buffer, attributeBindings) {\n var attributeValue, elem, type;\n\n a_forEach(attributeBindings, function(binding) {\n var split = binding.split(':'),\n property = split[0],\n attributeName = split[1] || property;\n\n // Create an observer to add/remove/change the attribute if the\n // JavaScript property changes.\n var observer = function() {\n elem = this.$();\n\n attributeValue = get(this, property);\n\n Ember.View.applyAttributeBindings(elem, attributeName, attributeValue);\n };\n\n this.registerObserver(this, property, observer);\n\n // Determine the current value and add it to the render buffer\n // if necessary.\n attributeValue = get(this, property);\n Ember.View.applyAttributeBindings(buffer, attributeName, attributeValue);\n }, this);\n },\n\n /**\n @private\n\n Given a property name, returns a dasherized version of that\n property name if the property evaluates to a non-falsy value.\n\n For example, if the view has property `isUrgent` that evaluates to true,\n passing `isUrgent` to this method will return `\"is-urgent\"`.\n\n @method _classStringForProperty\n @param property\n */\n _classStringForProperty: function(property) {\n var parsedPath = Ember.View._parsePropertyPath(property);\n var path = parsedPath.path;\n\n var val = get(this, path);\n if (val === undefined && Ember.isGlobalPath(path)) {\n val = get(Ember.lookup, path);\n }\n\n return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n },\n\n // ..........................................................\n // ELEMENT SUPPORT\n //\n\n /**\n Returns the current DOM element for the view.\n\n @property element\n @type DOMElement\n */\n element: Ember.computed(function(key, value) {\n if (value !== undefined) {\n return this.currentState.setElement(this, value);\n } else {\n return this.currentState.getElement(this);\n }\n }).property('_parentView'),\n\n /**\n Returns a jQuery object for this view's element. If you pass in a selector\n string, this method will return a jQuery object, using the current element\n as its buffer.\n\n For example, calling `view.$('li')` will return a jQuery object containing\n all of the `li` elements inside the DOM element of this view.\n\n @property $\n @param {String} [selector] a jQuery-compatible selector string\n @return {jQuery} the CoreQuery object for the DOM node\n */\n $: function(sel) {\n return this.currentState.$(this, sel);\n },\n\n mutateChildViews: function(callback) {\n var childViews = this._childViews,\n idx = childViews.length,\n view;\n\n while(--idx >= 0) {\n view = childViews[idx];\n callback.call(this, view, idx);\n }\n\n return this;\n },\n\n forEachChildView: function(callback) {\n var childViews = this._childViews;\n\n if (!childViews) { return this; }\n\n var len = childViews.length,\n view, idx;\n\n for(idx = 0; idx < len; idx++) {\n view = childViews[idx];\n callback.call(this, view);\n }\n\n return this;\n },\n\n /**\n Appends the view's element to the specified parent element.\n\n If the view does not have an HTML representation yet, `createElement()`\n will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing.\n\n This is not typically a function that you will need to call directly when\n building your application. You might consider using `Ember.ContainerView`\n instead. If you do need to use `appendTo`, be sure that the target element\n you are providing is associated with an `Ember.Application` and does not\n have an ancestor element that is associated with an Ember view.\n\n @method appendTo\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} receiver\n */\n appendTo: function(target) {\n // Schedule the DOM element to be created and appended to the given\n // element after bindings have synchronized.\n this._insertElementLater(function() {\n Ember.assert(\"You cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n Replaces the content of the specified parent element with this view's\n element. If the view does not have an HTML representation yet,\n `createElement()` will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing\n\n @method replaceIn\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} received\n */\n replaceIn: function(target) {\n Ember.assert(\"You cannot replace an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n\n this._insertElementLater(function() {\n Ember.$(target).empty();\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n @private\n\n Schedules a DOM operation to occur during the next render phase. This\n ensures that all bindings have finished synchronizing before the view is\n rendered.\n\n To use, pass a function that performs a DOM operation.\n\n Before your function is called, this view and all child views will receive\n the `willInsertElement` event. After your function is invoked, this view\n and all of its child views will receive the `didInsertElement` event.\n\n ```javascript\n view._insertElementLater(function() {\n this.createElement();\n this.$().appendTo('body');\n });\n ```\n\n @method _insertElementLater\n @param {Function} fn the function that inserts the element into the DOM\n */\n _insertElementLater: function(fn) {\n this._scheduledInsert = Ember.run.scheduleOnce('render', this, '_insertElement', fn);\n },\n\n _insertElement: function (fn) {\n this._scheduledInsert = null;\n this.currentState.insertElement(this, fn);\n },\n\n /**\n Appends the view's element to the document body. If the view does\n not have an HTML representation yet, `createElement()` will be called\n automatically.\n\n If your application uses the `rootElement` property, you must append\n the view within that element. Rendering views outside of the `rootElement`\n is not supported.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the document body until all bindings have\n finished synchronizing.\n\n @method append\n @return {Ember.View} receiver\n */\n append: function() {\n return this.appendTo(document.body);\n },\n\n /**\n Removes the view's element from the element to which it is attached.\n\n @method remove\n @return {Ember.View} receiver\n */\n remove: function() {\n // What we should really do here is wait until the end of the run loop\n // to determine if the element has been re-appended to a different\n // element.\n // In the interim, we will just re-render if that happens. It is more\n // important than elements get garbage collected.\n if (!this.removedFromDOM) { this.destroyElement(); }\n this.invokeRecursively(function(view) {\n if (view.clearRenderedChildren) { view.clearRenderedChildren(); }\n });\n },\n\n elementId: null,\n\n /**\n Attempts to discover the element in the parent element. The default\n implementation looks for an element with an ID of `elementId` (or the\n view's guid if `elementId` is null). You can override this method to\n provide your own form of lookup. For example, if you want to discover your\n element using a CSS class name instead of an ID.\n\n @method findElementInParentElement\n @param {DOMElement} parentElement The parent's DOM element\n @return {DOMElement} The discovered element\n */\n findElementInParentElement: function(parentElem) {\n var id = \"#\" + this.elementId;\n return Ember.$(id)[0] || Ember.$(id, parentElem)[0];\n },\n\n /**\n Creates a DOM representation of the view and all of its\n child views by recursively calling the `render()` method.\n\n After the element has been created, `didInsertElement` will\n be called on this view and all of its child views.\n\n @method createElement\n @return {Ember.View} receiver\n */\n createElement: function() {\n if (get(this, 'element')) { return this; }\n\n var buffer = this.renderToBuffer();\n set(this, 'element', buffer.element());\n\n return this;\n },\n\n /**\n Called when a view is going to insert an element into the DOM.\n\n @event willInsertElement\n */\n willInsertElement: Ember.K,\n\n /**\n Called when the element of the view has been inserted into the DOM.\n Override this function to do any set up that requires an element in the\n document body.\n\n @event didInsertElement\n */\n didInsertElement: Ember.K,\n\n /**\n Called when the view is about to rerender, but before anything has\n been torn down. This is a good opportunity to tear down any manual\n observers you have installed based on the DOM state\n\n @event willClearRender\n */\n willClearRender: Ember.K,\n\n /**\n @private\n\n Run this callback on the current view and recursively on child views.\n\n @method invokeRecursively\n @param fn {Function}\n */\n invokeRecursively: function(fn) {\n var childViews = [this], currentViews, view;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n fn.call(view, view);\n if (view._childViews) {\n childViews.push.apply(childViews, view._childViews);\n }\n }\n }\n },\n\n triggerRecursively: function(eventName) {\n var childViews = [this], currentViews, view;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n if (view.trigger) { view.trigger(eventName); }\n if (view._childViews) {\n childViews.push.apply(childViews, view._childViews);\n }\n }\n }\n },\n\n /**\n Destroys any existing element along with the element for any child views\n as well. If the view does not currently have a element, then this method\n will do nothing.\n\n If you implement `willDestroyElement()` on your view, then this method will\n be invoked on your view before your element is destroyed to give you a\n chance to clean up any event handlers, etc.\n\n If you write a `willDestroyElement()` handler, you can assume that your\n `didInsertElement()` handler was called earlier for the same element.\n\n Normally you will not call or override this method yourself, but you may\n want to implement the above callbacks when it is run.\n\n @method destroyElement\n @return {Ember.View} receiver\n */\n destroyElement: function() {\n return this.currentState.destroyElement(this);\n },\n\n /**\n Called when the element of the view is going to be destroyed. Override\n this function to do any teardown that requires an element, like removing\n event listeners.\n\n @event willDestroyElement\n */\n willDestroyElement: function() {},\n\n /**\n @private\n\n Triggers the `willDestroyElement` event (which invokes the\n `willDestroyElement()` method if it exists) on this view and all child\n views.\n\n Before triggering `willDestroyElement`, it first triggers the\n `willClearRender` event recursively.\n\n @method _notifyWillDestroyElement\n */\n _notifyWillDestroyElement: function() {\n this.triggerRecursively('willClearRender');\n this.triggerRecursively('willDestroyElement');\n },\n\n _elementWillChange: Ember.beforeObserver(function() {\n this.forEachChildView(function(view) {\n Ember.propertyWillChange(view, 'element');\n });\n }, 'element'),\n\n /**\n @private\n\n If this view's element changes, we need to invalidate the caches of our\n child views so that we do not retain references to DOM elements that are\n no longer needed.\n\n @method _elementDidChange\n */\n _elementDidChange: Ember.observer(function() {\n this.forEachChildView(function(view) {\n Ember.propertyDidChange(view, 'element');\n });\n }, 'element'),\n\n /**\n Called when the parentView property has changed.\n\n @event parentViewDidChange\n */\n parentViewDidChange: Ember.K,\n\n instrumentName: 'view',\n\n instrumentDetails: function(hash) {\n hash.template = get(this, 'templateName');\n this._super(hash);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n this.lengthBeforeRender = this._childViews.length;\n var buffer = this._super(parentBuffer, bufferOperation);\n this.lengthAfterRender = this._childViews.length;\n\n return buffer;\n },\n\n renderToBufferIfNeeded: function () {\n return this.currentState.renderToBufferIfNeeded(this, this);\n },\n\n beforeRender: function(buffer) {\n this.applyAttributesToBuffer(buffer);\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n },\n\n applyAttributesToBuffer: function(buffer) {\n // Creates observers for all registered class name and attribute bindings,\n // then adds them to the element.\n var classNameBindings = get(this, 'classNameBindings');\n if (classNameBindings.length) {\n this._applyClassNameBindings(classNameBindings);\n }\n\n // Pass the render buffer so the method can apply attributes directly.\n // This isn't needed for class name bindings because they use the\n // existing classNames infrastructure.\n var attributeBindings = get(this, 'attributeBindings');\n if (attributeBindings.length) {\n this._applyAttributeBindings(buffer, attributeBindings);\n }\n\n buffer.setClasses(this.classNames);\n buffer.id(this.elementId);\n\n var role = get(this, 'ariaRole');\n if (role) {\n buffer.attr('role', role);\n }\n\n if (get(this, 'isVisible') === false) {\n buffer.style('display', 'none');\n }\n },\n\n // ..........................................................\n // STANDARD RENDER PROPERTIES\n //\n\n /**\n Tag name for the view's outer element. The tag name is only used when an\n element is first created. If you change the `tagName` for an element, you\n must destroy and recreate the view element.\n\n By default, the render buffer will use a `<div>` tag for views.\n\n @property tagName\n @type String\n @default null\n */\n\n // We leave this null by default so we can tell the difference between\n // the default case and a user-specified tag.\n tagName: null,\n\n /**\n The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.\n\n The full list of valid WAI-ARIA roles is available at:\n http://www.w3.org/TR/wai-aria/roles#roles_categorization\n\n @property ariaRole\n @type String\n @default null\n */\n ariaRole: null,\n\n /**\n Standard CSS class names to apply to the view's outer element. This\n property automatically inherits any class names defined by the view's\n superclasses as well.\n\n @property classNames\n @type Array\n @default ['ember-view']\n */\n classNames: ['ember-view'],\n\n /**\n A list of properties of the view to apply as class names. If the property\n is a string value, the value of that string will be applied as a class\n name.\n\n ```javascript\n // Applies the 'high' class to the view element\n Ember.View.create({\n classNameBindings: ['priority']\n priority: 'high'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as a dasherized class name.\n\n ```javascript\n // Applies the 'is-urgent' class to the view element\n Ember.View.create({\n classNameBindings: ['isUrgent']\n isUrgent: true\n });\n ```\n\n If you would prefer to use a custom value instead of the dasherized\n property name, you can pass a binding like this:\n\n ```javascript\n // Applies the 'urgent' class to the view element\n Ember.View.create({\n classNameBindings: ['isUrgent:urgent']\n isUrgent: true\n });\n ```\n\n This list of properties is inherited from the view's superclasses as well.\n\n @property classNameBindings\n @type Array\n @default []\n */\n classNameBindings: [],\n\n /**\n A list of properties of the view to apply as attributes. If the property is\n a string value, the value of that string will be applied as the attribute.\n\n ```javascript\n // Applies the type attribute to the element\n // with the value \"button\", like <div type=\"button\">\n Ember.View.create({\n attributeBindings: ['type'],\n type: 'button'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as an attribute.\n\n ```javascript\n // Renders something like <div enabled=\"enabled\">\n Ember.View.create({\n attributeBindings: ['enabled'],\n enabled: true\n });\n ```\n\n @property attributeBindings\n */\n attributeBindings: [],\n\n // .......................................................\n // CORE DISPLAY METHODS\n //\n\n /**\n @private\n\n Setup a view, but do not finish waking it up.\n - configure `childViews`\n - register the view with the global views hash, which is used for event\n dispatch\n\n @method init\n */\n init: function() {\n this.elementId = this.elementId || guidFor(this);\n\n this._super();\n\n // setup child views. be sure to clone the child views array first\n this._childViews = this._childViews.slice();\n\n Ember.assert(\"Only arrays are allowed for 'classNameBindings'\", Ember.typeOf(this.classNameBindings) === 'array');\n this.classNameBindings = Ember.A(this.classNameBindings.slice());\n\n Ember.assert(\"Only arrays are allowed for 'classNames'\", Ember.typeOf(this.classNames) === 'array');\n this.classNames = Ember.A(this.classNames.slice());\n\n var viewController = get(this, 'viewController');\n if (viewController) {\n viewController = get(viewController);\n if (viewController) {\n set(viewController, 'view', this);\n }\n }\n },\n\n appendChild: function(view, options) {\n return this.currentState.appendChild(this, view, options);\n },\n\n /**\n Removes the child view from the parent view.\n\n @method removeChild\n @param {Ember.View} view\n @return {Ember.View} receiver\n */\n removeChild: function(view) {\n // If we're destroying, the entire subtree will be\n // freed, and the DOM will be handled separately,\n // so no need to mess with childViews.\n if (this.isDestroying) { return; }\n\n // update parent node\n set(view, '_parentView', null);\n\n // remove view from childViews array.\n var childViews = this._childViews;\n\n Ember.EnumerableUtils.removeObject(childViews, view);\n\n this.propertyDidChange('childViews'); // HUH?! what happened to will change?\n\n return this;\n },\n\n /**\n Removes all children from the `parentView`.\n\n @method removeAllChildren\n @return {Ember.View} receiver\n */\n removeAllChildren: function() {\n return this.mutateChildViews(function(view) {\n this.removeChild(view);\n });\n },\n\n destroyAllChildren: function() {\n return this.mutateChildViews(function(view) {\n view.destroy();\n });\n },\n\n /**\n Removes the view from its `parentView`, if one is found. Otherwise\n does nothing.\n\n @method removeFromParent\n @return {Ember.View} receiver\n */\n removeFromParent: function() {\n var parent = this._parentView;\n\n // Remove DOM element from parent\n this.remove();\n\n if (parent) { parent.removeChild(this); }\n return this;\n },\n\n /**\n You must call `destroy` on a view to destroy the view (and all of its\n child views). This will remove the view from any parent node, then make\n sure that the DOM element managed by the view can be released by the\n memory manager.\n\n @method willDestroy\n */\n willDestroy: function() {\n // calling this._super() will nuke computed properties and observers,\n // so collect any information we need before calling super.\n var childViews = this._childViews,\n parent = this._parentView,\n childLen, i;\n\n // destroy the element -- this will avoid each child view destroying\n // the element over and over again...\n if (!this.removedFromDOM) { this.destroyElement(); }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].removedFromDOM = true;\n }\n\n // remove from non-virtual parent view if viewName was specified\n if (this.viewName) {\n var nonVirtualParentView = get(this, 'parentView');\n if (nonVirtualParentView) {\n set(nonVirtualParentView, this.viewName, null);\n }\n }\n\n // remove from parent if found. Don't call removeFromParent,\n // as removeFromParent will try to remove the element from\n // the DOM again.\n if (parent) { parent.removeChild(this); }\n\n this.transitionTo('destroyed');\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].destroy();\n }\n\n // next remove view from global hash\n if (!this.isVirtual) delete Ember.View.views[get(this, 'elementId')];\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n @method createChildView\n @param {Class} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n if (view.isView && view._parentView === this) { return view; }\n\n if (Ember.CoreView.detect(view)) {\n attrs = attrs || {};\n attrs._parentView = this;\n attrs.templateData = attrs.templateData || get(this, 'templateData');\n\n view = view.create(attrs);\n\n // don't set the property on a virtual view, as they are invisible to\n // consumers of the view API\n if (view.viewName) { set(get(this, 'concreteView'), view.viewName, view); }\n } else {\n Ember.assert('You must pass instance or subclass of View', view.isView);\n\n if (attrs) {\n view.setProperties(attrs);\n }\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', get(this, 'templateData'));\n }\n\n set(view, '_parentView', this);\n }\n\n return view;\n },\n\n becameVisible: Ember.K,\n becameHidden: Ember.K,\n\n /**\n @private\n\n When the view's `isVisible` property changes, toggle the visibility\n element of the actual DOM element.\n\n @method _isVisibleDidChange\n */\n _isVisibleDidChange: Ember.observer(function() {\n var $el = this.$();\n if (!$el) { return; }\n\n var isVisible = get(this, 'isVisible');\n\n $el.toggle(isVisible);\n\n if (this._isAncestorHidden()) { return; }\n\n if (isVisible) {\n this._notifyBecameVisible();\n } else {\n this._notifyBecameHidden();\n }\n }, 'isVisible'),\n\n _notifyBecameVisible: function() {\n this.trigger('becameVisible');\n\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameVisible();\n }\n });\n },\n\n _notifyBecameHidden: function() {\n this.trigger('becameHidden');\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameHidden();\n }\n });\n },\n\n _isAncestorHidden: function() {\n var parent = get(this, 'parentView');\n\n while (parent) {\n if (get(parent, 'isVisible') === false) { return true; }\n\n parent = get(parent, 'parentView');\n }\n\n return false;\n },\n\n clearBuffer: function() {\n this.invokeRecursively(function(view) {\n view.buffer = null;\n });\n },\n\n transitionTo: function(state, children) {\n this.currentState = this.states[state];\n this.state = state;\n\n if (children !== false) {\n this.forEachChildView(function(view) {\n view.transitionTo(state);\n });\n }\n },\n\n // .......................................................\n // EVENT HANDLING\n //\n\n /**\n @private\n\n Handle events from `Ember.EventDispatcher`\n\n @method handleEvent\n @param eventName {String}\n @param evt {Event}\n */\n handleEvent: function(eventName, evt) {\n return this.currentState.handleEvent(this, eventName, evt);\n },\n\n registerObserver: function(root, path, target, observer) {\n if (!observer && 'function' === typeof target) {\n observer = target;\n target = null;\n }\n var view = this,\n stateCheckedObserver = function(){\n view.currentState.invokeObserver(this, observer);\n };\n Ember.addObserver(root, path, target, stateCheckedObserver);\n\n this.one('willClearRender', function() {\n Ember.removeObserver(root, path, target, stateCheckedObserver);\n });\n }\n\n});\n\n/*\n Describe how the specified actions should behave in the various\n states that a view can exist in. Possible states:\n\n * preRender: when a view is first instantiated, and after its\n element was destroyed, it is in the preRender state\n * inBuffer: once a view has been rendered, but before it has\n been inserted into the DOM, it is in the inBuffer state\n * inDOM: once a view has been inserted into the DOM it is in\n the inDOM state. A view spends the vast majority of its\n existence in this state.\n * destroyed: once a view has been destroyed (using the destroy\n method), it is in this state. No further actions can be invoked\n on a destroyed view.\n*/\n\n // in the destroyed state, everything is illegal\n\n // before rendering has begun, all legal manipulations are noops.\n\n // inside the buffer, legal manipulations are done on the buffer\n\n // once the view has been inserted into the DOM, legal manipulations\n // are done on the DOM element.\n\nfunction notifyMutationListeners() {\n Ember.run.once(Ember.View, 'notifyMutationListeners');\n}\n\nvar DOMManager = {\n prepend: function(view, html) {\n view.$().prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.$().after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.$().html(html);\n notifyMutationListeners();\n },\n\n replace: function(view) {\n var element = get(view, 'element');\n\n set(view, 'element', null);\n\n view._insertElementLater(function() {\n Ember.$(element).replaceWith(get(view, 'element'));\n notifyMutationListeners();\n });\n },\n\n remove: function(view) {\n view.$().remove();\n notifyMutationListeners();\n },\n\n empty: function(view) {\n view.$().empty();\n notifyMutationListeners();\n }\n};\n\nEmber.View.reopen({\n domManager: DOMManager\n});\n\nEmber.View.reopenClass({\n\n /**\n @private\n\n Parse a path and return an object which holds the parsed properties.\n\n For example a path like \"content.isEnabled:enabled:disabled\" wil return the\n following object:\n\n ```javascript\n {\n path: \"content.isEnabled\",\n className: \"enabled\",\n falsyClassName: \"disabled\",\n classNames: \":enabled:disabled\"\n }\n ```\n\n @method _parsePropertyPath\n @static\n */\n _parsePropertyPath: function(path) {\n var split = path.split(':'),\n propertyPath = split[0],\n classNames = \"\",\n className,\n falsyClassName;\n\n // check if the property is defined as prop:class or prop:trueClass:falseClass\n if (split.length > 1) {\n className = split[1];\n if (split.length === 3) { falsyClassName = split[2]; }\n\n classNames = ':' + className;\n if (falsyClassName) { classNames += \":\" + falsyClassName; }\n }\n\n return {\n path: propertyPath,\n classNames: classNames,\n className: (className === '') ? undefined : className,\n falsyClassName: falsyClassName\n };\n },\n\n /**\n @private\n\n Get the class name for a given value, based on the path, optional\n `className` and optional `falsyClassName`.\n\n - if a `className` or `falsyClassName` has been specified:\n - if the value is truthy and `className` has been specified,\n `className` is returned\n - if the value is falsy and `falsyClassName` has been specified,\n `falsyClassName` is returned\n - otherwise `null` is returned\n - if the value is `true`, the dasherized last part of the supplied path\n is returned\n - if the value is not `false`, `undefined` or `null`, the `value`\n is returned\n - if none of the above rules apply, `null` is returned\n\n @method _classStringForValue\n @param path\n @param val\n @param className\n @param falsyClassName\n @static\n */\n _classStringForValue: function(path, val, className, falsyClassName) {\n // When using the colon syntax, evaluate the truthiness or falsiness\n // of the value to determine which className to return\n if (className || falsyClassName) {\n if (className && !!val) {\n return className;\n\n } else if (falsyClassName && !val) {\n return falsyClassName;\n\n } else {\n return null;\n }\n\n // If value is a Boolean and true, return the dasherized property\n // name.\n } else if (val === true) {\n // Normalize property path to be suitable for use\n // as a class name. For exaple, content.foo.barBaz\n // becomes bar-baz.\n var parts = path.split('.');\n return Ember.String.dasherize(parts[parts.length-1]);\n\n // If the value is not false, undefined, or null, return the current\n // value of the property.\n } else if (val !== false && val !== undefined && val !== null) {\n return val;\n\n // Nothing to display. Return null so that the old class is removed\n // but no new class is added.\n } else {\n return null;\n }\n }\n});\n\nvar mutation = Ember.Object.extend(Ember.Evented).create();\n\nEmber.View.addMutationListener = function(callback) {\n mutation.on('change', callback);\n};\n\nEmber.View.removeMutationListener = function(callback) {\n mutation.off('change', callback);\n};\n\nEmber.View.notifyMutationListeners = function() {\n mutation.trigger('change');\n};\n\n/**\n Global views hash\n\n @property views\n @static\n @type Hash\n*/\nEmber.View.views = {};\n\n// If someone overrides the child views computed property when\n// defining their class, we want to be able to process the user's\n// supplied childViews and then restore the original computed property\n// at view initialization time. This happens in Ember.ContainerView's init\n// method.\nEmber.View.childViewsProperty = childViewsProperty;\n\nEmber.View.applyAttributeBindings = function(elem, name, value) {\n var type = Ember.typeOf(value);\n\n // if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js\n if (name !== 'value' && (type === 'string' || (type === 'number' && !isNaN(value)))) {\n if (value !== elem.attr(name)) {\n elem.attr(name, value);\n }\n } else if (name === 'value' || type === 'boolean') {\n // We can't set properties to undefined\n if (value === undefined) { value = null; }\n\n if (value !== elem.prop(name)) {\n // value and booleans should always be properties\n elem.prop(name, value);\n }\n } else if (!value) {\n elem.removeAttr(name);\n }\n};\n\nEmber.View.states = states;\n\n})();\n//@ sourceURL=ember-views/views/view");minispade.register('ember', "(function() {minispade.require('ember-application');\n\n/**\nEmber\n\n@module ember\n*/\n\n})();\n//@ sourceURL=ember");minispade.register('loader', "(function() {var define, requireModule;\n\n(function() {\n var registry = {}, seen = {};\n\n define = function(name, deps, callback) {\n registry[name] = { deps: deps, callback: callback };\n };\n\n requireModule = function(name) {\n if (seen[name]) { return seen[name]; }\n seen[name] = {};\n\n var mod = registry[name],\n deps = mod.deps,\n callback = mod.callback,\n reified = [],\n exports;\n\n for (var i=0, l=deps.length; i<l; i++) {\n if (deps[i] === 'exports') {\n reified.push(exports = {});\n } else {\n reified.push(requireModule(deps[i]));\n }\n }\n\n var value = callback.apply(this, reified);\n return seen[name] = exports || value;\n };\n})();\n\n})();\n//@ sourceURL=loader");minispade.register('metamorph', "(function() {define(\"metamorph\",\n [],\n function() {\n \"use strict\";\n // ==========================================================================\n // Project: metamorph\n // Copyright: ©2011 My Company Inc. All rights reserved.\n // ==========================================================================\n\n var K = function(){},\n guid = 0,\n document = this.document,\n\n // Feature-detect the W3C range API, the extended check is for IE9 which only partially supports ranges\n supportsRange = document && ('createRange' in document) && (typeof Range !== 'undefined') && Range.prototype.createContextualFragment,\n\n // Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n // is a \"zero-scope\" element. This problem can be worked around by making\n // the first node an invisible text node. We, like Modernizr, use ­\n needsShy = document && (function(){\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n })(),\n\n\n // IE 8 (and likely earlier) likes to move whitespace preceeding\n // a script tag to appear after it. This means that we can\n // accidentally remove whitespace when updating a morph.\n movesWhitespace = document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n })();\n\n // Constructor that supports either Metamorph('foo') or new\n // Metamorph('foo');\n //\n // Takes a string of HTML as the argument.\n\n var Metamorph = function(html) {\n var self;\n\n if (this instanceof Metamorph) {\n self = this;\n } else {\n self = new K();\n }\n\n self.innerHTML = html;\n var myGuid = 'metamorph-'+(guid++);\n self.start = myGuid + '-start';\n self.end = myGuid + '-end';\n\n return self;\n };\n\n K.prototype = Metamorph.prototype;\n\n var rangeFor, htmlFunc, removeFunc, outerHTMLFunc, appendToFunc, afterFunc, prependFunc, startTagFunc, endTagFunc;\n\n outerHTMLFunc = function() {\n return this.startTag() + this.innerHTML + this.endTag();\n };\n\n startTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.start + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n endTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.end + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n // If we have the W3C range API, this process is relatively straight forward.\n if (supportsRange) {\n\n // Get a range for the current morph. Optionally include the starting and\n // ending placeholders.\n rangeFor = function(morph, outerToo) {\n var range = document.createRange();\n var before = document.getElementById(morph.start);\n var after = document.getElementById(morph.end);\n\n if (outerToo) {\n range.setStartBefore(before);\n range.setEndAfter(after);\n } else {\n range.setStartAfter(before);\n range.setEndBefore(after);\n }\n\n return range;\n };\n\n htmlFunc = function(html, outerToo) {\n // get a range for the current metamorph object\n var range = rangeFor(this, outerToo);\n\n // delete the contents of the range, which will be the\n // nodes between the starting and ending placeholder.\n range.deleteContents();\n\n // create a new document fragment for the HTML\n var fragment = range.createContextualFragment(html);\n\n // insert the fragment into the range\n range.insertNode(fragment);\n };\n\n removeFunc = function() {\n // get a range for the current metamorph object including\n // the starting and ending placeholders.\n var range = rangeFor(this, true);\n\n // delete the entire range.\n range.deleteContents();\n };\n\n appendToFunc = function(node) {\n var range = document.createRange();\n range.setStart(node);\n range.collapse(false);\n var frag = range.createContextualFragment(this.outerHTML());\n node.appendChild(frag);\n };\n\n afterFunc = function(html) {\n var range = document.createRange();\n var after = document.getElementById(this.end);\n\n range.setStartAfter(after);\n range.setEndAfter(after);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n prependFunc = function(html) {\n var range = document.createRange();\n var start = document.getElementById(this.start);\n\n range.setStartAfter(start);\n range.setEndAfter(start);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n } else {\n /**\n * This code is mostly taken from jQuery, with one exception. In jQuery's case, we\n * have some HTML and we need to figure out how to convert it into some nodes.\n *\n * In this case, jQuery needs to scan the HTML looking for an opening tag and use\n * that as the key for the wrap map. In our case, we know the parent node, and\n * can use its type as the key for the wrap map.\n **/\n var wrapMap = {\n select: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n fieldset: [ 1, \"<fieldset>\", \"</fieldset>\" ],\n table: [ 1, \"<table>\", \"</table>\" ],\n tbody: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n tr: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n colgroup: [ 2, \"<table><tbody></tbody><colgroup>\", \"</colgroup></table>\" ],\n map: [ 1, \"<map>\", \"</map>\" ],\n _default: [ 0, \"\", \"\" ]\n };\n\n var findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n };\n\n var setInnerHTML = function(element, html) {\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n };\n\n /**\n * Given a parent node and some HTML, generate a set of nodes. Return the first\n * node, which will allow us to traverse the rest using nextSibling.\n *\n * We need to do this because innerHTML in IE does not really parse the nodes.\n **/\n var firstNodeFor = function(parentNode, html) {\n var arr = wrapMap[parentNode.tagName.toLowerCase()] || wrapMap._default;\n var depth = arr[0], start = arr[1], end = arr[2];\n\n if (needsShy) { html = '­'+html; }\n\n var element = document.createElement('div');\n\n setInnerHTML(element, start + html + end);\n\n for (var i=0; i<=depth; i++) {\n element = element.firstChild;\n }\n\n // Look for ­ to remove it.\n if (needsShy) {\n var shyElement = element;\n\n // Sometimes we get nameless elements with the shy inside\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n\n // At this point it's the actual unicode character.\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n\n return element;\n };\n\n /**\n * In some cases, Internet Explorer can create an anonymous node in\n * the hierarchy with no tagName. You can create this scenario via:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table>­<script></script><tr><td>hi</td></tr></table>\";\n * div.firstChild.firstChild.tagName //=> \"\"\n *\n * If our script markers are inside such a node, we need to find that\n * node and use *it* as the marker.\n **/\n var realNode = function(start) {\n while (start.parentNode.tagName === \"\") {\n start = start.parentNode;\n }\n\n return start;\n };\n\n /**\n * When automatically adding a tbody, Internet Explorer inserts the\n * tbody immediately before the first <tr>. Other browsers create it\n * before the first node, no matter what.\n *\n * This means the the following code:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table><script id='first'></script><tr><td>hi</td></tr><script id='last'></script></table>\n *\n * Generates the following DOM in IE:\n *\n * + div\n * + table\n * - script id='first'\n * + tbody\n * + tr\n * + td\n * - \"hi\"\n * - script id='last'\n *\n * Which means that the two script tags, even though they were\n * inserted at the same point in the hierarchy in the original\n * HTML, now have different parents.\n *\n * This code reparents the first script tag by making it the tbody's\n * first child.\n **/\n var fixParentage = function(start, end) {\n if (start.parentNode !== end.parentNode) {\n end.parentNode.insertBefore(start, end.parentNode.firstChild);\n }\n };\n\n htmlFunc = function(html, outerToo) {\n // get the real starting node. see realNode for details.\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n var parentNode = end.parentNode;\n var node, nextSibling, last;\n\n // make sure that the start and end nodes share the same\n // parent. If not, fix it.\n fixParentage(start, end);\n\n // remove all of the nodes after the starting placeholder and\n // before the ending placeholder.\n node = start.nextSibling;\n while (node) {\n nextSibling = node.nextSibling;\n last = node === end;\n\n // if this is the last node, and we want to remove it as well,\n // set the `end` node to the next sibling. This is because\n // for the rest of the function, we insert the new nodes\n // before the end (note that insertBefore(node, null) is\n // the same as appendChild(node)).\n //\n // if we do not want to remove it, just break.\n if (last) {\n if (outerToo) { end = node.nextSibling; } else { break; }\n }\n\n node.parentNode.removeChild(node);\n\n // if this is the last node and we didn't break before\n // (because we wanted to remove the outer nodes), break\n // now.\n if (last) { break; }\n\n node = nextSibling;\n }\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(start.parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, end);\n node = nextSibling;\n }\n };\n\n // remove the nodes in the DOM representing this metamorph.\n //\n // this includes the starting and ending placeholders.\n removeFunc = function() {\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n\n this.html('');\n start.parentNode.removeChild(start);\n end.parentNode.removeChild(end);\n };\n\n appendToFunc = function(parentNode) {\n var node = firstNodeFor(parentNode, this.outerHTML());\n var nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.appendChild(node);\n node = nextSibling;\n }\n };\n\n afterFunc = function(html) {\n // get the real starting node. see realNode for details.\n var end = document.getElementById(this.end);\n var insertBefore = end.nextSibling;\n var parentNode = end.parentNode;\n var nextSibling;\n var node;\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n\n prependFunc = function(html) {\n var start = document.getElementById(this.start);\n var parentNode = start.parentNode;\n var nextSibling;\n var node;\n\n node = firstNodeFor(parentNode, html);\n var insertBefore = start.nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n }\n\n Metamorph.prototype.html = function(html) {\n this.checkRemoved();\n if (html === undefined) { return this.innerHTML; }\n\n htmlFunc.call(this, html);\n\n this.innerHTML = html;\n };\n\n Metamorph.prototype.replaceWith = function(html) {\n this.checkRemoved();\n htmlFunc.call(this, html, true);\n };\n\n Metamorph.prototype.remove = removeFunc;\n Metamorph.prototype.outerHTML = outerHTMLFunc;\n Metamorph.prototype.appendTo = appendToFunc;\n Metamorph.prototype.after = afterFunc;\n Metamorph.prototype.prepend = prependFunc;\n Metamorph.prototype.startTag = startTagFunc;\n Metamorph.prototype.endTag = endTagFunc;\n\n Metamorph.prototype.isRemoved = function() {\n var before = document.getElementById(this.start);\n var after = document.getElementById(this.end);\n\n return !before || !after;\n };\n\n Metamorph.prototype.checkRemoved = function() {\n if (this.isRemoved()) {\n throw new Error(\"Cannot perform operations on a Metamorph that is not in the DOM.\");\n }\n };\n\n return Metamorph;\n });\n\n})();\n//@ sourceURL=metamorph");minispade.register('rsvp', "(function() {define(\"rsvp\",\n [],\n function() {\n \"use strict\";\n var browserGlobal = (typeof window !== 'undefined') ? window : {};\n\n var MutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n var RSVP, async;\n\n if (typeof process !== 'undefined' &&\n {}.toString.call(process) === '[object process]') {\n async = function(callback, binding) {\n process.nextTick(function() {\n callback.call(binding);\n });\n };\n } else if (MutationObserver) {\n var queue = [];\n\n var observer = new MutationObserver(function() {\n var toProcess = queue.slice();\n queue = [];\n\n toProcess.forEach(function(tuple) {\n var callback = tuple[0], binding = tuple[1];\n callback.call(binding);\n });\n });\n\n var element = document.createElement('div');\n observer.observe(element, { attributes: true });\n\n // Chrome Memory Leak: https://bugs.webkit.org/show_bug.cgi?id=93661\n window.addEventListener('unload', function(){\n observer.disconnect();\n observer = null;\n });\n\n async = function(callback, binding) {\n queue.push([callback, binding]);\n element.setAttribute('drainQueue', 'drainQueue');\n };\n } else {\n async = function(callback, binding) {\n setTimeout(function() {\n callback.call(binding);\n }, 1);\n };\n }\n\n var Event = function(type, options) {\n this.type = type;\n\n for (var option in options) {\n if (!options.hasOwnProperty(option)) { continue; }\n\n this[option] = options[option];\n }\n };\n\n var indexOf = function(callbacks, callback) {\n for (var i=0, l=callbacks.length; i<l; i++) {\n if (callbacks[i][0] === callback) { return i; }\n }\n\n return -1;\n };\n\n var callbacksFor = function(object) {\n var callbacks = object._promiseCallbacks;\n\n if (!callbacks) {\n callbacks = object._promiseCallbacks = {};\n }\n\n return callbacks;\n };\n\n var EventTarget = {\n mixin: function(object) {\n object.on = this.on;\n object.off = this.off;\n object.trigger = this.trigger;\n return object;\n },\n\n on: function(eventNames, callback, binding) {\n var allCallbacks = callbacksFor(this), callbacks, eventName;\n eventNames = eventNames.split(/\\s+/);\n binding = binding || this;\n\n while (eventName = eventNames.shift()) {\n callbacks = allCallbacks[eventName];\n\n if (!callbacks) {\n callbacks = allCallbacks[eventName] = [];\n }\n\n if (indexOf(callbacks, callback) === -1) {\n callbacks.push([callback, binding]);\n }\n }\n },\n\n off: function(eventNames, callback) {\n var allCallbacks = callbacksFor(this), callbacks, eventName, index;\n eventNames = eventNames.split(/\\s+/);\n\n while (eventName = eventNames.shift()) {\n if (!callback) {\n allCallbacks[eventName] = [];\n continue;\n }\n\n callbacks = allCallbacks[eventName];\n\n index = indexOf(callbacks, callback);\n\n if (index !== -1) { callbacks.splice(index, 1); }\n }\n },\n\n trigger: function(eventName, options) {\n var allCallbacks = callbacksFor(this),\n callbacks, callbackTuple, callback, binding, event;\n\n if (callbacks = allCallbacks[eventName]) {\n // Don't cache the callbacks.length since it may grow\n for (var i=0; i<callbacks.length; i++) {\n callbackTuple = callbacks[i];\n callback = callbackTuple[0];\n binding = callbackTuple[1];\n\n if (typeof options !== 'object') {\n options = { detail: options };\n }\n\n event = new Event(eventName, options);\n callback.call(binding, event);\n }\n }\n }\n };\n\n var Promise = function() {\n this.on('promise:resolved', function(event) {\n this.trigger('success', { detail: event.detail });\n }, this);\n\n this.on('promise:failed', function(event) {\n this.trigger('error', { detail: event.detail });\n }, this);\n };\n\n var noop = function() {};\n\n var invokeCallback = function(type, promise, callback, event) {\n var hasCallback = typeof callback === 'function',\n value, error, succeeded, failed;\n\n if (hasCallback) {\n try {\n value = callback(event.detail);\n succeeded = true;\n } catch(e) {\n failed = true;\n error = e;\n }\n } else {\n value = event.detail;\n succeeded = true;\n }\n\n if (value && typeof value.then === 'function') {\n value.then(function(value) {\n promise.resolve(value);\n }, function(error) {\n promise.reject(error);\n });\n } else if (hasCallback && succeeded) {\n promise.resolve(value);\n } else if (failed) {\n promise.reject(error);\n } else {\n promise[type](value);\n }\n };\n\n Promise.prototype = {\n then: function(done, fail) {\n var thenPromise = new Promise();\n\n if (this.isResolved) {\n RSVP.async(function() {\n invokeCallback('resolve', thenPromise, done, { detail: this.resolvedValue });\n }, this);\n }\n\n if (this.isRejected) {\n RSVP.async(function() {\n invokeCallback('reject', thenPromise, fail, { detail: this.rejectedValue });\n }, this);\n }\n\n this.on('promise:resolved', function(event) {\n invokeCallback('resolve', thenPromise, done, event);\n });\n\n this.on('promise:failed', function(event) {\n invokeCallback('reject', thenPromise, fail, event);\n });\n\n return thenPromise;\n },\n\n resolve: function(value) {\n resolve(this, value);\n\n this.resolve = noop;\n this.reject = noop;\n },\n\n reject: function(value) {\n reject(this, value);\n\n this.resolve = noop;\n this.reject = noop;\n }\n };\n\n function resolve(promise, value) {\n RSVP.async(function() {\n promise.trigger('promise:resolved', { detail: value });\n promise.isResolved = true;\n promise.resolvedValue = value;\n });\n }\n\n function reject(promise, value) {\n RSVP.async(function() {\n promise.trigger('promise:failed', { detail: value });\n promise.isRejected = true;\n promise.rejectedValue = value;\n });\n }\n\n function all(promises) {\n var i, results = [];\n var allPromise = new Promise();\n var remaining = promises.length;\n\n if (remaining === 0) {\n allPromise.resolve([]);\n }\n\n var resolver = function(index) {\n return function(value) {\n resolve(index, value);\n };\n };\n\n var resolve = function(index, value) {\n results[index] = value;\n if (--remaining === 0) {\n allPromise.resolve(results);\n }\n };\n\n var reject = function(error) {\n allPromise.reject(error);\n };\n\n for (i = 0; i < remaining; i++) {\n promises[i].then(resolver(i), reject);\n }\n return allPromise;\n }\n\n EventTarget.mixin(Promise.prototype);\n\n RSVP = { async: async, Promise: Promise, Event: Event, EventTarget: EventTarget, all: all, raiseOnUncaughtExceptions: true };\n return RSVP;\n });\n\n})();\n//@ sourceURL=rsvp");
\ No newline at end of file