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 = registry[name], deps = mod.deps, callback = mod.callback, reified = [], exports; for (var i=0, l=deps.length; i 0);\n this._readinessDeferrals++;\n },\n\n /**\n @method advanceReadiness\n @see {Ember.Application#deferReadiness}\n */\n advanceReadiness: function() {\n this._readinessDeferrals--;\n\n if (this._readinessDeferrals === 0) {\n Ember.run.once(this, this.didBecomeReady);\n }\n },\n\n /**\n registers a factory for later injection\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n\n App.Person = Ember.Object.extend({});\n App.Orange = Ember.Object.extend({});\n App.Email = Ember.Object.extend({});\n\n App.register('model:user', App.Person, {singleton: false });\n App.register('fruit:favorite', App.Orange);\n App.register('communication:main', App.Email, {singleton: false});\n ```\n\n @method register\n @param type {String}\n @param name {String}\n @param factory {String}\n @param options {String} (optional)\n **/\n register: function() {\n var container = this.__container__;\n container.register.apply(container, arguments);\n },\n /**\n defines an injection or typeInjection\n\n Example:\n\n ```javascript\n App.inject(, , )\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 this.register('router:main', this.Router);\n\n this.runInitializers();\n Ember.runLoadHooks('application', this);\n\n // At this point, any initializers or load hooks that would have wanted\n // to defer readiness have fired. In general, advancing readiness here\n // will proceed to didBecomeReady.\n this.advanceReadiness();\n\n return this;\n },\n\n reset: function() {\n Ember.assert('App#reset no longer needs to be wrapped in a run-loop', !Ember.run.currentRunLoop);\n Ember.run(this, function(){\n Ember.run(this.__container__, 'destroy');\n\n this.buildContainer();\n\n this._readinessDeferrals = 1;\n\n Ember.run.schedule('actions', this, function(){\n this._initialize();\n this.startRouting();\n });\n });\n },\n\n /**\n @private\n @method runInitializers\n */\n runInitializers: function() {\n var initializers = get(this.constructor, 'initializers'),\n container = this.__container__,\n graph = new Ember.DAG(),\n namespace = this,\n i, initializer;\n\n for (i=0; i -1) {\n result = result.replace(/\\.(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n if (name.indexOf('_') > -1) {\n result = result.replace(/_(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n return type + ':' + result;\n } else {\n return fullName;\n }\n}\n\nEmber.runLoadHooks('Ember.Application', Ember.Application);\n\n})();\n//@ sourceURL=ember-application/system/application");minispade.register('ember-application/system/dag', "(function() {function visit(vertex, fn, visited, path) {\n var name = vertex.name,\n vertices = vertex.incoming,\n names = vertex.incomingNames,\n len = names.length,\n i;\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n}\n\nfunction DAG() {\n this.names = [];\n this.vertices = {};\n}\n\nDAG.prototype.add = function(name) {\n if (!name) { return; }\n if (this.vertices.hasOwnProperty(name)) {\n return this.vertices[name];\n }\n var vertex = {\n name: name, incoming: {}, incomingNames: [], hasOutgoing: false, value: null\n };\n this.vertices[name] = vertex;\n this.names.push(name);\n return vertex;\n};\n\nDAG.prototype.map = function(name, value) {\n this.add(name).value = value;\n};\n\nDAG.prototype.addEdge = function(fromName, toName) {\n if (!fromName || !toName || fromName === toName) {\n return;\n }\n var from = this.add(fromName), to = this.add(toName);\n if (to.incoming.hasOwnProperty(fromName)) {\n return;\n }\n function checkCycle(vertex, path) {\n if (vertex.name === toName) {\n throw new Error(\"cycle detected: \" + toName + \" <- \" + path.join(\" <- \"));\n }\n }\n visit(from, checkCycle);\n from.hasOutgoing = true;\n to.incoming[fromName] = from;\n to.incomingNames.push(fromName);\n};\n\nDAG.prototype.topsort = function(fn) {\n var visited = {},\n vertices = this.vertices,\n names = this.names,\n len = names.length,\n i, vertex;\n for (i = 0; i < len; i++) {\n vertex = vertices[names[i]];\n if (!vertex.hasOutgoing) {\n visit(vertex, fn, visited);\n }\n }\n};\n\nDAG.prototype.addEdges = function(name, value, before, after) {\n var i;\n this.map(name, value);\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n for (i = 0; i < before.length; i++) {\n this.addEdge(name, before[i]);\n }\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n for (i = 0; i < after.length; i++) {\n this.addEdge(after[i], name);\n }\n }\n }\n};\n\nEmber.DAG = DAG;\n\n})();\n//@ sourceURL=ember-application/system/dag");minispade.register('ember-application/system/resolver', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get,\n classify = Ember.String.classify,\n capitalize = Ember.String.capitalize,\n decamelize = Ember.String.decamelize;\n\n/**\n The DefaultResolver defines the default lookup rules to resolve\n container lookups before consulting the container for registered\n items:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after converting\n the name. For example, `controller:post` looks up\n `App.PostController` by default.\n * there are some nuances (see examples below)\n\n ### How Resolving Works\n\n The container calls this object's `resolve` method with the\n `fullName` argument.\n\n It first parses the fullName into an object using `parseName`.\n\n Then it checks for the presence of a type-specific instance\n method of the form `resolve[Type]` and calls it if it exists.\n For example if it was resolving 'template:post', it would call\n the `resolveTemplate` method.\n\n Its last resort is to call the `resolveOther` method.\n\n The methods of this object are designed to be easy to override\n in a subclass. For example, you could enhance how a template\n is resolved like so:\n\n ```javascript\n App = Ember.Application.create({\n resolver: Ember.DefaultResolver.extend({\n resolveTemplate: function(parsedName) {\n var resolvedTemplate = this._super(parsedName);\n if (resolvedTemplate) { return resolvedTemplate; }\n return Ember.TEMPLATES['not_found'];\n }\n })\n });\n ```\n\n Some examples of how names are resolved:\n\n ```\n 'template:post' //=> Ember.TEMPLATES['post']\n 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:blogPost' //=> Ember.TEMPLATES['blogPost']\n // OR\n // Ember.TEMPLATES['blog_post']\n 'controller:post' //=> App.PostController\n 'controller:posts.index' //=> App.PostsIndexController\n 'controller:blog/post' //=> Blog.PostController\n 'controller:basic' //=> Ember.Controller\n 'route:post' //=> App.PostRoute\n 'route:posts.index' //=> App.PostsIndexRoute\n 'route:blog/post' //=> Blog.PostRoute\n 'route:basic' //=> Ember.Route\n 'view:post' //=> App.PostView\n 'view:posts.index' //=> App.PostsIndexView\n 'view:blog/post' //=> Blog.PostView\n 'view:basic' //=> Ember.View\n 'foo:post' //=> App.PostFoo\n ```\n\n @class DefaultResolver\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.DefaultResolver = Ember.Object.extend({\n /**\n This will be set to the Application instance when it is\n created.\n\n @property namespace\n */\n namespace: null,\n /**\n This method is called via the container's resolver method.\n It parses the provided `fullName` and then looks up and\n returns the appropriate template or class.\n\n @method resolve\n @param {String} fullName the lookup string\n @return {Object} the resolved factory\n */\n resolve: function(fullName) {\n var parsedName = this.parseName(fullName),\n typeSpecificResolveMethod = this[parsedName.resolveMethodName];\n if (typeSpecificResolveMethod) {\n var resolved = typeSpecificResolveMethod.call(this, parsedName);\n if (resolved) { return resolved; }\n }\n return this.resolveOther(parsedName);\n },\n /**\n Convert the string name of the form \"type:name\" to\n a Javascript object with the parsed aspects of the name\n broken out.\n\n @protected\n @method parseName\n */\n parseName: function(fullName) {\n var nameParts = fullName.split(\":\"),\n type = nameParts[0], fullNameWithoutType = nameParts[1],\n name = fullNameWithoutType,\n namespace = get(this, 'namespace'),\n root = namespace;\n\n if (type !== 'template' && name.indexOf('/') !== -1) {\n var parts = name.split('/');\n name = parts[parts.length - 1];\n var namespaceName = capitalize(parts.slice(0, -1).join('.'));\n root = Ember.Namespace.byName(namespaceName);\n\n Ember.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root);\n }\n\n return {\n fullName: fullName,\n type: type,\n fullNameWithoutType: fullNameWithoutType,\n name: name,\n root: root,\n resolveMethodName: \"resolve\" + classify(type)\n };\n },\n /**\n Look up the template in Ember.TEMPLATES\n\n @protected\n @method resolveTemplate\n */\n resolveTemplate: function(parsedName) {\n var templateName = parsedName.fullNameWithoutType.replace(/\\./g, '/');\n\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n\n templateName = decamelize(templateName);\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n },\n /**\n Given a parseName object (output from `parseName`), apply\n the conventions expected by `Ember.Router`\n\n @protected\n @method useRouterNaming\n */\n useRouterNaming: function(parsedName) {\n parsedName.name = parsedName.name.replace(/\\./g, '_');\n if (parsedName.name === 'basic') {\n parsedName.name = '';\n }\n },\n /**\n @protected\n @method resolveController\n */\n resolveController: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n @protected\n @method resolveRoute\n */\n resolveRoute: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n @protected\n @method resolveView\n */\n resolveView: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Look up the specified object (from parsedName) on the appropriate\n namespace (usually on the Application)\n\n @protected\n @method resolveOther\n */\n resolveOther: function(parsedName) {\n var className = classify(parsedName.name) + classify(parsedName.type),\n factory = get(parsedName.root, className);\n if (factory) { return factory; }\n }\n});\n\n})();\n//@ sourceURL=ember-application/system/resolver");minispade.register('ember-debug', "(function() {/*global __fail__*/\n\n/**\nEmber Debug\n\n@module ember\n@submodule ember-debug\n*/\n\n/**\n@class Ember\n*/\n\nif ('undefined' === typeof Ember) {\n Ember = {};\n\n if ('undefined' !== typeof window) {\n window.Em = window.Ember = Em = Ember;\n }\n}\n\nEmber.ENV = 'undefined' === typeof ENV ? {} : ENV;\n\nif (!('MANDATORY_SETTER' in Ember.ENV)) {\n Ember.ENV.MANDATORY_SETTER = true; // default to true for debug dist\n}\n\n/**\n Define an assertion that will throw an exception if the condition is not\n met. Ember build tools will remove any calls to `Ember.assert()` when\n doing a production build. Example:\n\n ```javascript\n // Test for truthiness\n Ember.assert('Must pass a valid object', obj);\n // Fail unconditionally\n Ember.assert('This code path should never be run')\n ```\n\n @method assert\n @param {String} desc A description of the assertion. This will become\n the text of the Error thrown if the assertion fails.\n @param {Boolean} test Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.\n*/\nEmber.assert = function(desc, test) {\n if (!test) throw new Error(\"assertion failed: \"+desc);\n};\n\n\n/**\n Display a warning with the provided message. Ember build tools will\n remove any calls to `Ember.warn()` when doing a production build.\n\n @method warn\n @param {String} message A warning to display.\n @param {Boolean} test An optional boolean. If falsy, the warning\n will be displayed.\n*/\nEmber.warn = function(message, test) {\n if (!test) {\n Ember.Logger.warn(\"WARNING: \"+message);\n if ('trace' in Ember.Logger) Ember.Logger.trace();\n }\n};\n\n/**\n Display a debug notice. Ember build tools will remove any calls to\n `Ember.debug()` when doing a production build.\n\n ```javascript\n Ember.debug(\"I'm a debug notice!\");\n ```\n\n @method debug\n @param {String} message A debug message to display.\n*/\nEmber.debug = function(message) {\n Ember.Logger.debug(\"DEBUG: \"+message);\n};\n\n/**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only). Ember build tools will remove any calls to\n `Ember.deprecate()` when doing a production build.\n\n @method deprecate\n @param {String} message A description of the deprecation.\n @param {Boolean} test An optional boolean. If falsy, the deprecation\n will be displayed.\n*/\nEmber.deprecate = function(message, test) {\n if (Ember && Ember.TESTING_DEPRECATION) { return; }\n\n if (arguments.length === 1) { test = false; }\n if (test) { return; }\n\n if (Ember && Ember.ENV.RAISE_ON_DEPRECATION) { throw new Error(message); }\n\n var error;\n\n // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome\n try { __fail__.fail(); } catch (e) { error = e; }\n\n if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {\n var stack, stackStr = '';\n if (error['arguments']) {\n // Chrome\n stack = error.stack.replace(/^\\s+at\\s+/gm, '').\n replace(/^([^\\(]+?)([\\n$])/gm, '{anonymous}($1)$2').\n replace(/^Object.\\s*\\(([^\\)]+)\\)/gm, '{anonymous}($1)').split('\\n');\n stack.shift();\n } else {\n // Firefox\n stack = error.stack.replace(/(?:\\n@:0)?\\s+$/m, '').\n replace(/^\\(/gm, '{anonymous}(').split('\\n');\n }\n\n stackStr = \"\\n \" + stack.slice(2).join(\"\\n \");\n message = message + stackStr;\n }\n\n Ember.Logger.warn(\"DEPRECATION: \"+message);\n};\n\n\n\n/**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only) when the wrapped method is called.\n\n Ember build tools will not remove calls to `Ember.deprecateFunc()`, though\n no warnings will be shown in production.\n\n @method deprecateFunc\n @param {String} message A description of the deprecation.\n @param {Function} func The function to be deprecated.\n @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//@ sourceURL=ember-debug");minispade.register('ember-handlebars-compiler', "(function() {/**\n@module ember\n@submodule ember-handlebars-compiler\n*/\n\n// Eliminate dependency on any Ember to simplify precompilation workflow\nvar objectCreate = Object.create || function(parent) {\n function F() {}\n F.prototype = parent;\n return new F();\n};\n\nvar Handlebars = this.Handlebars || (Ember.imports && Ember.imports.Handlebars);\nif(!Handlebars && typeof require === 'function') {\n Handlebars = require('handlebars');\n}\n\nEmber.assert(\"Ember Handlebars requires Handlebars 1.0.0-rc.3 or greater. Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before you link to Ember.\", Handlebars && Handlebars.COMPILER_REVISION === 2);\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\nfunction makeBindings(options) {\n var hash = options.hash,\n hashType = options.hashTypes;\n\n for (var prop in hash) {\n if (hashType[prop] === 'ID') {\n hash[prop + 'Binding'] = hash[prop];\n hashType[prop + 'Binding'] = 'STRING';\n delete hash[prop];\n delete hashType[prop];\n }\n }\n}\n\nEmber.Handlebars.helper = function(name, value) {\n if (Ember.View.detect(value)) {\n Ember.Handlebars.registerHelper(name, function(options) {\n Ember.assert(\"You can only pass attributes as parameters to a application-defined helper\", arguments.length < 3);\n makeBindings(options);\n return Ember.Handlebars.helpers.view.call(this, value, options);\n });\n } else {\n Ember.Handlebars.registerBoundHelper.apply(null, arguments);\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\n\nEmber.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {\n return \"''\";\n};\n\n/**\n @private\n\n Override the default buffer for Ember Handlebars. By default, Handlebars\n creates an empty String at the beginning of each invocation and appends to\n it. Ember's Handlebars overrides this to append to a single shared buffer.\n\n @method appendToBuffer\n @param string {String}\n*/\nEmber.Handlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {\n return \"data.buffer.push(\"+string+\");\";\n};\n\nvar prefix = \"ember\" + (+new Date()), incr = 1;\n\n/**\n @private\n\n Rewrite simple mustaches from `{{foo}}` to `{{bind \"foo\"}}`. This means that\n all simple mustaches in Ember's Handlebars will also set up an observer to\n keep the DOM up to date when the underlying property changes.\n\n @method mustache\n @for Ember.Handlebars.Compiler\n @param mustache\n*/\nEmber.Handlebars.Compiler.prototype.mustache = function(mustache) {\n if (mustache.isHelper && mustache.id.string === 'control') {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"controlID\", new Handlebars.AST.StringNode(prefix + incr++)]);\n } else if (mustache.params.length || mustache.hash) {\n // no changes required\n } else {\n var id = new Handlebars.AST.IdNode(['_triageMustache']);\n\n // Update the mustache node to include a hash value indicating whether the original node\n // was escaped. This will allow us to properly escape values when the underlying value\n // changes and we need to re-render the value.\n if(!mustache.escaped) {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"unescaped\", new Handlebars.AST.StringNode(\"true\")]);\n }\n mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);\n }\n\n return Handlebars.Compiler.prototype.mustache.call(this, mustache);\n};\n\n/**\n Used for precompilation of Ember Handlebars templates. This will not be used\n during normal app execution.\n\n @method precompile\n @for Ember.Handlebars\n @static\n @param {String} string The template to precompile\n*/\nEmber.Handlebars.precompile = function(string) {\n var ast = Handlebars.parse(string);\n\n var options = {\n knownHelpers: {\n action: true,\n unbound: true,\n bindAttr: true,\n template: true,\n view: true,\n _triageMustache: true\n },\n data: true,\n stringParams: true\n };\n\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n};\n\n// We don't support this for Handlebars runtime-only\nif (Handlebars.compile) {\n /**\n The entry point for Ember Handlebars. This replaces the default\n `Handlebars.compile` and turns on template-local data and String\n parameters.\n\n @method compile\n @for Ember.Handlebars\n @static\n @param {String} string The template to compile\n @return {Function}\n */\n Ember.Handlebars.compile = function(string) {\n var ast = Handlebars.parse(string);\n var options = { data: true, stringParams: true };\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n var templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n\n return Ember.Handlebars.template(templateSpec);\n };\n}\n\n\n})();\n//@ sourceURL=ember-handlebars-compiler");minispade.register('ember-handlebars/controls', "(function() {minispade.require(\"ember-handlebars/controls/checkbox\");\nminispade.require(\"ember-handlebars/controls/text_field\");\nminispade.require(\"ember-handlebars/controls/button\");\nminispade.require(\"ember-handlebars/controls/text_area\");\nminispade.require(\"ember-handlebars/controls/select\");\n\nfunction normalizeHash(hash, hashTypes) {\n for (var prop in hash) {\n if (hashTypes[prop] === 'ID') {\n hash[prop + 'Binding'] = hash[prop];\n delete hash[prop];\n }\n }\n}\n\n/**\n * `{{input}}` inserts a new instance of either Ember.TextField or\n * Ember.Checkbox, depending on the `type` option passed in. If no `type`\n * is supplied it defaults to Ember.TextField.\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 normalizeHash(hash, types);\n\n if (inputType === 'checkbox') {\n return Ember.Handlebars.helpers.view.call(this, Ember.Checkbox, options);\n } else {\n 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 Ember.TextArea into the template\n * passing its options to `Ember.TextArea`'s `create` method.\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 normalizeHash(hash, types);\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 `Ember.Checkbox` view class renders a checkbox\n [input](https://developer.mozilla.org/en/HTML/Element/Input) element. It\n allows for binding an Ember property (`checked`) to the status of the\n checkbox.\n\n Example:\n\n ```handlebars\n {{view Ember.Checkbox checkedBinding=\"receiveEmail\"}}\n ```\n\n You can add a `label` tag yourself in the template where the `Ember.Checkbox`\n is being used.\n\n ```html\n \n ```\n\n The `checked` attribute of an `Ember.Checkbox` object should always be set\n through the Ember object or by interacting with its rendered element\n representation via the mouse, keyboard, or touch. Updating the value of the\n checkbox via jQuery will result in the checked value of the object and its\n element losing synchronization.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See `Ember.View`'s layout section for more\n information.\n\n @class Checkbox\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Checkbox = Ember.View.extend({\n classNames: ['ember-checkbox'],\n\n tagName: 'input',\n\n attributeBindings: ['type', 'checked', 'disabled', 'tabindex', 'name'],\n\n type: \"checkbox\",\n checked: false,\n disabled: false,\n\n init: function() {\n this._super();\n this.on(\"change\", this, this._updateElementValue);\n },\n\n _updateElementValue: function() {\n set(this, 'checked', this.$().prop('checked'));\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/checkbox");minispade.register('ember-handlebars/controls/select', "(function() {/*jshint eqeqeq:false */\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set,\n get = Ember.get,\n indexOf = Ember.EnumerableUtils.indexOf,\n indexesOf = Ember.EnumerableUtils.indexesOf,\n replace = Ember.EnumerableUtils.replace,\n isArray = Ember.isArray,\n precompileTemplate = Ember.Handlebars.compile;\n\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(function() {\n var labelPath = get(this, 'parentView.optionLabelPath');\n\n if (!labelPath) { return; }\n\n Ember.defineProperty(this, 'label', Ember.computed(function() {\n return get(this, labelPath);\n }).property(labelPath));\n }, 'parentView.optionLabelPath'),\n\n valuePathDidChange: Ember.observer(function() {\n var valuePath = get(this, 'parentView.optionValuePath');\n\n if (!valuePath) { return; }\n\n Ember.defineProperty(this, 'value', Ember.computed(function() {\n return get(this, valuePath);\n }).property(valuePath));\n }, 'parentView.optionValuePath')\n});\n\n/**\n 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\n The `value` attribute of the selected `{{/if}}{{#each view.content}}{{view view.optionView contentBinding=\"this\"}}{{/each}}'),\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 disabled: false,\n\n /**\n The list of options.\n\n If `optionLabelPath` and `optionValuePath` are not overridden, this should\n be a list of strings, which will serve simultaneously as labels and values.\n\n Otherwise, this should be a list of objects. For instance:\n\n ```javascript\n Ember.Select.create({\n content: Ember.A([\n { id: 1, firstName: 'Yehuda' },\n { id: 2, firstName: 'Tom' }\n ]),\n optionLabelPath: 'content.firstName',\n optionValuePath: 'content.id'\n });\n ```\n\n @property content\n @type Array\n @default null\n */\n content: null,\n\n /**\n When `multiple` is `false`, the element of `content` that is currently\n selected, if any.\n\n When `multiple` is `true`, an array of such elements.\n\n @property selection\n @type Object or Array\n @default null\n */\n selection: null,\n\n /**\n In single selection mode (when `multiple` is `false`), value can be used to\n get the current selection's value or set the selection by it's value.\n\n It is not currently supported in multiple selection mode.\n\n @property value\n @type String\n @default null\n */\n value: Ember.computed(function(key, value) {\n if (arguments.length === 2) { return value; }\n var valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, '');\n return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection');\n }).property('selection'),\n\n /**\n If given, a top-most dummy option will be rendered to serve as a user\n prompt.\n\n @property prompt\n @type String\n @default null\n */\n prompt: null,\n\n /**\n The path of the option labels. See `content`.\n\n @property optionLabelPath\n @type String\n @default 'content'\n */\n optionLabelPath: 'content',\n\n /**\n The path of the option values. See `content`.\n\n @property optionValuePath\n @type String\n @default 'content'\n */\n optionValuePath: 'content',\n\n /**\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(function() {\n var selection = get(this, 'selection');\n if (get(this, 'multiple')) {\n if (!isArray(selection)) {\n set(this, 'selection', Ember.A([selection]));\n return;\n }\n this._selectionDidChangeMultiple();\n } else {\n this._selectionDidChangeSingle();\n }\n }, 'selection.@each'),\n\n valueDidChange: Ember.observer(function() {\n var content = get(this, 'content'),\n value = get(this, 'value'),\n valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, ''),\n selectedValue = (valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection')),\n selection;\n\n if (value !== selectedValue) {\n selection = content ? content.find(function(obj) {\n return value === (valuePath ? get(obj, valuePath) : obj);\n }) : null;\n\n this.set('selection', selection);\n }\n }, 'value'),\n\n\n _triggerChange: function() {\n var selection = get(this, 'selection');\n var value = get(this, 'value');\n\n if (selection) { this.selectionDidChange(); }\n if (value) { this.valueDidChange(); }\n\n this._change();\n },\n\n _changeSingle: function() {\n var selectedIndex = this.$()[0].selectedIndex,\n content = get(this, 'content'),\n prompt = get(this, 'prompt');\n\n if (!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 `Ember.TextArea` view class renders a\n [textarea](https://developer.mozilla.org/en/HTML/Element/textarea) element.\n It allows for binding Ember properties to the text area contents (`value`),\n live-updating as the user inputs text.\n\n ## Layout and LayoutName properties\n\n Because HTML `textarea` elements do not contain inner HTML the `layout` and\n `layoutName` properties will not be applied. See `Ember.View`'s layout\n section for more information.\n\n ## HTML Attributes\n\n By default `Ember.TextArea` provides support for `rows`, `cols`,\n `placeholder`, `disabled`, `maxlength` and `tabindex` attributes on a\n textarea. If you need to support more attributes have a look at the\n `attributeBindings` property in `Ember.View`'s HTML Attributes section.\n\n To globally add support for additional attributes you can reopen\n `Ember.TextArea` or `Ember.TextSupport`.\n\n ```javascript\n Ember.TextSupport.reopen({\n attributeBindings: [\"required\"]\n })\n ```\n\n @class TextArea\n @namespace Ember\n @extends Ember.View\n @uses Ember.TextSupport\n*/\nEmber.TextArea = Ember.View.extend(Ember.TextSupport, {\n classNames: ['ember-text-area'],\n\n tagName: \"textarea\",\n attributeBindings: ['rows', 'cols', 'name'],\n rows: null,\n cols: null,\n\n _updateElementValue: Ember.observer(function() {\n // We do this check so cursor position doesn't get affected in IE\n var value = get(this, 'value'),\n $el = this.$();\n if ($el && value !== $el.val()) {\n $el.val(value);\n }\n }, 'value'),\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._updateElementValue);\n }\n\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_area");minispade.register('ember-handlebars/controls/text_field', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/controls/text_support\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.TextField` view class renders a text\n [input](https://developer.mozilla.org/en/HTML/Element/Input) element. It\n allows for binding Ember properties to the text field contents (`value`),\n live-updating as the user inputs text.\n\n Example:\n\n ```handlebars\n {{view Ember.TextField valueBinding=\"firstName\"}}\n ```\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See `Ember.View`'s layout section for more\n information.\n\n ## HTML Attributes\n\n By default `Ember.TextField` provides support for `type`, `value`, `size`,\n `pattern`, `placeholder`, `disabled`, `maxlength` and `tabindex` attributes\n on a text field. If you need to support more attributes have a look at the\n `attributeBindings` property in `Ember.View`'s HTML Attributes section.\n\n To globally add support for additional attributes you can reopen\n `Ember.TextField` or `Ember.TextSupport`.\n\n ```javascript\n Ember.TextSupport.reopen({\n attributeBindings: [\"required\"]\n })\n ```\n\n @class TextField\n @namespace Ember\n @extends Ember.View\n @uses Ember.TextSupport\n*/\nEmber.TextField = Ember.View.extend(Ember.TextSupport,\n /** @scope Ember.TextField.prototype */ {\n\n classNames: ['ember-text-field'],\n tagName: \"input\",\n attributeBindings: ['type', 'value', 'size', 'pattern', '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 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 on\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 insertNewline: function(event) {\n sendAction('enter', this, event);\n },\n\n keyPress: function(event) {\n sendAction('keyPress', this, event);\n }\n});\n\nfunction sendAction(eventName, view, event) {\n var action = get(view, 'action'),\n on = get(view, 'onEvent');\n\n if (action && on === eventName) {\n var controller = get(view, 'controller'),\n value = get(view, 'value'),\n bubbles = get(view, 'bubbles');\n\n controller.send(action, value, view);\n\n if (!bubbles) {\n event.stopPropagation();\n }\n }\n}\n})();\n//@ sourceURL=ember-handlebars/controls/text_field");minispade.register('ember-handlebars/controls/text_support', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Shared mixin used by `Ember.TextField` and `Ember.TextArea`.\n\n @class TextSupport\n @namespace Ember\n @extends Ember.Mixin\n @private\n*/\nEmber.TextSupport = Ember.Mixin.create({\n value: \"\",\n\n attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex'],\n placeholder: null,\n disabled: false,\n maxlength: null,\n\n insertNewline: Ember.K,\n cancel: Ember.K,\n\n init: function() {\n this._super();\n this.on(\"focusOut\", this, this._elementValueDidChange);\n this.on(\"change\", this, this._elementValueDidChange);\n this.on(\"paste\", this, this._elementValueDidChange);\n this.on(\"cut\", this, this._elementValueDidChange);\n this.on(\"input\", this, this._elementValueDidChange);\n this.on(\"keyUp\", this, this.interpretKeyEvents);\n },\n\n interpretKeyEvents: function(event) {\n var map = Ember.TextSupport.KEY_EVENTS;\n var method = map[event.keyCode];\n\n this._elementValueDidChange();\n if (method) { return this[method](event); }\n },\n\n _elementValueDidChange: function() {\n set(this, 'value', this.$().val());\n }\n\n});\n\nEmber.TextSupport.KEY_EVENTS = {\n 13: 'insertNewline',\n 27: 'cancel'\n};\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_support");minispade.register('ember-handlebars/ext', "(function() {minispade.require('ember-handlebars-compiler');\n\nvar slice = Array.prototype.slice;\n\n/**\n @private\n\n If a path starts with a reserved keyword, returns the root\n that should be used.\n\n @method normalizePath\n @for Ember\n @param root {Object}\n @param path {String}\n @param data {Hash}\n*/\nvar normalizePath = Ember.Handlebars.normalizePath = function(root, path, data) {\n var keywords = (data && data.keywords) || {},\n keyword, isKeyword;\n\n // Get the first segment of the path. For example, if the\n // path is \"foo.bar.baz\", returns \"foo\".\n keyword = path.split('.', 1)[0];\n\n // Test to see if the first path is a keyword that has been\n // passed along in the view's data hash. If so, we will treat\n // that object as the new root.\n if (keywords.hasOwnProperty(keyword)) {\n // Look up the value in the template's data hash.\n root = keywords[keyword];\n isKeyword = true;\n\n // Handle cases where the entire path is the reserved\n // word. In that case, return the object itself.\n if (path === keyword) {\n path = '';\n } else {\n // Strip the keyword from the path and look up\n // the remainder from the newly found root.\n path = path.substr(keyword.length+1);\n }\n }\n\n return { root: root, path: path, isKeyword: isKeyword };\n};\n\n\n/**\n Lookup both on root and on window. If the path starts with\n a keyword, the corresponding object will be looked up in the\n template's data hash and used to resolve the path.\n\n @method get\n @for Ember.Handlebars\n @param {Object} root The object to look up the property on\n @param {String} path The path to be lookedup\n @param {Object} options The template's option hash\n*/\nvar handlebarsGet = Ember.Handlebars.get = function(root, path, options) {\n var data = options && options.data,\n normalizedPath = normalizePath(root, path, data),\n value;\n\n // In cases where the path begins with a keyword, change the\n // root to the value represented by that keyword, and ensure\n // the path is relative to it.\n root = normalizedPath.root;\n path = normalizedPath.path;\n\n value = Ember.get(root, path);\n\n // If the path starts with a capital letter, look it up on Ember.lookup,\n // which defaults to the `window` object in browsers.\n if (value === undefined && root !== Ember.lookup && Ember.isGlobalPath(path)) {\n value = Ember.get(Ember.lookup, path);\n }\n return value;\n};\nEmber.Handlebars.getPath = Ember.deprecateFunc('`Ember.Handlebars.getPath` has been changed to `Ember.Handlebars.get` for consistency.', Ember.Handlebars.get);\n\nEmber.Handlebars.resolveParams = function(context, params, options) {\n var resolvedParams = [], types = options.types, param, type;\n\n for (var i=0, l=params.length; i\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 `bindAttr` cannot redeclare existing DOM element attributes. The use of `src`\n in the following `bindAttr` example will be ignored and the hard coded value\n of `src=\"/failwhale.gif\"` will take precedence:\n\n ```handlebars\n \"imageTitle\"}}\n ```\n\n ### `bindAttr` and the `class` attribute\n\n `bindAttr` supports a special syntax for handling a number of cases unique\n to the `class` DOM element attribute. The `class` attribute combines\n multiple discreet values into a single attribute as a space-delimited\n list of strings. Each string can be:\n\n * a string return value of an object's property.\n * a boolean return value of an object's property\n * a hard-coded value\n\n A string return value works identically to other uses of `bindAttr`. The\n return value of the property will become the value of the attribute. For\n example, the following view and template:\n\n ```javascript\n AView = Ember.View.extend({\n someProperty: function(){\n return \"aValue\";\n }.property()\n })\n ```\n\n ```handlebars\n \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 bindAttr\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bindAttr', function(options) {\n\n var attrs = options.hash;\n\n Ember.assert(\"You must specify at least one hash argument to bindAttr\", !!Ember.keys(attrs).length);\n\n var view = options.data.view;\n var ret = [];\n var ctx = this;\n\n // Generate a unique id for this element. This will be added as a\n // data attribute to the element so it can be looked up when\n // the bound property changes.\n var dataId = ++Ember.uuid;\n\n // Handle classes differently, as we can bind multiple classes\n var classBindings = attrs['class'];\n if (classBindings !== null && classBindings !== undefined) {\n var classResults = EmberHandlebars.bindClasses(this, classBindings, view, dataId, options);\n\n ret.push('class=\"' + Handlebars.Utils.escapeExpression(classResults.join(' ')) + '\"');\n delete attrs['class'];\n }\n\n var attrKeys = Ember.keys(attrs);\n\n // For each attribute passed, create an observer and emit the\n // current value of the property as an attribute.\n forEach.call(attrKeys, function(attr) {\n var path = attrs[attr],\n normalized;\n\n Ember.assert(fmt(\"You must provide a String for a bound attribute, not %@\", [path]), typeof path === 'string');\n\n normalized = normalizePath(ctx, path, options.data);\n\n var value = (path === 'this') ? normalized.root : handlebarsGet(ctx, path, options),\n type = Ember.typeOf(value);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [value]), value === null || value === undefined || type === 'number' || type === 'string' || type === 'boolean');\n\n var observer, invoker;\n\n observer = function observer() {\n var result = handlebarsGet(ctx, path, options);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [result]), result === null || result === undefined || typeof result === 'number' || typeof result === 'string' || typeof result === 'boolean');\n\n var elem = view.$(\"[data-bindattr-\" + dataId + \"='\" + dataId + \"']\");\n\n // If we aren't able to find the element, it means the element\n // to which we were bound has been removed from the view.\n // In that case, we can assume the template has been re-rendered\n // and we need to clean up the observer.\n if (!elem || elem.length === 0) {\n Ember.removeObserver(normalized.root, normalized.path, invoker);\n return;\n }\n\n Ember.View.applyAttributeBindings(elem, attr, result);\n };\n\n // Add an observer to the view for when the property changes.\n // When the observer fires, find the element using the\n // unique data id and update the attribute to the new value.\n // Note: don't add observer when path is 'this' or path\n // is whole keyword e.g. {{#each x in list}} ... {{bindAttr attr=\"x\"}}\n if (path !== 'this' && !(normalized.isKeyword && normalized.path === '' )) {\n view.registerObserver(normalized.root, normalized.path, 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 @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() {/*globals Handlebars */\n\n// TODO: Don't require all of this module\nminispade.require('ember-handlebars');\nminispade.require('ember-handlebars/helpers/view');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, handlebarsGet = Ember.Handlebars.get, fmt = Ember.String.fmt;\n\n/**\n `{{collection}}` is a `Ember.Handlebars` helper for adding instances of\n `Ember.CollectionView` to a template. See `Ember.CollectionView` for\n additional information on how a `CollectionView` functions.\n\n `{{collection}}`'s primary use is as a block helper with a `contentBinding`\n option pointing towards an `Ember.Array`-compatible object. An `Ember.View`\n instance will be created for each item in its `content` property. Each view\n will have its own `content` property set to the appropriate item in the\n collection.\n\n The provided block will be applied as the template for each item's view.\n\n Given an empty `` 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 itemViewClass, itemViewPath = hash.itemViewClass;\n var collectionPrototype = collectionClass.proto();\n delete hash.itemViewClass;\n itemViewClass = itemViewPath ? handlebarsGet(collectionPrototype, itemViewPath, options) : collectionPrototype.itemViewClass;\n Ember.assert(fmt(\"%@ #collection: Could not find itemViewClass %@\", [data.view, itemViewPath]), !!itemViewClass);\n\n // Go through options passed to the {{collection}} helper and extract options\n // that configure item views instead of the collection itself.\n for (var prop in hash) {\n if (hash.hasOwnProperty(prop)) {\n match = prop.match(/^item(.)(.*)$/);\n\n if(match && prop !== 'itemController') {\n // Convert itemShouldFoo -> shouldFoo\n itemHash[match[1].toLowerCase() + match[2]] = hash[prop];\n // Delete from hash as this will end up getting passed to the\n // {{view}} helper method.\n delete hash[prop];\n }\n }\n }\n\n if (fn) {\n itemHash.template = fn;\n delete options.fn;\n }\n\n var emptyViewClass;\n if (inverse && inverse !== Handlebars.VM.noop) {\n emptyViewClass = get(collectionPrototype, 'emptyViewClass');\n emptyViewClass = emptyViewClass.extend({\n template: inverse,\n tagName: itemHash.tagName\n });\n } else if (hash.emptyViewClass) {\n emptyViewClass = handlebarsGet(this, hash.emptyViewClass, options);\n }\n if (emptyViewClass) { hash.emptyView = emptyViewClass; }\n\n if(!hash.keyword){\n itemHash._context = Ember.computed.alias('content');\n }\n\n var viewOptions = Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);\n hash.itemViewClass = itemViewClass.extend(viewOptions);\n\n return Ember.Handlebars.helpers.view.call(this, collectionClass, options);\n});\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/collection");minispade.register('ember-handlebars/helpers/debug', "(function() {/*jshint debug:true*/\nminispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\n\n/**\n `log` allows you to output the value of a value in the current rendering\n context.\n\n ```handlebars\n {{log myVariable}}\n ```\n\n @method log\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('log', function(property, options) {\n var context = (options.contexts && options.contexts[0]) || this,\n normalized = normalizePath(context, property, options.data),\n pathRoot = normalized.root,\n path = normalized.path,\n value = (path === 'this') ? pathRoot : handlebarsGet(pathRoot, path, options);\n Ember.Logger.log(value);\n});\n\n/**\n Execute the `debugger` statement in the current context.\n\n ```handlebars\n {{debugger}}\n ```\n\n @method debugger\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('debugger', function() {\n debugger;\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/debug");minispade.register('ember-handlebars/helpers/each', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/collection_view\");\nminispade.require(\"ember-handlebars/views/metamorph_view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, {\n init: function() {\n var itemController = get(this, 'itemController');\n var binding;\n\n if (itemController) {\n var controller = Ember.ArrayController.create();\n set(controller, 'itemController', itemController);\n set(controller, 'container', get(this, 'controller.container'));\n set(controller, '_eachView', this);\n set(controller, 'target', get(this, 'controller'));\n\n this.disableContentObservers(function() {\n set(this, 'content', controller);\n binding = new Ember.Binding('content', '_eachView.dataSource').oneWay();\n binding.connect(controller);\n });\n\n set(this, '_arrayController', controller);\n } else {\n this.disableContentObservers(function() {\n binding = new Ember.Binding('content', 'dataSource').oneWay();\n binding.connect(this);\n });\n }\n\n return this._super();\n },\n\n disableContentObservers: function(callback) {\n Ember.removeBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.removeObserver(this, 'content', null, '_contentDidChange');\n\n callback.call(this);\n\n Ember.addBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.addObserver(this, 'content', null, '_contentDidChange');\n },\n\n itemViewClass: Ember._MetamorphView,\n emptyViewClass: Ember._MetamorphView,\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n // At the moment, if a container view subclass wants\n // to insert keywords, it is responsible for cloning\n // the keywords hash. This will be fixed momentarily.\n var keyword = get(this, 'keyword');\n var content = get(view, 'content');\n\n if (keyword) {\n var data = get(view, 'templateData');\n\n data = Ember.copy(data);\n data.keywords = view.cloneKeywords();\n set(view, 'templateData', data);\n\n // In this case, we do not bind, because the `content` of\n // a #each item cannot change.\n data.keywords[keyword] = content;\n }\n\n // If {{#each}} is looping over an array of controllers,\n // point each child view at their respective controller.\n if (content && get(content, 'isController')) {\n set(view, 'controller', content);\n }\n\n return view;\n },\n\n 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 this.content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n removeArrayObservers: function() {\n this.content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n addContentObservers: function() {\n Ember.addBeforeObserver(this.normalizedRoot, this.normalizedPath, this, this.contentWillChange);\n Ember.addObserver(this.normalizedRoot, this.normalizedPath, this, this.contentDidChange);\n },\n\n removeContentObservers: function() {\n Ember.removeBeforeObserver(this.normalizedRoot, this.normalizedPath, this.contentWillChange);\n Ember.removeObserver(this.normalizedRoot, this.normalizedPath, this.contentDidChange);\n },\n\n render: function() {\n var content = this.content,\n contentLength = get(content, 'length'),\n data = this.options.data,\n template = this.template;\n\n data.insideEach = true;\n for (var i = 0; i < contentLength; i++) {\n template(content.objectAt(i), { data: data });\n }\n },\n\n rerenderContainingView: function() {\n Ember.run.scheduleOnce('render', this.containingView, 'rerender');\n },\n\n destroy: function() {\n this.removeContentObservers();\n this.removeArrayObservers();\n }\n};\n\n/**\n The `{{#each}}` helper loops over elements in a collection, rendering its\n block once for each item. It is an extension of the base Handlebars `{{#each}}`\n helper:\n\n ```javascript\n Developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}];\n ```\n\n ```handlebars\n {{#each Developers}}\n {{name}}\n {{/each}}\n ```\n\n `{{each}}` supports an alternative syntax with element naming:\n\n ```handlebars\n {{#each person in Developers}}\n {{person.name}}\n {{/each}}\n ```\n\n When looping over objects that do not have properties, `{{this}}` can be used\n to render the object:\n\n ```javascript\n DeveloperNames = ['Yehuda', 'Tom', 'Paul']\n ```\n\n ```handlebars\n {{#each DeveloperNames}}\n {{this}}\n {{/each}}\n ```\n ### {{else}} condition\n `{{#each}}` can have a matching `{{else}}`. The contents of this block will render\n if the collection is empty.\n\n ```\n {{#each person in Developers}}\n {{person.name}}\n {{else}}\n

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 ### Representing each item with a Controller.\n By default the controller lookup within an `{{#each}}` block will be\n the controller of the template where the `{{#each}}` was used. If each\n item needs to be presented by a custom controller you can provide a\n `itemController` option which references a controller by lookup name.\n Each item in the loop will be wrapped in an instance of this controller\n and the item itself will be set to the `content` property of that controller.\n\n This is useful in cases where properties of model objects need transformation\n or synthesis for display:\n\n ```javascript\n App.DeveloperController = Ember.ObjectController.extend({\n isAvailableForHire: function(){\n return !this.get('content.isEmployed') && this.get('content.isSeekingWork');\n }.property('isEmployed', 'isSeekingWork')\n })\n ```\n\n ```handlebars\n {{#each person in developers itemController=\"developer\"}}\n {{person.name}} {{#if person.isAvailableForHire}}Hire me!{{/if}}\n {{/each}}\n ```\n\n @method each\n @for Ember.Handlebars.helpers\n @param [name] {String} name for item (used with `in`)\n @param [path] {String} path\n @param [options] {Object} Handlebars key/value pairs of options\n @param [options.itemViewClass] {String} a path to a view class used for each item\n @param [options.itemController] {String} name of a controller to be created for each item\n*/\nEmber.Handlebars.registerHelper('each', function(path, options) {\n if (arguments.length === 4) {\n Ember.assert(\"If you pass more than one argument to the each helper, it must be in the form #each foo in bar\", arguments[1] === \"in\");\n\n var keywordName = arguments[0];\n\n options = arguments[3];\n path = arguments[2];\n if (path === '') { path = \"this\"; }\n\n options.hash.keyword = keywordName;\n }\n\n options.hash.dataSourceBinding = path;\n // Set up emptyView as a metamorph with no tag\n //options.hash.emptyViewClass = Ember._MetamorphView;\n\n if (options.data.insideGroup && !options.hash.groupedRows && !options.hash.itemViewClass) {\n new Ember.Handlebars.GroupedEach(this, path, options).render();\n } else {\n return Ember.Handlebars.helpers.collection.call(this, 'Ember.Handlebars.EachView', options);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/each");minispade.register('ember-handlebars/helpers/partial', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `partial` renders a template directly using the current context.\n If needed the context can be set using the `{{#with foo}}` helper.\n\n ```html\n \n ```\n\n The `data-template-name` attribute of a partial template\n is prefixed with an underscore.\n\n ```html\n \n ```\n\n @method partial\n @for Ember.Handlebars.helpers\n @param {String} partialName the name of the template to render minus the leading underscore\n*/\n\nEmber.Handlebars.registerHelper('partial', function(name, options) {\n var nameParts = name.split(\"/\"),\n lastPart = nameParts[nameParts.length - 1];\n\n nameParts[nameParts.length - 1] = \"_\" + lastPart;\n\n var view = options.data.view,\n underscoredName = nameParts.join(\"/\"),\n template = view.templateForName(underscoredName),\n deprecatedTemplate = view.templateForName(name);\n\n Ember.deprecate(\"You tried to render the partial \" + name + \", which should be at '\" + underscoredName + \"', but Ember found '\" + name + \"'. Please use a leading underscore in your partials\", template);\n Ember.assert(\"Unable to find partial with name '\"+name+\"'.\", template || deprecatedTemplate);\n\n template = template || deprecatedTemplate;\n\n template(this, { data: options.data });\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/partial");minispade.register('ember-handlebars/helpers/shared', "(function() {Ember.Handlebars.resolvePaths = function(options) {\n var ret = [],\n contexts = options.contexts,\n roots = options.roots,\n data = options.data;\n\n for (var i=0, l=contexts.length; i\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 ```\n\n And application code\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'a-template',\n anActionName: function(event){}\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will results in the following rendered HTML\n\n ```html\n
\n
\n click me\n
\n
\n ```\n\n Clicking \"click me\" will trigger the `anActionName` method of the `aView`\n object with a `jQuery.Event` object as its argument. The `jQuery.Event`\n object will be extended to include a `view` property that is set to the\n original view interacted with (in this case the `aView` object).\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers. To stop propagation of the event, simply return `false` from your\n handler.\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See `Ember.View`\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n \n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n Because `{{action}}` depends on Ember's event dispatch system it will only\n function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new\n `Ember.Application` is created. Having an instance of `Ember.Application`\n will satisfy this requirement.\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical `Ember.Router`-backed Application where views are managed\n through use of the `{{outlet}}` helper, actions will be forwarded to the\n current state of the Applications's Router. See `Ember.Router` 'Responding\n to User-initiated Events' for more information.\n\n If you manually set the `target` property on the controller of a template's\n `Ember.View` instance, the specifed `controller.target` will become the\n target for any actions. Likely custom values for a controller's `target` are\n the controller itself or a StateManager other than the Application's\n router.\n\n If the templates's view lacks a controller property the view itself is the\n target.\n\n Finally, a `target` option can be provided to the helper to change which\n object will receive the method call. This option must be a string\n representing a path to an object:\n\n ```handlebars\n \n ```\n\n Clicking \"click me\" in the rendered HTML of the above template will trigger\n the `anActionName` method of the object at `MyApplication.someObject`.\n The first argument to this method will be a `jQuery.Event` extended to\n include a `view` property that is set to the original view interacted with.\n\n A path relative to the template's `Ember.View` instance can also be used as\n a target:\n\n ```handlebars\n \n ```\n\n Clicking \"click me\" in the rendered HTML of the above template will trigger\n the `anActionName` method of the view's parent view.\n\n The `{{action}}` helper is `Ember.StateManager` aware. If the target of the\n action is an `Ember.StateManager` instance `{{action}}` will use the `send`\n functionality of StateManagers. The documentation for `Ember.StateManager`\n has additional information about this use.\n\n If an action's target does not implement a method that matches the supplied\n action name an error will be thrown.\n\n ```handlebars\n \n ```\n\n With the following application code\n\n ```javascript\n AView = Ember.View.extend({\n templateName; 'a-template',\n // note: no method 'aMethodNameThatIsMissing'\n anActionName: function(event){}\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when\n \"click me\" is clicked.\n\n ### Specifying a context\n\n You may optionally specify objects to pass as contexts to the `{{action}}`\n helper by providing property paths as the subsequent parameters. These\n objects are made available as the `contexts` (also `context` if there is only\n one) properties in the `jQuery.Event` object:\n\n ```handlebars\n \n ```\n\n Clicking \"click me\" will trigger the `edit` method of the view's context with\n a `jQuery.Event` object containing the person object as its context.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object...} contexts\n @param {Hash} options\n*/\nEmberHandlebars.registerHelper('action', function(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n view = options.data.view,\n target, controller, link;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\"\n };\n\n action.view = view = get(view, 'concreteView');\n\n if (hash.target) {\n target = handlebarsGet(this, hash.target, options);\n } else if (controller = options.data.keywords.controller) {\n target = controller;\n }\n\n action.target = target = target || view;\n\n if (contexts.length) {\n action.contexts = contexts = Ember.EnumerableUtils.map(contexts, function(context) {\n return handlebarsGet(this, context, options);\n }, this);\n action.context = contexts[0];\n }\n\n var output = [], url;\n\n if (hash.href && target.urlForEvent) {\n url = target.urlForEvent.apply(target, [actionName].concat(contexts));\n output.push('href=\"' + url + '\"');\n action.link = true;\n }\n\n var actionId = ActionHelper.registerAction(actionName, action);\n output.push('data-ember-action=\"' + actionId + '\"');\n\n return new EmberHandlebars.SafeString(output.join(\" \"));\n});\n\n})();\n//@ sourceURL=ember-old-router/helpers/action");minispade.register('ember-old-router/location', "(function() {minispade.require('ember-views');\nminispade.require('ember-old-router/location/api');\nminispade.require('ember-old-router/location/none_location');\nminispade.require('ember-old-router/location/hash_location');\nminispade.require('ember-old-router/location/history_location');\n\n})();\n//@ sourceURL=ember-old-router/location");minispade.register('ember-old-router/location/api', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n This file implements the `location` API used by Ember's router.\n\n That API is:\n\n getURL: returns the current URL\n setURL(path): sets the current URL\n onUpdateURL(callback): triggers the callback when the URL changes\n formatURL(url): formats `url` to be placed into `href` attribute\n\n Calling setURL will not trigger onUpdateURL callbacks.\n\n TODO: This should perhaps be moved so that it's visible in the doc output.\n*/\n\n/**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n You can pass it a `implementation` (`hash`, `history`, `none`) to force a\n particular implementation.\n\n @class Location\n @namespace Ember\n @static\n*/\nEmber.Location = {\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n registerImplementation: function(name, implementation) {\n this.implementations[name] = implementation;\n },\n\n implementations: {}\n};\n\n})();\n//@ sourceURL=ember-old-router/location/api");minispade.register('ember-old-router/location/hash_location', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n `Ember.HashLocation` implements the location API using the browser's\n hash. At present, it relies on a hashchange event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HashLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n },\n\n /**\n @private\n\n Returns the current `location.hash`, minus the '#' at the front.\n\n @method getURL\n */\n getURL: function() {\n return get(this, 'location').hash.substr(1);\n },\n\n /**\n @private\n\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = Ember.guidFor(this);\n\n Ember.$(window).bind('hashchange.ember-location-'+guid, function() {\n var path = location.hash.substr(1);\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(location.hash.substr(1));\n });\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the `{{action}}` helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('hashchange.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('hash', Ember.HashLocation);\n\n})();\n//@ sourceURL=ember-old-router/location/hash_location");minispade.register('ember-old-router/location/history_location', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar popstateReady = false;\n\n/**\n `Ember.HistoryLocation` implements the location API using the browser's\n `history.pushState` API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HistoryLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n this.initState();\n },\n\n /**\n @private\n\n Used to set state on first call to `setURL`\n\n @method initState\n */\n initState: function() {\n this.replaceState(get(this, 'location').pathname);\n set(this, 'history', window.history);\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Returns the current `location.pathname`.\n\n @method getURL\n */\n getURL: function() {\n return get(this, 'location').pathname;\n },\n\n /**\n @private\n\n Uses `history.pushState` to update the url without a page reload.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n path = this.formatURL(path);\n\n if (this.getState() && this.getState().path !== path) {\n popstateReady = true;\n this.pushState(path);\n }\n },\n\n /**\n @private\n\n Get the current `history.state`\n\n @method getState\n */\n getState: function() {\n return get(this, 'history').state;\n },\n\n /**\n @private\n\n Pushes a new state\n\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n window.history.pushState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Replaces the current state\n\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n window.history.replaceState({ path: path }, null, path);\n },\n\n /**\n @private\n\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).bind('popstate.ember-location-'+guid, function(e) {\n if(!popstateReady) {\n return;\n }\n callback(location.pathname);\n });\n },\n\n /**\n @private\n\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n }\n\n return rootURL + url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('popstate.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('history', Ember.HistoryLocation);\n\n})();\n//@ sourceURL=ember-old-router/location/history_location");minispade.register('ember-old-router/location/none_location', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n `Ember.NoneLocation` does not interact with the browser. It is useful for\n testing, or when you need to manage state with your router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.NoneLocation = Ember.Object.extend({\n path: '',\n\n getURL: function() {\n return get(this, 'path');\n },\n\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n onUpdateURL: function(callback) {\n // We are not wired up to the browser, so we'll never trigger the callback.\n },\n\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n});\n\nEmber.Location.registerImplementation('none', Ember.NoneLocation);\n\n})();\n//@ sourceURL=ember-old-router/location/none_location");minispade.register('ember-old-router', "(function() {minispade.require('ember-states');\nminispade.require('ember-old-router/promise_chain');\nminispade.require('ember-old-router/application');\nminispade.require('ember-old-router/route');\nminispade.require('ember-old-router/router');\nminispade.require('ember-old-router/helpers');\nminispade.require('ember-old-router/handlebars_ext');\nminispade.require('ember-old-router/controller_ext');\nminispade.require('ember-old-router/view_ext');\n\n/**\nEmber Old Router\n\n@module ember\n@submodule ember-old-router\n@requires ember-states\n*/\n\n})();\n//@ sourceURL=ember-old-router");minispade.register('ember-old-router/promise_chain', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber._PromiseChain = Ember.Object.extend({\n promises: null,\n failureCallback: Ember.K,\n successCallback: Ember.K,\n abortCallback: Ember.K,\n promiseSuccessCallback: Ember.K,\n\n runNextPromise: function() {\n if (get(this, 'isDestroyed')) { return; }\n\n var item = get(this, 'promises').shiftObject();\n if (item) {\n var promise = get(item, 'promise') || item;\n Ember.assert(\"Cannot find promise to invoke\", Ember.canInvoke(promise, 'then'));\n\n var self = this;\n\n var successCallback = function() {\n self.promiseSuccessCallback.call(this, item, arguments);\n self.runNextPromise();\n };\n\n var failureCallback = get(self, 'failureCallback');\n\n promise.then(successCallback, failureCallback);\n } else {\n this.successCallback();\n }\n },\n\n start: function() {\n this.runNextPromise();\n return this;\n },\n\n abort: function() {\n this.abortCallback();\n this.destroy();\n },\n\n init: function() {\n set(this, 'promises', Ember.A(get(this, 'promises')));\n this._super();\n }\n});\n\n\n})();\n//@ sourceURL=ember-old-router/promise_chain");minispade.register('ember-old-router/resolved_state', "(function() {var get = Ember.get;\n\nEmber._ResolvedState = Ember.Object.extend({\n manager: null,\n state: null,\n match: null,\n\n object: Ember.computed(function(key) {\n if (this._object) {\n return this._object;\n } else {\n var state = get(this, 'state'),\n match = get(this, 'match'),\n manager = get(this, 'manager');\n return state.deserialize(manager, match.hash);\n }\n }),\n\n hasPromise: Ember.computed(function() {\n return Ember.canInvoke(get(this, 'object'), 'then');\n }).property('object'),\n\n promise: Ember.computed(function() {\n var object = get(this, 'object');\n if (Ember.canInvoke(object, 'then')) {\n return object;\n } else {\n return {\n then: function(success) { success(object); }\n };\n }\n }).property('object'),\n\n transition: function() {\n var manager = get(this, 'manager'),\n path = get(this, 'state.path'),\n object = get(this, 'object');\n manager.transitionTo(path, object);\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/resolved_state");minispade.register('ember-old-router/routable', "(function() {minispade.require('ember-old-router/resolved_state');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get;\n\n// The Ember Routable mixin assumes the existance of a simple\n// routing shim that supports the following three behaviors:\n//\n// * .getURL() - this is called when the page loads\n// * .setURL(newURL) - this is called from within the state\n// manager when the state changes to a routable state\n// * .onURLChange(callback) - this happens when the user presses\n// the back or forward button\n\nvar paramForClass = function(classObject) {\n var className = classObject.toString(),\n parts = className.split(\".\"),\n last = parts[parts.length - 1];\n\n return Ember.String.underscore(last) + \"_id\";\n};\n\nvar merge = function(original, hash) {\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n if (original.hasOwnProperty(prop)) { continue; }\n\n original[prop] = hash[prop];\n }\n};\n\n/**\n @class Routable\n @namespace Ember\n @extends Ember.Mixin\n*/\nEmber.Routable = Ember.Mixin.create({\n init: function() {\n var redirection;\n this.on('setup', this, this.stashContext);\n\n if (redirection = get(this, 'redirectsTo')) {\n Ember.assert(\"You cannot use `redirectsTo` if you already have a `connectOutlets` method\", this.connectOutlets === Ember.K);\n\n this.connectOutlets = function(router) {\n router.transitionTo(redirection);\n };\n }\n\n // normalize empty route to '/'\n var route = get(this, 'route');\n if (route === '') {\n route = '/';\n }\n\n this._super();\n\n Ember.assert(\"You cannot use `redirectsTo` on a state that has child states\", !redirection || (!!redirection && !!get(this, 'isLeaf')));\n },\n\n setup: function() {\n return this.connectOutlets.apply(this, arguments);\n },\n\n /**\n @private\n\n Whenever a routable state is entered, the context it was entered with\n is stashed so that we can regenerate the state's `absoluteURL` on\n demand.\n\n @method stashContext\n @param manager {Ember.StateManager}\n @param context\n */\n stashContext: function(manager, context) {\n this.router = manager;\n\n var serialized = this.serialize(manager, context);\n Ember.assert('serialize must return a hash', !serialized || typeof serialized === 'object');\n\n manager.setStateMeta(this, 'context', context);\n manager.setStateMeta(this, 'serialized', serialized);\n\n if (get(this, 'isRoutable') && !get(manager, 'isRouting')) {\n this.updateRoute(manager, get(manager, 'location'));\n }\n },\n\n /**\n @private\n\n Whenever a routable state is entered, the router's location object\n is notified to set the URL to the current absolute path.\n\n In general, this will update the browser's URL.\n\n @method updateRoute\n @param manager {Ember.StateManager}\n @param location {Ember.Location}\n */\n updateRoute: function(manager, location) {\n if (get(this, 'isLeafRoute')) {\n var path = this.absoluteRoute(manager);\n location.setURL(path);\n }\n },\n\n /**\n @private\n\n Get the absolute route for the current state and a given\n hash.\n\n This method is private, as it expects a serialized hash,\n not the original context object.\n\n @method absoluteRoute\n @param manager {Ember.StateManager}\n @param hashes {Array}\n */\n absoluteRoute: function(manager, hashes) {\n var parentState = get(this, 'parentState'),\n path = '',\n generated,\n currentHash;\n\n // check if object passed instead of array\n // in this case set currentHash = hashes\n // this allows hashes to be a single hash\n // (it will be applied to state and all parents)\n currentHash = null;\n if (hashes) {\n if (hashes instanceof Array) {\n if (hashes.length > 0) {\n currentHash = hashes.shift();\n }\n } else {\n currentHash = hashes;\n }\n }\n\n // If the parent state is routable, use its current path\n // as this route's prefix.\n if (get(parentState, 'isRoutable')) {\n path = parentState.absoluteRoute(manager, hashes);\n }\n\n var matcher = get(this, 'routeMatcher'),\n serialized = manager.getStateMeta(this, 'serialized');\n\n // merge the existing serialized object in with the passed\n // in hash.\n currentHash = currentHash || {};\n merge(currentHash, serialized);\n\n generated = matcher && matcher.generate(currentHash);\n\n if (generated) {\n path = path + '/' + generated;\n }\n\n return path;\n },\n\n /**\n @private\n\n At the moment, a state is routable if it has a string `route`\n property. This heuristic may change.\n\n @property isRoutable\n @type Boolean\n */\n isRoutable: Ember.computed(function() {\n return typeof get(this, 'route') === 'string';\n }),\n\n /**\n @private\n\n Determine if this is the last routeable state\n\n @property isLeafRoute\n @type Boolean\n */\n isLeafRoute: Ember.computed(function() {\n if (get(this, 'isLeaf')) { return true; }\n return !get(this, 'childStates').findProperty('isRoutable');\n }),\n\n /**\n @private\n\n A `_RouteMatcher` object generated from the current route's `route`\n string property.\n\n @property routeMatcher\n @type Ember._RouteMatcher\n */\n routeMatcher: Ember.computed(function() {\n var route = get(this, 'route');\n if (route) {\n return Ember._RouteMatcher.create({ route: route });\n }\n }),\n\n /**\n @private\n\n Check whether the route has dynamic segments and therefore takes\n a context.\n\n @property hasContext\n @type Boolean\n */\n hasContext: Ember.computed(function() {\n var routeMatcher = get(this, 'routeMatcher');\n if (routeMatcher) {\n return routeMatcher.identifiers.length > 0;\n }\n }),\n\n /**\n @private\n\n The model class associated with the current state. This property\n uses the `modelType` property, in order to allow it to be\n specified as a String.\n\n @property modelClass\n @type Ember.Object\n */\n modelClass: Ember.computed(function() {\n var modelType = get(this, 'modelType');\n\n if (typeof modelType === 'string') {\n return Ember.get(Ember.lookup, modelType);\n } else {\n return modelType;\n }\n }),\n\n /**\n @private\n\n Get the model class for the state. The heuristic is:\n\n * The state must have a single dynamic segment\n * The dynamic segment must end in `_id`\n * A dynamic segment like `blog_post_id` is converted into `BlogPost`\n * The name is then looked up on the passed in namespace\n\n The process of initializing an application with a router will\n pass the application's namespace into the router, which will be\n used here.\n\n @method modelClassFor\n @param namespace {Ember.Namespace}\n */\n modelClassFor: function(namespace) {\n var modelClass, routeMatcher, identifiers, match, className;\n\n // if an explicit modelType was specified, use that\n if (modelClass = get(this, 'modelClass')) { return modelClass; }\n\n // if the router has no lookup namespace, we won't be able to guess\n // the modelType\n if (!namespace) { return; }\n\n // make sure this state is actually a routable state\n routeMatcher = get(this, 'routeMatcher');\n if (!routeMatcher) { return; }\n\n // only guess modelType for states with a single dynamic segment\n // (no more, no fewer)\n identifiers = routeMatcher.identifiers;\n if (identifiers.length !== 2) { return; }\n\n // extract the `_id` from the end of the dynamic segment; if the\n // dynamic segment does not end in `_id`, we can't guess the\n // modelType\n match = identifiers[1].match(/^(.*)_id$/);\n if (!match) { return; }\n\n // convert the underscored type into a class form and look it up\n // on the router's namespace\n className = Ember.String.classify(match[1]);\n return get(namespace, className);\n },\n\n /**\n The default method that takes a `params` object and converts\n it into an object.\n\n By default, a params hash that looks like `{ post_id: 1 }`\n will be looked up as `namespace.Post.find(1)`. This is\n designed to work seamlessly with Ember Data, but will work\n fine with any class that has a `find` method.\n\n @method deserialize\n @param manager {Ember.StateManager}\n @param params {Hash}\n */\n deserialize: function(manager, params) {\n var modelClass, routeMatcher, param;\n\n if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {\n Ember.assert(\"Expected \"+modelClass.toString()+\" to implement `find` for use in '\"+this.get('path')+\"' `deserialize`. Please implement the `find` method or overwrite `deserialize`.\", modelClass.find);\n return modelClass.find(params[paramForClass(modelClass)]);\n }\n\n return params;\n },\n\n /**\n The default method that takes an object and converts it into\n a params hash.\n\n By default, if there is a single dynamic segment named\n `blog_post_id` and the object is a `BlogPost` with an\n `id` of `12`, the serialize method will produce:\n\n ```javascript\n { blog_post_id: 12 }\n ```\n\n @method serialize\n @param manager {Ember.StateManager}\n @param context\n */\n serialize: function(manager, context) {\n var modelClass, routeMatcher, namespace, param, id;\n\n if (Ember.isEmpty(context)) { return ''; }\n\n if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {\n param = paramForClass(modelClass);\n id = get(context, 'id');\n context = {};\n context[param] = id;\n }\n\n return context;\n },\n\n /**\n @private\n @method resolvePath\n @param manager {Ember.StateManager}\n @param path {String}\n */\n resolvePath: function(manager, path) {\n if (get(this, 'isLeafRoute')) { return Ember.A(); }\n\n var childStates = get(this, 'childStates'), match;\n\n childStates = Ember.A(childStates.filterProperty('isRoutable'));\n\n childStates = childStates.sort(function(a, b) {\n var aDynamicSegments = get(a, 'routeMatcher.identifiers.length'),\n bDynamicSegments = get(b, 'routeMatcher.identifiers.length'),\n aRoute = get(a, 'route'),\n bRoute = get(b, 'route');\n\n if (aRoute.indexOf(bRoute) === 0) {\n return -1;\n } else if (bRoute.indexOf(aRoute) === 0) {\n return 1;\n }\n\n if (aDynamicSegments !== bDynamicSegments) {\n return aDynamicSegments - bDynamicSegments;\n }\n\n return get(b, 'route.length') - get(a, 'route.length');\n });\n\n var state = childStates.find(function(state) {\n var matcher = get(state, 'routeMatcher');\n if (match = matcher.match(path)) { return true; }\n });\n\n Ember.assert(\"Could not find state for path \" + path, !!state);\n\n var resolvedState = Ember._ResolvedState.create({\n manager: manager,\n state: state,\n match: match\n });\n\n var states = state.resolvePath(manager, match.remaining);\n\n return Ember.A([resolvedState]).pushObjects(states);\n },\n\n /**\n @private\n\n Once `unroute` has finished unwinding, `routePath` will be called\n with the remainder of the route.\n\n For example, if you were in the `/posts/1/comments` state, and you\n moved into the `/posts/2/comments` state, `routePath` will be called\n on the state whose path is `/posts` with the path `/2/comments`.\n\n @method routePath\n @param manager {Ember.StateManager}\n @param path {String}\n */\n routePath: function(manager, path) {\n if (get(this, 'isLeafRoute')) { return; }\n\n var resolvedStates = this.resolvePath(manager, path),\n hasPromises = resolvedStates.some(function(s) { return get(s, 'hasPromise'); });\n\n function runTransition() {\n resolvedStates.forEach(function(rs) { rs.transition(); });\n }\n\n if (hasPromises) {\n manager.transitionTo('loading');\n\n Ember.assert('Loading state should be the child of a route', Ember.Routable.detect(get(manager, 'currentState.parentState')));\n Ember.assert('Loading state should not be a route', !Ember.Routable.detect(get(manager, 'currentState')));\n\n manager.handleStatePromises(resolvedStates, runTransition);\n } else {\n runTransition();\n }\n },\n\n /**\n @private\n\n When you move to a new route by pressing the back\n or forward button, this method is called first.\n\n Its job is to move the state manager into a parent\n state of the state it will eventually move into.\n\n @method unroutePath\n @param router {Ember.Router}\n @param path {String}\n */\n unroutePath: function(router, path) {\n var parentState = get(this, 'parentState');\n\n // If we're at the root state, we're done\n if (parentState === router) {\n return;\n }\n\n path = path.replace(/^(?=[^\\/])/, \"/\");\n var absolutePath = this.absoluteRoute(router);\n\n var route = get(this, 'route');\n\n // If the current path is empty, move up one state,\n // because the index ('/') state must be a leaf node.\n if (route !== '/') {\n // If the current path is a prefix of the path we're trying\n // to go to, we're done.\n var index = path.indexOf(absolutePath),\n next = path.charAt(absolutePath.length);\n\n if (index === 0 && (next === \"/\" || next === \"\")) {\n return;\n }\n }\n\n // Transition to the parent and call unroute again.\n router.enterState({\n exitStates: [this],\n enterStates: [],\n finalState: parentState\n });\n\n router.send('unroutePath', path);\n },\n\n parentTemplate: Ember.computed(function() {\n var state = this, parentState, template;\n\n while (state = get(state, 'parentState')) {\n if (template = get(state, 'template')) {\n return template;\n }\n }\n\n return 'application';\n }),\n\n _template: Ember.computed(function(key) {\n var value = get(this, 'template');\n\n if (value) { return value; }\n\n // If no template was explicitly supplied convert\n // the class name into a template name. For example,\n // App.PostRoute will return `post`.\n var className = this.constructor.toString(), baseName;\n if (/^[^\\[].*Route$/.test(className)) {\n baseName = className.match(/([^\\.]+\\.)*([^\\.]+)/)[2];\n baseName = baseName.replace(/Route$/, '');\n return baseName.charAt(0).toLowerCase() + baseName.substr(1);\n }\n }),\n\n render: function(options) {\n options = options || {};\n\n var template = options.template || get(this, '_template'),\n parentTemplate = options.into || get(this, 'parentTemplate'),\n controller = get(this.router, parentTemplate + \"Controller\");\n\n var viewName = Ember.String.classify(template) + \"View\",\n viewClass = get(get(this.router, 'namespace'), viewName);\n\n viewClass = (viewClass || Ember.View).extend({\n templateName: template\n });\n\n controller.set('view', viewClass.create());\n },\n\n /**\n The `connectOutlets` event will be triggered once a\n state has been entered. It will be called with the\n route's context.\n\n @event connectOutlets\n @param router {Ember.Router}\n @param [context*]\n */\n connectOutlets: Ember.K,\n\n /**\n The `navigateAway` event will be triggered when the\n URL changes due to the back/forward button\n\n @event navigateAway\n */\n navigateAway: Ember.K\n});\n\n})();\n//@ sourceURL=ember-old-router/routable");minispade.register('ember-old-router/route', "(function() {minispade.require('ember-old-router/routable');\n\n/**\n@module ember\n@submodule ember-old-router\n*/\n\n/**\n @class Route\n @namespace Ember\n @extends Ember.State\n @uses Ember.Routable\n*/\nEmber.Route = Ember.State.extend(Ember.Routable);\n\n})();\n//@ sourceURL=ember-old-router/route");minispade.register('ember-old-router/route_matcher', "(function() {var escapeForRegex = function(text) {\n return text.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^\\$|#\\s]/g, \"\\\\$&\");\n};\n\n/**\n @class _RouteMatcher\n @namespace Ember\n @private\n @extends Ember.Object\n*/\nEmber._RouteMatcher = Ember.Object.extend({\n state: null,\n\n init: function() {\n var route = this.route,\n identifiers = [],\n count = 1,\n escaped;\n\n // Strip off leading slash if present\n if (route.charAt(0) === '/') {\n route = this.route = route.substr(1);\n }\n\n escaped = escapeForRegex(route);\n\n var regex = escaped.replace(/(:|(?:\\\\\\*))([a-z_]+)(?=$|\\/)/gi, function(match, type, id) {\n identifiers[count++] = id;\n switch (type) {\n case \":\":\n return \"([^/]+)\";\n case \"\\\\*\":\n return \"(.+)\";\n }\n });\n\n this.identifiers = identifiers;\n this.regex = new RegExp(\"^/?\" + regex);\n },\n\n match: function(path) {\n var match = path.match(this.regex);\n\n if (match) {\n var identifiers = this.identifiers,\n hash = {};\n\n for (var i=1, l=identifiers.length; i 0 ? hash : null\n };\n }\n },\n\n generate: function(hash) {\n var identifiers = this.identifiers, route = this.route, id;\n for (var i=1, l=identifiers.length; i\n

{{title}}

\n \n ```\n\n Will delegate `click` events on the rendered `h1` to the application's router\n instance. In this case the `anActionOnTheRouter` method of the state at\n 'root.aRoute' will be called with the view's controller as the context\n argument. This context will be passed to the `connectOutlets` as its second\n argument.\n\n Different `context` can be supplied from within the `{{action}}` helper,\n allowing specific context passing between application states:\n\n ```html\n \n ```\n\n See `Handlebars.helpers.action` for additional usage examples.\n\n ## Changing View Hierarchy in Response To State Change\n\n Changes in application state that change the URL should be accompanied by\n associated changes in view hierarchy. This can be accomplished by calling\n `connectOutlet` on the injected controller singletons from within the\n 'connectOutlets' event of an `Ember.Route`:\n\n ```javascript\n App = Ember.Application.create({\n OneController: Ember.ObjectController.extend(),\n OneView: Ember.View.extend(),\n\n AnotherController: Ember.ObjectController.extend(),\n AnotherView: Ember.View.extend(),\n\n Router: Ember.Router.extend({\n root: Ember.Route.extend({\n aRoute: Ember.Route.extend({\n route: '/',\n connectOutlets: function(router, context) {\n router.get('oneController').connectOutlet('another');\n },\n })\n })\n })\n });\n App.initialize();\n ```\n\n This will detect the `{{outlet}}` portion of `oneController`'s view (an\n instance of `App.OneView`) and fill it with a rendered instance of\n `App.AnotherView` whose `context` will be the single instance of\n `App.AnotherController` stored on the router in the `anotherController`\n property.\n\n For more information about Outlets, see `Ember.Handlebars.helpers.outlet`.\n For additional information on the `connectOutlet` method, see\n `Ember.Controller.connectOutlet`. For more information on controller\n injections, see `Ember.Application#initialize()`. For additional information\n about view context, see `Ember.View`.\n\n @class Router\n @namespace Ember\n @extends Ember.StateManager\n*/\nEmber.Router = Ember.StateManager.extend(\n/** @scope Ember.Router.prototype */ {\n\n /**\n @property initialState\n @type String\n @default 'root'\n */\n initialState: 'root',\n\n /**\n The `Ember.Location` implementation to be used to manage the application\n URL state. The following values are supported:\n\n * `hash`: Uses URL fragment identifiers (like #/blog/1) for routing.\n * `history`: Uses the browser's history.pushstate API for routing. Only\n works in modern browsers with pushstate support.\n * `none`: Does not read or set the browser URL, but still allows for\n routing to happen. Useful for testing.\n\n @property location\n @type String\n @default 'hash'\n */\n location: 'hash',\n\n /**\n This is only used when a history location is used so that applications that\n don't live at the root of the domain can append paths to their root.\n\n @property rootURL\n @type String\n @default '/'\n */\n\n rootURL: '/',\n\n transitionTo: function() {\n this.abortRoutingPromises();\n this._super.apply(this, arguments);\n },\n\n route: function(path) {\n this.abortRoutingPromises();\n\n set(this, 'isRouting', true);\n\n var routableState;\n function tryable() {\n path = path.replace(get(this, 'rootURL'), '');\n path = path.replace(/^(?=[^\\/])/, \"/\");\n\n this.send('navigateAway');\n this.send('unroutePath', path);\n\n routableState = get(this, 'currentState');\n while (routableState && !routableState.get('isRoutable')) {\n routableState = get(routableState, 'parentState');\n }\n var currentURL = routableState ? routableState.absoluteRoute(this) : '';\n var rest = path.substr(currentURL.length);\n\n this.send('routePath', rest);\n }\n\n function finalizer() {\n set(this, 'isRouting', false);\n }\n\n Ember.tryFinally(tryable, finalizer, this);\n\n routableState = get(this, 'currentState');\n while (routableState && !routableState.get('isRoutable')) {\n routableState = get(routableState, 'parentState');\n }\n\n if (routableState) {\n routableState.updateRoute(this, get(this, 'location'));\n }\n },\n\n urlFor: function(path, hashes) {\n var currentState = get(this, 'currentState') || this,\n state = this.findStateByPath(currentState, path);\n\n Ember.assert(Ember.String.fmt(\"Could not find route with path '%@'\", [path]), state);\n Ember.assert(Ember.String.fmt(\"To get a URL for the state '%@', it must have a `route` property.\", [path]), get(state, 'routeMatcher'));\n\n var location = get(this, 'location'),\n absoluteRoute = state.absoluteRoute(this, hashes);\n\n return location.formatURL(absoluteRoute);\n },\n\n urlForEvent: function(eventName) {\n var contexts = Array.prototype.slice.call(arguments, 1),\n currentState = get(this, 'currentState'),\n targetStateName = currentState.lookupEventTransition(eventName),\n targetState,\n hashes;\n\n Ember.assert(Ember.String.fmt(\"You must specify a target state for event '%@' in order to link to it in the current state '%@'.\", [eventName, get(currentState, 'path')]), targetStateName);\n\n targetState = this.findStateByPath(currentState, targetStateName);\n\n Ember.assert(\"Your target state name \" + targetStateName + \" for event \" + eventName + \" did not resolve to a state\", targetState);\n\n\n hashes = this.serializeRecursively(targetState, contexts, []);\n\n return this.urlFor(targetStateName, hashes);\n },\n\n serializeRecursively: function(state, contexts, hashes) {\n var parentState,\n\t\t\tcontext = get(state, 'hasContext') ? contexts.pop() : null,\n hash = context ? state.serialize(this, context) : null;\n\n\t\thashes.push(hash);\n\t\tparentState = state.get(\"parentState\");\n\n\t\tif (parentState && parentState instanceof Ember.Route) {\n return this.serializeRecursively(parentState, contexts, hashes);\n } else {\n return hashes;\n }\n },\n\n abortRoutingPromises: function() {\n if (this._routingPromises) {\n this._routingPromises.abort();\n this._routingPromises = null;\n }\n },\n\n handleStatePromises: function(states, complete) {\n this.abortRoutingPromises();\n\n this.set('isLocked', true);\n\n var manager = this;\n\n this._routingPromises = Ember._PromiseChain.create({\n promises: states.slice(),\n\n successCallback: function() {\n manager.set('isLocked', false);\n complete();\n },\n\n failureCallback: function() {\n throw \"Unable to load object\";\n },\n\n promiseSuccessCallback: function(item, args) {\n set(item, 'object', args[0]);\n },\n\n abortCallback: function() {\n manager.set('isLocked', false);\n }\n }).start();\n },\n\n moveStatesIntoRoot: function() {\n this.root = Ember.Route.extend();\n\n for (var name in this) {\n if (name === \"constructor\") { continue; }\n\n var state = this[name];\n\n if (state instanceof Ember.Route || Ember.Route.detect(state)) {\n this.root[name] = state;\n delete this[name];\n }\n }\n },\n\n init: function() {\n if (!this.root) {\n this.moveStatesIntoRoot();\n }\n\n this._super();\n\n var location = get(this, 'location'),\n rootURL = get(this, 'rootURL');\n\n if ('string' === typeof location) {\n set(this, 'location', Ember.Location.create({\n implementation: location,\n rootURL: rootURL\n }));\n }\n\n this.assignRouter(this, this);\n },\n\n assignRouter: function(state, router) {\n state.router = router;\n\n var childStates = state.states;\n\n if (childStates) {\n for (var stateName in childStates) {\n if (!childStates.hasOwnProperty(stateName)) { continue; }\n this.assignRouter(childStates[stateName], router);\n }\n }\n },\n\n willDestroy: function() {\n get(this, 'location').destroy();\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/router");minispade.register('ember-old-router/view_ext', "(function() {/**\n@module ember\n@submodule ember-old-router\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\nOverride functionality for Ember.View use in old-router\n\n@class View\n@namespace Ember\n*/\nEmber.View.reopen({\n templateForName: function(name, type) {\n if (!name) { return; }\n\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n var templates = get(this, 'templates'),\n template = get(templates, name);\n\n if (!template) {\n throw new Ember.Error(fmt('%@ - Unable to find %@ \"%@\".', [this, type, name]));\n }\n\n return template;\n }\n});\n\n})();\n//@ sourceURL=ember-old-router/view_ext");minispade.register('ember-routing/ext', "(function() {minispade.require('ember-routing/ext/controller');\nminispade.require('ember-routing/ext/view');\n\n})();\n//@ sourceURL=ember-routing/ext");minispade.register('ember-routing/ext/controller', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.ControllerMixin.reopen({\n /**\n Transition the application into another route. The route may\n be either a single route or route path:\n\n ```javascript\n aController.transitionToRoute('blogPosts');\n aController.transitionToRoute('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n \n ```javascript\n aController.transitionToRoute('blogPost', aPost);\n ```\n\n @param {String} name the name of the route\n @param {...Object} models the\n @for Ember.ControllerMixin\n @method transitionToRoute\n */\n transitionToRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.transitionToRoute || target.transitionTo;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method transitionTo\n */\n transitionTo: function() {\n Ember.deprecate(\"transitionTo is deprecated. Please use transitionToRoute.\");\n return this.transitionToRoute.apply(this, arguments);\n },\n\n replaceRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.replaceRoute || target.replaceWith;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method replaceWith\n */\n replaceWith: function() {\n Ember.deprecate(\"replaceWith is deprecated. Please use replaceRoute.\");\n return this.replaceRoute.apply(this, arguments);\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/controller");minispade.register('ember-routing/ext/view', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.View.reopen({\n init: function() {\n set(this, '_outlets', {});\n this._super();\n },\n\n connectOutlet: function(outletName, view) {\n var outlets = get(this, '_outlets'),\n container = get(this, 'container'),\n router = container && container.lookup('router:main'),\n renderedName = get(view, 'renderedName');\n\n set(outlets, outletName, view);\n\n if (router && renderedName) {\n router._connectActiveView(renderedName, view);\n }\n },\n\n disconnectOutlet: function(outletName) {\n var outlets = get(this, '_outlets');\n\n set(outlets, outletName, null);\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/view");minispade.register('ember-routing/helpers', "(function() {minispade.require('ember-routing/helpers/shared');\nminispade.require('ember-routing/helpers/link_to');\nminispade.require('ember-routing/helpers/outlet');\nminispade.require('ember-routing/helpers/render');\nminispade.require('ember-routing/helpers/action');\nminispade.require('ember-routing/helpers/control');\n\n})();\n//@ sourceURL=ember-routing/helpers");minispade.register('ember-routing/helpers/action', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\nminispade.require('ember-handlebars/ext');\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n var EmberHandlebars = Ember.Handlebars,\n handlebarsGet = EmberHandlebars.get,\n SafeString = EmberHandlebars.SafeString,\n forEach = Ember.ArrayPolyfills.forEach,\n get = Ember.get,\n a_slice = Array.prototype.slice;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return ret.concat(resolveParams(options.context, options.params, { types: types, data: data }));\n }\n\n var ActionHelper = EmberHandlebars.ActionHelper = {\n registeredActions: {}\n };\n\n var keys = [\"alt\", \"shift\", \"meta\", \"ctrl\"];\n\n var isAllowedClick = function(event, allowedKeys) {\n if (typeof allowedKeys === \"undefined\") {\n return isSimpleClick(event);\n }\n\n var allowed = true;\n\n forEach.call(keys, function(key) {\n if (event[key + \"Key\"] && allowedKeys.indexOf(key) === -1) {\n allowed = false;\n }\n });\n\n return allowed;\n };\n\n ActionHelper.registerAction = function(actionName, options, allowedKeys) {\n var actionId = (++Ember.uuid).toString();\n\n ActionHelper.registeredActions[actionId] = {\n eventName: options.eventName,\n handler: function(event) {\n if (!isAllowedClick(event, allowedKeys)) { return true; }\n\n event.preventDefault();\n\n if (options.bubbles === false) {\n event.stopPropagation();\n }\n\n var target = options.target;\n\n if (target.target) {\n target = handlebarsGet(target.root, target.target, target.options);\n } else {\n target = target.root;\n }\n\n Ember.run(function() {\n if (target.send) {\n target.send.apply(target, args(options.parameters, actionName));\n } else {\n Ember.assert(\"The action '\" + actionName + \"' did not exist on \" + target, typeof target[actionName] === 'function');\n target[actionName].apply(target, args(options.parameters));\n }\n });\n }\n };\n\n options.view.on('willClearRender', function() {\n delete ActionHelper.registeredActions[actionId];\n });\n\n return actionId;\n };\n\n /**\n The `{{action}}` helper registers an HTML element within a template for DOM\n event handling and forwards that interaction to the view's controller\n or supplied `target` option (see 'Specifying a Target').\n\n If the view's controller does not implement the event, the event is sent\n to the current route, and it bubbles up the route hierarchy from there.\n\n User interaction with that element will invoke the supplied action name on\n the appropriate target.\n\n Given the following Handlebars template on the page\n\n ```handlebars\n \n ```\n\n And application code\n\n ```javascript\n AController = Ember.Controller.extend({\n anActionName: function() {}\n });\n\n AView = Ember.View.extend({\n controller: AController.create(),\n templateName: 'a-template'\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will results in the following rendered HTML\n\n ```html\n
\n
\n click me\n
\n
\n ```\n\n Clicking \"click me\" will trigger the `anActionName` method of the\n `AController`. In this case, no additional parameters will be passed.\n\n If you provide additional parameters to the helper:\n\n ```handlebars\n \n ```\n\n Those parameters will be passed along as arguments to the JavaScript\n function implementing the action.\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers.\n\n To also disable bubbling, pass `bubbles=false` to the helper:\n\n ```handlebars\n \n ```\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See `Ember.View`\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n \n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n NOTE: Because `{{action}}` depends on Ember's event dispatch system it will\n only function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new `Ember.Application`\n is created. Having an instance of `Ember.Application` will satisfy this\n requirement.\n\n ### Specifying whitelisted modifier keys\n\n By default the `{{action}}` helper will ignore click event with pressed modifier\n keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.\n\n ```handlebars\n \n ```\n\n This way the `{{action}}` will fire when clicking with the alt key pressed down.\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical Ember application, where views are managed through use of the\n `{{outlet}}` helper, actions will bubble to the current controller, then\n to the current route, and then up the route hierarchy.\n\n Alternatively, a `target` option can be provided to the helper to change\n which object will receive the method call. This option must be a path\n path to an object, accessible in the current context:\n\n ```handlebars\n \n ```\n\n Clicking \"click me\" in the rendered HTML of the above template will trigger\n the `anActionName` method of the object at `MyApplication.someObject`.\n\n If an action's target does not implement a method that matches the supplied\n action name an error will be thrown.\n\n ```handlebars\n \n ```\n\n With the following application code\n\n ```javascript\n AView = Ember.View.extend({\n templateName; 'a-template',\n // note: no method 'aMethodNameThatIsMissing'\n anActionName: function(event) {}\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when\n \"click me\" is clicked.\n\n ### Additional Parameters\n\n You may specify additional parameters to the `{{action}}` helper. These\n parameters are passed along as the arguments to the JavaScript function\n implementing the action.\n\n ```handlebars\n \n ```\n\n Clicking \"click me\" will trigger the `edit` method on the current view's\n controller with the current person as a parameter.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object} [context]*\n @param {Hash} options\n */\n EmberHandlebars.registerHelper('action', function(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n controller;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\"\n };\n\n action.parameters = {\n context: this,\n options: options,\n params: contexts\n };\n\n action.view = options.data.view;\n\n var root, target;\n\n if (hash.target) {\n root = this;\n target = hash.target;\n } else if (controller = options.data.keywords.controller) {\n root = controller;\n }\n\n action.target = { root: root, target: target, options: options };\n action.bubbles = hash.bubbles;\n\n var actionId = ActionHelper.registerAction(actionName, action, hash.allowedKeys);\n return new SafeString('data-ember-action=\"' + actionId + '\"');\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/action");minispade.register('ember-routing/helpers/control', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nif (Ember.ENV.EXPERIMENTAL_CONTROL_HELPER) {\n var get = Ember.get, set = Ember.set;\n\n /**\n The control helper is currently under development and is considered experimental.\n To enable it, set `ENV.EXPERIMENTAL_CONTROL_HELPER = true` before requiring Ember.\n\n @method control\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {String} modelPath\n @param {Hash} options\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('control', function(path, modelPath, options) {\n if (arguments.length === 2) {\n options = modelPath;\n modelPath = undefined;\n }\n\n var model;\n\n if (modelPath) {\n model = Ember.Handlebars.get(this, modelPath, options);\n }\n\n var controller = options.data.keywords.controller,\n view = options.data.keywords.view,\n children = get(controller, '_childContainers'),\n controlID = options.hash.controlID,\n container, subContainer;\n\n if (children.hasOwnProperty(controlID)) {\n subContainer = children[controlID];\n } else {\n container = get(controller, 'container'),\n subContainer = container.child();\n children[controlID] = subContainer;\n }\n\n var normalizedPath = path.replace(/\\//g, '.');\n\n var childView = subContainer.lookup('view:' + normalizedPath) || subContainer.lookup('view:default'),\n childController = subContainer.lookup('controller:' + normalizedPath),\n childTemplate = subContainer.lookup('template:' + path);\n\n Ember.assert(\"Could not find controller for path: \" + normalizedPath, childController);\n Ember.assert(\"Could not find view for path: \" + normalizedPath, childView);\n\n set(childController, 'target', controller);\n set(childController, 'model', model);\n\n options.hash.template = childTemplate;\n options.hash.controller = childController;\n\n function observer() {\n var model = Ember.Handlebars.get(this, modelPath, options);\n set(childController, 'model', model);\n childView.rerender();\n }\n\n Ember.addObserver(this, modelPath, observer);\n childView.one('willDestroyElement', this, function() {\n Ember.removeObserver(this, modelPath, observer);\n });\n\n Ember.Handlebars.helpers.view.call(this, childView, options);\n });\n}\n\n})();\n//@ sourceURL=ember-routing/helpers/control");minispade.register('ember-routing/helpers/link_to', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n function fullRouteName(router, name) {\n if (!router.hasRoute(name)) {\n name = name + '.index';\n }\n\n return name;\n }\n\n function resolvedPaths(options) {\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return resolveParams(options.context, options.params, { types: types, data: data });\n }\n\n function args(linkView, router, route) {\n var passedRouteName = route || linkView.namedRoute, routeName;\n\n routeName = fullRouteName(router, passedRouteName);\n\n Ember.assert(fmt(\"The attempt to linkTo route '%@' failed. The router did not find '%@' in its possible routes: '%@'\", [passedRouteName, passedRouteName, Ember.keys(router.router.recognizer.names).join(\"', '\")]), router.hasRoute(routeName));\n\n var ret = [ routeName ];\n return ret.concat(resolvedPaths(linkView.parameters));\n }\n\n /**\n @class LinkView\n @namespace Ember\n @extends Ember.View\n **/\n var LinkView = Ember.LinkView = Ember.View.extend({\n tagName: 'a',\n namedRoute: null,\n currentWhen: null,\n title: null,\n activeClass: 'active',\n replace: false,\n attributeBindings: ['href', 'title'],\n classNameBindings: 'active',\n\n // Even though this isn't a virtual view, we want to treat it as if it is\n // so that you can access the parent with {{view.prop}}\n concreteView: Ember.computed(function() {\n return get(this, 'parentView');\n }).property('parentView'),\n\n active: Ember.computed(function() {\n var router = this.get('router'),\n params = resolvedPaths(this.parameters),\n currentWithIndex = this.currentWhen + '.index',\n isActive = router.isActive.apply(router, [this.currentWhen].concat(params)) ||\n router.isActive.apply(router, [currentWithIndex].concat(params));\n\n if (isActive) { return get(this, 'activeClass'); }\n }).property('namedRoute', 'router.url'),\n\n router: Ember.computed(function() {\n return this.get('controller').container.lookup('router:main');\n }),\n\n click: function(event) {\n if (!isSimpleClick(event)) { return true; }\n\n event.preventDefault();\n if (this.bubbles === false) { event.stopPropagation(); }\n\n var router = this.get('router');\n\n if (Ember.ENV.ENABLE_ROUTE_TO) {\n\n var routeArgs = args(this, router);\n\n router.routeTo(Ember.TransitionEvent.create({\n transitionMethod: this.get('replace') ? 'replaceWith' : 'transitionTo',\n destinationRouteName: routeArgs[0],\n contexts: routeArgs.slice(1)\n }));\n } else {\n if (this.get('replace')) {\n router.replaceWith.apply(router, args(this, router));\n } else {\n router.transitionTo.apply(router, args(this, router));\n }\n }\n },\n\n href: Ember.computed(function() {\n if (this.get('tagName') !== 'a') { return false; }\n\n var router = this.get('router');\n return router.generate.apply(router, args(this, router));\n })\n });\n\n LinkView.toString = function() { return \"LinkView\"; };\n\n /**\n The `{{linkTo}}` helper renders a link to the supplied\n `routeName` passing an optionally supplied model to the\n route as its `model` context of the route. The block\n for `{{linkTo}}` becomes the innerHTML of the rendered\n element:\n\n ```handlebars\n {{#linkTo photoGallery}}\n Great Hamster Photos\n {{/linkTo}}\n ```\n\n ```html\n \n Great Hamster Photos\n \n ```\n\n ### Supplying a tagName\n By default `{{linkTo}}` renders an `` element. This can\n be overridden for a single use of `{{linkTo}}` by supplying\n a `tagName` option:\n\n ```handlebars\n {{#linkTo photoGallery tagName=\"li\"}}\n Great Hamster Photos\n {{/linkTo}}\n ```\n\n ```html\n
  • \n Great Hamster Photos\n
  • \n ```\n\n To override this option for your entire application, see \n \"Overriding Application-wide Defaults\".\n\n ### Handling `href`\n `{{linkTo}}` will use your application's Router to\n fill the element's `href` property with a url that\n matches the path to the supplied `routeName` for your\n routers's configured `Location` scheme, which defaults\n to Ember.HashLocation.\n\n ### Handling current route\n `{{linkTo}}` will apply a CSS class name of 'active'\n when the application's current route matches\n the supplied routeName. For example, if the application's\n current route is 'photoGallery.recent' the following\n use of `{{linkTo}}`:\n\n ```handlebars\n {{#linkTo photoGallery.recent}}\n Great Hamster Photos from the last week\n {{/linkTo}}\n ```\n\n will result in\n\n ```html\n
    \n Great Hamster Photos\n \n ```\n\n The CSS class name used for active classes can be customized\n for a single use of `{{linkTo}}` by passing an `activeClass`\n option:\n\n ```handlebars\n {{#linkTo photoGallery.recent activeClass=\"current-url\"}}\n Great Hamster Photos from the last week\n {{/linkTo}}\n ```\n\n ```html\n \n Great Hamster Photos\n \n ```\n\n To override this option for your entire application, see \n \"Overriding Application-wide Defaults\".\n\n ### Supplying a model\n An optional model argument can be used for routes whose\n paths contain dynamic segments. This argument will become\n the model context of the linked route:\n\n ```javascript\n App.Router.map(function(){\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n })\n ```\n\n ```handlebars\n {{#linkTo photoGallery aPhoto}}\n {{aPhoto.title}}\n {{/linkTo}}\n ```\n\n ```html\n \n Tomster\n \n ```\n\n ### Supplying multiple models\n For deep-linking to route paths that contain multiple\n dynamic segments, multiple model arguments can be used.\n As the router transitions through the route path, each\n supplied model argument will become the context for the\n route with the dynamic segments:\n\n ```javascript\n App.Router.map(function(){\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"}, function(){\n this.route(\"comment\", {path: \"comments/:comment_id\"});\n });\n });\n ```\n This argument will become the model context of the linked route:\n\n ```handlebars\n {{#linkTo photoGallery.comment aPhoto comment}}\n {{comment.body}}\n {{/linkTo}}\n ```\n\n ```html\n \n A+++ would snuggle again.\n \n ```\n\n ### Overriding Application-wide Defaults\n ``{{linkTo}}`` creates an instance of Ember.LinkView\n for rendering. To override options for your entire\n application, reopen Ember.LinkView and supply the\n desired values:\n\n ``` javascript\n Ember.LinkView.reopen({\n activeClass: \"is-active\",\n tagName: 'li'\n })\n ```\n\n @method linkTo\n @for Ember.Handlebars.helpers\n @param {String} routeName\n @param {Object} [context]*\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('linkTo', function(name) {\n var options = [].slice.call(arguments, -1)[0];\n var params = [].slice.call(arguments, 1, -1);\n\n var hash = options.hash;\n\n hash.namedRoute = name;\n hash.currentWhen = hash.currentWhen || name;\n\n hash.parameters = {\n context: this,\n options: options,\n params: params\n };\n\n return Ember.Handlebars.helpers.view.call(this, LinkView, options);\n });\n\n});\n\n\n})();\n//@ sourceURL=ember-routing/helpers/link_to");minispade.register('ember-routing/helpers/outlet', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n /**\n @module ember\n @submodule ember-routing\n */\n\n Handlebars.OutletView = Ember.ContainerView.extend(Ember._Metamorph);\n\n /**\n The `outlet` helper is a placeholder that the router will fill in with\n the appropriate template based on the current state of the application.\n\n ``` handlebars\n {{outlet}}\n ```\n\n By default, a template based on Ember's naming conventions will be rendered\n into the `outlet` (e.g. `App.PostsRoute` will render the `posts` template).\n\n You can render a different template by using the `render()` method in the\n route's `renderTemplate` hook. The following will render the `favoritePost`\n template into the `outlet`.\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost');\n }\n });\n ```\n\n You can create custom named outlets for more control.\n\n ``` handlebars\n {{outlet favoritePost}}\n {{outlet posts}}\n ```\n\n Then you can define what template is rendered into each outlet in your\n route.\n\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost', { outlet: 'favoritePost' });\n this.render('posts', { outlet: 'posts' });\n }\n });\n ```\n\n @method outlet\n @for Ember.Handlebars.helpers\n @param {String} property the property on the controller\n that holds the view for this outlet\n */\n Handlebars.registerHelper('outlet', function(property, options) {\n var outletSource;\n\n if (property && property.data && property.data.isRenderData) {\n options = property;\n property = 'main';\n }\n\n outletSource = options.data.view;\n while (!(outletSource.get('template.isTop'))){\n outletSource = outletSource.get('_parentView');\n }\n\n options.data.view.set('outletSource', outletSource);\n options.hash.currentViewBinding = '_view.outletSource._outlets.' + property;\n\n return Handlebars.helpers.view.call(this, Handlebars.OutletView, options);\n });\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/outlet");minispade.register('ember-routing/helpers/render', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n /**\n Renders the named template in the current context using the singleton\n instance of the same-named controller.\n\n If a view class with the same name exists, uses the view class.\n\n If a `model` is specified, it becomes the model for that controller.\n\n The default target for `{{action}}`s in the rendered template is the\n named controller.\n\n @method render\n @for Ember.Handlebars.helpers\n @param {String} name\n @param {Object?} contextString\n @param {Hash} options\n */\n Ember.Handlebars.registerHelper('render', function(name, contextString, options) {\n Ember.assert(\"You must pass a template to render\", arguments.length >= 2);\n var container, router, controller, view, context, lookupOptions;\n\n if (arguments.length === 2) {\n options = contextString;\n contextString = undefined;\n }\n\n if (typeof contextString === 'string') {\n context = Ember.Handlebars.get(options.contexts[1], contextString, options);\n lookupOptions = { singleton: false };\n }\n\n name = name.replace(/\\//g, '.');\n container = options.data.keywords.controller.container;\n router = container.lookup('router:main');\n\n Ember.assert(\"You can only use the {{render}} helper once without a model object as its second argument, as in {{render \\\"post\\\" post}}.\", context || !router || !router._lookupActiveView(name));\n\n view = container.lookup('view:' + name) || container.lookup('view:default');\n\n if (controller = options.hash.controller) {\n controller = container.lookup('controller:' + controller, lookupOptions);\n } else {\n controller = Ember.controllerFor(container, name, context, lookupOptions);\n }\n\n if (controller && context) {\n controller.set('model', context);\n }\n\n var root = options.contexts[1];\n\n if (root) {\n view.registerObserver(root, contextString, function() {\n controller.set('model', Ember.Handlebars.get(root, contextString, options));\n });\n }\n\n controller.set('target', options.data.keywords.controller);\n\n options.hash.viewName = Ember.String.camelize(name);\n options.hash.template = container.lookup('template:' + name);\n options.hash.controller = controller;\n\n if (router && !context) {\n router._connectActiveView(name, view);\n }\n\n Ember.Handlebars.helpers.view.call(this, view, options);\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/render");minispade.register('ember-routing/helpers/shared', "(function() {minispade.require('ember-routing/system/router');\n\nEmber.onLoad('Ember.Handlebars', function() {\n var handlebarsResolve = Ember.Handlebars.resolveParams,\n map = Ember.ArrayPolyfills.map,\n get = Ember.get;\n\n function resolveParams(context, params, options) {\n var resolved = handlebarsResolve(context, params, options);\n return map.call(resolved, unwrap);\n\n function unwrap(object, i) {\n if (params[i] === 'controller') { return object; }\n\n if (Ember.ControllerMixin.detect(object)) {\n return unwrap(get(object, 'model'));\n } else {\n return object;\n }\n }\n }\n\n Ember.Router.resolveParams = resolveParams;\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/shared");minispade.register('ember-routing/location', "(function() {minispade.require('ember-views');\nminispade.require('ember-routing/location/api');\nminispade.require('ember-routing/location/none_location');\nminispade.require('ember-routing/location/hash_location');\nminispade.require('ember-routing/location/history_location');\n\n})();\n//@ sourceURL=ember-routing/location");minispade.register('ember-routing/location/api', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n This file implements the `location` API used by Ember's router.\n\n That API is:\n\n getURL: returns the current URL\n setURL(path): sets the current URL\n replaceURL(path): replace the current URL (optional)\n onUpdateURL(callback): triggers the callback when the URL changes\n formatURL(url): formats `url` to be placed into `href` attribute\n\n Calling setURL or replaceURL will not trigger onUpdateURL callbacks.\n\n TODO: This should perhaps be moved so that it's visible in the doc output.\n*/\n\n/**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n You can pass it a `implementation` ('hash', 'history', 'none') to force a\n particular implementation.\n\n @class Location\n @namespace Ember\n @static\n*/\nEmber.Location = {\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n registerImplementation: function(name, implementation) {\n this.implementations[name] = implementation;\n },\n\n implementations: {}\n};\n\n})();\n//@ sourceURL=ember-routing/location/api");minispade.register('ember-routing/location/hash_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.HashLocation implements the location API using the browser's\n hash. At present, it relies on a hashchange event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HashLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n },\n\n /**\n @private\n\n Returns the current `location.hash`, minus the '#' at the front.\n\n @method getURL\n */\n getURL: function() {\n return get(this, 'location').hash.substr(1);\n },\n\n /**\n @private\n\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = Ember.guidFor(this);\n\n Ember.$(window).bind('hashchange.ember-location-'+guid, function() {\n Ember.run(function() {\n var path = location.hash.substr(1);\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(path);\n });\n });\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('hashchange.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('hash', Ember.HashLocation);\n\n})();\n//@ sourceURL=ember-routing/location/hash_location");minispade.register('ember-routing/location/history_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar popstateFired = false;\n\n/**\n Ember.HistoryLocation implements the location API using the browser's\n history.pushState API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HistoryLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n this.initState();\n },\n\n /**\n @private\n\n Used to set state on first call to setURL\n\n @method initState\n */\n initState: function() {\n set(this, 'history', get(this, 'history') || window.history);\n this.replaceState(this.formatURL(this.getURL()));\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Returns the current `location.pathname` without rootURL\n\n @method getURL\n */\n getURL: function() {\n var rootURL = get(this, 'rootURL'),\n url = get(this, 'location').pathname;\n\n rootURL = rootURL.replace(/\\/$/, '');\n url = url.replace(rootURL, '');\n\n return url;\n },\n\n /**\n @private\n\n Uses `history.pushState` to update the url without a page reload.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n path = this.formatURL(path);\n\n if (this.getState() && this.getState().path !== path) {\n this.pushState(path);\n }\n },\n\n /**\n @private\n\n Uses `history.replaceState` to update the url without a page reload\n or history modification.\n\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n path = this.formatURL(path);\n\n if (this.getState() && this.getState().path !== path) {\n this.replaceState(path);\n }\n },\n\n /**\n @private\n\n Get the current `history.state`\n\n @method getState\n */\n getState: function() {\n return get(this, 'history').state;\n },\n\n /**\n @private\n\n Pushes a new state\n\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n get(this, 'history').pushState({ path: path }, null, path);\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n @private\n\n Replaces the current state\n\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n get(this, 'history').replaceState({ path: path }, null, path);\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n @private\n\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = Ember.guidFor(this),\n self = this;\n\n Ember.$(window).bind('popstate.ember-location-'+guid, function(e) {\n // Ignore initial page load popstate event in Chrome\n if(!popstateFired) {\n popstateFired = true;\n if (self.getURL() === self._previousURL) { return; }\n }\n callback(self.getURL());\n });\n },\n\n /**\n @private\n\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n }\n\n return rootURL + url;\n },\n\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).unbind('popstate.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('history', Ember.HistoryLocation);\n\n})();\n//@ sourceURL=ember-routing/location/history_location");minispade.register('ember-routing/location/none_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.NoneLocation does not interact with the browser. It is useful for\n testing, or when you need to manage state with your Router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.NoneLocation = Ember.Object.extend({\n path: '',\n\n getURL: function() {\n return get(this, 'path');\n },\n\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n onUpdateURL: function(callback) {\n this.updateCallback = callback;\n },\n\n handleURL: function(url) {\n set(this, 'path', url);\n this.updateCallback(url);\n },\n\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n});\n\nEmber.Location.registerImplementation('none', Ember.NoneLocation);\n\n})();\n//@ sourceURL=ember-routing/location/none_location");minispade.register('ember-routing', "(function() {minispade.require('ember-runtime');\nminispade.require('ember-views');\nminispade.require('ember-handlebars');\nminispade.require('ember-routing/vendor/route-recognizer');\nminispade.require('ember-routing/vendor/router');\nminispade.require('ember-routing/system');\nminispade.require('ember-routing/helpers');\nminispade.require('ember-routing/ext');\nminispade.require('ember-routing/location');\n\n/**\nEmber Routing\n\n@module ember\n@submodule ember-routing\n@requires ember-states\n@requires ember-views\n*/\n\n})();\n//@ sourceURL=ember-routing");minispade.register('ember-routing/system', "(function() {minispade.require('ember-routing/system/dsl');\nminispade.require('ember-routing/system/controller_for');\nminispade.require('ember-routing/system/router');\nminispade.require('ember-routing/system/route');\nminispade.require('ember-routing/system/transition_event');\n\n})();\n//@ sourceURL=ember-routing/system");minispade.register('ember-routing/system/controller_for', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nEmber.controllerFor = function(container, controllerName, context, lookupOptions) {\n return container.lookup('controller:' + controllerName, lookupOptions) ||\n Ember.generateController(container, controllerName, context);\n};\n/*\n Generates a controller automatically if none was provided.\n The type of generated controller depends on the context.\n You can customize your generated controllers by defining\n `App.ObjectController` and `App.ArrayController`\n*/\nEmber.generateController = function(container, controllerName, context) {\n var controller, DefaultController, fullName;\n\n if (context && Ember.isArray(context)) {\n DefaultController = container.resolve('controller:array');\n controller = DefaultController.extend({\n content: context\n });\n } else if (context) {\n DefaultController = container.resolve('controller:object');\n controller = DefaultController.extend({\n content: context\n });\n } else {\n DefaultController = container.resolve('controller:basic');\n controller = DefaultController.extend();\n }\n\n controller.toString = function() {\n return \"(generated \" + controllerName + \" controller)\";\n };\n\n\n fullName = 'controller:' + controllerName;\n container.register(fullName, controller);\n return container.lookup(fullName);\n};\n\n})();\n//@ sourceURL=ember-routing/system/controller_for");minispade.register('ember-routing/system/dsl', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nfunction DSL(name) {\n this.parent = name;\n this.matches = [];\n}\n\nDSL.prototype = {\n resource: function(name, options, callback) {\n if (arguments.length === 2 && typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n if (arguments.length === 1) {\n options = {};\n }\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (callback) {\n var dsl = new DSL(name);\n callback.call(dsl);\n this.push(options.path, name, dsl.generate());\n } else {\n this.push(options.path, name);\n }\n },\n\n push: function(url, name, callback) {\n var parts = name.split('.');\n if (url === \"\" || url === \"/\" || parts[parts.length-1] === \"index\") { this.explicitIndex = true; }\n\n this.matches.push([url, name, callback]);\n },\n\n route: function(name, options) {\n Ember.assert(\"You must use `this.resource` to nest\", typeof options !== 'function');\n\n options = options || {};\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (this.parent && this.parent !== 'application') {\n name = this.parent + \".\" + name;\n }\n\n this.push(options.path, name);\n },\n\n generate: function() {\n var dslMatches = this.matches;\n\n if (!this.explicitIndex) {\n this.route(\"index\", { path: \"/\" });\n }\n\n return function(match) {\n for (var i=0, l=dslMatches.length; i 0 ? !Ember.isNone(arguments[0]) : true);\n\n if (typeof name === 'object' && !options) {\n options = name;\n name = this.routeName;\n }\n\n name = name ? name.replace(/\\//g, '.') : this.routeName;\n\n var container = this.container,\n view = container.lookup('view:' + name),\n template = container.lookup('template:' + name);\n\n if (!view && !template) { return; }\n\n options = normalizeOptions(this, name, template, options);\n view = setupView(view, container, options);\n\n if (options.outlet === 'main') { this.lastRenderedTemplate = name; }\n\n appendView(this, view, options);\n },\n\n willDestroy: function() {\n teardownView(this);\n }\n});\n\nfunction parentRoute(route) {\n var handlerInfos = route.router.router.targetHandlerInfos;\n\n var parent, current;\n\n for (var i=0, l=handlerInfos.length; i \" + n.nextStates.map(function(s) { return s.debug() }).join(\" or \") + \" )\";\n }).join(\", \")\n }\n END IF **/\n\n // This is a somewhat naive strategy, but should work in a lot of cases\n // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id\n function sortSolutions(states) {\n return states.sort(function(a, b) {\n if (a.types.stars !== b.types.stars) { return a.types.stars - b.types.stars; }\n if (a.types.dynamics !== b.types.dynamics) { return a.types.dynamics - b.types.dynamics; }\n if (a.types.statics !== b.types.statics) { return a.types.statics - b.types.statics; }\n\n return 0;\n });\n }\n\n function recognizeChar(states, char) {\n var nextStates = [];\n\n for (var i=0, l=states.length; i 1 && path.charAt(pathLen - 1) === \"/\") {\n path = path.substr(0, pathLen - 1);\n }\n\n for (i=0, l=path.length; i=0 && objectsToMatch>0; i--) {\n if (handlers[i].names.length) {\n objectsToMatch--;\n startIdx = i;\n }\n }\n\n if (objectsToMatch > 0) {\n throw \"More context objects were passed than there are dynamic segments for the route: \"+handlerName;\n }\n\n // Connect the objects to the routes\n for (i=0; i= startIdx) {\n object = objects.shift();\n objectChanged = true;\n // Otherwise use existing context\n } else {\n object = handler.context;\n }\n\n // Serialize to generate params\n if (handler.serialize) {\n merge(params, handler.serialize(object, names));\n }\n // If it's not a dynamic segment and we're updating\n } else if (doUpdate) {\n // If we've passed the match point we need to deserialize again\n // or if we never had a context\n if (i > startIdx || !handler.hasOwnProperty('context')) {\n if (handler.deserialize) {\n object = handler.deserialize({});\n objectChanged = true;\n }\n // Otherwise use existing context\n } else {\n object = handler.context;\n }\n }\n\n // Make sure that we update the context here so it's available to\n // subsequent deserialize calls\n if (doUpdate && objectChanged) {\n // TODO: It's a bit awkward to set the context twice, see if we can DRY things up\n setContext(handler, object);\n }\n\n toSetup.push({\n isDynamic: !!handlerObj.names.length,\n name: handlerObj.handler,\n handler: handler,\n context: object\n });\n\n if (i === handlers.length - 1) {\n var lastHandler = toSetup[toSetup.length - 1],\n additionalHandler;\n\n if (additionalHandler = lastHandler.handler.additionalHandler) {\n handlers.push({\n handler: additionalHandler.call(lastHandler.handler),\n names: []\n });\n }\n }\n }\n\n return { params: params, toSetup: toSetup };\n },\n\n isActive: function(handlerName) {\n var contexts = [].slice.call(arguments, 1);\n\n var targetHandlerInfos = this.targetHandlerInfos,\n found = false, names, object, handlerInfo, handlerObj;\n\n for (var i=targetHandlerInfos.length-1; i>=0; i--) {\n handlerInfo = targetHandlerInfos[i];\n if (handlerInfo.name === handlerName) { found = true; }\n\n if (found) {\n if (contexts.length === 0) { break; }\n\n if (handlerInfo.isDynamic) {\n object = contexts.pop();\n if (handlerInfo.context !== object) { return false; }\n }\n }\n }\n\n return contexts.length === 0 && found;\n },\n\n trigger: function(name) {\n var args = [].slice.call(arguments);\n trigger(this, args);\n }\n };\n\n function merge(hash, other) {\n for (var prop in other) {\n if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; }\n }\n }\n\n function isCurrent(currentHandlerInfos, handlerName) {\n return currentHandlerInfos[currentHandlerInfos.length - 1].name === handlerName;\n }\n\n /**\n @private\n\n This function is called the first time the `collectObjects`\n function encounters a promise while converting URL parameters\n into objects.\n\n It triggers the `enter` and `setup` methods on the `loading`\n handler.\n\n @param {Router} router\n */\n function loading(router) {\n if (!router.isLoading) {\n router.isLoading = true;\n var handler = router.getHandler('loading');\n\n if (handler) {\n if (handler.enter) { handler.enter(); }\n if (handler.setup) { handler.setup(); }\n if (handler.setupTemplate) { handler.setupTemplate(); }\n }\n }\n }\n\n /**\n @private\n\n This function is called if a promise was previously\n encountered once all promises are resolved.\n\n It triggers the `exit` method on the `loading` handler.\n\n @param {Router} router\n */\n function loaded(router) {\n router.isLoading = false;\n var handler = router.getHandler('loading');\n if (handler && handler.exit) { handler.exit(); }\n }\n\n /**\n @private\n\n This function is called if any encountered promise\n is rejected.\n\n It triggers the `exit` method on the `loading` handler,\n the `enter` method on the `failure` handler, and the\n `setup` method on the `failure` handler with the\n `error`.\n\n @param {Router} router\n @param {Object} error the reason for the promise\n rejection, to pass into the failure handler's\n `setup` method.\n */\n function failure(router, error) {\n loaded(router);\n var handler = router.getHandler('failure');\n if (handler){\n if (handler.enter) { handler.enter(); }\n if (handler.setup) { handler.setup(error); }\n if (handler.setupTemplate) { handler.setupTemplate(error); }\n }\n }\n\n /**\n @private\n */\n function doTransition(router, name, method, args) {\n var output = router._paramsForHandler(name, args, true);\n var params = output.params, toSetup = output.toSetup;\n\n var url = router.recognizer.generate(name, params);\n method.call(router, url);\n\n setupContexts(router, toSetup);\n }\n\n /**\n @private\n\n This function is called after a URL change has been handled\n by `router.handleURL`.\n\n Takes an Array of `RecognizedHandler`s, and converts the raw\n params hashes into deserialized objects by calling deserialize\n on the handlers. This process builds up an Array of\n `HandlerInfo`s. It then calls `setupContexts` with the Array.\n\n If the `deserialize` method on a handler returns a promise\n (i.e. has a method called `then`), this function will pause\n building up the `HandlerInfo` Array until the promise is\n resolved. It will use the resolved value as the context of\n `HandlerInfo`.\n */\n function collectObjects(router, results, index, objects) {\n if (results.length === index) {\n var lastObject = objects[objects.length - 1],\n lastHandler = lastObject && lastObject.handler;\n\n if (lastHandler && lastHandler.additionalHandler) {\n var additionalResult = {\n handler: lastHandler.additionalHandler(),\n params: {},\n isDynamic: false\n };\n results.push(additionalResult);\n } else {\n loaded(router);\n setupContexts(router, objects);\n return;\n }\n }\n\n var result = results[index];\n var handler = router.getHandler(result.handler);\n var object = handler.deserialize && handler.deserialize(result.params);\n\n if (object && typeof object.then === 'function') {\n loading(router);\n\n // The chained `then` means that we can also catch errors that happen in `proceed`\n object.then(proceed).then(null, function(error) {\n failure(router, error);\n });\n } else {\n proceed(object);\n }\n\n function proceed(value) {\n if (handler.context !== object) {\n setContext(handler, object);\n }\n\n var updatedObjects = objects.concat([{\n context: value,\n name: result.handler,\n handler: router.getHandler(result.handler),\n isDynamic: result.isDynamic\n }]);\n collectObjects(router, results, index + 1, updatedObjects);\n }\n }\n\n /**\n @private\n\n Takes an Array of `HandlerInfo`s, figures out which ones are\n exiting, entering, or changing contexts, and calls the\n proper handler hooks.\n\n For example, consider the following tree of handlers. Each handler is\n followed by the URL segment it handles.\n\n ```\n |~index (\"/\")\n | |~posts (\"/posts\")\n | | |-showPost (\"/:id\")\n | | |-newPost (\"/new\")\n | | |-editPost (\"/edit\")\n | |~about (\"/about/:id\")\n ```\n\n Consider the following transitions:\n\n 1. A URL transition to `/posts/1`.\n 1. Triggers the `deserialize` callback on the\n `index`, `posts`, and `showPost` handlers\n 2. Triggers the `enter` callback on the same\n 3. Triggers the `setup` callback on the same\n 2. A direct transition to `newPost`\n 1. Triggers the `exit` callback on `showPost`\n 2. Triggers the `enter` callback on `newPost`\n 3. Triggers the `setup` callback on `newPost`\n 3. A direct transition to `about` with a specified\n context object\n 1. Triggers the `exit` callback on `newPost`\n and `posts`\n 2. Triggers the `serialize` callback on `about`\n 3. Triggers the `enter` callback on `about`\n 4. Triggers the `setup` callback on `about`\n\n @param {Router} router\n @param {Array[HandlerInfo]} handlerInfos\n */\n function setupContexts(router, handlerInfos) {\n var partition =\n partitionHandlers(router.currentHandlerInfos || [], handlerInfos);\n\n router.targetHandlerInfos = handlerInfos;\n\n eachHandler(partition.exited, function(handler, context, handlerInfo) {\n delete handler.context;\n if (handler.exit) { handler.exit(); }\n });\n\n var currentHandlerInfos = partition.unchanged.slice();\n router.currentHandlerInfos = currentHandlerInfos;\n\n eachHandler(partition.updatedContext, function(handler, context, handlerInfo) {\n setContext(handler, context);\n if (handler.setup) { handler.setup(context); }\n currentHandlerInfos.push(handlerInfo);\n });\n\n var aborted = false;\n eachHandler(partition.entered, function(handler, context, handlerInfo) {\n if (aborted) { return; }\n if (handler.enter) { handler.enter(); }\n\n setContext(handler, context);\n\n if (handler.setup) {\n if (false === handler.setup(context)) {\n aborted = true;\n }\n }\n if (!aborted) {\n if (handler.setupTemplate) {\n handler.setupTemplate(context);\n }\n currentHandlerInfos.push(handlerInfo);\n\t}\n });\n\n if (!aborted && router.didTransition) {\n router.didTransition(handlerInfos);\n }\n }\n\n /**\n @private\n\n Iterates over an array of `HandlerInfo`s, passing the handler\n and context into the callback.\n\n @param {Array[HandlerInfo]} handlerInfos\n @param {Function(Object, Object)} callback\n */\n function eachHandler(handlerInfos, callback) {\n for (var i=0, l=handlerInfos.length; i=0; i--) {\n var handlerInfo = currentHandlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler.events && handler.events[name]) {\n handler.events[name].apply(handler, args);\n return;\n }\n }\n\n throw new Error(\"Nothing handled the event '\" + name + \"'.\");\n }\n\n function setContext(handler, context) {\n handler.context = context;\n if (handler.contextDidChange) { handler.contextDidChange(); }\n }\n return Router;\n });\n\n})();\n//@ sourceURL=ember-routing/vendor/router");minispade.register('ember-runtime/controllers', "(function() {minispade.require('ember-runtime/controllers/array_controller');\nminispade.require('ember-runtime/controllers/object_controller');\nminispade.require('ember-runtime/controllers/controller');\n\n})();\n//@ sourceURL=ember-runtime/controllers");minispade.register('ember-runtime/controllers/array_controller', "(function() {minispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/controllers/controller');\nminispade.require('ember-runtime/mixins/sortable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach,\n replace = Ember.EnumerableUtils.replace;\n\n/**\n `Ember.ArrayController` provides a way for you to publish a collection of\n objects so that you can easily bind to the collection from a Handlebars\n `#each` helper, an `Ember.CollectionView`, or other controllers.\n\n The advantage of using an `ArrayController` is that you only have to set up\n your view bindings once; to change what's displayed, simply swap out the\n `content` property on the controller.\n\n For example, imagine you wanted to display a list of items fetched via an XHR\n request. Create an `Ember.ArrayController` and set its `content` property:\n\n ```javascript\n MyApp.listController = Ember.ArrayController.create();\n\n $.get('people.json', function(data) {\n MyApp.listController.set('content', data);\n });\n ```\n\n Then, create a view that binds to your new controller:\n\n ```handlebars\n {{#each MyApp.listController}}\n {{firstName}} {{lastName}}\n {{/each}}\n ```\n\n Although you are binding to the controller, the behavior of this controller\n is to pass through any methods or properties to the underlying array. This\n capability comes from `Ember.ArrayProxy`, which this class inherits from.\n\n Sometimes you want to display computed properties within the body of an\n `#each` helper that depend on the underlying items in `content`, but are not\n present on those items. To do this, set `itemController` to the name of a\n controller (probably an `ObjectController`) that will wrap each individual item.\n\n For example:\n\n ```handlebars\n {{#each post in controller}}\n
  • {{title}} ({{titleLength}} characters)
  • \n {{/each}}\n ```\n\n ```javascript\n App.PostsController = Ember.ArrayController.extend({\n itemController: 'post'\n });\n\n App.PostController = Ember.ObjectController.extend({\n // the `title` property will be proxied to the underlying post.\n\n titleLength: function() {\n return this.get('title').length;\n }.property('title')\n });\n ```\n\n In some cases it is helpful to return a different `itemController` depending\n on the particular item. Subclasses can do this by overriding\n `lookupItemController`.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @class ArrayController\n @namespace Ember\n @extends Ember.ArrayProxy\n @uses Ember.SortableMixin\n @uses Ember.ControllerMixin\n*/\n\nEmber.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,\n Ember.SortableMixin, {\n\n /**\n The controller used to wrap items, if any.\n\n @property itemController\n @type String\n @default null\n */\n itemController: null,\n\n /**\n Return the name of the controller to wrap items, or `null` if items should\n be returned directly. The default implementation simply returns the\n `itemController` property, but subclasses can override this method to return\n different controllers for different objects.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @method lookupItemController\n @param {Object} object\n @return {String}\n */\n lookupItemController: function(object) {\n return get(this, 'itemController');\n },\n\n objectAtContent: function(idx) {\n var length = get(this, 'length'),\n arrangedContent = get(this,'arrangedContent'),\n object = arrangedContent && arrangedContent.objectAt(idx);\n\n if (idx >= 0 && idx < length) {\n var controllerClass = this.lookupItemController(object);\n if (controllerClass) {\n return this.controllerAt(idx, object, controllerClass);\n }\n }\n\n // When `controllerClass` is falsy, we have not opted in to using item\n // controllers, so return the object directly.\n\n // When the index is out of range, we want to return the \"out of range\"\n // value, whatever that might be. Rather than make assumptions\n // (e.g. guessing `null` or `undefined`) we defer this to `arrangedContent`.\n return object;\n },\n\n arrangedContentDidChange: function() {\n this._super();\n this._resetSubControllers();\n },\n\n arrayContentDidChange: function(idx, removedCnt, addedCnt) {\n var subControllers = get(this, '_subControllers'),\n subControllersToRemove = subControllers.slice(idx, idx+removedCnt);\n\n forEach(subControllersToRemove, function(subController) {\n if (subController) { subController.destroy(); }\n });\n\n replace(subControllers, idx, removedCnt, new Array(addedCnt));\n\n // The shadow array of subcontrollers must be updated before we trigger\n // observers, otherwise observers will get the wrong subcontainer when\n // calling `objectAt`\n this._super(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n if (!this.get('content')) { Ember.defineProperty(this, 'content', undefined, Ember.A()); }\n this._super();\n this.set('_subControllers', Ember.A());\n },\n\n controllerAt: function(idx, object, controllerClass) {\n var container = get(this, 'container'),\n subControllers = get(this, '_subControllers'),\n subController = subControllers[idx];\n\n if (!subController) {\n subController = container.lookup(\"controller:\" + controllerClass, { singleton: false });\n subControllers[idx] = subController;\n }\n\n if (!subController) {\n throw new Error('Could not resolve itemController: \"' + controllerClass + '\"');\n }\n\n subController.set('target', this);\n subController.set('content', object);\n\n return subController;\n },\n\n _subControllers: null,\n\n _resetSubControllers: function() {\n var subControllers = get(this, '_subControllers');\n if (subControllers) {\n forEach(subControllers, function(subController) {\n if (subController) { subController.destroy(); }\n });\n }\n\n this.set('_subControllers', Ember.A());\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/controllers/array_controller");minispade.register('ember-runtime/controllers/controller', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/string');\n\nvar get = Ember.get;\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ControllerMixin` provides a standard interface for all classes that\n compose Ember's controller layer: `Ember.Controller`,\n `Ember.ArrayController`, and `Ember.ObjectController`.\n\n Within an `Ember.Router`-managed application single shared instaces of every\n Controller object in your application's namespace will be added to the\n application's `Ember.Router` instance. See `Ember.Application#initialize`\n for additional information.\n\n ## Views\n\n By default a controller instance will be the rendering context\n for its associated `Ember.View.` This connection is made during calls to\n `Ember.ControllerMixin#connectOutlet`.\n\n Within the view's template, the `Ember.View` instance can be accessed\n through the controller with `{{view}}`.\n\n ## Target Forwarding\n\n By default a controller will target your application's `Ember.Router`\n instance. Calls to `{{action}}` within the template of a controller's view\n are forwarded to the router. See `Ember.Handlebars.helpers.action` for\n additional information.\n\n @class ControllerMixin\n @namespace Ember\n @extends Ember.Mixin\n*/\nEmber.ControllerMixin = Ember.Mixin.create({\n /* ducktype as a controller */\n isController: true,\n\n /**\n The object to which events from the view should be sent.\n\n For example, when a Handlebars template uses the `{{action}}` helper,\n it will attempt to send the event to the view's controller's `target`.\n\n By default, a controller's `target` is set to the router after it is\n instantiated by `Ember.Application#initialize`.\n\n @property target\n @default null\n */\n target: null,\n\n container: null,\n\n store: null,\n\n model: Ember.computed.alias('content'),\n\n send: function(actionName) {\n var args = [].slice.call(arguments, 1), target;\n\n if (this[actionName]) {\n Ember.assert(\"The controller \" + this + \" does not have the action \" + actionName, typeof this[actionName] === 'function');\n this[actionName].apply(this, args);\n } else if(target = get(this, 'target')) {\n Ember.assert(\"The target for controller \" + this + \" (\" + target + \") did not define a `send` method\", typeof target.send === 'function');\n target.send.apply(target, arguments);\n }\n }\n});\n\n/**\n @class Controller\n @namespace Ember\n @extends Ember.Object\n @uses Ember.ControllerMixin\n*/\nEmber.Controller = Ember.Object.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/controller");minispade.register('ember-runtime/controllers/object_controller', "(function() {minispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/controllers/controller');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ObjectController` is part of Ember's Controller layer. A single shared\n instance of each `Ember.ObjectController` subclass in your application's\n namespace will be created at application initialization and be stored on your\n application's `Ember.Router` instance.\n\n `Ember.ObjectController` derives its functionality from its superclass\n `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin.\n\n @class ObjectController\n @namespace Ember\n @extends Ember.ObjectProxy\n @uses Ember.ControllerMixin\n**/\nEmber.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/object_controller");minispade.register('ember-runtime/core', "(function() {/*globals ENV */\nminispade.require('ember-metal');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar indexOf = Ember.EnumerableUtils.indexOf;\n\n/**\n This will compare two javascript values of possibly different types.\n It will tell you which one is greater than the other by returning:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n The order is calculated based on `Ember.ORDER_DEFINITION`, if types are different.\n In case they have the same type an appropriate comparison for this type is made.\n\n ```javascript\n Ember.compare('hello', 'hello'); // 0\n Ember.compare('abc', 'dfg'); // -1\n Ember.compare(2, 1); // 1\n ```\n\n @method compare\n @for Ember\n @param {Object} v First value to compare\n @param {Object} w Second value to compare\n @return {Number} -1 if v < w, 0 if v = w and 1 if v > w.\n*/\nEmber.compare = function compare(v, w) {\n if (v === w) { return 0; }\n\n var type1 = Ember.typeOf(v);\n var type2 = Ember.typeOf(w);\n\n var Comparable = Ember.Comparable;\n if (Comparable) {\n if (type1==='instance' && Comparable.detect(v.constructor)) {\n return v.constructor.compare(v, w);\n }\n\n if (type2 === 'instance' && Comparable.detect(w.constructor)) {\n return 1-w.constructor.compare(w, v);\n }\n }\n\n // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION,\n // do so now.\n var mapping = Ember.ORDER_DEFINITION_MAPPING;\n if (!mapping) {\n var order = Ember.ORDER_DEFINITION;\n mapping = Ember.ORDER_DEFINITION_MAPPING = {};\n var idx, len;\n for (idx = 0, len = order.length; idx < len; ++idx) {\n mapping[order[idx]] = idx;\n }\n\n // We no longer need Ember.ORDER_DEFINITION.\n delete Ember.ORDER_DEFINITION;\n }\n\n var type1Index = mapping[type1];\n var type2Index = mapping[type2];\n\n if (type1Index < type2Index) { return -1; }\n if (type1Index > type2Index) { return 1; }\n\n // types are equal - so we have to check values now\n switch (type1) {\n case 'boolean':\n case 'number':\n if (v < w) { return -1; }\n if (v > w) { return 1; }\n return 0;\n\n case 'string':\n var comp = v.localeCompare(w);\n if (comp < 0) { return -1; }\n if (comp > 0) { return 1; }\n return 0;\n\n case 'array':\n var vLen = v.length;\n var wLen = w.length;\n var l = Math.min(vLen, wLen);\n var r = 0;\n var i = 0;\n while (r === 0 && i < l) {\n r = compare(v[i],w[i]);\n i++;\n }\n if (r !== 0) { return r; }\n\n // all elements are equal now\n // shorter array should be ordered first\n if (vLen < wLen) { return -1; }\n if (vLen > wLen) { return 1; }\n // arrays are equal now\n return 0;\n\n case 'instance':\n if (Ember.Comparable && Ember.Comparable.detect(v)) {\n return v.compare(v, w);\n }\n return 0;\n\n case 'date':\n var vNum = v.getTime();\n var wNum = w.getTime();\n if (vNum < wNum) { return -1; }\n if (vNum > wNum) { return 1; }\n return 0;\n\n default:\n return 0;\n }\n};\n\nfunction _copy(obj, deep, seen, copies) {\n var ret, loc, key;\n\n // primitive data types are immutable, just return them.\n if ('object' !== typeof obj || obj===null) return obj;\n\n // avoid cyclical loops\n if (deep && (loc=indexOf(seen, obj))>=0) return copies[loc];\n\n Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof Ember.Object) || (Ember.Copyable && Ember.Copyable.detect(obj)));\n\n // IMPORTANT: this specific test will detect a native array only. Any other\n // object will need to implement Copyable.\n if (Ember.typeOf(obj) === 'array') {\n ret = obj.slice();\n if (deep) {\n loc = ret.length;\n while(--loc>=0) ret[loc] = _copy(ret[loc], deep, seen, copies);\n }\n } else if (Ember.Copyable && Ember.Copyable.detect(obj)) {\n ret = obj.copy(deep, seen, copies);\n } else {\n ret = {};\n for(key in obj) {\n if (!obj.hasOwnProperty(key)) continue;\n\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') continue;\n\n ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];\n }\n }\n\n if (deep) {\n seen.push(obj);\n copies.push(ret);\n }\n\n return ret;\n}\n\n/**\n Creates a clone of the passed object. This function can take just about\n any type of object and create a clone of it, including primitive values\n (which are not actually cloned because they are immutable).\n\n If the passed object implements the `clone()` method, then this function\n will simply call that method and return the result.\n\n @method copy\n @for Ember\n @param {Object} obj The object to clone\n @param {Boolean} deep If true, a deep copy of the object is made\n @return {Object} The cloned object\n*/\nEmber.copy = function(obj, deep) {\n // fast paths\n if ('object' !== typeof obj || obj===null) return obj; // can't copy primitives\n if (Ember.Copyable && Ember.Copyable.detect(obj)) return obj.copy(deep);\n return _copy(obj, deep, deep ? [] : null, deep ? [] : null);\n};\n\n/**\n Convenience method to inspect an object. This method will attempt to\n convert the object into a useful string description.\n\n It is a pretty simple implementation. If you want something more robust,\n use something like JSDump: https://github.com/NV/jsDump\n\n @method inspect\n @for Ember\n @param {Object} obj The object you want to inspect.\n @return {String} A description of the object\n*/\nEmber.inspect = function(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj + '';\n }\n\n var v, ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) {\n v = obj[key];\n if (v === 'toString') { continue; } // ignore useless items\n if (Ember.typeOf(v) === 'function') { v = \"function() { ... }\"; }\n ret.push(key + \": \" + v);\n }\n }\n return \"{\" + ret.join(\", \") + \"}\";\n};\n\n/**\n Compares two objects, returning true if they are logically equal. This is\n a deeper comparison than a simple triple equal. For sets it will compare the\n internal objects. For any other object that implements `isEqual()` it will\n respect that method.\n\n ```javascript\n Ember.isEqual('hello', 'hello'); // true\n Ember.isEqual(1, 2); // false\n Ember.isEqual([4,2], [4,2]); // false\n ```\n\n @method isEqual\n @for Ember\n @param {Object} a first object to compare\n @param {Object} b second object to compare\n @return {Boolean}\n*/\nEmber.isEqual = function(a, b) {\n if (a && 'function'===typeof a.isEqual) return a.isEqual(b);\n return a === b;\n};\n\n// Used by Ember.compare\nEmber.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [\n 'undefined',\n 'null',\n 'boolean',\n 'number',\n 'string',\n 'array',\n 'object',\n 'instance',\n 'function',\n 'class',\n 'date'\n];\n\n/**\n Returns all of the keys defined on an object or hash. This is useful\n when inspecting objects for debugging. On browsers that support it, this\n uses the native `Object.keys` implementation.\n\n @method keys\n @for Ember\n @param {Object} obj\n @return {Array} Array containing keys of obj\n*/\nEmber.keys = Object.keys;\n\nif (!Ember.keys) {\n Ember.keys = function(obj) {\n var ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) { ret.push(key); }\n }\n return ret;\n };\n}\n\n// ..........................................................\n// ERROR\n//\n\nvar errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];\n\n/**\n A subclass of the JavaScript Error object for use in Ember.\n\n @class Error\n @namespace Ember\n @extends Error\n @constructor\n*/\nEmber.Error = function() {\n var tmp = Error.prototype.constructor.apply(this, arguments);\n\n // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n for (var idx = 0; idx < errorProps.length; idx++) {\n this[errorProps[idx]] = tmp[errorProps[idx]];\n }\n};\n\nEmber.Error.prototype = Ember.create(Error.prototype);\n\n})();\n//@ sourceURL=ember-runtime/core");minispade.register('ember-runtime/ext', "(function() {minispade.require('ember-runtime/ext/ember');\nminispade.require('ember-runtime/ext/string');\nminispade.require('ember-runtime/ext/function');\n\n})();\n//@ sourceURL=ember-runtime/ext");minispade.register('ember-runtime/ext/ember', "(function() {/**\n Expose RSVP implementation\n\n @class RSVP\n @namespace Ember\n @constructor\n*/\nEmber.RSVP = requireModule('rsvp');\n\n})();\n//@ sourceURL=ember-runtime/ext/ember");minispade.register('ember-runtime/ext/function', "(function() {minispade.require('ember-runtime/core');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar a_slice = Array.prototype.slice;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {\n\n /**\n The `property` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n `true`, which is the default.\n\n Computed properties allow you to treat a function like a property:\n\n ```javascript\n MyApp.president = Ember.Object.create({\n firstName: \"Barack\",\n lastName: \"Obama\",\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Call this flag to mark the function as a property\n }.property()\n });\n\n MyApp.president.get('fullName'); // \"Barack Obama\"\n ```\n\n Treating a function like a property is useful because they can work with\n bindings, just like any other property.\n\n Many computed properties have dependencies on other properties. For\n example, in the above example, the `fullName` property depends on\n `firstName` and `lastName` to determine its value. You can tell Ember\n about these dependencies like this:\n\n ```javascript\n MyApp.president = Ember.Object.create({\n firstName: \"Barack\",\n lastName: \"Obama\",\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember.js that this computed property depends on firstName\n // and lastName\n }.property('firstName', 'lastName')\n });\n ```\n\n Make sure you list these dependencies so Ember knows when to update\n bindings that connect to a computed property. Changing a dependency\n will not immediately trigger an update of the computed property, but\n will instead clear the cache so that it is updated when the next `get`\n is called on the property.\n\n See {{#crossLink \"Ember.ComputedProperty\"}}{{/crossLink}},\n {{#crossLink \"Ember/computed\"}}{{/crossLink}}\n\n @method property\n @for Function\n */\n Function.prototype.property = function() {\n var ret = Ember.computed(this);\n return ret.property.apply(ret, arguments);\n };\n\n /**\n The `observes` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.create({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n See {{#crossLink \"Ember.Observable/observes\"}}{{/crossLink}}\n\n @method observes\n @for Function\n */\n Function.prototype.observes = function() {\n this.__ember_observes__ = a_slice.call(arguments);\n return this;\n };\n\n /**\n The `observesBefore` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can get notified when a property changes is about to happen by\n by adding the `observesBefore` call to the end of your method\n declarations in classes that you write. For example:\n\n ```javascript\n Ember.Object.create({\n valueObserver: function() {\n // Executes whenever the \"value\" property is about to change\n }.observesBefore('value')\n });\n ```\n\n See {{#crossLink \"Ember.Observable/observesBefore\"}}{{/crossLink}}\n\n @method observesBefore\n @for Function\n */\n Function.prototype.observesBefore = function() {\n this.__ember_observesBefore__ = a_slice.call(arguments);\n return this;\n };\n\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/function");minispade.register('ember-runtime/ext/string', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar fmt = Ember.String.fmt,\n w = Ember.String.w,\n loc = Ember.String.loc,\n camelize = Ember.String.camelize,\n decamelize = Ember.String.decamelize,\n dasherize = Ember.String.dasherize,\n underscore = Ember.String.underscore,\n capitalize = Ember.String.capitalize,\n classify = Ember.String.classify;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n See {{#crossLink \"Ember.String/fmt\"}}{{/crossLink}}\n\n @method fmt\n @for String\n */\n String.prototype.fmt = function() {\n return fmt(this, arguments);\n };\n\n /**\n See {{#crossLink \"Ember.String/w\"}}{{/crossLink}}\n\n @method w\n @for String\n */\n String.prototype.w = function() {\n return w(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/loc\"}}{{/crossLink}}\n\n @method loc\n @for String\n */\n String.prototype.loc = function() {\n return loc(this, arguments);\n };\n\n /**\n See {{#crossLink \"Ember.String/camelize\"}}{{/crossLink}}\n\n @method camelize\n @for String\n */\n String.prototype.camelize = function() {\n return camelize(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/decamelize\"}}{{/crossLink}}\n\n @method decamelize\n @for String\n */\n String.prototype.decamelize = function() {\n return decamelize(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/dasherize\"}}{{/crossLink}}\n\n @method dasherize\n @for String\n */\n String.prototype.dasherize = function() {\n return dasherize(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/underscore\"}}{{/crossLink}}\n\n @method underscore\n @for String\n */\n String.prototype.underscore = function() {\n return underscore(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/classify\"}}{{/crossLink}}\n\n @method classify\n @for String\n */\n String.prototype.classify = function() {\n return classify(this);\n };\n\n /**\n See {{#crossLink \"Ember.String/capitalize\"}}{{/crossLink}}\n\n @method capitalize\n @for String\n */\n String.prototype.capitalize = function() {\n return capitalize(this);\n };\n\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/string");minispade.register('ember-runtime', "(function() {/**\nEmber Runtime\n\n@module ember\n@submodule ember-runtime\n@requires ember-metal\n*/\nminispade.require('container');\nminispade.require('ember-metal');\nminispade.require('ember-runtime/core');\nminispade.require('ember-runtime/ext');\nminispade.require('ember-runtime/mixins');\nminispade.require('ember-runtime/system');\nminispade.require('ember-runtime/controllers');\n\n})();\n//@ sourceURL=ember-runtime");minispade.register('ember-runtime/mixins', "(function() {minispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/comparable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/enumerable');\nminispade.require('ember-runtime/mixins/freezable');\nminispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/mixins/target_action_support');\nminispade.require('ember-runtime/mixins/evented');\nminispade.require('ember-runtime/mixins/deferred');\n\n})();\n//@ sourceURL=ember-runtime/mixins");minispade.register('ember-runtime/mixins/array', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set, isNone = Ember.isNone, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;\n\n// ..........................................................\n// ARRAY\n//\n/**\n This module implements Observer-friendly Array-like behavior. This mixin is\n picked up by the Array class as well as other controllers, etc. that want to\n appear to be arrays.\n\n Unlike `Ember.Enumerable,` this mixin defines methods specifically for\n collections that provide index-ordered access to their contents. When you\n are designing code that needs to accept any kind of Array-like object, you\n should use these methods instead of Array primitives because these will\n properly notify observers of changes to the array.\n\n Although these methods are efficient, they do add a layer of indirection to\n your application so it is a good idea to use them only when you need the\n flexibility of using both true JavaScript arrays and \"virtual\" arrays such\n as controllers and collections.\n\n You can use the methods defined in this module to access and modify array\n contents in a KVO-friendly way. You can also be notified whenever the\n membership if an array changes by changing the syntax of the property to\n `.observes('*myProperty.[]')`.\n\n To support `Ember.Array` in your own class, you must override two\n primitives to use it: `replace()` and `objectAt()`.\n\n Note that the Ember.Array mixin also incorporates the `Ember.Enumerable`\n mixin. All `Ember.Array`-like objects are also enumerable.\n\n @class Array\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.Enumerable\n @since Ember 0.9.0\n*/\nEmber.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.prototype */ {\n\n // compatibility\n isSCArray: true,\n\n /**\n Your array must support the `length` property. Your replace methods should\n set this property whenever it changes.\n\n @property {Number} length\n */\n length: Ember.required(),\n\n /**\n Returns the object at the given `index`. If the given `index` is negative\n or is greater or equal than the array length, returns `undefined`.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n If your object supports retrieving the value of an array item using `get()`\n (i.e. `myArray.get(0)`), then you do not need to implement this method\n yourself.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectAt(0); // \"a\"\n arr.objectAt(3); // \"d\"\n arr.objectAt(-1); // undefined\n arr.objectAt(4); // undefined\n arr.objectAt(5); // undefined\n ```\n\n @method objectAt\n @param {Number} idx The index of the item to return.\n @return {*} item at index or undefined\n */\n objectAt: function(idx) {\n if ((idx < 0) || (idx>=get(this, 'length'))) return undefined ;\n return get(this, idx);\n },\n\n /**\n This returns the objects at the specified indexes, using `objectAt`.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectsAt([0, 1, 2]); // [\"a\", \"b\", \"c\"]\n arr.objectsAt([2, 3, 4]); // [\"c\", \"d\", undefined]\n ```\n\n @method objectsAt\n @param {Array} indexes An array of indexes of items to return.\n @return {Array}\n */\n objectsAt: function(indexes) {\n var self = this;\n return map(indexes, function(idx){ return self.objectAt(idx); });\n },\n\n // overrides Ember.Enumerable version\n nextObject: function(idx) {\n return this.objectAt(idx);\n },\n\n /**\n This is the handler for the special array content property. If you get\n this property, it will return this. If you set this property it a new\n array, it will replace the current content.\n\n This property overrides the default property defined in `Ember.Enumerable`.\n\n @property []\n @return this\n */\n '[]': Ember.computed(function(key, value) {\n if (value !== undefined) this.replace(0, get(this, 'length'), value) ;\n return this ;\n }),\n\n firstObject: Ember.computed(function() {\n return this.objectAt(0);\n }),\n\n lastObject: Ember.computed(function() {\n return this.objectAt(get(this, 'length')-1);\n }),\n\n // optimized version from Enumerable\n contains: function(obj){\n return this.indexOf(obj) >= 0;\n },\n\n // Add any extra methods to Ember.Array that are native to the built-in Array.\n /**\n Returns a new array that is a slice of the receiver. This implementation\n uses the observable array methods to retrieve the objects for the new\n slice.\n\n ```javascript\n var arr = ['red', 'green', 'blue'];\n arr.slice(0); // ['red', 'green', 'blue']\n arr.slice(0, 2); // ['red', 'green']\n arr.slice(1, 100); // ['green', 'blue']\n ```\n\n @method slice\n @param {Integer} beginIndex (Optional) index to begin slicing from.\n @param {Integer} endIndex (Optional) index to end the slice at.\n @return {Array} New array with specified slice\n */\n slice: function(beginIndex, endIndex) {\n var ret = Ember.A([]);\n var length = get(this, 'length') ;\n if (isNone(beginIndex)) beginIndex = 0 ;\n if (isNone(endIndex) || (endIndex > length)) endIndex = length ;\n\n if (beginIndex < 0) beginIndex = length + beginIndex;\n if (endIndex < 0) endIndex = length + endIndex;\n\n while(beginIndex < endIndex) {\n ret[ret.length] = this.objectAt(beginIndex++) ;\n }\n return ret ;\n },\n\n /**\n Returns the index of the given object's first occurrence.\n If no `startAt` argument is given, the starting location to\n search is 0. If it's negative, will count backward from\n the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.indexOf(\"a\"); // 0\n arr.indexOf(\"z\"); // -1\n arr.indexOf(\"a\", 2); // 4\n arr.indexOf(\"a\", -1); // 4\n arr.indexOf(\"b\", 3); // -1\n arr.indexOf(\"a\", 100); // -1\n ```\n\n @method indexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n indexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined) startAt = 0;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx= len) startAt = len-1;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this.objectAt(idx) === object) return idx ;\n }\n return -1;\n },\n\n // ..........................................................\n // ARRAY OBSERVERS\n //\n\n /**\n Adds an array observer to the receiving array. The array observer object\n normally must implement two methods:\n\n * `arrayWillChange(start, removeCount, addCount)` - This method will be\n called just before the array is modified.\n * `arrayDidChange(start, removeCount, addCount)` - This method will be\n called just after the array is modified.\n\n Both callbacks will be passed the starting index of the change as well a\n a count of the items to be removed and added. You can use these callbacks\n to optionally inspect the array during the change, clear caches, or do\n any other bookkeeping necessary.\n\n In addition to passing a target, you can also include an options hash\n which you can use to override the method names that will be invoked on the\n target.\n\n @method addArrayObserver\n @param {Object} target The observer object.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n addArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.addListener(this, '@array:before', target, willChange);\n Ember.addListener(this, '@array:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Removes an array observer from the object if the observer is current\n registered. Calling this method multiple times with the same object will\n have no effect.\n\n @method removeArrayObserver\n @param {Object} target The object observing the array.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n removeArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.removeListener(this, '@array:before', target, willChange);\n Ember.removeListener(this, '@array:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property Boolean\n */\n hasArrayObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@array:change') || Ember.hasListeners(this, '@array:before');\n }),\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just before the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentWillChange\n @param {Number} startIdx The starting index in the array that will change.\n @param {Number} removeAmt The number of items that will be removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that will be added. If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentWillChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n // Make sure the @each proxy is set up if anyone is observing @each\n if (Ember.isWatching(this, '@each')) { get(this, '@each'); }\n\n Ember.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);\n\n var removing, lim;\n if (startIdx>=0 && removeAmt>=0 && get(this, 'hasEnumerableObservers')) {\n removing = [];\n lim = startIdx+removeAmt;\n for(var idx=startIdx;idx=0 && addAmt>=0 && get(this, 'hasEnumerableObservers')) {\n adding = [];\n lim = startIdx+addAmt;\n for(var idx=startIdx;idx b`\n\n Default implementation raises an exception.\n\n @method compare\n @param a {Object} the first object to compare\n @param b {Object} the second object to compare\n @return {Integer} the result of the comparison\n */\n compare: Ember.required(Function)\n\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/comparable");minispade.register('ember-runtime/mixins/copyable', "(function() {minispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Implements some standard methods for copying an object. Add this mixin to\n any object you create that can create a copy of itself. This mixin is\n added automatically to the built-in array.\n\n You should generally implement the `copy()` method to return a copy of the\n receiver.\n\n Note that `frozenCopy()` will only work if you also implement\n `Ember.Freezable`.\n\n @class Copyable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Copyable = Ember.Mixin.create(\n/** @scope Ember.Copyable.prototype */ {\n\n /**\n Override to return a copy of the receiver. Default implementation raises\n an exception.\n\n @method copy\n @param {Boolean} deep if `true`, a deep copy of the object should be made\n @return {Object} copy of receiver\n */\n copy: Ember.required(Function),\n\n /**\n If the object implements `Ember.Freezable`, then this will return a new\n copy if the object is not frozen and the receiver if the object is frozen.\n\n Raises an exception if you try to call this method on a object that does\n not support freezing.\n\n You should use this method whenever you want a copy of a freezable object\n since a freezable object can simply return itself without actually\n consuming more memory.\n\n @method frozenCopy\n @return {Object} copy of receiver or receiver\n */\n frozenCopy: function() {\n if (Ember.Freezable && Ember.Freezable.detect(this)) {\n return get(this, 'isFrozen') ? this : this.copy().freeze();\n } else {\n throw new Error(Ember.String.fmt(\"%@ does not support freezing\", [this]));\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/copyable");minispade.register('ember-runtime/mixins/deferred', "(function() {var RSVP = requireModule(\"rsvp\");\n\nRSVP.configure('async', function(callback, binding) {\n Ember.run.schedule('actions', binding, callback);\n});\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get;\n\n/**\n @class Deferred\n @namespace Ember\n @extends Ember.Mixin\n */\nEmber.DeferredMixin = Ember.Mixin.create({\n /**\n Add handlers to be called when the Deferred object is resolved or rejected.\n\n @method then\n @param {Function} doneCallback a callback function to be called when done\n @param {Function} failCallback a callback function to be called when failed\n */\n then: function(resolve, reject) {\n var deferred, promise, entity;\n\n entity = this;\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n return promise.then(function(fulfillment) {\n if (fulfillment === promise) {\n return resolve(entity);\n } else {\n return resolve(fulfillment);\n }\n }, function(reason) {\n if (reason === promise) {\n return reject(entity);\n } else {\n return reject(reason);\n }\n });\n },\n\n /**\n Resolve a Deferred object and call any `doneCallbacks` with the given args.\n\n @method resolve\n */\n resolve: function(value) {\n var deferred, promise;\n\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n if (value === this){\n deferred.resolve(promise);\n } else {\n deferred.resolve(value);\n }\n },\n\n /**\n Reject a Deferred object and call any `failCallbacks` with the given args.\n\n @method reject\n */\n reject: function(value) {\n get(this, '_deferred').reject(value);\n },\n\n _deferred: Ember.computed(function() {\n return RSVP.defer();\n })\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/deferred");minispade.register('ember-runtime/mixins/enumerable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\nvar a_slice = Array.prototype.slice;\nvar a_indexOf = Ember.EnumerableUtils.indexOf;\n\nvar contexts = [];\n\nfunction popCtx() {\n return contexts.length===0 ? {} : contexts.pop();\n}\n\nfunction pushCtx(ctx) {\n contexts.push(ctx);\n return null;\n}\n\nfunction iter(key, value) {\n var valueProvided = arguments.length === 2;\n\n function i(item) {\n var cur = get(item, key);\n return valueProvided ? value===cur : !!cur;\n }\n return i ;\n}\n\n/**\n This mixin defines the common interface implemented by enumerable objects\n in Ember. Most of these methods follow the standard Array iteration\n API defined up to JavaScript 1.8 (excluding language-specific features that\n cannot be emulated in older versions of JavaScript).\n\n This mixin is applied automatically to the Array class on page load, so you\n can use any of these methods on simple arrays. If Array already implements\n one of these methods, the mixin will not override them.\n\n ## Writing Your Own Enumerable\n\n To make your own custom class enumerable, you need two items:\n\n 1. You must have a length property. This property should change whenever\n the number of items in your enumerable object changes. If you using this\n with an `Ember.Object` subclass, you should be sure to change the length\n property using `set().`\n\n 2. If you must implement `nextObject().` See documentation.\n\n Once you have these two methods implement, apply the `Ember.Enumerable` mixin\n to your class and you will be able to enumerate the contents of your object\n like any other collection.\n\n ## Using Ember Enumeration with Other Libraries\n\n Many other libraries provide some kind of iterator or enumeration like\n facility. This is often where the most common API conflicts occur.\n Ember's API is designed to be as friendly as possible with other\n libraries by implementing only methods that mostly correspond to the\n JavaScript 1.8 API.\n\n @class Enumerable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Enumerable = Ember.Mixin.create({\n\n // compatibility\n isEnumerable: true,\n\n /**\n Implement this method to make your class enumerable.\n\n This method will be call repeatedly during enumeration. The index value\n will always begin with 0 and increment monotonically. You don't have to\n rely on the index value to determine what object to return, but you should\n always check the value and start from the beginning when you see the\n requested index is 0.\n\n The `previousObject` is the object that was returned from the last call\n to `nextObject` for the current iteration. This is a useful way to\n manage iteration if you are tracing a linked list, for example.\n\n Finally the context parameter will always contain a hash you can use as\n a \"scratchpad\" to maintain any other state you need in order to iterate\n properly. The context object is reused and is not reset between\n iterations so make sure you setup the context with a fresh state whenever\n the index parameter is 0.\n\n Generally iterators will continue to call `nextObject` until the index\n reaches the your current length-1. If you run out of data before this\n time for some reason, you should simply return undefined.\n\n The default implementation of this method simply looks up the index.\n This works great on any Array-like objects.\n\n @method nextObject\n @param {Number} index the current index of the iteration\n @param {Object} previousObject the value returned by the last call to\n `nextObject`.\n @param {Object} context a context object you can use to maintain state.\n @return {Object} the next object in the iteration or undefined\n */\n nextObject: Ember.required(Function),\n\n /**\n Helper method returns the first object from a collection. This is usually\n used by bindings and other parts of the framework to extract a single\n object if the enumerable contains only one item.\n\n If you override this method, you should implement it so that it will\n always return the same value each time it is called. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('firstObject'); // \"a\"\n\n var arr = [];\n arr.get('firstObject'); // undefined\n ```\n\n @property firstObject\n @return {Object} the object or undefined\n */\n firstObject: Ember.computed(function() {\n if (get(this, 'length')===0) return undefined ;\n\n // handle generic enumerables\n var context = popCtx(), ret;\n ret = this.nextObject(0, null, context);\n pushCtx(context);\n return ret ;\n }).property('[]'),\n\n /**\n Helper method returns the last object from a collection. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('lastObject'); // \"c\"\n\n var arr = [];\n arr.get('lastObject'); // undefined\n ```\n\n @property lastObject\n @return {Object} the last object or undefined\n */\n lastObject: Ember.computed(function() {\n var len = get(this, 'length');\n if (len===0) return undefined ;\n var context = popCtx(), idx=0, cur, last = null;\n do {\n last = cur;\n cur = this.nextObject(idx++, last, context);\n } while (cur !== undefined);\n pushCtx(context);\n return last;\n }).property('[]'),\n\n /**\n Returns `true` if the passed object can be found in the receiver. The\n default version will iterate through the enumerable until the object\n is found. You may want to override this with a more efficient version.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.contains(\"a\"); // true\n arr.contains(\"z\"); // false\n ```\n\n @method contains\n @param {Object} obj The object to search for.\n @return {Boolean} `true` if object is found in enumerable.\n */\n contains: function(obj) {\n return this.find(function(item) { return item===obj; }) !== undefined;\n },\n\n /**\n Iterates through the enumerable, calling the passed function on each\n item. This method corresponds to the `forEach()` method defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method forEach\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} receiver\n */\n forEach: function(callback, target) {\n if (typeof callback !== \"function\") throw new TypeError() ;\n var len = get(this, 'length'), last = null, context = popCtx();\n\n if (target === undefined) target = null;\n\n for(var idx=0;idx1) args = a_slice.call(arguments, 1);\n\n this.forEach(function(x, idx) {\n var method = x && x[methodName];\n if ('function' === typeof method) {\n ret[idx] = args ? method.apply(x, args) : method.call(x);\n }\n }, this);\n\n return ret;\n },\n\n /**\n Simply converts the enumerable into a genuine array. The order is not\n guaranteed. Corresponds to the method implemented by Prototype.\n\n @method toArray\n @return {Array} the enumerable as an array.\n */\n toArray: function() {\n var ret = Ember.A([]);\n this.forEach(function(o, idx) { ret[idx] = o; });\n return ret ;\n },\n\n /**\n Returns a copy of the array with all null and undefined elements removed.\n\n ```javascript\n var arr = [\"a\", null, \"c\", undefined];\n arr.compact(); // [\"a\", \"c\"]\n ```\n\n @method compact\n @return {Array} the array without null and undefined elements.\n */\n compact: function() {\n return this.filter(function(value) { return value != null; });\n },\n\n /**\n Returns a new enumerable that excludes the passed value. The default\n implementation returns an array regardless of the receiver type unless\n the receiver does not contain the value.\n\n ```javascript\n var arr = [\"a\", \"b\", \"a\", \"c\"];\n arr.without(\"a\"); // [\"b\", \"c\"]\n ```\n\n @method without\n @param {Object} value\n @return {Ember.Enumerable}\n */\n without: function(value) {\n if (!this.contains(value)) return this; // nothing to do\n var ret = Ember.A([]);\n this.forEach(function(k) {\n if (k !== value) ret[ret.length] = k;\n }) ;\n return ret ;\n },\n\n /**\n Returns a new enumerable that contains only unique values. The default\n implementation returns an array regardless of the receiver type.\n\n ```javascript\n var arr = [\"a\", \"a\", \"b\", \"b\"];\n arr.uniq(); // [\"a\", \"b\"]\n ```\n\n @method uniq\n @return {Ember.Enumerable}\n */\n uniq: function() {\n var ret = Ember.A([]);\n this.forEach(function(k){\n if (a_indexOf(ret, k)<0) ret.push(k);\n });\n return ret;\n },\n\n /**\n This property will trigger anytime the enumerable's content changes.\n You can observe this property to be notified of changes to the enumerables\n content.\n\n For plain enumerables, this property is read only. `Ember.Array` overrides\n this method.\n\n @property []\n @type Ember.Array\n @return this\n */\n '[]': Ember.computed(function(key, value) {\n return this;\n }),\n\n // ..........................................................\n // ENUMERABLE OBSERVERS\n //\n\n /**\n Registers an enumerable observer. Must implement `Ember.EnumerableObserver`\n mixin.\n\n @method addEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n addEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.addListener(this, '@enumerable:before', target, willChange);\n Ember.addListener(this, '@enumerable:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Removes a registered enumerable observer.\n\n @method removeEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n removeEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.removeListener(this, '@enumerable:before', target, willChange);\n Ember.removeListener(this, '@enumerable:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property hasEnumerableObservers\n @type Boolean\n */\n hasEnumerableObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@enumerable:change') || Ember.hasListeners(this, '@enumerable:before');\n }),\n\n\n /**\n Invoke this method just before the contents of your enumerable will\n change. You can either omit the parameters completely or pass the objects\n to be removed or added if available or just a count.\n\n @method enumerableContentWillChange\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to be\n added or the number of items to be added.\n @chainable\n */\n enumerableContentWillChange: function(removing, adding) {\n\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding,'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.propertyWillChange(this, '[]');\n if (hasDelta) Ember.propertyWillChange(this, 'length');\n Ember.sendEvent(this, '@enumerable:before', [this, removing, adding]);\n\n return this;\n },\n\n /**\n Invoke this method when the contents of your enumerable has changed.\n This will notify any observers watching for content changes. If your are\n implementing an ordered enumerable (such as an array), also pass the\n start and end values where the content changed so that it can be used to\n notify range observers.\n\n @method enumerableContentDidChange\n @param {Number} [start] optional start offset for the content change.\n For unordered enumerables, you should always pass -1.\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to\n be added or the number of items to be added.\n @chainable\n */\n enumerableContentDidChange: function(removing, adding) {\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding, 'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.sendEvent(this, '@enumerable:change', [this, removing, adding]);\n if (hasDelta) Ember.propertyDidChange(this, 'length');\n Ember.propertyDidChange(this, '[]');\n\n return this ;\n }\n\n}) ;\n\n})();\n//@ sourceURL=ember-runtime/mixins/enumerable");minispade.register('ember-runtime/mixins/evented', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n This mixin allows for Ember objects to subscribe to and emit events.\n\n ```javascript\n App.Person = Ember.Object.extend(Ember.Evented, {\n greet: function() {\n // ...\n this.trigger('greet');\n }\n });\n\n var person = App.Person.create();\n\n person.on('greet', function() {\n console.log('Our person has greeted');\n });\n\n person.greet();\n\n // outputs: 'Our person has greeted'\n ```\n\n You can also chain multiple event subscriptions:\n\n ```javascript\n person.on('greet', function() {\n console.log('Our person has greeted');\n }).one('greet', function() {\n console.log('Offer one-time special');\n }).off('event', this, forgetThis);\n ```\n\n @class Evented\n @namespace Ember\n @extends Ember.Mixin\n */\nEmber.Evented = Ember.Mixin.create({\n\n /**\n Subscribes to a named event with given function.\n\n ```javascript\n person.on('didLoad', function() {\n // fired once the person has loaded\n });\n ```\n\n An optional target can be passed in as the 2nd argument that will\n be set as the \"this\" for the callback. This is a good way to give your\n function access to the object triggering the event. When the target\n parameter is used the callback becomes the third argument.\n\n @method on\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n on: function(name, target, method) {\n Ember.addListener(this, name, target, method);\n return this;\n },\n\n /**\n Subscribes a function to a named event and then cancels the subscription\n after the first time the event is triggered. It is good to use ``one`` when\n you only care about the first time an event has taken place.\n\n This function takes an optional 2nd argument that will become the \"this\"\n value for the callback. If this argument is passed then the 3rd argument\n becomes the function.\n\n @method one\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n one: function(name, target, method) {\n if (!method) {\n method = target;\n target = null;\n }\n\n Ember.addListener(this, name, target, method, true);\n return this;\n },\n\n /**\n Triggers a named event for the object. Any additional arguments\n will be passed as parameters to the functions that are subscribed to the\n event.\n\n ```javascript\n person.on('didEat', function(food) {\n console.log('person ate some ' + food);\n });\n\n person.trigger('didEat', 'broccoli');\n\n // outputs: person ate some broccoli\n ```\n @method trigger\n @param {String} name The name of the event\n @param {Object...} args Optional arguments to pass on\n */\n trigger: function(name) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n Ember.sendEvent(this, name, args);\n },\n\n fire: function(name) {\n Ember.deprecate(\"Ember.Evented#fire() has been deprecated in favor of trigger() for compatibility with jQuery. It will be removed in 1.0. Please update your code to call trigger() instead.\");\n this.trigger.apply(this, arguments);\n },\n\n /**\n Cancels subscription for give name, target, and method.\n\n @method off\n @param {String} name The name of the event\n @param {Object} target The target of the subscription\n @param {Function} method The function of the subscription\n @return this\n */\n off: function(name, target, method) {\n Ember.removeListener(this, name, target, method);\n return this;\n },\n\n /**\n Checks to see if object has any subscriptions for named event.\n\n @method has\n @param {String} name The name of the event\n @return {Boolean} does the object have a subscription for event\n */\n has: function(name) {\n return Ember.hasListeners(this, name);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/evented");minispade.register('ember-runtime/mixins/freezable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.Freezable` mixin implements some basic methods for marking an\n object as frozen. Once an object is frozen it should be read only. No changes\n may be made the internal state of the object.\n\n ## Enforcement\n\n To fully support freezing in your subclass, you must include this mixin and\n override any method that might alter any property on the object to instead\n raise an exception. You can check the state of an object by checking the\n `isFrozen` property.\n\n Although future versions of JavaScript may support language-level freezing\n object objects, that is not the case today. Even if an object is freezable,\n it is still technically possible to modify the object, even though it could\n break other parts of your application that do not expect a frozen object to\n change. It is, therefore, very important that you always respect the\n `isFrozen` property on all freezable objects.\n\n ## Example Usage\n\n The example below shows a simple object that implement the `Ember.Freezable`\n protocol.\n\n ```javascript\n Contact = Ember.Object.extend(Ember.Freezable, {\n firstName: null,\n lastName: null,\n\n // swaps the names\n swapNames: function() {\n if (this.get('isFrozen')) throw Ember.FROZEN_ERROR;\n var tmp = this.get('firstName');\n this.set('firstName', this.get('lastName'));\n this.set('lastName', tmp);\n return this;\n }\n\n });\n\n c = Context.create({ firstName: \"John\", lastName: \"Doe\" });\n c.swapNames(); // returns c\n c.freeze();\n c.swapNames(); // EXCEPTION\n ```\n\n ## Copying\n\n Usually the `Ember.Freezable` protocol is implemented in cooperation with the\n `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will\n return a frozen object, if the object implements this method as well.\n\n @class Freezable\n @namespace Ember\n @extends Ember.Mixin\n @since Ember 0.9\n*/\nEmber.Freezable = Ember.Mixin.create(\n/** @scope Ember.Freezable.prototype */ {\n\n /**\n Set to `true` when the object is frozen. Use this property to detect\n whether your object is frozen or not.\n\n @property isFrozen\n @type Boolean\n */\n isFrozen: false,\n\n /**\n Freezes the object. Once this method has been called the object should\n no longer allow any properties to be edited.\n\n @method freeze\n @return {Object} receiver\n */\n freeze: function() {\n if (get(this, 'isFrozen')) return this;\n set(this, 'isFrozen', true);\n return this;\n }\n\n});\n\nEmber.FROZEN_ERROR = \"Frozen object cannot be modified.\";\n\n})();\n//@ sourceURL=ember-runtime/mixins/freezable");minispade.register('ember-runtime/mixins/mutable_array', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\nminispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\n\n// ..........................................................\n// CONSTANTS\n//\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\" ;\nvar EMPTY = [];\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n This mixin defines the API for modifying array-like objects. These methods\n can be applied only to a collection that keeps its items in an ordered set.\n\n Note that an Array can change even if it does not implement this mixin.\n For example, one might implement a SparseArray that cannot be directly\n modified, but if its underlying enumerable changes, it will change also.\n\n @class MutableArray\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.Array\n @uses Ember.MutableEnumerable\n*/\nEmber.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,\n /** @scope Ember.MutableArray.prototype */ {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n You should replace amt objects started at idx with the objects in the\n passed array. You should also call `this.enumerableContentDidChange()`\n\n @method replace\n @param {Number} idx Starting index in the array to replace. If\n idx >= length, then append to the end of the array.\n @param {Number} amt Number of elements that should be removed from\n the array, starting at *idx*.\n @param {Array} objects An array of zero or more objects that should be\n inserted into the array at *idx*\n */\n replace: Ember.required(),\n\n /**\n Remove all elements from self. This is useful if you\n want to reuse an existing array without having to recreate it.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n color.length(); // 3\n colors.clear(); // []\n colors.length(); // 0\n ```\n\n @method clear\n @return {Ember.Array} An empty Array.\n */\n clear: function () {\n var len = get(this, 'length');\n if (len === 0) return this;\n this.replace(0, len, EMPTY);\n return this;\n },\n\n /**\n This will use the primitive `replace()` method to insert an object at the\n specified index.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.insertAt(2, \"yellow\"); // [\"red\", \"green\", \"yellow\", \"blue\"]\n colors.insertAt(5, \"orange\"); // Error: Index out of range\n ```\n\n @method insertAt\n @param {Number} idx index of insert the object at.\n @param {Object} object object to insert\n @return this\n */\n insertAt: function(idx, object) {\n if (idx > get(this, 'length')) throw new Error(OUT_OF_RANGE_EXCEPTION) ;\n this.replace(idx, 0, [object]) ;\n return this ;\n },\n\n /**\n Remove an object at the specified index using the `replace()` primitive\n method. You can pass either a single index, or a start and a length.\n\n If you pass a start and length that is beyond the\n length this method will throw an `Ember.OUT_OF_RANGE_EXCEPTION`\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\", \"yellow\", \"orange\"];\n colors.removeAt(0); // [\"green\", \"blue\", \"yellow\", \"orange\"]\n colors.removeAt(2, 2); // [\"green\", \"blue\"]\n colors.removeAt(4, 2); // Error: Index out of range\n ```\n\n @method removeAt\n @param {Number} start index, start of range\n @param {Number} len length of passing range\n @return {Object} receiver\n */\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n // fast case\n if (len === undefined) len = 1;\n this.replace(start, len, EMPTY);\n }\n\n return this ;\n },\n\n /**\n Push the object onto the end of the array. Works just like `push()` but it\n is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObject(\"black\"); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObject([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", [\"yellow\", \"orange\"]]\n ```\n\n @method pushObject\n @param {*} obj object to push\n @return {*} the same obj passed as param\n */\n pushObject: function(obj) {\n this.insertAt(get(this, 'length'), obj) ;\n return obj ;\n },\n\n /**\n Add the objects in the passed numerable to the end of the array. Defers\n notifying observers of the change until all objects are added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObjects(\"black\"); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObjects([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", \"yellow\", \"orange\"]\n ```\n\n @method pushObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n pushObjects: function(objects) {\n this.replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n /**\n Pop object from array or nil if none are left. Works just like `pop()` but\n it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.popObject(); // \"blue\"\n console.log(colors); // [\"red\", \"green\"]\n ```\n\n @method popObject\n @return object\n */\n popObject: function() {\n var len = get(this, 'length') ;\n if (len === 0) return null ;\n\n var ret = this.objectAt(len-1) ;\n this.removeAt(len-1, 1) ;\n return ret ;\n },\n\n /**\n Shift an object from start of array or nil if none are left. Works just\n like `shift()` but it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.shiftObject(); // \"red\"\n console.log(colors); // [\"green\", \"blue\"]\n ```\n\n @method shiftObject\n @return object\n */\n shiftObject: function() {\n if (get(this, 'length') === 0) return null ;\n var ret = this.objectAt(0) ;\n this.removeAt(0) ;\n return ret ;\n },\n\n /**\n Unshift an object to start of array. Works just like `unshift()` but it is\n KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObject(\"yellow\"); // [\"yellow\", \"red\", \"green\", \"blue\"]\n colors.unshiftObject([\"black\", \"white\"]); // [[\"black\", \"white\"], \"yellow\", \"red\", \"green\", \"blue\"]\n ```\n\n @method unshiftObject\n @param {*} obj object to unshift\n @return {*} the same obj passed as param\n */\n unshiftObject: function(obj) {\n this.insertAt(0, obj) ;\n return obj ;\n },\n\n /**\n Adds the named objects to the beginning of the array. Defers notifying\n observers until all objects have been added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObjects([\"black\", \"white\"]); // [\"black\", \"white\", \"red\", \"green\", \"blue\"]\n colors.unshiftObjects(\"yellow\"); // Type Error: 'undefined' is not a function\n ```\n\n @method unshiftObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n unshiftObjects: function(objects) {\n this.replace(0, 0, objects);\n return this;\n },\n\n /**\n Reverse objects in the array. Works just like `reverse()` but it is\n KVO-compliant.\n\n @method reverseObjects\n @return {Ember.Array} receiver\n */\n reverseObjects: function() {\n var len = get(this, 'length');\n if (len === 0) return this;\n var objects = this.toArray().reverse();\n this.replace(0, len, objects);\n return this;\n },\n\n /**\n Replace all the the receiver's content with content of the argument.\n If argument is an empty array receiver will be cleared.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.setObjects([\"black\", \"white\"]); // [\"black\", \"white\"]\n colors.setObjects([]); // []\n ```\n\n @method setObjects\n @param {Ember.Array} objects array whose content will be used for replacing\n the content of the receiver\n @return {Ember.Array} receiver with the new content\n */\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this.replace(0, len, objects);\n return this;\n },\n\n // ..........................................................\n // IMPLEMENT Ember.MutableEnumerable\n //\n\n removeObject: function(obj) {\n var loc = get(this, 'length') || 0;\n while(--loc >= 0) {\n var curObject = this.objectAt(loc) ;\n if (curObject === obj) this.removeAt(loc) ;\n }\n return this ;\n },\n\n addObject: function(obj) {\n if (!this.contains(obj)) this.pushObject(obj);\n return this ;\n }\n\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_array");minispade.register('ember-runtime/mixins/mutable_enumerable', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar forEach = Ember.EnumerableUtils.forEach;\n\n/**\n This mixin defines the API for modifying generic enumerables. These methods\n can be applied to an object regardless of whether it is ordered or\n unordered.\n\n Note that an Enumerable can change even if it does not implement this mixin.\n For example, a MappedEnumerable cannot be directly modified but if its\n underlying enumerable changes, it will change also.\n\n ## Adding Objects\n\n To add an object to an enumerable, use the `addObject()` method. This\n method will only add the object to the enumerable if the object is not\n already present and is of a type supported by the enumerable.\n\n ```javascript\n set.addObject(contact);\n ```\n\n ## Removing Objects\n\n To remove an object from an enumerable, use the `removeObject()` method. This\n will only remove the object if it is present in the enumerable, otherwise\n this method has no effect.\n\n ```javascript\n set.removeObject(contact);\n ```\n\n ## Implementing In Your Own Code\n\n If you are implementing an object and want to support this API, just include\n this mixin in your class and implement the required methods. In your unit\n tests, be sure to apply the Ember.MutableEnumerableTests to your object.\n\n @class MutableEnumerable\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.Enumerable\n*/\nEmber.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable, {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to add the passed object to the receiver if the object is not\n already present in the collection. If the object is present, this method\n has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method addObject\n @param {Object} object The object to add to the enumerable.\n @return {Object} the passed object\n */\n addObject: Ember.required(Function),\n\n /**\n Adds each object in the passed enumerable to the receiver.\n\n @method addObjects\n @param {Ember.Enumerable} objects the objects to add.\n @return {Object} receiver\n */\n addObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.addObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n },\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to remove the passed object from the receiver collection if the\n object is present in the collection. If the object is not present,\n this method has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method removeObject\n @param {Object} object The object to remove from the enumerable.\n @return {Object} the passed object\n */\n removeObject: Ember.required(Function),\n\n\n /**\n Removes each object in the passed enumerable from the receiver.\n\n @method removeObjects\n @param {Ember.Enumerable} objects the objects to remove\n @return {Object} receiver\n */\n removeObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.removeObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_enumerable");minispade.register('ember-runtime/mixins/observable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n ## Overview\n\n This mixin provides properties and property observing functionality, core\n features of the Ember object model.\n\n Properties and observers allow one object to observe changes to a\n property on another object. This is one of the fundamental ways that\n models, controllers and views communicate with each other in an Ember\n application.\n\n Any object that has this mixin applied can be used in observer\n operations. That includes `Ember.Object` and most objects you will\n interact with as you write your Ember application.\n\n Note that you will not generally apply this mixin to classes yourself,\n but you will use the features provided by this module frequently, so it\n is important to understand how to use it.\n\n ## Using `get()` and `set()`\n\n Because of Ember's support for bindings and observers, you will always\n access properties using the get method, and set properties using the\n set method. This allows the observing objects to be notified and\n computed properties to be handled properly.\n\n More documentation about `get` and `set` are below.\n\n ## Observing Property Changes\n\n You typically observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.create({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n Although this is the most common way to add an observer, this capability\n is actually built into the `Ember.Object` class on top of two methods\n defined in this mixin: `addObserver` and `removeObserver`. You can use\n these two methods to add and remove observers yourself if you need to\n do so at runtime.\n\n To add an observer for a property, call:\n\n ```javascript\n object.addObserver('propertyKey', targetObject, targetAction)\n ```\n\n This will call the `targetAction` method on the `targetObject` to be called\n whenever the value of the `propertyKey` changes.\n\n Note that if `propertyKey` is a computed property, the observer will be\n called when any of the property dependencies are changed, even if the\n resulting value of the computed property is unchanged. This is necessary\n because computed properties are not computed until `get` is called.\n\n @class Observable\n @namespace Ember\n @extends Ember.Mixin\n*/\nEmber.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {\n\n /**\n Retrieves the value of a property from the object.\n\n This method is usually similar to using `object[keyName]` or `object.keyName`,\n however it supports both computed properties and the unknownProperty\n handler.\n\n Because `get` unifies the syntax for accessing all these kinds\n of properties, it can make many refactorings easier, such as replacing a\n simple property with a computed property, or vice versa.\n\n ### Computed Properties\n\n Computed properties are methods defined with the `property` modifier\n declared at the end, such as:\n\n ```javascript\n fullName: function() {\n return this.getEach('firstName', 'lastName').compact().join(' ');\n }.property('firstName', 'lastName')\n ```\n\n When you call `get` on a computed property, the function will be\n called and the return value will be returned instead of the function\n itself.\n\n ### Unknown Properties\n\n Likewise, if you try to call `get` on a property whose value is\n `undefined`, the `unknownProperty()` method will be called on the object.\n If this method returns any value other than `undefined`, it will be returned\n instead. This allows you to implement \"virtual\" properties that are\n not defined upfront.\n\n @method get\n @param {String} keyName The property to retrieve\n @return {Object} The property value or undefined.\n */\n get: function(keyName) {\n return get(this, keyName);\n },\n\n /**\n To get multiple properties at once, call `getProperties`\n with a list of strings or an array:\n\n ```javascript\n record.getProperties('firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n record.getProperties(['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param {String...|Array} list of keys to get\n @return {Hash}\n */\n getProperties: function() {\n var ret = {};\n var propertyNames = arguments;\n if (arguments.length === 1 && Ember.typeOf(arguments[0]) === 'array') {\n propertyNames = arguments[0];\n }\n for(var i = 0; i < propertyNames.length; i++) {\n ret[propertyNames[i]] = get(this, propertyNames[i]);\n }\n return ret;\n },\n\n /**\n Sets the provided key or path to the value.\n\n This method is generally very similar to calling `object[key] = value` or\n `object.key = value`, except that it provides support for computed\n properties, the `unknownProperty()` method and property observers.\n\n ### Computed Properties\n\n If you try to set a value on a key that has a computed property handler\n defined (see the `get()` method for an example), then `set()` will call\n that method, passing both the value and key instead of simply changing\n the value itself. This is useful for those times when you need to\n implement a property that is composed of one or more member\n properties.\n\n ### Unknown Properties\n\n If you try to set a value on a key that is undefined in the target\n object, then the `unknownProperty()` handler will be called instead. This\n gives you an opportunity to implement complex \"virtual\" properties that\n are not predefined on the object. If `unknownProperty()` returns\n undefined, then `set()` will simply set the value on the object.\n\n ### Property Observers\n\n In addition to changing the property, `set()` will also register a property\n change with the object. Unless you have placed this call inside of a\n `beginPropertyChanges()` and `endPropertyChanges(),` any \"local\" observers\n (i.e. observer methods declared on the same object), will be called\n immediately. Any \"remote\" observers (i.e. observer methods declared on\n another object) will be placed in a queue and called at a later time in a\n coalesced manner.\n\n ### Chaining\n\n In addition to property changes, `set()` returns the value of the object\n itself so you can do chaining like this:\n\n ```javascript\n record.set('firstName', 'Charles').set('lastName', 'Jolley');\n ```\n\n @method set\n @param {String} keyName The property to set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n set: function(keyName, value) {\n set(this, keyName, value);\n return this;\n },\n\n /**\n To set multiple properties at once, call `setProperties`\n with a Hash:\n\n ```javascript\n record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });\n ```\n\n @method setProperties\n @param {Hash} hash the hash of keys and values to set\n @return {Ember.Observable}\n */\n setProperties: function(hash) {\n return Ember.setProperties(this, hash);\n },\n\n /**\n Begins a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call this\n method at the beginning of the changes to begin deferring change\n notifications. When you are done making changes, call\n `endPropertyChanges()` to deliver the deferred change notifications and end\n deferring.\n\n @method beginPropertyChanges\n @return {Ember.Observable}\n */\n beginPropertyChanges: function() {\n Ember.beginPropertyChanges();\n return this;\n },\n\n /**\n Ends a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call\n `beginPropertyChanges()` at the beginning of the changes to defer change\n notifications. When you are done making changes, call this method to\n deliver the deferred change notifications and end deferring.\n\n @method endPropertyChanges\n @return {Ember.Observable}\n */\n endPropertyChanges: function() {\n Ember.endPropertyChanges();\n return this;\n },\n\n /**\n Notify the observer system that a property is about to change.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyDidChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyWillChange\n @param {String} keyName The property key that is about to change.\n @return {Ember.Observable}\n */\n propertyWillChange: function(keyName){\n Ember.propertyWillChange(this, keyName);\n return this;\n },\n\n /**\n Notify the observer system that a property has just changed.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyWillChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyDidChange\n @param {String} keyName The property key that has just changed.\n @return {Ember.Observable}\n */\n propertyDidChange: function(keyName) {\n Ember.propertyDidChange(this, keyName);\n return this;\n },\n\n /**\n Convenience method to call `propertyWillChange` and `propertyDidChange` in\n succession.\n\n @method notifyPropertyChange\n @param {String} keyName The property key to be notified about.\n @return {Ember.Observable}\n */\n notifyPropertyChange: function(keyName) {\n this.propertyWillChange(keyName);\n this.propertyDidChange(keyName);\n return this;\n },\n\n addBeforeObserver: function(key, target, method) {\n Ember.addBeforeObserver(this, key, target, method);\n },\n\n /**\n Adds an observer on a property.\n\n This is the core method used to register an observer for a property.\n\n Once you call this method, anytime the key's value is set, your observer\n will be notified. Note that the observers are triggered anytime the\n value is set, regardless of whether it has actually changed. Your\n observer should be prepared to handle that.\n\n You can also pass an optional context parameter to this method. The\n context will be passed to your observer method whenever it is triggered.\n Note that if you add the same target/method pair on a key multiple times\n with different context parameters, your observer will only be called once\n with the last context you passed.\n\n ### Observer Methods\n\n Observer methods you pass should generally have the following signature if\n you do not pass a `context` parameter:\n\n ```javascript\n fooDidChange: function(sender, key, value, rev) { };\n ```\n\n The sender is the object that changed. The key is the property that\n changes. The value property is currently reserved and unused. The rev\n is the last property revision of the object when it changed, which you can\n use to detect if the key value has really changed or not.\n\n If you pass a `context` parameter, the context will be passed before the\n revision like so:\n\n ```javascript\n fooDidChange: function(sender, key, value, context, rev) { };\n ```\n\n Usually you will not need the value, context or revision parameters at\n the end. In this case, it is common to write observer methods that take\n only a sender and key value as parameters or, if you aren't interested in\n any of these values, to write an observer that has no parameters at all.\n\n @method addObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Object} self\n */\n addObserver: function(key, target, method) {\n Ember.addObserver(this, key, target, method);\n },\n\n /**\n Remove an observer you have previously registered on this object. Pass\n the same key, target, and method you passed to `addObserver()` and your\n target will no longer receive notifications.\n\n @method removeObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Observable} receiver\n */\n removeObserver: function(key, target, method) {\n Ember.removeObserver(this, key, target, method);\n },\n\n /**\n Returns `true` if the object currently has observers registered for a\n particular key. You can use this method to potentially defer performing\n an expensive action until someone begins observing a particular property\n on the object.\n\n @method hasObserverFor\n @param {String} key Key to check\n @return {Boolean}\n */\n hasObserverFor: function(key) {\n return Ember.hasListeners(this, key+':change');\n },\n\n /**\n @deprecated\n @method getPath\n @param {String} path The property path to retrieve\n @return {Object} The property value or undefined.\n */\n getPath: function(path) {\n Ember.deprecate(\"getPath is deprecated since get now supports paths\");\n return this.get(path);\n },\n\n /**\n @deprecated\n @method setPath\n @param {String} path The path to the property that will be set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n setPath: function(path, value) {\n Ember.deprecate(\"setPath is deprecated since set now supports paths\");\n return this.set(path, value);\n },\n\n /**\n Retrieves the value of a property, or a default value in the case that the\n property returns `undefined`.\n\n ```javascript\n person.getWithDefault('lastName', 'Doe');\n ```\n\n @method getWithDefault\n @param {String} keyName The name of the property to retrieve\n @param {Object} defaultValue The value to return if the property value is undefined\n @return {Object} The property value or the defaultValue.\n */\n getWithDefault: function(keyName, defaultValue) {\n return Ember.getWithDefault(this, keyName, defaultValue);\n },\n\n /**\n Set the value of a property to the current value plus some amount.\n\n ```javascript\n person.incrementProperty('age');\n team.incrementProperty('score', 2);\n ```\n\n @method incrementProperty\n @param {String} keyName The name of the property to increment\n @param {Object} increment The amount to increment by. Defaults to 1\n @return {Object} The new property value\n */\n incrementProperty: function(keyName, increment) {\n if (Ember.isNone(increment)) { increment = 1; }\n set(this, keyName, (get(this, keyName) || 0)+increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a property to the current value minus some amount.\n\n ```javascript\n player.decrementProperty('lives');\n orc.decrementProperty('health', 5);\n ```\n\n @method decrementProperty\n @param {String} keyName The name of the property to decrement\n @param {Object} increment The amount to decrement by. Defaults to 1\n @return {Object} The new property value\n */\n decrementProperty: function(keyName, increment) {\n if (Ember.isNone(increment)) { increment = 1; }\n set(this, keyName, (get(this, keyName) || 0)-increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a boolean property to the opposite of it's\n current value.\n\n ```javascript\n starship.toggleProperty('warpDriveEnaged');\n ```\n\n @method toggleProperty\n @param {String} keyName The name of the property to toggle\n @return {Object} The new property value\n */\n toggleProperty: function(keyName) {\n set(this, keyName, !get(this, keyName));\n return get(this, keyName);\n },\n\n /**\n Returns the cached value of a computed property, if it exists.\n This allows you to inspect the value of a computed property\n without accidentally invoking it if it is intended to be\n generated lazily.\n\n @method cacheFor\n @param {String} keyName\n @return {Object} The cached value of the computed property, if any\n */\n cacheFor: function(keyName) {\n return Ember.cacheFor(this, keyName);\n },\n\n // intended for debugging purposes\n observersForKey: function(keyName) {\n return Ember.observersFor(this, keyName);\n }\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/observable");minispade.register('ember-runtime/mixins/sortable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach;\n\n/**\n `Ember.SortableMixin` provides a standard interface for array proxies\n to specify a sort order and maintain this sorting when objects are added,\n removed, or updated without changing the implicit order of their underlying\n content array:\n\n ```javascript\n songs = [\n {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'},\n {trackNumber: 2, title: 'Back in the U.S.S.R.'},\n {trackNumber: 3, title: 'Glass Onion'},\n ];\n\n songsController = Ember.ArrayController.create({\n content: songs,\n sortProperties: ['trackNumber'],\n sortAscending: true\n });\n\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.addObject({trackNumber: 1, title: 'Dear Prudence'});\n songsController.get('firstObject'); // {trackNumber: 1, title: 'Dear Prudence'}\n ```\n\n @class SortableMixin\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.MutableEnumerable\n*/\nEmber.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {\n\n /**\n Specifies which properties dictate the arrangedContent's sort order.\n\n @property {Array} sortProperties\n */\n sortProperties: null,\n\n /**\n Specifies the arrangedContent's sort direction\n\n @property {Boolean} sortAscending\n */\n sortAscending: true,\n\n orderBy: function(item1, item2) {\n var result = 0,\n sortProperties = get(this, 'sortProperties'),\n sortAscending = get(this, 'sortAscending');\n\n Ember.assert(\"you need to define `sortProperties`\", !!sortProperties);\n\n forEach(sortProperties, function(propertyName) {\n if (result === 0) {\n result = Ember.compare(get(item1, propertyName), get(item2, propertyName));\n if ((result !== 0) && !sortAscending) {\n result = (-1) * result;\n }\n }\n });\n\n return result;\n },\n\n destroy: function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super();\n },\n\n isSorted: Ember.computed.bool('sortProperties'),\n\n arrangedContent: Ember.computed('content', 'sortProperties.@each', function(key, value) {\n var content = get(this, 'content'),\n isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties'),\n self = this;\n\n if (content && isSorted) {\n content = content.slice();\n content.sort(function(item1, item2) {\n return self.orderBy(item1, item2);\n });\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n return Ember.A(content);\n }\n\n return content;\n }),\n\n _contentWillChange: Ember.beforeObserver(function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n this._super();\n }, 'content'),\n\n sortAscendingWillChange: Ember.beforeObserver(function() {\n this._lastSortAscending = get(this, 'sortAscending');\n }, 'sortAscending'),\n\n sortAscendingDidChange: Ember.observer(function() {\n if (get(this, 'sortAscending') !== this._lastSortAscending) {\n var arrangedContent = get(this, 'arrangedContent');\n arrangedContent.reverseObjects();\n }\n }, 'sortAscending'),\n\n contentArrayWillChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted');\n\n if (isSorted) {\n var arrangedContent = get(this, 'arrangedContent');\n var removedObjects = array.slice(idx, idx+removedCount);\n var sortProperties = get(this, 'sortProperties');\n\n forEach(removedObjects, function(item) {\n arrangedContent.removeObject(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n contentArrayDidChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties');\n\n if (isSorted) {\n var addedObjects = array.slice(idx, idx+addedCount);\n\n forEach(addedObjects, function(item) {\n this.insertItemSorted(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n insertItemSorted: function(item) {\n var arrangedContent = get(this, 'arrangedContent');\n var length = get(arrangedContent, 'length');\n\n var idx = this._binarySearch(item, 0, length);\n arrangedContent.insertAt(idx, item);\n },\n\n contentItemSortPropertyDidChange: function(item) {\n var arrangedContent = get(this, 'arrangedContent'),\n oldIndex = arrangedContent.indexOf(item),\n leftItem = arrangedContent.objectAt(oldIndex - 1),\n rightItem = arrangedContent.objectAt(oldIndex + 1),\n leftResult = leftItem && this.orderBy(item, leftItem),\n rightResult = rightItem && this.orderBy(item, rightItem);\n\n if (leftResult < 0 || rightResult > 0) {\n arrangedContent.removeObject(item);\n this.insertItemSorted(item);\n }\n },\n\n _binarySearch: function(item, low, high) {\n var mid, midItem, res, arrangedContent;\n\n if (low === high) {\n return low;\n }\n\n arrangedContent = get(this, 'arrangedContent');\n\n mid = low + Math.floor((high - low) / 2);\n midItem = arrangedContent.objectAt(mid);\n\n res = this.orderBy(midItem, item);\n\n if (res < 0) {\n return this._binarySearch(item, mid+1, high);\n } else if (res > 0) {\n return this._binarySearch(item, low, mid);\n }\n\n return mid;\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/sortable");minispade.register('ember-runtime/mixins/target_action_support', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n`Ember.TargetActionSupport` is a mixin that can be included in a class\nto add a `triggerAction` method with semantics similar to the Handlebars\n`{{action}}` helper. In normal Ember usage, the `{{action}}` helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in View objects.\n\nSee also `Ember.ViewTargetActionSupport`, which has\nview-aware defaults for target and actionContext.\n\n@class TargetActionSupport\n@namespace Ember\n@extends Ember.Mixin\n*/\nEmber.TargetActionSupport = Ember.Mixin.create({\n target: null,\n action: null,\n actionContext: null,\n\n targetObject: Ember.computed(function() {\n var target = get(this, 'target');\n\n if (Ember.typeOf(target) === \"string\") {\n var value = get(this, target);\n if (value === undefined) { value = get(Ember.lookup, target); }\n return value;\n } else {\n return target;\n }\n }).property('target'),\n\n actionContextObject: Ember.computed(function() {\n var actionContext = get(this, 'actionContext');\n\n if (Ember.typeOf(actionContext) === \"string\") {\n var value = get(this, actionContext);\n if (value === undefined) { value = get(Ember.lookup, actionContext); }\n return value;\n } else {\n return actionContext;\n }\n }).property('actionContext'),\n\n /**\n Send an \"action\" with an \"actionContext\" to a \"target\". The action, actionContext\n and target will be retrieved from properties of the object. For example:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n action: 'save',\n actionContext: Ember.computed.alias('context'),\n click: function(){\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `target`, `action`, and `actionContext` can be provided as properties of\n an optional object argument to `triggerAction` as well.\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n click: function(){\n this.triggerAction({\n action: 'save',\n target: this.get('controller'),\n actionContext: this.get('context'),\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `actionContext` defaults to the object you mixing `TargetActionSupport` into.\n But `target` and `action` must be specified either as properties or with the argument\n to `triggerAction`, or a combination:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n click: function(){\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with a reference to `this`,\n // to the current controller\n }\n });\n ```\n\n @method triggerAction\n @param opts {Hash} (optional, with the optional keys action, target and/or actionContext)\n @return {Boolean} true if the action was sent successfully and did not return false\n */\n triggerAction: function(opts) {\n opts = opts || {};\n var action = opts['action'] || get(this, 'action'),\n target = opts['target'] || get(this, 'targetObject'),\n actionContext = opts['actionContext'] || get(this, 'actionContextObject') || this;\n\n if (target && action) {\n var ret;\n\n if (target.send) {\n ret = target.send.apply(target, [action, actionContext]);\n } else {\n Ember.assert(\"The action '\" + action + \"' did not exist on \" + target, typeof target[action] === 'function');\n ret = target[action].apply(target, [actionContext]);\n }\n\n if (ret !== false) ret = true;\n\n return ret;\n } else {\n return false;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/target_action_support");minispade.register('ember-runtime/system', "(function() {minispade.require('ember-runtime/system/container');\nminispade.require('ember-runtime/system/application');\nminispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/system/each_proxy');\nminispade.require('ember-runtime/system/namespace');\nminispade.require('ember-runtime/system/native_array');\nminispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/set');\nminispade.require('ember-runtime/system/string');\nminispade.require('ember-runtime/system/deferred');\nminispade.require('ember-runtime/system/lazy_load');\n\n})();\n//@ sourceURL=ember-runtime/system");minispade.register('ember-runtime/system/application', "(function() {minispade.require('ember-runtime/system/namespace');\n\nEmber.Application = Ember.Namespace.extend();\n\n})();\n//@ sourceURL=ember-runtime/system/application");minispade.register('ember-runtime/system/array_proxy', "(function() {minispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\";\nvar EMPTY = [];\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n An ArrayProxy wraps any other object that implements `Ember.Array` and/or\n `Ember.MutableArray,` forwarding all requests. This makes it very useful for\n a number of binding use cases or other cases where being able to swap\n out the underlying array is useful.\n\n A simple example of usage:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });\n\n ap.get('firstObject'); // 'dog'\n ap.set('content', ['amoeba', 'paramecium']);\n ap.get('firstObject'); // 'amoeba'\n ```\n\n This class can also be useful as a layer to transform the contents of\n an array, as they are accessed. This can be done by overriding\n `objectAtContent`:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({\n content: Ember.A(pets),\n objectAtContent: function(idx) {\n return this.get('content').objectAt(idx).toUpperCase();\n }\n });\n\n ap.get('firstObject'); // . 'DOG'\n ```\n\n @class ArrayProxy\n @namespace Ember\n @extends Ember.Object\n @uses Ember.MutableArray\n*/\nEmber.ArrayProxy = Ember.Object.extend(Ember.MutableArray,\n/** @scope Ember.ArrayProxy.prototype */ {\n\n /**\n The content array. Must be an object that implements `Ember.Array` and/or\n `Ember.MutableArray.`\n\n @property content\n @type Ember.Array\n */\n content: null,\n\n /**\n The array that the proxy pretends to be. In the default `ArrayProxy`\n implementation, this and `content` are the same. Subclasses of `ArrayProxy`\n can override this property to provide things like sorting and filtering.\n\n @property arrangedContent\n */\n arrangedContent: Ember.computed.alias('content'),\n\n /**\n Should actually retrieve the object at the specified index from the\n content. You can override this method in subclasses to transform the\n content item to something new.\n\n This method will only be called if content is non-`null`.\n\n @method objectAtContent\n @param {Number} idx The index to retrieve.\n @return {Object} the value or undefined if none found\n */\n objectAtContent: function(idx) {\n return get(this, 'arrangedContent').objectAt(idx);\n },\n\n /**\n Should actually replace the specified objects on the content array.\n You can override this method in subclasses to transform the content item\n into something new.\n\n This method will only be called if content is non-`null`.\n\n @method replaceContent\n @param {Number} idx The starting index\n @param {Number} amt The number of items to remove from the content.\n @param {Array} objects Optional array of objects to insert or null if no\n objects.\n @return {void}\n */\n replaceContent: function(idx, amt, objects) {\n get(this, 'content').replace(idx, amt, objects);\n },\n\n /**\n @private\n\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @method _contentWillChange\n */\n _contentWillChange: Ember.beforeObserver(function() {\n this._teardownContent();\n }, 'content'),\n\n _teardownContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n contentArrayWillChange: Ember.K,\n contentArrayDidChange: Ember.K,\n\n /**\n @private\n\n Invoked when the content property changes. Notifies observers that the\n entire array content has changed.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer(function() {\n var content = get(this, 'content');\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", content !== this);\n\n this._setupContent();\n }, 'content'),\n\n _setupContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n _arrangedContentWillChange: Ember.beforeObserver(function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n this.arrangedContentArrayWillChange(this, 0, len, undefined);\n this.arrangedContentWillChange(this);\n\n this._teardownArrangedContent(arrangedContent);\n }, 'arrangedContent'),\n\n _arrangedContentDidChange: Ember.observer(function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", arrangedContent !== this);\n\n this._setupArrangedContent();\n\n this.arrangedContentDidChange(this);\n this.arrangedContentArrayDidChange(this, 0, undefined, len);\n }, 'arrangedContent'),\n\n _setupArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.addArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n _teardownArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.removeArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n arrangedContentWillChange: Ember.K,\n arrangedContentDidChange: Ember.K,\n\n objectAt: function(idx) {\n return get(this, 'content') && this.objectAtContent(idx);\n },\n\n length: Ember.computed(function() {\n var arrangedContent = get(this, 'arrangedContent');\n return arrangedContent ? get(arrangedContent, 'length') : 0;\n // No dependencies since Enumerable notifies length of change\n }),\n\n _replace: function(idx, amt, objects) {\n var content = get(this, 'content');\n Ember.assert('The content property of '+ this.constructor + ' should be set before modifying it', content);\n if (content) this.replaceContent(idx, amt, objects);\n return this;\n },\n\n replace: function() {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n this._replace.apply(this, arguments);\n } else {\n throw new Ember.Error(\"Using replace on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n _insertAt: function(idx, object) {\n if (idx > get(this, 'content.length')) throw new Error(OUT_OF_RANGE_EXCEPTION);\n this._replace(idx, 0, [object]);\n return this;\n },\n\n insertAt: function(idx, object) {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n return this._insertAt(idx, object);\n } else {\n throw new Ember.Error(\"Using insertAt on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n var content = get(this, 'content'),\n arrangedContent = get(this, 'arrangedContent'),\n indices = [], i;\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n if (len === undefined) len = 1;\n\n // Get a list of indices in original content to remove\n for (i=start; i= 0) {\n var baseValue = this[keyName];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n value = baseValue.concat(value);\n } else {\n value = Ember.makeArray(baseValue).concat(value);\n }\n } else {\n value = Ember.makeArray(value);\n }\n }\n\n if (desc) {\n desc.set(this, keyName, value);\n } else {\n if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) {\n this.setUnknownProperty(keyName, value);\n } else if (MANDATORY_SETTER) {\n Ember.defineProperty(this, keyName, null, value); // setup mandatory setter\n } else {\n this[keyName] = value;\n }\n }\n }\n }\n }\n finishPartial(this, m);\n delete m.proto;\n finishChains(this);\n this.init.apply(this, arguments);\n };\n\n Class.toString = Mixin.prototype.toString;\n Class.willReopen = function() {\n if (wasApplied) {\n Class.PrototypeMixin = Mixin.create(Class.PrototypeMixin);\n }\n\n wasApplied = false;\n };\n Class._initMixins = function(args) { initMixins = args; };\n Class._initProperties = function(args) { initProperties = args; };\n\n Class.proto = function() {\n var superclass = Class.superclass;\n if (superclass) { superclass.proto(); }\n\n if (!wasApplied) {\n wasApplied = true;\n Class.PrototypeMixin.applyPartial(Class.prototype);\n rewatch(Class.prototype);\n }\n\n return this.prototype;\n };\n\n return Class;\n\n}\n\nvar CoreObject = makeCtor();\nCoreObject.toString = function() { return \"Ember.CoreObject\"; };\n\nCoreObject.PrototypeMixin = Mixin.create({\n reopen: function() {\n applyMixin(this, arguments, true);\n return this;\n },\n\n isInstance: true,\n\n /**\n An overridable method called when objects are instantiated. By default,\n does nothing unless it is overridden during class definition.\n\n Example:\n\n ```javascript\n App.Person = Ember.Object.extend({\n init: function() {\n this._super();\n alert('Name is ' + this.get('name'));\n }\n });\n\n var steve = App.Person.create({\n name: \"Steve\"\n });\n\n // alerts 'Name is Steve'.\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n @method init\n */\n init: function() {},\n\n /**\n Defines the properties that will be concatenated from the superclass\n (instead of overridden).\n\n By default, when you extend an Ember class a property defined in\n the subclass overrides a property with the same name that is defined\n in the superclass. However, there are some cases where it is preferable\n to build up a property's value by combining the superclass' property\n value with the subclass' value. An example of this in use within Ember\n is the `classNames` property of `Ember.View`.\n\n Here is some sample code showing the difference between a concatenated\n property and a normal one:\n\n ```javascript\n App.BarView = Ember.View.extend({\n someNonConcatenatedProperty: ['bar'],\n classNames: ['bar']\n });\n\n App.FooBarView = App.BarView.extend({\n someNonConcatenatedProperty: ['foo'],\n classNames: ['foo'],\n });\n\n var fooBarView = App.FooBarView.create();\n fooBarView.get('someNonConcatenatedProperty'); // ['foo']\n fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']\n ```\n\n This behavior extends to object creation as well. Continuing the\n above example:\n\n ```javascript\n var view = App.FooBarView.create({\n someNonConcatenatedProperty: ['baz'],\n classNames: ['baz']\n })\n view.get('someNonConcatenatedProperty'); // ['baz']\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n Adding a single property that is not an array will just add it in the array:\n\n ```javascript\n var view = App.FooBarView.create({\n classNames: 'baz'\n })\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n\n Using the `concatenatedProperties` property, we can tell to Ember that mix\n the content of the properties.\n\n In `Ember.View` the `classNameBindings` and `attributeBindings` properties\n are also concatenated, in addition to `classNames`.\n\n This feature is available for you to use throughout the Ember object model,\n although typical app developers are likely to use it infrequently.\n\n @property concatenatedProperties\n @type Array\n @default null\n */\n concatenatedProperties: null,\n\n /**\n Destroyed object property flag.\n\n if this property is `true` the observers and bindings were already\n removed by the effect of calling the `destroy()` method.\n\n @property isDestroyed\n @default false\n */\n isDestroyed: false,\n\n /**\n Destruction scheduled flag. The `destroy()` method has been called.\n\n The object stays intact until the end of the run loop at which point\n the `isDestroyed` flag is set.\n\n @property isDestroying\n @default false\n */\n isDestroying: false,\n\n /**\n Destroys an object by setting the `isDestroyed` flag and removing its\n metadata, which effectively destroys observers and bindings.\n\n If you try to set a property on a destroyed object, an exception will be\n raised.\n\n Note that destruction is scheduled for the end of the run loop and does not\n happen immediately.\n\n @method destroy\n @return {Ember.Object} receiver\n */\n destroy: function() {\n if (this._didCallDestroy) { return; }\n\n this.isDestroying = true;\n this._didCallDestroy = true;\n\n schedule('destroy', this, this._scheduledDestroy);\n return this;\n },\n\n willDestroy: Ember.K,\n\n /**\n @private\n\n Invoked by the run loop to actually destroy the object. This is\n scheduled for execution by the `destroy` method.\n\n @method _scheduledDestroy\n */\n _scheduledDestroy: function() {\n if (this.willDestroy) { this.willDestroy(); }\n destroy(this);\n this.isDestroyed = true;\n if (this.didDestroy) { this.didDestroy(); }\n },\n\n bind: function(to, from) {\n if (!(from instanceof Ember.Binding)) { from = Ember.Binding.from(from); }\n from.to(to).connect(this);\n return from;\n },\n\n /**\n Returns a string representation which attempts to provide more information\n than Javascript's `toString` typically does, in a generic way for all Ember\n objects.\n\n App.Person = Em.Object.extend()\n person = App.Person.create()\n person.toString() //=> \"\"\n\n If the object's class is not defined on an Ember namespace, it will\n indicate it is a subclass of the registered superclass:\n\n Student = App.Person.extend()\n student = Student.create()\n student.toString() //=> \"<(subclass of App.Person):ember1025>\"\n\n If the method `toStringExtension` is defined, its return value will be\n included in the output.\n\n App.Teacher = App.Person.extend({\n toStringExtension: function(){\n return this.get('fullName');\n }\n });\n teacher = App.Teacher.create()\n teacher.toString(); //=> \"\"\n\n @method toString\n @return {String} string representation\n */\n toString: function toString() {\n var hasToStringExtension = typeof this.toStringExtension === 'function',\n extension = hasToStringExtension ? \":\" + this.toStringExtension() : '';\n var ret = '<'+this.constructor.toString()+':'+guidFor(this)+extension+'>';\n this.toString = makeToString(ret);\n return ret;\n }\n});\n\nCoreObject.PrototypeMixin.ownerConstructor = CoreObject;\n\nfunction makeToString(ret) {\n return function() { return ret; };\n}\n\nif (Ember.config.overridePrototypeMixin) {\n Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);\n}\n\nCoreObject.__super__ = null;\n\nvar ClassMixin = Mixin.create({\n\n ClassMixin: Ember.required(),\n\n PrototypeMixin: Ember.required(),\n\n isClass: true,\n\n isMethod: false,\n\n extend: function() {\n var Class = makeCtor(), proto;\n Class.ClassMixin = Mixin.create(this.ClassMixin);\n Class.PrototypeMixin = Mixin.create(this.PrototypeMixin);\n\n Class.ClassMixin.ownerConstructor = Class;\n Class.PrototypeMixin.ownerConstructor = Class;\n\n reopen.apply(Class.PrototypeMixin, arguments);\n\n Class.superclass = this;\n Class.__super__ = this.prototype;\n\n proto = Class.prototype = o_create(this.prototype);\n proto.constructor = Class;\n generateGuid(proto, 'ember');\n meta(proto).proto = proto; // this will disable observers on prototype\n\n Class.ClassMixin.apply(Class);\n return Class;\n },\n\n createWithMixins: function() {\n var C = this;\n if (arguments.length>0) { this._initMixins(arguments); }\n return new C();\n },\n\n create: function() {\n var C = this;\n if (arguments.length>0) { this._initProperties(arguments); }\n return new C();\n },\n\n reopen: function() {\n this.willReopen();\n reopen.apply(this.PrototypeMixin, arguments);\n return this;\n },\n\n reopenClass: function() {\n reopen.apply(this.ClassMixin, arguments);\n applyMixin(this, arguments, false);\n return this;\n },\n\n detect: function(obj) {\n if ('function' !== typeof obj) { return false; }\n while(obj) {\n if (obj===this) { return true; }\n obj = obj.superclass;\n }\n return false;\n },\n\n detectInstance: function(obj) {\n return obj instanceof this;\n },\n\n /**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For\n example, computed property functions may close over variables that are then\n no longer available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```javascript\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n Once you've done this, you can retrieve the values saved to the computed\n property from your class like this:\n\n ```javascript\n MyClass.metaForProperty('person');\n ```\n\n This will return the original hash that was passed to `meta()`.\n\n @method metaForProperty\n @param key {String} property name\n */\n metaForProperty: function(key) {\n var desc = meta(this.proto(), false).descs[key];\n\n Ember.assert(\"metaForProperty() could not find a computed property with key '\"+key+\"'.\", !!desc && desc instanceof Ember.ComputedProperty);\n return desc._meta || {};\n },\n\n /**\n Iterate over each computed property for the class, passing its name\n and any associated metadata (see `metaForProperty`) to the callback.\n\n @method eachComputedProperty\n @param {Function} callback\n @param {Object} binding\n */\n eachComputedProperty: function(callback, binding) {\n var proto = this.proto(),\n descs = meta(proto).descs,\n empty = {},\n property;\n\n for (var name in descs) {\n property = descs[name];\n\n if (property instanceof Ember.ComputedProperty) {\n callback.call(binding || this, name, property._meta || empty);\n }\n }\n }\n\n});\n\nClassMixin.ownerConstructor = CoreObject;\n\nif (Ember.config.overrideClassMixin) {\n Ember.config.overrideClassMixin(ClassMixin);\n}\n\nCoreObject.ClassMixin = ClassMixin;\nClassMixin.apply(CoreObject);\n\n/**\n @class CoreObject\n @namespace Ember\n*/\nEmber.CoreObject = CoreObject;\n\n})();\n//@ sourceURL=ember-runtime/system/core_object");minispade.register('ember-runtime/system/deferred', "(function() {minispade.require(\"ember-runtime/mixins/deferred\");\nminispade.require(\"ember-runtime/system/object\");\n\nvar DeferredMixin = Ember.DeferredMixin, // mixins/deferred\n get = Ember.get;\n\nvar Deferred = Ember.Object.extend(DeferredMixin);\n\nDeferred.reopenClass({\n promise: function(callback, binding) {\n var deferred = Deferred.create();\n callback.call(binding, deferred);\n return deferred;\n }\n});\n\nEmber.Deferred = Deferred;\n\n})();\n//@ sourceURL=ember-runtime/system/deferred");minispade.register('ember-runtime/system/each_proxy', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/mixins/array');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar set = Ember.set, get = Ember.get, guidFor = Ember.guidFor;\nvar forEach = Ember.EnumerableUtils.forEach;\n\nvar EachArray = Ember.Object.extend(Ember.Array, {\n\n init: function(content, keyName, owner) {\n this._super();\n this._keyName = keyName;\n this._owner = owner;\n this._content = content;\n },\n\n objectAt: function(idx) {\n var item = this._content.objectAt(idx);\n return item && get(item, this._keyName);\n },\n\n length: Ember.computed(function() {\n var content = this._content;\n return content ? get(content, 'length') : 0;\n })\n\n});\n\nvar IS_OBSERVER = /^.+:(before|change)$/;\n\nfunction addObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects, guid;\n if (!objects) objects = proxy._objects = {};\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n // keep track of the index each item was found at so we can map\n // it back when the obj changes.\n guid = guidFor(item);\n if (!objects[guid]) objects[guid] = [];\n objects[guid].push(loc);\n }\n }\n}\n\nfunction removeObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects;\n if (!objects) objects = proxy._objects = {};\n var indicies, guid;\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n guid = guidFor(item);\n indicies = objects[guid];\n indicies[indicies.indexOf(loc)] = null;\n }\n }\n}\n\n/**\n This is the object instance returned when you get the `@each` property on an\n array. It uses the unknownProperty handler to automatically create\n EachArray instances for property names.\n\n @private\n @class EachProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.EachProxy = Ember.Object.extend({\n\n init: function(content) {\n this._super();\n this._content = content;\n content.addArrayObserver(this);\n\n // in case someone is already observing some keys make sure they are\n // added\n forEach(Ember.watchedEvents(this), function(eventName) {\n this.didAddListener(eventName);\n }, this);\n },\n\n /**\n You can directly access mapped properties by simply requesting them.\n The `unknownProperty` handler will generate an EachArray of each item.\n\n @method unknownProperty\n @param keyName {String}\n @param value {*}\n */\n unknownProperty: function(keyName, value) {\n var ret;\n ret = new EachArray(this._content, keyName, this);\n Ember.defineProperty(this, keyName, null, ret);\n this.beginObservingContentKey(keyName);\n return ret;\n },\n\n // ..........................................................\n // ARRAY CHANGES\n // Invokes whenever the content array itself changes.\n\n arrayWillChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = removedCnt>0 ? idx+removedCnt : -1;\n Ember.beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) removeObserverForContentKey(content, key, this, idx, lim);\n\n Ember.propertyWillChange(this, key);\n }\n\n Ember.propertyWillChange(this._content, '@each');\n Ember.endPropertyChanges(this);\n },\n\n arrayDidChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = addedCnt>0 ? idx+addedCnt : -1;\n Ember.beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) addObserverForContentKey(content, key, this, idx, lim);\n\n Ember.propertyDidChange(this, key);\n }\n\n Ember.propertyDidChange(this._content, '@each');\n Ember.endPropertyChanges(this);\n },\n\n // ..........................................................\n // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS\n // Start monitoring keys based on who is listening...\n\n didAddListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.beginObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n didRemoveListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.stopObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n // ..........................................................\n // CONTENT KEY OBSERVING\n // Actual watch keys on the source content.\n\n beginObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (!keys) keys = this._keys = {};\n if (!keys[keyName]) {\n keys[keyName] = 1;\n var content = this._content,\n len = get(content, 'length');\n addObserverForContentKey(content, keyName, this, 0, len);\n } else {\n keys[keyName]++;\n }\n },\n\n stopObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {\n var content = this._content,\n len = get(content, 'length');\n removeObserverForContentKey(content, keyName, this, 0, len);\n }\n },\n\n contentKeyWillChange: function(obj, keyName) {\n Ember.propertyWillChange(this, keyName);\n },\n\n contentKeyDidChange: function(obj, keyName) {\n Ember.propertyDidChange(this, keyName);\n }\n\n});\n\n\n\n})();\n//@ sourceURL=ember-runtime/system/each_proxy");minispade.register('ember-runtime/system/lazy_load', "(function() {var forEach = Ember.ArrayPolyfills.forEach;\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar loadHooks = Ember.ENV.EMBER_LOAD_HOOKS || {};\nvar loaded = {};\n\n/**\n@method onLoad\n@for Ember\n@param name {String} name of hook\n@param callback {Function} callback to be called\n*/\nEmber.onLoad = function(name, callback) {\n var object;\n\n loadHooks[name] = loadHooks[name] || Ember.A();\n loadHooks[name].pushObject(callback);\n\n if (object = loaded[name]) {\n callback(object);\n }\n};\n\n/**\n@method runLoadHooks\n@for Ember\n@param name {String} name of hook\n@param object {Object} object to pass to callbacks\n*/\nEmber.runLoadHooks = function(name, object) {\n loaded[name] = object;\n\n if (loadHooks[name]) {\n forEach.call(loadHooks[name], function(callback) {\n callback(object);\n });\n }\n};\n\n})();\n//@ sourceURL=ember-runtime/system/lazy_load");minispade.register('ember-runtime/system/namespace', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, indexOf = Ember.ArrayPolyfills.indexOf;\n\n/**\n A Namespace is an object usually used to contain other objects or methods\n such as an application or framework. Create a namespace anytime you want\n to define one of these new containers.\n\n # Example Usage\n\n ```javascript\n MyFramework = Ember.Namespace.create({\n VERSION: '1.0.0'\n });\n ```\n\n @class Namespace\n @namespace Ember\n @extends Ember.Object\n*/\nvar Namespace = Ember.Namespace = Ember.Object.extend({\n isNamespace: true,\n\n init: function() {\n Ember.Namespace.NAMESPACES.push(this);\n Ember.Namespace.PROCESSED = false;\n },\n\n toString: function() {\n var name = get(this, 'name');\n if (name) { return name; }\n\n findNamespaces();\n return this[Ember.GUID_KEY+'_name'];\n },\n\n nameClasses: function() {\n processNamespace([this.toString()], this, {});\n },\n\n destroy: function() {\n var namespaces = Ember.Namespace.NAMESPACES;\n Ember.lookup[this.toString()] = undefined;\n namespaces.splice(indexOf.call(namespaces, this), 1);\n this._super();\n }\n});\n\nNamespace.reopenClass({\n NAMESPACES: [Ember],\n NAMESPACES_BY_ID: {},\n PROCESSED: false,\n processAll: processAllNamespaces,\n byName: function(name) {\n if (!Ember.BOOTED) {\n processAllNamespaces();\n }\n\n return NAMESPACES_BY_ID[name];\n }\n});\n\nvar NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;\n\nvar hasOwnProp = ({}).hasOwnProperty,\n guidFor = Ember.guidFor;\n\nfunction processNamespace(paths, root, seen) {\n var idx = paths.length;\n\n NAMESPACES_BY_ID[paths.join('.')] = root;\n\n // Loop over all of the keys in the namespace, looking for classes\n for(var key in root) {\n if (!hasOwnProp.call(root, key)) { continue; }\n var obj = root[key];\n\n // If we are processing the `Ember` namespace, for example, the\n // `paths` will start with `[\"Ember\"]`. Every iteration through\n // the loop will update the **second** element of this list with\n // the key, so processing `Ember.View` will make the Array\n // `['Ember', 'View']`.\n paths[idx] = key;\n\n // If we have found an unprocessed class\n if (obj && obj.toString === classToString) {\n // Replace the class' `toString` with the dot-separated path\n // and set its `NAME_KEY`\n obj.toString = makeToString(paths.join('.'));\n obj[NAME_KEY] = paths.join('.');\n\n // Support nested namespaces\n } else if (obj && obj.isNamespace) {\n // Skip aliased namespaces\n if (seen[guidFor(obj)]) { continue; }\n seen[guidFor(obj)] = true;\n\n // Process the child namespace\n processNamespace(paths, obj, seen);\n }\n }\n\n paths.length = idx; // cut out last item\n}\n\nfunction findNamespaces() {\n var Namespace = Ember.Namespace, lookup = Ember.lookup, obj, isNamespace;\n\n if (Namespace.PROCESSED) { return; }\n\n for (var prop in lookup) {\n // These don't raise exceptions but can cause warnings\n if (prop === \"parent\" || prop === \"top\" || prop === \"frameElement\" || prop === \"webkitStorageInfo\") { continue; }\n\n // get(window.globalStorage, 'isNamespace') would try to read the storage for domain isNamespace and cause exception in Firefox.\n // globalStorage is a storage obsoleted by the WhatWG storage specification. See https://developer.mozilla.org/en/DOM/Storage#globalStorage\n if (prop === \"globalStorage\" && lookup.StorageList && lookup.globalStorage instanceof lookup.StorageList) { continue; }\n // Unfortunately, some versions of IE don't support window.hasOwnProperty\n if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }\n\n // At times we are not allowed to access certain properties for security reasons.\n // There are also times where even if we can access them, we are not allowed to access their properties.\n try {\n obj = Ember.lookup[prop];\n isNamespace = obj && obj.isNamespace;\n } catch (e) {\n continue;\n }\n\n if (isNamespace) {\n Ember.deprecate(\"Namespaces should not begin with lowercase.\", /^[A-Z]/.test(prop));\n obj[NAME_KEY] = prop;\n }\n }\n}\n\nvar NAME_KEY = Ember.NAME_KEY = Ember.GUID_KEY + '_name';\n\nfunction superClassString(mixin) {\n var superclass = mixin.superclass;\n if (superclass) {\n if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }\n else { return superClassString(superclass); }\n } else {\n return;\n }\n}\n\nfunction classToString() {\n if (!Ember.BOOTED && !this[NAME_KEY]) {\n processAllNamespaces();\n }\n\n var ret;\n\n if (this[NAME_KEY]) {\n ret = this[NAME_KEY];\n } else {\n var str = superClassString(this);\n if (str) {\n ret = \"(subclass of \" + str + \")\";\n } else {\n ret = \"(unknown mixin)\";\n }\n this.toString = makeToString(ret);\n }\n\n return ret;\n}\n\nfunction processAllNamespaces() {\n var unprocessedNamespaces = !Namespace.PROCESSED,\n unprocessedMixins = Ember.anyUnprocessedMixins;\n\n if (unprocessedNamespaces) {\n findNamespaces();\n Namespace.PROCESSED = true;\n }\n\n if (unprocessedNamespaces || unprocessedMixins) {\n var namespaces = Namespace.NAMESPACES, namespace;\n for (var i=0, l=namespaces.length; i=0;idx--) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n copy: function(deep) {\n if (deep) {\n return this.map(function(item){ return Ember.copy(item, true); });\n }\n\n return this.slice();\n }\n});\n\n// Remove any methods implemented natively so we don't override them\nvar ignore = ['length'];\nEmber.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {\n if (Array.prototype[methodName]) ignore.push(methodName);\n});\n\nif (ignore.length>0) {\n NativeArray = NativeArray.without.apply(NativeArray, ignore);\n}\n\n/**\n The NativeArray mixin contains the properties needed to to make the native\n Array support Ember.MutableArray and all of its dependent APIs. Unless you\n have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to\n false, this will be applied automatically. Otherwise you can apply the mixin\n at anytime by calling `Ember.NativeArray.activate`.\n\n @class NativeArray\n @namespace Ember\n @extends Ember.Mixin\n @uses Ember.MutableArray\n @uses Ember.Observable\n @uses Ember.Copyable\n*/\nEmber.NativeArray = NativeArray;\n\n/**\n Creates an `Ember.NativeArray` from an Array like object.\n Does not modify the original object.\n\n @method A\n @for Ember\n @return {Ember.NativeArray}\n*/\nEmber.A = function(arr){\n if (arr === undefined) { arr = []; }\n return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);\n};\n\n/**\n Activates the mixin on the Array.prototype if not already applied. Calling\n this method more than once is safe.\n\n @method activate\n @for Ember.NativeArray\n @static\n @return {void}\n*/\nEmber.NativeArray.activate = function() {\n NativeArray.apply(Array.prototype);\n\n Ember.A = function(arr) { return arr || []; };\n};\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n Ember.NativeArray.activate();\n}\n\n\n})();\n//@ sourceURL=ember-runtime/system/native_array");minispade.register('ember-runtime/system/object', "(function() {minispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/system/core_object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.Object` is the main base class for all Ember objects. It is a subclass\n of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,\n see the documentation for each of these.\n\n @class Object\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.Observable\n*/\nEmber.Object = Ember.CoreObject.extend(Ember.Observable);\nEmber.Object.toString = function() { return \"Ember.Object\"; };\n\n})();\n//@ sourceURL=ember-runtime/system/object");minispade.register('ember-runtime/system/object_proxy', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get,\n set = Ember.set,\n fmt = Ember.String.fmt,\n addBeforeObserver = Ember.addBeforeObserver,\n addObserver = Ember.addObserver,\n removeBeforeObserver = Ember.removeBeforeObserver,\n removeObserver = Ember.removeObserver,\n propertyWillChange = Ember.propertyWillChange,\n propertyDidChange = Ember.propertyDidChange;\n\nfunction contentPropertyWillChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyWillChange(this, key);\n}\n\nfunction contentPropertyDidChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyDidChange(this, key);\n}\n\n/**\n `Ember.ObjectProxy` forwards all properties not defined by the proxy itself\n to a proxied `content` object.\n\n ```javascript\n object = Ember.Object.create({\n name: 'Foo'\n });\n\n proxy = Ember.ObjectProxy.create({\n content: object\n });\n\n // Access and change existing properties\n proxy.get('name') // 'Foo'\n proxy.set('name', 'Bar');\n object.get('name') // 'Bar'\n\n // Create new 'description' property on `object`\n proxy.set('description', 'Foo is a whizboo baz');\n object.get('description') // 'Foo is a whizboo baz'\n ```\n\n While `content` is unset, setting a property to be delegated will throw an\n Error.\n\n ```javascript\n proxy = Ember.ObjectProxy.create({\n content: null,\n flag: null\n });\n proxy.set('flag', true);\n proxy.get('flag'); // true\n proxy.get('foo'); // undefined\n proxy.set('foo', 'data'); // throws Error\n ```\n\n Delegated properties can be bound to and will change when content is updated.\n\n Computed properties on the proxy itself can depend on delegated properties.\n\n ```javascript\n ProxyWithComputedProperty = Ember.ObjectProxy.extend({\n fullName: function () {\n var firstName = this.get('firstName'),\n lastName = this.get('lastName');\n if (firstName && lastName) {\n return firstName + ' ' + lastName;\n }\n return firstName || lastName;\n }.property('firstName', 'lastName')\n });\n\n proxy = ProxyWithComputedProperty.create();\n\n proxy.get('fullName'); // undefined\n proxy.set('content', {\n firstName: 'Tom', lastName: 'Dale'\n }); // triggers property change for fullName on proxy\n\n proxy.get('fullName'); // 'Tom Dale'\n ```\n\n @class ObjectProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.ObjectProxy = Ember.Object.extend(\n/** @scope Ember.ObjectProxy.prototype */ {\n /**\n The object whose properties will be forwarded.\n\n @property content\n @type Ember.Object\n @default null\n */\n content: null,\n _contentDidChange: Ember.observer(function() {\n Ember.assert(\"Can't set ObjectProxy's content to itself\", this.get('content') !== this);\n }, 'content'),\n\n isTruthy: Ember.computed.bool('content'),\n\n _debugContainerKey: null,\n\n willWatchProperty: function (key) {\n var contentKey = 'content.' + key;\n addBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n addObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n didUnwatchProperty: function (key) {\n var contentKey = 'content.' + key;\n removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n removeObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n unknownProperty: function (key) {\n var content = get(this, 'content');\n if (content) {\n return get(content, key);\n }\n },\n\n setUnknownProperty: function (key, value) {\n var content = get(this, 'content');\n Ember.assert(fmt(\"Cannot delegate set('%@', %@) to the 'content' property of object proxy %@: its 'content' is undefined.\", [key, value, this]), content);\n return set(content, key, value);\n }\n});\n\nEmber.ObjectProxy.reopenClass({\n create: function () {\n var mixin, prototype, i, l, properties, keyName;\n if (arguments.length) {\n prototype = this.proto();\n for (i = 0, l = arguments.length; i < l; i++) {\n properties = arguments[i];\n for (keyName in properties) {\n if (!properties.hasOwnProperty(keyName) || keyName in prototype) { continue; }\n if (!mixin) mixin = {};\n mixin[keyName] = null;\n }\n }\n if (mixin) this._initMixins([mixin]);\n }\n return this._super.apply(this, arguments);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/system/object_proxy");minispade.register('ember-runtime/system/set', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/freezable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, isNone = Ember.isNone, fmt = Ember.String.fmt;\n\n/**\n An unordered collection of objects.\n\n A Set works a bit like an array except that its items are not ordered. You\n can create a set to efficiently test for membership for an object. You can\n also iterate through a set just like an array, even accessing objects by\n index, however there is no guarantee as to their order.\n\n All Sets are observable via the Enumerable Observer API - which works\n on any enumerable object including both Sets and Arrays.\n\n ## Creating a Set\n\n You can create a set like you would most objects using\n `new Ember.Set()`. Most new sets you create will be empty, but you can\n also initialize the set with some content by passing an array or other\n enumerable of objects to the constructor.\n\n Finally, you can pass in an existing set and the set will be copied. You\n can also create a copy of a set by calling `Ember.Set#copy()`.\n\n ```javascript\n // creates a new empty set\n var foundNames = new Ember.Set();\n\n // creates a set with four names in it.\n var names = new Ember.Set([\"Charles\", \"Tom\", \"Juan\", \"Alex\"]); // :P\n\n // creates a copy of the names set.\n var namesCopy = new Ember.Set(names);\n\n // same as above.\n var anotherNamesCopy = names.copy();\n ```\n\n ## Adding/Removing Objects\n\n You generally add or remove objects from a set using `add()` or\n `remove()`. You can add any type of object including primitives such as\n numbers, strings, and booleans.\n\n Unlike arrays, objects can only exist one time in a set. If you call `add()`\n on a set with the same object multiple times, the object will only be added\n once. Likewise, calling `remove()` with the same object multiple times will\n remove the object the first time and have no effect on future calls until\n you add the object to the set again.\n\n NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do\n so will be ignored.\n\n In addition to add/remove you can also call `push()`/`pop()`. Push behaves\n just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary\n object, remove it and return it. This is a good way to use a set as a job\n queue when you don't care which order the jobs are executed in.\n\n ## Testing for an Object\n\n To test for an object's presence in a set you simply call\n `Ember.Set#contains()`.\n\n ## Observing changes\n\n When using `Ember.Set`, you can observe the `\"[]\"` property to be\n alerted whenever the content changes. You can also add an enumerable\n observer to the set to be notified of specific objects that are added and\n removed from the set. See `Ember.Enumerable` for more information on\n enumerables.\n\n This is often unhelpful. If you are filtering sets of objects, for instance,\n it is very inefficient to re-filter all of the items each time the set\n changes. It would be better if you could just adjust the filtered set based\n on what was changed on the original set. The same issue applies to merging\n sets, as well.\n\n ## Other Methods\n\n `Ember.Set` primary implements other mixin APIs. For a complete reference\n on the methods you will use with `Ember.Set`, please consult these mixins.\n The most useful ones will be `Ember.Enumerable` and\n `Ember.MutableEnumerable` which implement most of the common iterator\n methods you are used to on Array.\n\n Note that you can also use the `Ember.Copyable` and `Ember.Freezable`\n APIs on `Ember.Set` as well. Once a set is frozen it can no longer be\n modified. The benefit of this is that when you call `frozenCopy()` on it,\n Ember will avoid making copies of the set. This allows you to write\n code that can know with certainty when the underlying set data will or\n will not be modified.\n\n @class Set\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.MutableEnumerable\n @uses Ember.Copyable\n @uses Ember.Freezable\n @since Ember 0.9\n*/\nEmber.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,\n /** @scope Ember.Set.prototype */ {\n\n // ..........................................................\n // IMPLEMENT ENUMERABLE APIS\n //\n\n /**\n This property will change as the number of objects in the set changes.\n\n @property length\n @type number\n @default 0\n */\n length: 0,\n\n /**\n Clears the set. This is useful if you want to reuse an existing set\n without having to recreate it.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.length; // 3\n colors.clear();\n colors.length; // 0\n ```\n\n @method clear\n @return {Ember.Set} An empty Set\n */\n clear: function() {\n if (this.isFrozen) { throw new Error(Ember.FROZEN_ERROR); }\n\n var len = get(this, 'length');\n if (len === 0) { return this; }\n\n var guid;\n\n this.enumerableContentWillChange(len, 0);\n Ember.propertyWillChange(this, 'firstObject');\n Ember.propertyWillChange(this, 'lastObject');\n\n for (var i=0; i < len; i++){\n guid = guidFor(this[i]);\n delete this[guid];\n delete this[i];\n }\n\n set(this, 'length', 0);\n\n Ember.propertyDidChange(this, 'firstObject');\n Ember.propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(len, 0);\n\n return this;\n },\n\n /**\n Returns true if the passed object is also an enumerable that contains the\n same objects as the receiver.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"],\n same_colors = new Ember.Set(colors);\n\n same_colors.isEqual(colors); // true\n same_colors.isEqual([\"purple\", \"brown\"]); // false\n ```\n\n @method isEqual\n @param {Ember.Set} obj the other object.\n @return {Boolean}\n */\n isEqual: function(obj) {\n // fail fast\n if (!Ember.Enumerable.detect(obj)) return false;\n\n var loc = get(this, 'length');\n if (get(obj, 'length') !== loc) return false;\n\n while(--loc >= 0) {\n if (!obj.contains(this[loc])) return false;\n }\n\n return true;\n },\n\n /**\n Adds an object to the set. Only non-`null` objects can be added to a set\n and those can only be added once. If the object is already in the set or\n the passed value is null this method will have no effect.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"red\"); // [\"blue\", \"red\"]\n colors.add(null); // [\"blue\", \"red\"]\n colors.add(undefined); // [\"blue\", \"red\"]\n ```\n\n @method add\n @param {Object} obj The object to add.\n @return {Ember.Set} The set itself.\n */\n add: Ember.aliasMethod('addObject'),\n\n /**\n Removes the object from the set if it is found. If you pass a `null` value\n or an object that is already not in the set, this method will have no\n effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.remove(\"red\"); // [\"blue\", \"green\"]\n colors.remove(\"purple\"); // [\"blue\", \"green\"]\n colors.remove(null); // [\"blue\", \"green\"]\n ```\n\n @method remove\n @param {Object} obj The object to remove\n @return {Ember.Set} The set itself.\n */\n remove: Ember.aliasMethod('removeObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.pop(); // \"blue\"\n colors.pop(); // \"green\"\n colors.pop(); // null\n ```\n\n @method pop\n @return {Object} The removed object from the set or null.\n */\n pop: function() {\n if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);\n var obj = this.length > 0 ? this[this.length-1] : null;\n this.remove(obj);\n return obj;\n },\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.push(\"red\"); // [\"red\"]\n colors.push(\"green\"); // [\"red\", \"green\"]\n colors.push(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method push\n @return {Ember.Set} The set itself.\n */\n push: Ember.aliasMethod('addObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n This is an alias for `Ember.Set.pop()`.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.shift(); // \"blue\"\n colors.shift(); // \"green\"\n colors.shift(); // null\n ```\n\n @method shift\n @return {Object} The removed object from the set or null.\n */\n shift: Ember.aliasMethod('pop'),\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias of `Ember.Set.push()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.unshift(\"red\"); // [\"red\"]\n colors.unshift(\"green\"); // [\"red\", \"green\"]\n colors.unshift(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method unshift\n @return {Ember.Set} The set itself.\n */\n unshift: Ember.aliasMethod('push'),\n\n /**\n Adds each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.addObjects()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.addEach([\"red\", \"green\", \"blue\"]); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method addEach\n @param {Ember.Enumerable} objects the objects to add.\n @return {Ember.Set} The set itself.\n */\n addEach: Ember.aliasMethod('addObjects'),\n\n /**\n Removes each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.removeObjects()`\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.removeEach([\"red\", \"blue\"]); // [\"green\"]\n ```\n\n @method removeEach\n @param {Ember.Enumerable} objects the objects to remove.\n @return {Ember.Set} The set itself.\n */\n removeEach: Ember.aliasMethod('removeObjects'),\n\n // ..........................................................\n // PRIVATE ENUMERABLE SUPPORT\n //\n\n init: function(items) {\n this._super();\n if (items) this.addObjects(items);\n },\n\n // implement Ember.Enumerable\n nextObject: function(idx) {\n return this[idx];\n },\n\n // more optimized version\n firstObject: Ember.computed(function() {\n return this.length > 0 ? this[0] : undefined;\n }),\n\n // more optimized version\n lastObject: Ember.computed(function() {\n return this.length > 0 ? this[this.length-1] : undefined;\n }),\n\n // implements Ember.MutableEnumerable\n addObject: function(obj) {\n if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);\n if (isNone(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n added ;\n\n if (idx>=0 && idx=0 && idx=0;\n },\n\n copy: function() {\n var C = this.constructor, ret = new C(), loc = get(this, 'length');\n set(ret, 'length', loc);\n while(--loc>=0) {\n ret[loc] = this[loc];\n ret[guidFor(this[loc])] = loc;\n }\n return ret;\n },\n\n toString: function() {\n var len = this.length, idx, array = [];\n for(idx = 0; idx < len; idx++) {\n array[idx] = this[idx];\n }\n return fmt(\"Ember.Set<%@>\", [array.join(',')]);\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/system/set");minispade.register('ember-runtime/system/string', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar STRING_DASHERIZE_REGEXP = (/[ _]/g);\nvar STRING_DASHERIZE_CACHE = {};\nvar STRING_DECAMELIZE_REGEXP = (/([a-z])([A-Z])/g);\nvar STRING_CAMELIZE_REGEXP = (/(\\-|_|\\.|\\s)+(.)?/g);\nvar STRING_UNDERSCORE_REGEXP_1 = (/([a-z\\d])([A-Z]+)/g);\nvar STRING_UNDERSCORE_REGEXP_2 = (/\\-|\\s+/g);\n\n/**\n Defines the hash of localized strings for the current language. Used by\n the `Ember.String.loc()` helper. To localize, add string values to this\n hash.\n\n @property STRINGS\n @for Ember\n @type Hash\n*/\nEmber.STRINGS = {};\n\n/**\n Defines string helper methods including string formatting and localization.\n Unless `Ember.EXTEND_PROTOTYPES.String` is `false` these methods will also be\n added to the `String.prototype` as well.\n\n @class String\n @namespace Ember\n @static\n*/\nEmber.String = {\n\n /**\n Apply formatting options to the string. This will look for occurrences\n of \"%@\" in your string and substitute them with the arguments you pass into\n this method. If you want to control the specific order of replacement,\n you can add a number after the key as well to indicate which argument\n you want to insert.\n\n Ordered insertions are most useful when building loc strings where values\n you need to insert may appear in different orders.\n\n ```javascript\n \"Hello %@ %@\".fmt('John', 'Doe'); // \"Hello John Doe\"\n \"Hello %@2, %@1\".fmt('John', 'Doe'); // \"Hello Doe, John\"\n ```\n\n @method fmt\n @param {String} str The string to format\n @param {Array} formats An array of parameters to interpolate into string.\n @return {String} formatted string\n */\n fmt: function(str, formats) {\n // first, replace any ORDERED replacements.\n var idx = 0; // the current index for non-numerical replacements\n return str.replace(/%@([0-9]+)?/g, function(s, argIndex) {\n argIndex = (argIndex) ? parseInt(argIndex,0) - 1 : idx++ ;\n s = formats[argIndex];\n return ((s === null) ? '(null)' : (s === undefined) ? '' : s).toString();\n }) ;\n },\n\n /**\n Formats the passed string, but first looks up the string in the localized\n strings hash. This is a convenient way to localize text. See\n `Ember.String.fmt()` for more information on formatting.\n\n Note that it is traditional but not required to prefix localized string\n keys with an underscore or other character so you can easily identify\n localized strings.\n\n ```javascript\n Ember.STRINGS = {\n '_Hello World': 'Bonjour le monde',\n '_Hello %@ %@': 'Bonjour %@ %@'\n };\n\n Ember.String.loc(\"_Hello World\"); // 'Bonjour le monde';\n Ember.String.loc(\"_Hello %@ %@\", [\"John\", \"Smith\"]); // \"Bonjour John Smith\";\n ```\n\n @method loc\n @param {String} str The string to format\n @param {Array} formats Optional array of parameters to interpolate into string.\n @return {String} formatted string\n */\n loc: function(str, formats) {\n str = Ember.STRINGS[str] || str;\n return Ember.String.fmt(str, formats) ;\n },\n\n /**\n Splits a string into separate units separated by spaces, eliminating any\n empty strings in the process. This is a convenience method for split that\n is mostly useful when applied to the `String.prototype`.\n\n ```javascript\n Ember.String.w(\"alpha beta gamma\").forEach(function(key) {\n console.log(key);\n });\n\n // > alpha\n // > beta\n // > gamma\n ```\n\n @method w\n @param {String} str The string to split\n @return {String} split string\n */\n w: function(str) { return str.split(/\\s+/); },\n\n /**\n Converts a camelized string into all lower case separated by underscores.\n\n ```javascript\n 'innerHTML'.decamelize(); // 'inner_html'\n 'action_name'.decamelize(); // 'action_name'\n 'css-class-name'.decamelize(); // 'css-class-name'\n 'my favorite items'.decamelize(); // 'my favorite items'\n ```\n\n @method decamelize\n @param {String} str The string to decamelize.\n @return {String} the decamelized string.\n */\n decamelize: function(str) {\n return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();\n },\n\n /**\n Replaces underscores or spaces with dashes.\n\n ```javascript\n 'innerHTML'.dasherize(); // 'inner-html'\n 'action_name'.dasherize(); // 'action-name'\n 'css-class-name'.dasherize(); // 'css-class-name'\n 'my favorite items'.dasherize(); // 'my-favorite-items'\n ```\n\n @method dasherize\n @param {String} str The string to dasherize.\n @return {String} the dasherized string.\n */\n dasherize: function(str) {\n var cache = STRING_DASHERIZE_CACHE,\n hit = cache.hasOwnProperty(str),\n ret;\n\n if (hit) {\n return cache[str];\n } else {\n ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');\n cache[str] = ret;\n }\n\n return ret;\n },\n\n /**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.camelize(); // 'innerHTML'\n 'action_name'.camelize(); // 'actionName'\n 'css-class-name'.camelize(); // 'cssClassName'\n 'my favorite items'.camelize(); // 'myFavoriteItems'\n 'My Favorite Items'.camelize(); // 'myFavoriteItems'\n ```\n\n @method camelize\n @param {String} str The string to camelize.\n @return {String} the camelized string.\n */\n camelize: function(str) {\n return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) {\n return chr ? chr.toUpperCase() : '';\n }).replace(/^([A-Z])/, function(match, separator, chr) {\n return match.toLowerCase();\n });\n },\n\n /**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.classify(); // 'InnerHTML'\n 'action_name'.classify(); // 'ActionName'\n 'css-class-name'.classify(); // 'CssClassName'\n 'my favorite items'.classify(); // 'MyFavoriteItems'\n ```\n\n @method classify\n @param {String} str the string to classify\n @return {String} the classified string\n */\n classify: function(str) {\n var parts = str.split(\".\"),\n out = [];\n\n for (var i=0, l=parts.length; i` state will be added to the list of enter and exit\n // states because its context has changed.\n\n while (contexts.length > 0) {\n if (stateIdx >= 0) {\n state = this.enterStates[stateIdx--];\n } else {\n if (this.enterStates.length) {\n state = get(this.enterStates[0], 'parentState');\n if (!state) { throw \"Cannot match all contexts to states\"; }\n } else {\n // If re-entering the current state with a context, the resolve\n // state will be the current state.\n state = this.resolveState;\n }\n\n this.enterStates.unshift(state);\n this.exitStates.unshift(state);\n }\n\n // in routers, only states with dynamic segments have a context\n if (get(state, 'hasContext')) {\n context = contexts.pop();\n } else {\n context = null;\n }\n\n matchedContexts.unshift(context);\n }\n\n this.contexts = matchedContexts;\n },\n\n /**\n Add any `initialState`s to the list of enter states.\n\n @method addInitialStates\n */\n addInitialStates: function() {\n var finalState = this.finalState, initialState;\n\n while(true) {\n initialState = get(finalState, 'initialState') || 'start';\n finalState = get(finalState, 'states.' + initialState);\n\n if (!finalState) { break; }\n\n this.finalState = finalState;\n this.enterStates.push(finalState);\n this.contexts.push(undefined);\n }\n },\n\n /**\n Remove any states that were added because the number of contexts\n exceeded the number of explicit enter states, but the context has\n not changed since the last time the state was entered.\n\n @method removeUnchangedContexts\n @param {Ember.StateManager} manager passed in to look up the last\n context for a states\n */\n removeUnchangedContexts: function(manager) {\n // Start from the beginning of the enter states. If the state was added\n // to the list during the context matching phase, make sure the context\n // has actually changed since the last time the state was entered.\n while (this.enterStates.length > 0) {\n if (this.enterStates[0] !== this.exitStates[0]) { break; }\n\n if (this.enterStates.length === this.contexts.length) {\n if (manager.getStateMeta(this.enterStates[0], 'context') !== this.contexts[0]) { break; }\n this.contexts.shift();\n }\n\n this.resolveState = this.enterStates.shift();\n this.exitStates.shift();\n }\n }\n};\n\nvar sendRecursively = function(event, currentState, isUnhandledPass) {\n var log = this.enableLogging,\n eventName = isUnhandledPass ? 'unhandledEvent' : event,\n action = currentState[eventName],\n contexts, sendRecursiveArguments, actionArguments;\n\n contexts = [].slice.call(arguments, 3);\n\n // Test to see if the action is a method that\n // can be invoked. Don't blindly check just for\n // existence, because it is possible the state\n // manager has a child state of the given name,\n // and we should still raise an exception in that\n // case.\n if (typeof action === 'function') {\n if (log) {\n if (isUnhandledPass) {\n Ember.Logger.log(fmt(\"STATEMANAGER: Unhandled event '%@' being sent to state %@.\", [event, get(currentState, 'path')]));\n } else {\n Ember.Logger.log(fmt(\"STATEMANAGER: Sending event '%@' to state %@.\", [event, get(currentState, 'path')]));\n }\n }\n\n actionArguments = contexts;\n if (isUnhandledPass) {\n actionArguments.unshift(event);\n }\n actionArguments.unshift(this);\n\n return action.apply(currentState, actionArguments);\n } else {\n var parentState = get(currentState, 'parentState');\n if (parentState) {\n\n sendRecursiveArguments = contexts;\n sendRecursiveArguments.unshift(event, parentState, isUnhandledPass);\n\n return sendRecursively.apply(this, sendRecursiveArguments);\n } else if (!isUnhandledPass) {\n return sendEvent.call(this, event, contexts, true);\n }\n }\n};\n\nvar sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {\n sendRecursiveArguments.unshift(eventName, get(this, 'currentState'), isUnhandledPass);\n return sendRecursively.apply(this, sendRecursiveArguments);\n};\n\n/**\n StateManager is part of Ember's implementation of a finite state machine. A\n StateManager instance manages a number of properties that are instances of\n `Ember.State`,\n tracks the current active state, and triggers callbacks when states have changed.\n\n ## Defining States\n\n The states of StateManager can be declared in one of two ways. First, you can\n define a `states` property that contains all the states:\n\n ```javascript\n managerA = Ember.StateManager.create({\n states: {\n stateOne: Ember.State.create(),\n stateTwo: Ember.State.create()\n }\n })\n\n managerA.get('states')\n // {\n // stateOne: Ember.State.create(),\n // stateTwo: Ember.State.create()\n // }\n ```\n\n You can also add instances of `Ember.State` (or an `Ember.State` subclass)\n directly as properties of a StateManager. These states will be collected into\n the `states` property for you.\n\n ```javascript\n managerA = Ember.StateManager.create({\n stateOne: Ember.State.create(),\n stateTwo: Ember.State.create()\n })\n\n managerA.get('states')\n // {\n // stateOne: Ember.State.create(),\n // stateTwo: Ember.State.create()\n // }\n ```\n\n ## The Initial State\n\n When created a StateManager instance will immediately enter into the state\n defined as its `start` property or the state referenced by name in its\n `initialState` property:\n\n ```javascript\n managerA = Ember.StateManager.create({\n start: Ember.State.create({})\n })\n\n managerA.get('currentState.name') // 'start'\n\n managerB = Ember.StateManager.create({\n initialState: 'beginHere',\n beginHere: Ember.State.create({})\n })\n\n managerB.get('currentState.name') // 'beginHere'\n ```\n\n Because it is a property you may also provide a computed function if you wish\n to derive an `initialState` programmatically:\n\n ```javascript\n managerC = Ember.StateManager.create({\n initialState: function(){\n if (someLogic) {\n return 'active';\n } else {\n return 'passive';\n }\n }.property(),\n active: Ember.State.create({}),\n passive: Ember.State.create({})\n })\n ```\n\n ## Moving Between States\n\n A StateManager can have any number of `Ember.State` objects as properties\n and can have a single one of these states as its current state.\n\n Calling `transitionTo` transitions between states:\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({}),\n poweredUp: Ember.State.create({})\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n robotManager.transitionTo('poweredUp')\n robotManager.get('currentState.name') // 'poweredUp'\n ```\n\n Before transitioning into a new state the existing `currentState` will have\n its `exit` method called with the StateManager instance as its first argument\n and an object representing the transition as its second argument.\n\n After transitioning into a new state the new `currentState` will have its\n `enter` method called with the StateManager instance as its first argument\n and an object representing the transition as its second argument.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n exit: function(stateManager){\n console.log(\"exiting the poweredDown state\")\n }\n }),\n poweredUp: Ember.State.create({\n enter: function(stateManager){\n console.log(\"entering the poweredUp state. Destroy all humans.\")\n }\n })\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n robotManager.transitionTo('poweredUp')\n\n // will log\n // 'exiting the poweredDown state'\n // 'entering the poweredUp state. Destroy all humans.'\n ```\n\n Once a StateManager is already in a state, subsequent attempts to enter that\n state will not trigger enter or exit method calls. Attempts to transition\n into a state that the manager does not have will result in no changes in the\n StateManager's current state:\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n exit: function(stateManager){\n console.log(\"exiting the poweredDown state\")\n }\n }),\n poweredUp: Ember.State.create({\n enter: function(stateManager){\n console.log(\"entering the poweredUp state. Destroy all humans.\")\n }\n })\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n robotManager.transitionTo('poweredUp')\n // will log\n // 'exiting the poweredDown state'\n // 'entering the poweredUp state. Destroy all humans.'\n robotManager.transitionTo('poweredUp') // no logging, no state change\n\n robotManager.transitionTo('someUnknownState') // silently fails\n robotManager.get('currentState.name') // 'poweredUp'\n ```\n\n Each state property may itself contain properties that are instances of\n `Ember.State`. The StateManager can transition to specific sub-states in a\n series of transitionTo method calls or via a single transitionTo with the\n full path to the specific state. The StateManager will also keep track of the\n full path to its currentState\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n charging: Ember.State.create(),\n charged: Ember.State.create()\n }),\n poweredUp: Ember.State.create({\n mobile: Ember.State.create(),\n stationary: Ember.State.create()\n })\n })\n\n robotManager.get('currentState.name') // 'poweredDown'\n\n robotManager.transitionTo('poweredUp')\n robotManager.get('currentState.name') // 'poweredUp'\n\n robotManager.transitionTo('mobile')\n robotManager.get('currentState.name') // 'mobile'\n\n // transition via a state path\n robotManager.transitionTo('poweredDown.charging')\n robotManager.get('currentState.name') // 'charging'\n\n robotManager.get('currentState.path') // 'poweredDown.charging'\n ```\n\n Enter transition methods will be called for each state and nested child state\n in their hierarchical order. Exit methods will be called for each state and\n its nested states in reverse hierarchical order.\n\n Exit transitions for a parent state are not called when entering into one of\n its child states, only when transitioning to a new section of possible states\n in the hierarchy.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown',\n poweredDown: Ember.State.create({\n enter: function(){},\n exit: function(){\n console.log(\"exited poweredDown state\")\n },\n charging: Ember.State.create({\n enter: function(){},\n exit: function(){}\n }),\n charged: Ember.State.create({\n enter: function(){\n console.log(\"entered charged state\")\n },\n exit: function(){\n console.log(\"exited charged state\")\n }\n })\n }),\n poweredUp: Ember.State.create({\n enter: function(){\n console.log(\"entered poweredUp state\")\n },\n exit: function(){},\n mobile: Ember.State.create({\n enter: function(){\n console.log(\"entered mobile state\")\n },\n exit: function(){}\n }),\n stationary: Ember.State.create({\n enter: function(){},\n exit: function(){}\n })\n })\n })\n\n\n robotManager.get('currentState.path') // 'poweredDown'\n robotManager.transitionTo('charged')\n // logs 'entered charged state'\n // but does *not* log 'exited poweredDown state'\n robotManager.get('currentState.name') // 'charged\n\n robotManager.transitionTo('poweredUp.mobile')\n // logs\n // 'exited charged state'\n // 'exited poweredDown state'\n // 'entered poweredUp state'\n // 'entered mobile state'\n ```\n\n During development you can set a StateManager's `enableLogging` property to\n `true` to receive console messages of state transitions.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n enableLogging: true\n })\n ```\n\n ## Managing currentState with Actions\n\n To control which transitions are possible for a given state, and\n appropriately handle external events, the StateManager can receive and\n route action messages to its states via the `send` method. Calling to\n `send` with an action name will begin searching for a method with the same\n name starting at the current state and moving up through the parent states\n in a state hierarchy until an appropriate method is found or the StateManager\n instance itself is reached.\n\n If an appropriately named method is found it will be called with the state\n manager as the first argument and an optional `context` object as the second\n argument.\n\n ```javascript\n managerA = Ember.StateManager.create({\n initialState: 'stateOne.substateOne.subsubstateOne',\n stateOne: Ember.State.create({\n substateOne: Ember.State.create({\n anAction: function(manager, context){\n console.log(\"an action was called\")\n },\n subsubstateOne: Ember.State.create({})\n })\n })\n })\n\n managerA.get('currentState.name') // 'subsubstateOne'\n managerA.send('anAction')\n // 'stateOne.substateOne.subsubstateOne' has no anAction method\n // so the 'anAction' method of 'stateOne.substateOne' is called\n // and logs \"an action was called\"\n // with managerA as the first argument\n // and no second argument\n\n someObject = {}\n managerA.send('anAction', someObject)\n // the 'anAction' method of 'stateOne.substateOne' is called again\n // with managerA as the first argument and\n // someObject as the second argument.\n ```\n\n If the StateManager attempts to send an action but does not find an appropriately named\n method in the current state or while moving upwards through the state hierarchy, it will\n repeat the process looking for a `unhandledEvent` method. If an `unhandledEvent` method is\n found, it will be called with the original event name as the second argument. If an\n `unhandledEvent` method is not found, the StateManager will throw a new Ember.Error.\n\n ```javascript\n managerB = Ember.StateManager.create({\n initialState: 'stateOne.substateOne.subsubstateOne',\n stateOne: Ember.State.create({\n substateOne: Ember.State.create({\n subsubstateOne: Ember.State.create({}),\n unhandledEvent: function(manager, eventName, context) {\n console.log(\"got an unhandledEvent with name \" + eventName);\n }\n })\n })\n })\n\n managerB.get('currentState.name') // 'subsubstateOne'\n managerB.send('anAction')\n // neither `stateOne.substateOne.subsubstateOne` nor any of it's\n // parent states have a handler for `anAction`. `subsubstateOne`\n // also does not have a `unhandledEvent` method, but its parent\n // state, `substateOne`, does, and it gets fired. It will log\n // \"got an unhandledEvent with name anAction\"\n ```\n\n Action detection only moves upwards through the state hierarchy from the current state.\n It does not search in other portions of the hierarchy.\n\n ```javascript\n managerC = Ember.StateManager.create({\n initialState: 'stateOne.substateOne.subsubstateOne',\n stateOne: Ember.State.create({\n substateOne: Ember.State.create({\n subsubstateOne: Ember.State.create({})\n })\n }),\n stateTwo: Ember.State.create({\n anAction: function(manager, context){\n // will not be called below because it is\n // not a parent of the current state\n }\n })\n })\n\n managerC.get('currentState.name') // 'subsubstateOne'\n managerC.send('anAction')\n // Error: could not\n // respond to event anAction in state stateOne.substateOne.subsubstateOne.\n ```\n\n Inside of an action method the given state should delegate `transitionTo` calls on its\n StateManager.\n\n ```javascript\n robotManager = Ember.StateManager.create({\n initialState: 'poweredDown.charging',\n poweredDown: Ember.State.create({\n charging: Ember.State.create({\n chargeComplete: function(manager, context){\n manager.transitionTo('charged')\n }\n }),\n charged: Ember.State.create({\n boot: function(manager, context){\n manager.transitionTo('poweredUp')\n }\n })\n }),\n poweredUp: Ember.State.create({\n beginExtermination: function(manager, context){\n manager.transitionTo('rampaging')\n },\n rampaging: Ember.State.create()\n })\n })\n\n robotManager.get('currentState.name') // 'charging'\n robotManager.send('boot') // throws error, no boot action\n // in current hierarchy\n robotManager.get('currentState.name') // remains 'charging'\n\n robotManager.send('beginExtermination') // throws error, no beginExtermination\n // action in current hierarchy\n robotManager.get('currentState.name') // remains 'charging'\n\n robotManager.send('chargeComplete')\n robotManager.get('currentState.name') // 'charged'\n\n robotManager.send('boot')\n robotManager.get('currentState.name') // 'poweredUp'\n\n robotManager.send('beginExtermination', allHumans)\n robotManager.get('currentState.name') // 'rampaging'\n ```\n\n Transition actions can also be created using the `transitionTo` method of the `Ember.State` class. The\n following example StateManagers are equivalent:\n\n ```javascript\n aManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: Ember.State.transitionTo('stateTwo')\n }),\n stateTwo: Ember.State.create({})\n })\n\n bManager = Ember.StateManager.create({\n stateOne: Ember.State.create({\n changeToStateTwo: function(manager, context){\n manager.transitionTo('stateTwo', context)\n }\n }),\n stateTwo: Ember.State.create({})\n })\n ```\n\n @class StateManager\n @namespace Ember\n @extends Ember.State\n**/\nEmber.StateManager = Ember.State.extend({\n /**\n @private\n\n When creating a new statemanager, look for a default state to transition\n into. This state can either be named `start`, or can be specified using the\n `initialState` property.\n\n @method init\n */\n init: function() {\n this._super();\n\n set(this, 'stateMeta', Ember.Map.create());\n\n var initialState = get(this, 'initialState');\n\n if (!initialState && get(this, 'states.start')) {\n initialState = 'start';\n }\n\n if (initialState) {\n this.transitionTo(initialState);\n Ember.assert('Failed to transition to initial state \"' + initialState + '\"', !!get(this, 'currentState'));\n }\n },\n\n stateMetaFor: function(state) {\n var meta = get(this, 'stateMeta'),\n stateMeta = meta.get(state);\n\n if (!stateMeta) {\n stateMeta = {};\n meta.set(state, stateMeta);\n }\n\n return stateMeta;\n },\n\n setStateMeta: function(state, key, value) {\n return set(this.stateMetaFor(state), key, value);\n },\n\n getStateMeta: function(state, key) {\n return get(this.stateMetaFor(state), key);\n },\n\n /**\n The current state from among the manager's possible states. This property should\n not be set directly. Use `transitionTo` to move between states by name.\n\n @property currentState\n @type Ember.State\n */\n currentState: null,\n\n /**\n The path of the current state. Returns a string representation of the current\n state.\n\n @property currentPath\n @type String\n */\n currentPath: Ember.computed.alias('currentState.path'),\n\n /**\n The name of transitionEvent that this stateManager will dispatch\n\n @property transitionEvent\n @type String\n @default 'setup'\n */\n transitionEvent: 'setup',\n\n /**\n If set to true, `errorOnUnhandledEvents` will cause an exception to be\n raised if you attempt to send an event to a state manager that is not\n handled by the current state or any of its parent states.\n\n @property errorOnUnhandledEvents\n @type Boolean\n @default true\n */\n errorOnUnhandledEvent: true,\n\n send: function(event) {\n var contexts = [].slice.call(arguments, 1);\n Ember.assert('Cannot send event \"' + event + '\" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));\n return sendEvent.call(this, event, contexts, false);\n },\n unhandledEvent: function(manager, event) {\n if (get(this, 'errorOnUnhandledEvent')) {\n throw new Ember.Error(this.toString() + \" could not respond to event \" + event + \" in state \" + get(this, 'currentState.path') + \".\");\n }\n },\n\n /**\n Finds a state by its state path.\n\n Example:\n\n ```javascript\n manager = Ember.StateManager.create({\n root: Ember.State.create({\n dashboard: Ember.State.create()\n })\n });\n\n manager.getStateByPath(manager, \"root.dashboard\")\n\n // returns the dashboard state\n ```\n\n @method getStateByPath\n @param {Ember.State} root the state to start searching from\n @param {String} path the state path to follow\n @return {Ember.State} the state at the end of the path\n */\n getStateByPath: function(root, path) {\n var parts = path.split('.'),\n state = root;\n\n for (var i=0, len=parts.length; i`, an attempt to\n // transition to `comments.show` will match ``.\n //\n // First, this code will look for root.posts.show.comments.show.\n // Next, it will look for root.posts.comments.show. Finally,\n // it will look for `root.comments.show`, and find the state.\n //\n // After this process, the following variables will exist:\n //\n // * resolveState: a common parent state between the current\n // and target state. In the above example, `` is the\n // `resolveState`.\n // * enterStates: a list of all of the states represented\n // by the path from the `resolveState`. For example, for\n // the path `root.comments.show`, `enterStates` would have\n // `[, ]`\n // * exitStates: a list of all of the states from the\n // `resolveState` to the `currentState`. In the above\n // example, `exitStates` would have\n // `[`, `]`.\n while (resolveState && !enterStates) {\n exitStates.unshift(resolveState);\n\n resolveState = get(resolveState, 'parentState');\n if (!resolveState) {\n enterStates = this.getStatesInPath(this, path);\n if (!enterStates) {\n Ember.assert('Could not find state for path: \"'+path+'\"');\n return;\n }\n }\n enterStates = this.getStatesInPath(resolveState, path);\n }\n\n // If the path contains some states that are parents of both the\n // current state and the target state, remove them.\n //\n // For example, in the following hierarchy:\n //\n // |- root\n // | |- post\n // | | |- index (* current)\n // | | |- show\n //\n // If the `path` is `root.post.show`, the three variables will\n // be:\n //\n // * resolveState: ``\n // * enterStates: `[, , ]`\n // * exitStates: `[, , ]`\n //\n // The goal of this code is to remove the common states, so we\n // have:\n //\n // * resolveState: ``\n // * enterStates: `[]`\n // * exitStates: `[]`\n //\n // This avoid unnecessary calls to the enter and exit transitions.\n while (enterStates.length > 0 && enterStates[0] === exitStates[0]) {\n resolveState = enterStates.shift();\n exitStates.shift();\n }\n\n // Cache the enterStates, exitStates, and resolveState for the\n // current state and the `path`.\n var transitions = {\n exitStates: exitStates,\n enterStates: enterStates,\n resolveState: resolveState\n };\n\n currentState.setPathsCache(this, path, transitions);\n\n return transitions;\n },\n\n triggerSetupContext: function(transitions) {\n var contexts = transitions.contexts,\n offset = transitions.enterStates.length - contexts.length,\n enterStates = transitions.enterStates,\n transitionEvent = get(this, 'transitionEvent');\n\n Ember.assert(\"More contexts provided than states\", offset >= 0);\n\n arrayForEach.call(enterStates, function(state, idx) {\n state.trigger(transitionEvent, this, contexts[idx-offset]);\n }, this);\n },\n\n getState: function(name) {\n var state = get(this, name),\n parentState = get(this, 'parentState');\n\n if (state) {\n return state;\n } else if (parentState) {\n return parentState.getState(name);\n }\n },\n\n enterState: function(transition) {\n var log = this.enableLogging;\n\n var exitStates = transition.exitStates.slice(0).reverse();\n arrayForEach.call(exitStates, function(state) {\n state.trigger('exit', this);\n }, this);\n\n arrayForEach.call(transition.enterStates, function(state) {\n if (log) { Ember.Logger.log(\"STATEMANAGER: Entering \" + get(state, 'path')); }\n state.trigger('enter', this);\n }, this);\n\n set(this, 'currentState', transition.finalState);\n }\n});\n\n})();\n//@ sourceURL=ember-states/state_manager");minispade.register('ember-testing/helpers', "(function() {/*globals EMBER_APP_BEING_TESTED */\n\nvar Promise = Ember.RSVP.Promise,\n pendingAjaxRequests = 0,\n originalFind,\n slice = [].slice,\n get = Ember.get;\n\nfunction visit(app, url) {\n Ember.run(app, app.handleURL, url);\n return wait(app);\n}\n\nfunction click(app, selector) {\n Ember.run(function() {\n app.$(selector).click();\n });\n return wait(app);\n}\n\nfunction fillIn(app, selector, text) {\n var $el = find(app, selector);\n Ember.run(function() {\n $el.val(text);\n });\n return wait(app);\n}\n\nfunction find(app, selector) {\n return app.$(get(app, 'rootElement')).find(selector);\n}\n\nfunction wait(app, value) {\n return new Promise(function(resolve) {\n stop();\n var watcher = setInterval(function() {\n var routerIsLoading = app.__container__.lookup('router:main').router.isLoading;\n if (routerIsLoading) { return; }\n if (pendingAjaxRequests) { return; }\n if (Ember.run.hasScheduledTimers() || Ember.run.currentRunLoop) { return; }\n clearInterval(watcher);\n start();\n Ember.run(function() {\n resolve(value);\n });\n }, 10);\n });\n}\n\nfunction curry(app, fn) {\n return function() {\n var args = slice.call(arguments);\n args.unshift(app);\n return fn.apply(app, args);\n };\n}\n\nEmber.Application.reopen({\n setupForTesting: function() {\n this.deferReadiness();\n\n this.Router.reopen({\n location: 'none'\n });\n },\n\n injectTestHelpers: function() {\n Ember.$(document).ajaxStart(function() {\n pendingAjaxRequests++;\n });\n\n Ember.$(document).ajaxStop(function() {\n pendingAjaxRequests--;\n });\n\n // todo do this safer.\n window.visit = curry(this, visit);\n window.click = curry(this, click);\n window.fillIn = curry(this, fillIn);\n originalFind = window.find;\n window.find = curry(this, find);\n window.wait = curry(this, wait);\n },\n\n removeTestHelpers: function() {\n window.visit = null;\n window.click = null;\n window.fillIn = null;\n window.wait = null;\n window.find = originalFind;\n }\n});\n\n})();\n//@ sourceURL=ember-testing/helpers");minispade.register('ember-testing', "(function() {minispade.require('ember-application');\nminispade.require('ember-testing/helpers');\n})();\n//@ sourceURL=ember-testing");minispade.register('ember-views/core', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar jQuery = Ember.imports.jQuery;\nEmber.assert(\"Ember Views require jQuery 1.8, 1.9 or 2.0\", jQuery && (jQuery().jquery.match(/^((1\\.(8|9))|2.0)(\\.\\d+)?(pre|rc\\d?)?/) || Ember.ENV.FORCE_JQUERY));\n\n/**\n Alias for jQuery\n\n @method $\n @for Ember\n*/\nEmber.$ = jQuery;\n\n})();\n//@ sourceURL=ember-views/core");minispade.register('ember-views', "(function() {/*globals jQuery*/\nminispade.require(\"ember-runtime\");\nminispade.require(\"container\");\n\n/**\nEmber Views\n\n@module ember\n@submodule ember-views\n@requires ember-runtime\n@main ember-views\n*/\nminispade.require(\"ember-views/core\");\nminispade.require(\"ember-views/system\");\nminispade.require(\"ember-views/views\");\nminispade.require(\"ember-views/mixins\");\n\n})();\n//@ sourceURL=ember-views");minispade.register('ember-views/mixins', "(function() {minispade.require(\"ember-views/mixins/view_target_action_support\");\n\n})();\n//@ sourceURL=ember-views/mixins");minispade.register('ember-views/mixins/view_target_action_support', "(function() {/**\n`Ember.ViewTargetActionSupport` is a mixin that can be included in a\nview class to add a `triggerAction` method with semantics similar to\nthe Handlebars `{{action}}` helper. It provides intelligent defaults\nfor the action's target: the view's controller; and the context that is\nsent with the action: the view's context.\n\nNote: In normal Ember usage, the `{{action}}` helper is usually the best\nchoice. This mixin is most often useful when you are doing more complex\nevent handling in custom View subclasses.\n\nFor example:\n\n```javascript\nApp.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n action: 'save',\n click: function(){\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n});\n```\n\nThe `action` can be provided as properties of an optional object argument\nto `triggerAction` as well.\n\n```javascript\nApp.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n click: function(){\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n});\n```\n\n@class ViewTargetActionSupport\n@namespace Ember\n@extends Ember.TargetActionSupport\n*/\nEmber.ViewTargetActionSupport = Ember.Mixin.create(Ember.TargetActionSupport, {\n /**\n @property target\n */\n target: Ember.computed.alias('controller'),\n /**\n @property actionContext\n */\n actionContext: Ember.computed.alias('context')\n});\n\n})();\n//@ sourceURL=ember-views/mixins/view_target_action_support");minispade.register('ember-views/system', "(function() {minispade.require(\"ember-views/system/jquery_ext\");\nminispade.require(\"ember-views/system/utils\");\nminispade.require(\"ember-views/system/render_buffer\");\nminispade.require(\"ember-views/system/event_dispatcher\");\nminispade.require(\"ember-views/system/ext\");\nminispade.require(\"ember-views/system/controller\");\n\n})();\n//@ sourceURL=ember-views/system");minispade.register('ember-views/system/controller', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n// Original class declaration and documentation in runtime/lib/controllers/controller.js\n// NOTE: It may be possible with YUIDoc to combine docs in two locations\n\n/**\nAdditional methods for the ControllerMixin\n\n@class ControllerMixin\n@namespace Ember\n*/\nEmber.ControllerMixin.reopen({\n target: null,\n namespace: null,\n view: null,\n container: null,\n _childContainers: null,\n\n init: function() {\n this._super();\n set(this, '_childContainers', {});\n },\n\n _modelDidChange: Ember.observer(function() {\n var containers = get(this, '_childContainers');\n\n for (var prop in containers) {\n if (!containers.hasOwnProperty(prop)) { continue; }\n containers[prop].destroy();\n }\n\n set(this, '_childContainers', {});\n }, 'model')\n});\n\n})();\n//@ sourceURL=ember-views/system/controller");minispade.register('ember-views/system/event_dispatcher', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.EventDispatcher` handles delegating browser events to their\n corresponding `Ember.Views.` For example, when you click on a view,\n `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets\n called.\n\n @class EventDispatcher\n @namespace Ember\n @private\n @extends Ember.Object\n*/\nEmber.EventDispatcher = Ember.Object.extend(\n/** @scope Ember.EventDispatcher.prototype */{\n\n /**\n @private\n\n The root DOM element to which event listeners should be attached. Event\n listeners will be attached to the document unless this is overridden.\n\n Can be specified as a DOMElement or a selector string.\n\n The default body is a string since this may be evaluated before document.body\n exists in the DOM.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n @private\n\n Sets up event listeners for standard browser events.\n\n This will be called after the browser sends a `DOMContentReady` event. By\n default, it will set up all of the listeners on the document body. If you\n would like to register the listeners on a different element, set the event\n dispatcher's `root` property.\n\n @method setup\n @param addedEvents {Hash}\n */\n setup: function(addedEvents, rootElement) {\n var event, events = {\n touchstart : 'touchStart',\n touchmove : 'touchMove',\n touchend : 'touchEnd',\n touchcancel : 'touchCancel',\n keydown : 'keyDown',\n keyup : 'keyUp',\n keypress : 'keyPress',\n mousedown : 'mouseDown',\n mouseup : 'mouseUp',\n contextmenu : 'contextMenu',\n click : 'click',\n dblclick : 'doubleClick',\n mousemove : 'mouseMove',\n focusin : 'focusIn',\n focusout : 'focusOut',\n mouseenter : 'mouseEnter',\n mouseleave : 'mouseLeave',\n submit : 'submit',\n input : 'input',\n change : 'change',\n dragstart : 'dragStart',\n drag : 'drag',\n dragenter : 'dragEnter',\n dragleave : 'dragLeave',\n dragover : 'dragOver',\n drop : 'drop',\n dragend : 'dragEnd'\n };\n\n Ember.$.extend(events, addedEvents || {});\n\n\n if (!Ember.isNone(rootElement)) {\n set(this, 'rootElement', rootElement);\n }\n\n rootElement = Ember.$(get(this, 'rootElement'));\n\n Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));\n Ember.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length);\n Ember.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length);\n\n rootElement.addClass('ember-application');\n\n Ember.assert('Unable to add \"ember-application\" class to rootElement. Make sure you set rootElement to the body or an element in the body.', rootElement.is('.ember-application'));\n\n for (event in events) {\n if (events.hasOwnProperty(event)) {\n this.setupHandler(rootElement, event, events[event]);\n }\n }\n },\n\n /**\n @private\n\n Registers an event listener on the document. If the given event is\n triggered, the provided event handler will be triggered on the target view.\n\n If the target view does not implement the event handler, or if the handler\n returns `false`, the parent view will be called. The event will continue to\n bubble to each successive parent view until it reaches the top.\n\n For example, to have the `mouseDown` method called on the target view when\n a `mousedown` event is received from the browser, do the following:\n\n ```javascript\n setupHandler('mousedown', 'mouseDown');\n ```\n\n @method setupHandler\n @param {Element} rootElement\n @param {String} event the browser-originated event to listen to\n @param {String} eventName the name of the method to call on the view\n */\n setupHandler: function(rootElement, event, eventName) {\n var self = this;\n\n rootElement.delegate('.ember-view', event + '.ember', function(evt, triggeringManager) {\n return Ember.handleErrors(function() {\n var view = Ember.View.views[this.id],\n result = true, manager = null;\n\n manager = self._findNearestEventManager(view,eventName);\n\n if (manager && manager !== triggeringManager) {\n result = self._dispatchEvent(manager, evt, eventName, view);\n } else if (view) {\n result = self._bubbleEvent(view,evt,eventName);\n } else {\n evt.stopPropagation();\n }\n\n return result;\n }, this);\n });\n\n rootElement.delegate('[data-ember-action]', event + '.ember', function(evt) {\n return Ember.handleErrors(function() {\n var actionId = Ember.$(evt.currentTarget).attr('data-ember-action'),\n action = Ember.Handlebars.ActionHelper.registeredActions[actionId];\n\n // We have to check for action here since in some cases, jQuery will trigger\n // an event on `removeChild` (i.e. focusout) after we've already torn down the\n // action handlers for the view.\n if (action && action.eventName === eventName) {\n return action.handler(evt);\n }\n }, this);\n });\n },\n\n _findNearestEventManager: function(view, eventName) {\n var manager = null;\n\n while (view) {\n manager = get(view, 'eventManager');\n if (manager && manager[eventName]) { break; }\n\n view = get(view, 'parentView');\n }\n\n return manager;\n },\n\n _dispatchEvent: function(object, evt, eventName, view) {\n var result = true;\n\n var handler = object[eventName];\n if (Ember.typeOf(handler) === 'function') {\n result = handler.call(object, evt, view);\n // Do not preventDefault in eventManagers.\n evt.stopPropagation();\n }\n else {\n result = this._bubbleEvent(view, evt, eventName);\n }\n\n return result;\n },\n\n _bubbleEvent: function(view, evt, eventName) {\n return Ember.run(function() {\n return view.handleEvent(eventName, evt);\n });\n },\n\n destroy: function() {\n var rootElement = get(this, 'rootElement');\n Ember.$(rootElement).undelegate('.ember').removeClass('ember-application');\n return this._super();\n }\n});\n\n})();\n//@ sourceURL=ember-views/system/event_dispatcher");minispade.register('ember-views/system/ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n// Add a new named queue for rendering views that happens\n// after bindings have synced, and a queue for scheduling actions\n// that that should occur after view rendering.\nvar queues = Ember.run.queues,\n indexOf = Ember.ArrayPolyfills.indexOf;\nqueues.splice(indexOf.call(queues, 'actions')+1, 0, 'render', 'afterRender');\n\n})();\n//@ sourceURL=ember-views/system/ext");minispade.register('ember-views/system/jquery_ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\nif (Ember.$) {\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents\n var dragEvents = Ember.String.w('dragstart drag dragenter dragleave dragover drop dragend');\n\n // Copies the `dataTransfer` property from a browser event object onto the\n // jQuery event object for the specified events\n Ember.EnumerableUtils.forEach(dragEvents, function(eventName) {\n Ember.$.event.fixHooks[eventName] = { props: ['dataTransfer'] };\n });\n}\n\n})();\n//@ sourceURL=ember-views/system/jquery_ext");minispade.register('ember-views/system/render_buffer', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar ClassSet = function() {\n this.seen = {};\n this.list = [];\n};\n\nClassSet.prototype = {\n add: function(string) {\n if (string in this.seen) { return; }\n this.seen[string] = true;\n\n this.list.push(string);\n },\n\n toDOM: function() {\n return this.list.join(\" \");\n }\n};\n\n/**\n `Ember.RenderBuffer` gathers information regarding the a view and generates the\n final representation. `Ember.RenderBuffer` will generate HTML which can be pushed\n to the DOM.\n\n @class RenderBuffer\n @namespace Ember\n @constructor\n*/\nEmber.RenderBuffer = function(tagName) {\n return new Ember._RenderBuffer(tagName);\n};\n\nEmber._RenderBuffer = function(tagName) {\n this.tagNames = [tagName || null];\n this.buffer = \"\";\n};\n\nEmber._RenderBuffer.prototype =\n/** @scope Ember.RenderBuffer.prototype */ {\n\n // The root view's element\n _element: null,\n\n _hasElement: true,\n\n /**\n @private\n\n An internal set used to de-dupe class names when `addClass()` is\n used. After each call to `addClass()`, the `classes` property\n will be updated.\n\n @property elementClasses\n @type Array\n @default []\n */\n elementClasses: null,\n\n /**\n Array of class names which will be applied in the class attribute.\n\n You can use `setClasses()` to set this property directly. If you\n use `addClass()`, it will be maintained for you.\n\n @property classes\n @type Array\n @default []\n */\n classes: null,\n\n /**\n The id in of the element, to be applied in the id attribute.\n\n You should not set this property yourself, rather, you should use\n the `id()` method of `Ember.RenderBuffer`.\n\n @property elementId\n @type String\n @default null\n */\n elementId: null,\n\n /**\n A hash keyed on the name of the attribute and whose value will be\n applied to that attribute. For example, if you wanted to apply a\n `data-view=\"Foo.bar\"` property to an element, you would set the\n elementAttributes hash to `{'data-view':'Foo.bar'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `attr()` method of `Ember.RenderBuffer`.\n\n @property elementAttributes\n @type Hash\n @default {}\n */\n elementAttributes: null,\n\n /**\n A hash keyed on the name of the properties and whose value will be\n applied to that property. For example, if you wanted to apply a\n `checked=true` property to an element, you would set the\n elementProperties hash to `{'checked':true}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `prop()` method of `Ember.RenderBuffer`.\n\n @property elementProperties\n @type Hash\n @default {}\n */\n elementProperties: null,\n\n /**\n The tagname of the element an instance of `Ember.RenderBuffer` represents.\n\n Usually, this gets set as the first parameter to `Ember.RenderBuffer`. For\n example, if you wanted to create a `p` tag, then you would call\n\n ```javascript\n Ember.RenderBuffer('p')\n ```\n\n @property elementTag\n @type String\n @default null\n */\n elementTag: null,\n\n /**\n A hash keyed on the name of the style attribute and whose value will\n be applied to that attribute. For example, if you wanted to apply a\n `background-color:black;` style to an element, you would set the\n elementStyle hash to `{'background-color':'black'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `style()` method of `Ember.RenderBuffer`.\n\n @property elementStyle\n @type Hash\n @default {}\n */\n elementStyle: null,\n\n /**\n Nested `RenderBuffers` will set this to their parent `RenderBuffer`\n instance.\n\n @property parentBuffer\n @type Ember._RenderBuffer\n */\n parentBuffer: null,\n\n /**\n Adds a string of HTML to the `RenderBuffer`.\n\n @method push\n @param {String} string HTML to push into the buffer\n @chainable\n */\n push: function(string) {\n this.buffer += string;\n return this;\n },\n\n /**\n Adds a class to the buffer, which will be rendered to the class attribute.\n\n @method addClass\n @param {String} className Class name to add to the buffer\n @chainable\n */\n addClass: function(className) {\n // lazily create elementClasses\n this.elementClasses = (this.elementClasses || new ClassSet());\n this.elementClasses.add(className);\n this.classes = this.elementClasses.list;\n\n return this;\n },\n\n setClasses: function(classNames) {\n this.classes = classNames;\n },\n\n /**\n Sets the elementID to be used for the element.\n\n @method id\n @param {String} id\n @chainable\n */\n id: function(id) {\n this.elementId = id;\n return this;\n },\n\n // duck type attribute functionality like jQuery so a render buffer\n // can be used like a jQuery object in attribute binding scenarios.\n\n /**\n Adds an attribute which will be rendered to the element.\n\n @method attr\n @param {String} name The name of the attribute\n @param {String} value The value to add to the attribute\n @chainable\n @return {Ember.RenderBuffer|String} this or the current attribute value\n */\n attr: function(name, value) {\n var attributes = this.elementAttributes = (this.elementAttributes || {});\n\n if (arguments.length === 1) {\n return attributes[name];\n } else {\n attributes[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an attribute from the list of attributes to render.\n\n @method removeAttr\n @param {String} name The name of the attribute\n @chainable\n */\n removeAttr: function(name) {\n var attributes = this.elementAttributes;\n if (attributes) { delete attributes[name]; }\n\n return this;\n },\n\n /**\n Adds an property which will be rendered to the element.\n\n @method prop\n @param {String} name The name of the property\n @param {String} value The value to add to the property\n @chainable\n @return {Ember.RenderBuffer|String} this or the current property value\n */\n prop: function(name, value) {\n var properties = this.elementProperties = (this.elementProperties || {});\n\n if (arguments.length === 1) {\n return properties[name];\n } else {\n properties[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an property from the list of properties to render.\n\n @method removeProp\n @param {String} name The name of the property\n @chainable\n */\n removeProp: function(name) {\n var properties = this.elementProperties;\n if (properties) { delete properties[name]; }\n\n return this;\n },\n\n /**\n Adds a style to the style attribute which will be rendered to the element.\n\n @method style\n @param {String} name Name of the style\n @param {String} value\n @chainable\n */\n style: function(name, value) {\n this.elementStyle = (this.elementStyle || {});\n\n this.elementStyle[name] = value;\n return this;\n },\n\n begin: function(tagName) {\n this.tagNames.push(tagName || null);\n return this;\n },\n\n pushOpeningTag: function() {\n var tagName = this.currentTagName();\n if (!tagName) { return; }\n\n if (this._hasElement && !this._element && this.buffer.length === 0) {\n this._element = this.generateElement();\n return;\n }\n\n var buffer = this.buffer,\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n attr, prop;\n\n buffer += '<' + tagName;\n\n if (id) {\n buffer += ' id=\"' + this._escapeAttribute(id) + '\"';\n this.elementId = null;\n }\n if (classes) {\n buffer += ' class=\"' + this._escapeAttribute(classes.join(' ')) + '\"';\n this.classes = null;\n }\n\n if (style) {\n buffer += ' style=\"';\n\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n buffer += prop + ':' + this._escapeAttribute(style[prop]) + ';';\n }\n }\n\n buffer += '\"';\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n buffer += ' ' + attr + '=\"' + this._escapeAttribute(attrs[attr]) + '\"';\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n var value = props[prop];\n if (value || typeof(value) === 'number') {\n if (value === true) {\n buffer += ' ' + prop + '=\"' + prop + '\"';\n } else {\n buffer += ' ' + prop + '=\"' + this._escapeAttribute(props[prop]) + '\"';\n }\n }\n }\n }\n\n this.elementProperties = null;\n }\n\n buffer += '>';\n this.buffer = buffer;\n },\n\n pushClosingTag: function() {\n var tagName = this.tagNames.pop();\n if (tagName) { this.buffer += ''; }\n },\n\n currentTagName: function() {\n return this.tagNames[this.tagNames.length-1];\n },\n\n generateElement: function() {\n var tagName = this.tagNames.pop(), // pop since we don't need to close\n element = document.createElement(tagName),\n $element = Ember.$(element),\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n styleBuffer = '', attr, prop;\n\n if (id) {\n $element.attr('id', id);\n this.elementId = null;\n }\n if (classes) {\n $element.attr('class', classes.join(' '));\n this.classes = null;\n }\n\n if (style) {\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n styleBuffer += (prop + ':' + style[prop] + ';');\n }\n }\n\n $element.attr('style', styleBuffer);\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n $element.attr(attr, attrs[attr]);\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n $element.prop(prop, props[prop]);\n }\n }\n\n this.elementProperties = null;\n }\n\n return element;\n },\n\n /**\n @method element\n @return {DOMElement} The element corresponding to the generated HTML\n of this buffer\n */\n element: function() {\n var html = this.innerString();\n\n if (html) {\n this._element = Ember.ViewUtils.setInnerHTML(this._element, html);\n }\n\n return this._element;\n },\n\n /**\n Generates the HTML content for this buffer.\n\n @method string\n @return {String} The generated HTML\n */\n string: function() {\n if (this._hasElement && this._element) {\n // Firefox versions < 11 do not have support for element.outerHTML.\n var thisElement = this.element(), outerHTML = thisElement.outerHTML;\n if (typeof outerHTML === 'undefined'){\n return Ember.$('
    ').append(thisElement).html();\n }\n return outerHTML;\n } else {\n return this.innerString();\n }\n },\n\n innerString: function() {\n return this.buffer;\n },\n\n _escapeAttribute: function(value) {\n // Stolen shamelessly from Handlebars\n\n var escape = {\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n \"`\": \"`\"\n };\n\n var badChars = /&(?!\\w+;)|[<>\"'`]/g;\n var possible = /[&<>\"'`]/;\n\n var escapeChar = function(chr) {\n return escape[chr] || \"&\";\n };\n\n var string = value.toString();\n\n if(!possible.test(string)) { return string; }\n return string.replace(badChars, escapeChar);\n }\n\n};\n\n})();\n//@ sourceURL=ember-views/system/render_buffer");minispade.register('ember-views/system/utils', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n/*** BEGIN METAMORPH HELPERS ***/\n\n// Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n// is a \"zero-scope\" element. This problem can be worked around by making\n// the first node an invisible text node. We, like Modernizr, use ­\n\nvar needsShy = this.document && (function(){\n var testEl = document.createElement('div');\n testEl.innerHTML = \"
    \";\n testEl.firstChild.innerHTML = \"\";\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\");\n\n})();\n//@ sourceURL=ember-views/views");minispade.register('ember-views/views/collection_view', "(function() {minispade.require('ember-views/views/container_view');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.CollectionView` is an `Ember.View` descendent responsible for managing\n a collection (an array or array-like object) by maintaing a child view object\n and associated DOM representation for each item in the array and ensuring\n that child views and their associated rendered HTML are updated when items in\n the array are added, removed, or replaced.\n\n ## Setting content\n\n The managed collection of objects is referenced as the `Ember.CollectionView`\n instance's `content` property.\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n content: ['A', 'B','C']\n })\n ```\n\n The view for each item in the collection will have its `content` property set\n to the item.\n\n ## Specifying itemViewClass\n\n By default the view class for each item in the managed collection will be an\n instance of `Ember.View`. You can supply a different class by setting the\n `CollectionView`'s `itemViewClass` property.\n\n Given an empty `` 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 ## Programatic creation of child views\n\n For cases where additional customization beyond the use of a single\n `itemViewClass` or `tagName` matching is required CollectionView's\n `createChildView` method can be overidden:\n\n ```javascript\n CustomCollectionView = Ember.CollectionView.extend({\n createChildView: function(viewClass, attrs) {\n if (attrs.content.kind == 'album') {\n viewClass = App.AlbumView;\n } else {\n viewClass = App.SongView;\n }\n return this._super(viewClass, attrs);\n }\n });\n ```\n\n ## Empty View\n\n You can provide an `Ember.View` subclass to the `Ember.CollectionView`\n instance as its `emptyView` property. If the `content` property of a\n `CollectionView` is set to `null` or an empty array, an instance of this view\n will be the `CollectionView`s only child.\n\n ```javascript\n aListWithNothing = Ember.CollectionView.create({\n classNames: ['nothing']\n content: null,\n emptyView: Ember.View.extend({\n template: Ember.Handlebars.compile(\"The collection is empty\")\n })\n });\n\n aListWithNothing.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n
    \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 ## Use in templates via the `{{collection}}` `Ember.Handlebars` helper\n\n `Ember.Handlebars` provides a helper specifically for adding\n `CollectionView`s to templates. See `Ember.Handlebars.collection` for more\n details\n\n @class CollectionView\n @namespace Ember\n @extends Ember.ContainerView\n @since Ember 0.9\n*/\nEmber.CollectionView = Ember.ContainerView.extend(\n/** @scope Ember.CollectionView.prototype */ {\n\n /**\n A list of items to be displayed by the `Ember.CollectionView`.\n\n @property content\n @type Ember.Array\n @default null\n */\n content: null,\n\n /**\n @private\n\n This provides metadata about what kind of empty view class this\n collection would like if it is being instantiated from another\n system (like Handlebars)\n\n @property emptyViewClass\n */\n emptyViewClass: Ember.View,\n\n /**\n An optional view to display if content is set to an empty array.\n\n @property emptyView\n @type Ember.View\n @default null\n */\n emptyView: null,\n\n /**\n @property itemViewClass\n @type Ember.View\n @default Ember.View\n */\n itemViewClass: Ember.View,\n\n init: function() {\n var ret = this._super();\n this._contentDidChange();\n return ret;\n },\n\n _contentWillChange: Ember.beforeObserver(function() {\n var content = this.get('content');\n\n if (content) { content.removeArrayObserver(this); }\n var len = content ? get(content, 'length') : 0;\n this.arrayWillChange(content, 0, len);\n }, 'content'),\n\n /**\n @private\n\n Check to make sure that the content has changed, and if so,\n update the children directly. This is always scheduled\n asynchronously, to allow the element to be created before\n bindings have synchronized and vice versa.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer(function() {\n var content = get(this, 'content');\n\n if (content) {\n Ember.assert(fmt(\"an Ember.CollectionView's content must implement Ember.Array. You passed %@\", [content]), Ember.Array.detect(content));\n content.addArrayObserver(this);\n }\n\n var len = content ? get(content, 'length') : 0;\n this.arrayDidChange(content, 0, null, len);\n }, 'content'),\n\n 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 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 itemViewClass = get(this, 'itemViewClass'),\n addedViews = [], view, item, idx, len;\n\n if ('string' === typeof itemViewClass) {\n itemViewClass = get(itemViewClass);\n }\n\n Ember.assert(fmt(\"itemViewClass must be a subclass of Ember.View, not %@\", [itemViewClass]), Ember.View.detect(itemViewClass));\n\n len = content ? get(content, 'length') : 0;\n if (len) {\n for (idx = start; idx < start+added; idx++) {\n item = content.objectAt(idx);\n\n view = this.createChildView(itemViewClass, {\n content: item,\n contentIndex: idx\n });\n\n addedViews.push(view);\n }\n } else {\n var emptyView = get(this, 'emptyView');\n if (!emptyView) { return; }\n\n var isClass = Ember.CoreView.detect(emptyView);\n\n emptyView = this.createChildView(emptyView);\n addedViews.push(emptyView);\n set(this, 'emptyView', emptyView);\n\n if (isClass) { this._createdEmptyView = emptyView; }\n }\n this.replace(start, 0, addedViews);\n },\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n var itemTagName = get(view, 'tagName');\n var tagName = (itemTagName === null || itemTagName === undefined) ? Ember.CollectionView.CONTAINER_MAP[get(this, 'tagName')] : itemTagName;\n\n set(view, 'tagName', tagName);\n\n return view;\n }\n});\n\n/**\n A map of parent tags to their default child tags. You can add\n additional parent tags if you want collection views that use\n a particular parent tag to default to a child tag.\n\n @property CONTAINER_MAP\n @type Hash\n @static\n @final\n*/\nEmber.CollectionView.CONTAINER_MAP = {\n ul: 'li',\n ol: 'li',\n table: 'tr',\n thead: 'tr',\n tbody: 'tr',\n tfoot: 'tr',\n tr: 'td',\n select: 'option'\n};\n\n})();\n//@ sourceURL=ember-views/views/collection_view");minispade.register('ember-views/views/container_view', "(function() {minispade.require('ember-views/views/view');\nminispade.require('ember-views/views/states');\nminispade.require('ember-runtime/mixins/mutable_array');\n\nvar states = Ember.View.cloneStates(Ember.View.states);\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar forEach = Ember.EnumerableUtils.forEach;\nvar ViewCollection = Ember._ViewCollection;\n\n/**\n A `ContainerView` is an `Ember.View` subclass that implements `Ember.MutableArray`\n allowing programatic management of its child views.\n\n ## Setting Initial Child Views\n\n The initial array of child views can be set in one of two ways. You can\n provide a `childViews` property at creation time that contains instance of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: [Ember.View.create(), Ember.View.create()]\n });\n ```\n\n You can also provide a list of property names whose values are instances of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', 'bView', 'cView'],\n aView: Ember.View.create(),\n bView: Ember.View.create(),\n cView: Ember.View.create()\n });\n ```\n\n The two strategies can be combined:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', Ember.View.create()],\n aView: Ember.View.create()\n });\n ```\n\n Each child view's rendering will be inserted into the container's rendered\n HTML in the same order as its position in the `childViews` property.\n\n ## Adding and Removing Child Views\n\n The container view implements `Ember.MutableArray` allowing programatic management of its child views.\n\n To remove a view, pass that view into a `removeObject` call on the container view.\n\n Given an empty `` 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 ## Binding a View to Display\n\n If you would like to display a single view in your ContainerView, you can set\n its `currentView` property. When the `currentView` property is set to a view\n instance, it will be added to the ContainerView. If the `currentView` property\n is later changed to a different view, the new view will replace the old view.\n If `currentView` is set to `null`, the last `currentView` will be removed.\n\n This functionality is useful for cases where you want to bind the display of\n a ContainerView to a controller or state manager. For example, you can bind\n the `currentView` of a container to a controller like this:\n\n ```javascript\n App.appController = Ember.Object.create({\n view: Ember.View.create({\n templateName: 'person_template'\n })\n });\n ```\n\n ```handlebars\n {{view Ember.ContainerView currentViewBinding=\"App.appController.view\"}}\n ```\n\n @class ContainerView\n @namespace Ember\n @extends Ember.View\n*/\nEmber.ContainerView = Ember.View.extend(Ember.MutableArray, {\n states: states,\n\n init: function() {\n this._super();\n\n var childViews = get(this, 'childViews');\n\n // redefine view's childViews property that was obliterated\n Ember.defineProperty(this, 'childViews', Ember.View.childViewsProperty);\n\n var _childViews = this._childViews;\n\n forEach(childViews, function(viewName, idx) {\n var view;\n\n if ('string' === typeof viewName) {\n view = get(this, viewName);\n view = this.createChildView(view);\n set(this, viewName, view);\n } else {\n view = this.createChildView(viewName);\n }\n\n _childViews[idx] = view;\n }, this);\n\n var currentView = get(this, 'currentView');\n if (currentView) {\n 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\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 }),\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 (!get(view, 'templateData')) {\n set(view, 'templateData', templateData);\n }\n });\n },\n\n currentView: null,\n\n _currentViewWillChange: Ember.beforeObserver(function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n currentView.destroy();\n }\n }, 'currentView'),\n\n _currentViewDidChange: Ember.observer(function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n this.pushObject(currentView);\n }\n }, 'currentView'),\n\n _ensureChildrenAreInDOM: function () {\n this.currentState.ensureChildrenAreInDOM(this);\n }\n});\n\nEmber.merge(states._default, {\n childViewsWillChange: Ember.K,\n childViewsDidChange: Ember.K,\n ensureChildrenAreInDOM: Ember.K\n});\n\nEmber.merge(states.inBuffer, {\n childViewsDidChange: function(parentView, views, start, added) {\n throw new Error('You cannot modify child views while in the inBuffer state');\n }\n});\n\nEmber.merge(states.hasElement, {\n childViewsWillChange: function(view, views, start, removed) {\n for (var i=start; i\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.create({\n classNameBindings: ['isEnabled:enabled:disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n
    \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.create({\n classNameBindings: ['isEnabled::disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n
    \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` documentation for more information about concatenated\n properties.\n\n ## HTML Attributes\n\n The HTML attribute section of a view's tag can be set by providing an\n `attributeBindings` property set to an array of property names on the view.\n The return value of these properties will be used as the value of the view's\n HTML associated attribute:\n\n ```javascript\n AnchorView = Ember.View.extend({\n tagName: 'a',\n attributeBindings: ['href'],\n href: 'http://google.com'\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n \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`\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 Using a value for `templateName` that does not have a Handlebars template\n with a matching `data-template-name` attribute will throw an error.\n\n Assigning a value to both `template` and `templateName` properties will throw\n an error.\n\n For views classes that may have a template later defined (e.g. as the block\n portion of a `{{view}}` Handlebars helper call in another template or in\n a subclass), you can provide a `defaultTemplate` property set to compiled\n template function. If a template is not later provided for the view instance\n the `defaultTemplate` value will be used:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default'),\n template: null,\n templateName: null\n });\n ```\n\n Will result in instances with an HTML representation of:\n\n ```html\n
    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 `Handlebars.helpers.yield` for more information.\n\n ## Responding to Browser Events\n\n Views can respond to user-initiated events in one of three ways: method\n implementation, through an event manager, and through `{{action}}` helper use\n in their template or layout.\n\n ### Method Implementation\n\n Views can respond to user-initiated events by implementing a method that\n matches the event name. A `jQuery.Event` object will be passed as the\n argument to this method.\n\n ```javascript\n AView = Ember.View.extend({\n click: function(event){\n // will be called when when an instance's\n // rendered element is clicked\n }\n });\n ```\n\n ### Event Managers\n\n Views can define an object as their `eventManager` property. This object can\n then implement methods that match the desired event names. Matching events\n that occur on the view's rendered HTML or the rendered HTML of any of its DOM\n descendants will trigger this method. A `jQuery.Event` object will be passed\n as the first argument to the method and an `Ember.View` object as the\n second. The `Ember.View` will be the view whose rendered HTML was interacted\n with. This may be the view with the `eventManager` property or one of its\n descendent views.\n\n ```javascript\n AView = Ember.View.extend({\n eventManager: Ember.Object.create({\n doubleClick: function(event, view){\n // will be called when when an instance's\n // rendered element or any rendering\n // of this views's descendent\n // elements is clicked\n }\n })\n });\n ```\n\n An event defined for an event manager takes precedence over events of the\n same name handled through methods on the view.\n\n ```javascript\n AView = Ember.View.extend({\n mouseEnter: function(event){\n // will never trigger.\n },\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view){\n // takes presedence over AView#mouseEnter\n }\n })\n });\n ```\n\n Similarly a view's event manager will take precedence for events of any views\n rendered as a descendent. A method name that matches an event name will not\n be called if the view instance was rendered inside the HTML representation of\n a view that has an `eventManager` property defined that handles events of the\n name. Events not handled by the event manager will still trigger method calls\n on the descendent.\n\n ```javascript\n OuterView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"outer {{#view InnerView}}inner{{/view}} outer\"),\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view){\n // view might be instance of either\n // OutsideView or InnerView depending on\n // where on the page the user interaction occured\n }\n })\n });\n\n InnerView = Ember.View.extend({\n click: function(event){\n // will be called if rendered inside\n // an OuterView because OuterView's\n // eventManager doesn't handle click events\n },\n mouseEnter: function(event){\n // will never be called if rendered inside\n // an OuterView.\n }\n });\n ```\n\n ### Handlebars `{{action}}` Helper\n\n See `Handlebars.helpers.action`.\n\n ### Event Names\n\n Possible events names for any of the responding approaches described above\n are:\n\n Touch events:\n\n * `touchStart`\n * `touchMove`\n * `touchEnd`\n * `touchCancel`\n\n Keyboard events\n\n * `keyDown`\n * `keyUp`\n * `keyPress`\n\n Mouse events\n\n * `mouseDown`\n * `mouseUp`\n * `contextMenu`\n * `click`\n * `doubleClick`\n * `mouseMove`\n * `focusIn`\n * `focusOut`\n * `mouseEnter`\n * `mouseLeave`\n\n Form events:\n\n * `submit`\n * `change`\n * `focusIn`\n * `focusOut`\n * `input`\n\n HTML5 drag and drop events:\n\n * `dragStart`\n * `drag`\n * `dragEnter`\n * `dragLeave`\n * `drop`\n * `dragEnd`\n\n ## Handlebars `{{view}}` Helper\n\n Other `Ember.View` instances can be included as part of a view's template by\n using the `{{view}}` Handlebars helper. See `Handlebars.helpers.view` for\n additional information.\n\n @class View\n @namespace Ember\n @extends Ember.Object\n @uses Ember.Evented\n*/\nEmber.View = Ember.CoreView.extend(\n/** @scope Ember.View.prototype */ {\n\n concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'],\n\n /**\n @property isView\n @type Boolean\n @default true\n @final\n */\n isView: true,\n\n // ..........................................................\n // TEMPLATE SUPPORT\n //\n\n /**\n The name of the template to lookup if no template is provided.\n\n `Ember.View` will look for a template with this name in this view's\n `templates` object. By default, this will be a global object\n shared in `Ember.TEMPLATES`.\n\n @property templateName\n @type String\n @default null\n */\n templateName: null,\n\n /**\n The name of the layout to lookup if no layout is provided.\n\n `Ember.View` will look for a template with this name in this view's\n `templates` object. By default, this will be a global object\n shared in `Ember.TEMPLATES`.\n\n @property layoutName\n @type String\n @default null\n */\n layoutName: null,\n\n /**\n The hash in which to look for `templateName`.\n\n @property templates\n @type Ember.Object\n @default Ember.TEMPLATES\n */\n templates: Ember.TEMPLATES,\n\n /**\n The template used to render the view. This should be a function that\n accepts an optional context parameter and returns a string of HTML that\n will be inserted into the DOM relative to its parent view.\n\n In general, you should set the `templateName` property instead of setting\n the template yourself.\n\n @property template\n @type Function\n */\n template: Ember.computed(function(key, value) {\n if (value !== undefined) { return value; }\n\n var templateName = get(this, 'templateName'),\n template = this.templateForName(templateName, 'template');\n\n Ember.assert(\"You specified the templateName \" + templateName + \" for \" + this + \", but it did not exist.\", !templateName || template);\n\n return template || get(this, 'defaultTemplate');\n }).property('templateName'),\n\n /**\n The controller managing this view. If this property is set, it will be\n made available for use by the template.\n\n @property controller\n @type Object\n */\n controller: Ember.computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n A view may contain a layout. A layout is a regular template but\n supersedes the `template` property during rendering. It is the\n responsibility of the layout template to retrieve the `template`\n property from the view (or alternatively, call `Handlebars.helpers.yield`,\n `{{yield}}`) to render it in the correct location.\n\n This is useful for a view that has a shared wrapper, but which delegates\n the rendering of the contents of the wrapper to the `template` property\n on a subclass.\n\n @property layout\n @type Function\n */\n layout: Ember.computed(function(key) {\n var layoutName = get(this, 'layoutName'),\n layout = this.templateForName(layoutName, 'layout');\n\n Ember.assert(\"You specified the layoutName \" + layoutName + \" for \" + this + \", but it did not exist.\", !layoutName || layout);\n\n return layout || get(this, 'defaultLayout');\n }).property('layoutName'),\n\n templateForName: function(name, type) {\n if (!name) { return; }\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n var container = this.container;\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 _displayPropertyDidChange\n */\n _contextDidChange: Ember.observer(function() {\n this.rerender();\n }, 'context'),\n\n /**\n If `false`, the view will appear hidden in DOM.\n\n @property isVisible\n @type Boolean\n @default null\n */\n isVisible: true,\n\n /**\n @private\n\n Array of child views. You should never edit this array directly.\n Instead, use `appendChild` and `removeFromParent`.\n\n @property childViews\n @type Array\n @default []\n */\n childViews: childViewsProperty,\n\n _childViews: 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(function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyWillChange(parentView, 'childViews'); }\n }\n }, 'childViews'),\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews did change.\n _childViewsDidChange: Ember.observer(function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyDidChange(parentView, 'childViews'); }\n }\n }, 'childViews'),\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class.\n\n @property nearestInstanceOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n @deprecated\n */\n nearestInstanceOf: function(klass) {\n Ember.deprecate(\"nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.\");\n var view = get(this, 'parentView');\n\n while (view) {\n if(view instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class or mixin.\n\n @property nearestOfType\n @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself),\n or an instance of Ember.Mixin.\n @return Ember.View\n */\n nearestOfType: function(klass) {\n var view = get(this, 'parentView'),\n isOfType = klass instanceof Ember.Mixin ?\n function(view) { return klass.detect(view); } :\n function(view) { return klass.detect(view.constructor); };\n\n while (view) {\n if( isOfType(view) ) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that has a given property.\n\n @property nearestWithProperty\n @param {String} property A property name\n @return Ember.View\n */\n nearestWithProperty: function(property) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (property in view) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor whose parent is an instance of\n `klass`.\n\n @property nearestChildOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n */\n nearestChildOf: function(klass) {\n var view = get(this, 'parentView');\n\n while (view) {\n if(get(view, 'parentView') instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n @private\n\n When the parent view changes, recursively invalidate `controller`\n\n @method _parentViewDidChange\n */\n _parentViewDidChange: Ember.observer(function() {\n if (this.isDestroying) { return; }\n\n if (get(this, 'parentView.controller') && !get(this, 'controller')) {\n this.notifyPropertyChange('controller');\n }\n }, '_parentView'),\n\n _controllerDidChange: Ember.observer(function() {\n if (this.isDestroying) { return; }\n\n this.rerender();\n\n this.forEachChildView(function(view) {\n view.propertyDidChange('controller');\n });\n }, 'controller'),\n\n cloneKeywords: function() {\n var templateData = get(this, 'templateData');\n\n var keywords = templateData ? Ember.copy(templateData.keywords) : {};\n set(keywords, 'view', get(this, 'concreteView'));\n set(keywords, '_view', this);\n set(keywords, 'controller', get(this, 'controller'));\n\n return keywords;\n },\n\n /**\n Called on your view when it should push strings of HTML into a\n `Ember.RenderBuffer`. Most users will want to override the `template`\n or `templateName` properties instead of this method.\n\n By default, `Ember.View` will look for a function in the `template`\n property and invoke it with the value of `context`. The value of\n `context` will be the view's controller unless you override it.\n\n @method render\n @param {Ember.RenderBuffer} buffer The render buffer\n */\n render: function(buffer) {\n // If this view has a layout, it is the responsibility of the\n // the layout to render the view's template. Otherwise, render the template\n // directly.\n var template = get(this, 'layout') || get(this, 'template');\n\n if (template) {\n var context = get(this, 'context');\n var keywords = this.cloneKeywords();\n var output;\n\n var data = {\n view: this,\n buffer: buffer,\n isRenderData: true,\n keywords: keywords,\n insideGroup: get(this, 'templateData.insideGroup')\n };\n\n // Invoke the template with the provided template context, which\n // is the view's controller by default. A hash of data is also passed that provides\n // the template with access to the view and render buffer.\n\n Ember.assert('template must be a function. Did you mean to call Ember.Handlebars.compile(\"...\") or specify templateName instead?', typeof template === 'function');\n // The template should write directly to the render buffer instead\n // of returning a string.\n output = template(context, { data: data });\n\n // If the template returned a string instead of writing to the buffer,\n // push the string onto the buffer.\n if (output !== undefined) { buffer.push(output); }\n }\n },\n\n /**\n Renders the view again. This will work regardless of whether the\n view is already in the DOM or not. If the view is in the DOM, the\n rendering process will be deferred to give bindings a chance\n to synchronize.\n\n If children were added during the rendering process using `appendChild`,\n `rerender` will remove them, because they will be added again\n if needed by the next `render`.\n\n In general, if the display of your view changes, you should modify\n the DOM element directly instead of manually calling `rerender`, which can\n be slow.\n\n @method rerender\n */\n rerender: function() {\n return this.currentState.rerender(this);\n },\n\n clearRenderedChildren: function() {\n var lengthBefore = this.lengthBeforeRender,\n lengthAfter = this.lengthAfterRender;\n\n // If there were child views created during the last call to render(),\n // remove them under the assumption that they will be re-created when\n // we re-render.\n\n // VIEW-TODO: Unit test this path.\n var childViews = this._childViews;\n for (var i=lengthAfter-1; i>=lengthBefore; i--) {\n if (childViews[i]) { childViews[i].destroy(); }\n }\n },\n\n /**\n @private\n\n Iterates over the view's `classNameBindings` array, inserts the value\n of the specified property into the `classNames` array, then creates an\n observer to update the view's element if the bound property ever changes\n in the future.\n\n @method _applyClassNameBindings\n */\n _applyClassNameBindings: function(classBindings) {\n var classNames = this.classNames,\n elem, newClass, dasherizedClass;\n\n // Loop through all of the configured bindings. These will be either\n // property names ('isUrgent') or property paths relative to the view\n // ('content.isUrgent')\n a_forEach(classBindings, function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n // Extract just the property name from bindings like 'foo:bar'\n var parsedPath = Ember.View._parsePropertyPath(binding);\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n var observer = function() {\n // Get the current value of the property\n newClass = this._classStringForProperty(binding);\n elem = this.$();\n\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n // Also remove from classNames so that if the view gets rerendered,\n // the class doesn't get added back to the DOM.\n classNames.removeObject(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n };\n\n // Get the class name for the property at its current value\n dasherizedClass = this._classStringForProperty(binding);\n\n if (dasherizedClass) {\n // Ensure that it gets into the classNames array\n // so it is displayed when we render.\n a_addObject(classNames, dasherizedClass);\n\n // Save a reference to the class name so we can remove it\n // if the observer fires. Remember that this variable has\n // been closed over by the observer.\n oldClass = dasherizedClass;\n }\n\n this.registerObserver(this, parsedPath.path, observer);\n // Remove className so when the view is rerendered,\n // the className is added based on binding reevaluation\n this.one('willClearRender', function() {\n if (oldClass) {\n classNames.removeObject(oldClass);\n oldClass = null;\n }\n });\n\n }, this);\n },\n\n /**\n @private\n\n Iterates through the view's attribute bindings, sets up observers for each,\n then applies the current value of the attributes to the passed render buffer.\n\n @method _applyAttributeBindings\n @param {Ember.RenderBuffer} buffer\n */\n _applyAttributeBindings: function(buffer, attributeBindings) {\n var attributeValue, elem;\n\n a_forEach(attributeBindings, function(binding) {\n var split = binding.split(':'),\n property = split[0],\n attributeName = split[1] || property;\n\n // Create an observer to add/remove/change the attribute if the\n // JavaScript property changes.\n var observer = function() {\n elem = this.$();\n\n attributeValue = get(this, property);\n\n Ember.View.applyAttributeBindings(elem, attributeName, attributeValue);\n };\n\n this.registerObserver(this, property, observer);\n\n // Determine the current value and add it to the render buffer\n // if necessary.\n attributeValue = get(this, property);\n Ember.View.applyAttributeBindings(buffer, attributeName, attributeValue);\n }, this);\n },\n\n /**\n @private\n\n Given a property name, returns a dasherized version of that\n property name if the property evaluates to a non-falsy value.\n\n For example, if the view has property `isUrgent` that evaluates to true,\n passing `isUrgent` to this method will return `\"is-urgent\"`.\n\n @method _classStringForProperty\n @param property\n */\n _classStringForProperty: function(property) {\n var parsedPath = Ember.View._parsePropertyPath(property);\n var path = parsedPath.path;\n\n var val = get(this, path);\n if (val === undefined && Ember.isGlobalPath(path)) {\n val = get(Ember.lookup, path);\n }\n\n return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n },\n\n // ..........................................................\n // ELEMENT SUPPORT\n //\n\n /**\n Returns the current DOM element for the view.\n\n @property element\n @type DOMElement\n */\n element: Ember.computed(function(key, value) {\n if (value !== undefined) {\n return this.currentState.setElement(this, value);\n } else {\n return this.currentState.getElement(this);\n }\n }).property('_parentView'),\n\n /**\n Returns a jQuery object for this view's element. If you pass in a selector\n string, this method will return a jQuery object, using the current element\n as its buffer.\n\n For example, calling `view.$('li')` will return a jQuery object containing\n all of the `li` elements inside the DOM element of this view.\n\n @property $\n @param {String} [selector] a jQuery-compatible selector string\n @return {jQuery} the CoreQuery object for the DOM node\n */\n $: function(sel) {\n return this.currentState.$(this, sel);\n },\n\n mutateChildViews: function(callback) {\n var childViews = this._childViews,\n idx = childViews.length,\n view;\n\n while(--idx >= 0) {\n view = childViews[idx];\n callback(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 cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n Replaces the content of the specified parent element with this view's\n element. If the view does not have an HTML representation yet,\n `createElement()` will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing\n\n @method replaceIn\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} received\n */\n replaceIn: function(target) {\n Ember.assert(\"You cannot replace an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n\n this._insertElementLater(function() {\n Ember.$(target).empty();\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n @private\n\n Schedules a DOM operation to occur during the next render phase. This\n ensures that all bindings have finished synchronizing before the view is\n rendered.\n\n To use, pass a function that performs a DOM operation.\n\n Before your function is called, this view and all child views will receive\n the `willInsertElement` event. After your function is invoked, this view\n and all of its child views will receive the `didInsertElement` event.\n\n ```javascript\n view._insertElementLater(function() {\n this.createElement();\n this.$().appendTo('body');\n });\n ```\n\n @method _insertElementLater\n @param {Function} fn the function that inserts the element into the DOM\n */\n _insertElementLater: function(fn) {\n this._scheduledInsert = Ember.run.scheduleOnce('render', this, '_insertElement', fn);\n },\n\n _insertElement: function (fn) {\n this._scheduledInsert = null;\n this.currentState.insertElement(this, fn);\n },\n\n /**\n Appends the view's element to the document body. If the view does\n not have an HTML representation yet, `createElement()` will be called\n automatically.\n\n If your application uses the `rootElement` property, you must append\n the view within that element. Rendering views outside of the `rootElement`\n is not supported.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the document body until all bindings have\n finished synchronizing.\n\n @method append\n @return {Ember.View} receiver\n */\n append: function() {\n return this.appendTo(document.body);\n },\n\n /**\n Removes the view's element from the element to which it is attached.\n\n @method remove\n @return {Ember.View} receiver\n */\n remove: function() {\n // What we should really do here is wait until the end of the run loop\n // to determine if the element has been re-appended to a different\n // element.\n // In the interim, we will just re-render if that happens. It is more\n // important than elements get garbage collected.\n if (!this.removedFromDOM) { this.destroyElement(); }\n this.invokeRecursively(function(view) {\n if (view.clearRenderedChildren) { view.clearRenderedChildren(); }\n });\n },\n\n elementId: null,\n\n /**\n Attempts to discover the element in the parent element. The default\n implementation looks for an element with an ID of `elementId` (or the\n view's guid if `elementId` is null). You can override this method to\n provide your own form of lookup. For example, if you want to discover your\n element using a CSS class name instead of an ID.\n\n @method findElementInParentElement\n @param {DOMElement} parentElement The parent's DOM element\n @return {DOMElement} The discovered element\n */\n findElementInParentElement: function(parentElem) {\n var id = \"#\" + this.elementId;\n return Ember.$(id)[0] || Ember.$(id, parentElem)[0];\n },\n\n /**\n Creates a DOM representation of the view and all of its\n child views by recursively calling the `render()` method.\n\n After the element has been created, `didInsertElement` will\n be called on this view and all of its child views.\n\n @method createElement\n @return {Ember.View} receiver\n */\n createElement: function() {\n if (get(this, 'element')) { return this; }\n\n var buffer = this.renderToBuffer();\n set(this, 'element', buffer.element());\n\n return this;\n },\n\n /**\n Called when a view is going to insert an element into the DOM.\n\n @event willInsertElement\n */\n willInsertElement: Ember.K,\n\n /**\n Called when the element of the view has been inserted into the DOM\n 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;\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\n\n @property ariaRole\n @type String\n @default null\n */\n ariaRole: null,\n\n /**\n Standard CSS class names to apply to the view's outer element. This\n property automatically inherits any class names defined by the view's\n superclasses as well.\n\n @property classNames\n @type Array\n @default ['ember-view']\n */\n classNames: ['ember-view'],\n\n /**\n A list of properties of the view to apply as class names. If the property\n is a string value, the value of that string will be applied as a class\n name.\n\n ```javascript\n // Applies the 'high' class to the view element\n Ember.View.create({\n classNameBindings: ['priority']\n priority: 'high'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as a dasherized class name.\n\n ```javascript\n // Applies the 'is-urgent' class to the view element\n Ember.View.create({\n classNameBindings: ['isUrgent']\n isUrgent: true\n });\n ```\n\n If you would prefer to use a custom value instead of the dasherized\n property name, you can pass a binding like this:\n\n ```javascript\n // Applies the 'urgent' class to the view element\n Ember.View.create({\n classNameBindings: ['isUrgent:urgent']\n isUrgent: true\n });\n ```\n\n This list of properties is inherited from the view's superclasses as well.\n\n @property classNameBindings\n @type Array\n @default []\n */\n classNameBindings: 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.create({\n attributeBindings: ['type'],\n type: 'button'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as an attribute.\n\n ```javascript\n // Renders something like
    \n Ember.View.create({\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 var viewController = get(this, 'viewController');\n if (viewController) {\n viewController = get(viewController);\n if (viewController) {\n set(viewController, 'view', this);\n }\n }\n },\n\n appendChild: function(view, options) {\n return this.currentState.appendChild(this, view, options);\n },\n\n /**\n Removes the child view from the parent view.\n\n @method removeChild\n @param {Ember.View} view\n @return {Ember.View} receiver\n */\n removeChild: function(view) {\n // If we're destroying, the entire subtree will be\n // freed, and the DOM will be handled separately,\n // so no need to mess with childViews.\n if (this.isDestroying) { return; }\n\n // update parent node\n set(view, '_parentView', null);\n\n // remove view from childViews array.\n var childViews = this._childViews;\n\n Ember.EnumerableUtils.removeObject(childViews, view);\n\n this.propertyDidChange('childViews'); // HUH?! what happened to will change?\n\n return this;\n },\n\n /**\n Removes all children from the `parentView`.\n\n @method removeAllChildren\n @return {Ember.View} receiver\n */\n removeAllChildren: function() {\n return this.mutateChildViews(function(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} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n if (view.isView && view._parentView === this) { return view; }\n\n if (Ember.CoreView.detect(view)) {\n attrs = attrs || {};\n attrs._parentView = this;\n attrs.container = this.container;\n attrs.templateData = attrs.templateData || get(this, 'templateData');\n\n view = view.create(attrs);\n\n // don't set the property on a virtual view, as they are invisible to\n // consumers of the view API\n if (view.viewName) { set(get(this, 'concreteView'), view.viewName, view); }\n } else {\n Ember.assert('You must pass instance or subclass of View', view.isView);\n\n if (attrs) {\n view.setProperties(attrs);\n }\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', get(this, 'templateData'));\n }\n\n set(view, '_parentView', this);\n }\n\n return view;\n },\n\n becameVisible: Ember.K,\n becameHidden: Ember.K,\n\n /**\n @private\n\n When the view's `isVisible` property changes, toggle the visibility\n element of the actual DOM element.\n\n @method _isVisibleDidChange\n */\n _isVisibleDidChange: Ember.observer(function() {\n var $el = this.$();\n if (!$el) { return; }\n\n var isVisible = get(this, 'isVisible');\n\n $el.toggle(isVisible);\n\n if (this._isAncestorHidden()) { return; }\n\n if (isVisible) {\n this._notifyBecameVisible();\n } else {\n this._notifyBecameHidden();\n }\n }, 'isVisible'),\n\n _notifyBecameVisible: function() {\n this.trigger('becameVisible');\n\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameVisible();\n }\n });\n },\n\n _notifyBecameHidden: function() {\n this.trigger('becameHidden');\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameHidden();\n }\n });\n },\n\n _isAncestorHidden: function() {\n var parent = get(this, 'parentView');\n\n while (parent) {\n if (get(parent, 'isVisible') === false) { return true; }\n\n parent = get(parent, 'parentView');\n }\n\n return false;\n },\n\n clearBuffer: function() {\n this.invokeRecursively(function(view) {\n view.buffer = null;\n });\n },\n\n transitionTo: function(state, children) {\n 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\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 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\" wil return the\n following object:\n\n ```javascript\n {\n path: \"content.isEnabled\",\n className: \"enabled\",\n falsyClassName: \"disabled\",\n classNames: \":enabled:disabled\"\n }\n ```\n\n @method _parsePropertyPath\n @static\n */\n _parsePropertyPath: function(path) {\n var split = path.split(':'),\n propertyPath = split[0],\n classNames = \"\",\n className,\n falsyClassName;\n\n // check if the property is defined as prop:class or prop:trueClass:falseClass\n if (split.length > 1) {\n className = split[1];\n if (split.length === 3) { falsyClassName = split[2]; }\n\n classNames = ':' + className;\n if (falsyClassName) { classNames += \":\" + falsyClassName; }\n }\n\n return {\n path: propertyPath,\n classNames: classNames,\n className: (className === '') ? undefined : className,\n falsyClassName: falsyClassName\n };\n },\n\n /**\n @private\n\n Get the class name for a given value, based on the path, optional\n `className` and optional `falsyClassName`.\n\n - if a `className` or `falsyClassName` has been specified:\n - if the value is truthy and `className` has been specified,\n `className` is returned\n - if the value is falsy and `falsyClassName` has been specified,\n `falsyClassName` is returned\n - otherwise `null` is returned\n - if the value is `true`, the dasherized last part of the supplied path\n is returned\n - if the value is not `false`, `undefined` or `null`, the `value`\n is returned\n - if none of the above rules apply, `null` is returned\n\n @method _classStringForValue\n @param path\n @param val\n @param className\n @param falsyClassName\n @static\n */\n _classStringForValue: function(path, val, className, falsyClassName) {\n // When using the colon syntax, evaluate the truthiness or falsiness\n // of the value to determine which className to return\n if (className || falsyClassName) {\n if (className && !!val) {\n return className;\n\n } else if (falsyClassName && !val) {\n return falsyClassName;\n\n } else {\n return null;\n }\n\n // If value is a Boolean and true, return the dasherized property\n // name.\n } else if (val === true) {\n // Normalize property path to be suitable for use\n // as a class name. For exaple, content.foo.barBaz\n // becomes bar-baz.\n var parts = path.split('.');\n return Ember.String.dasherize(parts[parts.length-1]);\n\n // If the value is not false, undefined, or null, return the current\n // value of the property.\n } else if (val !== false && val !== undefined && val !== null) {\n return val;\n\n // Nothing to display. Return null so that the old class is removed\n // but no new class is added.\n } else {\n return null;\n }\n }\n});\n\nvar mutation = Ember.Object.extend(Ember.Evented).create();\n\nEmber.View.addMutationListener = function(callback) {\n mutation.on('change', callback);\n};\n\nEmber.View.removeMutationListener = function(callback) {\n mutation.off('change', callback);\n};\n\nEmber.View.notifyMutationListeners = function() {\n mutation.trigger('change');\n};\n\n/**\n Global views hash\n\n @property views\n @static\n @type Hash\n*/\nEmber.View.views = {};\n\n// If someone overrides the child views computed property when\n// defining their class, we want to be able to process the user's\n// supplied childViews and then restore the original computed property\n// at view initialization time. This happens in Ember.ContainerView's init\n// method.\nEmber.View.childViewsProperty = childViewsProperty;\n\nEmber.View.applyAttributeBindings = function(elem, name, value) {\n var type = Ember.typeOf(value);\n\n // if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js\n if (name !== 'value' && (type === 'string' || (type === 'number' && !isNaN(value)))) {\n if (value !== elem.attr(name)) {\n elem.attr(name, value);\n }\n } else if (name === 'value' || type === 'boolean') {\n // We can't set properties to undefined\n if (value === undefined) { value = null; }\n\n if (value !== elem.prop(name)) {\n // value and booleans should always be properties\n elem.prop(name, value);\n }\n } else if (!value) {\n elem.removeAttr(name);\n }\n};\n\nEmber.View.states = states;\n\n})();\n//@ sourceURL=ember-views/views/view");minispade.register('ember', "(function() {minispade.require('ember-application');\n\n/**\nEmber\n\n@module ember\n*/\n\n})();\n//@ sourceURL=ember");minispade.register('loader', "(function() {var define, requireModule;\n\n(function() {\n var registry = {}, seen = {};\n\n define = function(name, deps, callback) {\n registry[name] = { deps: deps, callback: callback };\n };\n\n requireModule = function(name) {\n if (seen[name]) { return seen[name]; }\n seen[name] = {};\n\n var mod = registry[name],\n deps = mod.deps,\n callback = mod.callback,\n reified = [],\n exports;\n\n for (var i=0, l=deps.length; i
    \";\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 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/defer\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var defer = __dependency1__.defer;\n\n function all(promises) {\n var results = [], deferred = defer(), remaining = promises.length;\n\n if (remaining === 0) {\n deferred.resolve([]);\n }\n\n var resolver = function(index) {\n return function(value) {\n resolveAll(index, value);\n };\n };\n\n var resolveAll = function(index, value) {\n results[index] = value;\n if (--remaining === 0) {\n deferred.resolve(results);\n }\n };\n\n var rejectAll = function(error) {\n deferred.reject(error);\n };\n\n for (var i = 0; i < promises.length; i++) {\n if (promises[i] && typeof promises[i].then === 'function') {\n promises[i].then(resolver(i), rejectAll);\n } else {\n resolveAll(i, promises[i]);\n }\n }\n return deferred.promise;\n }\n\n __exports__.all = all;\n });\n\ndefine(\"rsvp/async\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var browserGlobal = (typeof window !== 'undefined') ? window : {};\n\n var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n var async;\n\n if (typeof process !== 'undefined' &&\n {}.toString.call(process) === '[object process]') {\n async = function(callback, binding) {\n process.nextTick(function() {\n callback.call(binding);\n });\n };\n } else if (BrowserMutationObserver) {\n var queue = [];\n\n var observer = new BrowserMutationObserver(function() {\n var toProcess = queue.slice();\n queue = [];\n\n toProcess.forEach(function(tuple) {\n var callback = tuple[0], binding = tuple[1];\n callback.call(binding);\n });\n });\n\n var element = document.createElement('div');\n observer.observe(element, { attributes: true });\n\n // Chrome Memory Leak: https://bugs.webkit.org/show_bug.cgi?id=93661\n window.addEventListener('unload', function(){\n observer.disconnect();\n observer = null;\n });\n\n async = function(callback, binding) {\n queue.push([callback, binding]);\n element.setAttribute('drainQueue', 'drainQueue');\n };\n } else {\n async = function(callback, binding) {\n setTimeout(function() {\n callback.call(binding);\n }, 1);\n };\n }\n\n\n __exports__.async = async;\n });\n\ndefine(\"rsvp/config\",\n [\"rsvp/async\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var async = __dependency1__.async;\n\n var config = {};\n config.async = async;\n\n __exports__.config = config;\n });\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\n var promise = new Promise(function(resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n\n deferred.promise = promise;\n return deferred;\n }\n\n __exports__.defer = defer;\n });\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\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(this, nodeArgs);\n } catch(e) {\n reject(e);\n }\n });\n\n return promise;\n };\n }\n\n __exports__.denodeify = denodeify;\n });\n\ndefine(\"rsvp/promise\",\n [\"rsvp/config\",\"rsvp/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var config = __dependency1__.config;\n var EventTarget = __dependency2__.EventTarget;\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 var Promise = function(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 this.on('promise:resolved', function(event) {\n this.trigger('success', { detail: event.detail });\n }, this);\n\n this.on('promise:failed', function(event) {\n this.trigger('error', { detail: event.detail });\n }, this);\n\n resolver(resolvePromise, rejectPromise);\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\n then: function(done, fail) {\n var thenPromise = new Promise(function() {});\n\n if (this.isFulfilled) {\n config.async(function() {\n invokeCallback('resolve', thenPromise, done, { detail: this.fulfillmentValue });\n }, this);\n }\n\n if (this.isRejected) {\n config.async(function() {\n invokeCallback('reject', thenPromise, fail, { detail: this.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\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\n if (objectOrFunction(value)) {\n try {\n then = value.then;\n } catch(e) {\n reject(promise, e);\n return true;\n }\n\n if (isFunction(then)) {\n try {\n then.call(value, function(val) {\n if (value !== val) {\n resolve(promise, val);\n } else {\n fulfill(promise, val);\n }\n }, function(val) {\n reject(promise, val);\n });\n } catch (e) {\n reject(promise, e);\n }\n return true;\n }\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 promise.trigger('promise:failed', { detail: value });\n promise.isRejected = true;\n promise.rejectedReason = value;\n });\n }\n\n\n __exports__.Promise = Promise;\n });\n\ndefine(\"rsvp/resolve\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n\n function objectOrFunction(x) {\n return typeof x === \"function\" || (typeof x === \"object\" && x !== null);\n }\n\n function resolve(thenable){\n var promise = new Promise(function(resolve, reject){\n var then;\n\n try {\n if ( objectOrFunction(thenable) ) {\n then = thenable.then;\n\n if (typeof then === \"function\") {\n then.call(thenable, resolve, reject);\n } else {\n resolve(thenable);\n }\n\n } else {\n resolve(thenable);\n }\n\n } catch(error) {\n reject(error);\n }\n });\n\n return promise;\n }\n\n\n __exports__.resolve = resolve;\n });\n\ndefine(\"rsvp\",\n [\"rsvp/events\",\"rsvp/promise\",\"rsvp/node\",\"rsvp/all\",\"rsvp/hash\",\"rsvp/defer\",\"rsvp/config\",\"rsvp/resolve\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __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 defer = __dependency6__.defer;\n var config = __dependency7__.config;\n var resolve = __dependency8__.resolve;\n\n function configure(name, value) {\n config[name] = value;\n }\n\n\n __exports__.Promise = Promise;\n __exports__.EventTarget = EventTarget;\n __exports__.all = all;\n __exports__.hash = hash;\n __exports__.defer = defer;\n __exports__.denodeify = denodeify;\n __exports__.configure = configure;\n __exports__.resolve = resolve;\n });\n\n})();\n//@ sourceURL=rsvp");