// ========================================================================== // Project: Ember - JavaScript Application Framework // Copyright: Copyright 2011-2013 Tilde Inc. and contributors // Portions Copyright 2006-2011 Strobe Inc. // Portions Copyright 2008-2011 Apple Inc. All rights reserved. // License: Licensed under MIT license // See https://raw.github.com/emberjs/ember.js/master/LICENSE // ========================================================================== // Version: 1.3.0-beta.2 var define, requireModule; (function() { var registry = {}, seen = {}; define = function(name, deps, callback) { registry[name] = { deps: deps, callback: callback }; }; requireModule = function(name) { if (seen[name]) { return seen[name]; } seen[name] = {}; var mod, deps, callback, reified, exports; mod = registry[name]; if (!mod) { throw new Error("Module '" + name + "' not found."); } deps = mod.deps; callback = mod.callback; reified = []; for (var i=0, l=deps.length; i true\n\n container.unregister('model:user')\n container.lookup('model:user') === undefined //=> true\n ```\n\n @method unregister\n @param {String} fullName\n */\n unregister: function(fullName) {\n var normalizedName = this.normalize(fullName);\n\n this.registry.remove(normalizedName);\n this.cache.remove(normalizedName);\n this.factoryCache.remove(normalizedName);\n this._options.remove(normalizedName);\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n By default `resolve` will retrieve the factory from\n its container's registry.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n container.resolve('api:twitter') // => Twitter\n ```\n\n Optionally the container can be provided with a custom resolver.\n If provided, `resolve` will first provide the custom resolver\n the oppertunity to resolve the fullName, otherwise it will fallback\n to the registry.\n\n ```javascript\n var container = new Container();\n container.resolver = function(fullName) {\n // lookup via the module system of choice\n };\n\n // the twitter factory is added to the module system\n container.resolve('api:twitter') // => Twitter\n ```\n\n @method resolve\n @param {String} fullName\n @return {Function} fullName's factory\n */\n resolve: function(fullName) {\n return this.resolver(fullName) || this.registry.get(fullName);\n },\n\n /**\n A hook that can be used to describe how the resolver will\n attempt to find the factory.\n\n For example, the default Ember `.describe` returns the full\n class name (including namespace) where Ember's resolver expects\n to find the `fullName`.\n\n @method describe\n */\n describe: function(fullName) {\n return fullName;\n },\n\n /**\n A hook to enable custom fullName normalization behaviour\n\n @method normalize\n @param {String} fullName\n @return {string} normalized fullName\n */\n normalize: function(fullName) {\n return fullName;\n },\n\n /**\n @method makeToString\n\n @param {any} factory\n @param {string} fullName\n @return {function} toString function\n */\n makeToString: function(factory, fullName) {\n return factory.toString();\n },\n\n /**\n Given a fullName return a corresponding instance.\n\n The default behaviour is for lookup to return a singleton instance.\n The singleton is scoped to the container, allowing multiple containers\n to all have their own locally scoped singletons.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter');\n\n twitter instanceof Twitter; // => true\n\n // by default the container will return singletons\n twitter2 = container.lookup('api:twitter');\n twitter instanceof Twitter; // => true\n\n twitter === twitter2; //=> true\n ```\n\n If singletons are not wanted an optional flag can be provided at lookup.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter', { singleton: false });\n var twitter2 = container.lookup('api:twitter', { singleton: false });\n\n twitter === twitter2; //=> false\n ```\n\n @method lookup\n @param {String} fullName\n @param {Object} options\n @return {any}\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 === undefined) { return; }\n\n if (isSingleton(this, fullName) && options.singleton !== false) {\n this.cache.set(fullName, value);\n }\n\n return value;\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n @method lookupFactory\n @param {String} fullName\n @return {any}\n */\n lookupFactory: function(fullName) {\n return factoryFor(this, fullName);\n },\n\n /**\n Given a fullName check if the container is aware of its factory\n or singleton instance.\n\n @method has\n @param {String} fullName\n @return {Boolean}\n */\n has: function(fullName) {\n if (this.cache.has(fullName)) {\n return true;\n }\n\n return !!this.resolve(fullName);\n },\n\n /**\n Allow registering options for all factories of a type.\n\n ```javascript\n var container = new Container();\n\n // if all of type `connection` must not be singletons\n container.optionsForType('connection', { singleton: false });\n\n container.register('connection:twitter', TwitterConnection);\n container.register('connection:facebook', FacebookConnection);\n\n var twitter = container.lookup('connection:twitter');\n var twitter2 = container.lookup('connection:twitter');\n\n twitter === twitter2; // => false\n\n var facebook = container.lookup('connection:facebook');\n var facebook2 = container.lookup('connection:facebook');\n\n facebook === facebook2; // => false\n ```\n\n @method optionsForType\n @param {String} type\n @param {Object} options\n */\n optionsForType: function(type, options) {\n if (this.parent) { illegalChildOperation('optionsForType'); }\n\n this._typeOptions.set(type, options);\n },\n\n /**\n @method options\n @param {String} type\n @param {Object} options\n */\n options: function(type, options) {\n this.optionsForType(type, options);\n },\n\n /**\n @private\n\n Used only via `injection`.\n\n Provides a specialized form of injection, specifically enabling\n all objects of one type to be injected with a reference to another\n object.\n\n For example, provided each object of type `controller` needed a `router`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.register('router:main', Router);\n container.register('controller:user', UserController);\n container.register('controller:post', PostController);\n\n container.typeInjection('controller', 'router', 'router:main');\n\n var user = container.lookup('controller:user');\n var post = container.lookup('controller:post');\n\n user.router instanceof Router; //=> true\n post.router instanceof Router; //=> true\n\n // both controllers share the same router\n user.router === post.router; //=> true\n ```\n\n @method typeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n typeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('typeInjection'); }\n\n addTypeInjection(this.typeInjections, type, property, fullName);\n },\n\n /**\n Defines injection rules.\n\n These rules are used to inject dependencies onto objects when they\n are instantiated.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('source:main', Source);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another fullName\n // eg. each user model gets a post model\n container.injection('model:user', 'post', 'model:post');\n\n // injecting one fullName on another type\n container.injection('model', 'source', 'source:main');\n\n var user = container.lookup('model:user');\n var post = container.lookup('model:post');\n\n user.source instanceof Source; //=> true\n post.source instanceof Source; //=> true\n\n user.post instanceof Post; //=> true\n\n // and both models share the same source\n user.source === post.source; //=> true\n ```\n\n @method injection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\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 addInjection(this.injections, factoryName, property, injectionName);\n },\n\n\n /**\n @private\n\n Used only via `factoryInjection`.\n\n Provides a specialized form of injection, specifically enabling\n all factory of one type to be injected with a reference to another\n object.\n\n For example, provided each factory of type `model` needed a `store`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.register('store:main', SomeStore);\n\n container.factoryTypeInjection('model', 'store', 'store:main');\n\n var store = container.lookup('store:main');\n var UserFactory = container.lookupFactory('model:user');\n\n UserFactory.store instanceof SomeStore; //=> true\n ```\n\n @method factoryTypeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n factoryTypeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('factoryTypeInjection'); }\n\n addTypeInjection(this.factoryTypeInjections, type, property, fullName);\n },\n\n /**\n Defines factory injection rules.\n\n Similar to regular injection rules, but are run against factories, via\n `Container#lookupFactory`.\n\n These rules are used to inject objects onto factories when they\n are looked up.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('store:main', Store);\n container.register('store:secondary', OtherStore);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another type\n container.factoryInjection('model', 'store', 'store:main');\n\n // injecting one fullName on another fullName\n container.factoryInjection('model:post', 'secondaryStore', 'store:secondary');\n\n var UserFactory = container.lookupFactory('model:user');\n var PostFactory = container.lookupFactory('model:post');\n var store = container.lookup('store:main');\n\n UserFactory.store instanceof Store; //=> true\n UserFactory.secondaryStore instanceof OtherStore; //=> false\n\n PostFactory.store instanceof Store; //=> true\n PostFactory.secondaryStore instanceof OtherStore; //=> true\n\n // and both models share the same source instance\n UserFactory.store === PostFactory.store; //=> true\n ```\n\n @method factoryInjection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\n */\n factoryInjection: function(factoryName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n if (factoryName.indexOf(':') === -1) {\n return this.factoryTypeInjection(factoryName, property, injectionName);\n }\n\n addInjection(this.factoryInjections, factoryName, property, injectionName);\n },\n\n /**\n A depth first traversal, destroying the container, its descendant containers and all\n their managed objects.\n\n @method destroy\n */\n destroy: function() {\n\n for (var i=0, l=this.children.length; i 0) {\n Ember.assert(' `' + Ember.inspect(this) + ' specifies `needs`, but does not have a container. Please ensure this controller was instantiated with a container.', this.container);\n\n verifyNeedsDependencies(this, this.container, needs);\n\n // if needs then initialize controllers proxy\n get(this, 'controllers');\n }\n\n this._super.apply(this, arguments);\n },\n\n /**\n @method controllerFor\n @see {Ember.Route#controllerFor}\n @deprecated Use `needs` instead\n */\n controllerFor: function(controllerName) {\n Ember.deprecate(\"Controller#controllerFor is deprecated, please use Controller#needs instead\");\n return Ember.controllerFor(get(this, 'container'), controllerName);\n },\n\n /**\n Stores the instances of other controllers available from within\n this controller. Any controller listed by name in the `needs`\n property will be accessible by name through this property.\n\n ```javascript\n App.CommentsController = Ember.ArrayController.extend({\n needs: ['post'],\n postTitle: function(){\n var currentPost = this.get('controllers.post'); // instance of App.PostController\n return currentPost.get('title');\n }.property('controllers.post.title')\n });\n ```\n\n @see {Ember.ControllerMixin#needs}\n @property {Object} controllers\n @default null\n */\n controllers: Ember.computed(function() {\n var controller = this;\n\n return {\n needs: get(controller, 'needs'),\n container: get(controller, 'container'),\n unknownProperty: function(controllerName) {\n var needs = this.needs,\n dependency, i, l;\n for (i=0, l=needs.length; i 0);\n this._readinessDeferrals++;\n },\n\n /**\n Call `advanceReadiness` after any asynchronous setup logic has completed.\n Each call to `deferReadiness` must be matched by a call to `advanceReadiness`\n or the application will never become ready and routing will not begin.\n\n @method advanceReadiness\n @see {Ember.Application#deferReadiness}\n */\n advanceReadiness: function() {\n Ember.assert(\"You must call advanceReadiness on an instance of Ember.Application\", this instanceof Ember.Application);\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 App.session = Ember.Object.create({});\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 App.register('session', App.session, {instantiate: false});\n ```\n\n @method register\n @param fullName {String} type:name (e.g., 'model:user')\n @param factory {Function} (e.g., App.Person)\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(, , )\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 @deprecated\n\n Calling initialize manually is not supported.\n\n Please see Ember.Application#advanceReadiness and\n Ember.Application#deferReadiness.\n\n @method initialize\n **/\n initialize: function() {\n Ember.deprecate('Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and Ember.Application#deferReadiness');\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 if (this.isDestroyed) { return; }\n\n // At this point, the App.Router must already be assigned\n if (this.Router) {\n var container = this.__container__;\n container.unregister('router:main');\n container.register('router:main', this.Router);\n }\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 /**\n Reset the application. This is typically used only in tests. It cleans up\n the application in the following order:\n\n 1. Deactivate existing routes\n 2. Destroy all objects in the container\n 3. Create a new application container\n 4. Re-route to the existing url\n\n Typical Example:\n\n ```javascript\n\n var App;\n\n Ember.run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n App.reset();\n }\n });\n\n test(\"first test\", function() {\n // App is freshly reset\n });\n\n test(\"first test\", function() {\n // App is again freshly reset\n });\n ```\n\n Advanced Example:\n\n Occasionally you may want to prevent the app from initializing during\n setup. This could enable extra configuration, or enable asserting prior\n to the app becoming ready.\n\n ```javascript\n\n var App;\n\n Ember.run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n Ember.run(function() {\n App.reset();\n App.deferReadiness();\n });\n }\n });\n\n test(\"first test\", function() {\n ok(true, 'something before app is initialized');\n\n Ember.run(function() {\n App.advanceReadiness();\n });\n ok(true, 'something after app is initialized');\n });\n ```\n\n @method reset\n **/\n reset: function() {\n this._readinessDeferrals = 1;\n\n function handleReset() {\n var router = this.__container__.lookup('router:main');\n router.reset();\n\n Ember.run(this.__container__, 'destroy');\n\n this.buildContainer();\n\n Ember.run.schedule('actions', this, function() {\n this._initialize();\n });\n }\n\n Ember.run.join(this, handleReset);\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 name, initializer;\n\n for (name in initializers) {\n initializer = initializers[name];\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 this.resolve(this);\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 customEvents = get(this, 'customEvents'),\n rootElement = get(this, 'rootElement'),\n dispatcher = this.__container__.lookup('event_dispatcher:main');\n\n set(this, 'eventDispatcher', dispatcher);\n dispatcher.setup(customEvents, rootElement);\n },\n\n /**\n @private\n\n trigger a new call to `route` whenever the URL changes.\n If the application has a router, use it to route to the current URL, and\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 @deprecated Use 'Resolver' instead\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n\n @property resolver\n */\n resolver: null,\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 this.__container__.destroy();\n },\n\n initializer: function(options) {\n this.constructor.initializer(options);\n }\n});\n\nEmber.Application.reopenClass({\n initializers: {},\n initializer: function(initializer) {\n // If this is the first initializer being added to a subclass, we are going to reopen the class\n // to make sure we have a new `initializers` object, which extends from the parent class' using\n // prototypal inheritance. Without this, attempting to add initializers to the subclass would\n // pollute the parent class as well as other subclasses.\n if (this.superclass.initializers !== undefined && this.superclass.initializers === this.initializers) {\n this.reopenClass({\n initializers: Ember.create(this.initializers)\n });\n }\n\n Ember.assert(\"The initializer '\" + initializer.name + \"' has already been registered\", !this.initializers[initializer.name]);\n Ember.assert(\"An initializer cannot be registered with both a before and an after\", !(initializer.before && initializer.after));\n Ember.assert(\"An initializer cannot be registered without an initialize function\", Ember.canInvoke(initializer, 'initialize'));\n\n this.initializers[initializer.name] = 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\n Ember.Container.defaultContainer = new DeprecatedContainer(container);\n\n container.set = Ember.set;\n container.resolver = resolverFor(namespace);\n container.normalize = container.resolver.normalize;\n container.describe = container.resolver.describe;\n container.makeToString = container.resolver.makeToString;\n\n container.optionsForType('component', { singleton: false });\n container.optionsForType('view', { singleton: false });\n container.optionsForType('template', { instantiate: false });\n container.optionsForType('helper', { instantiate: false });\n\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 container.register('event_dispatcher:main', Ember.EventDispatcher);\n\n container.register('router:main', Ember.Router);\n container.injection('router:main', 'namespace', 'application:main');\n\n container.injection('controller', 'target', 'router:main');\n container.injection('controller', 'namespace', 'application:main');\n\n container.injection('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 @method resolverFor\n @param {Ember.Namespace} namespace the namespace to look for classes\n @return {*} the resolved value for a given lookup\n*/\nfunction resolverFor(namespace) {\n if (namespace.get('resolver')) {\n Ember.deprecate('Application.resolver is deprecated in favor of Application.Resolver', false);\n }\n\n var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || Ember.DefaultResolver;\n var resolver = ResolverClass.create({\n namespace: namespace\n });\n\n function resolve(fullName) {\n return resolver.resolve(fullName);\n }\n\n resolve.describe = function(fullName) {\n return resolver.lookupDescription(fullName);\n };\n\n resolve.makeToString = function(factory, fullName) {\n return resolver.makeToString(factory, fullName);\n };\n\n resolve.normalize = function(fullName) {\n if (resolver.normalize) {\n return resolver.normalize(fullName);\n } else {\n Ember.deprecate('The Resolver should now provide a \\'normalize\\' function', false);\n return fullName;\n }\n };\n\n return resolve;\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 Ember.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 'model:post' //=> App.Post\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 normalize: function(fullName) {\n var split = fullName.split(':', 2),\n type = split[0],\n name = split[1];\n\n Ember.assert(\"Tried to normalize a container name without a colon (:) in it. You probably tried to lookup a name that did not contain a type, a colon, and a name. A proper lookup name would be `view:post`.\", split.length === 2);\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\n\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\n if (!parsedName.name || !parsedName.type) {\n throw new TypeError(\"Invalid fullName: `\" + fullName + \"`, must of of the form `type:name` \");\n }\n\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 @param {String} fullName the lookup string\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 @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\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 @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\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 Lookup the controller using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveController\n */\n resolveController: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the route using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveRoute\n */\n resolveRoute: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the view using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveView\n */\n resolveView: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n\n resolveHelper: function(parsedName) {\n return this.resolveOther(parsedName) || Ember.Handlebars.helpers[parsedName.fullNameWithoutType];\n },\n\n /**\n Lookup the model on the Application namespace\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveModel\n */\n resolveModel: function(parsedName) {\n var className = classify(parsedName.name),\n factory = get(parsedName.root, className);\n\n if (factory) { return factory; }\n },\n /**\n Look up the specified object (from parsedName) on the appropriate\n namespace (usually on the Application)\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\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 Returns a human-readable description for a fullName. Used by the\n Application namespace in assertions to describe the\n precise name of the class that Ember is looking for, rather than\n container keys.\n\n @protected\n @param {String} fullName the lookup string\n @method lookupDescription\n */\n lookupDescription: function(fullName) {\n var parsedName = this.parseName(fullName);\n\n if (parsedName.type === 'template') {\n return \"template at \" + parsedName.fullNameWithoutType.replace(/\\./g, '/');\n }\n\n var description = parsedName.root + \".\" + classify(parsedName.name);\n if (parsedName.type !== 'model') { description += classify(parsedName.type); }\n\n return description;\n },\n\n makeToString: function(factory, fullName) {\n return factory.toString();\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) {\n Ember.Logger.assert(test, desc);\n }\n\n if (Ember.testing && !test) {\n // when testing, ensure test failures when assertions fail\n throw new Ember.Error(\"Assertion Failed: \" + desc);\n }\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.TESTING_DEPRECATION) { return; }\n\n if (arguments.length === 1) { test = false; }\n if (test) { return; }\n\n if (Ember.ENV.RAISE_ON_DEPRECATION) { throw new Ember.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.\\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 Alias an old, deprecated method with its new counterpart.\n\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only) when the assigned 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 ```javascript\n Ember.oldMethod = Ember.deprecateFunc(\"Please use the new, updated method\", Ember.newMethod);\n ```\n\n @method deprecateFunc\n @param {String} message A description of the deprecation.\n @param {Function} func The new function called to replace its deprecated counterpart.\n @return {Function} a new function that wrapped the original function with a deprecation warning\n*/\nEmber.deprecateFunc = function(message, func) {\n return function() {\n Ember.deprecate(message);\n return func.apply(this, arguments);\n };\n};\n\n\n// Inform the developer about the Ember Inspector if not installed.\nif (!Ember.testing) {\n if (typeof window !== 'undefined' && window.chrome && window.addEventListener) {\n window.addEventListener(\"load\", function() {\n if (document.body && document.body.dataset && !document.body.dataset.emberExtension) {\n Ember.debug('For more advanced debugging, install the Ember Inspector from https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi');\n }\n }, false);\n }\n}\n\n})();\n//@ sourceURL=ember-debug");minispade.register('ember-extension-support/data_adapter', "(function() {/**\n@module ember\n@submodule ember-extension-support\n*/\nminispade.require('ember-application');\n\n/**\n The `DataAdapter` helps a data persistence library\n interface with tools that debug Ember such\n as the Chrome Ember Extension.\n\n This class will be extended by a persistence library\n which will override some of the methods with\n library-specific code.\n\n The methods likely to be overriden are\n `getFilters`, `detect`, `columnsForType`,\n `getRecords`, `getRecordColumnValues`,\n `getRecordKeywords`, `getRecordFilterValues`,\n `getRecordColor`, `observeRecord`\n\n The adapter will need to be registered\n in the application's container as `dataAdapter:main`\n\n Example:\n ```javascript\n Application.initializer({\n name: \"dataAdapter\",\n\n initialize: function(container, application) {\n application.register('dataAdapter:main', DS.DataAdapter);\n }\n });\n ```\n\n @class DataAdapter\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.DataAdapter = Ember.Object.extend({\n init: function() {\n this._super();\n this.releaseMethods = Ember.A();\n },\n\n /**\n The container of the application being debugged.\n This property will be injected\n on creation.\n */\n container: null,\n\n /**\n @private\n\n Number of attributes to send\n as columns. (Enough to make the record\n identifiable).\n */\n attributeLimit: 3,\n\n /**\n @private\n\n Stores all methods that clear observers.\n These methods will be called on destruction.\n */\n releaseMethods: Ember.A(),\n\n /**\n @public\n\n Specifies how records can be filtered.\n Records returned will need to have a `filterValues`\n property with a key for every name in the returned array.\n\n @method getFilters\n @return {Array} List of objects defining filters.\n The object should have a `name` and `desc` property.\n */\n getFilters: function() {\n return Ember.A();\n },\n\n /**\n @public\n\n Fetch the model types and observe them for changes.\n\n @method watchModelTypes\n\n @param {Function} typesAdded Callback to call to add types.\n Takes an array of objects containing wrapped types (returned from `wrapModelType`).\n\n @param {Function} typesUpdated Callback to call when a type has changed.\n Takes an array of objects containing wrapped types.\n\n @return {Function} Method to call to remove all observers\n */\n watchModelTypes: function(typesAdded, typesUpdated) {\n var modelTypes = this.getModelTypes(),\n self = this, typesToSend, releaseMethods = Ember.A();\n\n typesToSend = modelTypes.map(function(type) {\n var wrapped = self.wrapModelType(type);\n releaseMethods.push(self.observeModelType(type, typesUpdated));\n return wrapped;\n });\n\n typesAdded(typesToSend);\n\n var release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n self.releaseMethods.removeObject(release);\n };\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n /**\n @public\n\n Fetch the records of a given type and observe them for changes.\n\n @method watchRecords\n\n @param {Function} recordsAdded Callback to call to add records.\n Takes an array of objects containing wrapped records.\n The object should have the following properties:\n columnValues: {Object} key and value of a table cell\n object: {Object} the actual record object\n\n @param {Function} recordsUpdated Callback to call when a record has changed.\n Takes an array of objects containing wrapped records.\n\n @param {Function} recordsRemoved Callback to call when a record has removed.\n Takes the following parameters:\n index: the array index where the records were removed\n count: the number of records removed\n\n @return {Function} Method to call to remove all observers\n */\n watchRecords: function(type, recordsAdded, recordsUpdated, recordsRemoved) {\n var self = this, releaseMethods = Ember.A(), records = this.getRecords(type), release;\n\n var recordUpdated = function(updatedRecord) {\n recordsUpdated([updatedRecord]);\n };\n\n var recordsToSend = records.map(function(record) {\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n return self.wrapRecord(record);\n });\n\n\n var contentDidChange = function(array, idx, removedCount, addedCount) {\n for (var i = idx; i < idx + addedCount; i++) {\n var record = array.objectAt(i);\n var wrapped = self.wrapRecord(record);\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n recordsAdded([wrapped]);\n }\n\n if (removedCount) {\n recordsRemoved(idx, removedCount);\n }\n };\n\n var observer = { didChange: contentDidChange, willChange: Ember.K };\n records.addArrayObserver(self, observer);\n\n release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n records.removeArrayObserver(self, observer);\n self.releaseMethods.removeObject(release);\n };\n\n recordsAdded(recordsToSend);\n\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n /**\n @private\n\n Clear all observers before destruction\n */\n willDestroy: function() {\n this._super();\n this.releaseMethods.forEach(function(fn) {\n fn();\n });\n },\n\n /**\n @private\n\n Detect whether a class is a model.\n\n Test that against the model class\n of your persistence library\n\n @method detect\n @param {Class} klass The class to test\n @return boolean Whether the class is a model class or not\n */\n detect: function(klass) {\n return false;\n },\n\n /**\n @private\n\n Get the columns for a given model type.\n\n @method columnsForType\n @param {Class} type The model type\n @return {Array} An array of columns of the following format:\n name: {String} name of the column\n desc: {String} Humanized description (what would show in a table column name)\n */\n columnsForType: function(type) {\n return Ember.A();\n },\n\n /**\n @private\n\n Adds observers to a model type class.\n\n @method observeModelType\n @param {Class} type The model type class\n @param {Function} typesUpdated Called when a type is modified.\n @return {Function} The function to call to remove observers\n */\n\n observeModelType: function(type, typesUpdated) {\n var self = this, records = this.getRecords(type);\n\n var onChange = function() {\n typesUpdated([self.wrapModelType(type)]);\n };\n var observer = {\n didChange: function() {\n Ember.run.scheduleOnce('actions', this, onChange);\n },\n willChange: Ember.K\n };\n\n records.addArrayObserver(this, observer);\n\n var release = function() {\n records.removeArrayObserver(self, observer);\n };\n\n return release;\n },\n\n\n /**\n @private\n\n Wraps a given model type and observes changes to it.\n\n @method wrapModelType\n @param {Class} type A model class\n @param {Function} typesUpdated callback to call when the type changes\n @return {Object} contains the wrapped type and the function to remove observers\n Format:\n type: {Object} the wrapped type\n The wrapped type has the following format:\n name: {String} name of the type\n count: {Integer} number of records available\n columns: {Columns} array of columns to describe the record\n object: {Class} the actual Model type class\n release: {Function} The function to remove observers\n */\n wrapModelType: function(type, typesUpdated) {\n var release, records = this.getRecords(type),\n typeToSend, self = this;\n\n typeToSend = {\n name: type.toString(),\n count: Ember.get(records, 'length'),\n columns: this.columnsForType(type),\n object: type\n };\n\n\n return typeToSend;\n },\n\n\n /**\n @private\n\n Fetches all models defined in the application.\n TODO: Use the resolver instead of looping over namespaces.\n\n @method getModelTypes\n @return {Array} Array of model types\n */\n getModelTypes: function() {\n var namespaces = Ember.A(Ember.Namespace.NAMESPACES), types = Ember.A(), self = this;\n\n namespaces.forEach(function(namespace) {\n for (var key in namespace) {\n if (!namespace.hasOwnProperty(key)) { continue; }\n var klass = namespace[key];\n if (self.detect(klass)) {\n types.push(klass);\n }\n }\n });\n return types;\n },\n\n /**\n @private\n\n Fetches all loaded records for a given type.\n\n @method getRecords\n @return {Array} array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.\n */\n getRecords: function(type) {\n return Ember.A();\n },\n\n /**\n @private\n\n Wraps a record and observers changes to it\n\n @method wrapRecord\n @param {Object} record The record instance\n @return {Object} the wrapped record. Format:\n columnValues: {Array}\n searchKeywords: {Array}\n */\n wrapRecord: function(record) {\n var recordToSend = { object: record }, columnValues = {}, self = this;\n\n recordToSend.columnValues = this.getRecordColumnValues(record);\n recordToSend.searchKeywords = this.getRecordKeywords(record);\n recordToSend.filterValues = this.getRecordFilterValues(record);\n recordToSend.color = this.getRecordColor(record);\n\n return recordToSend;\n },\n\n /**\n @private\n\n Gets the values for each column.\n\n @method getRecordColumnValues\n @return {Object} Keys should match column names defined\n by the model type.\n */\n getRecordColumnValues: function(record) {\n return {};\n },\n\n /**\n @private\n\n Returns keywords to match when searching records.\n\n @method getRecordKeywords\n @return {Array} Relevant keywords for search.\n */\n getRecordKeywords: function(record) {\n return Ember.A();\n },\n\n /**\n @private\n\n Returns the values of filters defined by `getFilters`.\n\n @method getRecordFilterValues\n @param {Object} record The record instance\n @return {Object} The filter values\n */\n getRecordFilterValues: function(record) {\n return {};\n },\n\n /**\n @private\n\n Each record can have a color that represents its state.\n\n @method getRecordColor\n @param {Object} record The record instance\n @return {String} The record's color\n Possible options: black, red, blue, green\n */\n getRecordColor: function(record) {\n return null;\n },\n\n /**\n @private\n\n Observes all relevant properties and re-sends the wrapped record\n when a change occurs.\n\n @method observerRecord\n @param {Object} record The record instance\n @param {Function} recordUpdated The callback to call when a record is updated.\n @return {Function} The function to call to remove all observers.\n */\n observeRecord: function(record, recordUpdated) {\n return function(){};\n }\n\n});\n\n\n})();\n//@ sourceURL=ember-extension-support/data_adapter");minispade.register('ember-extension-support', "(function() {/**\nEmber Extension Support\n\n@module ember\n@submodule ember-extension-support\n@requires ember-application\n*/\nminispade.require('ember-extension-support/data_adapter');\n\n})();\n//@ sourceURL=ember-extension-support");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 version 1.0 or 1.1. Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before you link to Ember.\", Handlebars);\nEmber.assert(\"Ember Handlebars requires Handlebars version 1.0 or 1.1, COMPILER_REVISION expected: 4, got: \" + Handlebars.COMPILER_REVISION + \" - Please note: Builds of master may have other COMPILER_REVISION values.\", Handlebars.COMPILER_REVISION === 4);\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 Register a bound helper or custom view helper.\n\n ## Simple bound helper example\n\n ```javascript\n Ember.Handlebars.helper('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 For more examples of bound helpers, see documentation for\n `Ember.Handlebars.registerBoundHelper`.\n\n ## Custom view helper example\n\n Assuming a view subclass named `App.CalendarView` were defined, a helper\n for rendering instances of this view could be registered as follows:\n\n ```javascript\n Ember.Handlebars.helper('calendar', App.CalendarView):\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{calendar}}\n ```\n\n Which is functionally equivalent to:\n\n ```handlebars\n {{view App.CalendarView}}\n ```\n\n Options in the helper will be passed to the view in exactly the same\n manner as with the `view` helper.\n\n @method helper\n @for Ember.Handlebars\n @param {String} name\n @param {Function|Ember.View} function or view class constructor\n @param {String} dependentKeys*\n*/\nEmber.Handlebars.helper = function(name, value) {\n Ember.assert(\"You tried to register a component named '\" + name + \"', but component names must include a '-'\", !Ember.Component.detect(value) || name.match(/-/));\n\n if (Ember.View.detect(value)) {\n Ember.Handlebars.registerHelper(name, Ember.Handlebars.makeViewHelper(value));\n } else {\n Ember.Handlebars.registerBoundHelper.apply(null, arguments);\n }\n};\n\n/**\n @private\n\n Returns a helper function that renders the provided ViewClass.\n\n Used internally by Ember.Handlebars.helper and other methods\n involving helper/component registration.\n\n @method helper\n @for Ember.Handlebars\n @param {Function} ViewClass view class constructor\n*/\nEmber.Handlebars.makeViewHelper = function(ViewClass) {\n return function(options) {\n Ember.assert(\"You can only pass attributes (such as name=value) not bare values to a helper for a View found in '\" + ViewClass.toString() + \"'\", arguments.length < 2);\n return Ember.Handlebars.helpers.view.call(this, ViewClass, options);\n };\n};\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\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\n// Hacks ahead:\n// Handlebars presently has a bug where the `blockHelperMissing` hook\n// doesn't get passed the name of the missing helper name, but rather\n// gets passed the value of that missing helper evaluated on the current\n// context, which is most likely `undefined` and totally useless.\n//\n// So we alter the compiled template function to pass the name of the helper\n// instead, as expected.\n//\n// This can go away once the following is closed:\n// https://github.com/wycats/handlebars.js/issues/634\n\nvar DOT_LOOKUP_REGEX = /helpers\\.(.*?)\\)/,\n BRACKET_STRING_LOOKUP_REGEX = /helpers\\['(.*?)'/,\n INVOCATION_SPLITTING_REGEX = /(.*blockHelperMissing\\.call\\(.*)(stack[0-9]+)(,.*)/;\n\nEmber.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation = function(source) {\n var helperInvocation = source[source.length - 1],\n helperName = (DOT_LOOKUP_REGEX.exec(helperInvocation) || BRACKET_STRING_LOOKUP_REGEX.exec(helperInvocation))[1],\n matches = INVOCATION_SPLITTING_REGEX.exec(helperInvocation);\n\n source[source.length - 1] = matches[1] + \"'\" + helperName + \"'\" + matches[3];\n}\nvar stringifyBlockHelperMissing = Ember.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation;\n\nvar originalBlockValue = Ember.Handlebars.JavaScriptCompiler.prototype.blockValue;\nEmber.Handlebars.JavaScriptCompiler.prototype.blockValue = function() {\n originalBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\n};\n\nvar originalAmbiguousBlockValue = Ember.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue;\nEmber.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue = function() {\n originalAmbiguousBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\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([{ part: '_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 var template = Ember.Handlebars.template(templateSpec);\n template.isMethod = false; //Make sure we don't wrap templates with ._super\n\n return template;\n };\n}\n\n\n})();\n//@ sourceURL=ember-handlebars-compiler");minispade.register('ember-handlebars/component_lookup', "(function() {Ember.ComponentLookup = Ember.Object.extend({\n lookupFactory: function(name, container) {\n\n container = container || this.container;\n\n var fullName = 'component:' + name,\n templateFullName = 'template:components/' + name,\n templateRegistered = container && container.has(templateFullName);\n\n if (templateRegistered) {\n container.injection(fullName, 'layout', templateFullName);\n }\n\n var Component = container.lookupFactory(fullName);\n\n // Only treat as a component if either the component\n // or a template has been registered.\n if (templateRegistered || Component) {\n if (!Component) {\n container.register(fullName, Ember.Component);\n Component = container.lookupFactory(fullName);\n }\n return Component;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/component_lookup");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@module ember\n@submodule ember-handlebars-compiler\n*/\n\n/**\n\n The `{{input}}` helper inserts an HTML `` tag into the template,\n with a `type` value of either `text` or `checkbox`. If no `type` is provided,\n `text` will be the default value applied. The attributes of `{{input}}`\n match those of the native HTML tag as closely as possible for these two types.\n\n ## Use as text field\n An `{{input}}` with no `type` or a `type` of `text` will render an HTML text input.\n The following HTML attributes can be set via the helper:\n\n* `value`\n* `size`\n* `name`\n* `pattern`\n* `placeholder`\n* `disabled`\n* `maxlength`\n* `tabindex`\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input value=\"http://www.facebook.com\"}}\n ```\n\n\n ```html\n \n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n firstName: \"Stanley\",\n entryNotAllowed: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"text\" value=firstName disabled=entryNotAllowed size=\"50\"}}\n ```\n\n\n ```html\n \n ```\n\n ## Extension\n\n Internally, `{{input type=\"text\"}}` creates an instance of `Ember.TextField`, passing\n arguments from the helper to `Ember.TextField`'s `create` method. You can extend the\n capablilties of text inputs in your applications by reopening this class. For example,\n if you are deploying to browsers where the `required` attribute is used, you\n can add this to the `TextField`'s `attributeBindings` property:\n\n ```javascript\n Ember.TextField.reopen({\n attributeBindings: ['required']\n });\n ```\n\n Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n\n ## Use as checkbox\n\n An `{{input}}` with a `type` of `checkbox` will render an HTML checkbox input.\n The following HTML attributes can be set via the helper:\n\n* `checked`\n* `disabled`\n* `tabindex`\n* `indeterminate`\n* `name`\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input type=\"checkbox\" name=\"isAdmin\"}}\n ```\n\n ```html\n \n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n isAdmin: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"checkbox\" checked=isAdmin }}\n ```\n\n\n ```html\n \n ```\n\n ## Extension\n\n Internally, `{{input type=\"checkbox\"}}` creates an instance of `Ember.Checkbox`, passing\n arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the\n capablilties of checkbox inputs in your applications by reopening this class. For example,\n if you wanted to add a css class to all checkboxes in your application:\n\n ```javascript\n Ember.Checkbox.reopen({\n classNames: ['my-app-checkbox']\n });\n ```\n\n\n @method input\n @for Ember.Handlebars.helpers\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('input', function(options) {\n Ember.assert('You can only pass attributes to the `input` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes,\n inputType = hash.type,\n onEvent = hash.on;\n\n delete hash.type;\n delete hash.on;\n\n if (inputType === 'checkbox') {\n return Ember.Handlebars.helpers.view.call(this, Ember.Checkbox, options);\n } else {\n if (inputType) { hash.type = inputType; }\n hash.onEvent = onEvent || 'enter';\n return Ember.Handlebars.helpers.view.call(this, Ember.TextField, options);\n }\n});\n\n/**\n `{{textarea}}` inserts a new instance of `\n ```\n\n Bound:\n\n In the following example, the `writtenWords` property on `App.ApplicationController`\n will be updated live as the user types 'Lots of text that IS bound' into\n the text area of their browser's window.\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\"\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n ```\n\n Would result in the following HTML:\n\n ```html\n \n ```\n\n If you wanted a one way binding between the text area and a div tag\n somewhere else on your screen, you could use `Ember.computed.oneWay`:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n outputWrittenWords: Ember.computed.oneWay(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n\n
\n {{outputWrittenWords}}\n
\n ```\n\n Would result in the following HTML:\n\n ```html\n \n\n <-- the following div will be updated in real time as you type -->\n\n
\n Lots of text that IS bound\n
\n ```\n\n Finally, this example really shows the power and ease of Ember when two\n properties are bound to eachother via `Ember.computed.alias`. Type into\n either text area box and they'll both stay in sync. Note that\n `Ember.computed.alias` costs more in terms of performance, so only use it when\n your really binding in both directions:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n twoWayWrittenWords: Ember.computed.alias(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n {{textarea value=twoWayWrittenWords}}\n ```\n\n ```html\n \n\n <-- both updated in real time -->\n\n \n ```\n\n ## Extension\n\n Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing\n arguments from the helper to `Ember.TextArea`'s `create` method. You can\n extend the capabilities of text areas in your application by reopening this\n class. For example, if you are deploying to browsers where the `required`\n attribute is used, you can globally add support for the `required` attribute\n on all {{textarea}}'s' in your app by reopening `Ember.TextArea` or\n `Ember.TextSupport` and adding it to the `attributeBindings` concatenated\n property:\n\n ```javascript\n Ember.TextArea.reopen({\n attributeBindings: ['required']\n });\n ```\n\n Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n @method textarea\n @for Ember.Handlebars.helpers\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('textarea', function(options) {\n Ember.assert('You can only pass attributes to the `textarea` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes;\n\n return Ember.Handlebars.helpers.view.call(this, Ember.TextArea, options);\n});\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 internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `checkbox`.\n\n See [handlebars.helpers.input](/api/classes/Ember.Handlebars.helpers.html#method_input) for usage details.\n\n ## Direct manipulation of `checked`\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](/api/classes/Ember.View.html)'s\n layout section for more 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', 'indeterminate', 'disabled', 'tabindex', 'name'],\n\n type: \"checkbox\",\n checked: false,\n disabled: false,\n indeterminate: false,\n\n init: function() {\n this._super();\n this.on(\"change\", this, this._updateElementValue);\n },\n\n didInsertElement: function() {\n this._super();\n this.get('element').indeterminate = !!this.get('indeterminate');\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 forEach = Ember.EnumerableUtils.forEach,\n replace = Ember.EnumerableUtils.replace,\n isArray = Ember.isArray,\n precompileTemplate = Ember.Handlebars.compile;\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'),\n\n labelPathDidChange: Ember.observer('parentView.optionLabelPath', 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 }),\n\n valuePathDidChange: Ember.observer('parentView.optionValuePath', 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 })\n});\n\nEmber.SelectOptgroup = Ember.CollectionView.extend({\n tagName: 'optgroup',\n attributeBindings: ['label'],\n\n selectionBinding: 'parentView.selection',\n multipleBinding: 'parentView.multiple',\n optionLabelPathBinding: 'parentView.optionLabelPath',\n optionValuePathBinding: 'parentView.optionValuePath',\n\n itemViewClassBinding: 'parentView.optionView'\n});\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 `\n \n \n ```\n\n The `value` attribute of the selected `{{/if}}{{#if view.optionGroupPath}}{{#each view.groupedContent}}{{view view.groupView content=content label=label}}{{/each}}{{else}}{{#each view.content}}{{view view.optionView content=this}}{{/each}}{{/if}}'),\n attributeBindings: ['multiple', 'disabled', 'tabindex', 'name'],\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 /**\n The `disabled` attribute of the select element. Indicates whether\n the element is disabled from interactions.\n\n @property disabled\n @type Boolean\n @default 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](/api/classes/Ember.Select.html#property_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](/api/classes/Ember.Select.html#property_content).\n\n @property optionValuePath\n @type String\n @default 'content'\n */\n optionValuePath: 'content',\n\n /**\n The path of the option group.\n When this property is used, `content` should be sorted by `optionGroupPath`.\n\n @property optionGroupPath\n @type String\n @default null\n */\n optionGroupPath: null,\n\n /**\n The view class for optgroup.\n\n @property groupView\n @type Ember.View\n @default Ember.SelectOptgroup\n */\n groupView: Ember.SelectOptgroup,\n\n groupedContent: Ember.computed(function() {\n var groupPath = get(this, 'optionGroupPath');\n var groupedContent = Ember.A();\n var content = get(this, 'content') || [];\n\n forEach(content, function(item) {\n var label = get(item, groupPath);\n\n if (get(groupedContent, 'lastObject.label') !== label) {\n groupedContent.pushObject({\n label: label,\n content: Ember.A()\n });\n }\n\n get(groupedContent, 'lastObject.content').push(item);\n });\n\n return groupedContent;\n }).property('optionGroupPath', 'content.@each'),\n\n /**\n The view class for option.\n\n @property optionView\n @type Ember.View\n @default Ember.SelectOption\n */\n optionView: Ember.SelectOption,\n\n _change: function() {\n if (get(this, 'multiple')) {\n this._changeMultiple();\n } else {\n this._changeSingle();\n }\n },\n\n selectionDidChange: Ember.observer('selection.@each', 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 }),\n\n valueDidChange: Ember.observer('value', 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 ? content.find(function(obj) {\n return value === (valuePath ? get(obj, valuePath) : obj);\n }) : null;\n\n this.set('selection', selection);\n }\n }),\n\n\n _triggerChange: function() {\n var selection = get(this, 'selection');\n var value = get(this, 'value');\n\n if (!Ember.isNone(selection)) { this.selectionDidChange(); }\n if (!Ember.isNone(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 (!content || !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\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 internal class used to create textarea element when the `{{textarea}}`\n helper is used.\n\n See [handlebars.helpers.textarea](/api/classes/Ember.Handlebars.helpers.html#method_textarea) for usage details.\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](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextArea\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n*/\nEmber.TextArea = Ember.Component.extend(Ember.TextSupport, {\n classNames: ['ember-text-area'],\n\n tagName: \"textarea\",\n attributeBindings: ['rows', 'cols', 'name'],\n rows: null,\n cols: null,\n\n _updateElementValue: Ember.observer('value', 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 }),\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\n The internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `text`.\n\n See [handlebars.helpers.input](/api/classes/Ember.Handlebars.helpers.html#method_input) for usage details.\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](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextField\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n*/\nEmber.TextField = Ember.Component.extend(Ember.TextSupport,\n /** @scope Ember.TextField.prototype */ {\n\n classNames: ['ember-text-field'],\n tagName: \"input\",\n attributeBindings: ['type', 'value', 'size', 'pattern', 'name'],\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})();\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 @private\n*/\nEmber.TextSupport = Ember.Mixin.create({\n value: \"\",\n\n attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex', 'readonly'],\n placeholder: null,\n disabled: false,\n maxlength: null,\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 /**\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 The event that should send the action.\n\n Options are:\n\n * `enter`: the user pressed enter\n * `keyPress`: the user pressed a key\n\n @property onEvent\n @type String\n @default enter\n */\n onEvent: 'enter',\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 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 The action to be sent when the user inserts a new line.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 13.\n Uses sendAction to send the `enter` action to the controller.\n\n @method insertNewline\n @param {Event} event\n */\n insertNewline: function(event) {\n sendAction('enter', this, event);\n sendAction('insert-newline', this, event);\n },\n\n /**\n Called when the user hits escape.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 27.\n Uses sendAction to send the `escape-press` action to the controller.\n\n @method cancel\n @param {Event} event\n */\n cancel: function(event) {\n sendAction('escape-press', this, event);\n },\n\n /**\n Called when the text area is focused.\n\n @method focusIn\n @param {Event} event\n */\n focusIn: function(event) {\n sendAction('focus-in', this, event);\n },\n\n /**\n Called when the text area is blurred.\n\n @method focusOut\n @param {Event} event\n */\n focusOut: function(event) {\n sendAction('focus-out', this, event);\n },\n\n /**\n The action to be sent when the user presses a key. Enabled by setting\n the `onEvent` property to `keyPress`.\n\n Uses sendAction to send the `keyPress` action to the controller.\n\n @method keyPress\n @param {Event} event\n */\n keyPress: function(event) {\n sendAction('key-press', this, event);\n }\n\n});\n\nEmber.TextSupport.KEY_EVENTS = {\n 13: 'insertNewline',\n 27: 'cancel'\n};\n\n// In principle, this shouldn't be necessary, but the legacy\n// sectionAction semantics for TextField are different from\n// the component semantics so this method normalizes them.\nfunction sendAction(eventName, view, event) {\n var action = get(view, eventName),\n on = get(view, 'onEvent'),\n value = get(view, 'value');\n\n // back-compat support for keyPress as an event name even though\n // it's also a method name that consumes the event (and therefore\n // incompatible with sendAction semantics).\n if (on === eventName || (on === 'keyPress' && eventName === 'key-press')) {\n view.sendAction('action', value);\n }\n\n view.sendAction(eventName, value);\n\n if (action || on === eventName) {\n if(!get(view, 'bubbles')) {\n event.stopPropagation();\n }\n }\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 originalTemplate = Ember.Handlebars.template;\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 if (Ember.FEATURES.isEnabled(\"ember-handlebars-caps-lookup\")) {\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 (Ember.isGlobalPath(path)) {\n value = Ember.get(Ember.lookup, path);\n } else {\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 value = Ember.get(normalizedPath.root, normalizedPath.path);\n }\n\n } else {\n root = normalizedPath.root;\n path = normalizedPath.path;\n\n value = Ember.get(root, path);\n\n if (value === undefined && root !== Ember.lookup && Ember.isGlobalPath(path)) {\n value = Ember.get(Ember.lookup, path);\n }\n }\n\n return value;\n};\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\n ```\n\n The above handlebars template will fill the ``'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 \"A\n ```\n\n `bind-attr` cannot redeclare existing DOM element attributes. The use of `src`\n in the following `bind-attr` example will be ignored and the hard coded value\n of `src=\"/failwhale.gif\"` will take precedence:\n\n ```handlebars\n \"imageTitle\"}}\n ```\n\n ### `bind-attr` and the `class` attribute\n\n `bind-attr` supports a special syntax for handling a number of cases unique\n to the `class` DOM element attribute. The `class` attribute combines\n multiple discrete 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 `bind-attr`. 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 \n ```\n\n Result in the following rendered output:\n\n ```html\n \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 \n ```\n\n Result in the following rendered output:\n\n ```html\n \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 \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 \n ```\n\n Results in the following rendered output:\n\n ```html\n \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 \n ```\n\n @method bind-attr\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bind-attr', function(options) {\n\n var attrs = options.hash;\n\n Ember.assert(\"You must specify at least one hash argument to bind-attr\", !!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) {\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 an expression as the value of bound attribute. You specified: %@=%@\", [attr, 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 // 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}} ... {{bind-attr attr=\"x\"}}\n if (path !== 'this' && !(normalized.isKeyword && normalized.path === '' )) {\n view.registerObserver(normalized.root, normalized.path, observer);\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 See `bind-attr`\n\n @method bindAttr\n @for Ember.Handlebars.helpers\n @deprecated\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bindAttr', EmberHandlebars.helpers['bind-attr']);\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 if (path !== '' && path !== 'this') {\n view.registerObserver(pathRoot, path, observer);\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() {// 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](/api/classes/Ember.CollectionView.html)\n for 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 `` 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
\n
Hi Dave
\n
Hi Mary
\n
Hi Sara
\n
\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
\n
Greetings Dave
\n
Greetings Mary
\n
Greetings Sara
\n
\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
\n

Howdy Dave

\n

Howdy Mary

\n

Howdy Sara

\n
\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 collectionPrototype = collectionClass.proto(),\n itemViewClass;\n\n if (hash.itemView) {\n var controller = data.keywords.controller;\n Ember.assert('You specified an itemView, but the current context has no container to look the itemView up in. This probably means that you created a view manually, instead of through the container. Instead, use container.lookup(\"view:viewName\"), which will properly instantiate your view.', controller && controller.container);\n var container = controller.container;\n itemViewClass = container.resolve('view:' + hash.itemView);\n Ember.assert('You specified the itemView ' + hash.itemView + \", but it was not found at \" + container.describe(\"view:\" + hash.itemView) + \" (and it was not registered in the container)\", !!itemViewClass);\n } else if (hash.itemViewClass) {\n itemViewClass = handlebarsGet(collectionPrototype, hash.itemViewClass, options);\n } else {\n itemViewClass = collectionPrototype.itemViewClass;\n }\n\n Ember.assert(fmt(\"%@ #collection: Could not find itemViewClass %@\", [data.view, itemViewClass]), !!itemViewClass);\n\n delete hash.itemViewClass;\n delete hash.itemView;\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 if (fn) {\n itemHash.template = fn;\n delete options.fn;\n }\n\n var emptyViewClass;\n if (inverse && inverse !== Ember.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 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 get = Ember.get, handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\n\n/**\n `log` allows you to output the value of a variable 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.length) ? 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 Before invoking the `debugger` statement, there\n are a few helpful variables defined in the\n body of this helper that you can inspect while\n debugging that describe how and where this\n helper was invoked:\n\n - templateContext: this is most likely a controller\n from which this template looks up / displays properties\n - typeOfTemplateContext: a string that describes the\n type of object templateContext is, e.g.\n \"controller:people\"\n\n For example, if you're wondering why a value `{{foo}}`\n isn't rendering as expected within a template, you\n could place a `{{debugger}}` statement, and when\n the `debugger;` breakpoint is hit, you can inspect\n `templateContext`, determine if it's the object you\n expect, and/or evaluate expressions in the console\n to perform property lookups on the `templateContext`:\n\n ```\n > templateContext.get('foo') // -> \"\"\n ```\n\n @method debugger\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('debugger', function(options) {\n\n // These are helpful values you can inspect while debugging.\n var templateContext = this;\n var typeOfTemplateContext = this ? get(this, '_debugContainerKey') : 'none';\n\n debugger;\n});\n\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 = get(this, 'controller.container').lookupFactory('controller:array').create({\n parentController: get(this, 'controller'),\n itemController: itemController,\n target: get(this, 'controller'),\n _eachView: this\n });\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 _assertArrayLike: function(content) {\n Ember.assert(\"The value that #each loops over must be an Array. You passed \" + content.constructor + \", but it should have been an ArrayController\", !Ember.ControllerMixin.detect(content) || (content && content.isGenerated) || content instanceof Ember.ArrayController);\n Ember.assert(\"The value that #each loops over must be an Array. You passed \" + ((Ember.ControllerMixin.detect(content) && content.get('model') !== undefined) ? (\"\" + content.get('model') + \" (wrapped in \" + content + \")\") : (\"\" + content)), Ember.Array.detect(content));\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 destroy: function() {\n if (!this._super()) { return; }\n\n var arrayController = get(this, '_arrayController');\n\n if (arrayController) {\n arrayController.destroy();\n }\n\n return this;\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 if (!this.content) { return; }\n\n this.content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n removeArrayObservers: function() {\n if (!this.content) { return; }\n\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 if (!this.content) { return; }\n\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 var self = this;\n Ember.run.scheduleOnce('render', this, function() {\n // It's possible it's been destroyed after we enqueued a re-render call.\n if (!self.destroyed) {\n self.containingView.rerender();\n }\n });\n },\n\n destroy: function() {\n this.removeContentObservers();\n if (this.content) {\n this.removeArrayObservers();\n }\n this.destroyed = true;\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

Sorry, nobody is available for this task.

\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
\n
Greetings Dave
\n
Greetings Mary
\n
Greetings Sara
\n
\n ```\n\n If an `itemViewClass` is defined on the helper, and therefore the helper is not\n being used as a block, an `emptyViewClass` can also be provided optionally.\n The `emptyViewClass` will match the behavior of the `{{else}}` condition\n described above. That is, the `emptyViewClass` will render if the collection\n is empty.\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 Each itemController will receive a reference to the current controller as\n a `parentController` property.\n\n ### (Experimental) Grouped Each\n\n When used in conjunction with the experimental [group helper](https://github.com/emberjs/group-helper),\n you can inform Handlebars to re-render an entire group of items instead of\n re-rendering them one at a time (in the event that they are changed en masse\n or an item is added/removed).\n\n ```handlebars\n {{#group}}\n {{#each people}}\n {{firstName}} {{lastName}}\n {{/each}}\n {{/group}}\n ```\n\n This can be faster than the normal way that Handlebars re-renders items\n in some cases.\n\n If for some reason you have a group with more than one `#each`, you can make\n one of the collections be updated in normal (non-grouped) fashion by setting\n the option `groupedRows=true` (counter-intuitive, I know).\n\n For example,\n\n ```handlebars\n {{dealershipName}}\n\n {{#group}}\n {{#each dealers}}\n {{firstName}} {{lastName}}\n {{/each}}\n\n {{#each car in cars groupedRows=true}}\n {{car.make}} {{car.model}} {{car.color}}\n {{/each}}\n {{/group}}\n ```\n Any change to `dealershipName` or the `dealers` collection will cause the\n entire group to be re-rendered. However, changes to the `cars` collection\n will be re-rendered individually (as normal).\n\n Note that `group` behavior is also disabled by specifying an `itemViewClass`.\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 @param [options.groupedRows] {boolean} enable normal item-by-item rendering when inside a `#group` helper\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 if (arguments.length === 1) {\n options = path;\n path = 'this';\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/loc', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `loc` looks up the string in the localized strings hash.\n This is a convenient way to localize text. For example:\n\n ```html\n \n ```\n\n Take note that `\"welcome\"` is a string and not an object\n reference.\n\n @method loc\n @for Ember.Handlebars.helpers\n @param {String} str The string to format\n*/\n\nEmber.Handlebars.registerHelper('loc', function(str) {\n return Ember.String.loc(str);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/loc");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 The `partial` helper renders another template without\n changing the template context:\n\n ```handlebars\n {{foo}}\n {{partial \"nav\"}}\n ```\n\n The above example template will render a template named\n \"_nav\", which has the same context as the parent template\n it's rendered into, so if the \"_nav\" template also referenced\n `{{foo}}`, it would print the same thing as the `{{foo}}`\n in the above example.\n\n If a \"_nav\" template isn't found, the `partial` helper will\n fall back to a template named \"nav\".\n\n ## Bound template names\n\n The parameter supplied to `partial` can also be a path\n to a property containing a template name, e.g.:\n\n ```handlebars\n {{partial someTemplateName}}\n ```\n\n The above example will look up the value of `someTemplateName`\n on the template context (e.g. a controller) and use that\n value as the name of the template to render. If the resolved\n value is falsy, nothing will be rendered. If `someTemplateName`\n changes, the partial will be re-rendered using the new template\n name.\n\n ## Setting the partial's context with `with`\n\n The `partial` helper can be used in conjunction with the `with`\n helper to set a context that will be used by the partial:\n\n ```handlebars\n {{#with currentUser}}\n {{partial \"user_info\"}}\n {{/with}}\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\n var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this;\n\n if (options.types[0] === \"ID\") {\n // Helper was passed a property path; we need to\n // create a binding that will re-render whenever\n // this property changes.\n options.fn = function(context, fnOptions) {\n var partialName = Ember.Handlebars.get(context, name, fnOptions);\n renderPartial(context, partialName, fnOptions);\n };\n\n return Ember.Handlebars.bind.call(context, name, options, true, exists);\n } else {\n // Render the partial right into parent template.\n renderPartial(context, name, options);\n }\n});\n\nfunction exists(value) {\n return !Ember.isNone(value);\n}\n\nfunction renderPartial(context, name, options) {\n var nameParts = name.split(\"/\"),\n lastPart = nameParts[nameParts.length - 1];\n\n nameParts[nameParts.length - 1] = \"_\" + lastPart;\n\n var view = options.data.view,\n underscoredName = nameParts.join(\"/\"),\n template = view.templateForName(underscoredName),\n deprecatedTemplate = !template && view.templateForName(name);\n\n Ember.assert(\"Unable to find partial with name '\"+name+\"'.\", template || deprecatedTemplate);\n\n template = template || deprecatedTemplate;\n\n template(context, { 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\n {{#with loggedInUser}}\n Last Login: {{lastLogin}}\n User Info: {{template \"user_info\"}}\n {{/with}}\n \n ```\n\n ```html\n \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 `\";\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: 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 0) {\n var len = matches.length, idx;\n for (idx=0; idxTest');\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 // Firefox versions < 11 do not have support for element.outerHTML.\n var outerHTML = element.outerHTML || new XMLSerializer().serializeToString(element);\n Ember.assert(\"Can't set innerHTML on \"+element.tagName+\" in this browser\", outerHTML);\n\n var startTag = outerHTML.match(new RegExp(\"<\"+tagName+\"([^>]*)>\", 'i'))[0],\n endTag = '';\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\");\nminispade.require(\"ember-views/views/component\");\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 maintaining 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 `` 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
\n
the letter: A
\n
the letter: B
\n
the letter: C
\n
\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 `` 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
    \n
  • the letter: A
  • \n
  • the letter: B
  • \n
  • the letter: C
  • \n
\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 ## Programmatic 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
\n
\n The collection is empty\n
\n
\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\n @class CollectionView\n @namespace Ember\n @extends Ember.ContainerView\n @since Ember 0.9\n*/\nEmber.CollectionView = Ember.ContainerView.extend(/** @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 /**\n Setup a CollectionView\n\n @method init\n */\n init: function() {\n var ret = this._super();\n this._contentDidChange();\n return ret;\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('content', 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 }),\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('content', function() {\n var content = get(this, 'content');\n\n if (content) {\n this._assertArrayLike(content);\n content.addArrayObserver(this);\n }\n\n var len = content ? get(content, 'length') : 0;\n this.arrayDidChange(content, 0, null, len);\n }),\n\n /**\n @private\n\n Ensure that the content implements Ember.Array\n\n @method _assertArrayLike\n */\n _assertArrayLike: function(content) {\n Ember.assert(fmt(\"an Ember.CollectionView's content must implement Ember.Array. You passed %@\", [content]), Ember.Array.detect(content));\n },\n\n /**\n Removes the content and content observers.\n\n @method destroy\n */\n destroy: function() {\n if (!this._super()) { return; }\n\n var content = get(this, 'content');\n if (content) { content.removeArrayObserver(this); }\n\n if (this._createdEmptyView) {\n this._createdEmptyView.destroy();\n }\n\n return this;\n },\n\n /**\n Called when a mutation to the underlying content array will occur.\n\n This method will remove any views that are no longer in the underlying\n content array.\n\n Invokes whenever the content array itself will change.\n\n @method arrayWillChange\n @param {Array} content the managed collection of objects\n @param {Number} start the index at which the changes will occurr\n @param {Number} removed number of object to be removed from content\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 this.invokeRecursively(function(view) {\n view.removedFromDOM = true;\n }, false);\n }\n\n for (idx = start + removedCount - 1; idx >= start; idx--) {\n childView = childViews[idx];\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} content the managed collection of objects\n @param {Number} start the index at which the changes occurred\n @param {Number} removed number of object removed from content\n @param {Number} added number of object added to content\n */\n arrayDidChange: function(content, start, removed, added) {\n var addedViews = [], view, item, idx, len, itemViewClass,\n emptyView;\n\n len = content ? get(content, 'length') : 0;\n\n if (len) {\n itemViewClass = get(this, 'itemViewClass');\n\n if ('string' === typeof itemViewClass) {\n itemViewClass = get(itemViewClass) || itemViewClass;\n }\n\n Ember.assert(fmt(\"itemViewClass must be a subclass of Ember.View, not %@\", [itemViewClass]), 'string' === typeof itemViewClass || Ember.View.detect(itemViewClass));\n\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 emptyView = get(this, 'emptyView');\n\n if (!emptyView) { return; }\n\n if ('string' === typeof emptyView) {\n emptyView = get(emptyView) || emptyView;\n }\n\n emptyView = this.createChildView(emptyView);\n addedViews.push(emptyView);\n set(this, 'emptyView', emptyView);\n\n if (Ember.CoreView.detect(emptyView)) {\n this._createdEmptyView = emptyView;\n }\n }\n\n this.replace(start, 0, addedViews);\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 The tag name for the view will be set to the tagName of the viewClass\n passed in.\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 view = this._super(view, attrs);\n\n var itemTagName = get(view, 'tagName');\n\n if (itemTagName === null || itemTagName === undefined) {\n itemTagName = Ember.CollectionView.CONTAINER_MAP[get(this, 'tagName')];\n set(view, 'tagName', itemTagName);\n }\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/component', "(function() {minispade.require(\"ember-views/views/view\");\n\nvar get = Ember.get, set = Ember.set, isNone = Ember.isNone,\n a_slice = Array.prototype.slice;\n\n\n/**\n@module ember\n@submodule ember-views\n*/\n\n/**\n An `Ember.Component` is a view that is completely\n isolated. Property access in its templates go\n to the view object and actions are targeted at\n the view object. There is no access to the\n surrounding context or outer controller; all\n contextual information must be passed in.\n\n The easiest way to create an `Ember.Component` is via\n a template. If you name a template\n `components/my-foo`, you will be able to use\n `{{my-foo}}` in other templates, which will make\n an instance of the isolated component.\n\n ```html\n {{app-profile person=currentUser}}\n ```\n\n ```html\n \n

{{person.title}}

\n \n

{{person.signature}}

\n ```\n\n You can use `yield` inside a template to\n include the **contents** of any block attached to\n the component. The block will be executed in the\n context of the surrounding context or outer controller:\n\n ```handlebars\n {{#app-profile person=currentUser}}\n

Admin mode

\n {{! Executed in the controllers context. }}\n {{/app-profile}}\n ```\n\n ```handlebars\n \n

{{person.title}}

\n {{! Executed in the components context. }}\n {{yield}} {{! block contents }}\n ```\n\n If you want to customize the component, in order to\n handle events or actions, you implement a subclass\n of `Ember.Component` named after the name of the\n component. Note that `Component` needs to be appended to the name of\n your subclass like `AppProfileComponent`.\n\n For example, you could implement the action\n `hello` for the `app-profile` component:\n\n ```javascript\n App.AppProfileComponent = Ember.Component.extend({\n actions: {\n hello: function(name) {\n console.log(\"Hello\", name);\n }\n }\n });\n ```\n\n And then use it in the component's template:\n\n ```html\n \n\n

{{person.title}}

\n {{yield}} \n\n \n ```\n\n Components must have a `-` in their name to avoid\n conflicts with built-in controls that wrap HTML\n elements. This is consistent with the same\n requirement in web components.\n\n @class Component\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Component = Ember.View.extend(Ember.TargetActionSupport, {\n init: function() {\n this._super();\n set(this, 'context', this);\n set(this, 'controller', this);\n },\n\n defaultLayout: function(options){\n options.data = {view: options._context};\n Ember.Handlebars.helpers['yield'].apply(this, [options]);\n },\n\n // during render, isolate keywords\n cloneKeywords: function() {\n return {\n view: this,\n controller: this\n };\n },\n\n _yield: function(context, options) {\n var view = options.data.view,\n parentView = this._parentView,\n template = get(this, 'template');\n\n if (template) {\n Ember.assert(\"A Component must have a parent view in order to yield.\", parentView);\n\n view.appendChild(Ember.View, {\n isVirtual: true,\n tagName: '',\n _contextView: parentView,\n template: template,\n context: get(parentView, 'context'),\n controller: get(parentView, 'controller'),\n templateData: { keywords: parentView.cloneKeywords() }\n });\n }\n },\n\n /**\n If the component is currently inserted into the DOM of a parent view, this\n property will point to the controller of the parent view.\n\n @property targetObject\n @type Ember.Controller\n @default null\n */\n targetObject: Ember.computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n Triggers a named action on the controller context where the component is used if\n this controller has registered for notifications of the action.\n\n For example a component for playing or pausing music may translate click events\n into action notifications of \"play\" or \"stop\" depending on some internal state\n of the component:\n\n\n ```javascript\n App.PlayButtonComponent = Ember.Component.extend({\n click: function(){\n if (this.get('isPlaying')) {\n this.triggerAction('play');\n } else {\n this.triggerAction('stop');\n }\n }\n });\n ```\n\n When used inside a template these component actions are configured to\n trigger actions in the outer application context:\n\n ```handlebars\n {{! application.hbs }}\n {{play-button play=\"musicStarted\" stop=\"musicStopped\"}}\n ```\n\n When the component receives a browser `click` event it translate this\n interaction into application-specific semantics (\"play\" or \"stop\") and\n triggers the specified action name on the controller for the template\n where the component is used: \n\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n musicStarted: function(){\n // called when the play button is clicked\n // and the music started playing\n },\n musicStopped: function(){\n // called when the play button is clicked\n // and the music stopped playing\n }\n }\n });\n ```\n\n If no action name is passed to `sendAction` a default name of \"action\"\n is assumed.\n\n ```javascript\n App.NextButtonComponent = Ember.Component.extend({\n click: function(){\n this.sendAction();\n }\n });\n ```\n\n ```handlebars\n {{! application.hbs }}\n {{next-button action=\"playNextSongInAlbum\"}}\n ```\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n playNextSongInAlbum: function(){\n ...\n }\n }\n });\n ```\n\n @method sendAction\n @param [action] {String} the action to trigger\n @param [context] {*} a context to send with the action\n */\n sendAction: function(action) {\n var actionName,\n contexts = a_slice.call(arguments, 1);\n\n // Send the default action\n if (action === undefined) {\n actionName = get(this, 'action');\n Ember.assert(\"The default action was triggered on the component \" + this.toString() + \", but the action name (\" + actionName + \") was not a string.\", isNone(actionName) || typeof actionName === 'string');\n } else {\n actionName = get(this, action);\n Ember.assert(\"The \" + action + \" action was triggered on the component \" + this.toString() + \", but the action name (\" + actionName + \") was not a string.\", isNone(actionName) || typeof actionName === 'string');\n }\n\n // If no action name for that action could be found, just abort.\n if (actionName === undefined) { return; }\n\n this.triggerAction({\n action: actionName,\n actionContext: contexts\n });\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/component");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;\nvar ViewCollection = Ember._ViewCollection;\n\n/**\n A `ContainerView` is an `Ember.View` subclass that implements `Ember.MutableArray`\n allowing programmatic 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 programmatic 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 `` 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
\n
A
\n
B
\n
\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
\n
A
\n
\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 `` 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
\n
A
\n
B
\n
\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, ]\n ```\n\n Will result in the following HTML\n\n ```html\n
\n
A
\n
B
\n
Another view
\n
\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 @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 if (!_childViews.length) { _childViews = this._childViews = this._childViews.slice(); }\n _childViews.push(this.createChildView(currentView));\n }\n },\n\n replace: function(idx, removedCount, addedViews) {\n var addedCount = addedViews ? get(addedViews, 'length') : 0;\n var self = this;\n Ember.assert(\"You can't add a child to a container that is already a child of another view\", Ember.A(addedViews).every(function(item) { return !get(item, '_parentView') || get(item, '_parentView') === self; }));\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 if (addedViews.length && !this._childViews.length) { this._childViews = this._childViews.slice(); }\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 }).volatile(),\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: '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 (!view.container && parentView) {\n set(view, 'container', parentView.container);\n }\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', templateData);\n }\n });\n },\n\n currentView: null,\n\n _currentViewWillChange: Ember.beforeObserver('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n currentView.destroy();\n }\n }),\n\n _currentViewDidChange: Ember.observer('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n Ember.assert(\"You tried to set a current view that already has a parent. Make sure you don't have multiple outlets in the same view.\", !get(currentView, '_parentView'));\n this.pushObject(currentView);\n }\n }),\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 Ember.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\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
\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
\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
\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
\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
\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
\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.extend({\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
\n ```\n\n When isEnabled is `false`, the resulting HTML reprensentation looks like\n this:\n\n ```html\n
\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.extend({\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
\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
\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](/api/classes/Ember.Object.html) documentation for more\n information about concatenated 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 \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 \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](/api/classes/Ember.Object.html)\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
I am the template
\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 \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 If you have nested resources, your Handlebars template will look like this:\n\n ```html\n \n ```\n\n And `templateName` property:\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'posts/new'\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 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
I was the default
\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
I was the template, not default
\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
Hello Barry!!!
\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. ``)\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(\"
{{yield}}
\")\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
\n
\n I got wrapped\n
\n
\n ```\n\n See [Ember.Handlebars.helpers.yield](/api/classes/Ember.Handlebars.helpers.html#method_yield)\n 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 precedence 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 // OuterView 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](/api/classes/Ember.Handlebars.helpers.html#method_action).\n\n ### Event Names\n\n All of the event handling approaches described above respond to the same set\n of events. The names of the built-in events are listed below. (The hash of\n built-in events exists in `Ember.EventDispatcher`.) Additional, custom events\n can be registered by using `Ember.Application.customEvents`.\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 [Ember.Handlebars.helpers.view](/api/classes/Ember.Handlebars.helpers.html#method_view)\n for additional information.\n\n @class View\n @namespace Ember\n @extends Ember.CoreView\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 By default `Ember.View` will lookup a template with this name in\n `Ember.TEMPLATES` (a shared global object).\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 By default `Ember.View` will lookup a template with this name in\n `Ember.TEMPLATES` (a shared global object).\n\n @property layoutName\n @type String\n @default null\n */\n layoutName: null,\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 /**\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 _yield: function(context, options) {\n var template = get(this, 'template');\n if (template) { template(context, options); }\n },\n\n templateForName: function(name, type) {\n if (!name) { return; }\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n // the defaultContainer is deprecated\n var container = this.container || (Ember.Container && Ember.Container.defaultContainer);\n return container && container.lookup('template:' + name);\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 _contextDidChange\n */\n _contextDidChange: Ember.observer('context', function() {\n this.rerender();\n }),\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: EMPTY_ARRAY,\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews will change.\n _childViewsWillChange: Ember.beforeObserver('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyWillChange(parentView, 'childViews'); }\n }\n }),\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews did change.\n _childViewsDidChange: Ember.observer('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyDidChange(parentView, 'childViews'); }\n }\n }),\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('_parentView', function() {\n if (this.isDestroying) { return; }\n\n this.trigger('parentViewDidChange');\n\n if (get(this, 'parentView.controller') && !get(this, 'controller')) {\n this.notifyPropertyChange('controller');\n }\n }),\n\n _controllerDidChange: Ember.observer('controller', function() {\n if (this.isDestroying) { return; }\n\n this.rerender();\n\n this.forEachChildView(function(view) {\n view.propertyDidChange('controller');\n });\n }),\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;\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 @method $\n @param {String} [selector] a jQuery-compatible selector string\n @return {jQuery} the jQuery 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(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(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 tried to append to (\" + target + \") but that isn't in the DOM\", Ember.$(target).length > 0);\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 tried to replace in (\" + target + \") but that isn't in the DOM\", Ember.$(target).length > 0);\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 or after the view was re-rendered. Override this function to do any\n set up that requires an element in the 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 (unless includeSelf is false) and recursively on child views.\n\n @method invokeRecursively\n @param fn {Function}\n @param includeSelf (optional, default true)\n */\n invokeRecursively: function(fn, includeSelf) {\n var childViews = (includeSelf === false) ? this._childViews : [this];\n var currentViews, view, currentChildViews;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i` 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](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.extend({\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.extend({\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.extend({\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: EMPTY_ARRAY,\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
\n Ember.View.extend({\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
\n Ember.View.extend({\n attributeBindings: ['enabled'],\n enabled: true\n });\n ```\n\n @property attributeBindings\n */\n attributeBindings: EMPTY_ARRAY,\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\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(parentView, view) {\n parentView.removeChild(view);\n });\n },\n\n destroyAllChildren: function() {\n return this.mutateChildViews(function(parentView, 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 destroy\n */\n destroy: function() {\n var childViews = this._childViews,\n // get parentView before calling super because it'll be destroyed\n nonVirtualParentView = get(this, 'parentView'),\n viewName = this.viewName,\n childLen, i;\n\n if (!this._super()) { return; }\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 (viewName && nonVirtualParentView) {\n nonVirtualParentView.set(viewName, null);\n }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].destroy();\n }\n\n return this;\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|String} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n if (!view) {\n throw new TypeError(\"createChildViews first argument must exist\");\n }\n\n if (view.isView && view._parentView === this && view.container === this.container) {\n return view;\n }\n\n attrs = attrs || {};\n attrs._parentView = this;\n\n if (Ember.CoreView.detect(view)) {\n attrs.templateData = attrs.templateData || get(this, 'templateData');\n\n attrs.container = this.container;\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) {\n set(get(this, 'concreteView'), view.viewName, view);\n }\n } else if ('string' === typeof view) {\n var fullName = 'view:' + view;\n var View = this.container.lookupFactory(fullName);\n\n Ember.assert(\"Could not find view: '\" + fullName + \"'\", !!View);\n\n attrs.templateData = get(this, 'templateData');\n view = View.create(attrs);\n } else {\n Ember.assert('You must pass instance or subclass of View', view.isView);\n attrs.container = this.container;\n\n if (!get(view, 'templateData')) {\n attrs.templateData = get(this, 'templateData');\n }\n\n Ember.setProperties(view, attrs);\n\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('isVisible', 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 }),\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 var priorState = this.currentState,\n currentState = this.currentState = this.states[state];\n this.state = state;\n\n if (priorState && priorState.exit) { priorState.exit(this); }\n if (currentState.enter) { currentState.enter(this); }\n if (state === 'inDOM') { delete Ember.meta(this).cache.element; }\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\n if (!root || typeof root !== 'object') {\n return;\n }\n\n var view = this,\n stateCheckedObserver = function() {\n view.currentState.invokeObserver(this, observer);\n },\n scheduledObserver = function() {\n Ember.run.scheduleOnce('render', this, stateCheckedObserver);\n };\n\n Ember.addObserver(root, path, target, scheduledObserver);\n\n this.one('willClearRender', function() {\n Ember.removeObserver(root, path, target, scheduledObserver);\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\" will 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 != 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 or null\n if (Ember.isNone(value)) { value = ''; }\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\nfunction throwWithMessage(msg) {\n return function() {\n throw new Ember.Error(msg);\n };\n}\n\nfunction generateRemovedClass(className) {\n var msg = \" has been moved into a plugin: https://github.com/emberjs/ember-states\";\n\n return {\n extend: throwWithMessage(className + msg),\n create: throwWithMessage(className + msg)\n };\n}\n\nEmber.StateManager = generateRemovedClass(\"Ember.StateManager\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n \n @class StateManager\n @namespace Ember\n*/\n\nEmber.State = generateRemovedClass(\"Ember.State\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n \n @class State\n @namespace 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, deps, callback, reified, exports;\n\n mod = registry[name];\n\n if (!mod) {\n throw new Error(\"Module '\" + name + \"' not found.\");\n }\n\n deps = mod.deps;\n callback = mod.callback;\n reified = [];\n\n for (var i=0, l=deps.length; i
\";\n testEl.firstChild.innerHTML = \"\";\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: 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 \"hi\";\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 . 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 = \"
hi
\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 */\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/all\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n /* global toString */\n\n\n function all(promises) {\n if (Object.prototype.toString.call(promises) !== \"[object Array]\") {\n throw new TypeError('You must pass an array to all.');\n }\n\n return new Promise(function(resolve, reject) {\n var results = [], remaining = promises.length,\n promise;\n\n if (remaining === 0) {\n resolve([]);\n }\n\n function resolver(index) {\n return function(value) {\n resolveAll(index, value);\n };\n }\n\n function resolveAll(index, value) {\n results[index] = value;\n if (--remaining === 0) {\n resolve(results);\n }\n }\n\n for (var i = 0; i < promises.length; i++) {\n promise = promises[i];\n\n if (promise && typeof promise.then === 'function') {\n promise.then(resolver(i), reject);\n } else {\n resolveAll(i, promise);\n }\n }\n });\n }\n\n\n __exports__.all = all;\n });\ndefine(\"rsvp/async\",\n [\"rsvp/config\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var config = __dependency1__.config;\n\n var browserGlobal = (typeof window !== 'undefined') ? window : {};\n var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n var local = (typeof global !== 'undefined') ? global : this;\n\n // node\n function useNextTick() {\n return function() {\n process.nextTick(flush);\n };\n }\n\n function useMutationObserver() {\n var observer = new BrowserMutationObserver(flush);\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 }, false);\n\n return function() {\n element.setAttribute('drainQueue', 'drainQueue');\n };\n }\n\n function useSetTimeout() {\n return function() {\n local.setTimeout(flush, 1);\n };\n }\n\n var queue = [];\n function flush() {\n for (var i = 0; i < queue.length; i++) {\n var tuple = queue[i];\n var callback = tuple[0], arg = tuple[1];\n callback(arg);\n }\n queue = [];\n }\n\n var scheduleFlush;\n\n // Decide what async method to use to triggering processing of queued callbacks:\n if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {\n scheduleFlush = useNextTick();\n } else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n } else {\n scheduleFlush = useSetTimeout();\n }\n\n function asyncDefault(callback, arg) {\n var length = queue.push([callback, arg]);\n if (length === 1) {\n // If length is 1, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n scheduleFlush();\n }\n }\n\n config.async = asyncDefault;\n\n function async(callback, arg) {\n config.async(callback, arg);\n }\n\n\n __exports__.async = async;\n __exports__.asyncDefault = asyncDefault;\n });\ndefine(\"rsvp/cast\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n function cast(object) {\n /*jshint validthis:true */\n if (object && typeof object === 'object' && object.constructor === this) {\n return object;\n }\n\n var Promise = this;\n\n return new Promise(function(resolve) {\n resolve(object);\n });\n }\n\n\n __exports__.cast = cast;\n });\ndefine(\"rsvp/config\",\n [\"rsvp/events\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var EventTarget = __dependency1__.EventTarget;\n\n var config = {};\n EventTarget.mixin(config);\n\n function configure(name, value) {\n if (name === 'onerror') {\n // handle for legacy users that expect the actual\n // error to be passed to their function added via\n // `RSVP.configure('onerror', someFunctionHere);`\n config.on('error', function(event){\n value(event.detail);\n });\n } else {\n config[name] = value;\n }\n }\n\n function on(){\n return config.on.apply(config, arguments);\n }\n\n function off(){\n return config.off.apply(config, arguments);\n }\n\n function trigger(){\n return config.trigger.apply(config, arguments);\n }\n\n\n __exports__.config = config;\n __exports__.configure = configure;\n __exports__.on = on;\n __exports__.off = off;\n __exports__.trigger = trigger;\n });\ndefine(\"rsvp/defer\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n function defer() {\n var deferred = {\n // pre-allocate shape\n resolve: undefined,\n reject: undefined,\n promise: undefined\n };\n\n deferred.promise = new Promise(function(resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n\n return deferred;\n }\n\n\n __exports__.defer = defer;\n });\ndefine(\"rsvp/events\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\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 2) {\n resolve(Array.prototype.slice.call(arguments, 1));\n } else {\n resolve(value);\n }\n };\n }\n\n function denodeify(nodeFunc) {\n return function() {\n var nodeArgs = Array.prototype.slice.call(arguments), resolve, reject;\n var thisArg = this;\n\n var promise = new Promise(function(nodeResolve, nodeReject) {\n resolve = nodeResolve;\n reject = nodeReject;\n });\n\n all(nodeArgs).then(function(nodeArgs) {\n nodeArgs.push(makeNodeCallbackFor(resolve, reject));\n\n try {\n nodeFunc.apply(thisArg, nodeArgs);\n } catch(e) {\n reject(e);\n }\n });\n\n return promise;\n };\n }\n\n\n __exports__.denodeify = denodeify;\n });\ndefine(\"rsvp/promise\",\n [\"rsvp/config\",\"rsvp/events\",\"rsvp/cast\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __exports__) {\n \"use strict\";\n var config = __dependency1__.config;\n var EventTarget = __dependency2__.EventTarget;\n var cast = __dependency3__.cast;\n\n function objectOrFunction(x) {\n return isFunction(x) || (typeof x === \"object\" && x !== null);\n }\n\n function isFunction(x){\n return typeof x === \"function\";\n }\n\n function Promise(resolver) {\n var promise = this,\n resolved = false;\n\n if (typeof resolver !== 'function') {\n throw new TypeError('You must pass a resolver function as the sole argument to the promise constructor');\n }\n\n if (!(promise instanceof Promise)) {\n return new Promise(resolver);\n }\n\n var resolvePromise = function(value) {\n if (resolved) { return; }\n resolved = true;\n resolve(promise, value);\n };\n\n var rejectPromise = function(value) {\n if (resolved) { return; }\n resolved = true;\n reject(promise, value);\n };\n\n try {\n resolver(resolvePromise, rejectPromise);\n } catch(e) {\n rejectPromise(e);\n }\n }\n\n var invokeCallback = function(type, promise, callback, event) {\n var hasCallback = isFunction(callback),\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 (handleThenable(promise, value)) {\n return;\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (failed) {\n reject(promise, error);\n } else if (type === 'resolve') {\n resolve(promise, value);\n } else if (type === 'reject') {\n reject(promise, value);\n }\n };\n\n Promise.prototype = {\n constructor: Promise,\n isRejected: undefined,\n isFulfilled: undefined,\n rejectedReason: undefined,\n fulfillmentValue: undefined,\n\n _onerror: function (reason) {\n config.trigger('error', {\n detail: reason\n });\n },\n\n then: function(done, fail) {\n this._onerror = null;\n\n var thenPromise = new this.constructor(function() {});\n\n if (this.isFulfilled) {\n config.async(function(promise) {\n invokeCallback('resolve', thenPromise, done, { detail: promise.fulfillmentValue });\n }, this);\n }\n\n if (this.isRejected) {\n config.async(function(promise) {\n invokeCallback('reject', thenPromise, fail, { detail: promise.rejectedReason });\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 fail: function(onRejection) {\n return this.then(null, onRejection);\n },\n 'finally': function(callback) {\n var constructor = this.constructor;\n\n return this.then(function(value) {\n return constructor.cast(callback()).then(function(){\n return value;\n });\n }, function(reason) {\n return constructor.cast(callback()).then(function(){\n throw reason;\n });\n });\n }\n };\n\n Promise.prototype['catch'] = Promise.prototype.fail;\n Promise.cast = cast;\n\n EventTarget.mixin(Promise.prototype);\n\n function resolve(promise, value) {\n if (promise === value) {\n fulfill(promise, value);\n } else if (!handleThenable(promise, value)) {\n fulfill(promise, value);\n }\n }\n\n function handleThenable(promise, value) {\n var then = null,\n resolved;\n\n try {\n if (promise === value) {\n throw new TypeError(\"A promises callback cannot return that same promise.\");\n }\n\n if (objectOrFunction(value)) {\n then = value.then;\n\n if (isFunction(then)) {\n then.call(value, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n if (value !== val) {\n resolve(promise, val);\n } else {\n fulfill(promise, val);\n }\n }, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n reject(promise, val);\n });\n\n return true;\n }\n }\n } catch (error) {\n reject(promise, error);\n return true;\n }\n\n return false;\n }\n\n function fulfill(promise, value) {\n config.async(function() {\n promise.trigger('promise:resolved', { detail: value });\n promise.isFulfilled = true;\n promise.fulfillmentValue = value;\n });\n }\n\n function reject(promise, value) {\n config.async(function() {\n if (promise._onerror) { promise._onerror(value); }\n promise.trigger('promise:failed', { detail: value });\n promise.isRejected = true;\n promise.rejectedReason = value;\n });\n }\n\n\n __exports__.Promise = Promise;\n });\ndefine(\"rsvp/reject\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n function reject(reason) {\n return new Promise(function (resolve, reject) {\n reject(reason);\n });\n }\n\n\n __exports__.reject = reject;\n });\ndefine(\"rsvp/resolve\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n function resolve(thenable) {\n return new Promise(function(resolve, reject) {\n resolve(thenable);\n });\n }\n\n\n __exports__.resolve = resolve;\n });\ndefine(\"rsvp/rethrow\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var local = (typeof global === \"undefined\") ? this : global;\n\n function rethrow(reason) {\n local.setTimeout(function() {\n throw reason;\n });\n throw reason;\n }\n\n\n __exports__.rethrow = rethrow;\n });\ndefine(\"rsvp\",\n [\"rsvp/events\",\"rsvp/promise\",\"rsvp/node\",\"rsvp/all\",\"rsvp/hash\",\"rsvp/rethrow\",\"rsvp/defer\",\"rsvp/config\",\"rsvp/resolve\",\"rsvp/reject\",\"rsvp/async\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {\n \"use strict\";\n var EventTarget = __dependency1__.EventTarget;\n var Promise = __dependency2__.Promise;\n var denodeify = __dependency3__.denodeify;\n var all = __dependency4__.all;\n var hash = __dependency5__.hash;\n var rethrow = __dependency6__.rethrow;\n var defer = __dependency7__.defer;\n var config = __dependency8__.config;\n var configure = __dependency8__.configure;\n var on = __dependency8__.on;\n var off = __dependency8__.off;\n var trigger = __dependency8__.trigger;\n var resolve = __dependency9__.resolve;\n var reject = __dependency10__.reject;\n var async = __dependency11__.async;\n var asyncDefault = __dependency11__.asyncDefault;\n\n\n __exports__.Promise = Promise;\n __exports__.EventTarget = EventTarget;\n __exports__.all = all;\n __exports__.hash = hash;\n __exports__.rethrow = rethrow;\n __exports__.defer = defer;\n __exports__.denodeify = denodeify;\n __exports__.configure = configure;\n __exports__.trigger = trigger;\n __exports__.on = on;\n __exports__.off = off;\n __exports__.resolve = resolve;\n __exports__.reject = reject;\n __exports__.async = async;\n __exports__.asyncDefault = asyncDefault;\n });\n\n})();\n//@ sourceURL=rsvp");