;(function() { /*! * @overview Ember - JavaScript Application Framework * @copyright Copyright 2011-2016 Tilde Inc. and contributors * Portions Copyright 2006-2011 Strobe Inc. * Portions Copyright 2008-2011 Apple Inc. All rights reserved. * @license Licensed under MIT license * See https://raw.github.com/emberjs/ember.js/master/LICENSE * @version 2.9.0-beta.1 */ var enifed, requireModule, require, Ember; var mainContext = this; (function() { var isNode = typeof window === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; if (!isNode) { Ember = this.Ember = this.Ember || {}; } if (typeof Ember === 'undefined') { Ember = {}; } if (typeof Ember.__loader === 'undefined') { var registry = {}; var seen = {}; enifed = function(name, deps, callback) { var value = { }; if (!callback) { value.deps = []; value.callback = deps; } else { value.deps = deps; value.callback = callback; } registry[name] = value; }; require = requireModule = function(name) { return internalRequire(name, null); }; // setup `require` module require['default'] = require; require.has = function registryHas(moduleName) { return !!registry[moduleName] || !!registry[moduleName + '/index']; }; function missingModule(name, referrerName) { if (referrerName) { throw new Error('Could not find module ' + name + ' required by: ' + referrerName); } else { throw new Error('Could not find module ' + name); } } function internalRequire(_name, referrerName) { var name = _name; var mod = registry[name]; if (!mod) { name = name + '/index'; mod = registry[name]; } var exports = seen[name]; if (exports !== undefined) { return exports; } exports = seen[name] = {}; if (!mod) { missingModule(_name, referrerName); } var deps = mod.deps; var callback = mod.callback; var reified = new Array(deps.length); for (var i = 0; i < deps.length; i++) { if (deps[i] === 'exports') { reified[i] = exports; } else if (deps[i] === 'require') { reified[i] = require; } else { reified[i] = internalRequire(deps[i], name); } } callback.apply(this, reified); return exports; } requireModule._eak_seen = registry; Ember.__loader = { define: enifed, require: require, registry: registry }; } else { enifed = Ember.__loader.define; require = requireModule = Ember.__loader.require; } })(); var babelHelpers; function inherits(subClass, superClass) { subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : defaults(subClass, superClass); } function taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; } function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function createClass(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; } function interopExportWildcard(obj, defaults) { var newObj = defaults({}, obj); delete newObj['default']; return newObj; } function defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } babelHelpers = { inherits: inherits, taggedTemplateLiteralLoose: taggedTemplateLiteralLoose, slice: Array.prototype.slice, createClass: createClass, interopExportWildcard: interopExportWildcard, defaults: defaults }; enifed('backburner', ['exports'], function (exports) { 'use strict'; var NUMBER = /\d+/; function each(collection, callback) { for (var i = 0; i < collection.length; i++) { callback(collection[i]); } } function isString(suspect) { return typeof suspect === 'string'; } function isFunction(suspect) { return typeof suspect === 'function'; } function isNumber(suspect) { return typeof suspect === 'number'; } function isCoercableNumber(number) { return isNumber(number) || NUMBER.test(number); } function binarySearch(time, timers) { var start = 0; var end = timers.length - 2; var middle, l; while (start < end) { // since timers is an array of pairs 'l' will always // be an integer l = (end - start) / 2; // compensate for the index in case even number // of pairs inside timers middle = start + l - (l % 2); if (time >= timers[middle]) { start = middle + 2; } else { end = middle; } } return (time >= timers[start]) ? start + 2 : start; } function Queue(name, options, globalOptions) { this.name = name; this.globalOptions = globalOptions || {}; this.options = options; this._queue = []; this.targetQueues = {}; this._queueBeingFlushed = undefined; } Queue.prototype = { push: function(target, method, args, stack) { var queue = this._queue; queue.push(target, method, args, stack); return { queue: this, target: target, method: method }; }, pushUniqueWithoutGuid: function(target, method, args, stack) { var queue = this._queue; for (var i = 0, l = queue.length; i < l; i += 4) { var currentTarget = queue[i]; var currentMethod = queue[i+1]; if (currentTarget === target && currentMethod === method) { queue[i+2] = args; // replace args queue[i+3] = stack; // replace stack return; } } queue.push(target, method, args, stack); }, targetQueue: function(targetQueue, target, method, args, stack) { var queue = this._queue; for (var i = 0, l = targetQueue.length; i < l; i += 2) { var currentMethod = targetQueue[i]; var currentIndex = targetQueue[i + 1]; if (currentMethod === method) { queue[currentIndex + 2] = args; // replace args queue[currentIndex + 3] = stack; // replace stack return; } } targetQueue.push( method, queue.push(target, method, args, stack) - 4 ); }, pushUniqueWithGuid: function(guid, target, method, args, stack) { var hasLocalQueue = this.targetQueues[guid]; if (hasLocalQueue) { this.targetQueue(hasLocalQueue, target, method, args, stack); } else { this.targetQueues[guid] = [ method, this._queue.push(target, method, args, stack) - 4 ]; } return { queue: this, target: target, method: method }; }, pushUnique: function(target, method, args, stack) { var KEY = this.globalOptions.GUID_KEY; if (target && KEY) { var guid = target[KEY]; if (guid) { return this.pushUniqueWithGuid(guid, target, method, args, stack); } } this.pushUniqueWithoutGuid(target, method, args, stack); return { queue: this, target: target, method: method }; }, invoke: function(target, method, args /*, onError, errorRecordedForStack */) { if (args && args.length > 0) { method.apply(target, args); } else { method.call(target); } }, invokeWithOnError: function(target, method, args, onError, errorRecordedForStack) { try { if (args && args.length > 0) { method.apply(target, args); } else { method.call(target); } } catch(error) { onError(error, errorRecordedForStack); } }, flush: function(sync) { var queue = this._queue; var length = queue.length; if (length === 0) { return; } var globalOptions = this.globalOptions; var options = this.options; var before = options && options.before; var after = options && options.after; var onError = globalOptions.onError || (globalOptions.onErrorTarget && globalOptions.onErrorTarget[globalOptions.onErrorMethod]); var target, method, args, errorRecordedForStack; var invoke = onError ? this.invokeWithOnError : this.invoke; this.targetQueues = Object.create(null); var queueItems = this._queueBeingFlushed = this._queue.slice(); this._queue = []; if (before) { before(); } for (var i = 0; i < length; i += 4) { target = queueItems[i]; method = queueItems[i+1]; args = queueItems[i+2]; errorRecordedForStack = queueItems[i+3]; // Debugging assistance if (isString(method)) { method = target[method]; } // method could have been nullified / canceled during flush if (method) { // // ** Attention intrepid developer ** // // To find out the stack of this task when it was scheduled onto // the run loop, add the following to your app.js: // // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production. // // Once that is in place, when you are at a breakpoint and navigate // here in the stack explorer, you can look at `errorRecordedForStack.stack`, // which will be the captured stack when this job was scheduled. // // One possible long-term solution is the following Chrome issue: // https://bugs.chromium.org/p/chromium/issues/detail?id=332624 // invoke(target, method, args, onError, errorRecordedForStack); } } if (after) { after(); } this._queueBeingFlushed = undefined; if (sync !== false && this._queue.length > 0) { // check if new items have been added this.flush(true); } }, cancel: function(actionToCancel) { var queue = this._queue, currentTarget, currentMethod, i, l; var target = actionToCancel.target; var method = actionToCancel.method; var GUID_KEY = this.globalOptions.GUID_KEY; if (GUID_KEY && this.targetQueues && target) { var targetQueue = this.targetQueues[target[GUID_KEY]]; if (targetQueue) { for (i = 0, l = targetQueue.length; i < l; i++) { if (targetQueue[i] === method) { targetQueue.splice(i, 1); } } } } for (i = 0, l = queue.length; i < l; i += 4) { currentTarget = queue[i]; currentMethod = queue[i+1]; if (currentTarget === target && currentMethod === method) { queue.splice(i, 4); return true; } } // if not found in current queue // could be in the queue that is being flushed queue = this._queueBeingFlushed; if (!queue) { return; } for (i = 0, l = queue.length; i < l; i += 4) { currentTarget = queue[i]; currentMethod = queue[i+1]; if (currentTarget === target && currentMethod === method) { // don't mess with array during flush // just nullify the method queue[i+1] = null; return true; } } } }; function DeferredActionQueues(queueNames, options) { var queues = this.queues = {}; this.queueNames = queueNames = queueNames || []; this.options = options; each(queueNames, function(queueName) { queues[queueName] = new Queue(queueName, options[queueName], options); }); } function noSuchQueue(name) { throw new Error('You attempted to schedule an action in a queue (' + name + ') that doesn\'t exist'); } function noSuchMethod(name) { throw new Error('You attempted to schedule an action in a queue (' + name + ') for a method that doesn\'t exist'); } DeferredActionQueues.prototype = { schedule: function(name, target, method, args, onceFlag, stack) { var queues = this.queues; var queue = queues[name]; if (!queue) { noSuchQueue(name); } if (!method) { noSuchMethod(name); } if (onceFlag) { return queue.pushUnique(target, method, args, stack); } else { return queue.push(target, method, args, stack); } }, flush: function() { var queues = this.queues; var queueNames = this.queueNames; var queueName, queue; var queueNameIndex = 0; var numberOfQueues = queueNames.length; while (queueNameIndex < numberOfQueues) { queueName = queueNames[queueNameIndex]; queue = queues[queueName]; var numberOfQueueItems = queue._queue.length; if (numberOfQueueItems === 0) { queueNameIndex++; } else { queue.flush(false /* async */); queueNameIndex = 0; } } } }; function Backburner(queueNames, options) { this.queueNames = queueNames; this.options = options || {}; if (!this.options.defaultQueue) { this.options.defaultQueue = queueNames[0]; } this.instanceStack = []; this._debouncees = []; this._throttlers = []; this._eventCallbacks = { end: [], begin: [] }; var _this = this; this._boundClearItems = function() { clearItems(); }; this._timerTimeoutId = undefined; this._timers = []; this._platform = this.options._platform || { setTimeout: function (fn, ms) { return setTimeout(fn, ms); }, clearTimeout: function (id) { clearTimeout(id); } }; this._boundRunExpiredTimers = function () { _this._runExpiredTimers(); }; } Backburner.prototype = { begin: function() { var options = this.options; var onBegin = options && options.onBegin; var previousInstance = this.currentInstance; if (previousInstance) { this.instanceStack.push(previousInstance); } this.currentInstance = new DeferredActionQueues(this.queueNames, options); this._trigger('begin', this.currentInstance, previousInstance); if (onBegin) { onBegin(this.currentInstance, previousInstance); } }, end: function() { var options = this.options; var onEnd = options && options.onEnd; var currentInstance = this.currentInstance; var nextInstance = null; // Prevent double-finally bug in Safari 6.0.2 and iOS 6 // This bug appears to be resolved in Safari 6.0.5 and iOS 7 var finallyAlreadyCalled = false; try { currentInstance.flush(); } finally { if (!finallyAlreadyCalled) { finallyAlreadyCalled = true; this.currentInstance = null; if (this.instanceStack.length) { nextInstance = this.instanceStack.pop(); this.currentInstance = nextInstance; } this._trigger('end', currentInstance, nextInstance); if (onEnd) { onEnd(currentInstance, nextInstance); } } } }, /** Trigger an event. Supports up to two arguments. Designed around triggering transition events from one run loop instance to the next, which requires an argument for the first instance and then an argument for the next instance. @private @method _trigger @param {String} eventName @param {any} arg1 @param {any} arg2 */ _trigger: function(eventName, arg1, arg2) { var callbacks = this._eventCallbacks[eventName]; if (callbacks) { for (var i = 0; i < callbacks.length; i++) { callbacks[i](arg1, arg2); } } }, on: function(eventName, callback) { if (typeof callback !== 'function') { throw new TypeError('Callback must be a function'); } var callbacks = this._eventCallbacks[eventName]; if (callbacks) { callbacks.push(callback); } else { throw new TypeError('Cannot on() event "' + eventName + '" because it does not exist'); } }, off: function(eventName, callback) { if (eventName) { var callbacks = this._eventCallbacks[eventName]; var callbackFound = false; if (!callbacks) return; if (callback) { for (var i = 0; i < callbacks.length; i++) { if (callbacks[i] === callback) { callbackFound = true; callbacks.splice(i, 1); i--; } } } if (!callbackFound) { throw new TypeError('Cannot off() callback that does not exist'); } } else { throw new TypeError('Cannot off() event "' + eventName + '" because it does not exist'); } }, run: function(/* target, method, args */) { var length = arguments.length; var method, target, args; if (length === 1) { method = arguments[0]; target = null; } else { target = arguments[0]; method = arguments[1]; } if (isString(method)) { method = target[method]; } if (length > 2) { args = new Array(length - 2); for (var i = 0, l = length - 2; i < l; i++) { args[i] = arguments[i + 2]; } } else { args = []; } var onError = getOnError(this.options); this.begin(); // guard against Safari 6's double-finally bug var didFinally = false; if (onError) { try { return method.apply(target, args); } catch(error) { onError(error); } finally { if (!didFinally) { didFinally = true; this.end(); } } } else { try { return method.apply(target, args); } finally { if (!didFinally) { didFinally = true; this.end(); } } } }, /* Join the passed method with an existing queue and execute immediately, if there isn't one use `Backburner#run`. The join method is like the run method except that it will schedule into an existing queue if one already exists. In either case, the join method will immediately execute the passed in function and return its result. @method join @param {Object} target @param {Function} method The method to be executed @param {any} args The method arguments @return method result */ join: function(/* target, method, args */) { if (!this.currentInstance) { return this.run.apply(this, arguments); } var length = arguments.length; var method, target; if (length === 1) { method = arguments[0]; target = null; } else { target = arguments[0]; method = arguments[1]; } if (isString(method)) { method = target[method]; } if (length === 1) { return method(); } else if (length === 2) { return method.call(target); } else { var args = new Array(length - 2); for (var i = 0, l = length - 2; i < l; i++) { args[i] = arguments[i + 2]; } return method.apply(target, args); } }, /* Defer the passed function to run inside the specified queue. @method defer @param {String} queueName @param {Object} target @param {Function|String} method The method or method name to be executed @param {any} args The method arguments @return method result */ defer: function(queueName /* , target, method, args */) { var length = arguments.length; var method, target, args; if (length === 2) { method = arguments[1]; target = null; } else { target = arguments[1]; method = arguments[2]; } if (isString(method)) { method = target[method]; } var stack = this.DEBUG ? new Error() : undefined; if (length > 3) { args = new Array(length - 3); for (var i = 3; i < length; i++) { args[i-3] = arguments[i]; } } else { args = undefined; } if (!this.currentInstance) { createAutorun(this); } return this.currentInstance.schedule(queueName, target, method, args, false, stack); }, deferOnce: function(queueName /* , target, method, args */) { var length = arguments.length; var method, target, args; if (length === 2) { method = arguments[1]; target = null; } else { target = arguments[1]; method = arguments[2]; } if (isString(method)) { method = target[method]; } var stack = this.DEBUG ? new Error() : undefined; if (length > 3) { args = new Array(length - 3); for (var i = 3; i < length; i++) { args[i-3] = arguments[i]; } } else { args = undefined; } if (!this.currentInstance) { createAutorun(this); } return this.currentInstance.schedule(queueName, target, method, args, true, stack); }, setTimeout: function() { var l = arguments.length; var args = new Array(l); for (var x = 0; x < l; x++) { args[x] = arguments[x]; } var length = args.length, method, wait, target, methodOrTarget, methodOrWait, methodOrArgs; if (length === 0) { return; } else if (length === 1) { method = args.shift(); wait = 0; } else if (length === 2) { methodOrTarget = args[0]; methodOrWait = args[1]; if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) { target = args.shift(); method = args.shift(); wait = 0; } else if (isCoercableNumber(methodOrWait)) { method = args.shift(); wait = args.shift(); } else { method = args.shift(); wait = 0; } } else { var last = args[args.length - 1]; if (isCoercableNumber(last)) { wait = args.pop(); } else { wait = 0; } methodOrTarget = args[0]; methodOrArgs = args[1]; if (isFunction(methodOrArgs) || (isString(methodOrArgs) && methodOrTarget !== null && methodOrArgs in methodOrTarget)) { target = args.shift(); method = args.shift(); } else { method = args.shift(); } } var executeAt = Date.now() + parseInt(wait !== wait ? 0 : wait, 10); if (isString(method)) { method = target[method]; } var onError = getOnError(this.options); function fn() { if (onError) { try { method.apply(target, args); } catch (e) { onError(e); } } else { method.apply(target, args); } } return this._setTimeout(fn, executeAt); }, _setTimeout: function (fn, executeAt) { if (this._timers.length === 0) { this._timers.push(executeAt, fn); this._installTimerTimeout(); return fn; } // find position to insert var i = binarySearch(executeAt, this._timers); this._timers.splice(i, 0, executeAt, fn); // we should be the new earliest timer if i == 0 if (i === 0) { this._reinstallTimerTimeout(); } return fn; }, throttle: function(target, method /* , args, wait, [immediate] */) { var backburner = this; var args = new Array(arguments.length); for (var i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } var immediate = args.pop(); var wait, throttler, index, timer; if (isNumber(immediate) || isString(immediate)) { wait = immediate; immediate = true; } else { wait = args.pop(); } wait = parseInt(wait, 10); index = findThrottler(target, method, this._throttlers); if (index > -1) { return this._throttlers[index]; } // throttled timer = this._platform.setTimeout(function() { if (!immediate) { backburner.run.apply(backburner, args); } var index = findThrottler(target, method, backburner._throttlers); if (index > -1) { backburner._throttlers.splice(index, 1); } }, wait); if (immediate) { this.run.apply(this, args); } throttler = [target, method, timer]; this._throttlers.push(throttler); return throttler; }, debounce: function(target, method /* , args, wait, [immediate] */) { var backburner = this; var args = new Array(arguments.length); for (var i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } var immediate = args.pop(); var wait, index, debouncee, timer; if (isNumber(immediate) || isString(immediate)) { wait = immediate; immediate = false; } else { wait = args.pop(); } wait = parseInt(wait, 10); // Remove debouncee index = findDebouncee(target, method, this._debouncees); if (index > -1) { debouncee = this._debouncees[index]; this._debouncees.splice(index, 1); this._platform.clearTimeout(debouncee[2]); } timer = this._platform.setTimeout(function() { if (!immediate) { backburner.run.apply(backburner, args); } var index = findDebouncee(target, method, backburner._debouncees); if (index > -1) { backburner._debouncees.splice(index, 1); } }, wait); if (immediate && index === -1) { backburner.run.apply(backburner, args); } debouncee = [ target, method, timer ]; backburner._debouncees.push(debouncee); return debouncee; }, cancelTimers: function() { each(this._throttlers, this._boundClearItems); this._throttlers = []; each(this._debouncees, this._boundClearItems); this._debouncees = []; this._clearTimerTimeout(); this._timers = []; if (this._autorun) { this._platform.clearTimeout(this._autorun); this._autorun = null; } }, hasTimers: function() { return !!this._timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun; }, cancel: function (timer) { var timerType = typeof timer; if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce return timer.queue.cancel(timer); } else if (timerType === 'function') { // we're cancelling a setTimeout for (var i = 0, l = this._timers.length; i < l; i += 2) { if (this._timers[i + 1] === timer) { this._timers.splice(i, 2); // remove the two elements if (i === 0) { this._reinstallTimerTimeout(); } return true; } } } else if (Object.prototype.toString.call(timer) === '[object Array]'){ // we're cancelling a throttle or debounce return this._cancelItem(findThrottler, this._throttlers, timer) || this._cancelItem(findDebouncee, this._debouncees, timer); } else { return; // timer was null or not a timer } }, _cancelItem: function(findMethod, array, timer){ var item, index; if (timer.length < 3) { return false; } index = findMethod(timer[0], timer[1], array); if (index > -1) { item = array[index]; if (item[2] === timer[2]) { array.splice(index, 1); this._platform.clearTimeout(timer[2]); return true; } } return false; }, _runExpiredTimers: function () { this._timerTimeoutId = undefined; this.run(this, this._scheduleExpiredTimers); }, _scheduleExpiredTimers: function () { var n = Date.now(); var timers = this._timers; var i = 0; var l = timers.length; for (; i < l; i += 2) { var executeAt = timers[i]; var fn = timers[i+1]; if (executeAt <= n) { this.schedule(this.options.defaultQueue, null, fn); } else { break; } } timers.splice(0, i); this._installTimerTimeout(); }, _reinstallTimerTimeout: function () { this._clearTimerTimeout(); this._installTimerTimeout(); }, _clearTimerTimeout: function () { if (!this._timerTimeoutId) { return; } this._platform.clearTimeout(this._timerTimeoutId); this._timerTimeoutId = undefined; }, _installTimerTimeout: function () { if (!this._timers.length) { return; } var minExpiresAt = this._timers[0]; var n = Date.now(); var wait = Math.max(0, minExpiresAt - n); this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait); } }; Backburner.prototype.schedule = Backburner.prototype.defer; Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce; Backburner.prototype.later = Backburner.prototype.setTimeout; function getOnError(options) { return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]); } function createAutorun(backburner) { var setTimeout = backburner._platform.setTimeout; backburner.begin(); backburner._autorun = setTimeout(function() { backburner._autorun = null; backburner.end(); }, 0); } function findDebouncee(target, method, debouncees) { return findItem(target, method, debouncees); } function findThrottler(target, method, throttlers) { return findItem(target, method, throttlers); } function findItem(target, method, collection) { var item; var index = -1; for (var i = 0, l = collection.length; i < l; i++) { item = collection[i]; if (item[0] === target && item[1] === method) { index = i; break; } } return index; } function clearItems(item) { this._platform.clearTimeout(item[2]); } exports['default'] = Backburner; Object.defineProperty(exports, '__esModule', { value: true }); }); enifed('container/container', ['exports', 'ember-environment', 'ember-metal', 'container/owner'], function (exports, _emberEnvironment, _emberMetal, _containerOwner) { 'use strict'; exports.default = Container; exports.buildFakeContainerWithDeprecations = buildFakeContainerWithDeprecations; var CONTAINER_OVERRIDE = _emberMetal.symbol('CONTAINER_OVERRIDE'); /** A container used to instantiate and cache objects. Every `Container` must be associated with a `Registry`, which is referenced to determine the factory and options that should be used to instantiate objects. The public API for `Container` is still in flux and should not be considered stable. @private @class Container */ function Container(registry, options) { this.registry = registry; this.owner = options && options.owner ? options.owner : null; this.cache = _emberMetal.dictionary(options && options.cache ? options.cache : null); this.factoryCache = _emberMetal.dictionary(options && options.factoryCache ? options.factoryCache : null); this.validationCache = _emberMetal.dictionary(options && options.validationCache ? options.validationCache : null); this._fakeContainerToInject = buildFakeContainerWithDeprecations(this); this[CONTAINER_OVERRIDE] = undefined; this.isDestroyed = false; } Container.prototype = { /** @private @property owner @type Object */ owner: null, /** @private @property registry @type Registry @since 1.11.0 */ registry: null, /** @private @property cache @type InheritingDict */ cache: null, /** @private @property factoryCache @type InheritingDict */ factoryCache: null, /** @private @property validationCache @type InheritingDict */ validationCache: null, /** Given a fullName return a corresponding instance. The default behaviour is for lookup to return a singleton instance. The singleton is scoped to the container, allowing multiple containers to all have their own locally scoped singletons. ```javascript let registry = new Registry(); let container = registry.container(); registry.register('api:twitter', Twitter); let twitter = container.lookup('api:twitter'); twitter instanceof Twitter; // => true // by default the container will return singletons let twitter2 = container.lookup('api:twitter'); twitter2 instanceof Twitter; // => true twitter === twitter2; //=> true ``` If singletons are not wanted, an optional flag can be provided at lookup. ```javascript let registry = new Registry(); let container = registry.container(); registry.register('api:twitter', Twitter); let twitter = container.lookup('api:twitter', { singleton: false }); let twitter2 = container.lookup('api:twitter', { singleton: false }); twitter === twitter2; //=> false ``` @private @method lookup @param {String} fullName @param {Object} [options] @param {String} [options.source] The fullname of the request source (used for local lookup) @return {any} */ lookup: function (fullName, options) { return lookup(this, this.registry.normalize(fullName), options); }, /** Given a fullName, return the corresponding factory. @private @method lookupFactory @param {String} fullName @param {Object} [options] @param {String} [options.source] The fullname of the request source (used for local lookup) @return {any} */ lookupFactory: function (fullName, options) { return factoryFor(this, this.registry.normalize(fullName), options); }, /** A depth first traversal, destroying the container, its descendant containers and all their managed objects. @private @method destroy */ destroy: function () { eachDestroyable(this, function (item) { if (item.destroy) { item.destroy(); } }); this.isDestroyed = true; }, /** Clear either the entire cache or just the cache for a particular key. @private @method reset @param {String} fullName optional key to reset; if missing, resets everything */ reset: function (fullName) { if (arguments.length > 0) { resetMember(this, this.registry.normalize(fullName)); } else { resetCache(this); } }, /** Returns an object that can be used to provide an owner to a manually created instance. @private @method ownerInjection @returns { Object } */ ownerInjection: function () { var _ref; return _ref = {}, _ref[_containerOwner.OWNER] = this.owner, _ref; } }; function isSingleton(container, fullName) { return container.registry.getOption(fullName, 'singleton') !== false; } function lookup(container, fullName) { var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; if (options.source) { fullName = container.registry.expandLocalLookup(fullName, options); // if expandLocalLookup returns falsey, we do not support local lookup if (!fullName) { return; } } if (container.cache[fullName] !== undefined && options.singleton !== false) { return container.cache[fullName]; } var value = instantiate(container, fullName); if (value === undefined) { return; } if (isSingleton(container, fullName) && options.singleton !== false) { container.cache[fullName] = value; } return value; } function markInjectionsAsDynamic(injections) { injections._dynamic = true; } function areInjectionsDynamic(injections) { return !!injections._dynamic; } function buildInjections() /* container, ...injections */{ var hash = {}; if (arguments.length > 1) { var container = arguments[0]; var injections = []; var injection = undefined; for (var i = 1; i < arguments.length; i++) { if (arguments[i]) { injections = injections.concat(arguments[i]); } } container.registry.validateInjections(injections); for (var i = 0; i < injections.length; i++) { injection = injections[i]; hash[injection.property] = lookup(container, injection.fullName); if (!isSingleton(container, injection.fullName)) { markInjectionsAsDynamic(hash); } } } return hash; } function factoryFor(container, fullName) { var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; var registry = container.registry; if (options.source) { fullName = registry.expandLocalLookup(fullName, options); // if expandLocalLookup returns falsey, we do not support local lookup if (!fullName) { return; } } var cache = container.factoryCache; if (cache[fullName]) { return cache[fullName]; } var factory = registry.resolve(fullName); if (factory === undefined) { return; } var type = fullName.split(':')[0]; if (!factory || typeof factory.extend !== 'function' || !_emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS && type === 'model') { if (factory && typeof factory._onLookup === 'function') { factory._onLookup(fullName); } // TODO: think about a 'safe' merge style extension // for now just fallback to create time injection cache[fullName] = factory; return factory; } else { var injections = injectionsFor(container, fullName); var factoryInjections = factoryInjectionsFor(container, fullName); var cacheable = !areInjectionsDynamic(injections) && !areInjectionsDynamic(factoryInjections); factoryInjections._toString = registry.makeToString(factory, fullName); var injectedFactory = factory.extend(injections); // TODO - remove all `container` injections when Ember reaches v3.0.0 injectDeprecatedContainer(injectedFactory.prototype, container); injectedFactory.reopenClass(factoryInjections); if (factory && typeof factory._onLookup === 'function') { factory._onLookup(fullName); } if (cacheable) { cache[fullName] = injectedFactory; } return injectedFactory; } } function injectionsFor(container, fullName) { var registry = container.registry; var splitName = fullName.split(':'); var type = splitName[0]; var injections = buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName)); injections._debugContainerKey = fullName; _containerOwner.setOwner(injections, container.owner); return injections; } function factoryInjectionsFor(container, fullName) { var registry = container.registry; var splitName = fullName.split(':'); var type = splitName[0]; var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); factoryInjections._debugContainerKey = fullName; return factoryInjections; } function instantiate(container, fullName) { var factory = factoryFor(container, fullName); var lazyInjections = undefined, validationCache = undefined; if (container.registry.getOption(fullName, 'instantiate') === false) { return factory; } if (factory) { if (typeof factory.create !== 'function') { throw new Error('Failed to create an instance of \'' + fullName + '\'. Most likely an improperly defined class or' + ' an invalid module export.'); } validationCache = container.validationCache; validationCache[fullName] = true; var obj = undefined; if (typeof factory.extend === 'function') { // assume the factory was extendable and is already injected obj = factory.create(); } else { // assume the factory was extendable // to create time injections // TODO: support new'ing for instantiation and merge injections for pure JS Functions var injections = injectionsFor(container, fullName); // Ensure that a container is available to an object during instantiation. // TODO - remove when Ember reaches v3.0.0 // This "fake" container will be replaced after instantiation with a // property that raises deprecations every time it is accessed. injections.container = container._fakeContainerToInject; obj = factory.create(injections); // TODO - remove when Ember reaches v3.0.0 if (!Object.isFrozen(obj) && 'container' in obj) { injectDeprecatedContainer(obj, container); } } return obj; } } // TODO - remove when Ember reaches v3.0.0 function injectDeprecatedContainer(object, container) { Object.defineProperty(object, 'container', { configurable: true, enumerable: false, get: function () { return this[CONTAINER_OVERRIDE] || container; }, set: function (value) { this[CONTAINER_OVERRIDE] = value; return value; } }); } function eachDestroyable(container, callback) { var cache = container.cache; var keys = Object.keys(cache); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = cache[key]; if (container.registry.getOption(key, 'instantiate') !== false) { callback(value); } } } function resetCache(container) { eachDestroyable(container, function (value) { if (value.destroy) { value.destroy(); } }); container.cache.dict = _emberMetal.dictionary(null); } function resetMember(container, fullName) { var member = container.cache[fullName]; delete container.factoryCache[fullName]; if (member) { delete container.cache[fullName]; if (member.destroy) { member.destroy(); } } } function buildFakeContainerWithDeprecations(container) { var fakeContainer = {}; var propertyMappings = { lookup: 'lookup', lookupFactory: '_lookupFactory' }; for (var containerProperty in propertyMappings) { fakeContainer[containerProperty] = buildFakeContainerFunction(container, containerProperty, propertyMappings[containerProperty]); } return fakeContainer; } function buildFakeContainerFunction(container, containerProperty, ownerProperty) { return function () { return container[containerProperty].apply(container, arguments); }; } }); // Ensure that all lazy injections are valid at instantiation time enifed('container/index', ['exports', 'container/registry', 'container/container', 'container/owner'], function (exports, _containerRegistry, _containerContainer, _containerOwner) { /* Public API for the container is still in flux. The public API, specified on the application namespace should be considered the stable API. // @module container @private */ 'use strict'; exports.Registry = _containerRegistry.default; exports.privatize = _containerRegistry.privatize; exports.Container = _containerContainer.default; exports.buildFakeContainerWithDeprecations = _containerContainer.buildFakeContainerWithDeprecations; exports.OWNER = _containerOwner.OWNER; exports.getOwner = _containerOwner.getOwner; exports.setOwner = _containerOwner.setOwner; }); enifed('container/owner', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-runtime */ 'use strict'; exports.getOwner = getOwner; exports.setOwner = setOwner; var OWNER = _emberMetal.symbol('OWNER'); exports.OWNER = OWNER; /** Framework objects in an Ember application (components, services, routes, etc.) are created via a factory and dependency injection system. Each of these objects is the responsibility of an "owner", which handled its instantiation and manages its lifetime. `getOwner` fetches the owner object responsible for an instance. This can be used to lookup or resolve other class instances, or register new factories into the owner. For example, this component dynamically looks up a service based on the `audioType` passed as an attribute: ``` // app/components/play-audio.js import Ember from 'ember'; // Usage: // // {{play-audio audioType=model.audioType audioFile=model.file}} // export default Ember.Component.extend({ audioService: Ember.computed('audioType', function() { let owner = Ember.getOwner(this); return owner.lookup(`service:${this.get('audioType')}`); }), click() { let player = this.get('audioService'); player.play(this.get('audioFile')); } }); ``` @method getOwner @for Ember @param {Object} object An object with an owner. @return {Object} An owner object. @since 2.3.0 @public */ function getOwner(object) { return object[OWNER]; } /** `setOwner` forces a new owner on a given object instance. This is primarily useful in some testing cases. @method setOwner @for Ember @param {Object} object An object with an owner. @return {Object} An owner object. @since 2.3.0 @public */ function setOwner(object, owner) { object[OWNER] = owner; } }); enifed('container/registry', ['exports', 'ember-metal', 'container/container'], function (exports, _emberMetal, _containerContainer) { 'use strict'; exports.default = Registry; exports.privatize = privatize; var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/; /** A registry used to store factory and option information keyed by type. A `Registry` stores the factory and option information needed by a `Container` to instantiate and cache objects. The API for `Registry` is still in flux and should not be considered stable. @private @class Registry @since 1.11.0 */ function Registry(options) { this.fallback = options && options.fallback ? options.fallback : null; if (options && options.resolver) { this.resolver = options.resolver; if (typeof this.resolver === 'function') { deprecateResolverFunction(this); } } this.registrations = _emberMetal.dictionary(options && options.registrations ? options.registrations : null); this._typeInjections = _emberMetal.dictionary(null); this._injections = _emberMetal.dictionary(null); this._factoryTypeInjections = _emberMetal.dictionary(null); this._factoryInjections = _emberMetal.dictionary(null); this._localLookupCache = new _emberMetal.EmptyObject(); this._normalizeCache = _emberMetal.dictionary(null); this._resolveCache = _emberMetal.dictionary(null); this._failCache = _emberMetal.dictionary(null); this._options = _emberMetal.dictionary(null); this._typeOptions = _emberMetal.dictionary(null); } Registry.prototype = { /** A backup registry for resolving registrations when no matches can be found. @private @property fallback @type Registry */ fallback: null, /** An object that has a `resolve` method that resolves a name. @private @property resolver @type Resolver */ resolver: null, /** @private @property registrations @type InheritingDict */ registrations: null, /** @private @property _typeInjections @type InheritingDict */ _typeInjections: null, /** @private @property _injections @type InheritingDict */ _injections: null, /** @private @property _factoryTypeInjections @type InheritingDict */ _factoryTypeInjections: null, /** @private @property _factoryInjections @type InheritingDict */ _factoryInjections: null, /** @private @property _normalizeCache @type InheritingDict */ _normalizeCache: null, /** @private @property _resolveCache @type InheritingDict */ _resolveCache: null, /** @private @property _options @type InheritingDict */ _options: null, /** @private @property _typeOptions @type InheritingDict */ _typeOptions: null, /** Creates a container based on this registry. @private @method container @param {Object} options @return {Container} created container */ container: function (options) { return new _containerContainer.default(this, options); }, /** Registers a factory for later injection. Example: ```javascript let registry = new Registry(); registry.register('model:user', Person, {singleton: false }); registry.register('fruit:favorite', Orange); registry.register('communication:main', Email, {singleton: false}); ``` @private @method register @param {String} fullName @param {Function} factory @param {Object} options */ register: function (fullName, factory) { var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; if (factory === undefined) { throw new TypeError('Attempting to register an unknown factory: \'' + fullName + '\''); } var normalizedName = this.normalize(fullName); if (this._resolveCache[normalizedName]) { throw new Error('Cannot re-register: \'' + fullName + '\', as it has already been resolved.'); } delete this._failCache[normalizedName]; this.registrations[normalizedName] = factory; this._options[normalizedName] = options; }, /** Unregister a fullName ```javascript let registry = new Registry(); registry.register('model:user', User); registry.resolve('model:user').create() instanceof User //=> true registry.unregister('model:user') registry.resolve('model:user') === undefined //=> true ``` @private @method unregister @param {String} fullName */ unregister: function (fullName) { var normalizedName = this.normalize(fullName); this._localLookupCache = new _emberMetal.EmptyObject(); delete this.registrations[normalizedName]; delete this._resolveCache[normalizedName]; delete this._failCache[normalizedName]; delete this._options[normalizedName]; }, /** Given a fullName return the corresponding factory. By default `resolve` will retrieve the factory from the registry. ```javascript let registry = new Registry(); registry.register('api:twitter', Twitter); registry.resolve('api:twitter') // => Twitter ``` Optionally the registry can be provided with a custom resolver. If provided, `resolve` will first provide the custom resolver the opportunity to resolve the fullName, otherwise it will fallback to the registry. ```javascript let registry = new Registry(); registry.resolver = function(fullName) { // lookup via the module system of choice }; // the twitter factory is added to the module system registry.resolve('api:twitter') // => Twitter ``` @private @method resolve @param {String} fullName @param {Object} [options] @param {String} [options.source] the fullname of the request source (used for local lookups) @return {Function} fullName's factory */ resolve: function (fullName, options) { var factory = resolve(this, this.normalize(fullName), options); if (factory === undefined && this.fallback) { var _fallback; factory = (_fallback = this.fallback).resolve.apply(_fallback, arguments); } return factory; }, /** A hook that can be used to describe how the resolver will attempt to find the factory. For example, the default Ember `.describe` returns the full class name (including namespace) where Ember's resolver expects to find the `fullName`. @private @method describe @param {String} fullName @return {string} described fullName */ describe: function (fullName) { if (this.resolver && this.resolver.lookupDescription) { return this.resolver.lookupDescription(fullName); } else if (this.fallback) { return this.fallback.describe(fullName); } else { return fullName; } }, /** A hook to enable custom fullName normalization behaviour @private @method normalizeFullName @param {String} fullName @return {string} normalized fullName */ normalizeFullName: function (fullName) { if (this.resolver && this.resolver.normalize) { return this.resolver.normalize(fullName); } else if (this.fallback) { return this.fallback.normalizeFullName(fullName); } else { return fullName; } }, /** Normalize a fullName based on the application's conventions @private @method normalize @param {String} fullName @return {string} normalized fullName */ normalize: function (fullName) { return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName)); }, /** @method makeToString @private @param {any} factory @param {string} fullName @return {function} toString function */ makeToString: function (factory, fullName) { if (this.resolver && this.resolver.makeToString) { return this.resolver.makeToString(factory, fullName); } else if (this.fallback) { return this.fallback.makeToString(factory, fullName); } else { return factory.toString(); } }, /** Given a fullName check if the container is aware of its factory or singleton instance. @private @method has @param {String} fullName @param {Object} [options] @param {String} [options.source] the fullname of the request source (used for local lookups) @return {Boolean} */ has: function (fullName, options) { if (!this.isValidFullName(fullName)) { return false; } var source = options && options.source && this.normalize(options.source); return has(this, this.normalize(fullName), source); }, /** Allow registering options for all factories of a type. ```javascript let registry = new Registry(); let container = registry.container(); // if all of type `connection` must not be singletons registry.optionsForType('connection', { singleton: false }); registry.register('connection:twitter', TwitterConnection); registry.register('connection:facebook', FacebookConnection); let twitter = container.lookup('connection:twitter'); let twitter2 = container.lookup('connection:twitter'); twitter === twitter2; // => false let facebook = container.lookup('connection:facebook'); let facebook2 = container.lookup('connection:facebook'); facebook === facebook2; // => false ``` @private @method optionsForType @param {String} type @param {Object} options */ optionsForType: function (type, options) { this._typeOptions[type] = options; }, getOptionsForType: function (type) { var optionsForType = this._typeOptions[type]; if (optionsForType === undefined && this.fallback) { optionsForType = this.fallback.getOptionsForType(type); } return optionsForType; }, /** @private @method options @param {String} fullName @param {Object} options */ options: function (fullName) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var normalizedName = this.normalize(fullName); this._options[normalizedName] = options; }, getOptions: function (fullName) { var normalizedName = this.normalize(fullName); var options = this._options[normalizedName]; if (options === undefined && this.fallback) { options = this.fallback.getOptions(fullName); } return options; }, getOption: function (fullName, optionName) { var options = this._options[fullName]; if (options && options[optionName] !== undefined) { return options[optionName]; } var type = fullName.split(':')[0]; options = this._typeOptions[type]; if (options && options[optionName] !== undefined) { return options[optionName]; } else if (this.fallback) { return this.fallback.getOption(fullName, optionName); } }, /** Used only via `injection`. Provides a specialized form of injection, specifically enabling all objects of one type to be injected with a reference to another object. For example, provided each object of type `controller` needed a `router`. one would do the following: ```javascript let registry = new Registry(); let container = registry.container(); registry.register('router:main', Router); registry.register('controller:user', UserController); registry.register('controller:post', PostController); registry.typeInjection('controller', 'router', 'router:main'); let user = container.lookup('controller:user'); let post = container.lookup('controller:post'); user.router instanceof Router; //=> true post.router instanceof Router; //=> true // both controllers share the same router user.router === post.router; //=> true ``` @private @method typeInjection @param {String} type @param {String} property @param {String} fullName */ typeInjection: function (type, property, fullName) { var fullNameType = fullName.split(':')[0]; if (fullNameType === type) { throw new Error('Cannot inject a \'' + fullName + '\' on other ' + type + '(s).'); } var injections = this._typeInjections[type] || (this._typeInjections[type] = []); injections.push({ property: property, fullName: fullName }); }, /** Defines injection rules. These rules are used to inject dependencies onto objects when they are instantiated. Two forms of injections are possible: * Injecting one fullName on another fullName * Injecting one fullName on a type Example: ```javascript let registry = new Registry(); let container = registry.container(); registry.register('source:main', Source); registry.register('model:user', User); registry.register('model:post', Post); // injecting one fullName on another fullName // eg. each user model gets a post model registry.injection('model:user', 'post', 'model:post'); // injecting one fullName on another type registry.injection('model', 'source', 'source:main'); let user = container.lookup('model:user'); let post = container.lookup('model:post'); user.source instanceof Source; //=> true post.source instanceof Source; //=> true user.post instanceof Post; //=> true // and both models share the same source user.source === post.source; //=> true ``` @private @method injection @param {String} factoryName @param {String} property @param {String} injectionName */ injection: function (fullName, property, injectionName) { this.validateFullName(injectionName); var normalizedInjectionName = this.normalize(injectionName); if (fullName.indexOf(':') === -1) { return this.typeInjection(fullName, property, normalizedInjectionName); } var normalizedName = this.normalize(fullName); var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []); injections.push({ property: property, fullName: normalizedInjectionName }); }, /** Used only via `factoryInjection`. Provides a specialized form of injection, specifically enabling all factory of one type to be injected with a reference to another object. For example, provided each factory of type `model` needed a `store`. one would do the following: ```javascript let registry = new Registry(); registry.register('store:main', SomeStore); registry.factoryTypeInjection('model', 'store', 'store:main'); let store = registry.lookup('store:main'); let UserFactory = registry.lookupFactory('model:user'); UserFactory.store instanceof SomeStore; //=> true ``` @private @method factoryTypeInjection @param {String} type @param {String} property @param {String} fullName */ factoryTypeInjection: function (type, property, fullName) { var injections = this._factoryTypeInjections[type] || (this._factoryTypeInjections[type] = []); injections.push({ property: property, fullName: this.normalize(fullName) }); }, /** Defines factory injection rules. Similar to regular injection rules, but are run against factories, via `Registry#lookupFactory`. These rules are used to inject objects onto factories when they are looked up. Two forms of injections are possible: * Injecting one fullName on another fullName * Injecting one fullName on a type Example: ```javascript let registry = new Registry(); let container = registry.container(); registry.register('store:main', Store); registry.register('store:secondary', OtherStore); registry.register('model:user', User); registry.register('model:post', Post); // injecting one fullName on another type registry.factoryInjection('model', 'store', 'store:main'); // injecting one fullName on another fullName registry.factoryInjection('model:post', 'secondaryStore', 'store:secondary'); let UserFactory = container.lookupFactory('model:user'); let PostFactory = container.lookupFactory('model:post'); let store = container.lookup('store:main'); UserFactory.store instanceof Store; //=> true UserFactory.secondaryStore instanceof OtherStore; //=> false PostFactory.store instanceof Store; //=> true PostFactory.secondaryStore instanceof OtherStore; //=> true // and both models share the same source instance UserFactory.store === PostFactory.store; //=> true ``` @private @method factoryInjection @param {String} factoryName @param {String} property @param {String} injectionName */ factoryInjection: function (fullName, property, injectionName) { var normalizedName = this.normalize(fullName); var normalizedInjectionName = this.normalize(injectionName); this.validateFullName(injectionName); if (fullName.indexOf(':') === -1) { return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName); } var injections = this._factoryInjections[normalizedName] || (this._factoryInjections[normalizedName] = []); injections.push({ property: property, fullName: normalizedInjectionName }); }, /** @private @method knownForType @param {String} type the type to iterate over */ knownForType: function (type) { var fallbackKnown = undefined, resolverKnown = undefined; var localKnown = _emberMetal.dictionary(null); var registeredNames = Object.keys(this.registrations); for (var index = 0; index < registeredNames.length; index++) { var fullName = registeredNames[index]; var itemType = fullName.split(':')[0]; if (itemType === type) { localKnown[fullName] = true; } } if (this.fallback) { fallbackKnown = this.fallback.knownForType(type); } if (this.resolver && this.resolver.knownForType) { resolverKnown = this.resolver.knownForType(type); } return _emberMetal.assign({}, fallbackKnown, localKnown, resolverKnown); }, validateFullName: function (fullName) { if (!this.isValidFullName(fullName)) { throw new TypeError('Invalid Fullname, expected: \'type:name\' got: ' + fullName); } return true; }, isValidFullName: function (fullName) { return !!VALID_FULL_NAME_REGEXP.test(fullName); }, validateInjections: function (injections) { if (!injections) { return; } var fullName = undefined; for (var i = 0; i < injections.length; i++) { fullName = injections[i].fullName; if (!this.has(fullName)) { throw new Error('Attempting to inject an unknown injection: \'' + fullName + '\''); } } }, normalizeInjectionsHash: function (hash) { var injections = []; for (var key in hash) { if (hash.hasOwnProperty(key)) { injections.push({ property: key, fullName: hash[key] }); } } return injections; }, getInjections: function (fullName) { var injections = this._injections[fullName] || []; if (this.fallback) { injections = injections.concat(this.fallback.getInjections(fullName)); } return injections; }, getTypeInjections: function (type) { var injections = this._typeInjections[type] || []; if (this.fallback) { injections = injections.concat(this.fallback.getTypeInjections(type)); } return injections; }, getFactoryInjections: function (fullName) { var injections = this._factoryInjections[fullName] || []; if (this.fallback) { injections = injections.concat(this.fallback.getFactoryInjections(fullName)); } return injections; }, getFactoryTypeInjections: function (type) { var injections = this._factoryTypeInjections[type] || []; if (this.fallback) { injections = injections.concat(this.fallback.getFactoryTypeInjections(type)); } return injections; } }; function deprecateResolverFunction(registry) { registry.resolver = { resolve: registry.resolver }; } /** Given a fullName and a source fullName returns the fully resolved fullName. Used to allow for local lookup. ```javascript let registry = new Registry(); // the twitter factory is added to the module system registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title ``` @private @method expandLocalLookup @param {String} fullName @param {Object} [options] @param {String} [options.source] the fullname of the request source (used for local lookups) @return {String} fullName */ Registry.prototype.expandLocalLookup = function Registry_expandLocalLookup(fullName, options) { if (this.resolver && this.resolver.expandLocalLookup) { var normalizedFullName = this.normalize(fullName); var normalizedSource = this.normalize(options.source); return expandLocalLookup(this, normalizedFullName, normalizedSource); } else if (this.fallback) { return this.fallback.expandLocalLookup(fullName, options); } else { return null; } }; function expandLocalLookup(registry, normalizedName, normalizedSource) { var cache = registry._localLookupCache; var normalizedNameCache = cache[normalizedName]; if (!normalizedNameCache) { normalizedNameCache = cache[normalizedName] = new _emberMetal.EmptyObject(); } var cached = normalizedNameCache[normalizedSource]; if (cached !== undefined) { return cached; } var expanded = registry.resolver.expandLocalLookup(normalizedName, normalizedSource); return normalizedNameCache[normalizedSource] = expanded; } function resolve(registry, normalizedName, options) { if (options && options.source) { // when `source` is provided expand normalizedName // and source into the full normalizedName normalizedName = registry.expandLocalLookup(normalizedName, options); // if expandLocalLookup returns falsey, we do not support local lookup if (!normalizedName) { return; } } var cached = registry._resolveCache[normalizedName]; if (cached !== undefined) { return cached; } if (registry._failCache[normalizedName]) { return; } var resolved = undefined; if (registry.resolver) { resolved = registry.resolver.resolve(normalizedName); } if (resolved === undefined) { resolved = registry.registrations[normalizedName]; } if (resolved === undefined) { registry._failCache[normalizedName] = true; } else { registry._resolveCache[normalizedName] = resolved; } return resolved; } function has(registry, fullName, source) { return registry.resolve(fullName, { source: source }) !== undefined; } var privateNames = _emberMetal.dictionary(null); var privateSuffix = '' + Math.random() + Date.now(); function privatize(_ref) { var fullName = _ref[0]; var name = privateNames[fullName]; if (name) { return name; } var _fullName$split = fullName.split(':'); var type = _fullName$split[0]; var rawName = _fullName$split[1]; return privateNames[fullName] = _emberMetal.intern(type + ':' + rawName + '-' + privateSuffix); } }); enifed('dag-map', ['exports'], function (exports) { 'use strict'; /** * A map of key/value pairs with dependencies contraints that can be traversed * in topological order and is checked for cycles. * * @class DAG * @constructor */ var DAG = (function () { function DAG() { this._vertices = new Vertices(); } /** * Adds a key/value pair with dependencies on other key/value pairs. * * @public * @method addEdges * @param {string[]} key The key of the vertex to be added. * @param {any} value The value of that vertex. * @param {string[]|string|undefined} before A key or array of keys of the vertices that must * be visited before this vertex. * @param {string[]|string|undefined} after An string or array of strings with the keys of the * vertices that must be after this vertex is visited. */ DAG.prototype.add = function (key, value, before, after) { var vertices = this._vertices; var v = vertices.add(key); v.val = value; if (before) { if (typeof before === "string") { vertices.addEdge(v, vertices.add(before)); } else { for (var i = 0; i < before.length; i++) { vertices.addEdge(v, vertices.add(before[i])); } } } if (after) { if (typeof after === "string") { vertices.addEdge(vertices.add(after), v); } else { for (var i = 0; i < after.length; i++) { vertices.addEdge(vertices.add(after[i]), v); } } } }; /** * Visits key/value pairs in topological order. * * @public * @method topsort * @param {Function} fn The function to be invoked with each key/value. */ DAG.prototype.topsort = function (callback) { this._vertices.topsort(callback); }; return DAG; }()); var Vertices = (function () { function Vertices() { this.stack = new IntStack(); this.result = new IntStack(); this.vertices = []; } Vertices.prototype.add = function (key) { if (!key) throw new Error("missing key"); var vertices = this.vertices; var i = 0; var vertex; for (; i < vertices.length; i++) { vertex = vertices[i]; if (vertex.key === key) return vertex; } return vertices[i] = { id: i, key: key, val: null, inc: null, out: false, mark: false }; }; Vertices.prototype.addEdge = function (v, w) { this.check(v, w.key); var inc = w.inc; if (!inc) { w.inc = [v.id]; } else { var i = 0; for (; i < inc.length; i++) { if (inc[i] === v.id) return; } inc[i] = v.id; } v.out = true; }; Vertices.prototype.topsort = function (cb) { this.reset(); var vertices = this.vertices; for (var i = 0; i < vertices.length; i++) { var vertex = vertices[i]; if (vertex.out) continue; this.visit(vertex, undefined); } this.each(cb); }; Vertices.prototype.check = function (v, w) { if (v.key === w) { throw new Error("cycle detected: " + w + " <- " + w); } var inc = v.inc; // quick check if (!inc || inc.length === 0) return; var vertices = this.vertices; // shallow check for (var i = 0; i < inc.length; i++) { var key = vertices[inc[i]].key; if (key === w) { throw new Error("cycle detected: " + w + " <- " + v.key + " <- " + w); } } // deep check this.reset(); this.visit(v, w); if (this.result.len > 0) { var msg_1 = "cycle detected: " + w; this.each(function (key) { msg_1 += " <- " + key; }); throw new Error(msg_1); } }; Vertices.prototype.each = function (cb) { var _a = this, result = _a.result, vertices = _a.vertices; for (var i = 0; i < result.len; i++) { var vertex = vertices[result.stack[i]]; cb(vertex.key, vertex.val); } }; // reuse between cycle check and topsort Vertices.prototype.reset = function () { this.stack.len = 0; this.result.len = 0; var vertices = this.vertices; for (var i = 0; i < vertices.length; i++) { vertices[i].mark = false; } }; Vertices.prototype.visit = function (start, search) { var _a = this, stack = _a.stack, result = _a.result, vertices = _a.vertices; stack.push(start.id); while (stack.len) { var index = stack.pop(); if (index < 0) { index = ~index; if (search) { result.pop(); } else { result.push(index); } } else { var vertex = vertices[index]; if (vertex.mark) { continue; } if (search) { result.push(index); if (search === vertex.key) { return; } } vertex.mark = true; stack.push(~index); var incoming = vertex.inc; if (incoming) { var i = incoming.length; while (i--) { index = incoming[i]; if (!vertices[index].mark) { stack.push(index); } } } } } }; return Vertices; }()); var IntStack = (function () { function IntStack() { this.stack = [0, 0, 0, 0, 0, 0]; this.len = 0; } IntStack.prototype.push = function (n) { this.stack[this.len++] = n; }; IntStack.prototype.pop = function () { return this.stack[--this.len]; }; return IntStack; }()); exports['default'] = DAG; Object.defineProperty(exports, '__esModule', { value: true }); }); enifed('ember-application/index', ['exports', 'ember-application/initializers/dom-templates', 'ember-application/system/application', 'ember-application/system/application-instance', 'ember-application/system/resolver', 'ember-application/system/engine', 'ember-application/system/engine-instance', 'ember-application/system/engine-parent'], function (exports, _emberApplicationInitializersDomTemplates, _emberApplicationSystemApplication, _emberApplicationSystemApplicationInstance, _emberApplicationSystemResolver, _emberApplicationSystemEngine, _emberApplicationSystemEngineInstance, _emberApplicationSystemEngineParent) { /** @module ember @submodule ember-application */ 'use strict'; exports.Application = _emberApplicationSystemApplication.default; exports.ApplicationInstance = _emberApplicationSystemApplicationInstance.default; exports.Resolver = _emberApplicationSystemResolver.default; exports.Engine = _emberApplicationSystemEngine.default; exports.EngineInstance = _emberApplicationSystemEngineInstance.default; exports.getEngineParent = _emberApplicationSystemEngineParent.getEngineParent; exports.setEngineParent = _emberApplicationSystemEngineParent.setEngineParent; // add domTemplates initializer (only does something if `ember-template-compiler` // is loaded already) }); enifed('ember-application/initializers/dom-templates', ['exports', 'require', 'ember-glimmer', 'ember-environment', 'ember-application/system/application'], function (exports, _require, _emberGlimmer, _emberEnvironment, _emberApplicationSystemApplication) { 'use strict'; var bootstrap = function () {}; _emberApplicationSystemApplication.default.initializer({ name: 'domTemplates', initialize: function () { var bootstrapModuleId = 'ember-template-compiler/system/bootstrap'; var context = undefined; if (_emberEnvironment.environment.hasDOM && _require.has(bootstrapModuleId)) { bootstrap = _require.default(bootstrapModuleId).default; context = document; } bootstrap({ context: context, hasTemplate: _emberGlimmer.hasTemplate, setTemplate: _emberGlimmer.setTemplate }); } }); }); enifed('ember-application/system/application-instance', ['exports', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-views', 'ember-application/system/engine-instance'], function (exports, _emberMetal, _emberRuntime, _emberEnvironment, _emberViews, _emberApplicationSystemEngineInstance) { /** @module ember @submodule ember-application */ 'use strict'; var BootOptions = undefined; /** The `ApplicationInstance` encapsulates all of the stateful aspects of a running `Application`. At a high-level, we break application boot into two distinct phases: * Definition time, where all of the classes, templates, and other dependencies are loaded (typically in the browser). * Run time, where we begin executing the application once everything has loaded. Definition time can be expensive and only needs to happen once since it is an idempotent operation. For example, between test runs and FastBoot requests, the application stays the same. It is only the state that we want to reset. That state is what the `ApplicationInstance` manages: it is responsible for creating the container that contains all application state, and disposing of it once the particular test run or FastBoot request has finished. @public @class Ember.ApplicationInstance @extends Ember.EngineInstance */ var ApplicationInstance = _emberApplicationSystemEngineInstance.default.extend({ /** The `Application` for which this is an instance. @property {Ember.Application} application @private */ application: null, /** The DOM events for which the event dispatcher should listen. By default, the application's `Ember.EventDispatcher` listens for a set of standard DOM events, such as `mousedown` and `keyup`, and delegates them to your application's `Ember.View` instances. @private @property {Object} customEvents */ customEvents: null, /** The root DOM element of the Application as an element or a [jQuery-compatible selector string](http://api.jquery.com/category/selectors/). @private @property {String|DOMElement} rootElement */ rootElement: null, init: function () { this._super.apply(this, arguments); // Register this instance in the per-instance registry. // // Why do we need to register the instance in the first place? // Because we need a good way for the root route (a.k.a ApplicationRoute) // to notify us when it has created the root-most view. That view is then // appended to the rootElement, in the case of apps, to the fixture harness // in tests, or rendered to a string in the case of FastBoot. this.register('-application-instance:main', this, { instantiate: false }); }, /** Overrides the base `EngineInstance._bootSync` method with concerns relevant to booting application (instead of engine) instances. This method should only contain synchronous boot concerns. Asynchronous boot concerns should eventually be moved to the `boot` method, which returns a promise. Until all boot code has been made asynchronous, we need to continue to expose this method for use *internally* in places where we need to boot an instance synchronously. @private */ _bootSync: function (options) { if (this._booted) { return this; } options = new BootOptions(options); this.setupRegistry(options); if (options.rootElement) { this.rootElement = options.rootElement; } else { this.rootElement = this.application.rootElement; } if (options.location) { var router = _emberMetal.get(this, 'router'); _emberMetal.set(router, 'location', options.location); } this.application.runInstanceInitializers(this); if (options.isInteractive) { this.setupEventDispatcher(); } this._booted = true; return this; }, setupRegistry: function (options) { this.constructor.setupRegistry(this.__registry__, options); }, router: _emberMetal.computed(function () { return this.lookup('router:main'); }).readOnly(), /** This hook is called by the root-most Route (a.k.a. the ApplicationRoute) when it has finished creating the root View. By default, we simply take the view and append it to the `rootElement` specified on the Application. In cases like FastBoot and testing, we can override this hook and implement custom behavior, such as serializing to a string and sending over an HTTP socket rather than appending to DOM. @param view {Ember.View} the root-most view @private */ didCreateRootView: function (view) { view.appendTo(this.rootElement); }, /** Tells the router to start routing. The router will ask the location for the current URL of the page to determine the initial URL to start routing to. To start the app at a specific URL, call `handleURL` instead. @private */ startRouting: function () { var router = _emberMetal.get(this, 'router'); router.startRouting(); this._didSetupRouter = true; }, /** @private Sets up the router, initializing the child router and configuring the location before routing begins. Because setup should only occur once, multiple calls to `setupRouter` beyond the first call have no effect. */ setupRouter: function () { if (this._didSetupRouter) { return; } this._didSetupRouter = true; var router = _emberMetal.get(this, 'router'); router.setupRouter(); }, /** Directs the router to route to a particular URL. This is useful in tests, for example, to tell the app to start at a particular URL. @param url {String} the URL the router should route to @private */ handleURL: function (url) { var router = _emberMetal.get(this, 'router'); this.setupRouter(); return router.handleURL(url); }, /** @private */ setupEventDispatcher: function () { var dispatcher = this.lookup('event_dispatcher:main'); var applicationCustomEvents = _emberMetal.get(this.application, 'customEvents'); var instanceCustomEvents = _emberMetal.get(this, 'customEvents'); var customEvents = _emberMetal.assign({}, applicationCustomEvents, instanceCustomEvents); dispatcher.setup(customEvents, this.rootElement); return dispatcher; }, /** Returns the current URL of the app instance. This is useful when your app does not update the browsers URL bar (i.e. it uses the `'none'` location adapter). @public @return {String} the current URL */ getURL: function () { var router = _emberMetal.get(this, 'router'); return _emberMetal.get(router, 'url'); }, // `instance.visit(url)` should eventually replace `instance.handleURL()`; // the test helpers can probably be switched to use this implementation too /** Navigate the instance to a particular URL. This is useful in tests, for example, or to tell the app to start at a particular URL. This method returns a promise that resolves with the app instance when the transition is complete, or rejects if the transion was aborted due to an error. @public @param url {String} the destination URL @return {Promise} */ visit: function (url) { var _this = this; this.setupRouter(); var router = _emberMetal.get(this, 'router'); var handleResolve = function () { // Resolve only after rendering is complete return new _emberRuntime.RSVP.Promise(function (resolve) { // TODO: why is this necessary? Shouldn't 'actions' queue be enough? // Also, aren't proimses supposed to be async anyway? _emberMetal.run.next(null, resolve, _this); }); }; var handleReject = function (error) { if (error.error) { throw error.error; } else if (error.name === 'TransitionAborted' && router.router.activeTransition) { return router.router.activeTransition.then(handleResolve, handleReject); } else if (error.name === 'TransitionAborted') { throw new Error(error.message); } else { throw error; } }; var location = _emberMetal.get(router, 'location'); // Keeps the location adapter's internal URL in-sync location.setURL(url); // getURL returns the set url with the rootURL stripped off return router.handleURL(location.getURL()).then(handleResolve, handleReject); } }); ApplicationInstance.reopenClass({ /** @private @method setupRegistry @param {Registry} registry @param {BootOptions} options */ setupRegistry: function (registry) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; if (!options.toEnvironment) { options = new BootOptions(options); } registry.register('-environment:main', options.toEnvironment(), { instantiate: false }); registry.register('service:-document', options.document, { instantiate: false }); this._super(registry, options); } }); /** A list of boot-time configuration options for customizing the behavior of an `Ember.ApplicationInstance`. This is an interface class that exists purely to document the available options; you do not need to construct it manually. Simply pass a regular JavaScript object containing the desired options into methods that require one of these options object: ```javascript MyApp.visit("/", { location: "none", rootElement: "#container" }); ``` Not all combinations of the supported options are valid. See the documentation on `Ember.Application#visit` for the supported configurations. Internal, experimental or otherwise unstable flags are marked as private. @class BootOptions @namespace Ember.ApplicationInstance @public */ BootOptions = function BootOptions() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; /** Provide a specific instance of jQuery. This is useful in conjunction with the `document` option, as it allows you to use a copy of `jQuery` that is appropriately bound to the foreign `document` (e.g. a jsdom). This is highly experimental and support very incomplete at the moment. @property jQuery @type Object @default auto-detected @private */ this.jQuery = _emberViews.jQuery; // This default is overridable below /** Interactive mode: whether we need to set up event delegation and invoke lifecycle callbacks on Components. @property isInteractive @type boolean @default auto-detected @private */ this.isInteractive = _emberEnvironment.environment.hasDOM; // This default is overridable below /** Run in a full browser environment. When this flag is set to `false`, it will disable most browser-specific and interactive features. Specifically: * It does not use `jQuery` to append the root view; the `rootElement` (either specified as a subsequent option or on the application itself) must already be an `Element` in the given `document` (as opposed to a string selector). * It does not set up an `EventDispatcher`. * It does not run any `Component` lifecycle hooks (such as `didInsertElement`). * It sets the `location` option to `"none"`. (If you would like to use the location adapter specified in the app's router instead, you can also specify `{ location: null }` to specifically opt-out.) @property isBrowser @type boolean @default auto-detected @public */ if (options.isBrowser !== undefined) { this.isBrowser = !!options.isBrowser; } else { this.isBrowser = _emberEnvironment.environment.hasDOM; } if (!this.isBrowser) { this.jQuery = null; this.isInteractive = false; this.location = 'none'; } /** Disable rendering completely. When this flag is set to `true`, it will disable the entire rendering pipeline. Essentially, this puts the app into "routing-only" mode. No templates will be rendered, and no Components will be created. @property shouldRender @type boolean @default true @public */ if (options.shouldRender !== undefined) { this.shouldRender = !!options.shouldRender; } else { this.shouldRender = true; } if (!this.shouldRender) { this.jQuery = null; this.isInteractive = false; } /** If present, render into the given `Document` object instead of the global `window.document` object. In practice, this is only useful in non-browser environment or in non-interactive mode, because Ember's `jQuery` dependency is implicitly bound to the current document, causing event delegation to not work properly when the app is rendered into a foreign document object (such as an iframe's `contentDocument`). In non-browser mode, this could be a "`Document`-like" object as Ember only interact with a small subset of the DOM API in non- interactive mode. While the exact requirements have not yet been formalized, the `SimpleDOM` library's implementation is known to work. @property document @type Document @default the global `document` object @public */ if (options.document) { this.document = options.document; } else { this.document = typeof document !== 'undefined' ? document : null; } /** If present, overrides the application's `rootElement` property on the instance. This is useful for testing environment, where you might want to append the root view to a fixture area. In non-browser mode, because Ember does not have access to jQuery, this options must be specified as a DOM `Element` object instead of a selector string. See the documentation on `Ember.Applications`'s `rootElement` for details. @property rootElement @type String|Element @default null @public */ if (options.rootElement) { this.rootElement = options.rootElement; } // Set these options last to give the user a chance to override the // defaults from the "combo" options like `isBrowser` (although in // practice, the resulting combination is probably invalid) /** If present, overrides the router's `location` property with this value. This is useful for environments where trying to modify the URL would be inappropriate. @property location @type string @default null @public */ if (options.location !== undefined) { this.location = options.location; } if (options.jQuery !== undefined) { this.jQuery = options.jQuery; } if (options.isInteractive !== undefined) { this.isInteractive = !!options.isInteractive; } }; BootOptions.prototype.toEnvironment = function () { var env = _emberMetal.assign({}, _emberEnvironment.environment); // For compatibility with existing code env.hasDOM = this.isBrowser; env.isInteractive = this.isInteractive; env.options = this; return env; }; Object.defineProperty(ApplicationInstance.prototype, 'container', { configurable: true, enumerable: false, get: function () { var instance = this; return { lookup: function () { return instance.lookup.apply(instance, arguments); } }; } }); Object.defineProperty(ApplicationInstance.prototype, 'registry', { configurable: true, enumerable: false, get: function () { return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'ApplicationInstance'); } }); exports.default = ApplicationInstance; }); enifed('ember-application/system/application', ['exports', 'ember-environment', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application/system/application-instance', 'container', 'ember-application/system/engine', 'ember-glimmer'], function (exports, _emberEnvironment, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplicationSystemApplicationInstance, _container, _emberApplicationSystemEngine, _emberGlimmer) { /** @module ember @submodule ember-application */ 'use strict'; exports._resetLegacyAddonWarnings = _resetLegacyAddonWarnings; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); var librariesRegistered = false; var warnedAboutLegacyViewAddon = false; var warnedAboutLegacyControllerAddon = false; // For testing function _resetLegacyAddonWarnings() { warnedAboutLegacyViewAddon = false; warnedAboutLegacyControllerAddon = false; } /** An instance of `Ember.Application` is the starting point for every Ember application. It helps to instantiate, initialize and coordinate the many objects that make up your app. Each Ember app has one and only one `Ember.Application` object. In fact, the very first thing you should do in your application is create the instance: ```javascript window.App = Ember.Application.create(); ``` Typically, the application object is the only global variable. All other classes in your app should be properties on the `Ember.Application` instance, which highlights its first role: a global namespace. For example, if you define a view class, it might look like this: ```javascript App.MyView = Ember.View.extend(); ``` By default, calling `Ember.Application.create()` will automatically initialize your application by calling the `Ember.Application.initialize()` method. If you need to delay initialization, you can call your app's `deferReadiness()` method. When you are ready for your app to be initialized, call its `advanceReadiness()` method. You can define a `ready` method on the `Ember.Application` instance, which will be run by Ember when the application is initialized. Because `Ember.Application` inherits from `Ember.Namespace`, any classes you create will have useful string representations when calling `toString()`. See the `Ember.Namespace` documentation for more information. While you can think of your `Ember.Application` as a container that holds the other classes in your application, there are several other responsibilities going on under-the-hood that you may want to understand. ### Event Delegation Ember uses a technique called _event delegation_. This allows the framework to set up a global, shared event listener instead of requiring each view to do it manually. For example, instead of each view registering its own `mousedown` listener on its associated element, Ember sets up a `mousedown` listener on the `body`. If a `mousedown` event occurs, Ember will look at the target of the event and start walking up the DOM node tree, finding corresponding views and invoking their `mouseDown` method as it goes. `Ember.Application` has a number of default events that it listens for, as well as a mapping from lowercase events to camel-cased view method names. For example, the `keypress` event causes the `keyPress` method on the view to be called, the `dblclick` event causes `doubleClick` to be called, and so on. If there is a bubbling browser event that Ember does not listen for by default, you can specify custom events and their corresponding view method names by setting the application's `customEvents` property: ```javascript let App = Ember.Application.create({ customEvents: { // add support for the paste event paste: 'paste' } }); ``` To prevent Ember from setting up a listener for a default event, specify the event name with a `null` value in the `customEvents` property: ```javascript let App = Ember.Application.create({ customEvents: { // prevent listeners for mouseenter/mouseleave events mouseenter: null, mouseleave: null } }); ``` By default, the application sets up these event listeners on the document body. However, in cases where you are embedding an Ember application inside an existing page, you may want it to set up the listeners on an element inside the body. For example, if only events inside a DOM element with the ID of `ember-app` should be delegated, set your application's `rootElement` property: ```javascript let App = Ember.Application.create({ rootElement: '#ember-app' }); ``` The `rootElement` can be either a DOM element or a jQuery-compatible selector string. Note that *views appended to the DOM outside the root element will not receive events.* If you specify a custom root element, make sure you only append views inside it! To learn more about the events Ember components use, see [components/handling-events](https://guides.emberjs.com/v2.6.0/components/handling-events/#toc_event-names). ### Initializers Libraries on top of Ember can add initializers, like so: ```javascript Ember.Application.initializer({ name: 'api-adapter', initialize: function(application) { application.register('api-adapter:main', ApiAdapter); } }); ``` Initializers provide an opportunity to access the internal registry, which organizes the different components of an Ember application. Additionally they provide a chance to access the instantiated application. Beyond being used for libraries, initializers are also a great way to organize dependency injection or setup in your own application. ### Routing In addition to creating your application's router, `Ember.Application` is also responsible for telling the router when to start routing. Transitions between routes can be logged with the `LOG_TRANSITIONS` flag, and more detailed intra-transition logging can be logged with the `LOG_TRANSITIONS_INTERNAL` flag: ```javascript let App = Ember.Application.create({ LOG_TRANSITIONS: true, // basic logging of successful transitions LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps }); ``` By default, the router will begin trying to translate the current URL into application state once the browser emits the `DOMContentReady` event. If you need to defer routing, you can call the application's `deferReadiness()` method. Once routing can begin, call the `advanceReadiness()` method. If there is any setup required before routing begins, you can implement a `ready()` method on your app that will be invoked immediately before routing begins. @class Application @namespace Ember @extends Ember.Engine @uses RegistryProxyMixin @public */ var Application = _emberApplicationSystemEngine.default.extend({ _suppressDeferredDeprecation: true, /** The root DOM element of the Application. This can be specified as an element or a [jQuery-compatible selector string](http://api.jquery.com/category/selectors/). This is the element that will be passed to the Application's, `eventDispatcher`, which sets up the listeners for event delegation. Every view in your application should be a child of the element you specify here. @property rootElement @type DOMElement @default 'body' @public */ rootElement: 'body', /** The `Ember.EventDispatcher` responsible for delegating events to this application's views. The event dispatcher is created by the application at initialization time and sets up event listeners on the DOM element described by the application's `rootElement` property. See the documentation for `Ember.EventDispatcher` for more information. @property eventDispatcher @type Ember.EventDispatcher @default null @public */ eventDispatcher: null, /** The DOM events for which the event dispatcher should listen. By default, the application's `Ember.EventDispatcher` listens for a set of standard DOM events, such as `mousedown` and `keyup`, and delegates them to your application's `Ember.View` instances. If you would like additional bubbling events to be delegated to your views, set your `Ember.Application`'s `customEvents` property to a hash containing the DOM event name as the key and the corresponding view method name as the value. Setting an event to a value of `null` will prevent a default event listener from being added for that event. To add new events to be listened to: ```javascript let App = Ember.Application.create({ customEvents: { // add support for the paste event paste: 'paste' } }); ``` To prevent default events from being listened to: ```javascript let App = Ember.Application.create({ customEvents: { // remove support for mouseenter / mouseleave events mouseenter: null, mouseleave: null } }); ``` @property customEvents @type Object @default null @public */ customEvents: null, /** Whether the application should automatically start routing and render templates to the `rootElement` on DOM ready. While default by true, other environments such as FastBoot or a testing harness can set this property to `false` and control the precise timing and behavior of the boot process. @property autoboot @type Boolean @default true @private */ autoboot: true, /** Whether the application should be configured for the legacy "globals mode". Under this mode, the Application object serves as a global namespace for all classes. ```javascript let App = Ember.Application.create({ ... }); App.Router.reopen({ location: 'none' }); App.Router.map({ ... }); App.MyComponent = Ember.Component.extend({ ... }); ``` This flag also exposes other internal APIs that assumes the existence of a special "default instance", like `App.__container__.lookup(...)`. This option is currently not configurable, its value is derived from the `autoboot` flag – disabling `autoboot` also implies opting-out of globals mode support, although they are ultimately orthogonal concerns. Some of the global modes features are already deprecated in 1.x. The existence of this flag is to untangle the globals mode code paths from the autoboot code paths, so that these legacy features can be reviewed for deprecation/removal separately. Forcing the (autoboot=true, _globalsMode=false) here and running the tests would reveal all the places where we are still relying on these legacy behavior internally (mostly just tests). @property _globalsMode @type Boolean @default true @private */ _globalsMode: true, init: function (options) { this._super.apply(this, arguments); if (!this.$) { this.$ = _emberViews.jQuery; } registerLibraries(); logLibraryVersions(); // Start off the number of deferrals at 1. This will be decremented by // the Application's own `boot` method. this._readinessDeferrals = 1; this._booted = false; this.autoboot = this._globalsMode = !!this.autoboot; if (this._globalsMode) { this._prepareForGlobalsMode(); } if (this.autoboot) { this.waitForDOMReady(); } }, /** Create an ApplicationInstance for this application. @private @method buildInstance @return {Ember.ApplicationInstance} the application instance */ buildInstance: function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; options.base = this; options.application = this; return _emberApplicationSystemApplicationInstance.default.create(options); }, /** Enable the legacy globals mode by allowing this application to act as a global namespace. See the docs on the `_globalsMode` property for details. Most of these features are already deprecated in 1.x, so we can stop using them internally and try to remove them. @private @method _prepareForGlobalsMode */ _prepareForGlobalsMode: function () { // Create subclass of Ember.Router for this Application instance. // This is to ensure that someone reopening `App.Router` does not // tamper with the default `Ember.Router`. this.Router = (this.Router || _emberRouting.Router).extend(); this._buildDeprecatedInstance(); }, /* Build the deprecated instance for legacy globals mode support. Called when creating and resetting the application. This is orthogonal to autoboot: the deprecated instance needs to be created at Application construction (not boot) time to expose App.__container__. If autoboot sees that this instance exists, it will continue booting it to avoid doing unncessary work (as opposed to building a new instance at boot time), but they are otherwise unrelated. @private @method _buildDeprecatedInstance */ _buildDeprecatedInstance: function () { // Build a default instance var instance = this.buildInstance(); // Legacy support for App.__container__ and other global methods // on App that rely on a single, default instance. this.__deprecatedInstance__ = instance; this.__container__ = instance.__container__; }, /** Automatically kick-off the boot process for the application once the DOM has become ready. The initialization itself is scheduled on the actions queue which ensures that code-loading finishes before booting. If you are asynchronously loading code, you should call `deferReadiness()` to defer booting, and then call `advanceReadiness()` once all of your code has finished loading. @private @method waitForDOMReady */ waitForDOMReady: function () { if (!this.$ || this.$.isReady) { _emberMetal.run.schedule('actions', this, 'domReady'); } else { this.$().ready(_emberMetal.run.bind(this, 'domReady')); } }, /** This is the autoboot flow: 1. Boot the app by calling `this.boot()` 2. Create an instance (or use the `__deprecatedInstance__` in globals mode) 3. Boot the instance by calling `instance.boot()` 4. Invoke the `App.ready()` callback 5. Kick-off routing on the instance Ideally, this is all we would need to do: ```javascript _autoBoot() { this.boot().then(() => { let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance(); return instance.boot(); }).then((instance) => { App.ready(); instance.startRouting(); }); } ``` Unfortunately, we cannot actually write this because we need to participate in the "synchronous" boot process. While the code above would work fine on the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to boot a new instance synchronously (see the documentation on `_bootSync()` for details). Because of this restriction, the actual logic of this method is located inside `didBecomeReady()`. @private @method domReady */ domReady: function () { if (this.isDestroyed) { return; } this._bootSync(); // Continues to `didBecomeReady` }, /** Use this to defer readiness until some condition is true. Example: ```javascript let App = Ember.Application.create(); App.deferReadiness(); // Ember.$ is a reference to the jQuery object/function Ember.$.getJSON('/auth-token', function(token) { App.token = token; App.advanceReadiness(); }); ``` This allows you to perform asynchronous setup logic and defer booting your application until the setup has finished. However, if the setup requires a loading UI, it might be better to use the router for this purpose. @method deferReadiness @public */ deferReadiness: function () { this._readinessDeferrals++; }, /** Call `advanceReadiness` after any asynchronous setup logic has completed. Each call to `deferReadiness` must be matched by a call to `advanceReadiness` or the application will never become ready and routing will not begin. @method advanceReadiness @see {Ember.Application#deferReadiness} @public */ advanceReadiness: function () { this._readinessDeferrals--; if (this._readinessDeferrals === 0) { _emberMetal.run.once(this, this.didBecomeReady); } }, /** Initialize the application and return a promise that resolves with the `Ember.Application` object when the boot process is complete. Run any application initializers and run the application load hook. These hooks may choose to defer readiness. For example, an authentication hook might want to defer readiness until the auth token has been retrieved. By default, this method is called automatically on "DOM ready"; however, if autoboot is disabled, this is automatically called when the first application instance is created via `visit`. @private @method boot @return {Promise} */ boot: function () { if (this._bootPromise) { return this._bootPromise; } try { this._bootSync(); } catch (_) { // Ignore th error: in the asynchronous boot path, the error is already reflected // in the promise rejection } return this._bootPromise; }, /** Unfortunately, a lot of existing code assumes the booting process is "synchronous". Specifically, a lot of tests assumes the last call to `app.advanceReadiness()` or `app.reset()` will result in the app being fully-booted when the current runloop completes. We would like new code (like the `visit` API) to stop making this assumption, so we created the asynchronous version above that returns a promise. But until we have migrated all the code, we would have to expose this method for use *internally* in places where we need to boot an app "synchronously". @private */ _bootSync: function () { if (this._booted) { return; } // Even though this returns synchronously, we still need to make sure the // boot promise exists for book-keeping purposes: if anything went wrong in // the boot process, we need to store the error as a rejection on the boot // promise so that a future caller of `boot()` can tell what failed. var defer = this._bootResolver = new _emberRuntime.RSVP.defer(); this._bootPromise = defer.promise; try { this.runInitializers(); _emberRuntime.runLoadHooks('application', this); this.advanceReadiness(); // Continues to `didBecomeReady` } catch (error) { // For the asynchronous boot path defer.reject(error); // For the synchronous boot path throw error; } }, /** Reset the application. This is typically used only in tests. It cleans up the application in the following order: 1. Deactivate existing routes 2. Destroy all objects in the container 3. Create a new application container 4. Re-route to the existing url Typical Example: ```javascript let App; run(function() { App = Ember.Application.create(); }); module('acceptance test', { setup: function() { App.reset(); } }); test('first test', function() { // App is freshly reset }); test('second test', function() { // App is again freshly reset }); ``` Advanced Example: Occasionally you may want to prevent the app from initializing during setup. This could enable extra configuration, or enable asserting prior to the app becoming ready. ```javascript let App; run(function() { App = Ember.Application.create(); }); module('acceptance test', { setup: function() { run(function() { App.reset(); App.deferReadiness(); }); } }); test('first test', function() { ok(true, 'something before app is initialized'); run(function() { App.advanceReadiness(); }); ok(true, 'something after app is initialized'); }); ``` @method reset @public */ reset: function () { var instance = this.__deprecatedInstance__; this._readinessDeferrals = 1; this._bootPromise = null; this._bootResolver = null; this._booted = false; function handleReset() { _emberMetal.run(instance, 'destroy'); this._buildDeprecatedInstance(); _emberMetal.run.schedule('actions', this, '_bootSync'); } _emberMetal.run.join(this, handleReset); }, /** @private @method didBecomeReady */ didBecomeReady: function () { try { // TODO: Is this still needed for _globalsMode = false? if (!_emberMetal.isTesting()) { // Eagerly name all classes that are already loaded _emberRuntime.Namespace.processAll(); _emberRuntime.setNamespaceSearchDisabled(true); } // See documentation on `_autoboot()` for details if (this.autoboot) { var instance = undefined; if (this._globalsMode) { // If we already have the __deprecatedInstance__ lying around, boot it to // avoid unnecessary work instance = this.__deprecatedInstance__; } else { // Otherwise, build an instance and boot it. This is currently unreachable, // because we forced _globalsMode to === autoboot; but having this branch // allows us to locally toggle that flag for weeding out legacy globals mode // dependencies independently instance = this.buildInstance(); } instance._bootSync(); // TODO: App.ready() is not called when autoboot is disabled, is this correct? this.ready(); instance.startRouting(); } // For the asynchronous boot path this._bootResolver.resolve(this); // For the synchronous boot path this._booted = true; } catch (error) { // For the asynchronous boot path this._bootResolver.reject(error); // For the synchronous boot path throw error; } }, /** Called when the Application has become ready, immediately before routing begins. The call will be delayed until the DOM has become ready. @event ready @public */ ready: function () { return this; }, // This method must be moved to the application instance object willDestroy: function () { this._super.apply(this, arguments); _emberRuntime.setNamespaceSearchDisabled(false); this._booted = false; this._bootPromise = null; this._bootResolver = null; if (_emberRuntime._loaded.application === this) { _emberRuntime._loaded.application = undefined; } if (this._globalsMode && this.__deprecatedInstance__) { this.__deprecatedInstance__.destroy(); } }, /** Boot a new instance of `Ember.ApplicationInstance` for the current application and navigate it to the given `url`. Returns a `Promise` that resolves with the instance when the initial routing and rendering is complete, or rejects with any error that occured during the boot process. When `autoboot` is disabled, calling `visit` would first cause the application to boot, which runs the application initializers. This method also takes a hash of boot-time configuration options for customizing the instance's behavior. See the documentation on `Ember.ApplicationInstance.BootOptions` for details. `Ember.ApplicationInstance.BootOptions` is an interface class that exists purely to document the available options; you do not need to construct it manually. Simply pass a regular JavaScript object containing of the desired options: ```javascript MyApp.visit("/", { location: "none", rootElement: "#container" }); ``` ### Supported Scenarios While the `BootOptions` class exposes a large number of knobs, not all combinations of them are valid; certain incompatible combinations might result in unexpected behavior. For example, booting the instance in the full browser environment while specifying a foriegn `document` object (e.g. `{ isBrowser: true, document: iframe.contentDocument }`) does not work correctly today, largely due to Ember's jQuery dependency. Currently, there are three officially supported scenarios/configurations. Usages outside of these scenarios are not guaranteed to work, but please feel free to file bug reports documenting your experience and any issues you encountered to help expand support. #### Browser Applications (Manual Boot) The setup is largely similar to how Ember works out-of-the-box. Normally, Ember will boot a default instance for your Application on "DOM ready". However, you can customize this behavior by disabling `autoboot`. For example, this allows you to render a miniture demo of your application into a specific area on your marketing website: ```javascript import MyApp from 'my-app'; $(function() { let App = MyApp.create({ autoboot: false }); let options = { // Override the router's location adapter to prevent it from updating // the URL in the address bar location: 'none', // Override the default `rootElement` on the app to render into a // specific `div` on the page rootElement: '#demo' }; // Start the app at the special demo URL App.visit('/demo', options); }); ```` Or perhaps you might want to boot two instances of your app on the same page for a split-screen multiplayer experience: ```javascript import MyApp from 'my-app'; $(function() { let App = MyApp.create({ autoboot: false }); let sessionId = MyApp.generateSessionID(); let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' }); let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' }); Promise.all([player1, player2]).then(() => { // Both apps have completed the initial render $('#loading').fadeOut(); }); }); ``` Do note that each app instance maintains their own registry/container, so they will run in complete isolation by default. #### Server-Side Rendering (also known as FastBoot) This setup allows you to run your Ember app in a server environment using Node.js and render its content into static HTML for SEO purposes. ```javascript const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap); function renderURL(url) { let dom = new SimpleDOM.Document(); let rootElement = dom.body; let options = { isBrowser: false, document: dom, rootElement: rootElement }; return MyApp.visit(options).then(instance => { try { return HTMLSerializer.serialize(rootElement.firstChild); } finally { instance.destroy(); } }); } ``` In this scenario, because Ember does not have access to a global `document` object in the Node.js environment, you must provide one explicitly. In practice, in the non-browser environment, the stand-in `document` object only need to implement a limited subset of the full DOM API. The `SimpleDOM` library is known to work. Since there is no access to jQuery in the non-browser environment, you must also specify a DOM `Element` object in the same `document` for the `rootElement` option (as opposed to a selector string like `"body"`). See the documentation on the `isBrowser`, `document` and `rootElement` properties on `Ember.ApplicationInstance.BootOptions` for details. #### Server-Side Resource Discovery This setup allows you to run the routing layer of your Ember app in a server environment using Node.js and completely disable rendering. This allows you to simulate and discover the resources (i.e. AJAX requests) needed to fufill a given request and eagerly "push" these resources to the client. ```app/initializers/network-service.js import BrowserNetworkService from 'app/services/network/browser'; import NodeNetworkService from 'app/services/network/node'; // Inject a (hypothetical) service for abstracting all AJAX calls and use // the appropiate implementaion on the client/server. This also allows the // server to log all the AJAX calls made during a particular request and use // that for resource-discovery purpose. export function initialize(application) { if (window) { // browser application.register('service:network', BrowserNetworkService); } else { // node application.register('service:network', NodeNetworkService); } application.inject('route', 'network', 'service:network'); }; export default { name: 'network-service', initialize: initialize }; ``` ```app/routes/post.js import Ember from 'ember'; // An example of how the (hypothetical) service is used in routes. export default Ember.Route.extend({ model(params) { return this.network.fetch(`/api/posts/${params.post_id}.json`); }, afterModel(post) { if (post.isExternalContent) { return this.network.fetch(`/api/external/?url=${post.externalURL}`); } else { return post; } } }); ``` ```javascript // Finally, put all the pieces together function discoverResourcesFor(url) { return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => { let networkService = instance.lookup('service:network'); return networkService.requests; // => { "/api/posts/123.json": "..." } }); } ``` @public @method visit @param url {String} The initial URL to navigate to @param options {Ember.ApplicationInstance.BootOptions} @return {Promise} */ visit: function (url, options) { var _this = this; return this.boot().then(function () { var instance = _this.buildInstance(); return instance.boot(options).then(function () { return instance.visit(url); }).catch(function (error) { _emberMetal.run(instance, 'destroy'); throw error; }); }); } }); Object.defineProperty(Application.prototype, 'registry', { configurable: true, enumerable: false, get: function () { return _emberRuntime.buildFakeRegistryWithDeprecations(this, 'Application'); } }); Application.reopenClass({ /** This creates a registry with the default Ember naming conventions. It also configures the registry: * registered views are created every time they are looked up (they are not singletons) * registered templates are not factories; the registered value is returned directly. * the router receives the application as its `namespace` property * all controllers receive the router as their `target` and `controllers` properties * all controllers receive the application as their `namespace` property * the application view receives the application controller as its `controller` property * the application view receives the application template as its `defaultTemplate` property @method buildRegistry @static @param {Ember.Application} namespace the application for which to build the registry @return {Ember.Registry} the built registry @private */ buildRegistry: function (application) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var registry = this._super.apply(this, arguments); commonSetupRegistry(registry); _emberGlimmer.setupApplicationRegistry(registry); return registry; } }); function commonSetupRegistry(registry) { registry.register('-view-registry:main', { create: function () { return _emberMetal.dictionary(null); } }); registry.register('route:basic', _emberRouting.Route); registry.register('event_dispatcher:main', _emberViews.EventDispatcher); registry.injection('router:main', 'namespace', 'application:main'); registry.register('location:auto', _emberRouting.AutoLocation); registry.register('location:hash', _emberRouting.HashLocation); registry.register('location:history', _emberRouting.HistoryLocation); registry.register('location:none', _emberRouting.NoneLocation); registry.register(_container.privatize(_templateObject), _emberRouting.BucketCache); } function registerLibraries() { if (!librariesRegistered) { librariesRegistered = true; if (_emberEnvironment.environment.hasDOM && typeof _emberViews.jQuery === 'function') { _emberMetal.libraries.registerCoreLibrary('jQuery', _emberViews.jQuery().jquery); } } } function logLibraryVersions() { if (_emberEnvironment.ENV.LOG_VERSION) { // we only need to see this once per Application#init _emberEnvironment.ENV.LOG_VERSION = false; var libs = _emberMetal.libraries._registry; var nameLengths = libs.map(function (item) { return _emberMetal.get(item, 'name.length'); }); var maxNameLength = Math.max.apply(this, nameLengths); for (var i = 0; i < libs.length; i++) { var lib = libs[i]; var spaces = new Array(maxNameLength - lib.name.length + 1).join(' '); } } } exports.default = Application; }); enifed('ember-application/system/engine-instance', ['exports', 'ember-runtime', 'ember-metal', 'container', 'ember-application/system/engine-parent'], function (exports, _emberRuntime, _emberMetal, _container, _emberApplicationSystemEngineParent) { /** @module ember @submodule ember-application */ 'use strict'; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); /** The `EngineInstance` encapsulates all of the stateful aspects of a running `Engine`. @public @class Ember.EngineInstance @extends Ember.Object @uses RegistryProxyMixin @uses ContainerProxyMixin */ var EngineInstance = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin, { /** The base `Engine` for which this is an instance. @property {Ember.Engine} engine @private */ base: null, init: function () { this._super.apply(this, arguments); _emberMetal.guidFor(this); var base = this.base; if (!base) { base = this.application; this.base = base; } // Create a per-instance registry that will use the application's registry // as a fallback for resolving registrations. var registry = this.__registry__ = new _container.Registry({ fallback: base.__registry__ }); // Create a per-instance container from the instance's registry this.__container__ = registry.container({ owner: this }); this._booted = false; }, /** Initialize the `Ember.EngineInstance` and return a promise that resolves with the instance itself when the boot process is complete. The primary task here is to run any registered instance initializers. See the documentation on `BootOptions` for the options it takes. @private @method boot @param options {Object} @return {Promise} */ boot: function (options) { var _this = this; if (this._bootPromise) { return this._bootPromise; } this._bootPromise = new _emberRuntime.RSVP.Promise(function (resolve) { return resolve(_this._bootSync(options)); }); return this._bootPromise; }, /** Unfortunately, a lot of existing code assumes booting an instance is synchronous – specifically, a lot of tests assume the last call to `app.advanceReadiness()` or `app.reset()` will result in a new instance being fully-booted when the current runloop completes. We would like new code (like the `visit` API) to stop making this assumption, so we created the asynchronous version above that returns a promise. But until we have migrated all the code, we would have to expose this method for use *internally* in places where we need to boot an instance synchronously. @private */ _bootSync: function (options) { if (this._booted) { return this; } this.cloneParentDependencies(); this.setupRegistry(options); this.base.runInstanceInitializers(this); this._booted = true; return this; }, setupRegistry: function () { var options = arguments.length <= 0 || arguments[0] === undefined ? this.__container__.lookup('-environment:main') : arguments[0]; this.constructor.setupRegistry(this.__registry__, options); }, /** Unregister a factory. Overrides `RegistryProxy#unregister` in order to clear any cached instances of the unregistered factory. @public @method unregister @param {String} fullName */ unregister: function (fullName) { this.__container__.reset(fullName); this._super.apply(this, arguments); }, /** @private */ willDestroy: function () { this._super.apply(this, arguments); _emberMetal.run(this.__container__, 'destroy'); }, /** Build a new `Ember.EngineInstance` that's a child of this instance. Engines must be registered by name with their parent engine (or application). @private @method buildChildEngineInstance @param name {String} the registered name of the engine. @param options {Object} options provided to the engine instance. @return {Ember.EngineInstance,Error} */ buildChildEngineInstance: function (name) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var Engine = this.lookup('engine:' + name); if (!Engine) { throw new _emberMetal.Error('You attempted to mount the engine \'' + name + '\', but it is not registered with its parent.'); } var engineInstance = Engine.buildInstance(options); _emberApplicationSystemEngineParent.setEngineParent(engineInstance, this); return engineInstance; }, /** Clone dependencies shared between an engine instance and its parent. @private @method cloneParentDependencies */ cloneParentDependencies: function () { var _this2 = this; var parent = _emberApplicationSystemEngineParent.getEngineParent(this); var registrations = ['route:basic', 'event_dispatcher:main', 'service:-routing', 'service:-glimmer-environment']; registrations.forEach(function (key) { return _this2.register(key, parent.resolveRegistration(key)); }); var env = parent.lookup('-environment:main'); this.register('-environment:main', env, { instantiate: false }); var singletons = ['router:main', _container.privatize(_templateObject), '-view-registry:main', 'renderer:-' + (env.isInteractive ? 'dom' : 'inert')]; singletons.forEach(function (key) { return _this2.register(key, parent.lookup(key), { instantiate: false }); }); this.inject('view', '_environment', '-environment:main'); this.inject('route', '_environment', '-environment:main'); } }); EngineInstance.reopenClass({ /** @private @method setupRegistry @param {Registry} registry @param {BootOptions} options */ setupRegistry: function (registry, options) { // when no options/environment is present, do nothing if (!options) { return; } registry.injection('view', '_environment', '-environment:main'); registry.injection('route', '_environment', '-environment:main'); if (options.isInteractive) { registry.injection('view', 'renderer', 'renderer:-dom'); registry.injection('component', 'renderer', 'renderer:-dom'); } else { registry.injection('view', 'renderer', 'renderer:-inert'); registry.injection('component', 'renderer', 'renderer:-inert'); } } }); exports.default = EngineInstance; }); enifed('ember-application/system/engine-parent', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-application */ 'use strict'; exports.getEngineParent = getEngineParent; exports.setEngineParent = setEngineParent; var ENGINE_PARENT = _emberMetal.symbol('ENGINE_PARENT'); exports.ENGINE_PARENT = ENGINE_PARENT; /** `getEngineParent` retrieves an engine instance's parent instance. @method getEngineParent @param {EngineInstance} engine An engine instance. @return {EngineInstance} The parent engine instance. @for Ember @public */ function getEngineParent(engine) { return engine[ENGINE_PARENT]; } /** `setEngineParent` sets an engine instance's parent instance. @method setEngineParent @param {EngineInstance} engine An engine instance. @param {EngineInstance} parent The parent engine instance. @private */ function setEngineParent(engine, parent) { engine[ENGINE_PARENT] = parent; } }); enifed('ember-application/system/engine', ['exports', 'ember-runtime', 'container', 'dag-map', 'ember-metal', 'ember-application/system/resolver', 'ember-application/system/engine-instance', 'ember-routing', 'ember-extension-support', 'ember-views', 'ember-glimmer'], function (exports, _emberRuntime, _container, _dagMap, _emberMetal, _emberApplicationSystemResolver, _emberApplicationSystemEngineInstance, _emberRouting, _emberExtensionSupport, _emberViews, _emberGlimmer) { /** @module ember @submodule ember-application */ 'use strict'; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['-bucket-cache:main'], ['-bucket-cache:main']); function props(obj) { var properties = []; for (var key in obj) { properties.push(key); } return properties; } /** The `Engine` class contains core functionality for both applications and engines. Each engine manages a registry that's used for dependency injection and exposed through `RegistryProxy`. Engines also manage initializers and instance initializers. Engines can spawn `EngineInstance` instances via `buildInstance()`. @class Engine @namespace Ember @extends Ember.Namespace @uses RegistryProxy @public */ var Engine = _emberRuntime.Namespace.extend(_emberRuntime.RegistryProxyMixin, { init: function () { this._super.apply(this, arguments); this.buildRegistry(); }, /** A private flag indicating whether an engine's initializers have run yet. @private @property _initializersRan */ _initializersRan: false, /** Ensure that initializers are run once, and only once, per engine. @private @method ensureInitializers */ ensureInitializers: function () { if (!this._initializersRan) { this.runInitializers(); this._initializersRan = true; } }, /** Create an EngineInstance for this engine. @private @method buildInstance @return {Ember.EngineInstance} the engine instance */ buildInstance: function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; this.ensureInitializers(); options.base = this; return _emberApplicationSystemEngineInstance.default.create(options); }, /** Build and configure the registry for the current engine. @private @method buildRegistry @return {Ember.Registry} the configured registry */ buildRegistry: function () { var registry = this.__registry__ = this.constructor.buildRegistry(this); return registry; }, /** @private @method initializer */ initializer: function (options) { this.constructor.initializer(options); }, /** @private @method instanceInitializer */ instanceInitializer: function (options) { this.constructor.instanceInitializer(options); }, /** @private @method runInitializers */ runInitializers: function () { var _this = this; this._runInitializer('initializers', function (name, initializer) { if (initializer.initialize.length === 2) { initializer.initialize(_this.__registry__, _this); } else { initializer.initialize(_this); } }); }, /** @private @since 1.12.0 @method runInstanceInitializers */ runInstanceInitializers: function (instance) { this._runInitializer('instanceInitializers', function (name, initializer) { initializer.initialize(instance); }); }, _runInitializer: function (bucketName, cb) { var initializersByName = _emberMetal.get(this.constructor, bucketName); var initializers = props(initializersByName); var graph = new _dagMap.default(); var initializer = undefined; for (var i = 0; i < initializers.length; i++) { initializer = initializersByName[initializers[i]]; graph.add(initializer.name, initializer, initializer.before, initializer.after); } graph.topsort(cb); } }); Engine.reopenClass({ initializers: new _emberMetal.EmptyObject(), instanceInitializers: new _emberMetal.EmptyObject(), /** The goal of initializers should be to register dependencies and injections. This phase runs once. Because these initializers may load code, they are allowed to defer application readiness and advance it. If you need to access the container or store you should use an InstanceInitializer that will be run after all initializers and therefore after all code is loaded and the app is ready. Initializer receives an object which has the following attributes: `name`, `before`, `after`, `initialize`. The only required attribute is `initialize`, all others are optional. * `name` allows you to specify under which name the initializer is registered. This must be a unique name, as trying to register two initializers with the same name will result in an error. ```javascript Ember.Application.initializer({ name: 'namedInitializer', initialize: function(application) { Ember.debug('Running namedInitializer!'); } }); ``` * `before` and `after` are used to ensure that this initializer is ran prior or after the one identified by the value. This value can be a single string or an array of strings, referencing the `name` of other initializers. An example of ordering initializers, we create an initializer named `first`: ```javascript Ember.Application.initializer({ name: 'first', initialize: function(application) { Ember.debug('First initializer!'); } }); // DEBUG: First initializer! ``` We add another initializer named `second`, specifying that it should run after the initializer named `first`: ```javascript Ember.Application.initializer({ name: 'second', after: 'first', initialize: function(application) { Ember.debug('Second initializer!'); } }); // DEBUG: First initializer! // DEBUG: Second initializer! ``` Afterwards we add a further initializer named `pre`, this time specifying that it should run before the initializer named `first`: ```javascript Ember.Application.initializer({ name: 'pre', before: 'first', initialize: function(application) { Ember.debug('Pre initializer!'); } }); // DEBUG: Pre initializer! // DEBUG: First initializer! // DEBUG: Second initializer! ``` Finally we add an initializer named `post`, specifying it should run after both the `first` and the `second` initializers: ```javascript Ember.Application.initializer({ name: 'post', after: ['first', 'second'], initialize: function(application) { Ember.debug('Post initializer!'); } }); // DEBUG: Pre initializer! // DEBUG: First initializer! // DEBUG: Second initializer! // DEBUG: Post initializer! ``` * `initialize` is a callback function that receives one argument, `application`, on which you can operate. Example of using `application` to register an adapter: ```javascript Ember.Application.initializer({ name: 'api-adapter', initialize: function(application) { application.register('api-adapter:main', ApiAdapter); } }); ``` @method initializer @param initializer {Object} @public */ initializer: buildInitializerMethod('initializers', 'initializer'), /** Instance initializers run after all initializers have run. Because instance initializers run after the app is fully set up. We have access to the store, container, and other items. However, these initializers run after code has loaded and are not allowed to defer readiness. Instance initializer receives an object which has the following attributes: `name`, `before`, `after`, `initialize`. The only required attribute is `initialize`, all others are optional. * `name` allows you to specify under which name the instanceInitializer is registered. This must be a unique name, as trying to register two instanceInitializer with the same name will result in an error. ```javascript Ember.Application.instanceInitializer({ name: 'namedinstanceInitializer', initialize: function(application) { Ember.debug('Running namedInitializer!'); } }); ``` * `before` and `after` are used to ensure that this initializer is ran prior or after the one identified by the value. This value can be a single string or an array of strings, referencing the `name` of other initializers. * See Ember.Application.initializer for discussion on the usage of before and after. Example instanceInitializer to preload data into the store. ```javascript Ember.Application.initializer({ name: 'preload-data', initialize: function(application) { var userConfig, userConfigEncoded, store; // We have a HTML escaped JSON representation of the user's basic // configuration generated server side and stored in the DOM of the main // index.html file. This allows the app to have access to a set of data // without making any additional remote calls. Good for basic data that is // needed for immediate rendering of the page. Keep in mind, this data, // like all local models and data can be manipulated by the user, so it // should not be relied upon for security or authorization. // // Grab the encoded data from the meta tag userConfigEncoded = Ember.$('head meta[name=app-user-config]').attr('content'); // Unescape the text, then parse the resulting JSON into a real object userConfig = JSON.parse(unescape(userConfigEncoded)); // Lookup the store store = application.lookup('service:store'); // Push the encoded JSON into the store store.pushPayload(userConfig); } }); ``` @method instanceInitializer @param instanceInitializer @public */ instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer'), /** This creates a registry with the default Ember naming conventions. It also configures the registry: * registered views are created every time they are looked up (they are not singletons) * registered templates are not factories; the registered value is returned directly. * the router receives the application as its `namespace` property * all controllers receive the router as their `target` and `controllers` properties * all controllers receive the application as their `namespace` property * the application view receives the application controller as its `controller` property * the application view receives the application template as its `defaultTemplate` property @method buildRegistry @static @param {Ember.Application} namespace the application for which to build the registry @return {Ember.Registry} the built registry @private */ buildRegistry: function (namespace) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var registry = new _container.Registry({ resolver: resolverFor(namespace) }); registry.set = _emberMetal.set; registry.register('application:main', namespace, { instantiate: false }); commonSetupRegistry(registry); _emberGlimmer.setupEngineRegistry(registry); return registry; }, /** Set this to provide an alternate class to `Ember.DefaultResolver` @deprecated Use 'Resolver' instead @property resolver @public */ resolver: null, /** Set this to provide an alternate class to `Ember.DefaultResolver` @property resolver @public */ Resolver: null }); /** This function defines the default lookup rules for container lookups: * templates are looked up on `Ember.TEMPLATES` * other names are looked up on the application after classifying the name. For example, `controller:post` looks up `App.PostController` by default. * if the default lookup fails, look for registered classes on the container This allows the application to register default injections in the container that could be overridden by the normal naming convention. @private @method resolverFor @param {Ember.Namespace} namespace the namespace to look for classes @return {*} the resolved value for a given lookup */ function resolverFor(namespace) { var ResolverClass = namespace.get('Resolver') || _emberApplicationSystemResolver.default; return ResolverClass.create({ namespace: namespace }); } function buildInitializerMethod(bucketName, humanName) { return function (initializer) { // If this is the first initializer being added to a subclass, we are going to reopen the class // to make sure we have a new `initializers` object, which extends from the parent class' using // prototypal inheritance. Without this, attempting to add initializers to the subclass would // pollute the parent class as well as other subclasses. if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) { var attrs = {}; attrs[bucketName] = Object.create(this[bucketName]); this.reopenClass(attrs); } this[bucketName][initializer.name] = initializer; }; } function commonSetupRegistry(registry) { registry.optionsForType('component', { singleton: false }); registry.optionsForType('view', { singleton: false }); registry.register('controller:basic', _emberRuntime.Controller, { instantiate: false }); registry.injection('view', '_viewRegistry', '-view-registry:main'); registry.injection('renderer', '_viewRegistry', '-view-registry:main'); registry.injection('event_dispatcher:main', '_viewRegistry', '-view-registry:main'); registry.injection('route', '_topLevelViewTemplate', 'template:-outlet'); registry.injection('view:-outlet', 'namespace', 'application:main'); registry.injection('controller', 'target', 'router:main'); registry.injection('controller', 'namespace', 'application:main'); registry.injection('router', '_bucketCache', _container.privatize(_templateObject)); registry.injection('route', '_bucketCache', _container.privatize(_templateObject)); registry.injection('controller', '_bucketCache', _container.privatize(_templateObject)); registry.injection('route', 'router', 'router:main'); // Register the routing service... registry.register('service:-routing', _emberRouting.RoutingService); // Then inject the app router into it registry.injection('service:-routing', 'router', 'router:main'); // DEBUGGING registry.register('resolver-for-debugging:main', registry.resolver, { instantiate: false }); registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); // Custom resolver authors may want to register their own ContainerDebugAdapter with this key registry.register('container-debug-adapter:main', _emberExtensionSupport.ContainerDebugAdapter); registry.register('component-lookup:main', _emberViews.ComponentLookup); } exports.default = Engine; }); enifed('ember-application/system/resolver', ['exports', 'ember-metal', 'ember-runtime', 'ember-application/utils/validate-type', 'ember-glimmer'], function (exports, _emberMetal, _emberRuntime, _emberApplicationUtilsValidateType, _emberGlimmer) { /** @module ember @submodule ember-application */ 'use strict'; var Resolver = _emberRuntime.Object.extend({ /* This will be set to the Application instance when it is created. @property namespace */ namespace: null, normalize: null, // required resolve: null, // required parseName: null, // required lookupDescription: null, // required makeToString: null, // required resolveOther: null, // required _logLookup: null // required }); exports.Resolver = Resolver; /** The DefaultResolver defines the default lookup rules to resolve container lookups before consulting the container for registered items: * templates are looked up on `Ember.TEMPLATES` * other names are looked up on the application after converting the name. For example, `controller:post` looks up `App.PostController` by default. * there are some nuances (see examples below) ### How Resolving Works The container calls this object's `resolve` method with the `fullName` argument. It first parses the fullName into an object using `parseName`. Then it checks for the presence of a type-specific instance method of the form `resolve[Type]` and calls it if it exists. For example if it was resolving 'template:post', it would call the `resolveTemplate` method. Its last resort is to call the `resolveOther` method. The methods of this object are designed to be easy to override in a subclass. For example, you could enhance how a template is resolved like so: ```javascript App = Ember.Application.create({ Resolver: Ember.DefaultResolver.extend({ resolveTemplate: function(parsedName) { let resolvedTemplate = this._super(parsedName); if (resolvedTemplate) { return resolvedTemplate; } return Ember.TEMPLATES['not_found']; } }) }); ``` Some examples of how names are resolved: ``` 'template:post' //=> Ember.TEMPLATES['post'] 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline'] 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline'] 'template:blogPost' //=> Ember.TEMPLATES['blogPost'] // OR // Ember.TEMPLATES['blog_post'] 'controller:post' //=> App.PostController 'controller:posts.index' //=> App.PostsIndexController 'controller:blog/post' //=> Blog.PostController 'controller:basic' //=> Ember.Controller 'route:post' //=> App.PostRoute 'route:posts.index' //=> App.PostsIndexRoute 'route:blog/post' //=> Blog.PostRoute 'route:basic' //=> Ember.Route 'view:post' //=> App.PostView 'view:posts.index' //=> App.PostsIndexView 'view:blog/post' //=> Blog.PostView 'view:basic' //=> Ember.View 'foo:post' //=> App.PostFoo 'model:post' //=> App.Post ``` @class DefaultResolver @namespace Ember @extends Ember.Object @public */ exports.default = _emberRuntime.Object.extend({ /** This will be set to the Application instance when it is created. @property namespace @public */ namespace: null, init: function () { this._parseNameCache = _emberMetal.dictionary(null); }, normalize: function (fullName) { var _fullName$split = fullName.split(':', 2); var type = _fullName$split[0]; var name = _fullName$split[1]; if (type !== 'template') { var result = name; if (result.indexOf('.') > -1) { result = result.replace(/\.(.)/g, function (m) { return m.charAt(1).toUpperCase(); }); } if (name.indexOf('_') > -1) { result = result.replace(/_(.)/g, function (m) { return m.charAt(1).toUpperCase(); }); } if (name.indexOf('-') > -1) { result = result.replace(/-(.)/g, function (m) { return m.charAt(1).toUpperCase(); }); } return type + ':' + result; } else { return fullName; } }, /** This method is called via the container's resolver method. It parses the provided `fullName` and then looks up and returns the appropriate template or class. @method resolve @param {String} fullName the lookup string @return {Object} the resolved factory @public */ resolve: function (fullName) { var parsedName = this.parseName(fullName); var resolveMethodName = parsedName.resolveMethodName; var resolved; if (this[resolveMethodName]) { resolved = this[resolveMethodName](parsedName); } resolved = resolved || this.resolveOther(parsedName); if (parsedName.root && parsedName.root.LOG_RESOLVER) { this._logLookup(resolved, parsedName); } if (resolved) { _emberApplicationUtilsValidateType.default(resolved, parsedName); } return resolved; }, /** Convert the string name of the form 'type:name' to a Javascript object with the parsed aspects of the name broken out. @param {String} fullName the lookup string @method parseName @protected */ parseName: function (fullName) { return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName)); }, _parseName: function (fullName) { var _fullName$split2 = fullName.split(':'); var type = _fullName$split2[0]; var fullNameWithoutType = _fullName$split2[1]; var name = fullNameWithoutType; var namespace = _emberMetal.get(this, 'namespace'); var root = namespace; var lastSlashIndex = name.lastIndexOf('/'); var dirname = lastSlashIndex !== -1 ? name.slice(0, lastSlashIndex) : null; if (type !== 'template' && lastSlashIndex !== -1) { var parts = name.split('/'); name = parts[parts.length - 1]; var namespaceName = _emberRuntime.String.capitalize(parts.slice(0, -1).join('.')); root = _emberRuntime.Namespace.byName(namespaceName); } var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : _emberRuntime.String.classify(type); if (!(name && type)) { throw new TypeError('Invalid fullName: `' + fullName + '`, must be of the form `type:name` '); } return { fullName: fullName, type: type, fullNameWithoutType: fullNameWithoutType, dirname: dirname, name: name, root: root, resolveMethodName: 'resolve' + resolveMethodName }; }, /** Returns a human-readable description for a fullName. Used by the Application namespace in assertions to describe the precise name of the class that Ember is looking for, rather than container keys. @param {String} fullName the lookup string @method lookupDescription @protected */ lookupDescription: function (fullName) { var parsedName = this.parseName(fullName); var description = undefined; if (parsedName.type === 'template') { return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); } description = parsedName.root + '.' + _emberRuntime.String.classify(parsedName.name).replace(/\./g, ''); if (parsedName.type !== 'model') { description += _emberRuntime.String.classify(parsedName.type); } return description; }, makeToString: function (factory, fullName) { return factory.toString(); }, /** Given a parseName object (output from `parseName`), apply the conventions expected by `Ember.Router` @param {Object} parsedName a parseName object with the parsed fullName lookup string @method useRouterNaming @protected */ useRouterNaming: function (parsedName) { parsedName.name = parsedName.name.replace(/\./g, '_'); if (parsedName.name === 'basic') { parsedName.name = ''; } }, /** Look up the template in Ember.TEMPLATES @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveTemplate @protected */ resolveTemplate: function (parsedName) { var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); return _emberGlimmer.getTemplate(templateName) || _emberGlimmer.getTemplate(_emberRuntime.String.decamelize(templateName)); }, /** Lookup the view using `resolveOther` @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveView @protected */ resolveView: function (parsedName) { this.useRouterNaming(parsedName); return this.resolveOther(parsedName); }, /** Lookup the controller using `resolveOther` @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveController @protected */ resolveController: function (parsedName) { this.useRouterNaming(parsedName); return this.resolveOther(parsedName); }, /** Lookup the route using `resolveOther` @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveRoute @protected */ resolveRoute: function (parsedName) { this.useRouterNaming(parsedName); return this.resolveOther(parsedName); }, /** Lookup the model on the Application namespace @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveModel @protected */ resolveModel: function (parsedName) { var className = _emberRuntime.String.classify(parsedName.name); var factory = _emberMetal.get(parsedName.root, className); return factory; }, /** Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application) @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveHelper @protected */ resolveHelper: function (parsedName) { return this.resolveOther(parsedName); }, /** Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application) @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveOther @protected */ resolveOther: function (parsedName) { var className = _emberRuntime.String.classify(parsedName.name) + _emberRuntime.String.classify(parsedName.type); var factory = _emberMetal.get(parsedName.root, className); return factory; }, resolveMain: function (parsedName) { var className = _emberRuntime.String.classify(parsedName.type); return _emberMetal.get(parsedName.root, className); }, /** @method _logLookup @param {Boolean} found @param {Object} parsedName @private */ _logLookup: function (found, parsedName) { var symbol = undefined, padding = undefined; if (found) { symbol = '[✓]'; } else { symbol = '[ ]'; } if (parsedName.fullName.length > 60) { padding = '.'; } else { padding = new Array(60 - parsedName.fullName.length).join('.'); } }, /** Used to iterate all items of a given type. @method knownForType @param {String} type the type to search for @private */ knownForType: function (type) { var namespace = _emberMetal.get(this, 'namespace'); var suffix = _emberRuntime.String.classify(type); var typeRegexp = new RegExp(suffix + '$'); var known = _emberMetal.dictionary(null); var knownKeys = Object.keys(namespace); for (var index = 0; index < knownKeys.length; index++) { var _name = knownKeys[index]; if (typeRegexp.test(_name)) { var containerName = this.translateToContainerFullname(type, _name); known[containerName] = true; } } return known; }, /** Converts provided name from the backing namespace into a container lookup name. Examples: App.FooBarHelper -> helper:foo-bar App.THelper -> helper:t @method translateToContainerFullname @param {String} type @param {String} name @private */ translateToContainerFullname: function (type, name) { var suffix = _emberRuntime.String.classify(type); var namePrefix = name.slice(0, suffix.length * -1); var dasherizedName = _emberRuntime.String.dasherize(namePrefix); return type + ':' + dasherizedName; } }); }); enifed('ember-application/utils/validate-type', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-application */ 'use strict'; exports.default = validateType; var VALIDATED_TYPES = { route: ['assert', 'isRouteFactory', 'Ember.Route'], component: ['deprecate', 'isComponentFactory', 'Ember.Component'], view: ['deprecate', 'isViewFactory', 'Ember.View'], service: ['deprecate', 'isServiceFactory', 'Ember.Service'] }; function validateType(resolvedType, parsedName) { var validationAttributes = VALIDATED_TYPES[parsedName.type]; if (!validationAttributes) { return; } var action = validationAttributes[0]; var factoryFlag = validationAttributes[1]; var expectedType = validationAttributes[2]; if (action === 'deprecate') {} else {} } }); enifed('ember-console/index', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { 'use strict'; function K() {} function consoleMethod(name) { var consoleObj = undefined; if (_emberEnvironment.context.imports.console) { consoleObj = _emberEnvironment.context.imports.console; } else if (typeof console !== 'undefined') { consoleObj = console; } var method = typeof consoleObj === 'object' ? consoleObj[name] : null; if (typeof method !== 'function') { return; } if (typeof method.bind === 'function') { return method.bind(consoleObj); } return function () { method.apply(consoleObj, arguments); }; } function assertPolyfill(test, message) { if (!test) { try { // attempt to preserve the stack throw new Error('assertion failed: ' + message); } catch (error) { setTimeout(function () { throw error; }, 0); } } } /** Inside Ember-Metal, simply uses the methods from `imports.console`. Override this to provide more robust logging functionality. @class Logger @namespace Ember @public */ exports.default = { /** Logs the arguments to the console. You can pass as many arguments as you want and they will be joined together with a space. ```javascript var foo = 1; Ember.Logger.log('log value of foo:', foo); // "log value of foo: 1" will be printed to the console ``` @method log @for Ember.Logger @param {*} arguments @public */ log: consoleMethod('log') || K, /** Prints the arguments to the console with a warning icon. You can pass as many arguments as you want and they will be joined together with a space. ```javascript Ember.Logger.warn('Something happened!'); // "Something happened!" will be printed to the console with a warning icon. ``` @method warn @for Ember.Logger @param {*} arguments @public */ warn: consoleMethod('warn') || K, /** Prints the arguments to the console with an error icon, red text and a stack trace. You can pass as many arguments as you want and they will be joined together with a space. ```javascript Ember.Logger.error('Danger! Danger!'); // "Danger! Danger!" will be printed to the console in red text. ``` @method error @for Ember.Logger @param {*} arguments @public */ error: consoleMethod('error') || K, /** Logs the arguments to the console. You can pass as many arguments as you want and they will be joined together with a space. ```javascript var foo = 1; Ember.Logger.info('log value of foo:', foo); // "log value of foo: 1" will be printed to the console ``` @method info @for Ember.Logger @param {*} arguments @public */ info: consoleMethod('info') || K, /** Logs the arguments to the console in blue text. You can pass as many arguments as you want and they will be joined together with a space. ```javascript var foo = 1; Ember.Logger.debug('log value of foo:', foo); // "log value of foo: 1" will be printed to the console ``` @method debug @for Ember.Logger @param {*} arguments @public */ debug: consoleMethod('debug') || consoleMethod('info') || K, /** If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. ```javascript Ember.Logger.assert(true); // undefined Ember.Logger.assert(true === false); // Throws an Assertion failed error. Ember.Logger.assert(true === false, 'Something invalid'); // Throws an Assertion failed error with message. ``` @method assert @for Ember.Logger @param {Boolean} bool Value to test @param {String} message Assertion message on failed @public */ assert: consoleMethod('assert') || assertPolyfill }; }); enifed('ember-environment/global', ['exports'], function (exports) { /* globals global, window, self, mainContext */ // from lodash to catch fake globals 'use strict'; function checkGlobal(value) { return value && value.Object === Object ? value : undefined; } // element ids can ruin global miss checks function checkElementIdShadowing(value) { return value && value.nodeType === undefined ? value : undefined; } // export real global exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || mainContext || // set before strict mode in Ember loader/wrapper new Function('return this')(); // eval outside of strict mode }); enifed('ember-environment/index', ['exports', 'ember-environment/global', 'ember-environment/utils'], function (exports, _emberEnvironmentGlobal, _emberEnvironmentUtils) { /* globals module */ 'use strict'; /** The hash of environment variables used to control various configuration settings. To specify your own or override default settings, add the desired properties to a global hash named `EmberENV` (or `ENV` for backwards compatibility with earlier versions of Ember). The `EmberENV` hash must be created before loading Ember. @class EmberENV @type Object @public */ var ENV = typeof _emberEnvironmentGlobal.default.EmberENV === 'object' && _emberEnvironmentGlobal.default.EmberENV || typeof _emberEnvironmentGlobal.default.ENV === 'object' && _emberEnvironmentGlobal.default.ENV || {}; exports.ENV = ENV; // ENABLE_ALL_FEATURES was documented, but you can't actually enable non optional features. if (ENV.ENABLE_ALL_FEATURES) { ENV.ENABLE_OPTIONAL_FEATURES = true; } /** Determines whether Ember should add to `Array`, `Function`, and `String` native object prototypes, a few extra methods in order to provide a more friendly API. We generally recommend leaving this option set to true however, if you need to turn it off, you can add the configuration property `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`. Note, when disabled (the default configuration for Ember Addons), you will instead have to access all methods and functions from the Ember namespace. @property EXTEND_PROTOTYPES @type Boolean @default true @for EmberENV @public */ ENV.EXTEND_PROTOTYPES = _emberEnvironmentUtils.normalizeExtendPrototypes(ENV.EXTEND_PROTOTYPES); /** The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log a full stack trace during deprecation warnings. @property LOG_STACKTRACE_ON_DEPRECATION @type Boolean @default true @for EmberENV @public */ ENV.LOG_STACKTRACE_ON_DEPRECATION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_STACKTRACE_ON_DEPRECATION); /** The `LOG_VERSION` property, when true, tells Ember to log versions of all dependent libraries in use. @property LOG_VERSION @type Boolean @default true @for EmberENV @public */ ENV.LOG_VERSION = _emberEnvironmentUtils.defaultTrue(ENV.LOG_VERSION); // default false ENV.MODEL_FACTORY_INJECTIONS = _emberEnvironmentUtils.defaultFalse(ENV.MODEL_FACTORY_INJECTIONS); /** Debug parameter you can turn on. This will log all bindings that fire to the console. This should be disabled in production code. Note that you can also enable this from the console or temporarily. @property LOG_BINDINGS @for EmberENV @type Boolean @default false @public */ ENV.LOG_BINDINGS = _emberEnvironmentUtils.defaultFalse(ENV.LOG_BINDINGS); ENV.RAISE_ON_DEPRECATION = _emberEnvironmentUtils.defaultFalse(ENV.RAISE_ON_DEPRECATION); // check if window exists and actually is the global var hasDOM = typeof window !== 'undefined' && window === _emberEnvironmentGlobal.default && window.document && window.document.createElement && !ENV.disableBrowserEnvironment; // is this a public thing? // legacy imports/exports/lookup stuff (should we keep this??) var originalContext = _emberEnvironmentGlobal.default.Ember || {}; var context = { // import jQuery imports: originalContext.imports || _emberEnvironmentGlobal.default, // export Ember exports: originalContext.exports || _emberEnvironmentGlobal.default, // search for Namespaces lookup: originalContext.lookup || _emberEnvironmentGlobal.default }; exports.context = context; // TODO: cleanup single source of truth issues with this stuff var environment = hasDOM ? { hasDOM: true, isChrome: !!window.chrome && !window.opera, isFirefox: typeof InstallTrigger !== 'undefined', isPhantom: !!window.callPhantom, location: window.location, history: window.history, userAgent: window.navigator.userAgent, window: window } : { hasDOM: false, isChrome: false, isFirefox: false, isPhantom: false, location: null, history: null, userAgent: 'Lynx (textmode)', window: null }; exports.environment = environment; }); enifed("ember-environment/utils", ["exports"], function (exports) { "use strict"; exports.defaultTrue = defaultTrue; exports.defaultFalse = defaultFalse; exports.normalizeExtendPrototypes = normalizeExtendPrototypes; function defaultTrue(v) { return v === false ? false : true; } function defaultFalse(v) { return v === true ? true : false; } function normalizeExtendPrototypes(obj) { if (obj === false) { return { String: false, Array: false, Function: false }; } else if (!obj || obj === true) { return { String: true, Array: true, Function: true }; } else { return { String: defaultTrue(obj.String), Array: defaultTrue(obj.Array), Function: defaultTrue(obj.Function) }; } } }); enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { 'use strict'; /** @module ember @submodule ember-extension-support */ /** The `ContainerDebugAdapter` helps the container and resolver interface with tools that debug Ember such as the [Ember Extension](https://github.com/tildeio/ember-extension) for Chrome and Firefox. This class can be extended by a custom resolver implementer to override some of the methods with library-specific code. The methods likely to be overridden are: * `canCatalogEntriesByType` * `catalogEntriesByType` The adapter will need to be registered in the application's container as `container-debug-adapter:main`. Example: ```javascript Application.initializer({ name: "containerDebugAdapter", initialize(application) { application.register('container-debug-adapter:main', require('app/container-debug-adapter')); } }); ``` @class ContainerDebugAdapter @namespace Ember @extends Ember.Object @since 1.5.0 @public */ exports.default = _emberRuntime.Object.extend({ /** The resolver instance of the application being debugged. This property will be injected on creation. @property resolver @default null @public */ resolver: null, /** Returns true if it is possible to catalog a list of available classes in the resolver for a given type. @method canCatalogEntriesByType @param {String} type The type. e.g. "model", "controller", "route". @return {boolean} whether a list is available for this type. @public */ canCatalogEntriesByType: function (type) { if (type === 'model' || type === 'template') { return false; } return true; }, /** Returns the available classes a given type. @method catalogEntriesByType @param {String} type The type. e.g. "model", "controller", "route". @return {Array} An array of strings. @public */ catalogEntriesByType: function (type) { var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); var types = _emberRuntime.A(); var typeSuffixRegex = new RegExp(_emberRuntime.String.classify(type) + '$'); namespaces.forEach(function (namespace) { if (namespace !== _emberMetal.default) { for (var key in namespace) { if (!namespace.hasOwnProperty(key)) { continue; } if (typeSuffixRegex.test(key)) { var klass = namespace[key]; if (_emberRuntime.typeOf(klass) === 'class') { types.push(_emberRuntime.String.dasherize(key.replace(typeSuffixRegex, ''))); } } } } }); return types; } }); }); // Ember as namespace enifed('ember-extension-support/data_adapter', ['exports', 'ember-metal', 'ember-runtime', 'ember-application', 'container'], function (exports, _emberMetal, _emberRuntime, _emberApplication, _container) { 'use strict'; /** @module ember @submodule ember-extension-support */ /** The `DataAdapter` helps a data persistence library interface with tools that debug Ember such as the [Ember Extension](https://github.com/tildeio/ember-extension) for Chrome and Firefox. This class will be extended by a persistence library which will override some of the methods with library-specific code. The methods likely to be overridden are: * `getFilters` * `detect` * `columnsForType` * `getRecords` * `getRecordColumnValues` * `getRecordKeywords` * `getRecordFilterValues` * `getRecordColor` * `observeRecord` The adapter will need to be registered in the application's container as `dataAdapter:main`. Example: ```javascript Application.initializer({ name: "data-adapter", initialize: function(application) { application.register('data-adapter:main', DS.DataAdapter); } }); ``` @class DataAdapter @namespace Ember @extends EmberObject @public */ exports.default = _emberRuntime.Object.extend({ init: function () { this._super.apply(this, arguments); this.releaseMethods = _emberRuntime.A(); }, /** The container-debug-adapter which is used to list all models. @property containerDebugAdapter @default undefined @since 1.5.0 @public **/ containerDebugAdapter: undefined, /** The number of attributes to send as columns. (Enough to make the record identifiable). @private @property attributeLimit @default 3 @since 1.3.0 */ attributeLimit: 3, /** Ember Data > v1.0.0-beta.18 requires string model names to be passed around instead of the actual factories. This is a stamp for the Ember Inspector to differentiate between the versions to be able to support older versions too. @public @property acceptsModelName */ acceptsModelName: true, /** Stores all methods that clear observers. These methods will be called on destruction. @private @property releaseMethods @since 1.3.0 */ releaseMethods: _emberRuntime.A(), /** Specifies how records can be filtered. Records returned will need to have a `filterValues` property with a key for every name in the returned array. @public @method getFilters @return {Array} List of objects defining filters. The object should have a `name` and `desc` property. */ getFilters: function () { return _emberRuntime.A(); }, /** Fetch the model types and observe them for changes. @public @method watchModelTypes @param {Function} typesAdded Callback to call to add types. Takes an array of objects containing wrapped types (returned from `wrapModelType`). @param {Function} typesUpdated Callback to call when a type has changed. Takes an array of objects containing wrapped types. @return {Function} Method to call to remove all observers */ watchModelTypes: function (typesAdded, typesUpdated) { var _this = this; var modelTypes = this.getModelTypes(); var releaseMethods = _emberRuntime.A(); var typesToSend = undefined; typesToSend = modelTypes.map(function (type) { var klass = type.klass; var wrapped = _this.wrapModelType(klass, type.name); releaseMethods.push(_this.observeModelType(type.name, typesUpdated)); return wrapped; }); typesAdded(typesToSend); var release = function () { releaseMethods.forEach(function (fn) { return fn(); }); _this.releaseMethods.removeObject(release); }; this.releaseMethods.pushObject(release); return release; }, _nameToClass: function (type) { if (typeof type === 'string') { type = _container.getOwner(this)._lookupFactory('model:' + type); } return type; }, /** Fetch the records of a given type and observe them for changes. @public @method watchRecords @param {String} modelName The model name. @param {Function} recordsAdded Callback to call to add records. Takes an array of objects containing wrapped records. The object should have the following properties: columnValues: {Object} The key and value of a table cell. object: {Object} The actual record object. @param {Function} recordsUpdated Callback to call when a record has changed. Takes an array of objects containing wrapped records. @param {Function} recordsRemoved Callback to call when a record has removed. Takes the following parameters: index: The array index where the records were removed. count: The number of records removed. @return {Function} Method to call to remove all observers. */ watchRecords: function (modelName, recordsAdded, recordsUpdated, recordsRemoved) { var _this2 = this; var releaseMethods = _emberRuntime.A(); var klass = this._nameToClass(modelName); var records = this.getRecords(klass, modelName); var release = undefined; function recordUpdated(updatedRecord) { recordsUpdated([updatedRecord]); } var recordsToSend = records.map(function (record) { releaseMethods.push(_this2.observeRecord(record, recordUpdated)); return _this2.wrapRecord(record); }); var contentDidChange = function (array, idx, removedCount, addedCount) { for (var i = idx; i < idx + addedCount; i++) { var record = _emberRuntime.objectAt(array, i); var wrapped = _this2.wrapRecord(record); releaseMethods.push(_this2.observeRecord(record, recordUpdated)); recordsAdded([wrapped]); } if (removedCount) { recordsRemoved(idx, removedCount); } }; var observer = { didChange: contentDidChange, willChange: function () { return this; } }; _emberRuntime.addArrayObserver(records, this, observer); release = function () { releaseMethods.forEach(function (fn) { return fn(); }); _emberRuntime.removeArrayObserver(records, _this2, observer); _this2.releaseMethods.removeObject(release); }; recordsAdded(recordsToSend); this.releaseMethods.pushObject(release); return release; }, /** Clear all observers before destruction @private @method willDestroy */ willDestroy: function () { this._super.apply(this, arguments); this.releaseMethods.forEach(function (fn) { return fn(); }); }, /** Detect whether a class is a model. Test that against the model class of your persistence library. @private @method detect @param {Class} klass The class to test. @return boolean Whether the class is a model class or not. */ detect: function (klass) { return false; }, /** Get the columns for a given model type. @private @method columnsForType @param {Class} type The model type. @return {Array} An array of columns of the following format: name: {String} The name of the column. desc: {String} Humanized description (what would show in a table column name). */ columnsForType: function (type) { return _emberRuntime.A(); }, /** Adds observers to a model type class. @private @method observeModelType @param {String} modelName The model type name. @param {Function} typesUpdated Called when a type is modified. @return {Function} The function to call to remove observers. */ observeModelType: function (modelName, typesUpdated) { var _this3 = this; var klass = this._nameToClass(modelName); var records = this.getRecords(klass, modelName); function onChange() { typesUpdated([this.wrapModelType(klass, modelName)]); } var observer = { didChange: function () { _emberMetal.run.scheduleOnce('actions', this, onChange); }, willChange: function () { return this; } }; _emberRuntime.addArrayObserver(records, this, observer); var release = function () { return _emberRuntime.removeArrayObserver(records, _this3, observer); }; return release; }, /** Wraps a given model type and observes changes to it. @private @method wrapModelType @param {Class} klass A model class. @param {String} modelName Name of the class. @return {Object} Contains the wrapped type and the function to remove observers Format: type: {Object} The wrapped type. The wrapped type has the following format: name: {String} The name of the type. count: {Integer} The number of records available. columns: {Columns} An array of columns to describe the record. object: {Class} The actual Model type class. release: {Function} The function to remove observers. */ wrapModelType: function (klass, name) { var records = this.getRecords(klass, name); var typeToSend = undefined; typeToSend = { name: name, count: _emberMetal.get(records, 'length'), columns: this.columnsForType(klass), object: klass }; return typeToSend; }, /** Fetches all models defined in the application. @private @method getModelTypes @return {Array} Array of model types. */ getModelTypes: function () { var _this4 = this; var containerDebugAdapter = this.get('containerDebugAdapter'); var types = undefined; if (containerDebugAdapter.canCatalogEntriesByType('model')) { types = containerDebugAdapter.catalogEntriesByType('model'); } else { types = this._getObjectsOnNamespaces(); } // New adapters return strings instead of classes. types = _emberRuntime.A(types).map(function (name) { return { klass: _this4._nameToClass(name), name: name }; }); types = _emberRuntime.A(types).filter(function (type) { return _this4.detect(type.klass); }); return _emberRuntime.A(types); }, /** Loops over all namespaces and all objects attached to them. @private @method _getObjectsOnNamespaces @return {Array} Array of model type strings. */ _getObjectsOnNamespaces: function () { var _this5 = this; var namespaces = _emberRuntime.A(_emberRuntime.Namespace.NAMESPACES); var types = _emberRuntime.A(); namespaces.forEach(function (namespace) { for (var key in namespace) { if (!namespace.hasOwnProperty(key)) { continue; } // Even though we will filter again in `getModelTypes`, // we should not call `lookupFactory` on non-models // (especially when `EmberENV.MODEL_FACTORY_INJECTIONS` is `true`) if (!_this5.detect(namespace[key])) { continue; } var _name = _emberRuntime.String.dasherize(key); if (!(namespace instanceof _emberApplication.Application) && namespace.toString()) { _name = namespace + '/' + _name; } types.push(_name); } }); return types; }, /** Fetches all loaded records for a given type. @private @method getRecords @return {Array} An array of records. This array will be observed for changes, so it should update when new records are added/removed. */ getRecords: function (type) { return _emberRuntime.A(); }, /** Wraps a record and observers changes to it. @private @method wrapRecord @param {Object} record The record instance. @return {Object} The wrapped record. Format: columnValues: {Array} searchKeywords: {Array} */ wrapRecord: function (record) { var recordToSend = { object: record }; recordToSend.columnValues = this.getRecordColumnValues(record); recordToSend.searchKeywords = this.getRecordKeywords(record); recordToSend.filterValues = this.getRecordFilterValues(record); recordToSend.color = this.getRecordColor(record); return recordToSend; }, /** Gets the values for each column. @private @method getRecordColumnValues @return {Object} Keys should match column names defined by the model type. */ getRecordColumnValues: function (record) { return {}; }, /** Returns keywords to match when searching records. @private @method getRecordKeywords @return {Array} Relevant keywords for search. */ getRecordKeywords: function (record) { return _emberRuntime.A(); }, /** Returns the values of filters defined by `getFilters`. @private @method getRecordFilterValues @param {Object} record The record instance. @return {Object} The filter values. */ getRecordFilterValues: function (record) { return {}; }, /** Each record can have a color that represents its state. @private @method getRecordColor @param {Object} record The record instance @return {String} The records color. Possible options: black, red, blue, green. */ getRecordColor: function (record) { return null; }, /** Observes all relevant properties and re-sends the wrapped record when a change occurs. @private @method observerRecord @param {Object} record The record instance. @param {Function} recordUpdated The callback to call when a record is updated. @return {Function} The function to call to remove all observers. */ observeRecord: function (record, recordUpdated) { return function () {}; } }); }); enifed('ember-extension-support/index', ['exports', 'ember-extension-support/data_adapter', 'ember-extension-support/container_debug_adapter'], function (exports, _emberExtensionSupportData_adapter, _emberExtensionSupportContainer_debug_adapter) { /** @module ember @submodule ember-extension-support */ 'use strict'; exports.DataAdapter = _emberExtensionSupportData_adapter.default; exports.ContainerDebugAdapter = _emberExtensionSupportContainer_debug_adapter.default; }); enifed('ember-glimmer/component', ['exports', 'ember-views', 'ember-runtime', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference', 'glimmer-runtime', 'container'], function (exports, _emberViews, _emberRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference, _glimmerRuntime, _container) { 'use strict'; var _CoreView$extend; var DIRTY_TAG = _emberMetal.symbol('DIRTY_TAG'); exports.DIRTY_TAG = DIRTY_TAG; var ARGS = _emberMetal.symbol('ARGS'); exports.ARGS = ARGS; var ROOT_REF = _emberMetal.symbol('ROOT_REF'); exports.ROOT_REF = ROOT_REF; var IS_DISPATCHING_ATTRS = _emberMetal.symbol('IS_DISPATCHING_ATTRS'); exports.IS_DISPATCHING_ATTRS = IS_DISPATCHING_ATTRS; var HAS_BLOCK = _emberMetal.symbol('HAS_BLOCK'); exports.HAS_BLOCK = HAS_BLOCK; var BOUNDS = _emberMetal.symbol('BOUNDS'); exports.BOUNDS = BOUNDS; /** @module ember @submodule ember-glimmer */ /** An `Ember.Component` is a view that is completely isolated. Properties accessed in its templates go to the view object and actions are targeted at the view object. There is no access to the surrounding context or outer controller; all contextual information must be passed in. The easiest way to create an `Ember.Component` is via a template. If you name a template `components/my-foo`, you will be able to use `{{my-foo}}` in other templates, which will make an instance of the isolated component. ```handlebars {{app-profile person=currentUser}} ``` ```handlebars

{{person.title}}

{{person.signature}}

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

Admin mode

{{! Executed in the controller's context. }} {{/app-profile}} ``` ```handlebars

{{person.title}}

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

{{person.title}}

{{yield}} ``` Components must have a `-` in their name to avoid conflicts with built-in controls that wrap HTML elements. This is consistent with the same requirement in web components. @class Component @namespace Ember @extends Ember.CoreView @uses Ember.TargetActionSupport @uses Ember.ClassNamesSupport @uses Ember.ActionSupport @uses Ember.ViewMixin @public */ var Component = _emberViews.CoreView.extend(_emberViews.ChildViewsSupport, _emberViews.ViewStateSupport, _emberViews.ClassNamesSupport, _emberRuntime.TargetActionSupport, _emberViews.ActionSupport, _emberViews.ViewMixin, (_CoreView$extend = { isComponent: true, init: function () { this._super.apply(this, arguments); this[IS_DISPATCHING_ATTRS] = false; this[DIRTY_TAG] = new _glimmerReference.DirtyableTag(); this[ROOT_REF] = new _emberGlimmerUtilsReferences.RootReference(this); this[BOUNDS] = null; // If a `defaultLayout` was specified move it to the `layout` prop. // `layout` is no longer a CP, so this just ensures that the `defaultLayout` // logic is supported with a deprecation if (this.defaultLayout && !this.layout) { this.layout = this.defaultLayout; } // If in a tagless component, assert that no event handlers are defined }, // indicate that the assertion should be triggered rerender: function () { this[DIRTY_TAG].dirty(); this._super(); }, __defineNonEnumerable: function (property) { this[property.name] = property.descriptor.value; } }, _CoreView$extend[_emberMetal.PROPERTY_DID_CHANGE] = function (key) { if (this[IS_DISPATCHING_ATTRS]) { return; } var args = undefined, reference = undefined; if ((args = this[ARGS]) && (reference = args[key])) { if (reference[_emberGlimmerUtilsReferences.UPDATE]) { reference[_emberGlimmerUtilsReferences.UPDATE](_emberMetal.get(this, key)); } } }, _CoreView$extend.getAttr = function (key) { // TODO Intimate API should be deprecated var attrs = this.attrs; if (!attrs) { return; } return _emberViews.getAttrFor(attrs, key); }, _CoreView$extend.readDOMAttr = function (name) { return _glimmerRuntime.readDOMAttr(this.element, name); }, _CoreView$extend)); /** The WAI-ARIA role of the control represented by this view. For example, a button may have a role of type 'button', or a pane may have a role of type 'alertdialog'. This property is used by assistive software to help visually challenged users navigate rich web applications. The full list of valid WAI-ARIA roles is available at: [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization) @property ariaRole @type String @default null @public */ /** Enables components to take a list of parameters as arguments. For example, a component that takes two parameters with the names `name` and `age`: ```javascript let MyComponent = Ember.Component.extend; MyComponent.reopenClass({ positionalParams: ['name', 'age'] }); ``` It can then be invoked like this: ```hbs {{my-component "John" 38}} ``` The parameters can be referred to just like named parameters: ```hbs Name: {{attrs.name}}, Age: {{attrs.age}}. ``` Using a string instead of an array allows for an arbitrary number of parameters: ```javascript let MyComponent = Ember.Component.extend; MyComponent.reopenClass({ positionalParams: 'names' }); ``` It can then be invoked like this: ```hbs {{my-component "John" "Michael" "Scott"}} ``` The parameters can then be referred to by enumerating over the list: ```hbs {{#each attrs.names as |name|}}{{name}}{{/each}} ``` @static @public @property positionalParams @since 1.13.0 */ /** Called when the attributes passed into the component have been updated. Called both during the initial render of a container and during a rerender. Can be used in place of an observer; code placed here will be executed every time any attribute updates. @method didReceiveAttrs @public @since 1.13.0 */ /** Called when the attributes passed into the component have been updated. Called both during the initial render of a container and during a rerender. Can be used in place of an observer; code placed here will be executed every time any attribute updates. @event didReceiveAttrs @public @since 1.13.0 */ /** Called after a component has been rendered, both on initial render and in subsequent rerenders. @method didRender @public @since 1.13.0 */ /** Called after a component has been rendered, both on initial render and in subsequent rerenders. @event didRender @public @since 1.13.0 */ /** Called before a component has been rendered, both on initial render and in subsequent rerenders. @method willRender @public @since 1.13.0 */ /** Called before a component has been rendered, both on initial render and in subsequent rerenders. @event willRender @public @since 1.13.0 */ /** Called when the attributes passed into the component have been changed. Called only during a rerender, not during an initial render. @method didUpdateAttrs @public @since 1.13.0 */ /** Called when the attributes passed into the component have been changed. Called only during a rerender, not during an initial render. @event didUpdateAttrs @public @since 1.13.0 */ /** Called when the component is about to update and rerender itself. Called only during a rerender, not during an initial render. @method willUpdate @public @since 1.13.0 */ /** Called when the component is about to update and rerender itself. Called only during a rerender, not during an initial render. @event willUpdate @public @since 1.13.0 */ /** Called when the component has updated and rerendered itself. Called only during a rerender, not during an initial render. @method didUpdate @public @since 1.13.0 */ /** Called when the component has updated and rerendered itself. Called only during a rerender, not during an initial render. @event didUpdate @public @since 1.13.0 */ /** If `false`, the view will appear hidden in DOM. @property isVisible @type Boolean @default null @public */ Component[_emberMetal.NAME_KEY] = 'Ember.Component'; Component.reopenClass({ isComponentFactory: true }); exports.default = Component; }); /** Normally, Ember's component model is "write-only". The component takes a bunch of attributes that it got passed in, and uses them to render its template. One nice thing about this model is that if you try to set a value to the same thing as last time, Ember (through HTMLBars) will avoid doing any work on the DOM. This is not just a performance optimization. If an attribute has not changed, it is important not to clobber the element's "hidden state". For example, if you set an input's `value` to the same value as before, it will clobber selection state and cursor position. In other words, setting an attribute is not **always** idempotent. This method provides a way to read an element's attribute and also update the last value Ember knows about at the same time. This makes setting an attribute idempotent. In particular, what this means is that if you get an `` element's `value` attribute and then re-render the template with the same value, it will avoid clobbering the cursor and selection position. Since most attribute sets are idempotent in the browser, you typically can get away with reading attributes using jQuery, but the most reliable way to do so is through this method. @method readDOMAttr @param {String} name the name of the attribute @return String @public */ enifed('ember-glimmer/components/checkbox', ['exports', 'ember-metal', 'ember-glimmer/component', 'ember-glimmer/templates/empty'], function (exports, _emberMetal, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty) { 'use strict'; /** @module ember @submodule ember-views */ /** The internal class used to create text inputs when the `{{input}}` helper is used with `type` of `checkbox`. See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. ## Direct manipulation of `checked` The `checked` attribute of an `Ember.Checkbox` object should always be set through the Ember object or by interacting with its rendered element representation via the mouse, keyboard, or touch. Updating the value of the checkbox via jQuery will result in the checked value of the object and its element losing synchronization. ## Layout and LayoutName properties Because HTML `input` elements are self closing `layout` and `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s layout section for more information. @class Checkbox @namespace Ember @extends Ember.Component @public */ exports.default = _emberGlimmerComponent.default.extend({ layout: _emberGlimmerTemplatesEmpty.default, classNames: ['ember-checkbox'], tagName: 'input', attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name', 'autofocus', 'required', 'form'], type: 'checkbox', checked: false, disabled: false, indeterminate: false, didInsertElement: function () { this._super.apply(this, arguments); _emberMetal.get(this, 'element').indeterminate = !!_emberMetal.get(this, 'indeterminate'); }, change: function () { _emberMetal.set(this, 'checked', this.$().prop('checked')); } }); }); enifed('ember-glimmer/components/link-to', ['exports', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-glimmer/templates/link-to', 'ember-glimmer/component'], function (exports, _emberConsole, _emberMetal, _emberRuntime, _emberViews, _emberGlimmerTemplatesLinkTo, _emberGlimmerComponent) { /** @module ember @submodule ember-templates */ /** The `{{link-to}}` component renders a link to the supplied `routeName` passing an optionally supplied model to the route as its `model` context of the route. The block for `{{link-to}}` becomes the innerHTML of the rendered element: ```handlebars {{#link-to 'photoGallery'}} Great Hamster Photos {{/link-to}} ``` You can also use an inline form of `{{link-to}}` component by passing the link text as the first argument to the component: ```handlebars {{link-to 'Great Hamster Photos' 'photoGallery'}} ``` Both will result in: ```html Great Hamster Photos ``` ### Supplying a tagName By default `{{link-to}}` renders an `` element. This can be overridden for a single use of `{{link-to}}` by supplying a `tagName` option: ```handlebars {{#link-to 'photoGallery' tagName="li"}} Great Hamster Photos {{/link-to}} ``` ```html
  • Great Hamster Photos
  • ``` To override this option for your entire application, see "Overriding Application-wide Defaults". ### Disabling the `link-to` component By default `{{link-to}}` is enabled. any passed value to the `disabled` component property will disable the `link-to` component. static use: the `disabled` option: ```handlebars {{#link-to 'photoGallery' disabled=true}} Great Hamster Photos {{/link-to}} ``` dynamic use: the `disabledWhen` option: ```handlebars {{#link-to 'photoGallery' disabledWhen=controller.someProperty}} Great Hamster Photos {{/link-to}} ``` any passed value to `disabled` will disable it except `undefined`. to ensure that only `true` disable the `link-to` component you can override the global behaviour of `Ember.LinkComponent`. ```javascript Ember.LinkComponent.reopen({ disabled: Ember.computed(function(key, value) { if (value !== undefined) { this.set('_isDisabled', value === true); } return value === true ? get(this, 'disabledClass') : false; }) }); ``` see "Overriding Application-wide Defaults" for more. ### Handling `href` `{{link-to}}` will use your application's Router to fill the element's `href` property with a url that matches the path to the supplied `routeName` for your router's configured `Location` scheme, which defaults to Ember.HashLocation. ### Handling current route `{{link-to}}` will apply a CSS class name of 'active' when the application's current route matches the supplied routeName. For example, if the application's current route is 'photoGallery.recent' the following use of `{{link-to}}`: ```handlebars {{#link-to 'photoGallery.recent'}} Great Hamster Photos {{/link-to}} ``` will result in ```html
    Great Hamster Photos ``` The CSS class name used for active classes can be customized for a single use of `{{link-to}}` by passing an `activeClass` option: ```handlebars {{#link-to 'photoGallery.recent' activeClass="current-url"}} Great Hamster Photos {{/link-to}} ``` ```html Great Hamster Photos ``` To override this option for your entire application, see "Overriding Application-wide Defaults". ### Keeping a link active for other routes If you need a link to be 'active' even when it doesn't match the current route, you can use the `current-when` argument. ```handlebars {{#link-to 'photoGallery' current-when='photos'}} Photo Gallery {{/link-to}} ``` This may be helpful for keeping links active for: * non-nested routes that are logically related * some secondary menu approaches * 'top navigation' with 'sub navigation' scenarios A link will be active if `current-when` is `true` or the current route is the route this link would transition to. To match multiple routes 'space-separate' the routes: ```handlebars {{#link-to 'gallery' current-when='photos drawings paintings'}} Art Gallery {{/link-to}} ``` ### Supplying a model An optional model argument can be used for routes whose paths contain dynamic segments. This argument will become the model context of the linked route: ```javascript Router.map(function() { this.route("photoGallery", {path: "hamster-photos/:photo_id"}); }); ``` ```handlebars {{#link-to 'photoGallery' aPhoto}} {{aPhoto.title}} {{/link-to}} ``` ```html Tomster ``` ### Supplying multiple models For deep-linking to route paths that contain multiple dynamic segments, multiple model arguments can be used. As the router transitions through the route path, each supplied model argument will become the context for the route with the dynamic segments: ```javascript Router.map(function() { this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() { this.route("comment", {path: "comments/:comment_id"}); }); }); ``` This argument will become the model context of the linked route: ```handlebars {{#link-to 'photoGallery.comment' aPhoto comment}} {{comment.body}} {{/link-to}} ``` ```html A+++ would snuggle again. ``` ### Supplying an explicit dynamic segment value If you don't have a model object available to pass to `{{link-to}}`, an optional string or integer argument can be passed for routes whose paths contain dynamic segments. This argument will become the value of the dynamic segment: ```javascript Router.map(function() { this.route("photoGallery", { path: "hamster-photos/:photo_id" }); }); ``` ```handlebars {{#link-to 'photoGallery' aPhotoId}} {{aPhoto.title}} {{/link-to}} ``` ```html Tomster ``` When transitioning into the linked route, the `model` hook will be triggered with parameters including this passed identifier. ### Allowing Default Action By default the `{{link-to}}` component prevents the default browser action by calling `preventDefault()` as this sort of action bubbling is normally handled internally and we do not want to take the browser to a new URL (for example). If you need to override this behavior specify `preventDefault=false` in your template: ```handlebars {{#link-to 'photoGallery' aPhotoId preventDefault=false}} {{aPhotoId.title}} {{/link-to}} ``` ### Overriding attributes You can override any given property of the `Ember.LinkComponent` that is generated by the `{{link-to}}` component by passing key/value pairs, like so: ```handlebars {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames='pic sweet'}} Uh-mazing! {{/link-to}} ``` See [Ember.LinkComponent](/api/classes/Ember.LinkComponent.html) for a complete list of overrideable properties. Be sure to also check out inherited properties of `LinkComponent`. ### Overriding Application-wide Defaults ``{{link-to}}`` creates an instance of `Ember.LinkComponent` for rendering. To override options for your entire application, reopen `Ember.LinkComponent` and supply the desired values: ``` javascript Ember.LinkComponent.reopen({ activeClass: "is-active", tagName: 'li' }) ``` It is also possible to override the default event in this manner: ``` javascript Ember.LinkComponent.reopen({ eventName: 'customEventName' }); ``` @method link-to @for Ember.Templates.helpers @param {String} routeName @param {Object} [context]* @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkComponent @return {String} HTML string @see {Ember.LinkComponent} @public */ /** @module ember @submodule ember-templates */ 'use strict'; /** `Ember.LinkComponent` renders an element whose `click` event triggers a transition of the application's instance of `Ember.Router` to a supplied route by name. `Ember.LinkComponent` components are invoked with {{#link-to}}. Properties of this class can be overridden with `reopen` to customize application-wide behavior. @class LinkComponent @namespace Ember @extends Ember.Component @see {Ember.Templates.helpers.link-to} @private **/ var LinkComponent = _emberGlimmerComponent.default.extend({ layout: _emberGlimmerTemplatesLinkTo.default, tagName: 'a', /** @deprecated Use current-when instead. @property currentWhen @private */ currentWhen: _emberRuntime.deprecatingAlias('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }), /** Used to determine when this `LinkComponent` is active. @property currentWhen @public */ 'current-when': null, /** Sets the `title` attribute of the `LinkComponent`'s HTML element. @property title @default null @public **/ title: null, /** Sets the `rel` attribute of the `LinkComponent`'s HTML element. @property rel @default null @public **/ rel: null, /** Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. @property tabindex @default null @public **/ tabindex: null, /** Sets the `target` attribute of the `LinkComponent`'s HTML element. @since 1.8.0 @property target @default null @public **/ target: null, /** The CSS class to apply to `LinkComponent`'s element when its `active` property is `true`. @property activeClass @type String @default active @public **/ activeClass: 'active', /** The CSS class to apply to `LinkComponent`'s element when its `loading` property is `true`. @property loadingClass @type String @default loading @private **/ loadingClass: 'loading', /** The CSS class to apply to a `LinkComponent`'s element when its `disabled` property is `true`. @property disabledClass @type String @default disabled @private **/ disabledClass: 'disabled', _isDisabled: false, /** Determines whether the `LinkComponent` will trigger routing via the `replaceWith` routing strategy. @property replace @type Boolean @default false @public **/ replace: false, /** By default the `{{link-to}}` component will bind to the `href` and `title` attributes. It's discouraged that you override these defaults, however you can push onto the array if needed. @property attributeBindings @type Array | String @default ['title', 'rel', 'tabindex', 'target'] @public */ attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'], /** By default the `{{link-to}}` component will bind to the `active`, `loading`, and `disabled` classes. It is discouraged to override these directly. @property classNameBindings @type Array @default ['active', 'loading', 'disabled', 'ember-transitioning-in', 'ember-transitioning-out'] @public */ classNameBindings: ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut'], /** By default the `{{link-to}}` component responds to the `click` event. You can override this globally by setting this property to your custom event name. This is particularly useful on mobile when one wants to avoid the 300ms click delay using some sort of custom `tap` event. @property eventName @type String @default click @private */ eventName: 'click', // this is doc'ed here so it shows up in the events // section of the API documentation, which is where // people will likely go looking for it. /** Triggers the `LinkComponent`'s routing behavior. If `eventName` is changed to a value other than `click` the routing behavior will trigger on that custom event instead. @event click @private */ /** An overridable method called when `LinkComponent` objects are instantiated. Example: ```javascript App.MyLinkComponent = Ember.LinkComponent.extend({ init: function() { this._super(...arguments); Ember.Logger.log('Event is ' + this.get('eventName')); } }); ``` NOTE: If you do override `init` for a framework class like `Ember.View`, be sure to call `this._super(...arguments)` in your `init` declaration! If you don't, Ember may not have an opportunity to do important setup work, and you'll see strange behavior in your application. @method init @private */ init: function () { this._super.apply(this, arguments); // Map desired event name to invoke function var eventName = _emberMetal.get(this, 'eventName'); this.on(eventName, this, this._invoke); }, _routing: _emberRuntime.inject.service('-routing'), /** Accessed as a classname binding to apply the `LinkComponent`'s `disabledClass` CSS `class` to the element when the link is disabled. When `true` interactions with the element will not trigger route changes. @property disabled @private */ disabled: _emberMetal.computed({ get: function (key, value) { return false; }, set: function (key, value) { if (value !== undefined) { this.set('_isDisabled', value); } return value ? _emberMetal.get(this, 'disabledClass') : false; } }), _computeActive: function (routerState) { if (_emberMetal.get(this, 'loading')) { return false; } var routing = _emberMetal.get(this, '_routing'); var models = _emberMetal.get(this, 'models'); var resolvedQueryParams = _emberMetal.get(this, 'resolvedQueryParams'); var currentWhen = _emberMetal.get(this, 'current-when'); var isCurrentWhenSpecified = !!currentWhen; currentWhen = currentWhen || _emberMetal.get(this, 'qualifiedRouteName'); currentWhen = currentWhen.split(' '); for (var i = 0; i < currentWhen.length; i++) { if (routing.isActiveForRoute(models, resolvedQueryParams, currentWhen[i], routerState, isCurrentWhenSpecified)) { return _emberMetal.get(this, 'activeClass'); } } return false; }, /** Accessed as a classname binding to apply the `LinkComponent`'s `activeClass` CSS `class` to the element when the link is active. A `LinkComponent` is considered active when its `currentWhen` property is `true` or the application's current route is the route the `LinkComponent` would trigger transitions into. The `currentWhen` property can match against multiple routes by separating route names using the ` ` (space) character. @property active @private */ active: _emberMetal.computed('attrs.params', '_routing.currentState', function computeLinkToComponentActive() { var currentState = _emberMetal.get(this, '_routing.currentState'); if (!currentState) { return false; } return this._computeActive(currentState); }), willBeActive: _emberMetal.computed('_routing.targetState', function computeLinkToComponentWillBeActive() { var routing = _emberMetal.get(this, '_routing'); var targetState = _emberMetal.get(routing, 'targetState'); if (_emberMetal.get(routing, 'currentState') === targetState) { return; } return !!this._computeActive(targetState); }), transitioningIn: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningIn() { var willBeActive = _emberMetal.get(this, 'willBeActive'); if (typeof willBeActive === 'undefined') { return false; } return !_emberMetal.get(this, 'active') && willBeActive && 'ember-transitioning-in'; }), transitioningOut: _emberMetal.computed('active', 'willBeActive', function computeLinkToComponentTransitioningOut() { var willBeActive = _emberMetal.get(this, 'willBeActive'); if (typeof willBeActive === 'undefined') { return false; } return _emberMetal.get(this, 'active') && !willBeActive && 'ember-transitioning-out'; }), /** Event handler that invokes the link, activating the associated route. @method _invoke @param {Event} event @private */ _invoke: function (event) { if (!_emberViews.isSimpleClick(event)) { return true; } var preventDefault = _emberMetal.get(this, 'preventDefault'); var targetAttribute = _emberMetal.get(this, 'target'); if (preventDefault !== false) { if (!targetAttribute || targetAttribute === '_self') { event.preventDefault(); } } if (_emberMetal.get(this, 'bubbles') === false) { event.stopPropagation(); } if (_emberMetal.get(this, '_isDisabled')) { return false; } if (_emberMetal.get(this, 'loading')) { _emberConsole.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.'); return false; } if (targetAttribute && targetAttribute !== '_self') { return false; } var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); var models = _emberMetal.get(this, 'models'); var queryParams = _emberMetal.get(this, 'queryParams.values'); var shouldReplace = _emberMetal.get(this, 'replace'); var payload = { queryParams: queryParams, routeName: qualifiedRouteName }; _emberMetal.flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace)); }, _generateTransition: function (payload, qualifiedRouteName, models, queryParams, shouldReplace) { var routing = _emberMetal.get(this, '_routing'); return function () { payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace); }; }, queryParams: null, qualifiedRouteName: _emberMetal.computed('targetRouteName', '_routing.currentState', function computeLinkToComponentQualifiedRouteName() { var params = _emberMetal.get(this, 'params').slice(); var lastParam = params[params.length - 1]; if (lastParam && lastParam.isQueryParams) { params.pop(); } var onlyQueryParamsSupplied = this[_emberGlimmerComponent.HAS_BLOCK] ? params.length === 0 : params.length === 1; if (onlyQueryParamsSupplied) { return _emberMetal.get(this, '_routing.currentRouteName'); } return _emberMetal.get(this, 'targetRouteName'); }), resolvedQueryParams: _emberMetal.computed('queryParams', function computeLinkToComponentResolvedQueryParams() { var resolvedQueryParams = {}; var queryParams = _emberMetal.get(this, 'queryParams'); if (!queryParams) { return resolvedQueryParams; } var values = queryParams.values; for (var key in values) { if (!values.hasOwnProperty(key)) { continue; } resolvedQueryParams[key] = values[key]; } return resolvedQueryParams; }), /** Sets the element's `href` attribute to the url for the `LinkComponent`'s targeted route. If the `LinkComponent`'s `tagName` is changed to a value other than `a`, this property will be ignored. @property href @private */ href: _emberMetal.computed('models', 'qualifiedRouteName', function computeLinkToComponentHref() { if (_emberMetal.get(this, 'tagName') !== 'a') { return; } var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); var models = _emberMetal.get(this, 'models'); if (_emberMetal.get(this, 'loading')) { return _emberMetal.get(this, 'loadingHref'); } var routing = _emberMetal.get(this, '_routing'); var queryParams = _emberMetal.get(this, 'queryParams.values'); return routing.generateURL(qualifiedRouteName, models, queryParams); }), loading: _emberMetal.computed('_modelsAreLoaded', 'qualifiedRouteName', function computeLinkToComponentLoading() { var qualifiedRouteName = _emberMetal.get(this, 'qualifiedRouteName'); var modelsAreLoaded = _emberMetal.get(this, '_modelsAreLoaded'); if (!modelsAreLoaded || qualifiedRouteName == null) { return _emberMetal.get(this, 'loadingClass'); } }), _modelsAreLoaded: _emberMetal.computed('models', function computeLinkToComponentModelsAreLoaded() { var models = _emberMetal.get(this, 'models'); for (var i = 0; i < models.length; i++) { if (models[i] == null) { return false; } } return true; }), _getModels: function (params) { var modelCount = params.length - 1; var models = new Array(modelCount); for (var i = 0; i < modelCount; i++) { var value = params[i + 1]; while (_emberRuntime.ControllerMixin.detect(value)) { value = value.get('model'); } models[i] = value; } return models; }, /** The default href value to use while a link-to is loading. Only applies when tagName is 'a' @property loadingHref @type String @default # @private */ loadingHref: '#', didReceiveAttrs: function () { var queryParams = undefined; var params = _emberMetal.get(this, 'params'); if (params) { // Do not mutate params in place params = params.slice(); } var disabledWhen = _emberMetal.get(this, 'disabledWhen'); if (disabledWhen !== undefined) { this.set('disabled', disabledWhen); } // Process the positional arguments, in order. // 1. Inline link title comes first, if present. if (!this[_emberGlimmerComponent.HAS_BLOCK]) { this.set('linkTitle', params.shift()); } // 2. `targetRouteName` is now always at index 0. this.set('targetRouteName', params[0]); // 3. The last argument (if still remaining) is the `queryParams` object. var lastParam = params[params.length - 1]; if (lastParam && lastParam.isQueryParams) { queryParams = params.pop(); } else { queryParams = { values: {} }; } this.set('queryParams', queryParams); // 4. Any remaining indices (excepting `targetRouteName` at 0) are `models`. if (params.length > 1) { this.set('models', this._getModels(params)); } else { this.set('models', []); } } }); LinkComponent.toString = function () { return 'LinkComponent'; }; LinkComponent.reopenClass({ positionalParams: 'params' }); exports.default = LinkComponent; }); enifed('ember-glimmer/components/text_area', ['exports', 'ember-glimmer/component', 'ember-views', 'ember-glimmer/templates/empty'], function (exports, _emberGlimmerComponent, _emberViews, _emberGlimmerTemplatesEmpty) { /** @module ember @submodule ember-views */ 'use strict'; /** The internal class used to create textarea element when the `{{textarea}}` helper is used. See [Ember.Templates.helpers.textarea](/api/classes/Ember.Templates.helpers.html#method_textarea) for usage details. ## Layout and LayoutName properties Because HTML `textarea` elements do not contain inner HTML the `layout` and `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s layout section for more information. @class TextArea @namespace Ember @extends Ember.Component @uses Ember.TextSupport @public */ exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { classNames: ['ember-text-area'], layout: _emberGlimmerTemplatesEmpty.default, tagName: 'textarea', attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'wrap', 'lang', 'dir', 'value'], rows: null, cols: null }); }); enifed('ember-glimmer/components/text_field', ['exports', 'ember-metal', 'ember-environment', 'ember-glimmer/component', 'ember-glimmer/templates/empty', 'ember-views'], function (exports, _emberMetal, _emberEnvironment, _emberGlimmerComponent, _emberGlimmerTemplatesEmpty, _emberViews) { /** @module ember @submodule ember-views */ 'use strict'; var inputTypeTestElement = undefined; var inputTypes = new _emberMetal.EmptyObject(); function canSetTypeOfInput(type) { if (type in inputTypes) { return inputTypes[type]; } // if running in outside of a browser always return the // original type if (!_emberEnvironment.environment.hasDOM) { inputTypes[type] = type; return type; } if (!inputTypeTestElement) { inputTypeTestElement = document.createElement('input'); } try { inputTypeTestElement.type = type; } catch (e) {} return inputTypes[type] = inputTypeTestElement.type === type; } /** The internal class used to create text inputs when the `{{input}}` helper is used with `type` of `text`. See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. ## Layout and LayoutName properties Because HTML `input` elements are self closing `layout` and `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s layout section for more information. @class TextField @namespace Ember @extends Ember.Component @uses Ember.TextSupport @public */ exports.default = _emberGlimmerComponent.default.extend(_emberViews.TextSupport, { layout: _emberGlimmerTemplatesEmpty.default, classNames: ['ember-text-field'], tagName: 'input', attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'type', 'value', 'width'], /** The `value` attribute of the input element. As the user inputs text, this property is updated live. @property value @type String @default "" @public */ value: '', /** The `type` attribute of the input element. @property type @type String @default "text" @public */ type: _emberMetal.computed({ get: function () { return 'text'; }, set: function (key, value) { var type = 'text'; if (canSetTypeOfInput(value)) { type = value; } return type; } }), /** The `size` of the text field in characters. @property size @type String @default null @public */ size: null, /** The `pattern` attribute of input element. @property pattern @type String @default null @public */ pattern: null, /** The `min` attribute of input element used with `type="number"` or `type="range"`. @property min @type String @default null @since 1.4.0 @public */ min: null, /** The `max` attribute of input element used with `type="number"` or `type="range"`. @property max @type String @default null @since 1.4.0 @public */ max: null }); }); enifed('ember-glimmer/dom', ['exports', 'glimmer-runtime', 'glimmer-node'], function (exports, _glimmerRuntime, _glimmerNode) { 'use strict'; exports.DOMChanges = _glimmerRuntime.DOMChanges; exports.DOMTreeConstruction = _glimmerRuntime.DOMTreeConstruction; exports.NodeDOMTreeConstruction = _glimmerNode.NodeDOMTreeConstruction; }); enifed('ember-glimmer/environment', ['exports', 'ember-metal', 'ember-views', 'glimmer-runtime', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/iterable', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/if-unless', 'ember-glimmer/utils/bindings', 'ember-glimmer/helpers/action', 'ember-glimmer/helpers/component', 'ember-glimmer/helpers/concat', 'ember-glimmer/helpers/debugger', 'ember-glimmer/helpers/get', 'ember-glimmer/helpers/hash', 'ember-glimmer/helpers/loc', 'ember-glimmer/helpers/log', 'ember-glimmer/helpers/mut', 'ember-glimmer/helpers/readonly', 'ember-glimmer/helpers/unbound', 'ember-glimmer/helpers/-class', 'ember-glimmer/helpers/-input-type', 'ember-glimmer/helpers/query-param', 'ember-glimmer/helpers/each-in', 'ember-glimmer/helpers/-normalize-class', 'ember-glimmer/helpers/-html-safe', 'container', 'ember-glimmer/protocol-for-url', 'ember-glimmer/modifiers/action'], function (exports, _emberMetal, _emberViews, _glimmerRuntime, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntax, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsIterable, _emberGlimmerUtilsReferences, _emberGlimmerHelpersIfUnless, _emberGlimmerUtilsBindings, _emberGlimmerHelpersAction, _emberGlimmerHelpersComponent, _emberGlimmerHelpersConcat, _emberGlimmerHelpersDebugger, _emberGlimmerHelpersGet, _emberGlimmerHelpersHash, _emberGlimmerHelpersLoc, _emberGlimmerHelpersLog, _emberGlimmerHelpersMut, _emberGlimmerHelpersReadonly, _emberGlimmerHelpersUnbound, _emberGlimmerHelpersClass, _emberGlimmerHelpersInputType, _emberGlimmerHelpersQueryParam, _emberGlimmerHelpersEachIn, _emberGlimmerHelpersNormalizeClass, _emberGlimmerHelpersHtmlSafe, _container, _emberGlimmerProtocolForUrl, _emberGlimmerModifiersAction) { 'use strict'; var builtInComponents = { textarea: '-text-area' }; var Environment = (function (_GlimmerEnvironment) { babelHelpers.inherits(Environment, _GlimmerEnvironment); Environment.create = function create(options) { return new Environment(options); }; function Environment(_ref) { var _this = this; var owner = _ref[_container.OWNER]; _GlimmerEnvironment.apply(this, arguments); this.owner = owner; this.isInteractive = owner.lookup('-environment:main').isInteractive; // can be removed once https://github.com/tildeio/glimmer/pull/305 lands this.destroyedComponents = undefined; _emberGlimmerProtocolForUrl.default(this); this._definitionCache = new _emberMetal.Cache(2000, function (_ref2) { var name = _ref2.name; var source = _ref2.source; var owner = _ref2.owner; var _lookupComponent = _emberViews.lookupComponent(owner, name, { source: source }); var ComponentClass = _lookupComponent.component; var layout = _lookupComponent.layout; if (ComponentClass || layout) { return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(name, ComponentClass, layout); } }, function (_ref3) { var name = _ref3.name; var source = _ref3.source; var owner = _ref3.owner; var expandedName = source && owner._resolveLocalLookupName(name, source) || name; var ownerGuid = _emberMetal.guidFor(owner); return ownerGuid + '|' + expandedName; }); this._templateCache = new _emberMetal.Cache(1000, function (_ref4) { var _Template$create; var Template = _ref4.Template; var owner = _ref4.owner; return Template.create((_Template$create = { env: _this }, _Template$create[_container.OWNER] = owner, _Template$create)); }, function (_ref5) { var Template = _ref5.Template; var owner = _ref5.owner; return _emberMetal.guidFor(owner) + '|' + Template.id; }); this._compilerCache = new _emberMetal.Cache(10, function (Compiler) { return new _emberMetal.Cache(2000, function (template) { var compilable = new Compiler(template); return _glimmerRuntime.compileLayout(compilable, _this); }, function (template) { return template.id; }); }, function (Compiler) { return Compiler.id; }); this.builtInModifiers = { action: new _emberGlimmerModifiersAction.default() }; this.builtInHelpers = { if: _emberGlimmerHelpersIfUnless.inlineIf, action: _emberGlimmerHelpersAction.default, component: _emberGlimmerHelpersComponent.default, concat: _emberGlimmerHelpersConcat.default, debugger: _emberGlimmerHelpersDebugger.default, get: _emberGlimmerHelpersGet.default, hash: _emberGlimmerHelpersHash.default, loc: _emberGlimmerHelpersLoc.default, log: _emberGlimmerHelpersLog.default, mut: _emberGlimmerHelpersMut.default, 'query-params': _emberGlimmerHelpersQueryParam.default, readonly: _emberGlimmerHelpersReadonly.default, unbound: _emberGlimmerHelpersUnbound.default, unless: _emberGlimmerHelpersIfUnless.inlineUnless, '-class': _emberGlimmerHelpersClass.default, '-each-in': _emberGlimmerHelpersEachIn.default, '-input-type': _emberGlimmerHelpersInputType.default, '-normalize-class': _emberGlimmerHelpersNormalizeClass.default, '-html-safe': _emberGlimmerHelpersHtmlSafe.default, '-get-dynamic-var': _glimmerRuntime.getDynamicVar }; } // Hello future traveler, welcome to the world of syntax refinement. // The method below is called by Glimmer's runtime compiler to allow // us to take generic statement syntax and refine it to more meaniful // syntax for Ember's use case. This on the fly switch-a-roo sounds fine // and dandy, however Ember has precedence on statement refinement that you // need to be aware of. The presendence for language constructs is as follows: // // ------------------------ // Native & Built-in Syntax // ------------------------ // User-land components // ------------------------ // User-land helpers // ------------------------ // // The one caveat here is that Ember also allows for dashed references that are // not a component or helper: // // export default Component.extend({ // 'foo-bar': 'LAME' // }); // // {{foo-bar}} // // The heuristic for the above situation is a dashed "key" in inline form // that does not resolve to a defintion. In this case refine statement simply // isn't going to return any syntax and the Glimmer engine knows how to handle // this case. Environment.prototype.refineStatement = function refineStatement(statement, symbolTable) { // 1. resolve any native syntax – if, unless, with, each, and partial var nativeSyntax = _GlimmerEnvironment.prototype.refineStatement.call(this, statement); if (nativeSyntax) { return nativeSyntax; } var appendType = statement.appendType; var isSimple = statement.isSimple; var isInline = statement.isInline; var isBlock = statement.isBlock; var isModifier = statement.isModifier; var key = statement.key; var path = statement.path; var args = statement.args; var templates = statement.templates; if (isSimple && (isInline || isBlock)) { // 2. built-in syntax var RefinedSyntax = _emberGlimmerSyntax.findSyntaxBuilder(key); if (RefinedSyntax) { return RefinedSyntax.create(this, args, templates, symbolTable); } var internalKey = builtInComponents[key]; var definition = null; if (internalKey) { definition = this.getComponentDefinition([internalKey], symbolTable); } else if (key.indexOf('-') >= 0) { definition = this.getComponentDefinition(path, symbolTable); } if (definition) { _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, templates, symbolTable); } } if (!isSimple && appendType === 'unknown') { return statement.original.deopt(); } if (!isSimple && path) { return _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax.fromPath(this, path, args, templates, symbolTable); } }; Environment.prototype.hasComponentDefinition = function hasComponentDefinition() { return false; }; Environment.prototype.getComponentDefinition = function getComponentDefinition(path, symbolTable) { var name = path[0]; var blockMeta = symbolTable.getMeta(); var owner = blockMeta.owner; var source = blockMeta.moduleName && 'template:' + blockMeta.moduleName; return this._definitionCache.get({ name: name, source: source, owner: owner }); }; // normally templates should be exported at the proper module name // and cached in the container, but this cache supports templates // that have been set directly on the component's layout property Environment.prototype.getTemplate = function getTemplate(Template, owner) { return this._templateCache.get({ Template: Template, owner: owner }); }; // a Compiler can wrap the template so it needs its own cache Environment.prototype.getCompiledBlock = function getCompiledBlock(Compiler, template, owner) { var compilerCache = this._compilerCache.get(Compiler); return compilerCache.get(template, owner); }; Environment.prototype.hasPartial = function hasPartial(name) { return _emberViews.hasPartial(this, name[0]); }; Environment.prototype.lookupPartial = function lookupPartial(name) { var partial = { template: _emberViews.lookupPartial(this, name[0]) }; if (partial) { return partial; } else { throw new Error(name + ' is not a partial'); } }; Environment.prototype.hasHelper = function hasHelper(nameParts, symbolTable) { // helpers are not allowed to include a dot in their invocation if (nameParts.length > 1) { return false; } var name = nameParts[0]; if (this.builtInHelpers[name]) { return true; } var blockMeta = symbolTable.getMeta(); var owner = blockMeta.owner; var options = { source: 'template:' + blockMeta.moduleName }; return owner.hasRegistration('helper:' + name, options) || owner.hasRegistration('helper:' + name); }; Environment.prototype.lookupHelper = function lookupHelper(nameParts, symbolTable) { var name = nameParts[0]; var helper = this.builtInHelpers[name]; if (helper) { return helper; } var blockMeta = symbolTable.getMeta(); var owner = blockMeta.owner; var options = blockMeta.moduleName && { source: 'template:' + blockMeta.moduleName } || {}; helper = owner.lookup('helper:' + name, options) || owner.lookup('helper:' + name); // TODO: try to unify this into a consistent protocol to avoid wasteful closure allocations if (helper.isHelperInstance) { return function (vm, args) { return _emberGlimmerUtilsReferences.SimpleHelperReference.create(helper.compute, args); }; } else if (helper.isHelperFactory) { return function (vm, args) { return _emberGlimmerUtilsReferences.ClassBasedHelperReference.create(helper, vm, args); }; } else { throw new Error(nameParts + ' is not a helper'); } }; Environment.prototype.hasModifier = function hasModifier(nameParts) { // modifiers are not allowed to include a dot in their invocation if (nameParts.length > 1) { return false; } return !!this.builtInModifiers[nameParts[0]]; }; Environment.prototype.lookupModifier = function lookupModifier(nameParts) { var modifier = this.builtInModifiers[nameParts[0]]; if (modifier) { return modifier; } else { throw new Error(nameParts + ' is not a modifier'); } }; Environment.prototype.toConditionalReference = function toConditionalReference(reference) { return _emberGlimmerUtilsReferences.ConditionalReference.create(reference); }; Environment.prototype.iterableFor = function iterableFor(ref, args) { var keyPath = args.named.get('key').value(); return _emberGlimmerUtilsIterable.default(ref, keyPath); }; Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier() { if (this.isInteractive) { var _GlimmerEnvironment$prototype$scheduleInstallModifier; (_GlimmerEnvironment$prototype$scheduleInstallModifier = _GlimmerEnvironment.prototype.scheduleInstallModifier).call.apply(_GlimmerEnvironment$prototype$scheduleInstallModifier, [this].concat(babelHelpers.slice.call(arguments))); } }; Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier() { if (this.isInteractive) { var _GlimmerEnvironment$prototype$scheduleUpdateModifier; (_GlimmerEnvironment$prototype$scheduleUpdateModifier = _GlimmerEnvironment.prototype.scheduleUpdateModifier).call.apply(_GlimmerEnvironment$prototype$scheduleUpdateModifier, [this].concat(babelHelpers.slice.call(arguments))); } }; Environment.prototype.didDestroy = function didDestroy(destroyable) { destroyable.destroy(); }; Environment.prototype.begin = function begin() { this.inTransaction = true; _GlimmerEnvironment.prototype.begin.call(this); this.destroyedComponents = []; }; Environment.prototype.commit = function commit() { // components queued for destruction must be destroyed before firing // `didCreate` to prevent errors when removing and adding a component // with the same name (would throw an error when added to view registry) for (var i = 0; i < this.destroyedComponents.length; i++) { this.destroyedComponents[i].destroy(); } _GlimmerEnvironment.prototype.commit.call(this); this.inTransaction = false; }; return Environment; })(_glimmerRuntime.Environment); exports.default = Environment; }); enifed('ember-glimmer/helper', ['exports', 'ember-metal', 'ember-runtime', 'glimmer-reference'], function (exports, _emberMetal, _emberRuntime, _glimmerReference) { /** @module ember @submodule ember-templates */ 'use strict'; var _EmberObject$extend; exports.helper = helper; var RECOMPUTE_TAG = _emberMetal.symbol('RECOMPUTE_TAG'); exports.RECOMPUTE_TAG = RECOMPUTE_TAG; /** Ember Helpers are functions that can compute values, and are used in templates. For example, this code calls a helper named `format-currency`: ```handlebars
    {{format-currency cents currency="$"}}
    ``` Additionally a helper can be called as a nested helper (sometimes called a subexpression). In this example, the computed value of a helper is passed to a component named `show-money`: ```handlebars {{show-money amount=(format-currency cents currency="$")}} ``` Helpers defined using a class must provide a `compute` function. For example: ```js export default Ember.Helper.extend({ compute(params, hash) { let cents = params[0]; let currency = hash.currency; return `${currency}${cents * 0.01}`; } }); ``` Each time the input to a helper changes, the `compute` function will be called again. As instances, these helpers also have access to the container an will accept injected dependencies. Additionally, class helpers can call `recompute` to force a new computation. @class Ember.Helper @public @since 1.13.0 */ var Helper = _emberRuntime.Object.extend((_EmberObject$extend = { isHelperInstance: true }, _EmberObject$extend[_emberRuntime.POST_INIT] = function () { this[RECOMPUTE_TAG] = new _glimmerReference.DirtyableTag(); }, _EmberObject$extend.recompute = function () { this[RECOMPUTE_TAG].dirty(); }, _EmberObject$extend)); /** Override this function when writing a class-based helper. @method compute @param {Array} params The positional arguments to the helper @param {Object} hash The named arguments to the helper @public @since 1.13.0 */ Helper.reopenClass({ isHelperFactory: true }); /** In many cases, the ceremony of a full `Ember.Helper` class is not required. The `helper` method create pure-function helpers without instances. For example: ```js // app/helpers/format-currency.js export default Ember.Helper.helper(function(params, hash) { let cents = params[0]; let currency = hash.currency; return `${currency}${cents * 0.01}`; }); ``` @static @param {Function} helper The helper function @method helper @public @since 1.13.0 */ function helper(helperFn) { return { isHelperInstance: true, compute: helperFn }; } exports.default = Helper; }); /** On a class-based helper, it may be useful to force a recomputation of that helpers value. This is akin to `rerender` on a component. For example, this component will rerender when the `currentUser` on a session service changes: ```js // app/helpers/current-user-email.js export default Ember.Helper.extend({ session: Ember.inject.service(), onNewUser: Ember.observer('session.currentUser', function() { this.recompute(); }), compute() { return this.get('session.currentUser.email'); } }); ``` @method recompute @public @since 1.13.0 */ enifed('ember-glimmer/helpers/-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { 'use strict'; function classHelper(_ref) { var positional = _ref.positional; var path = positional.at(0); var args = positional.length; var value = path.value(); if (value === true) { if (args > 1) { return _emberRuntime.String.dasherize(positional.at(1).value()); } return null; } if (value === false) { if (args > 2) { return _emberRuntime.String.dasherize(positional.at(2).value()); } return null; } return value; } exports.default = function (vm, args) { return new _emberGlimmerUtilsReferences.InternalHelperReference(classHelper, args); }; }); enifed('ember-glimmer/helpers/-html-safe', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/utils/string'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerUtilsString) { 'use strict'; function htmlSafe(_ref) { var positional = _ref.positional; var path = positional.at(0); return new _emberGlimmerUtilsString.SafeString(path.value()); } exports.default = function (vm, args) { return new _emberGlimmerUtilsReferences.InternalHelperReference(htmlSafe, args); }; }); enifed('ember-glimmer/helpers/-input-type', ['exports', 'ember-glimmer/utils/references'], function (exports, _emberGlimmerUtilsReferences) { 'use strict'; function inputTypeHelper(_ref) { var positional = _ref.positional; var named = _ref.named; var type = positional.at(0).value(); if (type === 'checkbox') { return '-checkbox'; } return '-text-field'; } exports.default = function (vm, args) { return new _emberGlimmerUtilsReferences.InternalHelperReference(inputTypeHelper, args); }; }); enifed('ember-glimmer/helpers/-normalize-class', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { 'use strict'; function normalizeClass(_ref) { var positional = _ref.positional; var named = _ref.named; var classNameParts = positional.at(0).value().split('.'); var className = classNameParts[classNameParts.length - 1]; var value = positional.at(1).value(); if (value === true) { return _emberRuntime.String.dasherize(className); } else if (!value && value !== 0) { return ''; } else { return String(value); } } exports.default = function (vm, args) { return new _emberGlimmerUtilsReferences.InternalHelperReference(normalizeClass, args); }; }); enifed('ember-glimmer/helpers/action', ['exports', 'ember-glimmer/utils/references', 'ember-metal'], function (exports, _emberGlimmerUtilsReferences, _emberMetal) { 'use strict'; exports.createClosureAction = createClosureAction; var INVOKE = _emberMetal.symbol('INVOKE'); exports.INVOKE = INVOKE; var ClosureActionReference = (function (_CachedReference) { babelHelpers.inherits(ClosureActionReference, _CachedReference); ClosureActionReference.create = function create(args) { // TODO: Const reference optimization. return new ClosureActionReference(args); }; function ClosureActionReference(args) { _CachedReference.call(this); this.args = args; this.tag = args.tag; } ClosureActionReference.prototype.compute = function compute() { var _args = this.args; var named = _args.named; var positional = _args.positional; var positionalValues = positional.value(); var target = positionalValues[0]; var rawActionRef = positional.at(1); var rawAction = positionalValues[1]; // The first two argument slots are reserved. // pos[0] is the context (or `this`) // pos[1] is the action name or function // Anything else is an action argument. var actionArgs = positionalValues.slice(2); // on-change={{action setName}} // element-space actions look to "controller" then target. Here we only // look to "target". var actionType = typeof rawAction; var action = rawAction; if (rawActionRef[INVOKE]) { target = rawActionRef; action = rawActionRef[INVOKE]; } else if (_emberMetal.isNone(rawAction)) { throw new _emberMetal.Error('Action passed is null or undefined in (action) from ' + target + '.'); } else if (actionType === 'string') { // on-change={{action 'setName'}} var actionName = rawAction; action = null; if (named.has('target')) { // on-change={{action 'setName' target=alternativeComponent}} target = named.get('target').value(); } if (target['actions']) { action = target.actions[actionName]; } if (!action) { throw new _emberMetal.Error('An action named \'' + actionName + '\' was not found in ' + target); } } else if (action && typeof action[INVOKE] === 'function') { target = action; action = action[INVOKE]; } else if (actionType !== 'function') { // TODO: Is there a better way of doing this? var rawActionLabel = rawActionRef._propertyKey || rawAction; throw new _emberMetal.Error('An action could not be made for `' + rawActionLabel + '` in ' + target + '. Please confirm that you are using either a quoted action name (i.e. `(action \'' + rawActionLabel + '\')`) or a function available in ' + target + '.'); } var valuePath = named.get('value').value(); return createClosureAction(target, action, valuePath, actionArgs); }; return ClosureActionReference; })(_emberGlimmerUtilsReferences.CachedReference); exports.ClosureActionReference = ClosureActionReference; exports.default = function (vm, args) { return ClosureActionReference.create(args); }; function createClosureAction(target, action, valuePath, actionArgs) { var closureAction = undefined; var actionArgLength = actionArgs.length; if (actionArgLength > 0) { closureAction = function () { for (var _len = arguments.length, passedArguments = Array(_len), _key = 0; _key < _len; _key++) { passedArguments[_key] = arguments[_key]; } var args = new Array(actionArgLength + passedArguments.length); for (var i = 0; i < actionArgLength; i++) { args[i] = actionArgs[i]; } for (var i = 0; i < passedArguments.length; i++) { args[i + actionArgLength] = passedArguments[i]; } if (valuePath && args.length > 0) { args[0] = _emberMetal.get(args[0], valuePath); } var payload = { target: target, args: args, label: 'glimmer-closure-action' }; return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { return _emberMetal.run.join.apply(_emberMetal.run, [target, action].concat(args)); }); }; } else { closureAction = function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } if (valuePath && args.length > 0) { args[0] = _emberMetal.get(args[0], valuePath); } var payload = { target: target, args: args, label: 'glimmer-closure-action' }; return _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { return _emberMetal.run.join.apply(_emberMetal.run, [target, action].concat(args)); }); }; } return closureAction; } }); enifed('ember-glimmer/helpers/component', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/syntax/curly-component', 'glimmer-runtime', 'ember-metal'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerSyntaxCurlyComponent, _glimmerRuntime, _emberMetal) { 'use strict'; var ClosureComponentReference = (function (_CachedReference) { babelHelpers.inherits(ClosureComponentReference, _CachedReference); ClosureComponentReference.create = function create(args, symbolTable, env) { return new ClosureComponentReference(args, symbolTable, env); }; function ClosureComponentReference(args, symbolTable, env) { _CachedReference.call(this); this.defRef = args.positional.at(0); this.env = env; this.tag = args.positional.at(0).tag; this.symbolTable = symbolTable; this.args = args; this.lastDefinition = undefined; this.lastName = undefined; } ClosureComponentReference.prototype.compute = function compute() { // TODO: Figure out how to extract this because it's nearly identical to // DynamicComponentReference::compute(). The only differences besides // currying are in the assertion messages. var args = this.args; var defRef = this.defRef; var env = this.env; var symbolTable = this.symbolTable; var lastDefinition = this.lastDefinition; var lastName = this.lastName; var nameOrDef = defRef.value(); var definition = null; if (nameOrDef && nameOrDef === lastName) { return lastDefinition; } this.lastName = nameOrDef; if (typeof nameOrDef === 'string') { definition = env.getComponentDefinition([nameOrDef], symbolTable); } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { definition = nameOrDef; } else { return null; } var newDef = createCurriedDefinition(definition, args); this.lastDefinition = newDef; return newDef; }; return ClosureComponentReference; })(_emberGlimmerUtilsReferences.CachedReference); exports.ClosureComponentReference = ClosureComponentReference; function createCurriedDefinition(definition, args) { var curriedArgs = curryArgs(definition, args); return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentDefinition(definition.name, definition.ComponentClass, definition.template, curriedArgs); } function curryArgs(definition, newArgs) { var args = definition.args; var ComponentClass = definition.ComponentClass; var positionalParams = ComponentClass.positionalParams; // The args being passed in are from the (component ...) invocation, // so the first positional argument is actually the name or component // definition. It needs to be dropped in order for any actual positional // args to coincide with the ComponentClass's positionParams. // For "normal" curly components this slicing is done at the syntax layer, // but we don't have that luxury here. var _newArgs$positional$values = newArgs.positional.values; var slicedPositionalArgs = _newArgs$positional$values.slice(1); if (positionalParams && slicedPositionalArgs.length) { _emberGlimmerSyntaxCurlyComponent.validatePositionalParameters(newArgs.named, slicedPositionalArgs, positionalParams); } var isRest = typeof positionalParams === 'string'; // For non-rest position params, we need to perform the position -> name mapping // at each layer to avoid a collision later when the args are used to construct // the component instance (inside of processArgs(), inside of create()). var positionalToNamedParams = {}; if (!isRest && positionalParams && positionalParams.length > 0) { var limit = Math.min(positionalParams.length, slicedPositionalArgs.length); for (var i = 0; i < limit; i++) { var _name = positionalParams[i]; positionalToNamedParams[_name] = slicedPositionalArgs[i]; } slicedPositionalArgs.length = 0; // Throw them away since you're merged in. } // args (aka 'oldArgs') may be undefined or simply be empty args, so // we need to fall back to an empty array or object. var oldNamed = args && args.named && args.named.map || {}; var oldPositional = args && args.positional && args.positional.values || []; // Merge positional arrays var mergedPositional = new Array(Math.max(oldPositional.length, slicedPositionalArgs.length)); mergedPositional.splice.apply(mergedPositional, [0, oldPositional.length].concat(oldPositional)); mergedPositional.splice.apply(mergedPositional, [0, slicedPositionalArgs.length].concat(slicedPositionalArgs)); // Merge named maps var mergedNamed = _emberMetal.assign({}, oldNamed, positionalToNamedParams, newArgs.named.map); var mergedArgs = _glimmerRuntime.EvaluatedArgs.create(_glimmerRuntime.EvaluatedPositionalArgs.create(mergedPositional), _glimmerRuntime.EvaluatedNamedArgs.create(mergedNamed)); return mergedArgs; } exports.default = function (vm, args, symbolTable) { return ClosureComponentReference.create(args, symbolTable, vm.env); }; }); enifed('ember-glimmer/helpers/concat', ['exports', 'ember-glimmer/utils/references', 'glimmer-runtime'], function (exports, _emberGlimmerUtilsReferences, _glimmerRuntime) { 'use strict'; /** @module ember @submodule ember-templates */ /** Concatenates the given arguments into a string. Example: ```handlebars {{some-component name=(concat firstName " " lastName)}} {{! would pass name=" " to the component}} ``` @public @method concat @for Ember.Templates.helpers @since 1.13.0 */ function concat(_ref) { var positional = _ref.positional; return positional.value().map(_glimmerRuntime.normalizeTextValue).join(''); } exports.default = function (vm, args) { return new _emberGlimmerUtilsReferences.InternalHelperReference(concat, args); }; }); enifed('ember-glimmer/helpers/debugger', ['exports', 'ember-metal/debug', 'glimmer-runtime'], function (exports, _emberMetalDebug, _glimmerRuntime) { /*jshint debug:true*/ /** @module ember @submodule ember-htmlbars */ 'use strict'; exports.default = debuggerHelper; exports.setDebuggerCallback = setDebuggerCallback; exports.resetDebuggerCallback = resetDebuggerCallback; /** Execute the `debugger` statement in the current template's context. ```handlebars {{debugger}} ``` When using the debugger helper you will have access to a `get` function. This function retrieves values available in the context of the template. For example, if you're wondering why a value `{{foo}}` isn't rendering as expected within a template, you could place a `{{debugger}}` statement and, when the `debugger;` breakpoint is hit, you can attempt to retrieve this value: ``` > get('foo') ``` `get` is also aware of block variables. So in this situation ```handlebars {{#each items as |item|}} {{debugger}} {{/each}} ``` You'll be able to get values from the current item: ``` > get('item.name') ``` You can also access the context of the view to make sure it is the object that you expect: ``` > context ``` @method debugger @for Ember.Templates.helpers @public */ function defaultCallback(context, get) { debugger; /* jshint debug: true */ } var callback = defaultCallback; function debuggerHelper(vm, args, symbolTable) { var context = vm.getSelf().value(); // Note: this is totally an overkill since we are only compiling // expressions, but this is the only kind of SymbolLookup we can // construct. The symbol table itself should really be sufficient // here – we should refactor the Glimmer code to make that possible. var symbolLookup = new _glimmerRuntime.CompileIntoList(vm.env, symbolTable); function get(path) { // Problem: technically, we are getting a `PublicVM` here, but to // evaluate an expression it requires the full VM. We happen to know // that they are the same thing, so this would work for now. However // this might break in the future. return _glimmerRuntime.GetSyntax.build(path).compile(symbolLookup).evaluate(vm).value(); } callback(context, get); return _glimmerRuntime.UNDEFINED_REFERENCE; } // These are exported for testing function setDebuggerCallback(newCallback) { callback = newCallback; } function resetDebuggerCallback() { callback = defaultCallback; } }); enifed('ember-glimmer/helpers/each-in', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-templates */ 'use strict'; exports.isEachIn = isEachIn; /** The `{{each-in}}` helper loops over properties on an object. For example, given a `user` object that looks like: ```javascript { "name": "Shelly Sails", "age": 42 } ``` This template would display all properties on the `user` object in a list: ```handlebars
      {{#each-in user as |key value|}}
    • {{key}}: {{value}}
    • {{/each-in}}
    ``` Outputting their name and age. @method each-in @for Ember.Templates.helpers @public @since 2.1.0 */ var EACH_IN_REFERENCE = _emberMetal.symbol('EACH_IN'); function isEachIn(ref) { return ref && ref[EACH_IN_REFERENCE]; } exports.default = function (vm, args) { var ref = Object.create(args.positional.at(0)); ref[EACH_IN_REFERENCE] = true; return ref; }; }); enifed('ember-glimmer/helpers/get', ['exports', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { 'use strict'; /** @module ember @submodule ember-templates */ /** Dynamically look up a property on an object. The second argument to `{{get}}` should have a string value, although it can be bound. For example, these two usages are equivilent: ```handlebars {{person.height}} {{get person "height"}} ``` If there were several facts about a person, the `{{get}}` helper can dynamically pick one: ```handlebars {{get person factName}} ``` For a more complex example, this template would allow the user to switch between showing the user's height and weight with a click: ```handlebars {{get person factName}} ``` The `{{get}}` helper can also respect mutable values itself. For example: ```handlebars {{input value=(mut (get person factName)) type="text"}} ``` Would allow the user to swap what fact is being displayed, and also edit that fact via a two-way mutable binding. @public @method get @for Ember.Templates.helpers @since 2.1.0 */ exports.default = function (vm, args) { return GetHelperReference.create(args.positional.at(0), args.positional.at(1)); }; var GetHelperReference = (function (_CachedReference) { babelHelpers.inherits(GetHelperReference, _CachedReference); GetHelperReference.create = function create(sourceReference, pathReference) { if (_glimmerReference.isConst(pathReference)) { var parts = pathReference.value().split('.'); return _glimmerReference.referenceFromParts(sourceReference, parts); } else { return new GetHelperReference(sourceReference, pathReference); } }; function GetHelperReference(sourceReference, pathReference) { _CachedReference.call(this); this.sourceReference = sourceReference; this.pathReference = pathReference; this.lastPath = null; this.innerReference = null; var innerTag = this.innerTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); this.tag = _glimmerReference.combine([sourceReference.tag, pathReference.tag, innerTag]); } GetHelperReference.prototype.compute = function compute() { var lastPath = this.lastPath; var innerReference = this.innerReference; var innerTag = this.innerTag; var path = this.lastPath = this.pathReference.value(); if (path !== lastPath) { if (path) { var pathType = typeof path; if (pathType === 'string') { innerReference = this.innerReference = _glimmerReference.referenceFromParts(this.sourceReference, path.split('.')); } else if (pathType === 'number') { innerReference = this.innerReference = this.sourceReference.get(path); } innerTag.update(innerReference.tag); } else { innerReference = this.innerReference = null; innerTag.update(_glimmerReference.CONSTANT_TAG); } } return innerReference ? innerReference.value() : null; }; GetHelperReference.prototype[_emberGlimmerUtilsReferences.UPDATE] = function (value) { _emberMetal.set(this.sourceReference.value(), this.pathReference.value(), value); }; return GetHelperReference; })(_emberGlimmerUtilsReferences.CachedReference); }); enifed("ember-glimmer/helpers/hash", ["exports"], function (exports) { /** @module ember @submodule ember-templates */ /** Use the `{{hash}}` helper to create a hash to pass as an option to your components. This is specially useful for contextual components where you can just yield a hash: ```handlebars {{yield (hash name='Sarah' title=office )}} ``` Would result in an object such as: ```js { name: 'Sarah', title: this.get('office') } ``` Where the `title` is bound to updates of the `office` property. @method hash @for Ember.Templates.helpers @param {Object} options @return {Object} Hash @public */ "use strict"; exports.default = function (vm, args) { return args.named; }; }); enifed('ember-glimmer/helpers/if-unless', ['exports', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { /** @module ember @submodule ember-templates */ 'use strict'; exports.inlineIf = inlineIf; exports.inlineUnless = inlineUnless; var ConditionalHelperReference = (function (_CachedReference) { babelHelpers.inherits(ConditionalHelperReference, _CachedReference); ConditionalHelperReference.create = function create(_condRef, _truthyRef, _falsyRef) { var condRef = _emberGlimmerUtilsReferences.ConditionalReference.create(_condRef); var truthyRef = _truthyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; var falsyRef = _falsyRef || _emberGlimmerUtilsReferences.UNDEFINED_REFERENCE; if (_glimmerReference.isConst(condRef)) { return condRef.value() ? truthyRef : falsyRef; } else { return new ConditionalHelperReference(condRef, truthyRef, falsyRef); } }; function ConditionalHelperReference(cond, truthy, falsy) { _CachedReference.call(this); this.branchTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); this.tag = _glimmerReference.combine([cond.tag, this.branchTag]); this.cond = cond; this.truthy = truthy; this.falsy = falsy; } /** The inline `if` helper conditionally renders a single property or string. This helper acts like a ternary operator. If the first property is truthy, the second argument will be displayed, otherwise, the third argument will be displayed ```handlebars {{if useLongGreeting "Hello" "Hi"}} Alex ``` You can use the `if` helper inside another helper as a subexpression. ```handlebars {{some-component height=(if isBig "100" "10")}} ``` @method if @for Ember.Templates.helpers @public */ ConditionalHelperReference.prototype.compute = function compute() { var cond = this.cond; var truthy = this.truthy; var falsy = this.falsy; var branch = cond.value() ? truthy : falsy; this.branchTag.update(branch.tag); return branch.value(); }; return ConditionalHelperReference; })(_emberGlimmerUtilsReferences.CachedReference); function inlineIf(vm, _ref) { var positional = _ref.positional; switch (positional.length) { case 2: return ConditionalHelperReference.create(positional.at(0), positional.at(1), null); case 3: return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2)); default: } } /** The inline `unless` helper conditionally renders a single property or string. This helper acts like a ternary operator. If the first property is falsy, the second argument will be displayed, otherwise, the third argument will be displayed ```handlebars {{unless useLongGreeting "Hi" "Hello"}} Ben ``` You can use the `unless` helper inside another helper as a subexpression. ```handlebars {{some-component height=(unless isBig "10" "100")}} ``` @method unless @for Ember.Templates.helpers @public */ function inlineUnless(vm, _ref2) { var positional = _ref2.positional; switch (positional.length) { case 2: return ConditionalHelperReference.create(positional.at(0), null, positional.at(1)); case 3: return ConditionalHelperReference.create(positional.at(0), positional.at(2), positional.at(1)); default: } } }); enifed('ember-glimmer/helpers/loc', ['exports', 'ember-glimmer/utils/references', 'ember-runtime'], function (exports, _emberGlimmerUtilsReferences, _emberRuntime) { 'use strict'; /** @module ember @submodule ember-templates */ /** Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the provided string. This is a convenient way to localize text within a template. For example: ```javascript Ember.STRINGS = { '_welcome_': 'Bonjour' }; ``` ```handlebars
    {{loc '_welcome_'}}
    ``` ```html
    Bonjour
    ``` See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to set up localized string references. @method loc @for Ember.Templates.helpers @param {String} str The string to format. @see {Ember.String#loc} @public */ function locHelper(_ref) { var positional = _ref.positional; return _emberRuntime.String.loc.apply(null, positional.value()); } exports.default = function (vm, args) { return new _emberGlimmerUtilsReferences.InternalHelperReference(locHelper, args); }; }); enifed('ember-glimmer/helpers/log', ['exports', 'ember-glimmer/utils/references', 'ember-console'], function (exports, _emberGlimmerUtilsReferences, _emberConsole) { 'use strict'; /** `log` allows you to output the value of variables in the current rendering context. `log` also accepts primitive types such as strings or numbers. ```handlebars {{log "myVariable:" myVariable }} ``` @method log @for Ember.Templates.helpers @param {Array} params @public */ function log(_ref) { var positional = _ref.positional; _emberConsole.default.log.apply(null, positional.value()); } exports.default = function (vm, args) { return new _emberGlimmerUtilsReferences.InternalHelperReference(log, args); }; }); /** @module ember @submodule ember-templates */ enifed('ember-glimmer/helpers/mut', ['exports', 'ember-metal', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/action'], function (exports, _emberMetal, _emberGlimmerUtilsReferences, _emberGlimmerHelpersAction) { 'use strict'; exports.isMut = isMut; exports.unMut = unMut; /** The `mut` helper lets you __clearly specify__ that a child `Component` can update the (mutable) value passed to it, which will __change the value of the parent component__. To specify that a parameter is mutable, when invoking the child `Component`: ```handlebars {{my-child childClickCount=(mut totalClicks)}} ``` The child `Component` can then modify the parent's value just by modifying its own property: ```javascript // my-child.js export default Component.extend({ click() { this.incrementProperty('childClickCount'); } }); ``` Additionally, the `mut` helper can be combined with the `action` helper to mutate a value. For example: ```handlebars {{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}} ``` The child `Component` would invoke the action with the new click value: ```javascript // my-child.js export default Component.extend({ click() { this.get('clickCountChange')(this.get('childClickCount') + 1); } }); ``` The `mut` helper changes the `totalClicks` value to what was provided as the action argument. @method mut @param {Object} [attr] the "two-way" attribute that can be modified. @for Ember.Templates.helpers @public */ var MUT_REFERENCE = _emberMetal.symbol('MUT'); var SOURCE = _emberMetal.symbol('SOURCE'); function isMut(ref) { return ref && ref[MUT_REFERENCE]; } function unMut(ref) { return ref[SOURCE] || ref; } exports.default = function (vm, args) { var rawRef = args.positional.at(0); if (isMut(rawRef)) { return rawRef; } // TODO: Improve this error message. This covers at least two distinct // cases: // // 1. (mut "not a path") – passing a literal, result from a helper // invocation, etc // // 2. (mut receivedValue) – passing a value received from the caller // that was originally derived from a literal, result from a helper // invocation, etc // // This message is alright for the first case, but could be quite // confusing for the second case. var wrappedRef = Object.create(rawRef); wrappedRef[SOURCE] = rawRef; wrappedRef[_emberGlimmerHelpersAction.INVOKE] = rawRef[_emberGlimmerUtilsReferences.UPDATE]; wrappedRef[MUT_REFERENCE] = true; return wrappedRef; }; }); enifed('ember-glimmer/helpers/query-param', ['exports', 'ember-glimmer/utils/references', 'ember-metal', 'ember-routing'], function (exports, _emberGlimmerUtilsReferences, _emberMetal, _emberRouting) { 'use strict'; function queryParams(_ref) { var positional = _ref.positional; var named = _ref.named; return _emberRouting.QueryParams.create({ values: _emberMetal.assign({}, named.value()) }); } exports.default = function (vm, args) { return new _emberGlimmerUtilsReferences.InternalHelperReference(queryParams, args); }; }); enifed('ember-glimmer/helpers/readonly', ['exports', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/mut'], function (exports, _emberGlimmerUtilsReferences, _emberGlimmerHelpersMut) { 'use strict'; exports.default = function (vm, args) { var ref = _emberGlimmerHelpersMut.unMut(args.positional.at(0)); var wrapped = Object.create(ref); wrapped[_emberGlimmerUtilsReferences.UPDATE] = undefined; return wrapped; }; }); enifed('ember-glimmer/helpers/unbound', ['exports', 'ember-metal', 'ember-glimmer/utils/references'], function (exports, _emberMetal, _emberGlimmerUtilsReferences) { /** @module ember @submodule ember-templates */ 'use strict'; /** The `{{unbound}}` helper disconnects the one-way binding of a property, essentially freezing its value at the moment of rendering. For example, in this example the display of the variable `name` will not change even if it is set with a new value: ```handlebars {{unbound name}} ``` Like any helper, the `unbound` helper can accept a nested helper expression. This allows for custom helpers to be rendered unbound: ```handlebars {{unbound (some-custom-helper)}} {{unbound (capitalize name)}} {{! You can use any helper, including unbound, in a nested expression }} {{capitalize (unbound name)}} ``` The `unbound` helper only accepts a single argument, and it return an unbound value. @method unbound @for Ember.Templates.helpers @public */ exports.default = function (vm, args) { return _emberGlimmerUtilsReferences.UnboundReference.create(args.positional.at(0).value()); }; }); enifed('ember-glimmer/index', ['exports', 'ember-glimmer/helpers/action', 'ember-glimmer/templates/root', 'ember-glimmer/syntax', 'ember-glimmer/template', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/helper', 'ember-glimmer/environment', 'ember-glimmer/make-bound-helper', 'ember-glimmer/utils/string', 'ember-glimmer/renderer', 'ember-glimmer/template_registry', 'ember-glimmer/setup-registry', 'ember-glimmer/dom'], function (exports, _emberGlimmerHelpersAction, _emberGlimmerTemplatesRoot, _emberGlimmerSyntax, _emberGlimmerTemplate, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerHelper, _emberGlimmerEnvironment, _emberGlimmerMakeBoundHelper, _emberGlimmerUtilsString, _emberGlimmerRenderer, _emberGlimmerTemplate_registry, _emberGlimmerSetupRegistry, _emberGlimmerDom) { 'use strict'; exports.INVOKE = _emberGlimmerHelpersAction.INVOKE; exports.RootTemplate = _emberGlimmerTemplatesRoot.default; exports.registerSyntax = _emberGlimmerSyntax.registerSyntax; exports.template = _emberGlimmerTemplate.default; exports.Checkbox = _emberGlimmerComponentsCheckbox.default; exports.TextField = _emberGlimmerComponentsText_field.default; exports.TextArea = _emberGlimmerComponentsText_area.default; exports.LinkComponent = _emberGlimmerComponentsLinkTo.default; exports.Component = _emberGlimmerComponent.default; exports.Helper = _emberGlimmerHelper.default; exports.helper = _emberGlimmerHelper.helper; exports.Environment = _emberGlimmerEnvironment.default; exports.makeBoundHelper = _emberGlimmerMakeBoundHelper.default; exports.SafeString = _emberGlimmerUtilsString.SafeString; exports.escapeExpression = _emberGlimmerUtilsString.escapeExpression; exports.htmlSafe = _emberGlimmerUtilsString.htmlSafe; exports.isHTMLSafe = _emberGlimmerUtilsString.isHTMLSafe; exports._getSafeString = _emberGlimmerUtilsString.getSafeString; exports.Renderer = _emberGlimmerRenderer.Renderer; exports.InertRenderer = _emberGlimmerRenderer.InertRenderer; exports.InteractiveRenderer = _emberGlimmerRenderer.InteractiveRenderer; exports.getTemplate = _emberGlimmerTemplate_registry.getTemplate; exports.setTemplate = _emberGlimmerTemplate_registry.setTemplate; exports.hasTemplate = _emberGlimmerTemplate_registry.hasTemplate; exports.getTemplates = _emberGlimmerTemplate_registry.getTemplates; exports.setTemplates = _emberGlimmerTemplate_registry.setTemplates; exports.setupEngineRegistry = _emberGlimmerSetupRegistry.setupEngineRegistry; exports.setupApplicationRegistry = _emberGlimmerSetupRegistry.setupApplicationRegistry; exports.DOMChanges = _emberGlimmerDom.DOMChanges; exports.NodeDOMTreeConstruction = _emberGlimmerDom.NodeDOMTreeConstruction; exports.DOMTreeConstruction = _emberGlimmerDom.DOMTreeConstruction; }); enifed('ember-glimmer/make-bound-helper', ['exports', 'ember-metal', 'ember-glimmer/helper'], function (exports, _emberMetal, _emberGlimmerHelper) { /** @module ember @submodule ember-templates */ 'use strict'; exports.default = makeBoundHelper; /** Create a bound helper. Accepts a function that receives the ordered and hash parameters from the template. If a bound property was provided in the template, it will be resolved to its value and any changes to the bound property cause the helper function to be re-run with the updated values. * `params` - An array of resolved ordered parameters. * `hash` - An object containing the hash parameters. For example: * With an unquoted ordered parameter: ```javascript {{x-capitalize foo}} ``` Assuming `foo` was set to `"bar"`, the bound helper would receive `["bar"]` as its first argument, and an empty hash as its second. * With a quoted ordered parameter: ```javascript {{x-capitalize "foo"}} ``` The bound helper would receive `["foo"]` as its first argument, and an empty hash as its second. * With an unquoted hash parameter: ```javascript {{x-repeat "foo" count=repeatCount}} ``` Assuming that `repeatCount` resolved to 2, the bound helper would receive `["foo"]` as its first argument, and { count: 2 } as its second. @private @method makeBoundHelper @for Ember.HTMLBars @param {Function} fn @since 1.10.0 */ function makeBoundHelper(fn) { return _emberGlimmerHelper.helper(fn); } }); enifed('ember-glimmer/modifiers/action', ['exports', 'ember-metal', 'ember-views', 'ember-glimmer/helpers/action'], function (exports, _emberMetal, _emberViews, _emberGlimmerHelpersAction) { 'use strict'; var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl']; var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/; function isAllowedEvent(event, allowedKeys) { if (allowedKeys === null || typeof allowedKeys === 'undefined') { if (POINTER_EVENT_TYPE_REGEX.test(event.type)) { return _emberViews.isSimpleClick(event); } else { allowedKeys = ''; } } if (allowedKeys.indexOf('any') >= 0) { return true; } for (var i = 0; i < MODIFIERS.length; i++) { if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) { return false; } } return true; } var ActionHelper = { // registeredActions is re-exported for compatibility with older plugins // that were using this undocumented API. registeredActions: _emberViews.ActionManager.registeredActions, registerAction: function (actionState) { var actionId = actionState.actionId; var actions = _emberViews.ActionManager.registeredActions[actionId]; if (!actions) { actions = _emberViews.ActionManager.registeredActions[actionId] = []; } actions.push(actionState); return actionId; }, unregisterAction: function (actionState) { var actionId = actionState.actionId; var actions = _emberViews.ActionManager.registeredActions[actionId]; var index = actions.indexOf(actionState); if (index !== -1) { actions.splice(index, 1); } if (actions.length === 0) { delete _emberViews.ActionManager.registeredActions[actionId]; } } }; exports.ActionHelper = ActionHelper; var ActionState = (function () { function ActionState(element, actionId, actionName, actionArgs, namedArgs, positionalArgs, implicitTarget, dom) { this.element = element; this.actionId = actionId; this.actionName = actionName; this.actionArgs = actionArgs; this.namedArgs = namedArgs; this.positional = positionalArgs; this.implicitTarget = implicitTarget; this.dom = dom; this.eventName = this.getEventName(); } // implements ModifierManager ActionState.prototype.getEventName = function getEventName() { return this.namedArgs.get('on').value() || 'click'; }; ActionState.prototype.getActionArgs = function getActionArgs() { var result = new Array(this.actionArgs.length); for (var i = 0; i < this.actionArgs.length; i++) { result[i] = this.actionArgs[i].value(); } return result; }; ActionState.prototype.getTarget = function getTarget() { var implicitTarget = this.implicitTarget; var namedArgs = this.namedArgs; var target = undefined; if (namedArgs.has('target')) { target = namedArgs.get('target').value(); } else { target = implicitTarget.value(); } return target; }; ActionState.prototype.handler = function handler(event) { var _this = this; var actionName = this.actionName; var namedArgs = this.namedArgs; var bubbles = namedArgs.get('bubbles'); var preventDefault = namedArgs.get('preventDefault'); var allowedKeys = namedArgs.get('allowedKeys'); var target = this.getTarget(); if (!isAllowedEvent(event, allowedKeys.value())) { return true; } if (preventDefault.value() !== false) { event.preventDefault(); } if (bubbles.value() === false) { event.stopPropagation(); } _emberMetal.run(function () { var args = _this.getActionArgs(); var payload = { args: args, target: target }; if (typeof actionName[_emberGlimmerHelpersAction.INVOKE] === 'function') { _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { actionName[_emberGlimmerHelpersAction.INVOKE].apply(actionName, args); }); return; } if (typeof actionName === 'function') { _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { actionName.apply(target, args); }); return; } payload.name = actionName; if (target.send) { _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { target.send.apply(target, [actionName].concat(args)); }); } else { _emberMetal.flaggedInstrument('interaction.ember-action', payload, function () { target[actionName].apply(target, args); }); } }); }; ActionState.prototype.destroy = function destroy() { ActionHelper.unregisterAction(this); }; return ActionState; })(); exports.ActionState = ActionState; var ActionModifierManager = (function () { function ActionModifierManager() {} ActionModifierManager.prototype.create = function create(element, args, dynamicScope, dom) { var named = args.named; var positional = args.positional; var implicitTarget = undefined; var actionName = undefined; var actionNameRef = undefined; if (positional.length > 1) { implicitTarget = positional.at(0); actionNameRef = positional.at(1); if (actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { actionName = actionNameRef; } else { var actionLabel = actionNameRef._propertyKey; actionName = actionNameRef.value(); } } var actionArgs = []; // The first two arguments are (1) `this` and (2) the action name. // Everything else is a param. for (var i = 2; i < positional.length; i++) { actionArgs.push(positional.at(i)); } var actionId = _emberMetal.uuid(); return new ActionState(element, actionId, actionName, actionArgs, named, positional, implicitTarget, dom); }; ActionModifierManager.prototype.install = function install(actionState) { var dom = actionState.dom; var element = actionState.element; var actionId = actionState.actionId; ActionHelper.registerAction(actionState); dom.setAttribute(element, 'data-ember-action', ''); dom.setAttribute(element, 'data-ember-action-' + actionId, actionId); }; ActionModifierManager.prototype.update = function update(actionState) { var positional = actionState.positional; var actionNameRef = positional.at(1); if (!actionNameRef[_emberGlimmerHelpersAction.INVOKE]) { actionState.actionName = actionNameRef.value(); } actionState.eventName = actionState.getEventName(); // Not sure if this is needed? If we mutate the actionState is that good enough? ActionHelper.unregisterAction(actionState); ActionHelper.registerAction(actionState); }; ActionModifierManager.prototype.getDestructor = function getDestructor(modifier) { return modifier; }; return ActionModifierManager; })(); exports.default = ActionModifierManager; }); enifed('ember-glimmer/protocol-for-url', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { /* globals module, URL */ 'use strict'; exports.default = installProtocolForURL; var nodeURL = undefined; var parsingNode = undefined; function installProtocolForURL(environment) { var protocol = undefined; if (_emberEnvironment.environment.hasDOM) { protocol = browserProtocolForURL.call(environment, 'foobar:baz'); } // Test to see if our DOM implementation parses // and normalizes URLs. if (protocol === 'foobar:') { // Swap in the method that doesn't do this test now that // we know it works. environment.protocolForURL = browserProtocolForURL; } else if (typeof URL === 'object') { // URL globally provided, likely from FastBoot's sandbox nodeURL = URL; environment.protocolForURL = nodeProtocolForURL; } else if (typeof module === 'object' && typeof module.require === 'function') { // Otherwise, we need to fall back to our own URL parsing. // Global `require` is shadowed by Ember's loader so we have to use the fully // qualified `module.require`. nodeURL = module.require('url'); environment.protocolForURL = nodeProtocolForURL; } else { throw new Error('Could not find valid URL parsing mechanism for URL Sanitization'); } } function browserProtocolForURL(url) { if (!parsingNode) { parsingNode = document.createElement('a'); } parsingNode.href = url; return parsingNode.protocol; } function nodeProtocolForURL(url) { var protocol = null; if (typeof url === 'string') { protocol = nodeURL.parse(url).protocol; } return protocol === null ? ':' : protocol; } }); enifed('ember-glimmer/renderer', ['exports', 'ember-glimmer/utils/references', 'ember-metal', 'glimmer-reference', 'ember-views', 'ember-glimmer/component', 'ember-glimmer/syntax/curly-component'], function (exports, _emberGlimmerUtilsReferences, _emberMetal, _glimmerReference, _emberViews, _emberGlimmerComponent, _emberGlimmerSyntaxCurlyComponent) { 'use strict'; var runInTransaction = undefined; if (_emberMetal.isFeatureEnabled('ember-glimmer-detect-backtracking-rerender') || _emberMetal.isFeatureEnabled('ember-glimmer-allow-backtracking-rerender')) { runInTransaction = _emberMetal.runInTransaction; } else { runInTransaction = function (context, methodName) { context[methodName](); return false; }; } var backburner = _emberMetal.run.backburner; var DynamicScope = (function () { function DynamicScope(view, outletState, rootOutletState, isTopLevel, targetObject) { this.view = view; this.outletState = outletState; this.rootOutletState = rootOutletState; this.isTopLevel = isTopLevel; } DynamicScope.prototype.child = function child() { return new DynamicScope(this.view, this.outletState, this.rootOutletState, this.isTopLevel); }; DynamicScope.prototype.get = function get(key) { return this[key]; }; DynamicScope.prototype.set = function set(key, value) { this[key] = value; return value; }; return DynamicScope; })(); var RootState = (function () { function RootState(root, env, template, self, parentElement, dynamicScope) { var _this = this; this.id = _emberViews.getViewId(root); this.env = env; this.root = root; this.result = undefined; this.shouldReflush = false; var options = this.options = { alwaysRevalidate: false }; this.render = function () { var result = _this.result = template.render(self, parentElement, dynamicScope); // override .render function after initial render _this.render = function () { result.rerender(options); }; }; } RootState.prototype.isFor = function isFor(possibleRoot) { return this.root === possibleRoot; }; RootState.prototype.destroy = function destroy() { var result = this.result; var env = this.env; this.env = null; this.root = null; this.result = null; this.render = null; if (result) { /* Handles these scenarios: * When roots are removed during standard rendering process, a transaction exists already `.begin()` / `.commit()` are not needed. * When roots are being destroyed manually (`component.append(); component.destroy() case), no transaction exists already. * When roots are being destroyed during `Renderer#destroy`, no transaction exists */ var needsTransaction = !env.inTransaction; if (needsTransaction) { env.begin(); } result.destroy(); if (needsTransaction) { env.commit(); } } }; return RootState; })(); var renderers = []; _emberMetal.setHasViews(function () { return renderers.length > 0; }); function register(renderer) { renderers.push(renderer); } function deregister(renderer) { var index = renderers.indexOf(renderer); renderers.splice(index, 1); } function loopBegin() { for (var i = 0; i < renderers.length; i++) { renderers[i]._scheduleRevalidate(); } } function K() {} var loops = 0; function loopEnd(current, next) { for (var i = 0; i < renderers.length; i++) { if (!renderers[i]._isValid()) { if (loops > 10) { loops = 0; // TODO: do something better renderers[i].destroy(); throw new Error('infinite rendering invalidation detected'); } loops++; return backburner.join(null, K); } } loops = 0; } backburner.on('begin', loopBegin); backburner.on('end', loopEnd); var Renderer = (function () { function Renderer(env, rootTemplate) { var _viewRegistry = arguments.length <= 2 || arguments[2] === undefined ? _emberViews.fallbackViewRegistry : arguments[2]; var destinedForDOM = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3]; this._env = env; this._rootTemplate = rootTemplate; this._viewRegistry = _viewRegistry; this._destinedForDOM = destinedForDOM; this._destroyed = false; this._roots = []; this._lastRevision = null; } // renderer HOOKS Renderer.prototype.appendOutletView = function appendOutletView(view, target) { var self = new _emberGlimmerUtilsReferences.RootReference(view); var targetObject = view.outletState.render.controller; var ref = view.toReference(); var dynamicScope = new DynamicScope(null, ref, ref, true, targetObject); var root = new RootState(view, this._env, view.template, self, target, dynamicScope); this._renderRoot(root); }; Renderer.prototype.appendTo = function appendTo(view, target) { var rootDef = new _emberGlimmerSyntaxCurlyComponent.RootComponentDefinition(view); var self = new _emberGlimmerUtilsReferences.RootReference(rootDef); var dynamicScope = new DynamicScope(null, _glimmerReference.UNDEFINED_REFERENCE, _glimmerReference.UNDEFINED_REFERENCE, true, null); var root = new RootState(view, this._env, this._rootTemplate, self, target, dynamicScope); this._renderRoot(root); }; Renderer.prototype.rerender = function rerender(view) { this._scheduleRevalidate(); }; Renderer.prototype.componentInitAttrs = function componentInitAttrs() { // TODO: Remove me }; Renderer.prototype.ensureViewNotRendering = function ensureViewNotRendering() { // TODO: Implement this // throw new Error('Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.'); }; Renderer.prototype.register = function register(view) { var id = _emberViews.getViewId(view); this._viewRegistry[id] = view; }; Renderer.prototype.unregister = function unregister(view) { delete this._viewRegistry[_emberViews.getViewId(view)]; }; Renderer.prototype.remove = function remove(view) { view._transitionTo('destroying'); view.element = null; if (this._env.isInteractive) { view.trigger('didDestroyElement'); } this.cleanupRootFor(view); if (!view.isDestroying) { view.destroy(); } }; Renderer.prototype.cleanupRootFor = function cleanupRootFor(view) { // no need to cleanup roots if we have already been destroyed if (this._destroyed) { return; } var roots = this._roots; // traverse in reverse so we can remove items // without mucking up the index var i = this._roots.length; while (i--) { var root = roots[i]; // check if the view being removed is a root view if (root.isFor(view)) { root.destroy(); roots.splice(i, 1); } } if (this._roots.length === 0) { deregister(this); } }; Renderer.prototype.destroy = function destroy() { if (this._destroyed) { return; } this._destroyed = true; this._clearAllRoots(); }; Renderer.prototype.getBounds = function getBounds(view) { var bounds = view[_emberGlimmerComponent.BOUNDS]; var parentElement = bounds.parentElement(); var firstNode = bounds.firstNode(); var lastNode = bounds.lastNode(); return { parentElement: parentElement, firstNode: firstNode, lastNode: lastNode }; }; Renderer.prototype.createElement = function createElement(tagName) { return this._env.getAppendOperations().createElement(tagName); }; Renderer.prototype._renderRoot = function _renderRoot(root) { var roots = this._roots; roots.push(root); if (roots.length === 1) { register(this); } this._renderRootsTransaction(); }; Renderer.prototype._renderRoots = function _renderRoots() { var roots = this._roots; var env = this._env; var globalShouldReflush = undefined; // ensure that for the first iteration of the loop // each root is processed var initial = true; do { env.begin(); globalShouldReflush = false; for (var i = 0; i < roots.length; i++) { var root = roots[i]; var shouldReflush = root.shouldReflush; // when processing non-initial reflush loops, // do not process more roots than needed if (!initial && !shouldReflush) { continue; } root.options.alwaysRevalidate = shouldReflush; // track shouldReflush based on this roots render result shouldReflush = root.shouldReflush = runInTransaction(root, 'render'); // globalShouldReflush should be `true` if *any* of // the roots need to reflush globalShouldReflush = globalShouldReflush || shouldReflush; } this._lastRevision = _glimmerReference.CURRENT_TAG.value(); env.commit(); initial = false; } while (globalShouldReflush); }; Renderer.prototype._renderRootsTransaction = function _renderRootsTransaction() { try { this._renderRoots(); } catch (e) { this.destroy(); throw e; } }; Renderer.prototype._clearAllRoots = function _clearAllRoots() { var roots = this._roots; for (var i = 0; i < roots.length; i++) { var root = roots[i]; root.destroy(); } this._roots = null; if (roots.length) { deregister(this); } }; Renderer.prototype._scheduleRevalidate = function _scheduleRevalidate() { backburner.scheduleOnce('render', this, this._revalidate); }; Renderer.prototype._isValid = function _isValid() { return this._destroyed || this._roots.length === 0 || _glimmerReference.CURRENT_TAG.validate(this._lastRevision); }; Renderer.prototype._revalidate = function _revalidate() { if (this._isValid()) { return; } this._renderRootsTransaction(); }; return Renderer; })(); exports.Renderer = Renderer; var InertRenderer = { create: function (_ref) { var env = _ref.env; var rootTemplate = _ref.rootTemplate; var _viewRegistry = _ref._viewRegistry; return new Renderer(env, rootTemplate, _viewRegistry, false); } }; exports.InertRenderer = InertRenderer; var InteractiveRenderer = { create: function (_ref2) { var env = _ref2.env; var rootTemplate = _ref2.rootTemplate; var _viewRegistry = _ref2._viewRegistry; return new Renderer(env, rootTemplate, _viewRegistry, true); } }; exports.InteractiveRenderer = InteractiveRenderer; }); enifed('ember-glimmer/setup-registry', ['exports', 'ember-environment', 'container', 'ember-glimmer/renderer', 'ember-glimmer/dom', 'ember-glimmer/views/outlet', 'ember-glimmer/components/text_field', 'ember-glimmer/components/text_area', 'ember-glimmer/components/checkbox', 'ember-glimmer/components/link-to', 'ember-glimmer/component', 'ember-glimmer/templates/component', 'ember-glimmer/templates/root', 'ember-glimmer/templates/outlet', 'ember-glimmer/environment'], function (exports, _emberEnvironment, _container, _emberGlimmerRenderer, _emberGlimmerDom, _emberGlimmerViewsOutlet, _emberGlimmerComponentsText_field, _emberGlimmerComponentsText_area, _emberGlimmerComponentsCheckbox, _emberGlimmerComponentsLinkTo, _emberGlimmerComponent, _emberGlimmerTemplatesComponent, _emberGlimmerTemplatesRoot, _emberGlimmerTemplatesOutlet, _emberGlimmerEnvironment) { 'use strict'; exports.setupApplicationRegistry = setupApplicationRegistry; exports.setupEngineRegistry = setupEngineRegistry; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:-root'], ['template:-root']), _templateObject2 = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']), _templateObject3 = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); function setupApplicationRegistry(registry) { registry.injection('service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); registry.injection('renderer', 'env', 'service:-glimmer-environment'); registry.register(_container.privatize(_templateObject), _emberGlimmerTemplatesRoot.default); registry.injection('renderer', 'rootTemplate', _container.privatize(_templateObject)); registry.register('renderer:-dom', _emberGlimmerRenderer.InteractiveRenderer); registry.register('renderer:-inert', _emberGlimmerRenderer.InertRenderer); if (_emberEnvironment.environment.hasDOM) { registry.injection('service:-glimmer-environment', 'updateOperations', 'service:-dom-changes'); } registry.register('service:-dom-changes', { create: function (_ref) { var document = _ref.document; return new _emberGlimmerDom.DOMChanges(document); } }); registry.register('service:-dom-tree-construction', { create: function (_ref2) { var document = _ref2.document; var Implementation = _emberEnvironment.environment.hasDOM ? _emberGlimmerDom.DOMTreeConstruction : _emberGlimmerDom.NodeDOMTreeConstruction; return new Implementation(document); } }); } function setupEngineRegistry(registry) { registry.register('view:-outlet', _emberGlimmerViewsOutlet.default); registry.register('template:-outlet', _emberGlimmerTemplatesOutlet.default); registry.injection('view:-outlet', 'template', 'template:-outlet'); registry.injection('service:-dom-changes', 'document', 'service:-document'); registry.injection('service:-dom-tree-construction', 'document', 'service:-document'); registry.register(_container.privatize(_templateObject2), _emberGlimmerTemplatesComponent.default); registry.register('service:-glimmer-environment', _emberGlimmerEnvironment.default); registry.injection('template', 'env', 'service:-glimmer-environment'); registry.optionsForType('helper', { instantiate: false }); registry.register('component:-text-field', _emberGlimmerComponentsText_field.default); registry.register('component:-text-area', _emberGlimmerComponentsText_area.default); registry.register('component:-checkbox', _emberGlimmerComponentsCheckbox.default); registry.register('component:link-to', _emberGlimmerComponentsLinkTo.default); registry.register(_container.privatize(_templateObject3), _emberGlimmerComponent.default); } }); enifed('ember-glimmer/syntax', ['exports', 'ember-glimmer/syntax/render', 'ember-glimmer/syntax/outlet', 'ember-glimmer/syntax/mount', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/syntax/input', 'glimmer-runtime'], function (exports, _emberGlimmerSyntaxRender, _emberGlimmerSyntaxOutlet, _emberGlimmerSyntaxMount, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerSyntaxInput, _glimmerRuntime) { 'use strict'; exports.registerSyntax = registerSyntax; exports.findSyntaxBuilder = findSyntaxBuilder; var syntaxKeys = []; var syntaxes = []; function registerSyntax(key, syntax) { syntaxKeys.push(key); syntaxes.push(syntax); } function findSyntaxBuilder(key) { var index = syntaxKeys.indexOf(key); if (index > -1) { return syntaxes[index]; } } registerSyntax('render', _emberGlimmerSyntaxRender.RenderSyntax); registerSyntax('outlet', _emberGlimmerSyntaxOutlet.OutletSyntax); registerSyntax('mount', _emberGlimmerSyntaxMount.MountSyntax); registerSyntax('component', _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax); registerSyntax('input', _emberGlimmerSyntaxInput.InputSyntax); registerSyntax('-with-dynamic-vars', (function () { function _class() {} _class.create = function create(environment, args, templates, symbolTable) { return new _glimmerRuntime.WithDynamicVarsSyntax({ args: args, templates: templates }); }; return _class; })()); }); enifed('ember-glimmer/syntax/curly-component', ['exports', 'glimmer-runtime', 'ember-glimmer/utils/bindings', 'ember-glimmer/component', 'ember-metal', 'ember-glimmer/utils/process-args', 'container'], function (exports, _glimmerRuntime, _emberGlimmerUtilsBindings, _emberGlimmerComponent, _emberMetal, _emberGlimmerUtilsProcessArgs, _container) { 'use strict'; exports.validatePositionalParameters = validatePositionalParameters; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['template:components/-default'], ['template:components/-default']); var DEFAULT_LAYOUT = _container.privatize(_templateObject); function processComponentInitializationAssertions(component, props) {} function validatePositionalParameters(named, positional, positionalParamsDefinition) {} function aliasIdToElementId(args, props) { if (args.named.has('id')) { props.elementId = props.id; } } // We must traverse the attributeBindings in reverse keeping track of // what has already been applied. This is essentially refining the concated // properties applying right to left. function applyAttributeBindings(element, attributeBindings, component, operations) { var seen = []; var i = attributeBindings.length - 1; while (i !== -1) { var binding = attributeBindings[i]; var parsed = _emberGlimmerUtilsBindings.AttributeBinding.parse(binding); var attribute = parsed[1]; if (seen.indexOf(attribute) === -1) { seen.push(attribute); _emberGlimmerUtilsBindings.AttributeBinding.install(element, component, parsed, operations); } i--; } if (seen.indexOf('id') === -1) { operations.addStaticAttribute(element, 'id', component.elementId); } if (seen.indexOf('style') === -1) { _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); } } var CurlyComponentSyntax = (function (_StatementSyntax) { babelHelpers.inherits(CurlyComponentSyntax, _StatementSyntax); function CurlyComponentSyntax(args, definition, templates, symbolTable) { _StatementSyntax.call(this); this.args = args; this.definition = definition; this.templates = templates; this.symbolTable = symbolTable; this.shadow = null; } CurlyComponentSyntax.prototype.compile = function compile(builder) { builder.component.static(this.definition, this.args, this.templates, this.symbolTable, this.shadow); }; return CurlyComponentSyntax; })(_glimmerRuntime.StatementSyntax); exports.CurlyComponentSyntax = CurlyComponentSyntax; function NOOP() {} var ComponentStateBucket = (function () { function ComponentStateBucket(environment, component, args, finalizer) { this.environment = environment; this.component = component; this.classRef = null; this.args = args; this.argsRevision = args.tag.value(); this.finalizer = finalizer; } ComponentStateBucket.prototype.destroy = function destroy() { var component = this.component; var environment = this.environment; if (environment.isInteractive) { component.trigger('willDestroyElement'); component.trigger('willClearRender'); } environment.destroyedComponents.push(component); }; ComponentStateBucket.prototype.finalize = function finalize() { var finalizer = this.finalizer; finalizer(); this.finalizer = NOOP; }; return ComponentStateBucket; })(); function initialRenderInstrumentDetails(component) { return component.instrumentDetails({ initialRender: true }); } function rerenderInstrumentDetails(component) { return component.instrumentDetails({ initialRender: false }); } var CurlyComponentManager = (function () { function CurlyComponentManager() {} CurlyComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { validatePositionalParameters(args.named, args.positional.values, definition.ComponentClass.positionalParams); if (definition.args) { var newNamed = args.named.map; var newPositional = args.positional.values; var oldNamed = definition.args.named.map; var oldPositional = definition.args.positional.values; // Merge positional arrays var mergedPositional = []; mergedPositional.push.apply(mergedPositional, oldPositional); mergedPositional.splice.apply(mergedPositional, [0, newPositional.length].concat(newPositional)); // Merge named maps var mergedNamed = _emberMetal.assign({}, oldNamed, newNamed); // THOUGHT: It might be nice to have a static method on EvaluatedArgs that // can merge two sets of args for us. var mergedArgs = _glimmerRuntime.EvaluatedArgs.create(_glimmerRuntime.EvaluatedPositionalArgs.create(mergedPositional), _glimmerRuntime.EvaluatedNamedArgs.create(mergedNamed)); return mergedArgs; } return args; }; CurlyComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, callerSelfRef, hasBlock) { var parentView = dynamicScope.view; var klass = definition.ComponentClass; var processedArgs = _emberGlimmerUtilsProcessArgs.default(args, klass.positionalParams); var _processedArgs$value = processedArgs.value(); var attrs = _processedArgs$value.attrs; var props = _processedArgs$value.props; aliasIdToElementId(args, props); props.parentView = parentView; props[_emberGlimmerComponent.HAS_BLOCK] = hasBlock; props._targetObject = callerSelfRef.value(); var component = klass.create(props); var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); dynamicScope.view = component; if (parentView !== null) { parentView.appendChild(component); } component.trigger('didInitAttrs', { attrs: attrs }); component.trigger('didReceiveAttrs', { newAttrs: attrs }); if (environment.isInteractive) { component.trigger('willInsertElement'); } component.trigger('willRender'); var bucket = new ComponentStateBucket(environment, component, processedArgs, finalizer); if (args.named.has('class')) { bucket.classRef = args.named.get('class'); } processComponentInitializationAssertions(component, props); return bucket; }; CurlyComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { var template = definition.template; if (!template) { var component = bucket.component; template = this.templateFor(component, env); } return env.getCompiledBlock(CurlyComponentLayoutCompiler, template); }; CurlyComponentManager.prototype.templateFor = function templateFor(component, env) { var Template = component.layout; var owner = component[_container.OWNER]; if (Template) { return env.getTemplate(Template, owner); } var layoutName = _emberMetal.get(component, 'layoutName'); if (layoutName) { var template = owner.lookup('template:' + layoutName); if (template) { return template; } } return owner.lookup(DEFAULT_LAYOUT); }; CurlyComponentManager.prototype.getSelf = function getSelf(_ref) { var component = _ref.component; return component[_emberGlimmerComponent.ROOT_REF]; }; CurlyComponentManager.prototype.didCreateElement = function didCreateElement(_ref2, element, operations) { var component = _ref2.component; var classRef = _ref2.classRef; component.element = element; var attributeBindings = component.attributeBindings; var classNames = component.classNames; var classNameBindings = component.classNameBindings; if (attributeBindings && attributeBindings.length) { applyAttributeBindings(element, attributeBindings, component, operations); } else { operations.addStaticAttribute(element, 'id', component.elementId); _emberGlimmerUtilsBindings.IsVisibleBinding.install(element, component, operations); } if (classRef) { operations.addDynamicAttribute(element, 'class', classRef); } if (classNames && classNames.length) { classNames.forEach(function (name) { operations.addStaticAttribute(element, 'class', name); }); } if (classNameBindings && classNameBindings.length) { classNameBindings.forEach(function (binding) { _emberGlimmerUtilsBindings.ClassNameBinding.install(element, component, binding, operations); }); } component._transitionTo('hasElement'); }; CurlyComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket, bounds) { bucket.component[_emberGlimmerComponent.BOUNDS] = bounds; bucket.finalize(); }; CurlyComponentManager.prototype.getTag = function getTag(_ref3) { var component = _ref3.component; return component[_emberGlimmerComponent.DIRTY_TAG]; }; CurlyComponentManager.prototype.didCreate = function didCreate(_ref4) { var component = _ref4.component; var environment = _ref4.environment; if (environment.isInteractive) { component.trigger('didInsertElement'); component.trigger('didRender'); component._transitionTo('inDOM'); } }; CurlyComponentManager.prototype.update = function update(bucket, _, dynamicScope) { var component = bucket.component; var args = bucket.args; var argsRevision = bucket.argsRevision; bucket.finalizer = _emberMetal._instrumentStart('render.component', rerenderInstrumentDetails, component); if (!args.tag.validate(argsRevision)) { var _args$value = args.value(); var attrs = _args$value.attrs; var props = _args$value.props; bucket.argsRevision = args.tag.value(); var oldAttrs = component.attrs; var newAttrs = attrs; component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = true; component.setProperties(props); component[_emberGlimmerComponent.IS_DISPATCHING_ATTRS] = false; component.trigger('didUpdateAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); component.trigger('didReceiveAttrs', { oldAttrs: oldAttrs, newAttrs: newAttrs }); } component.trigger('willUpdate'); component.trigger('willRender'); }; CurlyComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) { bucket.finalize(); }; CurlyComponentManager.prototype.didUpdate = function didUpdate(_ref5) { var component = _ref5.component; var environment = _ref5.environment; if (environment.isInteractive) { component.trigger('didUpdate'); component.trigger('didRender'); } }; CurlyComponentManager.prototype.getDestructor = function getDestructor(stateBucket) { return stateBucket; }; return CurlyComponentManager; })(); var MANAGER = new CurlyComponentManager(); var TopComponentManager = (function (_CurlyComponentManager) { babelHelpers.inherits(TopComponentManager, _CurlyComponentManager); function TopComponentManager() { _CurlyComponentManager.apply(this, arguments); } TopComponentManager.prototype.create = function create(environment, definition, args, dynamicScope, currentScope, hasBlock) { var component = definition.ComponentClass; var finalizer = _emberMetal._instrumentStart('render.component', initialRenderInstrumentDetails, component); dynamicScope.view = component; component.trigger('didInitAttrs'); component.trigger('didReceiveAttrs'); if (environment.isInteractive) { component.trigger('willInsertElement'); } component.trigger('willRender'); processComponentInitializationAssertions(component, {}); return new ComponentStateBucket(environment, component, args, finalizer); }; return TopComponentManager; })(CurlyComponentManager); var ROOT_MANAGER = new TopComponentManager(); function tagName(vm) { var tagName = vm.dynamicScope().view.tagName; return new _glimmerRuntime.ValueReference(tagName === '' ? null : tagName || 'div'); } function ariaRole(vm) { return vm.getSelf().get('ariaRole'); } var CurlyComponentDefinition = (function (_ComponentDefinition) { babelHelpers.inherits(CurlyComponentDefinition, _ComponentDefinition); function CurlyComponentDefinition(name, ComponentClass, template, args) { _ComponentDefinition.call(this, name, MANAGER, ComponentClass); this.template = template; this.args = args; } return CurlyComponentDefinition; })(_glimmerRuntime.ComponentDefinition); exports.CurlyComponentDefinition = CurlyComponentDefinition; var RootComponentDefinition = (function (_ComponentDefinition2) { babelHelpers.inherits(RootComponentDefinition, _ComponentDefinition2); function RootComponentDefinition(instance) { _ComponentDefinition2.call(this, '-root', ROOT_MANAGER, instance); this.template = undefined; this.args = undefined; } return RootComponentDefinition; })(_glimmerRuntime.ComponentDefinition); exports.RootComponentDefinition = RootComponentDefinition; var CurlyComponentLayoutCompiler = (function () { function CurlyComponentLayoutCompiler(template) { this.template = template; } CurlyComponentLayoutCompiler.prototype.compile = function compile(builder) { builder.wrapLayout(this.template.asLayout()); builder.tag.dynamic(tagName); builder.attrs.dynamic('role', ariaRole); builder.attrs.static('class', 'ember-view'); }; return CurlyComponentLayoutCompiler; })(); CurlyComponentLayoutCompiler.id = 'curly'; }); enifed('ember-glimmer/syntax/dynamic-component', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal) { 'use strict'; function dynamicComponentFor(vm, symbolTable) { var env = vm.env; var args = vm.getArgs(); var nameRef = args.positional.at(0); return new DynamicComponentReference({ nameRef: nameRef, env: env, symbolTable: symbolTable }); } var DynamicComponentSyntax = (function (_StatementSyntax) { babelHelpers.inherits(DynamicComponentSyntax, _StatementSyntax); // for {{component componentName}} DynamicComponentSyntax.create = function create(environment, args, templates, symbolTable) { var definitionArgs = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(0, 1)); var invocationArgs = _glimmerRuntime.ArgsSyntax.build(args.positional.slice(1), args.named); return new this(definitionArgs, invocationArgs, templates, symbolTable); }; // Transforms {{foo.bar with=args}} or {{#foo.bar with=args}}{{/foo.bar}} // into {{component foo.bar with=args}} or // {{#component foo.bar with=args}}{{/component}} // with all of it's arguments DynamicComponentSyntax.fromPath = function fromPath(environment, path, args, templates, symbolTable) { var positional = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(_glimmerRuntime.PositionalArgsSyntax.build([_glimmerRuntime.GetSyntax.build(path.join('.'))])); return new this(positional, args, templates, symbolTable); }; function DynamicComponentSyntax(definitionArgs, args, templates, symbolTable) { _StatementSyntax.call(this); this.definition = dynamicComponentFor; this.definitionArgs = definitionArgs; this.args = args; this.templates = templates; this.symbolTable = symbolTable; this.shadow = null; } DynamicComponentSyntax.prototype.compile = function compile(builder) { builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.templates, this.symbolTable, this.shadow); }; return DynamicComponentSyntax; })(_glimmerRuntime.StatementSyntax); exports.DynamicComponentSyntax = DynamicComponentSyntax; var DynamicComponentReference = (function () { function DynamicComponentReference(_ref) { var nameRef = _ref.nameRef; var env = _ref.env; var symbolTable = _ref.symbolTable; var args = _ref.args; this.tag = nameRef.tag; this.nameRef = nameRef; this.env = env; this.symbolTable = symbolTable; this.args = args; } DynamicComponentReference.prototype.value = function value() { var env = this.env; var nameRef = this.nameRef; var symbolTable = this.symbolTable; var nameOrDef = nameRef.value(); if (typeof nameOrDef === 'string') { var definition = env.getComponentDefinition([nameOrDef], symbolTable); return definition; } else if (_glimmerRuntime.isComponentDefinition(nameOrDef)) { return nameOrDef; } else { return null; } }; DynamicComponentReference.prototype.get = function get() { return _glimmerReference.UNDEFINED_REFERENCE; }; return DynamicComponentReference; })(); }); enifed('ember-glimmer/syntax/input', ['exports', 'ember-metal', 'ember-glimmer/syntax/curly-component', 'ember-glimmer/syntax/dynamic-component', 'ember-glimmer/utils/bindings'], function (exports, _emberMetal, _emberGlimmerSyntaxCurlyComponent, _emberGlimmerSyntaxDynamicComponent, _emberGlimmerUtilsBindings) { 'use strict'; function buildTextFieldSyntax(args, templates, getDefinition, symbolTable) { var definition = getDefinition('-text-field'); _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, templates, symbolTable); } var InputSyntax = { create: function (environment, args, templates, symbolTable) { var getDefinition = function (path) { return environment.getComponentDefinition([path], symbolTable); }; if (args.named.has('type')) { var typeArg = args.named.at('type'); if (typeArg.type === 'value') { if (typeArg.value === 'checkbox') { _emberGlimmerUtilsBindings.wrapComponentClassAttribute(args); var definition = getDefinition('-checkbox'); return new _emberGlimmerSyntaxCurlyComponent.CurlyComponentSyntax(args, definition, templates, symbolTable); } else { return buildTextFieldSyntax(args, templates, getDefinition, symbolTable); } } } else { return buildTextFieldSyntax(args, templates, getDefinition, symbolTable); } return _emberGlimmerSyntaxDynamicComponent.DynamicComponentSyntax.create(environment, args, templates, symbolTable); } }; exports.InputSyntax = InputSyntax; }); enifed('ember-glimmer/syntax/mount', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet) { 'use strict'; var MountSyntax = (function (_StatementSyntax) { babelHelpers.inherits(MountSyntax, _StatementSyntax); MountSyntax.create = function create(env, args, templates, symbolTable) { var name = args.positional.at(0).inner(); var definition = new MountDefinition(name, env); return new MountSyntax(definition, symbolTable); }; function MountSyntax(definition, symbolTable) { _StatementSyntax.call(this); this.definition = definition; this.symbolTable = symbolTable; } MountSyntax.prototype.compile = function compile(builder) { builder.component.static(this.definition, _glimmerRuntime.ArgsSyntax.empty(), null, this.symbolTable, null); }; return MountSyntax; })(_glimmerRuntime.StatementSyntax); exports.MountSyntax = MountSyntax; var MountManager = (function () { function MountManager() {} MountManager.prototype.prepareArgs = function prepareArgs(definition, args) { return args; }; MountManager.prototype.create = function create(environment, _ref, args, dynamicScope) { var name = _ref.name; var env = _ref.env; dynamicScope.outletState = _glimmerReference.UNDEFINED_REFERENCE; var engine = env.owner.buildChildEngineInstance(name); engine.boot(); return { engine: engine }; }; MountManager.prototype.layoutFor = function layoutFor(definition, _ref2, env) { var engine = _ref2.engine; var template = engine.lookup('template:application'); return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, template, engine); }; MountManager.prototype.getSelf = function getSelf(_ref3) { var engine = _ref3.engine; var factory = engine._lookupFactory('controller:application') || _emberRouting.generateControllerFactory(engine, 'application'); return new _emberGlimmerUtilsReferences.RootReference(factory.create()); }; MountManager.prototype.getTag = function getTag() { return null; }; MountManager.prototype.getDestructor = function getDestructor(_ref4) { var engine = _ref4.engine; return engine; }; MountManager.prototype.didCreateElement = function didCreateElement() {}; MountManager.prototype.didRenderLayout = function didRenderLayout() {}; MountManager.prototype.didCreate = function didCreate(state) {}; MountManager.prototype.update = function update(state, args, dynamicScope) {}; MountManager.prototype.didUpdateLayout = function didUpdateLayout() {}; MountManager.prototype.didUpdate = function didUpdate(state) {}; return MountManager; })(); var MOUNT_MANAGER = new MountManager(); var MountDefinition = (function (_ComponentDefinition) { babelHelpers.inherits(MountDefinition, _ComponentDefinition); function MountDefinition(name, env) { _ComponentDefinition.call(this, name, MOUNT_MANAGER, null); this.env = env; } return MountDefinition; })(_glimmerRuntime.ComponentDefinition); }); enifed('ember-glimmer/syntax/outlet', ['exports', 'glimmer-runtime', 'ember-metal', 'ember-glimmer/utils/references', 'glimmer-reference'], function (exports, _glimmerRuntime, _emberMetal, _emberGlimmerUtilsReferences, _glimmerReference) { 'use strict'; function outletComponentFor(vm) { var _vm$dynamicScope = vm.dynamicScope(); var outletState = _vm$dynamicScope.outletState; var isTopLevel = _vm$dynamicScope.isTopLevel; if (isTopLevel) { return new TopLevelOutletComponentReference(outletState); } else { var args = vm.getArgs(); var outletNameRef = undefined; if (args.positional.length === 0) { outletNameRef = new _glimmerReference.ConstReference('main'); } else { outletNameRef = args.positional.at(0); } return new OutletComponentReference(outletNameRef, outletState); } } var OutletSyntax = (function (_StatementSyntax) { babelHelpers.inherits(OutletSyntax, _StatementSyntax); OutletSyntax.create = function create(environment, args, templates, symbolTable) { var definitionArgs = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(0, 1)); return new this(environment, definitionArgs, templates, symbolTable); }; function OutletSyntax(environment, args, templates, symbolTable) { _StatementSyntax.call(this); this.definitionArgs = args; this.definition = outletComponentFor; this.args = _glimmerRuntime.ArgsSyntax.empty(); this.symbolTable = symbolTable; this.templates = null; this.shadow = null; } OutletSyntax.prototype.compile = function compile(builder) { builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.templates, this.symbolTable, this.shadow); }; return OutletSyntax; })(_glimmerRuntime.StatementSyntax); exports.OutletSyntax = OutletSyntax; var TopLevelOutletComponentReference = (function () { function TopLevelOutletComponentReference(reference) { this.outletReference = reference; this.lastState = reference.value(); this.definition = new TopLevelOutletComponentDefinition(this.lastState.render.template); this.tag = reference.tag; } TopLevelOutletComponentReference.prototype.value = function value() { var lastState = this.lastState; var outletReference = this.outletReference; var definition = this.definition; var newState = outletReference.value(); definition = revalidate(definition, lastState, newState); if (definition) { return definition; } else { return new TopLevelOutletComponentDefinition(newState.render.template); } return this.definition; }; return TopLevelOutletComponentReference; })(); var OutletComponentReference = (function () { function OutletComponentReference(outletNameRef, parentOutletStateRef) { this.outletNameRef = outletNameRef; this.parentOutletStateRef = parentOutletStateRef; this.definition = null; this.lastState = null; var outletStateTag = this.outletStateTag = new _glimmerReference.UpdatableTag(parentOutletStateRef.tag); this.tag = _glimmerReference.combine([outletStateTag.tag, outletNameRef.tag]); } OutletComponentReference.prototype.value = function value() { var outletNameRef = this.outletNameRef; var parentOutletStateRef = this.parentOutletStateRef; var definition = this.definition; var lastState = this.lastState; var outletName = outletNameRef.value(); var outletStateRef = parentOutletStateRef.get('outlets').get(outletName); var newState = this.lastState = outletStateRef.value(); this.outletStateTag.update(outletStateRef.tag); definition = revalidate(definition, lastState, newState); var hasTemplate = newState && newState.render.template; if (definition) { return definition; } else if (hasTemplate) { return this.definition = new OutletComponentDefinition(outletName, newState.render.template); } else { return null; } }; return OutletComponentReference; })(); function revalidate(definition, lastState, newState) { if (!lastState && !newState) { return definition; } if (!lastState && newState || lastState && !newState) { return null; } if (newState.render.template === lastState.render.template && newState.render.controller === lastState.render.controller) { return definition; } return null; } function instrumentationPayload(_ref) { var _ref$render = _ref.render; var name = _ref$render.name; var outlet = _ref$render.outlet; return { object: name + ':' + outlet }; } function NOOP() {} var StateBucket = (function () { function StateBucket(outletState) { this.outletState = outletState; this.instrument(); } StateBucket.prototype.instrument = function instrument() { this.finalizer = _emberMetal._instrumentStart('render.outlet', instrumentationPayload, this.outletState); }; StateBucket.prototype.finalize = function finalize() { var finalizer = this.finalizer; finalizer(); this.finalizer = NOOP; }; return StateBucket; })(); var AbstractOutletComponentManager = (function () { function AbstractOutletComponentManager() {} AbstractOutletComponentManager.prototype.prepareArgs = function prepareArgs(definition, args) { return args; }; AbstractOutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { throw new Error('Not implemented: create'); }; AbstractOutletComponentManager.prototype.getSelf = function getSelf(_ref2) { var outletState = _ref2.outletState; return new _emberGlimmerUtilsReferences.RootReference(outletState.render.controller); }; AbstractOutletComponentManager.prototype.getTag = function getTag() { return null; }; AbstractOutletComponentManager.prototype.getDestructor = function getDestructor() { return null; }; AbstractOutletComponentManager.prototype.didRenderLayout = function didRenderLayout(bucket) { bucket.finalize(); }; AbstractOutletComponentManager.prototype.didCreateElement = function didCreateElement() {}; AbstractOutletComponentManager.prototype.didCreate = function didCreate(state) {}; AbstractOutletComponentManager.prototype.update = function update(bucket) {}; AbstractOutletComponentManager.prototype.didUpdateLayout = function didUpdateLayout(bucket) {}; AbstractOutletComponentManager.prototype.didUpdate = function didUpdate(state) {}; return AbstractOutletComponentManager; })(); var TopLevelOutletComponentManager = (function (_AbstractOutletComponentManager) { babelHelpers.inherits(TopLevelOutletComponentManager, _AbstractOutletComponentManager); function TopLevelOutletComponentManager() { _AbstractOutletComponentManager.apply(this, arguments); } TopLevelOutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { dynamicScope.isTopLevel = false; return new StateBucket(dynamicScope.outletState.value()); }; TopLevelOutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { var template = definition.template; if (!template) { template = env.owner.lookup('template:-outlet'); } return env.getCompiledBlock(TopLevelOutletLayoutCompiler, template); }; return TopLevelOutletComponentManager; })(AbstractOutletComponentManager); var TOP_LEVEL_MANAGER = new TopLevelOutletComponentManager(); var OutletComponentManager = (function (_AbstractOutletComponentManager2) { babelHelpers.inherits(OutletComponentManager, _AbstractOutletComponentManager2); function OutletComponentManager() { _AbstractOutletComponentManager2.apply(this, arguments); } OutletComponentManager.prototype.create = function create(environment, definition, args, dynamicScope) { var outletStateReference = dynamicScope.outletState = dynamicScope.outletState.get('outlets').get(definition.outletName); var outletState = outletStateReference.value(); return new StateBucket(outletState); }; OutletComponentManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { return env.getCompiledBlock(OutletLayoutCompiler, definition.template); }; return OutletComponentManager; })(AbstractOutletComponentManager); var MANAGER = new OutletComponentManager(); var AbstractOutletComponentDefinition = (function (_ComponentDefinition) { babelHelpers.inherits(AbstractOutletComponentDefinition, _ComponentDefinition); function AbstractOutletComponentDefinition(manager, outletName, template) { _ComponentDefinition.call(this, 'outlet', manager, null); this.outletName = outletName; this.template = template; _emberMetal.generateGuid(this); } return AbstractOutletComponentDefinition; })(_glimmerRuntime.ComponentDefinition); var TopLevelOutletComponentDefinition = (function (_AbstractOutletComponentDefinition) { babelHelpers.inherits(TopLevelOutletComponentDefinition, _AbstractOutletComponentDefinition); function TopLevelOutletComponentDefinition(template) { _AbstractOutletComponentDefinition.call(this, TOP_LEVEL_MANAGER, null, template); } return TopLevelOutletComponentDefinition; })(AbstractOutletComponentDefinition); var TopLevelOutletLayoutCompiler = (function () { function TopLevelOutletLayoutCompiler(template) { this.template = template; } TopLevelOutletLayoutCompiler.prototype.compile = function compile(builder) { builder.wrapLayout(this.template.asLayout()); builder.tag.static('div'); builder.attrs.static('id', _emberMetal.guidFor(this)); builder.attrs.static('class', 'ember-view'); }; return TopLevelOutletLayoutCompiler; })(); TopLevelOutletLayoutCompiler.id = 'top-level-outlet'; var OutletComponentDefinition = (function (_AbstractOutletComponentDefinition2) { babelHelpers.inherits(OutletComponentDefinition, _AbstractOutletComponentDefinition2); function OutletComponentDefinition(outletName, template) { _AbstractOutletComponentDefinition2.call(this, MANAGER, outletName, template); } return OutletComponentDefinition; })(AbstractOutletComponentDefinition); var OutletLayoutCompiler = (function () { function OutletLayoutCompiler(template) { this.template = template; } OutletLayoutCompiler.prototype.compile = function compile(builder) { builder.wrapLayout(this.template.asLayout()); }; return OutletLayoutCompiler; })(); exports.OutletLayoutCompiler = OutletLayoutCompiler; OutletLayoutCompiler.id = 'outlet'; }); enifed('ember-glimmer/syntax/render', ['exports', 'glimmer-runtime', 'glimmer-reference', 'ember-metal', 'ember-glimmer/utils/references', 'ember-routing', 'ember-glimmer/syntax/outlet'], function (exports, _glimmerRuntime, _glimmerReference, _emberMetal, _emberGlimmerUtilsReferences, _emberRouting, _emberGlimmerSyntaxOutlet) { 'use strict'; function makeComponentDefinition(vm) { var env = vm.env; var args = vm.getArgs(); var nameRef = args.positional.at(0); var templateName = nameRef.value(); var template = env.owner.lookup('template:' + templateName); var controllerName = undefined; if (args.named.has('controller')) { var controllerNameRef = args.named.get('controller'); controllerName = controllerNameRef.value(); } else { controllerName = templateName; } if (args.positional.length === 1) { return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, SINGLETON_RENDER_MANAGER)); } else { return new _glimmerReference.ConstReference(new RenderDefinition(controllerName, template, env, NON_SINGLETON_RENDER_MANAGER)); } } var RenderSyntax = (function (_StatementSyntax) { babelHelpers.inherits(RenderSyntax, _StatementSyntax); RenderSyntax.create = function create(environment, args, templates, symbolTable) { return new this(environment, args, templates, symbolTable); }; function RenderSyntax(environment, args, templates, symbolTable) { _StatementSyntax.call(this); this.definitionArgs = args; this.definition = makeComponentDefinition; this.args = _glimmerRuntime.ArgsSyntax.fromPositionalArgs(args.positional.slice(1, 2)); this.templates = null; this.symbolTable = symbolTable; this.shadow = null; } RenderSyntax.prototype.compile = function compile(builder) { builder.component.dynamic(this.definitionArgs, this.definition, this.args, this.templates, this.symbolTable, this.shadow); }; return RenderSyntax; })(_glimmerRuntime.StatementSyntax); exports.RenderSyntax = RenderSyntax; var AbstractRenderManager = (function () { function AbstractRenderManager() {} AbstractRenderManager.prototype.prepareArgs = function prepareArgs(definition, args) { return args; }; /* abstract create(environment, definition, args, dynamicScope); */ AbstractRenderManager.prototype.layoutFor = function layoutFor(definition, bucket, env) { return env.getCompiledBlock(_emberGlimmerSyntaxOutlet.OutletLayoutCompiler, definition.template); }; AbstractRenderManager.prototype.getSelf = function getSelf(_ref) { var controller = _ref.controller; return new _emberGlimmerUtilsReferences.RootReference(controller); }; AbstractRenderManager.prototype.getTag = function getTag() { return null; }; AbstractRenderManager.prototype.getDestructor = function getDestructor() { return null; }; AbstractRenderManager.prototype.didCreateElement = function didCreateElement() {}; AbstractRenderManager.prototype.didRenderLayout = function didRenderLayout() {}; AbstractRenderManager.prototype.didCreate = function didCreate() {}; AbstractRenderManager.prototype.update = function update() {}; AbstractRenderManager.prototype.didUpdateLayout = function didUpdateLayout() {}; AbstractRenderManager.prototype.didUpdate = function didUpdate() {}; return AbstractRenderManager; })(); var SingletonRenderManager = (function (_AbstractRenderManager) { babelHelpers.inherits(SingletonRenderManager, _AbstractRenderManager); function SingletonRenderManager() { _AbstractRenderManager.apply(this, arguments); } SingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { var name = definition.name; var env = definition.env; var controller = env.owner.lookup('controller:' + name); if (dynamicScope.rootOutletState) { dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); } return { controller: controller }; }; return SingletonRenderManager; })(AbstractRenderManager); var SINGLETON_RENDER_MANAGER = new SingletonRenderManager(); var NonSingletonRenderManager = (function (_AbstractRenderManager2) { babelHelpers.inherits(NonSingletonRenderManager, _AbstractRenderManager2); function NonSingletonRenderManager() { _AbstractRenderManager2.apply(this, arguments); } NonSingletonRenderManager.prototype.create = function create(environment, definition, args, dynamicScope) { var name = definition.name; var env = definition.env; var modelRef = args.positional.at(0); var factory = env.owner._lookupFactory('controller:' + name) || _emberRouting.generateControllerFactory(env.owner, name); var controller = factory.create({ model: modelRef.value() }); if (dynamicScope.rootOutletState) { dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name); } return { controller: controller }; }; NonSingletonRenderManager.prototype.update = function update(_ref2, args, dynamicScope) { var controller = _ref2.controller; controller.set('model', args.positional.at(0).value()); }; NonSingletonRenderManager.prototype.getDestructor = function getDestructor(_ref3) { var controller = _ref3.controller; return controller; }; return NonSingletonRenderManager; })(AbstractRenderManager); var NON_SINGLETON_RENDER_MANAGER = new NonSingletonRenderManager(); var RenderDefinition = (function (_ComponentDefinition) { babelHelpers.inherits(RenderDefinition, _ComponentDefinition); function RenderDefinition(name, template, env, manager) { _ComponentDefinition.call(this, 'render', manager, null); this.name = name; this.template = template; this.env = env; } return RenderDefinition; })(_glimmerRuntime.ComponentDefinition); }); enifed('ember-glimmer/template', ['exports', 'glimmer-runtime', 'container'], function (exports, _glimmerRuntime, _container) { 'use strict'; exports.default = template; function template(json) { var factory = _glimmerRuntime.templateFactory(json); return { id: factory.id, meta: factory.meta, create: function (props) { return factory.create(props.env, { owner: props[_container.OWNER] }); } }; } }); enifed("ember-glimmer/template_registry", ["exports"], function (exports) { // STATE within a module is frowned apon, this exists // to support Ember.TEMPLATES but shield ember internals from this legacy // global API. "use strict"; exports.setTemplates = setTemplates; exports.getTemplates = getTemplates; exports.getTemplate = getTemplate; exports.hasTemplate = hasTemplate; exports.setTemplate = setTemplate; var TEMPLATES = {}; function setTemplates(templates) { TEMPLATES = templates; } function getTemplates() { return TEMPLATES; } function getTemplate(name) { if (TEMPLATES.hasOwnProperty(name)) { return TEMPLATES[name]; } } function hasTemplate(name) { return TEMPLATES.hasOwnProperty(name); } function setTemplate(name, template) { return TEMPLATES[name] = template; } }); enifed("ember-glimmer/templates/component", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { "use strict"; exports.default = _emberGlimmerTemplate.default({ "id": "IX+OYPc0", "block": "{\"statements\":[[\"yield\",\"default\"]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"blocks\":[]}", "meta": { "moduleName": "ember-glimmer/templates/component.hbs" } }); }); enifed("ember-glimmer/templates/empty", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { "use strict"; exports.default = _emberGlimmerTemplate.default({ "id": "tyeRnR5E", "block": "{\"statements\":[],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[]}", "meta": { "moduleName": "ember-glimmer/templates/empty.hbs" } }); }); enifed("ember-glimmer/templates/link-to", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { "use strict"; exports.default = _emberGlimmerTemplate.default({ "id": "UKKFiO+L", "block": "{\"statements\":[[\"block\",[\"if\"],[[\"get\",[\"linkTitle\"]]],null,1,0]],\"locals\":[],\"named\":[],\"yields\":[\"default\"],\"blocks\":[{\"statements\":[[\"yield\",\"default\"]],\"locals\":[]},{\"statements\":[[\"append\",[\"unknown\",[\"linkTitle\"]],false]],\"locals\":[]}]}", "meta": { "moduleName": "ember-glimmer/templates/link-to.hbs" } }); }); enifed("ember-glimmer/templates/outlet", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { "use strict"; exports.default = _emberGlimmerTemplate.default({ "id": "mZcjKuiN", "block": "{\"statements\":[[\"append\",[\"unknown\",[\"outlet\"]],false]],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[]}", "meta": { "moduleName": "ember-glimmer/templates/outlet.hbs" } }); }); enifed("ember-glimmer/templates/root", ["exports", "ember-glimmer/template"], function (exports, _emberGlimmerTemplate) { "use strict"; exports.default = _emberGlimmerTemplate.default({ "id": "T37BUrCf", "block": "{\"statements\":[[\"append\",[\"helper\",[\"component\"],[[\"get\",[null]]],null],false]],\"locals\":[],\"named\":[],\"yields\":[],\"blocks\":[]}", "meta": { "moduleName": "ember-glimmer/templates/root.hbs" } }); }); enifed('ember-glimmer/utils/bindings', ['exports', 'glimmer-runtime', 'ember-metal', 'ember-runtime', 'glimmer-reference', 'ember-glimmer/component', 'ember-glimmer/utils/string'], function (exports, _glimmerRuntime, _emberMetal, _emberRuntime, _glimmerReference, _emberGlimmerComponent, _emberGlimmerUtilsString) { 'use strict'; exports.wrapComponentClassAttribute = wrapComponentClassAttribute; function referenceForKey(component, key) { return component[_emberGlimmerComponent.ROOT_REF].get(key); } function referenceForParts(component, parts) { return _glimmerReference.referenceFromParts(component[_emberGlimmerComponent.ROOT_REF], parts); } // TODO we should probably do this transform at build time function wrapComponentClassAttribute(args) { var named = args.named; var index = named.keys.indexOf('class'); if (index !== -1) { var _named$values$index = named.values[index]; var ref = _named$values$index.ref; var type = _named$values$index.type; if (type === 'get') { var propName = ref.parts[ref.parts.length - 1]; named.values[index] = _glimmerRuntime.HelperSyntax.fromSpec(['helper', ['-class'], [['get', ref.parts], propName], null]); } } return args; } var AttributeBinding = { parse: function (microsyntax) { var colonIndex = microsyntax.indexOf(':'); if (colonIndex === -1) { return [microsyntax, microsyntax, true]; } else { var prop = microsyntax.substring(0, colonIndex); var attribute = microsyntax.substring(colonIndex + 1); return [prop, attribute, false]; } }, install: function (element, component, parsed, operations) { var prop = parsed[0]; var attribute = parsed[1]; var isSimple = parsed[2]; if (attribute === 'id') { operations.addStaticAttribute(element, 'id', _emberMetal.get(component, prop)); return; } var isPath = prop.indexOf('.') > -1; var reference = isPath ? referenceForParts(component, prop.split('.')) : referenceForKey(component, prop); if (attribute === 'style') { reference = new StyleBindingReference(reference, referenceForKey(component, 'isVisible')); } else { reference = _glimmerReference.map(reference, this.mapAttributeValue); } operations.addDynamicAttribute(element, attribute, reference); }, mapAttributeValue: function (value) { if (value === null || value === undefined || value === false) { return null; } else if (value === true) { // Note: // This is here to mimic functionality in HTMLBars for properties. // For instance when a property like "disable" is set all of these // forms are valid and have the same disabled functionality: // // // // // // // For compatability sake we do not just cast the true boolean to // a string. Potentially we can revisit this in the future as the // casting feels better and we can remove this branch. return ''; } else { return value; } } }; exports.AttributeBinding = AttributeBinding; var DISPLAY_NONE = 'display: none;'; var SAFE_DISPLAY_NONE = _emberGlimmerUtilsString.htmlSafe(DISPLAY_NONE); var StyleBindingReference = (function (_CachedReference) { babelHelpers.inherits(StyleBindingReference, _CachedReference); function StyleBindingReference(inner, isVisible) { _CachedReference.call(this); this.tag = inner.tag; this.inner = inner; this.isVisible = isVisible; } StyleBindingReference.prototype.compute = function compute() { var value = this.inner.value(); var isVisible = this.isVisible.value(); if (isVisible !== false) { return value; } else if (!value && value !== 0) { return SAFE_DISPLAY_NONE; } else { var style = value + ' ' + DISPLAY_NONE; return _emberGlimmerUtilsString.isHTMLSafe(value) ? _emberGlimmerUtilsString.htmlSafe(style) : style; } }; return StyleBindingReference; })(_glimmerReference.CachedReference); var IsVisibleBinding = { install: function (element, component, operations) { operations.addDynamicAttribute(element, 'style', _glimmerReference.map(referenceForKey(component, 'isVisible'), this.mapStyleValue)); }, mapStyleValue: function (isVisible) { return isVisible === false ? SAFE_DISPLAY_NONE : null; } }; exports.IsVisibleBinding = IsVisibleBinding; var ClassNameBinding = { install: function (element, component, microsyntax, operations) { var _microsyntax$split = microsyntax.split(':'); var prop = _microsyntax$split[0]; var truthy = _microsyntax$split[1]; var falsy = _microsyntax$split[2]; var isPath = prop.indexOf('.') > -1; var parts = isPath && prop.split('.'); var value = isPath ? referenceForParts(component, parts) : referenceForKey(component, prop); var ref = undefined; if (truthy === undefined) { ref = new SimpleClassNameBindingReference(value, isPath ? parts[parts.length - 1] : prop); } else { ref = new ColonClassNameBindingReference(value, truthy, falsy); } operations.addDynamicAttribute(element, 'class', ref); } }; exports.ClassNameBinding = ClassNameBinding; var SimpleClassNameBindingReference = (function (_CachedReference2) { babelHelpers.inherits(SimpleClassNameBindingReference, _CachedReference2); function SimpleClassNameBindingReference(inner, path) { _CachedReference2.call(this); this.tag = inner.tag; this.inner = inner; this.path = path; this.dasherizedPath = null; } SimpleClassNameBindingReference.prototype.compute = function compute() { var value = this.inner.value(); if (value === true) { var path = this.path; var dasherizedPath = this.dasherizedPath; return dasherizedPath || (this.dasherizedPath = _emberRuntime.String.dasherize(path)); } else if (value || value === 0) { return value; } else { return null; } }; return SimpleClassNameBindingReference; })(_glimmerReference.CachedReference); var ColonClassNameBindingReference = (function (_CachedReference3) { babelHelpers.inherits(ColonClassNameBindingReference, _CachedReference3); function ColonClassNameBindingReference(inner, truthy, falsy) { _CachedReference3.call(this); this.tag = inner.tag; this.inner = inner; this.truthy = truthy || null; this.falsy = falsy || null; } ColonClassNameBindingReference.prototype.compute = function compute() { var inner = this.inner; var truthy = this.truthy; var falsy = this.falsy; return inner.value() ? truthy : falsy; }; return ColonClassNameBindingReference; })(_glimmerReference.CachedReference); }); enifed('ember-glimmer/utils/iterable', ['exports', 'ember-metal', 'ember-runtime', 'ember-glimmer/utils/references', 'ember-glimmer/helpers/each-in', 'glimmer-reference'], function (exports, _emberMetal, _emberRuntime, _emberGlimmerUtilsReferences, _emberGlimmerHelpersEachIn, _glimmerReference) { 'use strict'; exports.default = iterableFor; var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; function iterableFor(ref, keyPath) { if (_emberGlimmerHelpersEachIn.isEachIn(ref)) { return new EachInIterable(ref, keyForEachIn(keyPath)); } else { return new ArrayIterable(ref, keyForArray(keyPath)); } } function keyForEachIn(keyPath) { switch (keyPath) { case '@index': case undefined: case null: return index; case '@identity': return identity; default: return function (item) { return _emberMetal.get(item, keyPath); }; } } function keyForArray(keyPath) { switch (keyPath) { case '@index': return index; case '@identity': case undefined: case null: return identity; default: return function (item) { return _emberMetal.get(item, keyPath); }; } } function index(item, index) { return String(index); } function identity(item) { switch (typeof item) { case 'string': case 'number': return String(item); default: return _emberMetal.guidFor(item); } } function ensureUniqueKey(seen, key) { var seenCount = seen[key]; if (seenCount) { seen[key]++; return '' + key + ITERATOR_KEY_GUID + seenCount; } else { seen[key] = 1; } return key; } var ArrayIterator = (function () { function ArrayIterator(array, keyFor) { this.array = array; this.length = array.length; this.keyFor = keyFor; this.position = 0; this.seen = new _emberMetal.EmptyObject(); } ArrayIterator.prototype.isEmpty = function isEmpty() { return false; }; ArrayIterator.prototype.next = function next() { var array = this.array; var length = this.length; var keyFor = this.keyFor; var position = this.position; var seen = this.seen; if (position >= length) { return null; } var value = array[position]; var memo = position; var key = ensureUniqueKey(seen, keyFor(value, memo)); this.position++; return { key: key, value: value, memo: memo }; }; return ArrayIterator; })(); var EmberArrayIterator = (function () { function EmberArrayIterator(array, keyFor) { this.array = array; this.length = _emberMetal.get(array, 'length'); this.keyFor = keyFor; this.position = 0; this.seen = new _emberMetal.EmptyObject(); } EmberArrayIterator.prototype.isEmpty = function isEmpty() { return this.length === 0; }; EmberArrayIterator.prototype.next = function next() { var array = this.array; var length = this.length; var keyFor = this.keyFor; var position = this.position; var seen = this.seen; if (position >= length) { return null; } var value = _emberRuntime.objectAt(array, position); var memo = position; var key = ensureUniqueKey(seen, keyFor(value, memo)); this.position++; return { key: key, value: value, memo: memo }; }; return EmberArrayIterator; })(); var ObjectKeysIterator = (function () { function ObjectKeysIterator(keys, values, keyFor) { this.keys = keys; this.values = values; this.keyFor = keyFor; this.position = 0; this.seen = new _emberMetal.EmptyObject(); } ObjectKeysIterator.prototype.isEmpty = function isEmpty() { return this.keys.length === 0; }; ObjectKeysIterator.prototype.next = function next() { var keys = this.keys; var values = this.values; var keyFor = this.keyFor; var position = this.position; var seen = this.seen; if (position >= keys.length) { return null; } var value = values[position]; var memo = keys[position]; var key = ensureUniqueKey(seen, keyFor(value, memo)); this.position++; return { key: key, value: value, memo: memo }; }; return ObjectKeysIterator; })(); var EmptyIterator = (function () { function EmptyIterator() {} EmptyIterator.prototype.isEmpty = function isEmpty() { return true; }; EmptyIterator.prototype.next = function next() { throw new Error('Cannot call next() on an empty iterator'); }; return EmptyIterator; })(); var EMPTY_ITERATOR = new EmptyIterator(); var EachInIterable = (function () { function EachInIterable(ref, keyFor) { this.ref = ref; this.keyFor = keyFor; var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); this.tag = _glimmerReference.combine([ref.tag, valueTag]); } EachInIterable.prototype.iterate = function iterate() { var ref = this.ref; var keyFor = this.keyFor; var valueTag = this.valueTag; var iterable = ref.value(); valueTag.update(_emberMetal.tagFor(iterable)); if (_emberRuntime.isProxy(iterable)) { iterable = _emberMetal.get(iterable, 'content'); } var typeofIterable = typeof iterable; if (iterable && (typeofIterable === 'object' || typeofIterable === 'function')) { var keys = Object.keys(iterable); var values = keys.map(function (key) { return iterable[key]; }); return keys.length > 0 ? new ObjectKeysIterator(keys, values, keyFor) : EMPTY_ITERATOR; } else { return EMPTY_ITERATOR; } }; // {{each-in}} yields |key value| instead of |value key|, so the memo and // value are flipped EachInIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); }; EachInIterable.prototype.updateValueReference = function updateValueReference(reference, item) { reference.update(item.memo); }; EachInIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); }; EachInIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { reference.update(item.value); }; return EachInIterable; })(); var ArrayIterable = (function () { function ArrayIterable(ref, keyFor) { this.ref = ref; this.keyFor = keyFor; var valueTag = this.valueTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); this.tag = _glimmerReference.combine([ref.tag, valueTag]); } ArrayIterable.prototype.iterate = function iterate() { var ref = this.ref; var keyFor = this.keyFor; var valueTag = this.valueTag; var iterable = ref.value(); valueTag.update(_emberMetal.tagFor(iterable)); if (!iterable || typeof iterable !== 'object') { return EMPTY_ITERATOR; } if (Array.isArray(iterable)) { return iterable.length > 0 ? new ArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; } else if (_emberRuntime.isEmberArray(iterable)) { return _emberMetal.get(iterable, 'length') > 0 ? new EmberArrayIterator(iterable, keyFor) : EMPTY_ITERATOR; } else if (typeof iterable.forEach === 'function') { var _ret = (function () { var array = []; iterable.forEach(function (item) { array.push(item); }); return { v: array.length > 0 ? new ArrayIterator(array, keyFor) : EMPTY_ITERATOR }; })(); if (typeof _ret === 'object') return _ret.v; } else { return EMPTY_ITERATOR; } }; ArrayIterable.prototype.valueReferenceFor = function valueReferenceFor(item) { return new _emberGlimmerUtilsReferences.UpdatableReference(item.value); }; ArrayIterable.prototype.updateValueReference = function updateValueReference(reference, item) { reference.update(item.value); }; ArrayIterable.prototype.memoReferenceFor = function memoReferenceFor(item) { return new _emberGlimmerUtilsReferences.UpdatablePrimitiveReference(item.memo); }; ArrayIterable.prototype.updateMemoReference = function updateMemoReference(reference, item) { reference.update(item.memo); }; return ArrayIterable; })(); }); enifed('ember-glimmer/utils/process-args', ['exports', 'glimmer-reference', 'ember-metal', 'ember-glimmer/component', 'ember-glimmer/utils/references', 'ember-views'], function (exports, _glimmerReference, _emberMetal, _emberGlimmerComponent, _emberGlimmerUtilsReferences, _emberViews) { 'use strict'; exports.default = processArgs; exports.isCell = isCell; function processArgs(args, positionalParamsDefinition) { if (!positionalParamsDefinition || positionalParamsDefinition.length === 0 || args.positional.length === 0) { return SimpleArgs.create(args); } else if (typeof positionalParamsDefinition === 'string') { return RestArgs.create(args, positionalParamsDefinition); } else { return PositionalArgs.create(args, positionalParamsDefinition); } } var EMPTY_ARGS = { tag: _glimmerReference.CONSTANT_TAG, value: function () { var _props; return { attrs: {}, props: (_props = { attrs: {} }, _props[_emberGlimmerComponent.ARGS] = {}, _props) }; } }; var SimpleArgs = (function () { SimpleArgs.create = function create(_ref) { var named = _ref.named; if (named.keys.length === 0) { return EMPTY_ARGS; } else { return new SimpleArgs(named); } }; function SimpleArgs(namedArgs) { this.tag = namedArgs.tag; this.namedArgs = namedArgs; } SimpleArgs.prototype.value = function value() { var namedArgs = this.namedArgs; var keys = namedArgs.keys; var attrs = namedArgs.value(); var props = new _emberMetal.EmptyObject(); var args = new _emberMetal.EmptyObject(); props[_emberGlimmerComponent.ARGS] = args; for (var i = 0, l = keys.length; i < l; i++) { var _name = keys[i]; var ref = namedArgs.get(_name); var value = attrs[_name]; if (ref[_emberGlimmerUtilsReferences.UPDATE]) { attrs[_name] = new MutableCell(ref, value); } args[_name] = ref; props[_name] = value; } props.attrs = attrs; return { attrs: attrs, props: props }; }; return SimpleArgs; })(); function isCell(val) { return val && val[_emberViews.MUTABLE_CELL]; } var REF = _emberMetal.symbol('REF'); var MutableCell = (function () { function MutableCell(ref, value) { this[_emberViews.MUTABLE_CELL] = true; this[REF] = ref; this.value = value; } MutableCell.prototype.update = function update(val) { this[REF][_emberGlimmerUtilsReferences.UPDATE](val); }; return MutableCell; })(); var RestArgs = (function () { RestArgs.create = function create(args, restArgName) { return new RestArgs(args, restArgName); }; function RestArgs(args, restArgName) { this.tag = args.tag; this.simpleArgs = SimpleArgs.create(args); this.positionalArgs = args.positional; this.restArgName = restArgName; } RestArgs.prototype.value = function value() { var simpleArgs = this.simpleArgs; var positionalArgs = this.positionalArgs; var restArgName = this.restArgName; var result = simpleArgs.value(); result.props[_emberGlimmerComponent.ARGS] = positionalArgs; result.attrs[restArgName] = result.props[restArgName] = positionalArgs.value(); return result; }; return RestArgs; })(); var PositionalArgs = (function () { PositionalArgs.create = function create(args, positionalParamNames) { if (args.positional.length < positionalParamNames.length) { positionalParamNames = positionalParamNames.slice(0, args.positional.length); } return new PositionalArgs(args, positionalParamNames); }; function PositionalArgs(args, positionalParamNames) { this.tag = args.tag; this.simpleArgs = SimpleArgs.create(args); this.positionalArgs = args.positional; this.positionalParamNames = positionalParamNames; } PositionalArgs.prototype.value = function value() { var simpleArgs = this.simpleArgs; var positionalArgs = this.positionalArgs; var positionalParamNames = this.positionalParamNames; var result = simpleArgs.value(); for (var i = 0; i < positionalParamNames.length; i++) { var _name2 = positionalParamNames[i]; var reference = result.props[_emberGlimmerComponent.ARGS][_name2] = positionalArgs.at(i); result.attrs[_name2] = result.props[_name2] = reference.value(); } return result; }; return PositionalArgs; })(); }); enifed('ember-glimmer/utils/references', ['exports', 'ember-metal', 'glimmer-reference', 'glimmer-runtime', 'ember-glimmer/utils/to-bool', 'ember-glimmer/helper', 'ember-runtime'], function (exports, _emberMetal, _glimmerReference, _glimmerRuntime, _emberGlimmerUtilsToBool, _emberGlimmerHelper, _emberRuntime) { 'use strict'; var UPDATE = _emberMetal.symbol('UPDATE'); exports.UPDATE = UPDATE; // @implements PathReference var PrimitiveReference = (function (_ConstReference) { babelHelpers.inherits(PrimitiveReference, _ConstReference); function PrimitiveReference() { _ConstReference.apply(this, arguments); } PrimitiveReference.prototype.get = function get() { return _glimmerRuntime.UNDEFINED_REFERENCE; }; return PrimitiveReference; })(_glimmerReference.ConstReference); exports.PrimitiveReference = PrimitiveReference; exports.NULL_REFERENCE = _glimmerRuntime.NULL_REFERENCE; exports.UNDEFINED_REFERENCE = _glimmerRuntime.UNDEFINED_REFERENCE; // @abstract // @implements PathReference var EmberPathReference = (function () { function EmberPathReference() {} // @abstract // @abstract get tag() // @abstract value() EmberPathReference.prototype.get = function get(key) { return PropertyReference.create(this, key); }; return EmberPathReference; })(); var CachedReference = (function (_EmberPathReference) { babelHelpers.inherits(CachedReference, _EmberPathReference); function CachedReference() { _EmberPathReference.call(this); this._lastRevision = null; this._lastValue = null; } // @implements PathReference CachedReference.prototype.value = function value() { var tag = this.tag; var _lastRevision = this._lastRevision; var _lastValue = this._lastValue; if (!_lastRevision || !tag.validate(_lastRevision)) { _lastValue = this._lastValue = this.compute(); this._lastRevision = tag.value(); } return _lastValue; }; // @abstract compute() return CachedReference; })(EmberPathReference); exports.CachedReference = CachedReference; var RootReference = (function (_ConstReference2) { babelHelpers.inherits(RootReference, _ConstReference2); function RootReference(value) { _ConstReference2.call(this, value); this.children = new _emberMetal.EmptyObject(); } RootReference.prototype.get = function get(propertyKey) { var ref = this.children[propertyKey]; if (!ref) { ref = this.children[propertyKey] = new RootPropertyReference(this.inner, propertyKey); } return ref; }; return RootReference; })(_glimmerReference.ConstReference); exports.RootReference = RootReference; var TwoWayFlushDetectionTag = undefined; if (_emberMetal.isFeatureEnabled('ember-glimmer-detect-backtracking-rerender') || _emberMetal.isFeatureEnabled('ember-glimmer-allow-backtracking-rerender')) { TwoWayFlushDetectionTag = (function () { function _class(tag, key, ref) { this.tag = tag; this.parent = null; this.key = key; this.ref = ref; } _class.prototype.value = function value() { return this.tag.value(); }; _class.prototype.validate = function validate(ticket) { var parent = this.parent; var key = this.key; var isValid = this.tag.validate(ticket); if (isValid && parent) { _emberMetal.didRender(parent, key, this.ref); } return isValid; }; _class.prototype.didCompute = function didCompute(parent) { this.parent = parent; _emberMetal.didRender(parent, this.key, this.ref); }; return _class; })(); } var PropertyReference = (function (_CachedReference) { babelHelpers.inherits(PropertyReference, _CachedReference); function PropertyReference() { _CachedReference.apply(this, arguments); } PropertyReference.create = function create(parentReference, propertyKey) { if (_glimmerReference.isConst(parentReference)) { return new RootPropertyReference(parentReference.value(), propertyKey); } else { return new NestedPropertyReference(parentReference, propertyKey); } }; PropertyReference.prototype.get = function get(key) { return new NestedPropertyReference(this, key); }; return PropertyReference; })(CachedReference); exports.PropertyReference = PropertyReference; var RootPropertyReference = (function (_PropertyReference) { babelHelpers.inherits(RootPropertyReference, _PropertyReference); function RootPropertyReference(parentValue, propertyKey) { _PropertyReference.call(this); this._parentValue = parentValue; this._propertyKey = propertyKey; if (_emberMetal.isFeatureEnabled('ember-glimmer-detect-backtracking-rerender') || _emberMetal.isFeatureEnabled('ember-glimmer-allow-backtracking-rerender')) { this.tag = new TwoWayFlushDetectionTag(_emberMetal.tagFor(parentValue), propertyKey, this); } else { this.tag = _emberMetal.tagFor(parentValue); } if (_emberMetal.isFeatureEnabled('mandatory-setter')) { _emberMetal.watchKey(parentValue, propertyKey, _emberMetal.meta(parentValue)); } } RootPropertyReference.prototype.compute = function compute() { var _parentValue = this._parentValue; var _propertyKey = this._propertyKey; if (_emberMetal.isFeatureEnabled('ember-glimmer-detect-backtracking-rerender') || _emberMetal.isFeatureEnabled('ember-glimmer-allow-backtracking-rerender')) { this.tag.didCompute(_parentValue); } return _emberMetal.get(_parentValue, _propertyKey); }; RootPropertyReference.prototype[UPDATE] = function (value) { _emberMetal.set(this._parentValue, this._propertyKey, value); }; return RootPropertyReference; })(PropertyReference); exports.RootPropertyReference = RootPropertyReference; var NestedPropertyReference = (function (_PropertyReference2) { babelHelpers.inherits(NestedPropertyReference, _PropertyReference2); function NestedPropertyReference(parentReference, propertyKey) { _PropertyReference2.call(this); var parentReferenceTag = parentReference.tag; var parentObjectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); this._parentReference = parentReference; this._parentObjectTag = parentObjectTag; this._propertyKey = propertyKey; if (_emberMetal.isFeatureEnabled('ember-glimmer-detect-backtracking-rerender') || _emberMetal.isFeatureEnabled('ember-glimmer-allow-backtracking-rerender')) { var tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); this.tag = new TwoWayFlushDetectionTag(tag, propertyKey, this); } else { this.tag = _glimmerReference.combine([parentReferenceTag, parentObjectTag]); } } NestedPropertyReference.prototype.compute = function compute() { var _parentReference = this._parentReference; var _parentObjectTag = this._parentObjectTag; var _propertyKey = this._propertyKey; var parentValue = _parentReference.value(); _parentObjectTag.update(_emberMetal.tagFor(parentValue)); if (typeof parentValue === 'object' && parentValue) { if (_emberMetal.isFeatureEnabled('mandatory-setter')) { var meta = _emberMetal.meta(parentValue); _emberMetal.watchKey(parentValue, _propertyKey, meta); } if (_emberMetal.isFeatureEnabled('ember-glimmer-detect-backtracking-rerender') || _emberMetal.isFeatureEnabled('ember-glimmer-allow-backtracking-rerender')) { this.tag.didCompute(parentValue); } return _emberMetal.get(parentValue, _propertyKey); } else { return undefined; } }; NestedPropertyReference.prototype[UPDATE] = function (value) { var parent = this._parentReference.value(); _emberMetal.set(parent, this._propertyKey, value); }; return NestedPropertyReference; })(PropertyReference); exports.NestedPropertyReference = NestedPropertyReference; var UpdatableReference = (function (_EmberPathReference2) { babelHelpers.inherits(UpdatableReference, _EmberPathReference2); function UpdatableReference(value) { _EmberPathReference2.call(this); this.tag = new _glimmerReference.DirtyableTag(); this._value = value; } UpdatableReference.prototype.value = function value() { return this._value; }; UpdatableReference.prototype.update = function update(value) { var _value = this._value; if (value !== _value) { this.tag.dirty(); this._value = value; } }; return UpdatableReference; })(EmberPathReference); exports.UpdatableReference = UpdatableReference; var UpdatablePrimitiveReference = (function (_UpdatableReference) { babelHelpers.inherits(UpdatablePrimitiveReference, _UpdatableReference); function UpdatablePrimitiveReference() { _UpdatableReference.apply(this, arguments); } UpdatablePrimitiveReference.prototype.get = function get() { return _glimmerRuntime.UNDEFINED_REFERENCE; }; return UpdatablePrimitiveReference; })(UpdatableReference); exports.UpdatablePrimitiveReference = UpdatablePrimitiveReference; var ConditionalReference = (function (_GlimmerConditionalReference) { babelHelpers.inherits(ConditionalReference, _GlimmerConditionalReference); ConditionalReference.create = function create(reference) { if (_glimmerReference.isConst(reference)) { var value = reference.value(); if (_emberRuntime.isProxy(value)) { return new RootPropertyReference(value, 'isTruthy'); } else { return new PrimitiveReference(_emberGlimmerUtilsToBool.default(value)); } } return new ConditionalReference(reference); }; function ConditionalReference(reference) { _GlimmerConditionalReference.call(this, reference); this.objectTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); this.tag = _glimmerReference.combine([reference.tag, this.objectTag]); } ConditionalReference.prototype.toBool = function toBool(predicate) { this.objectTag.update(_emberMetal.tagFor(predicate)); if (_emberRuntime.isProxy(predicate)) { return _emberMetal.get(predicate, 'isTruthy'); } else { return _emberGlimmerUtilsToBool.default(predicate); } }; return ConditionalReference; })(_glimmerRuntime.ConditionalReference); exports.ConditionalReference = ConditionalReference; var SimpleHelperReference = (function (_CachedReference2) { babelHelpers.inherits(SimpleHelperReference, _CachedReference2); SimpleHelperReference.create = function create(helper, args) { if (_glimmerReference.isConst(args)) { var positional = args.positional; var named = args.named; var result = helper(positional.value(), named.value()); if (result === null) { return _glimmerRuntime.NULL_REFERENCE; } else if (result === undefined) { return _glimmerRuntime.UNDEFINED_REFERENCE; } else if (typeof result === 'object') { return new RootReference(result); } else { return new PrimitiveReference(result); } } else { return new SimpleHelperReference(helper, args); } }; function SimpleHelperReference(helper, args) { _CachedReference2.call(this); this.tag = args.tag; this.helper = helper; this.args = args; } SimpleHelperReference.prototype.compute = function compute() { var helper = this.helper; var _args = this.args; var positional = _args.positional; var named = _args.named; return helper(positional.value(), named.value()); }; return SimpleHelperReference; })(CachedReference); exports.SimpleHelperReference = SimpleHelperReference; var ClassBasedHelperReference = (function (_CachedReference3) { babelHelpers.inherits(ClassBasedHelperReference, _CachedReference3); ClassBasedHelperReference.create = function create(helperClass, vm, args) { var instance = helperClass.create(); vm.newDestroyable(instance); return new ClassBasedHelperReference(instance, args); }; function ClassBasedHelperReference(instance, args) { _CachedReference3.call(this); this.tag = _glimmerReference.combine([instance[_emberGlimmerHelper.RECOMPUTE_TAG], args.tag]); this.instance = instance; this.args = args; } ClassBasedHelperReference.prototype.compute = function compute() { var instance = this.instance; var _args2 = this.args; var positional = _args2.positional; var named = _args2.named; return instance.compute(positional.value(), named.value()); }; return ClassBasedHelperReference; })(CachedReference); exports.ClassBasedHelperReference = ClassBasedHelperReference; var InternalHelperReference = (function (_CachedReference4) { babelHelpers.inherits(InternalHelperReference, _CachedReference4); function InternalHelperReference(helper, args) { _CachedReference4.call(this); this.tag = args.tag; this.helper = helper; this.args = args; } // @implements PathReference InternalHelperReference.prototype.compute = function compute() { var helper = this.helper; var args = this.args; return helper(args); }; return InternalHelperReference; })(CachedReference); exports.InternalHelperReference = InternalHelperReference; var UnboundReference = (function (_ConstReference3) { babelHelpers.inherits(UnboundReference, _ConstReference3); function UnboundReference() { _ConstReference3.apply(this, arguments); } UnboundReference.create = function create(value) { if (value === null) { return _glimmerRuntime.NULL_REFERENCE; } else if (value === undefined) { return _glimmerRuntime.UNDEFINED_REFERENCE; } else if (typeof value === 'object') { return new UnboundReference(value); } else { return new PrimitiveReference(value); } }; UnboundReference.prototype.get = function get(key) { return new UnboundReference(_emberMetal.get(this.inner, key)); }; return UnboundReference; })(_glimmerReference.ConstReference); exports.UnboundReference = UnboundReference; }); enifed('ember-glimmer/utils/string', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-glimmer */ 'use strict'; exports.getSafeString = getSafeString; exports.escapeExpression = escapeExpression; exports.htmlSafe = htmlSafe; exports.isHTMLSafe = isHTMLSafe; var SafeString = (function () { function SafeString(string) { this.string = string; } SafeString.prototype.toString = function toString() { return '' + this.string; }; SafeString.prototype.toHTML = function toHTML() { return this.toString(); }; return SafeString; })(); exports.SafeString = SafeString; function getSafeString() { return SafeString; } var escape = { '&': '&', '<': '<', '>': '>', '"': '"', // jscs:disable "'": ''', // jscs:enable '`': '`', '=': '=' }; var possible = /[&<>"'`=]/; var badChars = /[&<>"'`=]/g; function escapeChar(chr) { return escape[chr]; } function escapeExpression(string) { if (typeof string !== 'string') { // don't escape SafeStrings, since they're already safe if (string && string.toHTML) { return string.toHTML(); } else if (string == null) { return ''; } else if (!string) { return string + ''; } // Force a string conversion as this will be done by the append regardless and // the regex test will do this transparently behind the scenes, causing issues if // an object's to string has escaped characters in it. string = '' + string; } if (!possible.test(string)) { return string; } return string.replace(badChars, escapeChar); } /** Mark a string as safe for unescaped output with Ember templates. If you return HTML from a helper, use this function to ensure Ember's rendering layer does not escape the HTML. ```javascript Ember.String.htmlSafe('
    someString
    ') ``` @method htmlSafe @for Ember.String @static @return {Handlebars.SafeString} A string that will not be HTML escaped by Handlebars. @public */ function htmlSafe(str) { if (str === null || str === undefined) { str = ''; } else if (typeof str !== 'string') { str = '' + str; } return new SafeString(str); } /** Detects if a string was decorated using `Ember.String.htmlSafe`. ```javascript var plainString = 'plain string', safeString = Ember.String.htmlSafe('
    someValue
    '); Ember.String.isHTMLSafe(plainString); // false Ember.String.isHTMLSafe(safeString); // true ``` @method isHTMLSafe @for Ember.String @static @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise. @public */ function isHTMLSafe(str) { return str && typeof str.toHTML === 'function'; } }); enifed('ember-glimmer/utils/to-bool', ['exports', 'ember-runtime', 'ember-metal'], function (exports, _emberRuntime, _emberMetal) { 'use strict'; exports.default = toBool; function toBool(predicate) { if (!predicate) { return false; } if (predicate === true) { return true; } if (_emberRuntime.isArray(predicate)) { return _emberMetal.get(predicate, 'length') !== 0; } return true; } }); enifed('ember-glimmer/views/outlet', ['exports', 'ember-metal', 'glimmer-reference', 'ember-environment'], function (exports, _emberMetal, _glimmerReference, _emberEnvironment) { 'use strict'; /** @module ember @submodule ember-templates */ var OutletStateReference = (function () { function OutletStateReference(outletView) { this.outletView = outletView; this.tag = outletView._tag; } // So this is a relic of the past that SHOULD go away // in 3.0. Preferably it is deprecated in the release that // follows the Glimmer release. OutletStateReference.prototype.get = function get(key) { return new ChildOutletStateReference(this, key); }; OutletStateReference.prototype.value = function value() { return this.outletView.outletState; }; OutletStateReference.prototype.getOrphan = function getOrphan(name) { return new OrphanedOutletStateReference(this, name); }; OutletStateReference.prototype.update = function update(state) { this.outletView.setOutletState(state); }; babelHelpers.createClass(OutletStateReference, [{ key: 'isTopLevel', get: function () { return true; } }]); return OutletStateReference; })(); var OrphanedOutletStateReference = (function (_OutletStateReference) { babelHelpers.inherits(OrphanedOutletStateReference, _OutletStateReference); function OrphanedOutletStateReference(root, name) { _OutletStateReference.call(this, root.outletView); this.root = root; this.name = name; } OrphanedOutletStateReference.prototype.value = function value() { var rootState = this.root.value(); var orphans = rootState.outlets.__ember_orphans__; if (!orphans) { return null; } var matched = orphans.outlets[this.name]; if (!matched) { return null; } var state = new _emberMetal.EmptyObject(); state[matched.render.outlet] = matched; matched.wasUsed = true; return { outlets: state }; }; return OrphanedOutletStateReference; })(OutletStateReference); var ChildOutletStateReference = (function () { function ChildOutletStateReference(parent, key) { this.parent = parent; this.key = key; this.tag = parent.tag; } ChildOutletStateReference.prototype.get = function get(key) { return new ChildOutletStateReference(this, key); }; ChildOutletStateReference.prototype.value = function value() { return this.parent.value()[this.key]; }; babelHelpers.createClass(ChildOutletStateReference, [{ key: 'isTopLevel', get: function () { return false; } }]); return ChildOutletStateReference; })(); var OutletView = (function () { OutletView.extend = function extend(injections) { return (function (_OutletView) { babelHelpers.inherits(_class, _OutletView); function _class() { _OutletView.apply(this, arguments); } _class.create = function create(options) { if (options) { return _OutletView.create.call(this, _emberMetal.assign({}, injections, options)); } else { return _OutletView.create.call(this, injections); } }; return _class; })(OutletView); }; OutletView.reopenClass = function reopenClass(injections) { _emberMetal.assign(this, injections); }; OutletView.create = function create(_ref) { var _environment = _ref._environment; var renderer = _ref.renderer; var template = _ref.template; return new OutletView(_environment, renderer, template); }; function OutletView(_environment, renderer, template) { this._environment = _environment; this.renderer = renderer; this.template = template; this.outletState = null; this._renderResult = null; this._tag = new _glimmerReference.DirtyableTag(); } OutletView.prototype.appendTo = function appendTo(selector) { var env = this._environment || _emberEnvironment.environment; var target = undefined; if (env.hasDOM) { target = typeof selector === 'string' ? document.querySelector(selector) : selector; } else { target = selector; } this._renderResult = this.renderer.appendOutletView(this, target); }; OutletView.prototype.rerender = function rerender() { if (this._renderResult) { this.renderer.rerender(this); } }; OutletView.prototype.setOutletState = function setOutletState(state) { this.outletState = state; this._tag.dirty(); }; OutletView.prototype.toReference = function toReference() { return new OutletStateReference(this); }; OutletView.prototype.destroy = function destroy() { if (this._renderResult) { this._renderResult.destroy(); } }; return OutletView; })(); exports.default = OutletView; }); enifed('ember-metal/alias', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/dependent_keys'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalUtils, _emberMetalMeta, _emberMetalDependent_keys) { 'use strict'; exports.default = alias; exports.AliasedProperty = AliasedProperty; function alias(altKey) { return new AliasedProperty(altKey); } function AliasedProperty(altKey) { this.isDescriptor = true; this.altKey = altKey; this._dependentKeys = [altKey]; } AliasedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); AliasedProperty.prototype.get = function AliasedProperty_get(obj, keyName) { return _emberMetalProperty_get.get(obj, this.altKey); }; AliasedProperty.prototype.set = function AliasedProperty_set(obj, keyName, value) { return _emberMetalProperty_set.set(obj, this.altKey, value); }; AliasedProperty.prototype.willWatch = function (obj, keyName) { _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); }; AliasedProperty.prototype.didUnwatch = function (obj, keyName) { _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj)); }; AliasedProperty.prototype.setup = function (obj, keyName) { var m = _emberMetalMeta.meta(obj); if (m.peekWatching(keyName)) { _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, m); } }; AliasedProperty.prototype.teardown = function (obj, keyName) { var m = _emberMetalMeta.meta(obj); if (m.peekWatching(keyName)) { _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, m); } }; AliasedProperty.prototype.readOnly = function () { this.set = AliasedProperty_readOnlySet; return this; }; function AliasedProperty_readOnlySet(obj, keyName, value) { throw new _emberMetalError.default('Cannot set read-only property \'' + keyName + '\' on object: ' + _emberMetalUtils.inspect(obj)); } AliasedProperty.prototype.oneWay = function () { this.set = AliasedProperty_oneWaySet; return this; }; function AliasedProperty_oneWaySet(obj, keyName, value) { _emberMetalProperties.defineProperty(obj, keyName, null); return _emberMetalProperty_set.set(obj, keyName, value); } // Backwards compatibility with Ember Data. AliasedProperty.prototype._meta = undefined; AliasedProperty.prototype.meta = _emberMetalComputed.ComputedProperty.prototype.meta; }); enifed("ember-metal/assign", ["exports"], function (exports) { /** Copy properties from a source object to a target object. ```javascript var a = { first: 'Yehuda' }; var b = { last: 'Katz' }; var c = { company: 'Tilde Inc.' }; Ember.assign(a, b, c); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' }, b === { last: 'Katz' }, c === { company: 'Tilde Inc.' } ``` @method assign @for Ember @param {Object} original The object to assign into @param {Object} ...args The objects to copy properties from @return {Object} @public */ "use strict"; exports.default = assign; function assign(original) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } for (var i = 0; i < args.length; i++) { var arg = args[i]; if (!arg) { continue; } var updates = Object.keys(arg); for (var _i = 0; _i < updates.length; _i++) { var prop = updates[_i]; original[prop] = arg[prop]; } } return original; } }); enifed('ember-metal/binding', ['exports', 'ember-console', 'ember-environment', 'ember-metal/run_loop', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/events', 'ember-metal/observer', 'ember-metal/path_cache'], function (exports, _emberConsole, _emberEnvironment, _emberMetalRun_loop, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalUtils, _emberMetalEvents, _emberMetalObserver, _emberMetalPath_cache) { 'use strict'; exports.bind = bind; /** @module ember @submodule ember-metal */ // .......................................................... // BINDING // function Binding(toPath, fromPath) { // Configuration this._from = fromPath; this._to = toPath; this._oneWay = undefined; // State this._direction = undefined; this._readyToSync = undefined; this._fromObj = undefined; this._fromPath = undefined; this._toObj = undefined; } /** @class Binding @namespace Ember @deprecated See http://emberjs.com/deprecations/v2.x#toc_ember-binding @public */ Binding.prototype = { /** This copies the Binding so it can be connected to another object. @method copy @return {Ember.Binding} `this` @public */ copy: function () { var copy = new Binding(this._to, this._from); if (this._oneWay) { copy._oneWay = true; } return copy; }, // .......................................................... // CONFIG // /** This will set `from` property path to the specified value. It will not attempt to resolve this property path to an actual object until you connect the binding. The binding will search for the property path starting at the root object you pass when you `connect()` the binding. It follows the same rules as `get()` - see that method for more information. @method from @param {String} path The property path to connect to. @return {Ember.Binding} `this` @public */ from: function (path) { this._from = path; return this; }, /** This will set the `to` property path to the specified value. It will not attempt to resolve this property path to an actual object until you connect the binding. The binding will search for the property path starting at the root object you pass when you `connect()` the binding. It follows the same rules as `get()` - see that method for more information. @method to @param {String|Tuple} path A property path or tuple. @return {Ember.Binding} `this` @public */ to: function (path) { this._to = path; return this; }, /** Configures the binding as one way. A one-way binding will relay changes on the `from` side to the `to` side, but not the other way around. This means that if you change the `to` side directly, the `from` side may have a different value. @method oneWay @return {Ember.Binding} `this` @public */ oneWay: function () { this._oneWay = true; return this; }, /** @method toString @return {String} string representation of binding @public */ toString: function () { var oneWay = this._oneWay ? '[oneWay]' : ''; return 'Ember.Binding<' + _emberMetalUtils.guidFor(this) + '>(' + this._from + ' -> ' + this._to + ')' + oneWay; }, // .......................................................... // CONNECT AND SYNC // /** Attempts to connect this binding instance so that it can receive and relay changes. This method will raise an exception if you have not set the from/to properties yet. @method connect @param {Object} obj The root object for this binding. @return {Ember.Binding} `this` @public */ connect: function (obj) { var fromObj = undefined, fromPath = undefined, possibleGlobal = undefined; // If the binding's "from" path could be interpreted as a global, verify // whether the path refers to a global or not by consulting `Ember.lookup`. if (_emberMetalPath_cache.isGlobalPath(this._from)) { var _name = _emberMetalPath_cache.getFirstKey(this._from); possibleGlobal = _emberEnvironment.context.lookup[_name]; if (possibleGlobal) { fromObj = possibleGlobal; fromPath = _emberMetalPath_cache.getTailPath(this._from); } } if (fromObj === undefined) { fromObj = obj; fromPath = this._from; } _emberMetalProperty_set.trySet(obj, this._to, _emberMetalProperty_get.get(fromObj, fromPath)); // Add an observer on the object to be notified when the binding should be updated. _emberMetalObserver.addObserver(fromObj, fromPath, this, 'fromDidChange'); // If the binding is a two-way binding, also set up an observer on the target. if (!this._oneWay) { _emberMetalObserver.addObserver(obj, this._to, this, 'toDidChange'); } _emberMetalEvents.addListener(obj, 'willDestroy', this, 'disconnect'); fireDeprecations(obj, this._to, this._from, possibleGlobal, this._oneWay, !possibleGlobal && !this._oneWay); this._readyToSync = true; this._fromObj = fromObj; this._fromPath = fromPath; this._toObj = obj; return this; }, /** Disconnects the binding instance. Changes will no longer be relayed. You will not usually need to call this method. @method disconnect @return {Ember.Binding} `this` @public */ disconnect: function () { // Remove an observer on the object so we're no longer notified of // changes that should update bindings. _emberMetalObserver.removeObserver(this._fromObj, this._fromPath, this, 'fromDidChange'); // If the binding is two-way, remove the observer from the target as well. if (!this._oneWay) { _emberMetalObserver.removeObserver(this._toObj, this._to, this, 'toDidChange'); } this._readyToSync = false; // Disable scheduled syncs... return this; }, // .......................................................... // PRIVATE // /* Called when the from side changes. */ fromDidChange: function (target) { this._scheduleSync('fwd'); }, /* Called when the to side changes. */ toDidChange: function (target) { this._scheduleSync('back'); }, _scheduleSync: function (dir) { var existingDir = this._direction; // If we haven't scheduled the binding yet, schedule it. if (existingDir === undefined) { _emberMetalRun_loop.default.schedule('sync', this, '_sync'); this._direction = dir; } // If both a 'back' and 'fwd' sync have been scheduled on the same object, // default to a 'fwd' sync so that it remains deterministic. if (existingDir === 'back' && dir === 'fwd') { this._direction = 'fwd'; } }, _sync: function () { var log = _emberEnvironment.ENV.LOG_BINDINGS; var toObj = this._toObj; // Don't synchronize destroyed objects or disconnected bindings. if (toObj.isDestroyed || !this._readyToSync) { return; } // Get the direction of the binding for the object we are // synchronizing from. var direction = this._direction; var fromObj = this._fromObj; var fromPath = this._fromPath; this._direction = undefined; // If we're synchronizing from the remote object... if (direction === 'fwd') { var fromValue = _emberMetalProperty_get.get(fromObj, fromPath); if (log) { _emberConsole.default.log(' ', this.toString(), '->', fromValue, fromObj); } if (this._oneWay) { _emberMetalProperty_set.trySet(toObj, this._to, fromValue); } else { _emberMetalObserver._suspendObserver(toObj, this._to, this, 'toDidChange', function () { _emberMetalProperty_set.trySet(toObj, this._to, fromValue); }); } // If we're synchronizing *to* the remote object. } else if (direction === 'back') { var toValue = _emberMetalProperty_get.get(toObj, this._to); if (log) { _emberConsole.default.log(' ', this.toString(), '<-', toValue, toObj); } _emberMetalObserver._suspendObserver(fromObj, fromPath, this, 'fromDidChange', function () { _emberMetalProperty_set.trySet(fromObj, fromPath, toValue); }); } } }; function fireDeprecations(obj, toPath, fromPath, deprecateGlobal, deprecateOneWay, deprecateAlias) { var deprecateGlobalMessage = '`Ember.Binding` is deprecated. Since you' + ' are binding to a global consider using a service instead.'; var deprecateOneWayMessage = '`Ember.Binding` is deprecated. Since you' + ' are using a `oneWay` binding consider using a `readOnly` computed' + ' property instead.'; var deprecateAliasMessage = '`Ember.Binding` is deprecated. Consider' + ' using an `alias` computed property instead.'; var objectInfo = 'The `' + toPath + '` property of `' + obj + '` is an `Ember.Binding` connected to `' + fromPath + '`, but '; } function mixinProperties(to, from) { for (var key in from) { if (from.hasOwnProperty(key)) { to[key] = from[key]; } } } mixinProperties(Binding, { /* See `Ember.Binding.from`. @method from @static */ from: function (from) { var C = this; return new C(undefined, from); }, /* See `Ember.Binding.to`. @method to @static */ to: function (to) { var C = this; return new C(to, undefined); } }); /** An `Ember.Binding` connects the properties of two objects so that whenever the value of one property changes, the other property will be changed also. ## Automatic Creation of Bindings with `/^*Binding/`-named Properties. You do not usually create Binding objects directly but instead describe bindings in your class or object definition using automatic binding detection. Properties ending in a `Binding` suffix will be converted to `Ember.Binding` instances. The value of this property should be a string representing a path to another object or a custom binding instance created using Binding helpers (see "One Way Bindings"): ``` valueBinding: "MyApp.someController.title" ``` This will create a binding from `MyApp.someController.title` to the `value` property of your object instance automatically. Now the two values will be kept in sync. ## One Way Bindings One especially useful binding customization you can use is the `oneWay()` helper. This helper tells Ember that you are only interested in receiving changes on the object you are binding from. For example, if you are binding to a preference and you want to be notified if the preference has changed, but your object will not be changing the preference itself, you could do: ``` bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles") ``` This way if the value of `MyApp.preferencesController.bigTitles` changes the `bigTitles` property of your object will change also. However, if you change the value of your `bigTitles` property, it will not update the `preferencesController`. One way bindings are almost twice as fast to setup and twice as fast to execute because the binding only has to worry about changes to one side. You should consider using one way bindings anytime you have an object that may be created frequently and you do not intend to change a property; only to monitor it for changes (such as in the example above). ## Adding Bindings Manually All of the examples above show you how to configure a custom binding, but the result of these customizations will be a binding template, not a fully active Binding instance. The binding will actually become active only when you instantiate the object the binding belongs to. It is useful, however, to understand what actually happens when the binding is activated. For a binding to function it must have at least a `from` property and a `to` property. The `from` property path points to the object/key that you want to bind from while the `to` path points to the object/key you want to bind to. When you define a custom binding, you are usually describing the property you want to bind from (such as `MyApp.someController.value` in the examples above). When your object is created, it will automatically assign the value you want to bind `to` based on the name of your binding key. In the examples above, during init, Ember objects will effectively call something like this on your binding: ```javascript binding = Ember.Binding.from("valueBinding").to("value"); ``` This creates a new binding instance based on the template you provide, and sets the to path to the `value` property of the new object. Now that the binding is fully configured with a `from` and a `to`, it simply needs to be connected to become active. This is done through the `connect()` method: ```javascript binding.connect(this); ``` Note that when you connect a binding you pass the object you want it to be connected to. This object will be used as the root for both the from and to side of the binding when inspecting relative paths. This allows the binding to be automatically inherited by subclassed objects as well. This also allows you to bind between objects using the paths you declare in `from` and `to`: ```javascript // Example 1 binding = Ember.Binding.from("App.someObject.value").to("value"); binding.connect(this); // Example 2 binding = Ember.Binding.from("parentView.value").to("App.someObject.value"); binding.connect(this); ``` Now that the binding is connected, it will observe both the from and to side and relay changes. If you ever needed to do so (you almost never will, but it is useful to understand this anyway), you could manually create an active binding by using the `Ember.bind()` helper method. (This is the same method used by to setup your bindings on objects): ```javascript Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value"); ``` Both of these code fragments have the same effect as doing the most friendly form of binding creation like so: ```javascript MyApp.anotherObject = Ember.Object.create({ valueBinding: "MyApp.someController.value", // OTHER CODE FOR THIS OBJECT... }); ``` Ember's built in binding creation method makes it easy to automatically create bindings for you. You should always use the highest-level APIs available, even if you understand how it works underneath. @class Binding @namespace Ember @since Ember 0.9 @public */ // Ember.Binding = Binding; ES6TODO: where to put this? /** Global helper method to create a new binding. Just pass the root object along with a `to` and `from` path to create and connect the binding. @method bind @for Ember @param {Object} obj The root object of the transform. @param {String} to The path to the 'to' side of the binding. Must be relative to obj. @param {String} from The path to the 'from' side of the binding. Must be relative to obj or a global path. @return {Ember.Binding} binding instance @public */ function bind(obj, to, from) { return new Binding(to, from).connect(obj); } exports.Binding = Binding; }); enifed('ember-metal/cache', ['exports', 'ember-metal/empty_object'], function (exports, _emberMetalEmpty_object) { 'use strict'; var Cache = (function () { function Cache(limit, func, key, store) { this.size = 0; this.misses = 0; this.hits = 0; this.limit = limit; this.func = func; this.key = key; this.store = store || new DefaultStore(); } Cache.prototype.get = function get(obj) { var key = this.key === undefined ? obj : this.key(obj); var value = this.store.get(key); if (value === undefined) { this.misses++; value = this._set(key, this.func(obj)); } else if (value === UNDEFINED) { this.hits++; value = undefined; } else { this.hits++; // nothing to translate } return value; }; Cache.prototype.set = function set(obj, value) { var key = this.key === undefined ? obj : this.key(obj); return this._set(key, value); }; Cache.prototype._set = function _set(key, value) { if (this.limit > this.size) { this.size++; if (value === undefined) { this.store.set(key, UNDEFINED); } else { this.store.set(key, value); } } return value; }; Cache.prototype.purge = function purge() { this.store.clear(); this.size = 0; this.hits = 0; this.misses = 0; }; return Cache; })(); exports.default = Cache; function UNDEFINED() {} var DefaultStore = (function () { function DefaultStore() { this.data = new _emberMetalEmpty_object.default(); } DefaultStore.prototype.get = function get(key) { return this.data[key]; }; DefaultStore.prototype.set = function set(key, value) { this.data[key] = value; }; DefaultStore.prototype.clear = function clear() { this.data = new _emberMetalEmpty_object.default(); }; return DefaultStore; })(); }); enifed('ember-metal/chains', ['exports', 'ember-metal/property_get', 'ember-metal/meta', 'ember-metal/watch_key', 'ember-metal/empty_object', 'ember-metal/watch_path'], function (exports, _emberMetalProperty_get, _emberMetalMeta, _emberMetalWatch_key, _emberMetalEmpty_object, _emberMetalWatch_path) { 'use strict'; exports.finishChains = finishChains; var FIRST_KEY = /^([^\.]+)/; function firstKey(path) { return path.match(FIRST_KEY)[0]; } function isObject(obj) { return typeof obj === 'object' && obj; } function isVolatile(obj) { return !(isObject(obj) && obj.isDescriptor && obj._volatile === false); } function ChainWatchers() { // chain nodes that reference a key in this obj by key // we only create ChainWatchers when we are going to add them // so create this upfront this.chains = new _emberMetalEmpty_object.default(); } ChainWatchers.prototype = { add: function (key, node) { var nodes = this.chains[key]; if (nodes === undefined) { this.chains[key] = [node]; } else { nodes.push(node); } }, remove: function (key, node) { var nodes = this.chains[key]; if (nodes) { for (var i = 0; i < nodes.length; i++) { if (nodes[i] === node) { nodes.splice(i, 1); break; } } } }, has: function (key, node) { var nodes = this.chains[key]; if (nodes) { for (var i = 0; i < nodes.length; i++) { if (nodes[i] === node) { return true; } } } return false; }, revalidateAll: function () { for (var key in this.chains) { this.notify(key, true, undefined); } }, revalidate: function (key) { this.notify(key, true, undefined); }, // key: the string key that is part of a path changed // revalidate: boolean; the chains that are watching this value should revalidate // callback: function that will be called with the object and path that // will be/are invalidated by this key change, depending on // whether the revalidate flag is passed notify: function (key, revalidate, callback) { var nodes = this.chains[key]; if (nodes === undefined || nodes.length === 0) { return; } var affected = undefined; if (callback) { affected = []; } for (var i = 0; i < nodes.length; i++) { nodes[i].notify(revalidate, affected); } if (callback === undefined) { return; } // we gather callbacks so we don't notify them during revalidation for (var i = 0; i < affected.length; i += 2) { var obj = affected[i]; var path = affected[i + 1]; callback(obj, path); } } }; function makeChainWatcher() { return new ChainWatchers(); } function addChainWatcher(obj, keyName, node) { if (!isObject(obj)) { return; } var m = _emberMetalMeta.meta(obj); m.writableChainWatchers(makeChainWatcher).add(keyName, node); _emberMetalWatch_key.watchKey(obj, keyName, m); } function removeChainWatcher(obj, keyName, node) { if (!isObject(obj)) { return; } var m = _emberMetalMeta.peekMeta(obj); if (!m || !m.readableChainWatchers()) { return; } // make meta writable m = _emberMetalMeta.meta(obj); m.readableChainWatchers().remove(keyName, node); _emberMetalWatch_key.unwatchKey(obj, keyName, m); } // A ChainNode watches a single key on an object. If you provide a starting // value for the key then the node won't actually watch it. For a root node // pass null for parent and key and object for value. function ChainNode(parent, key, value) { this._parent = parent; this._key = key; // _watching is true when calling get(this._parent, this._key) will // return the value of this node. // // It is false for the root of a chain (because we have no parent) // and for global paths (because the parent node is the object with // the observer on it) this._watching = value === undefined; this._chains = undefined; this._object = undefined; this.count = 0; this._value = value; this._paths = {}; if (this._watching) { this._object = parent.value(); if (this._object) { addChainWatcher(this._object, this._key, this); } } } function lazyGet(obj, key) { if (!obj) { return; } var meta = _emberMetalMeta.peekMeta(obj); // check if object meant only to be a prototype if (meta && meta.proto === obj) { return; } // Use `get` if the return value is an EachProxy or an uncacheable value. if (isVolatile(obj[key])) { return _emberMetalProperty_get.get(obj, key); // Otherwise attempt to get the cached value of the computed property } else { var cache = meta.readableCache(); if (cache && key in cache) { return cache[key]; } } } ChainNode.prototype = { value: function () { if (this._value === undefined && this._watching) { var obj = this._parent.value(); this._value = lazyGet(obj, this._key); } return this._value; }, destroy: function () { if (this._watching) { var obj = this._object; if (obj) { removeChainWatcher(obj, this._key, this); } this._watching = false; // so future calls do nothing } }, // copies a top level object only copy: function (obj) { var ret = new ChainNode(null, null, obj); var paths = this._paths; var path = undefined; for (path in paths) { // this check will also catch non-number vals. if (paths[path] <= 0) { continue; } ret.add(path); } return ret; }, // called on the root node of a chain to setup watchers on the specified // path. add: function (path) { var paths = this._paths; paths[path] = (paths[path] || 0) + 1; var key = firstKey(path); var tail = path.slice(key.length + 1); this.chain(key, tail); }, // called on the root node of a chain to teardown watcher on the specified // path remove: function (path) { var paths = this._paths; if (paths[path] > 0) { paths[path]--; } var key = firstKey(path); var tail = path.slice(key.length + 1); this.unchain(key, tail); }, chain: function (key, path) { var chains = this._chains; var node = undefined; if (chains === undefined) { chains = this._chains = new _emberMetalEmpty_object.default(); } else { node = chains[key]; } if (node === undefined) { node = chains[key] = new ChainNode(this, key, undefined); } node.count++; // count chains... // chain rest of path if there is one if (path) { key = firstKey(path); path = path.slice(key.length + 1); node.chain(key, path); } }, unchain: function (key, path) { var chains = this._chains; var node = chains[key]; // unchain rest of path first... if (path && path.length > 1) { var nextKey = firstKey(path); var nextPath = path.slice(nextKey.length + 1); node.unchain(nextKey, nextPath); } // delete node if needed. node.count--; if (node.count <= 0) { chains[node._key] = undefined; node.destroy(); } }, notify: function (revalidate, affected) { if (revalidate && this._watching) { var obj = this._parent.value(); if (obj !== this._object) { removeChainWatcher(this._object, this._key, this); this._object = obj; addChainWatcher(obj, this._key, this); } this._value = undefined; } // then notify chains... var chains = this._chains; var node = undefined; if (chains) { for (var key in chains) { node = chains[key]; if (node !== undefined) { node.notify(revalidate, affected); } } } if (affected && this._parent) { this._parent.populateAffected(this._key, 1, affected); } }, populateAffected: function (path, depth, affected) { if (this._key) { path = this._key + '.' + path; } if (this._parent) { this._parent.populateAffected(path, depth + 1, affected); } else { if (depth > 1) { affected.push(this.value(), path); } } } }; function finishChains(obj) { // We only create meta if we really have to var m = _emberMetalMeta.peekMeta(obj); if (m) { m = _emberMetalMeta.meta(obj); // finish any current chains node watchers that reference obj var chainWatchers = m.readableChainWatchers(); if (chainWatchers) { chainWatchers.revalidateAll(); } // ensure that if we have inherited any chains they have been // copied onto our own meta. if (m.readableChains()) { m.writableChains(_emberMetalWatch_path.makeChainNode); } } } exports.removeChainWatcher = removeChainWatcher; exports.ChainNode = ChainNode; }); enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/property_events', 'ember-metal/dependent_keys'], function (exports, _emberMetalDebug, _emberMetalProperty_set, _emberMetalUtils, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalError, _emberMetalProperties, _emberMetalProperty_events, _emberMetalDependent_keys) { 'use strict'; exports.default = computed; /** @module ember @submodule ember-metal */ function UNDEFINED() {} var DEEP_EACH_REGEX = /\.@each\.[^.]+\./; /** A computed property transforms an object literal with object's accessor function(s) into a property. By default the function backing the computed property will only be called once and the result will be cached. You can specify various properties that your computed property depends on. This will force the cached result to be recomputed if the dependencies are modified. In the following example we declare a computed property - `fullName` - by calling `.Ember.computed()` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function will be called once (regardless of how many times it is accessed) as long as its dependencies have not changed. Once `firstName` or `lastName` are updated any future calls (or anything bound) to `fullName` will incorporate the new values. ```javascript let Person = Ember.Object.extend({ // these will be supplied by `create` firstName: null, lastName: null, fullName: Ember.computed('firstName', 'lastName', function() { let firstName = this.get('firstName'), lastName = this.get('lastName'); return firstName + ' ' + lastName; }) }); let tom = Person.create({ firstName: 'Tom', lastName: 'Dale' }); tom.get('fullName') // 'Tom Dale' ``` You can also define what Ember should do when setting a computed property by providing additional function (`set`) in hash argument. If you try to set a computed property, it will try to invoke setter accessor function with the key and value you want to set it to as arguments. ```javascript let Person = Ember.Object.extend({ // these will be supplied by `create` firstName: null, lastName: null, fullName: Ember.computed('firstName', 'lastName', { get(key) { let firstName = this.get('firstName'), lastName = this.get('lastName'); return firstName + ' ' + lastName; }, set(key, value) { let [firstName, lastName] = value.split(' '); this.set('firstName', firstName); this.set('lastName', lastName); return value; } }) }); let person = Person.create(); person.set('fullName', 'Peter Wagenet'); person.get('firstName'); // 'Peter' person.get('lastName'); // 'Wagenet' ``` You can overwrite computed property with normal property (no longer computed), that won't change if dependencies change, if you set computed property and it won't have setter accessor function defined. You can also mark computed property as `.readOnly()` and block all attempts to set it. ```javascript let Person = Ember.Object.extend({ // these will be supplied by `create` firstName: null, lastName: null, fullName: Ember.computed('firstName', 'lastName', { get(key) { let firstName = this.get('firstName'); let lastName = this.get('lastName'); return firstName + ' ' + lastName; } }).readOnly() }); let person = Person.create(); person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX> ``` Additional resources: - [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md) - [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax) @class ComputedProperty @namespace Ember @public */ function ComputedProperty(config, opts) { this.isDescriptor = true; if (typeof config === 'function') { this._getter = config; } else { this._getter = config.get; this._setter = config.set; } this._dependentKeys = undefined; this._suspended = undefined; this._meta = undefined; this._volatile = false; this._dependentKeys = opts && opts.dependentKeys; this._readOnly = false; } ComputedProperty.prototype = new _emberMetalProperties.Descriptor(); var ComputedPropertyPrototype = ComputedProperty.prototype; /** Call on a computed property to set it into non-cached mode. When in this mode the computed property will not automatically cache the return value. It also does not automatically fire any change events. You must manually notify any changes if you want to observe this property. Dependency keys have no effect on volatile properties as they are for cache invalidation and notification when cached value is invalidated. ```javascript let outsideService = Ember.Object.extend({ value: Ember.computed(function() { return OutsideService.getValue(); }).volatile() }).create(); ``` @method volatile @return {Ember.ComputedProperty} this @chainable @public */ ComputedPropertyPrototype.volatile = function () { this._volatile = true; return this; }; /** Call on a computed property to set it into read-only mode. When in this mode the computed property will throw an error when set. ```javascript let Person = Ember.Object.extend({ guid: Ember.computed(function() { return 'guid-guid-guid'; }).readOnly() }); let person = Person.create(); person.set('guid', 'new-guid'); // will throw an exception ``` @method readOnly @return {Ember.ComputedProperty} this @chainable @public */ ComputedPropertyPrototype.readOnly = function () { this._readOnly = true; return this; }; /** Sets the dependent keys on this computed property. Pass any number of arguments containing key paths that this computed property depends on. ```javascript let President = Ember.Object.extend({ fullName: Ember.computed(function() { return this.get('firstName') + ' ' + this.get('lastName'); // Tell Ember that this computed property depends on firstName // and lastName }).property('firstName', 'lastName') }); let president = President.create({ firstName: 'Barack', lastName: 'Obama' }); president.get('fullName'); // 'Barack Obama' ``` @method property @param {String} path* zero or more property paths @return {Ember.ComputedProperty} this @chainable @public */ ComputedPropertyPrototype.property = function () { var args = []; function addArg(property) { args.push(property); } for (var i = 0; i < arguments.length; i++) { _emberMetalExpand_properties.default(arguments[i], addArg); } this._dependentKeys = args; return this; }; /** In some cases, you may want to annotate computed properties with additional metadata about how they function or what values they operate on. For example, computed property functions may close over variables that are then no longer available for introspection. You can pass a hash of these values to a computed property like this: ``` person: Ember.computed(function() { let personId = this.get('personId'); return App.Person.create({ id: personId }); }).meta({ type: App.Person }) ``` The hash that you pass to the `meta()` function will be saved on the computed property descriptor under the `_meta` key. Ember runtime exposes a public API for retrieving these values from classes, via the `metaForProperty()` function. @method meta @param {Object} meta @chainable @public */ ComputedPropertyPrototype.meta = function (meta) { if (arguments.length === 0) { return this._meta || {}; } else { this._meta = meta; return this; } }; // invalidate cache when CP key changes ComputedPropertyPrototype.didChange = function (obj, keyName) { // _suspended is set via a CP.set to ensure we don't clear // the cached value set by the setter if (this._volatile || this._suspended === obj) { return; } // don't create objects just to invalidate var meta = _emberMetalMeta.peekMeta(obj); if (!meta || meta.source !== obj) { return; } var cache = meta.readableCache(); if (cache && cache[keyName] !== undefined) { cache[keyName] = undefined; _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); } }; ComputedPropertyPrototype.get = function (obj, keyName) { if (this._volatile) { return this._getter.call(obj, keyName); } var meta = _emberMetalMeta.meta(obj); var cache = meta.writableCache(); var result = cache[keyName]; if (result === UNDEFINED) { return undefined; } else if (result !== undefined) { return result; } var ret = this._getter.call(obj, keyName); if (ret === undefined) { cache[keyName] = UNDEFINED; } else { cache[keyName] = ret; } var chainWatchers = meta.readableChainWatchers(); if (chainWatchers) { chainWatchers.revalidate(keyName); } _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); return ret; }; ComputedPropertyPrototype.set = function computedPropertySetEntry(obj, keyName, value) { if (this._readOnly) { this._throwReadOnlyError(obj, keyName); } if (!this._setter) { return this.clobberSet(obj, keyName, value); } if (this._volatile) { return this.volatileSet(obj, keyName, value); } return this.setWithSuspend(obj, keyName, value); }; ComputedPropertyPrototype._throwReadOnlyError = function computedPropertyThrowReadOnlyError(obj, keyName) { throw new _emberMetalError.default('Cannot set read-only property "' + keyName + '" on object: ' + _emberMetalUtils.inspect(obj)); }; ComputedPropertyPrototype.clobberSet = function computedPropertyClobberSet(obj, keyName, value) { var cachedValue = cacheFor(obj, keyName); _emberMetalProperties.defineProperty(obj, keyName, null, cachedValue); _emberMetalProperty_set.set(obj, keyName, value); return value; }; ComputedPropertyPrototype.volatileSet = function computedPropertyVolatileSet(obj, keyName, value) { return this._setter.call(obj, keyName, value); }; ComputedPropertyPrototype.setWithSuspend = function computedPropertySetWithSuspend(obj, keyName, value) { var oldSuspended = this._suspended; this._suspended = obj; try { return this._set(obj, keyName, value); } finally { this._suspended = oldSuspended; } }; ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) { // cache requires own meta var meta = _emberMetalMeta.meta(obj); // either there is a writable cache or we need one to update var cache = meta.writableCache(); var hadCachedValue = false; var cachedValue = undefined; if (cache[keyName] !== undefined) { if (cache[keyName] !== UNDEFINED) { cachedValue = cache[keyName]; } hadCachedValue = true; } var ret = this._setter.call(obj, keyName, value, cachedValue); // allows setter to return the same value that is cached already if (hadCachedValue && cachedValue === ret) { return ret; } _emberMetalProperty_events.propertyWillChange(obj, keyName); if (hadCachedValue) { cache[keyName] = undefined; } if (!hadCachedValue) { _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, meta); } if (ret === undefined) { cache[keyName] = UNDEFINED; } else { cache[keyName] = ret; } _emberMetalProperty_events.propertyDidChange(obj, keyName); return ret; }; /* called before property is overridden */ ComputedPropertyPrototype.teardown = function (obj, keyName) { if (this._volatile) { return; } var meta = _emberMetalMeta.meta(obj); var cache = meta.readableCache(); if (cache && cache[keyName] !== undefined) { _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, meta); cache[keyName] = undefined; } }; /** This helper returns a new property descriptor that wraps the passed computed property function. You can use this helper to define properties with mixins or via `Ember.defineProperty()`. If you pass a function as an argument, it will be used as a getter. A computed property defined in this way might look like this: ```js let Person = Ember.Object.extend({ init() { this._super(...arguments); this.firstName = 'Betty'; this.lastName = 'Jones'; }, fullName: Ember.computed('firstName', 'lastName', function() { return `${this.get('firstName')} ${this.get('lastName')}`; }) }); let client = Person.create(); client.get('fullName'); // 'Betty Jones' client.set('lastName', 'Fuller'); client.get('fullName'); // 'Betty Fuller' ``` You can pass a hash with two functions, `get` and `set`, as an argument to provide both a getter and setter: ```js let Person = Ember.Object.extend({ init() { this._super(...arguments); this.firstName = 'Betty'; this.lastName = 'Jones'; }, fullName: Ember.computed('firstName', 'lastName', { get(key) { return `${this.get('firstName')} ${this.get('lastName')}`; }, set(key, value) { let [firstName, lastName] = value.split(/\s+/); this.setProperties({ firstName, lastName }); return value; } }); }) let client = Person.create(); client.get('firstName'); // 'Betty' client.set('fullName', 'Carroll Fuller'); client.get('firstName'); // 'Carroll' ``` The `set` function should accept two parameters, `key` and `value`. The value returned from `set` will be the new value of the property. _Note: This is the preferred way to define computed properties when writing third-party libraries that depend on or use Ember, since there is no guarantee that the user will have [prototype Extensions](http://emberjs.com/guides/configuring-ember/disabling-prototype-extensions/) enabled._ The alternative syntax, with prototype extensions, might look like: ```js fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') ``` @class computed @namespace Ember @constructor @static @param {String} [dependentKeys*] Optional dependent keys that trigger this computed property. @param {Function} func The computed property function. @return {Ember.ComputedProperty} property descriptor instance @public */ function computed(func) { var args = undefined; if (arguments.length > 1) { args = [].slice.call(arguments); func = args.pop(); } var cp = new ComputedProperty(func); if (args) { cp.property.apply(cp, args); } return cp; } /** Returns the cached value for a property, if one exists. This can be useful for peeking at the value of a computed property that is generated lazily, without accidentally causing it to be created. @method cacheFor @for Ember @param {Object} obj the object whose property you want to check @param {String} key the name of the property whose cached value you want to return @return {Object} the cached value @public */ function cacheFor(obj, key) { var meta = _emberMetalMeta.peekMeta(obj); var cache = meta && meta.source === obj && meta.readableCache(); var ret = cache && cache[key]; if (ret === UNDEFINED) { return undefined; } return ret; } cacheFor.set = function (cache, key, value) { if (value === undefined) { cache[key] = UNDEFINED; } else { cache[key] = value; } }; cacheFor.get = function (cache, key) { var ret = cache[key]; if (ret === UNDEFINED) { return undefined; } return ret; }; cacheFor.remove = function (cache, key) { cache[key] = undefined; }; exports.ComputedProperty = ComputedProperty; exports.computed = computed; exports.cacheFor = cacheFor; }); enifed('ember-metal/core', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { 'use strict'; /** @module ember @submodule ember-metal */ /** This namespace contains all Ember methods and functions. Future versions of Ember may overwrite this namespace and therefore, you should avoid adding any new properties. At the heart of Ember is Ember-Runtime, a set of core functions that provide cross-platform compatibility and object property observing. Ember-Runtime is small and performance-focused so you can use it alongside other cross-platform libraries such as jQuery. For more details, see [Ember-Runtime](http://emberjs.com/api/modules/ember-runtime.html). @class Ember @static @public */ var Ember = typeof _emberEnvironment.context.imports.Ember === 'object' && _emberEnvironment.context.imports.Ember || {}; // Make sure these are set whether Ember was already defined or not Ember.isNamespace = true; Ember.toString = function () { return 'Ember'; }; // .......................................................... // BOOTSTRAP // exports.default = Ember; }); enifed("ember-metal/debug", ["exports"], function (exports) { "use strict"; exports.getDebugFunction = getDebugFunction; exports.setDebugFunction = setDebugFunction; exports.assert = assert; exports.info = info; exports.warn = warn; exports.debug = debug; exports.deprecate = deprecate; exports.deprecateFunc = deprecateFunc; exports.runInDebug = runInDebug; exports.debugSeal = debugSeal; var debugFunctions = { assert: function () {}, info: function () {}, warn: function () {}, debug: function () {}, deprecate: function () {}, deprecateFunc: function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return args[args.length - 1]; }, runInDebug: function () {}, debugSeal: function () {} }; exports.debugFunctions = debugFunctions; function getDebugFunction(name) { return debugFunctions[name]; } function setDebugFunction(name, fn) { debugFunctions[name] = fn; } function assert() { return debugFunctions.assert.apply(undefined, arguments); } function info() { return debugFunctions.info.apply(undefined, arguments); } function warn() { return debugFunctions.warn.apply(undefined, arguments); } function debug() { return debugFunctions.debug.apply(undefined, arguments); } function deprecate() { return debugFunctions.deprecate.apply(undefined, arguments); } function deprecateFunc() { return debugFunctions.deprecateFunc.apply(undefined, arguments); } function runInDebug() { return debugFunctions.runInDebug.apply(undefined, arguments); } function debugSeal() { return debugFunctions.debugSeal.apply(undefined, arguments); } }); enifed('ember-metal/dependent_keys', ['exports', 'ember-metal/watching'], function (exports, _emberMetalWatching) { 'no use strict'; // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed exports.addDependentKeys = addDependentKeys; exports.removeDependentKeys = removeDependentKeys; /** @module ember @submodule ember-metal */ // .......................................................... // DEPENDENT KEYS // function addDependentKeys(desc, obj, keyName, meta) { // the descriptor has a list of dependent keys, so // add all of its dependent keys. var idx = undefined, depKey = undefined; var depKeys = desc._dependentKeys; if (!depKeys) { return; } for (idx = 0; idx < depKeys.length; idx++) { depKey = depKeys[idx]; // Increment the number of times depKey depends on keyName. meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) + 1); // Watch the depKey _emberMetalWatching.watch(obj, depKey, meta); } } function removeDependentKeys(desc, obj, keyName, meta) { // the descriptor has a list of dependent keys, so // remove all of its dependent keys. var depKeys = desc._dependentKeys; if (!depKeys) { return; } for (var idx = 0; idx < depKeys.length; idx++) { var depKey = depKeys[idx]; // Decrement the number of times depKey depends on keyName. meta.writeDeps(depKey, keyName, (meta.peekDeps(depKey, keyName) || 0) - 1); // Unwatch the depKey _emberMetalWatching.unwatch(obj, depKey, meta); } } }); enifed('ember-metal/deprecate_property', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set) { /** @module ember @submodule ember-metal */ 'use strict'; exports.deprecateProperty = deprecateProperty; /** Used internally to allow changing properties in a backwards compatible way, and print a helpful deprecation warning. @method deprecateProperty @param {Object} object The object to add the deprecated property to. @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing). @param {String} newKey The property that will be aliased. @private @since 1.7.0 */ function deprecateProperty(object, deprecatedKey, newKey, options) { function _deprecate() {} Object.defineProperty(object, deprecatedKey, { configurable: true, enumerable: false, set: function (value) { _deprecate(); _emberMetalProperty_set.set(this, newKey, value); }, get: function () { _deprecate(); return _emberMetalProperty_get.get(this, newKey); } }); } }); enifed('ember-metal/descriptor', ['exports', 'ember-metal/properties'], function (exports, _emberMetalProperties) { 'use strict'; exports.default = descriptor; function descriptor(desc) { return new Descriptor(desc); } /** A wrapper for a native ES5 descriptor. In an ideal world, we wouldn't need this at all, however, the way we currently flatten/merge our mixins require a special value to denote a descriptor. @class Descriptor @private */ var Descriptor = (function (_EmberDescriptor) { babelHelpers.inherits(Descriptor, _EmberDescriptor); function Descriptor(desc) { _EmberDescriptor.call(this); this.desc = desc; } Descriptor.prototype.setup = function setup(obj, key) { Object.defineProperty(obj, key, this.desc); }; Descriptor.prototype.teardown = function teardown(obj, key) {}; return Descriptor; })(_emberMetalProperties.Descriptor); }); enifed('ember-metal/dictionary', ['exports', 'ember-metal/empty_object'], function (exports, _emberMetalEmpty_object) { 'use strict'; exports.default = makeDictionary; // the delete is meant to hint at runtimes that this object should remain in // dictionary mode. This is clearly a runtime specific hack, but currently it // appears worthwhile in some usecases. Please note, these deletes do increase // the cost of creation dramatically over a plain Object.create. And as this // only makes sense for long-lived dictionaries that aren't instantiated often. function makeDictionary(parent) { var dict = undefined; if (parent === null) { dict = new _emberMetalEmpty_object.default(); } else { dict = Object.create(parent); } dict['_dict'] = null; delete dict['_dict']; return dict; } }); enifed("ember-metal/empty_object", ["exports"], function (exports) { // This exists because `Object.create(null)` is absurdly slow compared // to `new EmptyObject()`. In either case, you want a null prototype // when you're treating the object instances as arbitrary dictionaries // and don't want your keys colliding with build-in methods on the // default object prototype. "use strict"; var proto = Object.create(null, { // without this, we will always still end up with (new // EmptyObject()).constructor === Object constructor: { value: undefined, enumerable: false, writable: true } }); function EmptyObject() {} EmptyObject.prototype = proto; exports.default = EmptyObject; }); enifed("ember-metal/error", ["exports"], function (exports) { /** A subclass of the JavaScript Error object for use in Ember. @class Error @namespace Ember @extends Error @constructor @public */ "use strict"; exports.default = EmberError; function EmberError(message) { if (!(this instanceof EmberError)) { return new EmberError(message); } var error = Error.call(this, message); if (Error.captureStackTrace) { Error.captureStackTrace(this, EmberError); } else { this.stack = error.stack; } this.description = error.description; this.fileName = error.fileName; this.lineNumber = error.lineNumber; this.message = error.message; this.name = error.name; this.number = error.number; this.code = error.code; } EmberError.prototype = Object.create(Error.prototype); }); enifed('ember-metal/error_handler', ['exports', 'ember-console', 'ember-metal/testing'], function (exports, _emberConsole, _emberMetalTesting) { 'use strict'; exports.getOnerror = getOnerror; exports.setOnerror = setOnerror; exports.dispatchError = dispatchError; exports.setDispatchOverride = setDispatchOverride; // To maintain stacktrace consistency across browsers var getStack = function (error) { var stack = error.stack; var message = error.message; if (stack && stack.indexOf(message) === -1) { stack = message + '\n' + stack; } return stack; }; var onerror = undefined; // Ember.onerror getter function getOnerror() { return onerror; } // Ember.onerror setter function setOnerror(handler) { onerror = handler; } var dispatchOverride = undefined; // dispatch error function dispatchError(error) { if (dispatchOverride) { dispatchOverride(error); } else { defaultDispatch(error); } } // allows testing adapter to override dispatch function setDispatchOverride(handler) { dispatchOverride = handler; } function defaultDispatch(error) { if (_emberMetalTesting.isTesting()) { throw error; } if (onerror) { onerror(error); } else { _emberConsole.default.error(getStack(error)); } } }); enifed('ember-metal/events', ['exports', 'ember-metal/debug', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/meta_listeners'], function (exports, _emberMetalDebug, _emberMetalUtils, _emberMetalMeta, _emberMetalMeta_listeners) { 'no use strict'; // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed /** @module ember @submodule ember-metal */ exports.accumulateListeners = accumulateListeners; exports.addListener = addListener; exports.removeListener = removeListener; exports.suspendListener = suspendListener; exports.suspendListeners = suspendListeners; exports.watchedEvents = watchedEvents; exports.sendEvent = sendEvent; exports.hasListeners = hasListeners; exports.listenersFor = listenersFor; exports.on = on; /* The event system uses a series of nested hashes to store listeners on an object. When a listener is registered, or when an event arrives, these hashes are consulted to determine which target and action pair to invoke. The hashes are stored in the object's meta hash, and look like this: // Object's meta hash { listeners: { // variable name: `listenerSet` "foo:changed": [ // variable name: `actions` target, method, flags ] } } */ function indexOf(array, target, method) { var index = -1; // hashes are added to the end of the event array // so it makes sense to start searching at the end // of the array and search in reverse for (var i = array.length - 3; i >= 0; i -= 3) { if (target === array[i] && method === array[i + 1]) { index = i; break; } } return index; } function accumulateListeners(obj, eventName, otherActions) { var meta = _emberMetalMeta.peekMeta(obj); if (!meta) { return; } var actions = meta.matchingListeners(eventName); var newActions = []; for (var i = actions.length - 3; i >= 0; i -= 3) { var target = actions[i]; var method = actions[i + 1]; var flags = actions[i + 2]; var actionIndex = indexOf(otherActions, target, method); if (actionIndex === -1) { otherActions.push(target, method, flags); newActions.push(target, method, flags); } } return newActions; } /** Add an event listener @method addListener @for Ember @param obj @param {String} eventName @param {Object|Function} target A target object or a function @param {Function|String} method A function or the name of a function to be called on `target` @param {Boolean} once A flag whether a function should only be called once @public */ function addListener(obj, eventName, target, method, once) { if (!method && 'function' === typeof target) { method = target; target = null; } var flags = 0; if (once) { flags |= _emberMetalMeta_listeners.ONCE; } _emberMetalMeta.meta(obj).addToListeners(eventName, target, method, flags); if ('function' === typeof obj.didAddListener) { obj.didAddListener(eventName, target, method); } } /** Remove an event listener Arguments should match those passed to `Ember.addListener`. @method removeListener @for Ember @param obj @param {String} eventName @param {Object|Function} target A target object or a function @param {Function|String} method A function or the name of a function to be called on `target` @public */ function removeListener(obj, eventName, target, method) { if (!method && 'function' === typeof target) { method = target; target = null; } _emberMetalMeta.meta(obj).removeFromListeners(eventName, target, method, function () { if ('function' === typeof obj.didRemoveListener) { obj.didRemoveListener.apply(obj, arguments); } }); } /** Suspend listener during callback. This should only be used by the target of the event listener when it is taking an action that would cause the event, e.g. an object might suspend its property change listener while it is setting that property. @method suspendListener @for Ember @private @param obj @param {String} eventName @param {Object|Function} target A target object or a function @param {Function|String} method A function or the name of a function to be called on `target` @param {Function} callback */ function suspendListener(obj, eventName, target, method, callback) { return suspendListeners(obj, [eventName], target, method, callback); } /** Suspends multiple listeners during a callback. @method suspendListeners @for Ember @private @param obj @param {Array} eventNames Array of event names @param {Object|Function} target A target object or a function @param {Function|String} method A function or the name of a function to be called on `target` @param {Function} callback */ function suspendListeners(obj, eventNames, target, method, callback) { if (!method && 'function' === typeof target) { method = target; target = null; } return _emberMetalMeta.meta(obj).suspendListeners(eventNames, target, method, callback); } /** Return a list of currently watched events @private @method watchedEvents @for Ember @param obj */ function watchedEvents(obj) { return _emberMetalMeta.meta(obj).watchedEvents(); } /** Send an event. The execution of suspended listeners is skipped, and once listeners are removed. A listener without a target is executed on the passed object. If an array of actions is not passed, the actions stored on the passed object are invoked. @method sendEvent @for Ember @param obj @param {String} eventName @param {Array} params Optional parameters for each listener. @param {Array} actions Optional array of actions (listeners). @return true @public */ function sendEvent(obj, eventName, params, actions) { if (!actions) { var meta = _emberMetalMeta.peekMeta(obj); actions = meta && meta.matchingListeners(eventName); } if (!actions || actions.length === 0) { return; } for (var i = actions.length - 3; i >= 0; i -= 3) { // looping in reverse for once listeners var target = actions[i]; var method = actions[i + 1]; var flags = actions[i + 2]; if (!method) { continue; } if (flags & _emberMetalMeta_listeners.SUSPENDED) { continue; } if (flags & _emberMetalMeta_listeners.ONCE) { removeListener(obj, eventName, target, method); } if (!target) { target = obj; } if ('string' === typeof method) { if (params) { _emberMetalUtils.applyStr(target, method, params); } else { target[method](); } } else { if (params) { method.apply(target, params); } else { method.call(target); } } } return true; } /** @private @method hasListeners @for Ember @param obj @param {String} eventName */ function hasListeners(obj, eventName) { var meta = _emberMetalMeta.peekMeta(obj); if (!meta) { return false; } return meta.matchingListeners(eventName).length > 0; } /** @private @method listenersFor @for Ember @param obj @param {String} eventName */ function listenersFor(obj, eventName) { var ret = []; var meta = _emberMetalMeta.peekMeta(obj); var actions = meta && meta.matchingListeners(eventName); if (!actions) { return ret; } for (var i = 0; i < actions.length; i += 3) { var target = actions[i]; var method = actions[i + 1]; ret.push([target, method]); } return ret; } /** Define a property as a function that should be executed when a specified event or events are triggered. ``` javascript let Job = Ember.Object.extend({ logCompleted: Ember.on('completed', function() { console.log('Job completed!'); }) }); let job = Job.create(); Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' ``` @method on @for Ember @param {String} eventNames* @param {Function} func @return func @public */ function on() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var func = args.pop(); var events = args; func.__ember_listens__ = events; return func; } }); enifed('ember-metal/expand_properties', ['exports', 'ember-metal/debug'], function (exports, _emberMetalDebug) { 'use strict'; exports.default = expandProperties; /** @module ember @submodule ember-metal */ var SPLIT_REGEX = /\{|\}/; var END_WITH_EACH_REGEX = /\.@each$/; /** Expands `pattern`, invoking `callback` for each expansion. The only pattern supported is brace-expansion, anything else will be passed once to `callback` directly. Example ```js function echo(arg){ console.log(arg); } Ember.expandProperties('foo.bar', echo); //=> 'foo.bar' Ember.expandProperties('{foo,bar}', echo); //=> 'foo', 'bar' Ember.expandProperties('foo.{bar,baz}', echo); //=> 'foo.bar', 'foo.baz' Ember.expandProperties('{foo,bar}.baz', echo); //=> 'foo.baz', 'bar.baz' Ember.expandProperties('foo.{bar,baz}.[]', echo) //=> 'foo.bar.[]', 'foo.baz.[]' Ember.expandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs' Ember.expandProperties('{foo}.bar.{baz}') //=> 'foo.bar.baz' ``` @method expandProperties @for Ember @private @param {String} pattern The property pattern to expand. @param {Function} callback The callback to invoke. It is invoked once per expansion, and is passed the expansion. */ function expandProperties(pattern, callback) { var parts = pattern.split(SPLIT_REGEX); var properties = [parts]; for (var i = 0; i < parts.length; i++) { var part = parts[i]; if (part.indexOf(',') >= 0) { properties = duplicateAndReplace(properties, part.split(','), i); } } for (var i = 0; i < properties.length; i++) { callback(properties[i].join('').replace(END_WITH_EACH_REGEX, '.[]')); } } function duplicateAndReplace(properties, currentParts, index) { var all = []; properties.forEach(function (property) { currentParts.forEach(function (part) { var current = property.slice(0); current[index] = part; all.push(current); }); }); return all; } }); enifed('ember-metal/features', ['exports', 'ember-environment', 'ember-metal/assign', 'ember/features'], function (exports, _emberEnvironment, _emberMetalAssign, _emberFeatures) { 'use strict'; exports.default = isEnabled; /** The hash of enabled Canary features. Add to this, any canary features before creating your application. Alternatively (and recommended), you can also define `EmberENV.FEATURES` if you need to enable features flagged at runtime. @class FEATURES @namespace Ember @static @since 1.1.0 @public */ var FEATURES = _emberMetalAssign.default(_emberFeatures.default, _emberEnvironment.ENV.FEATURES); exports.FEATURES = FEATURES; /** Determine whether the specified `feature` is enabled. Used by Ember's build tools to exclude experimental features from beta/stable builds. You can define the following configuration options: * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly enabled/disabled. @method isEnabled @param {String} feature The feature to check @return {Boolean} @for Ember.FEATURES @since 1.1.0 @public */ function isEnabled(feature) { var featureValue = FEATURES[feature]; if (featureValue === true || featureValue === false || featureValue === undefined) { return featureValue; } else if (_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES) { return true; } else { return false; } } exports.DEFAULT_FEATURES = _emberFeatures.default; }); enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], function (exports, _emberMetalProperty_get) { 'use strict'; exports.default = getProperties; /** To get multiple properties at once, call `Ember.getProperties` with an object followed by a list of strings or an array: ```javascript Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } ``` is equivalent to: ```javascript Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } ``` @method getProperties @for Ember @param {Object} obj @param {String...|Array} list of keys to get @return {Object} @public */ function getProperties(obj) { var ret = {}; var propertyNames = arguments; var i = 1; if (arguments.length === 2 && Array.isArray(arguments[1])) { i = 0; propertyNames = arguments[1]; } for (; i < propertyNames.length; i++) { ret[propertyNames[i]] = _emberMetalProperty_get.get(obj, propertyNames[i]); } return ret; } }); enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/assign', 'ember-metal/merge', 'ember-metal/debug', 'ember-metal/instrumentation', 'ember-metal/utils', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/meta', 'ember-metal/error', 'ember-metal/cache', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/weak_map', 'ember-metal/events', 'ember-metal/is_none', 'ember-metal/is_empty', 'ember-metal/is_blank', 'ember-metal/is_present', 'ember-metal/run_loop', 'ember-metal/observer_set', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/watch_key', 'ember-metal/chains', 'ember-metal/watch_path', 'ember-metal/watching', 'ember-metal/libraries', 'ember-metal/map', 'ember-metal/get_properties', 'ember-metal/set_properties', 'ember-metal/expand_properties', 'ember-metal/observer', 'ember-metal/mixin', 'ember-metal/binding', 'ember-metal/path_cache', 'ember-metal/symbol', 'ember-metal/dictionary', 'ember-metal/empty_object', 'ember-metal/injected_property', 'ember-metal/tags', 'ember-metal/replace', 'ember-metal/transaction', 'ember-metal/descriptor'], function (exports, _require, _emberMetalCore, _emberMetalComputed, _emberMetalAlias, _emberMetalAssign, _emberMetalMerge, _emberMetalDebug, _emberMetalInstrumentation, _emberMetalUtils, _emberMetalTesting, _emberMetalError_handler, _emberMetalMeta, _emberMetalError, _emberMetalCache, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalWeak_map, _emberMetalEvents, _emberMetalIs_none, _emberMetalIs_empty, _emberMetalIs_blank, _emberMetalIs_present, _emberMetalRun_loop, _emberMetalObserver_set, _emberMetalProperty_events, _emberMetalProperties, _emberMetalWatch_key, _emberMetalChains, _emberMetalWatch_path, _emberMetalWatching, _emberMetalLibraries, _emberMetalMap, _emberMetalGet_properties, _emberMetalSet_properties, _emberMetalExpand_properties, _emberMetalObserver, _emberMetalMixin, _emberMetalBinding, _emberMetalPath_cache, _emberMetalSymbol, _emberMetalDictionary, _emberMetalEmpty_object, _emberMetalInjected_property, _emberMetalTags, _emberMetalReplace, _emberMetalTransaction, _emberMetalDescriptor) { /** @module ember @submodule ember-metal */ 'use strict'; exports.default = _emberMetalCore.default; // reexports exports.computed = _emberMetalComputed.default; exports.cacheFor = _emberMetalComputed.cacheFor; exports.ComputedProperty = _emberMetalComputed.ComputedProperty; exports.alias = _emberMetalAlias.default; exports.assign = _emberMetalAssign.default; exports.merge = _emberMetalMerge.default; exports.assert = _emberMetalDebug.assert; exports.info = _emberMetalDebug.info; exports.warn = _emberMetalDebug.warn; exports.debug = _emberMetalDebug.debug; exports.deprecate = _emberMetalDebug.deprecate; exports.deprecateFunc = _emberMetalDebug.deprecateFunc; exports.runInDebug = _emberMetalDebug.runInDebug; exports.setDebugFunction = _emberMetalDebug.setDebugFunction; exports.getDebugFunction = _emberMetalDebug.getDebugFunction; exports.instrument = _emberMetalInstrumentation.instrument; exports.flaggedInstrument = _emberMetalInstrumentation.flaggedInstrument; exports._instrumentStart = _emberMetalInstrumentation._instrumentStart; exports.instrumentationReset = _emberMetalInstrumentation.reset; exports.instrumentationSubscribe = _emberMetalInstrumentation.subscribe; exports.instrumentationUnsubscribe = _emberMetalInstrumentation.unsubscribe; exports.intern = _emberMetalUtils.intern; exports.GUID_KEY = _emberMetalUtils.GUID_KEY; exports.GUID_KEY_PROPERTY = _emberMetalUtils.GUID_KEY_PROPERTY; exports.applyStr = _emberMetalUtils.applyStr; exports.canInvoke = _emberMetalUtils.canInvoke; exports.generateGuid = _emberMetalUtils.generateGuid; exports.guidFor = _emberMetalUtils.guidFor; exports.inspect = _emberMetalUtils.inspect; exports.makeArray = _emberMetalUtils.makeArray; exports.tryInvoke = _emberMetalUtils.tryInvoke; exports.uuid = _emberMetalUtils.uuid; exports.wrap = _emberMetalUtils.wrap; exports.isTesting = _emberMetalTesting.isTesting; exports.setTesting = _emberMetalTesting.setTesting; exports.getOnerror = _emberMetalError_handler.getOnerror; exports.setOnerror = _emberMetalError_handler.setOnerror; exports.dispatchError = _emberMetalError_handler.dispatchError; exports.setDispatchOverride = _emberMetalError_handler.setDispatchOverride; exports.META_DESC = _emberMetalMeta.META_DESC; exports.meta = _emberMetalMeta.meta; exports.peekMeta = _emberMetalMeta.peekMeta; exports.Error = _emberMetalError.default; exports.Cache = _emberMetalCache.default; exports.isFeatureEnabled = _emberMetalFeatures.default; exports.FEATURES = _emberMetalFeatures.FEATURES; exports.DEFAULT_FEATURES = _emberMetalFeatures.DEFAULT_FEATURES; exports._getPath = _emberMetalProperty_get._getPath; exports.get = _emberMetalProperty_get.get; exports.getWithDefault = _emberMetalProperty_get.getWithDefault; exports.set = _emberMetalProperty_set.set; exports.trySet = _emberMetalProperty_set.trySet; exports.WeakMap = _emberMetalWeak_map.default; exports.accumulateListeners = _emberMetalEvents.accumulateListeners; exports.addListener = _emberMetalEvents.addListener; exports.hasListeners = _emberMetalEvents.hasListeners; exports.listenersFor = _emberMetalEvents.listenersFor; exports.on = _emberMetalEvents.on; exports.removeListener = _emberMetalEvents.removeListener; exports.sendEvent = _emberMetalEvents.sendEvent; exports.suspendListener = _emberMetalEvents.suspendListener; exports.suspendListeners = _emberMetalEvents.suspendListeners; exports.watchedEvents = _emberMetalEvents.watchedEvents; exports.isNone = _emberMetalIs_none.default; exports.isEmpty = _emberMetalIs_empty.default; exports.isBlank = _emberMetalIs_blank.default; exports.isPresent = _emberMetalIs_present.default; exports.run = _emberMetalRun_loop.default; exports.ObserverSet = _emberMetalObserver_set.default; exports.beginPropertyChanges = _emberMetalProperty_events.beginPropertyChanges; exports.changeProperties = _emberMetalProperty_events.changeProperties; exports.endPropertyChanges = _emberMetalProperty_events.endPropertyChanges; exports.overrideChains = _emberMetalProperty_events.overrideChains; exports.propertyDidChange = _emberMetalProperty_events.propertyDidChange; exports.propertyWillChange = _emberMetalProperty_events.propertyWillChange; exports.PROPERTY_DID_CHANGE = _emberMetalProperty_events.PROPERTY_DID_CHANGE; exports.defineProperty = _emberMetalProperties.defineProperty; exports.Descriptor = _emberMetalProperties.Descriptor; exports.watchKey = _emberMetalWatch_key.watchKey; exports.unwatchKey = _emberMetalWatch_key.unwatchKey; exports.ChainNode = _emberMetalChains.ChainNode; exports.finishChains = _emberMetalChains.finishChains; exports.removeChainWatcher = _emberMetalChains.removeChainWatcher; exports.watchPath = _emberMetalWatch_path.watchPath; exports.unwatchPath = _emberMetalWatch_path.unwatchPath; exports.destroy = _emberMetalWatching.destroy; exports.isWatching = _emberMetalWatching.isWatching; exports.rewatch = _emberMetalWatching.rewatch; exports.unwatch = _emberMetalWatching.unwatch; exports.watch = _emberMetalWatching.watch; exports.watcherCount = _emberMetalWatching.watcherCount; exports.libraries = _emberMetalLibraries.default; exports.Map = _emberMetalMap.Map; exports.MapWithDefault = _emberMetalMap.MapWithDefault; exports.OrderedSet = _emberMetalMap.OrderedSet; exports.getProperties = _emberMetalGet_properties.default; exports.setProperties = _emberMetalSet_properties.default; exports.expandProperties = _emberMetalExpand_properties.default; exports._suspendObserver = _emberMetalObserver._suspendObserver; exports._suspendObservers = _emberMetalObserver._suspendObservers; exports.addObserver = _emberMetalObserver.addObserver; exports.observersFor = _emberMetalObserver.observersFor; exports.removeObserver = _emberMetalObserver.removeObserver; exports._addBeforeObserver = _emberMetalObserver._addBeforeObserver; exports._removeBeforeObserver = _emberMetalObserver._removeBeforeObserver; exports.NAME_KEY = _emberMetalMixin.NAME_KEY; exports.Mixin = _emberMetalMixin.Mixin; exports.aliasMethod = _emberMetalMixin.aliasMethod; exports._immediateObserver = _emberMetalMixin._immediateObserver; exports._beforeObserver = _emberMetalMixin._beforeObserver; exports.mixin = _emberMetalMixin.mixin; exports.observer = _emberMetalMixin.observer; exports.required = _emberMetalMixin.required; exports.REQUIRED = _emberMetalMixin.REQUIRED; exports.hasUnprocessedMixins = _emberMetalMixin.hasUnprocessedMixins; exports.clearUnprocessedMixins = _emberMetalMixin.clearUnprocessedMixins; exports.detectBinding = _emberMetalMixin.detectBinding; exports.Binding = _emberMetalBinding.Binding; exports.bind = _emberMetalBinding.bind; exports.isGlobalPath = _emberMetalPath_cache.isGlobalPath; exports.symbol = _emberMetalSymbol.default; exports.dictionary = _emberMetalDictionary.default; exports.EmptyObject = _emberMetalEmpty_object.default; exports.InjectedProperty = _emberMetalInjected_property.default; exports.setHasViews = _emberMetalTags.setHasViews; exports.tagFor = _emberMetalTags.tagFor; exports.markObjectAsDirty = _emberMetalTags.markObjectAsDirty; exports.replace = _emberMetalReplace.default; exports.runInTransaction = _emberMetalTransaction.default; exports.didRender = _emberMetalTransaction.didRender; exports.assertNotRendered = _emberMetalTransaction.assertNotRendered; exports.descriptor = _emberMetalDescriptor.default; // TODO: this needs to be deleted once we refactor the build tooling // do this for side-effects of updating Ember.assert, warn, etc when // ember-debug is present // This needs to be called before any deprecateFunc if (_require.has('ember-debug')) { _require.default('ember-debug'); } }); enifed('ember-metal/injected_property', ['exports', 'ember-metal/debug', 'ember-metal/computed', 'ember-metal/alias', 'ember-metal/properties', 'container'], function (exports, _emberMetalDebug, _emberMetalComputed, _emberMetalAlias, _emberMetalProperties, _container) { 'use strict'; exports.default = InjectedProperty; /** Read-only property that returns the result of a container lookup. @class InjectedProperty @namespace Ember @constructor @param {String} type The container type the property will lookup @param {String} name (optional) The name the property will lookup, defaults to the property's name @private */ function InjectedProperty(type, name) { this.type = type; this.name = name; this._super$Constructor(injectedPropertyGet); AliasedPropertyPrototype.oneWay.call(this); } function injectedPropertyGet(keyName) { var desc = this[keyName]; var owner = _container.getOwner(this) || this.container; // fallback to `container` for backwards compat return owner.lookup(desc.type + ':' + (desc.name || keyName)); } InjectedProperty.prototype = Object.create(_emberMetalProperties.Descriptor.prototype); var InjectedPropertyPrototype = InjectedProperty.prototype; var ComputedPropertyPrototype = _emberMetalComputed.ComputedProperty.prototype; var AliasedPropertyPrototype = _emberMetalAlias.AliasedProperty.prototype; InjectedPropertyPrototype._super$Constructor = _emberMetalComputed.ComputedProperty; InjectedPropertyPrototype.get = ComputedPropertyPrototype.get; InjectedPropertyPrototype.readOnly = ComputedPropertyPrototype.readOnly; InjectedPropertyPrototype.teardown = ComputedPropertyPrototype.teardown; }); enifed('ember-metal/instrumentation', ['exports', 'ember-environment', 'ember-metal/features'], function (exports, _emberEnvironment, _emberMetalFeatures) { 'use strict'; exports.instrument = instrument; exports._instrumentStart = _instrumentStart; exports.subscribe = subscribe; exports.unsubscribe = unsubscribe; exports.reset = reset; /** The purpose of the Ember Instrumentation module is to provide efficient, general-purpose instrumentation for Ember. Subscribe to a listener by using `Ember.subscribe`: ```javascript Ember.subscribe("render", { before(name, timestamp, payload) { }, after(name, timestamp, payload) { } }); ``` If you return a value from the `before` callback, that same value will be passed as a fourth parameter to the `after` callback. Instrument a block of code by using `Ember.instrument`: ```javascript Ember.instrument("render.handlebars", payload, function() { // rendering logic }, binding); ``` Event names passed to `Ember.instrument` are namespaced by periods, from more general to more specific. Subscribers can listen for events by whatever level of granularity they are interested in. In the above example, the event is `render.handlebars`, and the subscriber listened for all events beginning with `render`. It would receive callbacks for events named `render`, `render.handlebars`, `render.container`, or even `render.handlebars.layout`. @class Instrumentation @namespace Ember @static @private */ var subscribers = []; exports.subscribers = subscribers; var cache = {}; function populateListeners(name) { var listeners = []; var subscriber = undefined; for (var i = 0; i < subscribers.length; i++) { subscriber = subscribers[i]; if (subscriber.regex.test(name)) { listeners.push(subscriber.object); } } cache[name] = listeners; return listeners; } var time = (function () { var perf = 'undefined' !== typeof window ? window.performance || {} : {}; var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow; // fn.bind will be available in all the browsers that support the advanced window.performance... ;-) return fn ? fn.bind(perf) : function () { return +new Date(); }; })(); /** Notifies event's subscribers, calls `before` and `after` hooks. @method instrument @namespace Ember.Instrumentation @param {String} [name] Namespaced event name. @param {Object} _payload @param {Function} callback Function that you're instrumenting. @param {Object} binding Context that instrument function is called with. @private */ function instrument(name, _payload, callback, binding) { if (arguments.length <= 3 && typeof _payload === 'function') { binding = callback; callback = _payload; _payload = undefined; } if (subscribers.length === 0) { return callback.call(binding); } var payload = _payload || {}; var finalizer = _instrumentStart(name, function () { return payload; }); if (finalizer) { return withFinalizer(callback, finalizer, payload, binding); } else { return callback.call(binding); } } var flaggedInstrument = undefined; if (false) { exports.flaggedInstrument = flaggedInstrument = instrument; } else { exports.flaggedInstrument = flaggedInstrument = function (name, payload, callback) { return callback(); }; } exports.flaggedInstrument = flaggedInstrument; function withFinalizer(callback, finalizer, payload, binding) { var result = undefined; try { result = callback.call(binding); } catch (e) { payload.exception = e; result = payload; } finally { finalizer(); return result; } } function NOOP() {} // private for now function _instrumentStart(name, _payload, _payloadParam) { if (subscribers.length === 0) { return NOOP; } var listeners = cache[name]; if (!listeners) { listeners = populateListeners(name); } if (listeners.length === 0) { return NOOP; } var payload = _payload(_payloadParam); var STRUCTURED_PROFILE = _emberEnvironment.ENV.STRUCTURED_PROFILE; var timeName = undefined; if (STRUCTURED_PROFILE) { timeName = name + ': ' + payload.object; console.time(timeName); } var beforeValues = new Array(listeners.length); var i = undefined, listener = undefined; var timestamp = time(); for (i = 0; i < listeners.length; i++) { listener = listeners[i]; beforeValues[i] = listener.before(name, timestamp, payload); } return function _instrumentEnd() { var i = undefined, listener = undefined; var timestamp = time(); for (i = 0; i < listeners.length; i++) { listener = listeners[i]; if (typeof listener.after === 'function') { listener.after(name, timestamp, payload, beforeValues[i]); } } if (STRUCTURED_PROFILE) { console.timeEnd(timeName); } }; } /** Subscribes to a particular event or instrumented block of code. @method subscribe @namespace Ember.Instrumentation @param {String} [pattern] Namespaced event name. @param {Object} [object] Before and After hooks. @return {Subscriber} @private */ function subscribe(pattern, object) { var paths = pattern.split('.'); var path = undefined; var regex = []; for (var i = 0; i < paths.length; i++) { path = paths[i]; if (path === '*') { regex.push('[^\\.]*'); } else { regex.push(path); } } regex = regex.join('\\.'); regex = regex + '(\\..*)?'; var subscriber = { pattern: pattern, regex: new RegExp('^' + regex + '$'), object: object }; subscribers.push(subscriber); cache = {}; return subscriber; } /** Unsubscribes from a particular event or instrumented block of code. @method unsubscribe @namespace Ember.Instrumentation @param {Object} [subscriber] @private */ function unsubscribe(subscriber) { var index = undefined; for (var i = 0; i < subscribers.length; i++) { if (subscribers[i] === subscriber) { index = i; } } subscribers.splice(index, 1); cache = {}; } /** Resets `Ember.Instrumentation` by flushing list of subscribers. @method reset @namespace Ember.Instrumentation @private */ function reset() { subscribers.length = 0; cache = {}; } }); enifed('ember-metal/is_blank', ['exports', 'ember-metal/is_empty'], function (exports, _emberMetalIs_empty) { 'use strict'; exports.default = isBlank; /** A value is blank if it is empty or a whitespace string. ```javascript Ember.isBlank(); // true Ember.isBlank(null); // true Ember.isBlank(undefined); // true Ember.isBlank(''); // true Ember.isBlank([]); // true Ember.isBlank('\n\t'); // true Ember.isBlank(' '); // true Ember.isBlank({}); // false Ember.isBlank('\n\t Hello'); // false Ember.isBlank('Hello world'); // false Ember.isBlank([1,2,3]); // false ``` @method isBlank @for Ember @param {Object} obj Value to test @return {Boolean} @since 1.5.0 @public */ function isBlank(obj) { return _emberMetalIs_empty.default(obj) || typeof obj === 'string' && obj.match(/\S/) === null; } }); enifed('ember-metal/is_empty', ['exports', 'ember-metal/property_get', 'ember-metal/is_none'], function (exports, _emberMetalProperty_get, _emberMetalIs_none) { 'use strict'; exports.default = isEmpty; /** Verifies that a value is `null` or an empty string, empty array, or empty function. Constrains the rules on `Ember.isNone` by returning true for empty string and empty arrays. ```javascript Ember.isEmpty(); // true Ember.isEmpty(null); // true Ember.isEmpty(undefined); // true Ember.isEmpty(''); // true Ember.isEmpty([]); // true Ember.isEmpty({}); // false Ember.isEmpty('Adam Hawkins'); // false Ember.isEmpty([0,1,2]); // false Ember.isEmpty('\n\t'); // false Ember.isEmpty(' '); // false ``` @method isEmpty @for Ember @param {Object} obj Value to test @return {Boolean} @public */ function isEmpty(obj) { var none = _emberMetalIs_none.default(obj); if (none) { return none; } if (typeof obj.size === 'number') { return !obj.size; } var objectType = typeof obj; if (objectType === 'object') { var size = _emberMetalProperty_get.get(obj, 'size'); if (typeof size === 'number') { return !size; } } if (typeof obj.length === 'number' && objectType !== 'function') { return !obj.length; } if (objectType === 'object') { var _length = _emberMetalProperty_get.get(obj, 'length'); if (typeof _length === 'number') { return !_length; } } return false; } }); enifed("ember-metal/is_none", ["exports"], function (exports) { /** Returns true if the passed value is null or undefined. This avoids errors from JSLint complaining about use of ==, which can be technically confusing. ```javascript Ember.isNone(); // true Ember.isNone(null); // true Ember.isNone(undefined); // true Ember.isNone(''); // false Ember.isNone([]); // false Ember.isNone(function() {}); // false ``` @method isNone @for Ember @param {Object} obj Value to test @return {Boolean} @public */ "use strict"; exports.default = isNone; function isNone(obj) { return obj === null || obj === undefined; } }); enifed('ember-metal/is_present', ['exports', 'ember-metal/is_blank'], function (exports, _emberMetalIs_blank) { 'use strict'; exports.default = isPresent; /** A value is present if it not `isBlank`. ```javascript Ember.isPresent(); // false Ember.isPresent(null); // false Ember.isPresent(undefined); // false Ember.isPresent(''); // false Ember.isPresent(' '); // false Ember.isPresent('\n\t'); // false Ember.isPresent([]); // false Ember.isPresent({ length: 0 }) // false Ember.isPresent(false); // true Ember.isPresent(true); // true Ember.isPresent('string'); // true Ember.isPresent(0); // true Ember.isPresent(function() {}) // true Ember.isPresent({}); // true Ember.isPresent(false); // true Ember.isPresent('\n\t Hello'); // true Ember.isPresent([1,2,3]); // true ``` @method isPresent @for Ember @param {Object} obj Value to test @return {Boolean} @since 1.8.0 @public */ function isPresent(obj) { return !_emberMetalIs_blank.default(obj); } }); enifed('ember-metal/libraries', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) { 'use strict'; exports.Libraries = Libraries; /** Helper class that allows you to register your library with Ember. Singleton created at `Ember.libraries`. @class Libraries @constructor @private */ function Libraries() { this._registry = []; this._coreLibIndex = 0; } Libraries.prototype = { constructor: Libraries, _getLibraryByName: function (name) { var libs = this._registry; var count = libs.length; for (var i = 0; i < count; i++) { if (libs[i].name === name) { return libs[i]; } } }, register: function (name, version, isCoreLibrary) { var index = this._registry.length; if (!this._getLibraryByName(name)) { if (isCoreLibrary) { index = this._coreLibIndex++; } this._registry.splice(index, 0, { name: name, version: version }); } else {} }, registerCoreLibrary: function (name, version) { this.register(name, version, true); }, deRegister: function (name) { var lib = this._getLibraryByName(name); var index = undefined; if (lib) { index = this._registry.indexOf(lib); this._registry.splice(index, 1); } } }; if (false) { Libraries.prototype.isRegistered = function (name) { return !!this._getLibraryByName(name); }; } exports.default = new Libraries(); }); enifed('ember-metal/map', ['exports', 'ember-metal/utils', 'ember-metal/empty_object'], function (exports, _emberMetalUtils, _emberMetalEmpty_object) { /** @module ember @submodule ember-metal */ /* JavaScript (before ES6) does not have a Map implementation. Objects, which are often used as dictionaries, may only have Strings as keys. Because Ember has a way to get a unique identifier for every object via `Ember.guidFor`, we can implement a performant Map with arbitrary keys. Because it is commonly used in low-level bookkeeping, Map is implemented as a pure JavaScript object for performance. This implementation follows the current iteration of the ES6 proposal for maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets), with one exception: as we do not have the luxury of in-VM iteration, we implement a forEach method for iteration. Map is mocked out to look like an Ember object, so you can do `Ember.Map.create()` for symmetry with other Ember classes. */ 'use strict'; function missingFunction(fn) { throw new TypeError(Object.prototype.toString.call(fn) + ' is not a function'); } function missingNew(name) { throw new TypeError('Constructor ' + name + ' requires \'new\''); } function copyNull(obj) { var output = new _emberMetalEmpty_object.default(); for (var prop in obj) { // hasOwnPropery is not needed because obj is new EmptyObject(); output[prop] = obj[prop]; } return output; } function copyMap(original, newObject) { var keys = original._keys.copy(); var values = copyNull(original._values); newObject._keys = keys; newObject._values = values; newObject.size = original.size; return newObject; } /** This class is used internally by Ember and Ember Data. Please do not use it at this time. We plan to clean it up and add many tests soon. @class OrderedSet @namespace Ember @constructor @private */ function OrderedSet() { if (this instanceof OrderedSet) { this.clear(); this._silenceRemoveDeprecation = false; } else { missingNew('OrderedSet'); } } /** @method create @static @return {Ember.OrderedSet} @private */ OrderedSet.create = function () { var Constructor = this; return new Constructor(); }; OrderedSet.prototype = { constructor: OrderedSet, /** @method clear @private */ clear: function () { this.presenceSet = new _emberMetalEmpty_object.default(); this.list = []; this.size = 0; }, /** @method add @param obj @param guid (optional, and for internal use) @return {Ember.OrderedSet} @private */ add: function (obj, _guid) { var guid = _guid || _emberMetalUtils.guidFor(obj); var presenceSet = this.presenceSet; var list = this.list; if (presenceSet[guid] !== true) { presenceSet[guid] = true; this.size = list.push(obj); } return this; }, /** @since 1.8.0 @method delete @param obj @param _guid (optional and for internal use only) @return {Boolean} @private */ delete: function (obj, _guid) { var guid = _guid || _emberMetalUtils.guidFor(obj); var presenceSet = this.presenceSet; var list = this.list; if (presenceSet[guid] === true) { delete presenceSet[guid]; var index = list.indexOf(obj); if (index > -1) { list.splice(index, 1); } this.size = list.length; return true; } else { return false; } }, /** @method isEmpty @return {Boolean} @private */ isEmpty: function () { return this.size === 0; }, /** @method has @param obj @return {Boolean} @private */ has: function (obj) { if (this.size === 0) { return false; } var guid = _emberMetalUtils.guidFor(obj); var presenceSet = this.presenceSet; return presenceSet[guid] === true; }, /** @method forEach @param {Function} fn @param self @private */ forEach: function (fn /*, ...thisArg*/) { if (typeof fn !== 'function') { missingFunction(fn); } if (this.size === 0) { return; } var list = this.list; if (arguments.length === 2) { for (var i = 0; i < list.length; i++) { fn.call(arguments[1], list[i]); } } else { for (var i = 0; i < list.length; i++) { fn(list[i]); } } }, /** @method toArray @return {Array} @private */ toArray: function () { return this.list.slice(); }, /** @method copy @return {Ember.OrderedSet} @private */ copy: function () { var Constructor = this.constructor; var set = new Constructor(); set._silenceRemoveDeprecation = this._silenceRemoveDeprecation; set.presenceSet = copyNull(this.presenceSet); set.list = this.toArray(); set.size = this.size; return set; } }; /** A Map stores values indexed by keys. Unlike JavaScript's default Objects, the keys of a Map can be any JavaScript object. Internally, a Map has two data structures: 1. `keys`: an OrderedSet of all of the existing keys 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)` When a key/value pair is added for the first time, we add the key to the `keys` OrderedSet, and create or replace an entry in `values`. When an entry is deleted, we delete its entry in `keys` and `values`. @class Map @namespace Ember @private @constructor */ function Map() { if (this instanceof Map) { this._keys = OrderedSet.create(); this._keys._silenceRemoveDeprecation = true; this._values = new _emberMetalEmpty_object.default(); this.size = 0; } else { missingNew('Map'); } } /** @method create @static @private */ Map.create = function () { var Constructor = this; return new Constructor(); }; Map.prototype = { constructor: Map, /** This property will change as the number of objects in the map changes. @since 1.8.0 @property size @type number @default 0 @private */ size: 0, /** Retrieve the value associated with a given key. @method get @param {*} key @return {*} the value associated with the key, or `undefined` @private */ get: function (key) { if (this.size === 0) { return; } var values = this._values; var guid = _emberMetalUtils.guidFor(key); return values[guid]; }, /** Adds a value to the map. If a value for the given key has already been provided, the new value will replace the old value. @method set @param {*} key @param {*} value @return {Ember.Map} @private */ set: function (key, value) { var keys = this._keys; var values = this._values; var guid = _emberMetalUtils.guidFor(key); // ensure we don't store -0 var k = key === -0 ? 0 : key; keys.add(k, guid); values[guid] = value; this.size = keys.size; return this; }, /** Removes a value from the map for an associated key. @since 1.8.0 @method delete @param {*} key @return {Boolean} true if an item was removed, false otherwise @private */ delete: function (key) { if (this.size === 0) { return false; } // don't use ES6 "delete" because it will be annoying // to use in browsers that are not ES6 friendly; var keys = this._keys; var values = this._values; var guid = _emberMetalUtils.guidFor(key); if (keys.delete(key, guid)) { delete values[guid]; this.size = keys.size; return true; } else { return false; } }, /** Check whether a key is present. @method has @param {*} key @return {Boolean} true if the item was present, false otherwise @private */ has: function (key) { return this._keys.has(key); }, /** Iterate over all the keys and values. Calls the function once for each key, passing in value, key, and the map being iterated over, in that order. The keys are guaranteed to be iterated over in insertion order. @method forEach @param {Function} callback @param {*} self if passed, the `this` value inside the callback. By default, `this` is the map. @private */ forEach: function (callback /*, ...thisArg*/) { if (typeof callback !== 'function') { missingFunction(callback); } if (this.size === 0) { return; } var map = this; var cb = undefined, thisArg = undefined; if (arguments.length === 2) { thisArg = arguments[1]; cb = function (key) { return callback.call(thisArg, map.get(key), key, map); }; } else { cb = function (key) { return callback(map.get(key), key, map); }; } this._keys.forEach(cb); }, /** @method clear @private */ clear: function () { this._keys.clear(); this._values = new _emberMetalEmpty_object.default(); this.size = 0; }, /** @method copy @return {Ember.Map} @private */ copy: function () { return copyMap(this, new Map()); } }; /** @class MapWithDefault @namespace Ember @extends Ember.Map @private @constructor @param [options] @param {*} [options.defaultValue] */ function MapWithDefault(options) { this._super$constructor(); this.defaultValue = options.defaultValue; } /** @method create @static @param [options] @param {*} [options.defaultValue] @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns `Ember.MapWithDefault` otherwise returns `Ember.Map` @private */ MapWithDefault.create = function (options) { if (options) { return new MapWithDefault(options); } else { return new Map(); } }; MapWithDefault.prototype = Object.create(Map.prototype); MapWithDefault.prototype.constructor = MapWithDefault; MapWithDefault.prototype._super$constructor = Map; MapWithDefault.prototype._super$get = Map.prototype.get; /** Retrieve the value associated with a given key. @method get @param {*} key @return {*} the value associated with the key, or the default value @private */ MapWithDefault.prototype.get = function (key) { var hasValue = this.has(key); if (hasValue) { return this._super$get(key); } else { var defaultValue = this.defaultValue(key); this.set(key, defaultValue); return defaultValue; } }; /** @method copy @return {Ember.MapWithDefault} @private */ MapWithDefault.prototype.copy = function () { var Constructor = this.constructor; return copyMap(this, new Constructor({ defaultValue: this.defaultValue })); }; exports.default = Map; exports.OrderedSet = OrderedSet; exports.Map = Map; exports.MapWithDefault = MapWithDefault; }); enifed('ember-metal/merge', ['exports'], function (exports) { /** Merge the contents of two objects together into the first object. ```javascript Ember.merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } var a = { first: 'Yehuda' }; var b = { last: 'Katz' }; Ember.merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } ``` @method merge @for Ember @param {Object} original The object to merge into @param {Object} updates The object to copy properties from @return {Object} @public */ 'use strict'; exports.default = merge; function merge(original, updates) { if (!updates || typeof updates !== 'object') { return original; } var props = Object.keys(updates); var prop = undefined; for (var i = 0; i < props.length; i++) { prop = props[i]; original[prop] = updates[prop]; } return original; } }); enifed('ember-metal/meta', ['exports', 'ember-metal/features', 'ember-metal/meta_listeners', 'ember-metal/empty_object', 'ember-metal/utils', 'ember-metal/symbol'], function (exports, _emberMetalFeatures, _emberMetalMeta_listeners, _emberMetalEmpty_object, _emberMetalUtils, _emberMetalSymbol) { 'no use strict'; // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed exports.meta = meta; exports.peekMeta = peekMeta; exports.deleteMeta = deleteMeta; /** @module ember-metal */ /* This declares several meta-programmed members on the Meta class. Such meta! In general, the `readable` variants will give you an object (if it already exists) that you can read but should not modify. The `writable` variants will give you a mutable object, and they will create it if it didn't already exist. The following methods will get generated metaprogrammatically, and I'm including them here for greppability: writableCache, readableCache, writeWatching, peekWatching, clearWatching, writeMixins, peekMixins, clearMixins, writeBindings, peekBindings, clearBindings, writeValues, peekValues, clearValues, writeDeps, forEachInDeps writableChainWatchers, readableChainWatchers, writableChains, readableChains, writableTag, readableTag */ var members = { cache: ownMap, weak: ownMap, watching: inheritedMap, mixins: inheritedMap, bindings: inheritedMap, values: inheritedMap, deps: inheritedMapOfMaps, chainWatchers: ownCustomObject, chains: inheritedCustomObject, tag: ownCustomObject }; if (false || false) { members.lastRendered = ownMap; members.lastRenderedFrom = ownMap; // FIXME: not used in production, remove me from prod builds } var memberNames = Object.keys(members); var META_FIELD = '__ember_meta__'; function Meta(obj, parentMeta) { this._cache = undefined; this._weak = undefined; this._watching = undefined; this._mixins = undefined; this._bindings = undefined; this._values = undefined; this._deps = undefined; this._chainWatchers = undefined; this._chains = undefined; this._tag = undefined; // used only internally this.source = obj; // when meta(obj).proto === obj, the object is intended to be only a // prototype and doesn't need to actually be observable itself this.proto = undefined; // The next meta in our inheritance chain. We (will) track this // explicitly instead of using prototypical inheritance because we // have detailed knowledge of how each property should really be // inherited, and we can optimize it much better than JS runtimes. this.parent = parentMeta; if (false || false) { this._lastRendered = undefined; this._lastRenderedFrom = undefined; // FIXME: not used in production, remove me from prod builds } this._initializeListeners(); } Meta.prototype.isInitialized = function (obj) { return this.proto !== obj; }; for (var _name in _emberMetalMeta_listeners.protoMethods) { Meta.prototype[_name] = _emberMetalMeta_listeners.protoMethods[_name]; } memberNames.forEach(function (name) { return members[name](name, Meta); }); // Implements a member that is a lazily created, non-inheritable // POJO. function ownMap(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['writable' + capitalized] = function () { return this._getOrCreateOwnMap(key); }; Meta.prototype['readable' + capitalized] = function () { return this[key]; }; } Meta.prototype._getOrCreateOwnMap = function (key) { var ret = this[key]; if (!ret) { ret = this[key] = new _emberMetalEmpty_object.default(); } return ret; }; // Implements a member that is a lazily created POJO with inheritable // values. function inheritedMap(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['write' + capitalized] = function (subkey, value) { var map = this._getOrCreateOwnMap(key); map[subkey] = value; }; Meta.prototype['peek' + capitalized] = function (subkey) { return this._findInherited(key, subkey); }; Meta.prototype['forEach' + capitalized] = function (fn) { var pointer = this; var seen = new _emberMetalEmpty_object.default(); while (pointer !== undefined) { var map = pointer[key]; if (map) { for (var _key in map) { if (!seen[_key]) { seen[_key] = true; fn(_key, map[_key]); } } } pointer = pointer.parent; } }; Meta.prototype['clear' + capitalized] = function () { this[key] = undefined; }; Meta.prototype['deleteFrom' + capitalized] = function (subkey) { delete this._getOrCreateOwnMap(key)[subkey]; }; Meta.prototype['hasIn' + capitalized] = function (subkey) { return this._findInherited(key, subkey) !== undefined; }; } Meta.prototype._getInherited = function (key) { var pointer = this; while (pointer !== undefined) { if (pointer[key]) { return pointer[key]; } pointer = pointer.parent; } }; Meta.prototype._findInherited = function (key, subkey) { var pointer = this; while (pointer !== undefined) { var map = pointer[key]; if (map) { var value = map[subkey]; if (value !== undefined) { return value; } } pointer = pointer.parent; } }; var UNDEFINED = _emberMetalSymbol.default('undefined'); exports.UNDEFINED = UNDEFINED; // Implements a member that provides a lazily created map of maps, // with inheritance at both levels. function inheritedMapOfMaps(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['write' + capitalized] = function (subkey, itemkey, value) { var outerMap = this._getOrCreateOwnMap(key); var innerMap = outerMap[subkey]; if (!innerMap) { innerMap = outerMap[subkey] = new _emberMetalEmpty_object.default(); } innerMap[itemkey] = value; }; Meta.prototype['peek' + capitalized] = function (subkey, itemkey) { var pointer = this; while (pointer !== undefined) { var map = pointer[key]; if (map) { var value = map[subkey]; if (value) { if (value[itemkey] !== undefined) { return value[itemkey]; } } } pointer = pointer.parent; } }; Meta.prototype['has' + capitalized] = function (subkey) { var pointer = this; while (pointer !== undefined) { if (pointer[key] && pointer[key][subkey]) { return true; } pointer = pointer.parent; } return false; }; Meta.prototype['forEachIn' + capitalized] = function (subkey, fn) { return this._forEachIn(key, subkey, fn); }; } Meta.prototype._forEachIn = function (key, subkey, fn) { var pointer = this; var seen = new _emberMetalEmpty_object.default(); var calls = []; while (pointer !== undefined) { var map = pointer[key]; if (map) { var innerMap = map[subkey]; if (innerMap) { for (var innerKey in innerMap) { if (!seen[innerKey]) { seen[innerKey] = true; calls.push([innerKey, innerMap[innerKey]]); } } } } pointer = pointer.parent; } for (var i = 0; i < calls.length; i++) { var _calls$i = calls[i]; var innerKey = _calls$i[0]; var value = _calls$i[1]; fn(innerKey, value); } }; // Implements a member that provides a non-heritable, lazily-created // object using the method you provide. function ownCustomObject(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['writable' + capitalized] = function (create) { var ret = this[key]; if (!ret) { ret = this[key] = create(this.source); } return ret; }; Meta.prototype['readable' + capitalized] = function () { return this[key]; }; } // Implements a member that provides an inheritable, lazily-created // object using the method you provide. We will derived children from // their parents by calling your object's `copy()` method. function inheritedCustomObject(name, Meta) { var key = memberProperty(name); var capitalized = capitalize(name); Meta.prototype['writable' + capitalized] = function (create) { var ret = this[key]; if (!ret) { if (this.parent) { ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source); } else { ret = this[key] = create(this.source); } } return ret; }; Meta.prototype['readable' + capitalized] = function () { return this._getInherited(key); }; } function memberProperty(name) { return '_' + name; } // there's a more general-purpose capitalize in ember-runtime, but we // don't want to make ember-metal depend on ember-runtime. function capitalize(name) { return name.replace(/^\w/, function (m) { return m.toUpperCase(); }); } var META_DESC = { writable: true, configurable: true, enumerable: false, value: null }; exports.META_DESC = META_DESC; var EMBER_META_PROPERTY = { name: META_FIELD, descriptor: META_DESC }; if (false) { Meta.prototype.readInheritedValue = function (key, subkey) { var internalKey = '_' + key; var pointer = this; while (pointer !== undefined) { var map = pointer[internalKey]; if (map) { var value = map[subkey]; if (value !== undefined || subkey in map) { return map[subkey]; } } pointer = pointer.parent; } return UNDEFINED; }; Meta.prototype.writeValue = function (obj, key, value) { var descriptor = _emberMetalUtils.lookupDescriptor(obj, key); var isMandatorySetter = descriptor && descriptor.set && descriptor.set.isMandatorySetter; if (isMandatorySetter) { this.writeValues(key, value); } else { obj[key] = value; } }; } // choose the one appropriate for given platform var setMeta = function (obj, meta) { // if `null` already, just set it to the new value // otherwise define property first if (obj[META_FIELD] !== null) { if (obj.__defineNonEnumerable) { obj.__defineNonEnumerable(EMBER_META_PROPERTY); } else { Object.defineProperty(obj, META_FIELD, META_DESC); } } obj[META_FIELD] = meta; }; /** Retrieves the meta hash for an object. If `writable` is true ensures the hash is writable for this object as well. The meta object contains information about computed property descriptors as well as any watched properties and other information. You generally will not access this information directly but instead work with higher level methods that manipulate this hash indirectly. @method meta @for Ember @private @param {Object} obj The object to retrieve meta for @param {Boolean} [writable=true] Pass `false` if you do not intend to modify the meta hash, allowing the method to avoid making an unnecessary copy. @return {Object} the meta hash for an object */ function meta(obj) { var maybeMeta = peekMeta(obj); var parent = undefined; // remove this code, in-favor of explicit parent if (maybeMeta) { if (maybeMeta.source === obj) { return maybeMeta; } parent = maybeMeta; } var newMeta = new Meta(obj, parent); setMeta(obj, newMeta); return newMeta; } function peekMeta(obj) { return obj[META_FIELD]; } function deleteMeta(obj) { if (typeof obj[META_FIELD] !== 'object') { return; } obj[META_FIELD] = null; } }); enifed('ember-metal/meta_listeners', ['exports'], function (exports) { /* When we render a rich template hierarchy, the set of events that *might* happen tends to be much larger than the set of events that actually happen. This implies that we should make listener creation & destruction cheap, even at the cost of making event dispatch more expensive. Thus we store a new listener with a single push and no new allocations, without even bothering to do deduplication -- we can save that for dispatch time, if an event actually happens. */ /* listener flags */ 'use strict'; var ONCE = 1; exports.ONCE = ONCE; var SUSPENDED = 2; exports.SUSPENDED = SUSPENDED; var protoMethods = { addToListeners: function (eventName, target, method, flags) { if (!this._listeners) { this._listeners = []; } this._listeners.push(eventName, target, method, flags); }, _finalizeListeners: function () { if (this._listenersFinalized) { return; } if (!this._listeners) { this._listeners = []; } var pointer = this.parent; while (pointer) { var listeners = pointer._listeners; if (listeners) { this._listeners = this._listeners.concat(listeners); } if (pointer._listenersFinalized) { break; } pointer = pointer.parent; } this._listenersFinalized = true; }, removeFromListeners: function (eventName, target, method, didRemove) { var pointer = this; while (pointer) { var listeners = pointer._listeners; if (listeners) { for (var index = listeners.length - 4; index >= 0; index -= 4) { if (listeners[index] === eventName && (!method || listeners[index + 1] === target && listeners[index + 2] === method)) { if (pointer === this) { // we are modifying our own list, so we edit directly if (typeof didRemove === 'function') { didRemove(eventName, target, listeners[index + 2]); } listeners.splice(index, 4); } else { // we are trying to remove an inherited listener, so we do // just-in-time copying to detach our own listeners from // our inheritance chain. this._finalizeListeners(); return this.removeFromListeners(eventName, target, method); } } } } if (pointer._listenersFinalized) { break; } pointer = pointer.parent; } }, matchingListeners: function (eventName) { var pointer = this; var result = []; while (pointer) { var listeners = pointer._listeners; if (listeners) { for (var index = 0; index < listeners.length - 3; index += 4) { if (listeners[index] === eventName) { pushUniqueListener(result, listeners, index); } } } if (pointer._listenersFinalized) { break; } pointer = pointer.parent; } var sus = this._suspendedListeners; if (sus) { for (var susIndex = 0; susIndex < sus.length - 2; susIndex += 3) { if (eventName === sus[susIndex]) { for (var resultIndex = 0; resultIndex < result.length - 2; resultIndex += 3) { if (result[resultIndex] === sus[susIndex + 1] && result[resultIndex + 1] === sus[susIndex + 2]) { result[resultIndex + 2] |= SUSPENDED; } } } } } return result; }, suspendListeners: function (eventNames, target, method, callback) { var sus = this._suspendedListeners; if (!sus) { sus = this._suspendedListeners = []; } for (var i = 0; i < eventNames.length; i++) { sus.push(eventNames[i], target, method); } try { return callback.call(target); } finally { if (sus.length === eventNames.length) { this._suspendedListeners = undefined; } else { for (var i = sus.length - 3; i >= 0; i -= 3) { if (sus[i + 1] === target && sus[i + 2] === method && eventNames.indexOf(sus[i]) !== -1) { sus.splice(i, 3); } } } } }, watchedEvents: function () { var pointer = this; var names = {}; while (pointer) { var listeners = pointer._listeners; if (listeners) { for (var index = 0; index < listeners.length - 3; index += 4) { names[listeners[index]] = true; } } if (pointer._listenersFinalized) { break; } pointer = pointer.parent; } return Object.keys(names); }, _initializeListeners: function () { this._listeners = undefined; this._listenersFinalized = undefined; this._suspendedListeners = undefined; } }; exports.protoMethods = protoMethods; function pushUniqueListener(destination, source, index) { var target = source[index + 1]; var method = source[index + 2]; for (var destinationIndex = 0; destinationIndex < destination.length - 2; destinationIndex += 3) { if (destination[destinationIndex] === target && destination[destinationIndex + 1] === method) { return; } } destination.push(target, method, source[index + 3]); } }); enifed('ember-metal/mixin', ['exports', 'ember-metal/error', 'ember-metal/debug', 'ember-metal/assign', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events'], function (exports, _emberMetalError, _emberMetalDebug, _emberMetalAssign, _emberMetalUtils, _emberMetalMeta, _emberMetalExpand_properties, _emberMetalProperties, _emberMetalComputed, _emberMetalBinding, _emberMetalObserver, _emberMetalEvents) { 'no use strict'; // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed /** @module ember @submodule ember-metal */ exports.detectBinding = detectBinding; exports.mixin = mixin; exports.default = Mixin; exports.hasUnprocessedMixins = hasUnprocessedMixins; exports.clearUnprocessedMixins = clearUnprocessedMixins; exports.required = required; exports.aliasMethod = aliasMethod; exports.observer = observer; exports._immediateObserver = _immediateObserver; exports._beforeObserver = _beforeObserver; function ROOT() {} ROOT.__hasSuper = false; var a_slice = [].slice; function isMethod(obj) { return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String; } var CONTINUE = {}; function mixinProperties(mixinsMeta, mixin) { var guid = undefined; if (mixin instanceof Mixin) { guid = _emberMetalUtils.guidFor(mixin); if (mixinsMeta.peekMixins(guid)) { return CONTINUE; } mixinsMeta.writeMixins(guid, mixin); return mixin.properties; } else { return mixin; // apply anonymous mixin properties } } function concatenatedMixinProperties(concatProp, props, values, base) { var concats = undefined; // reset before adding each new mixin to pickup concats from previous concats = values[concatProp] || base[concatProp]; if (props[concatProp]) { concats = concats ? concats.concat(props[concatProp]) : props[concatProp]; } return concats; } function giveDescriptorSuper(meta, key, property, values, descs, base) { var superProperty = undefined; // Computed properties override methods, and do not call super to them if (values[key] === undefined) { // Find the original descriptor in a parent mixin superProperty = descs[key]; } // If we didn't find the original descriptor in a parent mixin, find // it on the original object. if (!superProperty) { var possibleDesc = base[key]; var superDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; superProperty = superDesc; } if (superProperty === undefined || !(superProperty instanceof _emberMetalComputed.ComputedProperty)) { return property; } // Since multiple mixins may inherit from the same parent, we need // to clone the computed property so that other mixins do not receive // the wrapped version. property = Object.create(property); property._getter = _emberMetalUtils.wrap(property._getter, superProperty._getter); if (superProperty._setter) { if (property._setter) { property._setter = _emberMetalUtils.wrap(property._setter, superProperty._setter); } else { property._setter = superProperty._setter; } } return property; } function giveMethodSuper(obj, key, method, values, descs) { var superMethod = undefined; // Methods overwrite computed properties, and do not call super to them. if (descs[key] === undefined) { // Find the original method in a parent mixin superMethod = values[key]; } // If we didn't find the original value in a parent mixin, find it in // the original object superMethod = superMethod || obj[key]; // Only wrap the new method if the original method was a function if (superMethod === undefined || 'function' !== typeof superMethod) { return method; } return _emberMetalUtils.wrap(method, superMethod); } function applyConcatenatedProperties(obj, key, value, values) { var baseValue = values[key] || obj[key]; if (baseValue) { if ('function' === typeof baseValue.concat) { if (value === null || value === undefined) { return baseValue; } else { return baseValue.concat(value); } } else { return _emberMetalUtils.makeArray(baseValue).concat(value); } } else { return _emberMetalUtils.makeArray(value); } } function applyMergedProperties(obj, key, value, values) { var baseValue = values[key] || obj[key]; if (!baseValue) { return value; } var newBase = _emberMetalAssign.default({}, baseValue); var hasFunction = false; for (var prop in value) { if (!value.hasOwnProperty(prop)) { continue; } var propValue = value[prop]; if (isMethod(propValue)) { // TODO: support for Computed Properties, etc? hasFunction = true; newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {}); } else { newBase[prop] = propValue; } } if (hasFunction) { newBase._super = ROOT; } return newBase; } function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) { if (value instanceof _emberMetalProperties.Descriptor) { if (value === REQUIRED && descs[key]) { return CONTINUE; } // Wrap descriptor function to implement // _super() if needed if (value._getter) { value = giveDescriptorSuper(meta, key, value, values, descs, base); } descs[key] = value; values[key] = undefined; } else { if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') { value = applyConcatenatedProperties(base, key, value, values); } else if (mergings && mergings.indexOf(key) >= 0) { value = applyMergedProperties(base, key, value, values); } else if (isMethod(value)) { value = giveMethodSuper(base, key, value, values, descs); } descs[key] = undefined; values[key] = value; } } function mergeMixins(mixins, m, descs, values, base, keys) { var currentMixin = undefined, props = undefined, key = undefined, concats = undefined, mergings = undefined, meta = undefined; function removeKeys(keyName) { delete descs[keyName]; delete values[keyName]; } for (var i = 0; i < mixins.length; i++) { currentMixin = mixins[i]; props = mixinProperties(m, currentMixin); if (props === CONTINUE) { continue; } if (props) { meta = _emberMetalMeta.meta(base); if (base.willMergeMixin) { base.willMergeMixin(props); } concats = concatenatedMixinProperties('concatenatedProperties', props, values, base); mergings = concatenatedMixinProperties('mergedProperties', props, values, base); for (key in props) { if (!props.hasOwnProperty(key)) { continue; } keys.push(key); addNormalizedProperty(base, key, props[key], meta, descs, values, concats, mergings); } // manually copy toString() because some JS engines do not enumerate it if (props.hasOwnProperty('toString')) { base.toString = props.toString; } } else if (currentMixin.mixins) { mergeMixins(currentMixin.mixins, m, descs, values, base, keys); if (currentMixin._without) { currentMixin._without.forEach(removeKeys); } } } } function detectBinding(key) { var length = key.length; return length > 7 && key.charCodeAt(length - 7) === 66 && key.indexOf('inding', length - 6) !== -1; } // warm both paths of above function detectBinding('notbound'); detectBinding('fooBinding'); function connectBindings(obj, m) { // TODO Mixin.apply(instance) should disconnect binding if exists m.forEachBindings(function (key, binding) { if (binding) { var to = key.slice(0, -7); // strip Binding off end if (binding instanceof _emberMetalBinding.Binding) { binding = binding.copy(); // copy prototypes' instance binding.to(to); } else { // binding is string path binding = new _emberMetalBinding.Binding(to, binding); } binding.connect(obj); obj[key] = binding; } }); // mark as applied m.clearBindings(); } function finishPartial(obj, m) { connectBindings(obj, m || _emberMetalMeta.meta(obj)); return obj; } function followAlias(obj, desc, m, descs, values) { var altKey = desc.methodName; var value = undefined; var possibleDesc = undefined; if (descs[altKey] || values[altKey]) { value = values[altKey]; desc = descs[altKey]; } else if ((possibleDesc = obj[altKey]) && possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { desc = possibleDesc; value = undefined; } else { desc = undefined; value = obj[altKey]; } return { desc: desc, value: value }; } function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) { var paths = observerOrListener[pathsKey]; if (paths) { for (var i = 0; i < paths.length; i++) { updateMethod(obj, paths[i], null, key); } } } function replaceObserversAndListeners(obj, key, observerOrListener) { var prev = obj[key]; if ('function' === typeof prev) { updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _emberMetalObserver._removeBeforeObserver); updateObserversAndListeners(obj, key, prev, '__ember_observes__', _emberMetalObserver.removeObserver); updateObserversAndListeners(obj, key, prev, '__ember_listens__', _emberMetalEvents.removeListener); } if ('function' === typeof observerOrListener) { updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _emberMetalObserver._addBeforeObserver); updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', _emberMetalObserver.addObserver); updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', _emberMetalEvents.addListener); } } function applyMixin(obj, mixins, partial) { var descs = {}; var values = {}; var m = _emberMetalMeta.meta(obj); var keys = []; var key = undefined, value = undefined, desc = undefined; obj._super = ROOT; // Go through all mixins and hashes passed in, and: // // * Handle concatenated properties // * Handle merged properties // * Set up _super wrapping if necessary // * Set up computed property descriptors // * Copying `toString` in broken browsers mergeMixins(mixins, m, descs, values, obj, keys); for (var i = 0; i < keys.length; i++) { key = keys[i]; if (key === 'constructor' || !values.hasOwnProperty(key)) { continue; } desc = descs[key]; value = values[key]; if (desc === REQUIRED) { continue; } while (desc && desc instanceof Alias) { var followed = followAlias(obj, desc, m, descs, values); desc = followed.desc; value = followed.value; } if (desc === undefined && value === undefined) { continue; } replaceObserversAndListeners(obj, key, value); if (detectBinding(key)) { m.writeBindings(key, value); } _emberMetalProperties.defineProperty(obj, key, desc, value, m); } if (!partial) { // don't apply to prototype finishPartial(obj, m); } return obj; } /** @method mixin @for Ember @param obj @param mixins* @return obj @private */ function mixin(obj) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } applyMixin(obj, args, false); return obj; } var NAME_KEY = _emberMetalUtils.GUID_KEY + '_name'; exports.NAME_KEY = NAME_KEY; /** The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance, ```javascript const EditableMixin = Ember.Mixin.create({ edit() { console.log('starting to edit'); this.set('isEditing', true); }, isEditing: false }); // Mix mixins into classes by passing them as the first arguments to // `.extend.` const Comment = Ember.Object.extend(EditableMixin, { post: null }); let comment = Comment.create(post: somePost); comment.edit(); // outputs 'starting to edit' ``` Note that Mixins are created with `Ember.Mixin.create`, not `Ember.Mixin.extend`. Note that mixins extend a constructor's prototype so arrays and object literals defined as properties will be shared amongst objects that implement the mixin. If you want to define a property in a mixin that is not shared, you can define it either as a computed property or have it be created on initialization of the object. ```javascript // filters array will be shared amongst any object implementing mixin const FilterableMixin = Ember.Mixin.create({ filters: Ember.A() }); // filters will be a separate array for every object implementing the mixin const FilterableMixin = Ember.Mixin.create({ filters: Ember.computed(function() { return Ember.A(); }) }); // filters will be created as a separate array during the object's initialization const Filterable = Ember.Mixin.create({ init() { this._super(...arguments); this.set("filters", Ember.A()); } }); ``` @class Mixin @namespace Ember @public */ function Mixin(args, properties) { this.properties = properties; var length = args && args.length; if (length > 0) { var m = new Array(length); for (var i = 0; i < length; i++) { var x = args[i]; if (x instanceof Mixin) { m[i] = x; } else { m[i] = new Mixin(undefined, x); } } this.mixins = m; } else { this.mixins = undefined; } this.ownerConstructor = undefined; this._without = undefined; this[_emberMetalUtils.GUID_KEY] = null; this[NAME_KEY] = null; } Mixin._apply = applyMixin; Mixin.applyPartial = function (obj) { var args = a_slice.call(arguments, 1); return applyMixin(obj, args, true); }; Mixin.finishPartial = finishPartial; var unprocessedFlag = false; function hasUnprocessedMixins() { return unprocessedFlag; } function clearUnprocessedMixins() { unprocessedFlag = false; } /** @method create @static @param arguments* @public */ Mixin.create = function () { // ES6TODO: this relies on a global state? unprocessedFlag = true; var M = this; for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return new M(args, undefined); }; var MixinPrototype = Mixin.prototype; /** @method reopen @param arguments* @private */ MixinPrototype.reopen = function () { var currentMixin = undefined; if (this.properties) { currentMixin = new Mixin(undefined, this.properties); this.properties = undefined; this.mixins = [currentMixin]; } else if (!this.mixins) { this.mixins = []; } var mixins = this.mixins; var idx = undefined; for (idx = 0; idx < arguments.length; idx++) { currentMixin = arguments[idx]; if (currentMixin instanceof Mixin) { mixins.push(currentMixin); } else { mixins.push(new Mixin(undefined, currentMixin)); } } return this; }; /** @method apply @param obj @return applied object @private */ MixinPrototype.apply = function (obj) { return applyMixin(obj, [this], false); }; MixinPrototype.applyPartial = function (obj) { return applyMixin(obj, [this], true); }; MixinPrototype.toString = Object.toString; function _detect(curMixin, targetMixin, seen) { var guid = _emberMetalUtils.guidFor(curMixin); if (seen[guid]) { return false; } seen[guid] = true; if (curMixin === targetMixin) { return true; } var mixins = curMixin.mixins; var loc = mixins ? mixins.length : 0; while (--loc >= 0) { if (_detect(mixins[loc], targetMixin, seen)) { return true; } } return false; } /** @method detect @param obj @return {Boolean} @private */ MixinPrototype.detect = function (obj) { if (typeof obj !== 'object' || obj === null) { return false; } if (obj instanceof Mixin) { return _detect(obj, this, {}); } var m = _emberMetalMeta.peekMeta(obj); if (!m) { return false; } return !!m.peekMixins(_emberMetalUtils.guidFor(this)); }; MixinPrototype.without = function () { var ret = new Mixin([this]); for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } ret._without = args; return ret; }; function _keys(ret, mixin, seen) { if (seen[_emberMetalUtils.guidFor(mixin)]) { return; } seen[_emberMetalUtils.guidFor(mixin)] = true; if (mixin.properties) { var props = Object.keys(mixin.properties); for (var i = 0; i < props.length; i++) { var key = props[i]; ret[key] = true; } } else if (mixin.mixins) { mixin.mixins.forEach(function (x) { return _keys(ret, x, seen); }); } } MixinPrototype.keys = function () { var keys = {}; var seen = {}; _keys(keys, this, seen); var ret = Object.keys(keys); return ret; }; // returns the mixins currently applied to the specified object // TODO: Make Ember.mixin Mixin.mixins = function (obj) { var m = _emberMetalMeta.peekMeta(obj); var ret = []; if (!m) { return ret; } m.forEachMixins(function (key, currentMixin) { // skip primitive mixins since these are always anonymous if (!currentMixin.properties) { ret.push(currentMixin); } }); return ret; }; var REQUIRED = new _emberMetalProperties.Descriptor(); REQUIRED.toString = function () { return '(Required Property)'; }; /** Denotes a required property for a mixin @method required @for Ember @private */ function required() { return REQUIRED; } function Alias(methodName) { this.isDescriptor = true; this.methodName = methodName; } Alias.prototype = new _emberMetalProperties.Descriptor(); /** Makes a method available via an additional name. ```javascript App.Person = Ember.Object.extend({ name: function() { return 'Tomhuda Katzdale'; }, moniker: Ember.aliasMethod('name') }); let goodGuy = App.Person.create(); goodGuy.name(); // 'Tomhuda Katzdale' goodGuy.moniker(); // 'Tomhuda Katzdale' ``` @method aliasMethod @for Ember @param {String} methodName name of the method to alias @public */ function aliasMethod(methodName) { return new Alias(methodName); } // .......................................................... // OBSERVER HELPER // /** Specify a method that observes property changes. ```javascript Ember.Object.extend({ valueObserver: Ember.observer('value', function() { // Executes whenever the "value" property changes }) }); ``` Also available as `Function.prototype.observes` if prototype extensions are enabled. @method observer @for Ember @param {String} propertyNames* @param {Function} func @return func @public */ function observer() { for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } var func = args.slice(-1)[0]; var paths = undefined; var addWatchedProperty = function (path) { paths.push(path); }; var _paths = args.slice(0, -1); if (typeof func !== 'function') { func = args[0]; // revert to old, soft-deprecated argument ordering _paths = args.slice(1); } paths = []; for (var i = 0; i < _paths.length; ++i) { _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); } if (typeof func !== 'function') { throw new _emberMetalError.default('Ember.observer called without a function'); } func.__ember_observes__ = paths; return func; } /** Specify a method that observes property changes. ```javascript Ember.Object.extend({ valueObserver: Ember.immediateObserver('value', function() { // Executes whenever the "value" property changes }) }); ``` In the future, `Ember.observer` may become asynchronous. In this event, `Ember.immediateObserver` will maintain the synchronous behavior. Also available as `Function.prototype.observesImmediately` if prototype extensions are enabled. @method _immediateObserver @for Ember @param {String} propertyNames* @param {Function} func @deprecated Use `Ember.observer` instead. @return func @private */ function _immediateObserver() { for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; } return observer.apply(this, arguments); } /** When observers fire, they are called with the arguments `obj`, `keyName`. Note, `@each.property` observer is called per each add or replace of an element and it's not called with a specific enumeration item. A `_beforeObserver` fires before a property changes. @method beforeObserver @for Ember @param {String} propertyNames* @param {Function} func @return func @deprecated @private */ function _beforeObserver() { for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } var func = args.slice(-1)[0]; var paths = undefined; var addWatchedProperty = function (path) { paths.push(path); }; var _paths = args.slice(0, -1); if (typeof func !== 'function') { // revert to old, soft-deprecated argument ordering func = args[0]; _paths = args.slice(1); } paths = []; for (var i = 0; i < _paths.length; ++i) { _emberMetalExpand_properties.default(_paths[i], addWatchedProperty); } if (typeof func !== 'function') { throw new _emberMetalError.default('_beforeObserver called without a function'); } func.__ember_observesBefore__ = paths; return func; } exports.Mixin = Mixin; exports.required = required; exports.REQUIRED = REQUIRED; }); // use conditional to avoid stringifying every time enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/events'], function (exports, _emberMetalWatching, _emberMetalEvents) { 'use strict'; exports.addObserver = addObserver; exports.observersFor = observersFor; exports.removeObserver = removeObserver; exports._addBeforeObserver = _addBeforeObserver; exports._suspendObserver = _suspendObserver; exports._suspendObservers = _suspendObservers; exports._removeBeforeObserver = _removeBeforeObserver; /** @module ember-metal */ var AFTER_OBSERVERS = ':change'; var BEFORE_OBSERVERS = ':before'; function changeEvent(keyName) { return keyName + AFTER_OBSERVERS; } function beforeEvent(keyName) { return keyName + BEFORE_OBSERVERS; } /** @method addObserver @for Ember @param obj @param {String} _path @param {Object|Function} target @param {Function|String} [method] @public */ function addObserver(obj, _path, target, method) { _emberMetalEvents.addListener(obj, changeEvent(_path), target, method); _emberMetalWatching.watch(obj, _path); return this; } function observersFor(obj, path) { return _emberMetalEvents.listenersFor(obj, changeEvent(path)); } /** @method removeObserver @for Ember @param obj @param {String} path @param {Object|Function} target @param {Function|String} [method] @public */ function removeObserver(obj, path, target, method) { _emberMetalWatching.unwatch(obj, path); _emberMetalEvents.removeListener(obj, changeEvent(path), target, method); return this; } /** @method _addBeforeObserver @for Ember @param obj @param {String} path @param {Object|Function} target @param {Function|String} [method] @deprecated @private */ function _addBeforeObserver(obj, path, target, method) { _emberMetalEvents.addListener(obj, beforeEvent(path), target, method); _emberMetalWatching.watch(obj, path); return this; } // Suspend observer during callback. // // This should only be used by the target of the observer // while it is setting the observed path. function _suspendObserver(obj, path, target, method, callback) { return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback); } function _suspendObservers(obj, paths, target, method, callback) { var events = paths.map(changeEvent); return _emberMetalEvents.suspendListeners(obj, events, target, method, callback); } /** @method removeBeforeObserver @for Ember @param obj @param {String} path @param {Object|Function} target @param {Function|String} [method] @deprecated @private */ function _removeBeforeObserver(obj, path, target, method) { _emberMetalWatching.unwatch(obj, path); _emberMetalEvents.removeListener(obj, beforeEvent(path), target, method); return this; } }); enifed('ember-metal/observer_set', ['exports', 'ember-metal/utils', 'ember-metal/events'], function (exports, _emberMetalUtils, _emberMetalEvents) { 'use strict'; exports.default = ObserverSet; /* this.observerSet = { [senderGuid]: { // variable name: `keySet` [keyName]: listIndex } }, this.observers = [ { sender: obj, keyName: keyName, eventName: eventName, listeners: [ [target, method, flags] ] }, ... ] */ function ObserverSet() { this.clear(); } ObserverSet.prototype.add = function (sender, keyName, eventName) { var observerSet = this.observerSet; var observers = this.observers; var senderGuid = _emberMetalUtils.guidFor(sender); var keySet = observerSet[senderGuid]; var index = undefined; if (!keySet) { observerSet[senderGuid] = keySet = {}; } index = keySet[keyName]; if (index === undefined) { index = observers.push({ sender: sender, keyName: keyName, eventName: eventName, listeners: [] }) - 1; keySet[keyName] = index; } return observers[index].listeners; }; ObserverSet.prototype.flush = function () { var observers = this.observers; var i = undefined, observer = undefined, sender = undefined; this.clear(); for (i = 0; i < observers.length; ++i) { observer = observers[i]; sender = observer.sender; if (sender.isDestroying || sender.isDestroyed) { continue; } _emberMetalEvents.sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners); } }; ObserverSet.prototype.clear = function () { this.observerSet = {}; this.observers = []; }; }); enifed('ember-metal/path_cache', ['exports', 'ember-metal/cache'], function (exports, _emberMetalCache) { 'use strict'; exports.isGlobal = isGlobal; exports.isGlobalPath = isGlobalPath; exports.hasThis = hasThis; exports.isPath = isPath; exports.getFirstKey = getFirstKey; exports.getTailPath = getTailPath; var IS_GLOBAL = /^[A-Z$]/; var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; var HAS_THIS = 'this.'; var isGlobalCache = new _emberMetalCache.default(1000, function (key) { return IS_GLOBAL.test(key); }); var isGlobalPathCache = new _emberMetalCache.default(1000, function (key) { return IS_GLOBAL_PATH.test(key); }); var hasThisCache = new _emberMetalCache.default(1000, function (key) { return key.lastIndexOf(HAS_THIS, 0) === 0; }); var firstDotIndexCache = new _emberMetalCache.default(1000, function (key) { return key.indexOf('.'); }); var firstKeyCache = new _emberMetalCache.default(1000, function (path) { var index = firstDotIndexCache.get(path); if (index === -1) { return path; } else { return path.slice(0, index); } }); var tailPathCache = new _emberMetalCache.default(1000, function (path) { var index = firstDotIndexCache.get(path); if (index !== -1) { return path.slice(index + 1); } }); var caches = { isGlobalCache: isGlobalCache, isGlobalPathCache: isGlobalPathCache, hasThisCache: hasThisCache, firstDotIndexCache: firstDotIndexCache, firstKeyCache: firstKeyCache, tailPathCache: tailPathCache }; exports.caches = caches; function isGlobal(path) { return isGlobalCache.get(path); } function isGlobalPath(path) { return isGlobalPathCache.get(path); } function hasThis(path) { return hasThisCache.get(path); } function isPath(path) { return firstDotIndexCache.get(path) !== -1; } function getFirstKey(path) { return firstKeyCache.get(path); } function getTailPath(path) { return tailPathCache.get(path); } }); enifed('ember-metal/properties', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/property_events'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperty_events) { /** @module ember-metal */ 'use strict'; exports.Descriptor = Descriptor; exports.MANDATORY_SETTER_FUNCTION = MANDATORY_SETTER_FUNCTION; exports.DEFAULT_GETTER_FUNCTION = DEFAULT_GETTER_FUNCTION; exports.INHERITING_GETTER_FUNCTION = INHERITING_GETTER_FUNCTION; exports.defineProperty = defineProperty; // .......................................................... // DESCRIPTOR // /** Objects of this type can implement an interface to respond to requests to get and set. The default implementation handles simple properties. @class Descriptor @private */ function Descriptor() { this.isDescriptor = true; } var REDEFINE_SUPPORTED = (function () { // https://github.com/spalger/kibana/commit/b7e35e6737df585585332857a4c397dc206e7ff9 var a = Object.create(Object.prototype, { prop: { configurable: true, value: 1 } }); Object.defineProperty(a, 'prop', { configurable: true, value: 2 }); return a.prop === 2; })(); // .......................................................... // DEFINING PROPERTIES API // function MANDATORY_SETTER_FUNCTION(name) { function SETTER_FUNCTION(value) { var m = _emberMetalMeta.peekMeta(this); if (!m.isInitialized(this)) { m.writeValues(name, value); } else {} } SETTER_FUNCTION.isMandatorySetter = true; return SETTER_FUNCTION; } function DEFAULT_GETTER_FUNCTION(name) { return function GETTER_FUNCTION() { var meta = _emberMetalMeta.peekMeta(this); return meta && meta.peekValues(name); }; } function INHERITING_GETTER_FUNCTION(name) { function IGETTER_FUNCTION() { var meta = _emberMetalMeta.peekMeta(this); var val = meta && meta.readInheritedValue('values', name); if (val === _emberMetalMeta.UNDEFINED) { var proto = Object.getPrototypeOf(this); return proto && proto[name]; } else { return val; } } IGETTER_FUNCTION.isInheritingGetter = true; return IGETTER_FUNCTION; } /** NOTE: This is a low-level method used by other parts of the API. You almost never want to call this method directly. Instead you should use `Ember.mixin()` to define new properties. Defines a property on an object. This method works much like the ES5 `Object.defineProperty()` method except that it can also accept computed properties and other special descriptors. Normally this method takes only three parameters. However if you pass an instance of `Descriptor` as the third param then you can pass an optional value as the fourth parameter. This is often more efficient than creating new descriptor hashes for each property. ## Examples ```javascript // ES5 compatible mode Ember.defineProperty(contact, 'firstName', { writable: true, configurable: false, enumerable: true, value: 'Charles' }); // define a simple property Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); // define a computed property Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { return this.firstName+' '+this.lastName; })); ``` @private @method defineProperty @for Ember @param {Object} obj the object to define this property on. This may be a prototype. @param {String} keyName the name of the property @param {Descriptor} [desc] an instance of `Descriptor` (typically a computed property) or an ES5 descriptor. You must provide this or `data` but not both. @param {*} [data] something other than a descriptor, that will become the explicit value of this property. */ function defineProperty(obj, keyName, desc, data, meta) { var possibleDesc = undefined, existingDesc = undefined, watching = undefined, value = undefined; if (!meta) { meta = _emberMetalMeta.meta(obj); } var watchEntry = meta.peekWatching(keyName); possibleDesc = obj[keyName]; existingDesc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; watching = watchEntry !== undefined && watchEntry > 0; if (existingDesc) { existingDesc.teardown(obj, keyName); } if (desc instanceof Descriptor) { value = desc; if (false) { if (watching) { Object.defineProperty(obj, keyName, { configurable: true, enumerable: true, writable: true, value: value }); } else { obj[keyName] = value; } } else { obj[keyName] = value; } if (desc.setup) { desc.setup(obj, keyName); } } else { if (desc == null) { value = data; if (false) { if (watching) { meta.writeValues(keyName, data); var defaultDescriptor = { configurable: true, enumerable: true, set: MANDATORY_SETTER_FUNCTION(keyName), get: DEFAULT_GETTER_FUNCTION(keyName) }; if (REDEFINE_SUPPORTED) { Object.defineProperty(obj, keyName, defaultDescriptor); } else { handleBrokenPhantomDefineProperty(obj, keyName, defaultDescriptor); } } else { obj[keyName] = data; } } else { obj[keyName] = data; } } else { value = desc; // fallback to ES5 Object.defineProperty(obj, keyName, desc); } } // if key is being watched, override chains that // were initialized with the prototype if (watching) { _emberMetalProperty_events.overrideChains(obj, keyName, meta); } // The `value` passed to the `didDefineProperty` hook is // either the descriptor or data, whichever was passed. if (obj.didDefineProperty) { obj.didDefineProperty(obj, keyName, value); } return this; } function handleBrokenPhantomDefineProperty(obj, keyName, desc) { // https://github.com/ariya/phantomjs/issues/11856 Object.defineProperty(obj, keyName, { configurable: true, writable: true, value: 'iCry' }); Object.defineProperty(obj, keyName, desc); } }); enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/events', 'ember-metal/tags', 'ember-metal/observer_set', 'ember-metal/symbol', 'ember-metal/features', 'ember-metal/transaction'], function (exports, _emberMetalUtils, _emberMetalMeta, _emberMetalEvents, _emberMetalTags, _emberMetalObserver_set, _emberMetalSymbol, _emberMetalFeatures, _emberMetalTransaction) { 'use strict'; var PROPERTY_DID_CHANGE = _emberMetalSymbol.default('PROPERTY_DID_CHANGE'); exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE; var beforeObserverSet = new _emberMetalObserver_set.default(); var observerSet = new _emberMetalObserver_set.default(); var deferred = 0; // .......................................................... // PROPERTY CHANGES // /** This function is called just before an object property is about to change. It will notify any before observers and prepare caches among other things. Normally you will not need to call this method directly but if for some reason you can't directly watch a property you can invoke this method manually along with `Ember.propertyDidChange()` which you should call just after the property value changes. @method propertyWillChange @for Ember @param {Object} obj The object with the property that will change @param {String} keyName The property key (or path) that will change. @return {void} @private */ function propertyWillChange(obj, keyName) { var m = _emberMetalMeta.peekMeta(obj); if (m && !m.isInitialized(obj)) { return; } var watching = m && m.peekWatching(keyName) > 0; var possibleDesc = obj[keyName]; var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; if (desc && desc.willChange) { desc.willChange(obj, keyName); } if (watching) { dependentKeysWillChange(obj, keyName, m); chainsWillChange(obj, keyName, m); notifyBeforeObservers(obj, keyName); } } /** This function is called just after an object property has changed. It will notify any observers and clear caches among other things. Normally you will not need to call this method directly but if for some reason you can't directly watch a property you can invoke this method manually along with `Ember.propertyWillChange()` which you should call just before the property value changes. @method propertyDidChange @for Ember @param {Object} obj The object with the property that will change @param {String} keyName The property key (or path) that will change. @return {void} @private */ function propertyDidChange(obj, keyName) { var m = _emberMetalMeta.peekMeta(obj); if (m && !m.isInitialized(obj)) { return; } var watching = m && m.peekWatching(keyName) > 0; var possibleDesc = obj[keyName]; var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; // shouldn't this mean that we're watching this key? if (desc && desc.didChange) { desc.didChange(obj, keyName); } if (watching) { if (m.hasDeps(keyName)) { dependentKeysDidChange(obj, keyName, m); } chainsDidChange(obj, keyName, m, false); notifyObservers(obj, keyName); } if (obj[PROPERTY_DID_CHANGE]) { obj[PROPERTY_DID_CHANGE](keyName); } if (obj.isDestroying) { return; } _emberMetalTags.markObjectAsDirty(m); if (false || false) { _emberMetalTransaction.assertNotRendered(obj, keyName, m); } } var WILL_SEEN = undefined, DID_SEEN = undefined; // called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...) function dependentKeysWillChange(obj, depKey, meta) { if (obj.isDestroying) { return; } if (meta && meta.hasDeps(depKey)) { var seen = WILL_SEEN; var _top = !seen; if (_top) { seen = WILL_SEEN = {}; } iterDeps(propertyWillChange, obj, depKey, seen, meta); if (_top) { WILL_SEEN = null; } } } // called whenever a property has just changed to update dependent keys function dependentKeysDidChange(obj, depKey, meta) { if (obj.isDestroying) { return; } if (meta && meta.hasDeps(depKey)) { var seen = DID_SEEN; var _top2 = !seen; if (_top2) { seen = DID_SEEN = {}; } iterDeps(propertyDidChange, obj, depKey, seen, meta); if (_top2) { DID_SEEN = null; } } } function iterDeps(method, obj, depKey, seen, meta) { var possibleDesc = undefined, desc = undefined; var guid = _emberMetalUtils.guidFor(obj); var current = seen[guid]; if (!current) { current = seen[guid] = {}; } if (current[depKey]) { return; } current[depKey] = true; meta.forEachInDeps(depKey, function (key, value) { if (!value) { return; } possibleDesc = obj[key]; desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; if (desc && desc._suspended === obj) { return; } method(obj, key); }); } function chainsWillChange(obj, keyName, m) { var c = m.readableChainWatchers(); if (c) { c.notify(keyName, false, propertyWillChange); } } function chainsDidChange(obj, keyName, m) { var c = m.readableChainWatchers(); if (c) { c.notify(keyName, true, propertyDidChange); } } function overrideChains(obj, keyName, m) { var c = m.readableChainWatchers(); if (c) { c.revalidate(keyName); } } /** @method beginPropertyChanges @chainable @private */ function beginPropertyChanges() { deferred++; } /** @method endPropertyChanges @private */ function endPropertyChanges() { deferred--; if (deferred <= 0) { beforeObserverSet.clear(); observerSet.flush(); } } /** Make a series of property changes together in an exception-safe way. ```javascript Ember.changeProperties(function() { obj1.set('foo', mayBlowUpWhenSet); obj2.set('bar', baz); }); ``` @method changeProperties @param {Function} callback @param [binding] @private */ function changeProperties(callback, binding) { beginPropertyChanges(); try { callback.call(binding); } finally { endPropertyChanges.call(binding); } } function notifyBeforeObservers(obj, keyName) { if (obj.isDestroying) { return; } var eventName = keyName + ':before'; var listeners = undefined, added = undefined; if (deferred) { listeners = beforeObserverSet.add(obj, keyName, eventName); added = _emberMetalEvents.accumulateListeners(obj, eventName, listeners); _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName], added); } else { _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); } } function notifyObservers(obj, keyName) { if (obj.isDestroying) { return; } var eventName = keyName + ':change'; var listeners = undefined; if (deferred) { listeners = observerSet.add(obj, keyName, eventName); _emberMetalEvents.accumulateListeners(obj, eventName, listeners); } else { _emberMetalEvents.sendEvent(obj, eventName, [obj, keyName]); } } exports.propertyWillChange = propertyWillChange; exports.propertyDidChange = propertyDidChange; exports.overrideChains = overrideChains; exports.beginPropertyChanges = beginPropertyChanges; exports.endPropertyChanges = endPropertyChanges; exports.changeProperties = changeProperties; }); enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal/path_cache'], function (exports, _emberMetalDebug, _emberMetalPath_cache) { /** @module ember-metal */ 'use strict'; exports.get = get; exports._getPath = _getPath; exports.getWithDefault = getWithDefault; var ALLOWABLE_TYPES = { object: true, function: true, string: true }; // .......................................................... // GET AND SET // // If we are on a platform that supports accessors we can use those. // Otherwise simulate accessors by looking up the property directly on the // object. /** Gets the value of a property on an object. If the property is computed, the function will be invoked. If the property is not defined but the object implements the `unknownProperty` method then that will be invoked. If you plan to run on IE8 and older browsers then you should use this method anytime you want to retrieve a property on an object that you don't know for sure is private. (Properties beginning with an underscore '_' are considered private.) On all newer browsers, you only need to use this method to retrieve properties if the property might not be defined on the object and you want to respect the `unknownProperty` handler. Otherwise you can ignore this method. Note that if the object itself is `undefined`, this method will throw an error. @method get @for Ember @param {Object} obj The object to retrieve from. @param {String} keyName The property key to retrieve @return {Object} the property value or `null`. @public */ function get(obj, keyName) { // Helpers that operate with 'this' within an #each if (keyName === '') { return obj; } var value = obj[keyName]; var desc = value !== null && typeof value === 'object' && value.isDescriptor ? value : undefined; var ret = undefined; if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) { return _getPath(obj, keyName); } if (desc) { return desc.get(obj, keyName); } else { ret = value; if (ret === undefined && 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) { return obj.unknownProperty(keyName); } return ret; } } function _getPath(root, path) { var obj = root; var parts = path.split('.'); for (var i = 0; i < parts.length; i++) { if (!isGettable(obj)) { return undefined; } obj = get(obj, parts[i]); if (obj && obj.isDestroyed) { return undefined; } } return obj; } function isGettable(obj) { if (obj == null) { return false; } return ALLOWABLE_TYPES[typeof obj]; } /** Retrieves the value of a property from an Object, or a default value in the case that the property returns `undefined`. ```javascript Ember.getWithDefault(person, 'lastName', 'Doe'); ``` @method getWithDefault @for Ember @param {Object} obj The object to retrieve from. @param {String} keyName The name of the property to retrieve @param {Object} defaultValue The value to return if the property value is undefined @return {Object} The property value or the defaultValue. @public */ function getWithDefault(root, key, defaultValue) { var value = get(root, key); if (value === undefined) { return defaultValue; } return value; } exports.default = get; }); enifed('ember-metal/property_set', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta', 'ember-metal/utils'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta, _emberMetalUtils) { 'use strict'; exports.set = set; exports.trySet = trySet; /** Sets the value of a property on an object, respecting computed properties and notifying observers and other listeners of the change. If the property is not defined but the object implements the `setUnknownProperty` method then that will be invoked as well. @method set @for Ember @param {Object} obj The object to modify. @param {String} keyName The property key to set @param {Object} value The value to set @return {Object} the passed value. @public */ function set(obj, keyName, value, tolerant) { if (_emberMetalPath_cache.isPath(keyName)) { return setPath(obj, keyName, value, tolerant); } var meta = _emberMetalMeta.peekMeta(obj); var possibleDesc = obj[keyName]; var desc = undefined, currentValue = undefined; if (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) { desc = possibleDesc; } else { currentValue = possibleDesc; } if (desc) { /* computed property */ desc.set(obj, keyName, value); } else if (obj.setUnknownProperty && currentValue === undefined && !(keyName in obj)) { obj.setUnknownProperty(keyName, value); /* unknown property */ } else if (currentValue === value) { /* no change */ return value; } else { _emberMetalProperty_events.propertyWillChange(obj, keyName); if (false) { setWithMandatorySetter(meta, obj, keyName, value); } else { obj[keyName] = value; } _emberMetalProperty_events.propertyDidChange(obj, keyName); } return value; } if (false) { var setWithMandatorySetter = function (meta, obj, keyName, value) { if (meta && meta.peekWatching(keyName) > 0) { makeEnumerable(obj, keyName); meta.writeValue(obj, keyName, value); } else { obj[keyName] = value; } }; var makeEnumerable = function (obj, key) { var desc = Object.getOwnPropertyDescriptor(obj, key); if (desc && desc.set && desc.set.isMandatorySetter) { desc.enumerable = true; Object.defineProperty(obj, key, desc); } }; } function setPath(root, path, value, tolerant) { // get the last part of the path var keyName = path.slice(path.lastIndexOf('.') + 1); // get the first part of the part path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1)); // unless the path is this, look up the first part to // get the root if (path !== 'this') { root = _emberMetalProperty_get._getPath(root, path); } if (!keyName || keyName.length === 0) { throw new _emberMetalError.default('Property set failed: You passed an empty path'); } if (!root) { if (tolerant) { return; } else { throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.'); } } return set(root, keyName, value); } /** Error-tolerant form of `Ember.set`. Will not blow up if any part of the chain is `undefined`, `null`, or destroyed. This is primarily used when syncing bindings, which may try to update after an object has been destroyed. @method trySet @for Ember @param {Object} root The object to modify. @param {String} path The property path to set @param {Object} value The value to set @public */ function trySet(root, path, value) { return set(root, path, value, true); } }); enifed("ember-metal/replace", ["exports"], function (exports) { "use strict"; exports.default = replace; var splice = Array.prototype.splice; function replace(array, idx, amt, objects) { var args = [].concat(objects); var ret = []; // https://code.google.com/p/chromium/issues/detail?id=56588 var size = 60000; var start = idx; var ends = amt; var count = undefined, chunk = undefined; while (args.length) { count = ends > size ? size : ends; if (count <= 0) { count = 0; } chunk = args.splice(0, size); chunk = [start, count].concat(chunk); start += size; ends -= count; ret = ret.concat(splice.apply(array, chunk)); } return ret; } }); enifed('ember-metal/run_loop', ['exports', 'ember-metal/debug', 'ember-metal/testing', 'ember-metal/error_handler', 'ember-metal/utils', 'ember-metal/property_events', 'backburner'], function (exports, _emberMetalDebug, _emberMetalTesting, _emberMetalError_handler, _emberMetalUtils, _emberMetalProperty_events, _backburner) { 'use strict'; exports.default = run; function onBegin(current) { run.currentRunLoop = current; } function onEnd(current, next) { run.currentRunLoop = next; } var onErrorTarget = { get onerror() { return _emberMetalError_handler.getOnerror(); }, set onerror(handler) { return _emberMetalError_handler.setOnerror(handler); } }; var backburner = new _backburner.default(['sync', 'actions', 'destroy'], { GUID_KEY: _emberMetalUtils.GUID_KEY, sync: { before: _emberMetalProperty_events.beginPropertyChanges, after: _emberMetalProperty_events.endPropertyChanges }, defaultQueue: 'actions', onBegin: onBegin, onEnd: onEnd, onErrorTarget: onErrorTarget, onErrorMethod: 'onerror' }); // .......................................................... // run - this is ideally the only public API the dev sees // /** Runs the passed target and method inside of a RunLoop, ensuring any deferred actions including bindings and views updates are flushed at the end. Normally you should not need to invoke this method yourself. However if you are implementing raw event handlers when interfacing with other libraries or plugins, you should probably wrap all of your code inside this call. ```javascript run(function() { // code to be executed within a RunLoop }); ``` @class run @namespace Ember @static @constructor @param {Object} [target] target of method to call @param {Function|String} method Method to invoke. May be a function or a string. If you pass a string then it will be looked up on the passed target. @param {Object} [args*] Any additional arguments you wish to pass to the method. @return {Object} return value from invoking the passed function. @public */ function run() { return backburner.run.apply(backburner, arguments); } /** If no run-loop is present, it creates a new one. If a run loop is present it will queue itself to run on the existing run-loops action queue. Please note: This is not for normal usage, and should be used sparingly. If invoked when not within a run loop: ```javascript run.join(function() { // creates a new run-loop }); ``` Alternatively, if called within an existing run loop: ```javascript run(function() { // creates a new run-loop run.join(function() { // joins with the existing run-loop, and queues for invocation on // the existing run-loops action queue. }); }); ``` @method join @namespace Ember @param {Object} [target] target of method to call @param {Function|String} method Method to invoke. May be a function or a string. If you pass a string then it will be looked up on the passed target. @param {Object} [args*] Any additional arguments you wish to pass to the method. @return {Object} Return value from invoking the passed function. Please note, when called within an existing loop, no return value is possible. @public */ run.join = function () { return backburner.join.apply(backburner, arguments); }; /** Allows you to specify which context to call the specified function in while adding the execution of that function to the Ember run loop. This ability makes this method a great way to asynchronously integrate third-party libraries into your Ember application. `run.bind` takes two main arguments, the desired context and the function to invoke in that context. Any additional arguments will be supplied as arguments to the function that is passed in. Let's use the creation of a TinyMCE component as an example. Currently, TinyMCE provides a setup configuration option we can use to do some processing after the TinyMCE instance is initialized but before it is actually rendered. We can use that setup option to do some additional setup for our component. The component itself could look something like the following: ```javascript App.RichTextEditorComponent = Ember.Component.extend({ initializeTinyMCE: Ember.on('didInsertElement', function() { tinymce.init({ selector: '#' + this.$().prop('id'), setup: Ember.run.bind(this, this.setupEditor) }); }), setupEditor: function(editor) { this.set('editor', editor); editor.on('change', function() { console.log('content changed!'); }); } }); ``` In this example, we use Ember.run.bind to bind the setupEditor method to the context of the App.RichTextEditorComponent and to have the invocation of that method be safely handled and executed by the Ember run loop. @method bind @namespace Ember @param {Object} [target] target of method to call @param {Function|String} method Method to invoke. May be a function or a string. If you pass a string then it will be looked up on the passed target. @param {Object} [args*] Any additional arguments you wish to pass to the method. @return {Function} returns a new function that will always have a particular context @since 1.4.0 @public */ run.bind = function () { for (var _len = arguments.length, curried = Array(_len), _key = 0; _key < _len; _key++) { curried[_key] = arguments[_key]; } return function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return run.join.apply(run, curried.concat(args)); }; }; run.backburner = backburner; run.currentRunLoop = null; run.queues = backburner.queueNames; /** Begins a new RunLoop. Any deferred actions invoked after the begin will be buffered until you invoke a matching call to `run.end()`. This is a lower-level way to use a RunLoop instead of using `run()`. ```javascript run.begin(); // code to be executed within a RunLoop run.end(); ``` @method begin @return {void} @public */ run.begin = function () { backburner.begin(); }; /** Ends a RunLoop. This must be called sometime after you call `run.begin()` to flush any deferred actions. This is a lower-level way to use a RunLoop instead of using `run()`. ```javascript run.begin(); // code to be executed within a RunLoop run.end(); ``` @method end @return {void} @public */ run.end = function () { backburner.end(); }; /** Array of named queues. This array determines the order in which queues are flushed at the end of the RunLoop. You can define your own queues by simply adding the queue name to this array. Normally you should not need to inspect or modify this property. @property queues @type Array @default ['sync', 'actions', 'destroy'] @private */ /** Adds the passed target/method and any optional arguments to the named queue to be executed at the end of the RunLoop. If you have not already started a RunLoop when calling this method one will be started for you automatically. At the end of a RunLoop, any methods scheduled in this way will be invoked. Methods will be invoked in an order matching the named queues defined in the `run.queues` property. ```javascript run.schedule('sync', this, function() { // this will be executed in the first RunLoop queue, when bindings are synced console.log('scheduled on sync queue'); }); run.schedule('actions', this, function() { // this will be executed in the 'actions' queue, after bindings have synced. console.log('scheduled on actions queue'); }); // Note the functions will be run in order based on the run queues order. // Output would be: // scheduled on sync queue // scheduled on actions queue ``` @method schedule @param {String} queue The name of the queue to schedule against. Default queues are 'sync' and 'actions' @param {Object} [target] target object to use as the context when invoking a method. @param {String|Function} method The method to invoke. If you pass a string it will be resolved on the target object at the time the scheduled item is invoked allowing you to change the target function. @param {Object} [arguments*] Optional arguments to be passed to the queued method. @return {void} @public */ run.schedule = function () /* queue, target, method */{ backburner.schedule.apply(backburner, arguments); }; // Used by global test teardown run.hasScheduledTimers = function () { return backburner.hasTimers(); }; // Used by global test teardown run.cancelTimers = function () { backburner.cancelTimers(); }; /** Immediately flushes any events scheduled in the 'sync' queue. Bindings use this queue so this method is a useful way to immediately force all bindings in the application to sync. You should call this method anytime you need any changed state to propagate throughout the app immediately without repainting the UI (which happens in the later 'render' queue added by the `ember-views` package). ```javascript run.sync(); ``` @method sync @return {void} @private */ run.sync = function () { if (backburner.currentInstance) { backburner.currentInstance.queues.sync.flush(); } }; /** Invokes the passed target/method and optional arguments after a specified period of time. The last parameter of this method must always be a number of milliseconds. You should use this method whenever you need to run some action after a period of time instead of using `setTimeout()`. This method will ensure that items that expire during the same script execution cycle all execute together, which is often more efficient than using a real setTimeout. ```javascript run.later(myContext, function() { // code here will execute within a RunLoop in about 500ms with this == myContext }, 500); ``` @method later @param {Object} [target] target of method to invoke @param {Function|String} method The method to invoke. If you pass a string it will be resolved on the target at the time the method is invoked. @param {Object} [args*] Optional arguments to pass to the timeout. @param {Number} wait Number of milliseconds to wait. @return {*} Timer information for use in cancelling, see `run.cancel`. @public */ run.later = function () /*target, method*/{ return backburner.later.apply(backburner, arguments); }; /** Schedule a function to run one time during the current RunLoop. This is equivalent to calling `scheduleOnce` with the "actions" queue. @method once @param {Object} [target] The target of the method to invoke. @param {Function|String} method The method to invoke. If you pass a string it will be resolved on the target at the time the method is invoked. @param {Object} [args*] Optional arguments to pass to the timeout. @return {Object} Timer information for use in cancelling, see `run.cancel`. @public */ run.once = function () { for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } args.unshift('actions'); return backburner.scheduleOnce.apply(backburner, args); }; /** Schedules a function to run one time in a given queue of the current RunLoop. Calling this method with the same queue/target/method combination will have no effect (past the initial call). Note that although you can pass optional arguments these will not be considered when looking for duplicates. New arguments will replace previous calls. ```javascript function sayHi() { console.log('hi'); } run(function() { run.scheduleOnce('afterRender', myContext, sayHi); run.scheduleOnce('afterRender', myContext, sayHi); // sayHi will only be executed once, in the afterRender queue of the RunLoop }); ``` Also note that passing an anonymous function to `run.scheduleOnce` will not prevent additional calls with an identical anonymous function from scheduling the items multiple times, e.g.: ```javascript function scheduleIt() { run.scheduleOnce('actions', myContext, function() { console.log('Closure'); }); } scheduleIt(); scheduleIt(); // "Closure" will print twice, even though we're using `run.scheduleOnce`, // because the function we pass to it is anonymous and won't match the // previously scheduled operation. ``` Available queues, and their order, can be found at `run.queues` @method scheduleOnce @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'. @param {Object} [target] The target of the method to invoke. @param {Function|String} method The method to invoke. If you pass a string it will be resolved on the target at the time the method is invoked. @param {Object} [args*] Optional arguments to pass to the timeout. @return {Object} Timer information for use in cancelling, see `run.cancel`. @public */ run.scheduleOnce = function () /*queue, target, method*/{ return backburner.scheduleOnce.apply(backburner, arguments); }; /** Schedules an item to run from within a separate run loop, after control has been returned to the system. This is equivalent to calling `run.later` with a wait time of 1ms. ```javascript run.next(myContext, function() { // code to be executed in the next run loop, // which will be scheduled after the current one }); ``` Multiple operations scheduled with `run.next` will coalesce into the same later run loop, along with any other operations scheduled by `run.later` that expire right around the same time that `run.next` operations will fire. Note that there are often alternatives to using `run.next`. For instance, if you'd like to schedule an operation to happen after all DOM element operations have completed within the current run loop, you can make use of the `afterRender` run loop queue (added by the `ember-views` package, along with the preceding `render` queue where all the DOM element operations happen). Example: ```javascript export default Ember.Component.extend({ didInsertElement() { this._super(...arguments); run.scheduleOnce('afterRender', this, 'processChildElements'); }, processChildElements() { // ... do something with component's child component // elements after they've finished rendering, which // can't be done within this component's // `didInsertElement` hook because that gets run // before the child elements have been added to the DOM. } }); ``` One benefit of the above approach compared to using `run.next` is that you will be able to perform DOM/CSS operations before unprocessed elements are rendered to the screen, which may prevent flickering or other artifacts caused by delaying processing until after rendering. The other major benefit to the above approach is that `run.next` introduces an element of non-determinism, which can make things much harder to test, due to its reliance on `setTimeout`; it's much harder to guarantee the order of scheduled operations when they are scheduled outside of the current run loop, i.e. with `run.next`. @method next @param {Object} [target] target of method to invoke @param {Function|String} method The method to invoke. If you pass a string it will be resolved on the target at the time the method is invoked. @param {Object} [args*] Optional arguments to pass to the timeout. @return {Object} Timer information for use in cancelling, see `run.cancel`. @public */ run.next = function () { for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } args.push(1); return backburner.later.apply(backburner, args); }; /** Cancels a scheduled item. Must be a value returned by `run.later()`, `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or `run.throttle()`. ```javascript let runNext = run.next(myContext, function() { // will not be executed }); run.cancel(runNext); let runLater = run.later(myContext, function() { // will not be executed }, 500); run.cancel(runLater); let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { // will not be executed }); run.cancel(runScheduleOnce); let runOnce = run.once(myContext, function() { // will not be executed }); run.cancel(runOnce); let throttle = run.throttle(myContext, function() { // will not be executed }, 1, false); run.cancel(throttle); let debounce = run.debounce(myContext, function() { // will not be executed }, 1); run.cancel(debounce); let debounceImmediate = run.debounce(myContext, function() { // will be executed since we passed in true (immediate) }, 100, true); // the 100ms delay until this method can be called again will be cancelled run.cancel(debounceImmediate); ``` @method cancel @param {Object} timer Timer object to cancel @return {Boolean} true if cancelled or false/undefined if it wasn't found @public */ run.cancel = function (timer) { return backburner.cancel(timer); }; /** Delay calling the target method until the debounce period has elapsed with no additional debounce calls. If `debounce` is called again before the specified time has elapsed, the timer is reset and the entire period must pass again before the target method is called. This method should be used when an event may be called multiple times but the action should only be called once when the event is done firing. A common example is for scroll events where you only want updates to happen once scrolling has ceased. ```javascript function whoRan() { console.log(this.name + ' ran.'); } let myContext = { name: 'debounce' }; run.debounce(myContext, whoRan, 150); // less than 150ms passes run.debounce(myContext, whoRan, 150); // 150ms passes // whoRan is invoked with context myContext // console logs 'debounce ran.' one time. ``` Immediate allows you to run the function immediately, but debounce other calls for this function until the wait time has elapsed. If `debounce` is called again before the specified time has elapsed, the timer is reset and the entire period must pass again before the method can be called again. ```javascript function whoRan() { console.log(this.name + ' ran.'); } let myContext = { name: 'debounce' }; run.debounce(myContext, whoRan, 150, true); // console logs 'debounce ran.' one time immediately. // 100ms passes run.debounce(myContext, whoRan, 150, true); // 150ms passes and nothing else is logged to the console and // the debouncee is no longer being watched run.debounce(myContext, whoRan, 150, true); // console logs 'debounce ran.' one time immediately. // 150ms passes and nothing else is logged to the console and // the debouncee is no longer being watched ``` @method debounce @param {Object} [target] target of method to invoke @param {Function|String} method The method to invoke. May be a function or a string. If you pass a string then it will be looked up on the passed target. @param {Object} [args*] Optional arguments to pass to the timeout. @param {Number} wait Number of milliseconds to wait. @param {Boolean} immediate Trigger the function on the leading instead of the trailing edge of the wait interval. Defaults to false. @return {Array} Timer information for use in cancelling, see `run.cancel`. @public */ run.debounce = function () { return backburner.debounce.apply(backburner, arguments); }; /** Ensure that the target method is never called more frequently than the specified spacing period. The target method is called immediately. ```javascript function whoRan() { console.log(this.name + ' ran.'); } let myContext = { name: 'throttle' }; run.throttle(myContext, whoRan, 150); // whoRan is invoked with context myContext // console logs 'throttle ran.' // 50ms passes run.throttle(myContext, whoRan, 150); // 50ms passes run.throttle(myContext, whoRan, 150); // 150ms passes run.throttle(myContext, whoRan, 150); // whoRan is invoked with context myContext // console logs 'throttle ran.' ``` @method throttle @param {Object} [target] target of method to invoke @param {Function|String} method The method to invoke. May be a function or a string. If you pass a string then it will be looked up on the passed target. @param {Object} [args*] Optional arguments to pass to the timeout. @param {Number} spacing Number of milliseconds to space out requests. @param {Boolean} immediate Trigger the function on the leading instead of the trailing edge of the wait interval. Defaults to true. @return {Array} Timer information for use in cancelling, see `run.cancel`. @public */ run.throttle = function () { return backburner.throttle.apply(backburner, arguments); }; /** Add a new named queue after the specified queue. The queue to add will only be added once. @method _addQueue @param {String} name the name of the queue to add. @param {String} after the name of the queue to add after. @private */ run._addQueue = function (name, after) { if (run.queues.indexOf(name) === -1) { run.queues.splice(run.queues.indexOf(after) + 1, 0, name); } }; }); enifed('ember-metal/set_properties', ['exports', 'ember-metal/property_events', 'ember-metal/property_set'], function (exports, _emberMetalProperty_events, _emberMetalProperty_set) { 'use strict'; exports.default = setProperties; /** Set a list of properties on an object. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so observers will be buffered. ```javascript let anObject = Ember.Object.create(); anObject.setProperties({ firstName: 'Stanley', lastName: 'Stuart', age: 21 }); ``` @method setProperties @param obj @param {Object} properties @return properties @public */ function setProperties(obj, properties) { if (!properties || typeof properties !== 'object') { return properties; } _emberMetalProperty_events.changeProperties(function () { var props = Object.keys(properties); var propertyName = undefined; for (var i = 0; i < props.length; i++) { propertyName = props[i]; _emberMetalProperty_set.set(obj, propertyName, properties[propertyName]); } }); return properties; } }); enifed('ember-metal/symbol', ['exports', 'ember-metal/utils'], function (exports, _emberMetalUtils) { 'use strict'; exports.default = symbol; function symbol(debugName) { // TODO: Investigate using platform symbols, but we do not // want to require non-enumerability for this API, which // would introduce a large cost. return _emberMetalUtils.intern(debugName + ' [id=' + _emberMetalUtils.GUID_KEY + Math.floor(Math.random() * new Date()) + ']'); } }); enifed('ember-metal/tags', ['exports', 'ember-metal/meta', 'require'], function (exports, _emberMetalMeta, _require2) { 'use strict'; exports.setHasViews = setHasViews; exports.tagFor = tagFor; var hasGlimmer = _require2.has('glimmer-reference'); var CONSTANT_TAG = undefined, CURRENT_TAG = undefined, DirtyableTag = undefined, makeTag = undefined, run = undefined; var hasViews = function () { return false; }; function setHasViews(fn) { hasViews = fn; } var markObjectAsDirty = undefined; exports.markObjectAsDirty = markObjectAsDirty; function tagFor(object, _meta) { if (!hasGlimmer) { throw new Error('Cannot call tagFor without Glimmer'); } if (typeof object === 'object' && object) { var meta = _meta || _emberMetalMeta.meta(object); return meta.writableTag(makeTag); } else { return CONSTANT_TAG; } } function K() {} function ensureRunloop() { if (!run) { run = _require2.default('ember-metal/run_loop').default; } if (hasViews() && !run.backburner.currentInstance) { run.schedule('actions', K); } } if (hasGlimmer) { var _require = _require2.default('glimmer-reference'); DirtyableTag = _require.DirtyableTag; CONSTANT_TAG = _require.CONSTANT_TAG; CURRENT_TAG = _require.CURRENT_TAG; makeTag = function () { return new DirtyableTag(); }; exports.markObjectAsDirty = markObjectAsDirty = function (meta) { var tag = meta && meta.readableTag(); if (tag) { ensureRunloop(); tag.dirty(); } }; } else { exports.markObjectAsDirty = markObjectAsDirty = function () {}; } }); enifed("ember-metal/testing", ["exports"], function (exports) { "use strict"; exports.isTesting = isTesting; exports.setTesting = setTesting; var testing = false; function isTesting() { return testing; } function setTesting(value) { testing = !!value; } }); enifed('ember-metal/transaction', ['exports', 'ember-metal/meta', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalMeta, _emberMetalDebug, _emberMetalFeatures) { 'use strict'; var runInTransaction = undefined, didRender = undefined, assertNotRendered = undefined; var raise = _emberMetalDebug.assert; if (false) { raise = function (message, test) {}; } var implication = undefined; if (false) { implication = 'will be removed in Ember 3.0.'; } else if (false) { implication = 'is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.'; } if (false || false) { (function () { var counter = 0; var inTransaction = false; var shouldReflush = undefined; exports.default = runInTransaction = function (context, methodName) { shouldReflush = false; inTransaction = true; context[methodName](); inTransaction = false; counter++; return shouldReflush; }; exports.didRender = didRender = function (object, key, reference) { if (!inTransaction) { return; } var meta = _emberMetalMeta.meta(object); var lastRendered = meta.writableLastRendered(); lastRendered[key] = counter; }; exports.assertNotRendered = assertNotRendered = function (object, key, _meta) { var meta = _meta || _emberMetalMeta.meta(object); var lastRendered = meta.readableLastRendered(); if (lastRendered && lastRendered[key] === counter) { raise((function () { var ref = meta.readableLastRenderedFrom(); var parts = []; var lastRef = ref[key]; var label = undefined; if (lastRef) { while (lastRef && lastRef._propertyKey) { parts.unshift(lastRef._propertyKey); lastRef = lastRef._parentReference; } label = parts.join(); } else { label = 'the same value'; } return 'You modified ' + parts.join('.') + ' twice in a single render. This was unreliable and slow in Ember 1.x and ' + implication; })(), false); shouldReflush = true; } }; })(); } else { exports.default = runInTransaction = function () { throw new Error('Cannot call runInTransaction without Glimmer'); }; exports.didRender = didRender = function () { throw new Error('Cannot call didRender without Glimmer'); }; exports.assertNotRendered = assertNotRendered = function () { throw new Error('Cannot call assertNotRendered without Glimmer'); }; } exports.default = runInTransaction; exports.didRender = didRender; exports.assertNotRendered = assertNotRendered; }); enifed('ember-metal/utils', ['exports'], function (exports) { 'no use strict'; // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed /** @module ember-metal */ /** Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from jQuery master. We'll just bootstrap our own uuid now. @private @return {Number} the uuid */ exports.uuid = uuid; exports.intern = intern; exports.generateGuid = generateGuid; exports.guidFor = guidFor; exports.wrap = wrap; exports.tryInvoke = tryInvoke; exports.makeArray = makeArray; exports.inspect = inspect; exports.applyStr = applyStr; exports.lookupDescriptor = lookupDescriptor; exports.toString = toString; var _uuid = 0; /** Generates a universally unique identifier. This method is used internally by Ember for assisting with the generation of GUID's and other unique identifiers. @public @return {Number} [description] */ function uuid() { return ++_uuid; } /** Prefix used for guids through out Ember. @private @property GUID_PREFIX @for Ember @type String @final */ var GUID_PREFIX = 'ember'; // Used for guid generation... var numberCache = []; var stringCache = {}; /** Strongly hint runtimes to intern the provided string. When do I need to use this function? For the most part, never. Pre-mature optimization is bad, and often the runtime does exactly what you need it to, and more often the trade-off isn't worth it. Why? Runtimes store strings in at least 2 different representations: Ropes and Symbols (interned strings). The Rope provides a memory efficient data-structure for strings created from concatenation or some other string manipulation like splitting. Unfortunately checking equality of different ropes can be quite costly as runtimes must resort to clever string comparison algorithms. These algorithms typically cost in proportion to the length of the string. Luckily, this is where the Symbols (interned strings) shine. As Symbols are unique by their string content, equality checks can be done by pointer comparison. How do I know if my string is a rope or symbol? Typically (warning general sweeping statement, but truthy in runtimes at present) static strings created as part of the JS source are interned. Strings often used for comparisons can be interned at runtime if some criteria are met. One of these criteria can be the size of the entire rope. For example, in chrome 38 a rope longer then 12 characters will not intern, nor will segments of that rope. Some numbers: http://jsperf.com/eval-vs-keys/8 Known Trick™ @private @return {String} interned version of the provided string */ function intern(str) { var obj = {}; obj[str] = 1; for (var key in obj) { if (key === str) { return key; } } return str; } /** A unique key used to assign guids and other private metadata to objects. If you inspect an object in your browser debugger you will often see these. They can be safely ignored. On browsers that support it, these properties are added with enumeration disabled so they won't show up when you iterate over your properties. @private @property GUID_KEY @for Ember @type String @final */ var GUID_KEY = intern('__ember' + +new Date()); var GUID_DESC = { writable: true, configurable: true, enumerable: false, value: null }; exports.GUID_DESC = GUID_DESC; var nullDescriptor = { configurable: true, writable: true, enumerable: false, value: null }; var GUID_KEY_PROPERTY = { name: GUID_KEY, descriptor: nullDescriptor }; exports.GUID_KEY_PROPERTY = GUID_KEY_PROPERTY; /** Generates a new guid, optionally saving the guid to the object that you pass in. You will rarely need to use this method. Instead you should call `Ember.guidFor(obj)`, which return an existing guid if available. @private @method generateGuid @for Ember @param {Object} [obj] Object the guid will be used for. If passed in, the guid will be saved on the object and reused whenever you pass the same object again. If no object is passed, just generate a new guid. @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to separate the guid into separate namespaces. @return {String} the guid */ function generateGuid(obj, prefix) { if (!prefix) { prefix = GUID_PREFIX; } var ret = prefix + uuid(); if (obj) { if (obj[GUID_KEY] === null) { obj[GUID_KEY] = ret; } else { GUID_DESC.value = ret; if (obj.__defineNonEnumerable) { obj.__defineNonEnumerable(GUID_KEY_PROPERTY); } else { Object.defineProperty(obj, GUID_KEY, GUID_DESC); } } } return ret; } /** Returns a unique id for the object. If the object does not yet have a guid, one will be assigned to it. You can call this on any object, `Ember.Object`-based or not, but be aware that it will add a `_guid` property. You can also use this method on DOM Element objects. @public @method guidFor @for Ember @param {Object} obj any object, string, number, Element, or primitive @return {String} the unique guid for this instance. */ function guidFor(obj) { var type = typeof obj; var isObject = type === 'object' && obj !== null; var isFunction = type === 'function'; if ((isObject || isFunction) && obj[GUID_KEY]) { return obj[GUID_KEY]; } // special cases where we don't want to add a key to object if (obj === undefined) { return '(undefined)'; } if (obj === null) { return '(null)'; } var ret = undefined; // Don't allow prototype changes to String etc. to change the guidFor switch (type) { case 'number': ret = numberCache[obj]; if (!ret) { ret = numberCache[obj] = 'nu' + obj; } return ret; case 'string': ret = stringCache[obj]; if (!ret) { ret = stringCache[obj] = 'st' + uuid(); } return ret; case 'boolean': return obj ? '(true)' : '(false)'; default: if (obj === Object) { return '(Object)'; } if (obj === Array) { return '(Array)'; } ret = GUID_PREFIX + uuid(); if (obj[GUID_KEY] === null) { obj[GUID_KEY] = ret; } else { GUID_DESC.value = ret; if (obj.__defineNonEnumerable) { obj.__defineNonEnumerable(GUID_KEY_PROPERTY); } else { Object.defineProperty(obj, GUID_KEY, GUID_DESC); } } return ret; } } var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/; var fnToString = Function.prototype.toString; var checkHasSuper = (function () { var sourceAvailable = fnToString.call(function () { return this; }).indexOf('return this') > -1; if (sourceAvailable) { return function checkHasSuper(func) { return HAS_SUPER_PATTERN.test(fnToString.call(func)); }; } return function checkHasSuper() { return true; }; })(); exports.checkHasSuper = checkHasSuper; function ROOT() {} ROOT.__hasSuper = false; function hasSuper(func) { if (func.__hasSuper === undefined) { func.__hasSuper = checkHasSuper(func); } return func.__hasSuper; } /** Wraps the passed function so that `this._super` will point to the superFunc when the function is invoked. This is the primitive we use to implement calls to super. @private @method wrap @for Ember @param {Function} func The function to call @param {Function} superFunc The super function. @return {Function} wrapped function. */ function wrap(func, superFunc) { if (!hasSuper(func)) { return func; } // ensure an unwrapped super that calls _super is wrapped with a terminal _super if (!superFunc.wrappedFunction && hasSuper(superFunc)) { return _wrap(func, _wrap(superFunc, ROOT)); } return _wrap(func, superFunc); } function _wrap(func, superFunc) { function superWrapper() { var orig = this._super; this._super = superFunc; var ret = func.apply(this, arguments); this._super = orig; return ret; } superWrapper.wrappedFunction = func; superWrapper.__ember_observes__ = func.__ember_observes__; superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__; superWrapper.__ember_listens__ = func.__ember_listens__; return superWrapper; } /** Checks to see if the `methodName` exists on the `obj`. ```javascript let foo = { bar: function() { return 'bar'; }, baz: null }; Ember.canInvoke(foo, 'bar'); // true Ember.canInvoke(foo, 'baz'); // false Ember.canInvoke(foo, 'bat'); // false ``` @method canInvoke @for Ember @param {Object} obj The object to check for the method @param {String} methodName The method name to check for @return {Boolean} @private */ function canInvoke(obj, methodName) { return !!(obj && typeof obj[methodName] === 'function'); } /** Checks to see if the `methodName` exists on the `obj`, and if it does, invokes it with the arguments passed. ```javascript let d = new Date('03/15/2013'); Ember.tryInvoke(d, 'getTime'); // 1363320000000 Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000 Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined ``` @method tryInvoke @for Ember @param {Object} obj The object to check for the method @param {String} methodName The method name to check for @param {Array} [args] The arguments to pass to the method @return {*} the return value of the invoked method or undefined if it cannot be invoked @public */ function tryInvoke(obj, methodName, args) { if (canInvoke(obj, methodName)) { return args ? applyStr(obj, methodName, args) : applyStr(obj, methodName); } } // ........................................ // TYPING & ARRAY MESSAGING // var objectToString = Object.prototype.toString; /** Forces the passed object to be part of an array. If the object is already an array, it will return the object. Otherwise, it will add the object to an array. If obj is `null` or `undefined`, it will return an empty array. ```javascript Ember.makeArray(); // [] Ember.makeArray(null); // [] Ember.makeArray(undefined); // [] Ember.makeArray('lindsay'); // ['lindsay'] Ember.makeArray([1, 2, 42]); // [1, 2, 42] let controller = Ember.ArrayProxy.create({ content: [] }); Ember.makeArray(controller) === controller; // true ``` @method makeArray @for Ember @param {Object} obj the object @return {Array} @private */ function makeArray(obj) { if (obj === null || obj === undefined) { return []; } return Array.isArray(obj) ? obj : [obj]; } /** Convenience method to inspect an object. This method will attempt to convert the object into a useful string description. It is a pretty simple implementation. If you want something more robust, use something like JSDump: https://github.com/NV/jsDump @method inspect @for Ember @param {Object} obj The object you want to inspect. @return {String} A description of the object @since 1.4.0 @private */ function inspect(obj) { if (obj === null) { return 'null'; } if (obj === undefined) { return 'undefined'; } if (Array.isArray(obj)) { return '[' + obj + ']'; } // for non objects var type = typeof obj; if (type !== 'object' && type !== 'symbol') { return '' + obj; } // overridden toString if (typeof obj.toString === 'function' && obj.toString !== objectToString) { return obj.toString(); } // Object.prototype.toString === {}.toString var v = undefined; var ret = []; for (var key in obj) { if (obj.hasOwnProperty(key)) { v = obj[key]; if (v === 'toString') { continue; } // ignore useless items if (typeof v === 'function') { v = 'function() { ... }'; } if (v && typeof v.toString !== 'function') { ret.push(key + ': ' + objectToString.call(v)); } else { ret.push(key + ': ' + v); } } } return '{' + ret.join(', ') + '}'; } /** @param {Object} t target @param {String} m method @param {Array} a args @private */ function applyStr(t, m, a) { var l = a && a.length; if (!a || !l) { return t[m](); } switch (l) { case 1: return t[m](a[0]); case 2: return t[m](a[0], a[1]); case 3: return t[m](a[0], a[1], a[2]); case 4: return t[m](a[0], a[1], a[2], a[3]); case 5: return t[m](a[0], a[1], a[2], a[3], a[4]); default: return t[m].apply(t, a); } } function lookupDescriptor(obj, keyName) { var current = obj; while (current) { var descriptor = Object.getOwnPropertyDescriptor(current, keyName); if (descriptor) { return descriptor; } current = Object.getPrototypeOf(current); } return null; } // A `toString` util function that supports objects without a `toString` // method, e.g. an object created with `Object.create(null)`. function toString(obj) { if (obj && obj.toString) { return obj.toString(); } else { return objectToString.call(obj); } } exports.GUID_KEY = GUID_KEY; exports.makeArray = makeArray; exports.canInvoke = canInvoke; }); enifed('ember-metal/watch_key', ['exports', 'ember-metal/features', 'ember-metal/meta', 'ember-metal/properties', 'ember-metal/utils'], function (exports, _emberMetalFeatures, _emberMetalMeta, _emberMetalProperties, _emberMetalUtils) { 'use strict'; exports.watchKey = watchKey; exports.unwatchKey = unwatchKey; var handleMandatorySetter = undefined; function watchKey(obj, keyName, meta) { var m = meta || _emberMetalMeta.meta(obj); // activate watching first time if (!m.peekWatching(keyName)) { m.writeWatching(keyName, 1); var possibleDesc = obj[keyName]; var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; if (desc && desc.willWatch) { desc.willWatch(obj, keyName); } if ('function' === typeof obj.willWatchProperty) { obj.willWatchProperty(keyName); } if (false) { // NOTE: this is dropped for prod + minified builds handleMandatorySetter(m, obj, keyName); } } else { m.writeWatching(keyName, (m.peekWatching(keyName) || 0) + 1); } } if (false) { (function () { var hasOwnProperty = function (obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); }; var propertyIsEnumerable = function (obj, key) { return Object.prototype.propertyIsEnumerable.call(obj, key); }; // Future traveler, although this code looks scary. It merely exists in // development to aid in development asertions. Production builds of // ember strip this entire block out handleMandatorySetter = function handleMandatorySetter(m, obj, keyName) { var descriptor = _emberMetalUtils.lookupDescriptor(obj, keyName); var configurable = descriptor ? descriptor.configurable : true; var isWritable = descriptor ? descriptor.writable : true; var hasValue = descriptor ? 'value' in descriptor : true; var possibleDesc = descriptor && descriptor.value; var isDescriptor = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor; if (isDescriptor) { return; } // this x in Y deopts, so keeping it in this function is better; if (configurable && isWritable && hasValue && keyName in obj) { var desc = { configurable: true, set: _emberMetalProperties.MANDATORY_SETTER_FUNCTION(keyName), enumerable: propertyIsEnumerable(obj, keyName), get: undefined }; if (hasOwnProperty(obj, keyName)) { m.writeValues(keyName, obj[keyName]); desc.get = _emberMetalProperties.DEFAULT_GETTER_FUNCTION(keyName); } else { desc.get = _emberMetalProperties.INHERITING_GETTER_FUNCTION(keyName); } Object.defineProperty(obj, keyName, desc); } }; })(); } function unwatchKey(obj, keyName, meta) { var m = meta || _emberMetalMeta.meta(obj); var count = m.peekWatching(keyName); if (count === 1) { m.writeWatching(keyName, 0); var possibleDesc = obj[keyName]; var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; if (desc && desc.didUnwatch) { desc.didUnwatch(obj, keyName); } if ('function' === typeof obj.didUnwatchProperty) { obj.didUnwatchProperty(keyName); } if (false) { // It is true, the following code looks quite WAT. But have no fear, It // exists purely to improve development ergonomics and is removed from // ember.min.js and ember.prod.js builds. // // Some further context: Once a property is watched by ember, bypassing `set` // for mutation, will bypass observation. This code exists to assert when // that occurs, and attempt to provide more helpful feedback. The alternative // is tricky to debug partially observable properties. if (!desc && keyName in obj) { var maybeMandatoryDescriptor = _emberMetalUtils.lookupDescriptor(obj, keyName); if (maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) { if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) { var possibleValue = m.readInheritedValue('values', keyName); if (possibleValue === _emberMetalMeta.UNDEFINED) { delete obj[keyName]; return; } } Object.defineProperty(obj, keyName, { configurable: true, enumerable: Object.prototype.propertyIsEnumerable.call(obj, keyName), writable: true, value: m.peekValues(keyName) }); m.deleteFromValues(keyName); } } } } else if (count > 1) { m.writeWatching(keyName, count - 1); } } }); enifed('ember-metal/watch_path', ['exports', 'ember-metal/meta', 'ember-metal/chains'], function (exports, _emberMetalMeta, _emberMetalChains) { 'use strict'; exports.makeChainNode = makeChainNode; exports.watchPath = watchPath; exports.unwatchPath = unwatchPath; // get the chains for the current object. If the current object has // chains inherited from the proto they will be cloned and reconfigured for // the current object. function chainsFor(obj, meta) { return (meta || _emberMetalMeta.meta(obj)).writableChains(makeChainNode); } function makeChainNode(obj) { return new _emberMetalChains.ChainNode(null, null, obj); } function watchPath(obj, keyPath, meta) { var m = meta || _emberMetalMeta.meta(obj); var counter = m.peekWatching(keyPath) || 0; if (!counter) { // activate watching first time m.writeWatching(keyPath, 1); chainsFor(obj, m).add(keyPath); } else { m.writeWatching(keyPath, counter + 1); } } function unwatchPath(obj, keyPath, meta) { var m = meta || _emberMetalMeta.meta(obj); var counter = m.peekWatching(keyPath) || 0; if (counter === 1) { m.writeWatching(keyPath, 0); chainsFor(obj, m).remove(keyPath); } else if (counter > 1) { m.writeWatching(keyPath, counter - 1); } } }); enifed('ember-metal/watching', ['exports', 'ember-metal/chains', 'ember-metal/watch_key', 'ember-metal/watch_path', 'ember-metal/path_cache', 'ember-metal/meta'], function (exports, _emberMetalChains, _emberMetalWatch_key, _emberMetalWatch_path, _emberMetalPath_cache, _emberMetalMeta) { /** @module ember-metal */ 'use strict'; exports.isWatching = isWatching; exports.watcherCount = watcherCount; exports.unwatch = unwatch; exports.destroy = destroy; /** Starts watching a property on an object. Whenever the property changes, invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the primitive used by observers and dependent keys; usually you will never call this method directly but instead use higher level methods like `Ember.addObserver()` @private @method watch @for Ember @param obj @param {String} _keyPath */ function watch(obj, _keyPath, m) { if (!_emberMetalPath_cache.isPath(_keyPath)) { _emberMetalWatch_key.watchKey(obj, _keyPath, m); } else { _emberMetalWatch_path.watchPath(obj, _keyPath, m); } } exports.watch = watch; function isWatching(obj, key) { var meta = _emberMetalMeta.peekMeta(obj); return (meta && meta.peekWatching(key)) > 0; } function watcherCount(obj, key) { var meta = _emberMetalMeta.peekMeta(obj); return meta && meta.peekWatching(key) || 0; } function unwatch(obj, _keyPath, m) { if (!_emberMetalPath_cache.isPath(_keyPath)) { _emberMetalWatch_key.unwatchKey(obj, _keyPath, m); } else { _emberMetalWatch_path.unwatchPath(obj, _keyPath, m); } } var NODE_STACK = []; /** Tears down the meta on an object so that it can be garbage collected. Multiple calls will have no effect. @method destroy @for Ember @param {Object} obj the object to destroy @return {void} @private */ function destroy(obj) { var meta = _emberMetalMeta.peekMeta(obj); var node = undefined, nodes = undefined, key = undefined, nodeObject = undefined; if (meta) { _emberMetalMeta.deleteMeta(obj); // remove chainWatchers to remove circular references that would prevent GC node = meta.readableChains(); if (node) { NODE_STACK.push(node); // process tree while (NODE_STACK.length > 0) { node = NODE_STACK.pop(); // push children nodes = node._chains; if (nodes) { for (key in nodes) { if (nodes[key] !== undefined) { NODE_STACK.push(nodes[key]); } } } // remove chainWatcher in node object if (node._watching) { nodeObject = node._object; if (nodeObject) { _emberMetalChains.removeChainWatcher(nodeObject, node._key, node); } } } } } } }); enifed('ember-metal/weak_map', ['exports', 'ember-metal/utils', 'ember-metal/meta'], function (exports, _emberMetalUtils, _emberMetalMeta) { 'use strict'; exports.default = WeakMap; var id = 0; function UNDEFINED() {} // Returns whether Type(value) is Object according to the terminology in the spec function isObject(value) { return typeof value === 'object' && value !== null || typeof value === 'function'; } /* * @class Ember.WeakMap * @public * @category ember-metal-weakmap * * A partial polyfill for [WeakMap](http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-objects). * * There is a small but important caveat. This implementation assumes that the * weak map will live longer (in the sense of garbage collection) than all of its * keys, otherwise it is possible to leak the values stored in the weak map. In * practice, most use cases satisfy this limitation which is why it is included * in ember-metal. */ function WeakMap(iterable) { if (!(this instanceof WeakMap)) { throw new TypeError('Constructor WeakMap requires \'new\''); } this._id = _emberMetalUtils.GUID_KEY + id++; if (iterable === null || iterable === undefined) { return; } else if (Array.isArray(iterable)) { for (var i = 0; i < iterable.length; i++) { var _iterable$i = iterable[i]; var key = _iterable$i[0]; var value = _iterable$i[1]; this.set(key, value); } } else { throw new TypeError('The weak map constructor polyfill only supports an array argument'); } } /* * @method get * @param key {Object | Function} * @return {Any} stored value */ WeakMap.prototype.get = function (obj) { if (!isObject(obj)) { return undefined; } var meta = _emberMetalMeta.peekMeta(obj); if (meta) { var map = meta.readableWeak(); if (map) { if (map[this._id] === UNDEFINED) { return undefined; } return map[this._id]; } } }; /* * @method set * @param key {Object | Function} * @param value {Any} * @return {WeakMap} the weak map */ WeakMap.prototype.set = function (obj, value) { if (!isObject(obj)) { throw new TypeError('Invalid value used as weak map key'); } if (value === undefined) { value = UNDEFINED; } _emberMetalMeta.meta(obj).writableWeak()[this._id] = value; return this; }; /* * @method has * @param key {Object | Function} * @return {boolean} if the key exists */ WeakMap.prototype.has = function (obj) { if (!isObject(obj)) { return false; } var meta = _emberMetalMeta.peekMeta(obj); if (meta) { var map = meta.readableWeak(); if (map) { return map[this._id] !== undefined; } } return false; }; /* * @method delete * @param key {Object | Function} * @return {boolean} if the key was deleted */ WeakMap.prototype.delete = function (obj) { if (this.has(obj)) { delete _emberMetalMeta.meta(obj).writableWeak()[this._id]; return true; } else { return false; } }; /* * @method toString * @return {String} */ WeakMap.prototype.toString = function () { return '[object WeakMap]'; }; }); enifed('ember-routing/ext/controller', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { 'use strict'; /** @module ember @submodule ember-routing */ _emberRuntime.ControllerMixin.reopen({ concatenatedProperties: ['queryParams'], /** Defines which query parameters the controller accepts. If you give the names `['category','page']` it will bind the values of these query parameters to the variables `this.category` and `this.page` @property queryParams @public */ queryParams: null, /** @property _qpDelegate @private */ _qpDelegate: null, // set by route /** @method _qpChanged @private */ _qpChanged: function (controller, _prop) { var prop = _prop.substr(0, _prop.length - 3); var delegate = controller._qpDelegate; var value = _emberMetal.get(controller, prop); delegate(prop, value); }, /** Transition the application into another route. The route may be either a single route or route path: ```javascript aController.transitionToRoute('blogPosts'); aController.transitionToRoute('blogPosts.recentEntries'); ``` Optionally supply a model for the route in question. The model will be serialized into the URL using the `serialize` hook of the route: ```javascript aController.transitionToRoute('blogPost', aPost); ``` If a literal is passed (such as a number or a string), it will be treated as an identifier instead. In this case, the `model` hook of the route will be triggered: ```javascript aController.transitionToRoute('blogPost', 1); ``` Multiple models will be applied last to first recursively up the route tree. ```javascript App.Router.map(function() { this.route('blogPost', { path: ':blogPostId' }, function() { this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); }); }); aController.transitionToRoute('blogComment', aPost, aComment); aController.transitionToRoute('blogComment', 1, 13); ``` It is also possible to pass a URL (a string that starts with a `/`). This is intended for testing and debugging purposes and should rarely be used in production code. ```javascript aController.transitionToRoute('/'); aController.transitionToRoute('/blog/post/1/comment/13'); aController.transitionToRoute('/blog/posts?sort=title'); ``` An options hash with a `queryParams` property may be provided as the final argument to add query parameters to the destination URL. ```javascript aController.transitionToRoute('blogPost', 1, { queryParams: { showComments: 'true' } }); // if you just want to transition the query parameters without changing the route aController.transitionToRoute({ queryParams: { sort: 'date' } }); ``` See also [replaceRoute](/api/classes/Ember.ControllerMixin.html#method_replaceRoute). @param {String} name the name of the route or a URL @param {...Object} models the model(s) or identifier(s) to be used while transitioning to the route. @param {Object} [options] optional hash with a queryParams property containing a mapping of query parameters @for Ember.ControllerMixin @method transitionToRoute @public */ transitionToRoute: function () { // target may be either another controller or a router var target = _emberMetal.get(this, 'target'); var method = target.transitionToRoute || target.transitionTo; return method.apply(target, arguments); }, /** Transition into another route while replacing the current URL, if possible. This will replace the current history entry instead of adding a new one. Beside that, it is identical to `transitionToRoute` in all other respects. ```javascript aController.replaceRoute('blogPosts'); aController.replaceRoute('blogPosts.recentEntries'); ``` Optionally supply a model for the route in question. The model will be serialized into the URL using the `serialize` hook of the route: ```javascript aController.replaceRoute('blogPost', aPost); ``` If a literal is passed (such as a number or a string), it will be treated as an identifier instead. In this case, the `model` hook of the route will be triggered: ```javascript aController.replaceRoute('blogPost', 1); ``` Multiple models will be applied last to first recursively up the route tree. ```javascript App.Router.map(function() { this.route('blogPost', { path: ':blogPostId' }, function() { this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); }); }); aController.replaceRoute('blogComment', aPost, aComment); aController.replaceRoute('blogComment', 1, 13); ``` It is also possible to pass a URL (a string that starts with a `/`). This is intended for testing and debugging purposes and should rarely be used in production code. ```javascript aController.replaceRoute('/'); aController.replaceRoute('/blog/post/1/comment/13'); ``` @param {String} name the name of the route or a URL @param {...Object} models the model(s) or identifier(s) to be used while transitioning to the route. @for Ember.ControllerMixin @method replaceRoute @private */ replaceRoute: function () { // target may be either another controller or a router var target = _emberMetal.get(this, 'target'); var method = target.replaceRoute || target.replaceWith; return method.apply(target, arguments); } }); exports.default = _emberRuntime.ControllerMixin; }); enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; /** @module ember @submodule ember-views */ // Add a new named queue after the 'actions' queue (where RSVP promises // resolve), which is used in router transitions to prevent unnecessary // loading state entry if all context promises resolve on the // 'actions' queue first. _emberMetal.run._addQueue('routerTransitions', 'actions'); }); enifed('ember-routing/index', ['exports', 'ember-routing/ext/run_loop', 'ember-routing/ext/controller', 'ember-routing/location/api', 'ember-routing/location/none_location', 'ember-routing/location/hash_location', 'ember-routing/location/history_location', 'ember-routing/location/auto_location', 'ember-routing/system/generate_controller', 'ember-routing/system/controller_for', 'ember-routing/system/dsl', 'ember-routing/system/router', 'ember-routing/system/route', 'ember-routing/system/query_params', 'ember-routing/services/routing', 'ember-routing/system/cache'], function (exports, _emberRoutingExtRun_loop, _emberRoutingExtController, _emberRoutingLocationApi, _emberRoutingLocationNone_location, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingSystemGenerate_controller, _emberRoutingSystemController_for, _emberRoutingSystemDsl, _emberRoutingSystemRouter, _emberRoutingSystemRoute, _emberRoutingSystemQuery_params, _emberRoutingServicesRouting, _emberRoutingSystemCache) { /** @module ember @submodule ember-routing */ // ES6TODO: Cleanup modules with side-effects below 'use strict'; exports.Location = _emberRoutingLocationApi.default; exports.NoneLocation = _emberRoutingLocationNone_location.default; exports.HashLocation = _emberRoutingLocationHash_location.default; exports.HistoryLocation = _emberRoutingLocationHistory_location.default; exports.AutoLocation = _emberRoutingLocationAuto_location.default; exports.generateController = _emberRoutingSystemGenerate_controller.default; exports.generateControllerFactory = _emberRoutingSystemGenerate_controller.generateControllerFactory; exports.controllerFor = _emberRoutingSystemController_for.default; exports.RouterDSL = _emberRoutingSystemDsl.default; exports.Router = _emberRoutingSystemRouter.default; exports.Route = _emberRoutingSystemRoute.default; exports.QueryParams = _emberRoutingSystemQuery_params.default; exports.RoutingService = _emberRoutingServicesRouting.default; exports.BucketCache = _emberRoutingSystemCache.default; }); enifed('ember-routing/location/api', ['exports', 'ember-metal', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberMetal, _emberEnvironment, _emberRoutingLocationUtil) { 'use strict'; /** @module ember @submodule ember-routing */ /** Ember.Location returns an instance of the correct implementation of the `location` API. ## Implementations You can pass an implementation name (`hash`, `history`, `none`) to force a particular implementation to be used in your application. ### HashLocation Using `HashLocation` results in URLs with a `#` (hash sign) separating the server side URL portion of the URL from the portion that is used by Ember. This relies upon the `hashchange` event existing in the browser. Example: ```javascript App.Router.map(function() { this.route('posts', function() { this.route('new'); }); }); App.Router.reopen({ location: 'hash' }); ``` This will result in a posts.new url of `/#/posts/new`. ### HistoryLocation Using `HistoryLocation` results in URLs that are indistinguishable from a standard URL. This relies upon the browser's `history` API. Example: ```javascript App.Router.map(function() { this.route('posts', function() { this.route('new'); }); }); App.Router.reopen({ location: 'history' }); ``` This will result in a posts.new url of `/posts/new`. Keep in mind that your server must serve the Ember app at all the routes you define. ### AutoLocation Using `AutoLocation`, the router will use the best Location class supported by the browser it is running in. Browsers that support the `history` API will use `HistoryLocation`, those that do not, but still support the `hashchange` event will use `HashLocation`, and in the rare case neither is supported will use `NoneLocation`. Example: ```javascript App.Router.map(function() { this.route('posts', function() { this.route('new'); }); }); App.Router.reopen({ location: 'auto' }); ``` This will result in a posts.new url of `/posts/new` for modern browsers that support the `history` api or `/#/posts/new` for older ones, like Internet Explorer 9 and below. When a user visits a link to your application, they will be automatically upgraded or downgraded to the appropriate `Location` class, with the URL transformed accordingly, if needed. Keep in mind that since some of your users will use `HistoryLocation`, your server must serve the Ember app at all the routes you define. ### NoneLocation Using `NoneLocation` causes Ember to not store the applications URL state in the actual URL. This is generally used for testing purposes, and is one of the changes made when calling `App.setupForTesting()`. ## Location API Each location implementation must provide the following methods: * implementation: returns the string name used to reference the implementation. * getURL: returns the current URL. * setURL(path): sets the current URL. * replaceURL(path): replace the current URL (optional). * onUpdateURL(callback): triggers the callback when the URL changes. * formatURL(url): formats `url` to be placed into `href` attribute. * detect() (optional): instructs the location to do any feature detection necessary. If the location needs to redirect to a different URL, it can cancel routing by setting the `cancelRouterSetup` property on itself to `false`. Calling setURL or replaceURL will not trigger onUpdateURL callbacks. ## Custom implementation Ember scans `app/locations/*` for extending the Location API. Example: ```javascript import Ember from 'ember'; export default Ember.HistoryLocation.extend({ implementation: 'history-url-logging', pushState: function (path) { console.log(path); this._super.apply(this, arguments); } }); ``` @class Location @namespace Ember @static @private */ exports.default = { /** This is deprecated in favor of using the container to lookup the location implementation as desired. For example: ```javascript // Given a location registered as follows: container.register('location:history-test', HistoryTestLocation); // You could create a new instance via: container.lookup('location:history-test'); ``` @method create @param {Object} options @return {Object} an instance of an implementation of the `location` API @deprecated Use the container to lookup the location implementation that you need. @private */ create: function (options) { var implementation = options && options.implementation; var implementationClass = this.implementations[implementation]; return implementationClass.create.apply(implementationClass, arguments); }, implementations: {}, _location: _emberEnvironment.environment.location, /** Returns the current `location.hash` by parsing location.href since browsers inconsistently URL-decode `location.hash`. https://bugzilla.mozilla.org/show_bug.cgi?id=483304 @private @method getHash @since 1.4.0 */ _getHash: function () { return _emberRoutingLocationUtil.getHash(this.location); } }; }); enifed('ember-routing/location/auto_location', ['exports', 'ember-metal', 'container', 'ember-runtime', 'ember-environment', 'ember-routing/location/util'], function (exports, _emberMetal, _container, _emberRuntime, _emberEnvironment, _emberRoutingLocationUtil) { 'use strict'; exports.getHistoryPath = getHistoryPath; exports.getHashPath = getHashPath; /** @module ember @submodule ember-routing */ /** Ember.AutoLocation will select the best location option based off browser support with the priority order: history, hash, none. Clean pushState paths accessed by hashchange-only browsers will be redirected to the hash-equivalent and vice versa so future transitions are consistent. Keep in mind that since some of your users will use `HistoryLocation`, your server must serve the Ember app at all the routes you define. @class AutoLocation @namespace Ember @static @private */ exports.default = _emberRuntime.Object.extend({ /** @private The browser's `location` object. This is typically equivalent to `window.location`, but may be overridden for testing. @property location @default environment.location */ location: _emberEnvironment.environment.location, /** @private The browser's `history` object. This is typically equivalent to `window.history`, but may be overridden for testing. @since 1.5.1 @property history @default environment.history */ history: _emberEnvironment.environment.history, /** @private The user agent's global variable. In browsers, this will be `window`. @since 1.11 @property global @default window */ global: _emberEnvironment.environment.window, /** @private The browser's `userAgent`. This is typically equivalent to `navigator.userAgent`, but may be overridden for testing. @since 1.5.1 @property userAgent @default environment.history */ userAgent: _emberEnvironment.environment.userAgent, /** @private This property is used by the router to know whether to cancel the routing setup process, which is needed while we redirect the browser. @since 1.5.1 @property cancelRouterSetup @default false */ cancelRouterSetup: false, /** @private Will be pre-pended to path upon state change. @since 1.5.1 @property rootURL @default '/' */ rootURL: '/', /** Called by the router to instruct the location to do any feature detection necessary. In the case of AutoLocation, we detect whether to use history or hash concrete implementations. @private */ detect: function () { var rootURL = this.rootURL; var implementation = detectImplementation({ location: this.location, history: this.history, userAgent: this.userAgent, rootURL: rootURL, documentMode: this.documentMode, global: this.global }); if (implementation === false) { _emberMetal.set(this, 'cancelRouterSetup', true); implementation = 'none'; } var concrete = _container.getOwner(this).lookup('location:' + implementation); _emberMetal.set(concrete, 'rootURL', rootURL); _emberMetal.set(this, 'concreteImplementation', concrete); }, initState: delegateToConcreteImplementation('initState'), getURL: delegateToConcreteImplementation('getURL'), setURL: delegateToConcreteImplementation('setURL'), replaceURL: delegateToConcreteImplementation('replaceURL'), onUpdateURL: delegateToConcreteImplementation('onUpdateURL'), formatURL: delegateToConcreteImplementation('formatURL'), willDestroy: function () { var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); if (concreteImplementation) { concreteImplementation.destroy(); } } }); function delegateToConcreteImplementation(methodName) { return function () { var concreteImplementation = _emberMetal.get(this, 'concreteImplementation'); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _emberMetal.tryInvoke(concreteImplementation, methodName, args); }; } /* Given the browser's `location`, `history` and `userAgent`, and a configured root URL, this function detects whether the browser supports the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History) and returns a string representing the Location object to use based on its determination. For example, if the page loads in an evergreen browser, this function would return the string "history", meaning the history API and thus HistoryLocation should be used. If the page is loaded in IE8, it will return the string "hash," indicating that the History API should be simulated by manipulating the hash portion of the location. */ function detectImplementation(options) { var location = options.location; var userAgent = options.userAgent; var history = options.history; var documentMode = options.documentMode; var global = options.global; var rootURL = options.rootURL; var implementation = 'none'; var cancelRouterSetup = false; var currentPath = _emberRoutingLocationUtil.getFullPath(location); if (_emberRoutingLocationUtil.supportsHistory(userAgent, history)) { var historyPath = getHistoryPath(rootURL, location); // If the browser supports history and we have a history path, we can use // the history location with no redirects. if (currentPath === historyPath) { return 'history'; } else { if (currentPath.substr(0, 2) === '/#') { history.replaceState({ path: historyPath }, null, historyPath); implementation = 'history'; } else { cancelRouterSetup = true; _emberRoutingLocationUtil.replacePath(location, historyPath); } } } else if (_emberRoutingLocationUtil.supportsHashChange(documentMode, global)) { var hashPath = getHashPath(rootURL, location); // Be sure we're using a hashed path, otherwise let's switch over it to so // we start off clean and consistent. We'll count an index path with no // hash as "good enough" as well. if (currentPath === hashPath || currentPath === '/' && hashPath === '/#/') { implementation = 'hash'; } else { // Our URL isn't in the expected hash-supported format, so we want to // cancel the router setup and replace the URL to start off clean cancelRouterSetup = true; _emberRoutingLocationUtil.replacePath(location, hashPath); } } if (cancelRouterSetup) { return false; } return implementation; } /** @private Returns the current path as it should appear for HistoryLocation supported browsers. This may very well differ from the real current path (e.g. if it starts off as a hashed URL) */ function getHistoryPath(rootURL, location) { var path = _emberRoutingLocationUtil.getPath(location); var hash = _emberRoutingLocationUtil.getHash(location); var query = _emberRoutingLocationUtil.getQuery(location); var rootURLIndex = path.indexOf(rootURL); var routeHash = undefined, hashParts = undefined; // By convention, Ember.js routes using HashLocation are required to start // with `#/`. Anything else should NOT be considered a route and should // be passed straight through, without transformation. if (hash.substr(0, 2) === '#/') { // There could be extra hash segments after the route hashParts = hash.substr(1).split('#'); // The first one is always the route url routeHash = hashParts.shift(); // If the path already has a trailing slash, remove the one // from the hashed route so we don't double up. if (path.slice(-1) === '/') { routeHash = routeHash.substr(1); } // This is the "expected" final order path = path + routeHash + query; if (hashParts.length) { path += '#' + hashParts.join('#'); } } else { path = path + query + hash; } return path; } /** @private Returns the current path as it should appear for HashLocation supported browsers. This may very well differ from the real current path. @method _getHashPath */ function getHashPath(rootURL, location) { var path = rootURL; var historyPath = getHistoryPath(rootURL, location); var routePath = historyPath.substr(rootURL.length); if (routePath !== '') { if (routePath.charAt(0) !== '/') { routePath = '/' + routePath; } path += '#' + routePath; } return path; } }); enifed('ember-routing/location/hash_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { 'use strict'; /** @module ember @submodule ember-routing */ /** `Ember.HashLocation` implements the location API using the browser's hash. At present, it relies on a `hashchange` event existing in the browser. @class HashLocation @namespace Ember @extends Ember.Object @private */ exports.default = _emberRuntime.Object.extend({ implementation: 'hash', init: function () { _emberMetal.set(this, 'location', _emberMetal.get(this, '_location') || window.location); this._hashchangeHandler = undefined; }, /** @private Returns normalized location.hash @since 1.5.1 @method getHash */ getHash: _emberRoutingLocationApi.default._getHash, /** Returns the normalized URL, constructed from `location.hash`. e.g. `#/foo` => `/foo` as well as `#/foo#bar` => `/foo#bar`. By convention, hashed paths must begin with a forward slash, otherwise they are not treated as a path so we can distinguish intent. @private @method getURL */ getURL: function () { var originalPath = this.getHash().substr(1); var outPath = originalPath; if (outPath.charAt(0) !== '/') { outPath = '/'; // Only add the # if the path isn't empty. // We do NOT want `/#` since the ampersand // is only included (conventionally) when // the location.hash has a value if (originalPath) { outPath += '#' + originalPath; } } return outPath; }, /** Set the `location.hash` and remembers what was set. This prevents `onUpdateURL` callbacks from triggering when the hash was set by `HashLocation`. @private @method setURL @param path {String} */ setURL: function (path) { _emberMetal.get(this, 'location').hash = path; _emberMetal.set(this, 'lastSetURL', path); }, /** Uses location.replace to update the url without a page reload or history modification. @private @method replaceURL @param path {String} */ replaceURL: function (path) { _emberMetal.get(this, 'location').replace('#' + path); _emberMetal.set(this, 'lastSetURL', path); }, /** Register a callback to be invoked when the hash changes. These callbacks will execute when the user presses the back or forward button, but not after `setURL` is invoked. @private @method onUpdateURL @param callback {Function} */ onUpdateURL: function (callback) { var _this = this; this._removeEventListener(); this._hashchangeHandler = function () { _emberMetal.run(function () { var path = _this.getURL(); if (_emberMetal.get(_this, 'lastSetURL') === path) { return; } _emberMetal.set(_this, 'lastSetURL', null); callback(path); }); }; window.addEventListener('hashchange', this._hashchangeHandler); }, /** Given a URL, formats it to be placed into the page as part of an element's `href` attribute. This is used, for example, when using the {{action}} helper to generate a URL based on an event. @private @method formatURL @param url {String} */ formatURL: function (url) { return '#' + url; }, /** Cleans up the HashLocation event listener. @private @method willDestroy */ willDestroy: function () { this._removeEventListener(); }, _removeEventListener: function () { if (this._hashchangeHandler) { window.removeEventListener('hashchange', this._hashchangeHandler); } } }); }); enifed('ember-routing/location/history_location', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/location/api'], function (exports, _emberMetal, _emberRuntime, _emberRoutingLocationApi) { 'use strict'; /** @module ember @submodule ember-routing */ var popstateFired = false; /** Ember.HistoryLocation implements the location API using the browser's history.pushState API. @class HistoryLocation @namespace Ember @extends Ember.Object @private */ exports.default = _emberRuntime.Object.extend({ implementation: 'history', init: function () { this._super.apply(this, arguments); var base = document.querySelector('base'); var baseURL = base ? base.getAttribute('href') : ''; _emberMetal.set(this, 'baseURL', baseURL); _emberMetal.set(this, 'location', _emberMetal.get(this, 'location') || window.location); this._popstateHandler = undefined; }, /** Used to set state on first call to setURL @private @method initState */ initState: function () { var history = _emberMetal.get(this, 'history') || window.history; _emberMetal.set(this, 'history', history); if (history && 'state' in history) { this.supportsHistory = true; } this.replaceState(this.formatURL(this.getURL())); }, /** Will be pre-pended to path upon state change @property rootURL @default '/' @private */ rootURL: '/', /** Returns the current `location.pathname` without `rootURL` or `baseURL` @private @method getURL @return url {String} */ getURL: function () { var location = _emberMetal.get(this, 'location'); var path = location.pathname; var rootURL = _emberMetal.get(this, 'rootURL'); var baseURL = _emberMetal.get(this, 'baseURL'); // remove trailing slashes if they exists rootURL = rootURL.replace(/\/$/, ''); baseURL = baseURL.replace(/\/$/, ''); // remove baseURL and rootURL from start of path var url = path.replace(new RegExp('^' + baseURL + '(?=/|$)'), '').replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); var search = location.search || ''; url += search; url += this.getHash(); return url; }, /** Uses `history.pushState` to update the url without a page reload. @private @method setURL @param path {String} */ setURL: function (path) { var state = this.getState(); path = this.formatURL(path); if (!state || state.path !== path) { this.pushState(path); } }, /** Uses `history.replaceState` to update the url without a page reload or history modification. @private @method replaceURL @param path {String} */ replaceURL: function (path) { var state = this.getState(); path = this.formatURL(path); if (!state || state.path !== path) { this.replaceState(path); } }, /** Get the current `history.state`. Checks for if a polyfill is required and if so fetches this._historyState. The state returned from getState may be null if an iframe has changed a window's history. @private @method getState @return state {Object} */ getState: function () { if (this.supportsHistory) { return _emberMetal.get(this, 'history').state; } return this._historyState; }, /** Pushes a new state. @private @method pushState @param path {String} */ pushState: function (path) { var state = { path: path }; _emberMetal.get(this, 'history').pushState(state, null, path); this._historyState = state; // used for webkit workaround this._previousURL = this.getURL(); }, /** Replaces the current state. @private @method replaceState @param path {String} */ replaceState: function (path) { var state = { path: path }; _emberMetal.get(this, 'history').replaceState(state, null, path); this._historyState = state; // used for webkit workaround this._previousURL = this.getURL(); }, /** Register a callback to be invoked whenever the browser history changes, including using forward and back buttons. @private @method onUpdateURL @param callback {Function} */ onUpdateURL: function (callback) { var _this = this; this._removeEventListener(); this._popstateHandler = function () { // Ignore initial page load popstate event in Chrome if (!popstateFired) { popstateFired = true; if (_this.getURL() === _this._previousURL) { return; } } callback(_this.getURL()); }; window.addEventListener('popstate', this._popstateHandler); }, /** Used when using `{{action}}` helper. The url is always appended to the rootURL. @private @method formatURL @param url {String} @return formatted url {String} */ formatURL: function (url) { var rootURL = _emberMetal.get(this, 'rootURL'); var baseURL = _emberMetal.get(this, 'baseURL'); if (url !== '') { // remove trailing slashes if they exists rootURL = rootURL.replace(/\/$/, ''); baseURL = baseURL.replace(/\/$/, ''); } else if (baseURL.match(/^\//) && rootURL.match(/^\//)) { // if baseURL and rootURL both start with a slash // ... remove trailing slash from baseURL if it exists baseURL = baseURL.replace(/\/$/, ''); } return baseURL + rootURL + url; }, /** Cleans up the HistoryLocation event listener. @private @method willDestroy */ willDestroy: function () { this._removeEventListener(); }, /** @private Returns normalized location.hash @method getHash */ getHash: _emberRoutingLocationApi.default._getHash, _removeEventListener: function () { if (this._popstateHandler) { window.removeEventListener('popstate', this._popstateHandler); } } }); }); enifed('ember-routing/location/none_location', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { 'use strict'; /** @module ember @submodule ember-routing */ /** Ember.NoneLocation does not interact with the browser. It is useful for testing, or when you need to manage state with your Router, but temporarily don't want it to muck with the URL (for example when you embed your application in a larger page). @class NoneLocation @namespace Ember @extends Ember.Object @private */ exports.default = _emberRuntime.Object.extend({ implementation: 'none', path: '', detect: function () { var rootURL = this.rootURL; }, /** Will be pre-pended to path. @private @property rootURL @default '/' */ rootURL: '/', /** Returns the current path without `rootURL`. @private @method getURL @return {String} path */ getURL: function () { var path = _emberMetal.get(this, 'path'); var rootURL = _emberMetal.get(this, 'rootURL'); // remove trailing slashes if they exists rootURL = rootURL.replace(/\/$/, ''); // remove rootURL from url return path.replace(new RegExp('^' + rootURL + '(?=/|$)'), ''); }, /** Set the path and remembers what was set. Using this method to change the path will not invoke the `updateURL` callback. @private @method setURL @param path {String} */ setURL: function (path) { _emberMetal.set(this, 'path', path); }, /** Register a callback to be invoked when the path changes. These callbacks will execute when the user presses the back or forward button, but not after `setURL` is invoked. @private @method onUpdateURL @param callback {Function} */ onUpdateURL: function (callback) { this.updateCallback = callback; }, /** Sets the path and calls the `updateURL` callback. @private @method handleURL @param callback {Function} */ handleURL: function (url) { _emberMetal.set(this, 'path', url); this.updateCallback(url); }, /** Given a URL, formats it to be placed into the page as part of an element's `href` attribute. This is used, for example, when using the {{action}} helper to generate a URL based on an event. @private @method formatURL @param url {String} @return {String} url */ formatURL: function (url) { var rootURL = _emberMetal.get(this, 'rootURL'); if (url !== '') { // remove trailing slashes if they exists rootURL = rootURL.replace(/\/$/, ''); } return rootURL + url; } }); }); enifed('ember-routing/location/util', ['exports'], function (exports) { /** @private Returns the current `location.pathname`, normalized for IE inconsistencies. */ 'use strict'; exports.getPath = getPath; exports.getQuery = getQuery; exports.getHash = getHash; exports.getFullPath = getFullPath; exports.getOrigin = getOrigin; exports.supportsHashChange = supportsHashChange; exports.supportsHistory = supportsHistory; exports.replacePath = replacePath; function getPath(location) { var pathname = location.pathname; // Various versions of IE/Opera don't always return a leading slash if (pathname.charAt(0) !== '/') { pathname = '/' + pathname; } return pathname; } /** @private Returns the current `location.search`. */ function getQuery(location) { return location.search; } /** @private Returns the current `location.hash` by parsing location.href since browsers inconsistently URL-decode `location.hash`. Should be passed the browser's `location` object as the first argument. https://bugzilla.mozilla.org/show_bug.cgi?id=483304 */ function getHash(location) { var href = location.href; var hashIndex = href.indexOf('#'); if (hashIndex === -1) { return ''; } else { return href.substr(hashIndex); } } function getFullPath(location) { return getPath(location) + getQuery(location) + getHash(location); } function getOrigin(location) { var origin = location.origin; // Older browsers, especially IE, don't have origin if (!origin) { origin = location.protocol + '//' + location.hostname; if (location.port) { origin += ':' + location.port; } } return origin; } /* `documentMode` only exist in Internet Explorer, and it's tested because IE8 running in IE7 compatibility mode claims to support `onhashchange` but actually does not. `global` is an object that may have an `onhashchange` property. @private @function supportsHashChange */ function supportsHashChange(documentMode, global) { return 'onhashchange' in global && (documentMode === undefined || documentMode > 7); } /* `userAgent` is a user agent string. We use user agent testing here, because the stock Android browser is known to have buggy versions of the History API, in some Android versions. @private @function supportsHistory */ function supportsHistory(userAgent, history) { // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support // Unfortunately support is really buggy and there is no clean way to detect // these bugs, so we fall back to a user agent sniff :( // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies // itself as 'Mobile Safari' as well, nor Windows Phone. if ((userAgent.indexOf('Android 2.') !== -1 || userAgent.indexOf('Android 4.0') !== -1) && userAgent.indexOf('Mobile Safari') !== -1 && userAgent.indexOf('Chrome') === -1 && userAgent.indexOf('Windows Phone') === -1) { return false; } return !!(history && 'pushState' in history); } /** Replaces the current location, making sure we explicitly include the origin to prevent redirecting to a different origin. @private */ function replacePath(location, path) { location.replace(getOrigin(location) + path); } }); enifed('ember-routing/services/routing', ['exports', 'ember-runtime', 'ember-metal', 'ember-routing/utils'], function (exports, _emberRuntime, _emberMetal, _emberRoutingUtils) { /** @module ember @submodule ember-routing */ 'use strict'; /** The Routing service is used by LinkComponent, and provides facilities for the component/view layer to interact with the router. While still private, this service can eventually be opened up, and provides the set of API needed for components to control routing without interacting with router internals. @private @class RoutingService */ exports.default = _emberRuntime.Service.extend({ router: null, targetState: _emberRuntime.readOnly('router.targetState'), currentState: _emberRuntime.readOnly('router.currentState'), currentRouteName: _emberRuntime.readOnly('router.currentRouteName'), currentPath: _emberRuntime.readOnly('router.currentPath'), availableRoutes: function () { return Object.keys(_emberMetal.get(this, 'router').router.recognizer.names); }, hasRoute: function (routeName) { return _emberMetal.get(this, 'router').hasRoute(routeName); }, transitionTo: function (routeName, models, queryParams, shouldReplace) { var router = _emberMetal.get(this, 'router'); var transition = router._doTransition(routeName, models, queryParams); if (shouldReplace) { transition.method('replace'); } return transition; }, normalizeQueryParams: function (routeName, models, queryParams) { var router = _emberMetal.get(this, 'router'); router._prepareQueryParams(routeName, models, queryParams); }, generateURL: function (routeName, models, queryParams) { var router = _emberMetal.get(this, 'router'); if (!router.router) { return; } var visibleQueryParams = {}; _emberMetal.assign(visibleQueryParams, queryParams); this.normalizeQueryParams(routeName, models, visibleQueryParams); var args = _emberRoutingUtils.routeArgs(routeName, models, visibleQueryParams); return router.generate.apply(router, args); }, isActiveForRoute: function (contexts, queryParams, routeName, routerState, isCurrentWhenSpecified) { var router = _emberMetal.get(this, 'router'); var handlers = router.router.recognizer.handlersFor(routeName); var leafName = handlers[handlers.length - 1].handler; var maximumContexts = numberOfContextsAcceptedByHandler(routeName, handlers); // NOTE: any ugliness in the calculation of activeness is largely // due to the fact that we support automatic normalizing of // `resource` -> `resource.index`, even though there might be // dynamic segments / query params defined on `resource.index` // which complicates (and makes somewhat ambiguous) the calculation // of activeness for links that link to `resource` instead of // directly to `resource.index`. // if we don't have enough contexts revert back to full route name // this is because the leaf route will use one of the contexts if (contexts.length > maximumContexts) { routeName = leafName; } return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified); } }); function numberOfContextsAcceptedByHandler(handler, handlerInfos) { var req = 0; for (var i = 0; i < handlerInfos.length; i++) { req = req + handlerInfos[i].names.length; if (handlerInfos[i].handler === handler) { break; } } return req; } }); enifed('ember-routing/system/cache', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { 'use strict'; exports.default = _emberRuntime.Object.extend({ init: function () { this.cache = {}; }, has: function (bucketKey) { return bucketKey in this.cache; }, stash: function (bucketKey, key, value) { var bucket = this.cache[bucketKey]; if (!bucket) { bucket = this.cache[bucketKey] = {}; } bucket[key] = value; }, lookup: function (bucketKey, prop, defaultValue) { var cache = this.cache; if (!(bucketKey in cache)) { return defaultValue; } var bucket = cache[bucketKey]; if (prop in bucket) { return bucket[prop]; } else { return defaultValue; } } }); }); enifed("ember-routing/system/controller_for", ["exports"], function (exports) { /** @module ember @submodule ember-routing */ /** Finds a controller instance. @for Ember @method controllerFor @private */ "use strict"; exports.default = controllerFor; function controllerFor(container, controllerName, lookupOptions) { return container.lookup("controller:" + controllerName, lookupOptions); } }); enifed('ember-routing/system/dsl', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; /** @module ember @submodule ember-routing */ function DSL(name, options) { this.parent = name; this.enableLoadingSubstates = options && options.enableLoadingSubstates; this.matches = []; this.explicitIndex = undefined; this.options = options; } exports.default = DSL; DSL.prototype = { route: function (name, options, callback) { var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; if (arguments.length === 2 && typeof options === 'function') { callback = options; options = {}; } if (arguments.length === 1) { options = {}; } if (this.enableLoadingSubstates) { createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); createRoute(this, name + '_error', { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); } if (callback) { var fullName = getFullName(this, name, options.resetNamespace); var dsl = new DSL(fullName, this.options); createRoute(dsl, 'loading'); createRoute(dsl, 'error', { path: dummyErrorRoute }); callback.call(dsl); createRoute(this, name, options, dsl.generate()); } else { createRoute(this, name, options); } }, push: function (url, name, callback, serialize) { var parts = name.split('.'); if (this.options.engineInfo) { var localFullName = name.slice(this.options.engineInfo.fullName.length + 1); var routeInfo = _emberMetal.assign({ localFullName: localFullName }, this.options.engineInfo); if (serialize) { routeInfo.serializeMethod = serialize; } this.options.addRouteForEngine(name, routeInfo); } else if (serialize) { throw new Error('Defining a route serializer on route \'' + name + '\' outside an Engine is not allowed.'); } if (url === '' || url === '/' || parts[parts.length - 1] === 'index') { this.explicitIndex = true; } this.matches.push([url, name, callback]); }, resource: function (name, options, callback) { if (arguments.length === 2 && typeof options === 'function') { callback = options; options = {}; } if (arguments.length === 1) { options = {}; } options.resetNamespace = true; this.route(name, options, callback); }, generate: function () { var dslMatches = this.matches; if (!this.explicitIndex) { this.route('index', { path: '/' }); } return function (match) { for (var i = 0; i < dslMatches.length; i++) { var dslMatch = dslMatches[i]; match(dslMatch[0]).to(dslMatch[1], dslMatch[2]); } }; } }; function canNest(dsl) { return dsl.parent && dsl.parent !== 'application'; } function getFullName(dsl, name, resetNamespace) { if (canNest(dsl) && resetNamespace !== true) { return dsl.parent + '.' + name; } else { return name; } } function createRoute(dsl, name, options, callback) { options = options || {}; var fullName = getFullName(dsl, name, options.resetNamespace); if (typeof options.path !== 'string') { options.path = '/' + name; } dsl.push(options.path, fullName, callback, options.serialize); } DSL.map = function (callback) { var dsl = new DSL(); callback.call(dsl); return dsl; }; var uuid = 0; DSL.prototype.mount = function (_name, _options) { var options = _options || {}; var engineRouteMap = this.options.resolveRouteMap(_name); var name = _name; if (options.as) { name = options.as; } var fullName = getFullName(this, name, options.resetNamespace); var engineInfo = { name: _name, instanceId: uuid++, mountPoint: fullName, fullName: fullName }; var path = options.path; if (typeof path !== 'string') { path = '/' + name; } var callback = undefined; if (engineRouteMap) { var shouldResetEngineInfo = false; var oldEngineInfo = this.options.engineInfo; if (oldEngineInfo) { shouldResetEngineInfo = true; this.options.engineInfo = engineInfo; } var optionsForChild = _emberMetal.assign({ engineInfo: engineInfo }, this.options); var childDSL = new DSL(fullName, optionsForChild); engineRouteMap.call(childDSL); callback = childDSL.generate(); if (shouldResetEngineInfo) { this.options.engineInfo = oldEngineInfo; } } if (this.enableLoadingSubstates) { var dummyErrorRoute = '/_unused_dummy_error_path_route_' + name + '/:error'; createRoute(this, name + '_loading', { resetNamespace: options.resetNamespace }); createRoute(this, name + '_error', { resetNamespace: options.resetNamespace, path: dummyErrorRoute }); } var localFullName = 'application'; var routeInfo = _emberMetal.assign({ localFullName: localFullName }, engineInfo); this.options.addRouteForEngine(fullName, routeInfo); this.push(path, fullName, callback); }; }); enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; exports.generateControllerFactory = generateControllerFactory; exports.default = generateController; /** @module ember @submodule ember-routing */ /** Generates a controller factory @for Ember @method generateControllerFactory @private */ function generateControllerFactory(owner, controllerName, context) { var Factory = owner._lookupFactory('controller:basic').extend({ isGenerated: true, toString: function () { return '(generated ' + controllerName + ' controller)'; } }); var fullName = 'controller:' + controllerName; owner.register(fullName, Factory); return Factory; } /** Generates and instantiates a controller. The type of the generated controller factory is derived from the context. If the context is an array an array controller is generated, if an object, an object controller otherwise, a basic controller is generated. @for Ember @method generateController @private @since 1.3.0 */ function generateController(owner, controllerName, context) { generateControllerFactory(owner, controllerName, context); var fullName = 'controller:' + controllerName; var instance = owner.lookup(fullName); if (_emberMetal.get(instance, 'namespace.LOG_ACTIVE_GENERATION')) {} return instance; } }); enifed('ember-routing/system/query_params', ['exports', 'ember-runtime'], function (exports, _emberRuntime) { 'use strict'; exports.default = _emberRuntime.Object.extend({ isQueryParams: true, values: null }); }); enifed('ember-routing/system/route', ['exports', 'ember-metal', 'ember-runtime', 'ember-routing/system/generate_controller', 'ember-routing/utils', 'container'], function (exports, _emberMetal, _emberRuntime, _emberRoutingSystemGenerate_controller, _emberRoutingUtils, _container) { 'use strict'; exports.defaultSerialize = defaultSerialize; exports.hasDefaultSerialize = hasDefaultSerialize; var slice = Array.prototype.slice; function K() { return this; } function defaultSerialize(model, params) { if (params.length < 1) { return; } if (!model) { return; } var name = params[0]; var object = {}; if (params.length === 1) { if (name in model) { object[name] = _emberMetal.get(model, name); } else if (/_id$/.test(name)) { object[name] = _emberMetal.get(model, 'id'); } } else { object = _emberMetal.getProperties(model, params); } return object; } var DEFAULT_SERIALIZE = _emberMetal.symbol('DEFAULT_SERIALIZE'); defaultSerialize[DEFAULT_SERIALIZE] = true; function hasDefaultSerialize(route) { return !!route.serialize[DEFAULT_SERIALIZE]; } /** @module ember @submodule ember-routing */ /** The `Ember.Route` class is used to define individual routes. Refer to the [routing guide](http://emberjs.com/guides/routing/) for documentation. @class Route @namespace Ember @extends Ember.Object @uses Ember.ActionHandler @uses Ember.Evented @public */ var Route = _emberRuntime.Object.extend(_emberRuntime.ActionHandler, _emberRuntime.Evented, { /** Configuration hash for this route's queryParams. The possible configuration options and their defaults are as follows (assuming a query param whose controller property is `page`): ```javascript queryParams: { page: { // By default, controller query param properties don't // cause a full transition when they are changed, but // rather only cause the URL to update. Setting // `refreshModel` to true will cause an "in-place" // transition to occur, whereby the model hooks for // this route (and any child routes) will re-fire, allowing // you to reload models (e.g., from the server) using the // updated query param values. refreshModel: false, // By default, changes to controller query param properties // cause the URL to update via `pushState`, which means an // item will be added to the browser's history, allowing // you to use the back button to restore the app to the // previous state before the query param property was changed. // Setting `replace` to true will use `replaceState` (or its // hash location equivalent), which causes no browser history // item to be added. This options name and default value are // the same as the `link-to` helper's `replace` option. replace: false, // By default, the query param URL key is the same name as // the controller property name. Use `as` to specify a // different URL key. as: 'page' } } ``` @property queryParams @for Ember.Route @type Object @public */ queryParams: {}, /** The name of the route, dot-delimited. For example, a route found at `app/routes/posts/post.js` or `app/posts/post/route.js` (with pods) will have a `routeName` of `posts.post`. @property routeName @for Ember.Route @type String @public */ /** @private @property _qp */ _qp: _emberMetal.computed(function () { var _this = this; var controllerProto = undefined, combinedQueryParameterConfiguration = undefined; var controllerName = this.controllerName || this.routeName; var definedControllerClass = _container.getOwner(this)._lookupFactory('controller:' + controllerName); var queryParameterConfiguraton = _emberMetal.get(this, 'queryParams'); var hasRouterDefinedQueryParams = !!Object.keys(queryParameterConfiguraton).length; if (definedControllerClass) { // the developer has authored a controller class in their application for this route // access the prototype, find its query params and normalize their object shape // them merge in the query params for the route. As a mergedProperty, Route#queryParams is always // at least `{}` controllerProto = definedControllerClass.proto(); var controllerDefinedQueryParameterConfiguration = _emberMetal.get(controllerProto, 'queryParams'); var normalizedControllerQueryParameterConfiguration = _emberRoutingUtils.normalizeControllerQueryParams(controllerDefinedQueryParameterConfiguration); combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton); if (_emberMetal.isFeatureEnabled('ember-routing-route-configured-query-params')) { if (controllerDefinedQueryParameterConfiguration.length) {} } } else if (hasRouterDefinedQueryParams) { // the developer has not defined a controller but *has* supplied route query params. // Generate a class for them so we can later insert default values var generatedControllerClass = _emberRoutingSystemGenerate_controller.generateControllerFactory(_container.getOwner(this), controllerName); controllerProto = generatedControllerClass.proto(); combinedQueryParameterConfiguration = queryParameterConfiguraton; } var qps = []; var map = {}; var propertyNames = []; for (var propName in combinedQueryParameterConfiguration) { if (!combinedQueryParameterConfiguration.hasOwnProperty(propName)) { continue; } // to support the dubious feature of using unknownProperty // on queryParams configuration if (propName === 'unknownProperty' || propName === '_super') { // possible todo: issue deprecation warning? continue; } var desc = combinedQueryParameterConfiguration[propName]; if (_emberMetal.isFeatureEnabled('ember-routing-route-configured-query-params')) { // apply default values to controllers // detect that default value defined on router config if (desc.hasOwnProperty('defaultValue')) { // detect that property was not defined on controller if (controllerProto[propName] === undefined) { controllerProto[propName] = desc.defaultValue; } else { deprecateQueryParamDefaultValuesSetOnController(controllerName, this.routeName, propName); } } } var scope = desc.scope || 'model'; var parts = undefined; if (scope === 'controller') { parts = []; } var urlKey = desc.as || this.serializeQueryParamKey(propName); var defaultValue = _emberMetal.get(controllerProto, propName); if (Array.isArray(defaultValue)) { defaultValue = _emberRuntime.A(defaultValue.slice()); } var type = desc.type || _emberRuntime.typeOf(defaultValue); var defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type); var scopedPropertyName = controllerName + ':' + propName; var qp = { undecoratedDefaultValue: _emberMetal.get(controllerProto, propName), defaultValue: defaultValue, serializedDefaultValue: defaultValueSerialized, serializedValue: defaultValueSerialized, type: type, urlKey: urlKey, prop: propName, scopedPropertyName: scopedPropertyName, ctrl: controllerName, route: this, parts: parts, // provided later when stashNames is called if 'model' scope values: null, // provided later when setup is called. no idea why. scope: scope, prefix: '' }; map[propName] = map[urlKey] = map[scopedPropertyName] = qp; qps.push(qp); propertyNames.push(propName); } return { qps: qps, map: map, propertyNames: propertyNames, states: { /* Called when a query parameter changes in the URL, this route cares about that query parameter, but the route is not currently in the active route hierarchy. */ inactive: function (prop, value) { var qp = map[prop]; _this._qpChanged(prop, value, qp); }, /* Called when a query parameter changes in the URL, this route cares about that query parameter, and the route is currently in the active route hierarchy. */ active: function (prop, value) { var qp = map[prop]; _this._qpChanged(prop, value, qp); return _this._activeQPChanged(map[prop], value); }, /* Called when a value of a query parameter this route handles changes in a controller and the route is currently in the active route hierarchy. */ allowOverrides: function (prop, value) { var qp = map[prop]; _this._qpChanged(prop, value, qp); return _this._updatingQPChanged(map[prop]); } } }; }), /** @private @property _names */ _names: null, /** @private @method _stashNames */ _stashNames: function (_handlerInfo, dynamicParent) { var handlerInfo = _handlerInfo; if (this._names) { return; } var names = this._names = handlerInfo._names; if (!names.length) { handlerInfo = dynamicParent; names = handlerInfo && handlerInfo._names || []; } var qps = _emberMetal.get(this, '_qp.qps'); var namePaths = new Array(names.length); for (var a = 0; a < names.length; ++a) { namePaths[a] = handlerInfo.name + '.' + names[a]; } for (var i = 0; i < qps.length; ++i) { var qp = qps[i]; if (qp.scope === 'model') { qp.parts = namePaths; } qp.prefix = qp.ctrl; } }, /** @private @property _activeQPChanged */ _activeQPChanged: function (qp, value) { var router = this.router; router._activeQPChanged(qp.scopedPropertyName, value); }, /** @private @method _updatingQPChanged */ _updatingQPChanged: function (qp) { var router = this.router; router._updatingQPChanged(qp.urlKey); }, mergedProperties: ['queryParams'], /** Returns a hash containing the parameters of an ancestor route. Example ```javascript App.Router.map(function() { this.route('member', { path: ':name' }, function() { this.route('interest', { path: ':interest' }); }); }); App.MemberRoute = Ember.Route.extend({ queryParams: { memberQp: { refreshModel: true } } }); App.MemberInterestRoute = Ember.Route.extend({ queryParams: { interestQp: { refreshModel: true } }, model() { return this.paramsFor('member'); } }); ``` If we visit `/turing/maths?memberQp=member&interestQp=interest` the model for the `member.interest` route is hash with: * `name`: `turing` * `memberQp`: `member` @method paramsFor @param {String} name @return {Object} hash containing the parameters of the route `name` @public */ paramsFor: function (name) { var route = _container.getOwner(this).lookup('route:' + name); if (!route) { return {}; } var transition = this.router.router.activeTransition; var state = transition ? transition.state : this.router.router.state; var params = {}; var fullName = getEngineRouteName(_container.getOwner(this), name); _emberMetal.assign(params, state.params[fullName]); _emberMetal.assign(params, getQueryParamsFor(route, state)); return params; }, /** Serializes the query parameter key @method serializeQueryParamKey @param {String} controllerPropertyName @private */ serializeQueryParamKey: function (controllerPropertyName) { return controllerPropertyName; }, /** Serializes value of the query parameter based on defaultValueType @method serializeQueryParam @param {Object} value @param {String} urlKey @param {String} defaultValueType @private */ serializeQueryParam: function (value, urlKey, defaultValueType) { // urlKey isn't used here, but anyone overriding // can use it to provide serialization specific // to a certain query param. if (defaultValueType === 'array') { return JSON.stringify(value); } return '' + value; }, /** Deserializes value of the query parameter based on defaultValueType @method deserializeQueryParam @param {Object} value @param {String} urlKey @param {String} defaultValueType @private */ deserializeQueryParam: function (value, urlKey, defaultValueType) { // urlKey isn't used here, but anyone overriding // can use it to provide deserialization specific // to a certain query param. // Use the defaultValueType of the default value (the initial value assigned to a // controller query param property), to intelligently deserialize and cast. if (defaultValueType === 'boolean') { return value === 'true' ? true : false; } else if (defaultValueType === 'number') { return Number(value).valueOf(); } else if (defaultValueType === 'array') { return _emberRuntime.A(JSON.parse(value)); } return value; }, /** @private @property _optionsForQueryParam */ _optionsForQueryParam: function (qp) { return _emberMetal.get(this, 'queryParams.' + qp.urlKey) || _emberMetal.get(this, 'queryParams.' + qp.prop) || {}; }, /** A hook you can use to reset controller values either when the model changes or the route is exiting. ```javascript App.ArticlesRoute = Ember.Route.extend({ // ... resetController: function(controller, isExiting, transition) { if (isExiting) { controller.set('page', 1); } } }); ``` @method resetController @param {Controller} controller instance @param {Boolean} isExiting @param {Object} transition @since 1.7.0 @public */ resetController: K, /** @private @method exit */ exit: function () { this.deactivate(); this.trigger('deactivate'); this.teardownViews(); }, /** @private @method _reset @since 1.7.0 */ _reset: function (isExiting, transition) { var controller = this.controller; controller._qpDelegate = _emberMetal.get(this, '_qp.states.inactive'); this.resetController(controller, isExiting, transition); }, /** @private @method enter */ enter: function () { this.connections = []; this.activate(); this.trigger('activate'); }, /** The name of the template to use by default when rendering this routes template. ```javascript let PostsList = Ember.Route.extend({ templateName: 'posts/list' }); App.PostsIndexRoute = PostsList.extend(); App.PostsArchivedRoute = PostsList.extend(); ``` @property templateName @type String @default null @since 1.4.0 @public */ templateName: null, /** The name of the controller to associate with this route. By default, Ember will lookup a route's controller that matches the name of the route (i.e. `App.PostController` for `App.PostRoute`). However, if you would like to define a specific controller to use, you can do so using this property. This is useful in many ways, as the controller specified will be: * passed to the `setupController` method. * used as the controller for the template being rendered by the route. * returned from a call to `controllerFor` for the route. @property controllerName @type String @default null @since 1.4.0 @public */ controllerName: null, /** The `willTransition` action is fired at the beginning of any attempted transition with a `Transition` object as the sole argument. This action can be used for aborting, redirecting, or decorating the transition from the currently active routes. A good example is preventing navigation when a form is half-filled out: ```javascript App.ContactFormRoute = Ember.Route.extend({ actions: { willTransition: function(transition) { if (this.controller.get('userHasEnteredData')) { this.controller.displayNavigationConfirm(); transition.abort(); } } } }); ``` You can also redirect elsewhere by calling `this.transitionTo('elsewhere')` from within `willTransition`. Note that `willTransition` will not be fired for the redirecting `transitionTo`, since `willTransition` doesn't fire when there is already a transition underway. If you want subsequent `willTransition` actions to fire for the redirecting transition, you must first explicitly call `transition.abort()`. To allow the `willTransition` event to continue bubbling to the parent route, use `return true;`. When the `willTransition` method has a return value of `true` then the parent route's `willTransition` method will be fired, enabling "bubbling" behavior for the event. @event willTransition @param {Transition} transition @public */ /** The `didTransition` action is fired after a transition has successfully been completed. This occurs after the normal model hooks (`beforeModel`, `model`, `afterModel`, `setupController`) have resolved. The `didTransition` action has no arguments, however, it can be useful for tracking page views or resetting state on the controller. ```javascript App.LoginRoute = Ember.Route.extend({ actions: { didTransition: function() { this.controller.get('errors.base').clear(); return true; // Bubble the didTransition event } } }); ``` @event didTransition @since 1.2.0 @public */ /** The `loading` action is fired on the route when a route's `model` hook returns a promise that is not already resolved. The current `Transition` object is the first parameter and the route that triggered the loading event is the second parameter. ```javascript App.ApplicationRoute = Ember.Route.extend({ actions: { loading: function(transition, route) { let controller = this.controllerFor('foo'); controller.set('currentlyLoading', true); transition.finally(function() { controller.set('currentlyLoading', false); }); } } }); ``` @event loading @param {Transition} transition @param {Ember.Route} route The route that triggered the loading event @since 1.2.0 @public */ /** When attempting to transition into a route, any of the hooks may return a promise that rejects, at which point an `error` action will be fired on the partially-entered routes, allowing for per-route error handling logic, or shared error handling logic defined on a parent route. Here is an example of an error handler that will be invoked for rejected promises from the various hooks on the route, as well as any unhandled errors from child routes: ```javascript App.AdminRoute = Ember.Route.extend({ beforeModel: function() { return Ember.RSVP.reject('bad things!'); }, actions: { error: function(error, transition) { // Assuming we got here due to the error in `beforeModel`, // we can expect that error === "bad things!", // but a promise model rejecting would also // call this hook, as would any errors encountered // in `afterModel`. // The `error` hook is also provided the failed // `transition`, which can be stored and later // `.retry()`d if desired. this.transitionTo('login'); } } }); ``` `error` actions that bubble up all the way to `ApplicationRoute` will fire a default error handler that logs the error. You can specify your own global default error handler by overriding the `error` handler on `ApplicationRoute`: ```javascript App.ApplicationRoute = Ember.Route.extend({ actions: { error: function(error, transition) { this.controllerFor('banner').displayError(error.message); } } }); ``` @event error @param {Error} error @param {Transition} transition @public */ /** This event is triggered when the router enters the route. It is not executed when the model for the route changes. ```javascript App.ApplicationRoute = Ember.Route.extend({ collectAnalytics: function(){ collectAnalytics(); }.on('activate') }); ``` @event activate @since 1.9.0 @public */ /** This event is triggered when the router completely exits this route. It is not executed when the model for the route changes. ```javascript App.IndexRoute = Ember.Route.extend({ trackPageLeaveAnalytics: function(){ trackPageLeaveAnalytics(); }.on('deactivate') }); ``` @event deactivate @since 1.9.0 @public */ /** The controller associated with this route. Example ```javascript App.FormRoute = Ember.Route.extend({ actions: { willTransition: function(transition) { if (this.controller.get('userHasEnteredData') && !confirm('Are you sure you want to abandon progress?')) { transition.abort(); } else { // Bubble the `willTransition` action so that // parent routes can decide whether or not to abort. return true; } } } }); ``` @property controller @type Ember.Controller @since 1.6.0 @public */ actions: { /** This action is called when one or more query params have changed. Bubbles. @method queryParamsDidChange @param changed {Object} Keys are names of query params that have changed. @param totalPresent {Object} Keys are names of query params that are currently set. @param removed {Object} Keys are names of query params that have been removed. @returns {boolean} @private */ queryParamsDidChange: function (changed, totalPresent, removed) { var qpMap = _emberMetal.get(this, '_qp').map; var totalChanged = Object.keys(changed).concat(Object.keys(removed)); for (var i = 0; i < totalChanged.length; ++i) { var qp = qpMap[totalChanged[i]]; if (qp && _emberMetal.get(this._optionsForQueryParam(qp), 'refreshModel') && this.router.currentState) { this.refresh(); } } return true; }, finalizeQueryParamChange: function (params, finalParams, transition) { if (this.routeName !== 'application') { return true; } // Transition object is absent for intermediate transitions. if (!transition) { return; } var handlerInfos = transition.state.handlerInfos; var router = this.router; var qpMeta = router._queryParamsFor(handlerInfos[handlerInfos.length - 1].name); var changes = router._qpUpdates; var replaceUrl = undefined; _emberRoutingUtils.stashParamNames(router, handlerInfos); for (var i = 0; i < qpMeta.qps.length; ++i) { var qp = qpMeta.qps[i]; var route = qp.route; var controller = route.controller; var presentKey = qp.urlKey in params && qp.urlKey; // Do a reverse lookup to see if the changed query // param URL key corresponds to a QP property on // this controller. var value = undefined, svalue = undefined; if (changes && qp.urlKey in changes) { // Value updated in/before setupController value = _emberMetal.get(controller, qp.prop); svalue = route.serializeQueryParam(value, qp.urlKey, qp.type); } else { if (presentKey) { svalue = params[presentKey]; value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type); } else { // No QP provided; use default value. svalue = qp.serializedDefaultValue; value = copyDefaultValue(qp.defaultValue); } } controller._qpDelegate = _emberMetal.get(route, '_qp.states.inactive'); var thisQueryParamChanged = svalue !== qp.serializedValue; if (thisQueryParamChanged) { if (transition.queryParamsOnly && replaceUrl !== false) { var options = route._optionsForQueryParam(qp); var replaceConfigValue = _emberMetal.get(options, 'replace'); if (replaceConfigValue) { replaceUrl = true; } else if (replaceConfigValue === false) { // Explicit pushState wins over any other replaceStates. replaceUrl = false; } } _emberMetal.set(controller, qp.prop, value); } // Stash current serialized value of controller. qp.serializedValue = svalue; var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue; if (!thisQueryParamHasDefaultValue) { finalParams.push({ value: svalue, visible: true, key: presentKey || qp.urlKey }); } } if (replaceUrl) { transition.method('replace'); } qpMeta.qps.forEach(function (qp) { var routeQpMeta = _emberMetal.get(qp.route, '_qp'); var finalizedController = qp.route.controller; finalizedController._qpDelegate = _emberMetal.get(routeQpMeta, 'states.active'); }); router._qpUpdates = null; } }, /** This hook is executed when the router completely exits this route. It is not executed when the model for the route changes. @method deactivate @public */ deactivate: K, /** This hook is executed when the router enters the route. It is not executed when the model for the route changes. @method activate @public */ activate: K, /** Transition the application into another route. The route may be either a single route or route path: ```javascript this.transitionTo('blogPosts'); this.transitionTo('blogPosts.recentEntries'); ``` Optionally supply a model for the route in question. The model will be serialized into the URL using the `serialize` hook of the route: ```javascript this.transitionTo('blogPost', aPost); ``` If a literal is passed (such as a number or a string), it will be treated as an identifier instead. In this case, the `model` hook of the route will be triggered: ```javascript this.transitionTo('blogPost', 1); ``` Multiple models will be applied last to first recursively up the route tree. ```javascript App.Router.map(function() { this.route('blogPost', { path:':blogPostId' }, function() { this.route('blogComment', { path: ':blogCommentId', resetNamespace: true }); }); }); this.transitionTo('blogComment', aPost, aComment); this.transitionTo('blogComment', 1, 13); ``` It is also possible to pass a URL (a string that starts with a `/`). This is intended for testing and debugging purposes and should rarely be used in production code. ```javascript this.transitionTo('/'); this.transitionTo('/blog/post/1/comment/13'); this.transitionTo('/blog/posts?sort=title'); ``` An options hash with a `queryParams` property may be provided as the final argument to add query parameters to the destination URL. ```javascript this.transitionTo('blogPost', 1, { queryParams: { showComments: 'true' } }); // if you just want to transition the query parameters without changing the route this.transitionTo({ queryParams: { sort: 'date' } }); ``` See also [replaceWith](#method_replaceWith). Simple Transition Example ```javascript App.Router.map(function() { this.route('index'); this.route('secret'); this.route('fourOhFour', { path: '*:' }); }); App.IndexRoute = Ember.Route.extend({ actions: { moveToSecret: function(context) { if (authorized()) { this.transitionTo('secret', context); } else { this.transitionTo('fourOhFour'); } } } }); ``` Transition to a nested route ```javascript App.Router.map(function() { this.route('articles', { path: '/articles' }, function() { this.route('new'); }); }); App.IndexRoute = Ember.Route.extend({ actions: { transitionToNewArticle: function() { this.transitionTo('articles.new'); } } }); ``` Multiple Models Example ```javascript App.Router.map(function() { this.route('index'); this.route('breakfast', { path: ':breakfastId' }, function() { this.route('cereal', { path: ':cerealId', resetNamespace: true }); }); }); App.IndexRoute = Ember.Route.extend({ actions: { moveToChocolateCereal: function() { let cereal = { cerealId: 'ChocolateYumminess' }; let breakfast = { breakfastId: 'CerealAndMilk' }; this.transitionTo('cereal', breakfast, cereal); } } }); ``` Nested Route with Query String Example ```javascript App.Router.map(function() { this.route('fruits', function() { this.route('apples'); }); }); App.IndexRoute = Ember.Route.extend({ actions: { transitionToApples: function() { this.transitionTo('fruits.apples', { queryParams: { color: 'red' } }); } } }); ``` @method transitionTo @param {String} name the name of the route or a URL @param {...Object} models the model(s) or identifier(s) to be used while transitioning to the route. @param {Object} [options] optional hash with a queryParams property containing a mapping of query parameters @return {Transition} the transition object associated with this attempted transition @public */ transitionTo: function (name, context) { var router = this.router; return router.transitionTo.apply(router, prefixRouteNameArg(this, arguments)); }, /** Perform a synchronous transition into another route without attempting to resolve promises, update the URL, or abort any currently active asynchronous transitions (i.e. regular transitions caused by `transitionTo` or URL changes). This method is handy for performing intermediate transitions on the way to a final destination route, and is called internally by the default implementations of the `error` and `loading` handlers. @method intermediateTransitionTo @param {String} name the name of the route @param {...Object} models the model(s) to be used while transitioning to the route. @since 1.2.0 @public */ intermediateTransitionTo: function () { var router = this.router; router.intermediateTransitionTo.apply(router, arguments); }, /** Refresh the model on this route and any child routes, firing the `beforeModel`, `model`, and `afterModel` hooks in a similar fashion to how routes are entered when transitioning in from other route. The current route params (e.g. `article_id`) will be passed in to the respective model hooks, and if a different model is returned, `setupController` and associated route hooks will re-fire as well. An example usage of this method is re-querying the server for the latest information using the same parameters as when the route was first entered. Note that this will cause `model` hooks to fire even on routes that were provided a model object when the route was initially entered. @method refresh @return {Transition} the transition object associated with this attempted transition @since 1.4.0 @public */ refresh: function () { return this.router.router.refresh(this); }, /** Transition into another route while replacing the current URL, if possible. This will replace the current history entry instead of adding a new one. Beside that, it is identical to `transitionTo` in all other respects. See 'transitionTo' for additional information regarding multiple models. Example ```javascript App.Router.map(function() { this.route('index'); this.route('secret'); }); App.SecretRoute = Ember.Route.extend({ afterModel: function() { if (!authorized()){ this.replaceWith('index'); } } }); ``` @method replaceWith @param {String} name the name of the route or a URL @param {...Object} models the model(s) or identifier(s) to be used while transitioning to the route. @return {Transition} the transition object associated with this attempted transition @public */ replaceWith: function () { var router = this.router; return router.replaceWith.apply(router, prefixRouteNameArg(this, arguments)); }, /** Sends an action to the router, which will delegate it to the currently active route hierarchy per the bubbling rules explained under `actions`. Example ```javascript App.Router.map(function() { this.route('index'); }); App.ApplicationRoute = Ember.Route.extend({ actions: { track: function(arg) { console.log(arg, 'was clicked'); } } }); App.IndexRoute = Ember.Route.extend({ actions: { trackIfDebug: function(arg) { if (debug) { this.send('track', arg); } } } }); ``` @method send @param {String} name the name of the action to trigger @param {...*} args @public */ send: function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (this.router && this.router.router || !_emberMetal.isTesting()) { var _router; (_router = this.router).send.apply(_router, args); } else { var _name2 = args[0]; args = slice.call(args, 1); var action = this.actions[_name2]; if (action) { return this.actions[_name2].apply(this, args); } } }, /** This hook is the entry point for router.js @private @method setup */ setup: function (context, transition) { var _this2 = this; var controller = undefined; var controllerName = this.controllerName || this.routeName; var definedController = this.controllerFor(controllerName, true); if (!definedController) { controller = this.generateController(controllerName, context); } else { controller = definedController; } // Assign the route's controller so that it can more easily be // referenced in action handlers. Side effects. Side effects everywhere. if (!this.controller) { var propNames = _emberMetal.get(this, '_qp.propertyNames'); addQueryParamsObservers(controller, propNames); this.controller = controller; } var queryParams = _emberMetal.get(this, '_qp'); var states = queryParams.states; if (transition) { (function () { // Update the model dep values used to calculate cache keys. _emberRoutingUtils.stashParamNames(_this2.router, transition.state.handlerInfos); var params = transition.params; var allParams = queryParams.propertyNames; var cache = _this2._bucketCache; allParams.forEach(function (prop) { var aQp = queryParams.map[prop]; aQp.values = params; var cacheKey = _emberRoutingUtils.calculateCacheKey(aQp.prefix, aQp.parts, aQp.values); if (cache) { var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue); _emberMetal.set(controller, prop, value); } }); })(); } controller._qpDelegate = states.allowOverrides; if (transition) { var qpValues = getQueryParamsFor(this, transition.state); controller.setProperties(qpValues); } this.setupController(controller, context, transition); if (this._environment.options.shouldRender) { this.renderTemplate(controller, context); } }, /* Called when a query parameter for this route changes, regardless of whether the route is currently part of the active route hierarchy. This will update the query parameter's value in the cache so if this route becomes active, the cache value has been updated. */ _qpChanged: function (prop, value, qp) { if (!qp) { return; } var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.prefix || '', qp.parts, qp.values); // Update model-dep cache var cache = this._bucketCache; if (cache) { cache.stash(cacheKey, prop, value); } }, /** This hook is the first of the route entry validation hooks called when an attempt is made to transition into a route or one of its children. It is called before `model` and `afterModel`, and is appropriate for cases when: 1) A decision can be made to redirect elsewhere without needing to resolve the model first. 2) Any async operations need to occur first before the model is attempted to be resolved. This hook is provided the current `transition` attempt as a parameter, which can be used to `.abort()` the transition, save it for a later `.retry()`, or retrieve values set on it from a previous hook. You can also just call `this.transitionTo` to another route to implicitly abort the `transition`. You can return a promise from this hook to pause the transition until the promise resolves (or rejects). This could be useful, for instance, for retrieving async code from the server that is required to enter a route. ```javascript App.PostRoute = Ember.Route.extend({ beforeModel: function(transition) { if (!App.Post) { return Ember.$.getScript('/models/post.js'); } } }); ``` If `App.Post` doesn't exist in the above example, `beforeModel` will use jQuery's `getScript`, which returns a promise that resolves after the server has successfully retrieved and executed the code from the server. Note that if an error were to occur, it would be passed to the `error` hook on `Ember.Route`, but it's also possible to handle errors specific to `beforeModel` right from within the hook (to distinguish from the shared error handling behavior of the `error` hook): ```javascript App.PostRoute = Ember.Route.extend({ beforeModel: function(transition) { if (!App.Post) { let self = this; return Ember.$.getScript('post.js').then(null, function(e) { self.transitionTo('help'); // Note that the above transitionTo will implicitly // halt the transition. If you were to return // nothing from this promise reject handler, // according to promise semantics, that would // convert the reject into a resolve and the // transition would continue. To propagate the // error so that it'd be handled by the `error` // hook, you would have to return Ember.RSVP.reject(e); }); } } }); ``` @method beforeModel @param {Transition} transition @return {Promise} if the value returned from this hook is a promise, the transition will pause until the transition resolves. Otherwise, non-promise return values are not utilized in any way. @public */ beforeModel: K, /** This hook is called after this route's model has resolved. It follows identical async/promise semantics to `beforeModel` but is provided the route's resolved model in addition to the `transition`, and is therefore suited to performing logic that can only take place after the model has already resolved. ```javascript App.PostsRoute = Ember.Route.extend({ afterModel: function(posts, transition) { if (posts.get('length') === 1) { this.transitionTo('post.show', posts.get('firstObject')); } } }); ``` Refer to documentation for `beforeModel` for a description of transition-pausing semantics when a promise is returned from this hook. @method afterModel @param {Object} resolvedModel the value returned from `model`, or its resolved value if it was a promise @param {Transition} transition @return {Promise} if the value returned from this hook is a promise, the transition will pause until the transition resolves. Otherwise, non-promise return values are not utilized in any way. @public */ afterModel: K, /** A hook you can implement to optionally redirect to another route. If you call `this.transitionTo` from inside of this hook, this route will not be entered in favor of the other hook. `redirect` and `afterModel` behave very similarly and are called almost at the same time, but they have an important distinction in the case that, from one of these hooks, a redirect into a child route of this route occurs: redirects from `afterModel` essentially invalidate the current attempt to enter this route, and will result in this route's `beforeModel`, `model`, and `afterModel` hooks being fired again within the new, redirecting transition. Redirects that occur within the `redirect` hook, on the other hand, will _not_ cause these hooks to be fired again the second time around; in other words, by the time the `redirect` hook has been called, both the resolved model and attempted entry into this route are considered to be fully validated. @method redirect @param {Object} model the model for this route @param {Transition} transition the transition object associated with the current transition @public */ redirect: K, /** Called when the context is changed by router.js. @private @method contextDidChange */ contextDidChange: function () { this.currentModel = this.context; }, /** A hook you can implement to convert the URL into the model for this route. ```javascript App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); ``` The model for the `post` route is `store.findRecord('post', params.post_id)`. By default, if your route has a dynamic segment ending in `_id`: * The model class is determined from the segment (`post_id`'s class is `App.Post`) * The find method is called on the model class with the value of the dynamic segment. Note that for routes with dynamic segments, this hook is not always executed. If the route is entered through a transition (e.g. when using the `link-to` Handlebars helper or the `transitionTo` method of routes), and a model context is already provided this hook is not called. A model context does not include a primitive string or number, which does cause the model hook to be called. Routes without dynamic segments will always execute the model hook. ```javascript // no dynamic segment, model hook always called this.transitionTo('posts'); // model passed in, so model hook not called thePost = store.findRecord('post', 1); this.transitionTo('post', thePost); // integer passed in, model hook is called this.transitionTo('post', 1); // model id passed in, model hook is called // useful for forcing the hook to execute thePost = store.findRecord('post', 1); this.transitionTo('post', thePost.id); ``` This hook follows the asynchronous/promise semantics described in the documentation for `beforeModel`. In particular, if a promise returned from `model` fails, the error will be handled by the `error` hook on `Ember.Route`. Example ```javascript App.PostRoute = Ember.Route.extend({ model: function(params) { return this.store.findRecord('post', params.post_id); } }); ``` @method model @param {Object} params the parameters extracted from the URL @param {Transition} transition @return {Object|Promise} the model for this route. If a promise is returned, the transition will pause until the promise resolves, and the resolved value of the promise will be used as the model for this route. @public */ model: function (params, transition) { var match = undefined, name = undefined, sawParams = undefined, value = undefined; var queryParams = _emberMetal.get(this, '_qp.map'); for (var prop in params) { if (prop === 'queryParams' || queryParams && prop in queryParams) { continue; } if (match = prop.match(/^(.*)_id$/)) { name = match[1]; value = params[prop]; } sawParams = true; } if (!name && sawParams) { return _emberRuntime.copy(params); } else if (!name) { if (transition.resolveIndex < 1) { return; } var parentModel = transition.state.handlerInfos[transition.resolveIndex - 1].context; return parentModel; } return this.findModel(name, value); }, /** @private @method deserialize @param {Object} params the parameters extracted from the URL @param {Transition} transition @return {Object|Promise} the model for this route. Router.js hook. */ deserialize: function (params, transition) { return this.model(this.paramsFor(this.routeName), transition); }, /** @method findModel @param {String} type the model type @param {Object} value the value passed to find @private */ findModel: function () { var store = _emberMetal.get(this, 'store'); return store.find.apply(store, arguments); }, /** Store property provides a hook for data persistence libraries to inject themselves. By default, this store property provides the exact same functionality previously in the model hook. Currently, the required interface is: `store.find(modelName, findArguments)` @method store @param {Object} store @private */ store: _emberMetal.computed(function () { var owner = _container.getOwner(this); var routeName = this.routeName; var namespace = _emberMetal.get(this, 'router.namespace'); return { find: function (name, value) { var modelClass = owner._lookupFactory('model:' + name); if (!modelClass) { return; } return modelClass.find(value); } }; }), /** A hook you can implement to convert the route's model into parameters for the URL. ```javascript App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); App.PostRoute = Ember.Route.extend({ model: function(params) { // the server returns `{ id: 12 }` return Ember.$.getJSON('/posts/' + params.post_id); }, serialize: function(model) { // this will make the URL `/posts/12` return { post_id: model.id }; } }); ``` The default `serialize` method will insert the model's `id` into the route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. If the route has multiple dynamic segments or does not contain '_id', `serialize` will return `Ember.getProperties(model, params)` This method is called when `transitionTo` is called with a context in order to populate the URL. @method serialize @param {Object} model the routes model @param {Array} params an Array of parameter names for the current route (in the example, `['post_id']`. @return {Object} the serialized parameters @public */ serialize: defaultSerialize, /** A hook you can use to setup the controller for the current route. This method is called with the controller for the current route and the model supplied by the `model` hook. By default, the `setupController` hook sets the `model` property of the controller to the `model`. If you implement the `setupController` hook in your Route, it will prevent this default behavior. If you want to preserve that behavior when implementing your `setupController` function, make sure to call `_super`: ```javascript App.PhotosRoute = Ember.Route.extend({ model: function() { return this.store.findAll('photo'); }, setupController: function(controller, model) { // Call _super for default behavior this._super(controller, model); // Implement your custom setup after this.controllerFor('application').set('showingPhotos', true); } }); ``` The provided controller will be one resolved based on the name of this route. If no explicit controller is defined, Ember will automatically create one. As an example, consider the router: ```javascript App.Router.map(function() { this.route('post', { path: '/posts/:post_id' }); }); ``` For the `post` route, a controller named `App.PostController` would be used if it is defined. If it is not defined, a basic `Ember.Controller` instance would be used. Example ```javascript App.PostRoute = Ember.Route.extend({ setupController: function(controller, model) { controller.set('model', model); } }); ``` @method setupController @param {Controller} controller instance @param {Object} model @public */ setupController: function (controller, context, transition) { if (controller && context !== undefined) { _emberMetal.set(controller, 'model', context); } }, /** Returns the controller for a particular route or name. The controller instance must already have been created, either through entering the associated route or using `generateController`. ```javascript App.PostRoute = Ember.Route.extend({ setupController: function(controller, post) { this._super(controller, post); this.controllerFor('posts').set('currentPost', post); } }); ``` @method controllerFor @param {String} name the name of the route or controller @return {Ember.Controller} @public */ controllerFor: function (name, _skipAssert) { var owner = _container.getOwner(this); var route = owner.lookup('route:' + name); var controller = undefined; if (route && route.controllerName) { name = route.controllerName; } controller = owner.lookup('controller:' + name); // NOTE: We're specifically checking that skipAssert is true, because according // to the old API the second parameter was model. We do not want people who // passed a model to skip the assertion. return controller; }, /** Generates a controller for a route. Example ```javascript App.PostRoute = Ember.Route.extend({ setupController: function(controller, post) { this._super(controller, post); this.generateController('posts', post); } }); ``` @method generateController @param {String} name the name of the controller @param {Object} model the model to infer the type of the controller (optional) @private */ generateController: function (name, model) { var owner = _container.getOwner(this); model = model || this.modelFor(name); return _emberRoutingSystemGenerate_controller.default(owner, name, model); }, /** Returns the resolved model of a parent (or any ancestor) route in a route hierarchy. During a transition, all routes must resolve a model object, and if a route needs access to a parent route's model in order to resolve a model (or just reuse the model from a parent), it can call `this.modelFor(theNameOfParentRoute)` to retrieve it. If the ancestor route's model was a promise, its resolved result is returned. Example ```javascript App.Router.map(function() { this.route('post', { path: '/post/:post_id' }, function() { this.route('comments', { resetNamespace: true }); }); }); App.CommentsRoute = Ember.Route.extend({ afterModel: function() { this.set('post', this.modelFor('post')); } }); ``` @method modelFor @param {String} name the name of the route @return {Object} the model object @public */ modelFor: function (_name) { var name = undefined; var owner = _container.getOwner(this); // Only change the route name when there is an active transition. // Otherwise, use the passed in route name. if (owner.routable && this.router && this.router.router.activeTransition) { name = getEngineRouteName(owner, _name); } else { name = _name; } var route = _container.getOwner(this).lookup('route:' + name); var transition = this.router ? this.router.router.activeTransition : null; // If we are mid-transition, we want to try and look up // resolved parent contexts on the current transitionEvent. if (transition) { var modelLookupName = route && route.routeName || name; if (transition.resolvedModels.hasOwnProperty(modelLookupName)) { return transition.resolvedModels[modelLookupName]; } } return route && route.currentModel; }, /** A hook you can use to render the template for the current route. This method is called with the controller for the current route and the model supplied by the `model` hook. By default, it renders the route's template, configured with the controller for the route. This method can be overridden to set up and render additional or alternative templates. ```javascript App.PostsRoute = Ember.Route.extend({ renderTemplate: function(controller, model) { let favController = this.controllerFor('favoritePost'); // Render the `favoritePost` template into // the outlet `posts`, and display the `favoritePost` // controller. this.render('favoritePost', { outlet: 'posts', controller: favController }); } }); ``` @method renderTemplate @param {Object} controller the route's controller @param {Object} model the route's model @public */ renderTemplate: function (controller, model) { this.render(); }, /** `render` is used to render a template into a region of another template (indicated by an `{{outlet}}`). `render` is used both during the entry phase of routing (via the `renderTemplate` hook) and later in response to user interaction. For example, given the following minimal router and templates: ```javascript Router.map(function() { this.route('photos'); }); ``` ```handlebars
    {{outlet "anOutletName"}}
    ``` ```handlebars

    Photos

    ``` You can render `photos.hbs` into the `"anOutletName"` outlet of `application.hbs` by calling `render`: ```javascript // posts route Ember.Route.extend({ renderTemplate: function() { this.render('photos', { into: 'application', outlet: 'anOutletName' }) } }); ``` `render` additionally allows you to supply which `controller` and `model` objects should be loaded and associated with the rendered template. ```javascript // posts route Ember.Route.extend({ renderTemplate: function(controller, model){ this.render('posts', { // the template to render, referenced by name into: 'application', // the template to render into, referenced by name outlet: 'anOutletName', // the outlet inside `options.template` to render into. controller: 'someControllerName', // the controller to use for this template, referenced by name model: model // the model to set on `options.controller`. }) } }); ``` The string values provided for the template name, and controller will eventually pass through to the resolver for lookup. See Ember.Resolver for how these are mapped to JavaScript objects in your application. The template to render into needs to be related to either the current route or one of its ancestors. Not all options need to be passed to `render`. Default values will be used based on the name of the route specified in the router or the Route's `controllerName` and `templateName` properties. For example: ```javascript // router Router.map(function() { this.route('index'); this.route('post', { path: '/posts/:post_id' }); }); ``` ```javascript // post route PostRoute = App.Route.extend({ renderTemplate: function() { this.render(); // all defaults apply } }); ``` The name of the `PostRoute`, defined by the router, is `post`. The following equivalent default options will be applied when the Route calls `render`: ```javascript // this.render('post', { // the template name associated with 'post' Route into: 'application', // the parent route to 'post' Route outlet: 'main', // {{outlet}} and {{outlet 'main'}} are synonymous, controller: 'post', // the controller associated with the 'post' Route }) ``` By default the controller's `model` will be the route's model, so it does not need to be passed unless you wish to change which model is being used. @method render @param {String} name the name of the template to render @param {Object} [options] the options @param {String} [options.into] the template to render into, referenced by name. Defaults to the parent template @param {String} [options.outlet] the outlet inside `options.template` to render into. Defaults to 'main' @param {String|Object} [options.controller] the controller to use for this template, referenced by name or as a controller instance. Defaults to the Route's paired controller @param {Object} [options.model] the model object to set on `options.controller`. Defaults to the return value of the Route's model hook @public */ render: function (_name, options) { var namePassed = typeof _name === 'string' && !!_name; var isDefaultRender = arguments.length === 0 || _emberMetal.isEmpty(arguments[0]); var name = undefined; if (typeof _name === 'object' && !options) { name = this.templateName || this.routeName; options = _name; } else { name = _name; } var renderOptions = buildRenderOptions(this, namePassed, isDefaultRender, name, options); this.connections.push(renderOptions); _emberMetal.run.once(this.router, '_setOutlets'); }, /** Disconnects a view that has been rendered into an outlet. You may pass any or all of the following options to `disconnectOutlet`: * `outlet`: the name of the outlet to clear (default: 'main') * `parentView`: the name of the view containing the outlet to clear (default: the view rendered by the parent route) Example: ```javascript App.ApplicationRoute = App.Route.extend({ actions: { showModal: function(evt) { this.render(evt.modalName, { outlet: 'modal', into: 'application' }); }, hideModal: function(evt) { this.disconnectOutlet({ outlet: 'modal', parentView: 'application' }); } } }); ``` Alternatively, you can pass the `outlet` name directly as a string. Example: ```javascript hideModal: function(evt) { this.disconnectOutlet('modal'); } ``` @method disconnectOutlet @param {Object|String} options the options hash or outlet name @public */ disconnectOutlet: function (options) { var outletName = undefined; var parentView = undefined; if (!options || typeof options === 'string') { outletName = options; } else { outletName = options.outlet; parentView = options.parentView; if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { throw new _emberMetal.Error('You passed undefined as the outlet name.'); } } parentView = parentView && parentView.replace(/\//g, '.'); outletName = outletName || 'main'; this._disconnectOutlet(outletName, parentView); for (var i = 0; i < this.router.router.currentHandlerInfos.length; i++) { // This non-local state munging is sadly necessary to maintain // backward compatibility with our existing semantics, which allow // any route to disconnectOutlet things originally rendered by any // other route. This should all get cut in 2.0. this.router.router.currentHandlerInfos[i].handler._disconnectOutlet(outletName, parentView); } }, _disconnectOutlet: function (outletName, parentView) { var parent = parentRoute(this); if (parent && parentView === parent.routeName) { parentView = undefined; } for (var i = 0; i < this.connections.length; i++) { var connection = this.connections[i]; if (connection.outlet === outletName && connection.into === parentView) { // This neuters the disconnected outlet such that it doesn't // render anything, but it leaves an entry in the outlet // hierarchy so that any existing other renders that target it // don't suddenly blow up. They will still stick themselves // into its outlets, which won't render anywhere. All of this // statefulness should get the machete in 2.0. this.connections[i] = { owner: connection.owner, into: connection.into, outlet: connection.outlet, name: connection.name, controller: undefined, template: undefined, ViewClass: undefined }; _emberMetal.run.once(this.router, '_setOutlets'); } } }, willDestroy: function () { this.teardownViews(); }, /** @private @method teardownViews */ teardownViews: function () { if (this.connections && this.connections.length > 0) { this.connections = []; _emberMetal.run.once(this.router, '_setOutlets'); } } }); _emberRuntime.deprecateUnderscoreActions(Route); Route.reopenClass({ isRouteFactory: true }); function parentRoute(route) { var handlerInfo = handlerInfoFor(route, route.router.router.state.handlerInfos, -1); return handlerInfo && handlerInfo.handler; } function handlerInfoFor(route, handlerInfos, _offset) { if (!handlerInfos) { return; } var offset = _offset || 0; var current = undefined; for (var i = 0; i < handlerInfos.length; i++) { current = handlerInfos[i].handler; if (current === route) { return handlerInfos[i + offset]; } } } function buildRenderOptions(route, namePassed, isDefaultRender, _name, options) { var into = options && options.into && options.into.replace(/\//g, '.'); var outlet = options && options.outlet || 'main'; var name = undefined, templateName = undefined; if (_name) { name = _name.replace(/\//g, '.'); templateName = name; } else { name = route.routeName; templateName = route.templateName || name; } var owner = _container.getOwner(route); var controller = options && options.controller; if (!controller) { if (namePassed) { controller = owner.lookup('controller:' + name) || route.controllerName || route.routeName; } else { controller = route.controllerName || owner.lookup('controller:' + name); } } if (typeof controller === 'string') { var controllerName = controller; controller = owner.lookup('controller:' + controllerName); if (!controller) { throw new _emberMetal.Error('You passed `controller: \'' + controllerName + '\'` into the `render` method, but no such controller could be found.'); } } if (options && Object.keys(options).indexOf('outlet') !== -1 && typeof options.outlet === 'undefined') { throw new _emberMetal.Error('You passed undefined as the outlet name.'); } if (options && options.model) { controller.set('model', options.model); } var template = owner.lookup('template:' + templateName); var parent = undefined; if (into && (parent = parentRoute(route)) && into === parentRoute(route).routeName) { into = undefined; } var renderOptions = { owner: owner, into: into, outlet: outlet, name: name, controller: controller, template: template || route._topLevelViewTemplate, ViewClass: undefined }; var LOG_VIEW_LOOKUPS = _emberMetal.get(route.router, 'namespace.LOG_VIEW_LOOKUPS'); if (LOG_VIEW_LOOKUPS && !template) {} return renderOptions; } function getFullQueryParams(router, state) { if (state.fullQueryParams) { return state.fullQueryParams; } state.fullQueryParams = {}; _emberMetal.assign(state.fullQueryParams, state.queryParams); var targetRouteName = state.handlerInfos[state.handlerInfos.length - 1].name; router._deserializeQueryParams(targetRouteName, state.fullQueryParams); return state.fullQueryParams; } function getQueryParamsFor(route, state) { state.queryParamsFor = state.queryParamsFor || {}; var name = route.routeName; name = getEngineRouteName(_container.getOwner(route), name); if (state.queryParamsFor[name]) { return state.queryParamsFor[name]; } var fullQueryParams = getFullQueryParams(route.router, state); var params = state.queryParamsFor[name] = {}; // Copy over all the query params for this route/controller into params hash. var qpMeta = _emberMetal.get(route, '_qp'); var qps = qpMeta.qps; for (var i = 0; i < qps.length; ++i) { // Put deserialized qp on params hash. var qp = qps[i]; var qpValueWasPassedIn = (qp.prop in fullQueryParams); params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue); } return params; } function copyDefaultValue(value) { if (Array.isArray(value)) { return _emberRuntime.A(value.slice()); } return value; } /* Merges all query parameters from a controller with those from a route, returning a new object and avoiding any mutations to the existing objects. */ function mergeEachQueryParams(controllerQP, routeQP) { var keysAlreadyMergedOrSkippable = undefined; var qps = {}; if (_emberMetal.isFeatureEnabled('ember-routing-route-configured-query-params')) { keysAlreadyMergedOrSkippable = {}; } else { keysAlreadyMergedOrSkippable = { defaultValue: true, type: true, scope: true, as: true }; } // first loop over all controller qps, merging them with any matching route qps // into a new empty object to avoid mutating. for (var cqpName in controllerQP) { if (!controllerQP.hasOwnProperty(cqpName)) { continue; } var newControllerParameterConfiguration = {}; _emberMetal.assign(newControllerParameterConfiguration, controllerQP[cqpName]); _emberMetal.assign(newControllerParameterConfiguration, routeQP[cqpName]); qps[cqpName] = newControllerParameterConfiguration; // allows us to skip this QP when we check route QPs. keysAlreadyMergedOrSkippable[cqpName] = true; } // loop over all route qps, skipping those that were merged in the first pass // because they also appear in controller qps for (var rqpName in routeQP) { if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) { continue; } var newRouteParameterConfiguration = {}; _emberMetal.assign(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]); qps[rqpName] = newRouteParameterConfiguration; } return qps; } function addQueryParamsObservers(controller, propNames) { propNames.forEach(function (prop) { controller.addObserver(prop + '.[]', controller, controller._qpChanged); }); } function deprecateQueryParamDefaultValuesSetOnController(controllerName, routeName, propName) {} /* Returns an arguments array where the route name arg is prefixed based on the mount point @private */ function prefixRouteNameArg(route, args) { var routeName = args[0]; var owner = _container.getOwner(route); var prefix = owner.mountPoint; // only alter the routeName if it's actually referencing a route. if (owner.routable && typeof routeName === 'string') { if (resemblesURL(routeName)) { throw new _emberMetal.Error('Route#transitionTo cannot be used for URLs. Please use the route name instead.'); } else { routeName = prefix + '.' + routeName; args[0] = routeName; } } return args; } /* Check if a routeName resembles a url instead @private */ function resemblesURL(str) { return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); } function getEngineRouteName(engine, routeName) { if (engine.routable) { var prefix = engine.mountPoint; if (routeName === 'application') { return prefix; } else { return prefix + '.' + routeName; } } return routeName; } exports.default = Route; }); enifed('ember-routing/system/router', ['exports', 'ember-console', 'ember-metal', 'ember-runtime', 'ember-routing/system/route', 'ember-routing/system/dsl', 'ember-routing/location/api', 'ember-routing/utils', 'ember-routing/system/router_state', 'container', 'router'], function (exports, _emberConsole, _emberMetal, _emberRuntime, _emberRoutingSystemRoute, _emberRoutingSystemDsl, _emberRoutingLocationApi, _emberRoutingUtils, _emberRoutingSystemRouter_state, _container, _router4) { 'use strict'; exports.triggerEvent = triggerEvent; function K() { return this; } var slice = Array.prototype.slice; /** The `Ember.Router` class manages the application state and URLs. Refer to the [routing guide](http://emberjs.com/guides/routing/) for documentation. @class Router @namespace Ember @extends Ember.Object @uses Ember.Evented @public */ var EmberRouter = _emberRuntime.Object.extend(_emberRuntime.Evented, { /** The `location` property determines the type of URL's that your application will use. The following location types are currently available: * `history` - use the browser's history API to make the URLs look just like any standard URL * `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new` * `none` - do not store the Ember URL in the actual browser URL (mainly used for testing) * `auto` - use the best option based on browser capabilites: `history` if possible, then `hash` if possible, otherwise `none` Note: If using ember-cli, this value is defaulted to `auto` by the `locationType` setting of `/config/environment.js` @property location @default 'hash' @see {Ember.Location} @public */ location: 'hash', /** Represents the URL of the root of the application, often '/'. This prefix is assumed on all routes defined on this router. @property rootURL @default '/' @public */ rootURL: '/', _initRouterJs: function () { var router = this.router = new _router4.default(); router.triggerEvent = triggerEvent; router._triggerWillChangeContext = K; router._triggerWillLeave = K; var dslCallbacks = this.constructor.dslCallbacks || [K]; var dsl = this._buildDSL(); dsl.route('application', { path: '/', resetNamespace: true, overrideNameAssertion: true }, function () { for (var i = 0; i < dslCallbacks.length; i++) { dslCallbacks[i].call(this); } }); if (_emberMetal.get(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) { router.log = _emberConsole.default.debug; } router.map(dsl.generate()); }, _buildDSL: function () { var moduleBasedResolver = this._hasModuleBasedResolver(); var options = { enableLoadingSubstates: !!moduleBasedResolver }; var owner = _container.getOwner(this); var router = this; options.enableLoadingSubstates = !!moduleBasedResolver; options.resolveRouteMap = function (name) { return owner._lookupFactory('route-map:' + name); }; options.addRouteForEngine = function (name, engineInfo) { if (!router._engineInfoByRoute[name]) { router._engineInfoByRoute[name] = engineInfo; } }; return new _emberRoutingSystemDsl.default(null, options); }, init: function () { this._super.apply(this, arguments); this._qpCache = new _emberMetal.EmptyObject(); this._resetQueuedQueryParameterChanges(); this._handledErrors = _emberMetal.dictionary(null); this._engineInstances = new _emberMetal.EmptyObject(); this._engineInfoByRoute = new _emberMetal.EmptyObject(); // avoid shaping issues with checks during `_setOutlets` this.isDestroyed = false; this.isDestroying = false; }, /* Resets all pending query paramter changes. Called after transitioning to a new route based on query parameter changes. */ _resetQueuedQueryParameterChanges: function () { this._queuedQPChanges = {}; }, /** Represents the current URL. @method url @return {String} The current URL. @private */ url: _emberMetal.computed(function () { return _emberMetal.get(this, 'location').getURL(); }), _hasModuleBasedResolver: function () { var owner = _container.getOwner(this); if (!owner) { return false; } var resolver = owner.application && owner.application.__registry__ && owner.application.__registry__.resolver; if (!resolver) { return false; } return !!resolver.moduleBasedResolver; }, /** Initializes the current router instance and sets up the change handling event listeners used by the instances `location` implementation. A property named `initialURL` will be used to determine the initial URL. If no value is found `/` will be used. @method startRouting @private */ startRouting: function () { var initialURL = _emberMetal.get(this, 'initialURL'); if (this.setupRouter()) { if (typeof initialURL === 'undefined') { initialURL = _emberMetal.get(this, 'location').getURL(); } var initialTransition = this.handleURL(initialURL); if (initialTransition && initialTransition.error) { throw initialTransition.error; } } }, setupRouter: function () { var _this = this; this._initRouterJs(); this._setupLocation(); var router = this.router; var location = _emberMetal.get(this, 'location'); // Allow the Location class to cancel the router setup while it refreshes // the page if (_emberMetal.get(location, 'cancelRouterSetup')) { return false; } this._setupRouter(router, location); location.onUpdateURL(function (url) { _this.handleURL(url); }); return true; }, /** Handles updating the paths and notifying any listeners of the URL change. Triggers the router level `didTransition` hook. For example, to notify google analytics when the route changes, you could use this hook. (Note: requires also including GA scripts, etc.) ```javascript let Router = Ember.Router.extend({ location: config.locationType, didTransition: function() { this._super(...arguments); return ga('send', 'pageview', { 'page': this.get('url'), 'title': this.get('url') }); } }); ``` @method didTransition @public @since 1.2.0 */ didTransition: function (infos) { updatePaths(this); this._cancelSlowTransitionTimer(); this.notifyPropertyChange('url'); this.set('currentState', this.targetState); // Put this in the runloop so url will be accurate. Seems // less surprising than didTransition being out of sync. _emberMetal.run.once(this, this.trigger, 'didTransition'); if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { _emberConsole.default.log('Transitioned into \'' + EmberRouter._routePath(infos) + '\''); } }, _setOutlets: function () { // This is triggered async during Ember.Route#willDestroy. // If the router is also being destroyed we do not want to // to create another this._toplevelView (and leak the renderer) if (this.isDestroying || this.isDestroyed) { return; } var handlerInfos = this.router.currentHandlerInfos; var route = undefined; var defaultParentState = undefined; var liveRoutes = null; if (!handlerInfos) { return; } for (var i = 0; i < handlerInfos.length; i++) { route = handlerInfos[i].handler; var connections = route.connections; var ownState = undefined; for (var j = 0; j < connections.length; j++) { var appended = appendLiveRoute(liveRoutes, defaultParentState, connections[j]); liveRoutes = appended.liveRoutes; if (appended.ownState.render.name === route.routeName || appended.ownState.render.outlet === 'main') { ownState = appended.ownState; } } if (connections.length === 0) { ownState = representEmptyRoute(liveRoutes, defaultParentState, route); } defaultParentState = ownState; } if (!this._toplevelView) { var owner = _container.getOwner(this); var OutletView = owner._lookupFactory('view:-outlet'); this._toplevelView = OutletView.create(); this._toplevelView.setOutletState(liveRoutes); var instance = owner.lookup('-application-instance:main'); instance.didCreateRootView(this._toplevelView); } else { this._toplevelView.setOutletState(liveRoutes); } }, /** Handles notifying any listeners of an impending URL change. Triggers the router level `willTransition` hook. @method willTransition @public @since 1.11.0 */ willTransition: function (oldInfos, newInfos, transition) { _emberMetal.run.once(this, this.trigger, 'willTransition', transition); if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { _emberConsole.default.log('Preparing to transition from \'' + EmberRouter._routePath(oldInfos) + '\' to \'' + EmberRouter._routePath(newInfos) + '\''); } }, handleURL: function (url) { // Until we have an ember-idiomatic way of accessing #hashes, we need to // remove it because router.js doesn't know how to handle it. url = url.split(/#(.+)?/)[0]; return this._doURLTransition('handleURL', url); }, _doURLTransition: function (routerJsMethod, url) { var transition = this.router[routerJsMethod](url || '/'); didBeginTransition(transition, this); return transition; }, /** Transition the application into another route. The route may be either a single route or route path: See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. @method transitionTo @param {String} name the name of the route or a URL @param {...Object} models the model(s) or identifier(s) to be used while transitioning to the route. @param {Object} [options] optional hash with a queryParams property containing a mapping of query parameters @return {Transition} the transition object associated with this attempted transition @public */ transitionTo: function () { var queryParams = undefined; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (resemblesURL(args[0])) { return this._doURLTransition('transitionTo', args[0]); } var possibleQueryParams = args[args.length - 1]; if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) { queryParams = args.pop().queryParams; } else { queryParams = {}; } var targetRouteName = args.shift(); return this._doTransition(targetRouteName, args, queryParams); }, intermediateTransitionTo: function () { var _router; (_router = this.router).intermediateTransitionTo.apply(_router, arguments); updatePaths(this); var infos = this.router.currentHandlerInfos; if (_emberMetal.get(this, 'namespace').LOG_TRANSITIONS) { _emberConsole.default.log('Intermediate-transitioned into \'' + EmberRouter._routePath(infos) + '\''); } }, replaceWith: function () { return this.transitionTo.apply(this, arguments).method('replace'); }, generate: function () { var _router2; var url = (_router2 = this.router).generate.apply(_router2, arguments); return this.location.formatURL(url); }, /** Determines if the supplied route is currently active. @method isActive @param routeName @return {Boolean} @private */ isActive: function (routeName) { var router = this.router; return router.isActive.apply(router, arguments); }, /** An alternative form of `isActive` that doesn't require manual concatenation of the arguments into a single array. @method isActiveIntent @param routeName @param models @param queryParams @return {Boolean} @private @since 1.7.0 */ isActiveIntent: function (routeName, models, queryParams) { return this.currentState.isActiveIntent(routeName, models, queryParams); }, send: function (name, context) { var _router3; (_router3 = this.router).trigger.apply(_router3, arguments); }, /** Does this router instance have the given route. @method hasRoute @return {Boolean} @private */ hasRoute: function (route) { return this.router.hasRoute(route); }, /** Resets the state of the router by clearing the current route handlers and deactivating them. @private @method reset */ reset: function () { if (this.router) { this.router.reset(); } }, willDestroy: function () { var instances = this._engineInstances; for (var _name in instances) { for (var id in instances[_name]) { _emberMetal.run(instances[_name][id], 'destroy'); } } if (this._toplevelView) { this._toplevelView.destroy(); this._toplevelView = null; } this._super.apply(this, arguments); this.reset(); }, /* Called when an active route's query parameter has changed. These changes are batched into a runloop run and trigger a single transition. */ _activeQPChanged: function (queryParameterName, newValue) { this._queuedQPChanges[queryParameterName] = newValue; _emberMetal.run.once(this, this._fireQueryParamTransition); }, _updatingQPChanged: function (queryParameterName) { if (!this._qpUpdates) { this._qpUpdates = {}; } this._qpUpdates[queryParameterName] = true; }, /* Triggers a transition to a route based on query parameter changes. This is called once per runloop, to batch changes. e.g. if these methods are called in succession: this._activeQPChanged('foo', '10'); // results in _queuedQPChanges = { foo: '10' } this._activeQPChanged('bar', false); // results in _queuedQPChanges = { foo: '10', bar: false } _queuedQPChanges will represent both of these changes and the transition using `transitionTo` will be triggered once. */ _fireQueryParamTransition: function () { this.transitionTo({ queryParams: this._queuedQPChanges }); this._resetQueuedQueryParameterChanges(); }, _setupLocation: function () { var location = _emberMetal.get(this, 'location'); var rootURL = _emberMetal.get(this, 'rootURL'); var owner = _container.getOwner(this); if ('string' === typeof location && owner) { var resolvedLocation = owner.lookup('location:' + location); if ('undefined' !== typeof resolvedLocation) { location = _emberMetal.set(this, 'location', resolvedLocation); } else { // Allow for deprecated registration of custom location API's var options = { implementation: location }; location = _emberMetal.set(this, 'location', _emberRoutingLocationApi.default.create(options)); } } if (location !== null && typeof location === 'object') { if (rootURL) { _emberMetal.set(location, 'rootURL', rootURL); } // Allow the location to do any feature detection, such as AutoLocation // detecting history support. This gives it a chance to set its // `cancelRouterSetup` property which aborts routing. if (typeof location.detect === 'function') { location.detect(); } // ensure that initState is called AFTER the rootURL is set on // the location instance if (typeof location.initState === 'function') { location.initState(); } } }, _getHandlerFunction: function () { var _this2 = this; var seen = new _emberMetal.EmptyObject(); var owner = _container.getOwner(this); return function (name) { var routeName = name; var routeOwner = owner; var engineInfo = _this2._engineInfoByRoute[routeName]; if (engineInfo) { var engineInstance = _this2._getEngineInstance(engineInfo); routeOwner = engineInstance; routeName = engineInfo.localFullName; } var fullRouteName = 'route:' + routeName; var handler = routeOwner.lookup(fullRouteName); if (seen[name]) { return handler; } seen[name] = true; if (!handler) { var DefaultRoute = routeOwner._lookupFactory('route:basic'); routeOwner.register(fullRouteName, DefaultRoute.extend()); handler = routeOwner.lookup(fullRouteName); if (_emberMetal.get(_this2, 'namespace.LOG_ACTIVE_GENERATION')) {} } handler.routeName = routeName; if (engineInfo && !_emberRoutingSystemRoute.hasDefaultSerialize(handler)) { throw new Error('Defining a custom serialize method on an Engine route is not supported.'); } return handler; }; }, _getSerializerFunction: function () { var _this3 = this; return function (name) { var engineInfo = _this3._engineInfoByRoute[name]; // If this is not an Engine route, we fall back to the handler for serialization if (!engineInfo) { return; } return engineInfo.serializeMethod || _emberRoutingSystemRoute.defaultSerialize; }; }, _setupRouter: function (router, location) { var lastURL = undefined; var emberRouter = this; router.getHandler = this._getHandlerFunction(); router.getSerializer = this._getSerializerFunction(); var doUpdateURL = function () { location.setURL(lastURL); }; router.updateURL = function (path) { lastURL = path; _emberMetal.run.once(doUpdateURL); }; if (location.replaceURL) { (function () { var doReplaceURL = function () { location.replaceURL(lastURL); }; router.replaceURL = function (path) { lastURL = path; _emberMetal.run.once(doReplaceURL); }; })(); } router.didTransition = function (infos) { emberRouter.didTransition(infos); }; router.willTransition = function (oldInfos, newInfos, transition) { emberRouter.willTransition(oldInfos, newInfos, transition); }; }, _serializeQueryParams: function (targetRouteName, queryParams) { var groupedByUrlKey = {}; forEachQueryParam(this, targetRouteName, queryParams, function (key, value, qp) { var urlKey = qp.urlKey; if (!groupedByUrlKey[urlKey]) { groupedByUrlKey[urlKey] = []; } groupedByUrlKey[urlKey].push({ qp: qp, value: value }); delete queryParams[key]; }); for (var key in groupedByUrlKey) { var qps = groupedByUrlKey[key]; var qp = qps[0].qp; queryParams[qp.urlKey] = qp.route.serializeQueryParam(qps[0].value, qp.urlKey, qp.type); } }, _deserializeQueryParams: function (targetRouteName, queryParams) { forEachQueryParam(this, targetRouteName, queryParams, function (key, value, qp) { delete queryParams[key]; queryParams[qp.prop] = qp.route.deserializeQueryParam(value, qp.urlKey, qp.type); }); }, _pruneDefaultQueryParamValues: function (targetRouteName, queryParams) { var qps = this._queryParamsFor(targetRouteName); for (var key in queryParams) { var qp = qps.map[key]; if (qp && qp.serializedDefaultValue === queryParams[key]) { delete queryParams[key]; } } }, _doTransition: function (_targetRouteName, models, _queryParams) { var targetRouteName = _targetRouteName || _emberRoutingUtils.getActiveTargetName(this.router); var queryParams = {}; this._processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams); _emberMetal.assign(queryParams, _queryParams); this._prepareQueryParams(targetRouteName, models, queryParams); var transitionArgs = _emberRoutingUtils.routeArgs(targetRouteName, models, queryParams); var transition = this.router.transitionTo.apply(this.router, transitionArgs); didBeginTransition(transition, this); return transition; }, _processActiveTransitionQueryParams: function (targetRouteName, models, queryParams, _queryParams) { // merge in any queryParams from the active transition which could include // queryParams from the url on initial load. if (!this.router.activeTransition) { return; } var unchangedQPs = {}; var qpUpdates = this._qpUpdates || {}; for (var key in this.router.activeTransition.queryParams) { if (!qpUpdates[key]) { unchangedQPs[key] = this.router.activeTransition.queryParams[key]; } } // We need to fully scope queryParams so that we can create one object // that represents both pased in queryParams and ones that aren't changed // from the active transition. this._fullyScopeQueryParams(targetRouteName, models, _queryParams); this._fullyScopeQueryParams(targetRouteName, models, unchangedQPs); _emberMetal.assign(queryParams, unchangedQPs); }, _prepareQueryParams: function (targetRouteName, models, queryParams) { this._hydrateUnsuppliedQueryParams(targetRouteName, models, queryParams); this._serializeQueryParams(targetRouteName, queryParams); this._pruneDefaultQueryParamValues(targetRouteName, queryParams); }, /** Returns a merged query params meta object for a given route. Useful for asking a route what its known query params are. @private */ _queryParamsFor: function (leafRouteName) { if (this._qpCache[leafRouteName]) { return this._qpCache[leafRouteName]; } var map = {}; var qps = []; this._qpCache[leafRouteName] = { map: map, qps: qps }; var routerjs = this.router; var recogHandlerInfos = routerjs.recognizer.handlersFor(leafRouteName); for (var i = 0; i < recogHandlerInfos.length; ++i) { var recogHandler = recogHandlerInfos[i]; var route = routerjs.getHandler(recogHandler.handler); var qpMeta = _emberMetal.get(route, '_qp'); if (!qpMeta) { continue; } _emberMetal.assign(map, qpMeta.map); qps.push.apply(qps, qpMeta.qps); } return { qps: qps, map: map }; }, _fullyScopeQueryParams: function (leafRouteName, contexts, queryParams) { var state = calculatePostTransitionState(this, leafRouteName, contexts); var handlerInfos = state.handlerInfos; _emberRoutingUtils.stashParamNames(this, handlerInfos); for (var i = 0, len = handlerInfos.length; i < len; ++i) { var route = handlerInfos[i].handler; var qpMeta = _emberMetal.get(route, '_qp'); for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { var qp = qpMeta.qps[j]; var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; if (presentProp) { if (presentProp !== qp.scopedPropertyName) { queryParams[qp.scopedPropertyName] = queryParams[presentProp]; delete queryParams[presentProp]; } } } } }, _hydrateUnsuppliedQueryParams: function (leafRouteName, contexts, queryParams) { var state = calculatePostTransitionState(this, leafRouteName, contexts); var handlerInfos = state.handlerInfos; var appCache = this._bucketCache; _emberRoutingUtils.stashParamNames(this, handlerInfos); for (var i = 0; i < handlerInfos.length; ++i) { var route = handlerInfos[i].handler; var qpMeta = _emberMetal.get(route, '_qp'); for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) { var qp = qpMeta.qps[j]; var presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey; if (presentProp) { if (presentProp !== qp.scopedPropertyName) { queryParams[qp.scopedPropertyName] = queryParams[presentProp]; delete queryParams[presentProp]; } } else { var cacheKey = _emberRoutingUtils.calculateCacheKey(qp.ctrl, qp.parts, state.params); queryParams[qp.scopedPropertyName] = appCache.lookup(cacheKey, qp.prop, qp.defaultValue); } } } }, _scheduleLoadingEvent: function (transition, originRoute) { this._cancelSlowTransitionTimer(); this._slowTransitionTimer = _emberMetal.run.scheduleOnce('routerTransitions', this, '_handleSlowTransition', transition, originRoute); }, currentState: null, targetState: null, _handleSlowTransition: function (transition, originRoute) { if (!this.router.activeTransition) { // Don't fire an event if we've since moved on from // the transition that put us in a loading state. return; } this.set('targetState', _emberRoutingSystemRouter_state.default.create({ emberRouter: this, routerJs: this.router, routerJsState: this.router.activeTransition.state })); transition.trigger(true, 'loading', transition, originRoute); }, _cancelSlowTransitionTimer: function () { if (this._slowTransitionTimer) { _emberMetal.run.cancel(this._slowTransitionTimer); } this._slowTransitionTimer = null; }, // These three helper functions are used to ensure errors aren't // re-raised if they're handled in a route's error action. _markErrorAsHandled: function (errorGuid) { this._handledErrors[errorGuid] = true; }, _isErrorHandled: function (errorGuid) { return this._handledErrors[errorGuid]; }, _clearHandledError: function (errorGuid) { delete this._handledErrors[errorGuid]; }, _getEngineInstance: function (_ref) { var name = _ref.name; var instanceId = _ref.instanceId; var mountPoint = _ref.mountPoint; var engineInstances = this._engineInstances; if (!engineInstances[name]) { engineInstances[name] = new _emberMetal.EmptyObject(); } var engineInstance = engineInstances[name][instanceId]; if (!engineInstance) { var owner = _container.getOwner(this); engineInstance = owner.buildChildEngineInstance(name, { routable: true, mountPoint: mountPoint }); engineInstance.boot(); engineInstances[name][instanceId] = engineInstance; } return engineInstance; } }); /* Helper function for iterating root-ward, starting from (but not including) the provided `originRoute`. Returns true if the last callback fired requested to bubble upward. @private */ function forEachRouteAbove(originRoute, transition, callback) { var handlerInfos = transition.state.handlerInfos; var originRouteFound = false; var handlerInfo = undefined, route = undefined; for (var i = handlerInfos.length - 1; i >= 0; --i) { handlerInfo = handlerInfos[i]; route = handlerInfo.handler; if (!originRouteFound) { if (originRoute === route) { originRouteFound = true; } continue; } if (callback(route, handlerInfos[i + 1].handler) !== true) { return false; } } return true; } // These get invoked when an action bubbles above ApplicationRoute // and are not meant to be overridable. var defaultActionHandlers = { willResolveModel: function (transition, originRoute) { originRoute.router._scheduleLoadingEvent(transition, originRoute); }, error: function (error, transition, originRoute) { // Attempt to find an appropriate error substate to enter. var router = originRoute.router; var tryTopLevel = forEachRouteAbove(originRoute, transition, function (route, childRoute) { var childErrorRouteName = findChildRouteName(route, childRoute, 'error'); if (childErrorRouteName) { router.intermediateTransitionTo(childErrorRouteName, error); return; } return true; }); if (tryTopLevel) { // Check for top-level error state to enter. if (routeHasBeenDefined(originRoute.router, 'application_error')) { router.intermediateTransitionTo('application_error', error); return; } } logError(error, 'Error while processing route: ' + transition.targetName); }, loading: function (transition, originRoute) { // Attempt to find an appropriate loading substate to enter. var router = originRoute.router; var tryTopLevel = forEachRouteAbove(originRoute, transition, function (route, childRoute) { var childLoadingRouteName = findChildRouteName(route, childRoute, 'loading'); if (childLoadingRouteName) { router.intermediateTransitionTo(childLoadingRouteName); return; } // Don't bubble above pivot route. if (transition.pivotHandler !== route) { return true; } }); if (tryTopLevel) { // Check for top-level loading state to enter. if (routeHasBeenDefined(originRoute.router, 'application_loading')) { router.intermediateTransitionTo('application_loading'); return; } } } }; function logError(_error, initialMessage) { var errorArgs = []; var error = undefined; if (_error && typeof _error === 'object' && typeof _error.errorThrown === 'object') { error = _error.errorThrown; } else { error = _error; } if (initialMessage) { errorArgs.push(initialMessage); } if (error) { if (error.message) { errorArgs.push(error.message); } if (error.stack) { errorArgs.push(error.stack); } if (typeof error === 'string') { errorArgs.push(error); } } _emberConsole.default.error.apply(this, errorArgs); } function findChildRouteName(parentRoute, originatingChildRoute, name) { var router = parentRoute.router; var childName = undefined; var originatingChildRouteName = originatingChildRoute.routeName; // The only time the originatingChildRoute's name should be 'application' // is if we're entering an engine if (originatingChildRouteName === 'application') { originatingChildRouteName = _container.getOwner(originatingChildRoute).mountPoint; } // First, try a named loading state of the route, e.g. 'foo_loading' childName = originatingChildRouteName + '_' + name; if (routeHasBeenDefined(router, childName)) { return childName; } // Second, try general loading state of the parent, e.g. 'loading' var originatingChildRouteParts = originatingChildRouteName.split('.').slice(0, -1); var namespace = undefined; // If there is a namespace on the route, then we use that, otherwise we use // the parent route as the namespace. if (originatingChildRouteParts.length) { namespace = originatingChildRouteParts.join('.') + '.'; } else { namespace = parentRoute.routeName === 'application' ? '' : parentRoute.routeName + '.'; } childName = namespace + name; if (routeHasBeenDefined(router, childName)) { return childName; } } function routeHasBeenDefined(router, name) { var owner = _container.getOwner(router); return router.hasRoute(name) && (owner.hasRegistration('template:' + name) || owner.hasRegistration('route:' + name)); } function triggerEvent(handlerInfos, ignoreFailure, args) { var name = args.shift(); if (!handlerInfos) { if (ignoreFailure) { return; } throw new _emberMetal.Error('Can\'t trigger action \'' + name + '\' because your app hasn\'t finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.'); } var eventWasHandled = false; var handlerInfo = undefined, handler = undefined; for (var i = handlerInfos.length - 1; i >= 0; i--) { handlerInfo = handlerInfos[i]; handler = handlerInfo.handler; if (handler && handler.actions && handler.actions[name]) { if (handler.actions[name].apply(handler, args) === true) { eventWasHandled = true; } else { // Should only hit here if a non-bubbling error action is triggered on a route. if (name === 'error') { var errorId = _emberMetal.guidFor(args[0]); handler.router._markErrorAsHandled(errorId); } return; } } } if (defaultActionHandlers[name]) { defaultActionHandlers[name].apply(null, args); return; } if (!eventWasHandled && !ignoreFailure) { throw new _emberMetal.Error('Nothing handled the action \'' + name + '\'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.'); } } function calculatePostTransitionState(emberRouter, leafRouteName, contexts) { var routerjs = emberRouter.router; var state = routerjs.applyIntent(leafRouteName, contexts); var handlerInfos = state.handlerInfos; var params = state.params; for (var i = 0; i < handlerInfos.length; ++i) { var handlerInfo = handlerInfos[i]; if (!handlerInfo.isResolved) { handlerInfo = handlerInfo.becomeResolved(null, handlerInfo.context); } params[handlerInfo.name] = handlerInfo.params; } return state; } function updatePaths(router) { var infos = router.router.currentHandlerInfos; if (infos.length === 0) { return; } var path = EmberRouter._routePath(infos); var currentRouteName = infos[infos.length - 1].name; _emberMetal.set(router, 'currentPath', path); _emberMetal.set(router, 'currentRouteName', currentRouteName); var appController = _container.getOwner(router).lookup('controller:application'); if (!appController) { // appController might not exist when top-level loading/error // substates have been entered since ApplicationRoute hasn't // actually been entered at that point. return; } if (!('currentPath' in appController)) { _emberMetal.defineProperty(appController, 'currentPath'); } _emberMetal.set(appController, 'currentPath', path); if (!('currentRouteName' in appController)) { _emberMetal.defineProperty(appController, 'currentRouteName'); } _emberMetal.set(appController, 'currentRouteName', currentRouteName); } EmberRouter.reopenClass({ router: null, /** The `Router.map` function allows you to define mappings from URLs to routes in your application. These mappings are defined within the supplied callback function using `this.route`. The first parameter is the name of the route which is used by default as the path name as well. The second parameter is the optional options hash. Available options are: * `path`: allows you to provide your own path as well as mark dynamic segments. * `resetNamespace`: false by default; when nesting routes, ember will combine the route names to form the fully-qualified route name, which is used with `{{link-to}}` or manually transitioning to routes. Setting `resetNamespace: true` will cause the route not to inherit from its parent route's names. This is handy for preventing extremely long route names. Keep in mind that the actual URL path behavior is still retained. The third parameter is a function, which can be used to nest routes. Nested routes, by default, will have the parent route tree's route name and path prepended to it's own. ```javascript App.Router.map(function(){ this.route('post', { path: '/post/:post_id' }, function() { this.route('edit'); this.route('comments', { resetNamespace: true }, function() { this.route('new'); }); }); }); ``` For more detailed documentation and examples please see [the guides](http://emberjs.com/guides/routing/defining-your-routes/). @method map @param callback @public */ map: function (callback) { if (!this.dslCallbacks) { this.dslCallbacks = []; this.reopenClass({ dslCallbacks: this.dslCallbacks }); } this.dslCallbacks.push(callback); return this; }, _routePath: function (handlerInfos) { var path = []; // We have to handle coalescing resource names that // are prefixed with their parent's names, e.g. // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz' function intersectionMatches(a1, a2) { for (var i = 0; i < a1.length; ++i) { if (a1[i] !== a2[i]) { return false; } } return true; } var name = undefined, nameParts = undefined, oldNameParts = undefined; for (var i = 1; i < handlerInfos.length; i++) { name = handlerInfos[i].name; nameParts = name.split('.'); oldNameParts = slice.call(path); while (oldNameParts.length) { if (intersectionMatches(oldNameParts, nameParts)) { break; } oldNameParts.shift(); } path.push.apply(path, nameParts.slice(oldNameParts.length)); } return path.join('.'); } }); function didBeginTransition(transition, router) { var routerState = _emberRoutingSystemRouter_state.default.create({ emberRouter: router, routerJs: router.router, routerJsState: transition.state }); if (!router.currentState) { router.set('currentState', routerState); } router.set('targetState', routerState); transition.promise = transition.catch(function (error) { var errorId = _emberMetal.guidFor(error); if (router._isErrorHandled(errorId)) { router._clearHandledError(errorId); } else { throw error; } }); } function resemblesURL(str) { return typeof str === 'string' && (str === '' || str.charAt(0) === '/'); } function forEachQueryParam(router, targetRouteName, queryParams, callback) { var qpCache = router._queryParamsFor(targetRouteName); for (var key in queryParams) { if (!queryParams.hasOwnProperty(key)) { continue; } var value = queryParams[key]; var qp = qpCache.map[key]; if (qp) { callback(key, value, qp); } } } function findLiveRoute(liveRoutes, name) { if (!liveRoutes) { return; } var stack = [liveRoutes]; while (stack.length > 0) { var test = stack.shift(); if (test.render.name === name) { return test; } var outlets = test.outlets; for (var outletName in outlets) { stack.push(outlets[outletName]); } } } function appendLiveRoute(liveRoutes, defaultParentState, renderOptions) { var target = undefined; var myState = { render: renderOptions, outlets: new _emberMetal.EmptyObject(), wasUsed: false }; if (renderOptions.into) { target = findLiveRoute(liveRoutes, renderOptions.into); } else { target = defaultParentState; } if (target) { _emberMetal.set(target.outlets, renderOptions.outlet, myState); } else { if (renderOptions.into) { // Megahax time. Post-3.0-breaking-changes, we will just assert // right here that the user tried to target a nonexistent // thing. But for now we still need to support the `render` // helper, and people are allowed to target templates rendered // by the render helper. So instead we defer doing anyting with // these orphan renders until afterRender. appendOrphan(liveRoutes, renderOptions.into, myState); } else { liveRoutes = myState; } } return { liveRoutes: liveRoutes, ownState: myState }; } function appendOrphan(liveRoutes, into, myState) { if (!liveRoutes.outlets.__ember_orphans__) { liveRoutes.outlets.__ember_orphans__ = { render: { name: '__ember_orphans__' }, outlets: new _emberMetal.EmptyObject() }; } liveRoutes.outlets.__ember_orphans__.outlets[into] = myState; _emberMetal.run.schedule('afterRender', function () {}); } function representEmptyRoute(liveRoutes, defaultParentState, route) { // the route didn't render anything var alreadyAppended = findLiveRoute(liveRoutes, route.routeName); if (alreadyAppended) { // But some other route has already rendered our default // template, so that becomes the default target for any // children we may have. return alreadyAppended; } else { // Create an entry to represent our default template name, // just so other routes can target it and inherit its place // in the outlet hierarchy. defaultParentState.outlets.main = { render: { name: route.routeName, outlet: 'main' }, outlets: {} }; return defaultParentState; } } exports.default = EmberRouter; }); /** @module ember @submodule ember-routing */ // `wasUsed` gets set by the render helper. enifed('ember-routing/system/router_state', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { 'use strict'; exports.default = _emberRuntime.Object.extend({ emberRouter: null, routerJs: null, routerJsState: null, isActiveIntent: function (routeName, models, queryParams, queryParamsMustMatch) { var state = this.routerJsState; if (!this.routerJs.isActiveIntent(routeName, models, null, state)) { return false; } var emptyQueryParams = _emberMetal.isEmpty(Object.keys(queryParams)); if (queryParamsMustMatch && !emptyQueryParams) { var visibleQueryParams = {}; _emberMetal.assign(visibleQueryParams, queryParams); this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams); return shallowEqual(visibleQueryParams, state.queryParams); } return true; } }); function shallowEqual(a, b) { var k = undefined; for (k in a) { if (a.hasOwnProperty(k) && a[k] !== b[k]) { return false; } } for (k in b) { if (b.hasOwnProperty(k) && a[k] !== b[k]) { return false; } } return true; } }); enifed('ember-routing/utils', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; exports.routeArgs = routeArgs; exports.getActiveTargetName = getActiveTargetName; exports.stashParamNames = stashParamNames; exports.calculateCacheKey = calculateCacheKey; exports.normalizeControllerQueryParams = normalizeControllerQueryParams; var ALL_PERIODS_REGEX = /\./g; function routeArgs(targetRouteName, models, queryParams) { var args = []; if (typeof targetRouteName === 'string') { args.push('' + targetRouteName); } args.push.apply(args, models); args.push({ queryParams: queryParams }); return args; } function getActiveTargetName(router) { var handlerInfos = router.activeTransition ? router.activeTransition.state.handlerInfos : router.state.handlerInfos; return handlerInfos[handlerInfos.length - 1].name; } function stashParamNames(router, handlerInfos) { if (handlerInfos._namesStashed) { return; } // This helper exists because router.js/route-recognizer.js awkwardly // keeps separate a handlerInfo's list of parameter names depending // on whether a URL transition or named transition is happening. // Hopefully we can remove this in the future. var targetRouteName = handlerInfos[handlerInfos.length - 1].name; var recogHandlers = router.router.recognizer.handlersFor(targetRouteName); var dynamicParent = null; for (var i = 0; i < handlerInfos.length; ++i) { var handlerInfo = handlerInfos[i]; var names = recogHandlers[i].names; if (names.length) { dynamicParent = handlerInfo; } handlerInfo._names = names; var route = handlerInfo.handler; route._stashNames(handlerInfo, dynamicParent); } handlerInfos._namesStashed = true; } function _calculateCacheValuePrefix(prefix, part) { // calculates the dot seperated sections from prefix that are also // at the start of part - which gives us the route name // given : prefix = site.article.comments, part = site.article.id // - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below) // given : prefix = site.article, part = site.article.id // - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below) var prefixParts = prefix.split('.'); var currPrefix = ''; for (var i = 0; i < prefixParts.length; i++) { var currPart = prefixParts.slice(0, i + 1).join('.'); if (part.indexOf(currPart) !== 0) { break; } currPrefix = currPart; } return currPrefix; } /* Stolen from Controller */ function calculateCacheKey(prefix, _parts, values) { var parts = _parts || []; var suffixes = ''; for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part); var value = undefined; if (values) { if (cacheValuePrefix && cacheValuePrefix in values) { var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part; value = _emberMetal.get(values[cacheValuePrefix], partRemovedPrefix); } else { value = _emberMetal.get(values, part); } } suffixes += '::' + part + ':' + value; } return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-'); } /* Controller-defined query parameters can come in three shapes: Array queryParams: ['foo', 'bar'] Array of simple objects where value is an alias queryParams: [ { 'foo': 'rename_foo_to_this' }, { 'bar': 'call_bar_this_instead' } ] Array of fully defined objects queryParams: [ { 'foo': { as: 'rename_foo_to_this' }, } { 'bar': { as: 'call_bar_this_instead', scope: 'controller' } } ] This helper normalizes all three possible styles into the 'Array of fully defined objects' style. */ function normalizeControllerQueryParams(queryParams) { if (queryParams._qpMap) { return queryParams._qpMap; } var qpMap = queryParams._qpMap = {}; for (var i = 0; i < queryParams.length; ++i) { accumulateQueryParamDescriptors(queryParams[i], qpMap); } return qpMap; } function accumulateQueryParamDescriptors(_desc, accum) { var desc = _desc; var tmp = undefined; if (typeof desc === 'string') { tmp = {}; tmp[desc] = { as: null }; desc = tmp; } for (var key in desc) { if (!desc.hasOwnProperty(key)) { return; } var singleDesc = desc[key]; if (typeof singleDesc === 'string') { singleDesc = { as: singleDesc }; } tmp = accum[key] || { as: null, scope: 'model' }; _emberMetal.assign(tmp, singleDesc); accum[key] = tmp; } } }); enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtime/mixins/comparable'], function (exports, _emberRuntimeUtils, _emberRuntimeMixinsComparable) { 'use strict'; exports.default = compare; var TYPE_ORDER = { 'undefined': 0, 'null': 1, 'boolean': 2, 'number': 3, 'string': 4, 'array': 5, 'object': 6, 'instance': 7, 'function': 8, 'class': 9, 'date': 10 }; // // the spaceship operator // // `. ___ // __,' __`. _..----....____ // __...--.'``;. ,. ;``--..__ .' ,-._ _.-' // _..-''-------' `' `' `' O ``-''._ (,;') _,' // ,'________________ \`-._`-',' // `._ ```````````------...___ '-.._'-: // ```--.._ ,. ````--...__\-. // `.--. `-` "INFINITY IS LESS ____ | |` // `. `. THAN BEYOND" ,'`````. ; ;` // `._`. __________ `. \'__/` // `-:._____/______/___/____`. \ ` // | `._ `. \ // `._________`-. `. `.___ // SSt `------'` function spaceship(a, b) { var diff = a - b; return (diff > 0) - (diff < 0); } /** Compares two javascript values and returns: - -1 if the first is smaller than the second, - 0 if both are equal, - 1 if the first is greater than the second. ```javascript Ember.compare('hello', 'hello'); // 0 Ember.compare('abc', 'dfg'); // -1 Ember.compare(2, 1); // 1 ``` If the types of the two objects are different precedence occurs in the following order, with types earlier in the list considered `<` types later in the list: - undefined - null - boolean - number - string - array - object - instance - function - class - date ```javascript Ember.compare('hello', 50); // 1 Ember.compare(50, 'hello'); // -1 ``` @method compare @for Ember @param {Object} v First value to compare @param {Object} w Second value to compare @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. @public */ function compare(v, w) { if (v === w) { return 0; } var type1 = _emberRuntimeUtils.typeOf(v); var type2 = _emberRuntimeUtils.typeOf(w); if (_emberRuntimeMixinsComparable.default) { if (type1 === 'instance' && _emberRuntimeMixinsComparable.default.detect(v) && v.constructor.compare) { return v.constructor.compare(v, w); } if (type2 === 'instance' && _emberRuntimeMixinsComparable.default.detect(w) && w.constructor.compare) { return w.constructor.compare(w, v) * -1; } } var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]); if (res !== 0) { return res; } // types are equal - so we have to check values now switch (type1) { case 'boolean': case 'number': return spaceship(v, w); case 'string': return spaceship(v.localeCompare(w), 0); case 'array': var vLen = v.length; var wLen = w.length; var len = Math.min(vLen, wLen); for (var i = 0; i < len; i++) { var r = compare(v[i], w[i]); if (r !== 0) { return r; } } // all elements are equal now // shorter array should be ordered first return spaceship(vLen, wLen); case 'instance': if (_emberRuntimeMixinsComparable.default && _emberRuntimeMixinsComparable.default.detect(v)) { return v.compare(v, w); } return 0; case 'date': return spaceship(v.getTime(), w.getTime()); default: return 0; } } }); enifed('ember-runtime/computed/computed_macros', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; exports.empty = empty; exports.notEmpty = notEmpty; exports.none = none; exports.not = not; exports.bool = bool; exports.match = match; exports.equal = equal; exports.gt = gt; exports.gte = gte; exports.lt = lt; exports.lte = lte; exports.oneWay = oneWay; exports.readOnly = readOnly; exports.deprecatingAlias = deprecatingAlias; /** @module ember @submodule ember-metal */ function expandPropertiesToArray(predicateName, properties) { var expandedProperties = []; function extractProperty(entry) { expandedProperties.push(entry); } for (var i = 0; i < properties.length; i++) { var property = properties[i]; _emberMetal.expandProperties(property, extractProperty); } return expandedProperties; } function generateComputedWithPredicate(name, predicate) { return function () { for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) { properties[_key] = arguments[_key]; } var expandedProperties = expandPropertiesToArray(name, properties); var computedFunc = _emberMetal.computed(function () { var lastIdx = expandedProperties.length - 1; for (var i = 0; i < lastIdx; i++) { var value = _emberMetal.get(this, expandedProperties[i]); if (!predicate(value)) { return value; } } return _emberMetal.get(this, expandedProperties[lastIdx]); }); return computedFunc.property.apply(computedFunc, expandedProperties); }; } /** A computed property that returns true if the value of the dependent property is null, an empty string, empty array, or empty function. Example ```javascript let ToDoList = Ember.Object.extend({ isDone: Ember.computed.empty('todos') }); let todoList = ToDoList.create({ todos: ['Unit Test', 'Documentation', 'Release'] }); todoList.get('isDone'); // false todoList.get('todos').clear(); todoList.get('isDone'); // true ``` @since 1.6.0 @method empty @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computed property which negate the original value for property @public */ function empty(dependentKey) { return _emberMetal.computed(dependentKey + '.length', function () { return _emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); }); } /** A computed property that returns true if the value of the dependent property is NOT null, an empty string, empty array, or empty function. Example ```javascript let Hamster = Ember.Object.extend({ hasStuff: Ember.computed.notEmpty('backpack') }); let hamster = Hamster.create({ backpack: ['Food', 'Sleeping Bag', 'Tent'] }); hamster.get('hasStuff'); // true hamster.get('backpack').clear(); // [] hamster.get('hasStuff'); // false ``` @method notEmpty @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computed property which returns true if original value for property is not empty. @public */ function notEmpty(dependentKey) { return _emberMetal.computed(dependentKey + '.length', function () { return !_emberMetal.isEmpty(_emberMetal.get(this, dependentKey)); }); } /** A computed property that returns true if the value of the dependent property is null or undefined. This avoids errors from JSLint complaining about use of ==, which can be technically confusing. Example ```javascript let Hamster = Ember.Object.extend({ isHungry: Ember.computed.none('food') }); let hamster = Hamster.create(); hamster.get('isHungry'); // true hamster.set('food', 'Banana'); hamster.get('isHungry'); // false hamster.set('food', null); hamster.get('isHungry'); // true ``` @method none @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computed property which returns true if original value for property is null or undefined. @public */ function none(dependentKey) { return _emberMetal.computed(dependentKey, function () { return _emberMetal.isNone(_emberMetal.get(this, dependentKey)); }); } /** A computed property that returns the inverse boolean value of the original value for the dependent property. Example ```javascript let User = Ember.Object.extend({ isAnonymous: Ember.computed.not('loggedIn') }); let user = User.create({loggedIn: false}); user.get('isAnonymous'); // true user.set('loggedIn', true); user.get('isAnonymous'); // false ``` @method not @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computed property which returns inverse of the original value for property @public */ function not(dependentKey) { return _emberMetal.computed(dependentKey, function () { return !_emberMetal.get(this, dependentKey); }); } /** A computed property that converts the provided dependent property into a boolean value. ```javascript let Hamster = Ember.Object.extend({ hasBananas: Ember.computed.bool('numBananas') }); let hamster = Hamster.create(); hamster.get('hasBananas'); // false hamster.set('numBananas', 0); hamster.get('hasBananas'); // false hamster.set('numBananas', 1); hamster.get('hasBananas'); // true hamster.set('numBananas', null); hamster.get('hasBananas'); // false ``` @method bool @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computed property which converts to boolean the original value for property @public */ function bool(dependentKey) { return _emberMetal.computed(dependentKey, function () { return !!_emberMetal.get(this, dependentKey); }); } /** A computed property which matches the original value for the dependent property against a given RegExp, returning `true` if the value matches the RegExp and `false` if it does not. Example ```javascript let User = Ember.Object.extend({ hasValidEmail: Ember.computed.match('email', /^.+@.+\..+$/) }); let user = User.create({loggedIn: false}); user.get('hasValidEmail'); // false user.set('email', ''); user.get('hasValidEmail'); // false user.set('email', 'ember_hamster@example.com'); user.get('hasValidEmail'); // true ``` @method match @for Ember.computed @param {String} dependentKey @param {RegExp} regexp @return {Ember.ComputedProperty} computed property which match the original value for property against a given RegExp @public */ function match(dependentKey, regexp) { return _emberMetal.computed(dependentKey, function () { var value = _emberMetal.get(this, dependentKey); return typeof value === 'string' ? regexp.test(value) : false; }); } /** A computed property that returns true if the provided dependent property is equal to the given value. Example ```javascript let Hamster = Ember.Object.extend({ napTime: Ember.computed.equal('state', 'sleepy') }); let hamster = Hamster.create(); hamster.get('napTime'); // false hamster.set('state', 'sleepy'); hamster.get('napTime'); // true hamster.set('state', 'hungry'); hamster.get('napTime'); // false ``` @method equal @for Ember.computed @param {String} dependentKey @param {String|Number|Object} value @return {Ember.ComputedProperty} computed property which returns true if the original value for property is equal to the given value. @public */ function equal(dependentKey, value) { return _emberMetal.computed(dependentKey, function () { return _emberMetal.get(this, dependentKey) === value; }); } /** A computed property that returns true if the provided dependent property is greater than the provided value. Example ```javascript let Hamster = Ember.Object.extend({ hasTooManyBananas: Ember.computed.gt('numBananas', 10) }); let hamster = Hamster.create(); hamster.get('hasTooManyBananas'); // false hamster.set('numBananas', 3); hamster.get('hasTooManyBananas'); // false hamster.set('numBananas', 11); hamster.get('hasTooManyBananas'); // true ``` @method gt @for Ember.computed @param {String} dependentKey @param {Number} value @return {Ember.ComputedProperty} computed property which returns true if the original value for property is greater than given value. @public */ function gt(dependentKey, value) { return _emberMetal.computed(dependentKey, function () { return _emberMetal.get(this, dependentKey) > value; }); } /** A computed property that returns true if the provided dependent property is greater than or equal to the provided value. Example ```javascript let Hamster = Ember.Object.extend({ hasTooManyBananas: Ember.computed.gte('numBananas', 10) }); let hamster = Hamster.create(); hamster.get('hasTooManyBananas'); // false hamster.set('numBananas', 3); hamster.get('hasTooManyBananas'); // false hamster.set('numBananas', 10); hamster.get('hasTooManyBananas'); // true ``` @method gte @for Ember.computed @param {String} dependentKey @param {Number} value @return {Ember.ComputedProperty} computed property which returns true if the original value for property is greater or equal then given value. @public */ function gte(dependentKey, value) { return _emberMetal.computed(dependentKey, function () { return _emberMetal.get(this, dependentKey) >= value; }); } /** A computed property that returns true if the provided dependent property is less than the provided value. Example ```javascript let Hamster = Ember.Object.extend({ needsMoreBananas: Ember.computed.lt('numBananas', 3) }); let hamster = Hamster.create(); hamster.get('needsMoreBananas'); // true hamster.set('numBananas', 3); hamster.get('needsMoreBananas'); // false hamster.set('numBananas', 2); hamster.get('needsMoreBananas'); // true ``` @method lt @for Ember.computed @param {String} dependentKey @param {Number} value @return {Ember.ComputedProperty} computed property which returns true if the original value for property is less then given value. @public */ function lt(dependentKey, value) { return _emberMetal.computed(dependentKey, function () { return _emberMetal.get(this, dependentKey) < value; }); } /** A computed property that returns true if the provided dependent property is less than or equal to the provided value. Example ```javascript let Hamster = Ember.Object.extend({ needsMoreBananas: Ember.computed.lte('numBananas', 3) }); let hamster = Hamster.create(); hamster.get('needsMoreBananas'); // true hamster.set('numBananas', 5); hamster.get('needsMoreBananas'); // false hamster.set('numBananas', 3); hamster.get('needsMoreBananas'); // true ``` @method lte @for Ember.computed @param {String} dependentKey @param {Number} value @return {Ember.ComputedProperty} computed property which returns true if the original value for property is less or equal than given value. @public */ function lte(dependentKey, value) { return _emberMetal.computed(dependentKey, function () { return _emberMetal.get(this, dependentKey) <= value; }); } /** A computed property that performs a logical `and` on the original values for the provided dependent properties. You may pass in more than two properties and even use property brace expansion. The computed property will return the first falsy value or last truthy value just like JavaScript's `&&` operator. Example ```javascript let Hamster = Ember.Object.extend({ readyForCamp: Ember.computed.and('hasTent', 'hasBackpack'), readyForHike: Ember.computed.and('hasWalkingStick', 'hasBackpack') }); let tomster = Hamster.create(); tomster.get('readyForCamp'); // false tomster.set('hasTent', true); tomster.get('readyForCamp'); // false tomster.set('hasBackpack', true); tomster.get('readyForCamp'); // true tomster.set('hasBackpack', 'Yes'); tomster.get('readyForCamp'); // 'Yes' tomster.set('hasWalkingStick', null); tomster.get('readyForHike'); // null ``` @method and @for Ember.computed @param {String} dependentKey* @return {Ember.ComputedProperty} computed property which performs a logical `and` on the values of all the original values for properties. @public */ var and = generateComputedWithPredicate('and', function (value) { return value; }); exports.and = and; /** A computed property which performs a logical `or` on the original values for the provided dependent properties. You may pass in more than two properties and even use property brace expansion. The computed property will return the first truthy value or last falsy value just like JavaScript's `||` operator. Example ```javascript let Hamster = Ember.Object.extend({ readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella'), readyForBeach: Ember.computed.or('{hasSunscreen,hasUmbrella}') }); let tomster = Hamster.create(); tomster.get('readyForRain'); // undefined tomster.set('hasUmbrella', true); tomster.get('readyForRain'); // true tomster.set('hasJacket', 'Yes'); tomster.get('readyForRain'); // 'Yes' tomster.set('hasSunscreen', 'Check'); tomster.get('readyForBeach'); // 'Check' ``` @method or @for Ember.computed @param {String} dependentKey* @return {Ember.ComputedProperty} computed property which performs a logical `or` on the values of all the original values for properties. @public */ var or = generateComputedWithPredicate('or', function (value) { return !value; }); exports.or = or; /** Creates a new property that is an alias for another property on an object. Calls to `get` or `set` this property behave as though they were called on the original property. ```javascript let Person = Ember.Object.extend({ name: 'Alex Matchneer', nomen: Ember.computed.alias('name') }); let alex = Person.create(); alex.get('nomen'); // 'Alex Matchneer' alex.get('name'); // 'Alex Matchneer' alex.set('nomen', '@machty'); alex.get('name'); // '@machty' ``` @method alias @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computed property which creates an alias to the original value for property. @public */ /** Where `computed.alias` aliases `get` and `set`, and allows for bidirectional data flow, `computed.oneWay` only provides an aliased `get`. The `set` will not mutate the upstream property, rather causes the current property to become the value set. This causes the downstream property to permanently diverge from the upstream property. Example ```javascript let User = Ember.Object.extend({ firstName: null, lastName: null, nickName: Ember.computed.oneWay('firstName') }); let teddy = User.create({ firstName: 'Teddy', lastName: 'Zeenny' }); teddy.get('nickName'); // 'Teddy' teddy.set('nickName', 'TeddyBear'); // 'TeddyBear' teddy.get('firstName'); // 'Teddy' ``` @method oneWay @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computed property which creates a one way computed property to the original value for property. @public */ function oneWay(dependentKey) { return _emberMetal.alias(dependentKey).oneWay(); } /** This is a more semantically meaningful alias of `computed.oneWay`, whose name is somewhat ambiguous as to which direction the data flows. @method reads @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computed property which creates a one way computed property to the original value for property. @public */ /** Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides a readOnly one way binding. Very often when using `computed.oneWay` one does not also want changes to propagate back up, as they will replace the value. This prevents the reverse flow, and also throws an exception when it occurs. Example ```javascript let User = Ember.Object.extend({ firstName: null, lastName: null, nickName: Ember.computed.readOnly('firstName') }); let teddy = User.create({ firstName: 'Teddy', lastName: 'Zeenny' }); teddy.get('nickName'); // 'Teddy' teddy.set('nickName', 'TeddyBear'); // throws Exception // throw new Ember.Error('Cannot Set: nickName on: ' );` teddy.get('firstName'); // 'Teddy' ``` @method readOnly @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computed property which creates a one way computed property to the original value for property. @since 1.5.0 @public */ function readOnly(dependentKey) { return _emberMetal.alias(dependentKey).readOnly(); } /** Creates a new property that is an alias for another property on an object. Calls to `get` or `set` this property behave as though they were called on the original property, but also print a deprecation warning. ```javascript let Hamster = Ember.Object.extend({ bananaCount: Ember.computed.deprecatingAlias('cavendishCount', { id: 'hamster.deprecate-banana', until: '3.0.0' }) }); let hamster = Hamster.create(); hamster.set('bananaCount', 5); // Prints a deprecation warning. hamster.get('cavendishCount'); // 5 ``` @method deprecatingAlias @for Ember.computed @param {String} dependentKey @param {Object} options Options for `Ember.deprecate`. @return {Ember.ComputedProperty} computed property which creates an alias with a deprecation to the original value for property. @since 1.7.0 @public */ function deprecatingAlias(dependentKey, options) { return _emberMetal.computed(dependentKey, { get: function (key) { return _emberMetal.get(this, dependentKey); }, set: function (key, value) { _emberMetal.set(this, dependentKey, value); return value; } }); } }); enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array'], function (exports, _emberMetal, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array) { /** @module ember @submodule ember-runtime */ 'use strict'; exports.sum = sum; exports.max = max; exports.min = min; exports.map = map; exports.mapBy = mapBy; exports.filter = filter; exports.filterBy = filterBy; exports.uniq = uniq; exports.uniqBy = uniqBy; exports.intersect = intersect; exports.setDiff = setDiff; exports.collect = collect; exports.sort = sort; function reduceMacro(dependentKey, callback, initialValue) { return _emberMetal.computed(dependentKey + '.[]', function () { var _this = this; var arr = _emberMetal.get(this, dependentKey); if (arr === null || typeof arr !== 'object') { return initialValue; } return arr.reduce(function (previousValue, currentValue, index, array) { return callback.call(_this, previousValue, currentValue, index, array); }, initialValue); }).readOnly(); } function arrayMacro(dependentKey, callback) { // This is a bit ugly var propertyName = undefined; if (/@each/.test(dependentKey)) { propertyName = dependentKey.replace(/\.@each.*$/, ''); } else { propertyName = dependentKey; dependentKey += '.[]'; } return _emberMetal.computed(dependentKey, function () { var value = _emberMetal.get(this, propertyName); if (_emberRuntimeUtils.isArray(value)) { return _emberRuntimeSystemNative_array.A(callback.call(this, value)); } else { return _emberRuntimeSystemNative_array.A(); } }).readOnly(); } function multiArrayMacro(dependentKeys, callback) { var args = dependentKeys.map(function (key) { return key + '.[]'; }); args.push(function () { return _emberRuntimeSystemNative_array.A(callback.call(this, dependentKeys)); }); return _emberMetal.computed.apply(this, args).readOnly(); } /** A computed property that returns the sum of the values in the dependent array. @method sum @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computes the sum of all values in the dependentKey's array @since 1.4.0 @public */ function sum(dependentKey) { return reduceMacro(dependentKey, function (sum, item) { return sum + item; }, 0); } /** A computed property that calculates the maximum value in the dependent array. This will return `-Infinity` when the dependent array is empty. ```javascript let Person = Ember.Object.extend({ childAges: Ember.computed.mapBy('children', 'age'), maxChildAge: Ember.computed.max('childAges') }); let lordByron = Person.create({ children: [] }); lordByron.get('maxChildAge'); // -Infinity lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); lordByron.get('maxChildAge'); // 7 lordByron.get('children').pushObjects([{ name: 'Allegra Byron', age: 5 }, { name: 'Elizabeth Medora Leigh', age: 8 }]); lordByron.get('maxChildAge'); // 8 ``` If the types of the arguments are not numbers, they will be converted to numbers and the type of the return value will always be `Number`. For example, the max of a list of Date objects will be the highest timestamp as a `Number`. This behavior is consistent with `Math.max`. @method max @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array @public */ function max(dependentKey) { return reduceMacro(dependentKey, function (max, item) { return Math.max(max, item); }, -Infinity); } /** A computed property that calculates the minimum value in the dependent array. This will return `Infinity` when the dependent array is empty. ```javascript let Person = Ember.Object.extend({ childAges: Ember.computed.mapBy('children', 'age'), minChildAge: Ember.computed.min('childAges') }); let lordByron = Person.create({ children: [] }); lordByron.get('minChildAge'); // Infinity lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); lordByron.get('minChildAge'); // 7 lordByron.get('children').pushObjects([{ name: 'Allegra Byron', age: 5 }, { name: 'Elizabeth Medora Leigh', age: 8 }]); lordByron.get('minChildAge'); // 5 ``` If the types of the arguments are not numbers, they will be converted to numbers and the type of the return value will always be `Number`. For example, the min of a list of Date objects will be the lowest timestamp as a `Number`. This behavior is consistent with `Math.min`. @method min @for Ember.computed @param {String} dependentKey @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array @public */ function min(dependentKey) { return reduceMacro(dependentKey, function (min, item) { return Math.min(min, item); }, Infinity); } /** Returns an array mapped via the callback The callback method you provide should have the following signature. `item` is the current item in the iteration. `index` is the integer index of the current item in the iteration. ```javascript function(item, index); ``` Example ```javascript let Hamster = Ember.Object.extend({ excitingChores: Ember.computed.map('chores', function(chore, index) { return chore.toUpperCase() + '!'; }) }); let hamster = Hamster.create({ chores: ['clean', 'write more unit tests'] }); hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!'] ``` @method map @for Ember.computed @param {String} dependentKey @param {Function} callback @return {Ember.ComputedProperty} an array mapped via the callback @public */ function map(dependentKey, callback) { return arrayMacro(dependentKey, function (value) { return value.map(callback, this); }); } /** Returns an array mapped to the specified key. ```javascript let Person = Ember.Object.extend({ childAges: Ember.computed.mapBy('children', 'age') }); let lordByron = Person.create({ children: [] }); lordByron.get('childAges'); // [] lordByron.get('children').pushObject({ name: 'Augusta Ada Byron', age: 7 }); lordByron.get('childAges'); // [7] lordByron.get('children').pushObjects([{ name: 'Allegra Byron', age: 5 }, { name: 'Elizabeth Medora Leigh', age: 8 }]); lordByron.get('childAges'); // [7, 5, 8] ``` @method mapBy @for Ember.computed @param {String} dependentKey @param {String} propertyKey @return {Ember.ComputedProperty} an array mapped to the specified key @public */ function mapBy(dependentKey, propertyKey) { return map(dependentKey + '.@each.' + propertyKey, function (item) { return _emberMetal.get(item, propertyKey); }); } /** Filters the array by the callback. The callback method you provide should have the following signature. `item` is the current item in the iteration. `index` is the integer index of the current item in the iteration. `array` is the dependant array itself. ```javascript function(item, index, array); ``` ```javascript let Hamster = Ember.Object.extend({ remainingChores: Ember.computed.filter('chores', function(chore, index, array) { return !chore.done; }) }); let hamster = Hamster.create({ chores: [ { name: 'cook', done: true }, { name: 'clean', done: true }, { name: 'write more unit tests', done: false } ] }); hamster.get('remainingChores'); // [{name: 'write more unit tests', done: false}] ``` @method filter @for Ember.computed @param {String} dependentKey @param {Function} callback @return {Ember.ComputedProperty} the filtered array @public */ function filter(dependentKey, callback) { return arrayMacro(dependentKey, function (value) { return value.filter(callback, this); }); } /** Filters the array by the property and value ```javascript let Hamster = Ember.Object.extend({ remainingChores: Ember.computed.filterBy('chores', 'done', false) }); let hamster = Hamster.create({ chores: [ { name: 'cook', done: true }, { name: 'clean', done: true }, { name: 'write more unit tests', done: false } ] }); hamster.get('remainingChores'); // [{ name: 'write more unit tests', done: false }] ``` @method filterBy @for Ember.computed @param {String} dependentKey @param {String} propertyKey @param {*} value @return {Ember.ComputedProperty} the filtered array @public */ function filterBy(dependentKey, propertyKey, value) { var callback = undefined; if (arguments.length === 2) { callback = function (item) { return _emberMetal.get(item, propertyKey); }; } else { callback = function (item) { return _emberMetal.get(item, propertyKey) === value; }; } return filter(dependentKey + '.@each.' + propertyKey, callback); } /** A computed property which returns a new array with all the unique elements from one or more dependent arrays. Example ```javascript let Hamster = Ember.Object.extend({ uniqueFruits: Ember.computed.uniq('fruits') }); let hamster = Hamster.create({ fruits: [ 'banana', 'grape', 'kale', 'banana' ] }); hamster.get('uniqueFruits'); // ['banana', 'grape', 'kale'] ``` @method uniq @for Ember.computed @param {String} propertyKey* @return {Ember.ComputedProperty} computes a new array with all the unique elements from the dependent array @public */ function uniq() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return multiArrayMacro(args, function (dependentKeys) { var _this2 = this; var uniq = _emberRuntimeSystemNative_array.A(); dependentKeys.forEach(function (dependentKey) { var value = _emberMetal.get(_this2, dependentKey); if (_emberRuntimeUtils.isArray(value)) { value.forEach(function (item) { if (uniq.indexOf(item) === -1) { uniq.push(item); } }); } }); return uniq; }); } /** A computed property which returns a new array with all the unique elements from an array, with uniqueness determined by specific key. Example ```javascript let Hamster = Ember.Object.extend({ uniqueFruits: Ember.computed.uniqBy('fruits', 'id') }); let hamster = Hamster.create({ fruits: [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }, { id: 1, 'banana' } ] }); hamster.get('uniqueFruits'); // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }] ``` @method uniqBy @for Ember.computed @param {String} dependentKey @param {String} propertyKey @return {Ember.ComputedProperty} computes a new array with all the unique elements from the dependent array @public */ function uniqBy(dependentKey, propertyKey) { return _emberMetal.computed(dependentKey + '.[]', function () { var uniq = _emberRuntimeSystemNative_array.A(); var seen = new _emberMetal.EmptyObject(); var list = _emberMetal.get(this, dependentKey); if (_emberRuntimeUtils.isArray(list)) { list.forEach(function (item) { var guid = _emberMetal.guidFor(_emberMetal.get(item, propertyKey)); if (!(guid in seen)) { seen[guid] = true; uniq.push(item); } }); } return uniq; }).readOnly(); } /** Alias for [Ember.computed.uniq](/api/#method_computed_uniq). @method union @for Ember.computed @param {String} propertyKey* @return {Ember.ComputedProperty} computes a new array with all the unique elements from the dependent array @public */ var union = uniq; exports.union = union; /** A computed property which returns a new array with all the duplicated elements from two or more dependent arrays. Example ```javascript let obj = Ember.Object.extend({ friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends') }).create({ adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'], charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'] }); obj.get('friendsInCommon'); // ['William King', 'Mary Somerville'] ``` @method intersect @for Ember.computed @param {String} propertyKey* @return {Ember.ComputedProperty} computes a new array with all the duplicated elements from the dependent arrays @public */ function intersect() { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return multiArrayMacro(args, function (dependentKeys) { var _this3 = this; var arrays = dependentKeys.map(function (dependentKey) { var array = _emberMetal.get(_this3, dependentKey); return _emberRuntimeUtils.isArray(array) ? array : []; }); var results = arrays.pop().filter(function (candidate) { for (var i = 0; i < arrays.length; i++) { var found = false; var array = arrays[i]; for (var j = 0; j < array.length; j++) { if (array[j] === candidate) { found = true; break; } } if (found === false) { return false; } } return true; }); return _emberRuntimeSystemNative_array.A(results); }); } /** A computed property which returns a new array with all the properties from the first dependent array that are not in the second dependent array. Example ```javascript let Hamster = Ember.Object.extend({ likes: ['banana', 'grape', 'kale'], wants: Ember.computed.setDiff('likes', 'fruits') }); let hamster = Hamster.create({ fruits: [ 'grape', 'kale', ] }); hamster.get('wants'); // ['banana'] ``` @method setDiff @for Ember.computed @param {String} setAProperty @param {String} setBProperty @return {Ember.ComputedProperty} computes a new array with all the items from the first dependent array that are not in the second dependent array @public */ function setDiff(setAProperty, setBProperty) { if (arguments.length !== 2) { throw new _emberMetal.Error('setDiff requires exactly two dependent arrays.'); } return _emberMetal.computed(setAProperty + '.[]', setBProperty + '.[]', function () { var setA = this.get(setAProperty); var setB = this.get(setBProperty); if (!_emberRuntimeUtils.isArray(setA)) { return _emberRuntimeSystemNative_array.A(); } if (!_emberRuntimeUtils.isArray(setB)) { return _emberRuntimeSystemNative_array.A(setA); } return setA.filter(function (x) { return setB.indexOf(x) === -1; }); }).readOnly(); } /** A computed property that returns the array of values for the provided dependent properties. Example ```javascript let Hamster = Ember.Object.extend({ clothes: Ember.computed.collect('hat', 'shirt') }); let hamster = Hamster.create(); hamster.get('clothes'); // [null, null] hamster.set('hat', 'Camp Hat'); hamster.set('shirt', 'Camp Shirt'); hamster.get('clothes'); // ['Camp Hat', 'Camp Shirt'] ``` @method collect @for Ember.computed @param {String} dependentKey* @return {Ember.ComputedProperty} computed property which maps values of all passed in properties to an array. @public */ function collect() { for (var _len3 = arguments.length, dependentKeys = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { dependentKeys[_key3] = arguments[_key3]; } return multiArrayMacro(dependentKeys, function () { var properties = _emberMetal.getProperties(this, dependentKeys); var res = _emberRuntimeSystemNative_array.A(); for (var key in properties) { if (properties.hasOwnProperty(key)) { if (_emberMetal.isNone(properties[key])) { res.push(null); } else { res.push(properties[key]); } } } return res; }); } /** A computed property which returns a new array with all the properties from the first dependent array sorted based on a property or sort function. The callback method you provide should have the following signature: ```javascript function(itemA, itemB); ``` - `itemA` the first item to compare. - `itemB` the second item to compare. This function should return negative number (e.g. `-1`) when `itemA` should come before `itemB`. It should return positive number (e.g. `1`) when `itemA` should come after `itemB`. If the `itemA` and `itemB` are equal this function should return `0`. Therefore, if this function is comparing some numeric values, simple `itemA - itemB` or `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of series of `if`. Example ```javascript let ToDoList = Ember.Object.extend({ // using standard ascending sort todosSorting: ['name'], sortedTodos: Ember.computed.sort('todos', 'todosSorting'), // using descending sort todosSortingDesc: ['name:desc'], sortedTodosDesc: Ember.computed.sort('todos', 'todosSortingDesc'), // using a custom sort function priorityTodos: Ember.computed.sort('todos', function(a, b){ if (a.priority > b.priority) { return 1; } else if (a.priority < b.priority) { return -1; } return 0; }) }); let todoList = ToDoList.create({todos: [ { name: 'Unit Test', priority: 2 }, { name: 'Documentation', priority: 3 }, { name: 'Release', priority: 1 } ]}); todoList.get('sortedTodos'); // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }] todoList.get('sortedTodosDesc'); // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }] todoList.get('priorityTodos'); // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }] ``` @method sort @for Ember.computed @param {String} itemsKey @param {String or Function} sortDefinition a dependent key to an array of sort properties (add `:desc` to the arrays sort properties to sort descending) or a function to use when sorting @return {Ember.ComputedProperty} computes a new sorted array based on the sort property array or callback function @public */ function sort(itemsKey, sortDefinition) { if (typeof sortDefinition === 'function') { return customSort(itemsKey, sortDefinition); } else { return propertySort(itemsKey, sortDefinition); } } function customSort(itemsKey, comparator) { return arrayMacro(itemsKey, function (value) { var _this4 = this; return value.slice().sort(function (x, y) { return comparator.call(_this4, x, y); }); }); } // This one needs to dynamically set up and tear down observers on the itemsKey // depending on the sortProperties function propertySort(itemsKey, sortPropertiesKey) { var cp = new _emberMetal.ComputedProperty(function (key) { var _this5 = this; var itemsKeyIsAtThis = itemsKey === '@this'; var sortProperties = _emberMetal.get(this, sortPropertiesKey); var normalizedSortProperties = normalizeSortProperties(sortProperties); // Add/remove property observers as required. var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new _emberMetal.WeakMap()); var activeObservers = activeObserversMap.get(this); if (activeObservers) { activeObservers.forEach(function (args) { return _emberMetal.removeObserver.apply(null, args); }); } function sortPropertyDidChange() { this.notifyPropertyChange(key); } activeObservers = normalizedSortProperties.map(function (_ref) { var prop = _ref[0]; var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop; var args = [_this5, path, sortPropertyDidChange]; _emberMetal.addObserver.apply(null, args); return args; }); activeObserversMap.set(this, activeObservers); // Sort and return the array. var items = itemsKeyIsAtThis ? this : _emberMetal.get(this, itemsKey); if (_emberRuntimeUtils.isArray(items)) { return sortByNormalizedSortProperties(items, normalizedSortProperties); } else { return _emberRuntimeSystemNative_array.A(); } }); cp._activeObserverMap = undefined; return cp.property(sortPropertiesKey + '.[]').readOnly(); } function normalizeSortProperties(sortProperties) { return sortProperties.map(function (p) { var _p$split = p.split(':'); var prop = _p$split[0]; var direction = _p$split[1]; direction = direction || 'asc'; return [prop, direction]; }); } function sortByNormalizedSortProperties(items, normalizedSortProperties) { return _emberRuntimeSystemNative_array.A(items.slice().sort(function (itemA, itemB) { for (var i = 0; i < normalizedSortProperties.length; i++) { var _normalizedSortProperties$i = normalizedSortProperties[i]; var prop = _normalizedSortProperties$i[0]; var direction = _normalizedSortProperties$i[1]; var result = _emberRuntimeCompare.default(_emberMetal.get(itemA, prop), _emberMetal.get(itemB, prop)); if (result !== 0) { return direction === 'desc' ? -1 * result : result; } } return 0; })); } }); enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject, _emberRuntimeMixinsAction_handler) { 'use strict'; /** @module ember @submodule ember-runtime */ /** @class Controller @namespace Ember @extends Ember.Object @uses Ember.ControllerMixin @public */ var Controller = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsController.default); _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions(Controller); function controllerInjectionHelper(factory) {} /** Creates a property that lazily looks up another controller in the container. Can only be used when defining another controller. Example: ```javascript App.PostController = Ember.Controller.extend({ posts: Ember.inject.controller() }); ``` This example will create a `posts` property on the `post` controller that looks up the `posts` controller in the container, making it easy to reference other controllers. This is functionally equivalent to: ```javascript App.PostController = Ember.Controller.extend({ needs: 'posts', posts: Ember.computed.alias('controllers.posts') }); ``` @method controller @since 1.10.0 @for Ember.inject @param {String} name (optional) name of the controller to inject, defaults to the property's name @return {Ember.InjectedProperty} injection descriptor instance @public */ _emberRuntimeInject.createInjectionHelper('controller', controllerInjectionHelper); exports.default = Controller; }); enifed('ember-runtime/copy', ['exports', 'ember-metal', 'ember-runtime/system/object', 'ember-runtime/mixins/copyable'], function (exports, _emberMetal, _emberRuntimeSystemObject, _emberRuntimeMixinsCopyable) { 'use strict'; exports.default = copy; function _copy(obj, deep, seen, copies) { var ret = undefined, loc = undefined, key = undefined; // primitive data types are immutable, just return them. if (typeof obj !== 'object' || obj === null) { return obj; } // avoid cyclical loops if (deep && (loc = seen.indexOf(obj)) >= 0) { return copies[loc]; } // IMPORTANT: this specific test will detect a native array only. Any other // object will need to implement Copyable. if (Array.isArray(obj)) { ret = obj.slice(); if (deep) { loc = ret.length; while (--loc >= 0) { ret[loc] = _copy(ret[loc], deep, seen, copies); } } } else if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { ret = obj.copy(deep, seen, copies); } else if (obj instanceof Date) { ret = new Date(obj.getTime()); } else { ret = {}; for (key in obj) { // support Null prototype if (!Object.prototype.hasOwnProperty.call(obj, key)) { continue; } // Prevents browsers that don't respect non-enumerability from // copying internal Ember properties if (key.substring(0, 2) === '__') { continue; } ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key]; } } if (deep) { seen.push(obj); copies.push(ret); } return ret; } /** Creates a shallow copy of the passed object. A deep copy of the object is returned if the optional `deep` argument is `true`. If the passed object implements the `Ember.Copyable` interface, then this function will delegate to the object's `copy()` method and return the result. See `Ember.Copyable` for further details. For primitive values (which are immutable in JavaScript), the passed object is simply returned. @method copy @for Ember @param {Object} obj The object to clone @param {Boolean} [deep=false] If true, a deep copy of the object is made. @return {Object} The copied object @public */ function copy(obj, deep) { // fast paths if ('object' !== typeof obj || obj === null) { return obj; // can't copy primitives } if (_emberRuntimeMixinsCopyable.default && _emberRuntimeMixinsCopyable.default.detect(obj)) { return obj.copy(deep); } return _copy(obj, deep, deep ? [] : null, deep ? [] : null); } }); enifed('ember-runtime/ext/function', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { /** @module ember @submodule ember-runtime */ 'use strict'; var a_slice = Array.prototype.slice; var FunctionPrototype = Function.prototype; if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Function) { /** The `property` extension of Javascript's Function prototype is available when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is `true`, which is the default. Computed properties allow you to treat a function like a property: ```javascript MyApp.President = Ember.Object.extend({ firstName: '', lastName: '', fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); }.property() // Call this flag to mark the function as a property }); let president = MyApp.President.create({ firstName: 'Barack', lastName: 'Obama' }); president.get('fullName'); // 'Barack Obama' ``` Treating a function like a property is useful because they can work with bindings, just like any other property. Many computed properties have dependencies on other properties. For example, in the above example, the `fullName` property depends on `firstName` and `lastName` to determine its value. You can tell Ember about these dependencies like this: ```javascript MyApp.President = Ember.Object.extend({ firstName: '', lastName: '', fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); // Tell Ember.js that this computed property depends on firstName // and lastName }.property('firstName', 'lastName') }); ``` Make sure you list these dependencies so Ember knows when to update bindings that connect to a computed property. Changing a dependency will not immediately trigger an update of the computed property, but will instead clear the cache so that it is updated when the next `get` is called on the property. See [Ember.ComputedProperty](/api/classes/Ember.ComputedProperty.html), [Ember.computed](/api/classes/Ember.computed.html). @method property @for Function @public */ FunctionPrototype.property = function () { var ret = _emberMetal.computed(this); // ComputedProperty.prototype.property expands properties; no need for us to // do so here. return ret.property.apply(ret, arguments); }; /** The `observes` extension of Javascript's Function prototype is available when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default. You can observe property changes simply by adding the `observes` call to the end of your method declarations in classes that you write. For example: ```javascript Ember.Object.extend({ valueObserver: function() { // Executes whenever the "value" property changes }.observes('value') }); ``` In the future this method may become asynchronous. See `Ember.observer`. @method observes @for Function @public */ FunctionPrototype.observes = function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } args.push(this); return _emberMetal.observer.apply(this, args); }; FunctionPrototype._observesImmediately = function () { // observes handles property expansion return this.observes.apply(this, arguments); }; /** The `observesImmediately` extension of Javascript's Function prototype is available when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default. You can observe property changes simply by adding the `observesImmediately` call to the end of your method declarations in classes that you write. For example: ```javascript Ember.Object.extend({ valueObserver: function() { // Executes immediately after the "value" property changes }.observesImmediately('value') }); ``` In the future, `observes` may become asynchronous. In this event, `observesImmediately` will maintain the synchronous behavior. See `Ember.immediateObserver`. @method observesImmediately @for Function @deprecated @private */ FunctionPrototype.observesImmediately = _emberMetal.deprecateFunc('Function#observesImmediately is deprecated. Use Function#observes instead', { id: 'ember-runtime.ext-function', until: '3.0.0' }, FunctionPrototype._observesImmediately); /** The `on` extension of Javascript's Function prototype is available when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default. You can listen for events simply by adding the `on` call to the end of your method declarations in classes or mixins that you write. For example: ```javascript Ember.Mixin.create({ doSomethingWithElement: function() { // Executes whenever the "didInsertElement" event fires }.on('didInsertElement') }); ``` See `Ember.on`. @method on @for Function @public */ FunctionPrototype.on = function () { var events = a_slice.call(arguments); this.__ember_listens__ = events; return this; }; } }); enifed('ember-runtime/ext/rsvp', ['exports', 'rsvp', 'ember-metal'], function (exports, _rsvp, _emberMetal) { 'use strict'; exports.onerrorDefault = onerrorDefault; var backburner = _emberMetal.run.backburner; _emberMetal.run._addQueue('rsvpAfter', 'destroy'); _rsvp.configure('async', function (callback, promise) { backburner.schedule('actions', null, callback, promise); }); _rsvp.configure('after', function (cb) { backburner.schedule('rsvpAfter', null, cb); }); _rsvp.on('error', onerrorDefault); function onerrorDefault(reason) { var error = errorFor(reason); if (error) { _emberMetal.dispatchError(error); } } function errorFor(reason) { if (!reason) return; if (reason.errorThrown) { return unwrapErrorThrown(reason); } if (reason.name === 'UnrecognizedURLError') { return; } if (reason.name === 'TransitionAborted') { return; } return reason; } function unwrapErrorThrown(reason) { var error = reason.errorThrown; if (typeof error === 'string') { error = new Error(error); } Object.defineProperty(error, '__reason_with_error_thrown__', { value: reason, enumerable: false }); return error; } exports.default = _rsvp; }); enifed('ember-runtime/ext/string', ['exports', 'ember-environment', 'ember-runtime/system/string'], function (exports, _emberEnvironment, _emberRuntimeSystemString) { /** @module ember @submodule ember-runtime */ 'use strict'; var StringPrototype = String.prototype; if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { /** See [Ember.String.fmt](/api/classes/Ember.String.html#method_fmt). @method fmt @for String @private @deprecated */ StringPrototype.fmt = function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _emberRuntimeSystemString.fmt(this, args); }; /** See [Ember.String.w](/api/classes/Ember.String.html#method_w). @method w @for String @private */ StringPrototype.w = function () { return _emberRuntimeSystemString.w(this); }; /** See [Ember.String.loc](/api/classes/Ember.String.html#method_loc). @method loc @for String @private */ StringPrototype.loc = function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return _emberRuntimeSystemString.loc(this, args); }; /** See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize). @method camelize @for String @private */ StringPrototype.camelize = function () { return _emberRuntimeSystemString.camelize(this); }; /** See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize). @method decamelize @for String @private */ StringPrototype.decamelize = function () { return _emberRuntimeSystemString.decamelize(this); }; /** See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize). @method dasherize @for String @private */ StringPrototype.dasherize = function () { return _emberRuntimeSystemString.dasherize(this); }; /** See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore). @method underscore @for String @private */ StringPrototype.underscore = function () { return _emberRuntimeSystemString.underscore(this); }; /** See [Ember.String.classify](/api/classes/Ember.String.html#method_classify). @method classify @for String @private */ StringPrototype.classify = function () { return _emberRuntimeSystemString.classify(this); }; /** See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize). @method capitalize @for String @private */ StringPrototype.capitalize = function () { return _emberRuntimeSystemString.capitalize(this); }; } }); enifed('ember-runtime/index', ['exports', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/system/object', 'ember-runtime/system/string', 'ember-runtime/mixins/registry_proxy', 'ember-runtime/mixins/container_proxy', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/compare', 'ember-runtime/is-equal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/system/namespace', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/target_action_support', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/computed/computed_macros', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeSystemObject, _emberRuntimeSystemString, _emberRuntimeMixinsRegistry_proxy, _emberRuntimeMixinsContainer_proxy, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeCompare, _emberRuntimeIsEqual, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeSystemNamespace, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsObservable, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedComputed_macros, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeUtils, _emberRuntimeString_registry) { /** @module ember @submodule ember-runtime */ 'use strict'; exports.Object = _emberRuntimeSystemObject.default; exports.String = _emberRuntimeSystemString.default; exports.RegistryProxyMixin = _emberRuntimeMixinsRegistry_proxy.default; exports.buildFakeRegistryWithDeprecations = _emberRuntimeMixinsRegistry_proxy.buildFakeRegistryWithDeprecations; exports.ContainerProxyMixin = _emberRuntimeMixinsContainer_proxy.default; exports.copy = _emberRuntimeCopy.default; exports.inject = _emberRuntimeInject.default; exports.compare = _emberRuntimeCompare.default; exports.isEqual = _emberRuntimeIsEqual.default; exports.Array = _emberRuntimeMixinsArray.default; exports.objectAt = _emberRuntimeMixinsArray.objectAt; exports.isEmberArray = _emberRuntimeMixinsArray.isEmberArray; exports.addArrayObserver = _emberRuntimeMixinsArray.addArrayObserver; exports.removeArrayObserver = _emberRuntimeMixinsArray.removeArrayObserver; exports.Comparable = _emberRuntimeMixinsComparable.default; exports.Namespace = _emberRuntimeSystemNamespace.default; exports.isNamespaceSearchDisabled = _emberRuntimeSystemNamespace.isSearchDisabled; exports.setNamespaceSearchDisabled = _emberRuntimeSystemNamespace.setSearchDisabled; exports.ArrayProxy = _emberRuntimeSystemArray_proxy.default; exports.ObjectProxy = _emberRuntimeSystemObject_proxy.default; exports.CoreObject = _emberRuntimeSystemCore_object.default; exports.POST_INIT = _emberRuntimeSystemCore_object.POST_INIT; exports.NativeArray = _emberRuntimeSystemNative_array.default; exports.A = _emberRuntimeSystemNative_array.A; exports.ActionHandler = _emberRuntimeMixinsAction_handler.default; exports.deprecateUnderscoreActions = _emberRuntimeMixinsAction_handler.deprecateUnderscoreActions; exports.Copyable = _emberRuntimeMixinsCopyable.default; exports.Enumerable = _emberRuntimeMixinsEnumerable.default; exports.Freezable = _emberRuntimeMixinsFreezable.Freezable; exports.FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR; exports._ProxyMixin = _emberRuntimeMixinsProxy.default; exports.isProxy = _emberRuntimeMixinsProxy.isProxy; exports.onLoad = _emberRuntimeSystemLazy_load.onLoad; exports.runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks; exports._loaded = _emberRuntimeSystemLazy_load._loaded; exports.Observable = _emberRuntimeMixinsObservable.default; exports.MutableEnumerable = _emberRuntimeMixinsMutable_enumerable.default; exports.MutableArray = _emberRuntimeMixinsMutable_array.default; exports.removeAt = _emberRuntimeMixinsMutable_array.removeAt; exports.TargetActionSupport = _emberRuntimeMixinsTarget_action_support.default; exports.Evented = _emberRuntimeMixinsEvented.default; exports.PromiseProxyMixin = _emberRuntimeMixinsPromise_proxy.default; exports.empty = _emberRuntimeComputedComputed_macros.empty; exports.notEmpty = _emberRuntimeComputedComputed_macros.notEmpty; exports.none = _emberRuntimeComputedComputed_macros.none; exports.not = _emberRuntimeComputedComputed_macros.not; exports.bool = _emberRuntimeComputedComputed_macros.bool; exports.match = _emberRuntimeComputedComputed_macros.match; exports.equal = _emberRuntimeComputedComputed_macros.equal; exports.gt = _emberRuntimeComputedComputed_macros.gt; exports.gte = _emberRuntimeComputedComputed_macros.gte; exports.lt = _emberRuntimeComputedComputed_macros.lt; exports.lte = _emberRuntimeComputedComputed_macros.lte; exports.oneWay = _emberRuntimeComputedComputed_macros.oneWay; exports.readOnly = _emberRuntimeComputedComputed_macros.readOnly; exports.defaultTo = _emberRuntimeComputedComputed_macros.defaultTo; exports.deprecatingAlias = _emberRuntimeComputedComputed_macros.deprecatingAlias; exports.and = _emberRuntimeComputedComputed_macros.and; exports.or = _emberRuntimeComputedComputed_macros.or; exports.any = _emberRuntimeComputedComputed_macros.any; exports.sum = _emberRuntimeComputedReduce_computed_macros.sum; exports.min = _emberRuntimeComputedReduce_computed_macros.min; exports.max = _emberRuntimeComputedReduce_computed_macros.max; exports.map = _emberRuntimeComputedReduce_computed_macros.map; exports.sort = _emberRuntimeComputedReduce_computed_macros.sort; exports.setDiff = _emberRuntimeComputedReduce_computed_macros.setDiff; exports.mapBy = _emberRuntimeComputedReduce_computed_macros.mapBy; exports.filter = _emberRuntimeComputedReduce_computed_macros.filter; exports.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy; exports.uniq = _emberRuntimeComputedReduce_computed_macros.uniq; exports.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy; exports.union = _emberRuntimeComputedReduce_computed_macros.union; exports.intersect = _emberRuntimeComputedReduce_computed_macros.intersect; exports.collect = _emberRuntimeComputedReduce_computed_macros.collect; exports.Controller = _emberRuntimeControllersController.default; exports.ControllerMixin = _emberRuntimeMixinsController.default; exports.Service = _emberRuntimeSystemService.default; exports.RSVP = _emberRuntimeExtRsvp.default; exports.onerrorDefault = _emberRuntimeExtRsvp.onerrorDefault; // just for side effect of extending Ember.RSVP exports.isArray = _emberRuntimeUtils.isArray; exports.typeOf = _emberRuntimeUtils.typeOf; exports.getStrings = _emberRuntimeString_registry.getStrings; exports.setStrings = _emberRuntimeString_registry.setStrings; }); // just for side effect of extending String.prototype // just for side effect of extending Function.prototype enifed('ember-runtime/inject', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; exports.default = inject; exports.createInjectionHelper = createInjectionHelper; exports.validatePropertyInjections = validatePropertyInjections; /** Namespace for injection helper methods. @class inject @namespace Ember @static @public */ function inject() {} // Dictionary of injection validations by type, added to by `createInjectionHelper` var typeValidators = {}; /** This method allows other Ember modules to register injection helpers for a given container type. Helpers are exported to the `inject` namespace as the container type itself. @private @method createInjectionHelper @since 1.10.0 @for Ember @param {String} type The container type the helper will inject @param {Function} validator A validation callback that is executed at mixin-time */ function createInjectionHelper(type, validator) { typeValidators[type] = validator; inject[type] = function (name) { return new _emberMetal.InjectedProperty(type, name); }; } /** Validation function that runs per-type validation functions once for each injected type encountered. @private @method validatePropertyInjections @since 1.10.0 @for Ember @param {Object} factory The factory object */ function validatePropertyInjections(factory) { var proto = factory.proto(); var types = []; for (var key in proto) { var desc = proto[key]; if (desc instanceof _emberMetal.InjectedProperty && types.indexOf(desc.type) === -1) { types.push(desc.type); } } if (types.length) { for (var i = 0; i < types.length; i++) { var validator = typeValidators[types[i]]; if (typeof validator === 'function') { validator(factory); } } } return true; } }); enifed('ember-runtime/is-equal', ['exports'], function (exports) { /** Compares two objects, returning true if they are equal. ```javascript Ember.isEqual('hello', 'hello'); // true Ember.isEqual(1, 2); // false ``` `isEqual` is a more specific comparison than a triple equal comparison. It will call the `isEqual` instance method on the objects being compared, allowing finer control over when objects should be considered equal to each other. ```javascript let Person = Ember.Object.extend({ isEqual(other) { return this.ssn == other.ssn; } }); let personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'}); let personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'}); Ember.isEqual(personA, personB); // true ``` Due to the expense of array comparisons, collections will never be equal to each other even if each of their items are equal to each other. ```javascript Ember.isEqual([4, 2], [4, 2]); // false ``` @method isEqual @for Ember @param {Object} a first object to compare @param {Object} b second object to compare @return {Boolean} @public */ 'use strict'; exports.default = isEqual; function isEqual(a, b) { if (a && typeof a.isEqual === 'function') { return a.isEqual(b); } if (a instanceof Date && b instanceof Date) { return a.getTime() === b.getTime(); } return a === b; } }); enifed('ember-runtime/mixins/-proxy', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros', 'ember-runtime/system/core_object', 'require'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros, _emberRuntimeSystemCore_object, _require2) { /** @module ember @submodule ember-runtime */ 'use strict'; var _PROXY_MIXIN_PROPS; exports.isProxy = isProxy; var hasGlimmer = _require2.has('glimmer-reference'); var IS_PROXY = _emberMetal.symbol('IS_PROXY'); function isProxy(value) { return typeof value === 'object' && value && value[IS_PROXY]; } function contentPropertyWillChange(content, contentKey) { var key = contentKey.slice(8); // remove "content." if (key in this) { return; } // if shadowed in proxy _emberMetal.propertyWillChange(this, key); } function contentPropertyDidChange(content, contentKey) { var key = contentKey.slice(8); // remove "content." if (key in this) { return; } // if shadowed in proxy _emberMetal.propertyDidChange(this, key); } /** `Ember.ProxyMixin` forwards all properties not defined by the proxy itself to a proxied `content` object. See Ember.ObjectProxy for more details. @class ProxyMixin @namespace Ember @private */ var PROXY_MIXIN_PROPS = (_PROXY_MIXIN_PROPS = {}, _PROXY_MIXIN_PROPS[IS_PROXY] = true, _PROXY_MIXIN_PROPS.content = null, _PROXY_MIXIN_PROPS._contentDidChange = _emberMetal.observer('content', function () {}), _PROXY_MIXIN_PROPS.isTruthy = _emberRuntimeComputedComputed_macros.bool('content'), _PROXY_MIXIN_PROPS._debugContainerKey = null, _PROXY_MIXIN_PROPS.willWatchProperty = function (key) { var contentKey = 'content.' + key; _emberMetal._addBeforeObserver(this, contentKey, null, contentPropertyWillChange); _emberMetal.addObserver(this, contentKey, null, contentPropertyDidChange); }, _PROXY_MIXIN_PROPS.didUnwatchProperty = function (key) { var contentKey = 'content.' + key; _emberMetal._removeBeforeObserver(this, contentKey, null, contentPropertyWillChange); _emberMetal.removeObserver(this, contentKey, null, contentPropertyDidChange); }, _PROXY_MIXIN_PROPS.unknownProperty = function (key) { var content = _emberMetal.get(this, 'content'); if (content) { return _emberMetal.get(content, key); } }, _PROXY_MIXIN_PROPS.setUnknownProperty = function (key, value) { var m = _emberMetal.meta(this); if (m.proto === this) { // if marked as prototype then just defineProperty // rather than delegate _emberMetal.defineProperty(this, key, null, value); return value; } var content = _emberMetal.get(this, 'content'); return _emberMetal.set(content, key, value); }, _PROXY_MIXIN_PROPS); if (hasGlimmer) { (function () { var _require = _require2.default('glimmer-reference'); var CachedTag = _require.CachedTag; var DirtyableTag = _require.DirtyableTag; var UpdatableTag = _require.UpdatableTag; var ProxyTag = (function (_CachedTag) { babelHelpers.inherits(ProxyTag, _CachedTag); function ProxyTag(proxy, content) { _CachedTag.call(this); this.proxyWrapperTag = new DirtyableTag(); this.proxyContentTag = new UpdatableTag(_emberMetal.tagFor(content)); } ProxyTag.prototype.compute = function compute() { return Math.max(this.proxyWrapperTag.value(), this.proxyContentTag.value()); }; ProxyTag.prototype.dirty = function dirty() { this.proxyWrapperTag.dirty(); }; ProxyTag.prototype.contentDidChange = function contentDidChange(content) { this.proxyContentTag.update(_emberMetal.tagFor(content)); }; return ProxyTag; })(CachedTag); PROXY_MIXIN_PROPS[_emberRuntimeSystemCore_object.POST_INIT] = function postInit() { this._super(); _emberMetal.meta(this)._tag = new ProxyTag(this, _emberMetal.get(this, 'content')); }; PROXY_MIXIN_PROPS._contentDidChange = _emberMetal.observer('content', function () { _emberMetal.meta(this)._tag.contentDidChange(_emberMetal.get(this, 'content')); }); })(); } exports.default = _emberMetal.Mixin.create(PROXY_MIXIN_PROPS); }); /** The object whose properties will be forwarded. @property content @type Ember.Object @default null @private */ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-runtime */ 'use strict'; exports.deprecateUnderscoreActions = deprecateUnderscoreActions; /** `Ember.ActionHandler` is available on some familiar classes including `Ember.Route`, `Ember.Component`, and `Ember.Controller`. (Internally the mixin is used by `Ember.CoreView`, `Ember.ControllerMixin`, and `Ember.Route` and available to the above classes through inheritance.) @class ActionHandler @namespace Ember @private */ var ActionHandler = _emberMetal.Mixin.create({ mergedProperties: ['actions'], /** The collection of functions, keyed by name, available on this `ActionHandler` as action targets. These functions will be invoked when a matching `{{action}}` is triggered from within a template and the application's current route is this route. Actions can also be invoked from other parts of your application via `ActionHandler#send`. The `actions` hash will inherit action handlers from the `actions` hash defined on extended parent classes or mixins rather than just replace the entire hash, e.g.: ```js App.CanDisplayBanner = Ember.Mixin.create({ actions: { displayBanner(msg) { // ... } } }); App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, { actions: { playMusic() { // ... } } }); // `WelcomeRoute`, when active, will be able to respond // to both actions, since the actions hash is merged rather // then replaced when extending mixins / parent classes. this.send('displayBanner'); this.send('playMusic'); ``` Within a Controller, Route or Component's action handler, the value of the `this` context is the Controller, Route or Component object: ```js App.SongRoute = Ember.Route.extend({ actions: { myAction() { this.controllerFor("song"); this.transitionTo("other.route"); ... } } }); ``` It is also possible to call `this._super(...arguments)` from within an action handler if it overrides a handler defined on a parent class or mixin: Take for example the following routes: ```js App.DebugRoute = Ember.Mixin.create({ actions: { debugRouteInformation() { console.debug("trololo"); } } }); App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, { actions: { debugRouteInformation() { // also call the debugRouteInformation of mixed in App.DebugRoute this._super(...arguments); // show additional annoyance window.alert(...); } } }); ``` ## Bubbling By default, an action will stop bubbling once a handler defined on the `actions` hash handles it. To continue bubbling the action, you must return `true` from the handler: ```js App.Router.map(function() { this.route("album", function() { this.route("song"); }); }); App.AlbumRoute = Ember.Route.extend({ actions: { startPlaying: function() { } } }); App.AlbumSongRoute = Ember.Route.extend({ actions: { startPlaying() { // ... if (actionShouldAlsoBeTriggeredOnParentRoute) { return true; } } } }); ``` @property actions @type Object @default null @public */ /** Triggers a named action on the `ActionHandler`. Any parameters supplied after the `actionName` string will be passed as arguments to the action target function. If the `ActionHandler` has its `target` property set, actions may bubble to the `target`. Bubbling happens when an `actionName` can not be found in the `ActionHandler`'s `actions` hash or if the action target function returns `true`. Example ```js App.WelcomeRoute = Ember.Route.extend({ actions: { playTheme() { this.send('playMusic', 'theme.mp3'); }, playMusic(track) { // ... } } }); ``` @method send @param {String} actionName The action to trigger @param {*} context a context to send with the action @public */ send: function (actionName) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var target = undefined; if (this.actions && this.actions[actionName]) { var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { return; } } if (target = _emberMetal.get(this, 'target')) { var _target; (_target = target).send.apply(_target, arguments); } }, willMergeMixin: function (props) { if (props._actions) { props.actions = props._actions; delete props._actions; } } }); exports.default = ActionHandler; function deprecateUnderscoreActions(factory) { Object.defineProperty(factory.prototype, '_actions', { configurable: true, enumerable: false, set: function (value) {}, get: function () { return _emberMetal.get(this, 'actions'); } }); } }); enifed('ember-runtime/mixins/array', ['exports', 'ember-metal', 'ember-runtime/mixins/enumerable', 'ember-runtime/system/each_proxy'], function (exports, _emberMetal, _emberRuntimeMixinsEnumerable, _emberRuntimeSystemEach_proxy) { /** @module ember @submodule ember-runtime */ // .......................................................... // HELPERS // 'use strict'; var _Mixin$create; exports.addArrayObserver = addArrayObserver; exports.removeArrayObserver = removeArrayObserver; exports.objectAt = objectAt; exports.arrayContentWillChange = arrayContentWillChange; exports.arrayContentDidChange = arrayContentDidChange; exports.isEmberArray = isEmberArray; function arrayObserversHelper(obj, target, opts, operation, notify) { var willChange = opts && opts.willChange || 'arrayWillChange'; var didChange = opts && opts.didChange || 'arrayDidChange'; var hasObservers = _emberMetal.get(obj, 'hasArrayObservers'); if (hasObservers === notify) { _emberMetal.propertyWillChange(obj, 'hasArrayObservers'); } operation(obj, '@array:before', target, willChange); operation(obj, '@array:change', target, didChange); if (hasObservers === notify) { _emberMetal.propertyDidChange(obj, 'hasArrayObservers'); } return obj; } function addArrayObserver(array, target, opts) { return arrayObserversHelper(array, target, opts, _emberMetal.addListener, false); } function removeArrayObserver(array, target, opts) { return arrayObserversHelper(array, target, opts, _emberMetal.removeListener, true); } function objectAt(content, idx) { if (content.objectAt) { return content.objectAt(idx); } return content[idx]; } function arrayContentWillChange(array, startIdx, removeAmt, addAmt) { var removing = undefined, lim = undefined; // if no args are passed assume everything changes if (startIdx === undefined) { startIdx = 0; removeAmt = addAmt = -1; } else { if (removeAmt === undefined) { removeAmt = -1; } if (addAmt === undefined) { addAmt = -1; } } if (array.__each) { array.__each.arrayWillChange(array, startIdx, removeAmt, addAmt); } _emberMetal.sendEvent(array, '@array:before', [array, startIdx, removeAmt, addAmt]); if (startIdx >= 0 && removeAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { removing = []; lim = startIdx + removeAmt; for (var idx = startIdx; idx < lim; idx++) { removing.push(objectAt(array, idx)); } } else { removing = removeAmt; } array.enumerableContentWillChange(removing, addAmt); return array; } function arrayContentDidChange(array, startIdx, removeAmt, addAmt) { _emberMetal.markObjectAsDirty(_emberMetal.meta(array)); // if no args are passed assume everything changes if (startIdx === undefined) { startIdx = 0; removeAmt = addAmt = -1; } else { if (removeAmt === undefined) { removeAmt = -1; } if (addAmt === undefined) { addAmt = -1; } } var adding = undefined; if (startIdx >= 0 && addAmt >= 0 && _emberMetal.get(array, 'hasEnumerableObservers')) { adding = []; var lim = startIdx + addAmt; for (var idx = startIdx; idx < lim; idx++) { adding.push(objectAt(array, idx)); } } else { adding = addAmt; } array.enumerableContentDidChange(removeAmt, adding); if (array.__each) { array.__each.arrayDidChange(array, startIdx, removeAmt, addAmt); } _emberMetal.sendEvent(array, '@array:change', [array, startIdx, removeAmt, addAmt]); var length = _emberMetal.get(array, 'length'); var cachedFirst = _emberMetal.cacheFor(array, 'firstObject'); var cachedLast = _emberMetal.cacheFor(array, 'lastObject'); if (objectAt(array, 0) !== cachedFirst) { _emberMetal.propertyWillChange(array, 'firstObject'); _emberMetal.propertyDidChange(array, 'firstObject'); } if (objectAt(array, length - 1) !== cachedLast) { _emberMetal.propertyWillChange(array, 'lastObject'); _emberMetal.propertyDidChange(array, 'lastObject'); } return array; } var EMBER_ARRAY = _emberMetal.symbol('EMBER_ARRAY'); function isEmberArray(obj) { return obj && !!obj[EMBER_ARRAY]; } // .......................................................... // ARRAY // /** This mixin implements Observer-friendly Array-like behavior. It is not a concrete implementation, but it can be used up by other classes that want to appear like arrays. For example, ArrayProxy is a concrete classes that can be instantiated to implement array-like behavior. Both of these classes use the Array Mixin by way of the MutableArray mixin, which allows observable changes to be made to the underlying array. Unlike `Ember.Enumerable,` this mixin defines methods specifically for collections that provide index-ordered access to their contents. When you are designing code that needs to accept any kind of Array-like object, you should use these methods instead of Array primitives because these will properly notify observers of changes to the array. Although these methods are efficient, they do add a layer of indirection to your application so it is a good idea to use them only when you need the flexibility of using both true JavaScript arrays and "virtual" arrays such as controllers and collections. You can use the methods defined in this module to access and modify array contents in a KVO-friendly way. You can also be notified whenever the membership of an array changes by using `.observes('myArray.[]')`. To support `Ember.Array` in your own class, you must override two primitives to use it: `length()` and `objectAt()`. Note that the Ember.Array mixin also incorporates the `Ember.Enumerable` mixin. All `Ember.Array`-like objects are also enumerable. @class Array @namespace Ember @uses Ember.Enumerable @since Ember 0.9.0 @public */ var ArrayMixin = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, (_Mixin$create = {}, _Mixin$create[EMBER_ARRAY] = true, _Mixin$create.length = null, _Mixin$create.objectAt = function (idx) { if (idx < 0 || idx >= _emberMetal.get(this, 'length')) { return undefined; } return _emberMetal.get(this, idx); }, _Mixin$create.objectsAt = function (indexes) { var _this = this; return indexes.map(function (idx) { return objectAt(_this, idx); }); }, _Mixin$create.nextObject = function (idx) { return objectAt(this, idx); }, _Mixin$create['[]'] = _emberMetal.computed({ get: function (key) { return this; }, set: function (key, value) { this.replace(0, _emberMetal.get(this, 'length'), value); return this; } }), _Mixin$create.firstObject = _emberMetal.computed(function () { return objectAt(this, 0); }).readOnly(), _Mixin$create.lastObject = _emberMetal.computed(function () { return objectAt(this, _emberMetal.get(this, 'length') - 1); }).readOnly(), _Mixin$create.contains = function (obj) { if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) {} return this.indexOf(obj) >= 0; }, _Mixin$create.slice = function (beginIndex, endIndex) { var ret = _emberMetal.default.A(); var length = _emberMetal.get(this, 'length'); if (_emberMetal.isNone(beginIndex)) { beginIndex = 0; } if (_emberMetal.isNone(endIndex) || endIndex > length) { endIndex = length; } if (beginIndex < 0) { beginIndex = length + beginIndex; } if (endIndex < 0) { endIndex = length + endIndex; } while (beginIndex < endIndex) { ret[ret.length] = objectAt(this, beginIndex++); } return ret; }, _Mixin$create.indexOf = function (object, startAt) { var len = _emberMetal.get(this, 'length'); if (startAt === undefined) { startAt = 0; } if (startAt < 0) { startAt += len; } for (var idx = startAt; idx < len; idx++) { if (objectAt(this, idx) === object) { return idx; } } return -1; }, _Mixin$create.lastIndexOf = function (object, startAt) { var len = _emberMetal.get(this, 'length'); if (startAt === undefined || startAt >= len) { startAt = len - 1; } if (startAt < 0) { startAt += len; } for (var idx = startAt; idx >= 0; idx--) { if (objectAt(this, idx) === object) { return idx; } } return -1; }, _Mixin$create.addArrayObserver = function (target, opts) { return addArrayObserver(this, target, opts); }, _Mixin$create.removeArrayObserver = function (target, opts) { return removeArrayObserver(this, target, opts); }, _Mixin$create.hasArrayObservers = _emberMetal.computed(function () { return _emberMetal.hasListeners(this, '@array:change') || _emberMetal.hasListeners(this, '@array:before'); }), _Mixin$create.arrayContentWillChange = function (startIdx, removeAmt, addAmt) { return arrayContentWillChange(this, startIdx, removeAmt, addAmt); }, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) { return arrayContentDidChange(this, startIdx, removeAmt, addAmt); }, _Mixin$create['@each'] = _emberMetal.computed(function () { // TODO use Symbol or add to meta if (!this.__each) { this.__each = new _emberRuntimeSystemEach_proxy.default(this); } return this.__each; }).volatile(), _Mixin$create)); if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) { ArrayMixin.reopen({ /** Returns `true` if the passed object can be found in the array. This method is a Polyfill for ES 2016 Array.includes. If no `startAt` argument is given, the starting location to search is 0. If it's negative, searches from the index of `this.length + startAt` by asc. ```javascript [1, 2, 3].includes(2); // true [1, 2, 3].includes(4); // false [1, 2, 3].includes(3, 2); // true [1, 2, 3].includes(3, 3); // false [1, 2, 3].includes(3, -1); // true [1, 2, 3].includes(1, -1); // false [1, 2, 3].includes(1, -4); // true [1, 2, NaN].includes(NaN); // true ``` @method includes @param {Object} obj The object to search for. @param {Number} startAt optional starting location to search, default 0 @return {Boolean} `true` if object is found in the array. @public */ includes: function (obj, startAt) { var len = _emberMetal.get(this, 'length'); if (startAt === undefined) { startAt = 0; } if (startAt < 0) { startAt += len; } for (var idx = startAt; idx < len; idx++) { var currentObj = objectAt(this, idx); // SameValueZero comparison (NaN !== NaN) if (obj === currentObj || obj !== obj && currentObj !== currentObj) { return true; } } return false; } }); } exports.default = ArrayMixin; }); // ES6TODO: Ember.A /** __Required.__ You must implement this method to apply this mixin. Your array must support the `length` property. Your replace methods should set this property whenever it changes. @property {Number} length @public */ /** Returns the object at the given `index`. If the given `index` is negative or is greater or equal than the array length, returns `undefined`. This is one of the primitives you must implement to support `Ember.Array`. If your object supports retrieving the value of an array item using `get()` (i.e. `myArray.get(0)`), then you do not need to implement this method yourself. ```javascript let arr = ['a', 'b', 'c', 'd']; arr.objectAt(0); // 'a' arr.objectAt(3); // 'd' arr.objectAt(-1); // undefined arr.objectAt(4); // undefined arr.objectAt(5); // undefined ``` @method objectAt @param {Number} idx The index of the item to return. @return {*} item at index or undefined @public */ /** This returns the objects at the specified indexes, using `objectAt`. ```javascript let arr = ['a', 'b', 'c', 'd']; arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c'] arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined] ``` @method objectsAt @param {Array} indexes An array of indexes of items to return. @return {Array} @public */ // overrides Ember.Enumerable version /** This is the handler for the special array content property. If you get this property, it will return this. If you set this property to a new array, it will replace the current content. This property overrides the default property defined in `Ember.Enumerable`. @property [] @return this @public */ // optimized version from Enumerable // Add any extra methods to Ember.Array that are native to the built-in Array. /** Returns a new array that is a slice of the receiver. This implementation uses the observable array methods to retrieve the objects for the new slice. ```javascript let arr = ['red', 'green', 'blue']; arr.slice(0); // ['red', 'green', 'blue'] arr.slice(0, 2); // ['red', 'green'] arr.slice(1, 100); // ['green', 'blue'] ``` @method slice @param {Number} beginIndex (Optional) index to begin slicing from. @param {Number} endIndex (Optional) index to end the slice at (but not included). @return {Array} New array with specified slice @public */ /** Returns the index of the given object's first occurrence. If no `startAt` argument is given, the starting location to search is 0. If it's negative, will count backward from the end of the array. Returns -1 if no match is found. ```javascript let arr = ['a', 'b', 'c', 'd', 'a']; arr.indexOf('a'); // 0 arr.indexOf('z'); // -1 arr.indexOf('a', 2); // 4 arr.indexOf('a', -1); // 4 arr.indexOf('b', 3); // -1 arr.indexOf('a', 100); // -1 ``` @method indexOf @param {Object} object the item to search for @param {Number} startAt optional starting location to search, default 0 @return {Number} index or -1 if not found @public */ /** Returns the index of the given object's last occurrence. If no `startAt` argument is given, the search starts from the last position. If it's negative, will count backward from the end of the array. Returns -1 if no match is found. ```javascript let arr = ['a', 'b', 'c', 'd', 'a']; arr.lastIndexOf('a'); // 4 arr.lastIndexOf('z'); // -1 arr.lastIndexOf('a', 2); // 0 arr.lastIndexOf('a', -1); // 4 arr.lastIndexOf('b', 3); // 1 arr.lastIndexOf('a', 100); // 4 ``` @method lastIndexOf @param {Object} object the item to search for @param {Number} startAt optional starting location to search, default 0 @return {Number} index or -1 if not found @public */ // .......................................................... // ARRAY OBSERVERS // /** Adds an array observer to the receiving array. The array observer object normally must implement two methods: * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be called just before the array is modified. * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be called just after the array is modified. Both callbacks will be passed the observed object, starting index of the change as well as a count of the items to be removed and added. You can use these callbacks to optionally inspect the array during the change, clear caches, or do any other bookkeeping necessary. In addition to passing a target, you can also include an options hash which you can use to override the method names that will be invoked on the target. @method addArrayObserver @param {Object} target The observer object. @param {Object} opts Optional hash of configuration options including `willChange` and `didChange` option. @return {Ember.Array} receiver @public */ /** Removes an array observer from the object if the observer is current registered. Calling this method multiple times with the same object will have no effect. @method removeArrayObserver @param {Object} target The object observing the array. @param {Object} opts Optional hash of configuration options including `willChange` and `didChange` option. @return {Ember.Array} receiver @public */ /** Becomes true whenever the array currently has observers watching changes on the array. @property {Boolean} hasArrayObservers @public */ /** If you are implementing an object that supports `Ember.Array`, call this method just before the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change. @method arrayContentWillChange @param {Number} startIdx The starting index in the array that will change. @param {Number} removeAmt The number of items that will be removed. If you pass `null` assumes 0 @param {Number} addAmt The number of items that will be added. If you pass `null` assumes 0. @return {Ember.Array} receiver @public */ /** If you are implementing an object that supports `Ember.Array`, call this method just after the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change. @method arrayContentDidChange @param {Number} startIdx The starting index in the array that did change. @param {Number} removeAmt The number of items that were removed. If you pass `null` assumes 0 @param {Number} addAmt The number of items that were added. If you pass `null` assumes 0. @return {Ember.Array} receiver @public */ /** Returns a special object that can be used to observe individual properties on the array. Just get an equivalent property on this object and it will return an enumerable that maps automatically to the named key on the member objects. `@each` should only be used in a non-terminal context. Example: ```javascript myMethod: computed('posts.@each.author', function(){ ... }); ``` If you merely want to watch for the array being changed, like an object being replaced, added or removed, use `[]` instead of `@each`. ```javascript myMethod: computed('posts.[]', function(){ ... }); ``` @property @each @public */ enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; /** @module ember @submodule ember-runtime */ /** Implements some standard methods for comparing objects. Add this mixin to any class you create that can compare its instances. You should implement the `compare()` method. @class Comparable @namespace Ember @since Ember 0.9 @private */ exports.default = _emberMetal.Mixin.create({ /** __Required.__ You must implement this method to apply this mixin. Override to return the result of the comparison of the two parameters. The compare method should return: - `-1` if `a < b` - `0` if `a == b` - `1` if `a > b` Default implementation raises an exception. @method compare @param a {Object} the first object to compare @param b {Object} the second object to compare @return {Number} the result of the comparison @private */ compare: null }); }); enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-runtime */ 'use strict'; /** ContainerProxyMixin is used to provide public access to specific container functionality. @class ContainerProxyMixin @private */ exports.default = _emberMetal.Mixin.create({ /** The container stores state. @private @property {Ember.Container} __container__ */ __container__: null, /** Returns an object that can be used to provide an owner to a manually created instance. Example: ``` let owner = Ember.getOwner(this); User.create( owner.ownerInjection(), { username: 'rwjblue' } ) ``` @public @method ownerInjection @return {Object} */ ownerInjection: function () { return this.__container__.ownerInjection(); }, /** Given a fullName return a corresponding instance. The default behaviour is for lookup to return a singleton instance. The singleton is scoped to the container, allowing multiple containers to all have their own locally scoped singletons. ```javascript let registry = new Registry(); let container = registry.container(); registry.register('api:twitter', Twitter); let twitter = container.lookup('api:twitter'); twitter instanceof Twitter; // => true // by default the container will return singletons let twitter2 = container.lookup('api:twitter'); twitter2 instanceof Twitter; // => true twitter === twitter2; //=> true ``` If singletons are not wanted an optional flag can be provided at lookup. ```javascript let registry = new Registry(); let container = registry.container(); registry.register('api:twitter', Twitter); let twitter = container.lookup('api:twitter', { singleton: false }); let twitter2 = container.lookup('api:twitter', { singleton: false }); twitter === twitter2; //=> false ``` @public @method lookup @param {String} fullName @param {Object} options @return {any} */ lookup: function (fullName, options) { return this.__container__.lookup(fullName, options); }, /** Given a fullName return the corresponding factory. @private @method _lookupFactory @param {String} fullName @return {any} */ _lookupFactory: function (fullName, options) { return this.__container__.lookupFactory(fullName, options); }, /** Given a name and a source path, resolve the fullName @private @method _resolveLocalLookupName @param {String} fullName @param {String} source @return {String} */ _resolveLocalLookupName: function (name, source) { return this.__container__.registry.expandLocalLookup('component:' + name, { source: source }); }, /** @private */ willDestroy: function () { this._super.apply(this, arguments); if (this.__container__) { _emberMetal.run(this.__container__, 'destroy'); } } }); }); enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) { 'use strict'; /** @class ControllerMixin @namespace Ember @uses Ember.ActionHandler @private */ exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsAction_handler.default, _emberRuntimeMixinsController_content_model_alias_deprecation.default, { /* ducktype as a controller */ isController: true, /** The object to which actions from the view should be sent. For example, when a Handlebars template uses the `{{action}}` helper, it will attempt to send the action to the view's controller's `target`. By default, the value of the target property is set to the router, and is injected when a controller is instantiated. This injection is applied as part of the application's initialization process. In most cases the `target` property will automatically be set to the logical consumer of actions for the controller. @property target @default null @public */ target: null, store: null, /** The controller's current model. When retrieving or modifying a controller's model, this property should be used instead of the `content` property. @property model @public */ model: null, /** @private */ content: _emberMetal.alias('model') }); }); enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; /* The ControllerContentModelAliasDeprecation mixin is used to provide a useful deprecation warning when specifying `content` directly on a `Ember.Controller` (without also specifying `model`). Ember versions prior to 1.7 used `model` as an alias of `content`, but due to much confusion this alias was reversed (so `content` is now an alias of `model). This change reduces many caveats with model/content, and also sets a simple ground rule: Never set a controllers content, rather always set its model and ember will do the right thing. Used internally by Ember in `Ember.Controller`. */ exports.default = _emberMetal.Mixin.create({ /** @private Moves `content` to `model` at extend time if a `model` is not also specified. Note that this currently modifies the mixin themselves, which is technically dubious but is practically of little consequence. This may change in the future. @method willMergeMixin @since 1.4.0 */ willMergeMixin: function (props) { // Calling super is only OK here since we KNOW that // there is another Mixin loaded first. this._super.apply(this, arguments); var modelSpecified = !!props.model; if (props.content && !modelSpecified) { props.model = props.content; delete props['content']; } } }); }); enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal', 'ember-runtime/mixins/freezable'], function (exports, _emberMetal, _emberRuntimeMixinsFreezable) { /** @module ember @submodule ember-runtime */ 'use strict'; /** Implements some standard methods for copying an object. Add this mixin to any object you create that can create a copy of itself. This mixin is added automatically to the built-in array. You should generally implement the `copy()` method to return a copy of the receiver. Note that `frozenCopy()` will only work if you also implement `Ember.Freezable`. @class Copyable @namespace Ember @since Ember 0.9 @private */ exports.default = _emberMetal.Mixin.create({ /** __Required.__ You must implement this method to apply this mixin. Override to return a copy of the receiver. Default implementation raises an exception. @method copy @param {Boolean} deep if `true`, a deep copy of the object should be made @return {Object} copy of receiver @private */ copy: null, /** If the object implements `Ember.Freezable`, then this will return a new copy if the object is not frozen and the receiver if the object is frozen. Raises an exception if you try to call this method on a object that does not support freezing. You should use this method whenever you want a copy of a freezable object since a freezable object can simply return itself without actually consuming more memory. @method frozenCopy @return {Object} copy of receiver or receiver @deprecated Use `Object.freeze` instead. @private */ frozenCopy: function () { if (_emberRuntimeMixinsFreezable.Freezable && _emberRuntimeMixinsFreezable.Freezable.detect(this)) { return _emberMetal.get(this, 'isFrozen') ? this : this.copy().freeze(); } else { throw new _emberMetal.Error(this + ' does not support freezing'); } } }); }); enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal', 'ember-runtime/compare', 'require'], function (exports, _emberMetal, _emberRuntimeCompare, _require) { /** @module ember @submodule ember-runtime */ // .......................................................... // HELPERS // 'use strict'; var _emberA = undefined; function emberA() { return (_emberA || (_emberA = _require.default('ember-runtime/system/native_array').A))(); } var contexts = []; function popCtx() { return contexts.length === 0 ? {} : contexts.pop(); } function pushCtx(ctx) { contexts.push(ctx); return null; } function iter(key, value) { var valueProvided = arguments.length === 2; function i(item) { var cur = _emberMetal.get(item, key); return valueProvided ? value === cur : !!cur; } return i; } /** This mixin defines the common interface implemented by enumerable objects in Ember. Most of these methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific features that cannot be emulated in older versions of JavaScript). This mixin is applied automatically to the Array class on page load, so you can use any of these methods on simple arrays. If Array already implements one of these methods, the mixin will not override them. ## Writing Your Own Enumerable To make your own custom class enumerable, you need two items: 1. You must have a length property. This property should change whenever the number of items in your enumerable object changes. If you use this with an `Ember.Object` subclass, you should be sure to change the length property using `set().` 2. You must implement `nextObject().` See documentation. Once you have these two methods implemented, apply the `Ember.Enumerable` mixin to your class and you will be able to enumerate the contents of your object like any other collection. ## Using Ember Enumeration with Other Libraries Many other libraries provide some kind of iterator or enumeration like facility. This is often where the most common API conflicts occur. Ember's API is designed to be as friendly as possible with other libraries by implementing only methods that mostly correspond to the JavaScript 1.8 API. @class Enumerable @namespace Ember @since Ember 0.9 @private */ var Enumerable = _emberMetal.Mixin.create({ /** __Required.__ You must implement this method to apply this mixin. Implement this method to make your class enumerable. This method will be called repeatedly during enumeration. The index value will always begin with 0 and increment monotonically. You don't have to rely on the index value to determine what object to return, but you should always check the value and start from the beginning when you see the requested index is 0. The `previousObject` is the object that was returned from the last call to `nextObject` for the current iteration. This is a useful way to manage iteration if you are tracing a linked list, for example. Finally the context parameter will always contain a hash you can use as a "scratchpad" to maintain any other state you need in order to iterate properly. The context object is reused and is not reset between iterations so make sure you setup the context with a fresh state whenever the index parameter is 0. Generally iterators will continue to call `nextObject` until the index reaches the current length-1. If you run out of data before this time for some reason, you should simply return undefined. The default implementation of this method simply looks up the index. This works great on any Array-like objects. @method nextObject @param {Number} index the current index of the iteration @param {Object} previousObject the value returned by the last call to `nextObject`. @param {Object} context a context object you can use to maintain state. @return {Object} the next object in the iteration or undefined @private */ nextObject: null, /** Helper method returns the first object from a collection. This is usually used by bindings and other parts of the framework to extract a single object if the enumerable contains only one item. If you override this method, you should implement it so that it will always return the same value each time it is called. If your enumerable contains only one object, this method should always return that object. If your enumerable is empty, this method should return `undefined`. ```javascript let arr = ['a', 'b', 'c']; arr.get('firstObject'); // 'a' let arr = []; arr.get('firstObject'); // undefined ``` @property firstObject @return {Object} the object or undefined @readOnly @public */ firstObject: _emberMetal.computed('[]', function () { if (_emberMetal.get(this, 'length') === 0) { return undefined; } // handle generic enumerables var context = popCtx(); var ret = this.nextObject(0, null, context); pushCtx(context); return ret; }).readOnly(), /** Helper method returns the last object from a collection. If your enumerable contains only one object, this method should always return that object. If your enumerable is empty, this method should return `undefined`. ```javascript let arr = ['a', 'b', 'c']; arr.get('lastObject'); // 'c' let arr = []; arr.get('lastObject'); // undefined ``` @property lastObject @return {Object} the last object or undefined @readOnly @public */ lastObject: _emberMetal.computed('[]', function () { var len = _emberMetal.get(this, 'length'); if (len === 0) { return undefined; } var context = popCtx(); var idx = 0; var last = null; var cur = undefined; do { last = cur; cur = this.nextObject(idx++, last, context); } while (cur !== undefined); pushCtx(context); return last; }).readOnly(), /** Returns `true` if the passed object can be found in the receiver. The default version will iterate through the enumerable until the object is found. You may want to override this with a more efficient version. ```javascript let arr = ['a', 'b', 'c']; arr.contains('a'); // true arr.contains('z'); // false ``` @method contains @deprecated Use `Enumerable#includes` instead. See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains @param {Object} obj The object to search for. @return {Boolean} `true` if object is found in enumerable. @public */ contains: function (obj) { if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) {} var found = this.find(function (item) { return item === obj; }); return found !== undefined; }, /** Iterates through the enumerable, calling the passed function on each item. This method corresponds to the `forEach()` method defined in JavaScript 1.6. The callback method you provide should have the following signature (all parameters are optional): ```javascript function(item, index, enumerable); ``` - `item` is the current item in the iteration. - `index` is the current index in the iteration. - `enumerable` is the enumerable object itself. Note that in addition to a callback, you can also pass an optional target object that will be set as `this` on the context. This is a good way to give your iterator function access to the current object. @method forEach @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Object} receiver @public */ forEach: function (callback, target) { if (typeof callback !== 'function') { throw new TypeError(); } var context = popCtx(); var len = _emberMetal.get(this, 'length'); var last = null; if (target === undefined) { target = null; } for (var idx = 0; idx < len; idx++) { var next = this.nextObject(idx, last, context); callback.call(target, next, idx, this); last = next; } last = null; context = pushCtx(context); return this; }, /** Alias for `mapBy` @method getEach @param {String} key name of the property @return {Array} The mapped array. @public */ getEach: _emberMetal.aliasMethod('mapBy'), /** Sets the value on the named property for each member. This is more ergonomic than using other methods defined on this helper. If the object implements Ember.Observable, the value will be changed to `set(),` otherwise it will be set directly. `null` objects are skipped. @method setEach @param {String} key The key to set @param {Object} value The object to set @return {Object} receiver @public */ setEach: function (key, value) { return this.forEach(function (item) { return _emberMetal.set(item, key, value); }); }, /** Maps all of the items in the enumeration to another value, returning a new array. This method corresponds to `map()` defined in JavaScript 1.6. The callback method you provide should have the following signature (all parameters are optional): ```javascript function(item, index, enumerable); ``` - `item` is the current item in the iteration. - `index` is the current index in the iteration. - `enumerable` is the enumerable object itself. It should return the mapped value. Note that in addition to a callback, you can also pass an optional target object that will be set as `this` on the context. This is a good way to give your iterator function access to the current object. @method map @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Array} The mapped array. @public */ map: function (callback, target) { var ret = emberA(); this.forEach(function (x, idx, i) { return ret[idx] = callback.call(target, x, idx, i); }); return ret; }, /** Similar to map, this specialized function returns the value of the named property on all items in the enumeration. @method mapBy @param {String} key name of the property @return {Array} The mapped array. @public */ mapBy: function (key) { return this.map(function (next) { return _emberMetal.get(next, key); }); }, /** Returns an array with all of the items in the enumeration that the passed function returns true for. This method corresponds to `filter()` defined in JavaScript 1.6. The callback method you provide should have the following signature (all parameters are optional): ```javascript function(item, index, enumerable); ``` - `item` is the current item in the iteration. - `index` is the current index in the iteration. - `enumerable` is the enumerable object itself. It should return `true` to include the item in the results, `false` otherwise. Note that in addition to a callback, you can also pass an optional target object that will be set as `this` on the context. This is a good way to give your iterator function access to the current object. @method filter @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Array} A filtered array. @public */ filter: function (callback, target) { var ret = emberA(); this.forEach(function (x, idx, i) { if (callback.call(target, x, idx, i)) { ret.push(x); } }); return ret; }, /** Returns an array with all of the items in the enumeration where the passed function returns false. This method is the inverse of filter(). The callback method you provide should have the following signature (all parameters are optional): ```javascript function(item, index, enumerable); ``` - *item* is the current item in the iteration. - *index* is the current index in the iteration - *enumerable* is the enumerable object itself. It should return a falsey value to include the item in the results. Note that in addition to a callback, you can also pass an optional target object that will be set as "this" on the context. This is a good way to give your iterator function access to the current object. @method reject @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Array} A rejected array. @public */ reject: function (callback, target) { return this.filter(function () { return !callback.apply(target, arguments); }); }, /** Returns an array with just the items with the matched property. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`. @method filterBy @param {String} key the property to test @param {*} [value] optional value to test against. @return {Array} filtered array @public */ filterBy: function (key, value) { return this.filter(iter.apply(this, arguments)); }, /** Returns an array with the items that do not have truthy values for key. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to false. @method rejectBy @param {String} key the property to test @param {String} [value] optional value to test against. @return {Array} rejected array @public */ rejectBy: function (key, value) { var exactValue = function (item) { return _emberMetal.get(item, key) === value; }; var hasValue = function (item) { return !!_emberMetal.get(item, key); }; var use = arguments.length === 2 ? exactValue : hasValue; return this.reject(use); }, /** Returns the first item in the array for which the callback returns true. This method works similar to the `filter()` method defined in JavaScript 1.6 except that it will stop working on the array once a match is found. The callback method you provide should have the following signature (all parameters are optional): ```javascript function(item, index, enumerable); ``` - `item` is the current item in the iteration. - `index` is the current index in the iteration. - `enumerable` is the enumerable object itself. It should return the `true` to include the item in the results, `false` otherwise. Note that in addition to a callback, you can also pass an optional target object that will be set as `this` on the context. This is a good way to give your iterator function access to the current object. @method find @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Object} Found item or `undefined`. @public */ find: function (callback, target) { var len = _emberMetal.get(this, 'length'); if (target === undefined) { target = null; } var context = popCtx(); var found = false; var last = null; var next = undefined, ret = undefined; for (var idx = 0; idx < len && !found; idx++) { next = this.nextObject(idx, last, context); if (found = callback.call(target, next, idx, this)) { ret = next; } last = next; } next = last = null; context = pushCtx(context); return ret; }, /** Returns the first item with a property matching the passed value. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`. This method works much like the more generic `find()` method. @method findBy @param {String} key the property to test @param {String} [value] optional value to test against. @return {Object} found item or `undefined` @public */ findBy: function (key, value) { return this.find(iter.apply(this, arguments)); }, /** Returns `true` if the passed function returns true for every item in the enumeration. This corresponds with the `every()` method in JavaScript 1.6. The callback method you provide should have the following signature (all parameters are optional): ```javascript function(item, index, enumerable); ``` - `item` is the current item in the iteration. - `index` is the current index in the iteration. - `enumerable` is the enumerable object itself. It should return the `true` or `false`. Note that in addition to a callback, you can also pass an optional target object that will be set as `this` on the context. This is a good way to give your iterator function access to the current object. Example Usage: ```javascript if (people.every(isEngineer)) { Paychecks.addBigBonus(); } ``` @method every @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Boolean} @public */ every: function (callback, target) { return !this.find(function (x, idx, i) { return !callback.call(target, x, idx, i); }); }, /** Returns `true` if the passed property resolves to the value of the second argument for all items in the enumerable. This method is often simpler/faster than using a callback. @method isEvery @param {String} key the property to test @param {String} [value] optional value to test against. Defaults to `true` @return {Boolean} @since 1.3.0 @public */ isEvery: function (key, value) { return this.every(iter.apply(this, arguments)); }, /** Returns `true` if the passed function returns true for any item in the enumeration. This corresponds with the `some()` method in JavaScript 1.6. The callback method you provide should have the following signature (all parameters are optional): ```javascript function(item, index, enumerable); ``` - `item` is the current item in the iteration. - `index` is the current index in the iteration. - `enumerable` is the enumerable object itself. It should return the `true` to include the item in the results, `false` otherwise. Note that in addition to a callback, you can also pass an optional target object that will be set as `this` on the context. This is a good way to give your iterator function access to the current object. Usage Example: ```javascript if (people.any(isManager)) { Paychecks.addBiggerBonus(); } ``` @method any @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Boolean} `true` if the passed function returns `true` for any item @public */ any: function (callback, target) { var len = _emberMetal.get(this, 'length'); var context = popCtx(); var found = false; var last = null; var next = undefined; if (target === undefined) { target = null; } for (var idx = 0; idx < len && !found; idx++) { next = this.nextObject(idx, last, context); found = callback.call(target, next, idx, this); last = next; } next = last = null; context = pushCtx(context); return found; }, /** Returns `true` if the passed property resolves to the value of the second argument for any item in the enumerable. This method is often simpler/faster than using a callback. @method isAny @param {String} key the property to test @param {String} [value] optional value to test against. Defaults to `true` @return {Boolean} @since 1.3.0 @public */ isAny: function (key, value) { return this.any(iter.apply(this, arguments)); }, /** This will combine the values of the enumerator into a single value. It is a useful way to collect a summary value from an enumeration. This corresponds to the `reduce()` method defined in JavaScript 1.8. The callback method you provide should have the following signature (all parameters are optional): ```javascript function(previousValue, item, index, enumerable); ``` - `previousValue` is the value returned by the last call to the iterator. - `item` is the current item in the iteration. - `index` is the current index in the iteration. - `enumerable` is the enumerable object itself. Return the new cumulative value. In addition to the callback you can also pass an `initialValue`. An error will be raised if you do not pass an initial value and the enumerator is empty. Note that unlike the other methods, this method does not allow you to pass a target object to set as this for the callback. It's part of the spec. Sorry. @method reduce @param {Function} callback The callback to execute @param {Object} initialValue Initial value for the reduce @param {String} reducerProperty internal use only. @return {Object} The reduced value. @public */ reduce: function (callback, initialValue, reducerProperty) { if (typeof callback !== 'function') { throw new TypeError(); } var ret = initialValue; this.forEach(function (item, i) { ret = callback(ret, item, i, this, reducerProperty); }, this); return ret; }, /** Invokes the named method on every object in the receiver that implements it. This method corresponds to the implementation in Prototype 1.6. @method invoke @param {String} methodName the name of the method @param {Object...} args optional arguments to pass as well. @return {Array} return values from calling invoke. @public */ invoke: function (methodName) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var ret = emberA(); this.forEach(function (x, idx) { var method = x && x[methodName]; if ('function' === typeof method) { ret[idx] = args ? method.apply(x, args) : x[methodName](); } }, this); return ret; }, /** Simply converts the enumerable into a genuine array. The order is not guaranteed. Corresponds to the method implemented by Prototype. @method toArray @return {Array} the enumerable as an array. @public */ toArray: function () { var ret = emberA(); this.forEach(function (o, idx) { return ret[idx] = o; }); return ret; }, /** Returns a copy of the array with all `null` and `undefined` elements removed. ```javascript let arr = ['a', null, 'c', undefined]; arr.compact(); // ['a', 'c'] ``` @method compact @return {Array} the array without null and undefined elements. @public */ compact: function () { return this.filter(function (value) { return value != null; }); }, /** Returns a new enumerable that excludes the passed value. The default implementation returns an array regardless of the receiver type. If the receiver does not contain the value it returns the original enumerable. ```javascript let arr = ['a', 'b', 'a', 'c']; arr.without('a'); // ['b', 'c'] ``` @method without @param {Object} value @return {Ember.Enumerable} @public */ without: function (value) { if (!this.contains(value)) { return this; // nothing to do } var ret = emberA(); this.forEach(function (k) { if (k !== value) { ret[ret.length] = k; } }); return ret; }, /** Returns a new enumerable that contains only unique values. The default implementation returns an array regardless of the receiver type. ```javascript let arr = ['a', 'a', 'b', 'b']; arr.uniq(); // ['a', 'b'] ``` This only works on primitive data types, e.g. Strings, Numbers, etc. @method uniq @return {Ember.Enumerable} @public */ uniq: function () { var ret = emberA(); this.forEach(function (k) { if (ret.indexOf(k) < 0) { ret.push(k); } }); return ret; }, /** This property will trigger anytime the enumerable's content changes. You can observe this property to be notified of changes to the enumerable's content. For plain enumerables, this property is read only. `Array` overrides this method. @property [] @type Array @return this @private */ '[]': _emberMetal.computed({ get: function (key) { return this; } }), // .......................................................... // ENUMERABLE OBSERVERS // /** Registers an enumerable observer. Must implement `Ember.EnumerableObserver` mixin. @method addEnumerableObserver @param {Object} target @param {Object} [opts] @return this @private */ addEnumerableObserver: function (target, opts) { var willChange = opts && opts.willChange || 'enumerableWillChange'; var didChange = opts && opts.didChange || 'enumerableDidChange'; var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); if (!hasObservers) { _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); } _emberMetal.addListener(this, '@enumerable:before', target, willChange); _emberMetal.addListener(this, '@enumerable:change', target, didChange); if (!hasObservers) { _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); } return this; }, /** Removes a registered enumerable observer. @method removeEnumerableObserver @param {Object} target @param {Object} [opts] @return this @private */ removeEnumerableObserver: function (target, opts) { var willChange = opts && opts.willChange || 'enumerableWillChange'; var didChange = opts && opts.didChange || 'enumerableDidChange'; var hasObservers = _emberMetal.get(this, 'hasEnumerableObservers'); if (hasObservers) { _emberMetal.propertyWillChange(this, 'hasEnumerableObservers'); } _emberMetal.removeListener(this, '@enumerable:before', target, willChange); _emberMetal.removeListener(this, '@enumerable:change', target, didChange); if (hasObservers) { _emberMetal.propertyDidChange(this, 'hasEnumerableObservers'); } return this; }, /** Becomes true whenever the array currently has observers watching changes on the array. @property hasEnumerableObservers @type Boolean @private */ hasEnumerableObservers: _emberMetal.computed(function () { return _emberMetal.hasListeners(this, '@enumerable:change') || _emberMetal.hasListeners(this, '@enumerable:before'); }), /** Invoke this method just before the contents of your enumerable will change. You can either omit the parameters completely or pass the objects to be removed or added if available or just a count. @method enumerableContentWillChange @param {Ember.Enumerable|Number} removing An enumerable of the objects to be removed or the number of items to be removed. @param {Ember.Enumerable|Number} adding An enumerable of the objects to be added or the number of items to be added. @chainable @private */ enumerableContentWillChange: function (removing, adding) { var removeCnt = undefined, addCnt = undefined, hasDelta = undefined; if ('number' === typeof removing) { removeCnt = removing; } else if (removing) { removeCnt = _emberMetal.get(removing, 'length'); } else { removeCnt = removing = -1; } if ('number' === typeof adding) { addCnt = adding; } else if (adding) { addCnt = _emberMetal.get(adding, 'length'); } else { addCnt = adding = -1; } hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; if (removing === -1) { removing = null; } if (adding === -1) { adding = null; } _emberMetal.propertyWillChange(this, '[]'); if (hasDelta) { _emberMetal.propertyWillChange(this, 'length'); } _emberMetal.sendEvent(this, '@enumerable:before', [this, removing, adding]); return this; }, /** Invoke this method when the contents of your enumerable has changed. This will notify any observers watching for content changes. If you are implementing an ordered enumerable (such as an array), also pass the start and end values where the content changed so that it can be used to notify range observers. @method enumerableContentDidChange @param {Ember.Enumerable|Number} removing An enumerable of the objects to be removed or the number of items to be removed. @param {Ember.Enumerable|Number} adding An enumerable of the objects to be added or the number of items to be added. @chainable @private */ enumerableContentDidChange: function (removing, adding) { var removeCnt = undefined, addCnt = undefined, hasDelta = undefined; if ('number' === typeof removing) { removeCnt = removing; } else if (removing) { removeCnt = _emberMetal.get(removing, 'length'); } else { removeCnt = removing = -1; } if ('number' === typeof adding) { addCnt = adding; } else if (adding) { addCnt = _emberMetal.get(adding, 'length'); } else { addCnt = adding = -1; } hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; if (removing === -1) { removing = null; } if (adding === -1) { adding = null; } _emberMetal.sendEvent(this, '@enumerable:change', [this, removing, adding]); if (hasDelta) { _emberMetal.propertyDidChange(this, 'length'); } _emberMetal.propertyDidChange(this, '[]'); return this; }, /** Converts the enumerable into an array and sorts by the keys specified in the argument. You may provide multiple arguments to sort by multiple properties. @method sortBy @param {String} property name(s) to sort on @return {Array} The sorted array. @since 1.2.0 @public */ sortBy: function () { var sortKeys = arguments; return this.toArray().sort(function (a, b) { for (var i = 0; i < sortKeys.length; i++) { var key = sortKeys[i]; var propA = _emberMetal.get(a, key); var propB = _emberMetal.get(b, key); // return 1 or -1 else continue to the next sortKey var compareValue = _emberRuntimeCompare.default(propA, propB); if (compareValue) { return compareValue; } } return 0; }); } }); if (_emberMetal.isFeatureEnabled('ember-runtime-computed-uniq-by')) { Enumerable.reopen({ /** Returns a new enumerable that contains only items containing a unique property value. The default implementation returns an array regardless of the receiver type. ```javascript let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }]; arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }] ``` @method uniqBy @return {Ember.Enumerable} @public */ uniqBy: function (key) { var ret = emberA(); var seen = new _emberMetal.EmptyObject(); this.forEach(function (item) { var guid = _emberMetal.guidFor(_emberMetal.get(item, key)); if (!(guid in seen)) { seen[guid] = true; ret.push(item); } }); return ret; } }); } if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) { Enumerable.reopen({ /** Returns `true` if the passed object can be found in the enumerable. ```javascript [1, 2, 3].includes(2); // true [1, 2, 3].includes(4); // false [1, 2, undefined].includes(undefined); // true [1, 2, null].includes(null); // true [1, 2, NaN].includes(NaN); // true ``` @method includes @param {Object} obj The object to search for. @return {Boolean} `true` if object is found in the enumerable. @public */ includes: function (obj) { var len = _emberMetal.get(this, 'length'); var idx = undefined, next = undefined; var last = null; var found = false; var context = popCtx(); for (idx = 0; idx < len && !found; idx++) { next = this.nextObject(idx, last, context); found = obj === next || obj !== obj && next !== next; last = next; } next = last = null; context = pushCtx(context); return found; }, without: function (value) { if (!this.includes(value)) { return this; // nothing to do } var ret = emberA(); this.forEach(function (k) { // SameValueZero comparison (NaN !== NaN) if (!(k === value || k !== k && value !== value)) { ret[ret.length] = k; } }); return ret; } }); } exports.default = Enumerable; }); enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; /** @module ember @submodule ember-runtime */ /** This mixin allows for Ember objects to subscribe to and emit events. ```javascript App.Person = Ember.Object.extend(Ember.Evented, { greet: function() { // ... this.trigger('greet'); } }); var person = App.Person.create(); person.on('greet', function() { console.log('Our person has greeted'); }); person.greet(); // outputs: 'Our person has greeted' ``` You can also chain multiple event subscriptions: ```javascript person.on('greet', function() { console.log('Our person has greeted'); }).one('greet', function() { console.log('Offer one-time special'); }).off('event', this, forgetThis); ``` @class Evented @namespace Ember @public */ exports.default = _emberMetal.Mixin.create({ /** Subscribes to a named event with given function. ```javascript person.on('didLoad', function() { // fired once the person has loaded }); ``` An optional target can be passed in as the 2nd argument that will be set as the "this" for the callback. This is a good way to give your function access to the object triggering the event. When the target parameter is used the callback becomes the third argument. @method on @param {String} name The name of the event @param {Object} [target] The "this" binding for the callback @param {Function} method The callback to execute @return this @public */ on: function (name, target, method) { _emberMetal.addListener(this, name, target, method); return this; }, /** Subscribes a function to a named event and then cancels the subscription after the first time the event is triggered. It is good to use ``one`` when you only care about the first time an event has taken place. This function takes an optional 2nd argument that will become the "this" value for the callback. If this argument is passed then the 3rd argument becomes the function. @method one @param {String} name The name of the event @param {Object} [target] The "this" binding for the callback @param {Function} method The callback to execute @return this @public */ one: function (name, target, method) { if (!method) { method = target; target = null; } _emberMetal.addListener(this, name, target, method, true); return this; }, /** Triggers a named event for the object. Any additional arguments will be passed as parameters to the functions that are subscribed to the event. ```javascript person.on('didEat', function(food) { console.log('person ate some ' + food); }); person.trigger('didEat', 'broccoli'); // outputs: person ate some broccoli ``` @method trigger @param {String} name The name of the event @param {Object...} args Optional arguments to pass on @public */ trigger: function (name) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } _emberMetal.sendEvent(this, name, args); }, /** Cancels subscription for given name, target, and method. @method off @param {String} name The name of the event @param {Object} target The target of the subscription @param {Function} method The function of the subscription @return this @public */ off: function (name, target, method) { _emberMetal.removeListener(this, name, target, method); return this; }, /** Checks to see if object has any subscriptions for named event. @method has @param {String} name The name of the event @return {Boolean} does the object have a subscription for event @public */ has: function (name) { return _emberMetal.hasListeners(this, name); } }); }); enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-runtime */ 'use strict'; /** The `Ember.Freezable` mixin implements some basic methods for marking an object as frozen. Once an object is frozen it should be read only. No changes may be made the internal state of the object. ## Enforcement To fully support freezing in your subclass, you must include this mixin and override any method that might alter any property on the object to instead raise an exception. You can check the state of an object by checking the `isFrozen` property. Although future versions of JavaScript may support language-level freezing object objects, that is not the case today. Even if an object is freezable, it is still technically possible to modify the object, even though it could break other parts of your application that do not expect a frozen object to change. It is, therefore, very important that you always respect the `isFrozen` property on all freezable objects. ## Example Usage The example below shows a simple object that implement the `Ember.Freezable` protocol. ```javascript Contact = Ember.Object.extend(Ember.Freezable, { firstName: null, lastName: null, // swaps the names swapNames: function() { if (this.get('isFrozen')) throw Ember.FROZEN_ERROR; var tmp = this.get('firstName'); this.set('firstName', this.get('lastName')); this.set('lastName', tmp); return this; } }); c = Contact.create({ firstName: "John", lastName: "Doe" }); c.swapNames(); // returns c c.freeze(); c.swapNames(); // EXCEPTION ``` ## Copying Usually the `Ember.Freezable` protocol is implemented in cooperation with the `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will return a frozen object, if the object implements this method as well. @class Freezable @namespace Ember @since Ember 0.9 @deprecated Use `Object.freeze` instead. @private */ var Freezable = _emberMetal.Mixin.create({ init: function () { this._super.apply(this, arguments); }, /** Set to `true` when the object is frozen. Use this property to detect whether your object is frozen or not. @property isFrozen @type Boolean @private */ isFrozen: false, /** Freezes the object. Once this method has been called the object should no longer allow any properties to be edited. @method freeze @return {Object} receiver @private */ freeze: function () { if (_emberMetal.get(this, 'isFrozen')) { return this; } _emberMetal.set(this, 'isFrozen', true); return this; } }); exports.Freezable = Freezable; var FROZEN_ERROR = 'Frozen object cannot be modified.'; exports.FROZEN_ERROR = FROZEN_ERROR; }); enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, _emberMetal, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsEnumerable) { /** @module ember @submodule ember-runtime */ 'use strict'; exports.removeAt = removeAt; var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; var EMPTY = []; // .......................................................... // HELPERS // function removeAt(array, start, len) { if ('number' === typeof start) { if (start < 0 || start >= _emberMetal.get(array, 'length')) { throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); } // fast case if (len === undefined) { len = 1; } array.replace(start, len, EMPTY); } return array; } /** This mixin defines the API for modifying array-like objects. These methods can be applied only to a collection that keeps its items in an ordered set. It builds upon the Array mixin and adds methods to modify the array. One concrete implementations of this class include ArrayProxy. It is important to use the methods in this class to modify arrays so that changes are observable. This allows the binding system in Ember to function correctly. Note that an Array can change even if it does not implement this mixin. For example, one might implement a SparseArray that cannot be directly modified, but if its underlying enumerable changes, it will change also. @class MutableArray @namespace Ember @uses Ember.Array @uses Ember.MutableEnumerable @public */ exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsArray.default, _emberRuntimeMixinsMutable_enumerable.default, { /** __Required.__ You must implement this method to apply this mixin. This is one of the primitives you must implement to support `Ember.Array`. You should replace amt objects started at idx with the objects in the passed array. You should also call `this.enumerableContentDidChange()` @method replace @param {Number} idx Starting index in the array to replace. If idx >= length, then append to the end of the array. @param {Number} amt Number of elements that should be removed from the array, starting at *idx*. @param {Array} objects An array of zero or more objects that should be inserted into the array at *idx* @public */ replace: null, /** Remove all elements from the array. This is useful if you want to reuse an existing array without having to recreate it. ```javascript let colors = ['red', 'green', 'blue']; color.length(); // 3 colors.clear(); // [] colors.length(); // 0 ``` @method clear @return {Ember.Array} An empty Array. @public */ clear: function () { var len = _emberMetal.get(this, 'length'); if (len === 0) { return this; } this.replace(0, len, EMPTY); return this; }, /** This will use the primitive `replace()` method to insert an object at the specified index. ```javascript let colors = ['red', 'green', 'blue']; colors.insertAt(2, 'yellow'); // ['red', 'green', 'yellow', 'blue'] colors.insertAt(5, 'orange'); // Error: Index out of range ``` @method insertAt @param {Number} idx index of insert the object at. @param {Object} object object to insert @return {Ember.Array} receiver @public */ insertAt: function (idx, object) { if (idx > _emberMetal.get(this, 'length')) { throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); } this.replace(idx, 0, [object]); return this; }, /** Remove an object at the specified index using the `replace()` primitive method. You can pass either a single index, or a start and a length. If you pass a start and length that is beyond the length this method will throw an `OUT_OF_RANGE_EXCEPTION`. ```javascript let colors = ['red', 'green', 'blue', 'yellow', 'orange']; colors.removeAt(0); // ['green', 'blue', 'yellow', 'orange'] colors.removeAt(2, 2); // ['green', 'blue'] colors.removeAt(4, 2); // Error: Index out of range ``` @method removeAt @param {Number} start index, start of range @param {Number} len length of passing range @return {Ember.Array} receiver @public */ removeAt: function (start, len) { return removeAt(this, start, len); }, /** Push the object onto the end of the array. Works just like `push()` but it is KVO-compliant. ```javascript let colors = ['red', 'green']; colors.pushObject('black'); // ['red', 'green', 'black'] colors.pushObject(['yellow']); // ['red', 'green', ['yellow']] ``` @method pushObject @param {*} obj object to push @return object same object passed as a param @public */ pushObject: function (obj) { this.insertAt(_emberMetal.get(this, 'length'), obj); return obj; }, /** Add the objects in the passed numerable to the end of the array. Defers notifying observers of the change until all objects are added. ```javascript let colors = ['red']; colors.pushObjects(['yellow', 'orange']); // ['red', 'yellow', 'orange'] ``` @method pushObjects @param {Ember.Enumerable} objects the objects to add @return {Ember.Array} receiver @public */ pushObjects: function (objects) { if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || Array.isArray(objects))) { throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); } this.replace(_emberMetal.get(this, 'length'), 0, objects); return this; }, /** Pop object from array or nil if none are left. Works just like `pop()` but it is KVO-compliant. ```javascript let colors = ['red', 'green', 'blue']; colors.popObject(); // 'blue' console.log(colors); // ['red', 'green'] ``` @method popObject @return object @public */ popObject: function () { var len = _emberMetal.get(this, 'length'); if (len === 0) { return null; } var ret = _emberRuntimeMixinsArray.objectAt(this, len - 1); this.removeAt(len - 1, 1); return ret; }, /** Shift an object from start of array or nil if none are left. Works just like `shift()` but it is KVO-compliant. ```javascript let colors = ['red', 'green', 'blue']; colors.shiftObject(); // 'red' console.log(colors); // ['green', 'blue'] ``` @method shiftObject @return object @public */ shiftObject: function () { if (_emberMetal.get(this, 'length') === 0) { return null; } var ret = _emberRuntimeMixinsArray.objectAt(this, 0); this.removeAt(0); return ret; }, /** Unshift an object to start of array. Works just like `unshift()` but it is KVO-compliant. ```javascript let colors = ['red']; colors.unshiftObject('yellow'); // ['yellow', 'red'] colors.unshiftObject(['black']); // [['black'], 'yellow', 'red'] ``` @method unshiftObject @param {*} obj object to unshift @return object same object passed as a param @public */ unshiftObject: function (obj) { this.insertAt(0, obj); return obj; }, /** Adds the named objects to the beginning of the array. Defers notifying observers until all objects have been added. ```javascript let colors = ['red']; colors.unshiftObjects(['black', 'white']); // ['black', 'white', 'red'] colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function ``` @method unshiftObjects @param {Ember.Enumerable} objects the objects to add @return {Ember.Array} receiver @public */ unshiftObjects: function (objects) { this.replace(0, 0, objects); return this; }, /** Reverse objects in the array. Works just like `reverse()` but it is KVO-compliant. @method reverseObjects @return {Ember.Array} receiver @public */ reverseObjects: function () { var len = _emberMetal.get(this, 'length'); if (len === 0) { return this; } var objects = this.toArray().reverse(); this.replace(0, len, objects); return this; }, /** Replace all the receiver's content with content of the argument. If argument is an empty array receiver will be cleared. ```javascript let colors = ['red', 'green', 'blue']; colors.setObjects(['black', 'white']); // ['black', 'white'] colors.setObjects([]); // [] ``` @method setObjects @param {Ember.Array} objects array whose content will be used for replacing the content of the receiver @return {Ember.Array} receiver with the new content @public */ setObjects: function (objects) { if (objects.length === 0) { return this.clear(); } var len = _emberMetal.get(this, 'length'); this.replace(0, len, objects); return this; }, // .......................................................... // IMPLEMENT Ember.MutableEnumerable // /** Remove all occurrences of an object in the array. ```javascript let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago']; cities.removeObject('Chicago'); // ['Berlin', 'Lima'] cities.removeObject('Lima'); // ['Berlin'] cities.removeObject('Tokyo') // ['Berlin'] ``` @method removeObject @param {*} obj object to remove @return {Ember.Array} receiver @public */ removeObject: function (obj) { var loc = _emberMetal.get(this, 'length') || 0; while (--loc >= 0) { var curObject = _emberRuntimeMixinsArray.objectAt(this, loc); if (curObject === obj) { this.removeAt(loc); } } return this; }, /** Push the object onto the end of the array if it is not already present in the array. ```javascript let cities = ['Chicago', 'Berlin']; cities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima'] cities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima'] ``` @method addObject @param {*} obj object to add, if not already present @return {Ember.Array} receiver @public */ addObject: function (obj) { var included = undefined; if (_emberMetal.isFeatureEnabled('ember-runtime-enumerable-includes')) { included = this.includes(obj); } else { included = this.contains(obj); } if (!included) { this.pushObject(obj); } return this; } }); }); enifed('ember-runtime/mixins/mutable_enumerable', ['exports', 'ember-runtime/mixins/enumerable', 'ember-metal'], function (exports, _emberRuntimeMixinsEnumerable, _emberMetal) { 'use strict'; /** @module ember @submodule ember-runtime */ /** This mixin defines the API for modifying generic enumerables. These methods can be applied to an object regardless of whether it is ordered or unordered. Note that an Enumerable can change even if it does not implement this mixin. For example, a MappedEnumerable cannot be directly modified but if its underlying enumerable changes, it will change also. ## Adding Objects To add an object to an enumerable, use the `addObject()` method. This method will only add the object to the enumerable if the object is not already present and is of a type supported by the enumerable. ```javascript set.addObject(contact); ``` ## Removing Objects To remove an object from an enumerable, use the `removeObject()` method. This will only remove the object if it is present in the enumerable, otherwise this method has no effect. ```javascript set.removeObject(contact); ``` ## Implementing In Your Own Code If you are implementing an object and want to support this API, just include this mixin in your class and implement the required methods. In your unit tests, be sure to apply the Ember.MutableEnumerableTests to your object. @class MutableEnumerable @namespace Ember @uses Ember.Enumerable @public */ exports.default = _emberMetal.Mixin.create(_emberRuntimeMixinsEnumerable.default, { /** __Required.__ You must implement this method to apply this mixin. Attempts to add the passed object to the receiver if the object is not already present in the collection. If the object is present, this method has no effect. If the passed object is of a type not supported by the receiver, then this method should raise an exception. @method addObject @param {Object} object The object to add to the enumerable. @return {Object} the passed object @public */ addObject: null, /** Adds each object in the passed enumerable to the receiver. @method addObjects @param {Ember.Enumerable} objects the objects to add. @return {Object} receiver @public */ addObjects: function (objects) { var _this = this; _emberMetal.beginPropertyChanges(this); objects.forEach(function (obj) { return _this.addObject(obj); }); _emberMetal.endPropertyChanges(this); return this; }, /** __Required.__ You must implement this method to apply this mixin. Attempts to remove the passed object from the receiver collection if the object is present in the collection. If the object is not present, this method has no effect. If the passed object is of a type not supported by the receiver, then this method should raise an exception. @method removeObject @param {Object} object The object to remove from the enumerable. @return {Object} the passed object @public */ removeObject: null, /** Removes each object in the passed enumerable from the receiver. @method removeObjects @param {Ember.Enumerable} objects the objects to remove @return {Object} receiver @public */ removeObjects: function (objects) { _emberMetal.beginPropertyChanges(this); for (var i = objects.length - 1; i >= 0; i--) { this.removeObject(objects[i]); } _emberMetal.endPropertyChanges(this); return this; } }); }); enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-runtime */ 'use strict'; /** ## Overview This mixin provides properties and property observing functionality, core features of the Ember object model. Properties and observers allow one object to observe changes to a property on another object. This is one of the fundamental ways that models, controllers and views communicate with each other in an Ember application. Any object that has this mixin applied can be used in observer operations. That includes `Ember.Object` and most objects you will interact with as you write your Ember application. Note that you will not generally apply this mixin to classes yourself, but you will use the features provided by this module frequently, so it is important to understand how to use it. ## Using `get()` and `set()` Because of Ember's support for bindings and observers, you will always access properties using the get method, and set properties using the set method. This allows the observing objects to be notified and computed properties to be handled properly. More documentation about `get` and `set` are below. ## Observing Property Changes You typically observe property changes simply by using the `Ember.observer` function in classes that you write. For example: ```javascript Ember.Object.extend({ valueObserver: Ember.observer('value', function(sender, key, value, rev) { // Executes whenever the "value" property changes // See the addObserver method for more information about the callback arguments }) }); ``` Although this is the most common way to add an observer, this capability is actually built into the `Ember.Object` class on top of two methods defined in this mixin: `addObserver` and `removeObserver`. You can use these two methods to add and remove observers yourself if you need to do so at runtime. To add an observer for a property, call: ```javascript object.addObserver('propertyKey', targetObject, targetAction) ``` This will call the `targetAction` method on the `targetObject` whenever the value of the `propertyKey` changes. Note that if `propertyKey` is a computed property, the observer will be called when any of the property dependencies are changed, even if the resulting value of the computed property is unchanged. This is necessary because computed properties are not computed until `get` is called. @class Observable @namespace Ember @public */ exports.default = _emberMetal.Mixin.create({ /** Retrieves the value of a property from the object. This method is usually similar to using `object[keyName]` or `object.keyName`, however it supports both computed properties and the unknownProperty handler. Because `get` unifies the syntax for accessing all these kinds of properties, it can make many refactorings easier, such as replacing a simple property with a computed property, or vice versa. ### Computed Properties Computed properties are methods defined with the `property` modifier declared at the end, such as: ```javascript fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); }.property('firstName', 'lastName') ``` When you call `get` on a computed property, the function will be called and the return value will be returned instead of the function itself. ### Unknown Properties Likewise, if you try to call `get` on a property whose value is `undefined`, the `unknownProperty()` method will be called on the object. If this method returns any value other than `undefined`, it will be returned instead. This allows you to implement "virtual" properties that are not defined upfront. @method get @param {String} keyName The property to retrieve @return {Object} The property value or undefined. @public */ get: function (keyName) { return _emberMetal.get(this, keyName); }, /** To get the values of multiple properties at once, call `getProperties` with a list of strings or an array: ```javascript record.getProperties('firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } ``` is equivalent to: ```javascript record.getProperties(['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' } ``` @method getProperties @param {String...|Array} list of keys to get @return {Object} @public */ getProperties: function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _emberMetal.getProperties.apply(null, [this].concat(args)); }, /** Sets the provided key or path to the value. This method is generally very similar to calling `object[key] = value` or `object.key = value`, except that it provides support for computed properties, the `setUnknownProperty()` method and property observers. ### Computed Properties If you try to set a value on a key that has a computed property handler defined (see the `get()` method for an example), then `set()` will call that method, passing both the value and key instead of simply changing the value itself. This is useful for those times when you need to implement a property that is composed of one or more member properties. ### Unknown Properties If you try to set a value on a key that is undefined in the target object, then the `setUnknownProperty()` handler will be called instead. This gives you an opportunity to implement complex "virtual" properties that are not predefined on the object. If `setUnknownProperty()` returns undefined, then `set()` will simply set the value on the object. ### Property Observers In addition to changing the property, `set()` will also register a property change with the object. Unless you have placed this call inside of a `beginPropertyChanges()` and `endPropertyChanges(),` any "local" observers (i.e. observer methods declared on the same object), will be called immediately. Any "remote" observers (i.e. observer methods declared on another object) will be placed in a queue and called at a later time in a coalesced manner. @method set @param {String} keyName The property to set @param {Object} value The value to set or `null`. @return {Object} The passed value @public */ set: function (keyName, value) { return _emberMetal.set(this, keyName, value); }, /** Sets a list of properties at once. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so observers will be buffered. ```javascript record.setProperties({ firstName: 'Charles', lastName: 'Jolley' }); ``` @method setProperties @param {Object} hash the hash of keys and values to set @return {Object} The passed in hash @public */ setProperties: function (hash) { return _emberMetal.setProperties(this, hash); }, /** Begins a grouping of property changes. You can use this method to group property changes so that notifications will not be sent until the changes are finished. If you plan to make a large number of changes to an object at one time, you should call this method at the beginning of the changes to begin deferring change notifications. When you are done making changes, call `endPropertyChanges()` to deliver the deferred change notifications and end deferring. @method beginPropertyChanges @return {Ember.Observable} @private */ beginPropertyChanges: function () { _emberMetal.beginPropertyChanges(); return this; }, /** Ends a grouping of property changes. You can use this method to group property changes so that notifications will not be sent until the changes are finished. If you plan to make a large number of changes to an object at one time, you should call `beginPropertyChanges()` at the beginning of the changes to defer change notifications. When you are done making changes, call this method to deliver the deferred change notifications and end deferring. @method endPropertyChanges @return {Ember.Observable} @private */ endPropertyChanges: function () { _emberMetal.endPropertyChanges(); return this; }, /** Notify the observer system that a property is about to change. Sometimes you need to change a value directly or indirectly without actually calling `get()` or `set()` on it. In this case, you can use this method and `propertyDidChange()` instead. Calling these two methods together will notify all observers that the property has potentially changed value. Note that you must always call `propertyWillChange` and `propertyDidChange` as a pair. If you do not, it may get the property change groups out of order and cause notifications to be delivered more often than you would like. @method propertyWillChange @param {String} keyName The property key that is about to change. @return {Ember.Observable} @private */ propertyWillChange: function (keyName) { _emberMetal.propertyWillChange(this, keyName); return this; }, /** Notify the observer system that a property has just changed. Sometimes you need to change a value directly or indirectly without actually calling `get()` or `set()` on it. In this case, you can use this method and `propertyWillChange()` instead. Calling these two methods together will notify all observers that the property has potentially changed value. Note that you must always call `propertyWillChange` and `propertyDidChange` as a pair. If you do not, it may get the property change groups out of order and cause notifications to be delivered more often than you would like. @method propertyDidChange @param {String} keyName The property key that has just changed. @return {Ember.Observable} @private */ propertyDidChange: function (keyName) { _emberMetal.propertyDidChange(this, keyName); return this; }, /** Convenience method to call `propertyWillChange` and `propertyDidChange` in succession. @method notifyPropertyChange @param {String} keyName The property key to be notified about. @return {Ember.Observable} @public */ notifyPropertyChange: function (keyName) { this.propertyWillChange(keyName); this.propertyDidChange(keyName); return this; }, /** Adds an observer on a property. This is the core method used to register an observer for a property. Once you call this method, any time the key's value is set, your observer will be notified. Note that the observers are triggered any time the value is set, regardless of whether it has actually changed. Your observer should be prepared to handle that. You can also pass an optional context parameter to this method. The context will be passed to your observer method whenever it is triggered. Note that if you add the same target/method pair on a key multiple times with different context parameters, your observer will only be called once with the last context you passed. ### Observer Methods Observer methods you pass should generally have the following signature if you do not pass a `context` parameter: ```javascript fooDidChange: function(sender, key, value, rev) { }; ``` The sender is the object that changed. The key is the property that changes. The value property is currently reserved and unused. The rev is the last property revision of the object when it changed, which you can use to detect if the key value has really changed or not. If you pass a `context` parameter, the context will be passed before the revision like so: ```javascript fooDidChange: function(sender, key, value, context, rev) { }; ``` Usually you will not need the value, context or revision parameters at the end. In this case, it is common to write observer methods that take only a sender and key value as parameters or, if you aren't interested in any of these values, to write an observer that has no parameters at all. @method addObserver @param {String} key The key to observer @param {Object} target The target object to invoke @param {String|Function} method The method to invoke. @public */ addObserver: function (key, target, method) { _emberMetal.addObserver(this, key, target, method); }, /** Remove an observer you have previously registered on this object. Pass the same key, target, and method you passed to `addObserver()` and your target will no longer receive notifications. @method removeObserver @param {String} key The key to observer @param {Object} target The target object to invoke @param {String|Function} method The method to invoke. @public */ removeObserver: function (key, target, method) { _emberMetal.removeObserver(this, key, target, method); }, /** Returns `true` if the object currently has observers registered for a particular key. You can use this method to potentially defer performing an expensive action until someone begins observing a particular property on the object. @method hasObserverFor @param {String} key Key to check @return {Boolean} @private */ hasObserverFor: function (key) { return _emberMetal.hasListeners(this, key + ':change'); }, /** Retrieves the value of a property, or a default value in the case that the property returns `undefined`. ```javascript person.getWithDefault('lastName', 'Doe'); ``` @method getWithDefault @param {String} keyName The name of the property to retrieve @param {Object} defaultValue The value to return if the property value is undefined @return {Object} The property value or the defaultValue. @public */ getWithDefault: function (keyName, defaultValue) { return _emberMetal.getWithDefault(this, keyName, defaultValue); }, /** Set the value of a property to the current value plus some amount. ```javascript person.incrementProperty('age'); team.incrementProperty('score', 2); ``` @method incrementProperty @param {String} keyName The name of the property to increment @param {Number} increment The amount to increment by. Defaults to 1 @return {Number} The new property value @public */ incrementProperty: function (keyName, increment) { if (_emberMetal.isNone(increment)) { increment = 1; } return _emberMetal.set(this, keyName, (parseFloat(_emberMetal.get(this, keyName)) || 0) + increment); }, /** Set the value of a property to the current value minus some amount. ```javascript player.decrementProperty('lives'); orc.decrementProperty('health', 5); ``` @method decrementProperty @param {String} keyName The name of the property to decrement @param {Number} decrement The amount to decrement by. Defaults to 1 @return {Number} The new property value @public */ decrementProperty: function (keyName, decrement) { if (_emberMetal.isNone(decrement)) { decrement = 1; } return _emberMetal.set(this, keyName, (_emberMetal.get(this, keyName) || 0) - decrement); }, /** Set the value of a boolean property to the opposite of its current value. ```javascript starship.toggleProperty('warpDriveEngaged'); ``` @method toggleProperty @param {String} keyName The name of the property to toggle @return {Boolean} The new property value @public */ toggleProperty: function (keyName) { return _emberMetal.set(this, keyName, !_emberMetal.get(this, keyName)); }, /** Returns the cached value of a computed property, if it exists. This allows you to inspect the value of a computed property without accidentally invoking it if it is intended to be generated lazily. @method cacheFor @param {String} keyName @return {Object} The cached value of the computed property, if any @public */ cacheFor: function (keyName) { return _emberMetal.cacheFor(this, keyName); }, // intended for debugging purposes observersForKey: function (keyName) { return _emberMetal.observersFor(this, keyName); } }); }); enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal', 'ember-runtime/computed/computed_macros'], function (exports, _emberMetal, _emberRuntimeComputedComputed_macros) { 'use strict'; /** @module ember @submodule ember-runtime */ function tap(proxy, promise) { _emberMetal.setProperties(proxy, { isFulfilled: false, isRejected: false }); return promise.then(function (value) { _emberMetal.setProperties(proxy, { content: value, isFulfilled: true }); return value; }, function (reason) { _emberMetal.setProperties(proxy, { reason: reason, isRejected: true }); throw reason; }, 'Ember: PromiseProxy'); } /** A low level mixin making ObjectProxy promise-aware. ```javascript let ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); let proxy = ObjectPromiseProxy.create({ promise: Ember.RSVP.cast($.getJSON('/some/remote/data.json')) }); proxy.then(function(json){ // the json }, function(reason) { // the reason why you have no json }); ``` the proxy has bindable attributes which track the promises life cycle ```javascript proxy.get('isPending') //=> true proxy.get('isSettled') //=> false proxy.get('isRejected') //=> false proxy.get('isFulfilled') //=> false ``` When the $.getJSON completes, and the promise is fulfilled with json, the life cycle attributes will update accordingly. Note that $.getJSON doesn't return an ECMA specified promise, it is useful to wrap this with an `RSVP.cast` so that it behaves as a spec compliant promise. ```javascript proxy.get('isPending') //=> false proxy.get('isSettled') //=> true proxy.get('isRejected') //=> false proxy.get('isFulfilled') //=> true ``` As the proxy is an ObjectProxy, and the json now its content, all the json properties will be available directly from the proxy. ```javascript // Assuming the following json: { firstName: 'Stefan', lastName: 'Penner' } // both properties will accessible on the proxy proxy.get('firstName') //=> 'Stefan' proxy.get('lastName') //=> 'Penner' ``` @class Ember.PromiseProxyMixin @public */ exports.default = _emberMetal.Mixin.create({ /** If the proxied promise is rejected this will contain the reason provided. @property reason @default null @public */ reason: null, /** Once the proxied promise has settled this will become `false`. @property isPending @default true @public */ isPending: _emberRuntimeComputedComputed_macros.not('isSettled').readOnly(), /** Once the proxied promise has settled this will become `true`. @property isSettled @default false @public */ isSettled: _emberRuntimeComputedComputed_macros.or('isRejected', 'isFulfilled').readOnly(), /** Will become `true` if the proxied promise is rejected. @property isRejected @default false @public */ isRejected: false, /** Will become `true` if the proxied promise is fulfilled. @property isFulfilled @default false @public */ isFulfilled: false, /** The promise whose fulfillment value is being proxied by this object. This property must be specified upon creation, and should not be changed once created. Example: ```javascript Ember.ObjectProxy.extend(Ember.PromiseProxyMixin).create({ promise: }); ``` @property promise @public */ promise: _emberMetal.computed({ get: function () { throw new _emberMetal.Error('PromiseProxy\'s promise must be set'); }, set: function (key, promise) { return tap(this, promise); } }), /** An alias to the proxied promise's `then`. See RSVP.Promise.then. @method then @param {Function} callback @return {RSVP.Promise} @public */ then: promiseAlias('then'), /** An alias to the proxied promise's `catch`. See RSVP.Promise.catch. @method catch @param {Function} callback @return {RSVP.Promise} @since 1.3.0 @public */ 'catch': promiseAlias('catch'), /** An alias to the proxied promise's `finally`. See RSVP.Promise.finally. @method finally @param {Function} callback @return {RSVP.Promise} @since 1.3.0 @public */ 'finally': promiseAlias('finally') }); function promiseAlias(name) { return function () { var promise = _emberMetal.get(this, 'promise'); return promise[name].apply(promise, arguments); }; } }); enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-runtime */ 'use strict'; exports.buildFakeRegistryWithDeprecations = buildFakeRegistryWithDeprecations; /** RegistryProxyMixin is used to provide public access to specific registry functionality. @class RegistryProxyMixin @private */ exports.default = _emberMetal.Mixin.create({ __registry__: null, /** Given a fullName return the corresponding factory. @public @method resolveRegistration @param {String} fullName @return {Function} fullName's factory */ resolveRegistration: registryAlias('resolve'), /** Registers a factory that can be used for dependency injection (with `inject`) or for service lookup. Each factory is registered with a full name including two parts: `type:name`. A simple example: ```javascript let App = Ember.Application.create(); App.Orange = Ember.Object.extend(); App.register('fruit:favorite', App.Orange); ``` Ember will resolve factories from the `App` namespace automatically. For example `App.CarsController` will be discovered and returned if an application requests `controller:cars`. An example of registering a controller with a non-standard name: ```javascript let App = Ember.Application.create(); let Session = Ember.Controller.extend(); App.register('controller:session', Session); // The Session controller can now be treated like a normal controller, // despite its non-standard name. App.ApplicationController = Ember.Controller.extend({ needs: ['session'] }); ``` Registered factories are **instantiated** by having `create` called on them. Additionally they are **singletons**, each time they are looked up they return the same instance. Some examples modifying that default behavior: ```javascript let App = Ember.Application.create(); App.Person = Ember.Object.extend(); App.Orange = Ember.Object.extend(); App.Email = Ember.Object.extend(); App.session = Ember.Object.create(); App.register('model:user', App.Person, { singleton: false }); App.register('fruit:favorite', App.Orange); App.register('communication:main', App.Email, { singleton: false }); App.register('session', App.session, { instantiate: false }); ``` @method register @param fullName {String} type:name (e.g., 'model:user') @param factory {Function} (e.g., App.Person) @param options {Object} (optional) disable instantiation or singleton usage @public */ register: registryAlias('register'), /** Unregister a factory. ```javascript let App = Ember.Application.create(); let User = Ember.Object.extend(); App.register('model:user', User); App.resolveRegistration('model:user').create() instanceof User //=> true App.unregister('model:user') App.resolveRegistration('model:user') === undefined //=> true ``` @public @method unregister @param {String} fullName */ unregister: registryAlias('unregister'), /** Check if a factory is registered. @public @method hasRegistration @param {String} fullName @return {Boolean} */ hasRegistration: registryAlias('has'), /** Register an option for a particular factory. @public @method registerOption @param {String} fullName @param {String} optionName @param {Object} options */ registerOption: registryAlias('option'), /** Return a specific registered option for a particular factory. @public @method registeredOption @param {String} fullName @param {String} optionName @return {Object} options */ registeredOption: registryAlias('getOption'), /** Register options for a particular factory. @public @method registerOptions @param {String} fullName @param {Object} options */ registerOptions: registryAlias('options'), /** Return registered options for a particular factory. @public @method registeredOptions @param {String} fullName @return {Object} options */ registeredOptions: registryAlias('getOptions'), /** Allow registering options for all factories of a type. ```javascript let App = Ember.Application.create(); let appInstance = App.buildInstance(); // if all of type `connection` must not be singletons appInstance.optionsForType('connection', { singleton: false }); appInstance.register('connection:twitter', TwitterConnection); appInstance.register('connection:facebook', FacebookConnection); let twitter = appInstance.lookup('connection:twitter'); let twitter2 = appInstance.lookup('connection:twitter'); twitter === twitter2; // => false let facebook = appInstance.lookup('connection:facebook'); let facebook2 = appInstance.lookup('connection:facebook'); facebook === facebook2; // => false ``` @public @method registerOptionsForType @param {String} type @param {Object} options */ registerOptionsForType: registryAlias('optionsForType'), /** Return the registered options for all factories of a type. @public @method registeredOptionsForType @param {String} type @return {Object} options */ registeredOptionsForType: registryAlias('getOptionsForType'), /** Define a dependency injection onto a specific factory or all factories of a type. When Ember instantiates a controller, view, or other framework component it can attach a dependency to that component. This is often used to provide services to a set of framework components. An example of providing a session object to all controllers: ```javascript let App = Ember.Application.create(); let Session = Ember.Object.extend({ isAuthenticated: false }); // A factory must be registered before it can be injected App.register('session:main', Session); // Inject 'session:main' onto all factories of the type 'controller' // with the name 'session' App.inject('controller', 'session', 'session:main'); App.IndexController = Ember.Controller.extend({ isLoggedIn: Ember.computed.alias('session.isAuthenticated') }); ``` Injections can also be performed on specific factories. ```javascript App.inject(, , ) App.inject('route', 'source', 'source:main') App.inject('route:application', 'email', 'model:email') ``` It is important to note that injections can only be performed on classes that are instantiated by Ember itself. Instantiating a class directly (via `create` or `new`) bypasses the dependency injection system. **Note:** Ember-Data instantiates its models in a unique manner, and consequently injections onto models (or all models) will not work as expected. Injections on models can be enabled by setting `EmberENV.MODEL_FACTORY_INJECTIONS` to `true`. @public @method inject @param factoryNameOrType {String} @param property {String} @param injectionName {String} **/ inject: registryAlias('injection') }); function registryAlias(name) { return function () { var _registry__; return (_registry__ = this.__registry__)[name].apply(_registry__, arguments); }; } function buildFakeRegistryWithDeprecations(instance, typeForMessage) { var fakeRegistry = {}; var registryProps = { resolve: 'resolveRegistration', register: 'register', unregister: 'unregister', has: 'hasRegistration', option: 'registerOption', options: 'registerOptions', getOptions: 'registeredOptions', optionsForType: 'registerOptionsForType', getOptionsForType: 'registeredOptionsForType', injection: 'inject' }; for (var deprecatedProperty in registryProps) { fakeRegistry[deprecatedProperty] = buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, registryProps[deprecatedProperty]); } return fakeRegistry; } function buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, nonDeprecatedProperty) { return function () { return instance[nonDeprecatedProperty].apply(instance, arguments); }; } }); enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-environment', 'ember-metal'], function (exports, _emberEnvironment, _emberMetal) { /** @module ember @submodule ember-runtime */ 'use strict'; /** `Ember.TargetActionSupport` is a mixin that can be included in a class to add a `triggerAction` method with semantics similar to the Handlebars `{{action}}` helper. In normal Ember usage, the `{{action}}` helper is usually the best choice. This mixin is most often useful when you are doing more complex event handling in Components. @class TargetActionSupport @namespace Ember @extends Ember.Mixin @private */ exports.default = _emberMetal.Mixin.create({ target: null, action: null, actionContext: null, actionContextObject: _emberMetal.computed('actionContext', function () { var actionContext = _emberMetal.get(this, 'actionContext'); if (typeof actionContext === 'string') { var value = _emberMetal.get(this, actionContext); if (value === undefined) { value = _emberMetal.get(_emberEnvironment.context.lookup, actionContext); } return value; } else { return actionContext; } }), /** Send an `action` with an `actionContext` to a `target`. The action, actionContext and target will be retrieved from properties of the object. For example: ```javascript App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { target: Ember.computed.alias('controller'), action: 'save', actionContext: Ember.computed.alias('context'), click() { this.triggerAction(); // Sends the `save` action, along with the current context // to the current controller } }); ``` The `target`, `action`, and `actionContext` can be provided as properties of an optional object argument to `triggerAction` as well. ```javascript App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { click() { this.triggerAction({ action: 'save', target: this.get('controller'), actionContext: this.get('context') }); // Sends the `save` action, along with the current context // to the current controller } }); ``` The `actionContext` defaults to the object you are mixing `TargetActionSupport` into. But `target` and `action` must be specified either as properties or with the argument to `triggerAction`, or a combination: ```javascript App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, { target: Ember.computed.alias('controller'), click() { this.triggerAction({ action: 'save' }); // Sends the `save` action, along with a reference to `this`, // to the current controller } }); ``` @method triggerAction @param opts {Object} (optional, with the optional keys action, target and/or actionContext) @return {Boolean} true if the action was sent successfully and did not return false @private */ triggerAction: function () { var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var action = opts.action || _emberMetal.get(this, 'action'); var target = opts.target; if (!target) { target = getTarget(this); } var actionContext = opts.actionContext; function args(options, actionName) { var ret = []; if (actionName) { ret.push(actionName); } return ret.concat(options); } if (typeof actionContext === 'undefined') { actionContext = _emberMetal.get(this, 'actionContextObject') || this; } if (target && action) { var ret = undefined; if (target.send) { ret = target.send.apply(target, args(actionContext, action)); } else { ret = target[action].apply(target, args(actionContext)); } if (ret !== false) { ret = true; } return ret; } else { return false; } } }); function getTarget(instance) { // TODO: Deprecate specifying `targetObject` var target = _emberMetal.get(instance, 'targetObject'); // if a `targetObject` CP was provided, use it if (target) { return target; } // if _targetObject use it if (instance._targetObject) { return instance._targetObject; } target = _emberMetal.get(instance, 'target'); if (target) { if (typeof target === 'string') { var value = _emberMetal.get(instance, target); if (value === undefined) { value = _emberMetal.get(_emberEnvironment.context.lookup, target); } return value; } else { return target; } } return null; } }); enifed("ember-runtime/string_registry", ["exports"], function (exports) { // STATE within a module is frowned apon, this exists // to support Ember.STRINGS but shield ember internals from this legacy global // API. "use strict"; exports.setStrings = setStrings; exports.getStrings = getStrings; exports.get = get; var STRINGS = {}; function setStrings(strings) { STRINGS = strings; } function getStrings() { return STRINGS; } function get(name) { return STRINGS[name]; } }); enifed('ember-runtime/system/application', ['exports', 'ember-runtime/system/namespace'], function (exports, _emberRuntimeSystemNamespace) { 'use strict'; exports.default = _emberRuntimeSystemNamespace.default.extend(); }); enifed('ember-runtime/system/array_proxy', ['exports', 'ember-metal', 'ember-runtime/utils', 'ember-runtime/system/object', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeUtils, _emberRuntimeSystemObject, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsArray) { 'use strict'; /** @module ember @submodule ember-runtime */ var OUT_OF_RANGE_EXCEPTION = 'Index out of range'; var EMPTY = []; function K() { return this; } /** An ArrayProxy wraps any other object that implements `Ember.Array` and/or `Ember.MutableArray,` forwarding all requests. This makes it very useful for a number of binding use cases or other cases where being able to swap out the underlying array is useful. A simple example of usage: ```javascript let pets = ['dog', 'cat', 'fish']; let ap = Ember.ArrayProxy.create({ content: Ember.A(pets) }); ap.get('firstObject'); // 'dog' ap.set('content', ['amoeba', 'paramecium']); ap.get('firstObject'); // 'amoeba' ``` This class can also be useful as a layer to transform the contents of an array, as they are accessed. This can be done by overriding `objectAtContent`: ```javascript let pets = ['dog', 'cat', 'fish']; let ap = Ember.ArrayProxy.create({ content: Ember.A(pets), objectAtContent: function(idx) { return this.get('content').objectAt(idx).toUpperCase(); } }); ap.get('firstObject'); // . 'DOG' ``` @class ArrayProxy @namespace Ember @extends Ember.Object @uses Ember.MutableArray @public */ exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsMutable_array.default, { /** The content array. Must be an object that implements `Ember.Array` and/or `Ember.MutableArray.` @property content @type Ember.Array @private */ content: null, /** The array that the proxy pretends to be. In the default `ArrayProxy` implementation, this and `content` are the same. Subclasses of `ArrayProxy` can override this property to provide things like sorting and filtering. @property arrangedContent @private */ arrangedContent: _emberMetal.alias('content'), /** Should actually retrieve the object at the specified index from the content. You can override this method in subclasses to transform the content item to something new. This method will only be called if content is non-`null`. @method objectAtContent @param {Number} idx The index to retrieve. @return {Object} the value or undefined if none found @private */ objectAtContent: function (idx) { return _emberRuntimeMixinsArray.objectAt(_emberMetal.get(this, 'arrangedContent'), idx); }, /** Should actually replace the specified objects on the content array. You can override this method in subclasses to transform the content item into something new. This method will only be called if content is non-`null`. @method replaceContent @param {Number} idx The starting index @param {Number} amt The number of items to remove from the content. @param {Array} objects Optional array of objects to insert or null if no objects. @return {void} @private */ replaceContent: function (idx, amt, objects) { _emberMetal.get(this, 'content').replace(idx, amt, objects); }, /** Invoked when the content property is about to change. Notifies observers that the entire array content will change. @private @method _contentWillChange */ _contentWillChange: _emberMetal._beforeObserver('content', function () { this._teardownContent(); }), _teardownContent: function () { var content = _emberMetal.get(this, 'content'); if (content) { _emberRuntimeMixinsArray.removeArrayObserver(content, this, { willChange: 'contentArrayWillChange', didChange: 'contentArrayDidChange' }); } }, /** Override to implement content array `willChange` observer. @method contentArrayWillChange @param {Ember.Array} contentArray the content array @param {Number} start starting index of the change @param {Number} removeCount count of items removed @param {Number} addCount count of items added @private */ contentArrayWillChange: K, /** Override to implement content array `didChange` observer. @method contentArrayDidChange @param {Ember.Array} contentArray the content array @param {Number} start starting index of the change @param {Number} removeCount count of items removed @param {Number} addCount count of items added @private */ contentArrayDidChange: K, /** Invoked when the content property changes. Notifies observers that the entire array content has changed. @private @method _contentDidChange */ _contentDidChange: _emberMetal.observer('content', function () { var content = _emberMetal.get(this, 'content'); this._setupContent(); }), _setupContent: function () { var content = _emberMetal.get(this, 'content'); if (content) { _emberRuntimeMixinsArray.addArrayObserver(content, this, { willChange: 'contentArrayWillChange', didChange: 'contentArrayDidChange' }); } }, _arrangedContentWillChange: _emberMetal._beforeObserver('arrangedContent', function () { var arrangedContent = _emberMetal.get(this, 'arrangedContent'); var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; this.arrangedContentArrayWillChange(this, 0, len, undefined); this.arrangedContentWillChange(this); this._teardownArrangedContent(arrangedContent); }), _arrangedContentDidChange: _emberMetal.observer('arrangedContent', function () { var arrangedContent = _emberMetal.get(this, 'arrangedContent'); var len = arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; this._setupArrangedContent(); this.arrangedContentDidChange(this); this.arrangedContentArrayDidChange(this, 0, undefined, len); }), _setupArrangedContent: function () { var arrangedContent = _emberMetal.get(this, 'arrangedContent'); if (arrangedContent) { _emberRuntimeMixinsArray.addArrayObserver(arrangedContent, this, { willChange: 'arrangedContentArrayWillChange', didChange: 'arrangedContentArrayDidChange' }); } }, _teardownArrangedContent: function () { var arrangedContent = _emberMetal.get(this, 'arrangedContent'); if (arrangedContent) { _emberRuntimeMixinsArray.removeArrayObserver(arrangedContent, this, { willChange: 'arrangedContentArrayWillChange', didChange: 'arrangedContentArrayDidChange' }); } }, arrangedContentWillChange: K, arrangedContentDidChange: K, objectAt: function (idx) { return _emberMetal.get(this, 'content') && this.objectAtContent(idx); }, length: _emberMetal.computed(function () { var arrangedContent = _emberMetal.get(this, 'arrangedContent'); return arrangedContent ? _emberMetal.get(arrangedContent, 'length') : 0; // No dependencies since Enumerable notifies length of change }), _replace: function (idx, amt, objects) { var content = _emberMetal.get(this, 'content'); if (content) { this.replaceContent(idx, amt, objects); } return this; }, replace: function () { if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { this._replace.apply(this, arguments); } else { throw new _emberMetal.Error('Using replace on an arranged ArrayProxy is not allowed.'); } }, _insertAt: function (idx, object) { if (idx > _emberMetal.get(this, 'content.length')) { throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); } this._replace(idx, 0, [object]); return this; }, insertAt: function (idx, object) { if (_emberMetal.get(this, 'arrangedContent') === _emberMetal.get(this, 'content')) { return this._insertAt(idx, object); } else { throw new _emberMetal.Error('Using insertAt on an arranged ArrayProxy is not allowed.'); } }, removeAt: function (start, len) { if ('number' === typeof start) { var content = _emberMetal.get(this, 'content'); var arrangedContent = _emberMetal.get(this, 'arrangedContent'); var indices = []; if (start < 0 || start >= _emberMetal.get(this, 'length')) { throw new _emberMetal.Error(OUT_OF_RANGE_EXCEPTION); } if (len === undefined) { len = 1; } // Get a list of indices in original content to remove for (var i = start; i < start + len; i++) { // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent indices.push(content.indexOf(_emberRuntimeMixinsArray.objectAt(arrangedContent, i))); } // Replace in reverse order since indices will change indices.sort(function (a, b) { return b - a; }); _emberMetal.beginPropertyChanges(); for (var i = 0; i < indices.length; i++) { this._replace(indices[i], 1, EMPTY); } _emberMetal.endPropertyChanges(); } return this; }, pushObject: function (obj) { this._insertAt(_emberMetal.get(this, 'content.length'), obj); return obj; }, pushObjects: function (objects) { if (!(_emberRuntimeMixinsEnumerable.default.detect(objects) || _emberRuntimeUtils.isArray(objects))) { throw new TypeError('Must pass Ember.Enumerable to Ember.MutableArray#pushObjects'); } this._replace(_emberMetal.get(this, 'length'), 0, objects); return this; }, setObjects: function (objects) { if (objects.length === 0) { return this.clear(); } var len = _emberMetal.get(this, 'length'); this._replace(0, len, objects); return this; }, unshiftObject: function (obj) { this._insertAt(0, obj); return obj; }, unshiftObjects: function (objects) { this._replace(0, 0, objects); return this; }, slice: function () { var arr = this.toArray(); return arr.slice.apply(arr, arguments); }, arrangedContentArrayWillChange: function (item, idx, removedCnt, addedCnt) { this.arrayContentWillChange(idx, removedCnt, addedCnt); }, arrangedContentArrayDidChange: function (item, idx, removedCnt, addedCnt) { this.arrayContentDidChange(idx, removedCnt, addedCnt); }, init: function () { this._super.apply(this, arguments); this._setupContent(); this._setupArrangedContent(); }, willDestroy: function () { this._teardownArrangedContent(); this._teardownContent(); } }); }); enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-runtime/mixins/action_handler', 'ember-runtime/inject'], function (exports, _emberMetal, _emberRuntimeMixinsAction_handler, _emberRuntimeInject) { 'no use strict'; // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed /** @module ember @submodule ember-runtime */ // using ember-metal/lib/main here to ensure that ember-debug is setup // if present var _Mixin$create; var POST_INIT = _emberMetal.symbol('POST_INIT'); exports.POST_INIT = POST_INIT; var schedule = _emberMetal.run.schedule; var applyMixin = _emberMetal.Mixin._apply; var finishPartial = _emberMetal.Mixin.finishPartial; var reopen = _emberMetal.Mixin.prototype.reopen; var hasCachedComputedProperties = false; function makeCtor() { // Note: avoid accessing any properties on the object since it makes the // method a lot faster. This is glue code so we want it to be as fast as // possible. var wasApplied = false; var initProperties; var Class = function () { if (!wasApplied) { Class.proto(); // prepare prototype... } if (arguments.length > 0) { initProperties = [arguments[0]]; } this.__defineNonEnumerable(_emberMetal.GUID_KEY_PROPERTY); var m = _emberMetal.meta(this); var proto = m.proto; m.proto = this; if (initProperties) { // capture locally so we can clear the closed over variable var props = initProperties; initProperties = null; var concatenatedProperties = this.concatenatedProperties; var mergedProperties = this.mergedProperties; for (var i = 0; i < props.length; i++) { var properties = props[i]; if (typeof properties !== 'object' && properties !== undefined) { throw new _emberMetal.Error('Ember.Object.create only accepts objects.'); } if (!properties) { continue; } var keyNames = Object.keys(properties); for (var j = 0; j < keyNames.length; j++) { var keyName = keyNames[j]; var value = properties[keyName]; if (_emberMetal.detectBinding(keyName)) { m.writeBindings(keyName, value); } var possibleDesc = this[keyName]; var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; if (concatenatedProperties && concatenatedProperties.length > 0 && concatenatedProperties.indexOf(keyName) >= 0) { var baseValue = this[keyName]; if (baseValue) { if ('function' === typeof baseValue.concat) { value = baseValue.concat(value); } else { value = _emberMetal.makeArray(baseValue).concat(value); } } else { value = _emberMetal.makeArray(value); } } if (mergedProperties && mergedProperties.length && mergedProperties.indexOf(keyName) >= 0) { var originalValue = this[keyName]; value = _emberMetal.assign({}, originalValue, value); } if (desc) { desc.set(this, keyName, value); } else { if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) { this.setUnknownProperty(keyName, value); } else { if (_emberMetal.isFeatureEnabled('mandatory-setter')) { _emberMetal.defineProperty(this, keyName, null, value); // setup mandatory setter } else { this[keyName] = value; } } } } } } finishPartial(this, m); this.init.apply(this, arguments); this[POST_INIT](); m.proto = proto; _emberMetal.finishChains(this); _emberMetal.sendEvent(this, 'init'); }; Class.toString = _emberMetal.Mixin.prototype.toString; Class.willReopen = function () { if (wasApplied) { Class.PrototypeMixin = _emberMetal.Mixin.create(Class.PrototypeMixin); } wasApplied = false; }; Class._initProperties = function (args) { initProperties = args; }; Class.proto = function () { var superclass = Class.superclass; if (superclass) { superclass.proto(); } if (!wasApplied) { wasApplied = true; Class.PrototypeMixin.applyPartial(Class.prototype); } return this.prototype; }; return Class; } /** @class CoreObject @namespace Ember @public */ var CoreObject = makeCtor(); CoreObject.toString = function () { return 'Ember.CoreObject'; }; CoreObject.PrototypeMixin = _emberMetal.Mixin.create((_Mixin$create = { reopen: function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } applyMixin(this, args, true); return this; }, /** An overridable method called when objects are instantiated. By default, does nothing unless it is overridden during class definition. Example: ```javascript const Person = Ember.Object.extend({ init() { alert(`Name is ${this.get('name')}`); } }); let steve = Person.create({ name: "Steve" }); // alerts 'Name is Steve'. ``` NOTE: If you do override `init` for a framework class like `Ember.View`, be sure to call `this._super(...arguments)` in your `init` declaration! If you don't, Ember may not have an opportunity to do important setup work, and you'll see strange behavior in your application. @method init @public */ init: function () {} }, _Mixin$create[POST_INIT] = function () {}, _Mixin$create.__defineNonEnumerable = function (property) { Object.defineProperty(this, property.name, property.descriptor); //this[property.name] = property.descriptor.value; }, _Mixin$create.concatenatedProperties = null, _Mixin$create.mergedProperties = null, _Mixin$create.isDestroyed = false, _Mixin$create.isDestroying = false, _Mixin$create.destroy = function () { if (this.isDestroying) { return; } this.isDestroying = true; schedule('actions', this, this.willDestroy); schedule('destroy', this, this._scheduledDestroy); return this; }, _Mixin$create.willDestroy = function () {}, _Mixin$create._scheduledDestroy = function () { if (this.isDestroyed) { return; } _emberMetal.destroy(this); this.isDestroyed = true; }, _Mixin$create.bind = function (to, from) { if (!(from instanceof _emberMetal.Binding)) { from = _emberMetal.Binding.from(from); } from.to(to).connect(this); return from; }, _Mixin$create.toString = function () { var hasToStringExtension = typeof this.toStringExtension === 'function'; var extension = hasToStringExtension ? ':' + this.toStringExtension() : ''; var ret = '<' + this.constructor.toString() + ':' + _emberMetal.guidFor(this) + extension + '>'; return ret; }, _Mixin$create)); CoreObject.PrototypeMixin.ownerConstructor = CoreObject; CoreObject.__super__ = null; var ClassMixinProps = { ClassMixin: _emberMetal.REQUIRED, PrototypeMixin: _emberMetal.REQUIRED, isClass: true, isMethod: false, /** Creates a new subclass. ```javascript const Person = Ember.Object.extend({ say(thing) { alert(thing); } }); ``` This defines a new subclass of Ember.Object: `Person`. It contains one method: `say()`. You can also create a subclass from any existing class by calling its `extend()` method. For example, you might want to create a subclass of Ember's built-in `Ember.Component` class: ```javascript const PersonComponent = Ember.Component.extend({ tagName: 'li', classNameBindings: ['isAdministrator'] }); ``` When defining a subclass, you can override methods but still access the implementation of your parent class by calling the special `_super()` method: ```javascript const Person = Ember.Object.extend({ say(thing) { var name = this.get('name'); alert(`${name} says: ${thing}`); } }); const Soldier = Person.extend({ say(thing) { this._super(`${thing}, sir!`); }, march(numberOfHours) { alert(`${this.get('name')} marches for ${numberOfHours} hours.`); } }); let yehuda = Soldier.create({ name: "Yehuda Katz" }); yehuda.say("Yes"); // alerts "Yehuda Katz says: Yes, sir!" ``` The `create()` on line #17 creates an *instance* of the `Soldier` class. The `extend()` on line #8 creates a *subclass* of `Person`. Any instance of the `Person` class will *not* have the `march()` method. You can also pass `Mixin` classes to add additional properties to the subclass. ```javascript const Person = Ember.Object.extend({ say(thing) { alert(`${this.get('name')} says: ${thing}`); } }); const SingingMixin = Mixin.create({ sing(thing){ alert(`${this.get('name')} sings: la la la ${thing}`); } }); const BroadwayStar = Person.extend(SingingMixin, { dance() { alert(`${this.get('name')} dances: tap tap tap tap `); } }); ``` The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`. @method extend @static @param {Mixin} [mixins]* One or more Mixin classes @param {Object} [arguments]* Object containing values to use within the new class @public */ extend: function () { var Class = makeCtor(); var proto; Class.ClassMixin = _emberMetal.Mixin.create(this.ClassMixin); Class.PrototypeMixin = _emberMetal.Mixin.create(this.PrototypeMixin); Class.ClassMixin.ownerConstructor = Class; Class.PrototypeMixin.ownerConstructor = Class; reopen.apply(Class.PrototypeMixin, arguments); Class.superclass = this; Class.__super__ = this.prototype; proto = Class.prototype = Object.create(this.prototype); proto.constructor = Class; _emberMetal.generateGuid(proto); _emberMetal.meta(proto).proto = proto; // this will disable observers on prototype Class.ClassMixin.apply(Class); return Class; }, /** Creates an instance of a class. Accepts either no arguments, or an object containing values to initialize the newly instantiated object with. ```javascript const Person = Ember.Object.extend({ helloWorld() { alert(`Hi, my name is ${this.get('name')}`); } }); let tom = Person.create({ name: 'Tom Dale' }); tom.helloWorld(); // alerts "Hi, my name is Tom Dale". ``` `create` will call the `init` function if defined during `Ember.AnyObject.extend` If no arguments are passed to `create`, it will not set values to the new instance during initialization: ```javascript let noName = Person.create(); noName.helloWorld(); // alerts undefined ``` NOTE: For performance reasons, you cannot declare methods or computed properties during `create`. You should instead declare methods and computed properties when using `extend`. @method create @static @param [arguments]* @public */ create: function () { var C = this; for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } if (args.length > 0) { this._initProperties(args); } return new C(); }, /** Augments a constructor's prototype with additional properties and functions: ```javascript const MyObject = Ember.Object.extend({ name: 'an object' }); o = MyObject.create(); o.get('name'); // 'an object' MyObject.reopen({ say(msg){ console.log(msg); } }) o2 = MyObject.create(); o2.say("hello"); // logs "hello" o.say("goodbye"); // logs "goodbye" ``` To add functions and properties to the constructor itself, see `reopenClass` @method reopen @public */ reopen: function () { this.willReopen(); reopen.apply(this.PrototypeMixin, arguments); return this; }, /** Augments a constructor's own properties and functions: ```javascript const MyObject = Ember.Object.extend({ name: 'an object' }); MyObject.reopenClass({ canBuild: false }); MyObject.canBuild; // false o = MyObject.create(); ``` In other words, this creates static properties and functions for the class. These are only available on the class and not on any instance of that class. ```javascript const Person = Ember.Object.extend({ name: "", sayHello() { alert("Hello. My name is " + this.get('name')); } }); Person.reopenClass({ species: "Homo sapiens", createPerson(newPersonsName){ return Person.create({ name:newPersonsName }); } }); let tom = Person.create({ name: "Tom Dale" }); let yehuda = Person.createPerson("Yehuda Katz"); tom.sayHello(); // "Hello. My name is Tom Dale" yehuda.sayHello(); // "Hello. My name is Yehuda Katz" alert(Person.species); // "Homo sapiens" ``` Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda` variables. They are only valid on `Person`. To add functions and properties to instances of a constructor by extending the constructor's prototype see `reopen` @method reopenClass @public */ reopenClass: function () { reopen.apply(this.ClassMixin, arguments); applyMixin(this, arguments, false); return this; }, detect: function (obj) { if ('function' !== typeof obj) { return false; } while (obj) { if (obj === this) { return true; } obj = obj.superclass; } return false; }, detectInstance: function (obj) { return obj instanceof this; }, /** In some cases, you may want to annotate computed properties with additional metadata about how they function or what values they operate on. For example, computed property functions may close over variables that are then no longer available for introspection. You can pass a hash of these values to a computed property like this: ```javascript person: Ember.computed(function() { var personId = this.get('personId'); return Person.create({ id: personId }); }).meta({ type: Person }) ``` Once you've done this, you can retrieve the values saved to the computed property from your class like this: ```javascript MyClass.metaForProperty('person'); ``` This will return the original hash that was passed to `meta()`. @static @method metaForProperty @param key {String} property name @private */ metaForProperty: function (key) { var proto = this.proto(); var possibleDesc = proto[key]; var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined; return desc._meta || {}; }, _computedProperties: _emberMetal.computed(function () { hasCachedComputedProperties = true; var proto = this.proto(); var property; var properties = []; for (var name in proto) { property = proto[name]; if (property && property.isDescriptor) { properties.push({ name: name, meta: property._meta }); } } return properties; }).readOnly(), /** Iterate over each computed property for the class, passing its name and any associated metadata (see `metaForProperty`) to the callback. @static @method eachComputedProperty @param {Function} callback @param {Object} binding @private */ eachComputedProperty: function (callback, binding) { var property; var empty = {}; var properties = _emberMetal.get(this, '_computedProperties'); for (var i = 0; i < properties.length; i++) { property = properties[i]; callback.call(binding || this, property.name, property.meta || empty); } } }; function injectedPropertyAssertion() {} /** Returns a hash of property names and container names that injected properties will lookup on the container lazily. @method _lazyInjections @return {Object} Hash of all lazy injected property keys to container names @private */ ClassMixinProps._lazyInjections = function () { var injections = {}; var proto = this.proto(); var key, desc; for (key in proto) { desc = proto[key]; if (desc instanceof _emberMetal.InjectedProperty) { injections[key] = desc.type + ':' + (desc.name || key); } } return injections; }; var ClassMixin = _emberMetal.Mixin.create(ClassMixinProps); ClassMixin.ownerConstructor = CoreObject; CoreObject.ClassMixin = ClassMixin; ClassMixin.apply(CoreObject); CoreObject.reopen({ didDefineProperty: function (proto, key, value) { if (hasCachedComputedProperties === false) { return; } if (value instanceof _emberMetal.ComputedProperty) { var cache = _emberMetal.meta(this.constructor).readableCache(); if (cache && cache._computedProperties !== undefined) { cache._computedProperties = undefined; } } } }); exports.default = CoreObject; }); /** Defines the properties that will be concatenated from the superclass (instead of overridden). By default, when you extend an Ember class a property defined in the subclass overrides a property with the same name that is defined in the superclass. However, there are some cases where it is preferable to build up a property's value by combining the superclass' property value with the subclass' value. An example of this in use within Ember is the `classNames` property of `Ember.View`. Here is some sample code showing the difference between a concatenated property and a normal one: ```javascript const Bar = Ember.Object.extend({ // Configure which properties to concatenate concatenatedProperties: ['concatenatedProperty'], someNonConcatenatedProperty: ['bar'], concatenatedProperty: ['bar'] }); const FooBar = Bar.extend({ someNonConcatenatedProperty: ['foo'], concatenatedProperty: ['foo'] }); let fooBar = FooBar.create(); fooBar.get('someNonConcatenatedProperty'); // ['foo'] fooBar.get('concatenatedProperty'); // ['bar', 'foo'] ``` This behavior extends to object creation as well. Continuing the above example: ```javascript let fooBar = FooBar.create({ someNonConcatenatedProperty: ['baz'], concatenatedProperty: ['baz'] }) fooBar.get('someNonConcatenatedProperty'); // ['baz'] fooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] ``` Adding a single property that is not an array will just add it in the array: ```javascript let fooBar = FooBar.create({ concatenatedProperty: 'baz' }) view.get('concatenatedProperty'); // ['bar', 'foo', 'baz'] ``` Using the `concatenatedProperties` property, we can tell Ember to mix the content of the properties. In `Ember.Component` the `classNames`, `classNameBindings` and `attributeBindings` properties are concatenated. This feature is available for you to use throughout the Ember object model, although typical app developers are likely to use it infrequently. Since it changes expectations about behavior of properties, you should properly document its usage in each individual concatenated property (to not mislead your users to think they can override the property in a subclass). @property concatenatedProperties @type Array @default null @public */ /** Defines the properties that will be merged from the superclass (instead of overridden). By default, when you extend an Ember class a property defined in the subclass overrides a property with the same name that is defined in the superclass. However, there are some cases where it is preferable to build up a property's value by merging the superclass property value with the subclass property's value. An example of this in use within Ember is the `queryParams` property of routes. Here is some sample code showing the difference between a merged property and a normal one: ```javascript const Bar = Ember.Object.extend({ // Configure which properties are to be merged mergedProperties: ['mergedProperty'], someNonMergedProperty: { nonMerged: 'superclass value of nonMerged' }, mergedProperty: { page: {replace: false}, limit: {replace: true} } }); const FooBar = Bar.extend({ someNonMergedProperty: { completelyNonMerged: 'subclass value of nonMerged' }, mergedProperty: { limit: {replace: false} } }); let fooBar = FooBar.create(); fooBar.get('someNonMergedProperty'); // => { completelyNonMerged: 'subclass value of nonMerged' } // // Note the entire object, including the nonMerged property of // the superclass object, has been replaced fooBar.get('mergedProperty'); // => { // page: {replace: false}, // limit: {replace: false} // } // // Note the page remains from the superclass, and the // `limit` property's value of `false` has been merged from // the subclass. ``` This behavior is not available during object `create` calls. It is only available at `extend` time. In `Ember.Route` the `queryParams` property is merged. This feature is available for you to use throughout the Ember object model, although typical app developers are likely to use it infrequently. Since it changes expectations about behavior of properties, you should properly document its usage in each individual merged property (to not mislead your users to think they can override the property in a subclass). @property mergedProperties @type Array @default null @public */ /** Destroyed object property flag. if this property is `true` the observers and bindings were already removed by the effect of calling the `destroy()` method. @property isDestroyed @default false @public */ /** Destruction scheduled flag. The `destroy()` method has been called. The object stays intact until the end of the run loop at which point the `isDestroyed` flag is set. @property isDestroying @default false @public */ /** Destroys an object by setting the `isDestroyed` flag and removing its metadata, which effectively destroys observers and bindings. If you try to set a property on a destroyed object, an exception will be raised. Note that destruction is scheduled for the end of the run loop and does not happen immediately. It will set an isDestroying flag immediately. @method destroy @return {Ember.Object} receiver @public */ /** Override to implement teardown. @method willDestroy @public */ /** Invoked by the run loop to actually destroy the object. This is scheduled for execution by the `destroy` method. @private @method _scheduledDestroy */ /** Returns a string representation which attempts to provide more information than Javascript's `toString` typically does, in a generic way for all Ember objects. ```javascript const Person = Ember.Object.extend() person = Person.create() person.toString() //=> "" ``` If the object's class is not defined on an Ember namespace, it will indicate it is a subclass of the registered superclass: ```javascript const Student = Person.extend() let student = Student.create() student.toString() //=> "<(subclass of Person):ember1025>" ``` If the method `toStringExtension` is defined, its return value will be included in the output. ```javascript const Teacher = Person.extend({ toStringExtension() { return this.get('fullName'); } }); teacher = Teacher.create() teacher.toString(); //=> "" ``` @method toString @return {String} string representation @public */ /** Provides lookup-time type validation for injected properties. @private @method _onLookup */ enifed('ember-runtime/system/each_proxy', ['exports', 'ember-metal', 'ember-runtime/mixins/array'], function (exports, _emberMetal, _emberRuntimeMixinsArray) { 'use strict'; exports.default = EachProxy; /** This is the object instance returned when you get the `@each` property on an array. It uses the unknownProperty handler to automatically create EachArray instances for property names. @class EachProxy @private */ function EachProxy(content) { this._content = content; this._keys = undefined; this.__ember_meta__ = null; } EachProxy.prototype = { __defineNonEnumerable: function (property) { this[property.name] = property.descriptor.value; }, // .......................................................... // ARRAY CHANGES // Invokes whenever the content array itself changes. arrayWillChange: function (content, idx, removedCnt, addedCnt) { var keys = this._keys; var lim = removedCnt > 0 ? idx + removedCnt : -1; for (var key in keys) { if (lim > 0) { removeObserverForContentKey(content, key, this, idx, lim); } _emberMetal.propertyWillChange(this, key); } }, arrayDidChange: function (content, idx, removedCnt, addedCnt) { var keys = this._keys; var lim = addedCnt > 0 ? idx + addedCnt : -1; for (var key in keys) { if (lim > 0) { addObserverForContentKey(content, key, this, idx, lim); } _emberMetal.propertyDidChange(this, key); } }, // .......................................................... // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS // Start monitoring keys based on who is listening... willWatchProperty: function (property) { this.beginObservingContentKey(property); }, didUnwatchProperty: function (property) { this.stopObservingContentKey(property); }, // .......................................................... // CONTENT KEY OBSERVING // Actual watch keys on the source content. beginObservingContentKey: function (keyName) { var keys = this._keys; if (!keys) { keys = this._keys = new _emberMetal.EmptyObject(); } if (!keys[keyName]) { keys[keyName] = 1; var content = this._content; var len = _emberMetal.get(content, 'length'); addObserverForContentKey(content, keyName, this, 0, len); } else { keys[keyName]++; } }, stopObservingContentKey: function (keyName) { var keys = this._keys; if (keys && keys[keyName] > 0 && --keys[keyName] <= 0) { var content = this._content; var len = _emberMetal.get(content, 'length'); removeObserverForContentKey(content, keyName, this, 0, len); } }, contentKeyWillChange: function (obj, keyName) { _emberMetal.propertyWillChange(this, keyName); }, contentKeyDidChange: function (obj, keyName) { _emberMetal.propertyDidChange(this, keyName); } }; function addObserverForContentKey(content, keyName, proxy, idx, loc) { while (--loc >= idx) { var item = _emberRuntimeMixinsArray.objectAt(content, loc); if (item) { _emberMetal._addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); _emberMetal.addObserver(item, keyName, proxy, 'contentKeyDidChange'); } } } function removeObserverForContentKey(content, keyName, proxy, idx, loc) { while (--loc >= idx) { var item = _emberRuntimeMixinsArray.objectAt(content, loc); if (item) { _emberMetal._removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange'); _emberMetal.removeObserver(item, keyName, proxy, 'contentKeyDidChange'); } } } }); enifed('ember-runtime/system/lazy_load', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { /*globals CustomEvent */ 'use strict'; exports.onLoad = onLoad; exports.runLoadHooks = runLoadHooks; /** @module ember @submodule ember-runtime */ var loadHooks = _emberEnvironment.ENV.EMBER_LOAD_HOOKS || {}; var loaded = {}; var _loaded = loaded; exports._loaded = _loaded; /** Detects when a specific package of Ember (e.g. 'Ember.Application') has fully loaded and is available for extension. The provided `callback` will be called with the `name` passed resolved from a string into the object: ``` javascript Ember.onLoad('Ember.Application' function(hbars) { hbars.registerHelper(...); }); ``` @method onLoad @for Ember @param name {String} name of hook @param callback {Function} callback to be called @private */ function onLoad(name, callback) { var object = loaded[name]; loadHooks[name] = loadHooks[name] || []; loadHooks[name].push(callback); if (object) { callback(object); } } /** Called when an Ember.js package (e.g Ember.Application) has finished loading. Triggers any callbacks registered for this event. @method runLoadHooks @for Ember @param name {String} name of hook @param object {Object} object to pass to callbacks @private */ function runLoadHooks(name, object) { loaded[name] = object; var window = _emberEnvironment.environment.window; if (window && typeof CustomEvent === 'function') { var _event = new CustomEvent(name, { detail: object, name: name }); window.dispatchEvent(_event); } if (loadHooks[name]) { loadHooks[name].forEach(function (callback) { return callback(object); }); } } }); enifed('ember-runtime/system/namespace', ['exports', 'ember-metal', 'ember-environment', 'ember-runtime/system/object'], function (exports, _emberMetal, _emberEnvironment, _emberRuntimeSystemObject) { /** @module ember @submodule ember-runtime */ 'use strict'; exports.isSearchDisabled = isSearchDisabled; exports.setSearchDisabled = setSearchDisabled; var searchDisabled = false; function isSearchDisabled() { return searchDisabled; } function setSearchDisabled(flag) { searchDisabled = !!flag; } /** A Namespace is an object usually used to contain other objects or methods such as an application or framework. Create a namespace anytime you want to define one of these new containers. # Example Usage ```javascript MyFramework = Ember.Namespace.create({ VERSION: '1.0.0' }); ``` @class Namespace @namespace Ember @extends Ember.Object @public */ var Namespace = _emberRuntimeSystemObject.default.extend({ isNamespace: true, init: function () { Namespace.NAMESPACES.push(this); Namespace.PROCESSED = false; }, toString: function () { var name = _emberMetal.get(this, 'name') || _emberMetal.get(this, 'modulePrefix'); if (name) { return name; } findNamespaces(); return this[_emberMetal.NAME_KEY]; }, nameClasses: function () { processNamespace([this.toString()], this, {}); }, destroy: function () { var namespaces = Namespace.NAMESPACES; var toString = this.toString(); if (toString) { _emberEnvironment.context.lookup[toString] = undefined; delete Namespace.NAMESPACES_BY_ID[toString]; } namespaces.splice(namespaces.indexOf(this), 1); this._super.apply(this, arguments); } }); Namespace.reopenClass({ NAMESPACES: [_emberMetal.default], NAMESPACES_BY_ID: { Ember: _emberMetal.default }, PROCESSED: false, processAll: processAllNamespaces, byName: function (name) { if (!searchDisabled) { processAllNamespaces(); } return NAMESPACES_BY_ID[name]; } }); var NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID; var hasOwnProp = ({}).hasOwnProperty; function processNamespace(paths, root, seen) { var idx = paths.length; NAMESPACES_BY_ID[paths.join('.')] = root; // Loop over all of the keys in the namespace, looking for classes for (var key in root) { if (!hasOwnProp.call(root, key)) { continue; } var obj = root[key]; // If we are processing the `Ember` namespace, for example, the // `paths` will start with `["Ember"]`. Every iteration through // the loop will update the **second** element of this list with // the key, so processing `Ember.View` will make the Array // `['Ember', 'View']`. paths[idx] = key; // If we have found an unprocessed class if (obj && obj.toString === classToString && !obj[_emberMetal.NAME_KEY]) { // Replace the class' `toString` with the dot-separated path // and set its `NAME_KEY` obj[_emberMetal.NAME_KEY] = paths.join('.'); // Support nested namespaces } else if (obj && obj.isNamespace) { // Skip aliased namespaces if (seen[_emberMetal.guidFor(obj)]) { continue; } seen[_emberMetal.guidFor(obj)] = true; // Process the child namespace processNamespace(paths, obj, seen); } } paths.length = idx; // cut out last item } function isUppercase(code) { return code >= 65 && // A code <= 90; // Z } function tryIsNamespace(lookup, prop) { try { var obj = lookup[prop]; return obj && obj.isNamespace && obj; } catch (e) { // continue } } function findNamespaces() { if (Namespace.PROCESSED) { return; } var lookup = _emberEnvironment.context.lookup; var keys = Object.keys(lookup); for (var i = 0; i < keys.length; i++) { var key = keys[i]; // Only process entities that start with uppercase A-Z if (!isUppercase(key.charCodeAt(0))) { continue; } var obj = tryIsNamespace(lookup, key); if (obj) { obj[_emberMetal.NAME_KEY] = key; } } } function superClassString(mixin) { var superclass = mixin.superclass; if (superclass) { if (superclass[_emberMetal.NAME_KEY]) { return superclass[_emberMetal.NAME_KEY]; } return superClassString(superclass); } } function classToString() { if (!searchDisabled && !this[_emberMetal.NAME_KEY]) { processAllNamespaces(); } var ret = undefined; if (this[_emberMetal.NAME_KEY]) { ret = this[_emberMetal.NAME_KEY]; } else if (this._toString) { ret = this._toString; } else { var str = superClassString(this); if (str) { ret = '(subclass of ' + str + ')'; } else { ret = '(unknown mixin)'; } this.toString = makeToString(ret); } return ret; } function processAllNamespaces() { var unprocessedNamespaces = !Namespace.PROCESSED; var unprocessedMixins = _emberMetal.hasUnprocessedMixins(); if (unprocessedNamespaces) { findNamespaces(); Namespace.PROCESSED = true; } if (unprocessedNamespaces || unprocessedMixins) { var namespaces = Namespace.NAMESPACES; var namespace = undefined; for (var i = 0; i < namespaces.length; i++) { namespace = namespaces[i]; processNamespace([namespace.toString()], namespace, {}); } _emberMetal.clearUnprocessedMixins(); } } function makeToString(ret) { return function () { return ret; }; } _emberMetal.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. exports.default = Namespace; }); // Preloaded into namespaces enifed('ember-runtime/system/native_array', ['exports', 'ember-metal', 'ember-environment', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/freezable', 'ember-runtime/copy'], function (exports, _emberMetal, _emberEnvironment, _emberRuntimeMixinsArray, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsObservable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsFreezable, _emberRuntimeCopy) { /** @module ember @submodule ember-runtime */ 'use strict'; // Add Ember.Array to Array.prototype. Remove methods with native // implementations and supply some more optimized versions of generic methods // because they are so common. /** The NativeArray mixin contains the properties needed to make the native Array support Ember.MutableArray and all of its dependent APIs. Unless you have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to false, this will be applied automatically. Otherwise you can apply the mixin at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. @class NativeArray @namespace Ember @uses Ember.MutableArray @uses Ember.Observable @uses Ember.Copyable @public */ var NativeArray = _emberMetal.Mixin.create(_emberRuntimeMixinsMutable_array.default, _emberRuntimeMixinsObservable.default, _emberRuntimeMixinsCopyable.default, { // because length is a built-in property we need to know to just get the // original property. get: function (key) { if ('number' === typeof key) { return this[key]; } else { return this._super(key); } }, objectAt: function (idx) { return this[idx]; }, // primitive for array support. replace: function (idx, amt, objects) { if (this.isFrozen) { throw _emberRuntimeMixinsFreezable.FROZEN_ERROR; } // if we replaced exactly the same number of items, then pass only the // replaced range. Otherwise, pass the full remaining array length // since everything has shifted var len = objects ? _emberMetal.get(objects, 'length') : 0; _emberRuntimeMixinsArray.arrayContentWillChange(this, idx, amt, len); if (len === 0) { this.splice(idx, amt); } else { _emberMetal.replace(this, idx, amt, objects); } _emberRuntimeMixinsArray.arrayContentDidChange(this, idx, amt, len); return this; }, // If you ask for an unknown property, then try to collect the value // from member items. unknownProperty: function (key, value) { var ret = undefined; // = this.reducedProperty(key, value); if (value !== undefined && ret === undefined) { ret = this[key] = value; } return ret; }, indexOf: Array.prototype.indexOf, lastIndexOf: Array.prototype.lastIndexOf, copy: function (deep) { if (deep) { return this.map(function (item) { return _emberRuntimeCopy.default(item, true); }); } return this.slice(); } }); // Remove any methods implemented natively so we don't override them var ignore = ['length']; NativeArray.keys().forEach(function (methodName) { if (Array.prototype[methodName]) { ignore.push(methodName); } }); exports.NativeArray // TODO: only use default export = NativeArray = NativeArray.without.apply(NativeArray, ignore); /** Creates an `Ember.NativeArray` from an Array like object. Does not modify the original object. Ember.A is not needed if `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, it is recommended that you use Ember.A when creating addons for ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` will be `true`. Example ```js export default Ember.Component.extend({ tagName: 'ul', classNames: ['pagination'], init() { this._super(...arguments); if (!this.get('content')) { this.set('content', Ember.A()); } } }); ``` @method A @for Ember @return {Ember.NativeArray} @public */ var A = undefined; if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.Array) { NativeArray.apply(Array.prototype); exports.A = A = function (arr) { return arr || []; }; } else { exports.A = A = function (arr) { if (!arr) { arr = []; } return _emberRuntimeMixinsArray.default.detect(arr) ? arr : NativeArray.apply(arr); }; } _emberMetal.default.A = A; exports.A = A; exports.NativeArray = NativeArray; exports.default = NativeArray; }); // Ember.A circular enifed('ember-runtime/system/object', ['exports', 'ember-runtime/system/core_object', 'ember-runtime/mixins/observable'], function (exports, _emberRuntimeSystemCore_object, _emberRuntimeMixinsObservable) { /** @module ember @submodule ember-runtime */ 'use strict'; /** `Ember.Object` is the main base class for all Ember objects. It is a subclass of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details, see the documentation for each of these. @class Object @namespace Ember @extends Ember.CoreObject @uses Ember.Observable @public */ var EmberObject = _emberRuntimeSystemCore_object.default.extend(_emberRuntimeMixinsObservable.default); EmberObject.toString = function () { return 'Ember.Object'; }; exports.default = EmberObject; }); enifed('ember-runtime/system/object_proxy', ['exports', 'ember-runtime/system/object', 'ember-runtime/mixins/-proxy'], function (exports, _emberRuntimeSystemObject, _emberRuntimeMixinsProxy) { 'use strict'; /** `Ember.ObjectProxy` forwards all properties not defined by the proxy itself to a proxied `content` object. ```javascript object = Ember.Object.create({ name: 'Foo' }); proxy = Ember.ObjectProxy.create({ content: object }); // Access and change existing properties proxy.get('name') // 'Foo' proxy.set('name', 'Bar'); object.get('name') // 'Bar' // Create new 'description' property on `object` proxy.set('description', 'Foo is a whizboo baz'); object.get('description') // 'Foo is a whizboo baz' ``` While `content` is unset, setting a property to be delegated will throw an Error. ```javascript proxy = Ember.ObjectProxy.create({ content: null, flag: null }); proxy.set('flag', true); proxy.get('flag'); // true proxy.get('foo'); // undefined proxy.set('foo', 'data'); // throws Error ``` Delegated properties can be bound to and will change when content is updated. Computed properties on the proxy itself can depend on delegated properties. ```javascript ProxyWithComputedProperty = Ember.ObjectProxy.extend({ fullName: function() { var firstName = this.get('firstName'), lastName = this.get('lastName'); if (firstName && lastName) { return firstName + ' ' + lastName; } return firstName || lastName; }.property('firstName', 'lastName') }); proxy = ProxyWithComputedProperty.create(); proxy.get('fullName'); // undefined proxy.set('content', { firstName: 'Tom', lastName: 'Dale' }); // triggers property change for fullName on proxy proxy.get('fullName'); // 'Tom Dale' ``` @class ObjectProxy @namespace Ember @extends Ember.Object @extends Ember._ProxyMixin @public */ exports.default = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsProxy.default); }); enifed('ember-runtime/system/service', ['exports', 'ember-runtime/system/object', 'ember-runtime/inject'], function (exports, _emberRuntimeSystemObject, _emberRuntimeInject) { 'use strict'; /** Creates a property that lazily looks up a service in the container. There are no restrictions as to what objects a service can be injected into. Example: ```javascript App.ApplicationRoute = Ember.Route.extend({ authManager: Ember.inject.service('auth'), model: function() { return this.get('authManager').findCurrentUser(); } }); ``` This example will create an `authManager` property on the application route that looks up the `auth` service in the container, making it easily accessible in the `model` hook. @method service @since 1.10.0 @for Ember.inject @param {String} name (optional) name of the service to inject, defaults to the property's name @return {Ember.InjectedProperty} injection descriptor instance @public */ _emberRuntimeInject.createInjectionHelper('service'); /** @class Service @namespace Ember @extends Ember.Object @since 1.10.0 @public */ var Service = _emberRuntimeSystemObject.default.extend(); Service.reopenClass({ isServiceFactory: true }); exports.default = Service; }); enifed('ember-runtime/system/string', ['exports', 'ember-metal', 'ember-runtime/utils', 'ember-runtime/string_registry'], function (exports, _emberMetal, _emberRuntimeUtils, _emberRuntimeString_registry) { /** @module ember @submodule ember-runtime */ 'use strict'; var STRING_DASHERIZE_REGEXP = /[ _]/g; var STRING_DASHERIZE_CACHE = new _emberMetal.Cache(1000, function (key) { return decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'); }); var STRING_CAMELIZE_REGEXP_1 = /(\-|\_|\.|\s)+(.)?/g; var STRING_CAMELIZE_REGEXP_2 = /(^|\/)([A-Z])/g; var CAMELIZE_CACHE = new _emberMetal.Cache(1000, function (key) { return key.replace(STRING_CAMELIZE_REGEXP_1, function (match, separator, chr) { return chr ? chr.toUpperCase() : ''; }).replace(STRING_CAMELIZE_REGEXP_2, function (match, separator, chr) { return match.toLowerCase(); }); }); var STRING_CLASSIFY_REGEXP_1 = /^(\-|_)+(.)?/; var STRING_CLASSIFY_REGEXP_2 = /(.)(\-|\_|\.|\s)+(.)?/g; var STRING_CLASSIFY_REGEXP_3 = /(^|\/|\.)([a-z])/g; var CLASSIFY_CACHE = new _emberMetal.Cache(1000, function (str) { var replace1 = function (match, separator, chr) { return chr ? '_' + chr.toUpperCase() : ''; }; var replace2 = function (match, initialChar, separator, chr) { return initialChar + (chr ? chr.toUpperCase() : ''); }; var parts = str.split('/'); for (var i = 0; i < parts.length; i++) { parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2); } return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, function (match, separator, chr) { return match.toUpperCase(); }); }); var STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g; var STRING_UNDERSCORE_REGEXP_2 = /\-|\s+/g; var UNDERSCORE_CACHE = new _emberMetal.Cache(1000, function (str) { return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase(); }); var STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z])/g; var CAPITALIZE_CACHE = new _emberMetal.Cache(1000, function (str) { return str.replace(STRING_CAPITALIZE_REGEXP, function (match, separator, chr) { return match.toUpperCase(); }); }); var STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; var DECAMELIZE_CACHE = new _emberMetal.Cache(1000, function (str) { return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase(); }); function _fmt(str, formats) { var cachedFormats = formats; if (!_emberRuntimeUtils.isArray(cachedFormats) || arguments.length > 2) { cachedFormats = new Array(arguments.length - 1); for (var i = 1; i < arguments.length; i++) { cachedFormats[i - 1] = arguments[i]; } } // first, replace any ORDERED replacements. var idx = 0; // the current index for non-numerical replacements return str.replace(/%@([0-9]+)?/g, function (s, argIndex) { argIndex = argIndex ? parseInt(argIndex, 10) - 1 : idx++; s = cachedFormats[argIndex]; return s === null ? '(null)' : s === undefined ? '' : _emberMetal.inspect(s); }); } function fmt(str, formats) { return _fmt.apply(undefined, arguments); } function loc(str, formats) { if (!_emberRuntimeUtils.isArray(formats) || arguments.length > 2) { formats = Array.prototype.slice.call(arguments, 1); } str = _emberRuntimeString_registry.get(str) || str; return _fmt(str, formats); } function w(str) { return str.split(/\s+/); } function decamelize(str) { return DECAMELIZE_CACHE.get(str); } function dasherize(str) { return STRING_DASHERIZE_CACHE.get(str); } function camelize(str) { return CAMELIZE_CACHE.get(str); } function classify(str) { return CLASSIFY_CACHE.get(str); } function underscore(str) { return UNDERSCORE_CACHE.get(str); } function capitalize(str) { return CAPITALIZE_CACHE.get(str); } /** Defines string helper methods including string formatting and localization. Unless `EmberENV.EXTEND_PROTOTYPES.String` is `false` these methods will also be added to the `String.prototype` as well. @class String @namespace Ember @static @public */ exports.default = { /** Apply formatting options to the string. This will look for occurrences of "%@" in your string and substitute them with the arguments you pass into this method. If you want to control the specific order of replacement, you can add a number after the key as well to indicate which argument you want to insert. Ordered insertions are most useful when building loc strings where values you need to insert may appear in different orders. ```javascript "Hello %@ %@".fmt('John', 'Doe'); // "Hello John Doe" "Hello %@2, %@1".fmt('John', 'Doe'); // "Hello Doe, John" ``` @method fmt @param {String} str The string to format @param {Array} formats An array of parameters to interpolate into string. @return {String} formatted string @public @deprecated Use ES6 template strings instead: http://babeljs.io/docs/learn-es2015/#template-strings */ fmt: fmt, /** Formats the passed string, but first looks up the string in the localized strings hash. This is a convenient way to localize text. See `Ember.String.fmt()` for more information on formatting. Note that it is traditional but not required to prefix localized string keys with an underscore or other character so you can easily identify localized strings. ```javascript Ember.STRINGS = { '_Hello World': 'Bonjour le monde', '_Hello %@ %@': 'Bonjour %@ %@' }; Ember.String.loc("_Hello World"); // 'Bonjour le monde'; Ember.String.loc("_Hello %@ %@", ["John", "Smith"]); // "Bonjour John Smith"; ``` @method loc @param {String} str The string to format @param {Array} formats Optional array of parameters to interpolate into string. @return {String} formatted string @public */ loc: loc, /** Splits a string into separate units separated by spaces, eliminating any empty strings in the process. This is a convenience method for split that is mostly useful when applied to the `String.prototype`. ```javascript Ember.String.w("alpha beta gamma").forEach(function(key) { console.log(key); }); // > alpha // > beta // > gamma ``` @method w @param {String} str The string to split @return {Array} array containing the split strings @public */ w: w, /** Converts a camelized string into all lower case separated by underscores. ```javascript 'innerHTML'.decamelize(); // 'inner_html' 'action_name'.decamelize(); // 'action_name' 'css-class-name'.decamelize(); // 'css-class-name' 'my favorite items'.decamelize(); // 'my favorite items' ``` @method decamelize @param {String} str The string to decamelize. @return {String} the decamelized string. @public */ decamelize: decamelize, /** Replaces underscores, spaces, or camelCase with dashes. ```javascript 'innerHTML'.dasherize(); // 'inner-html' 'action_name'.dasherize(); // 'action-name' 'css-class-name'.dasherize(); // 'css-class-name' 'my favorite items'.dasherize(); // 'my-favorite-items' 'privateDocs/ownerInvoice'.dasherize(); // 'private-docs/owner-invoice' ``` @method dasherize @param {String} str The string to dasherize. @return {String} the dasherized string. @public */ dasherize: dasherize, /** Returns the lowerCamelCase form of a string. ```javascript 'innerHTML'.camelize(); // 'innerHTML' 'action_name'.camelize(); // 'actionName' 'css-class-name'.camelize(); // 'cssClassName' 'my favorite items'.camelize(); // 'myFavoriteItems' 'My Favorite Items'.camelize(); // 'myFavoriteItems' 'private-docs/owner-invoice'.camelize(); // 'privateDocs/ownerInvoice' ``` @method camelize @param {String} str The string to camelize. @return {String} the camelized string. @public */ camelize: camelize, /** Returns the UpperCamelCase form of a string. ```javascript 'innerHTML'.classify(); // 'InnerHTML' 'action_name'.classify(); // 'ActionName' 'css-class-name'.classify(); // 'CssClassName' 'my favorite items'.classify(); // 'MyFavoriteItems' 'private-docs/owner-invoice'.classify(); // 'PrivateDocs/OwnerInvoice' ``` @method classify @param {String} str the string to classify @return {String} the classified string @public */ classify: classify, /** More general than decamelize. Returns the lower\_case\_and\_underscored form of a string. ```javascript 'innerHTML'.underscore(); // 'inner_html' 'action_name'.underscore(); // 'action_name' 'css-class-name'.underscore(); // 'css_class_name' 'my favorite items'.underscore(); // 'my_favorite_items' 'privateDocs/ownerInvoice'.underscore(); // 'private_docs/owner_invoice' ``` @method underscore @param {String} str The string to underscore. @return {String} the underscored string. @public */ underscore: underscore, /** Returns the Capitalized form of a string ```javascript 'innerHTML'.capitalize() // 'InnerHTML' 'action_name'.capitalize() // 'Action_name' 'css-class-name'.capitalize() // 'Css-class-name' 'my favorite items'.capitalize() // 'My favorite items' 'privateDocs/ownerInvoice'.capitalize(); // 'PrivateDocs/ownerInvoice' ``` @method capitalize @param {String} str The string to capitalize. @return {String} The capitalized string. @public */ capitalize: capitalize }; exports.fmt = fmt; exports.loc = loc; exports.w = w; exports.decamelize = decamelize; exports.dasherize = dasherize; exports.camelize = camelize; exports.classify = classify; exports.underscore = underscore; exports.capitalize = capitalize; }); enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-runtime/system/object'], function (exports, _emberRuntimeMixinsArray, _emberRuntimeSystemObject) { 'use strict'; exports.isArray = isArray; exports.typeOf = typeOf; // ........................................ // TYPING & ARRAY MESSAGING // var TYPE_MAP = { '[object Boolean]': 'boolean', '[object Number]': 'number', '[object String]': 'string', '[object Function]': 'function', '[object Array]': 'array', '[object Date]': 'date', '[object RegExp]': 'regexp', '[object Object]': 'object' }; var toString = Object.prototype.toString; /** Returns true if the passed object is an array or Array-like. Objects are considered Array-like if any of the following are true: - the object is a native Array - the object has an objectAt property - the object is an Object, and has a length property Unlike `Ember.typeOf` this method returns true even if the passed object is not formally an array but appears to be array-like (i.e. implements `Ember.Array`) ```javascript Ember.isArray(); // false Ember.isArray([]); // true Ember.isArray(Ember.ArrayProxy.create({ content: [] })); // true ``` @method isArray @for Ember @param {Object} obj The object to test @return {Boolean} true if the passed object is an array or Array-like @public */ function isArray(obj) { if (!obj || obj.setInterval) { return false; } if (Array.isArray(obj)) { return true; } if (_emberRuntimeMixinsArray.default.detect(obj)) { return true; } var type = typeOf(obj); if ('array' === type) { return true; } if (obj.length !== undefined && 'object' === type) { return true; } return false; } /** Returns a consistent type for the passed object. Use this instead of the built-in `typeof` to get the type of an item. It will return the same result across all browsers and includes a bit more detail. Here is what will be returned: | Return Value | Meaning | |---------------|------------------------------------------------------| | 'string' | String primitive or String object. | | 'number' | Number primitive or Number object. | | 'boolean' | Boolean primitive or Boolean object. | | 'null' | Null value | | 'undefined' | Undefined value | | 'function' | A function | | 'array' | An instance of Array | | 'regexp' | An instance of RegExp | | 'date' | An instance of Date | | 'class' | An Ember class (created using Ember.Object.extend()) | | 'instance' | An Ember object instance | | 'error' | An instance of the Error object | | 'object' | A JavaScript object not inheriting from Ember.Object | Examples: ```javascript Ember.typeOf(); // 'undefined' Ember.typeOf(null); // 'null' Ember.typeOf(undefined); // 'undefined' Ember.typeOf('michael'); // 'string' Ember.typeOf(new String('michael')); // 'string' Ember.typeOf(101); // 'number' Ember.typeOf(new Number(101)); // 'number' Ember.typeOf(true); // 'boolean' Ember.typeOf(new Boolean(true)); // 'boolean' Ember.typeOf(Ember.makeArray); // 'function' Ember.typeOf([1, 2, 90]); // 'array' Ember.typeOf(/abc/); // 'regexp' Ember.typeOf(new Date()); // 'date' Ember.typeOf(Ember.Object.extend()); // 'class' Ember.typeOf(Ember.Object.create()); // 'instance' Ember.typeOf(new Error('teamocil')); // 'error' // 'normal' JavaScript object Ember.typeOf({ a: 'b' }); // 'object' ``` @method typeOf @for Ember @param {Object} item the item to check @return {String} the type @public */ function typeOf(item) { if (item === null) { return 'null'; } if (item === undefined) { return 'undefined'; } var ret = TYPE_MAP[toString.call(item)] || 'object'; if (ret === 'function') { if (_emberRuntimeSystemObject.default.detect(item)) { ret = 'class'; } } else if (ret === 'object') { if (item instanceof Error) { ret = 'error'; } else if (item instanceof _emberRuntimeSystemObject.default) { ret = 'instance'; } else if (item instanceof Date) { ret = 'date'; } } return ret; } }); enifed('ember-views/compat/attrs', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; exports.getAttrFor = getAttrFor; var MUTABLE_CELL = _emberMetal.symbol('MUTABLE_CELL'); exports.MUTABLE_CELL = MUTABLE_CELL; function isCell(val) { return val && val[MUTABLE_CELL]; } function getAttrFor(attrs, key) { var val = attrs[key]; return isCell(val) ? val.value : val; } }); enifed('ember-views/compat/fallback-view-registry', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; exports.default = _emberMetal.dictionary(null); }); enifed('ember-views/component_lookup', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { 'use strict'; exports.default = _emberRuntime.Object.extend({ componentFor: function (name, owner, options) { var fullName = 'component:' + name; return owner._lookupFactory(fullName, options); }, layoutFor: function (name, owner, options) { var templateFullName = 'template:components/' + name; return owner.lookup(templateFullName, options); } }); }); enifed('ember-views/index', ['exports', 'ember-views/system/ext', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/event_dispatcher', 'ember-views/component_lookup', 'ember-views/mixins/text_support', 'ember-views/views/core_view', 'ember-views/mixins/class_names_support', 'ember-views/mixins/child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/view_support', 'ember-views/mixins/action_support', 'ember-views/compat/attrs', 'ember-views/system/lookup_partial', 'ember-views/utils/lookup-component', 'ember-views/system/action_manager', 'ember-views/compat/fallback-view-registry'], function (exports, _emberViewsSystemExt, _emberViewsSystemJquery, _emberViewsSystemUtils, _emberViewsSystemEvent_dispatcher, _emberViewsComponent_lookup, _emberViewsMixinsText_support, _emberViewsViewsCore_view, _emberViewsMixinsClass_names_support, _emberViewsMixinsChild_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsView_support, _emberViewsMixinsAction_support, _emberViewsCompatAttrs, _emberViewsSystemLookup_partial, _emberViewsUtilsLookupComponent, _emberViewsSystemAction_manager, _emberViewsCompatFallbackViewRegistry) { /** @module ember @submodule ember-views */ 'use strict'; exports.jQuery = _emberViewsSystemJquery.default; exports.isSimpleClick = _emberViewsSystemUtils.isSimpleClick; exports.getViewBounds = _emberViewsSystemUtils.getViewBounds; exports.getViewClientRects = _emberViewsSystemUtils.getViewClientRects; exports.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect; exports.getRootViews = _emberViewsSystemUtils.getRootViews; exports.getChildViews = _emberViewsSystemUtils.getChildViews; exports.STYLE_WARNING = _emberViewsSystemUtils.STYLE_WARNING; exports.getViewId = _emberViewsSystemUtils.getViewId; exports.EventDispatcher = _emberViewsSystemEvent_dispatcher.default; exports.ComponentLookup = _emberViewsComponent_lookup.default; exports.TextSupport = _emberViewsMixinsText_support.default; exports.CoreView = _emberViewsViewsCore_view.default; exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; exports.ChildViewsSupport = _emberViewsMixinsChild_views_support.default; exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; exports.ViewMixin = _emberViewsMixinsView_support.default; exports.ActionSupport = _emberViewsMixinsAction_support.default; exports.getAttrFor = _emberViewsCompatAttrs.getAttrFor; exports.MUTABLE_CELL = _emberViewsCompatAttrs.MUTABLE_CELL; exports.lookupPartial = _emberViewsSystemLookup_partial.default; exports.hasPartial = _emberViewsSystemLookup_partial.hasPartial; exports.lookupComponent = _emberViewsUtilsLookupComponent.default; exports.ActionManager = _emberViewsSystemAction_manager.default; exports.fallbackViewRegistry = _emberViewsCompatFallbackViewRegistry.default; }); // for the side effect of extending Ember.run.queues enifed('ember-views/mixins/action_support', ['exports', 'ember-metal', 'ember-views/compat/attrs'], function (exports, _emberMetal, _emberViewsCompatAttrs) { /** @module ember @submodule ember-views */ 'use strict'; function validateAction(component, actionName) { if (actionName && actionName[_emberViewsCompatAttrs.MUTABLE_CELL]) { actionName = actionName.value; } return actionName; } /** @class ActionSupport @namespace Ember @private */ exports.default = _emberMetal.Mixin.create({ /** Calls an action passed to a component. For example a component for playing or pausing music may translate click events into action notifications of "play" or "stop" depending on some internal state of the component: ```javascript // app/components/play-button.js export default Ember.Component.extend({ click() { if (this.get('isPlaying')) { this.sendAction('play'); } else { this.sendAction('stop'); } } }); ``` The actions "play" and "stop" must be passed to this `play-button` component: ```handlebars {{! app/templates/application.hbs }} {{play-button play=(action "musicStarted") stop=(action "musicStopped")}} ``` When the component receives a browser `click` event it translate this interaction into application-specific semantics ("play" or "stop") and calls the specified action. ```javascript // app/controller/application.js export default Ember.Controller.extend({ actions: { musicStarted() { // called when the play button is clicked // and the music started playing }, musicStopped() { // called when the play button is clicked // and the music stopped playing } } }); ``` If no action is passed to `sendAction` a default name of "action" is assumed. ```javascript // app/components/next-button.js export default Ember.Component.extend({ click() { this.sendAction(); } }); ``` ```handlebars {{! app/templates/application.hbs }} {{next-button action=(action "playNextSongInAlbum")}} ``` ```javascript // app/controllers/application.js App.ApplicationController = Ember.Controller.extend({ actions: { playNextSongInAlbum() { ... } } }); ``` @method sendAction @param [action] {String} the action to call @param [params] {*} arguments for the action @public */ sendAction: function (action) { for (var _len = arguments.length, contexts = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { contexts[_key - 1] = arguments[_key]; } var actionName = undefined; // Send the default action if (action === undefined) { action = 'action'; } actionName = _emberMetal.get(this, 'attrs.' + action) || _emberMetal.get(this, action); actionName = validateAction(this, actionName); // If no action name for that action could be found, just abort. if (actionName === undefined) { return; } if (typeof actionName === 'function') { actionName.apply(undefined, contexts); } else { this.triggerAction({ action: actionName, actionContext: contexts }); } }, send: function (actionName) { for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } var target = undefined; var action = this.actions && this.actions[actionName]; if (action) { var shouldBubble = action.apply(this, args) === true; if (!shouldBubble) { return; } } target = _emberMetal.get(this, 'target') || _emberMetal.get(this, '_targetObject'); if (target) { var _target; (_target = target).send.apply(_target, arguments); } else {} } }); }); enifed('ember-views/mixins/child_views_support', ['exports', 'ember-metal', 'container', 'ember-views/system/utils'], function (exports, _emberMetal, _container, _emberViewsSystemUtils) { /** @module ember @submodule ember-views */ 'use strict'; exports.default = _emberMetal.Mixin.create({ init: function () { this._super.apply(this, arguments); _emberViewsSystemUtils.initChildViews(this); }, /** Array of child views. You should never edit this array directly. @property childViews @type Array @default [] @private */ childViews: _emberMetal.descriptor({ configurable: false, enumerable: false, get: function () { return _emberViewsSystemUtils.getChildViews(this); } }), appendChild: function (view) { this.linkChild(view); _emberViewsSystemUtils.addChildView(this, view); }, linkChild: function (instance) { if (!_container.getOwner(instance)) { _container.setOwner(instance, _container.getOwner(this)); } } }); }); enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-views */ 'use strict'; var EMPTY_ARRAY = Object.freeze([]); /** @class ClassNamesSupport @namespace Ember @private */ exports.default = _emberMetal.Mixin.create({ concatenatedProperties: ['classNames', 'classNameBindings'], init: function () { this._super.apply(this, arguments); this.classNameBindings = this.classNameBindings.slice(); this.classNames = this.classNames.slice(); }, /** Standard CSS class names to apply to the view's outer element. This property automatically inherits any class names defined by the view's superclasses as well. @property classNames @type Array @default ['ember-view'] @public */ classNames: EMPTY_ARRAY, /** A list of properties of the view to apply as class names. If the property is a string value, the value of that string will be applied as a class name. ```javascript // Applies the 'high' class to the view element Ember.Component.extend({ classNameBindings: ['priority'], priority: 'high' }); ``` If the value of the property is a Boolean, the name of that property is added as a dasherized class name. ```javascript // Applies the 'is-urgent' class to the view element Ember.Component.extend({ classNameBindings: ['isUrgent'], isUrgent: true }); ``` If you would prefer to use a custom value instead of the dasherized property name, you can pass a binding like this: ```javascript // Applies the 'urgent' class to the view element Ember.Component.extend({ classNameBindings: ['isUrgent:urgent'], isUrgent: true }); ``` This list of properties is inherited from the component's superclasses as well. @property classNameBindings @type Array @default [] @public */ classNameBindings: EMPTY_ARRAY }); }); enifed('ember-views/mixins/text_support', ['exports', 'ember-metal', 'ember-runtime'], function (exports, _emberMetal, _emberRuntime) { /** @module ember @submodule ember-views */ 'use strict'; var KEY_EVENTS = { 13: 'insertNewline', 27: 'cancel' }; /** `TextSupport` is a shared mixin used by both `Ember.TextField` and `Ember.TextArea`. `TextSupport` adds a number of methods that allow you to specify a controller action to invoke when a certain event is fired on your text field or textarea. The specifed controller action would get the current value of the field passed in as the only argument unless the value of the field is empty. In that case, the instance of the field itself is passed in as the only argument. Let's use the pressing of the escape key as an example. If you wanted to invoke a controller action when a user presses the escape key while on your field, you would use the `escape-press` attribute on your field like so: ```handlebars {{! application.hbs}} {{input escape-press='alertUser'}} ``` ```javascript App = Ember.Application.create(); App.ApplicationController = Ember.Controller.extend({ actions: { alertUser: function ( currentValue ) { alert( 'escape pressed, current value: ' + currentValue ); } } }); ``` The following chart is a visual representation of what takes place when the escape key is pressed in this scenario: ``` The Template +---------------------------+ | | | escape-press='alertUser' | | | TextSupport Mixin +----+----------------------+ +-------------------------------+ | | cancel method | | escape button pressed | | +-------------------------------> | checks for the `escape-press` | | attribute and pulls out the | +-------------------------------+ | `alertUser` value | | action name 'alertUser' +-------------------------------+ | sent to controller v Controller +------------------------------------------ + | | | actions: { | | alertUser: function( currentValue ){ | | alert( 'the esc key was pressed!' ) | | } | | } | | | +-------------------------------------------+ ``` Here are the events that we currently support along with the name of the attribute you would need to use on your field. To reiterate, you would use the attribute name like so: ```handlebars {{input attribute-name='controllerAction'}} ``` ``` +--------------------+----------------+ | | | | event | attribute name | +--------------------+----------------+ | new line inserted | insert-newline | | | | | enter key pressed | insert-newline | | | | | cancel key pressed | escape-press | | | | | focusin | focus-in | | | | | focusout | focus-out | | | | | keypress | key-press | | | | | keyup | key-up | | | | | keydown | key-down | +--------------------+----------------+ ``` @class TextSupport @namespace Ember @uses Ember.TargetActionSupport @extends Ember.Mixin @private */ exports.default = _emberMetal.Mixin.create(_emberRuntime.TargetActionSupport, { value: '', attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'], placeholder: null, disabled: false, maxlength: null, init: function () { this._super.apply(this, arguments); this.on('paste', this, this._elementValueDidChange); this.on('cut', this, this._elementValueDidChange); this.on('input', this, this._elementValueDidChange); }, /** The action to be sent when the user presses the return key. This is similar to the `{{action}}` helper, but is fired when the user presses the return key when editing a text field, and sends the value of the field as the context. @property action @type String @default null @private */ action: null, /** The event that should send the action. Options are: * `enter`: the user pressed enter * `keyPress`: the user pressed a key @property onEvent @type String @default enter @private */ onEvent: 'enter', /** Whether the `keyUp` event that triggers an `action` to be sent continues propagating to other views. By default, when the user presses the return key on their keyboard and the text field has an `action` set, the action will be sent to the view's controller and the key event will stop propagating. If you would like parent views to receive the `keyUp` event even after an action has been dispatched, set `bubbles` to true. @property bubbles @type Boolean @default false @private */ bubbles: false, interpretKeyEvents: function (event) { var map = KEY_EVENTS; var method = map[event.keyCode]; this._elementValueDidChange(); if (method) { return this[method](event); } }, _elementValueDidChange: function () { _emberMetal.set(this, 'value', this.element.value); }, change: function (event) { this._elementValueDidChange(event); }, /** Allows you to specify a controller action to invoke when either the `enter` key is pressed or, in the case of the field being a textarea, when a newline is inserted. To use this method, give your field an `insert-newline` attribute. The value of that attribute should be the name of the action in your controller that you wish to invoke. For an example on how to use the `insert-newline` attribute, please reference the example near the top of this file. @method insertNewline @param {Event} event @private */ insertNewline: function (event) { sendAction('enter', this, event); sendAction('insert-newline', this, event); }, /** Allows you to specify a controller action to invoke when the escape button is pressed. To use this method, give your field an `escape-press` attribute. The value of that attribute should be the name of the action in your controller that you wish to invoke. For an example on how to use the `escape-press` attribute, please reference the example near the top of this file. @method cancel @param {Event} event @private */ cancel: function (event) { sendAction('escape-press', this, event); }, /** Allows you to specify a controller action to invoke when a field receives focus. To use this method, give your field a `focus-in` attribute. The value of that attribute should be the name of the action in your controller that you wish to invoke. For an example on how to use the `focus-in` attribute, please reference the example near the top of this file. @method focusIn @param {Event} event @private */ focusIn: function (event) { sendAction('focus-in', this, event); }, /** Allows you to specify a controller action to invoke when a field loses focus. To use this method, give your field a `focus-out` attribute. The value of that attribute should be the name of the action in your controller that you wish to invoke. For an example on how to use the `focus-out` attribute, please reference the example near the top of this file. @method focusOut @param {Event} event @private */ focusOut: function (event) { this._elementValueDidChange(event); sendAction('focus-out', this, event); }, /** Allows you to specify a controller action to invoke when a key is pressed. To use this method, give your field a `key-press` attribute. The value of that attribute should be the name of the action in your controller you that wish to invoke. For an example on how to use the `key-press` attribute, please reference the example near the top of this file. @method keyPress @param {Event} event @private */ keyPress: function (event) { sendAction('key-press', this, event); }, /** Allows you to specify a controller action to invoke when a key-up event is fired. To use this method, give your field a `key-up` attribute. The value of that attribute should be the name of the action in your controller that you wish to invoke. For an example on how to use the `key-up` attribute, please reference the example near the top of this file. @method keyUp @param {Event} event @private */ keyUp: function (event) { this.interpretKeyEvents(event); this.sendAction('key-up', _emberMetal.get(this, 'value'), event); }, /** Allows you to specify a controller action to invoke when a key-down event is fired. To use this method, give your field a `key-down` attribute. The value of that attribute should be the name of the action in your controller that you wish to invoke. For an example on how to use the `key-down` attribute, please reference the example near the top of this file. @method keyDown @param {Event} event @private */ keyDown: function (event) { this.sendAction('key-down', _emberMetal.get(this, 'value'), event); } }); // In principle, this shouldn't be necessary, but the legacy // sendAction semantics for TextField are different from // the component semantics so this method normalizes them. function sendAction(eventName, view, event) { var action = _emberMetal.get(view, 'attrs.' + eventName) || _emberMetal.get(view, eventName); var on = _emberMetal.get(view, 'onEvent'); var value = _emberMetal.get(view, 'value'); // back-compat support for keyPress as an event name even though // it's also a method name that consumes the event (and therefore // incompatible with sendAction semantics). if (on === eventName || on === 'keyPress' && eventName === 'key-press') { view.sendAction('action', value); } view.sendAction(eventName, value); if (action || on === eventName) { if (!_emberMetal.get(view, 'bubbles')) { event.stopPropagation(); } } } }); enifed('ember-views/mixins/view_state_support', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-views */ 'use strict'; exports.default = _emberMetal.Mixin.create({ _transitionTo: function (state) { var priorState = this._currentState; var currentState = this._currentState = this._states[state]; this._state = state; if (priorState && priorState.exit) { priorState.exit(this); } if (currentState.enter) { currentState.enter(this); } } }); }); enifed('ember-views/mixins/view_support', ['exports', 'ember-metal', 'ember-runtime', 'ember-environment', 'ember-views/system/utils', 'ember-views/system/jquery'], function (exports, _emberMetal, _emberRuntime, _emberEnvironment, _emberViewsSystemUtils, _emberViewsSystemJquery) { 'use strict'; var _Mixin$create; var INIT_WAS_CALLED = _emberMetal.symbol('INIT_WAS_CALLED'); function K() { return this; } /** @class ViewMixin @namespace Ember @private */ exports.default = _emberMetal.Mixin.create((_Mixin$create = { concatenatedProperties: ['attributeBindings'], // .......................................................... // TEMPLATE SUPPORT // /** Return the nearest ancestor that is an instance of the provided class or mixin. @method nearestOfType @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself), or an instance of Ember.Mixin. @return Ember.View @deprecated use `yield` and contextual components for composition instead. @private */ nearestOfType: function (klass) { var view = this.parentView; var isOfType = klass instanceof _emberMetal.Mixin ? function (view) { return klass.detect(view); } : function (view) { return klass.detect(view.constructor); }; while (view) { if (isOfType(view)) { return view; } view = view.parentView; } }, /** Return the nearest ancestor that has a given property. @method nearestWithProperty @param {String} property A property name @return Ember.View @deprecated use `yield` and contextual components for composition instead. @private */ nearestWithProperty: function (property) { var view = this.parentView; while (view) { if (property in view) { return view; } view = view.parentView; } }, /** Renders the view again. This will work regardless of whether the view is already in the DOM or not. If the view is in the DOM, the rendering process will be deferred to give bindings a chance to synchronize. If children were added during the rendering process using `appendChild`, `rerender` will remove them, because they will be added again if needed by the next `render`. In general, if the display of your view changes, you should modify the DOM element directly instead of manually calling `rerender`, which can be slow. @method rerender @public */ rerender: function () { return this._currentState.rerender(this); }, // .......................................................... // ELEMENT SUPPORT // /** Returns the current DOM element for the view. @property element @type DOMElement @public */ element: null, /** Returns a jQuery object for this view's element. If you pass in a selector string, this method will return a jQuery object, using the current element as its buffer. For example, calling `view.$('li')` will return a jQuery object containing all of the `li` elements inside the DOM element of this view. @method $ @param {String} [selector] a jQuery-compatible selector string @return {jQuery} the jQuery object for the DOM node @public */ $: function (sel) { return this._currentState.$(this, sel); }, /** Appends the view's element to the specified parent element. Note that this method just schedules the view to be appended; the DOM element will not be appended to the given element until all bindings have finished synchronizing. This is not typically a function that you will need to call directly when building your application. If you do need to use `appendTo`, be sure that the target element you are providing is associated with an `Ember.Application` and does not have an ancestor element that is associated with an Ember view. @method appendTo @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object @return {Ember.View} receiver @private */ appendTo: function (selector) { var env = this._environment || _emberEnvironment.environment; var target = undefined; if (env.hasDOM) { target = typeof selector === 'string' ? document.querySelector(selector) : selector; } else { target = selector; } this.renderer.appendTo(this, target); return this; }, /** Creates a new DOM element, renders the view into it, then returns the element. By default, the element created and rendered into will be a `BODY` element, since this is the default context that views are rendered into when being inserted directly into the DOM. ```js let element = view.renderToElement(); element.tagName; // => "BODY" ``` You can override the kind of element rendered into and returned by specifying an optional tag name as the first argument. ```js let element = view.renderToElement('table'); element.tagName; // => "TABLE" ``` This method is useful if you want to render the view into an element that is not in the document's body. Instead, a new `body` element, detached from the DOM is returned. FastBoot uses this to serialize the rendered view into a string for transmission over the network. ```js app.visit('/').then(function(instance) { let element; Ember.run(function() { element = renderToElement(instance); }); res.send(serialize(element)); }); ``` @method renderToElement @param {String} tagName The tag of the element to create and render into. Defaults to "body". @return {HTMLBodyElement} element @private */ renderToElement: function (tagName) { tagName = tagName || 'body'; var element = this.renderer.createElement(tagName); this.renderer.appendTo(this, element); return element; }, /** Replaces the content of the specified parent element with this view's element. If the view does not have an HTML representation yet, the element will be generated automatically. Note that this method just schedules the view to be appended; the DOM element will not be appended to the given element until all bindings have finished synchronizing @method replaceIn @param {String|DOMElement|jQuery} target A selector, element, HTML string, or jQuery object @return {Ember.View} received @private */ replaceIn: function (selector) { var target = _emberViewsSystemJquery.default(selector); this.renderer.replaceIn(this, target[0]); return this; }, /** Appends the view's element to the document body. If the view does not have an HTML representation yet the element will be generated automatically. If your application uses the `rootElement` property, you must append the view within that element. Rendering views outside of the `rootElement` is not supported. Note that this method just schedules the view to be appended; the DOM element will not be appended to the document body until all bindings have finished synchronizing. @method append @return {Ember.View} receiver @private */ append: function () { return this.appendTo(document.body); }, /** The HTML `id` of the view's element in the DOM. You can provide this value yourself but it must be unique (just as in HTML): ```handlebars {{my-component elementId="a-really-cool-id"}} ``` If not manually set a default value will be provided by the framework. Once rendered an element's `elementId` is considered immutable and you should never change it. If you need to compute a dynamic value for the `elementId`, you should do this when the component or element is being instantiated: ```javascript export default Ember.Component.extend({ init() { this._super(...arguments); let index = this.get('index'); this.set('elementId', 'component-id' + index); } }); ``` @property elementId @type String @public */ elementId: null, /** Attempts to discover the element in the parent element. The default implementation looks for an element with an ID of `elementId` (or the view's guid if `elementId` is null). You can override this method to provide your own form of lookup. For example, if you want to discover your element using a CSS class name instead of an ID. @method findElementInParentElement @param {DOMElement} parentElement The parent's DOM element @return {DOMElement} The discovered element @private */ findElementInParentElement: function (parentElem) { var id = '#' + this.elementId; return _emberViewsSystemJquery.default(id)[0] || _emberViewsSystemJquery.default(id, parentElem)[0]; }, /** Called when a view is going to insert an element into the DOM. @event willInsertElement @public */ willInsertElement: K, /** Called when the element of the view has been inserted into the DOM or after the view was re-rendered. Override this function to do any set up that requires an element in the document body. When a view has children, didInsertElement will be called on the child view(s) first, bubbling upwards through the hierarchy. @event didInsertElement @public */ didInsertElement: K, /** Called when the view is about to rerender, but before anything has been torn down. This is a good opportunity to tear down any manual observers you have installed based on the DOM state @event willClearRender @public */ willClearRender: K, /** You must call `destroy` on a view to destroy the view (and all of its child views). This will remove the view from any parent node, then make sure that the DOM element managed by the view can be released by the memory manager. @method destroy @private */ destroy: function () { this._super.apply(this, arguments); this._currentState.destroy(this); }, /** Called when the element of the view is going to be destroyed. Override this function to do any teardown that requires an element, like removing event listeners. Please note: any property changes made during this event will have no effect on object observers. @event willDestroyElement @public */ willDestroyElement: K, /** Called when the parentView property has changed. @event parentViewDidChange @private */ parentViewDidChange: K, // .......................................................... // STANDARD RENDER PROPERTIES // /** Tag name for the view's outer element. The tag name is only used when an element is first created. If you change the `tagName` for an element, you must destroy and recreate the view element. By default, the render buffer will use a `
    ` tag for views. @property tagName @type String @default null @public */ // We leave this null by default so we can tell the difference between // the default case and a user-specified tag. tagName: null, // ....................................................... // CORE DISPLAY METHODS // /** Setup a view, but do not finish waking it up. * configure `childViews` * register the view with the global views hash, which is used for event dispatch @method init @private */ init: function () { this._super.apply(this, arguments); if (!this.elementId && this.tagName !== '') { this.elementId = _emberMetal.guidFor(this); } this[INIT_WAS_CALLED] = true; if (typeof this.didInitAttrs === 'function') {} } }, _Mixin$create[_emberRuntime.POST_INIT] = function () { this._super(); this.renderer.componentInitAttrs(this, this.attrs || {}); }, _Mixin$create.__defineNonEnumerable = function (property) { this[property.name] = property.descriptor.value; }, _Mixin$create.handleEvent = function (eventName, evt) { return this._currentState.handleEvent(this, eventName, evt); }, _Mixin$create)); }); /* This is a special hook implemented in CoreObject, that allows Views/Components to have a way to ensure that `init` fires before `didInitAttrs` / `didReceiveAttrs` (so that `this._super` in init does not trigger `didReceiveAttrs` before the classes own `init` is finished). @method __postInitInitialization @private */ // ....................................................... // EVENT HANDLING // /** Handle events from `Ember.EventDispatcher` @method handleEvent @param eventName {String} @param evt {Event} @private */ enifed("ember-views/system/action_manager", ["exports"], function (exports) { /** @module ember @submodule ember-views */ "use strict"; exports.default = ActionManager; function ActionManager() {} /** Global action id hash. @private @property registeredActions @type Object */ ActionManager.registeredActions = {}; }); enifed('ember-views/system/event_dispatcher', ['exports', 'ember-metal', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/action_manager', 'container', 'ember-environment', 'ember-views/compat/fallback-view-registry'], function (exports, _emberMetal, _emberRuntime, _emberViewsSystemJquery, _emberViewsSystemAction_manager, _container, _emberEnvironment, _emberViewsCompatFallbackViewRegistry) { /** @module ember @submodule ember-views */ 'use strict'; var ROOT_ELEMENT_CLASS = 'ember-application'; var ROOT_ELEMENT_SELECTOR = '.' + ROOT_ELEMENT_CLASS; /** `Ember.EventDispatcher` handles delegating browser events to their corresponding `Ember.Views.` For example, when you click on a view, `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets called. @class EventDispatcher @namespace Ember @private @extends Ember.Object */ exports.default = _emberRuntime.Object.extend({ /** The set of events names (and associated handler function names) to be setup and dispatched by the `EventDispatcher`. Modifications to this list can be done at setup time, generally via the `Ember.Application.customEvents` hash. To add new events to be listened to: ```javascript let App = Ember.Application.create({ customEvents: { paste: 'paste' } }); ``` To prevent default events from being listened to: ```javascript let App = Ember.Application.create({ customEvents: { mouseenter: null, mouseleave: null } }); ``` @property events @type Object @private */ events: { touchstart: 'touchStart', touchmove: 'touchMove', touchend: 'touchEnd', touchcancel: 'touchCancel', keydown: 'keyDown', keyup: 'keyUp', keypress: 'keyPress', mousedown: 'mouseDown', mouseup: 'mouseUp', contextmenu: 'contextMenu', click: 'click', dblclick: 'doubleClick', mousemove: 'mouseMove', focusin: 'focusIn', focusout: 'focusOut', mouseenter: 'mouseEnter', mouseleave: 'mouseLeave', submit: 'submit', input: 'input', change: 'change', dragstart: 'dragStart', drag: 'drag', dragenter: 'dragEnter', dragleave: 'dragLeave', dragover: 'dragOver', drop: 'drop', dragend: 'dragEnd' }, /** The root DOM element to which event listeners should be attached. Event listeners will be attached to the document unless this is overridden. Can be specified as a DOMElement or a selector string. The default body is a string since this may be evaluated before document.body exists in the DOM. @private @property rootElement @type DOMElement @default 'body' */ rootElement: 'body', /** It enables events to be dispatched to the view's `eventManager.` When present, this object takes precedence over handling of events on the view itself. Note that most Ember applications do not use this feature. If your app also does not use it, consider setting this property to false to gain some performance improvement by allowing the EventDispatcher to skip the search for the `eventManager` on the view tree. ```javascript let EventDispatcher = Em.EventDispatcher.extend({ events: { click : 'click', focusin : 'focusIn', focusout : 'focusOut', change : 'change' }, canDispatchToEventManager: false }); container.register('event_dispatcher:main', EventDispatcher); ``` @property canDispatchToEventManager @type boolean @default 'true' @since 1.7.0 @private */ canDispatchToEventManager: true, init: function () { this._super(); }, /** Sets up event listeners for standard browser events. This will be called after the browser sends a `DOMContentReady` event. By default, it will set up all of the listeners on the document body. If you would like to register the listeners on a different element, set the event dispatcher's `root` property. @private @method setup @param addedEvents {Object} */ setup: function (addedEvents, rootElement) { var event = undefined; var events = this._finalEvents = _emberMetal.assign({}, _emberMetal.get(this, 'events'), addedEvents); if (!_emberMetal.isNone(rootElement)) { _emberMetal.set(this, 'rootElement', rootElement); } rootElement = _emberViewsSystemJquery.default(_emberMetal.get(this, 'rootElement')); rootElement.addClass(ROOT_ELEMENT_CLASS); if (!rootElement.is(ROOT_ELEMENT_SELECTOR)) { throw new TypeError('Unable to add \'' + ROOT_ELEMENT_CLASS + '\' class to root element (' + (rootElement.selector || rootElement[0].tagName) + '). Make sure you set rootElement to the body or an element in the body.'); } for (event in events) { if (events.hasOwnProperty(event)) { this.setupHandler(rootElement, event, events[event]); } } }, /** Registers an event listener on the rootElement. If the given event is triggered, the provided event handler will be triggered on the target view. If the target view does not implement the event handler, or if the handler returns `false`, the parent view will be called. The event will continue to bubble to each successive parent view until it reaches the top. @private @method setupHandler @param {Element} rootElement @param {String} event the browser-originated event to listen to @param {String} eventName the name of the method to call on the view */ setupHandler: function (rootElement, event, eventName) { var self = this; var owner = _container.getOwner(this); var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsCompatFallbackViewRegistry.default; if (eventName === null) { return; } rootElement.on(event + '.ember', '.ember-view', function (evt, triggeringManager) { var view = viewRegistry[this.id]; var result = true; var manager = self.canDispatchToEventManager ? self._findNearestEventManager(view, eventName) : null; if (manager && manager !== triggeringManager) { result = self._dispatchEvent(manager, evt, eventName, view); } else if (view) { result = self._bubbleEvent(view, evt, eventName); } return result; }); rootElement.on(event + '.ember', '[data-ember-action]', function (evt) { var actionId = _emberViewsSystemJquery.default(evt.currentTarget).attr('data-ember-action'); var actions = _emberViewsSystemAction_manager.default.registeredActions[actionId]; // In Glimmer2 this attribute is set to an empty string and an additional // attribute it set for each action on a given element. In this case, the // attributes need to be read so that a proper set of action handlers can // be coalesced. if (actionId === '') { var attributes = evt.currentTarget.attributes; var attributeCount = attributes.length; actions = []; for (var i = 0; i < attributeCount; i++) { var attr = attributes.item(i); var attrName = attr.name; if (attrName.indexOf('data-ember-action-') === 0) { actions = actions.concat(_emberViewsSystemAction_manager.default.registeredActions[attr.value]); } } } // We have to check for actions here since in some cases, jQuery will trigger // an event on `removeChild` (i.e. focusout) after we've already torn down the // action handlers for the view. if (!actions) { return; } for (var index = 0; index < actions.length; index++) { var action = actions[index]; if (action && action.eventName === eventName) { return action.handler(evt); } } }); }, _findNearestEventManager: function (view, eventName) { var manager = null; while (view) { manager = _emberMetal.get(view, 'eventManager'); if (manager && manager[eventName]) { break; } view = _emberMetal.get(view, 'parentView'); } return manager; }, _dispatchEvent: function (object, evt, eventName, view) { var result = true; var handler = object[eventName]; if (typeof handler === 'function') { result = _emberMetal.run(object, handler, evt, view); // Do not preventDefault in eventManagers. evt.stopPropagation(); } else { result = this._bubbleEvent(view, evt, eventName); } return result; }, _bubbleEvent: function (view, evt, eventName) { return view.handleEvent(eventName, evt); }, destroy: function () { var rootElement = _emberMetal.get(this, 'rootElement'); _emberViewsSystemJquery.default(rootElement).off('.ember', '**').removeClass(ROOT_ELEMENT_CLASS); return this._super.apply(this, arguments); }, toString: function () { return '(EventDispatcher)'; } }); }); enifed('ember-views/system/ext', ['exports', 'ember-metal'], function (exports, _emberMetal) { /** @module ember @submodule ember-views */ 'use strict'; // Add a new named queue for rendering views that happens // after bindings have synced, and a queue for scheduling actions // that should occur after view rendering. _emberMetal.run._addQueue('render', 'actions'); _emberMetal.run._addQueue('afterRender', 'render'); }); enifed('ember-views/system/jquery', ['exports', 'ember-environment'], function (exports, _emberEnvironment) { 'use strict'; var jQuery = undefined; if (_emberEnvironment.environment.hasDOM) { jQuery = _emberEnvironment.context.imports.jQuery; if (jQuery) { if (jQuery.event.addProp) { jQuery.event.addProp('dataTransfer'); } else { // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend'].forEach(function (eventName) { jQuery.event.fixHooks[eventName] = { props: ['dataTransfer'] }; }); } } } exports.default = jQuery; }); enifed('ember-views/system/lookup_partial', ['exports', 'ember-metal'], function (exports, _emberMetal) { 'use strict'; exports.default = lookupPartial; exports.hasPartial = hasPartial; function parseUnderscoredName(templateName) { var nameParts = templateName.split('/'); var lastPart = nameParts[nameParts.length - 1]; nameParts[nameParts.length - 1] = '_' + lastPart; return nameParts.join('/'); } function lookupPartial(env, templateName) { if (templateName == null) { return; } var template = templateFor(env, parseUnderscoredName(templateName), templateName); return template; } function hasPartial(env, name) { if (!env.owner) { throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); } return env.owner.hasRegistration('template:' + parseUnderscoredName(name)) || env.owner.hasRegistration('template:' + name); } function templateFor(env, underscored, name) { if (!name) { return; } if (!env.owner) { throw new _emberMetal.Error('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA'); } return env.owner.lookup('template:' + underscored) || env.owner.lookup('template:' + name); } }); enifed('ember-views/system/utils', ['exports', 'ember-metal', 'container'], function (exports, _emberMetal, _container) { /* globals Element */ 'use strict'; exports.isSimpleClick = isSimpleClick; exports.getRootViews = getRootViews; exports.getViewId = getViewId; exports.getChildViews = getChildViews; exports.initChildViews = initChildViews; exports.addChildView = addChildView; exports.collectChildViews = collectChildViews; exports.getViewBounds = getViewBounds; exports.getViewRange = getViewRange; exports.getViewClientRects = getViewClientRects; exports.getViewBoundingClientRect = getViewBoundingClientRect; exports.matches = matches; /** @module ember @submodule ember-views */ function isSimpleClick(event) { var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey; var secondaryClick = event.which > 1; // IE9 may return undefined return !modifier && !secondaryClick; } var STYLE_WARNING = '' + 'Binding style attributes may introduce cross-site scripting vulnerabilities; ' + 'please ensure that values being bound are properly escaped. For more information, ' + 'including how to disable this warning, see ' + 'http://emberjs.com/deprecations/v1.x/#toc_binding-style-attributes.'; exports.STYLE_WARNING = STYLE_WARNING; /** @private @method getRootViews @param {Object} owner */ function getRootViews(owner) { var registry = owner.lookup('-view-registry:main'); var rootViews = []; Object.keys(registry).forEach(function (id) { var view = registry[id]; if (view.parentView === null) { rootViews.push(view); } }); return rootViews; } /** @private @method getViewId @param {Ember.View} view */ function getViewId(view) { return view.elementId || _emberMetal.guidFor(view); } var CHILD_VIEW_IDS = _emberMetal.symbol('CHILD_VIEW_IDS'); exports.CHILD_VIEW_IDS = CHILD_VIEW_IDS; var CHILD_VIEW_COUNTER = _emberMetal.symbol('CHILD_VIEW_COUNTER'); exports.CHILD_VIEW_COUNTER = CHILD_VIEW_COUNTER; /** @private @method getChildViews @param {Ember.View} view */ function getChildViews(view) { var owner = _container.getOwner(view); var registry = owner.lookup('-view-registry:main'); return collectChildViews(view, registry); } function initChildViews(view) { view[CHILD_VIEW_IDS] = []; } function addChildView(parent, child) { parent[CHILD_VIEW_IDS].push(getViewId(child)); } function collectChildViews(view, registry) { var ids = []; var views = []; view[CHILD_VIEW_IDS].forEach(function (id) { var view = registry[id]; if (view && !view.isDestroying && !view.isDestroyed && ids.indexOf(id) === -1) { ids.push(id); views.push(view); } }); view[CHILD_VIEW_IDS] = ids; return views; } /** @private @method getViewBounds @param {Ember.View} view */ function getViewBounds(view) { return view.renderer.getBounds(view); } /** @private @method getViewRange @param {Ember.View} view */ function getViewRange(view) { var bounds = getViewBounds(view); var range = document.createRange(); range.setStartBefore(bounds.firstNode); range.setEndAfter(bounds.lastNode); return range; } /** `getViewClientRects` provides information about the position of the border box edges of a view relative to the viewport. It is only intended to be used by development tools like the Ember Inspector and may not work on older browsers. @private @method getViewClientRects @param {Ember.View} view */ function getViewClientRects(view) { var range = getViewRange(view); return range.getClientRects(); } /** `getViewBoundingClientRect` provides information about the position of the bounding border box edges of a view relative to the viewport. It is only intended to be used by development tools like the Ember Inpsector and may not work on older browsers. @private @method getViewBoundingClientRect @param {Ember.View} view */ function getViewBoundingClientRect(view) { var range = getViewRange(view); return range.getBoundingClientRect(); } /** Determines if the element matches the specified selector. @private @method matches @param {DOMElement} el @param {String} selector */ var elMatches = typeof Element !== 'undefined' && (Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector); exports.elMatches = elMatches; function matches(el, selector) { return elMatches.call(el, selector); } }); enifed('ember-views/utils/lookup-component', ['exports', 'container'], function (exports, _container) { 'use strict'; exports.default = lookupComponent; var _templateObject = babelHelpers.taggedTemplateLiteralLoose(['component:-default'], ['component:-default']); function lookupComponentPair(componentLookup, owner, name, options) { var component = componentLookup.componentFor(name, owner, options); var layout = componentLookup.layoutFor(name, owner, options); var result = { layout: layout, component: component }; if (layout && !component) { result.component = owner._lookupFactory(_container.privatize(_templateObject)); } return result; } function lookupComponent(owner, name, options) { var componentLookup = owner.lookup('component-lookup:main'); var source = options && options.source; if (source) { var localResult = lookupComponentPair(componentLookup, owner, name, options); if (localResult.component || localResult.layout) { return localResult; } } return lookupComponentPair(componentLookup, owner, name); } }); enifed('ember-views/views/core_view', ['exports', 'ember-runtime', 'ember-views/views/states'], function (exports, _emberRuntime, _emberViewsViewsStates) { 'use strict'; /** `Ember.CoreView` is an abstract class that exists to give view-like behavior to both Ember's main view class `Ember.Component` and other classes that don't need the fully functionaltiy of `Ember.Component`. Unless you have specific needs for `CoreView`, you will use `Ember.Component` in your applications. @class CoreView @namespace Ember @extends Ember.Object @deprecated Use `Ember.Component` instead. @uses Ember.Evented @uses Ember.ActionHandler @private */ var CoreView = _emberRuntime.Object.extend(_emberRuntime.Evented, _emberRuntime.ActionHandler, { isView: true, _states: _emberViewsViewsStates.cloneStates(_emberViewsViewsStates.states), init: function () { this._super.apply(this, arguments); this._state = 'preRender'; this._currentState = this._states.preRender; this._willInsert = false; this.lastResult = null; this._destroyingSubtreeForView = null; this._isDispatchingAttrs = false; this.element = null; this._env = null; if (!this.renderer) { throw new Error('Cannot instantiate a component without a renderer. Please ensure that you are creating ' + this + ' with a proper container/registry.'); } }, /** If the view is currently inserted into the DOM of a parent view, this property will point to the parent of the view. @property parentView @type Ember.View @default null @private */ parentView: null, instrumentDetails: function (hash) { hash.object = this.toString(); hash.containerKey = this._debugContainerKey; hash.view = this; return hash; }, /** Override the default event firing from `Ember.Evented` to also call methods with the given name. @method trigger @param name {String} @private */ trigger: function () { this._super.apply(this, arguments); var name = arguments[0]; var method = this[name]; if (method) { var args = new Array(arguments.length - 1); for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } return method.apply(this, args); } }, has: function (name) { return _emberRuntime.typeOf(this[name]) === 'function' || this._super(name); } }); _emberRuntime.deprecateUnderscoreActions(CoreView); CoreView.reopenClass({ isViewFactory: true }); exports.default = CoreView; }); enifed('ember-views/views/states', ['exports', 'ember-metal', 'ember-views/views/states/default', 'ember-views/views/states/pre_render', 'ember-views/views/states/has_element', 'ember-views/views/states/in_dom', 'ember-views/views/states/destroying'], function (exports, _emberMetal, _emberViewsViewsStatesDefault, _emberViewsViewsStatesPre_render, _emberViewsViewsStatesHas_element, _emberViewsViewsStatesIn_dom, _emberViewsViewsStatesDestroying) { 'use strict'; exports.cloneStates = cloneStates; function cloneStates(from) { var into = {}; into._default = {}; into.preRender = Object.create(into._default); into.destroying = Object.create(into._default); into.hasElement = Object.create(into._default); into.inDOM = Object.create(into.hasElement); for (var stateName in from) { if (!from.hasOwnProperty(stateName)) { continue; } _emberMetal.assign(into[stateName], from[stateName]); } return into; } var states = { _default: _emberViewsViewsStatesDefault.default, preRender: _emberViewsViewsStatesPre_render.default, inDOM: _emberViewsViewsStatesIn_dom.default, hasElement: _emberViewsViewsStatesHas_element.default, destroying: _emberViewsViewsStatesDestroying.default }; exports.states = states; }); enifed('ember-views/views/states/default', ['exports', 'ember-metal', 'ember-views/compat/attrs'], function (exports, _emberMetal, _emberViewsCompatAttrs) { 'use strict'; /** @module ember @submodule ember-views */ exports.default = { // appendChild is only legal while rendering the buffer. appendChild: function () { throw new _emberMetal.Error('You can\'t use appendChild outside of the rendering process'); }, $: function () { return undefined; }, getElement: function () { return null; }, legacyPropertyDidChange: function (view, key) { var attrs = view.attrs; if (attrs && key in attrs) { var possibleCell = attrs[key]; if (possibleCell && possibleCell[_emberViewsCompatAttrs.MUTABLE_CELL]) { var value = _emberMetal.get(view, key); if (value === possibleCell.value) { return; } possibleCell.update(value); } } }, // Handle events from `Ember.EventDispatcher` handleEvent: function () { return true; // continue event propagation }, destroy: function () {}, rerender: function (view) { view.renderer.ensureViewNotRendering(view); } }; }); enifed('ember-views/views/states/destroying', ['exports', 'ember-metal', 'ember-views/views/states/default'], function (exports, _emberMetal, _emberViewsViewsStatesDefault) { 'use strict'; /** @module ember @submodule ember-views */ var destroying = Object.create(_emberViewsViewsStatesDefault.default); _emberMetal.assign(destroying, { appendChild: function () { throw new _emberMetal.Error('You can\'t call appendChild on a view being destroyed'); }, rerender: function () { throw new _emberMetal.Error('You can\'t call rerender on a view being destroyed'); } }); exports.default = destroying; }); enifed('ember-views/views/states/has_element', ['exports', 'ember-views/views/states/default', 'ember-metal', 'ember-views/system/jquery'], function (exports, _emberViewsViewsStatesDefault, _emberMetal, _emberViewsSystemJquery) { 'use strict'; var hasElement = Object.create(_emberViewsViewsStatesDefault.default); _emberMetal.assign(hasElement, { $: function (view, sel) { var elem = view.element; return sel ? _emberViewsSystemJquery.default(sel, elem) : _emberViewsSystemJquery.default(elem); }, getElement: function (view) { var parent = _emberMetal.get(view, 'parentView'); if (parent) { parent = _emberMetal.get(parent, 'element'); } if (parent) { return view.findElementInParentElement(parent); } return _emberViewsSystemJquery.default('#' + _emberMetal.get(view, 'elementId'))[0]; }, // once the view has been inserted into the DOM, rerendering is // deferred to allow bindings to synchronize. rerender: function (view) { view.renderer.ensureViewNotRendering(view); view.renderer.rerender(view); }, destroy: function (view) { view.renderer.remove(view); }, // Handle events from `Ember.EventDispatcher` handleEvent: function (view, eventName, event) { if (view.has(eventName)) { // Handler should be able to re-dispatch events, so we don't // preventDefault or stopPropagation. return _emberMetal.flaggedInstrument('interaction.' + eventName, { event: event, view: view }, function () { return _emberMetal.run.join(view, view.trigger, eventName, event); }); } else { return true; // continue event propagation } } }); exports.default = hasElement; }); enifed('ember-views/views/states/in_dom', ['exports', 'ember-metal', 'ember-views/views/states/has_element'], function (exports, _emberMetal, _emberViewsViewsStatesHas_element) { 'use strict'; /** @module ember @submodule ember-views */ var inDOM = Object.create(_emberViewsViewsStatesHas_element.default); _emberMetal.assign(inDOM, { enter: function (view) { // Register the view for event handling. This hash is used by // Ember.EventDispatcher to dispatch incoming events. view.renderer.register(view); }, exit: function (view) { view.renderer.unregister(view); } }); exports.default = inDOM; }); enifed('ember-views/views/states/pre_render', ['exports', 'ember-views/views/states/default', 'ember-metal'], function (exports, _emberViewsViewsStatesDefault, _emberMetal) { 'use strict'; /** @module ember @submodule ember-views */ var preRender = Object.create(_emberViewsViewsStatesDefault.default); _emberMetal.assign(preRender, { legacyPropertyDidChange: function (view, key) {} }); exports.default = preRender; }); enifed('ember-views/views/view', ['exports', 'ember-views/system/ext', 'ember-views/views/core_view', 'ember-views/mixins/child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/class_names_support', 'ember-views/mixins/view_support'], function (exports, _emberViewsSystemExt, _emberViewsViewsCore_view, _emberViewsMixinsChild_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsClass_names_support, _emberViewsMixinsView_support) { 'use strict'; /** @module ember @submodule ember-views */ /** `Ember.View` is the class in Ember responsible for encapsulating templates of HTML content, combining templates with data to render as sections of a page's DOM, and registering and responding to user-initiated events. ## HTML Tag The default HTML tag name used for a view's DOM representation is `div`. This can be customized by setting the `tagName` property. The following view class: ```javascript ParagraphView = Ember.View.extend({ tagName: 'em' }); ``` Would result in instances with the following HTML: ```html ``` ## HTML `class` Attribute The HTML `class` attribute of a view's tag can be set by providing a `classNames` property that is set to an array of strings: ```javascript MyView = Ember.View.extend({ classNames: ['my-class', 'my-other-class'] }); ``` Will result in view instances with an HTML representation of: ```html
    ``` `class` attribute values can also be set by providing a `classNameBindings` property set to an array of properties names for the view. The return value of these properties will be added as part of the value for the view's `class` attribute. These properties can be computed properties: ```javascript MyView = Ember.View.extend({ classNameBindings: ['propertyA', 'propertyB'], propertyA: 'from-a', propertyB: Ember.computed(function() { if (someLogic) { return 'from-b'; } }) }); ``` Will result in view instances with an HTML representation of: ```html
    ``` If the value of a class name binding returns a boolean the property name itself will be used as the class name if the property is true. The class name will not be added if the value is `false` or `undefined`. ```javascript MyView = Ember.View.extend({ classNameBindings: ['hovered'], hovered: true }); ``` Will result in view instances with an HTML representation of: ```html
    ``` When using boolean class name bindings you can supply a string value other than the property name for use as the `class` HTML attribute by appending the preferred value after a ":" character when defining the binding: ```javascript MyView = Ember.View.extend({ classNameBindings: ['awesome:so-very-cool'], awesome: true }); ``` Will result in view instances with an HTML representation of: ```html
    ``` Boolean value class name bindings whose property names are in a camelCase-style format will be converted to a dasherized format: ```javascript MyView = Ember.View.extend({ classNameBindings: ['isUrgent'], isUrgent: true }); ``` Will result in view instances with an HTML representation of: ```html
    ``` Class name bindings can also refer to object values that are found by traversing a path relative to the view itself: ```javascript MyView = Ember.View.extend({ classNameBindings: ['messages.empty'] messages: Ember.Object.create({ empty: true }) }); ``` Will result in view instances with an HTML representation of: ```html
    ``` If you want to add a class name for a property which evaluates to true and and a different class name if it evaluates to false, you can pass a binding like this: ```javascript // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false Ember.View.extend({ classNameBindings: ['isEnabled:enabled:disabled'] isEnabled: true }); ``` Will result in view instances with an HTML representation of: ```html
    ``` When isEnabled is `false`, the resulting HTML representation looks like this: ```html
    ``` This syntax offers the convenience to add a class if a property is `false`: ```javascript // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false Ember.View.extend({ classNameBindings: ['isEnabled::disabled'] isEnabled: true }); ``` Will result in view instances with an HTML representation of: ```html
    ``` When the `isEnabled` property on the view is set to `false`, it will result in view instances with an HTML representation of: ```html
    ``` Updates to the value of a class name binding will result in automatic update of the HTML `class` attribute in the view's rendered HTML representation. If the value becomes `false` or `undefined` the class name will be removed. Both `classNames` and `classNameBindings` are concatenated properties. See [Ember.Object](/api/classes/Ember.Object.html) documentation for more information about concatenated properties. ## HTML Attributes The HTML attribute section of a view's tag can be set by providing an `attributeBindings` property set to an array of property names on the view. The return value of these properties will be used as the value of the view's HTML associated attribute: ```javascript AnchorView = Ember.View.extend({ tagName: 'a', attributeBindings: ['href'], href: 'http://google.com' }); ``` Will result in view instances with an HTML representation of: ```html ``` One property can be mapped on to another by placing a ":" between the source property and the destination property: ```javascript AnchorView = Ember.View.extend({ tagName: 'a', attributeBindings: ['url:href'], url: 'http://google.com' }); ``` Will result in view instances with an HTML representation of: ```html ``` Namespaced attributes (e.g. `xlink:href`) are supported, but have to be mapped, since `:` is not a valid character for properties in Javascript: ```javascript UseView = Ember.View.extend({ tagName: 'use', attributeBindings: ['xlinkHref:xlink:href'], xlinkHref: '#triangle' }); ``` Will result in view instances with an HTML representation of: ```html ``` If the return value of an `attributeBindings` monitored property is a boolean the attribute will be present or absent depending on the value: ```javascript MyTextInput = Ember.View.extend({ tagName: 'input', attributeBindings: ['disabled'], disabled: false }); ``` Will result in a view instance with an HTML representation of: ```html ``` `attributeBindings` can refer to computed properties: ```javascript MyTextInput = Ember.View.extend({ tagName: 'input', attributeBindings: ['disabled'], disabled: Ember.computed(function() { if (someLogic) { return true; } else { return false; } }) }); ``` To prevent setting an attribute altogether, use `null` or `undefined` as the return value of the `attributeBindings` monitored property: ```javascript MyTextInput = Ember.View.extend({ tagName: 'form', attributeBindings: ['novalidate'], novalidate: null }); ``` Updates to the property of an attribute binding will result in automatic update of the HTML attribute in the view's rendered HTML representation. `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html) documentation for more information about concatenated properties. ## Layouts Views can have a secondary template that wraps their main template. Like primary templates, layouts can be any function that accepts an optional context parameter and returns a string of HTML that will be inserted inside view's tag. Views whose HTML element is self closing (e.g. ``) cannot have a layout and this property will be ignored. Most typically in Ember a layout will be a compiled template. A view's layout can be set directly with the `layout` property or reference an existing template by name with the `layoutName` property. A template used as a layout must contain a single use of the `{{yield}}` helper. The HTML contents of a view's rendered `template` will be inserted at this location: ```javascript AViewWithLayout = Ember.View.extend({ layout: Ember.HTMLBars.compile("
    {{yield}}
    "), template: Ember.HTMLBars.compile("I got wrapped") }); ``` Will result in view instances with an HTML representation of: ```html
    I got wrapped
    ``` See [Ember.Templates.helpers.yield](/api/classes/Ember.Templates.helpers.html#method_yield) for more information. ## Responding to Browser Events Views can respond to user-initiated events in one of three ways: method implementation, through an event manager, and through `{{action}}` helper use in their template or layout. ### Method Implementation Views can respond to user-initiated events by implementing a method that matches the event name. A `jQuery.Event` object will be passed as the argument to this method. ```javascript AView = Ember.View.extend({ click: function(event) { // will be called when an instance's // rendered element is clicked } }); ``` ### Event Managers Views can define an object as their `eventManager` property. This object can then implement methods that match the desired event names. Matching events that occur on the view's rendered HTML or the rendered HTML of any of its DOM descendants will trigger this method. A `jQuery.Event` object will be passed as the first argument to the method and an `Ember.View` object as the second. The `Ember.View` will be the view whose rendered HTML was interacted with. This may be the view with the `eventManager` property or one of its descendant views. ```javascript AView = Ember.View.extend({ eventManager: Ember.Object.create({ doubleClick: function(event, view) { // will be called when an instance's // rendered element or any rendering // of this view's descendant // elements is clicked } }) }); ``` An event defined for an event manager takes precedence over events of the same name handled through methods on the view. ```javascript AView = Ember.View.extend({ mouseEnter: function(event) { // will never trigger. }, eventManager: Ember.Object.create({ mouseEnter: function(event, view) { // takes precedence over AView#mouseEnter } }) }); ``` Similarly a view's event manager will take precedence for events of any views rendered as a descendant. A method name that matches an event name will not be called if the view instance was rendered inside the HTML representation of a view that has an `eventManager` property defined that handles events of the name. Events not handled by the event manager will still trigger method calls on the descendant. ```javascript var App = Ember.Application.create(); App.OuterView = Ember.View.extend({ template: Ember.HTMLBars.compile("outer {{#view 'inner'}}inner{{/view}} outer"), eventManager: Ember.Object.create({ mouseEnter: function(event, view) { // view might be instance of either // OuterView or InnerView depending on // where on the page the user interaction occurred } }) }); App.InnerView = Ember.View.extend({ click: function(event) { // will be called if rendered inside // an OuterView because OuterView's // eventManager doesn't handle click events }, mouseEnter: function(event) { // will never be called if rendered inside // an OuterView. } }); ``` ### `{{action}}` Helper See [Ember.Templates.helpers.action](/api/classes/Ember.Templates.helpers.html#method_action). ### Event Names All of the event handling approaches described above respond to the same set of events. The names of the built-in events are listed below. (The hash of built-in events exists in `Ember.EventDispatcher`.) Additional, custom events can be registered by using `Ember.Application.customEvents`. Touch events: * `touchStart` * `touchMove` * `touchEnd` * `touchCancel` Keyboard events * `keyDown` * `keyUp` * `keyPress` Mouse events * `mouseDown` * `mouseUp` * `contextMenu` * `click` * `doubleClick` * `mouseMove` * `focusIn` * `focusOut` * `mouseEnter` * `mouseLeave` Form events: * `submit` * `change` * `focusIn` * `focusOut` * `input` HTML5 drag and drop events: * `dragStart` * `drag` * `dragEnter` * `dragLeave` * `dragOver` * `dragEnd` * `drop` @class View @namespace Ember @extends Ember.CoreView @deprecated See http://emberjs.com/deprecations/v1.x/#toc_ember-view @uses Ember.ViewSupport @uses Ember.ViewChildViewsSupport @uses Ember.ClassNamesSupport @uses Ember.AttributeBindingsSupport @public */ // jscs:disable validateIndentation var View = _emberViewsViewsCore_view.default.extend(_emberViewsMixinsChild_views_support.default, _emberViewsMixinsView_state_support.default, _emberViewsMixinsClass_names_support.default, _emberViewsMixinsView_support.default); // jscs:enable validateIndentation /* Describe how the specified actions should behave in the various states that a view can exist in. Possible states: * preRender: when a view is first instantiated, and after its element was destroyed, it is in the preRender state * inBuffer: once a view has been rendered, but before it has been inserted into the DOM, it is in the inBuffer state * hasElement: the DOM representation of the view is created, and is ready to be inserted * inDOM: once a view has been inserted into the DOM it is in the inDOM state. A view spends the vast majority of its existence in this state. * destroyed: once a view has been destroyed (using the destroy method), it is in this state. No further actions can be invoked on a destroyed view. */ // in the destroyed state, everything is illegal // before rendering has begun, all legal manipulations are noops. // inside the buffer, legal manipulations are done on the buffer // once the view has been inserted into the DOM, legal manipulations // are done on the DOM element. exports.default = View; exports.ViewChildViewsSupport = _emberViewsMixinsChild_views_support.default; exports.ViewStateSupport = _emberViewsMixinsView_state_support.default; exports.ClassNamesSupport = _emberViewsMixinsClass_names_support.default; }); // for the side effect of extending Ember.run.queues enifed("ember/features", ["exports"], function (exports) { "use strict"; exports.default = { "features-stripped-test": false, "ember-routing-route-configured-query-params": false, "ember-libraries-isregistered": false, "ember-runtime-computed-uniq-by": true, "ember-improved-instrumentation": false, "ember-runtime-enumerable-includes": true, "ember-string-ishtmlsafe": true, "ember-testing-check-waiters": true, "ember-metal-weakmap": false, "ember-glimmer-allow-backtracking-rerender": false, "mandatory-setter": false, "ember-glimmer-detect-backtracking-rerender": false }; }); enifed('ember/index', ['exports', 'require', 'ember-environment', 'container', 'ember-metal', 'backburner', 'ember-console', 'ember-runtime', 'ember-glimmer', 'ember/version', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support'], function (exports, _require, _emberEnvironment, _container, _emberMetal, _backburner, _emberConsole, _emberRuntime, _emberGlimmer, _emberVersion, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport) { 'use strict'; var computed = _emberMetal.computed; computed.alias = _emberMetal.alias; _emberMetal.default.computed = computed; _emberMetal.default.ComputedProperty = _emberMetal.ComputedProperty; _emberMetal.default.cacheFor = _emberMetal.cacheFor; _emberMetal.default.assert = _emberMetal.assert; _emberMetal.default.warn = _emberMetal.warn; _emberMetal.default.debug = _emberMetal.debug; _emberMetal.default.deprecate = _emberMetal.deprecate; _emberMetal.default.deprecateFunc = _emberMetal.deprecateFunc; _emberMetal.default.runInDebug = _emberMetal.runInDebug; _emberMetal.default.assign = Object.assign || _emberMetal.assign; _emberMetal.default.merge = _emberMetal.merge; _emberMetal.default.instrument = _emberMetal.instrument; _emberMetal.default.subscribe = _emberMetal.instrumentationSubscribe; _emberMetal.default.Instrumentation = { instrument: _emberMetal.instrument, subscribe: _emberMetal.instrumentationSubscribe, unsubscribe: _emberMetal.instrumentationUnsubscribe, reset: _emberMetal.instrumentationReset }; _emberMetal.default.generateGuid = _emberMetal.generateGuid; _emberMetal.default.GUID_KEY = _emberMetal.GUID_KEY; _emberMetal.default.guidFor = _emberMetal.guidFor; _emberMetal.default.inspect = _emberMetal.inspect; _emberMetal.default.makeArray = _emberMetal.makeArray; _emberMetal.default.canInvoke = _emberMetal.canInvoke; _emberMetal.default.tryInvoke = _emberMetal.tryInvoke; _emberMetal.default.wrap = _emberMetal.wrap; _emberMetal.default.applyStr = _emberMetal.applyStr; _emberMetal.default.uuid = _emberMetal.uuid; _emberMetal.default.Error = _emberMetal.Error; _emberMetal.default.META_DESC = _emberMetal.META_DESC; _emberMetal.default.meta = _emberMetal.meta; _emberMetal.default.get = _emberMetal.get; _emberMetal.default.getWithDefault = _emberMetal.getWithDefault; _emberMetal.default._getPath = _emberMetal._getPath; _emberMetal.default.set = _emberMetal.set; _emberMetal.default.trySet = _emberMetal.trySet; _emberMetal.default.FEATURES = _emberMetal.FEATURES; _emberMetal.default.FEATURES.isEnabled = _emberMetal.isFeatureEnabled; _emberMetal.default._Cache = _emberMetal.Cache; _emberMetal.default.on = _emberMetal.on; _emberMetal.default.addListener = _emberMetal.addListener; _emberMetal.default.removeListener = _emberMetal.removeListener; _emberMetal.default._suspendListener = _emberMetal.suspendListener; _emberMetal.default._suspendListeners = _emberMetal.suspendListeners; _emberMetal.default.sendEvent = _emberMetal.sendEvent; _emberMetal.default.hasListeners = _emberMetal.hasListeners; _emberMetal.default.watchedEvents = _emberMetal.watchedEvents; _emberMetal.default.listenersFor = _emberMetal.listenersFor; _emberMetal.default.accumulateListeners = _emberMetal.accumulateListeners; _emberMetal.default.isNone = _emberMetal.isNone; _emberMetal.default.isEmpty = _emberMetal.isEmpty; _emberMetal.default.isBlank = _emberMetal.isBlank; _emberMetal.default.isPresent = _emberMetal.isPresent; _emberMetal.default.run = _emberMetal.run; _emberMetal.default._ObserverSet = _emberMetal.ObserverSet; _emberMetal.default.propertyWillChange = _emberMetal.propertyWillChange; _emberMetal.default.propertyDidChange = _emberMetal.propertyDidChange; _emberMetal.default.overrideChains = _emberMetal.overrideChains; _emberMetal.default.beginPropertyChanges = _emberMetal.beginPropertyChanges; _emberMetal.default.endPropertyChanges = _emberMetal.endPropertyChanges; _emberMetal.default.changeProperties = _emberMetal.changeProperties; _emberMetal.default.platform = { defineProperty: true, hasPropertyAccessors: true }; _emberMetal.default.defineProperty = _emberMetal.defineProperty; _emberMetal.default.watchKey = _emberMetal.watchKey; _emberMetal.default.unwatchKey = _emberMetal.unwatchKey; _emberMetal.default.removeChainWatcher = _emberMetal.removeChainWatcher; _emberMetal.default._ChainNode = _emberMetal.ChainNode; _emberMetal.default.finishChains = _emberMetal.finishChains; _emberMetal.default.watchPath = _emberMetal.watchPath; _emberMetal.default.unwatchPath = _emberMetal.unwatchPath; _emberMetal.default.watch = _emberMetal.watch; _emberMetal.default.isWatching = _emberMetal.isWatching; _emberMetal.default.unwatch = _emberMetal.unwatch; _emberMetal.default.rewatch = _emberMetal.rewatch; _emberMetal.default.destroy = _emberMetal.destroy; _emberMetal.default.libraries = _emberMetal.libraries; _emberMetal.default.OrderedSet = _emberMetal.OrderedSet; _emberMetal.default.Map = _emberMetal.Map; _emberMetal.default.MapWithDefault = _emberMetal.MapWithDefault; _emberMetal.default.getProperties = _emberMetal.getProperties; _emberMetal.default.setProperties = _emberMetal.setProperties; _emberMetal.default.expandProperties = _emberMetal.expandProperties; _emberMetal.default.NAME_KEY = _emberMetal.NAME_KEY; _emberMetal.default.addObserver = _emberMetal.addObserver; _emberMetal.default.observersFor = _emberMetal.observersFor; _emberMetal.default.removeObserver = _emberMetal.removeObserver; _emberMetal.default._suspendObserver = _emberMetal._suspendObserver; _emberMetal.default._suspendObservers = _emberMetal._suspendObservers; _emberMetal.default.required = _emberMetal.required; _emberMetal.default.aliasMethod = _emberMetal.aliasMethod; _emberMetal.default.observer = _emberMetal.observer; _emberMetal.default.immediateObserver = _emberMetal._immediateObserver; _emberMetal.default.mixin = _emberMetal.mixin; _emberMetal.default.Mixin = _emberMetal.Mixin; _emberMetal.default.bind = _emberMetal.bind; _emberMetal.default.Binding = _emberMetal.Binding; _emberMetal.default.isGlobalPath = _emberMetal.isGlobalPath; if (_emberMetal.isFeatureEnabled('ember-metal-weakmap')) { _emberMetal.default.WeakMap = _emberMetal.WeakMap; } Object.defineProperty(_emberMetal.default, 'ENV', { get: function () { return _emberEnvironment.ENV; }, enumerable: false }); /** The context that Ember searches for namespace instances on. @private */ Object.defineProperty(_emberMetal.default, 'lookup', { get: function () { return _emberEnvironment.context.lookup; }, set: function (value) { _emberEnvironment.context.lookup = value; }, enumerable: false }); _emberMetal.default.EXTEND_PROTOTYPES = _emberEnvironment.ENV.EXTEND_PROTOTYPES; // BACKWARDS COMPAT ACCESSORS FOR ENV FLAGS Object.defineProperty(_emberMetal.default, 'LOG_STACKTRACE_ON_DEPRECATION', { get: function () { return _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION; }, set: function (value) { _emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION = !!value; }, enumerable: false }); Object.defineProperty(_emberMetal.default, 'LOG_VERSION', { get: function () { return _emberEnvironment.ENV.LOG_VERSION; }, set: function (value) { _emberEnvironment.ENV.LOG_VERSION = !!value; }, enumerable: false }); Object.defineProperty(_emberMetal.default, 'MODEL_FACTORY_INJECTIONS', { get: function () { return _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS; }, set: function (value) { _emberEnvironment.ENV.MODEL_FACTORY_INJECTIONS = !!value; }, enumerable: false }); Object.defineProperty(_emberMetal.default, 'LOG_BINDINGS', { get: function () { return _emberEnvironment.ENV.LOG_BINDINGS; }, set: function (value) { _emberEnvironment.ENV.LOG_BINDINGS = !!value; }, enumerable: false }); /** A function may be assigned to `Ember.onerror` to be called when Ember internals encounter an error. This is useful for specialized error handling and reporting code. ```javascript Ember.onerror = function(error) { Em.$.ajax('/report-error', 'POST', { stack: error.stack, otherInformation: 'whatever app state you want to provide' }); }; ``` Internally, `Ember.onerror` is used as Backburner's error handler. @event onerror @for Ember @param {Exception} error the error object @public */ Object.defineProperty(_emberMetal.default, 'onerror', { get: _emberMetal.getOnerror, set: _emberMetal.setOnerror, enumerable: false }); /** An empty function useful for some operations. Always returns `this`. @method K @return {Object} @public */ _emberMetal.default.K = function K() { return this; }; Object.defineProperty(_emberMetal.default, 'testing', { get: _emberMetal.isTesting, set: _emberMetal.setTesting, enumerable: false }); if (!_require.has('ember-debug')) { _emberMetal.default.Debug = { registerDeprecationHandler: function () {}, registerWarnHandler: function () {} }; } /** @class Backburner @for Ember @private */ _emberMetal.default.Backburner = function () { function BackburnerAlias(args) { return _backburner.default.apply(this, args); } BackburnerAlias.prototype = _backburner.default.prototype; return new BackburnerAlias(arguments); }; _emberMetal.default._Backburner = _backburner.default; _emberMetal.default.Container = _container.Container; _emberMetal.default.Registry = _container.Registry; _emberMetal.default.getOwner = _container.getOwner; _emberMetal.default.setOwner = _container.setOwner; _emberMetal.default.Logger = _emberConsole.default; // ****ember-runtime**** _emberMetal.default.String = _emberRuntime.String; _emberMetal.default.Object = _emberRuntime.Object; _emberMetal.default._RegistryProxyMixin = _emberRuntime.RegistryProxyMixin; _emberMetal.default._ContainerProxyMixin = _emberRuntime.ContainerProxyMixin; _emberMetal.default.compare = _emberRuntime.compare; _emberMetal.default.copy = _emberRuntime.copy; _emberMetal.default.isEqual = _emberRuntime.isEqual; _emberMetal.default.inject = _emberRuntime.inject; _emberMetal.default.Array = _emberRuntime.Array; _emberMetal.default.Comparable = _emberRuntime.Comparable; _emberMetal.default.Enumerable = _emberRuntime.Enumerable; _emberMetal.default.ArrayProxy = _emberRuntime.ArrayProxy; _emberMetal.default.ObjectProxy = _emberRuntime.ObjectProxy; _emberMetal.default.ActionHandler = _emberRuntime.ActionHandler; _emberMetal.default.CoreObject = _emberRuntime.CoreObject; _emberMetal.default.NativeArray = _emberRuntime.NativeArray; _emberMetal.default.Copyable = _emberRuntime.Copyable; _emberMetal.default.Freezable = _emberRuntime.Freezable; _emberMetal.default.FROZEN_ERROR = _emberRuntime.FROZEN_ERROR; _emberMetal.default.MutableEnumerable = _emberRuntime.MutableEnumerable; _emberMetal.default.MutableArray = _emberRuntime.MutableArray; _emberMetal.default.TargetActionSupport = _emberRuntime.TargetActionSupport; _emberMetal.default.Evented = _emberRuntime.Evented; _emberMetal.default.PromiseProxyMixin = _emberRuntime.PromiseProxyMixin; _emberMetal.default.Observable = _emberRuntime.Observable; _emberMetal.default.typeOf = _emberRuntime.typeOf; _emberMetal.default.isArray = _emberRuntime.isArray; _emberMetal.default.Object = _emberRuntime.Object; _emberMetal.default.onLoad = _emberRuntime.onLoad; _emberMetal.default.runLoadHooks = _emberRuntime.runLoadHooks; _emberMetal.default.Controller = _emberRuntime.Controller; _emberMetal.default.ControllerMixin = _emberRuntime.ControllerMixin; _emberMetal.default.Service = _emberRuntime.Service; _emberMetal.default._ProxyMixin = _emberRuntime._ProxyMixin; _emberMetal.default.RSVP = _emberRuntime.RSVP; _emberMetal.default.Namespace = _emberRuntime.Namespace; // ES6TODO: this seems a less than ideal way/place to add properties to Ember.computed computed.empty = _emberRuntime.empty; computed.notEmpty = _emberRuntime.notEmpty; computed.none = _emberRuntime.none; computed.not = _emberRuntime.not; computed.bool = _emberRuntime.bool; computed.match = _emberRuntime.match; computed.equal = _emberRuntime.equal; computed.gt = _emberRuntime.gt; computed.gte = _emberRuntime.gte; computed.lt = _emberRuntime.lt; computed.lte = _emberRuntime.lte; computed.oneWay = _emberRuntime.oneWay; computed.reads = _emberRuntime.oneWay; computed.readOnly = _emberRuntime.readOnly; computed.defaultTo = _emberRuntime.defaultTo; computed.deprecatingAlias = _emberRuntime.deprecatingAlias; computed.and = _emberRuntime.and; computed.or = _emberRuntime.or; computed.any = _emberRuntime.any; computed.sum = _emberRuntime.sum; computed.min = _emberRuntime.min; computed.max = _emberRuntime.max; computed.map = _emberRuntime.map; computed.sort = _emberRuntime.sort; computed.setDiff = _emberRuntime.setDiff; computed.mapBy = _emberRuntime.mapBy; computed.filter = _emberRuntime.filter; computed.filterBy = _emberRuntime.filterBy; computed.uniq = _emberRuntime.uniq; if (_emberMetal.isFeatureEnabled('ember-runtime-computed-uniq-by')) { computed.uniqBy = _emberRuntime.uniqBy; } computed.union = _emberRuntime.union; computed.intersect = _emberRuntime.intersect; computed.collect = _emberRuntime.collect; /** Defines the hash of localized strings for the current language. Used by the `Ember.String.loc()` helper. To localize, add string values to this hash. @property STRINGS @for Ember @type Object @private */ Object.defineProperty(_emberMetal.default, 'STRINGS', { configurable: false, get: _emberRuntime.getStrings, set: _emberRuntime.setStrings }); /** Whether searching on the global for new Namespace instances is enabled. This is only exported here as to not break any addons. Given the new visit API, you will have issues if you treat this as a indicator of booted. Internally this is only exposing a flag in Namespace. @property BOOTED @for Ember @type Boolean @private */ Object.defineProperty(_emberMetal.default, 'BOOTED', { configurable: false, enumerable: false, get: _emberRuntime.isNamespaceSearchDisabled, set: _emberRuntime.setNamespaceSearchDisabled }); _emberMetal.default.Component = _emberGlimmer.Component; _emberGlimmer.Helper.helper = _emberGlimmer.helper; _emberMetal.default.Helper = _emberGlimmer.Helper; _emberMetal.default.Checkbox = _emberGlimmer.Checkbox; _emberMetal.default.TextField = _emberGlimmer.TextField; _emberMetal.default.TextArea = _emberGlimmer.TextArea; _emberMetal.default.LinkComponent = _emberGlimmer.LinkComponent; _emberMetal.default._Renderer = _emberGlimmer.Renderer; if (_emberEnvironment.ENV.EXTEND_PROTOTYPES.String) { String.prototype.htmlSafe = function () { return _emberGlimmer.htmlSafe(this); }; } var EmberHandlebars = _emberMetal.default.Handlebars = _emberMetal.default.Handlebars || {}; var EmberHTMLBars = _emberMetal.default.HTMLBars = _emberMetal.default.HTMLBars || {}; var EmberHandleBarsUtils = EmberHandlebars.Utils = EmberHandlebars.Utils || {}; Object.defineProperty(EmberHandlebars, 'SafeString', { get: _emberGlimmer._getSafeString }); EmberHTMLBars.template = EmberHandlebars.template = _emberGlimmer.template; EmberHandleBarsUtils.escapeExpression = _emberGlimmer.escapeExpression; _emberRuntime.String.htmlSafe = _emberGlimmer.htmlSafe; if (_emberMetal.isFeatureEnabled('ember-string-ishtmlsafe')) { _emberRuntime.String.isHTMLSafe = _emberGlimmer.isHTMLSafe; } EmberHTMLBars.makeBoundHelper = _emberGlimmer.makeBoundHelper; /** Global hash of shared templates. This will automatically be populated by the build tools so that you can store your Handlebars templates in separate files that get loaded into JavaScript at buildtime. @property TEMPLATES @for Ember @type Object @private */ Object.defineProperty(_emberMetal.default, 'TEMPLATES', { get: _emberGlimmer.getTemplates, set: _emberGlimmer.setTemplates, configurable: false, enumerable: false }); exports.VERSION = _emberVersion.default; /** The semantic version @property VERSION @type String @public */ _emberMetal.default.VERSION = _emberVersion.default; _emberMetal.libraries.registerCoreLibrary('Ember', _emberVersion.default); _emberMetal.default.create = _emberMetal.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create); _emberMetal.default.keys = _emberMetal.deprecateFunc('Ember.keys is deprecated in favor of Object.keys', { id: 'ember-metal.ember.keys', until: '3.0.0' }, Object.keys); // require the main entry points for each of these packages // this is so that the global exports occur properly /** Alias for jQuery @method $ @for Ember @public */ _emberMetal.default.$ = _emberViews.jQuery; _emberMetal.default.ViewTargetActionSupport = _emberViews.ViewTargetActionSupport; _emberMetal.default.ViewUtils = { isSimpleClick: _emberViews.isSimpleClick, getViewBounds: _emberViews.getViewBounds, getViewClientRects: _emberViews.getViewClientRects, getViewBoundingClientRect: _emberViews.getViewBoundingClientRect, getRootViews: _emberViews.getRootViews, getChildViews: _emberViews.getChildViews }; _emberMetal.default.TextSupport = _emberViews.TextSupport; _emberMetal.default.ComponentLookup = _emberViews.ComponentLookup; _emberMetal.default.EventDispatcher = _emberViews.EventDispatcher; _emberMetal.default.Location = _emberRouting.Location; _emberMetal.default.AutoLocation = _emberRouting.AutoLocation; _emberMetal.default.HashLocation = _emberRouting.HashLocation; _emberMetal.default.HistoryLocation = _emberRouting.HistoryLocation; _emberMetal.default.NoneLocation = _emberRouting.NoneLocation; _emberMetal.default.controllerFor = _emberRouting.controllerFor; _emberMetal.default.generateControllerFactory = _emberRouting.generateControllerFactory; _emberMetal.default.generateController = _emberRouting.generateController; _emberMetal.default.RouterDSL = _emberRouting.RouterDSL; _emberMetal.default.Router = _emberRouting.Router; _emberMetal.default.Route = _emberRouting.Route; _emberMetal.default.Application = _emberApplication.Application; _emberMetal.default.ApplicationInstance = _emberApplication.ApplicationInstance; _emberMetal.default.Engine = _emberApplication.Engine; _emberMetal.default.EngineInstance = _emberApplication.EngineInstance; _emberMetal.default.DefaultResolver = _emberMetal.default.Resolver = _emberApplication.Resolver; _emberRuntime.runLoadHooks('Ember.Application', _emberApplication.Application); _emberMetal.default.DataAdapter = _emberExtensionSupport.DataAdapter; _emberMetal.default.ContainerDebugAdapter = _emberExtensionSupport.ContainerDebugAdapter; if (_require.has('ember-template-compiler')) { _require.default('ember-template-compiler'); } // do this to ensure that Ember.Test is defined properly on the global // if it is present. if (_require.has('ember-testing')) { var testing = _require.default('ember-testing'); _emberMetal.default.Test = testing.Test; _emberMetal.default.Test.Adapter = testing.Adapter; _emberMetal.default.Test.QUnitAdapter = testing.QUnitAdapter; _emberMetal.default.setupForTesting = testing.setupForTesting; } _emberRuntime.runLoadHooks('Ember'); /** @module ember */ exports.default = _emberMetal.default; /* globals module */ if (typeof module === 'object' && module.exports) { module.exports = _emberMetal.default; } else { _emberEnvironment.context.exports.Ember = _emberEnvironment.context.exports.Em = _emberMetal.default; } }); // ****ember-environment**** // ****ember-metal**** // need to import this directly, to ensure the babel feature // flag plugin works properly // computed macros // reduced computed macros enifed("ember/version", ["exports"], function (exports) { "use strict"; exports.default = "2.9.0-beta.1"; }); enifed('internal-test-helpers/factory', ['exports'], function (exports) { 'use strict'; exports.default = factory; function setProperties(object, properties) { for (var key in properties) { if (properties.hasOwnProperty(key)) { object[key] = properties[key]; } } } var guids = 0; function factory() { /*jshint validthis: true */ function Klass(options) { setProperties(this, options); this._guid = guids++; this.isDestroyed = false; } Klass.prototype.constructor = Klass; Klass.prototype.destroy = function () { this.isDestroyed = true; }; Klass.prototype.toString = function () { return ''; }; Klass.create = create; Klass.extend = extend; Klass.reopen = extend; Klass.reopenClass = reopenClass; return Klass; function create(options) { return new this.prototype.constructor(options); } function reopenClass(options) { setProperties(this, options); } function extend(options) { function Child(options) { Klass.call(this, options); } var Parent = this; Child.prototype = new Parent(); Child.prototype.constructor = Child; setProperties(Child, Klass); setProperties(Child.prototype, options); Child.create = create; Child.extend = extend; Child.reopen = extend; Child.reopenClass = reopenClass; return Child; } } }); enifed('internal-test-helpers/index', ['exports', 'container', 'ember-application', 'ember-routing', 'ember-runtime', 'ember-environment', 'ember-metal', 'require', 'internal-test-helpers/factory'], function (exports, _container, _emberApplication, _emberRouting, _emberRuntime, _emberEnvironment, _emberMetal, _require, _internalTestHelpersFactory) { 'use strict'; exports.buildOwner = buildOwner; exports.confirmExport = confirmExport; exports.testBoth = testBoth; exports.testWithDefault = testWithDefault; exports.runAppend = runAppend; exports.runDestroy = runDestroy; exports.factory = _internalTestHelpersFactory.default; function buildOwner() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var ownerOptions = options.ownerOptions || {}; var resolver = options.resolver; var bootOptions = options.bootOptions || {}; var Owner = _emberRuntime.Object.extend(_emberRuntime.RegistryProxyMixin, _emberRuntime.ContainerProxyMixin); var namespace = _emberRuntime.Object.create({ Resolver: { create: function () { return resolver; } } }); var fallbackRegistry = _emberApplication.Application.buildRegistry(namespace); fallbackRegistry.register('router:main', _emberRouting.Router); var registry = new _container.Registry({ fallback: fallbackRegistry }); _emberApplication.ApplicationInstance.setupRegistry(registry, bootOptions); var owner = Owner.create({ __registry__: registry, __container__: null }, ownerOptions); var container = registry.container({ owner: owner }); owner.__container__ = container; return owner; } function confirmExport(Ember, assert, path, moduleId, exportName) { var desc = getDescriptor(Ember, path); assert.ok(desc, 'the property exists on the global'); var mod = _require.default(moduleId); if (typeof exportName === 'string') { assert.equal(desc.value, mod[exportName], 'Ember.' + path + ' is exported correctly'); assert.notEqual(mod[exportName], undefined, 'Ember.' + path + ' is not `undefined`'); } else { assert.equal(desc.get, mod[exportName.get], 'Ember.' + path + ' getter is exported correctly'); assert.notEqual(desc.get, undefined, 'Ember.' + path + ' getter is not undefined'); if (exportName.set) { assert.equal(desc.set, mod[exportName.set], 'Ember.' + path + ' setter is exported correctly'); assert.notEqual(desc.set, undefined, 'Ember.' + path + ' setter is not undefined'); } } } function getDescriptor(obj, path) { var parts = path.split('.'); var value = obj; for (var i = 0; i < parts.length - 1; i++) { var part = parts[i]; value = value[part]; if (!value) { return undefined; } } var last = parts[parts.length - 1]; return Object.getOwnPropertyDescriptor(value, last); } // used by unit tests to test both accessor mode and non-accessor mode function testBoth(testname, callback) { function emberget(x, y) { return _emberMetal.get(x, y); } function emberset(x, y, z) { return _emberMetal.set(x, y, z); } function aget(x, y) { return x[y]; } function aset(x, y, z) { return x[y] = z; } QUnit.test(testname + ' using getFromEmberMetal()/Ember.set()', function () { callback(emberget, emberset); }); QUnit.test(testname + ' using accessors', function () { if (_emberEnvironment.ENV.USES_ACCESSORS) { callback(aget, aset); } else { ok('SKIPPING ACCESSORS'); } }); } function testWithDefault(testname, callback) { function emberget(x, y) { return _emberMetal.get(x, y); } function embergetwithdefault(x, y, z) { return _emberMetal.getWithDefault(x, y, z); } function getwithdefault(x, y, z) { return x.getWithDefault(y, z); } function emberset(x, y, z) { return _emberMetal.set(x, y, z); } function aget(x, y) { return x[y]; } function aset(x, y, z) { return x[y] = z; } QUnit.test(testname + ' using obj.get()', function () { callback(emberget, emberset); }); QUnit.test(testname + ' using obj.getWithDefault()', function () { callback(getwithdefault, emberset); }); QUnit.test(testname + ' using getFromEmberMetal()', function () { callback(emberget, emberset); }); QUnit.test(testname + ' using Ember.getWithDefault()', function () { callback(embergetwithdefault, emberset); }); QUnit.test(testname + ' using accessors', function () { if (_emberEnvironment.ENV.USES_ACCESSORS) { callback(aget, aset); } else { ok('SKIPPING ACCESSORS'); } }); } function runAppend(view) { _emberMetal.run(view, 'appendTo', '#qunit-fixture'); } function runDestroy(toDestroy) { if (toDestroy) { _emberMetal.run(toDestroy, 'destroy'); } } }); enifed('glimmer-node/index', ['exports', 'glimmer-node/lib/node-dom-helper'], function (exports, _glimmerNodeLibNodeDomHelper) { 'use strict'; exports.NodeDOMTreeConstruction = _glimmerNodeLibNodeDomHelper.default; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItbm9kZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFBb0IsdUJBQXVCLGdDQUFsQyxPQUFPIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBOb2RlRE9NVHJlZUNvbnN0cnVjdGlvbiB9IGZyb20gJy4vbGliL25vZGUtZG9tLWhlbHBlcic7XG4iXX0= enifed('glimmer-node/lib/node-dom-helper', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntime) { 'use strict'; var NodeDOMTreeConstruction = (function (_DOMTreeConstruction) { babelHelpers.inherits(NodeDOMTreeConstruction, _DOMTreeConstruction); function NodeDOMTreeConstruction(doc) { _DOMTreeConstruction.call(this, doc); } // override to prevent usage of `this.document` until after the constructor NodeDOMTreeConstruction.prototype.setupUselessElement = function setupUselessElement() {}; NodeDOMTreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { var prev = reference ? reference.previousSibling : parent.lastChild; var raw = this.document.createRawHTMLSection(html); parent.insertBefore(raw, reference); var first = prev ? prev.nextSibling : parent.firstChild; var last = reference ? reference.previousSibling : parent.lastChild; return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); }; NodeDOMTreeConstruction.prototype.createElement = function createElement(tag) { return this.document.createElement(tag); }; return NodeDOMTreeConstruction; })(_glimmerRuntime.DOMTreeConstruction); exports.default = NodeDOMTreeConstruction; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItbm9kZS9saWIvbm9kZS1kb20taGVscGVyLnRzIl0sIm5hbWVzIjpbXSwibWF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IHByZXYubmV4dFNpYmxpbmcgOiBwYXJlbnQuZmlyc3RDaGlsZDtcbiAgICBsZXQgbGFzdCA9IHJlZmVyZW5jZSA/IHJlZmVyZW5jZS5wcmV2aW91c1NpYmxpbmcgOiBwYXJlbnQubGFzdENoaWxkO1xuXG4gICAgcmV0dXJuIG5ldyBDb25jcmV0ZUJvdW5kcyhwYXJlbnQsIGZpcnN0LCBsYXN0KTtcbiAgfVxuXG4gIGNyZWF0ZUVsZW1lbnQodGFnOiBzdHJpbmcpIHtcbiAgICByZXR1cm4gdGhpcy5kb2N1bWVudC5jcmVhdGVFbGVtZW50KHRhZyk7XG4gIH1cbn1cbiJdfQ== enifed('glimmer-reference/index', ['exports', 'glimmer-reference/lib/reference', 'glimmer-reference/lib/const', 'glimmer-reference/lib/validators', 'glimmer-reference/lib/utils', 'glimmer-reference/lib/iterable'], function (exports, _glimmerReferenceLibReference, _glimmerReferenceLibConst, _glimmerReferenceLibValidators, _glimmerReferenceLibUtils, _glimmerReferenceLibIterable) { 'use strict'; exports.BasicReference = _glimmerReferenceLibReference.Reference; exports.BasicPathReference = _glimmerReferenceLibReference.PathReference; exports.ConstReference = _glimmerReferenceLibConst.ConstReference; exports.isConst = _glimmerReferenceLibConst.isConst; babelHelpers.defaults(exports, babelHelpers.interopExportWildcard(_glimmerReferenceLibValidators, babelHelpers.defaults)); exports.Reference = _glimmerReferenceLibValidators.VersionedReference; exports.PathReference = _glimmerReferenceLibValidators.VersionedPathReference; exports.referenceFromParts = _glimmerReferenceLibUtils.referenceFromParts; exports.IterationItem = _glimmerReferenceLibIterable.IterationItem; exports.Iterator = _glimmerReferenceLibIterable.Iterator; exports.Iterable = _glimmerReferenceLibIterable.Iterable; exports.OpaqueIterator = _glimmerReferenceLibIterable.OpaqueIterator; exports.OpaqueIterable = _glimmerReferenceLibIterable.OpaqueIterable; exports.AbstractIterator = _glimmerReferenceLibIterable.AbstractIterator; exports.AbstractIterable = _glimmerReferenceLibIterable.AbstractIterable; exports.IterationArtifacts = _glimmerReferenceLibIterable.IterationArtifacts; exports.ReferenceIterator = _glimmerReferenceLibIterable.ReferenceIterator; exports.IteratorSynchronizer = _glimmerReferenceLibIterable.IteratorSynchronizer; exports.IteratorSynchronizerDelegate = _glimmerReferenceLibIterable.IteratorSynchronizerDelegate; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztVQUNlLGNBQWMsaUNBQTNCLFNBQVM7VUFDUSxrQkFBa0IsaUNBQW5DLGFBQWE7VUFJYixjQUFjLDZCQUFkLGNBQWM7VUFDZCxPQUFPLDZCQUFQLE9BQU87O1VBTWUsU0FBUyxrQ0FBL0Isa0JBQWtCO1VBQ1EsYUFBYSxrQ0FBdkMsc0JBQXNCO1VBSXRCLGtCQUFrQiw2QkFBbEIsa0JBQWtCO1VBSWxCLGFBQWEsZ0NBQWIsYUFBYTtVQUNiLFFBQVEsZ0NBQVIsUUFBUTtVQUNSLFFBQVEsZ0NBQVIsUUFBUTtVQUNSLGNBQWMsZ0NBQWQsY0FBYztVQUNkLGNBQWMsZ0NBQWQsY0FBYztVQUNkLGdCQUFnQixnQ0FBaEIsZ0JBQWdCO1VBQ2hCLGdCQUFnQixnQ0FBaEIsZ0JBQWdCO1VBQ2hCLGtCQUFrQixnQ0FBbEIsa0JBQWtCO1VBQ2xCLGlCQUFpQixnQ0FBakIsaUJBQWlCO1VBQ2pCLG9CQUFvQixnQ0FBcEIsb0JBQW9CO1VBQ3BCLDRCQUE0QixnQ0FBNUIsNEJBQTRCIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHtcbiAgUmVmZXJlbmNlIGFzIEJhc2ljUmVmZXJlbmNlLFxuICBQYXRoUmVmZXJlbmNlIGFzIEJhc2ljUGF0aFJlZmVyZW5jZVxufSBmcm9tICcuL2xpYi9yZWZlcmVuY2UnO1xuXG5leHBvcnQge1xuICBDb25zdFJlZmVyZW5jZSxcbiAgaXNDb25zdFxufSBmcm9tICcuL2xpYi9jb25zdCc7XG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL3ZhbGlkYXRvcnMnO1xuXG5leHBvcnQge1xuICBWZXJzaW9uZWRSZWZlcmVuY2UgYXMgUmVmZXJlbmNlLFxuICBWZXJzaW9uZWRQYXRoUmVmZXJlbmNlIGFzIFBhdGhSZWZlcmVuY2Vcbn0gZnJvbSAnLi9saWIvdmFsaWRhdG9ycyc7XG5cbmV4cG9ydCB7XG4gIHJlZmVyZW5jZUZyb21QYXJ0c1xufSBmcm9tICcuL2xpYi91dGlscyc7XG5cbmV4cG9ydCB7XG4gIEl0ZXJhdGlvbkl0ZW0sXG4gIEl0ZXJhdG9yLFxuICBJdGVyYWJsZSxcbiAgT3BhcXVlSXRlcmF0b3IsXG4gIE9wYXF1ZUl0ZXJhYmxlLFxuICBBYnN0cmFjdEl0ZXJhdG9yLFxuICBBYnN0cmFjdEl0ZXJhYmxlLFxuICBJdGVyYXRpb25BcnRpZmFjdHMsXG4gIFJlZmVyZW5jZUl0ZXJhdG9yLFxuICBJdGVyYXRvclN5bmNocm9uaXplcixcbiAgSXRlcmF0b3JTeW5jaHJvbml6ZXJEZWxlZ2F0ZVxufSBmcm9tICcuL2xpYi9pdGVyYWJsZSc7XG4iXX0= enifed('glimmer-reference/lib/const', ['exports', 'glimmer-reference/lib/validators'], function (exports, _glimmerReferenceLibValidators) { 'use strict'; exports.isConst = isConst; var ConstReference = (function () { function ConstReference(inner) { this.inner = inner; this.tag = _glimmerReferenceLibValidators.CONSTANT_TAG; } ConstReference.prototype.value = function value() { return this.inner; }; return ConstReference; })(); exports.ConstReference = ConstReference; function isConst(reference) { return reference.tag === _glimmerReferenceLibValidators.CONSTANT_TAG; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjp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X1RBRztcbn1cbiJdfQ== enifed("glimmer-reference/lib/iterable", ["exports", "glimmer-util"], function (exports, _glimmerUtil) { "use strict"; var ListItem = (function (_ListNode) { babelHelpers.inherits(ListItem, _ListNode); function ListItem(iterable, result) { _ListNode.call(this, iterable.valueReferenceFor(result)); this.retained = false; this.seen = false; this.key = result.key; this.iterable = iterable; this.memo = iterable.memoReferenceFor(result); } ListItem.prototype.update = function update(item) { this.retained = true; this.iterable.updateValueReference(this.value, item); this.iterable.updateMemoReference(this.memo, item); }; ListItem.prototype.shouldRemove = function shouldRemove() { return !this.retained; }; ListItem.prototype.reset = function reset() { this.retained = false; this.seen = false; }; return ListItem; })(_glimmerUtil.ListNode); var IterationArtifacts = (function () { function IterationArtifacts(iterable) { this.map = _glimmerUtil.dict(); this.list = new _glimmerUtil.LinkedList(); this.tag = iterable.tag; this.iterable = iterable; } IterationArtifacts.prototype.isEmpty = function isEmpty() { var iterator = this.iterator = this.iterable.iterate(); return iterator.isEmpty(); }; IterationArtifacts.prototype.iterate = function iterate() { var iterator = this.iterator || this.iterable.iterate(); this.iterator = null; return iterator; }; IterationArtifacts.prototype.has = function has(key) { return !!this.map[key]; }; IterationArtifacts.prototype.get = function get(key) { return this.map[key]; }; IterationArtifacts.prototype.wasSeen = function wasSeen(key) { var node = this.map[key]; return node && node.seen; }; IterationArtifacts.prototype.append = function append(item) { var map = this.map; var list = this.list; var iterable = this.iterable; var node = map[item.key] = new ListItem(iterable, item); list.append(node); return node; }; IterationArtifacts.prototype.insertBefore = function insertBefore(item, reference) { var map = this.map; var list = this.list; var iterable = this.iterable; var node = map[item.key] = new ListItem(iterable, item); node.retained = true; list.insertBefore(node, reference); return node; }; IterationArtifacts.prototype.move = function move(item, reference) { var list = this.list; item.retained = true; list.remove(item); list.insertBefore(item, reference); }; IterationArtifacts.prototype.remove = function remove(item) { var list = this.list; list.remove(item); delete this.map[item.key]; }; IterationArtifacts.prototype.nextNode = function nextNode(item) { return this.list.nextNode(item); }; IterationArtifacts.prototype.head = function head() { return this.list.head(); }; return IterationArtifacts; })(); exports.IterationArtifacts = IterationArtifacts; var ReferenceIterator = (function () { // if anyone needs to construct this object with something other than // an iterable, let @wycats know. function ReferenceIterator(iterable) { this.iterator = null; var artifacts = new IterationArtifacts(iterable); this.artifacts = artifacts; } ReferenceIterator.prototype.next = function next() { var artifacts = this.artifacts; var iterator = this.iterator = this.iterator || artifacts.iterate(); var item = iterator.next(); if (!item) return null; return artifacts.append(item); }; return ReferenceIterator; })(); exports.ReferenceIterator = ReferenceIterator; var Phase; (function (Phase) { Phase[Phase["Append"] = 0] = "Append"; Phase[Phase["Prune"] = 1] = "Prune"; Phase[Phase["Done"] = 2] = "Done"; })(Phase || (Phase = {})); var IteratorSynchronizer = (function () { function IteratorSynchronizer(_ref) { var target = _ref.target; var artifacts = _ref.artifacts; this.target = target; this.artifacts = artifacts; this.iterator = artifacts.iterate(); this.current = artifacts.head(); } IteratorSynchronizer.prototype.sync = function sync() { var phase = Phase.Append; while (true) { switch (phase) { case Phase.Append: phase = this.nextAppend(); break; case Phase.Prune: phase = this.nextPrune(); break; case Phase.Done: this.nextDone(); return; } } }; IteratorSynchronizer.prototype.advanceToKey = function advanceToKey(key) { var current = this.current; var artifacts = this.artifacts; var seek = current; while (seek && seek.key !== key) { seek.seen = true; seek = artifacts.nextNode(seek); } this.current = seek && artifacts.nextNode(seek); }; IteratorSynchronizer.prototype.nextAppend = function nextAppend() { var iterator = this.iterator; var current = this.current; var artifacts = this.artifacts; var item = iterator.next(); if (item === null) { return this.startPrune(); } var key = item.key; if (current && current.key === key) { this.nextRetain(item); } else if (artifacts.has(key)) { this.nextMove(item); } else { this.nextInsert(item); } return Phase.Append; }; IteratorSynchronizer.prototype.nextRetain = function nextRetain(item) { var artifacts = this.artifacts; var current = this.current; current.update(item); this.current = artifacts.nextNode(current); this.target.retain(item.key, current.value, current.memo); }; IteratorSynchronizer.prototype.nextMove = function nextMove(item) { var current = this.current; var artifacts = this.artifacts; var target = this.target; var key = item.key; var found = artifacts.get(item.key); found.update(item); if (artifacts.wasSeen(item.key)) { artifacts.move(found, current); target.move(found.key, found.value, found.memo, current ? current.key : null); } else { this.advanceToKey(key); } }; IteratorSynchronizer.prototype.nextInsert = function nextInsert(item) { var artifacts = this.artifacts; var target = this.target; var current = this.current; var node = artifacts.insertBefore(item, current); target.insert(node.key, node.value, node.memo, current ? current.key : null); }; IteratorSynchronizer.prototype.startPrune = function startPrune() { this.current = this.artifacts.head(); return Phase.Prune; }; IteratorSynchronizer.prototype.nextPrune = function nextPrune() { var artifacts = this.artifacts; var target = this.target; var current = this.current; if (current === null) { return Phase.Done; } var node = current; this.current = artifacts.nextNode(node); if (node.shouldRemove()) { artifacts.remove(node); target.delete(node.key); } else { node.reset(); } return Phase.Prune; }; IteratorSynchronizer.prototype.nextDone = function nextDone() { this.target.done(); }; return IteratorSynchronizer; })(); exports.IteratorSynchronizer = IteratorSynchronizer; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9pdGVyYWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFnQ0EsUUFBZTs4QkFBZixRQUFlOztBQU9iLGlCQVBGLFFBQWUsQ0FPRCxRQUF3QixFQUFFLE1BQTJCLEVBQUE7QUFDL0QsaUNBQU0sUUFBUSxDQUFDLGlCQUFpQixDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7QUFMckMsZ0JBQUEsQ0FBQSxRQUFRLEdBQVksS0FBSyxDQUFDO0FBQzFCLGdCQUFBLENBQUEsSUFBSSxHQUFZLEtBQUssQ0FBQztBQUszQixnQkFBSSxDQUFDLEdBQUcsR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFDO0FBQ3RCLGdCQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztBQUN6QixnQkFBSSxDQUFDLElBQUksR0FBRyxRQUFRLENBQUMs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XMudGFyZ2V0LmRvbmUoKTtcbiAgfVxufVxuIl19 enifed("glimmer-reference/lib/reference", ["exports"], function (exports) { "use strict"; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi9yZWZlcmVuY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJyZWZlcmVuY2UuanMiLCJzb3VyY2VzQ29udGVudCI6W119 enifed("glimmer-reference/lib/utils", ["exports"], function (exports) { "use strict"; exports.referenceFromParts = referenceFromParts; function referenceFromParts(root, parts) { var reference = root; for (var i = 0; i < parts.length; i++) { reference = reference.get(parts[i]); } return reference; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUdNLGFBQUEsa0JBQUEsQ0FBNkIsSUFBb0MsRUFBRSxLQUFlLEVBQUE7QUFDdEYsWUFBSSxTQUFTLEdBQUcsSUFBSSxDQUFDO0FBRXJCLGFBQUssSUFBSSxDQUFDLEdBQUMsQ0FBQyxFQUFFLENBQUMsR0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQ2pDLHFCQUFTLEdBQUcsU0FBUyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNyQztBQUVELGVBQU8sU0FBUyxDQUFDO0tBQ2xCIiwiZmlsZSI6InV0aWxzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVmVyc2lvbmVkUGF0aFJlZmVyZW5jZSB9IGZyb20gJy4vdmFsaWRhdG9ycyc7XG5pbXBvcnQgeyBPcGFxdWUgfSBmcm9tICdnbGltbWVyLXV0aWwnO1xuXG5leHBvcnQgZnVuY3Rpb24gcmVmZXJlbmNlRnJvbVBhcnRzKHJvb3Q6IFZlcnNpb25lZFBhdGhSZWZlcmVuY2U8T3BhcXVlPiwgcGFydHM6IHN0cmluZ1tdKTogVmVyc2lvbmVkUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgbGV0IHJlZmVyZW5jZSA9IHJvb3Q7XG5cbiAgZm9yIChsZXQgaT0wOyBpPHBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgcmVmZXJlbmNlID0gcmVmZXJlbmNlLmdldChwYXJ0c1tpXSk7XG4gIH1cblxuICByZXR1cm4gcmVmZXJlbmNlO1xufVxuIl19 enifed("glimmer-reference/lib/validators", ["exports"], function (exports) { "use strict"; exports.combineTagged = combineTagged; exports.combineSlice = combineSlice; exports.combine = combine; exports.map = map; exports.isModified = isModified; var CONSTANT = 0; exports.CONSTANT = CONSTANT; var INITIAL = 1; exports.INITIAL = INITIAL; var VOLATILE = NaN; exports.VOLATILE = VOLATILE; var RevisionTag = (function () { function RevisionTag() {} RevisionTag.prototype.validate = function validate(snapshot) { return this.value() === snapshot; }; return RevisionTag; })(); exports.RevisionTag = RevisionTag; var $REVISION = INITIAL; var DirtyableTag = (function (_RevisionTag) { babelHelpers.inherits(DirtyableTag, _RevisionTag); function DirtyableTag() { var revision = arguments.length <= 0 || arguments[0] === undefined ? $REVISION : arguments[0]; _RevisionTag.call(this); this.revision = revision; } DirtyableTag.prototype.value = function value() { return this.revision; }; DirtyableTag.prototype.dirty = function dirty() { this.revision = ++$REVISION; }; return DirtyableTag; })(RevisionTag); exports.DirtyableTag = DirtyableTag; function combineTagged(tagged) { var optimized = []; for (var i = 0, l = tagged.length; i < l; i++) { var tag = tagged[i].tag; if (tag === VOLATILE_TAG) return VOLATILE_TAG; if (tag === CONSTANT_TAG) continue; optimized.push(tag); } return _combine(optimized); } function combineSlice(slice) { var optimized = []; var node = slice.head(); while (node !== null) { var tag = node.tag; if (tag === VOLATILE_TAG) return VOLATILE_TAG; if (tag !== CONSTANT_TAG) optimized.push(tag); node = slice.nextNode(node); } return _combine(optimized); } function combine(tags) { var optimized = []; for (var i = 0, l = tags.length; i < l; i++) { var tag = tags[i]; if (tag === VOLATILE_TAG) return VOLATILE_TAG; if (tag === CONSTANT_TAG) continue; optimized.push(tag); } return _combine(optimized); } function _combine(tags) { switch (tags.length) { case 0: return CONSTANT_TAG; case 1: return tags[0]; case 2: return new TagsPair(tags[0], tags[1]); default: return new TagsCombinator(tags); } ; } var CachedTag = (function (_RevisionTag2) { babelHelpers.inherits(CachedTag, _RevisionTag2); function CachedTag() { _RevisionTag2.apply(this, arguments); this.lastChecked = null; this.lastValue = null; } CachedTag.prototype.value = function value() { var lastChecked = this.lastChecked; var lastValue = this.lastValue; if (lastChecked !== $REVISION) { this.lastChecked = $REVISION; this.lastValue = lastValue = this.compute(); } return this.lastValue; }; CachedTag.prototype.invalidate = function invalidate() { this.lastChecked = null; }; return CachedTag; })(RevisionTag); exports.CachedTag = CachedTag; var TagsPair = (function (_CachedTag) { babelHelpers.inherits(TagsPair, _CachedTag); function TagsPair(first, second) { _CachedTag.call(this); this.first = first; this.second = second; } TagsPair.prototype.compute = function compute() { return Math.max(this.first.value(), this.second.value()); }; return TagsPair; })(CachedTag); var TagsCombinator = (function (_CachedTag2) { babelHelpers.inherits(TagsCombinator, _CachedTag2); function TagsCombinator(tags) { _CachedTag2.call(this); this.tags = tags; } TagsCombinator.prototype.compute = function compute() { var tags = this.tags; var max = -1; for (var i = 0; i < tags.length; i++) { var value = tags[i].value(); max = Math.max(value, max); } return max; }; return TagsCombinator; })(CachedTag); var UpdatableTag = (function (_CachedTag3) { babelHelpers.inherits(UpdatableTag, _CachedTag3); function UpdatableTag(tag) { _CachedTag3.call(this); this.tag = tag; this.lastUpdated = INITIAL; } ////////// UpdatableTag.prototype.compute = function compute() { return Math.max(this.lastUpdated, this.tag.value()); }; UpdatableTag.prototype.update = function update(tag) { if (tag !== this.tag) { this.tag = tag; this.lastUpdated = $REVISION; this.invalidate(); } }; return UpdatableTag; })(CachedTag); exports.UpdatableTag = UpdatableTag; var CONSTANT_TAG = new ((function (_RevisionTag3) { babelHelpers.inherits(ConstantTag, _RevisionTag3); function ConstantTag() { _RevisionTag3.apply(this, arguments); } ConstantTag.prototype.value = function value() { return CONSTANT; }; return ConstantTag; })(RevisionTag))(); exports.CONSTANT_TAG = CONSTANT_TAG; var VOLATILE_TAG = new ((function (_RevisionTag4) { babelHelpers.inherits(VolatileTag, _RevisionTag4); function VolatileTag() { _RevisionTag4.apply(this, arguments); } VolatileTag.prototype.value = function value() { return VOLATILE; }; return VolatileTag; })(RevisionTag))(); exports.VOLATILE_TAG = VOLATILE_TAG; var CURRENT_TAG = new ((function (_DirtyableTag) { babelHelpers.inherits(CurrentTag, _DirtyableTag); function CurrentTag() { _DirtyableTag.apply(this, arguments); } CurrentTag.prototype.value = function value() { return $REVISION; }; return CurrentTag; })(DirtyableTag))(); exports.CURRENT_TAG = CURRENT_TAG; var CachedReference = (function () { function CachedReference() { this.lastRevision = null; this.lastValue = null; } CachedReference.prototype.value = function value() { var tag = this.tag; var lastRevision = this.lastRevision; var lastValue = this.lastValue; if (!lastRevision || !tag.validate(lastRevision)) { lastValue = this.lastValue = this.compute(); this.lastRevision = tag.value(); } return lastValue; }; CachedReference.prototype.invalidate = function invalidate() { this.lastRevision = null; }; return CachedReference; })(); exports.CachedReference = CachedReference; var MapperReference = (function (_CachedReference) { babelHelpers.inherits(MapperReference, _CachedReference); function MapperReference(reference, mapper) { _CachedReference.call(this); this.tag = reference.tag; this.reference = reference; this.mapper = mapper; } MapperReference.prototype.compute = function compute() { var reference = this.reference; var mapper = this.mapper; return mapper(reference.value()); }; return MapperReference; })(CachedReference); function map(reference, mapper) { return new MapperReference(reference, mapper); } ////////// var ReferenceCache = (function () { function ReferenceCache(reference) { this.lastValue = null; this.lastRevision = null; this.initialized = false; this.tag = reference.tag; this.reference = reference; } ReferenceCache.prototype.peek = function peek() { if (!this.initialized) { return this.initialize(); } return this.lastValue; }; ReferenceCache.prototype.revalidate = function revalidate() { if (!this.initialized) { return this.initialize(); } var reference = this.reference; var lastRevision = this.lastRevision; var tag = reference.tag; if (tag.validate(lastRevision)) return NOT_MODIFIED; this.lastRevision = tag.value(); var lastValue = this.lastValue; var value = reference.value(); if (value === lastValue) return NOT_MODIFIED; this.lastValue = value; return value; }; ReferenceCache.prototype.initialize = function initialize() { var reference = this.reference; var value = this.lastValue = reference.value(); this.lastRevision = reference.tag.value(); this.initialized = true; return value; }; return ReferenceCache; })(); exports.ReferenceCache = ReferenceCache; var NOT_MODIFIED = "adb3b78e-3d22-4e4b-877a-6317c2c5c145"; function isModified(value) { return value !== NOT_MODIFIED; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcmVmZXJlbmNlL2xpYi92YWxpZGF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBa0JPLFFBQU0sUUFBUSxHQUFhLENBQUMsQ0FBQzs7QUFDN0IsUUFBTSxPQUFPLEdBQWMsQ0FBQyxDQUFDOztBQUM3QixRQUFNLFFBQVEsR0FBYSxHQUFHLENBQUM7OztRQUVoQyxXQUFBO2lCQUFBLFdBQUE7O0FBQUEsbUJBQUEsV0FHSixRQUFRLEdBQUEsa0JBQUMsUUFBa0IsRUFBQTtBQUN6QixtQkFBTyxJQUFJLENBQUMsS0FBSyxFQUFFLEtBQUssUUFBUSxDQUFDO1NBQ2xDOztlQUxHLFdBQUE7Ozs7O0FBUU4sUUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDOztRQUVsQixZQUFvQjs4QkFBcEIsWUFBb0I7O0FBR3hCLGlCQUhJLFlBQW9CLEdBR1E7Z0JBQXBCLFFBQVEseURBQUcsU0FBUzs7QUFDOUIsbUNBQU8sQ0FBQztBQUNSLGdCQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztTQ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Qgb3B0aW1pemVkID0gW107XG4gICAgZm9yIChsZXQgaSA9IDAsIGwgPSB0YWdnZWQubGVuZ3RoOyBpIDwgbDsgaSsrKSB7XG4gICAgICAgIGxldCB0YWcgPSB0YWdnZWRbaV0udGFnO1xuICAgICAgICBpZiAodGFnID09PSBWT0xBVElMRV9UQUcpXG4gICAgICAgICAgICByZXR1cm4gVk9MQVRJTEVfVEFHO1xuICAgICAgICBpZiAodGFnID09PSBDT05TVEFOVF9UQUcpXG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgb3B0aW1pemVkLnB1c2godGFnKTtcbiAgICB9XG4gICAgcmV0dXJuIF9jb21iaW5lKG9wdGltaXplZCk7XG59XG5leHBvcnQgZnVuY3Rpb24gY29tYmluZVNsaWNlKHNsaWNlKSB7XG4gICAgbGV0IG9wdGltaXplZCA9IFtdO1xuICAgIGxldCBub2RlID0gc2xpY2UuaGVhZCgpO1xuICAgIHdoaWxlIChub2RlICE9PSBudWxsKSB7XG4gICAgICAgIGxldCB0YWcgPSBub2RlLnRhZztcbiAgICAgICAgaWYgKHRhZyA9PT0gVk9MQVRJTEVfVEFHKVxuICAgICAgICAgICAgcmV0dXJuIFZPTEFUSUxFX1RBRztcbiAgICAgICAgaWYgKHRhZyAhPT0gQ09OU1RBTlRfVEFHKVxuICAgICAgICAgICAgb3B0aW1pemVkLnB1c2godGFnKTtcbiAgICAgICAgbm9kZSA9IHNsaWNlLm5leHROb2RlKG5vZGUpO1xuICAgIH1cbiAgICByZXR1cm4gX2NvbWJpbmUob3B0aW1pemVkKTtcbn1cbmV4cG9ydCBmdW5jdGlvbiBjb21iaW5lKHRhZ3MpIHtcbiAgICBsZXQgb3B0aW1pemVkID0gW107XG4gICAgZm9yIChsZXQgaSA9IDAsIGwgPSB0YWdzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICBsZXQgdGFnID0gdGFnc1tpXTtcbiAgICAgICAgaWYgKHRhZyA9PT0gVk9MQVRJTEVfVEFH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gICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cbiAgICBpbml0aWFsaXplKCkge1xuICAgICAgICBsZXQgeyByZWZlcmVuY2UgfSA9IHRoaXM7XG4gICAgICAgIGxldCB2YWx1ZSA9IHRoaXMubGFzdFZhbHVlID0gcmVmZXJlbmNlLnZhbHVlKCk7XG4gICAgICAgIHRoaXMubGFzdFJldmlzaW9uID0gcmVmZXJlbmNlLnRhZy52YWx1ZSgpO1xuICAgICAgICB0aGlzLmluaXRpYWxpemVkID0gdHJ1ZTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cbn1cbmNvbnN0IE5PVF9NT0RJRklFRCA9IFwiYWRiM2I3OGUtM2QyMi00ZTRiLTg3N2EtNjMxN2MyYzVjMTQ1XCI7XG5leHBvcnQgZnVuY3Rpb24gaXNNb2RpZmllZCh2YWx1ZSkge1xuICAgIHJldHVybiB2YWx1ZSAhPT0gTk9UX01PRElGSUVEO1xufVxuIl19 enifed('glimmer-runtime/index', ['exports', 'glimmer-runtime/lib/dom/interfaces', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/template', 'glimmer-runtime/lib/symbol-table', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/opcode-builder', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/dom/change-lists', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/compiled/opcodes/lists', 'glimmer-runtime/lib/helpers/get-dynamic-var', 'glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/environment', 'glimmer-runtime/lib/partial', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/modifier/interfaces', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibDomInterfaces, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibTemplate, _glimmerRuntimeLibSymbolTable, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibOpcodeBuilder, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibDomChangeLists, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibCompiledOpcodesLists, _glimmerRuntimeLibHelpersGetDynamicVar, _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars, _glimmerRuntimeLibVm, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibEnvironment, _glimmerRuntimeLibPartial, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibModifierInterfaces, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibBounds) { 'use strict'; exports.ATTRIBUTE_SYNTAX = _glimmerRuntimeLibSyntax.ATTRIBUTE; exports.StatementSyntax = _glimmerRuntimeLibSyntax.Statement; exports.ExpressionSyntax = _glimmerRuntimeLibSyntax.Expression; exports.AttributeSyntax = _glimmerRuntimeLibSyntax.Attribute; exports.StatementCompilationBuffer = _glimmerRuntimeLibSyntax.StatementCompilationBuffer; exports.SymbolLookup = _glimmerRuntimeLibSyntax.SymbolLookup; exports.CompileInto = _glimmerRuntimeLibSyntax.CompileInto; exports.isAttribute = _glimmerRuntimeLibSyntax.isAttribute; exports.templateFactory = _glimmerRuntimeLibTemplate.default; exports.TemplateFactory = _glimmerRuntimeLibTemplate.TemplateFactory; exports.Template = _glimmerRuntimeLibTemplate.Template; exports.SymbolTable = _glimmerRuntimeLibSymbolTable.default; exports.ConditionalReference = _glimmerRuntimeLibReferences.ConditionalReference; exports.NULL_REFERENCE = _glimmerRuntimeLibReferences.NULL_REFERENCE; exports.UNDEFINED_REFERENCE = _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; exports.Templates = _glimmerRuntimeLibSyntaxCore.Templates; exports.OptimizedAppend = _glimmerRuntimeLibSyntaxCore.OptimizedAppend; exports.UnoptimizedAppend = _glimmerRuntimeLibSyntaxCore.UnoptimizedAppend; exports.Unknown = _glimmerRuntimeLibSyntaxCore.Unknown; exports.StaticAttr = _glimmerRuntimeLibSyntaxCore.StaticAttr; exports.DynamicAttr = _glimmerRuntimeLibSyntaxCore.DynamicAttr; exports.ArgsSyntax = _glimmerRuntimeLibSyntaxCore.Args; exports.NamedArgsSyntax = _glimmerRuntimeLibSyntaxCore.NamedArgs; exports.PositionalArgsSyntax = _glimmerRuntimeLibSyntaxCore.PositionalArgs; exports.RefSyntax = _glimmerRuntimeLibSyntaxCore.Ref; exports.GetNamedParameterSyntax = _glimmerRuntimeLibSyntaxCore.GetArgument; exports.GetSyntax = _glimmerRuntimeLibSyntaxCore.Get; exports.ValueSyntax = _glimmerRuntimeLibSyntaxCore.Value; exports.OpenElement = _glimmerRuntimeLibSyntaxCore.OpenElement; exports.HelperSyntax = _glimmerRuntimeLibSyntaxCore.Helper; exports.BlockSyntax = _glimmerRuntimeLibSyntaxCore.Block; exports.OpenPrimitiveElementSyntax = _glimmerRuntimeLibSyntaxCore.OpenPrimitiveElement; exports.CloseElementSyntax = _glimmerRuntimeLibSyntaxCore.CloseElement; exports.Compiler = _glimmerRuntimeLibCompiler.default; exports.Compilable = _glimmerRuntimeLibCompiler.Compilable; exports.CompileIntoList = _glimmerRuntimeLibCompiler.CompileIntoList; exports.compileLayout = _glimmerRuntimeLibCompiler.compileLayout; exports.ComponentBuilder = _glimmerRuntimeLibOpcodeBuilder.ComponentBuilder; exports.StaticDefinition = _glimmerRuntimeLibOpcodeBuilder.StaticDefinition; exports.DynamicDefinition = _glimmerRuntimeLibOpcodeBuilder.DynamicDefinition; exports.OpcodeBuilderDSL = _glimmerRuntimeLibCompiledOpcodesBuilder.default; exports.Block = _glimmerRuntimeLibCompiledBlocks.Block; exports.CompiledBlock = _glimmerRuntimeLibCompiledBlocks.CompiledBlock; exports.Layout = _glimmerRuntimeLibCompiledBlocks.Layout; exports.InlineBlock = _glimmerRuntimeLibCompiledBlocks.InlineBlock; exports.EntryPoint = _glimmerRuntimeLibCompiledBlocks.EntryPoint; exports.Opcode = _glimmerRuntimeLibOpcodes.Opcode; exports.OpSeq = _glimmerRuntimeLibOpcodes.OpSeq; exports.OpSeqBuilder = _glimmerRuntimeLibOpcodes.OpSeqBuilder; exports.inspectOpcodes = _glimmerRuntimeLibOpcodes.inspect; exports.PushChildScopeOpcode = _glimmerRuntimeLibCompiledOpcodesVm.PushChildScopeOpcode; exports.PopScopeOpcode = _glimmerRuntimeLibCompiledOpcodesVm.PopScopeOpcode; exports.PushDynamicScopeOpcode = _glimmerRuntimeLibCompiledOpcodesVm.PushDynamicScopeOpcode; exports.PopDynamicScopeOpcode = _glimmerRuntimeLibCompiledOpcodesVm.PopDynamicScopeOpcode; exports.PutValueOpcode = _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode; exports.PutNullOpcode = _glimmerRuntimeLibCompiledOpcodesVm.PutNullOpcode; exports.PutArgsOpcode = _glimmerRuntimeLibCompiledOpcodesVm.PutArgsOpcode; exports.LabelOpcode = _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode; exports.EnterOpcode = _glimmerRuntimeLibCompiledOpcodesVm.EnterOpcode; exports.ExitOpcode = _glimmerRuntimeLibCompiledOpcodesVm.ExitOpcode; exports.EvaluateOpcode = _glimmerRuntimeLibCompiledOpcodesVm.EvaluateOpcode; exports.TestOpcode = _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode; exports.JumpOpcode = _glimmerRuntimeLibCompiledOpcodesVm.JumpOpcode; exports.JumpIfOpcode = _glimmerRuntimeLibCompiledOpcodesVm.JumpIfOpcode; exports.JumpUnlessOpcode = _glimmerRuntimeLibCompiledOpcodesVm.JumpUnlessOpcode; exports.BindNamedArgsOpcode = _glimmerRuntimeLibCompiledOpcodesVm.BindNamedArgsOpcode; exports.BindDynamicScopeOpcode = _glimmerRuntimeLibCompiledOpcodesVm.BindDynamicScopeOpcode; exports.OpenComponentOpcode = _glimmerRuntimeLibCompiledOpcodesComponent.OpenComponentOpcode; exports.CloseComponentOpcode = _glimmerRuntimeLibCompiledOpcodesComponent.CloseComponentOpcode; exports.ShadowAttributesOpcode = _glimmerRuntimeLibCompiledOpcodesComponent.ShadowAttributesOpcode; exports.OpenPrimitiveElementOpcode = _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode; exports.CloseElementOpcode = _glimmerRuntimeLibCompiledOpcodesDom.CloseElementOpcode; exports.IChangeList = _glimmerRuntimeLibDomChangeLists.IChangeList; exports.AttributeChangeList = _glimmerRuntimeLibDomChangeLists.AttributeChangeList; exports.PropertyChangeList = _glimmerRuntimeLibDomChangeLists.PropertyChangeList; exports.SafeHrefAttributeChangeList = _glimmerRuntimeLibDomChangeLists.SafeHrefAttributeChangeList; exports.SafeHrefPropertyChangeList = _glimmerRuntimeLibDomChangeLists.SafeHrefPropertyChangeList; exports.InputValuePropertyChangeList = _glimmerRuntimeLibDomChangeLists.InputValuePropertyChangeList; exports.defaultChangeLists = _glimmerRuntimeLibDomChangeLists.defaultChangeLists; exports.defaultAttributeChangeLists = _glimmerRuntimeLibDomChangeLists.defaultAttributeChangeLists; exports.defaultPropertyChangeLists = _glimmerRuntimeLibDomChangeLists.defaultPropertyChangeLists; exports.readDOMAttr = _glimmerRuntimeLibDomChangeLists.readDOMAttr; exports.normalizeTextValue = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue; exports.CompiledExpression = _glimmerRuntimeLibCompiledExpressions.CompiledExpression; exports.CompiledArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs; exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs; exports.CompiledPositionalArgs = _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs; exports.EvaluatedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs; exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedNamedArgs; exports.EvaluatedPositionalArgs = _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedPositionalArgs; exports.ValueReference = _glimmerRuntimeLibCompiledExpressionsValue.ValueReference; exports.FunctionExpression = _glimmerRuntimeLibCompiledExpressionsFunction.FunctionExpression; exports.EnterListOpcode = _glimmerRuntimeLibCompiledOpcodesLists.EnterListOpcode; exports.ExitListOpcode = _glimmerRuntimeLibCompiledOpcodesLists.ExitListOpcode; exports.EnterWithKeyOpcode = _glimmerRuntimeLibCompiledOpcodesLists.EnterWithKeyOpcode; exports.NextIterOpcode = _glimmerRuntimeLibCompiledOpcodesLists.NextIterOpcode; exports.getDynamicVar = _glimmerRuntimeLibHelpersGetDynamicVar.default; exports.WithDynamicVarsSyntax = _glimmerRuntimeLibSyntaxBuiltinsWithDynamicVars.default; exports.VM = _glimmerRuntimeLibVm.PublicVM; exports.UpdatingVM = _glimmerRuntimeLibVm.UpdatingVM; exports.RenderResult = _glimmerRuntimeLibVm.RenderResult; exports.SafeString = _glimmerRuntimeLibUpsert.SafeString; exports.isSafeString = _glimmerRuntimeLibUpsert.isSafeString; exports.Scope = _glimmerRuntimeLibEnvironment.Scope; exports.Environment = _glimmerRuntimeLibEnvironment.default; exports.Helper = _glimmerRuntimeLibEnvironment.Helper; exports.ParsedStatement = _glimmerRuntimeLibEnvironment.ParsedStatement; exports.DynamicScope = _glimmerRuntimeLibEnvironment.DynamicScope; exports.PartialDefinition = _glimmerRuntimeLibPartial.PartialDefinition; exports.Component = _glimmerRuntimeLibComponentInterfaces.Component; exports.ComponentClass = _glimmerRuntimeLibComponentInterfaces.ComponentClass; exports.ComponentManager = _glimmerRuntimeLibComponentInterfaces.ComponentManager; exports.ComponentDefinition = _glimmerRuntimeLibComponentInterfaces.ComponentDefinition; exports.ComponentLayoutBuilder = _glimmerRuntimeLibComponentInterfaces.ComponentLayoutBuilder; exports.ComponentAttrsBuilder = _glimmerRuntimeLibComponentInterfaces.ComponentAttrsBuilder; exports.isComponentDefinition = _glimmerRuntimeLibComponentInterfaces.isComponentDefinition; exports.ModifierManager = _glimmerRuntimeLibModifierInterfaces.ModifierManager; exports.DOMChanges = _glimmerRuntimeLibDomHelper.default; exports.IDOMChanges = _glimmerRuntimeLibDomHelper.DOMChanges; exports.DOMTreeConstruction = _glimmerRuntimeLibDomHelper.DOMTreeConstruction; exports.isWhitespace = _glimmerRuntimeLibDomHelper.isWhitespace; exports.insertHTMLBefore = _glimmerRuntimeLibDomHelper.insertHTMLBefore; exports.Simple = _glimmerRuntimeLibDomInterfaces; exports.ElementStack = _glimmerRuntimeLibBuilder.ElementStack; exports.ElementOperations = _glimmerRuntimeLibBuilder.ElementOperations; exports.Bounds = _glimmerRuntimeLibBounds.default; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7VUFDZSxnQkFBZ0IsNEJBQTdCLFNBQVM7VUFDSSxlQUFlLDRCQUE1QixTQUFTO1VBQ0ssZ0JBQWdCLDR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V4cG9ydCB7XG4gIFNjb3BlLFxuICBkZWZhdWx0IGFzIEVudmlyb25tZW50LFxuICBIZWxwZXIsXG4gIFBhcnNlZFN0YXRlbWVudCxcbiAgRHluYW1pY1Njb3BlLFxufSBmcm9tICcuL2xpYi9lbnZpcm9ubWVudCc7XG5cbmV4cG9ydCB7XG4gIFBhcnRpYWxEZWZpbml0aW9uXG59IGZyb20gJy4vbGliL3BhcnRpYWwnO1xuXG5leHBvcnQge1xuICBDb21wb25lbnQsXG4gIENvbXBvbmVudENsYXNzLFxuICBDb21wb25lbnRNYW5hZ2VyLFxuICBDb21wb25lbnREZWZpbml0aW9uLFxuICBDb21wb25lbnRMYXlvdXRCdWlsZGVyLFxuICBDb21wb25lbnRBdHRyc0J1aWxkZXIsXG4gIGlzQ29tcG9uZW50RGVmaW5pdGlvblxufSBmcm9tICcuL2xpYi9jb21wb25lbnQvaW50ZXJmYWNlcyc7XG5cbmV4cG9ydCB7XG4gIE1vZGlmaWVyTWFuYWdlclxufSBmcm9tICcuL2xpYi9tb2RpZmllci9pbnRlcmZhY2VzJztcblxuZXhwb3J0IHsgZGVmYXVsdCBhcyBET01DaGFuZ2VzLCBET01DaGFuZ2VzIGFzIElET01DaGFuZ2VzLCBET01UcmVlQ29uc3RydWN0aW9uLCBpc1doaXRlc3BhY2UsIGluc2VydEhUTUxCZWZvcmUgfSBmcm9tICcuL2xpYi9kb20vaGVscGVyJztcbmltcG9ydCAgKiBhcyBTaW1wbGUgZnJvbSAnLi9saWIvZG9tL2ludGVyZmFjZXMnO1xuZXhwb3J0IHsgU2ltcGxlIH07XG5leHBvcnQgeyBFbGVtZW50U3RhY2ssIEVsZW1lbnRPcGVyYXRpb25zIH0gZnJvbSAnLi9saWIvYnVpbGRlcic7XG5leHBvcnQgeyBkZWZhdWx0IGFzIEJvdW5kcyB9IGZyb20gJy4vbGliL2JvdW5kcyc7XG4iXX0= enifed("glimmer-runtime/lib/bounds", ["exports"], function (exports) { "use strict"; exports.bounds = bounds; exports.single = single; exports.move = move; exports.clear = clear; var Cursor = function Cursor(element, nextSibling) { this.element = element; this.nextSibling = nextSibling; }; exports.Cursor = Cursor; var RealDOMBounds = (function () { function RealDOMBounds(bounds) { this.bounds = bounds; } RealDOMBounds.prototype.parentElement = function parentElement() { return this.bounds.parentElement(); }; RealDOMBounds.prototype.firstNode = function firstNode() { return this.bounds.firstNode(); }; RealDOMBounds.prototype.lastNode = function lastNode() { return this.bounds.lastNode(); }; return RealDOMBounds; })(); exports.RealDOMBounds = RealDOMBounds; var ConcreteBounds = (function () { function ConcreteBounds(parentNode, first, last) { this.parentNode = parentNode; this.first = first; this.last = last; } ConcreteBounds.prototype.parentElement = function parentElement() { return this.parentNode; }; ConcreteBounds.prototype.firstNode = function firstNode() { return this.first; }; ConcreteBounds.prototype.lastNode = function lastNode() { return this.last; }; return ConcreteBounds; })(); exports.ConcreteBounds = ConcreteBounds; var SingleNodeBounds = (function () { function SingleNodeBounds(parentNode, node) { this.parentNode = parentNode; this.node = node; } SingleNodeBounds.prototype.parentElement = function parentElement() { return this.parentNode; }; SingleNodeBounds.prototype.firstNode = function firstNode() { return this.node; }; SingleNodeBounds.prototype.lastNode = function lastNode() { return this.node; }; return SingleNodeBounds; })(); exports.SingleNodeBounds = SingleNodeBounds; function bounds(parent, first, last) { return new ConcreteBounds(parent, first, last); } function single(parent, node) { return new SingleNodeBounds(parent, node); } function move(bounds, reference) { var parent = bounds.parentElement(); var first = bounds.firstNode(); var last = bounds.lastNode(); var node = first; while (node) { var next = node.nextSibling; parent.insertBefore(node, reference); if (node === last) return next; node = next; } return null; } function clear(bounds) { var parent = bounds.parentElement(); var first = bounds.firstNode(); var last = bounds.lastNode(); var node = first; while (node) { var next = node.nextSibling; parent.removeChild(node); if (node === last) return next; node = next; } return null; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvYm91bmRzLnRzIl0sIm5hbWVzIjpb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ldHVybiBuZXh0O1xuICAgIG5vZGUgPSBuZXh0O1xuICB9XG5cbiAgcmV0dXJuIG51bGw7XG59XG4iXX0= enifed('glimmer-runtime/lib/builder', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-util', 'glimmer-runtime/lib/compiled/opcodes/dom'], function (exports, _glimmerRuntimeLibBounds, _glimmerUtil, _glimmerRuntimeLibCompiledOpcodesDom) { 'use strict'; var First = (function () { function First(node) { this.node = node; } First.prototype.firstNode = function firstNode() { return this.node; }; return First; })(); var Last = (function () { function Last(node) { this.node = node; } Last.prototype.lastNode = function lastNode() { return this.node; }; return Last; })(); var Fragment = (function () { function Fragment(bounds) { this.bounds = bounds; } Fragment.prototype.parentElement = function parentElement() { return this.bounds.parentElement(); }; Fragment.prototype.firstNode = function firstNode() { return this.bounds.firstNode(); }; Fragment.prototype.lastNode = function lastNode() { return this.bounds.lastNode(); }; Fragment.prototype.update = function update(bounds) { this.bounds = bounds; }; return Fragment; })(); exports.Fragment = Fragment; var ElementStack = (function () { function ElementStack(env, parentNode, nextSibling) { this.constructing = null; this.operations = null; this.elementStack = new _glimmerUtil.Stack(); this.nextSiblingStack = new _glimmerUtil.Stack(); this.blockStack = new _glimmerUtil.Stack(); this.env = env; this.dom = env.getAppendOperations(); this.updateOperations = env.getDOM(); this.element = parentNode; this.nextSibling = nextSibling; this.defaultOperations = new _glimmerRuntimeLibCompiledOpcodesDom.SimpleElementOperations(env); this.elementStack.push(this.element); this.nextSiblingStack.push(this.nextSibling); } ElementStack.forInitialRender = function forInitialRender(env, parentNode, nextSibling) { return new ElementStack(env, parentNode, nextSibling); }; ElementStack.resume = function resume(env, tracker, nextSibling) { var parentNode = tracker.parentElement(); var stack = new ElementStack(env, parentNode, nextSibling); stack.pushBlockTracker(tracker); return stack; }; ElementStack.prototype.block = function block() { return this.blockStack.current; }; ElementStack.prototype.popElement = function popElement() { var elementStack = this.elementStack; var nextSiblingStack = this.nextSiblingStack; var topElement = elementStack.pop(); nextSiblingStack.pop(); this.element = elementStack.current; this.nextSibling = nextSiblingStack.current; return topElement; }; ElementStack.prototype.pushSimpleBlock = function pushSimpleBlock() { var tracker = new SimpleBlockTracker(this.element); this.pushBlockTracker(tracker); return tracker; }; ElementStack.prototype.pushUpdatableBlock = function pushUpdatableBlock() { var tracker = new UpdatableBlockTracker(this.element); this.pushBlockTracker(tracker); return tracker; }; ElementStack.prototype.pushBlockTracker = function pushBlockTracker(tracker) { var current = this.blockStack.current; if (current !== null) { current.newDestroyable(tracker); current.newBounds(tracker); } this.blockStack.push(tracker); return tracker; }; ElementStack.prototype.pushBlockList = function pushBlockList(list) { var tracker = new BlockListTracker(this.element, list); var current = this.blockStack.current; if (current !== null) { current.newDestroyable(tracker); current.newBounds(tracker); } this.blockStack.push(tracker); return tracker; }; ElementStack.prototype.popBlock = function popBlock() { this.blockStack.current.finalize(this); return this.blockStack.pop(); }; ElementStack.prototype.openElement = function openElement(tag) { var operations = arguments.length <= 1 || arguments[1] === undefined ? this.defaultOperations : arguments[1]; var element = this.dom.createElement(tag, this.element); this.constructing = element; this.operations = operations; return element; }; ElementStack.prototype.flushElement = function flushElement() { var parent = this.element; var element = this.element = this.constructing; this.dom.insertBefore(parent, element, this.nextSibling); this.constructing = null; this.operations = null; this.nextSibling = null; this.elementStack.push(element); this.nextSiblingStack.push(null); this.blockStack.current.openElement(element); }; ElementStack.prototype.newDestroyable = function newDestroyable(d) { this.blockStack.current.newDestroyable(d); }; ElementStack.prototype.newBounds = function newBounds(bounds) { this.blockStack.current.newBounds(bounds); }; ElementStack.prototype.appendText = function appendText(string) { var dom = this.dom; var text = dom.createTextNode(string); dom.insertBefore(this.element, text, this.nextSibling); this.blockStack.current.newNode(text); return text; }; ElementStack.prototype.appendComment = function appendComment(string) { var dom = this.dom; var comment = dom.createComment(string); dom.insertBefore(this.element, comment, this.nextSibling); this.blockStack.current.newNode(comment); return comment; }; ElementStack.prototype.setStaticAttribute = function setStaticAttribute(name, value) { this.operations.addStaticAttribute(this.constructing, name, value); }; ElementStack.prototype.setStaticAttributeNS = function setStaticAttributeNS(namespace, name, value) { this.operations.addStaticAttributeNS(this.constructing, namespace, name, value); }; ElementStack.prototype.setDynamicAttribute = function setDynamicAttribute(name, reference, isTrusting) { this.operations.addDynamicAttribute(this.constructing, name, reference, isTrusting); }; ElementStack.prototype.setDynamicAttributeNS = function setDynamicAttributeNS(namespace, name, reference, isTrusting) { this.operations.addDynamicAttributeNS(this.constructing, namespace, name, reference, isTrusting); }; ElementStack.prototype.closeElement = function closeElement() { this.blockStack.current.closeElement(); this.popElement(); }; return ElementStack; })(); exports.ElementStack = ElementStack; var SimpleBlockTracker = (function () { function SimpleBlockTracker(parent) { this.parent = parent; this.first = null; this.last = null; this.destroyables = null; this.nesting = 0; this.parent = parent; } SimpleBlockTracker.prototype.destroy = function destroy() { var destroyables = this.destroyables; if (destroyables && destroyables.length) { for (var i = 0; i < destroyables.length; i++) { destroyables[i].destroy(); } } }; SimpleBlockTracker.prototype.parentElement = function parentElement() { return this.parent; }; SimpleBlockTracker.prototype.firstNode = function firstNode() { return this.first && this.first.firstNode(); }; SimpleBlockTracker.prototype.lastNode = function lastNode() { return this.last && this.last.lastNode(); }; SimpleBlockTracker.prototype.openElement = function openElement(element) { this.newNode(element); this.nesting++; }; SimpleBlockTracker.prototype.closeElement = function closeElement() { this.nesting--; }; SimpleBlockTracker.prototype.newNode = function newNode(node) { if (this.nesting !== 0) return; if (!this.first) { this.first = new First(node); } this.last = new Last(node); }; SimpleBlockTracker.prototype.newBounds = function newBounds(bounds) { if (this.nesting !== 0) return; if (!this.first) { this.first = bounds; } this.last = bounds; }; SimpleBlockTracker.prototype.newDestroyable = function newDestroyable(d) { this.destroyables = this.destroyables || []; this.destroyables.push(d); }; SimpleBlockTracker.prototype.finalize = function finalize(stack) { if (!this.first) { stack.appendComment(''); } }; return SimpleBlockTracker; })(); exports.SimpleBlockTracker = SimpleBlockTracker; var UpdatableBlockTracker = (function (_SimpleBlockTracker) { babelHelpers.inherits(UpdatableBlockTracker, _SimpleBlockTracker); function UpdatableBlockTracker() { _SimpleBlockTracker.apply(this, arguments); } UpdatableBlockTracker.prototype.reset = function reset(env) { var destroyables = this.destroyables; if (destroyables && destroyables.length) { for (var i = 0; i < destroyables.length; i++) { env.didDestroy(destroyables[i]); } } var nextSibling = _glimmerRuntimeLibBounds.clear(this); this.destroyables = null; this.first = null; this.last = null; return nextSibling; }; return UpdatableBlockTracker; })(SimpleBlockTracker); exports.UpdatableBlockTracker = UpdatableBlockTracker; var BlockListTracker = (function () { function BlockListTracker(parent, boundList) { this.parent = parent; this.boundList = boundList; this.parent = parent; this.boundList = boundList; } BlockListTracker.prototype.destroy = function destroy() { this.boundList.forEachNode(function (node) { return node.destroy(); }); }; BlockListTracker.prototype.parentElement = function parentElement() { return this.parent; }; BlockListTracker.prototype.firstNode = function firstNode() { return this.boundList.head().firstNode(); }; BlockListTracker.prototype.lastNode = function lastNode() { return this.boundList.tail().lastNode(); }; BlockListTracker.prototype.openElement = function openElement(element) { _glimmerUtil.assert(false, 'Cannot openElement directly inside a block list'); }; BlockListTracker.prototype.closeElement = function closeElement() { _glimmerUtil.assert(false, 'Cannot closeElement directly inside a block list'); }; BlockListTracker.prototype.newNode = function newNode(node) { _glimmerUtil.assert(false, 'Cannot create a new node directly inside a block list'); }; BlockListTracker.prototype.newBounds = function newBounds(bounds) {}; BlockListTracker.prototype.newDestroyable = function newDestroyable(d) {}; BlockListTracker.prototype.finalize = function finalize(stack) {}; return BlockListTracker; })(); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvYnVpbGRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUE0QkEsS0FBQTtBQUdFLGlCQUhGLEtBQUEsQ0FHYyxJQUFJLEVBQUE7QUFDZCxnQkFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7U0FDbEI7O0FBTEgsYU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['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; exports.domChanges = domChanges; exports.treeConstruction = treeConstruction; var innerHTMLWrapper = { colgroup: { depth: 2, before: '', after: '
    ' }, table: { depth: 1, before: '', after: '
    ' }, tbody: { depth: 2, before: '', after: '
    ' }, tfoot: { depth: 2, before: '', after: '
    ' }, thead: { depth: 2, before: '', after: '
    ' }, tr: { depth: 3, before: '', after: '
    ' } }; // Patch: innerHTML Fix // Browsers: IE9 // Reason: IE9 don't allow us to set innerHTML on col, colgroup, frameset, // html, style, table, tbody, tfoot, thead, title, tr. // Fix: Wrap the innerHTML we are about to set in its parents, apply the // wrapped innerHTML on a div, then move the unwrapped nodes into the // target position. function domChanges(document, DOMChangesClass) { if (!document) return DOMChangesClass; if (!shouldApplyFix(document)) { return DOMChangesClass; } var div = document.createElement('div'); return (function (_DOMChangesClass) { babelHelpers.inherits(DOMChangesWithInnerHTMLFix, _DOMChangesClass); function DOMChangesWithInnerHTMLFix() { _DOMChangesClass.apply(this, arguments); } DOMChangesWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { if (html === null || html === '') { return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); } var parentTag = parent.tagName.toLowerCase(); var wrapper = innerHTMLWrapper[parentTag]; if (wrapper === undefined) { return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); } return fixInnerHTML(parent, wrapper, div, html, nextSibling); }; return DOMChangesWithInnerHTMLFix; })(DOMChangesClass); } function treeConstruction(document, DOMTreeConstructionClass) { if (!document) return DOMTreeConstructionClass; if (!shouldApplyFix(document)) { return DOMTreeConstructionClass; } var div = document.createElement('div'); return (function (_DOMTreeConstructionClass) { babelHelpers.inherits(DOMTreeConstructionWithInnerHTMLFix, _DOMTreeConstructionClass); function DOMTreeConstructionWithInnerHTMLFix() { _DOMTreeConstructionClass.apply(this, arguments); } DOMTreeConstructionWithInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { if (html === null || html === '') { return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); } var parentTag = parent.tagName.toLowerCase(); var wrapper = innerHTMLWrapper[parentTag]; if (wrapper === undefined) { return _DOMTreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); } return fixInnerHTML(parent, wrapper, div, html, reference); }; return DOMTreeConstructionWithInnerHTMLFix; })(DOMTreeConstructionClass); } function fixInnerHTML(parent, wrapper, div, html, reference) { var wrappedHtml = wrapper.before + html + wrapper.after; div.innerHTML = wrappedHtml; var parentNode = div; for (var i = 0; i < wrapper.depth; i++) { parentNode = parentNode.childNodes[0]; } var _moveNodesBefore = _glimmerRuntimeLibDomHelper.moveNodesBefore(parentNode, parent, reference); var first = _moveNodesBefore[0]; var last = _moveNodesBefore[1]; return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); } function shouldApplyFix(document) { var table = document.createElement('table'); try { table.innerHTML = ''; } catch (e) {} finally { if (table.childNodes.length !== 0) { // It worked as expected, no fix required return false; } } return true; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L2lubmVyLWh0bWwtZml4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQVNBLFFBQUksZ0JBQWdCLEdBQUc7QUFDckIsZ0JBQVEsRUFBRSxFQUFFLEtBQUssRUFBRSxDQUFDLEVBQUUsTUFBTSxFQUFFLG1CQUFtQixFQUFFLEtBQUssRUFBRSxxQkFBcUIsRUFBRTtBQUNqRixhQUFLLEVBQUssRUFBRSxLQUFLLEVBQUUsQ0FBQyxFQUFFLE1BQU0sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLFVBQVUsRUFBRTtBQUM1RCxhQUFLL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ime/lib/dom/helper'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibDomHelper) { 'use strict'; exports.domChanges = domChanges; exports.treeConstruction = treeConstruction; var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; // Patch: insertAdjacentHTML on SVG Fix // Browsers: Safari, IE, Edge, Firefox ~33-34 // Reason: insertAdjacentHTML does not exist on SVG elements in Safari. It is // present but throws an exception on IE and Edge. Old versions of // Firefox create nodes in the incorrect namespace. // Fix: Since IE and Edge silently fail to create SVG nodes using // innerHTML, and because Firefox may create nodes in the incorrect // namespace using innerHTML on SVG elements, an HTML-string wrapping // approach is used. A pre/post SVG tag is added to the string, then // that whole string is added to a div. The created nodes are plucked // out and applied to the target location on DOM. function domChanges(document, DOMChangesClass, svgNamespace) { if (!document) return DOMChangesClass; if (!shouldApplyFix(document, svgNamespace)) { return DOMChangesClass; } var div = document.createElement('div'); return (function (_DOMChangesClass) { babelHelpers.inherits(DOMChangesWithSVGInnerHTMLFix, _DOMChangesClass); function DOMChangesWithSVGInnerHTMLFix() { _DOMChangesClass.apply(this, arguments); } DOMChangesWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { if (html === null || html === '') { return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); } if (parent.namespaceURI !== svgNamespace) { return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); } return fixSVG(parent, div, html, nextSibling); }; return DOMChangesWithSVGInnerHTMLFix; })(DOMChangesClass); } function treeConstruction(document, TreeConstructionClass, svgNamespace) { if (!document) return TreeConstructionClass; if (!shouldApplyFix(document, svgNamespace)) { return TreeConstructionClass; } var div = document.createElement('div'); return (function (_TreeConstructionClass) { babelHelpers.inherits(TreeConstructionWithSVGInnerHTMLFix, _TreeConstructionClass); function TreeConstructionWithSVGInnerHTMLFix() { _TreeConstructionClass.apply(this, arguments); } TreeConstructionWithSVGInnerHTMLFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { if (html === null || html === '') { return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); } if (parent.namespaceURI !== svgNamespace) { return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); } return fixSVG(parent, div, html, reference); }; return TreeConstructionWithSVGInnerHTMLFix; })(TreeConstructionClass); } function fixSVG(parent, div, html, reference) { // IE, Edge: also do not correctly support using `innerHTML` on SVG // namespaced elements. So here a wrapper is used. var wrappedHtml = '' + html + ''; div.innerHTML = wrappedHtml; var _moveNodesBefore = _glimmerRuntimeLibDomHelper.moveNodesBefore(div.firstChild, parent, reference); var first = _moveNodesBefore[0]; var last = _moveNodesBefore[1]; return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); } function shouldApplyFix(document, svgNamespace) { var svg = document.createElementNS(svgNamespace, 'svg'); try { svg['insertAdjacentHTML']('beforeEnd', ''); } catch (e) {} finally { // FF: Old versions will create a node in the wrong namespace if (svg.childNodes.length === 1 && svg.firstChild.namespaceURI === SVG_NAMESPACE) { // The test worked as expected, no fix required return false; } svg = null; return true; } } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L3N2Zy1pbm5lci1odG1sLWZpeC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFHQSxRQUFNLGFBQWEsR0FBRyw0QkFBNEIsQ0FBQzs7Ozs7Ozs7Ozs7OztBQWE3QyxhQUFBLFVBQUEsQ0FBcUIsUUFBa0IsRUFBRSxlQUFrQyxFQUFFLFlBQW9CLEVBQUE7QUFDckcsWUFBSSxDQUFDLFFBQVEsRUFBRSxPQUFPLGVBQWUsQ0FBQztBQUV0QyxZQUFJLENBQUMsY0FBYyxDQUFDLFFBQVEsRUFBRSxZQUFZLENBQUMsRUFBRTtBQUMzQyxtQkFBTyxlQUFlLENBQUM7U0FDeEI7QUFFRCx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AgICByZXR1cm4gdHJ1ZTtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/compat/text-node-merging-fix', ['exports'], function (exports) { // Patch: Adjacent text node merging fix // Browsers: IE, Edge, Firefox w/o inspector open // Reason: These browsers will merge adjacent text nodes. For exmaple given //
    Hello
    with div.insertAdjacentHTML(' world') browsers // with proper behavior will populate div.childNodes with two items. // These browsers will populate it with one merged node instead. // Fix: Add these nodes to a wrapper element, then iterate the childNodes // of that wrapper and move the nodes to their target location. Note // that potential SVG bugs will have been handled before this fix. // Note that this fix must only apply to the previous text node, as // the base implementation of `insertHTMLBefore` already handles // following text nodes correctly. 'use strict'; exports.domChanges = domChanges; exports.treeConstruction = treeConstruction; function domChanges(document, DOMChangesClass) { if (!document) return DOMChangesClass; if (!shouldApplyFix(document)) { return DOMChangesClass; } return (function (_DOMChangesClass) { babelHelpers.inherits(DOMChangesWithTextNodeMergingFix, _DOMChangesClass); function DOMChangesWithTextNodeMergingFix(document) { _DOMChangesClass.call(this, document); this.uselessComment = document.createComment(''); } DOMChangesWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, nextSibling, html) { if (html === null) { return _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); } var didSetUselessComment = false; var nextPrevious = nextSibling ? nextSibling.previousSibling : parent.lastChild; if (nextPrevious && nextPrevious instanceof Text) { didSetUselessComment = true; parent.insertBefore(this.uselessComment, nextSibling); } var bounds = _DOMChangesClass.prototype.insertHTMLBefore.call(this, parent, nextSibling, html); if (didSetUselessComment) { parent.removeChild(this.uselessComment); } return bounds; }; return DOMChangesWithTextNodeMergingFix; })(DOMChangesClass); } function treeConstruction(document, TreeConstructionClass) { if (!document) return TreeConstructionClass; if (!shouldApplyFix(document)) { return TreeConstructionClass; } return (function (_TreeConstructionClass) { babelHelpers.inherits(TreeConstructionWithTextNodeMergingFix, _TreeConstructionClass); function TreeConstructionWithTextNodeMergingFix(document) { _TreeConstructionClass.call(this, document); this.uselessComment = this.createComment(''); } TreeConstructionWithTextNodeMergingFix.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { if (html === null) { return _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); } var didSetUselessComment = false; var nextPrevious = reference ? reference.previousSibling : parent.lastChild; if (nextPrevious && nextPrevious instanceof Text) { didSetUselessComment = true; parent.insertBefore(this.uselessComment, reference); } var bounds = _TreeConstructionClass.prototype.insertHTMLBefore.call(this, parent, html, reference); if (didSetUselessComment) { parent.removeChild(this.uselessComment); } return bounds; }; return TreeConstructionWithTextNodeMergingFix; })(TreeConstructionClass); } function shouldApplyFix(document) { var mergingTextDiv = document.createElement('div'); mergingTextDiv.innerHTML = 'first'; mergingTextDiv.insertAdjacentHTML('beforeEnd', 'second'); if (mergingTextDiv.childNodes.length === 2) { mergingTextDiv = null; // It worked as expected, no fix required return false; } mergingTextDiv = null; return true; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGF0L3RleHQtbm9kZS1tZXJnaW5nLWZpeC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFlTSxhQUFBLFVBQUEsQ0FBcUIsUUFBa0IsRUFBRSxlQUFrQyxFQUFBO0FBQy9FLFlBQUksQ0FBQyxRQUFRLEVBQUUsT0FBTyxlQUFlLENBQUM7QUFFdEMsWUFBSSxDQUFDLGNBQWMsQ0FBQyxRQUFRLENBQUMsRUFBRTtBQUM3QixtQkFBTyxlQUFlLENBQUM7U0FDeEI7QUFFRDtrQ0FBTyxnQ0FBdUM7O0FBRzVDLHFCQUhLLGdDQUF1QyxDQUdoQyxRQUFRLEVBQUE7QUFDbEIsNENBQU0sUUFBUSxDQUFDLENBQUM7QUFDaEIsb0JBQUksQ0FBQyxjQUFjLEdBQUcsUUFBUSxDQUFDLGFBQWEsQ0FBQyxF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gICAvLyBJdCB3b3JrZWQgYXMgZXhwZWN0ZWQsIG5vIGZpeCByZXF1aXJlZFxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIG1lcmdpbmdUZXh0RGl2ID0gbnVsbDtcblxuICByZXR1cm4gdHJ1ZTtcbn1cbiJdfQ== enifed('glimmer-runtime/lib/compiled/blocks', ['exports', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiler'], function (exports, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiler) { 'use strict'; var CompiledBlock = function CompiledBlock(ops, symbols) { this.ops = ops; this.symbols = symbols; }; exports.CompiledBlock = CompiledBlock; var Block = function Block(program, symbolTable) { this.program = program; this.symbolTable = symbolTable; this.compiled = null; }; exports.Block = Block; var InlineBlock = (function (_Block) { babelHelpers.inherits(InlineBlock, _Block); function InlineBlock(program, symbolTable) { var locals = arguments.length <= 2 || arguments[2] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[2]; _Block.call(this, program, symbolTable); this.locals = locals; } InlineBlock.prototype.hasPositionalParameters = function hasPositionalParameters() { return !!this.locals.length; }; InlineBlock.prototype.compile = function compile(env) { var compiled = this.compiled; if (compiled) return compiled; var ops = new _glimmerRuntimeLibCompiler.InlineBlockCompiler(this, env).compile(); return this.compiled = new CompiledBlock(ops, this.symbolTable.size); }; return InlineBlock; })(Block); exports.InlineBlock = InlineBlock; var PartialBlock = (function (_InlineBlock) { babelHelpers.inherits(PartialBlock, _InlineBlock); function PartialBlock() { _InlineBlock.apply(this, arguments); } return PartialBlock; })(InlineBlock); exports.PartialBlock = PartialBlock; var TopLevelTemplate = (function (_Block2) { babelHelpers.inherits(TopLevelTemplate, _Block2); function TopLevelTemplate() { _Block2.apply(this, arguments); } return TopLevelTemplate; })(Block); exports.TopLevelTemplate = TopLevelTemplate; var EntryPoint = (function (_TopLevelTemplate) { babelHelpers.inherits(EntryPoint, _TopLevelTemplate); function EntryPoint() { _TopLevelTemplate.apply(this, arguments); } EntryPoint.prototype.compile = function compile(env) { var compiled = this.compiled; if (compiled) return compiled; var ops = new _glimmerRuntimeLibCompiler.EntryPointCompiler(this, env).compile(); return this.compiled = new CompiledBlock(ops, this.symbolTable.size); }; return EntryPoint; })(TopLevelTemplate); exports.EntryPoint = EntryPoint; var Layout = (function (_TopLevelTemplate2) { babelHelpers.inherits(Layout, _TopLevelTemplate2); function Layout(program, symbolTable, named, yields) { _TopLevelTemplate2.call(this, program, symbolTable); this.named = named; this.yields = yields; } Layout.prototype.hasNamedParameters = function hasNamedParameters() { return !!this.named.length; }; Layout.prototype.hasYields = function hasYields() { return !!this.yields.length; }; return Layout; })(TopLevelTemplate); exports.Layout = Layout; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvYmxvY2tzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQVdNLGFBQUEsR0FJSixTQUpJLGFBQUEsQ0FJUSxHQUFVLEVBQUUsT0FBZSxFQUFBO0FBQ3JDLFlBQUksQ0FBQyxHQUFHLEdBQUcsR0FBRyxDQUFDO0FBQ2YsWUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7S0FDeEI7Ozs7UUFHRyxLQUFBLEdBR0osU0FISSxLQUFBLENBR2UsT0FBZ0IsRUFBUyxXQUF3QixFQUFBO0FBQWpELFlBQUEsQ0FBQSxPQUFPLEdBQVAsT0FBTyxDQUFTO0FBQVMsWUFBQSxDQUFBLFdBQVcsR0FBWCxXQUFXLENBQWE7QUFGMUQsWUFBQSxDQUFBLFFBQVEsR0FBa0IsSUFBSSxDQUFDO0tBRStCOzs7O1FBR3BFLFdBQW1COzhCQUFuQixXQUFtQjs7QUFDdkIsaUJBREksV0FBbUIsQ0FDWCxPQUFnQixFQUFFLFdBQXdCLEVBQXVDO2dCQUE5QixNQUFBLGlGQXhCeEQsV0FBVzs7QUF5QmhC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dbXSkge1xuICAgIHN1cGVyKHByb2dyYW0sIHN5bWJvbFRhYmxlKTtcbiAgfVxuXG4gIGhhc05hbWVkUGFyYW1ldGVycygpOiBib29sZWFuIHtcbiAgICByZXR1cm4gISF0aGlzLm5hbWVkLmxlbmd0aDtcbiAgfVxuXG4gIGhhc1lpZWxkcygpOiBib29sZWFuIHtcbiAgICByZXR1cm4gISF0aGlzLnlpZWxkcy5sZW5ndGg7XG4gIH1cbn1cbiJdfQ== enifed("glimmer-runtime/lib/compiled/expressions", ["exports"], function (exports) { "use strict"; var CompiledExpression = (function () { function CompiledExpression() {} CompiledExpression.prototype.toJSON = function toJSON() { return "UNIMPL: " + this.type.toUpperCase(); }; return CompiledExpression; })(); exports.CompiledExpression = CompiledExpression; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBR00sa0JBQUE7aUJBQUEsa0JBQUE7O0FBQUEsMEJBQUEsV0FJSixNQUFNLEdBQUEsa0JBQUE7QUFDSixnQ0FBa0IsSUFBSSxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBRztTQUM3Qzs7ZUFORyxrQkFBQSIsImZpbGUiOiJleHByZXNzaW9ucy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBWTSBmcm9tICcuLi92bS9hcHBlbmQnO1xuaW1wb3J0IHsgUGF0aFJlZmVyZW5jZSB9IGZyb20gJ2dsaW1tZXItcmVmZXJlbmNlJztcblxuZXhwb3J0IGFic3RyYWN0IGNsYXNzIENvbXBpbGVkRXhwcmVzc2lvbjxUPiB7XG4gIHR5cGU6IHN0cmluZztcbiAgYWJzdHJhY3QgZXZhbHVhdGUodm06IFZNKTogUGF0aFJlZmVyZW5jZTxUPjtcblxuICB0b0pTT04oKTogc3RyaW5nIHtcbiAgICByZXR1cm4gYFVOSU1QTDogJHt0aGlzLnR5cGUudG9VcHBlckNhc2UoKX1gO1xuICB9XG59XG4iXX0= enifed('glimmer-runtime/lib/compiled/expressions/args', ['exports', 'glimmer-runtime/lib/compiled/expressions/positional-args', 'glimmer-runtime/lib/compiled/expressions/named-args', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressionsPositionalArgs, _glimmerRuntimeLibCompiledExpressionsNamedArgs, _glimmerReference) { 'use strict'; var CompiledArgs = (function () { function CompiledArgs(positional, named) { this.positional = positional; this.named = named; } CompiledArgs.create = function create(positional, named) { if (positional === _glimmerRuntimeLibCompiledExpressionsPositionalArgs.COMPILED_EMPTY_POSITIONAL_ARGS && named === _glimmerRuntimeLibCompiledExpressionsNamedArgs.COMPILED_EMPTY_NAMED_ARGS) { return this.empty(); } else { return new this(positional, named); } }; CompiledArgs.empty = function empty() { return COMPILED_EMPTY_ARGS; }; CompiledArgs.prototype.evaluate = function evaluate(vm) { return EvaluatedArgs.create(this.positional.evaluate(vm), this.named.evaluate(vm)); }; return CompiledArgs; })(); exports.CompiledArgs = CompiledArgs; var COMPILED_EMPTY_ARGS = new ((function (_CompiledArgs) { babelHelpers.inherits(_class, _CompiledArgs); function _class() { _CompiledArgs.call(this, _glimmerRuntimeLibCompiledExpressionsPositionalArgs.COMPILED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.COMPILED_EMPTY_NAMED_ARGS); } _class.prototype.evaluate = function evaluate(vm) { return EMPTY_EVALUATED_ARGS; }; return _class; })(CompiledArgs))(); var EvaluatedArgs = (function () { function EvaluatedArgs(positional, named) { this.positional = positional; this.named = named; this.tag = _glimmerReference.combineTagged([positional, named]); } EvaluatedArgs.empty = function empty() { return EMPTY_EVALUATED_ARGS; }; EvaluatedArgs.create = function create(positional, named) { return new this(positional, named); }; EvaluatedArgs.positional = function positional(values) { return new this(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EvaluatedPositionalArgs.create(values), _glimmerRuntimeLibCompiledExpressionsNamedArgs.EVALUATED_EMPTY_NAMED_ARGS); }; EvaluatedArgs.named = function named(map) { return new this(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EVALUATED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs.create(map)); }; return EvaluatedArgs; })(); exports.EvaluatedArgs = EvaluatedArgs; var EMPTY_EVALUATED_ARGS = new EvaluatedArgs(_glimmerRuntimeLibCompiledExpressionsPositionalArgs.EVALUATED_EMPTY_POSITIONAL_ARGS, _glimmerRuntimeLibCompiledExpressionsNamedArgs.EVALUATED_EMPTY_NAMED_ARGS); exports.CompiledPositionalArgs = _glimmerRuntimeLibCompiledExpressionsPositionalArgs.CompiledPositionalArgs; exports.EvaluatedPositionalArgs = _glimmerRuntimeLibCompiledExpressionsPositionalArgs.EvaluatedPositionalArgs; exports.CompiledNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.CompiledNamedArgs; exports.EvaluatedNamedArgs = _glimmerRuntimeLibCompiledExpressionsNamedArgs.EvaluatedNamedArgs; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvYXJncy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFNTSxZQUFBO0FBYUosaUJBYkksWUFBQSxDQWNLLFVBQWtDLEVBQ2xDLEtBQXdCLEVBQUE7QUFEeEIsZ0JBQUEsQ0FBQSxVQUFVLEdBQVYsVUFBVSxDQUF3QjtBQUNsQyxnQkFBQSxDQUFBLEtBQUssR0FBTCxLQUFLLENBQW1CO1NBRWhDOztBQWpCRyxvQkFBQSxDQUNHLE1BQU0sR0FBQSxnQkFBQyxVQUFrQyxFQUFFLEtBQXdCLEVBQUE7QUFDeEUsZ0JBQUksVUFBVSx5REFQVCw4QkF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AgIHJldHVybiBuZXcgdGhpcyhFdmFsdWF0ZWRQb3NpdGlvbmFsQXJncy5jcmVhdGUodmFsdWVzKSwgRVZBTFVBVEVEX0VNUFRZX05BTUVEX0FSR1MpO1xuICB9XG5cbiAgc3RhdGljIG5hbWVkKG1hcDogRGljdDxQYXRoUmVmZXJlbmNlPE9wYXF1ZT4+KSB7XG4gICAgcmV0dXJuIG5ldyB0aGlzKEVWQUxVQVRFRF9FTVBUWV9QT1NJVElPTkFMX0FSR1MsIEV2YWx1YXRlZE5hbWVkQXJncy5jcmVhdGUobWFwKSk7XG4gIH1cblxuICBwdWJsaWMgdGFnOiBSZXZpc2lvblRhZztcblxuICBjb25zdHJ1Y3RvcihcbiAgICBwdWJsaWMgcG9zaXRpb25hbDogRXZhbHVhdGVkUG9zaXRpb25hbEFyZ3MsXG4gICAgcHVibGljIG5hbWVkOiBFdmFsdWF0ZWROYW1lZEFyZ3NcbiAgKSB7XG4gICAgdGhpcy50YWcgPSBjb21iaW5lVGFnZ2VkKFtwb3NpdGlvbmFsLCBuYW1lZF0pO1xuICB9XG59XG5cbmNvbnN0IEVNUFRZX0VWQUxVQVRFRF9BUkdTID0gbmV3IEV2YWx1YXRlZEFyZ3MoRVZBTFVBVEVEX0VNUFRZX1BPU0lUSU9OQUxfQVJHUywgRVZBTFVBVEVEX0VNUFRZX05BTUVEX0FSR1MpO1xuXG5leHBvcnQgeyBDb21waWxlZFBvc2l0aW9uYWxBcmdzLCBFdmFsdWF0ZWRQb3NpdGlvbmFsQXJncywgQ29tcGlsZWROYW1lZEFyZ3MsIEV2YWx1YXRlZE5hbWVkQXJncyB9O1xuIl19 enifed('glimmer-runtime/lib/compiled/expressions/concat', ['exports', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerReference) { 'use strict'; var CompiledConcat = (function () { function CompiledConcat(_ref) { var parts = _ref.parts; this.type = "concat"; this.parts = parts; } CompiledConcat.prototype.evaluate = function evaluate(vm) { var parts = new Array(this.parts.length); for (var i = 0; i < this.parts.length; i++) { parts[i] = this.parts[i].evaluate(vm); } return new ConcatReference(parts); }; CompiledConcat.prototype.toJSON = function toJSON() { return 'concat(' + this.parts.map(function (expr) { return expr.toJSON(); }).join(", ") + ')'; }; return CompiledConcat; })(); exports.default = CompiledConcat; var ConcatReference = (function (_CachedReference) { babelHelpers.inherits(ConcatReference, _CachedReference); function ConcatReference(parts) { _CachedReference.call(this); this.tag = _glimmerReference.combineTagged(parts); this.parts = parts; } ConcatReference.prototype.compute = function compute() { var parts = new Array(this.parts.length); for (var i = 0; i < this.parts.length; i++) { parts[i] = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(this.parts[i].value()); } return parts.join(''); }; return ConcatReference; })(_glimmerReference.CachedReference); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvY29uY2F0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQU1jLGNBQUE7QUFJWixpQkFKWSxjQUFBLENBSUEsSUFBa0QsRUFBQTtnQkFBaEQsS0FBSyxHQUFQLElBQWtELENBQWhELEtBQUs7O0FBSFosZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsUUFBUSxDQUFDO0FBSXJCLGdCQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztTQUNwQjs7QUFOVyxzQkFBQSxXQVFaLFFBQVEsR0FBQSxrQkFBQyxFQUFNLEVBQUE7QUFDYixnQkFBSSxLQUFLLEdBQTRCLElBQUksS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDbEUsaUJBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sRUFBRSxDQ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QgaSA9IDA7IGkgPCB0aGlzLnBhcnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICBwYXJ0c1tpXSA9IHRoaXMucGFydHNbaV0uZXZhbHVhdGUodm0pO1xuICAgIH1cbiAgICByZXR1cm4gbmV3IENvbmNhdFJlZmVyZW5jZShwYXJ0cyk7XG4gIH1cblxuICB0b0pTT04oKTogc3RyaW5nIHtcbiAgICByZXR1cm4gYGNvbmNhdCgke3RoaXMucGFydHMubWFwKGV4cHIgPT4gZXhwci50b0pTT04oKSkuam9pbihcIiwgXCIpfSlgO1xuICB9XG59XG5cbmNsYXNzIENvbmNhdFJlZmVyZW5jZSBleHRlbmRzIENhY2hlZFJlZmVyZW5jZTxzdHJpbmc+IHtcbiAgcHVibGljIHRhZzogUmV2aXNpb25UYWc7XG4gIHByaXZhdGUgcGFydHM6IFBhdGhSZWZlcmVuY2U8T3BhcXVlPltdO1xuXG4gIGNvbnN0cnVjdG9yKHBhcnRzOiBQYXRoUmVmZXJlbmNlPE9wYXF1ZT5bXSkge1xuICAgIHN1cGVyKCk7XG4gICAgdGhpcy50YWcgPSBjb21iaW5lVGFnZ2VkKHBhcnRzKTtcbiAgICB0aGlzLnBhcnRzID0gcGFydHM7XG4gIH1cblxuICBwcm90ZWN0ZWQgY29tcHV0ZSgpOiBzdHJpbmcge1xuICAgIGxldCBwYXJ0cyA9IG5ldyBBcnJheTxzdHJpbmc+KHRoaXMucGFydHMubGVuZ3RoKTtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMucGFydHMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHBhcnRzW2ldID0gbm9ybWFsaXplVGV4dFZhbHVlKHRoaXMucGFydHNbaV0udmFsdWUoKSk7XG4gICAgfVxuICAgIHJldHVybiBwYXJ0cy5qb2luKCcnKTtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/compiled/expressions/function', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; exports.default = make; function make(func) { return new FunctionExpressionSyntax(func); } var FunctionExpressionSyntax = (function (_ExpressionSyntax) { babelHelpers.inherits(FunctionExpressionSyntax, _ExpressionSyntax); function FunctionExpressionSyntax(func) { _ExpressionSyntax.call(this); this.type = "function-expression"; this.func = func; } FunctionExpressionSyntax.prototype.compile = function compile(lookup, env, symbolTable) { return new CompiledFunctionExpression(this.func, symbolTable); }; return FunctionExpressionSyntax; })(_glimmerRuntimeLibSyntax.Expression); var CompiledFunctionExpression = (function (_CompiledExpression) { babelHelpers.inherits(CompiledFunctionExpression, _CompiledExpression); function CompiledFunctionExpression(func, symbolTable) { _CompiledExpression.call(this); this.func = func; this.symbolTable = symbolTable; this.type = "function"; this.func = func; } CompiledFunctionExpression.prototype.evaluate = function evaluate(vm) { var func = this.func; var symbolTable = this.symbolTable; return func(vm, symbolTable); }; CompiledFunctionExpression.prototype.toJSON = function toJSON() { var func = this.func; if (func.name) { return '`' + func.name + '(...)`'; } else { return "`func(...)`"; } }; return CompiledFunctionExpression; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvZnVuY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQVFjLElBQUE7O0FBQUEsYUFBQSxJQUFBLENBQWtCLElBQTJCLEVBQUE7QUFDekQsZUFBTyxJQUFJLHdCQUF3QixDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzNDOztRQUVELHdCQUFrQzs4QkFBbEMsd0JBQWtDOztBQUloQyxpQkFKRix3QkFBa0MsQ0FJcEIsSUFBMkIsRUFBQTtBQUNyQyx3Q0FBTyxDQUFDO0FBSkgsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcscUJBQX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0gZnVuYztcbiAgfVxuXG4gIGNvbXBpbGUobG9va3VwLCBlbnYsIHN5bWJvbFRhYmxlOiBTeW1ib2xUYWJsZSk6IENvbXBpbGVkRXhwcmVzc2lvbjxUPiB7XG4gICAgcmV0dXJuIG5ldyBDb21waWxlZEZ1bmN0aW9uRXhwcmVzc2lvbih0aGlzLmZ1bmMsIHN5bWJvbFRhYmxlKTtcbiAgfVxufVxuXG5jbGFzcyBDb21waWxlZEZ1bmN0aW9uRXhwcmVzc2lvbjxUPiBleHRlbmRzIENvbXBpbGVkRXhwcmVzc2lvbjxUPiB7XG4gIHB1YmxpYyB0eXBlID0gXCJmdW5jdGlvblwiO1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgZnVuYzogRnVuY3Rpb25FeHByZXNzaW9uPFQ+LCBwcml2YXRlIHN5bWJvbFRhYmxlOiBTeW1ib2xUYWJsZSkge1xuICAgIHN1cGVyKCk7XG4gICAgdGhpcy5mdW5jID0gZnVuYztcbiAgfVxuXG4gIGV2YWx1YXRlKHZtOiBWTSk6IFBhdGhSZWZlcmVuY2U8VD4ge1xuICAgIGxldCB7IGZ1bmMsIHN5bWJvbFRhYmxlIH0gPSB0aGlzO1xuICAgIHJldHVybiBmdW5jKHZtLCBzeW1ib2xUYWJsZSk7XG4gIH1cblxuICB0b0pTT04oKTogc3RyaW5nIHtcbiAgICBsZXQgeyBmdW5jIH0gPSB0aGlzO1xuXG4gICAgaWYgKGZ1bmMubmFtZSkge1xuICAgICAgcmV0dXJuIGBcXGAke2Z1bmMubmFtZX0oLi4uKVxcYGA7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBcImBmdW5jKC4uLilgXCI7XG4gICAgfVxuICB9XG59XG4iXX0= enifed('glimmer-runtime/lib/compiled/expressions/has-block-params', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/value'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsValue) { 'use strict'; var CompiledHasBlockParams = (function (_CompiledExpression) { babelHelpers.inherits(CompiledHasBlockParams, _CompiledExpression); function CompiledHasBlockParams(_ref) { var blockName = _ref.blockName; var blockSymbol = _ref.blockSymbol; _CompiledExpression.call(this); this.type = "has-block-params"; this.blockName = blockName; this.blockSymbol = blockSymbol; } CompiledHasBlockParams.prototype.evaluate = function evaluate(vm) { var blockRef = vm.scope().getBlock(this.blockSymbol); return new _glimmerRuntimeLibCompiledExpressionsValue.ValueReference(!!(blockRef && blockRef.locals.length > 0)); }; CompiledHasBlockParams.prototype.toJSON = function toJSON() { return 'has-block-params(' + this.blockName + ')'; }; return CompiledHasBlockParams; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); exports.default = CompiledHasBlockParams; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvaGFzLWJsb2NrLXBhcmFtcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFJYyxzQkFBOEI7OEJBQTlCLHNCQUE4Qjs7QUFLMUMsaUJBTFksc0JBQThCLENBSzlCLElBQXNFLEVBQUE7Z0JBQXBFLFNBQVMsR0FBWCxJQUFzRSxDQUFwRSxTQUFTO2dCQUFFLFdBQVcsR0FBeEIsSUFBc0UsQ0FBekQsV0FBVzs7QUFDbEMsMENBQU8sQ0FBQztBQUxILGdCQUFBLENBQUEsSUFBSSxHQUFHLGtCQUFrQixDQUFDO0FBTS9CLGdCQUFJLENBQUMsU0FBUyxHQUFHLFNBQVMsQ0FBQztBQUMzQixnQkFBSSxDQUFDLFdBQVcsR0FBRyxXQUFXLENBQUM7U0FDaEM7O0FBVFcsOEJBQThCLFdBVzFDLFFBQVEsR0FBQSxrQkFBQyxFQUFNLEVBQUE7QUFDYixnQkFBSSxRQUFRLEdBQUcsRUFBRSxDQUFDLEtBQUssRUFBRSxDQUFDL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O1xuICB9XG5cbiAgZXZhbHVhdGUodm06IFZNKTogVmFsdWVSZWZlcmVuY2U8Ym9vbGVhbj4ge1xuICAgIGxldCBibG9ja1JlZiA9IHZtLnNjb3BlKCkuZ2V0QmxvY2sodGhpcy5ibG9ja1N5bWJvbCk7XG4gICAgcmV0dXJuIG5ldyBWYWx1ZVJlZmVyZW5jZSghIShibG9ja1JlZiAmJiBibG9ja1JlZi5sb2NhbHMubGVuZ3RoID4gMCkpO1xuICB9XG5cbiAgdG9KU09OKCk6IHN0cmluZyB7XG4gICAgcmV0dXJuIGBoYXMtYmxvY2stcGFyYW1zKCR7dGhpcy5ibG9ja05hbWV9KWA7XG4gIH1cbn1cbiJdfQ== enifed('glimmer-runtime/lib/compiled/expressions/has-block', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-runtime/lib/compiled/expressions/value'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerRuntimeLibCompiledExpressionsValue) { 'use strict'; var CompiledHasBlock = (function (_CompiledExpression) { babelHelpers.inherits(CompiledHasBlock, _CompiledExpression); function CompiledHasBlock(_ref) { var blockName = _ref.blockName; var blockSymbol = _ref.blockSymbol; _CompiledExpression.call(this); this.type = "has-block"; this.blockName = blockName; this.blockSymbol = blockSymbol; } CompiledHasBlock.prototype.evaluate = function evaluate(vm) { var blockRef = vm.scope().getBlock(this.blockSymbol); return new _glimmerRuntimeLibCompiledExpressionsValue.ValueReference(!!blockRef); }; CompiledHasBlock.prototype.toJSON = function toJSON() { return 'has-block(' + this.blockName + ')'; }; return CompiledHasBlock; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); exports.default = CompiledHasBlock; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvaGFzLWJsb2NrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQUljLGdCQUF3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GVkRXhwcmVzc2lvbjxib29sZWFuPiB7XG4gIHB1YmxpYyB0eXBlID0gXCJoYXMtYmxvY2tcIjtcbiAgcHVibGljIGJsb2NrTmFtZTogc3RyaW5nO1xuICBwdWJsaWMgYmxvY2tTeW1ib2w6IG51bWJlcjtcblxuICBjb25zdHJ1Y3Rvcih7IGJsb2NrTmFtZSwgYmxvY2tTeW1ib2wgfTogeyBibG9ja05hbWU6IHN0cmluZywgYmxvY2tTeW1ib2w6IG51bWJlciB9KSB7XG4gICAgc3VwZXIoKTtcbiAgICB0aGlzLmJsb2NrTmFtZSA9IGJsb2NrTmFtZTtcbiAgICB0aGlzLmJsb2NrU3ltYm9sID0gYmxvY2tTeW1ib2w7XG4gIH1cblxuICBldmFsdWF0ZSh2bTogVk0pOiBWYWx1ZVJlZmVyZW5jZTxib29sZWFuPiB7XG4gICAgbGV0IGJsb2NrUmVmID0gdm0uc2NvcGUoKS5nZXRCbG9jayh0aGlzLmJsb2NrU3ltYm9sKTtcbiAgICByZXR1cm4gbmV3IFZhbHVlUmVmZXJlbmNlKCEhYmxvY2tSZWYpO1xuICB9XG5cbiAgdG9KU09OKCk6IHN0cmluZyB7XG4gICAgcmV0dXJuIGBoYXMtYmxvY2soJHt0aGlzLmJsb2NrTmFtZX0pYDtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/compiled/expressions/helper', ['exports', 'glimmer-runtime/lib/compiled/expressions'], function (exports, _glimmerRuntimeLibCompiledExpressions) { 'use strict'; var CompiledHelper = (function (_CompiledExpression) { babelHelpers.inherits(CompiledHelper, _CompiledExpression); function CompiledHelper(name, helper, args, symbolTable) { _CompiledExpression.call(this); this.name = name; this.helper = helper; this.args = args; this.symbolTable = symbolTable; this.type = "helper"; } CompiledHelper.prototype.evaluate = function evaluate(vm) { var helper = this.helper; return helper(vm, this.args.evaluate(vm), this.symbolTable); }; CompiledHelper.prototype.toJSON = function toJSON() { return '`' + this.name.join('.') + '($ARGS)`'; }; return CompiledHelper; })(_glim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AgfVxufVxuIl19 enifed('glimmer-runtime/lib/compiled/expressions/lookups', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-reference'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerReference) { 'use strict'; var CompiledLocalLookup = (function (_CompiledExpression) { babelHelpers.inherits(CompiledLocalLookup, _CompiledExpression); function CompiledLocalLookup(symbol, path, debug) { _CompiledExpression.call(this); this.symbol = symbol; this.path = path; this.debug = debug; this.type = "local-lookup"; } CompiledLocalLookup.prototype.evaluate = function evaluate(vm) { var base = vm.referenceForSymbol(this.symbol); return _glimmerReference.referenceFromParts(base, this.path); }; CompiledLocalLookup.prototype.toJSON = function toJSON() { var debug = this.debug; var symbol = this.symbol; var path = this.path; if (path.length) { return '$' + symbol + '(' + debug + ').' + path.join('.'); } else { return '$' + symbol + '(' + debug + ')'; } }; return CompiledLocalLookup; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); exports.CompiledLocalLookup = CompiledLocalLookup; var CompiledSelfLookup = (function (_CompiledExpression2) { babelHelpers.inherits(CompiledSelfLookup, _CompiledExpression2); function CompiledSelfLookup(parts) { _CompiledExpression2.call(this); this.parts = parts; this.type = "self-lookup"; } CompiledSelfLookup.prototype.evaluate = function evaluate(vm) { return _glimmerReference.referenceFromParts(vm.getSelf(), this.parts); }; CompiledSelfLookup.prototype.toJSON = function toJSON() { var path = ['self']; path.push.apply(path, this.parts); return path.join('.'); }; return CompiledSelfLookup; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); exports.CompiledSelfLookup = CompiledSelfLookup; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvbG9va3Vwcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFLTSxtQkFBMkI7OEJBQTNCLG1CQUEyQjs7QUFHL0IsaUJBSEksbUJBQTJCLENBS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AgIHJldHVybiBwYXRoLmpvaW4oJy4nKTtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/compiled/expressions/named-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference, _glimmerUtil) { 'use strict'; var CompiledNamedArgs = (function () { function CompiledNamedArgs(keys, values) { this.keys = keys; this.values = values; this.length = keys.length; _glimmerUtil.assert(keys.length === values.length, 'Keys and values do not have the same length'); } CompiledNamedArgs.empty = function empty() { return COMPILED_EMPTY_NAMED_ARGS; }; CompiledNamedArgs.create = function create(map) { var keys = Object.keys(map); var length = keys.length; if (length > 0) { var values = []; for (var i = 0; i < length; i++) { values[i] = map[keys[i]]; } return new this(keys, values); } else { return COMPILED_EMPTY_NAMED_ARGS; } }; CompiledNamedArgs.prototype.evaluate = function evaluate(vm) { var keys = this.keys; var values = this.values; var length = this.length; var evaluated = new Array(length); for (var i = 0; i < length; i++) { evaluated[i] = values[i].evaluate(vm); } return new EvaluatedNamedArgs(keys, evaluated); }; CompiledNamedArgs.prototype.toJSON = function toJSON() { var keys = this.keys; var values = this.values; var inner = keys.map(function (key, i) { return key + ': ' + values[i].toJSON(); }).join(", "); return '{' + inner + '}'; }; return CompiledNamedArgs; })(); exports.CompiledNamedArgs = CompiledNamedArgs; var COMPILED_EMPTY_NAMED_ARGS = new ((function (_CompiledNamedArgs) { babelHelpers.inherits(_class, _CompiledNamedArgs); function _class() { _CompiledNamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY); } _class.prototype.evaluate = function evaluate(vm) { return EVALUATED_EMPTY_NAMED_ARGS; }; _class.prototype.toJSON = function toJSON() { return ''; }; return _class; })(CompiledNamedArgs))(); exports.COMPILED_EMPTY_NAMED_ARGS = COMPILED_EMPTY_NAMED_ARGS; var EvaluatedNamedArgs = (function () { function EvaluatedNamedArgs(keys, values) { var _map = arguments.length <= 2 || arguments[2] === undefined ? undefined : arguments[2]; this.keys = keys; this.values = values; this._map = _map; this.tag = _glimmerReference.combineTagged(values); this.length = keys.length; _glimmerUtil.assert(keys.length === values.length, 'Keys and values do not have the same length'); } EvaluatedNamedArgs.create = function create(map) { var keys = Object.keys(map); var length = keys.length; if (length > 0) { var values = new Array(length); for (var i = 0; i < length; i++) { values[i] = map[keys[i]]; } return new this(keys, values, map); } else { return EVALUATED_EMPTY_NAMED_ARGS; } }; EvaluatedNamedArgs.empty = function empty() { return EVALUATED_EMPTY_NAMED_ARGS; }; EvaluatedNamedArgs.prototype.get = function get(key) { var keys = this.keys; var values = this.values; var index = keys.indexOf(key); return index === -1 ? _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE : values[index]; }; EvaluatedNamedArgs.prototype.has = function has(key) { return this.keys.indexOf(key) !== -1; }; EvaluatedNamedArgs.prototype.value = function value() { var keys = this.keys; var values = this.values; var out = _glimmerUtil.dict(); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var ref = values[i]; out[key] = ref.value(); } return out; }; babelHelpers.createClass(EvaluatedNamedArgs, [{ key: 'map', get: function () { var map = this._map; if (map) { return map; } map = this._map = _glimmerUtil.dict(); var keys = this.keys; var values = this.values; var length = this.length; for (var i = 0; i < length; i++) { map[keys[i]] = values[i]; } return map; } }]); return EvaluatedNamedArgs; })(); exports.EvaluatedNamedArgs = EvaluatedNamedArgs; var EVALUATED_EMPTY_NAMED_ARGS = new ((function (_EvaluatedNamedArgs) { babelHelpers.inherits(_class2, _EvaluatedNamedArgs); function _class2() { _EvaluatedNamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_DICT); } _class2.prototype.get = function get() { return _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; }; _class2.prototype.has = function has(key) { return false; }; _class2.prototype.value = function value() { return _glimmerR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BpKyspIHtcbiAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuICAgICAgbGV0IHJlZiA9IHZhbHVlc1tpXTtcbiAgICAgIG91dFtrZXldID0gcmVmLnZhbHVlKCk7XG4gICAgfVxuXG4gICAgcmV0dXJuIG91dDtcbiAgfVxufVxuXG5leHBvcnQgY29uc3QgRVZBTFVBVEVEX0VNUFRZX05BTUVEX0FSR1MgPSBuZXcgKGNsYXNzIGV4dGVuZHMgRXZhbHVhdGVkTmFtZWRBcmdzIHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoRU1QVFlfQVJSQVksIEVNUFRZX0FSUkFZLCBFTVBUWV9ESUNUKTtcbiAgfVxuXG4gIGdldCgpOiBQYXRoUmVmZXJlbmNlPE9wYXF1ZT4ge1xuICAgIHJldHVybiBVTkRFRklORURfUkVGRVJFTkNFO1xuICB9XG5cbiAgaGFzKGtleTogc3RyaW5nKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgdmFsdWUoKTogRGljdDxPcGFxdWU+IHtcbiAgICByZXR1cm4gRU1QVFlfRElDVDtcbiAgfVxufSk7XG4iXX0= enifed('glimmer-runtime/lib/compiled/expressions/positional-args', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/utils', 'glimmer-reference'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibUtils, _glimmerReference) { 'use strict'; var CompiledPositionalArgs = (function () { function CompiledPositionalArgs(values) { this.values = values; this.length = values.length; } CompiledPositionalArgs.create = function create(values) { if (values.length) { return new this(values); } else { return COMPILED_EMPTY_POSITIONAL_ARGS; } }; CompiledPositionalArgs.empty = function empty() { return COMPILED_EMPTY_POSITIONAL_ARGS; }; CompiledPositionalArgs.prototype.evaluate = function evaluate(vm) { var values = this.values; var length = this.length; var references = new Array(length); for (var i = 0; i < length; i++) { references[i] = values[i].evaluate(vm); } return EvaluatedPositionalArgs.create(references); }; CompiledPositionalArgs.prototype.toJSON = function toJSON() { return '[' + this.values.map(function (value) { return value.toJSON(); }).join(", ") + ']'; }; return CompiledPositionalArgs; })(); exports.CompiledPositionalArgs = CompiledPositionalArgs; var COMPILED_EMPTY_POSITIONAL_ARGS = new ((function (_CompiledPositionalArgs) { babelHelpers.inherits(_class, _CompiledPositionalArgs); function _class() { _CompiledPositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); } _class.prototype.evaluate = function evaluate(vm) { return EVALUATED_EMPTY_POSITIONAL_ARGS; }; _class.prototype.toJSON = function toJSON() { return ''; }; return _class; })(CompiledPositionalArgs))(); exports.COMPILED_EMPTY_POSITIONAL_ARGS = COMPILED_EMPTY_POSITIONAL_ARGS; var EvaluatedPositionalArgs = (function () { function EvaluatedPositionalArgs(values) { this.values = values; this.tag = _glimmerReference.combineTagged(values); this.length = values.length; } EvaluatedPositionalArgs.create = function create(values) { return new this(values); }; EvaluatedPositionalArgs.empty = function empty() { return EVALUATED_EMPTY_POSITIONAL_ARGS; }; EvaluatedPositionalArgs.prototype.at = function at(index) { var values = this.values; var length = this.length; return index < length ? values[index] : _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; }; EvaluatedPositionalArgs.prototype.value = function value() { var values = this.values; var length = this.length; var ret = new Array(length); for (var i = 0; i < length; i++) { ret[i] = values[i].value(); } return ret; }; return EvaluatedPositionalArgs; })(); exports.EvaluatedPositionalArgs = EvaluatedPositionalArgs; var EVALUATED_EMPTY_POSITIONAL_ARGS = new ((function (_EvaluatedPositionalArgs) { babelHelpers.inherits(_class2, _EvaluatedPositionalArgs); function _class2() { _EvaluatedPositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); } _class2.prototype.at = function at() { return _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; }; _class2.prototype.value = function value() { return this.values; }; return _class2; })(EvaluatedPositionalArgs))(); exports.EVALUATED_EMPTY_POSITIONAL_ARGS = EVALUATED_EMPTY_POSITIONAL_ARGS; }); //# source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3Mge1xuICBjb25zdHJ1Y3RvcigpIHtcbiAgICBzdXBlcihFTVBUWV9BUlJBWSk7XG4gIH1cblxuICBhdCgpOiBQYXRoUmVmZXJlbmNlPE9wYXF1ZT4ge1xuICAgIHJldHVybiBVTkRFRklORURfUkVGRVJFTkNFO1xuICB9XG5cbiAgdmFsdWUoKTogT3BhcXVlW10ge1xuICAgIHJldHVybiB0aGlzLnZhbHVlcztcbiAgfVxufSk7XG4iXX0= enifed('glimmer-runtime/lib/compiled/expressions/value', ['exports', 'glimmer-runtime/lib/compiled/expressions', 'glimmer-reference', 'glimmer-util'], function (exports, _glimmerRuntimeLibCompiledExpressions, _glimmerReference, _glimmerUtil) { 'use strict'; var CompiledValue = (function (_CompiledExpression) { babelHelpers.inherits(CompiledValue, _CompiledExpression); function CompiledValue(_ref) { var value = _ref.value; _CompiledExpression.call(this); this.type = "value"; this.reference = new ValueReference(value); } CompiledValue.prototype.evaluate = function evaluate(vm) { return this.reference; }; CompiledValue.prototype.toJSON = function toJSON() { return JSON.stringify(this.reference.value()); }; return CompiledValue; })(_glimmerRuntimeLibCompiledExpressions.CompiledExpression); exports.default = CompiledValue; var ValueReference = (function (_ConstReference) { babelHelpers.inherits(ValueReference, _ConstReference); function ValueReference() { _ConstReference.apply(this, arguments); this.children = _glimmerUtil.dict(); } ValueReference.prototype.get = function get(key) { var children = this.children; var child = children[key]; if (!child) { child = children[key] = new ValueReference(this.inner[key]); } return child; }; ValueReference.prototype.value = function value() { return this.inner; }; return ValueReference; })(_glimmerReference.ConstReference); exports.ValueReference = ValueReference; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvZXhwcmVzc2lvbnMvdmFsdWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBS2MsYUFBd0I7OEJBQXhCLGFBQXdCOztBQUlwQyxpQkFKWSxhQUF3QixDQUl4QixJ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tcbiAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHRoaXMucmVmZXJlbmNlLnZhbHVlKCkpO1xuICAgIH1cbn1cbmV4cG9ydCBjbGFzcyBWYWx1ZVJlZmVyZW5jZSBleHRlbmRzIENvbnN0UmVmZXJlbmNlIHtcbiAgICBjb25zdHJ1Y3RvcigpIHtcbiAgICAgICAgc3VwZXIoLi4uYXJndW1lbnRzKTtcbiAgICAgICAgdGhpcy5jaGlsZHJlbiA9IGRpY3QoKTtcbiAgICB9XG4gICAgZ2V0KGtleSkge1xuICAgICAgICBsZXQgeyBjaGlsZHJlbiB9ID0gdGhpcztcbiAgICAgICAgbGV0IGNoaWxkID0gY2hpbGRyZW5ba2V5XTtcbiAgICAgICAgaWYgKCFjaGlsZCkge1xuICAgICAgICAgICAgY2hpbGQgPSBjaGlsZHJlbltrZXldID0gbmV3IFZhbHVlUmVmZXJlbmNlKHRoaXMuaW5uZXJba2V5XSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGNoaWxkO1xuICAgIH1cbiAgICB2YWx1ZSgpIHsgcmV0dXJuIHRoaXMuaW5uZXI7IH1cbn1cbiJdfQ== enifed('glimmer-runtime/lib/compiled/opcodes/builder', ['exports', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/compiled/opcodes/lists', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-util', 'glimmer-runtime/lib/utils'], function (exports, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibCompiledOpcodesLists, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerUtil, _glimmerRuntimeLibUtils) { 'use strict'; var StatementCompilationBufferProxy = (function () { function StatementCompilationBufferProxy(inner) { this.inner = inner; } StatementCompilationBufferProxy.prototype.toOpSeq = function toOpSeq() { return this.inner.toOpSeq(); }; StatementCompilationBufferProxy.prototype.append = function append(opcode) { this.inner.append(opcode); }; StatementCompilationBufferProxy.prototype.getLocalSymbol = function getLocalSymbol(name) { return this.inner.getLocalSymbol(name); }; StatementCompilationBufferProxy.prototype.hasLocalSymbol = function hasLocalSymbol(name) { return this.inner.hasLocalSymbol(name); }; StatementCompilationBufferProxy.prototype.getNamedSymbol = function getNamedSymbol(name) { return this.inner.getNamedSymbol(name); }; StatementCompilationBufferProxy.prototype.hasNamedSymbol = function hasNamedSymbol(name) { return this.inner.hasNamedSymbol(name); }; StatementCompilationBufferProxy.prototype.getBlockSymbol = function getBlockSymbol(name) { return this.inner.getBlockSymbol(name); }; StatementCompilationBufferProxy.prototype.hasBlockSymbol = function hasBlockSymbol(name) { return this.inner.hasBlockSymbol(name); }; babelHelpers.createClass(StatementCompilationBufferProxy, [{ key: 'component', get: function () { return this.inner.component; } }]); return StatementCompilationBufferProxy; })(); var BasicOpcodeBuilder = (function (_StatementCompilationBufferProxy) { babelHelpers.inherits(BasicOpcodeBuilder, _StatementCompilationBufferProxy); function BasicOpcodeBuilder(inner, symbolTable, env) { _StatementCompilationBufferProxy.call(this, inner); this.symbolTable = symbolTable; this.env = env; this.labelsStack = new _glimmerUtil.Stack(); this.templatesStack = new _glimmerUtil.Stack(); } // helpers BasicOpcodeBuilder.prototype.startBlock = function startBlock(_ref) { var templates = _ref.templates; this.templatesStack.push(templates); }; BasicOpcodeBuilder.prototype.endBlock = function endBlock() { this.templatesStack.pop(); }; BasicOpcodeBuilder.prototype.startLabels = function startLabels() { this.labelsStack.push(_glimmerUtil.dict()); }; BasicOpcodeBuilder.prototype.stopLabels = function stopLabels() { this.labelsStack.pop(); }; BasicOpcodeBuilder.prototype.labelFor = function labelFor(name) { var labels = this.labels; var label = labels[name]; if (!label) { label = labels[name] = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode(name); } return label; }; // components BasicOpcodeBuilder.prototype.putComponentDefinition = function putComponentDefinition(definition) { this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutComponentDefinitionOpcode(definition)); }; BasicOpcodeBuilder.prototype.putDynamicComponentDefinition = function putDynamicComponentDefinition() { this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutDynamicComponentDefinitionOpcode()); }; BasicOpcodeBuilder.prototype.openComponent = function openComponent(args) { var shadow = arguments.length <= 1 || arguments[1] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[1]; this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.OpenComponentOpcode(this.compile(args), shadow, this.templates)); }; BasicOpcodeBuilder.prototype.didCreateElement = function didCreateElement() { this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.DidCreateElementOpcode()); }; BasicOpcodeBuilder.prototype.shadowAttributes = function shadowAttributes() { this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.ShadowAttributesOpcode()); }; BasicOpcodeBuilder.prototype.didRenderLayout = function didRenderLayout() { this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.DidRenderLayoutOpcode()); }; BasicOpcodeBuilder.prototype.closeComponent = function closeComponent() { this.append(new _glimmerRuntimeLibCompiledOpcodesComponent.CloseComponentOpcode()); }; // content BasicOpcodeBuilder.prototype.cautiousAppend = function cautiousAppend() { this.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedCautiousAppendOpcode()); }; BasicOpcodeBuilder.prototype.trustingAppend = function trustingAppend() { this.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedTrustingAppendOpcode()); }; // dom BasicOpcodeBuilder.prototype.text = function text(_text) { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.TextOpcode({ text: _text })); }; BasicOpcodeBuilder.prototype.openPrimitiveElement = function openPrimitiveElement(tag) { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(tag)); }; BasicOpcodeBuilder.prototype.openComponentElement = function openComponentElement(tag) { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenComponentElementOpcode(tag)); }; BasicOpcodeBuilder.prototype.openDynamicPrimitiveElement = function openDynamicPrimitiveElement() { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenDynamicPrimitiveElementOpcode()); }; BasicOpcodeBuilder.prototype.flushElement = function flushElement() { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.FlushElementOpcode()); }; BasicOpcodeBuilder.prototype.closeElement = function closeElement() { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.CloseElementOpcode()); }; BasicOpcodeBuilder.prototype.staticAttr = function staticAttr(options) { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.StaticAttrOpcode(options)); }; BasicOpcodeBuilder.prototype.dynamicAttrNS = function dynamicAttrNS(options) { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrNSOpcode(options)); }; BasicOpcodeBuilder.prototype.dynamicAttr = function dynamicAttr(options) { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrOpcode(options)); }; BasicOpcodeBuilder.prototype.comment = function comment(_comment) { this.append(new _glimmerRuntimeLibCompiledOpcodesDom.CommentOpcode({ comment: _comment })); }; // lists BasicOpcodeBuilder.prototype.putIterator = function putIterator() { this.append(new _glimmerRuntimeLibCompiledOpcodesLists.PutIteratorOpcode()); }; BasicOpcodeBuilder.prototype.enterList = function enterList(start, end) { this.append(new _glimmerRuntimeLibCompiledOpcodesLists.EnterListOpcode(this.labelFor(start), this.labelFor(end))); }; BasicOpcodeBuilder.prototype.exitList = function exitList() { this.append(new _glimmerRuntimeLibCompiledOpcodesLists.ExitListOpcode()); }; BasicOpcodeBuilder.prototype.enterWithKey = function enterWithKey(start, end) { this.append(new _glimmerRuntimeLibCompiledOpcodesLists.EnterWithKeyOpcode(this.labelFor(start), this.labelFor(end))); }; BasicOpcodeBuilder.prototype.nextIter = function nextIter(end) { this.append(new _glimmerRuntimeLibCompiledOpcodesLists.NextIterOpcode(this.labelFor(end))); }; // vm BasicOpcodeBuilder.prototype.label = function label(name) { this.append(this.labelFor(name)); }; BasicOpcodeBuilder.prototype.pushChildScope = function pushChildScope() { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PushChildScopeOpcode()); }; BasicOpcodeBuilder.prototype.popScope = function popScope() { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PopScopeOpcode()); }; BasicOpcodeBuilder.prototype.pushDynamicScope = function pushDynamicScope() { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PushDynamicScopeOpcode()); }; BasicOpcodeBuilder.prototype.popDynamicScope = function popDynamicScope() { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PopDynamicScopeOpcode()); }; BasicOpcodeBuilder.prototype.putNull = function putNull() { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutNullOpcode()); }; BasicOpcodeBuilder.prototype.putValue = function putValue(expression) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode({ expression: this.compile(expression) })); }; BasicOpcodeBuilder.prototype.putArgs = function putArgs(args) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutArgsOpcode({ args: this.compile(args) })); }; BasicOpcodeBuilder.prototype.bindDynamicScope = function bindDynamicScope(names) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindDynamicScopeOpcode(names)); }; BasicOpcodeBuilder.prototype.bindPositionalArgs = function bindPositionalArgs(names, symbols) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindPositionalArgsOpcode(names, symbols)); }; BasicOpcodeBuilder.prototype.bindNamedArgs = function bindNamedArgs(names, symbols) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindNamedArgsOpcode(names, symbols)); }; BasicOpcodeBuilder.prototype.bindBlocks = function bindBlocks(names, symbols) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.BindBlocksOpcode(names, symbols)); }; BasicOpcodeBuilder.prototype.enter = function enter(_enter, exit) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.EnterOpcode({ begin: this.labelFor(_enter), end: this.labelFor(exit) })); }; BasicOpcodeBuilder.prototype.exit = function exit() { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.ExitOpcode()); }; BasicOpcodeBuilder.prototype.evaluate = function evaluate(name) { var block = arguments.length <= 1 || arguments[1] === undefined ? this.templates[name] : arguments[1]; return (function () { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.EvaluateOpcode({ debug: name, block: block })); }).apply(this, arguments); }; BasicOpcodeBuilder.prototype.test = function test(testFunc) { if (testFunc === 'const') { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.ConstTest)); } else if (testFunc === 'simple') { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.SimpleTest)); } else if (testFunc === 'environment') { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.EnvironmentTest)); } else if (typeof testFunc === 'function') { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(testFunc)); } else { throw new Error('unreachable'); } }; BasicOpcodeBuilder.prototype.jump = function jump(target) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpOpcode({ target: this.labelFor(target) })); }; BasicOpcodeBuilder.prototype.jumpIf = function jumpIf(target) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpIfOpcode({ target: this.labelFor(target) })); }; BasicOpcodeBuilder.prototype.jumpUnless = function jumpUnless(target) { this.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpUnlessOpcode({ target: this.labelFor(target) })); }; babelHelpers.createClass(BasicOpcodeBuilder, [{ key: 'labels', get: function () { return this.labelsStack.current; } }, { key: 'templates', get: function () { return this.templatesStack.current; } }]); return BasicOpcodeBuilder; })(StatementCompilationBufferProxy); exports.BasicOpcodeBuilder = BasicOpcodeBuilder; function isCompilableExpression(expr) { return expr && typeof expr['compile'] === 'function'; } var SIMPLE_BLOCK = { templates: null }; var OpcodeBuilder = (function (_BasicOpcodeBuilder) { babelHelpers.inherits(OpcodeBuilder, _BasicOpcodeBuilder); function OpcodeBuilder() { _BasicOpcodeBuilder.apply(this, arguments); } OpcodeBuilder.prototype.compile = function compile(expr) { if (isCompilableExpression(expr)) { return expr.compile(this, this.env, this.symbolTable); } else { return expr; } }; OpcodeBuilder.prototype.bindPositionalArgsForBlock = function bindPositionalArgsForBlock(block) { this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindPositionalArgsOpcode.create(block)); }; OpcodeBuilder.prototype.bindNamedArgsForLayout = function bindNamedArgsForLayout(layout) { this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindNamedArgsOpcode.create(layout)); }; OpcodeBuilder.prototype.bindBlocksForLayout = function bindBlocksForLayout(layout) { this.append(_glimmerRuntimeLibCompiledOpcodesVm.BindBlocksOpcode.create(layout)); }; OpcodeBuilder.prototype.simpleBlock = function simpleBlock(callback) { this.block(SIMPLE_BLOCK, callback); }; OpcodeBuilder.prototype.block = function block(_ref2, callback) { var templates = _ref2.templates; var args = _ref2.args; this.startLabels(); this.startBlock({ templates: templates }); this.enter('BEGIN', 'END'); this.label('BEGIN'); if (args) this.putArgs(args); callback(this, 'BEGIN', 'END'); this.label('END'); this.exit(); this.endBlock(); this.stopLabels(); }; OpcodeBuilder.prototype.iter = function iter(_ref3, callback) { var templates = _ref3.templates; this.startLabels(); this.startBlock({ templates: templates }); this.enterList('BEGIN', 'END'); this.label('ITER'); this.nextIter('BREAK'); this.enterWithKey('BEGIN', 'END'); this.label('BEGIN'); callback(this, 'BEGIN', 'END'); this.label('END'); this.exit(); this.jump('ITER'); this.label('BREAK'); this.exitList(); this.endBlock(); this.stopLabels(); }; OpcodeBuilder.prototype.unit = function unit(_ref4, callback) { var templates = _ref4.templates; this.startLabels(); this.startBlock({ templates: templates }); callback(this); this.endBlock(); this.stopLabels(); }; return OpcodeBuilder; })(BasicOpcodeBuilder); exports.default = OpcodeBuilder; }); //# sourceMappingURL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0ZW1wbGF0ZXMgfSk7XG4gICAgY2FsbGJhY2sodGhpcyk7XG4gICAgdGhpcy5lbmRCbG9jaygpO1xuICAgIHRoaXMuc3RvcExhYmVscygpO1xuICB9XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgVW5pdE9wdGlvbnMge1xuICB0ZW1wbGF0ZXM6IFN5bnRheC5UZW1wbGF0ZXM7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgQmxvY2tPcHRpb25zIGV4dGVuZHMgVW5pdE9wdGlvbnMge1xuICBhcmdzOiBTeW50YXguQXJncztcbn1cbmV4cG9ydCB0eXBlIEJsb2NrQ2FsbGJhY2sgPSAoZHNsOiBPcGNvZGVCdWlsZGVyLCBCRUdJTjogTGFiZWwsIEVORDogTGFiZWwpID0+IHZvaWQ7XG4iXX0= enifed('glimmer-runtime/lib/compiled/opcodes/component', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerReference) { 'use strict'; var PutDynamicComponentDefinitionOpcode = (function (_Opcode) { babelHelpers.inherits(PutDynamicComponentDefinitionOpcode, _Opcode); function PutDynamicComponentDefinitionOpcode() { _Opcode.apply(this, arguments); this.type = "put-dynamic-component-definition"; } PutDynamicComponentDefinitionOpcode.prototype.evaluate = function evaluate(vm) { var reference = vm.frame.getOperand(); var cache = _glimmerReference.isConst(reference) ? undefined : new _glimmerReference.ReferenceCache(reference); var definition = cache ? cache.peek() : reference.value(); vm.frame.setComponentDefinition(definition); if (cache) { vm.updateWith(new _glimmerRuntimeLibCompiledOpcodesVm.Assert(cache)); } }; return PutDynamicComponentDefinitionOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PutDynamicComponentDefinitionOpcode = PutDynamicComponentDefinitionOpcode; var PutComponentDefinitionOpcode = (function (_Opcode2) { babelHelpers.inherits(PutComponentDefinitionOpcode, _Opcode2); function PutComponentDefinitionOpcode(definition) { _Opcode2.call(this); this.definition = definition; this.type = "put-component-definition"; } PutComponentDefinitionOpcode.prototype.evaluate = function evaluate(vm) { vm.frame.setComponentDefinition(this.definition); }; return PutComponentDefinitionOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PutComponentDefinitionOpcode = PutComponentDefinitionOpcode; var OpenComponentOpcode = (function (_Opcode3) { babelHelpers.inherits(OpenComponentOpcode, _Opcode3); function OpenComponentOpcode(args, shadow, templates) { _Opcode3.call(this); this.args = args; this.shadow = shadow; this.templates = templates; this.type = "open-component"; } OpenComponentOpcode.prototype.evaluate = function evaluate(vm) { var rawArgs = this.args; var shadow = this.shadow; var templates = this.templates; var definition = vm.frame.getComponentDefinition(); var dynamicScope = vm.pushDynamicScope(); var callerScope = vm.scope(); var manager = definition.manager; var hasDefaultBlock = templates && !!templates.default; // TODO Cleanup? var args = manager.prepareArgs(definition, rawArgs.evaluate(vm)); var component = manager.create(vm.env, definition, args, dynamicScope, vm.getSelf(), hasDefaultBlock); var destructor = manager.getDestructor(component); if (destructor) vm.newDestroyable(destructor); var layout = manager.layoutFor(definition, component, vm.env); var selfRef = manager.getSelf(component); vm.beginCacheGroup(); vm.stack().pushSimpleBlock(); vm.pushRootScope(selfRef, layout.symbols); vm.invokeLayout(args, layout, templates, callerScope, component, manager, shadow); vm.updateWith(new UpdateComponentOpcode(definition.name, component, manager, args, dynamicScope)); }; return OpenComponentOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.OpenComponentOpcode = OpenComponentOpcode; var UpdateComponentOpcode = (function (_UpdatingOpcode) { babelHelpers.inherits(UpdateComponentOpcode, _UpdatingOpcode); function UpdateComponentOpcode(name, component, manager, args, dynamicScope) { _UpdatingOpcode.call(this); this.name = name; this.component = component; this.manager = manager; this.args = args; this.dynamicScope = dynamicScope; this.type = "update-component"; var componentTag = manager.getTag(component); if (componentTag) { this.tag = _glimmerReference.combine([args.tag, componentTag]); } else { this.tag = args.tag; } } UpdateComponentOpcode.prototype.evaluate = function evaluate(vm) { var component = this.component; var manager = this.manager; var args = this.args; var dynamicScope = this.dynamicScope; manager.update(component, args, dynamicScope); }; UpdateComponentOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [JSON.stringify(this.name)] }; }; return UpdateComponentOpcode; })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); exports.UpdateComponentOpcode = UpdateComponentOpcode; var DidCreateElementOpcode = (function (_Opcode4) { babelHelpers.inherits(DidCreateElementOpcode, _Opcode4); function DidCreateElementOpcode() { _Opcode4.apply(this, arguments); this.type = "did-create-element"; } // Slow path for non-specialized component invocations. Uses an internal // named lookup on the args. DidCreateElementOpcode.prototype.evaluate = function evaluate(vm) { var manager = vm.frame.getManager(); var component = vm.frame.getComponent(); manager.didCreateElement(component, vm.stack().constructing, vm.stack().operations); }; DidCreateElementOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: ["$ARGS"] }; }; return DidCreateElementOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.DidCreateElementOpcode = DidCreateElementOpcode; var ShadowAttributesOpcode = (function (_Opcode5) { babelHelpers.inherits(ShadowAttributesOpcode, _Opcode5); function ShadowAttributesOpcode() { _Opcode5.apply(this, arguments); this.type = "shadow-attributes"; } ShadowAttributesOpcode.prototype.evaluate = function evaluate(vm) { var shadow = vm.frame.getShadow(); if (!shadow) return; var _vm$frame$getArgs = vm.frame.getArgs(); var named = _vm$frame$getArgs.named; shadow.forEach(function (name) { vm.stack().setDynamicAttribute(name, named.get(name), false); }); }; ShadowAttributesOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: ["$ARGS"] }; }; return ShadowAttributesOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.ShadowAttributesOpcode = ShadowAttributesOpcode; var DidRenderLayoutOpcode = (function (_Opcode6) { babelHelpers.inherits(DidRenderLayoutOpcode, _Opcode6); function DidRenderLayoutOpcode() { _Opcode6.apply(this, arguments); this.type = "did-render-layout"; } DidRenderLayoutOpcode.prototype.evaluate = function evaluate(vm) { var manager = vm.frame.getManager(); var component = vm.frame.getComponent(); var bounds = vm.stack().popBlock(); manager.didRenderLayout(component, bounds); vm.env.didCreate(component, manager); vm.updateWith(new DidUpdateLayoutOpcode(manager, component, bounds)); }; return DidRenderLayoutOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.DidRenderLayoutOpcode = DidRenderLayoutOpcode; var DidUpdateLayoutOpcode = (function (_UpdatingOpcode2) { babelHelpers.inherits(DidUpdateLayoutOpcode, _UpdatingOpcode2); function DidUpdateLayoutOpcode(manager, component, bounds) { _UpdatingOpcode2.call(this); this.manager = manager; this.component = component; this.bounds = bounds; this.type = "did-update-layout"; this.tag = _glimmerReference.CONSTANT_TAG; } DidUpdateLayoutOpcode.prototype.evaluate = function evaluate(vm) { var manager = this.manager; var component = this.component; var bounds = this.bounds; manager.didUpdateLayout(component, bounds); vm.env.didUpdate(component, manager); }; return DidUpdateLayoutOpcode; })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); exports.DidUpdateLayoutOpcode = DidUpdateLayoutOpcode; var CloseComponentOpcode = (function (_Opcode7) { babelHelpers.inherits(CloseComponentOpcode, _Opcode7); function CloseComponentOpcode() { _Opcode7.apply(this, arguments); this.type = "close-component"; } CloseComponentOpcode.prototype.evaluate = function evaluate(vm) { vm.popScope(); vm.popDynamicScope(); vm.commitCacheGroup(); }; return CloseComponentOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.CloseComponentOpcode = CloseComponentOpcode; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBV00sbUNBQTJDOzhCQUEzQyxtQ0FBMkM7O0FBQWpELGlCQUFNLG1DQUEyQyxHQ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AgICAgdGhpcy5uYW1lID0gbmFtZTtcbiAgICAgICAgdGhpcy5jb21wb25lbnQgPSBjb21wb25lbnQ7XG4gICAgICAgIHRoaXMubWFuYWdlciA9IG1hbmFnZXI7XG4gICAgICAgIHRoaXMuYXJncyA9IGFyZ3M7XG4gICAgICAgIHRoaXMuZHluYW1pY1Njb3BlID0gZHluYW1pY1Njb3BlO1xuICAgICAgICB0aGlzLnR5cGUgPSBcInVwZGF0ZS1jb21wb25lbnRcIjtcbiAgICAgICAgbGV0IGNvbXBvbmVudFRhZyA9IG1hbmFnZXIuZ2V0VGFnKGNvbXBvbmVudCk7XG4gICAgICAgIGlmIChjb21wb25lbnRUYWcpIHtcbiAgICAgICAgICAgIHRoaXMudGFnID0gY29tYmluZShbYXJncy50YWcsIGNvbXBvbmVudFRhZ10pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhpcy50YWcgPSBhcmdzLnRhZztcbiAgICAgICAgfVxuICAgIH1cbiAgICBldmFsdWF0ZSh2bSkge1xuICAgICAgICBsZXQgeyBjb21wb25lbnQsIG1hbmFnZXIsIGFyZ3MsIGR5bmFtaWNTY29wZSB9ID0gdGhpcztcbiAgICAgICAgbWFuYWdlci51cGRhdGUoY29tcG9uZW50LCBhcmdzLCBkeW5hbWljU2NvcGUpO1xuICAgIH1cbiAgICB0b0pTT04oKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBndWlkOiB0aGlzLl9ndWlkLFxuICAgICAgICAgICAgdHlwZTogdGhpcy50eXBlLFxuICAgICAgICAgICAgYXJnczogW0pTT04uc3RyaW5naWZ5KHRoaXMubmFtZSldXG4gICAgICAgIH07XG4gICAgfVxufVxuZXhwb3J0IGNsYXNzIERpZENyZWF0ZUVsZW1lbnRPcGNvZGUgZXh0ZW5kcyBPcGNvZGUge1xuICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICBzdXBlciguLi5hcmd1bWVudHMpO1xuICAgICAgICB0a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RvcihtYW5hZ2VyLCBjb21wb25lbnQsIGJvdW5kcykge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLm1hbmFnZXIgPSBtYW5hZ2VyO1xuICAgICAgICB0aGlzLmNvbXBvbmVudCA9IGNvbXBvbmVudDtcbiAgICAgICAgdGhpcy5ib3VuZHMgPSBib3VuZHM7XG4gICAgICAgIHRoaXMudHlwZSA9IFwiZGlkLXVwZGF0ZS1sYXlvdXRcIjtcbiAgICAgICAgdGhpcy50YWcgPSBDT05TVEFOVF9UQUc7XG4gICAgfVxuICAgIGV2YWx1YXRlKHZtKSB7XG4gICAgICAgIGxldCB7IG1hbmFnZXIsIGNvbXBvbmVudCwgYm91bmRzIH0gPSB0aGlzO1xuICAgICAgICBtYW5hZ2VyLmRpZFVwZGF0ZUxheW91dChjb21wb25lbnQsIGJvdW5kcyk7XG4gICAgICAgIHZtLmVudi5kaWRVcGRhdGUoY29tcG9uZW50LCBtYW5hZ2VyKTtcbiAgICB9XG59XG5leHBvcnQgY2xhc3MgQ2xvc2VDb21wb25lbnRPcGNvZGUgZXh0ZW5kcyBPcGNvZGUge1xuICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICBzdXBlciguLi5hcmd1bWVudHMpO1xuICAgICAgICB0aGlzLnR5cGUgPSBcImNsb3NlLWNvbXBvbmVudFwiO1xuICAgIH1cbiAgICBldmFsdWF0ZSh2bSkge1xuICAgICAgICB2bS5wb3BTY29wZSgpO1xuICAgICAgICB2bS5wb3BEeW5hbWljU2NvcGUoKTtcbiAgICAgICAgdm0uY29tbWl0Q2FjaGVHcm91cCgpO1xuICAgIH1cbn1cbiJdfQ== enifed('glimmer-runtime/lib/compiled/opcodes/content', ['exports', 'glimmer-runtime/lib/upsert', 'glimmer-runtime/lib/component/interfaces', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/update', 'glimmer-reference', 'glimmer-util', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/compiler', 'glimmer-runtime/lib/compiled/opcodes/builder', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/syntax/core'], function (exports, _glimmerRuntimeLibUpsert, _glimmerRuntimeLibComponentInterfaces, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmUpdate, _glimmerReference, _glimmerUtil, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibCompiler, _glimmerRuntimeLibCompiledOpcodesBuilder, _glimmerRuntimeLibReferences, _glimmerRuntimeLibSyntaxCore) { 'use strict'; exports.normalizeTextValue = normalizeTextValue; exports.normalizeTrustedValue = normalizeTrustedValue; exports.normalizeValue = normalizeValue; function isEmpty(value) { return value === null || value === undefined || typeof value['toString'] !== 'function'; } function normalizeTextValue(value) { if (isEmpty(value)) { return ''; } return String(value); } function normalizeTrustedValue(value) { if (isEmpty(value)) { return ''; } if (_glimmerRuntimeLibUpsert.isString(value)) { return value; } if (_glimmerRuntimeLibUpsert.isSafeString(value)) { return value.toHTML(); } if (_glimmerRuntimeLibUpsert.isNode(value)) { return value; } return String(value); } function normalizeValue(value) { if (isEmpty(value)) { return ''; } if (_glimmerRuntimeLibUpsert.isString(value)) { return value; } if (_glimmerRuntimeLibUpsert.isSafeString(value) || _glimmerRuntimeLibUpsert.isNode(value)) { return value; } return String(value); } var AppendOpcode = (function (_Opcode) { babelHelpers.inherits(AppendOpcode, _Opcode); function AppendOpcode() { _Opcode.apply(this, arguments); } AppendOpcode.prototype.evaluate = function evaluate(vm) { var reference = vm.frame.getOperand(); var normalized = this.normalize(reference); var value = undefined, cache = undefined; if (_glimmerReference.isConst(reference)) { value = normalized.value(); } else { cache = new _glimmerReference.ReferenceCache(normalized); value = cache.peek(); } var stack = vm.stack(); var upsert = this.insert(vm.env.getAppendOperations(), stack, value); var bounds = new _glimmerRuntimeLibBuilder.Fragment(upsert.bounds); stack.newBounds(bounds); if (cache /* i.e. !isConst(reference) */) { vm.updateWith(this.updateWith(vm, reference, cache, bounds, upsert)); } }; AppendOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: ["$OPERAND"] }; }; return AppendOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.AppendOpcode = AppendOpcode; var GuardedAppendOpcode = (function (_AppendOpcode) { babelHelpers.inherits(GuardedAppendOpcode, _AppendOpcode); function GuardedAppendOpcode(expression, symbolTable) { _AppendOpcode.call(this); this.expression = expression; this.symbolTable = symbolTable; this.deopted = null; } GuardedAppendOpcode.prototype.evaluate = function evaluate(vm) { if (this.deopted) { vm.pushEvalFrame(this.deopted); } else { vm.evaluateOperand(this.expression); var value = vm.frame.getOperand().value(); if (_glimmerRuntimeLibComponentInterfaces.isComponentDefinition(value)) { vm.pushEvalFrame(this.deopt(vm.env)); } else { _AppendOpcode.prototype.evaluate.call(this, vm); } } }; GuardedAppendOpcode.prototype.deopt = function deopt(env) { var _this = this; // At compile time, we determined that this append callsite might refer // to a local variable/property lookup that resolves to a component // definition at runtime. // // We could have eagerly compiled this callsite into something like this: // // {{#if (is-component-definition foo)}} // {{component foo}} // {{else}} // {{foo}} // {{/if}} // // However, in practice, there might be a large amout of these callsites // and most of them would resolve to a simple value lookup. Therefore, we // tried to be optimistic and assumed that the callsite will resolve to // appending a simple value. // // However, we have reached here because at runtime, the guard conditional // have detected that this callsite is indeed referring to a component // definition object. Since this is likely going to be true for other // instances of the same callsite, it is now appropiate to deopt into the // expanded version that handles both cases. The compilation would look // like this: // // Enter(BEGIN, END) // BEGIN: Noop // Test(is-component-definition) // JumpUnless(VALUE) // COMPONENT: Noop // PutDynamicComponentDefinitionOpcode // OpenComponent // CloseComponent // Jump(END) // VALUE: Noop // OptimizedAppend // END: Noop // Exit // // Keep in mind that even if we *don't* reach here at initial render time, // it is still possible (although quite rare) that the simple value we // encounter during initial render could later change into a component // definition object at update time. That is handled by the "lazy deopt" // code on the update side (scroll down for the next big block of comment). var buffer = new _glimmerRuntimeLibCompiler.CompileIntoList(env, null); var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, this.symbolTable, env); dsl.block({ templates: null }, function (dsl, BEGIN, END) { dsl.putValue(_this.expression); dsl.test(IsComponentDefinitionReference.create); dsl.jumpUnless('VALUE'); dsl.label('COMPONENT'); dsl.putDynamicComponentDefinition(); dsl.openComponent(_glimmerRuntimeLibSyntaxCore.Args.empty()); dsl.closeComponent(); dsl.jump(END); dsl.label('VALUE'); dsl.append(new _this.AppendOpcode()); }); var deopted = this.deopted = dsl.toOpSeq(); // From this point on, we have essentially replaced ourselve with a new set // of opcodes. Since we will always be executing the new/deopted code, it's // a good idea (as a pattern) to null out any unneeded fields here to avoid // holding on to unneeded/stale objects: this.expression = null; return deopted; }; GuardedAppendOpcode.prototype.toJSON = function toJSON() { var guid = this._guid; var type = this.type; var deopted = this.deopted; if (deopted) { return { guid: guid, type: type, deopted: true, children: deopted.toArray().map(function (op) { return op.toJSON(); }) }; } else { return { guid: guid, type: type, args: [this.expression.toJSON()] }; } }; return GuardedAppendOpcode; })(AppendOpcode); exports.GuardedAppendOpcode = GuardedAppendOpcode; var IsComponentDefinitionReference = (function (_ConditionalReference) { babelHelpers.inherits(IsComponentDefinitionReference, _ConditionalReference); function IsComponentDefinitionReference() { _ConditionalReference.apply(this, arguments); } IsComponentDefinitionReference.create = function create(inner) { return new IsComponentDefinitionReference(inner); }; IsComponentDefinitionReference.prototype.toBool = function toBool(value) { return _glimmerRuntimeLibComponentInterfaces.isComponentDefinition(value); }; return IsComponentDefinitionReference; })(_glimmerRuntimeLibReferences.ConditionalReference); var UpdateOpcode = (function (_UpdatingOpcode) { babelHelpers.inherits(UpdateOpcode, _UpdatingOpcode); function UpdateOpcode(cache, bounds, upsert) { _UpdatingOpcode.call(this); this.cache = cache; this.bounds = bounds; this.upsert = upsert; this.tag = cache.tag; } UpdateOpcode.prototype.evaluate = function evaluate(vm) { var value = this.cache.revalidate(); if (_glimmerReference.isModified(value)) { var bounds = this.bounds; var upsert = this.upsert; var dom = vm.dom; if (!this.upsert.update(dom, value)) { var cursor = new _glimmerRuntimeLibBounds.Cursor(bounds.parentElement(), _glimmerRuntimeLibBounds.clear(bounds)); upsert = this.upsert = this.insert(vm.env.getAppendOperations(), cursor, value); } bounds.update(upsert.bounds); } }; UpdateOpcode.prototype.toJSON = function toJSON() { var guid = this._guid; var type = this.type; var cache = this.cache; return { guid: guid, type: type, details: { lastValue: JSON.stringify(cache.peek()) } }; }; return UpdateOpcode; })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); var GuardedUpdateOpcode = (function (_UpdateOpcode) { babelHelpers.inherits(GuardedUpdateOpcode, _UpdateOpcode); function GuardedUpdateOpcode(reference, cache, bounds, upsert, appendOpcode, state) { _UpdateOpcode.call(this, cache, bounds, upsert); this.reference = reference; this.appendOpcode = appendOpcode; this.state = state; this.deopted = null; this.tag = this._tag = new _glimmerReference.UpdatableTag(this.tag); } GuardedUpdateOpcode.prototype.evaluate = function evaluate(vm) { if (this.deopted) { vm.evaluateOpcode(this.deopted); } else { if (_glimmerRuntimeLibComponentInterfaces.isComponentDefinition(this.reference.value())) { this.lazyDeopt(vm); } else { _UpdateOpcode.prototype.evaluate.call(this, vm); } } }; GuardedUpdateOpcode.prototype.lazyDeopt = function lazyDeopt(vm) { // Durign initial render, we know that the reference does not contain a // component definition, so we optimistically assumed that this append // is just a normal append. However, at update time, we discovered that // the reference has switched into containing a component definition, so // we need to do a "lazy deopt", simulating what would have happened if // we had decided to perform the deopt in the first place during initial // render. // // More concretely, we would have expanded the curly into a if/else, and // based on whether the value is a component definition or not, we would // have entered either the dynamic component branch or the simple value // branch. // // Since we rendered a simple value during initial render (and all the // updates up until this point), we need to pretend that the result is // produced by the "VALUE" branch of the deopted append opcode: // // Try(BEGIN, END) // Assert(IsComponentDefinition, expected=false) // OptimizedUpdate // // In this case, because the reference has switched from being a simple // value into a component definition, what would have happened is that // the assert would throw, causing the Try opcode to teardown the bounds // and rerun the original append opcode. // // Since the Try opcode would have nuked the updating opcodes anyway, we // wouldn't have to worry about simulating those. All we have to do is to // execute the Try opcode and immediately throw. var bounds = this.bounds; var appendOpcode = this.appendOpcode; var state = this.state; var appendOps = appendOpcode.deopt(vm.env); var enter = appendOps.head(); var ops = enter.slice; var tracker = new _glimmerRuntimeLibBuilder.UpdatableBlockTracker(bounds.parentElement()); tracker.newBounds(this.bounds); var children = new _glimmerUtil.LinkedList(); var deopted = this.deopted = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, children); this._tag.update(deopted.tag); vm.evaluateOpcode(deopted); vm.throw(); // From this point on, we have essentially replaced ourselve with a new // opcode. Since we will always be executing the new/deopted code, it's a // good idea (as a pattern) to null out any unneeded fields here to avoid // holding on to unneeded/stale objects: this._tag = null; this.reference = null; this.cache = null; this.bounds = null; this.upsert = null; this.appendOpcode = null; this.state = null; }; GuardedUpdateOpcode.prototype.toJSON = function toJSON() { var guid = this._guid; var type = this.type; var deopted = this.deopted; if (deopted) { return { guid: guid, type: type, deopted: true, children: [deopted.toJSON()] }; } else { return _UpdateOpcode.prototype.toJSON.call(this); } }; return GuardedUpdateOpcode; })(UpdateOpcode); exports.GuardedUpdateOpcode = GuardedUpdateOpcode; var OptimizedCautiousAppendOpcode = (function (_AppendOpcode2) { babelHelpers.inherits(OptimizedCautiousAppendOpcode, _AppendOpcode2); function OptimizedCautiousAppendOpcode() { _AppendOpcode2.apply(this, arguments); this.type = 'optimized-cautious-append'; } OptimizedCautiousAppendOpcode.prototype.normalize = function normalize(reference) { return _glimmerReference.map(reference, normalizeValue); }; OptimizedCautiousAppendOpcode.prototype.insert = function insert(dom, cursor, value) { return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); }; OptimizedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { return new OptimizedCautiousUpdateOpcode(cache, bounds, upsert); }; return OptimizedCautiousAppendOpcode; })(AppendOpcode); exports.OptimizedCautiousAppendOpcode = OptimizedCautiousAppendOpcode; var OptimizedCautiousUpdateOpcode = (function (_UpdateOpcode2) { babelHelpers.inherits(OptimizedCautiousUpdateOpcode, _UpdateOpcode2); function OptimizedCautiousUpdateOpcode() { _UpdateOpcode2.apply(this, arguments); this.type = 'optimized-cautious-update'; } OptimizedCautiousUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); }; return OptimizedCautiousUpdateOpcode; })(UpdateOpcode); var GuardedCautiousAppendOpcode = (function (_GuardedAppendOpcode) { babelHelpers.inherits(GuardedCautiousAppendOpcode, _GuardedAppendOpcode); function GuardedCautiousAppendOpcode() { _GuardedAppendOpcode.apply(this, arguments); this.type = 'guarded-cautious-append'; this.AppendOpcode = OptimizedCautiousAppendOpcode; } GuardedCautiousAppendOpcode.prototype.normalize = function normalize(reference) { return _glimmerReference.map(reference, normalizeValue); }; GuardedCautiousAppendOpcode.prototype.insert = function insert(dom, cursor, value) { return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); }; GuardedCautiousAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { return new GuardedCautiousUpdateOpcode(reference, cache, bounds, upsert, this, vm.capture()); }; return GuardedCautiousAppendOpcode; })(GuardedAppendOpcode); exports.GuardedCautiousAppendOpcode = GuardedCautiousAppendOpcode; var GuardedCautiousUpdateOpcode = (function (_GuardedUpdateOpcode) { babelHelpers.inherits(GuardedCautiousUpdateOpcode, _GuardedUpdateOpcode); function GuardedCautiousUpdateOpcode() { _GuardedUpdateOpcode.apply(this, arguments); this.type = 'guarded-cautious-update'; } GuardedCautiousUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { return _glimmerRuntimeLibUpsert.cautiousInsert(dom, cursor, value); }; return GuardedCautiousUpdateOpcode; })(GuardedUpdateOpcode); var OptimizedTrustingAppendOpcode = (function (_AppendOpcode3) { babelHelpers.inherits(OptimizedTrustingAppendOpcode, _AppendOpcode3); function OptimizedTrustingAppendOpcode() { _AppendOpcode3.apply(this, arguments); this.type = 'optimized-trusting-append'; } OptimizedTrustingAppendOpcode.prototype.normalize = function normalize(reference) { return _glimmerReference.map(reference, normalizeTrustedValue); }; OptimizedTrustingAppendOpcode.prototype.insert = function insert(dom, cursor, value) { return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); }; OptimizedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { return new OptimizedTrustingUpdateOpcode(cache, bounds, upsert); }; return OptimizedTrustingAppendOpcode; })(AppendOpcode); exports.OptimizedTrustingAppendOpcode = OptimizedTrustingAppendOpcode; var OptimizedTrustingUpdateOpcode = (function (_UpdateOpcode3) { babelHelpers.inherits(OptimizedTrustingUpdateOpcode, _UpdateOpcode3); function OptimizedTrustingUpdateOpcode() { _UpdateOpcode3.apply(this, arguments); this.type = 'optimized-trusting-update'; } OptimizedTrustingUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); }; return OptimizedTrustingUpdateOpcode; })(UpdateOpcode); var GuardedTrustingAppendOpcode = (function (_GuardedAppendOpcode2) { babelHelpers.inherits(GuardedTrustingAppendOpcode, _GuardedAppendOpcode2); function GuardedTrustingAppendOpcode() { _GuardedAppendOpcode2.apply(this, arguments); this.type = 'guarded-trusting-append'; this.AppendOpcode = OptimizedTrustingAppendOpcode; } GuardedTrustingAppendOpcode.prototype.normalize = function normalize(reference) { return _glimmerReference.map(reference, normalizeTrustedValue); }; GuardedTrustingAppendOpcode.prototype.insert = function insert(dom, cursor, value) { return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); }; GuardedTrustingAppendOpcode.prototype.updateWith = function updateWith(vm, reference, cache, bounds, upsert) { return new GuardedTrustingUpdateOpcode(reference, cache, bounds, upsert, this, vm.capture()); }; return GuardedTrustingAppendOpcode; })(GuardedAppendOpcode); exports.GuardedTrustingAppendOpcode = GuardedTrustingAppendOpcode; var GuardedTrustingUpdateOpcode = (function (_GuardedUpdateOpcode2) { babelHelpers.inherits(GuardedTrustingUpdateOpcode, _GuardedUpdateOpcode2); function GuardedTrustingUpdateOpcode() { _GuardedUpdateOpcode2.apply(this, arguments); this.type = 'trusting-update'; } GuardedTrustingUpdateOpcode.prototype.insert = function insert(dom, cursor, value) { return _glimmerRuntimeLibUpsert.trustingInsert(dom, cursor, value); }; return GuardedTrustingUpdateOpcode; })(GuardedUpdateOpcode); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9jb250ZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUErQkEsYUFBQSxPQUFBLENBQWlCLEtBQWEsRUFBQTtBQUM1QixlQUFPLEtBQUssS0FBSyxJQUFJLElBQUksS0FBSyxLQUFLLFNBQVMsSUFBSSxPQUFPLEtBQUssQ0FBQyxVQUFVLENBQUMsS0FBSyxVQUFVLENBQUM7S0FDekY7O0FBRUssYUFBQSxrQkFBQSxDQUE2QixLQUFhLEVBQUE7QUFDOUMsWUFBSSxPQUFPLENBQUMsS0FBSyxDQUFDLEVBQUU7QUFDbEIsbUJBQU8sRUFBRSxDQUFDO1NBQ1g7QUFDRCxlQUFPLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQztLQUN0Qjs7QUFFSyxhQUFBLHFCQUFBLENBQWdDLEtBQWEsRUFBQTtBQUNqRCxZQUFJLE9BQU8sQ0FBQyxLQUFLLENBQUMsRUFBRTtBQUNsQixtQkFBTyxFQUFFLENBQUM7U0FDWDtBQUNELFlBQUkseUJBdkNKLFFBQVEsQ0F1Q0ssS0FBSyxDQUFDLEVBQUU7QUFDbkIsbUJBQU8sS0FBSyxDQUFDO1NBQ2Q7QUFDRCxZQUFJLHlCQTVDSixZQUFZLENBNENLLEtBQUssQ0FBQyxFQUFFO0FBQ3ZCLG1CQUFPLEtBQUssQ0FBQ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IGRlb3B0IGludG8gdGhlXG4gICAgLy8gZXhwYW5kZWQgdmVyc2lvbiB0aGF0IGhhbmRsZXMgYm90aCBjYXNlcy4gVGhlIGNvbXBpbGF0aW9uIHdvdWxkIGxvb2tcbiAgICAvLyBsaWtlIHRoaXM6XG4gICAgLy9cbiAgICAvLyAgICAgICAgICAgICAgIEVudGVyKEJFR0lOLCBFTkQpXG4gICAgLy8gICBCRUdJTjogICAgICBOb29wXG4gICAgLy8gICAgICAgICAgICAgICBUZXN0KGlzLWNvbXBvbmVudC1kZWZpbml0aW9uKVxuICAgIC8vICAgICAgICAgICAgICAgSnVtcFVubGVzcyhWQUxVRSlcbiAgICAvLyAgIENPTVBPTkVOVDogIE5vb3BcbiAgICAvLyAgICAgICAgICAgICAgIFB1dER5bmFtaWNDb21wb25lbnREZWZpbml0aW9uT3Bjb2RlXG4gICAgLy8gICAgICAgICAgICAgICBPcGVuQ29tcG9uZW50XG4gICAgLy8gICAgICAgICAgICAgICBDbG9zZUNvbXBvbmVudFxuICAgIC8vICAgICAgICAgICAgICAgSnVtcChFTkQpXG4gICAgLy8gICBWQUxVRTogICAgICBOb29wXG4gICAgLy8gICAgICAgICAgICAgICBPcHRpbWl6ZWRBcHBlbmRcbiAgICAvLyAgIEVORDogICAgICAgIE5vb3BcbiAgICAvLyAgICAgICAgICAgICAgIEV4aXRcbiAgICAvL1xuICAgIC8vIEtlZXAgaW4gbWluZCB0aGF0IGV2ZW4gaWYgd2UgKmRvbid0KiByZWFjaCBoZXJlIGF0IGluaXRpYWwgcmVuZGVyIHRpbWUsXG4gICAgLy8gaXQgaXMgc3RpbGwgcG9zc2libGUgKGFsdGhvdWdoIHF1aXRlIHJhcmUpIHRoYXQgdGhlIHNpbXBsZSB2YWx1ZSB3ZVxuICAgIC8vIGVuY291bnRlciBkdXJpbmcgaW5pdGlhbCByZW5kZXIgY291bGQgbGF0ZXIgY2hhbmdlIGludG8gYSBjb21wb25lbnRcbiAgICAvLyBkZWZpbml0aW9uI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zIGxpa2VseSBnb2luZyB0byBiZSB0cnVlIGZvciBvdGhlclxuICAgICAgICAvLyBpbnN0YW5jZXMgb2YgdGhlIHNhbWUgY2FsbHNpdGUsIGl0IGlzIG5vdyBhcHByb3BpYXRlIHRvIGRlb3B0IGludG8gdGhlXG4gICAgICAgIC8vIGV4cGFuZGVkIHZlcnNpb24gdGhhdCBoYW5kbGVzIGJvdGggY2FzZXMuIFRoZSBjb21waWxhdGlvbiB3b3VsZCBsb29rXG4gICAgICAgIC8vIGxpa2UgdGhpczpcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgICAgICAgICAgICBFbnRlcihCRUdJTiwgRU5EKVxuICAgICAgICAvLyAgIEJFR0lOOiAgICAgIE5vb3BcbiAgICAgICAgLy8gICAgICAgICAgICAgICBUZXN0KGlzLWNvbXBvbmVudC1kZWZpbml0aW9uKVxuICAgICAgICAvLyAgICAgICAgICAgICAgIEp1bXBVbmxlc3MoVkFMVUUpXG4gICAgICAgIC8vICAgQ09NUE9ORU5UOiAgTm9vcFxuICAgICAgICAvLyAgICAgICAgICAgICAgIFB1dER5bmFtaWNDb21wb25lbnREZWZpbml0aW9uT3Bjb2RlXG4gICAgICAgIC8vICAgICAgICAgICAgICAgT3BlbkNvbXBvbmVudFxuICAgICAgICAvLyAgICAgICAgICAgICAgIENsb3NlQ29tcG9uZW50XG4gICAgICAgIC8vICAgICAgICAgICAgICAgSnVtcChFTkQpXG4gICAgICAgIC8vICAgVkFMVUU6ICAgICAgTm9vcFxuICAgICAgICAvLyAgICAgICAgICAgICAgIE9wdGltaXplZEFwcGVuZFxuICAgICAgICAvLyAgIEVORDogICAgICAgIE5vb3BcbiAgICAgICAgLy8gICAgICAgICAgICAgICBFeGl0XG4gICAgICAgIC8vXG4gICAgICAgIC8vIEtlZXAgaW4gbWluZCB0aGF0IGV2ZW4gaWYgd2UgKmRvbid0KiByZWFjaCBoZXJlIGF0IGluaXRpYWwgcmVuZGVyIHRpbWUsXG4gICAgICAgIC8vI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HlwZSA9ICd0cnVzdGluZy11cGRhdGUnO1xuICAgIH1cbiAgICBpbnNlcnQoZG9tLCBjdXJzb3IsIHZhbHVlKSB7XG4gICAgICAgIHJldHVybiB0cnVzdGluZ0luc2VydChkb20sIGN1cnNvciwgdmFsdWUpO1xuICAgIH1cbn1cbiJdfQ== enifed('glimmer-runtime/lib/compiled/opcodes/dom', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/compiled/expressions/value'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibReferences, _glimmerRuntimeLibCompiledExpressionsValue) { 'use strict'; var TextOpcode = (function (_Opcode) { babelHelpers.inherits(TextOpcode, _Opcode); function TextOpcode(_ref) { var text = _ref.text; _Opcode.call(this); this.type = "text"; this.text = text; } TextOpcode.prototype.evaluate = function evaluate(vm) { vm.stack().appendText(this.text); }; TextOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [JSON.stringify(this.text)] }; }; return TextOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.TextOpcode = TextOpcode; var OpenPrimitiveElementOpcode = (function (_Opcode2) { babelHelpers.inherits(OpenPrimitiveElementOpcode, _Opcode2); function OpenPrimitiveElementOpcode(tag) { _Opcode2.call(this); this.tag = tag; this.type = "open-primitive-element"; } OpenPrimitiveElementOpcode.prototype.evaluate = function evaluate(vm) { vm.stack().openElement(this.tag); }; OpenPrimitiveElementOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [JSON.stringify(this.tag)] }; }; return OpenPrimitiveElementOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.OpenPrimitiveElementOpcode = OpenPrimitiveElementOpcode; var OpenComponentElementOpcode = (function (_Opcode3) { babelHelpers.inherits(OpenComponentElementOpcode, _Opcode3); function OpenComponentElementOpcode(tag) { _Opcode3.call(this); this.tag = tag; this.type = "open-component-element"; } OpenComponentElementOpcode.prototype.evaluate = function evaluate(vm) { vm.stack().openElement(this.tag, new ComponentElementOperations(vm.env)); }; OpenComponentElementOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [JSON.stringify(this.tag)] }; }; return OpenComponentElementOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.OpenComponentElementOpcode = OpenComponentElementOpcode; var OpenDynamicPrimitiveElementOpcode = (function (_Opcode4) { babelHelpers.inherits(OpenDynamicPrimitiveElementOpcode, _Opcode4); function OpenDynamicPrimitiveElementOpcode() { _Opcode4.apply(this, arguments); this.type = "open-dynamic-primitive-element"; } OpenDynamicPrimitiveElementOpcode.prototype.evaluate = function evaluate(vm) { var tagName = vm.frame.getOperand().value(); vm.stack().openElement(tagName); }; OpenDynamicPrimitiveElementOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: ["$OPERAND"] }; }; return OpenDynamicPrimitiveElementOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.OpenDynamicPrimitiveElementOpcode = OpenDynamicPrimitiveElementOpcode; var ClassList = (function () { function ClassList() { this.list = null; this.isConst = true; } ClassList.prototype.append = function append(reference) { var list = this.list; var isConst = this.isConst; if (list === null) list = this.list = []; list.push(reference); this.isConst = isConst && _glimmerReference.isConst(reference); }; ClassList.prototype.toReference = function toReference() { var list = this.list; var isConst = this.isConst; if (!list) return _glimmerRuntimeLibReferences.NULL_REFERENCE; if (isConst) return new _glimmerRuntimeLibCompiledExpressionsValue.ValueReference(toClassName(list)); return new ClassListReference(list); }; return ClassList; })(); var ClassListReference = (function (_CachedReference) { babelHelpers.inherits(ClassListReference, _CachedReference); function ClassListReference(list) { _CachedReference.call(this); this.list = []; this.tag = _glimmerReference.combineTagged(list); this.list = list; } ClassListReference.prototype.compute = function compute() { return toClassName(this.list); }; return ClassListReference; })(_glimmerReference.CachedReference); function toClassName(list) { var ret = []; for (var i = 0; i < list.length; i++) { var value = list[i].value(); if (value !== false && value !== null && value !== undefined) ret.push(value); } return ret.length === 0 ? null : ret.join(' '); } var SimpleElementOperations = (function () { function SimpleElementOperations(env) { this.env = env; this.opcodes = null; this.classList = null; } SimpleElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element, name, value) { if (name === 'class') { this.addClass(new _glimmerRuntimeLibCompiledExpressionsValue.ValueReference(value)); } else { this.env.getAppendOperations().setAttribute(element, name, value); } }; SimpleElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element, namespace, name, value) { this.env.getAppendOperations().setAttribute(element, name, value, namespace); }; SimpleElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element, name, reference, isTrusting) { if (name === 'class') { this.addClass(reference); } else { var attributeManager = this.env.attributeFor(element, name, isTrusting); var attribute = new DynamicAttribute(element, attributeManager, name, reference); this.addAttribute(attribute); } }; SimpleElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element, namespace, name, reference, isTrusting) { var attributeManager = this.env.attributeFor(element, name, isTrusting, namespace); var nsAttribute = new DynamicAttribute(element, attributeManager, name, reference, namespace); this.addAttribute(nsAttribute); }; SimpleElementOperations.prototype.flush = function flush(element, vm) { var env = vm.env; var opcodes = this.opcodes; var classList = this.classList; for (var i = 0; opcodes && i < opcodes.length; i++) { vm.updateWith(opcodes[i]); } if (classList) { var attributeManager = env.attributeFor(element, 'class', false); var attribute = new DynamicAttribute(element, attributeManager, 'class', classList.toReference()); var opcode = attribute.flush(env); if (opcode) { vm.updateWith(opcode); } } this.opcodes = null; this.classList = null; }; SimpleElementOperations.prototype.addClass = function addClass(reference) { var classList = this.classList; if (!classList) { classList = this.classList = new ClassList(); } classList.append(reference); }; SimpleElementOperations.prototype.addAttribute = function addAttribute(attribute) { var opcode = attribute.flush(this.env); if (opcode) { var opcodes = this.opcodes; if (!opcodes) { opcodes = this.opcodes = []; } opcodes.push(opcode); } }; return SimpleElementOperations; })(); exports.SimpleElementOperations = SimpleElementOperations; var ComponentElementOperations = (function () { function ComponentElementOperations(env) { this.env = env; this.attributeNames = null; this.attributes = null; this.classList = null; } ComponentElementOperations.prototype.addStaticAttribute = function addStaticAttribute(element, name, value) { if (name === 'class') { this.addClass(new _glimmerRuntimeLibCompiledExpressionsValue.ValueReference(value)); } else if (this.shouldAddAttribute(name)) { this.addAttribute(name, new StaticAttribute(element, name, value)); } }; ComponentElementOperations.prototype.addStaticAttributeNS = function addStaticAttributeNS(element, namespace, name, value) { if (this.shouldAddAttribute(name)) { this.addAttribute(name, new StaticAttribute(element, name, value, namespace)); } }; ComponentElementOperations.prototype.addDynamicAttribute = function addDynamicAttribute(element, name, reference, isTrusting) { if (name === 'class') { this.addClass(reference); } else if (this.shouldAddAttribute(name)) { var attributeManager = this.env.attributeFor(element, name, isTrusting); var attribute = new DynamicAttribute(element, attributeManager, name, reference); this.addAttribute(name, attribute); } }; ComponentElementOperations.prototype.addDynamicAttributeNS = function addDynamicAttributeNS(element, namespace, name, reference, isTrusting) { if (this.shouldAddAttribute(name)) { var attributeManager = this.env.attributeFor(element, name, isTrusting, namespace); var nsAttribute = new DynamicAttribute(element, attributeManager, name, reference, namespace); this.addAttribute(name, nsAttribute); } }; ComponentElementOperations.prototype.flush = function flush(element, vm) { var env = this.env; var attributes = this.attributes; var classList = this.classList; for (var i = 0; attributes && i < attributes.length; i++) { var opcode = attributes[i].flush(env); if (opcode) { vm.updateWith(opcode); } } if (classList) { var attributeManager = env.attributeFor(element, 'class', false); var attribute = new DynamicAttribute(element, attributeManager, 'class', classList.toReference()); var opcode = attribute.flush(env); if (opcode) { vm.updateWith(opcode); } } }; ComponentElementOperations.prototype.shouldAddAttribute = function shouldAddAttribute(name) { return !this.attributeNames || this.attributeNames.indexOf(name) === -1; }; ComponentElementOperations.prototype.addClass = function addClass(reference) { var classList = this.classList; if (!classList) { classList = this.classList = new ClassList(); } classList.append(reference); }; ComponentElementOperations.prototype.addAttribute = function addAttribute(name, attribute) { var attributeNames = this.attributeNames; var attributes = this.attributes; if (!attributeNames) { attributeNames = this.attributeNames = []; attributes = this.attributes = []; } attributeNames.push(name); attributes.push(attribute); }; return ComponentElementOperations; })(); exports.ComponentElementOperations = ComponentElementOperations; var FlushElementOpcode = (function (_Opcode5) { babelHelpers.inherits(FlushElementOpcode, _Opcode5); function FlushElementOpcode() { _Opcode5.apply(this, arguments); this.type = "flush-element"; } FlushElementOpcode.prototype.evaluate = function evaluate(vm) { var stack = vm.stack(); stack.operations.flush(stack.constructing, vm); stack.flushElement(); }; return FlushElementOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.FlushElementOpcode = FlushElementOpcode; var CloseElementOpcode = (function (_Opcode6) { babelHelpers.inherits(CloseElementOpcode, _Opcode6); function CloseElementOpcode() { _Opcode6.apply(this, arguments); this.type = "close-element"; } CloseElementOpcode.prototype.evaluate = function evaluate(vm) { vm.stack().closeElement(); }; return CloseElementOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.CloseElementOpcode = CloseElementOpcode; var StaticAttrOpcode = (function (_Opcode7) { babelHelpers.inherits(StaticAttrOpcode, _Opcode7); function StaticAttrOpcode(_ref2) { var namespace = _ref2.namespace; var name = _ref2.name; var value = _ref2.value; _Opcode7.call(this); this.type = "static-attr"; this.namespace = namespace; this.name = name; this.value = value; } StaticAttrOpcode.prototype.evaluate = function evaluate(vm) { var name = this.name; var value = this.value; var namespace = this.namespace; if (namespace) { vm.stack().setStaticAttributeNS(namespace, name, value); } else { vm.stack().setStaticAttribute(name, value); } }; StaticAttrOpcode.prototype.toJSON = function toJSON() { var guid = this._guid; var type = this.type; var namespace = this.namespace; var name = this.name; var value = this.value; var details = _glimmerUtil.dict(); if (namespace) { details["namespace"] = JSON.stringify(namespace); } details["name"] = JSON.stringify(name); details["value"] = JSON.stringify(value); return { guid: guid, type: type, details: details }; }; return StaticAttrOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.StaticAttrOpcode = StaticAttrOpcode; var ModifierOpcode = (function (_Opcode8) { babelHelpers.inherits(ModifierOpcode, _Opcode8); function ModifierOpcode(name, manager, args) { _Opcode8.call(this); this.name = name; this.manager = manager; this.args = args; this.type = "modifier"; } ModifierOpcode.prototype.evaluate = function evaluate(vm) { var manager = this.manager; var stack = vm.stack(); var element = stack.constructing; var updateOperations = stack.updateOperations; var args = this.args.evaluate(vm); var dynamicScope = vm.dynamicScope(); var modifier = manager.create(element, args, dynamicScope, updateOperations); vm.env.scheduleInstallModifier(modifier, manager); var destructor = manager.getDestructor(modifier); if (destructor) { vm.newDestroyable(destructor); } vm.updateWith(new UpdateModifierOpcode(manager, modifier, args)); }; ModifierOpcode.prototype.toJSON = function toJSON() { var guid = this._guid; var type = this.type; var name = this.name; var args = this.args; var details = _glimmerUtil.dict(); details["type"] = JSON.stringify(type); details["name"] = JSON.stringify(name); details["args"] = JSON.stringify(args); return { guid: guid, type: type, details: details }; }; return ModifierOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.ModifierOpcode = ModifierOpcode; var UpdateModifierOpcode = (function (_UpdatingOpcode) { babelHelpers.inherits(UpdateModifierOpcode, _UpdatingOpcode); function UpdateModifierOpcode(manager, modifier, args) { _UpdatingOpcode.call(this); this.manager = manager; this.modifier = modifier; this.args = args; this.type = "update-modifier"; this.tag = args.tag; this.lastUpdated = args.tag.value(); } UpdateModifierOpcode.prototype.evaluate = function evaluate(vm) { var manager = this.manager; var modifier = this.modifier; var tag = this.tag; var lastUpdated = this.lastUpdated; if (!tag.validate(lastUpdated)) { vm.env.scheduleUpdateModifier(modifier, manager); this.lastUpdated = tag.value(); } }; UpdateModifierOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [JSON.stringify(this.args)] }; }; return UpdateModifierOpcode; })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); exports.UpdateModifierOpcode = UpdateModifierOpcode; var StaticAttribute = (function () { function StaticAttribute(element, name, value, namespace) { this.element = element; this.name = name; this.value = value; this.namespace = namespace; } StaticAttribute.prototype.flush = function flush(env) { env.getAppendOperations().setAttribute(this.element, this.name, this.value, this.namespace); return null; }; return StaticAttribute; })(); exports.StaticAttribute = StaticAttribute; var DynamicAttribute = (function () { function DynamicAttribute(element, changeList, name, reference, namespace) { this.element = element; this.changeList = changeList; this.name = name; this.reference = reference; this.namespace = namespace; this.element = element; this.reference = reference; this.changeList = changeList; this.tag = reference.tag; this.name = name; this.cache = null; this.namespace = namespace; } DynamicAttribute.prototype.patch = function patch(env) { var element = this.element; var cache = this.cache; var value = cache.revalidate(); if (_glimmerReference.isModified(value)) { this.changeList.updateAttribute(env, element, this.name, value, this.namespace); } }; DynamicAttribute.prototype.flush = function flush(env) { var reference = this.reference; var element = this.element; if (_glimmerReference.isConst(reference)) { var value = reference.value(); this.changeList.setAttribute(env, element, this.name, value, this.namespace); return null; } else { var cache = this.cache = new _glimmerReference.ReferenceCache(reference); var value = cache.peek(); this.changeList.setAttribute(env, element, this.name, value, this.namespace); return new PatchElementOpcode(this); } }; DynamicAttribute.prototype.toJSON = function toJSON() { var element = this.element; var namespace = this.namespace; var name = this.name; var cache = this.cache; var formattedElement = formatElement(element); var lastValue = cache.peek(); if (namespace) { return { element: formattedElement, type: 'attribute', namespace: namespace, name: name, lastValue: lastValue }; } return { element: formattedElement, type: 'attribute', namespace: namespace, name: name, lastValue: lastValue }; }; return DynamicAttribute; })(); exports.DynamicAttribute = DynamicAttribute; function formatElement(element) { return JSON.stringify('<' + element.tagName.toLowerCase() + ' />'); } var DynamicAttrNSOpcode = (function (_Opcode9) { babelHelpers.inherits(DynamicAttrNSOpcode, _Opcode9); function DynamicAttrNSOpcode(_ref3) { var name = _ref3.name; var namespace = _ref3.namespace; var isTrusting = _ref3.isTrusting; _Opcode9.call(this); this.type = "dynamic-attr"; this.name = name; this.namespace = namespace; this.isTrusting = isTrusting; } DynamicAttrNSOpcode.prototype.evaluate = function evaluate(vm) { var name = this.name; var namespace = this.namespace; var isTrusting = this.isTrusting; var reference = vm.frame.getOperand(); vm.stack().setDynamicAttributeNS(namespace, name, reference, isTrusting); }; DynamicAttrNSOpcode.prototype.toJSON = function toJSON() { var guid = this._guid; var type = this.type; var name = this.name; var namespace = this.namespace; var details = _glimmerUtil.dict(); details["name"] = JSON.stringify(name); details["value"] = "$OPERAND"; if (namespace) { details["namespace"] = JSON.stringify(namespace); } return { guid: guid, type: type, details: details }; }; return DynamicAttrNSOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.DynamicAttrNSOpcode = DynamicAttrNSOpcode; var DynamicAttrOpcode = (function (_Opcode10) { babelHelpers.inherits(DynamicAttrOpcode, _Opcode10); function DynamicAttrOpcode(_ref4) { var name = _ref4.name; var isTrusting = _ref4.isTrusting; _Opcode10.call(this); this.type = "dynamic-attr"; this.name = name; this.isTrusting = isTrusting; } DynamicAttrOpcode.prototype.evaluate = function evaluate(vm) { var name = this.name; var isTrusting = this.isTrusting; var reference = vm.frame.getOperand(); vm.stack().setDynamicAttribute(name, reference, isTrusting); }; DynamicAttrOpcode.prototype.toJSON = function toJSON() { var guid = this._guid; var type = this.type; var name = this.name; var details = _glimmerUtil.dict(); details["name"] = JSON.stringify(name); details["value"] = "$OPERAND"; return { guid: guid, type: type, details: details }; }; return DynamicAttrOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.DynamicAttrOpcode = DynamicAttrOpcode; var PatchElementOpcode = (function (_UpdatingOpcode2) { babelHelpers.inherits(PatchElementOpcode, _UpdatingOpcode2); function PatchElementOpcode(operation) { _UpdatingOpcode2.call(this); this.type = "patch-element"; this.tag = operation.tag; this.operation = operation; } PatchElementOpcode.prototype.evaluate = function evaluate(vm) { this.operation.patch(vm.env); }; PatchElementOpcode.prototype.toJSON = function toJSON() { var _guid = this._guid; var type = this.type; var operation = this.operation; return { guid: _guid, type: type, details: operation.toJSON() }; }; return PatchElementOpcode; })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); exports.PatchElementOpcode = PatchElementOpcode; var CommentOpcode = (function (_Opcode11) { babelHelpers.inherits(CommentOpcode, _Opcode11); function CommentOpcode(_ref5) { var comment = _ref5.comment; _Opcode11.call(this); this.type = "comment"; this.comment = comment; } CommentOpcode.prototype.evaluate = function evaluate(vm) { vm.stack().appendComment(this.comment); }; CommentOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [JSON.stringify(this.comment)] }; }; return CommentOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.CommentOpcode = CommentOpcode; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9kb20udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBd0JNLFVBQWtCOzhCQUFsQixVQUFrQjs7QUFJdEIsaUJBSkksVUFBa0IsQ0FJVixJQUEwQixFQUFBO2dCQUF4QixJQUFJLEdBQU4sSUFBMEIsQ0FBeEIsSUFBSTs7QUFDaEIsOEJBQU8sQ0FBQztBQUpILGdCQUFBLENBQUEsSUFBSSxHQUFHLE1BQU0sQ0FBQztBQUtuQixnQkFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7U0FDbEI7O0FBUEcsa0JBQWtCLFdBU3RCLFFBQVEsR0FBQSxrQkFBQyxFQUFNLEVBQUE7QUFDYixjQUFFLENBQUMsS0FBSyxFQUFFLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztTQUNsQzs7QUFYRyxrQkFBa0IsV0FhdEIsTUFBTSxHQUFBLGtCQUFBO0FBQ0osbUJBQU87QUFDTCxvQkFBSSxFQUFFLElBQUksQ0FBQyxLQUFLO0FBQ2hCLG9CQUFJLEVBQUUsSUFBSSxDQUFDLElBQUk7QUFDZixvQkFBSSxFQUFFLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDbEMsQ0FBQztTQUNIOztlQW5CRyxVQUFrQjtpQ0F4QmYsTUFBTTs7O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glimmer-runtime/lib/compiled/opcodes/lists', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-util', 'glimmer-reference'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerUtil, _glimmerReference) { 'use strict'; var IterablePresenceReference = (function () { function IterablePresenceReference(artifacts) { this.tag = artifacts.tag; this.artifacts = artifacts; } IterablePresenceReference.prototype.value = function value() { return !this.artifacts.isEmpty(); }; return IterablePresenceReference; })(); var PutIteratorOpcode = (function (_Opcode) { babelHelpers.inherits(PutIteratorOpcode, _Opcode); function PutIteratorOpcode() { _Opcode.apply(this, arguments); this.type = "put-iterator"; } PutIteratorOpcode.prototype.evaluate = function evaluate(vm) { var listRef = vm.frame.getOperand(); var args = vm.frame.getArgs(); var iterable = vm.env.iterableFor(listRef, args); var iterator = new _glimmerReference.ReferenceIterator(iterable); vm.frame.setIterator(iterator); vm.frame.setCondition(new IterablePresenceReference(iterator.artifacts)); }; return PutIteratorOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PutIteratorOpcode = PutIteratorOpcode; var EnterListOpcode = (function (_Opcode2) { babelHelpers.inherits(EnterListOpcode, _Opcode2); function EnterListOpcode(start, end) { _Opcode2.call(this); this.type = "enter-list"; this.slice = new _glimmerUtil.ListSlice(start, end); } EnterListOpcode.prototype.evaluate = function evaluate(vm) { vm.enterList(this.slice); }; EnterListOpcode.prototype.toJSON = function toJSON() { var slice = this.slice; var type = this.type; var _guid = this._guid; var begin = slice.head(); var end = slice.tail(); return { guid: _guid, type: type, args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] }; }; return EnterListOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.EnterListOpcode = EnterListOpcode; var ExitListOpcode = (function (_Opcode3) { babelHelpers.inherits(ExitListOpcode, _Opcode3); function ExitListOpcode() { _Opcode3.apply(this, arguments); this.type = "exit-list"; } ExitListOpcode.prototype.evaluate = function evaluate(vm) { vm.exitList(); }; return ExitListOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.ExitListOpcode = ExitListOpcode; var EnterWithKeyOpcode = (function (_Opcode4) { babelHelpers.inherits(EnterWithKeyOpcode, _Opcode4); function EnterWithKeyOpcode(start, end) { _Opcode4.call(this); this.type = "enter-with-key"; this.slice = new _glimmerUtil.ListSlice(start, end); } EnterWithKeyOpcode.prototype.evaluate = function evaluate(vm) { vm.enterWithKey(vm.frame.getKey(), this.slice); }; EnterWithKeyOpcode.prototype.toJSON = function toJSON() { var slice = this.slice; var _guid = this._guid; var type = this.type; var begin = slice.head(); var end = slice.tail(); return { guid: _guid, type: type, args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] }; }; return EnterWithKeyOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.EnterWithKeyOpcode = EnterWithKeyOpcode; var TRUE_REF = new _glimmerReference.ConstReference(true); var FALSE_REF = new _glimmerReference.ConstReference(false); var NextIterOpcode = (function (_Opcode5) { babelHelpers.inherits(NextIterOpcode, _Opcode5); function NextIterOpcode(end) { _Opcode5.call(this); this.type = "next-iter"; this.end = end; } NextIterOpcode.prototype.evaluate = function evaluate(vm) { var item = vm.frame.getIterator().next(); if (item) { vm.frame.setCondition(TRUE_REF); vm.frame.setKey(item.key); vm.frame.setOperand(item.value); vm.frame.setArgs(_glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs.positional([item.value, item.memo])); } else { vm.frame.setCondition(FALSE_REF); vm.goto(this.end); } }; return NextIterOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.NextIterOpcode = NextIterOpcode; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy9saXN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFPQSx5QkFBQTtBQUlFLGlCQUpGLHl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TtcbiAgICAgICAgfVxuICAgIH1cbn1cbiJdfQ== enifed('glimmer-runtime/lib/compiled/opcodes/vm', ['exports', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/references', 'glimmer-reference', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-util'], function (exports, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibReferences, _glimmerReference, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerUtil) { 'use strict'; var PushChildScopeOpcode = (function (_Opcode) { babelHelpers.inherits(PushChildScopeOpcode, _Opcode); function PushChildScopeOpcode() { _Opcode.apply(this, arguments); this.type = "push-child-scope"; } PushChildScopeOpcode.prototype.evaluate = function evaluate(vm) { vm.pushChildScope(); }; return PushChildScopeOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PushChildScopeOpcode = PushChildScopeOpcode; var PopScopeOpcode = (function (_Opcode2) { babelHelpers.inherits(PopScopeOpcode, _Opcode2); function PopScopeOpcode() { _Opcode2.apply(this, arguments); this.type = "pop-scope"; } PopScopeOpcode.prototype.evaluate = function evaluate(vm) { vm.popScope(); }; return PopScopeOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PopScopeOpcode = PopScopeOpcode; var PushDynamicScopeOpcode = (function (_Opcode3) { babelHelpers.inherits(PushDynamicScopeOpcode, _Opcode3); function PushDynamicScopeOpcode() { _Opcode3.apply(this, arguments); this.type = "push-dynamic-scope"; } PushDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { vm.pushDynamicScope(); }; return PushDynamicScopeOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PushDynamicScopeOpcode = PushDynamicScopeOpcode; var PopDynamicScopeOpcode = (function (_Opcode4) { babelHelpers.inherits(PopDynamicScopeOpcode, _Opcode4); function PopDynamicScopeOpcode() { _Opcode4.apply(this, arguments); this.type = "pop-dynamic-scope"; } PopDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { vm.popDynamicScope(); }; return PopDynamicScopeOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PopDynamicScopeOpcode = PopDynamicScopeOpcode; var PutNullOpcode = (function (_Opcode5) { babelHelpers.inherits(PutNullOpcode, _Opcode5); function PutNullOpcode() { _Opcode5.apply(this, arguments); this.type = "put-null"; } PutNullOpcode.prototype.evaluate = function evaluate(vm) { vm.frame.setOperand(_glimmerRuntimeLibReferences.NULL_REFERENCE); }; return PutNullOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PutNullOpcode = PutNullOpcode; var PutValueOpcode = (function (_Opcode6) { babelHelpers.inherits(PutValueOpcode, _Opcode6); function PutValueOpcode(_ref) { var expression = _ref.expression; _Opcode6.call(this); this.type = "put-value"; this.expression = expression; } PutValueOpcode.prototype.evaluate = function evaluate(vm) { vm.evaluateOperand(this.expression); }; PutValueOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [this.expression.toJSON()] }; }; return PutValueOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PutValueOpcode = PutValueOpcode; var PutArgsOpcode = (function (_Opcode7) { babelHelpers.inherits(PutArgsOpcode, _Opcode7); function PutArgsOpcode(_ref2) { var args = _ref2.args; _Opcode7.call(this); this.type = "put-args"; this.args = args; } PutArgsOpcode.prototype.evaluate = function evaluate(vm) { vm.evaluateArgs(this.args); }; PutArgsOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, details: { "positional": this.args.positional.toJSON(), "named": this.args.named.toJSON() } }; }; return PutArgsOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.PutArgsOpcode = PutArgsOpcode; var BindPositionalArgsOpcode = (function (_Opcode8) { babelHelpers.inherits(BindPositionalArgsOpcode, _Opcode8); function BindPositionalArgsOpcode(names, symbols) { _Opcode8.call(this); this.names = names; this.symbols = symbols; this.type = "bind-positional-args"; } BindPositionalArgsOpcode.create = function create(block) { var names = block.locals; var symbols = names.map(function (name) { return block.symbolTable.getLocal(name); }); return new this(names, symbols); }; BindPositionalArgsOpcode.prototype.evaluate = function evaluate(vm) { vm.bindPositionalArgs(this.symbols); }; BindPositionalArgsOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: ['[' + this.names.map(function (name) { return JSON.stringify(name); }).join(", ") + ']'] }; }; return BindPositionalArgsOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.BindPositionalArgsOpcode = BindPositionalArgsOpcode; var BindNamedArgsOpcode = (function (_Opcode9) { babelHelpers.inherits(BindNamedArgsOpcode, _Opcode9); function BindNamedArgsOpcode(names, symbols) { _Opcode9.call(this); this.names = names; this.symbols = symbols; this.type = "bind-named-args"; } BindNamedArgsOpcode.create = function create(layout) { var names = layout.named; var symbols = names.map(function (name) { return layout.symbolTable.getNamed(name); }); return new BindNamedArgsOpcode(names, symbols); }; BindNamedArgsOpcode.prototype.evaluate = function evaluate(vm) { vm.bindNamedArgs(this.names, this.symbols); }; BindNamedArgsOpcode.prototype.toJSON = function toJSON() { var names = this.names; var symbols = this.symbols; var args = names.map(function (name, i) { return '$' + symbols[i] + ': $ARGS[' + name + ']'; }); return { guid: this._guid, type: this.type, args: args }; }; return BindNamedArgsOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.BindNamedArgsOpcode = BindNamedArgsOpcode; var BindBlocksOpcode = (function (_BindNamedArgsOpcode) { babelHelpers.inherits(BindBlocksOpcode, _BindNamedArgsOpcode); function BindBlocksOpcode() { _BindNamedArgsOpcode.apply(this, arguments); this.type = "bind-blocks"; } BindBlocksOpcode.create = function create(layout) { var names = layout.yields; var symbols = names.map(function (name) { return layout.symbolTable.getYield(name); }); return new this(names, symbols); }; BindBlocksOpcode.prototype.evaluate = function evaluate(vm) { vm.bindBlocks(this.names, this.symbols); }; return BindBlocksOpcode; })(BindNamedArgsOpcode); exports.BindBlocksOpcode = BindBlocksOpcode; var BindDynamicScopeOpcode = (function (_Opcode10) { babelHelpers.inherits(BindDynamicScopeOpcode, _Opcode10); function BindDynamicScopeOpcode(names) { _Opcode10.call(this); this.names = names; this.type = "bind-dynamic-scope"; } BindDynamicScopeOpcode.prototype.evaluate = function evaluate(vm) { vm.bindDynamicScope(this.names); }; return BindDynamicScopeOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.BindDynamicScopeOpcode = BindDynamicScopeOpcode; var EnterOpcode = (function (_Opcode11) { babelHelpers.inherits(EnterOpcode, _Opcode11); function EnterOpcode(_ref3) { var begin = _ref3.begin; var end = _ref3.end; _Opcode11.call(this); this.type = "enter"; this.slice = new _glimmerUtil.ListSlice(begin, end); } EnterOpcode.prototype.evaluate = function evaluate(vm) { vm.enter(this.slice); }; EnterOpcode.prototype.toJSON = function toJSON() { var slice = this.slice; var type = this.type; var _guid = this._guid; var begin = slice.head(); var end = slice.tail(); return { guid: _guid, type: type, args: [JSON.stringify(begin.inspect()), JSON.stringify(end.inspect())] }; }; return EnterOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.EnterOpcode = EnterOpcode; var ExitOpcode = (function (_Opcode12) { babelHelpers.inherits(ExitOpcode, _Opcode12); function ExitOpcode() { _Opcode12.apply(this, arguments); this.type = "exit"; } ExitOpcode.prototype.evaluate = function evaluate(vm) { vm.exit(); }; return ExitOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.ExitOpcode = ExitOpcode; var LabelOpcode = (function (_Opcode13) { babelHelpers.inherits(LabelOpcode, _Opcode13); function LabelOpcode(label) { _Opcode13.call(this); this.tag = _glimmerReference.CONSTANT_TAG; this.type = "label"; this.label = null; this.prev = null; this.next = null; if (label) this.label = label; } LabelOpcode.prototype.evaluate = function evaluate() {}; LabelOpcode.prototype.inspect = function inspect() { return this.label + ' [' + this._guid + ']'; }; LabelOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [JSON.stringify(this.inspect())] }; }; return LabelOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.LabelOpcode = LabelOpcode; var EvaluateOpcode = (function (_Opcode14) { babelHelpers.inherits(EvaluateOpcode, _Opcode14); function EvaluateOpcode(_ref4) { var debug = _ref4.debug; var block = _ref4.block; _Opcode14.call(this); this.type = "evaluate"; this.debug = debug; this.block = block; } EvaluateOpcode.prototype.evaluate = function evaluate(vm) { vm.invokeBlock(this.block, vm.frame.getArgs()); }; EvaluateOpcode.prototype.toJSON = function toJSON() { var guid = this._guid; var type = this.type; var debug = this.debug; var block = this.block; var compiled = block['compiled']; var children = undefined; if (compiled) { children = compiled.ops.toArray().map(function (op) { return op.toJSON(); }); } else { children = [{ guid: null, type: '[ UNCOMPILED BLOCK ]' }]; } return { guid: guid, type: type, args: [debug], children: children }; }; return EvaluateOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.EvaluateOpcode = EvaluateOpcode; var EvaluatePartialOpcode = (function (_Opcode15) { babelHelpers.inherits(EvaluatePartialOpcode, _Opcode15); function EvaluatePartialOpcode(_ref5) { var name = _ref5.name; var symbolTable = _ref5.symbolTable; _Opcode15.call(this); this.type = "evaluate-partial"; this.cache = _glimmerUtil.dict(); this.name = name; this.symbolTable = symbolTable; } EvaluatePartialOpcode.prototype.evaluate = function evaluate(vm) { var reference = this.name.evaluate(vm); var referenceCache = new _glimmerReference.ReferenceCache(reference); var name = referenceCache.revalidate(); var block = this.cache[name]; if (!block) { var _vm$env$lookupPartial = vm.env.lookupPartial([name], this.symbolTable); var template = _vm$env$lookupPartial.template; block = template.asPartial(this.symbolTable); } vm.invokeBlock(block, _glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs.empty()); if (!_glimmerReference.isConst(reference)) { vm.updateWith(new Assert(referenceCache)); } }; EvaluatePartialOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [this.name.toJSON()] }; }; return EvaluatePartialOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.EvaluatePartialOpcode = EvaluatePartialOpcode; var NameToPartialOpcode = (function (_Opcode16) { babelHelpers.inherits(NameToPartialOpcode, _Opcode16); function NameToPartialOpcode(symbolTable) { _Opcode16.call(this); this.symbolTable = symbolTable; this.type = "name-to-partial"; } NameToPartialOpcode.prototype.evaluate = function evaluate(vm) { var reference = vm.frame.getOperand(); var referenceCache = new _glimmerReference.ReferenceCache(reference); var name = referenceCache.revalidate(); var partial = name && vm.env.hasPartial([name], this.symbolTable) ? vm.env.lookupPartial([name], this.symbolTable) : false; vm.frame.setOperand(new _glimmerRuntimeLibCompiledExpressionsValue.ValueReference(partial)); if (!_glimmerReference.isConst(reference)) { vm.updateWith(new Assert(referenceCache)); } }; NameToPartialOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: ["$OPERAND"] }; }; return NameToPartialOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.NameToPartialOpcode = NameToPartialOpcode; var ConstTest = function (ref, env) { return new _glimmerReference.ConstReference(!!ref.value()); }; exports.ConstTest = ConstTest; var SimpleTest = function (ref, env) { return ref; }; exports.SimpleTest = SimpleTest; var EnvironmentTest = function (ref, env) { return env.toConditionalReference(ref); }; exports.EnvironmentTest = EnvironmentTest; var TestOpcode = (function (_Opcode17) { babelHelpers.inherits(TestOpcode, _Opcode17); function TestOpcode(testFunc) { _Opcode17.call(this); this.testFunc = testFunc; this.type = "test"; } TestOpcode.prototype.evaluate = function evaluate(vm) { vm.frame.setCondition(this.testFunc(vm.frame.getOperand(), vm.env)); }; TestOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: ["$OPERAND", this.testFunc.name] }; }; return TestOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.TestOpcode = TestOpcode; var JumpOpcode = (function (_Opcode18) { babelHelpers.inherits(JumpOpcode, _Opcode18); function JumpOpcode(_ref6) { var target = _ref6.target; _Opcode18.call(this); this.type = "jump"; this.target = target; } JumpOpcode.prototype.evaluate = function evaluate(vm) { vm.goto(this.target); }; JumpOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [JSON.stringify(this.target.inspect())] }; }; return JumpOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.JumpOpcode = JumpOpcode; var JumpIfOpcode = (function (_JumpOpcode) { babelHelpers.inherits(JumpIfOpcode, _JumpOpcode); function JumpIfOpcode() { _JumpOpcode.apply(this, arguments); this.type = "jump-if"; } JumpIfOpcode.prototype.evaluate = function evaluate(vm) { var reference = vm.frame.getCondition(); if (_glimmerReference.isConst(reference)) { if (reference.value()) { _JumpOpcode.prototype.evaluate.call(this, vm); } } else { var cache = new _glimmerReference.ReferenceCache(reference); if (cache.peek()) { _JumpOpcode.prototype.evaluate.call(this, vm); } vm.updateWith(new Assert(cache)); } }; return JumpIfOpcode; })(JumpOpcode); exports.JumpIfOpcode = JumpIfOpcode; var JumpUnlessOpcode = (function (_JumpOpcode2) { babelHelpers.inherits(JumpUnlessOpcode, _JumpOpcode2); function JumpUnlessOpcode() { _JumpOpcode2.apply(this, arguments); this.type = "jump-unless"; } JumpUnlessOpcode.prototype.evaluate = function evaluate(vm) { var reference = vm.frame.getCondition(); if (_glimmerReference.isConst(reference)) { if (!reference.value()) { _JumpOpcode2.prototype.evaluate.call(this, vm); } } else { var cache = new _glimmerReference.ReferenceCache(reference); if (!cache.peek()) { _JumpOpcode2.prototype.evaluate.call(this, vm); } vm.updateWith(new Assert(cache)); } }; return JumpUnlessOpcode; })(JumpOpcode); exports.JumpUnlessOpcode = JumpUnlessOpcode; var Assert = (function (_UpdatingOpcode) { babelHelpers.inherits(Assert, _UpdatingOpcode); function Assert(cache) { _UpdatingOpcode.call(this); this.type = "assert"; this.tag = cache.tag; this.cache = cache; } Assert.prototype.evaluate = function evaluate(vm) { var cache = this.cache; if (_glimmerReference.isModified(cache.revalidate())) { vm.throw(); } }; Assert.prototype.toJSON = function toJSON() { var type = this.type; var _guid = this._guid; var cache = this.cache; var expected = undefined; try { expected = JSON.stringify(cache.peek()); } catch (e) { expected = String(cache.peek()); } return { guid: _guid, type: type, args: [], details: { expected: expected } }; }; return Assert; })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); exports.Assert = Assert; var JumpIfNotModifiedOpcode = (function (_UpdatingOpcode2) { babelHelpers.inherits(JumpIfNotModifiedOpcode, _UpdatingOpcode2); function JumpIfNotModifiedOpcode(_ref7) { var tag = _ref7.tag; var target = _ref7.target; _UpdatingOpcode2.call(this); this.type = "jump-if-not-modified"; this.tag = tag; this.target = target; this.lastRevision = tag.value(); } JumpIfNotModifiedOpcode.prototype.evaluate = function evaluate(vm) { var tag = this.tag; var target = this.target; var lastRevision = this.lastRevision; if (!vm.alwaysRevalidate && tag.validate(lastRevision)) { vm.goto(target); } }; JumpIfNotModifiedOpcode.prototype.didModify = function didModify() { this.lastRevision = this.tag.value(); }; JumpIfNotModifiedOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type, args: [JSON.stringify(this.target.inspect())] }; }; return JumpIfNotModifiedOpcode; })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); exports.JumpIfNotModifiedOpcode = JumpIfNotModifiedOpcode; var DidModifyOpcode = (function (_UpdatingOpcode3) { babelHelpers.inherits(DidModifyOpcode, _UpdatingOpcode3); function DidModifyOpcode(_ref8) { var target = _ref8.target; _UpdatingOpcode3.call(this); this.type = "did-modify"; this.tag = _glimmerReference.CONSTANT_TAG; this.target = target; } DidModifyOpcode.prototype.evaluate = function evaluate() { this.target.didModify(); }; return DidModifyOpcode; })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); exports.DidModifyOpcode = DidModifyOpcode; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZWQvb3Bjb2Rlcy92bS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFhTSxvQkFBNEI7OEJBQTVCLG9CQUE0Qjs7QUFBbEMsaUJBQU0sb0JBQTRCLEdBQWxDO0FDSlEsZ0NBQV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4gICAgfVxuICAgIGV2YWx1YXRlKHZtKSB7XG4gICAgICAgIHZtLmVudGVyKHRoaXMuc2xpY2UpO1xuICAgIH1cbiAgICB0b0pTT04oKSB7XG4gICAgICAgIGxldCB7IHNsaWNlLCB0eXBlLCBfZ3VpZCB9ID0gdGhpcztcbiAgICAgICAgbGV0IGJlZ2luID0gc2xpY2UuaGVhZCgpO1xuICAgICAgICBsZXQgZW5kID0gc2xpY2UudGFpbCgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgZ3VpZDogX2d1aWQsXG4gICAgICAgICAgICB0eXBlLFxuICAgICAgICAgICAgYXJnczogW1xuICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KGJlZ2luLmluc3BlY3QoKSksXG4gICAgICAgICAgICAgICAgSlNPTi5zdHJpbmdpZnkoZW5kLmluc3BlY3QoKSlcbiAgICAgICAgICAgIF1cbiAgICAgICAgfTtcbiAgICB9XG59XG5leHBvcnQgY2xhc3MgRXhpdE9wY29kZSBleHRlbmRzIE9wY29kZSB7XG4gICAgY29uc3RydWN0b3IoKSB7XG4gICAgICAgIHN1cGVyKC4uLmFyZ3VtZW50cyk7XG4gICAgICAgIHRoaXMudHlwZSA9IFwiZXhpdFwiO1xuICAgIH1cbiAgICBldmFsdWF0ZSh2bSkge1xuICAgICAgICB2bS5leGl0KCk7XG4gICAgfVxufVxuZXhwb3J0IGNsYXNzIExhYmVsT3Bjb2RlIGV4dGVuZHMgT3Bjb2RlIHtcbiAgICBjb25zdHJ1Y3RvcihsYWJlbCkge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLnRhZyA9IENPTlNUQU5UX1RBRztcbiAgICAgICAgdGhpcy50eXBlID0gXCJsYWJlbFwiO1xuICAgICAgICB0aGlzLmxhYmVsID0gbnVsbDtcbiAgICAgICAgdGhpcy5wcmV2ID0gbnVsbDtcbiAgICAgICAgdGhpcy5uZXh0ID0gbnVsbDtcbiAgICAgICAgaWYgKGxhYmVsK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pdGlvbigpO1xuICAgICAgICBpZiAoaXNDb25zdChyZWZlcmVuY2UpKSB7XG4gICAgICAgICAgICBpZiAocmVmZXJlbmNlLnZhbHVlKCkpIHtcbiAgICAgICAgICAgICAgICBzdXBlci5ldmFsdWF0ZSh2bSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBsZXQgY2FjaGUgPSBuZXcgUmVmZXJlbmNlQ2FjaGUocmVmZXJlbmNlKTtcbiAgICAgICAgICAgIGlmIChjYWNoZS5wZWVrKCkpIHtcbiAgICAgICAgICAgICAgICBzdXBlci5ldmFsdWF0ZSh2bSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2bS51cGRhdGVXaXRoKG5ldyBBc3NlcnQoY2FjaGUpKTtcbiAgICAgICAgfVxuICAgIH1cbn1cbmV4cG9ydCBjbGFzcyBKdW1wVW5sZXNzT3Bjb2RlIGV4dGVuZHMgSnVtcE9wY29kZSB7XG4gICAgY29uc3RydWN0b3IoKSB7XG4gICAgICAgIHN1cGVyKC4uLmFyZ3VtZW50cyk7XG4gICAgICAgIHRoaXMudHlwZSA9IFwianVtcC11bmxlc3NcIjtcbiAgICB9XG4gICAgZXZhbHVhdGUodm0pIHtcbiAgICAgICAgbGV0IHJlZmVyZW5jZSA9IHZtLmZyYW1lLmdldENvbmRpdGlvbigpO1xuICAgICAgICBpZiAoaXNDb25zdChyZWZlcmVuY2UpKSB7XG4gICAgICAgICAgICBpZiAoIXJlZmVyZW5jZS52YWx1ZSgpKSB7XG4gICAgICAgICAgICAgICAgc3VwZXIuZXZhbHVhdGUodm0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgbGV0IGNhY2hlID0gbmV3IFJlZmVyZW5jZUNhY2hlKHJlZmVyZW5jZSk7XG4gICAgICAgICAgICBpZiAoIWNhY2hlLnBlZWsoKSkge1xuICAgICAgICAgICAgICAgIHN1cGVyLmV2YWx1YXRlKHZtKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZtLnVwZGF0ZVdpdGgobmV3IEFzc2VydChjYWNoZSkpO1xuICAgICAgICB9XG4gICAgfVxufVxuZXhwb3J0IGNsYXNzIEFzc2VydCBleHRlbmRzIFVwZGF0aW5nT3Bjb2RlIHtcbiAgICBjb25zdHJ1Y3RvcihjYWNoZSkge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLnR5cGUgPSBcImFzc2VydFwiO1xuICAgICAgICB0aGlzLnRhZyA9IGNhY2hlLnRhZztcbiAgICAgICAgdGhpcy5jYWNoZSA9IGNhY2hlO1xuICAgIH1cbiAgICBldmFsdWF0ZSh2bSkge1xuICAgICAgICBsZXQgeyBjYWNoZSB9ID0gdGhpcztcbiAgICAgICAgaWYgKGlzTW9kaWZpZWQoY2FjaGUucmV2YWxpZGF0ZSgpKSkge1xuICAgICAgICAgICAgdm0udGhyb3coKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICB0b0pTT04oKSB7XG4gICAgICAgIGxldCB7IHR5cGUsIF9ndWlkLCBjYWNoZSB9ID0gdGhpcztcbiAgICAgICAgbGV0IGV4cGVjdGVkO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgZXhwZWN0ZWQgPSBKU09OLnN0cmluZ2lmeShjYWNoZS5wZWVrKCkpO1xuICAgICAgICB9XG4gICAgICAgIGNhdGNoIChlKSB7XG4gICAgICAgICAgICBleHBlY3RlZCA9IFN0cmluZyhjYWNoZS5wZWVrKCkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBndWlkOiBfZ3VpZCxcbiAgICAgICAgICAgIHR5cGUsXG4gICAgICAgICAgICBhcmdzOiBbXSxcbiAgICAgICAgICAgIGRldGFpbHM6IHsgZXhwZWN0ZWQgfVxuICAgICAgICB9O1xuICAgIH1cbn1cbmV4cG9ydCBjbGFzcyBKdW1wSWZOb3RNb2RpZm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9IENPTlNUQU5UX1RBRztcbiAgICAgICAgdGhpcy50YXJnZXQgPSB0YXJnZXQ7XG4gICAgfVxuICAgIGV2YWx1YXRlKCkge1xuICAgICAgICB0aGlzLnRhcmdldC5kaWRNb2RpZnkoKTtcbiAgICB9XG59XG4iXX0= enifed('glimmer-runtime/lib/compiler', ['exports', 'glimmer-util', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-runtime/lib/compiled/expressions/function', 'glimmer-runtime/lib/compiled/opcodes/builder'], function (exports, _glimmerUtil, _glimmerRuntimeLibUtils, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibCompiledBlocks, _glimmerRuntimeLibCompiledExpressionsFunction, _glimmerRuntimeLibCompiledOpcodesBuilder) { 'use strict'; exports.compileLayout = compileLayout; var Compiler = (function () { function Compiler(block, env) { this.block = block; this.current = block.program.head(); this.env = env; this.symbolTable = block.symbolTable; } Compiler.prototype.compileStatement = function compileStatement(statement, ops) { this.env.statement(statement, this.symbolTable).compile(ops, this.env, this.symbolTable); }; return Compiler; })(); function compileStatement(env, statement, ops, layout) { env.statement(statement, layout.symbolTable).compile(ops, env, layout.symbolTable); } exports.default = Compiler; var EntryPointCompiler = (function (_Compiler) { babelHelpers.inherits(EntryPointCompiler, _Compiler); function EntryPointCompiler(template, env) { _Compiler.call(this, template, env); var list = new CompileIntoList(env, template.symbolTable); this.ops = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(list, template.symbolTable, env); } EntryPointCompiler.prototype.compile = function compile() { var block = this.block; var ops = this.ops; var program = block.program; var current = program.head(); while (current) { var next = program.nextNode(current); this.compileStatement(current, ops); current = next; } return ops.toOpSeq(); }; EntryPointCompiler.prototype.append = function append(op) { this.ops.append(op); }; EntryPointCompiler.prototype.getLocalSymbol = function getLocalSymbol(name) { return this.symbolTable.getLocal(name); }; EntryPointCompiler.prototype.getNamedSymbol = function getNamedSymbol(name) { return this.symbolTable.getNamed(name); }; EntryPointCompiler.prototype.getYieldSymbol = function getYieldSymbol(name) { return this.symbolTable.getYield(name); }; return EntryPointCompiler; })(Compiler); exports.EntryPointCompiler = EntryPointCompiler; var InlineBlockCompiler = (function (_Compiler2) { babelHelpers.inherits(InlineBlockCompiler, _Compiler2); function InlineBlockCompiler(block, env) { _Compiler2.call(this, block, env); var list = new CompileIntoList(env, block.symbolTable); this.ops = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(list, block.symbolTable, env); } InlineBlockCompiler.prototype.compile = function compile() { var block = this.block; var ops = this.ops; var program = block.program; if (block.hasPositionalParameters()) { ops.bindPositionalArgsForBlock(block); } var current = program.head(); while (current) { var next = program.nextNode(current); this.compileStatement(current, ops); current = next; } return ops.toOpSeq(); }; return InlineBlockCompiler; })(Compiler); exports.InlineBlockCompiler = InlineBlockCompiler; function compileLayout(compilable, env) { var builder = new ComponentLayoutBuilder(env); compilable.compile(builder); return builder.compile(); } var ComponentLayoutBuilder = (function () { function ComponentLayoutBuilder(env) { this.env = env; } ComponentLayoutBuilder.prototype.empty = function empty() { this.inner = new EmptyBuilder(this.env); }; ComponentLayoutBuilder.prototype.wrapLayout = function wrapLayout(layout) { this.inner = new WrappedBuilder(this.env, layout); }; ComponentLayoutBuilder.prototype.fromLayout = function fromLayout(layout) { this.inner = new UnwrappedBuilder(this.env, layout); }; ComponentLayoutBuilder.prototype.compile = function compile() { return this.inner.compile(); }; babelHelpers.createClass(ComponentLayoutBuilder, [{ key: 'tag', get: function () { return this.inner.tag; } }, { key: 'attrs', get: function () { return this.inner.attrs; } }]); return ComponentLayoutBuilder; })(); var EmptyBuilder = (function () { function EmptyBuilder(env) { this.env = env; } EmptyBuilder.prototype.compile = function compile() { var env = this.env; var list = new CompileIntoList(env, null); return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(list, 0); }; babelHelpers.createClass(EmptyBuilder, [{ key: 'tag', get: function () { throw new Error('Nope'); } }, { key: 'attrs', get: function () { throw new Error('Nope'); } }]); return EmptyBuilder; })(); var WrappedBuilder = (function () { function WrappedBuilder(env, layout) { this.tag = new ComponentTagBuilder(); this.attrs = new ComponentAttrsBuilder(); this.env = env; this.layout = layout; } WrappedBuilder.prototype.compile = function compile() { //========DYNAMIC // PutValue(TagExpr) // Test // JumpUnless(BODY) // OpenDynamicPrimitiveElement // DidCreateElement // ...attr statements... // FlushElement // BODY: Noop // ...body statements... // PutValue(TagExpr) // Test // JumpUnless(END) // CloseElement // END: Noop // DidRenderLayout // Exit // //========STATIC // OpenPrimitiveElementOpcode // DidCreateElement // ...attr statements... // FlushElement // ...body statements... // CloseElement // DidRenderLayout // Exit var env = this.env; var layout = this.layout; var symbolTable = layout.symbolTable; var buffer = new CompileIntoList(env, layout.symbolTable); var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, layout.symbolTable, env); dsl.startLabels(); if (this.tag.isDynamic) { dsl.putValue(this.tag.dynamicTagName); dsl.test('simple'); dsl.jumpUnless('BODY'); dsl.openDynamicPrimitiveElement(); dsl.didCreateElement(); this.attrs['buffer'].forEach(function (statement) { return compileStatement(env, statement, dsl, layout); }); dsl.flushElement(); dsl.label('BODY'); } else if (this.tag.isStatic) { var tag = this.tag.staticTagName; dsl.openPrimitiveElement(tag); dsl.didCreateElement(); this.attrs['buffer'].forEach(function (statement) { return compileStatement(env, statement, dsl, layout); }); dsl.flushElement(); } if (layout.hasNamedParameters()) { dsl.bindNamedArgsForLayout(layout); } if (layout.hasYields()) { dsl.bindBlocksForLayout(layout); } layout.program.forEachNode(function (statement) { return compileStatement(env, statement, dsl, layout); }); if (this.tag.isDynamic) { dsl.putValue(this.tag.dynamicTagName); dsl.test('simple'); dsl.jumpUnless('END'); dsl.closeElement(); dsl.label('END'); } else if (this.tag.isStatic) { dsl.closeElement(); } dsl.didRenderLayout(); dsl.stopLabels(); return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(dsl.toOpSeq(), symbolTable.size); }; return WrappedBuilder; })(); var UnwrappedBuilder = (function () { function UnwrappedBuilder(env, layout) { this.attrs = new ComponentAttrsBuilder(); this.env = env; this.layout = layout; } UnwrappedBuilder.prototype.compile = function compile() { var env = this.env; var layout = this.layout; var buffer = new CompileIntoList(env, layout.symbolTable); var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(buffer, layout.symbolTable, env); dsl.startLabels(); if (layout.hasNamedParameters()) { dsl.bindNamedArgsForLayout(layout); } if (layout.hasYields()) { dsl.bindBlocksForLayout(layout); } var attrs = this.attrs['buffer']; var attrsInserted = false; this.layout.program.forEachNode(function (statement) { if (!attrsInserted && isOpenElement(statement)) { dsl.openComponentElement(statement.tag); dsl.didCreateElement(); dsl.shadowAttributes(); attrs.forEach(function (statement) { return compileStatement(env, statement, dsl, layout); }); attrsInserted = true; } else { compileStatement(env, statement, dsl, layout); } }); dsl.didRenderLayout(); dsl.stopLabels(); return new _glimmerRuntimeLibCompiledBlocks.CompiledBlock(dsl.toOpSeq(), layout.symbolTable.size); }; babelHelpers.createClass(UnwrappedBuilder, [{ key: 'tag', get: function () { throw new Error('BUG: Cannot call `tag` on an UnwrappedBuilder'); } }]); return UnwrappedBuilder; })(); function isOpenElement(syntax) { return syntax instanceof _glimmerRuntimeLibSyntaxCore.OpenElement || syntax instanceof _glimmerRuntimeLibSyntaxCore.OpenPrimitiveElement; } var ComponentTagBuilder = (function () { function ComponentTagBuilder() { this.isDynamic = null; this.isStatic = null; this.staticTagName = null; this.dynamicTagName = null; } ComponentTagBuilder.prototype.static = function _static(tagName) { this.isStatic = true; this.staticTagName = tagName; }; ComponentTagBuilder.prototype.dynamic = function dynamic(tagName) { this.isDynamic = true; this.dynamicTagName = _glimmerRuntimeLibCompiledExpressionsFunction.default(tagName); }; return ComponentTagBuilder; })(); var ComponentAttrsBuilder = (function () { function ComponentAttrsBuilder() { this.buffer = []; } ComponentAttrsBuilder.prototype.static = function _static(name, value) { this.buffer.push(new _glimmerRuntimeLibSyntaxCore.StaticAttr({ name: name, value: value })); }; ComponentAttrsBuilder.prototype.dynamic = function dynamic(name, value) { this.buffer.push(new _glimmerRuntimeLibSyntaxCore.DynamicAttr({ name: name, value: _glimmerRuntimeLibCompiledExpressionsFunction.default(value), isTrusting: false })); }; return ComponentAttrsBuilder; })(); var ComponentBuilder = (function () { function ComponentBuilder(dsl) { this.dsl = dsl; this.env = dsl.env; } ComponentBuilder.prototype.static = function _static(definition, args, templates, symbolTable) { var shadow = arguments.length <= 4 || arguments[4] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[4]; this.dsl.unit({ templates: templates }, function (dsl) { dsl.putComponentDefinition(definition); dsl.openComponent(args, shadow); dsl.closeComponent(); }); }; ComponentBuilder.prototype.dynamic = function dynamic(definitionArgs, definition, args, templates, symbolTable) { var shadow = arguments.length <= 5 || arguments[5] === undefined ? _glimmerRuntimeLibUtils.EMPTY_ARRAY : arguments[5]; this.dsl.unit({ templates: templates }, function (dsl) { dsl.enter('BEGIN', 'END'); dsl.label('BEGIN'); dsl.putArgs(definitionArgs); dsl.putValue(_glimmerRuntimeLibCompiledExpressionsFunction.default(definition)); dsl.test('simple'); dsl.jumpUnless('END'); dsl.putDynamicComponentDefinition(); dsl.openComponent(args, shadow); dsl.closeComponent(); dsl.label('END'); dsl.exit(); }); }; return ComponentBuilder; })(); var CompileIntoList = (function (_LinkedList) { babelHelpers.inherits(CompileIntoList, _LinkedList); function CompileIntoList(env, symbolTable) { _LinkedList.call(this); this.env = env; this.symbolTable = symbolTable; var dsl = new _glimmerRuntimeLibCompiledOpcodesBuilder.default(this, symbolTable, env); this.component = new ComponentBuilder(dsl); } CompileIntoList.prototype.getLocalSymbol = function getLocalSymbol(name) { return this.symbolTable.getLocal(name); }; CompileIntoList.prototype.hasLocalSymbol = function hasLocalSymbol(name) { return typeof this.symbolTable.getLocal(name) === 'number'; }; CompileIntoList.prototype.getNamedSymbol = function getNamedSymbol(name) { return this.symbolTable.getNamed(name); }; CompileIntoList.prototype.hasNamedSymbol = function hasNamedSymbol(name) { return typeof this.symbolTable.getNamed(name) === 'number'; }; CompileIntoList.prototype.getBlockSymbol = function getBlockSymbol(name) { return this.symbolTable.getYield(name); }; CompileIntoList.prototype.hasBlockSymbol = function hasBlockSymbol(name) { return typeof this.symbolTable.getYield(name) === 'number'; }; CompileIntoList.prototype.toOpSeq = function toOpSeq() { return this; }; return CompileIntoList; })(_glimmerUtil.LinkedList); exports.CompileIntoList = CompileIntoList; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcGlsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7UUFrQ0EsUUFBQTtBQU1FLGlCQU5GLFFBQUEsQ0FNYyxLQUFZLEVBQUUsR0FBZ0IsRUFBQTtBQUN4QyxnQkFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7QUFDbkIsZ0JBQUksQ0FBQyxPQUFPLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsQ0FBQztBQUNwQyxnQkFBSSxDQUFDLEdBQUcsR0FBRyxHQUFHLENBQUM7QUFDZixnQkFBSSxDQUFDLFdBQVcsR0FBRyxLQUFLLENBQUMsV0FBVyxDQUFDO1NBQ3RDOztBQVhILGdCQUFBLFdBYVksZ0JBQWdCLEdBQUEsMEJBQUMsU0FBMEIsRUFBRSxHQUFxQixFQUFBO0FBQzFFLGdCQUFJLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxTQUFTLEVBQUUsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsV0FBVyxDQUFDLENBQUM7U0FDMUY7O2VBZkgsUUFBQTs7O0FBa0JBLGFBQUEsZ0JBQUEsQ0FBMEIsR0FBZ0IsRUFBRSxTQUEwQixFQUFFLEdBQXFCL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0QmxvY2tTeW1ib2wobmFtZTogc3RyaW5nKTogbnVtYmVyIHtcbiAgICByZXR1cm4gdGhpcy5zeW1ib2xUYWJsZS5nZXRZaWVsZChuYW1lKTtcbiAgfVxuXG4gIGhhc0Jsb2NrU3ltYm9sKG5hbWU6IHN0cmluZyk6IGJvb2xlYW4ge1xuICAgIHJldHVybiB0eXBlb2YgdGhpcy5zeW1ib2xUYWJsZS5nZXRZaWVsZChuYW1lKSA9PT0gJ251bWJlcic7XG4gIH1cblxuICB0b09wU2VxKCk6IE9wU2VxIHtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/component/interfaces', ['exports'], function (exports) { 'use strict'; exports.isComponentDefinition = isComponentDefinition; var COMPONENT_DEFINITION_BRAND = 'COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]'; function isComponentDefinition(obj) { return typeof obj === 'object' && obj && obj[COMPONENT_DEFINITION_BRAND]; } var ComponentDefinition = function ComponentDefinition(name, manager, ComponentClass) { this['COMPONENT DEFINITION [id=e59c754e-61eb-4392-8c4a-2c0ac72bfcd4]'] = true; this.name = name; this.manager = manager; this.ComponentClass = ComponentClass; }; exports.ComponentDefinition = ComponentDefinition; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvY29tcG9uZW50L2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQXFHQSxRQUFNLDBCQUEwQixHQUFHLGdFQUFnRSxDQUFDOztBQUU5RixhQUFBLHFCQUFBLENBQWdDLEdBQVEsRUFBQTtBQUM1QyxlQUFPLE9BQU8sR0FBRyxLQUFLLFFBQVEsSUFBSSxHQUFHLElBQUksR0FBRyxDQUFDLDBCQUEwQixDQUFDLENBQUM7S0FDMUU7O1FBRUssbUJBQUEsR0FPSixTQVBJLG1CQUFBLENBT1EsSUFBWS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pc0NvbXBvbmVudERlZmluaXRpb24ob2JqOiBhbnkpOiBvYmogaXMgQ29tcG9uZW50RGVmaW5pdGlvbjxPcGFxdWU+IHtcbiAgcmV0dXJuIHR5cGVvZiBvYmogPT09ICdvYmplY3QnICYmIG9iaiAmJiBvYmpbQ09NUE9ORU5UX0RFRklOSVRJT05fQlJBTkRdO1xufVxuXG5leHBvcnQgYWJzdHJhY3QgY2xhc3MgQ29tcG9uZW50RGVmaW5pdGlvbjxUPiB7XG4gIHB1YmxpYyBuYW1lOiBzdHJpbmc7IC8vIGZvciBkZWJ1Z2dpbmdcbiAgcHVibGljIG1hbmFnZXI6IENvbXBvbmVudE1hbmFnZXI8VD47XG4gIHB1YmxpYyBDb21wb25lbnRDbGFzczogQ29tcG9uZW50Q2xhc3M7XG5cbiAgcHJpdmF0ZSBbJ0NPTVBPTkVOVCBERUZJTklUSU9OIFtpZD1lNTljNzU0ZS02MWViLTQzOTItOGM0YS0yYzBhYzcyYmZjZDRdJ10gPSB0cnVlO1xuXG4gIGNvbnN0cnVjdG9yKG5hbWU6IHN0cmluZywgbWFuYWdlcjogQ29tcG9uZW50TWFuYWdlcjxUPiwgQ29tcG9uZW50Q2xhc3M6IENvbXBvbmVudENsYXNzKSB7XG4gICAgdGhpcy5uYW1lID0gbmFtZTtcbiAgICB0aGlzLm1hbmFnZXIgPSBtYW5hZ2VyO1xuICAgIHRoaXMuQ29tcG9uZW50Q2xhc3MgPSBDb21wb25lbnRDbGFzcztcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/dom/change-lists', ['exports', 'glimmer-runtime/lib/dom/sanitized-values', 'glimmer-runtime/lib/dom/props', 'glimmer-runtime/lib/dom/helper', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibDomSanitizedValues, _glimmerRuntimeLibDomProps, _glimmerRuntimeLibDomHelper, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; exports.defaultChangeLists = defaultChangeLists; exports.defaultPropertyChangeLists = defaultPropertyChangeLists; exports.defaultAttributeChangeLists = defaultAttributeChangeLists; exports.readDOMAttr = readDOMAttr; function defaultChangeLists(element, attr, isTrusting, namespace) { var tagName = element.tagName; var isSVG = element.namespaceURI === _glimmerRuntimeLibDomHelper.SVG_NAMESPACE; if (isSVG) { return defaultAttributeChangeLists(tagName, attr); } var _normalizeProperty = _glimmerRuntimeLibDomProps.normalizeProperty(element, attr); var type = _normalizeProperty.type; if (type === 'attr') { return defaultAttributeChangeLists(tagName, attr); } else { return defaultPropertyChangeLists(tagName, attr); } } function defaultPropertyChangeLists(tagName, attr) { if (_glimmerRuntimeLibDomSanitizedValues.requiresSanitization(tagName, attr)) { return SafeHrefPropertyChangeList; } if (isUserInputValue(tagName, attr)) { return InputValuePropertyChangeList; } if (isOptionSelected(tagName, attr)) { return OptionSelectedChangeList; } return PropertyChangeList; } function defaultAttributeChangeLists(tagName, attr) { if (_glimmerRuntimeLibDomSanitizedValues.requiresSanitization(tagName, attr)) { return SafeHrefAttributeChangeList; } return AttributeChangeList; } function readDOMAttr(element, attr) { var isSVG = element.namespaceURI === _glimmerRuntimeLibDomHelper.SVG_NAMESPACE; var _normalizeProperty2 = _glimmerRuntimeLibDomProps.normalizeProperty(element, attr); var type = _normalizeProperty2.type; var normalized = _normalizeProperty2.normalized; if (isSVG) { return element.getAttribute(normalized); } if (type === 'attr') { return element.getAttribute(normalized); } { return element[normalized]; } } ; var PropertyChangeList = { setAttribute: function (env, element, attr, value, namespace) { if (value !== null) { var normalized = attr.toLowerCase(); element[normalized] = _glimmerRuntimeLibDomProps.normalizePropertyValue(value); // TODO: This doesn't work } }, updateAttribute: function (env, element, attr, value, namespace) { if (value === null) { var normalized = attr.toLowerCase(); element[normalized] = value; } else { this.setAttribute.apply(this, arguments); } } }; exports.PropertyChangeList = PropertyChangeList; var AttributeChangeList = new ((function () { function _class() {} _class.prototype.setAttribute = function setAttribute(env, element, attr, value, namespace) { var dom = env.getAppendOperations(); if (value !== null && value !== undefined) { dom.setAttribute(element, attr, _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value), namespace); } }; _class.prototype.updateAttribute = function updateAttribute(env, element, attr, value, namespace) { if (value === null) { if (namespace) { env.getDOM().removeAttributeNS(element, namespace, attr); } else { env.getDOM().removeAttribute(element, attr); } } else { this.setAttribute(env, element, attr, value); } }; return _class; })())(); exports.AttributeChangeList = AttributeChangeList; function isUserInputValue(tagName, attribute) { return (tagName === 'INPUT' || tagName === 'TEXTAREA') && attribute === 'value'; } var InputValuePropertyChangeList = new ((function () { function _class2() {} _class2.prototype.setAttribute = function setAttribute(env, element, attr, value) { var input = element; input.value = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); }; _class2.prototype.updateAttribute = function updateAttribute(env, element, attr, value) { var input = element; var currentValue = input.value; var normalizedValue = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); if (currentValue !== normalizedValue) { input.value = normalizedValue; } }; return _class2; })())(); exports.InputValuePropertyChangeList = InputValuePropertyChangeList; function isOptionSelected(tagName, attribute) { return tagName === 'OPTION' && attribute === 'selected'; } var OptionSelectedChangeList = new ((function () { function _class3() {} _class3.prototype.setAttribute = function setAttribute(env, element, attr, value) { if (value !== null && value !== undefined && value !== false) { env.getAppendOperations().setAttribute(element, 'selected', ''); } }; _class3.prototype.updateAttribute = function updateAttribute(env, element, attr, value) { var option = element; if (value === null || value === undefined || value === false) { option.selected = false; } else { option.selected = true; } }; return _class3; })())(); exports.OptionSelectedChangeList = OptionSelectedChangeList; var SafeHrefPropertyChangeList = new ((function () { function _class4() {} _class4.prototype.setAttribute = function setAttribute(env, element, attr, value) { var tree = env.getAppendOperations(); PropertyChangeList.setAttribute(env, element, attr, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, attr, value)); }; _class4.prototype.updateAttribute = function updateAttribute(env, element, attr, value) { this.setAttribute(env, element, attr, value); }; return _class4; })())(); exports.SafeHrefPropertyChangeList = SafeHrefPropertyChangeList; var SafeHrefAttributeChangeList = new ((function () { function _class5() {} _class5.prototype.setAttribute = function setAttribute(env, element, attr, value) { AttributeChangeList.setAttribute(env, element, attr, _glimmerRuntimeLibDomSanitizedValues.sanitizeAttributeValue(env, element, attr, value)); }; _class5.prototype.updateAttribute = function updateAttribute(env, element, attr, value) { this.setAttribute(env, element, attr, value); }; return _class5; })())(); exports.SafeHrefAttributeChangeList = SafeHrefAttributeChangeList; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2NoYW5nZS1saXN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQWlCTSxhQUFBLGtCQUFBLENBQTZCLE9BQXVCLEVBQUUsSUFBWSxFQUFFLFVBQW1CLEVBQUUsU0FBaUIsRUFBQTtBQUM5RyxZQUFJLE9BQU8sR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDO0FBQzlCLFlBQUksS0FBSyxHQUFHLE9BQU8sQ0FBQyxZQUFZLGlDQVh6QixhQUFhLEFBVzhCLENBQUM7QUFFbkQsWUFBSSxLQUFLLEVBQUU7QUFDVCxtQkFBTywyQkFBMkIsQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7U0FDbkQ7O2lDQUVjLDJCQWxCUixpQkFBaUIsQ0FrQlMsT0FBTyxFQUFFLElBQUksQ0FBQzs7WUFBekMsSUFBSSxzQkFBSixJQUFJOztBQUVWLFlBQUksSUFBSSxLQUFLLE1BQU0sRUFBRTtBQUNuQixtQkFBTywyQkFBMkIsQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7U0FDbkQsTUFBTTtBQUNMLG1CQUFPLDBCQUEwQixDQUFDLE9BQU8sRUFBRSxJQUFJLENBQUMsQ0FBQztTQUNsRDtLQUNGOztBQUVLLGFBQUEsMEJBQUEsQ0FBcUMsT0FBZSxFQUFFLElBQVksRUFBQTtBQ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HNhbml0aXplQXR0cmlidXRlVmFsdWUoZW52LCBlbGVtZW50LCBhdHRyLCB2YWx1ZSkpO1xuICB9XG5cbiAgdXBkYXRlQXR0cmlidXRlKGVudjogRW52aXJvbm1lbnQsIGVsZW1lbnQ6IEVsZW1lbnQsIGF0dHI6IHN0cmluZywgdmFsdWU6IE9wYXF1ZSkge1xuICAgIHRoaXMuc2V0QXR0cmlidXRlKGVudiwgZWxlbWVudCwgYXR0ciwgdmFsdWUpO1xuICB9XG59O1xuXG5leHBvcnQgY29uc3QgU2FmZUhyZWZBdHRyaWJ1dGVDaGFuZ2VMaXN0OiBJQ2hhbmdlTGlzdCA9IG5ldyBjbGFzcyB7XG4gIHNldEF0dHJpYnV0ZShlbnY6IEVudmlyb25tZW50LCBlbGVtZW50OiBFbGVtZW50LCBhdHRyOiBzdHJpbmcsIHZhbHVlOiBPcGFxdWUpIHtcbiAgICBBdHRyaWJ1dGVDaGFuZ2VMaXN0LnNldEF0dHJpYnV0ZShlbnYsIGVsZW1lbnQsIGF0dHIsIHNhbml0aXplQXR0cmlidXRlVmFsdWUoZW52LCBlbGVtZW50LCBhdHRyLCB2YWx1ZSkpO1xuICB9XG5cbiAgdXBkYXRlQXR0cmlidXRlKGVudjogRW52aXJvbm1lbnQsIGVsZW1lbnQ6IEVsZW1lbnQsIGF0dHI6IHN0cmluZywgdmFsdWU6IE9wYXF1ZSkge1xuICAgIHRoaXMuc2V0QXR0cmlidXRlKGVudiwgZWxlbWVudCwgYXR0ciwgdmFsdWUpO1xuICB9XG59O1xuIl19 enifed('glimmer-runtime/lib/dom/helper', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/compat/inner-html-fix', 'glimmer-runtime/lib/compat/svg-inner-html-fix', 'glimmer-runtime/lib/compat/text-node-merging-fix', 'glimmer-runtime/lib/dom/interfaces'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibCompatInnerHtmlFix, _glimmerRuntimeLibCompatSvgInnerHtmlFix, _glimmerRuntimeLibCompatTextNodeMergingFix, _glimmerRuntimeLibDomInterfaces) { 'use strict'; exports.isWhitespace = isWhitespace; exports.moveNodesBefore = moveNodesBefore; exports.insertHTMLBefore = _insertHTMLBefore; var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; exports.SVG_NAMESPACE = SVG_NAMESPACE; // http://www.w3.org/TR/html/syntax.html#html-integration-point var SVG_INTEGRATION_POINTS = { foreignObject: 1, desc: 1, title: 1 }; // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes // TODO: Adjust SVG attributes // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign // TODO: Adjust SVG elements // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign var BLACKLIST_TABLE = Object.create(null); exports.BLACKLIST_TABLE = BLACKLIST_TABLE; ["b", "big", "blockquote", "body", "br", "center", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "head", "hr", "i", "img", "li", "listing", "main", "meta", "nobr", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "strike", "sub", "sup", "table", "tt", "u", "ul", "var"].forEach(function (tag) { return BLACKLIST_TABLE[tag] = 1; }); var WHITESPACE = /[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/; var doc = typeof document === 'undefined' ? undefined : document; function isWhitespace(string) { return WHITESPACE.test(string); } function moveNodesBefore(source, target, nextSibling) { var first = source.firstChild; var last = null; var current = first; while (current) { last = current; current = current.nextSibling; target.insertBefore(last, nextSibling); } return [first, last]; } var DOM; (function (DOM) { var TreeConstruction = (function () { function TreeConstruction(document) { this.document = document; this.uselessElement = null; this.setupUselessElement(); } TreeConstruction.prototype.setupUselessElement = function setupUselessElement() { this.uselessElement = this.document.createElement('div'); }; TreeConstruction.prototype.createElement = function createElement(tag, context) { var isElementInSVGNamespace = undefined, isHTMLIntegrationPoint = undefined; if (context) { isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg'; isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName]; } else { isElementInSVGNamespace = tag === 'svg'; isHTMLIntegrationPoint = false; } if (isElementInSVGNamespace && !isHTMLIntegrationPoint) { // FIXME: This does not properly handle with color, face, or // size attributes, which is also disallowed by the spec. We should fix // this. if (BLACKLIST_TABLE[tag]) { throw new Error('Cannot create a ' + tag + ' inside an SVG context'); } return this.document.createElementNS(SVG_NAMESPACE, tag); } else { return this.document.createElement(tag); } }; TreeConstruction.prototype.createElementNS = function createElementNS(namespace, tag) { return this.document.createElementNS(namespace, tag); }; TreeConstruction.prototype.setAttribute = function setAttribute(element, name, value, namespace) { if (namespace) { element.setAttributeNS(namespace, name, value); } else { element.setAttribute(name, value); } }; TreeConstruction.prototype.createTextNode = function createTextNode(text) { return this.document.createTextNode(text); }; TreeConstruction.prototype.createComment = function createComment(data) { return this.document.createComment(data); }; TreeConstruction.prototype.insertBefore = function insertBefore(parent, node, reference) { parent.insertBefore(node, reference); }; TreeConstruction.prototype.insertHTMLBefore = function insertHTMLBefore(parent, html, reference) { return _insertHTMLBefore(this.uselessElement, parent, reference, html); }; return TreeConstruction; })(); var appliedTreeContruction = TreeConstruction; appliedTreeContruction = _glimmerRuntimeLibCompatTextNodeMergingFix.treeConstruction(doc, appliedTreeContruction); appliedTreeContruction = _glimmerRuntimeLibCompatInnerHtmlFix.treeConstruction(doc, appliedTreeContruction); appliedTreeContruction = _glimmerRuntimeLibCompatSvgInnerHtmlFix.treeConstruction(doc, appliedTreeContruction, SVG_NAMESPACE); DOM.DOMTreeConstruction = appliedTreeContruction; })(DOM || (DOM = {})); var DOMChanges = (function () { function DOMChanges(document) { this.document = document; this.uselessElement = null; this.namespace = null; this.uselessElement = this.document.createElement('div'); } DOMChanges.prototype.setAttribute = function setAttribute(element, name, value) { element.setAttribute(name, value); }; DOMChanges.prototype.setAttributeNS = function setAttributeNS(element, namespace, name, value) { element.setAttributeNS(namespace, name, value); }; DOMChanges.prototype.removeAttribute = function removeAttribute(element, name) { element.removeAttribute(name); }; DOMChanges.prototype.removeAttributeNS = function removeAttributeNS(element, namespace, name) { element.removeAttributeNS(namespace, name); }; DOMChanges.prototype.createTextNode = function createTextNode(text) { return this.document.createTextNode(text); }; DOMChanges.prototype.createComment = function createComment(data) { return this.document.createComment(data); }; DOMChanges.prototype.createElement = function createElement(tag, context) { var isElementInSVGNamespace = undefined, isHTMLIntegrationPoint = undefined; if (context) { isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg'; isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName]; } else { isElementInSVGNamespace = tag === 'svg'; isHTMLIntegrationPoint = false; } if (isElementInSVGNamespace && !isHTMLIntegrationPoint) { // FIXME: This does not properly handle with color, face, or // size attributes, which is also disallowed by the spec. We should fix // this. if (BLACKLIST_TABLE[tag]) { throw new Error('Cannot create a ' + tag + ' inside an SVG context'); } return this.document.createElementNS(SVG_NAMESPACE, tag); } else { return this.document.createElement(tag); } }; DOMChanges.prototype.insertHTMLBefore = function insertHTMLBefore(_parent, nextSibling, html) { return _insertHTMLBefore(this.uselessElement, _parent, nextSibling, html); }; DOMChanges.prototype.insertNodeBefore = function insertNodeBefore(parent, node, reference) { if (isDocumentFragment(node)) { var firstChild = node.firstChild; var lastChild = node.lastChild; this.insertBefore(parent, node, reference); return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, firstChild, lastChild); } else { this.insertBefore(parent, node, reference); return new _glimmerRuntimeLibBounds.SingleNodeBounds(parent, node); } }; DOMChanges.prototype.insertTextBefore = function insertTextBefore(parent, nextSibling, text) { var textNode = this.createTextNode(text); this.insertBefore(parent, textNode, nextSibling); return textNode; }; DOMChanges.prototype.insertBefore = function insertBefore(element, node, reference) { element.insertBefore(node, reference); }; DOMChanges.prototype.insertAfter = function insertAfter(element, node, reference) { this.insertBefore(element, node, reference.nextSibling); }; return DOMChanges; })(); exports.DOMChanges = DOMChanges; function _insertHTMLBefore(_useless, _parent, _nextSibling, html) { // TypeScript vendored an old version of the DOM spec where `insertAdjacentHTML` // only exists on `HTMLElement` but not on `Element`. We actually work with the // newer version of the DOM API here (and monkey-patch this method in `./compat` // when we detect older browsers). This is a hack to work around this limitation. var parent = _parent; var useless = _useless; var nextSibling = _nextSibling; var prev = nextSibling ? nextSibling.previousSibling : parent.lastChild; var last = undefined; if (html === null || html === '') { return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, null, null); } if (nextSibling === null) { parent.insertAdjacentHTML('beforeEnd', html); last = parent.lastChild; } else if (nextSibling instanceof HTMLElement) { nextSibling.insertAdjacentHTML('beforeBegin', html); last = nextSibling.previousSibling; } else { // Non-element nodes do not support insertAdjacentHTML, so add an // element and call it on that element. Then remove the element. // // This also protects Edge, IE and Firefox w/o the inspector open // from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts parent.insertBefore(useless, nextSibling); useless.insertAdjacentHTML('beforeBegin', html); last = useless.previousSibling; parent.removeChild(useless); } var first = prev ? prev.nextSibling : parent.firstChild; return new _glimmerRuntimeLibBounds.ConcreteBounds(parent, first, last); } function isDocumentFragment(node) { return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE; } var helper = DOMChanges; helper = _glimmerRuntimeLibCompatTextNodeMergingFix.domChanges(doc, helper); helper = _glimmerRuntimeLibCompatInnerHtmlFix.domChanges(doc, helper); helper = _glimmerRuntimeLibCompatSvgInnerHtmlFix.domChanges(doc, helper, SVG_NAMESPACE); exports.default = helper; var DOMTreeConstruction = DOM.DOMTreeConstruction; exports.DOMTreeConstruction = DOMTreeConstruction; exports.DOMNamespace = _glimmerRuntimeLibDomInterfaces.Namespace; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2hlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFlTyxRQUFNLGFBQWEsR0FBRyw0QkFBNEIsQ0FBQz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b3J0IHR5cGUgRE9NVHJlZUNvbnN0cnVjdGlvbiA9IERPTS5ET01UcmVlQ29uc3RydWN0aW9uO1xuZXhwb3J0IHsgTmFtZXNwYWNlIGFzIERPTU5hbWVzcGFjZSB9IGZyb20gJy4vaW50ZXJmYWNlcyc7XG4iXX0= enifed("glimmer-runtime/lib/dom/interface", ["exports"], function (exports) { "use strict"; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2ludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwiZmlsZSI6ImludGVyZmFjZS5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0= enifed("glimmer-runtime/lib/dom/interfaces", ["exports"], function (exports) { "use strict"; var NodeType; (function (NodeType) { NodeType[NodeType["Element"] = 0] = "Element"; NodeType[NodeType["Attribute"] = 1] = "Attribute"; NodeType[NodeType["Text"] = 2] = "Text"; NodeType[NodeType["CdataSection"] = 3] = "CdataSection"; NodeType[NodeType["EntityReference"] = 4] = "EntityReference"; NodeType[NodeType["Entity"] = 5] = "Entity"; NodeType[NodeType["ProcessingInstruction"] = 6] = "ProcessingInstruction"; NodeType[NodeType["Comment"] = 7] = "Comment"; NodeType[NodeType["Document"] = 8] = "Document"; NodeType[NodeType["DocumentType"] = 9] = "DocumentType"; NodeType[NodeType["DocumentFragment"] = 10] = "DocumentFragment"; NodeType[NodeType["Notation"] = 11] = "Notation"; })(NodeType || (NodeType = {})); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBV0EsUUFBSyxRQWFKLENBQUE7QUFiRCxLQUFBLFVBQUssUUFBUSxFQUFBO0FBQ1gsZ0JBQUEsQ0FBQSxRQUFBLENBQUE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hbWU6IHN0cmluZyk6IHZvaWQ7XG4gIHJlbW92ZUF0dHJpYnV0ZU5TKG5hbWVzcGFjZVVSSTogc3RyaW5nLCBuYW1lOiBzdHJpbmcpO1xuICBzZXRBdHRyaWJ1dGUobmFtZTogc3RyaW5nLCB2YWx1ZTogc3RyaW5nKTogdm9pZDtcbiAgc2V0QXR0cmlidXRlTlMobmFtZXNwYWNlVVJJOiBzdHJpbmcsIHF1YWxpZmllZE5hbWU6IHN0cmluZywgdmFsdWU6IHN0cmluZyk6IHZvaWQ7XG4gIGluc2VydEJlZm9yZShub2RlOiBOb2RlLCByZWZlcmVuY2U6IE5vZGUpOiB2b2lkO1xuICByZW1vdmVDaGlsZChub2RlOiBOb2RlKTogdm9pZDtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBTVkdFbGVtZW50IGV4dGVuZHMgRWxlbWVudCB7fVxuXG5leHBvcnQgaW50ZXJmYWNlIEhUTUxFbGVtZW50IGV4dGVuZHMgRWxlbWVudCB7fVxuIl19 enifed('glimmer-runtime/lib/dom/props', ['exports'], function (exports) { /* * @method normalizeProperty * @param element {HTMLElement} * @param slotName {String} * @returns {Object} { name, type } */ /* * @method normalizeProperty * @param element {HTMLElement} * @param slotName {String} * @returns {Object} { name, type } */'use strict'; exports.normalizeProperty = normalizeProperty; exports.normalizePropertyValue = normalizePropertyValue; function normalizeProperty(element, slotName) { var type = undefined, normalized = undefined; if (slotName in element) { normalized = slotName; type = 'prop'; } else { var lower = slotName.toLowerCase(); if (lower in element) { type = 'prop'; normalized = lower; } else { type = 'attr'; normalized = slotName; } } if (type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName, normalized))) { type = 'attr'; } return { normalized: normalized, type: type }; } function normalizePropertyValue(value) { if (value === '') { return true; } return value; } // properties that MUST be set as attributes, due to: // * browser bug // * strange spec outlier var ATTR_OVERRIDES = { // phantomjs < 2.0 lets you set it as a prop but won't reflect it // back to the attribute. button.getAttribute('type') === null BUTTON: { type: true, form: true }, INPUT: { // Some version of IE (like IE9) actually throw an exception // if you set input.type = 'something-unknown' type: true, form: true, // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false // Safari 8.0.7: 'autocorrect' in document.createElement('input') === false // Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true autocorrect: true }, // element.form is actually a legitimate readOnly property, that is to be // mutated, but must be mutated by setAttribute... SELECT: { form: true }, OPTION: { form: true }, TEXTAREA: { form: true }, LABEL: { form: true }, FIELDSET: { form: true }, LEGEND: { form: true }, OBJECT: { form: true } }; function preferAttr(tagName, propName) { var tag = ATTR_OVERRIDES[tagName.toUpperCase()]; return tag && tag[propName.toLowerCase()] || false; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Byb3BzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBTU0sYUFBQSxpQkFBQSxDQUE0QixPQUFPLEVBQUUsUUFBUSxFQUFBO0FBQ2pELFlBQUksSUFBSSxZQUFBO1lBQUUsVUFBVSxZQUFBLENBQUM7QUFFckIsWUFBSSxRQUFRLElBQUksT0FBTyxFQUFFO0FBQ3ZCLHNCQUFVLEdBQUcsUUFBUSxDQUFDO0FBQ3RCLGdCQUFJLEdBQUcsTUFBTSxDQUFDO1NBQ2YsTUFBTTtBQUNMLGdCQUFJLEtBQUssR0FBRyxRQUFRLENBQUMsV0FBVyxFQUFFLENBQUM7QUFDbkMsZ0JBQUksS0FBSyxJQUFJLE9BQU8sRUFBRTtBQUNwQixvQkFBSSxHQUFHLE1BQU0sQ0FBQztBQUNkLDBCQUFVLEdBQUcsS0FBSyxDQUFDO2FBQ3BCLE1BQU07QUFDTCxvQkFBSSxHQUFHLE1BQU0sQ0FBQztBQUNkLDBCQUFVLEdBQUcsUUFBUSxDQUFDO2FBQ3ZCO1NBQ0Y7QUFF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PT0gZmFsc2VcbiAgICAvLyBTYWZhcmkgOC4wLjc6ICdhdXRvY29ycmVjdCcgaW4gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaW5wdXQnKSA9PT0gZmFsc2VcbiAgICAvLyBNb2JpbGUgU2FmYXJpIChpT1MgOC40IHNpbXVsYXRvcik6ICdhdXRvY29ycmVjdCcgaW4gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaW5wdXQnKSA9PT0gdHJ1ZVxuICAgIGF1dG9jb3JyZWN0OiB0cnVlXG4gIH0sXG5cbiAgLy8gZWxlbWVudC5mb3JtIGlzIGFjdHVhbGx5IGEgbGVnaXRpbWF0ZSByZWFkT25seSBwcm9wZXJ0eSwgdGhhdCBpcyB0byBiZVxuICAvLyBtdXRhdGVkLCBidXQgbXVzdCBiZSBtdXRhdGVkIGJ5IHNldEF0dHJpYnV0ZS4uLlxuICBTRUxFQ1Q6ICAgeyBmb3JtOiB0cnVlIH0sXG4gIE9QVElPTjogICB7IGZvcm06IHRydWUgfSxcbiAgVEVYVEFSRUE6IHsgZm9ybTogdHJ1ZSB9LFxuICBMQUJFTDogICAgeyBmb3JtOiB0cnVlIH0sXG4gIEZJRUxEU0VUOiB7IGZvcm06IHRydWUgfSxcbiAgTEVHRU5EOiAgIHsgZm9ybTogdHJ1ZSB9LFxuICBPQkpFQ1Q6ICAgeyBmb3JtOiB0cnVlIH1cbn07XG5cbmZ1bmN0aW9uIHByZWZlckF0dHIodGFnTmFtZSwgcHJvcE5hbWUpIHtcbiAgbGV0IHRhZyA9IEFUVFJfT1ZFUlJJREVTW3RhZ05hbWUudG9VcHBlckNhc2UoKV07XG4gIHJldHVybiB0YWcgJiYgdGFnW3Byb3BOYW1lLnRvTG93ZXJDYXNlKCldIHx8IGZhbHNlO1xufVxuIl19 enifed('glimmer-runtime/lib/dom/sanitized-values', ['exports', 'glimmer-runtime/lib/compiled/opcodes/content', 'glimmer-runtime/lib/upsert'], function (exports, _glimmerRuntimeLibCompiledOpcodesContent, _glimmerRuntimeLibUpsert) { 'use strict'; exports.requiresSanitization = requiresSanitization; exports.sanitizeAttributeValue = sanitizeAttributeValue; var badProtocols = ['javascript:', 'vbscript:']; var badTags = ['A', 'BODY', 'LINK', 'IMG', 'IFRAME', 'BASE', 'FORM']; var badTagsForDataURI = ['EMBED']; var badAttributes = ['href', 'src', 'background', 'action']; exports.badAttributes = badAttributes; var badAttributesForDataURI = ['src']; function has(array, item) { return array.indexOf(item) !== -1; } function checkURI(tagName, attribute) { return (tagName === null || has(badTags, tagName)) && has(badAttributes, attribute); } function checkDataURI(tagName, attribute) { return has(badTagsForDataURI, tagName) && has(badAttributesForDataURI, attribute); } function requiresSanitization(tagName, attribute) { return checkURI(tagName, attribute) || checkDataURI(tagName, attribute); } function sanitizeAttributeValue(env, element, attribute, value) { var tagName = undefined; if (_glimmerRuntimeLibUpsert.isSafeString(value)) { return value.toHTML(); } if (!element) { tagName = null; } else { tagName = element.tagName.toUpperCase(); } var str = _glimmerRuntimeLibCompiledOpcodesContent.normalizeTextValue(value); if (checkURI(tagName, attribute)) { var protocol = env.protocolForURL(str); if (has(badProtocols, protocol)) { return 'unsafe:' + str; } } if (checkDataURI(tagName, attribute)) { return 'unsafe:' + str; } return str; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZG9tL3Nhbml0aXplZC12YWx1ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBTUEsUUFBTSxZQUFZLEdBQUcsQ0FDbkIsYUFBYSxFQUNiLFdBQVcsQ0FDWixDQUFDO0FBRUYsUUFBTSxPQUFPLEdBQUcsQ0FDZCxHQUFHLEVBQ0gsTUFBTSxFQUNOLE1BQU0sRUFDTixLQUFLLEVBQ0wsUUFBUSxFQUNSLE1BQU0sRUFDTixNQUFNLENBQ1AsQ0FBQztBQUVGLFFBQU0saUJBQWlCLEdBQUcsQ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lib/environment', ['exports', 'glimmer-runtime/lib/references', 'glimmer-runtime/lib/dom/change-lists', 'glimmer-util', 'glimmer-runtime/lib/syntax/core', 'glimmer-runtime/lib/syntax/builtins/if', 'glimmer-runtime/lib/syntax/builtins/unless', 'glimmer-runtime/lib/syntax/builtins/with', 'glimmer-runtime/lib/syntax/builtins/each', 'glimmer-runtime/lib/syntax/builtins/partial'], function (exports, _glimmerRuntimeLibReferences, _glimmerRuntimeLibDomChangeLists, _glimmerUtil, _glimmerRuntimeLibSyntaxCore, _glimmerRuntimeLibSyntaxBuiltinsIf, _glimmerRuntimeLibSyntaxBuiltinsUnless, _glimmerRuntimeLibSyntaxBuiltinsWith, _glimmerRuntimeLibSyntaxBuiltinsEach, _glimmerRuntimeLibSyntaxBuiltinsPartial) { 'use strict'; var Scope = (function () { function Scope(references) { var callerScope = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; this.callerScope = null; this.slots = references; this.callerScope = callerScope; } Scope.root = function root(self) { var size = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; var refs = new Array(size + 1); for (var i = 0; i <= size; i++) { refs[i] = _glimmerRuntimeLibReferences.UNDEFINED_REFERENCE; } return new Scope(refs).init({ self: self }); }; Scope.prototype.init = function init(_ref) { var self = _ref.self; this.slots[0] = self; return this; }; Scope.prototype.getSelf = function getSelf() { return this.slots[0]; }; Scope.prototype.getSymbol = function getSymbol(symbol) { return this.slots[symbol]; }; Scope.prototype.getBlock = function getBlock(symbol) { return this.slots[symbol]; }; Scope.prototype.bindSymbol = function bindSymbol(symbol, value) { this.slots[symbol] = value; }; Scope.prototype.bindBlock = function bindBlock(symbol, value) { this.slots[symbol] = value; }; Scope.prototype.bindCallerScope = function bindCallerScope(scope) { this.callerScope = scope; }; Scope.prototype.getCallerScope = function getCallerScope() { return this.callerScope; }; Scope.prototype.child = function child() { return new Scope(this.slots.slice(), this.callerScope); }; return Scope; })(); exports.Scope = Scope; var Environment = (function () { function Environment(_ref2) { var appendOperations = _ref2.appendOperations; var updateOperations = _ref2.updateOperations; this.scheduledInstallManagers = null; this.scheduledInstallModifiers = null; this.scheduledUpdateModifierManagers = null; this.scheduledUpdateModifiers = null; this.createdComponents = null; this.createdManagers = null; this.updatedComponents = null; this.updatedManagers = null; this.destructors = null; this.appendOperations = appendOperations; this.updateOperations = updateOperations; } Environment.prototype.toConditionalReference = function toConditionalReference(reference) { return new _glimmerRuntimeLibReferences.ConditionalReference(reference); }; Environment.prototype.getAppendOperations = function getAppendOperations() { return this.appendOperations; }; Environment.prototype.getDOM = function getDOM() { return this.updateOperations; }; Environment.prototype.getIdentity = function getIdentity(object) { return _glimmerUtil.ensureGuid(object) + ''; }; Environment.prototype.statement = function statement(_statement, symbolTable) { return this.refineStatement(parseStatement(_statement), symbolTable) || _statement; }; Environment.prototype.refineStatement = function refineStatement(statement, symbolTable) { var isSimple = statement.isSimple; var isBlock = statement.isBlock; var isInline = statement.isInline; var key = statement.key; var args = statement.args; var templates = statement.templates; if (isSimple && isInline) { if (key === 'partial') { return new _glimmerRuntimeLibSyntaxBuiltinsPartial.default({ args: args, symbolTable: symbolTable }); } } if (isSimple && isBlock) { switch (key) { case 'each': return new _glimmerRuntimeLibSyntaxBuiltinsEach.default({ args: args, templates: templates }); case 'if': return new _glimmerRuntimeLibSyntaxBuiltinsIf.default({ args: args, templates: templates }); case 'with': return new _glimmerRuntimeLibSyntaxBuiltinsWith.default({ args: args, templates: templates }); case 'unless': return new _glimmerRuntimeLibSyntaxBuiltinsUnless.default({ args: args, templates: templates }); } } }; Environment.prototype.begin = function begin() { this.createdComponents = []; this.createdManagers = []; this.updatedComponents = []; this.updatedManagers = []; this.destructors = []; this.scheduledInstallManagers = []; this.scheduledInstallModifiers = []; this.scheduledUpdateModifierManagers = []; this.scheduledUpdateModifiers = []; }; Environment.prototype.didCreate = function didCreate(component, manager) { this.createdComponents.push(component); this.createdManagers.push(manager); }; Environment.prototype.didUpdate = function didUpdate(component, manager) { this.updatedComponents.push(component); this.updatedManagers.push(manager); }; Environment.prototype.scheduleInstallModifier = function scheduleInstallModifier(modifier, manager) { this.scheduledInstallManagers.push(manager); this.scheduledInstallModifiers.push(modifier); }; Environment.prototype.scheduleUpdateModifier = function scheduleUpdateModifier(modifier, manager) { this.scheduledUpdateModifierManagers.push(manager); this.scheduledUpdateModifiers.push(modifier); }; Environment.prototype.didDestroy = function didDestroy(d) { this.destructors.push(d); }; Environment.prototype.commit = function commit() { for (var i = 0; i < this.createdComponents.length; i++) { var component = this.createdComponents[i]; var manager = this.createdManagers[i]; manager.didCreate(component); } for (var i = 0; i < this.updatedComponents.length; i++) { var component = this.updatedComponents[i]; var manager = this.updatedManagers[i]; manager.didUpdate(component); } for (var i = 0; i < this.destructors.length; i++) { this.destructors[i].destroy(); } for (var i = 0; i < this.scheduledInstallManagers.length; i++) { var manager = this.scheduledInstallManagers[i]; var modifier = this.scheduledInstallModifiers[i]; manager.install(modifier); } for (var i = 0; i < this.scheduledUpdateModifierManagers.length; i++) { var manager = this.scheduledUpdateModifierManagers[i]; var modifier = this.scheduledUpdateModifiers[i]; manager.update(modifier); } this.createdComponents = null; this.createdManagers = null; this.updatedComponents = null; this.updatedManagers = null; this.destructors = null; this.scheduledInstallManagers = null; this.scheduledInstallModifiers = null; this.scheduledUpdateModifierManagers = null; this.scheduledUpdateModifiers = null; }; Environment.prototype.attributeFor = function attributeFor(element, attr, isTrusting, namespace) { return _glimmerRuntimeLibDomChangeLists.defaultChangeLists(element, attr, isTrusting, namespace); }; return Environment; })(); exports.Environment = Environment; exports.default = Environment; function parseStatement(statement) { var type = statement.type; var block = type === 'block' ? statement : null; var append = type === 'optimized-append' ? statement : null; var modifier = type === 'modifier' ? statement : null; var appendType = append && append.value.type; var args = undefined; var path = undefined; if (block) { args = block.args; path = block.path; } else if (append && (appendType === 'unknown' || appendType === 'get')) { var appendValue = append.value; args = _glimmerRuntimeLibSyntaxCore.Args.empty(); path = appendValue.ref.parts; } else if (append && append.value.type === 'helper') { var helper = append.value; args = helper.args; path = helper.ref.parts; } else if (modifier) { path = modifier.path; args = modifier.args; } var key = undefined, isSimple = undefined; if (path) { isSimple = path.length === 1; key = path[0]; } return { isSimple: isSimple, path: path, key: key, args: args, appendType: appendType, original: statement, isInline: !!append, isBlock: !!block, isModifier: !!modifier, templates: block && block.templates }; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvZW52aXJvbm1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBNERNLEtBQUE7QUFlSixpQkFmSSxLQUFBLENBZVEsVUFBdUIsRUFBMkI7Z0JBQXpCLFdBQVcseURBQVUsSUFBSTs7QUFGdEQsZ0JBQUEsQ0FBQSxXQUFXLEdBQVUsSUFBSSxDQUFDO0FBR2hDLGdCQUFJLENBQUMsS0FBSyxHQUFHLFVBQVUsQ0FBQztBQUN4QixnQkFBSSxDQUFDLFdBQVcsR0FBRyxXQUFXLENBQUM7U0FDaEM7O0FBbEJHLGFBQUEsQ0FDRyxJQUFJLEdBQUEsY0FBQyxJQUEyQixFQUFVO2dCQUFSLElBQUkseURBQUcsQ0FBQzs7QUFDL0MsZ0JBQUksSUFBSSxHQUE0QixJQUFJLEtBQUssQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFFeEQsaUJBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsSUFBSSxJQUFJLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDOUIsb0JBQUksQ0FBQyxDQUFDLENBQUMsZ0NBMURKLG1CQUFtQixBQTBETyxDQUFDO2FBQy9CO0FBRUQsbUJBQU8sSUFBSSxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUUsSUFBSSxFQUFKLElBQUksRUFBRSxDQUFDLENBQUM7U0FDdkM7O0FBVEcsYUFBQSxXQW9CSixJQUFJLEd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zQmxvY2s6ICEhYmxvY2ssXG4gICAgICBpc01vZGlmaWVyOiAhIW1vZGlmaWVyLFxuICAgICAgdGVtcGxhdGVzOiBibG9jayAmJiBibG9jay50ZW1wbGF0ZXNcbiAgICB9O1xufVxuIl19 enifed('glimmer-runtime/lib/helpers/get-dynamic-var', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; var DynamicVarReference = (function () { function DynamicVarReference(scope, nameRef) { this.scope = scope; this.nameRef = nameRef; var varTag = this.varTag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); this.tag = _glimmerReference.combine([nameRef.tag, varTag]); } DynamicVarReference.prototype.value = function value() { return this.getVar().value(); }; DynamicVarReference.prototype.get = function get(key) { return this.getVar().get(key); }; DynamicVarReference.prototype.getVar = function getVar() { var name = String(this.nameRef.value()); var ref = this.scope.get(name); this.varTag.update(ref.tag); return ref; }; return DynamicVarReference; })(); function getDynamicVar(vm, args, symbolTable) { var scope = vm.dynamicScope(); var nameRef = args.positional.at(0); return new DynamicVarReference(scope, nameRef); } exports.default = getDynamicVar; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvaGVscGVycy9nZXQtZHluYW1pYy12YXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBT0EsbUJBQUE7QUFJRSxpQkFKRixtQkFBQSxDQUlzQixLQUFtQixFQUFVLE9BQThCLEVBQUE7QUFBM0QsZ0JBQUEsQ0FBQSxLQUFLLEdBQUwsS0FBSyxDQUFjO0FBQVUsZ0JBQUEsQ0FBQSxPQUFPLEdBQVAsT0FBTyxDQUF1QjtBQUM3RSxnQkFBSSxNQUFNLEdBQUcsSUFBSSxDQUFDLE1BQU0sR0FBRyxzQkFSb0IsWUFBWSxtQkFBdEQsWUFBWSxDQVF3QyxDQUFDO0FBQzFELGdCQUFJLENBQUMsR0FBRyxHQUFHLGtCQVRrRC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oUmVmZXJlbmNlPE9wYXF1ZT4ge1xuICAgIHJldHVybiB0aGlzLmdldFZhcigpLmdldChrZXkpO1xuICB9XG5cbiAgcHJpdmF0ZSBnZXRWYXIoKTogUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgICBsZXQgbmFtZSA9IFN0cmluZyh0aGlzLm5hbWVSZWYudmFsdWUoKSk7XG4gICAgbGV0IHJlZiA9IHRoaXMuc2NvcGUuZ2V0KG5hbWUpO1xuXG4gICAgdGhpcy52YXJUYWcudXBkYXRlKHJlZi50YWcpO1xuXG4gICAgcmV0dXJuIHJlZjtcbiAgfVxufVxuXG5mdW5jdGlvbiBnZXREeW5hbWljVmFyKHZtOiBQdWJsaWNWTSwgYXJnczogRXZhbHVhdGVkQXJncywgc3ltYm9sVGFibGU6IFN5bWJvbFRhYmxlKTogUGF0aFJlZmVyZW5jZTxPcGFxdWU+IHtcbiAgbGV0IHNjb3BlID0gdm0uZHluYW1pY1Njb3BlKCk7XG4gIGxldCBuYW1lUmVmID0gYXJncy5wb3NpdGlvbmFsLmF0KDApO1xuXG4gIHJldHVybiBuZXcgRHluYW1pY1ZhclJlZmVyZW5jZShzY29wZSwgbmFtZVJlZik7XG59XG5cbmV4cG9ydCBkZWZhdWx0IChnZXREeW5hbWljVmFyIGFzIEhlbHBlcik7XG4iXX0= enifed("glimmer-runtime/lib/modifier/interfaces", ["exports"], function (exports) { "use strict"; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvbW9kaWZpZXIvaW50ZXJmYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwiZmlsZSI6ImludGVyZmFjZXMuanMiLCJzb3VyY2VzQ29udGVudCI6W119 enifed("glimmer-runtime/lib/opcode-builder", ["exports"], function (exports) { "use strict"; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvb3Bjb2RlLWJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJvcGNvZGUtYnVpbGRlci5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0= enifed('glimmer-runtime/lib/opcodes', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; exports.inspect = inspect; var AbstractOpcode = (function () { function AbstractOpcode() { _glimmerUtil.initializeGuid(this); } AbstractOpcode.prototype.toJSON = function toJSON() { return { guid: this._guid, type: this.type }; }; return AbstractOpcode; })(); exports.AbstractOpcode = AbstractOpcode; var Opcode = (function (_AbstractOpcode) { babelHelpers.inherits(Opcode, _AbstractOpcode); function Opcode() { _AbstractOpcode.apply(this, arguments); this.next = null; this.prev = null; } return Opcode; })(AbstractOpcode); exports.Opcode = Opcode; var UpdatingOpcode = (function (_AbstractOpcode2) { babelHelpers.inherits(UpdatingOpcode, _AbstractOpcode2); function UpdatingOpcode() { _AbstractOpcode2.apply(this, arguments); this.next = null; this.prev = null; } return UpdatingOpcode; })(AbstractOpcode); exports.UpdatingOpcode = UpdatingOpcode; function inspect(opcodes) { var buffer = []; opcodes.toArray().forEach(function (opcode, i) { _inspect(opcode.toJSON(), buffer, 0, i); }); return buffer.join(''); } function _inspect(opcode, buffer, level, index) { var indentation = []; for (var i = 0; i < level; i++) { indentation.push(' '); } buffer.push.apply(buffer, indentation); buffer.push(index + 1 + '. ' + opcode.type.toUpperCase()); if (opcode.args || opcode.details) { buffer.push('('); if (opcode.args) { buffer.push(opcode.args.join(', ')); } if (opcode.details) { var keys = Object.keys(opcode.details); if (keys.length) { if (opcode.args && opcode.args.length) { buffer.push(', '); } buffer.push(keys.map(function (key) { return key + '=' + opcode.details[key]; }).join(', ')); } } buffer.push(')'); } buffer.push('\n'); if (opcode.children && opcode.children.length) { for (var i = 0; i < opcode.children.length; i++) { _inspect(opcode.children[i], buffer, level + 1, i); } } } }); //# sourceMappingURL=data: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GJ1ZmZlci5wdXNoKGAke2luZGV4ICsgMX0uICR7b3Bjb2RlLnR5cGUudG9VcHBlckNhc2UoKX1gKTtcbiAgICBpZiAob3Bjb2RlLmFyZ3MgfHwgb3Bjb2RlLmRldGFpbHMpIHtcbiAgICAgICAgYnVmZmVyLnB1c2goJygnKTtcbiAgICAgICAgaWYgKG9wY29kZS5hcmdzKSB7XG4gICAgICAgICAgICBidWZmZXIucHVzaChvcGNvZGUuYXJncy5qb2luKCcsICcpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAob3Bjb2RlLmRldGFpbHMpIHtcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMob3Bjb2RlLmRldGFpbHMpO1xuICAgICAgICAgICAgaWYgKGtleXMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9wY29kZS5hcmdzICYmIG9wY29kZS5hcmdzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBidWZmZXIucHVzaCgnLCAnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnVmZmVyLnB1c2goa2V5cy5tYXAoa2V5ID0+IGAke2tleX09JHtvcGNvZGUuZGV0YWlsc1trZXldfWApLmpvaW4oJywgJykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGJ1ZmZlci5wdXNoKCcpJyk7XG4gICAgfVxuICAgIGJ1ZmZlci5wdXNoKCdcXG4nKTtcbiAgICBpZiAob3Bjb2RlLmNoaWxkcmVuICYmIG9wY29kZS5jaGlsZHJlbi5sZW5ndGgpIHtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvcGNvZGUuY2hpbGRyZW4ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIF9pbnNwZWN0KG9wY29kZS5jaGlsZHJlbltpXSwgYnVmZmVyLCBsZXZlbCArIDEsIGkpO1xuICAgICAgICB9XG4gICAgfVxufVxuIl19 enifed("glimmer-runtime/lib/partial", ["exports"], function (exports) { "use strict"; var PartialDefinition = function PartialDefinition(name, template) { this.name = name; this.template = template; }; exports.PartialDefinition = PartialDefinition; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcGFydGlhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFFTSxpQkFBQSxHQUlKLFNBSkksaUJBQUEsQ0FJUSxJQUFZLEVBQUUsUUFBcUIsRUFBQTtBQUM3QyxZQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztBQUNqQixZQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztLQUMxQiIsImZpbGUiOiJwYXJ0aWFsLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVGVtcGxhdGUgfSBmcm9tICcuL3RlbXBsYXRlJztcblxuZXhwb3J0IGNsYXNzIFBhcnRpYWxEZWZpbml0aW9uPFQ+IHtcbiAgbmFtZTogc3RyaW5nO1xuICB0ZW1wbGF0ZTogVGVtcGxhdGU8VD47XG5cbiAgY29uc3RydWN0b3IobmFtZTogc3RyaW5nLCB0ZW1wbGF0ZTogVGVtcGxhdGU8VD4pIHtcbiAgICB0aGlzLm5hbWUgPSBuYW1lO1xuICAgIHRoaXMudGVtcGxhdGUgPSB0ZW1wbGF0ZTtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/references', ['exports', 'glimmer-reference'], function (exports, _glimmerReference) { 'use strict'; var PrimitiveReference = (function (_ConstReference) { babelHelpers.inherits(PrimitiveReference, _ConstReference); function PrimitiveReference() { _ConstReference.apply(this, arguments); } PrimitiveReference.prototype.get = function get() { return UNDEFINED_REFERENCE; }; return PrimitiveReference; })(_glimmerReference.ConstReference); exports.PrimitiveReference = PrimitiveReference; var ConditionalReference = (function () { function ConditionalReference(inner) { this.inner = inner; this.tag = inner.tag; } ConditionalReference.prototype.value = function value() { return this.toBool(this.inner.value()); }; ConditionalReference.prototype.toBool = function toBool(value) { return !!value; }; return ConditionalReference; })(); exports.ConditionalReference = ConditionalReference; var NULL_REFERENCE = new PrimitiveReference(null); exports.NULL_REFERENCE = NULL_REFERENCE; var UNDEFINED_REFERENCE = new PrimitiveReference(undefined); exports.UNDEFINED_REFERENCE = UNDEFINED_REFERENCE; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvcmVmZXJlbmNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFLTSxrQkFBMEI7OEJBQTFCLGtCQUEwQjs7aUJBQTFCLGtCQUEwQjs7OztBQUExQiwwQkFBMEIsV0FDOUIsR0FBRyxHQUFBLGVBQUE7QUFDRCxtQkFBTyxtQkFBbUIsQ0FBQztTQUM1Qjs7ZUFIRyxrQkFBMEI7eUJBTFYsY0FBYzs7OztRQVc5QixvQkFBQTtBQUlKLGlCQUpJLG9CQUFBLENBSVEsS0FBd0IsRUFBQTtBQUNsQyxnQkFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7QUFDbkIsZ0JBQUksQ0FBQyxHQUFHLEdBQUcsS0FBSyxDQUFDLEdBQUcsQ0FBQztTQUN0Qjs7QUFQRyw0QkFBQSxXQVNKLEtBQUssR0FBQSxpQkFBQTtBQUNILG1CQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxLQUFLLEVBQUUsQ0FBQyxDQUFDO1NBQ3hDOztBQVhHLDRCQUFBLFdBYU0sTUFBTSxHQUFBLGdCQUFDLEtBQWEsRUFBQTtBQUM1QixtQkFBTyxDQUFDLENBQUMsS0FBSyxDQUFDO1NBQ2hCOztlQWZHLG9CQUFBOzs7O0FBa0JDLFFBQU0sY0FBYyxHQUFHLElBQUksa0JBQWtCLENBQUMsSUFBSSxDQUFDLENBQUM7O0FBQ3BELFFBQU0sbU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mV0dXJuICEhdmFsdWU7XG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IE5VTExfUkVGRVJFTkNFID0gbmV3IFByaW1pdGl2ZVJlZmVyZW5jZShudWxsKTtcbmV4cG9ydCBjb25zdCBVTkRFRklORURfUkVGRVJFTkNFID0gbmV3IFByaW1pdGl2ZVJlZmVyZW5jZSh1bmRlZmluZWQpO1xuIl19 enifed('glimmer-runtime/lib/scanner', ['exports', 'glimmer-runtime/lib/syntax/statements', 'glimmer-runtime/lib/compiled/blocks', 'glimmer-util', 'glimmer-runtime/lib/symbol-table'], function (exports, _glimmerRuntimeLibSyntaxStatements, _glimmerRuntimeLibCompiledBlocks, _glimmerUtil, _glimmerRuntimeLibSymbolTable) { 'use strict'; var Scanner = (function () { function Scanner(block, meta, env) { this.block = block; this.meta = meta; this.env = env; } Scanner.prototype.scanEntryPoint = function scanEntryPoint() { var block = this.block; var meta = this.meta; var symbolTable = _glimmerRuntimeLibSymbolTable.default.forEntryPoint(meta); var program = buildStatements(block, block.blocks, symbolTable, this.env); return new _glimmerRuntimeLibCompiledBlocks.EntryPoint(program, symbolTable); }; Scanner.prototype.scanLayout = function scanLayout() { var block = this.block; var meta = this.meta; var blocks = block.blocks; var named = block.named; var yields = block.yields; var symbolTable = _glimmerRuntimeLibSymbolTable.default.forLayout(named, yields, meta); var program = buildStatements(block, blocks, symbolTable, this.env); return new _glimmerRuntimeLibCompiledBlocks.Layout(program, symbolTable, named, yields); }; Scanner.prototype.scanPartial = function scanPartial(symbolTable) { var block = this.block; var blocks = block.blocks; var locals = block.locals; var program = buildStatements(block, blocks, symbolTable, this.env); return new _glimmerRuntimeLibCompiledBlocks.PartialBlock(program, symbolTable, locals); }; return Scanner; })(); exports.default = Scanner; function buildStatements(_ref, blocks, symbolTable, env) { var statements = _ref.statements; if (statements.length === 0) return EMPTY_PROGRAM; return new BlockScanner(statements, blocks, symbolTable, env).scan(); } var EMPTY_PROGRAM = _glimmerUtil.EMPTY_SLICE; var BlockScanner = (function () { function BlockScanner(statements, blocks, symbolTable, env) { this.blocks = blocks; this.symbolTable = symbolTable; this.stack = new _glimmerUtil.Stack(); this.stack.push(new ChildBlockScanner(symbolTable)); this.reader = new SyntaxReader(statements, symbolTable, this); this.env = env; } BlockScanner.prototype.scan = function scan() { var statement = undefined; while (statement = this.reader.next()) { this.addStatement(statement); } return this.stack.current.program; }; BlockScanner.prototype.blockFor = function blockFor(symbolTable, id) { var block = this.blocks[id]; var childTable = _glimmerRuntimeLibSymbolTable.default.forBlock(this.symbolTable, block.locals); var program = buildStatements(block, this.blocks, childTable, this.env); return new _glimmerRuntimeLibCompiledBlocks.InlineBlock(program, childTable, block.locals); }; BlockScanner.prototype.startBlock = function startBlock(locals) { var childTable = _glimmerRuntimeLibSymbolTable.default.forBlock(this.symbolTable, locals); this.stack.push(new ChildBlockScanner(childTable)); }; BlockScanner.prototype.endBlock = function endBlock(locals) { var _stack$pop = this.stack.pop(); var program = _stack$pop.program; var symbolTable = _stack$pop.symbolTable; var block = new _glimmerRuntimeLibCompiledBlocks.InlineBlock(program, symbolTable, locals); this.addChild(block); return block; }; BlockScanner.prototype.addChild = function addChild(block) { this.stack.current.addChild(block); }; BlockScanner.prototype.addStatement = function addStatement(statement) { this.stack.current.addStatement(statement.scan(this)); }; BlockScanner.prototype.next = function next() { return this.reader.next(); }; return BlockScanner; })(); exports.BlockScanner = BlockScanner; var ChildBlockScanner = (function () { function ChildBlockScanner(symbolTable) { this.symbolTable = symbolTable; this.children = []; this.program = new _glimmerUtil.LinkedList(); } ChildBlockScanner.prototype.addChild = function addChild(block) { this.children.push(block); }; ChildBlockScanner.prototype.addStatement = function addStatement(statement) { this.program.append(statement); }; return ChildBlockScanner; })(); var SyntaxReader = (function () { function SyntaxReader(statements, symbolTable, scanner) { this.statements = statements; this.symbolTable = symbolTable; this.scanner = scanner; this.current = 0; this.last = null; } SyntaxReader.prototype.next = function next() { var last = this.last; if (last) { this.last = null; return last; } else if (this.current === this.statements.length) { return null; } var sexp = this.statements[this.current++]; return _glimmerRuntimeLibSyntaxStatements.default(sexp, this.symbolTable, this.scanner); }; return SyntaxReader; })(); exports.SyntaxReader = SyntaxReader; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc2Nhbm5lci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFRYyxPQUFBO0FBQ1osaUJBRFksT0FBQSxDQUNRLEtBQThCLEVBQVUsSUFBa0IsRUFBVSxHQUFnQixFQUFBO0FBQXBGLGdCQUFBLENBQUEsS0FBSyxHQUFMLEtBQUssQ0FBeUI7QUFBVSxnQkFBQSxDQUFBLElBQUksR0FBSixJQUFJLENBQWM7QUFBVSxnQkFBQSxDQUFBLEdBQUcsR0FBSCxHQUFHLENBQWE7U0FDdkc7O0FBRlcsZUFBQSxXQUlaLGNBQWMsR0FBQSwwQkFBQTtnQkFDTixLQUFLLEdBQVcsSUFBSSxDQUFwQixLQUFLO2dCQUFFLElBQUksR0FBSyxJQUFJLENBQWIsSUFBSTs7QUFFakIsZ0JBQUksV0FBVyxHQUFHLHNDQUFZLGFBQWEsQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNsRCxnQkFBSSxPQUFPLEdBQUcsZUFBZSxDQUFDLEtBQUssRUFBRSxLQUFLLENBQUMsTUFBTSxFQUFFLFdBQVcsRUFBRSxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDMUUsbUJBQU8scUNBZkYsVUFBVSxDQWVPLE9BQU8sRUFBRSxXQUFXLENBQUMsQ0FBQztTQUM3Qzs7QUFWVyxlQUFBLFdBWVosVUFBVSxHQUFBLHNCQUFBO2dCQUNGLEtBQUssR0FBVyxJQUFJLENBQXBCLEtBQUs7Z0JBQUUsSUFBSSxHQUFLLElBQUksQ0FBYixJQUFJO2dCQUNYLE1BQU0sR0FBb0IsS0FBSyxDQUEvQixNQUFNO2dCQUFFLEtBQU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VudHMubGVuZ3RoKSB7XG4gICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBsZXQgc2V4cCA9IHRoaXMuc3RhdGVtZW50c1t0aGlzLmN1cnJlbnQrK107XG4gICAgcmV0dXJuIGJ1aWxkU3RhdGVtZW50KHNleHAsIHRoaXMuc3ltYm9sVGFibGUsIHRoaXMuc2Nhbm5lcik7XG4gIH1cbn1cbiJdfQ== enifed('glimmer-runtime/lib/symbol-table', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; var SymbolTable = (function () { function SymbolTable(parent) { var meta = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; this.parent = parent; this.meta = meta; this.locals = _glimmerUtil.dict(); this.named = _glimmerUtil.dict(); this.yields = _glimmerUtil.dict(); this.size = 1; this.top = parent ? parent.top : this; } SymbolTable.forEntryPoint = function forEntryPoint(meta) { return new SymbolTable(null, meta).initEntryPoint(); }; SymbolTable.forLayout = function forLayout(named, yields, meta) { return new SymbolTable(null, meta).initLayout(named, yields); }; SymbolTable.forBlock = function forBlock(parent, locals) { return new SymbolTable(parent, null).initBlock(locals); }; SymbolTable.prototype.initEntryPoint = function initEntryPoint() { return this; }; SymbolTable.prototype.initBlock = function initBlock(locals) { this.initPositionals(locals); return this; }; SymbolTable.prototype.initLayout = function initLayout(named, yields) { this.initNamed(named); this.initYields(yields); return this; }; SymbolTable.prototype.initPositionals = function initPositionals(positionals) { var _this = this; if (positionals) positionals.forEach(function (s) { return _this.locals[s] = _this.top.size++; }); return this; }; SymbolTable.prototype.initNamed = function initNamed(named) { var _this2 = this; if (named) named.forEach(function (s) { return _this2.named[s] = _this2.top.size++; }); return this; }; SymbolTable.prototype.initYields = function initYields(yields) { var _this3 = this; if (yields) yields.forEach(function (b) { return _this3.yields[b] = _this3.top.size++; }); return this; }; SymbolTable.prototype.getMeta = function getMeta() { var meta = this.meta; var parent = this.parent; if (!meta && parent) { meta = parent.getMeta(); } return meta; }; SymbolTable.prototype.getYield = function getYield(name) { var yields = this.yields; var parent = this.parent; var symbol = yields[name]; if (!symbol && parent) { symbol = parent.getYield(name); } return symbol; }; SymbolTable.prototype.getNamed = function getNamed(name) { var named = this.named; var parent = this.parent; var symbol = named[name]; if (!symbol && parent) { symbol = parent.getNamed(name); } return symbol; }; SymbolTable.prototype.getLocal = function getLocal(name) { var locals = this.locals; var parent = this.parent; var symbol = locals[name]; if (!symbol && parent) { symbol = parent.getLocal(name); } return symbol; }; SymbolTable.prototype.isTop = function isTop() { return this.top === this; }; return SymbolTable; })(); exports.default = SymbolTable; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ltYm9sLXRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQUdjLFdBQUE7QUFtQlosaUJBbkJZLFdBQUEsQ0FtQlEsTUFBbUIsRUFBbUM7Z0JBQXpCLElBQUEseURBQXFCLElBQUk7O0FBQXRELGdCQUFBLENBQUEsTUFBTSxHQUFOLE1BQU0sQ0FBYTtBQUFVLGdCQUFBLENBQUEsSUFBSSxHQUFKLElBQUksQ0FBcUI7QUFMbEUsZ0JBQUEsQ0FBQSxNQUFNLEdBQUssYUFqQlosSUFBSSxFQWlCc0IsQ0FBQztBQUMxQixnQkFBQSxDQUFBLEtBQUssR0FBTSxhQWxCWixJQUFJLEVBa0JzQixDQUFDO0FBQzFCLGdCQUFBLENBQUEsTUFBTSxHQUFLLGFBbkJaLElBQUksRUFtQnNCLENBQUM7QUFDM0IsZ0JBQUEsQ0FBQSxJQUFJLEdBQUcsQ0FBQyxDQUFDO0FBR2QsZ0JBQUksQ0FBQyxHQUFHLEdBQUcsTUFBTSxHQUFHLE1BQU0sQ0FBQyxHQUFHLEdBQUcsSUFBSSxDQUFDO1NBQ3ZDOztBQXJCVyxtQkFBQSxDQUNMLGFBQWEsR0FBQSx1QkFBQyxJQUFrQixFQUFBO0FBQ3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AgICAgIHN5bWJvbCA9IHBhcmVudC5nZXRMb2NhbChuYW1lKTtcbiAgICB9XG5cbiAgICByZXR1cm4gc3ltYm9sO1xuICB9XG5cbiAgaXNUb3AoKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRoaXMudG9wID09PSB0aGlzO1xuICB9XG59XG4iXX0= enifed("glimmer-runtime/lib/syntax", ["exports"], function (exports) { "use strict"; exports.isAttribute = isAttribute; var Statement = (function () { function Statement() { this.next = null; this.prev = null; } Statement.fromSpec = function fromSpec(spec, symbolTable, scanner) { throw new Error("You need to implement fromSpec on " + this); }; Statement.prototype.clone = function clone() { // not type safe but the alternative is extreme boilerplate per // syntax subclass. return new this.constructor(this); }; Statement.prototype.scan = function scan(scanner) { return this; }; return Statement; })(); exports.Statement = Statement; var Expression = (function () { function Expression() {} Expression.fromSpec = function fromSpec(spec, blocks) { throw new Error("You need to implement fromSpec on " + this); }; return Expression; })(); exports.Expression = Expression; var ATTRIBUTE = "e1185d30-7cac-4b12-b26a-35327d905d92"; exports.ATTRIBUTE = ATTRIBUTE; var ARGUMENT = "0f3802314-d747-bbc5-0168-97875185c3rt"; exports.ARGUMENT = ARGUMENT; var Attribute = (function (_Statement) { babelHelpers.inherits(Attribute, _Statement); function Attribute() { _Statement.apply(this, arguments); this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; } return Attribute; })(Statement); exports.Attribute = Attribute; var Argument = (function (_Statement2) { babelHelpers.inherits(Argument, _Statement2); function Argument() { _Statement2.apply(this, arguments); this["0f3802314-d747-bbc5-0168-97875185c3rt"] = true; } return Argument; })(Statement); exports.Argument = Argument; function isAttribute(value) { return value && value[ATTRIBUTE] === true; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O1FBbUJNLFNBQUE7QUFBTixpQkFBTSxTQUF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GZyb21TcGVjKHNwZWMsIGJsb2Nrcykge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFlvdSBuZWVkIHRvIGltcGxlbWVudCBmcm9tU3BlYyBvbiAke3RoaXN9YCk7XG4gICAgfVxufVxuZXhwb3J0IGNvbnN0IEFUVFJJQlVURSA9IFwiZTExODVkMzAtN2NhYy00YjEyLWIyNmEtMzUzMjdkOTA1ZDkyXCI7XG5leHBvcnQgY29uc3QgQVJHVU1FTlQgPSBcIjBmMzgwMjMxNC1kNzQ3LWJiYzUtMDE2OC05Nzg3NTE4NWMzcnRcIjtcbmV4cG9ydCBjbGFzcyBBdHRyaWJ1dGUgZXh0ZW5kcyBTdGF0ZW1lbnQge1xuICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICBzdXBlciguLi5hcmd1bWVudHMpO1xuICAgICAgICB0aGlzW1wiZTExODVkMzAtN2NhYy00YjEyLWIyNmEtMzUzMjdkOTA1ZDkyXCJdID0gdHJ1ZTtcbiAgICB9XG59XG5leHBvcnQgY2xhc3MgQXJndW1lbnQgZXh0ZW5kcyBTdGF0ZW1lbnQge1xuICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICBzdXBlciguLi5hcmd1bWVudHMpO1xuICAgICAgICB0aGlzW1wiMGYzODAyMzE0LWQ3NDctYmJjNS0wMTY4LTk3ODc1MTg1YzNydFwiXSA9IHRydWU7XG4gICAgfVxufVxuZXhwb3J0IGZ1bmN0aW9uIGlzQXR0cmlidXRlKHZhbHVlKSB7XG4gICAgcmV0dXJuIHZhbHVlICYmIHZhbHVlW0FUVFJJQlVURV0gPT09IHRydWU7XG59XG4iXX0= enifed('glimmer-runtime/lib/syntax/builtins/each', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; var EachSyntax = (function (_StatementSyntax) { babelHelpers.inherits(EachSyntax, _StatementSyntax); function EachSyntax(_ref) { var args = _ref.args; var templates = _ref.templates; _StatementSyntax.call(this); this.type = "each-statement"; this.isStatic = false; this.args = args; this.templates = templates; } EachSyntax.prototype.compile = function compile(dsl, env) { // Enter(BEGIN, END) // BEGIN: Noop // PutArgs // PutIterable // JumpUnless(ELSE) // EnterList(BEGIN2, END2) // ITER: Noop // NextIter(BREAK) // EnterWithKey(BEGIN2, END2) // BEGIN2: Noop // PushChildScope // Evaluate(default) // PopScope // END2: Noop // Exit // Jump(ITER) // BREAK: Noop // ExitList // Jump(END) // ELSE: Noop // Evalulate(inverse) // END: Noop // Exit var args = this.args; var templates = this.templates; dsl.block({ templates: templates, args: args }, function (dsl, BEGIN, END) { dsl.putIterator(); if (templates.inverse) { dsl.jumpUnless('ELSE'); } else { dsl.jumpUnless(END); } dsl.iter({ templates: templates }, function (dsl, BEGIN, END) { dsl.pushChildScope(); dsl.evaluate('default'); dsl.popScope(); }); if (templates.inverse) { dsl.jump(END); dsl.label('ELSE'); dsl.evaluate('inverse'); } }); }; return EachSyntax; })(_glimmerRuntimeLibSyntax.Statement); exports.default = EachSyntax; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2VhY2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBVWMsVUFBa0I7OEJBQWxCLFVBQWtCOztBQU85QixpQkFQWSxVQUFrQixDQU9sQixJQUF1RSxFQUFBO2dCQUFyRSxJQUFJLEdBQU4sSUFBdUUsQ0FBckUsSUFBSTtnQkFBRSxTQUFTLEdBQWpCLElBQXVFLENBQS9ELFNBQVM7O0FBQzNCLHVDQUFPLENBQUM7QUFQVixnQkFBQSxDQUFBLElBQUksR0FBRyxnQkFBZ0IsQ0FBQztBQUlqQixnQkFBQSxDQUFBLFFBQVEsR0FBRyxLQUFLLENBQUM7QUFJdEIsZ0JBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO0FBQ2pCLGdCQUFJLENBQU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CRUdJTiwgRU5EKVxuICAgIC8vIEJFR0lOOiAgTm9vcFxuICAgIC8vICAgICAgICAgUHV0QXJnc1xuICAgIC8vICAgICAgICAgUHV0SXRlcmFibGVcbiAgICAvLyAgICAgICAgIEp1bXBVbmxlc3MoRUxTRSlcbiAgICAvLyAgICAgICAgIEVudGVyTGlzdChCRUdJTjIsIEVORDIpXG4gICAgLy8gSVRFUjogICBOb29wXG4gICAgLy8gICAgICAgICBOZXh0SXRlcihCUkVBSylcbiAgICAvLyAgICAgICAgIEVudGVyV2l0aEtleShCRUdJTjIsIEVORDIpXG4gICAgLy8gQkVHSU4yOiBOb29wXG4gICAgLy8gICAgICAgICBQdXNoQ2hpbGRTY29wZVxuICAgIC8vICAgICAgICAgRXZhbHVhdGUoZGVmYXVsdClcbiAgICAvLyAgICAgICAgIFBvcFNjb3BlXG4gICAgLy8gRU5EMjogICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0XG4gICAgLy8gICAgICAgICBKdW1wKElURVIpXG4gICAgLy8gQlJFQUs6ICBOb29wXG4gICAgLy8gICAgICAgICBFeGl0TGlzdFxuICAgIC8vICAgICAgICAgSnVtcChFTkQpXG4gICAgLy8gRUxTRTogICBOb29wXG4gICAgLy8gICAgICAgICBFdmFsdWxhdGUoaW52ZXJzZSlcbiAgICAvLyBFTkQ6ICAgIE5vb3BcbiAgICAvLyAgICAgICAgIEV4aXRcblxuICAgIGxldCB7IGFyZ3MsIHRlbXBsYXRlcyB9ID0gdGhpcztcblxuICAgIGRzbC5ibG9jayh7IHRlbXBsYXRlcywgYXJncyB9LCAoZHNsLCBCRUdJTiwgRU5EKSA9PiB7XG4gICAgICBkc2wucHV0SXRlcmF0b3IoKTtcblxuICAgICAgaWYgKHRlbXBsYXRlcy5pbnZlcnNlKSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKCdFTFNFJyk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBkc2wuanVtcFVubGVzcyhFTkQpO1xuICAgICAgfVxuXG4gICAgICBkc2wuaXRlcih7IHRlbXBsYXRlcyB9LCAoZHNsLCBCRUdJTiwgRU5EKSA9PiB7XG4gICAgICAgIGRzbC5wdXNoQ2hpbGRTY29wZSgpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2RlZmF1bHQnKTtcbiAgICAgICAgZHNsLnBvcFNjb3BlKCk7XG4gICAgICB9KTtcblxuICAgICAgaWYgKHRlbXBsYXRlcy5pbnZlcnNlKSB7XG4gICAgICAgIGRzbC5qdW1wKEVORCk7XG4gICAgICAgIGRzbC5sYWJlbCgnRUxTRScpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2ludmVyc2UnKTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/syntax/builtins/if', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; var IfSyntax = (function (_StatementSyntax) { babelHelpers.inherits(IfSyntax, _StatementSyntax); function IfSyntax(_ref) { var args = _ref.args; var templates = _ref.templates; _StatementSyntax.call(this); this.type = "if-statement"; this.isStatic = false; this.args = args; this.templates = templates; } IfSyntax.prototype.compile = function compile(dsl) { // Enter(BEGIN, END) // BEGIN: Noop // PutArgs // Test(Environment) // JumpUnless(ELSE) // Evaluate(default) // Jump(END) // ELSE: Noop // Evalulate(inverse) // END: Noop // Exit var args = this.args; var templates = this.templates; dsl.block({ templates: templates, args: args }, function (dsl, BEGIN, END) { dsl.test('environment'); if (templates.inverse) { dsl.jumpUnless('ELSE'); dsl.evaluate('default'); dsl.jump(END); dsl.label('ELSE'); dsl.evaluate('inverse'); } else { dsl.jumpUnless(END); dsl.evaluate('default'); } }); }; return IfSyntax; })(_glimmerRuntimeLibSyntax.Statement); exports.default = IfSyntax; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL2lmLn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kc2w6IE9wY29kZUJ1aWxkZXJEU0wpIHtcbiAgICAvLyAgICAgICAgRW50ZXIoQkVHSU4sIEVORClcbiAgICAvLyBCRUdJTjogTm9vcFxuICAgIC8vICAgICAgICBQdXRBcmdzXG4gICAgLy8gICAgICAgIFRlc3QoRW52aXJvbm1lbnQpXG4gICAgLy8gICAgICAgIEp1bXBVbmxlc3MoRUxTRSlcbiAgICAvLyAgICAgICAgRXZhbHVhdGUoZGVmYXVsdClcbiAgICAvLyAgICAgICAgSnVtcChFTkQpXG4gICAgLy8gRUxTRTogIE5vb3BcbiAgICAvLyAgICAgICAgRXZhbHVsYXRlKGludmVyc2UpXG4gICAgLy8gRU5EOiAgIE5vb3BcbiAgICAvLyAgICAgICAgRXhpdFxuXG4gICAgbGV0IHsgYXJncywgdGVtcGxhdGVzIH0gPSB0aGlzO1xuXG4gICAgZHNsLmJsb2NrKHsgdGVtcGxhdGVzLCBhcmdzIH0sIChkc2wsIEJFR0lOLCBFTkQpID0+IHtcbiAgICAgIGRzbC50ZXN0KCdlbnZpcm9ubWVudCcpO1xuXG4gICAgICBpZiAodGVtcGxhdGVzLmludmVyc2UpIHtcbiAgICAgICAgZHNsLmp1bXBVbmxlc3MoJ0VMU0UnKTtcbiAgICAgICAgZHNsLmV2YWx1YXRlKCdkZWZhdWx0Jyk7XG4gICAgICAgIGRzbC5qdW1wKEVORCk7XG4gICAgICAgIGRzbC5sYWJlbCgnRUxTRScpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2ludmVyc2UnKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKEVORCk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcpO1xuICAgICAgfVxuICAgIH0pO1xuICB9XG59XG4iXX0= enifed('glimmer-runtime/lib/syntax/builtins/partial', ['exports', 'glimmer-util', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/compiled/opcodes/vm'], function (exports, _glimmerUtil, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibCompiledOpcodesVm) { 'use strict'; var PartialSyntax = (function (_StatementSyntax) { babelHelpers.inherits(PartialSyntax, _StatementSyntax); function PartialSyntax(_ref) { var args = _ref.args; var symbolTable = _ref.symbolTable; _StatementSyntax.call(this); this.type = "partial-statement"; this.isStatic = false; this.args = args; this.symbolTable = symbolTable; } PartialSyntax.prototype.compile = function compile(compiler, env, symbolTable) { /* // Enter(BEGIN, END) // BEGIN: Noop // PutArgs // NameToPartial // Test // JumpUnless(END) // EvaluatePartial // END: Noop // Exit */ _glimmerUtil.assert(this.args.positional.values.length > 0, 'Partial found with no arguments. You must specify a template.'); _glimmerUtil.assert(this.args.positional.values.length < 2, 'Partial found with more than one argument. You can only specify a single template.'); var compiledPartialNameExpression = this.args.positional.values[0].compile(compiler, env, symbolTable); var BEGIN = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode("BEGIN"); var END = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode("END"); compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.EnterOpcode({ begin: BEGIN, end: END })); compiler.append(BEGIN); compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutArgsOpcode({ args: this.args.compile(compiler, env, symbolTable) })); compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.NameToPartialOpcode(this.symbolTable)); compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.TestOpcode(_glimmerRuntimeLibCompiledOpcodesVm.SimpleTest)); compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.JumpUnlessOpcode({ target: END })); compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.EvaluatePartialOpcode({ name: compiledPartialNameExpression, symbolTable: symbolTable })); compiler.append(END); compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.ExitOpcode()); }; return PartialSyntax; })(_glimmerRuntimeLibSyntax.Statement); exports.default = PartialSyntax; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW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XJ0aWFsTmFtZUV4cHJlc3Npb24gPSB0aGlzLmFyZ3MucG9zaXRpb25hbC52YWx1ZXNbMF0uY29tcGlsZShjb21waWxlciwgZW52LCBzeW1ib2xUYWJsZSk7XG5cbiAgICBsZXQgQkVHSU4gPSBuZXcgTGFiZWxPcGNvZGUoXCJCRUdJTlwiKTtcbiAgICBsZXQgRU5EID0gbmV3IExhYmVsT3Bjb2RlKFwiRU5EXCIpO1xuXG4gICAgY29tcGlsZXIuYXBwZW5kKG5ldyBFbnRlck9wY29kZSh7IGJlZ2luOiBCRUdJTiwgZW5kOiBFTkQgfSkpO1xuICAgIGNvbXBpbGVyLmFwcGVuZChCRUdJTik7XG4gICAgY29tcGlsZXIuYXBwZW5kKG5ldyBQdXRBcmdzT3Bjb2RlKHsgYXJnczogdGhpcy5hcmdzLmNvbXBpbGUoY29tcGlsZXIsIGVudiwgc3ltYm9sVGFibGUpIH0pKTtcbiAgICBjb21waWxlci5hcHBlbmQobmV3IE5hbWVUb1BhcnRpYWxPcGNvZGUodGhpcy5zeW1ib2xUYWJsZSkpO1xuICAgIGNvbXBpbGVyLmFwcGVuZChuZXcgVGVzdE9wY29kZShTaW1wbGVUZXN0KSk7XG5cbiAgICBjb21waWxlci5hcHBlbmQobmV3IEp1bXBVbmxlc3NPcGNvZGUoeyB0YXJnZXQ6IEVORCB9KSk7XG4gICAgY29tcGlsZXIuYXBwZW5kKG5ldyBFdmFsdWF0ZVBhcnRpYWxPcGNvZGUoe1xuICAgICAgbmFtZTogY29tcGlsZWRQYXJ0aWFsTmFtZUV4cHJlc3Npb24sXG4gICAgICBzeW1ib2xUYWJsZVxuICAgIH0pKTtcblxuICAgIGNvbXBpbGVyLmFwcGVuZChFTkQpO1xuICAgIGNvbXBpbGVyLmFwcGVuZChuZXcgRXhpdE9wY29kZSgpKTtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/syntax/builtins/unless', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; var UnlessSyntax = (function (_StatementSyntax) { babelHelpers.inherits(UnlessSyntax, _StatementSyntax); function UnlessSyntax(_ref) { var args = _ref.args; var templates = _ref.templates; _StatementSyntax.call(this); this.type = "unless-statement"; this.isStatic = false; this.args = args; this.templates = templates; } UnlessSyntax.prototype.compile = function compile(dsl, env) { // Enter(BEGIN, END) // BEGIN: Noop // PutArgs // Test(Environment) // JumpIf(ELSE) // Evaluate(default) // Jump(END) // ELSE: Noop // Evalulate(inverse) // END: Noop // Exit var args = this.args; var templates = this.templates; dsl.block({ templates: templates, args: args }, function (dsl) { dsl.test('environment'); if (templates.inverse) { dsl.jumpIf('ELSE'); dsl.evaluate('default'); dsl.jump('END'); dsl.label('ELSE'); dsl.evaluate('inverse'); } else { dsl.jumpIf('END'); dsl.evaluate('default'); } }); }; return UnlessSyntax; })(_glimmerRuntimeLibSyntax.Statement); exports.default = UnlessSyntax; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3VubGVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFVYyxZQUFvQjs4QkFBcEIsWUFBb0I7O0FBT2hDLGlCQVBZLFlBQW9CLENBT3BCLElBQXVFLEVBQUE7Z0JBQXJFLElBQUksR0FBTixJQUF1RSxDQUFyRSxJQUFJO2dCQUFFLFNBQVMsR0FBakIsSUFBdUUsQ0FBL0QsU0FBUzs7QUFDM0IsdUNBQU8sQ0FBQztBQVBWLGdCQUFBLENBQUEsSUFBSSxHQUFHLGtCQUFrQixDQUFDO0FBSW5CLGdCQUFBLENBQUEsUUFBUSxHQUFHLEtBQUssQ0FBQztBQUl0QixnQkFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7QUFDakIsZ0JBQUksQ0FBQyxTQUFTLEdBQUcsU0FBUyxDQUFDO1NBQzVCOztBQVhXLG9CQUFvQ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AgIEV4aXRcblxuICAgIGxldCB7IGFyZ3MsIHRlbXBsYXRlcyB9ID0gdGhpcztcblxuICAgIGRzbC5ibG9jayh7IHRlbXBsYXRlcywgYXJncyB9LCBkc2wgPT4ge1xuICAgICAgZHNsLnRlc3QoJ2Vudmlyb25tZW50Jyk7XG5cbiAgICAgIGlmICh0ZW1wbGF0ZXMuaW52ZXJzZSkge1xuICAgICAgICBkc2wuanVtcElmKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcpO1xuICAgICAgICBkc2wuanVtcCgnRU5EJyk7XG4gICAgICAgIGRzbC5sYWJlbCgnRUxTRScpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2ludmVyc2UnKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRzbC5qdW1wSWYoJ0VORCcpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2RlZmF1bHQnKTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/syntax/builtins/with-dynamic-vars', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; var WithDynamicVarsSyntax = (function (_StatementSyntax) { babelHelpers.inherits(WithDynamicVarsSyntax, _StatementSyntax); function WithDynamicVarsSyntax(_ref) { var args = _ref.args; var templates = _ref.templates; _StatementSyntax.call(this); this.type = "with-dynamic-vars-statement"; this.isStatic = false; this.args = args; this.templates = templates; } WithDynamicVarsSyntax.prototype.compile = function compile(dsl, env) { var args = this.args; var templates = this.templates; dsl.unit({ templates: templates }, function (dsl) { dsl.putArgs(args); dsl.pushDynamicScope(); dsl.bindDynamicScope(args.named.keys); dsl.evaluate('default'); dsl.popDynamicScope(); }); }; return WithDynamicVarsSyntax; })(_glimmerRuntimeLibSyntax.Statement); exports.default = WithDynamicVarsSyntax; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjp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ztcblxuICAgIGRzbC51bml0KHsgdGVtcGxhdGVzIH0sIGRzbCA9PiB7XG4gICAgICBkc2wucHV0QXJncyhhcmdzKTtcbiAgICAgIGRzbC5wdXNoRHluYW1pY1Njb3BlKCk7XG4gICAgICBkc2wuYmluZER5bmFtaWNTY29wZShhcmdzLm5hbWVkLmtleXMpO1xuICAgICAgZHNsLmV2YWx1YXRlKCdkZWZhdWx0Jyk7XG4gICAgICBkc2wucG9wRHluYW1pY1Njb3BlKCk7XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ== enifed('glimmer-runtime/lib/syntax/builtins/with', ['exports', 'glimmer-runtime/lib/syntax'], function (exports, _glimmerRuntimeLibSyntax) { 'use strict'; var WithSyntax = (function (_StatementSyntax) { babelHelpers.inherits(WithSyntax, _StatementSyntax); function WithSyntax(_ref) { var args = _ref.args; var templates = _ref.templates; _StatementSyntax.call(this); this.type = "with-statement"; this.isStatic = false; this.args = args; this.templates = templates; } WithSyntax.prototype.compile = function compile(dsl, env) { // Enter(BEGIN, END) // BEGIN: Noop // PutArgs // Test(Environment) // JumpUnless(ELSE) // Evaluate(default) // Jump(END) // ELSE: Noop // Evaluate(inverse) // END: Noop // Exit var args = this.args; var templates = this.templates; dsl.block({ templates: templates, args: args }, function (dsl, BEGIN, END) { dsl.test('environment'); if (templates.inverse) { dsl.jumpUnless('ELSE'); dsl.evaluate('default'); dsl.jump(END); dsl.label('ELSE'); dsl.evaluate('inverse'); } else { dsl.jumpUnless(END); dsl.evaluate('default'); } }); }; return WithSyntax; })(_glimmerRuntimeLibSyntax.Statement); exports.default = WithSyntax; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2J1aWx0aW5zL3dpdGgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBU2MsVUFBa0I7OEJBQWxCLFVBQWtCOztBQU85QixpQkFQWSxVQUFrQixDQU9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ZW52OiBFbnZpcm9ubWVudCkge1xuICAgIC8vICAgICAgICBFbnRlcihCRUdJTiwgRU5EKVxuICAgIC8vIEJFR0lOOiBOb29wXG4gICAgLy8gICAgICAgIFB1dEFyZ3NcbiAgICAvLyAgICAgICAgVGVzdChFbnZpcm9ubWVudClcbiAgICAvLyAgICAgICAgSnVtcFVubGVzcyhFTFNFKVxuICAgIC8vICAgICAgICBFdmFsdWF0ZShkZWZhdWx0KVxuICAgIC8vICAgICAgICBKdW1wKEVORClcbiAgICAvLyBFTFNFOiAgTm9vcFxuICAgIC8vICAgICAgICBFdmFsdWF0ZShpbnZlcnNlKVxuICAgIC8vIEVORDogICBOb29wXG4gICAgLy8gICAgICAgIEV4aXRcblxuICAgIGxldCB7IGFyZ3MsIHRlbXBsYXRlcyB9ID0gdGhpcztcblxuICAgIGRzbC5ibG9jayh7IHRlbXBsYXRlcywgYXJncyB9LCAoZHNsLCBCRUdJTiwgRU5EKSA9PiB7XG4gICAgICBkc2wudGVzdCgnZW52aXJvbm1lbnQnKTtcblxuICAgICAgaWYgKHRlbXBsYXRlcy5pbnZlcnNlKSB7XG4gICAgICAgIGRzbC5qdW1wVW5sZXNzKCdFTFNFJyk7XG4gICAgICAgIGRzbC5ldmFsdWF0ZSgnZGVmYXVsdCcpO1xuICAgICAgICBkc2wuanVtcChFTkQpO1xuICAgICAgICBkc2wubGFiZWwoJ0VMU0UnKTtcbiAgICAgICAgZHNsLmV2YWx1YXRlKCdpbnZlcnNlJyk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBkc2wuanVtcFVubGVzcyhFTkQpO1xuICAgICAgICBkc2wuZXZhbHVhdGUoJ2RlZmF1bHQnKTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/syntax/core', ['exports', 'glimmer-runtime/lib/syntax', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/compiled/opcodes/component', 'glimmer-runtime/lib/compiled/opcodes/dom', 'glimmer-runtime/lib/syntax/expressions', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/compiled/expressions/value', 'glimmer-runtime/lib/compiled/expressions/lookups', 'glimmer-runtime/lib/compiled/expressions/has-block', 'glimmer-runtime/lib/compiled/expressions/has-block-params', 'glimmer-runtime/lib/compiled/expressions/helper', 'glimmer-runtime/lib/compiled/expressions/concat', 'glimmer-runtime/lib/utils', 'glimmer-runtime/lib/compiled/opcodes/content'], function (exports, _glimmerRuntimeLibSyntax, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibCompiledOpcodesComponent, _glimmerRuntimeLibCompiledOpcodesDom, _glimmerRuntimeLibSyntaxExpressions, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibCompiledExpressionsValue, _glimmerRuntimeLibCompiledExpressionsLookups, _glimmerRuntimeLibCompiledExpressionsHasBlock, _glimmerRuntimeLibCompiledExpressionsHasBlockParams, _glimmerRuntimeLibCompiledExpressionsHelper, _glimmerRuntimeLibCompiledExpressionsConcat, _glimmerRuntimeLibUtils, _glimmerRuntimeLibCompiledOpcodesContent) { 'use strict'; var Block = (function (_StatementSyntax) { babelHelpers.inherits(Block, _StatementSyntax); function Block(options) { _StatementSyntax.call(this); this.type = "block"; this.path = options.path; this.args = options.args; this.templates = options.templates; } Block.fromSpec = function fromSpec(sexp, symbolTable, scanner) { var path = sexp[1]; var params = sexp[2]; var hash = sexp[3]; var templateId = sexp[4]; var inverseId = sexp[5]; var template = scanner.blockFor(symbolTable, templateId); var inverse = typeof inverseId === 'number' ? scanner.blockFor(symbolTable, inverseId) : null; return new Block({ path: path, args: Args.fromSpec(params, hash), templates: Templates.fromSpec(template, inverse) }); }; Block.build = function build(options) { return new this(options); }; Block.prototype.scan = function scan(scanner) { var _templates = this.templates; var _default = _templates.default; var inverse = _templates.inverse; if (_default) scanner.addChild(_default); if (inverse) scanner.addChild(inverse); return this; }; Block.prototype.compile = function compile(ops) { throw new Error("SyntaxError"); }; return Block; })(_glimmerRuntimeLibSyntax.Statement); exports.Block = Block; var Append = (function (_StatementSyntax2) { babelHelpers.inherits(Append, _StatementSyntax2); Append.fromSpec = function fromSpec(sexp) { var value = sexp[1]; var trustingMorph = sexp[2]; return new OptimizedAppend({ value: _glimmerRuntimeLibSyntaxExpressions.default(value), trustingMorph: trustingMorph }); }; function Append(_ref) { var value = _ref.value; var trustingMorph = _ref.trustingMorph; _StatementSyntax2.call(this); this.value = value; this.trustingMorph = trustingMorph; } return Append; })(_glimmerRuntimeLibSyntax.Statement); var OptimizedAppend = (function (_Append) { babelHelpers.inherits(OptimizedAppend, _Append); function OptimizedAppend() { _Append.apply(this, arguments); this.type = "optimized-append"; } OptimizedAppend.prototype.deopt = function deopt() { return new UnoptimizedAppend(this); }; OptimizedAppend.prototype.compile = function compile(compiler, env, symbolTable) { compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode({ expression: this.value.compile(compiler, env, symbolTable) })); if (this.trustingMorph) { compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedTrustingAppendOpcode()); } else { compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.OptimizedCautiousAppendOpcode()); } }; return OptimizedAppend; })(Append); exports.OptimizedAppend = OptimizedAppend; var UnoptimizedAppend = (function (_Append2) { babelHelpers.inherits(UnoptimizedAppend, _Append2); function UnoptimizedAppend() { _Append2.apply(this, arguments); this.type = "unoptimized-append"; } UnoptimizedAppend.prototype.compile = function compile(compiler, env, symbolTable) { var expression = this.value.compile(compiler, env, symbolTable); if (this.trustingMorph) { compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.GuardedTrustingAppendOpcode(expression, symbolTable)); } else { compiler.append(new _glimmerRuntimeLibCompiledOpcodesContent.GuardedCautiousAppendOpcode(expression, symbolTable)); } }; return UnoptimizedAppend; })(Append); exports.UnoptimizedAppend = UnoptimizedAppend; var MODIFIER_SYNTAX = "c0420397-8ff1-4241-882b-4b7a107c9632"; exports.MODIFIER_SYNTAX = MODIFIER_SYNTAX; var Modifier = (function (_StatementSyntax3) { babelHelpers.inherits(Modifier, _StatementSyntax3); function Modifier(options) { _StatementSyntax3.call(this); this["c0420397-8ff1-4241-882b-4b7a107c9632"] = true; this.type = "modifier"; this.path = options.path; this.args = options.args; } Modifier.fromSpec = function fromSpec(node) { var path = node[1]; var params = node[2]; var hash = node[3]; return new Modifier({ path: path, args: Args.fromSpec(params, hash) }); }; Modifier.build = function build(path, options) { return new Modifier({ path: path, params: options.params, hash: options.hash }); }; Modifier.prototype.compile = function compile(compiler, env, symbolTable) { var args = this.args.compile(compiler, env, symbolTable); if (env.hasModifier(this.path, symbolTable)) { compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.ModifierOpcode(this.path[0], env.lookupModifier(this.path, symbolTable), args)); } else { throw new Error('Compile Error: ' + this.path.join('.') + ' is not a modifier'); } }; return Modifier; })(_glimmerRuntimeLibSyntax.Statement); exports.Modifier = Modifier; var StaticArg = (function (_ArgumentSyntax) { babelHelpers.inherits(StaticArg, _ArgumentSyntax); function StaticArg(_ref2) { var name = _ref2.name; var value = _ref2.value; _ArgumentSyntax.call(this); this.type = "static-arg"; this.name = name; this.value = value; } StaticArg.fromSpec = function fromSpec(node) { var name = node[1]; var value = node[2]; return new StaticArg({ name: name, value: value }); }; StaticArg.build = function build(name, value) { var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; return new this({ name: name, value: value }); }; StaticArg.prototype.compile = function compile() { throw new Error('Cannot compiler StaticArg "' + this.name + '" as it is a delegate for ValueSyntax.'); }; StaticArg.prototype.valueSyntax = function valueSyntax() { return Value.build(this.value); }; return StaticArg; })(_glimmerRuntimeLibSyntax.Argument); exports.StaticArg = StaticArg; var DynamicArg = (function (_ArgumentSyntax2) { babelHelpers.inherits(DynamicArg, _ArgumentSyntax2); function DynamicArg(_ref3) { var name = _ref3.name; var value = _ref3.value; var _ref3$namespace = _ref3.namespace; var namespace = _ref3$namespace === undefined ? null : _ref3$namespace; _ArgumentSyntax2.call(this); this.type = 'dynamic-arg'; this.name = name; this.value = value; this.namespace = namespace; } DynamicArg.fromSpec = function fromSpec(sexp) { var name = sexp[1]; var value = sexp[2]; return new DynamicArg({ name: name, value: _glimmerRuntimeLibSyntaxExpressions.default(value) }); }; DynamicArg.build = function build(name, value) { return new this({ name: name, value: value }); }; DynamicArg.prototype.compile = function compile() { throw new Error('Cannot compile DynamicArg for "' + this.name + '" as it is delegate for ExpressionSyntax.'); }; DynamicArg.prototype.valueSyntax = function valueSyntax() { return this.value; }; return DynamicArg; })(_glimmerRuntimeLibSyntax.Argument); exports.DynamicArg = DynamicArg; var TrustingAttr = (function () { function TrustingAttr() {} TrustingAttr.fromSpec = function fromSpec(sexp) { var name = sexp[1]; var value = sexp[2]; var namespace = sexp[3]; return new DynamicAttr({ name: name, namespace: namespace, isTrusting: true, value: _glimmerRuntimeLibSyntaxExpressions.default(value) }); }; TrustingAttr.build = function build(name, value, isTrusting) { var namespace = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; return new DynamicAttr({ name: name, value: value, namespace: namespace, isTrusting: isTrusting }); }; TrustingAttr.prototype.compile = function compile() { throw new Error('Attempting to compile a TrustingAttr which is just a delegate for DynamicAttr.'); }; return TrustingAttr; })(); exports.TrustingAttr = TrustingAttr; var StaticAttr = (function (_AttributeSyntax) { babelHelpers.inherits(StaticAttr, _AttributeSyntax); function StaticAttr(_ref4) { var name = _ref4.name; var value = _ref4.value; var _ref4$namespace = _ref4.namespace; var namespace = _ref4$namespace === undefined ? null : _ref4$namespace; _AttributeSyntax.call(this); this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; this.type = "static-attr"; this.isTrusting = false; this.name = name; this.value = value; this.namespace = namespace; } StaticAttr.fromSpec = function fromSpec(node) { var name = node[1]; var value = node[2]; var namespace = node[3]; return new StaticAttr({ name: name, value: value, namespace: namespace }); }; StaticAttr.build = function build(name, value) { var namespace = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; return new this({ name: name, value: value, namespace: namespace }); }; StaticAttr.prototype.compile = function compile(compiler) { compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.StaticAttrOpcode(this)); }; StaticAttr.prototype.valueSyntax = function valueSyntax() { return Value.build(this.value); }; return StaticAttr; })(_glimmerRuntimeLibSyntax.Attribute); exports.StaticAttr = StaticAttr; var DynamicAttr = (function (_AttributeSyntax2) { babelHelpers.inherits(DynamicAttr, _AttributeSyntax2); function DynamicAttr(_ref5) { var name = _ref5.name; var value = _ref5.value; var _ref5$isTrusting = _ref5.isTrusting; var isTrusting = _ref5$isTrusting === undefined ? false : _ref5$isTrusting; var _ref5$namespace = _ref5.namespace; var namespace = _ref5$namespace === undefined ? null : _ref5$namespace; _AttributeSyntax2.call(this); this["e1185d30-7cac-4b12-b26a-35327d905d92"] = true; this.type = "dynamic-attr"; this.name = name; this.value = value; this.namespace = namespace; this.isTrusting = isTrusting; } DynamicAttr.fromSpec = function fromSpec(sexp) { var name = sexp[1]; var value = sexp[2]; var namespace = sexp[3]; return new DynamicAttr({ name: name, namespace: namespace, value: _glimmerRuntimeLibSyntaxExpressions.default(value) }); }; DynamicAttr.build = function build(name, value) { var isTrusting = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; var namespace = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; return new this({ name: name, value: value, namespace: namespace, isTrusting: isTrusting }); }; DynamicAttr.prototype.compile = function compile(compiler, env, symbolTable) { var namespace = this.namespace; var value = this.value; compiler.append(new _glimmerRuntimeLibCompiledOpcodesVm.PutValueOpcode({ expression: value.compile(compiler, env, symbolTable) })); if (namespace) { compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrNSOpcode(this)); } else { compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.DynamicAttrOpcode(this)); } }; DynamicAttr.prototype.valueSyntax = function valueSyntax() { return this.value; }; return DynamicAttr; })(_glimmerRuntimeLibSyntax.Attribute); exports.DynamicAttr = DynamicAttr; var FlushElement = (function (_StatementSyntax4) { babelHelpers.inherits(FlushElement, _StatementSyntax4); function FlushElement() { _StatementSyntax4.apply(this, arguments); this.type = "flush-element"; } FlushElement.fromSpec = function fromSpec() { return new FlushElement(); }; FlushElement.build = function build() { return new this(); }; FlushElement.prototype.compile = function compile(compiler) { compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.FlushElementOpcode()); }; return FlushElement; })(_glimmerRuntimeLibSyntax.Statement); exports.FlushElement = FlushElement; var CloseElement = (function (_StatementSyntax5) { babelHelpers.inherits(CloseElement, _StatementSyntax5); function CloseElement() { _StatementSyntax5.apply(this, arguments); this.type = "close-element"; } CloseElement.fromSpec = function fromSpec() { return new CloseElement(); }; CloseElement.build = function build() { return new this(); }; CloseElement.prototype.compile = function compile(compiler) { compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.CloseElementOpcode()); }; return CloseElement; })(_glimmerRuntimeLibSyntax.Statement); exports.CloseElement = CloseElement; var Text = (function (_StatementSyntax6) { babelHelpers.inherits(Text, _StatementSyntax6); function Text(options) { _StatementSyntax6.call(this); this.type = "text"; this.content = options.content; } Text.fromSpec = function fromSpec(node) { var content = node[1]; return new Text({ content: content }); }; Text.build = function build(content) { return new this({ content: content }); }; Text.prototype.compile = function compile(dsl) { dsl.text(this.content); }; return Text; })(_glimmerRuntimeLibSyntax.Statement); exports.Text = Text; var Comment = (function (_StatementSyntax7) { babelHelpers.inherits(Comment, _StatementSyntax7); function Comment(options) { _StatementSyntax7.call(this); this.type = "comment"; this.comment = options.value; } Comment.fromSpec = function fromSpec(sexp) { var value = sexp[1]; return new Comment({ value: value }); }; Comment.build = function build(value) { return new this({ value: value }); }; Comment.prototype.compile = function compile(dsl) { dsl.comment(this.comment); }; return Comment; })(_glimmerRuntimeLibSyntax.Statement); exports.Comment = Comment; var OpenElement = (function (_StatementSyntax8) { babelHelpers.inherits(OpenElement, _StatementSyntax8); function OpenElement(options) { _StatementSyntax8.call(this); this.type = "open-element"; this.tag = options.tag; this.blockParams = options.blockParams; this.symbolTable = options.symbolTable; } OpenElement.fromSpec = function fromSpec(sexp, symbolTable) { var tag = sexp[1]; var blockParams = sexp[2]; return new OpenElement({ tag: tag, blockParams: blockParams, symbolTable: symbolTable }); }; OpenElement.build = function build(tag, blockParams, symbolTable) { return new this({ tag: tag, blockParams: blockParams, symbolTable: symbolTable }); }; OpenElement.prototype.scan = function scan(scanner) { var tag = this.tag; if (scanner.env.hasComponentDefinition([tag], this.symbolTable)) { var _parameters = this.parameters(scanner); var args = _parameters.args; var attrs = _parameters.attrs; scanner.startBlock(this.blockParams); this.tagContents(scanner); var template = scanner.endBlock(this.blockParams); return new Component(tag, attrs, args, template); } else { return new OpenPrimitiveElement({ tag: tag }); } }; OpenElement.prototype.compile = function compile(list, env) { list.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(this.tag)); }; OpenElement.prototype.toIdentity = function toIdentity() { var tag = this.tag; return new OpenPrimitiveElement({ tag: tag }); }; OpenElement.prototype.parameters = function parameters(scanner) { var current = scanner.next(); var attrs = []; var argKeys = []; var argValues = []; while (!(current instanceof FlushElement)) { if (current[MODIFIER_SYNTAX]) { throw new Error('Compile Error: Element modifiers are not allowed in components'); } var param = current; if (current[_glimmerRuntimeLibSyntax.ATTRIBUTE]) { attrs.push(param.name); // REMOVE ME: attributes should not be treated as args argKeys.push(param.name); argValues.push(param.valueSyntax()); } else if (current[_glimmerRuntimeLibSyntax.ARGUMENT]) { argKeys.push(param.name); argValues.push(param.valueSyntax()); } else { throw new Error("Expected FlushElement, but got ${current}"); } current = scanner.next(); } return { args: Args.fromNamedArgs(NamedArgs.build(argKeys, argValues)), attrs: attrs }; }; OpenElement.prototype.tagContents = function tagContents(scanner) { var nesting = 1; while (true) { var current = scanner.next(); if (current instanceof CloseElement && --nesting === 0) { break; } scanner.addStatement(current); if (current instanceof OpenElement || current instanceof OpenPrimitiveElement) { nesting++; } } }; return OpenElement; })(_glimmerRuntimeLibSyntax.Statement); exports.OpenElement = OpenElement; var Component = (function (_StatementSyntax9) { babelHelpers.inherits(Component, _StatementSyntax9); function Component(tag, attrs, args, template) { _StatementSyntax9.call(this); this.tag = tag; this.attrs = attrs; this.args = args; this.template = template; this.type = 'component'; } Component.prototype.compile = function compile(list, env, symbolTable) { var definition = env.getComponentDefinition([this.tag], symbolTable); var args = this.args.compile(list, env, symbolTable); var shadow = this.attrs; var templates = new Templates(this.template); list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.PutComponentDefinitionOpcode(definition)); list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.OpenComponentOpcode(args, shadow, templates)); list.append(new _glimmerRuntimeLibCompiledOpcodesComponent.CloseComponentOpcode()); }; return Component; })(_glimmerRuntimeLibSyntax.Statement); exports.Component = Component; var OpenPrimitiveElement = (function (_StatementSyntax10) { babelHelpers.inherits(OpenPrimitiveElement, _StatementSyntax10); function OpenPrimitiveElement(options) { _StatementSyntax10.call(this); this.type = "open-primitive-element"; this.tag = options.tag; } OpenPrimitiveElement.build = function build(tag) { return new this({ tag: tag }); }; OpenPrimitiveElement.prototype.compile = function compile(compiler) { compiler.append(new _glimmerRuntimeLibCompiledOpcodesDom.OpenPrimitiveElementOpcode(this.tag)); }; return OpenPrimitiveElement; })(_glimmerRuntimeLibSyntax.Statement); exports.OpenPrimitiveElement = OpenPrimitiveElement; var Yield = (function (_StatementSyntax11) { babelHelpers.inherits(Yield, _StatementSyntax11); function Yield(_ref6) { var to = _ref6.to; var args = _ref6.args; _StatementSyntax11.call(this); this.type = "yield"; this.to = to; this.args = args; } Yield.fromSpec = function fromSpec(sexp) { var to = sexp[1]; var params = sexp[2]; var args = Args.fromSpec(params, null); return new Yield({ to: to, args: args }); }; Yield.build = function build(params, to) { var args = Args.fromPositionalArgs(PositionalArgs.build(params)); return new this({ to: to, args: args }); }; Yield.prototype.compile = function compile(dsl, env, symbolTable) { var to = dsl.getBlockSymbol(this.to); var args = this.args.compile(dsl, env, symbolTable); dsl.append(new OpenBlockOpcode({ to: to, label: this.to, args: args })); dsl.append(new CloseBlockOpcode()); }; return Yield; })(_glimmerRuntimeLibSyntax.Statement); exports.Yield = Yield; var OpenBlockOpcode = (function (_Opcode) { babelHelpers.inherits(OpenBlockOpcode, _Opcode); function OpenBlockOpcode(_ref7) { var to = _ref7.to; var label = _ref7.label; var args = _ref7.args; _Opcode.call(this); this.type = "open-block"; this.to = to; this.label = label; this.args = args; } OpenBlockOpcode.prototype.evaluate = function evaluate(vm) { var block = vm.scope().getBlock(this.to); var args = undefined; if (block) { args = this.args.evaluate(vm); } // FIXME: can we avoid doing this when we don't have a block? vm.pushCallerScope(); if (block) { vm.invokeBlock(block, args); } }; return OpenBlockOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); var CloseBlockOpcode = (function (_Opcode2) { babelHelpers.inherits(CloseBlockOpcode, _Opcode2); function CloseBlockOpcode() { _Opcode2.apply(this, arguments); this.type = "close-block"; } CloseBlockOpcode.prototype.evaluate = function evaluate(vm) { vm.popScope(); }; return CloseBlockOpcode; })(_glimmerRuntimeLibOpcodes.Opcode); exports.CloseBlockOpcode = CloseBlockOpcode; var Value = (function (_ExpressionSyntax) { babelHelpers.inherits(Value, _ExpressionSyntax); function Value(value) { _ExpressionSyntax.call(this); this.type = "value"; this.value = value; } Value.fromSpec = function fromSpec(value) { return new Value(value); }; Value.build = function build(value) { return new this(value); }; Value.prototype.inner = function inner() { return this.value; }; Value.prototype.compile = function compile(compiler) { return new _glimmerRuntimeLibCompiledExpressionsValue.default(this); }; return Value; })(_glimmerRuntimeLibSyntax.Expression); exports.Value = Value; var GetArgument = (function (_ExpressionSyntax2) { babelHelpers.inherits(GetArgument, _ExpressionSyntax2); function GetArgument(options) { _ExpressionSyntax2.call(this); this.type = "get-argument"; this.parts = options.parts; } // this is separated out from Get because Unknown also has a ref, but it // may turn out to be a helper GetArgument.fromSpec = function fromSpec(sexp) { var parts = sexp[1]; return new GetArgument({ parts: parts }); }; GetArgument.build = function build(path) { return new this({ parts: path.split('.') }); }; GetArgument.prototype.compile = function compile(lookup) { var parts = this.parts; var head = parts[0]; var symbol = lookup.getNamedSymbol(head); var path = parts.slice(1); return new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledLocalLookup(symbol, path, head); }; return GetArgument; })(_glimmerRuntimeLibSyntax.Expression); exports.GetArgument = GetArgument; var Ref = (function (_ExpressionSyntax3) { babelHelpers.inherits(Ref, _ExpressionSyntax3); function Ref(parts) { _ExpressionSyntax3.call(this); this.parts = parts; this.type = "ref"; this.parts = parts; } Ref.build = function build(path) { var parts = path.split('.'); if (parts[0] === 'this') { parts[0] = null; } return new this(parts); }; Ref.prototype.compile = function compile(lookup) { var parts = this.parts; var head = parts[0]; var path = parts.slice(1); if (head === null) { return new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSelfLookup(path); } else if (lookup.hasLocalSymbol(head)) { var symbol = lookup.getLocalSymbol(head); return new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledLocalLookup(symbol, path, head); } else { return new _glimmerRuntimeLibCompiledExpressionsLookups.CompiledSelfLookup(parts); } }; return Ref; })(_glimmerRuntimeLibSyntax.Expression); exports.Ref = Ref; var Get = (function (_ExpressionSyntax4) { babelHelpers.inherits(Get, _ExpressionSyntax4); function Get(ref) { _ExpressionSyntax4.call(this); this.ref = ref; this.type = "get"; } Get.fromSpec = function fromSpec(sexp) { var parts = sexp[1]; return new this(new Ref(parts)); }; Get.build = function build(path) { return new this(Ref.build(path)); }; Get.prototype.compile = function compile(compiler) { return this.ref.compile(compiler); }; return Get; })(_glimmerRuntimeLibSyntax.Expression); exports.Get = Get; var Unknown = (function (_ExpressionSyntax5) { babelHelpers.inherits(Unknown, _ExpressionSyntax5); function Unknown(ref) { _ExpressionSyntax5.call(this); this.ref = ref; this.type = "unknown"; } Unknown.fromSpec = function fromSpec(sexp) { var path = sexp[1]; return new this(new Ref(path)); }; Unknown.build = function build(path) { return new this(Ref.build(path)); }; Unknown.prototype.compile = function compile(compiler, env, symbolTable) { var ref = this.ref; if (env.hasHelper(ref.parts, symbolTable)) { return new _glimmerRuntimeLibCompiledExpressionsHelper.default(ref.parts, env.lookupHelper(ref.parts, symbolTable), _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.empty(), symbolTable); } else { return this.ref.compile(compiler); } }; return Unknown; })(_glimmerRuntimeLibSyntax.Expression); exports.Unknown = Unknown; var Helper = (function (_ExpressionSyntax6) { babelHelpers.inherits(Helper, _ExpressionSyntax6); function Helper(options) { _ExpressionSyntax6.call(this); this.type = "helper"; this.isStatic = false; this.ref = options.ref; this.args = options.args; } Helper.fromSpec = function fromSpec(sexp) { var path = sexp[1]; var params = sexp[2]; var hash = sexp[3]; return new Helper({ ref: new Ref(path), args: Args.fromSpec(params, hash) }); }; Helper.build = function build(path, positional, named) { return new this({ ref: Ref.build(path), args: Args.build(positional, named) }); }; Helper.prototype.compile = function compile(compiler, env, symbolTable) { if (env.hasHelper(this.ref.parts, symbolTable)) { var args = this.args; var ref = this.ref; return new _glimmerRuntimeLibCompiledExpressionsHelper.default(ref.parts, env.lookupHelper(ref.parts, symbolTable), args.compile(compiler, env, symbolTable), symbolTable); } else { throw new Error('Compile Error: ' + this.ref.parts.join('.') + ' is not a helper'); } }; return Helper; })(_glimmerRuntimeLibSyntax.Expression); exports.Helper = Helper; var HasBlock = (function (_ExpressionSyntax7) { babelHelpers.inherits(HasBlock, _ExpressionSyntax7); function HasBlock(_ref8) { var blockName = _ref8.blockName; _ExpressionSyntax7.call(this); this.type = "has-block"; this.blockName = blockName; } HasBlock.fromSpec = function fromSpec(sexp) { var blockName = sexp[1]; return new HasBlock({ blockName: blockName }); }; HasBlock.build = function build(blockName) { return new this({ blockName: blockName }); }; HasBlock.prototype.compile = function compile(compiler, env) { return new _glimmerRuntimeLibCompiledExpressionsHasBlock.default({ blockName: this.blockName, blockSymbol: compiler.getBlockSymbol(this.blockName) }); }; return HasBlock; })(_glimmerRuntimeLibSyntax.Expression); exports.HasBlock = HasBlock; var HasBlockParams = (function (_ExpressionSyntax8) { babelHelpers.inherits(HasBlockParams, _ExpressionSyntax8); function HasBlockParams(_ref9) { var blockName = _ref9.blockName; _ExpressionSyntax8.call(this); this.type = "has-block-params"; this.blockName = blockName; } HasBlockParams.fromSpec = function fromSpec(sexp) { var blockName = sexp[1]; return new HasBlockParams({ blockName: blockName }); }; HasBlockParams.build = function build(blockName) { return new this({ blockName: blockName }); }; HasBlockParams.prototype.compile = function compile(compiler, env) { return new _glimmerRuntimeLibCompiledExpressionsHasBlockParams.default({ blockName: this.blockName, blockSymbol: compiler.getBlockSymbol(this.blockName) }); }; return HasBlockParams; })(_glimmerRuntimeLibSyntax.Expression); exports.HasBlockParams = HasBlockParams; var Concat = (function () { function Concat(_ref10) { var parts = _ref10.parts; this.type = "concat"; this.isStatic = false; this.parts = parts; } Concat.fromSpec = function fromSpec(sexp) { var params = sexp[1]; return new Concat({ parts: params.map(_glimmerRuntimeLibSyntaxExpressions.default) }); }; Concat.build = function build(parts) { return new this({ parts: parts }); }; Concat.prototype.compile = function compile(compiler, env, symbolTable) { return new _glimmerRuntimeLibCompiledExpressionsConcat.default({ parts: this.parts.map(function (p) { return p.compile(compiler, env, symbolTable); }) }); }; return Concat; })(); exports.Concat = Concat; var Args = (function () { function Args(positional, named) { this.positional = positional; this.named = named; this.type = "args"; } Args.empty = function empty() { return EMPTY_ARGS; }; Args.fromSpec = function fromSpec(positional, named) { return new Args(PositionalArgs.fromSpec(positional), NamedArgs.fromSpec(named)); }; Args.fromPositionalArgs = function fromPositionalArgs(positional) { return new Args(positional, EMPTY_NAMED_ARGS); }; Args.fromNamedArgs = function fromNamedArgs(named) { return new Args(EMPTY_POSITIONAL_ARGS, named); }; Args.build = function build(positional, named) { if (positional === EMPTY_POSITIONAL_ARGS && named === EMPTY_NAMED_ARGS) { return EMPTY_ARGS; } else { return new this(positional, named); } }; Args.prototype.compile = function compile(compiler, env, symbolTable) { var positional = this.positional; var named = this.named; return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.create(positional.compile(compiler, env, symbolTable), named.compile(compiler, env, symbolTable)); }; return Args; })(); exports.Args = Args; var PositionalArgs = (function () { function PositionalArgs(values) { this.values = values; this.type = "positional"; this.length = values.length; } PositionalArgs.empty = function empty() { return EMPTY_POSITIONAL_ARGS; }; PositionalArgs.fromSpec = function fromSpec(sexp) { if (!sexp || sexp.length === 0) return EMPTY_POSITIONAL_ARGS; return new PositionalArgs(sexp.map(_glimmerRuntimeLibSyntaxExpressions.default)); }; PositionalArgs.build = function build(exprs) { if (exprs.length === 0) { return EMPTY_POSITIONAL_ARGS; } else { return new this(exprs); } }; PositionalArgs.prototype.slice = function slice(start, end) { return PositionalArgs.build(this.values.slice(start, end)); }; PositionalArgs.prototype.at = function at(index) { return this.values[index]; }; PositionalArgs.prototype.compile = function compile(compiler, env, symbolTable) { return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs.create(this.values.map(function (v) { return v.compile(compiler, env, symbolTable); })); }; return PositionalArgs; })(); exports.PositionalArgs = PositionalArgs; var EMPTY_POSITIONAL_ARGS = new ((function (_PositionalArgs) { babelHelpers.inherits(_class, _PositionalArgs); function _class() { _PositionalArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY); } _class.prototype.slice = function slice(start, end) { return this; }; _class.prototype.at = function at(index) { return undefined; // ??! }; _class.prototype.compile = function compile(compiler, env) { return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledPositionalArgs.empty(); }; return _class; })(PositionalArgs))(); var NamedArgs = (function () { function NamedArgs(keys, values) { this.keys = keys; this.values = values; this.type = "named"; this.length = keys.length; } NamedArgs.empty = function empty() { return EMPTY_NAMED_ARGS; }; NamedArgs.fromSpec = function fromSpec(sexp) { if (sexp === null || sexp === undefined) { return EMPTY_NAMED_ARGS; } var keys = sexp[0]; var exprs = sexp[1]; if (keys.length === 0) { return EMPTY_NAMED_ARGS; } return new this(keys, exprs.map(function (expr) { return _glimmerRuntimeLibSyntaxExpressions.default(expr); })); }; NamedArgs.build = function build(keys, values) { if (keys.length === 0) { return EMPTY_NAMED_ARGS; } else { return new this(keys, values); } }; NamedArgs.prototype.at = function at(key) { var keys = this.keys; var values = this.values; var index = keys.indexOf(key); return values[index]; }; NamedArgs.prototype.has = function has(key) { return this.keys.indexOf(key) !== -1; }; NamedArgs.prototype.compile = function compile(compiler, env, symbolTable) { var keys = this.keys; var values = this.values; return new _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs(keys, values.map(function (value) { return value.compile(compiler, env, symbolTable); })); }; return NamedArgs; })(); exports.NamedArgs = NamedArgs; var EMPTY_NAMED_ARGS = new ((function (_NamedArgs) { babelHelpers.inherits(_class2, _NamedArgs); function _class2() { _NamedArgs.call(this, _glimmerRuntimeLibUtils.EMPTY_ARRAY, _glimmerRuntimeLibUtils.EMPTY_ARRAY); } _class2.prototype.at = function at(key) { return undefined; // ??! }; _class2.prototype.has = function has(key) { return false; }; _class2.prototype.compile = function compile(compiler, env) { return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledNamedArgs.empty(); }; return _class2; })(NamedArgs))(); var EMPTY_ARGS = new ((function (_Args) { babelHelpers.inherits(_class3, _Args); function _class3() { _Args.call(this, EMPTY_POSITIONAL_ARGS, EMPTY_NAMED_ARGS); } _class3.prototype.compile = function compile(compiler, env) { return _glimmerRuntimeLibCompiledExpressionsArgs.CompiledArgs.empty(); }; return _class3; })(Args))(); var Templates = (function () { function Templates(_default) { var inverse = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; this.type = "templates"; this.default = _default; this.inverse = inverse; } Templates.fromSpec = function fromSpec(_default) { var inverse = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; return new Templates(_default, inverse); }; Templates.empty = function empty() { return new Templates(null, null); }; return Templates; })(); exports.Templates = Templates; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3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ucGF0aCA9IG9wdGlvbnMucGF0aDtcbiAgICAgICAgdGhpcy5hcmdzID0gb3B0aW9ucy5hcmdzO1xuICAgIH1cbiAgICBzdGF0aWMgZnJvbVNwZWMobm9kZSkge1xuICAgICAgICBsZXQgWywgcGF0aCwgcGFyYW1zLCBoYXNoXSA9IG5vZGU7XG4gICAgICAgIHJldHVybiBuZXcgTW9kaWZpZXIoe1xuICAgICAgICAgICAgcGF0aCxcbiAgICAgICAgICAgIGFyZ3M6IEFyZ3MuZnJvbVNwZWMocGFyYW1zLCBoYXNoKVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgc3RhdGljIGJ1aWxkKHBhdGgsIG9wdGlvbnMpIHtcbiAgICAgICAgcmV0dXJuIG5ldyBNb2RpZmllcih7XG4gICAgICAgICAgICBwYXRoLFxuICAgICAgICAgICAgcGFyYW1zOiBvcHRpb25zLnBhcmFtcyxcbiAgICAgICAgICAgIGhhc2g6IG9wdGlvbnMuaGFzaFxuICAgICAgICB9KTtcbiAgICB9XG4gICAgY29tcGlsZShjb21waWxlciwgZW52LCBzeW1ib2xUYWJsZSkge1xuICAgICAgICBsZXQgYXJncyA9IHRoaXMuYXJncy5jb21waWxlKGNvbXBpbGVyLCBlbnYsIHN5bWJvbFRhYmxlKTtcbiAgICAgICAgaWYgKGVudi5oYXNNb2RpZmllcih0aGlzLnBhdGgsIHN5bWJvbFRhYmxlKSkge1xuICAgICAgICAgICAgY29tcGlsZXIuYXBwZW5kKG5ldyBNb2RpZmllck9wY29kZSh0aGlzLnBhdGhbMF0sIGVudi5sb29rdXBNb2RpZmllcih0aGlzLnBhdGgsIHN5bWJvbFRhYmxlKSwgYXJncykpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBDb21waWxlIEVycm9yOiAke3RoaXMucGF0aC5qb2luKCcuJyl9IGlzIG5vdCBhIG1vZGlmaWVyYCk7XG4gICAgICAgIH1cbiAgICB9XG59XG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XJhbXNdID0gc2V4cDtcbiAgICAgICAgcmV0dXJuIG5ldyBPcGVuRWxlbWVudCh7XG4gICAgICAgICAgICB0YWcsXG4gICAgICAgICAgICBibG9ja1BhcmFtcyxcbiAgICAgICAgICAgIHN5bWJvbFRhYmxlXG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBzdGF0aWMgYnVpbGQodGFnLCBibG9ja1BhcmFtcywgc3ltYm9sVGFibGUpIHtcbiAgICAgICAgcmV0dXJuIG5ldyB0aGlzKHsgdGFnLCBibG9ja1BhcmFtcywgc3ltYm9sVGFibGUgfSk7XG4gICAgfVxuICAgIHNjYW4oc2Nhbm5lcikge1xuICAgICAgICBsZXQgeyB0YWcgfSA9IHRoaXM7XG4gICAgICAgIGlmIChzY2FubmVyLmVudi5oYXNDb21wb25lbnREZWZpbml0aW9uKFt0YWddLCB0aGlzLnN5bWJvbFRhYmxlKSkge1xuICAgICAgICAgICAgbGV0IHsgYXJncywgYXR0cnMgfSA9IHRoaXMucGFyYW1ldGVycyhzY2FubmVyKTtcbiAgICAgICAgICAgIHNjYW5uZXIuc3RhcnRCbG9jayh0aGlzLmJsb2NrUGFyYW1zKTtcbiAgICAgICAgICAgIHRoaXMudGFnQ29udGVudHMoc2Nhbm5lcik7XG4gICAgICAgICAgICBsZXQgdGVtcGxhdGUgPSBzY2FubmVyLmVuZEJsb2NrKHRoaXMuYmxvY2tQYXJhbXMpO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBDb21wb25lbnQodGFnLCBhdHRycywgYXJncywgdGVtcGxhdGUpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBPcGVuUHJpbWl0aXZlRWxlbWVudCh7IHRhZyB9KTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBjb21waWxlKGxpc3QsIGVudikge1xuICAgICAgICBsaXN0LmFwcGVuZChuZXcgT3BlblByaW1pdGl2ZUVsZW1lbnRPcGNvZGUodGhpcy50YWcpKTtcbiAgICB9XG4gICAgdG9JZGVudGl0eSgpIHtcbiAgICAgICAgbGV0IHsgdGFnIH0gPSB0aGlzO1xuICAgICAgICByZXR1cm4gbmV3IE9wZW5QcmltaXRpdmVFbGVtZW50KHsgdGFnIH0pO1xuICAgIH1cbiAgICBwYXJhbWV0ZXJzKHNjYW5uZXIpIHtcbiAgICAgICAgbGV0IGN1cnJlbnQgPSBzY2FubmVyLm5leHQoKTtcbiAgICAgICAgbGV0IGF0dHJzID0gW107XG4gICAgICAgIGxldCBhcmdLZXlzID0gW107XG4gICAgICAgIGxldCBhcmdWYWx1ZXMgPSBbXTtcbiAgICAgICAgd2hpbGUgKCEoY3VycmVudCBpbnN0YW5jZW9mIEZsdXNoRWxlbWVudCkpIHtcbiAgICAgICAgICAgIGlmIChjdXJyZW50W01PRElGSUVSX1NZTlRBWF0pIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYENvbXBpbGUgRXJyb3I6IEVsZW1lbnQgbW9kaWZpZXJzIGFyZSBub3QgYWxsb3dlZCBpbiBjb21wb25lbnRzYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcGFyYW0gPSBjdXJyZW50O1xuICAgICAgICAgICAgaWYgKGN1cnJlbnRbQVRUUklCVVRFX1NZTlRBWF0pIHtcbiAgICAgICAgICAgICAgICBhdHRycy5wdXNoKHBhcmFtLm5hbWUpO1xuICAgICAgICAgICAgICAgIC8vIFJFTU9WRSBNRTogYXR0cmlidXRlcyBzaG91bGQgbm90IGJlIHRyZWF0ZWQgYXMgYXJnc1xuICAgICAgICAgICAgICAgIGFyZ0tleXMucHVzaChwYXJhbS5uYW1lKTtcbiAgICAgICAgICAgICAgICBhcmdWYWx1ZXMucHVzaChwYXJhbS52YWx1ZVN5bnRheCgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGN1cnJlbnRbQVJHVU1FTlRfU1lOVEFYXSkge1xuICAgICAgICAgICA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BsZXQgeyBwYXJ0cyB9ID0gdGhpcztcbiAgICAgICAgbGV0IGhlYWQgPSBwYXJ0c1swXTtcbiAgICAgICAgbGV0IHBhdGggPSBwYXJ0cy5zbGljZSgxKTtcbiAgICAgICAgaWYgKGhlYWQgPT09IG51bGwpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgQ29tcGlsZWRTZWxmTG9va3VwKHBhdGgpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGxvb2t1cC5oYXNMb2NhbFN5bWJvbChoZWFkKSkge1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGxvb2t1cC5nZXRMb2NhbFN5bWJvbChoZWFkKTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgQ29tcGlsZWRMb2NhbExvb2t1cChzeW1ib2wsIHBhdGgsIGhlYWQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBDb21waWxlZFNlbGZMb29rdXAocGFydHMpO1xuICAgICAgICB9XG4gICAgfVxufVxuZXhwb3J0IGNsYXNzIEdldCBleHRlbmRzIEV4cHJlc3Npb25TeW50YXgge1xuICAgIGNvbnN0cnVjdG9yKHJlZikge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLnJlZiA9IHJlZjtcbiAgICAgICAgdGhpcy50eXBlID0gXCJnZXRcIjtcbiAgICB9XG4gICAgc3RhdGljIGZyb21TcGVjKHNleHApIHtcbiAgICAgICAgbGV0IFssIHBhcnRzXSA9IHNleHA7XG4gICAgICAgIHJldHVybiBuZXcgdGhpcyhuZXcgUmVmKHBhcnRzKSk7XG4gICAgfVxuICAgIHN0YXRpYyBidWlsZChwYXRoKSB7XG4gICAgICAgIHJldHVybiBuZXcgdGhpcyhSZWYuYnVpbGQocGF0aCkpO1xuICAgIH1cbiAgICBjb21waWxlKGNvbXBpbGVyKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnJlZi5jb21waWxlKGNvbXBpbGVyKTtcbiAgICB9XG59XG5leHBvcnQgY2xhc3MgVW5rbm93biBleHRlbmRzIEV4cHJlc3Npb25TeW50YXgge1xuICAgIGNvbnN0cnVjdG9yKHJlZikge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLnJlZiA9IHJlZjtcbiAgICAgICAgdGhpcy50eXBlID0gXCJ1bmtub3duXCI7XG4gICAgfVxuICAgIHN0YXRpYyBmcm9tU3BlYyhzZXhwKSB7XG4gICAgICAgIGxldCBbLCBwYXRoXSA9IHNleHA7XG4gICAgICAgIHJldHVybiBuZXcgdGhpcyhuZXcgUmVmKHBhdGgpKTtcbiAgICB9XG4gICAgc3RhdGljIGJ1aWxkKHBhdGgpIHtcbiAgICAgICAgcmV0dXJuIG5ldyB0aGlzKFJlZi5idWlsZChwYXRoKSk7XG4gICAgfVxuICAgIGNvbXBpbGUoY29tcGlsZXIsIGVudiwgc3ltYm9sVGFibGUpIHtcbiAgICAgICAgbGV0IHsgcmVmIH0gPSB0aGlzO1xuICAgICAgICBpZiAoZW52Lmhhc0hlbHBlcihyZWYucGFydHMsIHN5bWJvbFRhYmxlKSkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBDb21waWxlZEhlbHBlcihyZWYucGFydHMsIGVudi5sb29rdXBIZWxwZXIocmVmLnBhcnRzLCBzeW1ib2xUYWJsZSksIENvbXBpbGVkQXJncy5lbXB0eSgpLCBzeW1ib2xUYWJsZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5yZWYuY29tcGlsZShjb21waWxlcik7XG4gICAgICAgIH1cbiAgICB9XG59XG5leHBvcnQgY2xhc3MgSGVscGVyIGV4dGVuZHMgRXhwcmVzc2lvblN5bnRheCB7XG4gICAgY29uc3RydWN0b3Iob3B0aW9ucykge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLnR5cGUgPSBcImhlbHBlclwiO1xuICAgICAgICB0aGlzLmlzU3RhdGljID0gZmFsc2U7XG4gICAgICAgIHRoaXMucmVmID0gb3B0aW9ucy5yZWY7XG4gICAgICAgIHRoaXMuYXJncyA9IG9wdGlvbnMuYXJncztcbiAgICB9XG4gICAgc3RhdGljIGZyb21TcGVjKHNleHApIHtcbiAgICAgICAgbGV0IFssIHBhdGgsIHBhcmFtcywgaGFzaF0gPSBzZXhwO1xuICAgICAgICByZXR1cm4gbmV3IEhlbHBlcih7XG4gICAgICAgICAgICByZWY6IG5ldyBSZWYocGF0aCksXG4gICAgICAgICAgICBhcmdzOiBBcmdzLmZyb21TcGVjKHBhcmFtcywgaGFzaClcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIHN0YXRpYyBidWlsZChwYXRoLCBwb3NpdGlvbmFsLCBuYW1lZCkge1xuICAgICAgICByZXR1cm4gbmV3IHRoaXMoeyByZWY6IFJlZi5idWlsZChwYXRoKSwgYXJnczogQXJncy5idWlsZChwb3NpdGlvbmFsLCBuYW1lZCkgfSk7XG4gICAgfVxuICAgIGNvbXBpbGUoY29tcGlsZXIsIGVudiwgc3ltYm9sVGFibGUpIHtcbiAgICAgICAgaWYgKGVudi5oYXNIZWxwZXIodGhpcy5yZWYucGFydHMsIHN5bWJvbFRhYmxlKSkge1xuICAgICAgICAgICAgbGV0IHsgYXJncywgcmVmIH0gPSB0aGlzO1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBDb21waWxlZEhlbHBlcihyZWYucGFydHMsIGVudi5sb29rdXBIZWxwZXIocmVmLnBhcnRzLCBzeW1ib2xUYWJsZSksIGFyZ3MuY29tcGlsZShjb21waWxlciwgZW52LCBzeW1ib2xUYWJsZSksIHN5bWJvbFRhYmxlKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgQ29tcGlsZSBFcnJvcjogJHt0aGlzLnJlZi5wYXJ0cy5qb2luKCcuJyl9IGlzIG5vdCBhIGhlbHBlcmApO1xuICAgICAgICB9XG4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gICAgdGhpcy5sZW5ndGggPSBrZXlzLmxlbmd0aDtcbiAgICB9XG4gICAgc3RhdGljIGVtcHR5KCkge1xuICAgICAgICByZXR1cm4gRU1QVFlfTkFNRURfQVJHUztcbiAgICB9XG4gICAgc3RhdGljIGZyb21TcGVjKHNleHApIHtcbiAgICAgICAgaWYgKHNleHAgPT09IG51bGwgfHwgc2V4cCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXR1cm4gRU1QVFlfTkFNRURfQVJHUztcbiAgICAgICAgfVxuICAgICAgICBsZXQgW2tleXMsIGV4cHJzXSA9IHNleHA7XG4gICAgICAgIGlmIChrZXlzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIEVNUFRZX05BTUVEX0FSR1M7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ldyB0aGlzKGtleXMsIGV4cHJzLm1hcChleHByID0+IGJ1aWxkRXhwcmVzc2lvbihleHByKSkpO1xuICAgIH1cbiAgICBzdGF0aWMgYnVpbGQoa2V5cywgdmFsdWVzKSB7XG4gICAgICAgIGlmIChrZXlzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIEVNUFRZX05BTUVEX0FSR1M7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IHRoaXMoa2V5cywgdmFsdWVzKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBhdChrZXkpIHtcbiAgICAgICAgbGV0IHsga2V5cywgdmFsdWVzIH0gPSB0aGlzO1xuICAgICAgICBsZXQgaW5kZXggPSBrZXlzLmluZGV4T2Yoa2V5KTtcbiAgICAgICAgcmV0dXJuIHZhbHVlc1tpbmRleF07XG4gICAgfVxuICAgIGhhcyhrZXkpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMua2V5cy5pbmRleE9mKGtleSkgIT09IC0xO1xuICAgIH1cbiAgICBjb21waWxlKGNvbXBpbGVyLCB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uZGVmYXVsdCA9IF9kZWZhdWx0O1xuICAgICAgICB0aGlzLmludmVyc2UgPSBpbnZlcnNlO1xuICAgIH1cbiAgICBzdGF0aWMgZnJvbVNwZWMoX2RlZmF1bHQsIGludmVyc2UgPSBudWxsKSB7XG4gICAgICAgIHJldHVybiBuZXcgVGVtcGxhdGVzKF9kZWZhdWx0LCBpbnZlcnNlKTtcbiAgICB9XG4gICAgc3RhdGljIGVtcHR5KCkge1xuICAgICAgICByZXR1cm4gbmV3IFRlbXBsYXRlcyhudWxsLCBudWxsKTtcbiAgICB9XG59XG4iXX0= enifed('glimmer-runtime/lib/syntax/expressions', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; var isArg = _glimmerWireFormat.Expressions.isArg; var isConcat = _glimmerWireFormat.Expressions.isConcat; var isGet = _glimmerWireFormat.Expressions.isGet; var isHasBlock = _glimmerWireFormat.Expressions.isHasBlock; var isHasBlockParams = _glimmerWireFormat.Expressions.isHasBlockParams; var isHelper = _glimmerWireFormat.Expressions.isHelper; var isUnknown = _glimmerWireFormat.Expressions.isUnknown; var isPrimitiveValue = _glimmerWireFormat.Expressions.isPrimitiveValue; var isUndefined = _glimmerWireFormat.Expressions.isUndefined; exports.default = function (sexp) { if (isPrimitiveValue(sexp)) return _glimmerRuntimeLibSyntaxCore.Value.fromSpec(sexp); if (isUndefined(sexp)) return _glimmerRuntimeLibSyntaxCore.Value.build(undefined); if (isArg(sexp)) return _glimmerRuntimeLibSyntaxCore.GetArgument.fromSpec(sexp); if (isConcat(sexp)) return _glimmerRuntimeLibSyntaxCore.Concat.fromSpec(sexp); if (isGet(sexp)) return _glimmerRuntimeLibSyntaxCore.Get.fromSpec(sexp); if (isHelper(sexp)) return _glimmerRuntimeLibSyntaxCore.Helper.fromSpec(sexp); if (isUnknown(sexp)) return _glimmerRuntimeLibSyntaxCore.Unknown.fromSpec(sexp); if (isHasBlock(sexp)) return _glimmerRuntimeLibSyntaxCore.HasBlock.fromSpec(sexp); if (isHasBlockParams(sexp)) return _glimmerRuntimeLibSyntaxCore.HasBlockParams.fromSpec(sexp); throw new Error('Unexpected wire format: ' + JSON.stringify(sexp)); }; ; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L2V4cHJlc3Npb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQWlCRSxLQUFLLHNCQUxMLFdBQVcsQ0FLWCxLQUFLO1FBQ0wsUUFBUSxzQkFOUixXQUFXLENBTVgsUUFBUTtRQUNSLEtBQUssc0JBUEwsV0FBVyxDQU9YLEtBQUs7UUFDTCxVQUFVLHNCQVJWLFdBQVcsQ0FRWCxVQUFVO1FBQ1YsZ0JBQWdCLHNCQVRoQixXQUFXLENBU1gsZ0JBQWdCO1FBQ2hCLFFBQVEsc0JBVlIsV0FBVyxDQVVYLFFBQVE7UUFDUixTQUFTLHNCQVhULFdBQVcsQ0FXWCxTQUFTO1FBQ1QsZ0JBQWdCLHNCQVpoQixXQUFXLENBWVgsZ0JBQWdCO1FBQ2hCLFdBQVcsc0JBYlgsV0FBVyxDQWFYLFdBQVc7O3NCQUdDLFVBQVUsSUFBMEIsRUFBQTtBQUNoRCxZQUFJLGdCQUFnQixDQUFDLElBQUksQ0FBQyxFQUFFLE9BQU8sNkJBNUJuQyxLQUFLLENBNEIwQyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDOUQsWUFBSSxXQUFXLENBQUMsSUFBSSxDQUFDLEVBQUUsT0FBTyw2QkE3QjlCLEtBQUssQ0E2QnFDLEtBQUssQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUMzRCxZQUFJLEtBQUssQ0FBQyxJQUFJLENBQUMsRUFBRSxPQUFPLDZCQTdCeEIsV0FBVyxDQTZCdUIsUUFBUSxDQUFDLElBQUksQ0F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heC5mcm9tU3BlYyhzZXhwKTtcbiAgaWYgKGlzVW5rbm93bihzZXhwKSkgcmV0dXJuIFVua25vd25TeW50YXguZnJvbVNwZWMoc2V4cCk7XG4gIGlmIChpc0hhc0Jsb2NrKHNleHApKSByZXR1cm4gSGFzQmxvY2tTeW50YXguZnJvbVNwZWMoc2V4cCk7XG4gIGlmIChpc0hhc0Jsb2NrUGFyYW1zKHNleHApKSByZXR1cm4gSGFzQmxvY2tQYXJhbXNTeW50YXguZnJvbVNwZWMoc2V4cCk7XG5cbiAgdGhyb3cgbmV3IEVycm9yKGBVbmV4cGVjdGVkIHdpcmUgZm9ybWF0OiAke0pTT04uc3RyaW5naWZ5KHNleHApfWApO1xufTtcbiJdfQ== enifed('glimmer-runtime/lib/syntax/statements', ['exports', 'glimmer-runtime/lib/syntax/core', 'glimmer-wire-format'], function (exports, _glimmerRuntimeLibSyntaxCore, _glimmerWireFormat) { 'use strict'; var isYield = _glimmerWireFormat.Statements.isYield; var isBlock = _glimmerWireFormat.Statements.isBlock; var isAppend = _glimmerWireFormat.Statements.isAppend; var isDynamicAttr = _glimmerWireFormat.Statements.isDynamicAttr; var isText = _glimmerWireFormat.Statements.isText; var isComment = _glimmerWireFormat.Statements.isComment; var isOpenElement = _glimmerWireFormat.Statements.isOpenElement; var isFlushElement = _glimmerWireFormat.Statements.isFlushElement; var isCloseElement = _glimmerWireFormat.Statements.isCloseElement; var isStaticAttr = _glimmerWireFormat.Statements.isStaticAttr; var isModifier = _glimmerWireFormat.Statements.isModifier; var isDynamicArg = _glimmerWireFormat.Statements.isDynamicArg; var isStaticArg = _glimmerWireFormat.Statements.isStaticArg; var isTrustingAttr = _glimmerWireFormat.Statements.isTrustingAttr; exports.default = function (sexp, symbolTable, scanner) { if (isYield(sexp)) return _glimmerRuntimeLibSyntaxCore.Yield.fromSpec(sexp); if (isBlock(sexp)) return _glimmerRuntimeLibSyntaxCore.Block.fromSpec(sexp, symbolTable, scanner); if (isAppend(sexp)) return _glimmerRuntimeLibSyntaxCore.OptimizedAppend.fromSpec(sexp); if (isDynamicAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.DynamicAttr.fromSpec(sexp); if (isDynamicArg(sexp)) return _glimmerRuntimeLibSyntaxCore.DynamicArg.fromSpec(sexp); if (isTrustingAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.TrustingAttr.fromSpec(sexp); if (isText(sexp)) return _glimmerRuntimeLibSyntaxCore.Text.fromSpec(sexp); if (isComment(sexp)) return _glimmerRuntimeLibSyntaxCore.Comment.fromSpec(sexp); if (isOpenElement(sexp)) return _glimmerRuntimeLibSyntaxCore.OpenElement.fromSpec(sexp, symbolTable); if (isFlushElement(sexp)) return _glimmerRuntimeLibSyntaxCore.FlushElement.fromSpec(); if (isCloseElement(sexp)) return _glimmerRuntimeLibSyntaxCore.CloseElement.fromSpec(); if (isStaticAttr(sexp)) return _glimmerRuntimeLibSyntaxCore.StaticAttr.fromSpec(sexp); if (isStaticArg(sexp)) return _glimmerRuntimeLibSyntaxCore.StaticArg.fromSpec(sexp); if (isModifier(sexp)) return _glimmerRuntimeLibSyntaxCore.Modifier.fromSpec(sexp); }; ; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvc3ludGF4L3N0YXRlbWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBMEJFLE9BQU8sc0JBTlAsVUFBVSxDQU1WLE9BQU87UUFDUCxPQUFPLHNCQVBQLFVBQVUsQ0FPVixPQUFPO1FBQ1AsUUFBUSxzQkFSUixVQUFVLENBUVYsUUFBUTtRQUNSLGFBQWEsc0JBVGIsVUFBVSxDQVNWLGFBQWE7UUFDYixNQUFNLHNCQVZOLFVBQVUsQ0FVVixNQUFNO1FBQ04sU0FBUyxzQkFYVCxVQUFVLENBV1YsU0FBUztRQUNULGFBQWEsc0JBWmIsVUFBVSxDQVlWLGFBQWE7UUFDY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5mcm9tU3BlYyhzZXhwKTtcbiAgaWYgKGlzTW9kaWZpZXIoc2V4cCkpIHJldHVybiBNb2RpZmllci5mcm9tU3BlYyhzZXhwKTtcbn07XG4iXX0= enifed('glimmer-runtime/lib/template', ['exports', 'glimmer-util', 'glimmer-runtime/lib/builder', 'glimmer-runtime/lib/vm', 'glimmer-runtime/lib/scanner'], function (exports, _glimmerUtil, _glimmerRuntimeLibBuilder, _glimmerRuntimeLibVm, _glimmerRuntimeLibScanner) { 'use strict'; exports.default = templateFactory; var clientId = 0; function templateFactory(_ref) { var id = _ref.id; var meta = _ref.meta; var block = _ref.block; var parsedBlock = undefined; if (!id) { id = 'client-' + clientId++; } var create = function (env, envMeta) { var newMeta = envMeta ? _glimmerUtil.assign({}, envMeta, meta) : meta; if (!parsedBlock) { parsedBlock = JSON.parse(block); } return template(parsedBlock, id, newMeta, env); }; return { id: id, meta: meta, create: create }; } function template(block, id, meta, env) { var scanner = new _glimmerRuntimeLibScanner.default(block, meta, env); var entryPoint = undefined; var asEntryPoint = function () { if (!entryPoint) entryPoint = scanner.scanEntryPoint(); return entryPoint; }; var layout = undefined; var asLayout = function () { if (!layout) layout = scanner.scanLayout(); return layout; }; var asPartial = function (symbols) { return scanner.scanPartial(symbols); }; var render = function (self, appendTo, dynamicScope) { var elementStack = _glimmerRuntimeLibBuilder.ElementStack.forInitialRender(env, appendTo, null); var compiled = asEntryPoint().compile(env); var vm = _glimmerRuntimeLibVm.VM.initial(env, { self: self, dynamicScope: dynamicScope, elementStack: elementStack, size: compiled.symbols }); return vm.execute(compiled.ops); }; return { id: id, meta: meta, _block: block, asEntryPoint: asEntryPoint, asLayout: asLayout, asPartial: asPartial, render: render }; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdGVtcGxhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3NCQWtGYyxlQUFBOztBQVRk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ssIGFzRW50cnlQb2ludCwgYXNMYXlvdXQsIGFzUGFydGlhbCwgcmVuZGVyIH07XG59XG4iXX0= enifed('glimmer-runtime/lib/upsert', ['exports', 'glimmer-runtime/lib/bounds'], function (exports, _glimmerRuntimeLibBounds) { 'use strict'; exports.isSafeString = isSafeString; exports.isNode = isNode; exports.isString = isString; exports.cautiousInsert = cautiousInsert; exports.trustingInsert = trustingInsert; function isSafeString(value) { return value && typeof value['toHTML'] === 'function'; } function isNode(value) { return value !== null && typeof value === 'object' && typeof value['nodeType'] === 'number'; } function isString(value) { return typeof value === 'string'; } var Upsert = function Upsert(bounds) { this.bounds = bounds; }; exports.default = Upsert; function cautiousInsert(dom, cursor, value) { if (isString(value)) { return TextUpsert.insert(dom, cursor, value); } if (isSafeString(value)) { return SafeStringUpsert.insert(dom, cursor, value); } if (isNode(value)) { return NodeUpsert.insert(dom, cursor, value); } } function trustingInsert(dom, cursor, value) { if (isString(value)) { return HTMLUpsert.insert(dom, cursor, value); } if (isNode(value)) { return NodeUpsert.insert(dom, cursor, value); } } var TextUpsert = (function (_Upsert) { babelHelpers.inherits(TextUpsert, _Upsert); TextUpsert.insert = function insert(dom, cursor, value) { var textNode = dom.createTextNode(value); dom.insertBefore(cursor.element, textNode, cursor.nextSibling); var bounds = new _glimmerRuntimeLibBounds.SingleNodeBounds(cursor.element, textNode); return new TextUpsert(bounds, textNode); }; function TextUpsert(bounds, textNode) { _Upsert.call(this, bounds); this.textNode = textNode; } TextUpsert.prototype.update = function update(dom, value) { if (isString(value)) { var textNode = this.textNode; textNode.nodeValue = value; return true; } else { return false; } }; return TextUpsert; })(Upsert); var HTMLUpsert = (function (_Upsert2) { babelHelpers.inherits(HTMLUpsert, _Upsert2); function HTMLUpsert() { _Upsert2.apply(this, arguments); } HTMLUpsert.insert = function insert(dom, cursor, value) { var bounds = dom.insertHTMLBefore(cursor.element, value, cursor.nextSibling); return new HTMLUpsert(bounds); }; HTMLUpsert.prototype.update = function update(dom, value) { if (isString(value)) { var bounds = this.bounds; var parentElement = bounds.parentElement(); var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); this.bounds = dom.insertHTMLBefore(parentElement, nextSibling, value); return true; } else { return false; } }; return HTMLUpsert; })(Upsert); var SafeStringUpsert = (function (_Upsert3) { babelHelpers.inherits(SafeStringUpsert, _Upsert3); function SafeStringUpsert(bounds, lastStringValue) { _Upsert3.call(this, bounds); this.lastStringValue = lastStringValue; } SafeStringUpsert.insert = function insert(dom, cursor, value) { var stringValue = value.toHTML(); var bounds = dom.insertHTMLBefore(cursor.element, stringValue, cursor.nextSibling); return new SafeStringUpsert(bounds, stringValue); }; SafeStringUpsert.prototype.update = function update(dom, value) { if (isSafeString(value)) { var stringValue = value.toHTML(); if (stringValue !== this.lastStringValue) { var bounds = this.bounds; var parentElement = bounds.parentElement(); var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); this.bounds = dom.insertHTMLBefore(parentElement, nextSibling, stringValue); this.lastStringValue = stringValue; } return true; } else { return false; } }; return SafeStringUpsert; })(Upsert); var NodeUpsert = (function (_Upsert4) { babelHelpers.inherits(NodeUpsert, _Upsert4); function NodeUpsert() { _Upsert4.apply(this, arguments); } NodeUpsert.insert = function insert(dom, cursor, node) { dom.insertBefore(cursor.element, node, cursor.nextSibling); return new NodeUpsert(_glimmerRuntimeLibBounds.single(cursor.element, node)); }; NodeUpsert.prototype.update = function update(dom, value) { if (isNode(value)) { var bounds = this.bounds; var parentElement = bounds.parentElement(); var nextSibling = _glimmerRuntimeLibBounds.clear(bounds); this.bounds = dom.insertNodeBefore(parentElement, value, nextSibling); return true; } else { return false; } }; return NodeUpsert; })(Upsert); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXBzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQVVNLGFBQUEsWUFBQSxDQUF1QixLQUFhLEVBQU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HVlLCBuZXh0U2libGluZyBhcyBGSVhfUkVJRklDQVRJT048Tm9kZT4pO1xuXG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/utils', ['exports', 'glimmer-util'], function (exports, _glimmerUtil) { 'use strict'; exports.turbocharge = turbocharge; var EMPTY_ARRAY = Object.freeze([]); exports.EMPTY_ARRAY = EMPTY_ARRAY; var EMPTY_DICT = Object.freeze(_glimmerUtil.dict()); exports.EMPTY_DICT = EMPTY_DICT; function turbocharge(object) { // function Constructor() {} // Constructor.prototype = object; return object; } var ListRange = (function () { function ListRange(list, start, end) { this.list = list; this.start = start; this.end = end; } ListRange.prototype.at = function at(index) { if (index >= this.list.length) return null; return this.list[index]; }; ListRange.prototype.min = function min() { return this.start; }; ListRange.prototype.max = function max() { return this.end; }; return ListRange; })(); exports.ListRange = ListRange; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUVPLFFBQU0sV0FBVyxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUM7O0FBQ3RDLFFBQU0sVUFBVSxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsYUFIL0IsSUFBSSxFQUdzQyxDQUFDLENBQUM7OztBQUUvQyxhQUFBLFdBQUEsQ0FBc0IsTUFBYyxFQUFBOzs7QUFHeEMsZUFBTyxNQUFNLENBQUM7S0FDZjs7UUFvQkssU0FBQTtBQU9KLGlCQVBJLFNBQUEsQ0FPUSxJQUFTLEVBQUUsS0FBYSxFQUFFLEdBQVcsRUFBQTtBQUMvQyxnQkFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7QUFDakIsZ0JBQUksQ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ibGU8VD4ge1xuICBmb3JFYWNoKGNhbGxiYWNrOiBFbnVtZXJhYmxlQ2FsbGJhY2s8VD4pO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIERlc3Ryb3lhYmxlIHtcbiAgZGVzdHJveSgpO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFJhbmdlPFQ+IHtcbiAgbWluKCk6IG51bWJlcjtcbiAgbWF4KCk6IG51bWJlcjtcbiAgYXQoaW5kZXg6IG51bWJlcik6IFQ7XG59XG5cbmV4cG9ydCBjbGFzcyBMaXN0UmFuZ2U8VD4gaW1wbGVtZW50cyBSYW5nZTxUPiB7XG4gIHByaXZhdGUgbGlzdDogVFtdO1xuXG4gIC8vIFtzdGFydCwgZW5kXVxuICBwcml2YXRlIHN0YXJ0OiBudW1iZXI7XG4gIHByaXZhdGUgZW5kOiBudW1iZXI7XG5cbiAgY29uc3RydWN0b3IobGlzdDogVFtdLCBzdGFydDogbnVtYmVyLCBlbmQ6IG51bWJlcikge1xuICAgIHRoaXMubGlzdCA9IGxpc3Q7XG4gICAgdGhpcy5zdGFydCA9IHN0YXJ0O1xuICAgIHRoaXMuZW5kID0gZW5kO1xuICB9XG5cbiAgYXQoaW5kZXg6IG51bWJlcik6IFQge1xuICAgIGlmIChpbmRleCA+PSB0aGlzLmxpc3QubGVuZ3RoKSByZXR1cm4gbnVsbDtcbiAgICByZXR1cm4gdGhpcy5saXN0W2luZGV4XTtcbiAgfVxuXG4gIG1pbigpOiBudW1iZXIge1xuICAgIHJldHVybiB0aGlzLnN0YXJ0O1xuICB9XG5cbiAgbWF4KCk6IG51bWJlciB7XG4gICAgcmV0dXJuIHRoaXMuZW5kO1xuICB9XG59XG4iXX0= enifed('glimmer-runtime/lib/vm', ['exports', 'glimmer-runtime/lib/vm/append', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result'], function (exports, _glimmerRuntimeLibVmAppend, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult) { 'use strict'; exports.VM = _glimmerRuntimeLibVmAppend.default; exports.PublicVM = _glimmerRuntimeLibVmAppend.PublicVM; exports.UpdatingVM = _glimmerRuntimeLibVmUpdate.default; exports.RenderResult = _glimmerRuntimeLibVmRenderResult.default; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1VBQW9CLEVBQUUsOEJBQWIsT0FBTztVQUFRLFFBQVEsOEJBQVIsUUFBUTtVQUNaLFVBQVUsOEJBQXJCLE9BQU87VUFDSSxZQUFZLG9DQUF2QixPQUFPIiwiZmlsZSI6InZtLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgZGVmYXVsdCBhcyBWTSwgUHVibGljVk0gfSBmcm9tICcuL3ZtL2FwcGVuZCc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFVwZGF0aW5nVk0gfSBmcm9tICcuL3ZtL3VwZGF0ZSc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIFJlbmRlclJlc3VsdCB9IGZyb20gJy4vdm0vcmVuZGVyLXJlc3VsdCc7XG4iXX0= enifed('glimmer-runtime/lib/vm/append', ['exports', 'glimmer-runtime/lib/environment', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/opcodes/vm', 'glimmer-runtime/lib/vm/update', 'glimmer-runtime/lib/vm/render-result', 'glimmer-runtime/lib/vm/frame'], function (exports, _glimmerRuntimeLibEnvironment, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledOpcodesVm, _glimmerRuntimeLibVmUpdate, _glimmerRuntimeLibVmRenderResult, _glimmerRuntimeLibVmFrame) { 'use strict'; var VM = (function () { function VM(_ref) { var env = _ref.env; var scope = _ref.scope; var dynamicScope = _ref.dynamicScope; var elementStack = _ref.elementStack; this.dynamicScopeStack = new _glimmerUtil.Stack(); this.scopeStack = new _glimmerUtil.Stack(); this.updatingOpcodeStack = new _glimmerUtil.Stack(); this.cacheGroups = new _glimmerUtil.Stack(); this.listBlockStack = new _glimmerUtil.Stack(); this.frame = new _glimmerRuntimeLibVmFrame.FrameStack(); this.env = env; this.elementStack = elementStack; this.scopeStack.push(scope); this.dynamicScopeStack.push(dynamicScope); } VM.initial = function initial(env, _ref2) { var elementStack = _ref2.elementStack; var self = _ref2.self; var dynamicScope = _ref2.dynamicScope; var size = _ref2.size; var scope = _glimmerRuntimeLibEnvironment.Scope.root(self, size); return new VM({ env: env, scope: scope, dynamicScope: dynamicScope, elementStack: elementStack }); }; VM.prototype.capture = function capture() { return { env: this.env, scope: this.scope(), dynamicScope: this.dynamicScope() }; }; VM.prototype.goto = function goto(op) { // assert(this.frame.getOps().contains(op), `Illegal jump to ${op.label}`); this.frame.goto(op); }; VM.prototype.beginCacheGroup = function beginCacheGroup() { this.cacheGroups.push(this.updatingOpcodeStack.current.tail()); }; VM.prototype.commitCacheGroup = function commitCacheGroup() { // JumpIfNotModified(END) // (head) // (....) // (tail) // DidModify // END: Noop var END = new _glimmerRuntimeLibCompiledOpcodesVm.LabelOpcode("END"); var opcodes = this.updatingOpcodeStack.current; var marker = this.cacheGroups.pop(); var head = marker ? opcodes.nextNode(marker) : opcodes.head(); var tail = opcodes.tail(); var tag = _glimmerReference.combineSlice(new _glimmerUtil.ListSlice(head, tail)); var guard = new _glimmerRuntimeLibCompiledOpcodesVm.JumpIfNotModifiedOpcode({ tag: tag, target: END }); opcodes.insertBefore(guard, head); opcodes.append(new _glimmerRuntimeLibCompiledOpcodesVm.DidModifyOpcode({ target: guard })); opcodes.append(END); }; VM.prototype.enter = function enter(ops) { var updating = new _glimmerUtil.LinkedList(); var tracker = this.stack().pushUpdatableBlock(); var state = this.capture(); var tryOpcode = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, updating); this.didEnter(tryOpcode, updating); }; VM.prototype.enterWithKey = function enterWithKey(key, ops) { var updating = new _glimmerUtil.LinkedList(); var tracker = this.stack().pushUpdatableBlock(); var state = this.capture(); var tryOpcode = new _glimmerRuntimeLibVmUpdate.TryOpcode(ops, state, tracker, updating); this.listBlockStack.current.map[key] = tryOpcode; this.didEnter(tryOpcode, updating); }; VM.prototype.enterList = function enterList(ops) { var updating = new _glimmerUtil.LinkedList(); var tracker = this.stack().pushBlockList(updating); var state = this.capture(); var artifacts = this.frame.getIterator().artifacts; var opcode = new _glimmerRuntimeLibVmUpdate.ListBlockOpcode(ops, state, tracker, updating, artifacts); this.listBlockStack.push(opcode); this.didEnter(opcode, updating); }; VM.prototype.didEnter = function didEnter(opcode, updating) { this.updateWith(opcode); this.updatingOpcodeStack.push(updating); }; VM.prototype.exit = function exit() { this.stack().popBlock(); this.updatingOpcodeStack.pop(); var parent = this.updatingOpcodeStack.current.tail(); parent.didInitializeChildren(); }; VM.prototype.exitList = function exitList() { this.exit(); this.listBlockStack.pop(); }; VM.prototype.updateWith = function updateWith(opcode) { this.updatingOpcodeStack.current.append(opcode); }; VM.prototype.stack = function stack() { return this.elementStack; }; VM.prototype.scope = function scope() { return this.scopeStack.current; }; VM.prototype.dynamicScope = function dynamicScope() { return this.dynamicScopeStack.current; }; VM.prototype.pushFrame = function pushFrame(_ref3) { var block = _ref3.block; var args = _ref3.args; var blocks = _ref3.blocks; var callerScope = _ref3.callerScope; this.frame.push(block.ops); if (args) this.frame.setArgs(args); if (blocks) this.frame.setBlocks(blocks); if (callerScope) this.frame.setCallerScope(callerScope); }; VM.prototype.pushComponentFrame = function pushComponentFrame(layout, args, blocks, callerScope, component, manager, shadow) { this.frame.push(layout.ops, component, manager, shadow); if (args) this.frame.setArgs(args); if (blocks) this.frame.setBlocks(blocks); if (callerScope) this.frame.setCallerScope(callerScope); }; VM.prototype.pushEvalFrame = function pushEvalFrame(ops) { this.frame.push(ops); }; VM.prototype.popFrame = function popFrame() { var frame = this.frame; frame.pop(); var current = frame.getCurrent(); if (current === null) return; }; VM.prototype.pushChildScope = function pushChildScope() { this.scopeStack.push(this.scopeStack.current.child()); }; VM.prototype.pushCallerScope = function pushCallerScope() { this.scopeStack.push(this.scope().getCallerScope()); }; VM.prototype.pushDynamicScope = function pushDynamicScope() { var child = this.dynamicScopeStack.current.child(); this.dynamicScopeStack.push(child); return child; }; VM.prototype.pushRootScope = function pushRootScope(self, size) { var scope = _glimmerRuntimeLibEnvironment.Scope.root(self, size); this.scopeStack.push(scope); return scope; }; VM.prototype.popScope = function popScope() { this.scopeStack.pop(); }; VM.prototype.popDynamicScope = function popDynamicScope() { this.dynamicScopeStack.pop(); }; VM.prototype.newDestroyable = function newDestroyable(d) { this.stack().newDestroyable(d); }; /// SCOPE HELPERS VM.prototype.getSelf = function getSelf() { return this.scope().getSelf(); }; VM.prototype.referenceForSymbol = function referenceForSymbol(symbol) { return this.scope().getSymbol(symbol); }; VM.prototype.getArgs = function getArgs() { return this.frame.getArgs(); }; /// EXECUTION VM.prototype.execute = function execute(opcodes, initialize) { _glimmerUtil.LOGGER.debug("[VM] Begin program execution"); var elementStack = this.elementStack; var frame = this.frame; var updatingOpcodeStack = this.updatingOpcodeStack; var env = this.env; elementStack.pushSimpleBlock(); updatingOpcodeStack.push(new _glimmerUtil.LinkedList()); frame.push(opcodes); if (initialize) initialize(this); var opcode = undefined; while (frame.hasOpcodes()) { if (opcode = frame.nextStatement()) { _glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type); _glimmerUtil.LOGGER.trace(opcode); opcode.evaluate(this); } } _glimmerUtil.LOGGER.debug("[VM] Completed program execution"); return new _glimmerRuntimeLibVmRenderResult.default({ env: env, updating: updatingOpcodeStack.pop(), bounds: elementStack.popBlock() }); }; VM.prototype.evaluateOpcode = function evaluateOpcode(opcode) { opcode.evaluate(this); }; // Make sure you have opcodes that push and pop a scope around this opcode // if you need to change the scope. VM.prototype.invokeBlock = function invokeBlock(block, args) { var compiled = block.compile(this.env); this.pushFrame({ block: compiled, args: args }); }; VM.prototype.invokeLayout = function invokeLayout(args, layout, templates, callerScope, component, manager, shadow) { this.pushComponentFrame(layout, args, templates, callerScope, component, manager, shadow); }; VM.prototype.evaluateOperand = function evaluateOperand(expr) { this.frame.setOperand(expr.evaluate(this)); }; VM.prototype.evaluateArgs = function evaluateArgs(args) { var evaledArgs = this.frame.setArgs(args.evaluate(this)); this.frame.setOperand(evaledArgs.positional.at(0)); }; VM.prototype.bindPositionalArgs = function bindPositionalArgs(symbols) { var args = this.frame.getArgs(); _glimmerUtil.assert(args, "Cannot bind positional args"); var positional = args.positional; var scope = this.scope(); for (var i = 0; i < symbols.length; i++) { scope.bindSymbol(symbols[i], positional.at(i)); } }; VM.prototype.bindNamedArgs = function bindNamedArgs(names, symbols) { var args = this.frame.getArgs(); _glimmerUtil.assert(args, "Cannot bind named args"); var named = args.named; var scope = this.scope(); for (var i = 0; i < names.length; i++) { scope.bindSymbol(symbols[i], named.get(names[i])); } }; VM.prototype.bindBlocks = function bindBlocks(names, symbols) { var blocks = this.frame.getBlocks(); var callerScope = this.frame.getCallerScope(); var scope = this.scope(); scope.bindCallerScope(callerScope); for (var i = 0; i < names.length; i++) { scope.bindBlock(symbols[i], blocks && blocks[names[i]] || null); } }; VM.prototype.bindDynamicScope = function bindDynamicScope(names) { var args = this.frame.getArgs(); _glimmerUtil.assert(args, "Cannot bind dynamic scope"); var scope = this.dynamicScope(); for (var i = 0; i < names.length; i++) { scope.set(names[i], args.named.get(names[i])); } }; return VM; })(); exports.default = VM; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vYXBwZW5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQStDYyxFQUFBO0FBZVosaUJBZlksRUFBQSxDQWVBLElBQWdFLEVBQUE7Z0JBQTlELEdBQUcsR0FBTCxJQUFnRSxDQUE5RCxHQUFHO2dCQUFFLEtBQUssR0FBWixJQUFnRSxDQUF6RCxLQUFLO2dCQUFF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YWxsZXJTY29wZSgpO1xuXG4gICAgbGV0IHNjb3BlID0gdGhpcy5zY29wZSgpO1xuXG4gICAgc2NvcGUuYmluZENhbGxlclNjb3BlKGNhbGxlclNjb3BlKTtcblxuICAgIGZvcihsZXQgaT0wOyBpIDwgbmFtZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHNjb3BlLmJpbmRCbG9jayhzeW1ib2xzW2ldLCAoYmxvY2tzICYmIGJsb2Nrc1tuYW1lc1tpXV0pIHx8IG51bGwpO1xuICAgIH1cbiAgfVxuXG4gIGJpbmREeW5hbWljU2NvcGUobmFtZXM6IHN0cmluZ1tdKSB7XG4gICAgbGV0IGFyZ3MgPSB0aGlzLmZyYW1lLmdldEFyZ3MoKTtcblxuICAgIGFzc2VydChhcmdzLCBcIkNhbm5vdCBiaW5kIGR5bmFtaWMgc2NvcGVcIik7XG5cbiAgICBsZXQgc2NvcGUgPSB0aGlzLmR5bmFtaWNTY29wZSgpO1xuXG4gICAgZm9yKGxldCBpPTA7IGkgPCBuYW1lcy5sZW5ndGg7IGkrKykge1xuICAgICAgc2NvcGUuc2V0KG5hbWVzW2ldLCBhcmdzLm5hbWVkLmdldChuYW1lc1tpXSkpO1xuICAgIH1cbiAgfVxufVxuXG5pbnRlcmZhY2UgRXhjZXB0aW9uSGFuZGxlciB7XG4gIGhhbmRsZUV4Y2VwdGlvbihpbml0aWFsaXplPzogKHZtOiBWTSkgPT4gdm9pZCk7XG59XG5cbmludGVyZmFjZSBSZXR1cm5IYW5kbGVyIHtcbiAgc2V0UmVuZGVyUmVzdWx0KHJlbmRlclJlc3VsdDogUmVuZGVyUmVzdWx0KTtcbn1cbiJdfQ== enifed("glimmer-runtime/lib/vm/frame", ["exports"], function (exports) { "use strict"; var Frame = function Frame(ops) { var component = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; var manager = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; var shadow = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; this.component = component; this.manager = manager; this.shadow = shadow; this.operand = null; this.args = null; this.callerScope = null; this.blocks = null; this.condition = null; this.iterator = null; this.key = null; this.componentDefinition = null; this.ops = ops; this.op = ops.head(); }; var FrameStack = (function () { function FrameStack() { this.frames = []; this.frame = undefined; } FrameStack.prototype.push = function push(ops) { var component = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; var manager = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; var shadow = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; var frame = this.frame === undefined ? this.frame = 0 : ++this.frame; if (this.frames.length <= frame) { this.frames.push(null); } this.frames[frame] = new Frame(ops, component, manager, shadow); }; FrameStack.prototype.pop = function pop() { var frames = this.frames; var frame = this.frame; frames[frame] = null; this.frame = frame === 0 ? undefined : frame - 1; }; FrameStack.prototype.getOps = function getOps() { return this.frames[this.frame].ops; }; FrameStack.prototype.getCurrent = function getCurrent() { return this.frames[this.frame].op; }; FrameStack.prototype.setCurrent = function setCurrent(op) { return this.frames[this.frame].op = op; }; FrameStack.prototype.getOperand = function getOperand() { return this.frames[this.frame].operand; }; FrameStack.prototype.setOperand = function setOperand(operand) { return this.frames[this.frame].operand = operand; }; FrameStack.prototype.getArgs = function getArgs() { return this.frames[this.frame].args; }; FrameStack.prototype.setArgs = function setArgs(args) { var frame = this.frames[this.frame]; return frame.args = args; }; FrameStack.prototype.getCondition = function getCondition() { return this.frames[this.frame].condition; }; FrameStack.prototype.setCondition = function setCondition(condition) { return this.frames[this.frame].condition = condition; }; FrameStack.prototype.getIterator = function getIterator() { return this.frames[this.frame].iterator; }; FrameStack.prototype.setIterator = function setIterator(iterator) { return this.frames[this.frame].iterator = iterator; }; FrameStack.prototype.getKey = function getKey() { return this.frames[this.frame].key; }; FrameStack.prototype.setKey = function setKey(key) { return this.frames[this.frame].key = key; }; FrameStack.prototype.getComponentDefinition = function getComponentDefinition() { return this.frames[this.frame].componentDefinition; }; FrameStack.prototype.setComponentDefinition = function setComponentDefinition(definition) { return this.frames[this.frame].componentDefinition = definition; }; FrameStack.prototype.getBlocks = function getBlocks() { return this.frames[this.frame].blocks; }; FrameStack.prototype.setBlocks = function setBlocks(blocks) { return this.frames[this.frame].blocks = blocks; }; FrameStack.prototype.getCallerScope = function getCallerScope() { return this.frames[this.frame].callerScope; }; FrameStack.prototype.setCallerScope = function setCallerScope(callerScope) { return this.frames[this.frame].callerScope = callerScope; }; FrameStack.prototype.getComponent = function getComponent() { return this.frames[this.frame].component; }; FrameStack.prototype.getManager = function getManager() { return this.frames[this.frame].manager; }; FrameStack.prototype.getShadow = function getShadow() { return this.frames[this.frame].shadow; }; FrameStack.prototype.goto = function goto(op) { this.setCurrent(op); }; FrameStack.prototype.hasOpcodes = function hasOpcodes() { return this.frame !== undefined; }; FrameStack.prototype.nextStatement = function nextStatement() { var op = this.frames[this.frame].op; var ops = this.getOps(); if (op) { this.setCurrent(ops.nextNode(op)); return op; } else { this.pop(); return null; } }; return FrameStack; })(); exports.FrameStack = FrameStack; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vZnJhbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O1FBUUEsS0FBQSxHQVlFLFNBWkYsS0FBQSxDQWFJLEdBQVUsRUFHb0I7WUFGdkIsU0FBQSx5REFBdUIsSUFBSTtZQUMzQixPQUFBLHlEQUF1QyxJQUFJO1lBQzNDLE1BQUEseURBQW1CLElBQUk7O0FBRnZCLFlBQUEsQ0FBQSxTQUFTLEdBQVQsU0FBUyxDQUFrQjtBQUMzQixZQUFBLENBQUEsT0FBTyxHQUFQLE9BQU8sQ0FBb0M7QUFDM0MsWUFBQSxDQUFBLE1BQU0sR0FBTixNQUFNLENBQWlCO0FBYmhDLFlBQUEsQ0FBQSxPQUFPLEdBQXVCLElBQUksQ0FBQztBQUNuQyxZQUFBLENBQUEsSUFBSSxHQUFrQixJQUFJL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E1hbmFnZXI8Q29tcG9uZW50PiB7XG4gICAgcmV0dXJuIHRoaXMuZnJhbWVzW3RoaXMuZnJhbWVdLm1hbmFnZXI7XG4gIH1cblxuICBnZXRTaGFkb3coKTogc3RyaW5nW10ge1xuICAgIHJldHVybiB0aGlzLmZyYW1lc1t0aGlzLmZyYW1lXS5zaGFkb3c7XG4gIH1cblxuICBnb3RvKG9wOiBMYWJlbE9wY29kZSkge1xuICAgIHRoaXMuc2V0Q3VycmVudChvcCk7XG4gIH1cblxuICBoYXNPcGNvZGVzKCk6IGJvb2xlYW4ge1xuICAgIHJldHVybiB0aGlzLmZyYW1lICE9PSB1bmRlZmluZWQ7XG4gIH1cblxuICBuZXh0U3RhdGVtZW50KCk6IE9wY29kZSB7XG4gICAgbGV0IG9wID0gdGhpcy5mcmFtZXNbdGhpcy5mcmFtZV0ub3A7XG4gICAgbGV0IG9wcyA9IHRoaXMuZ2V0T3BzKCk7XG5cbiAgICBpZiAob3ApIHtcbiAgICAgIHRoaXMuc2V0Q3VycmVudChvcHMubmV4dE5vZGUob3ApKTtcbiAgICAgIHJldHVybiBvcDtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhpcy5wb3AoKTtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/vm/render-result', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/vm/update'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibVmUpdate) { 'use strict'; var RenderResult = (function () { function RenderResult(_ref) { var env = _ref.env; var updating = _ref.updating; var bounds = _ref.bounds; this.env = env; this.updating = updating; this.bounds = bounds; } RenderResult.prototype.rerender = function rerender() { var _ref2 = arguments.length <= 0 || arguments[0] === undefined ? { alwaysRevalidate: false } : arguments[0]; var _ref2$alwaysRevalidate = _ref2.alwaysRevalidate; var alwaysRevalidate = _ref2$alwaysRevalidate === undefined ? false : _ref2$alwaysRevalidate; var env = this.env; var updating = this.updating; var vm = new _glimmerRuntimeLibVmUpdate.default(env, { alwaysRevalidate: alwaysRevalidate }); vm.execute(updating, this); }; RenderResult.prototype.parentElement = function parentElement() { return this.bounds.parentElement(); }; RenderResult.prototype.firstNode = function firstNode() { return this.bounds.firstNode(); }; RenderResult.prototype.lastNode = function lastNode() { return this.bounds.lastNode(); }; RenderResult.prototype.opcodes = function opcodes() { return this.updating; }; RenderResult.prototype.handleException = function handleException() { throw "this should never happen"; }; RenderResult.prototype.destroy = function destroy() { this.bounds.destroy(); _glimmerRuntimeLibBounds.clear(this.bounds); }; return RenderResult; })(); exports.default = RenderResult; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vcmVuZGVyLXJlc3VsdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFZYyxZQUFBO0FBS1osaUJBTFksWUFBQSxDQUtBLElBQStDLEVBQUE7Z0JBQTdDLEdBQUcsR0FBTCxJQUErQyxDQUE3QyxHQUFHO2dCQUFFLFFBQVEsR0FBZixJQUErQyxDQUF4QyxRQUFRO2dCQUFFLE1BQU0sR0FBdkIsSUFBK0MsQ0FBOUIsTUFBTTs7QUFDakMsZ0JBQUksQ0FBQyxHQUFHLEdBQUcsR0FBRyxDQUFDO0FBQ2YsZ0JBQUksQ0FBQyxRQUFRLEdBQUcsUUFBUSxDQUFDO0FBQ3pCLGdCQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQztTQUN0Qjs7QUFUVyxvQkFBQSxXQVdaLFFBQVEsR0FBQSxvQkFBMkQ7OEVBQTNCLEVBQUUsZ0JBQWdCLEVBQUUsS0FBSyxFQUFFOzsrQ0FBeEQsZ0JBQWdCO2dCQUFoQixnQkFBZ0IsMENBQUcsS0FBSztnQkFDM0IsR0FBRyxHQUFlLElBQUksQ0FBdEIsR0FBRztnQkFBRSxRQUFRLEdBQUssSUFBSSxDQUFqQixRQ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GluZ1ZNKGVudiwgeyBhbHdheXNSZXZhbGlkYXRlIH0pO1xuICAgIHZtLmV4ZWN1dGUodXBkYXRpbmcsIHRoaXMpO1xuICB9XG5cbiAgcGFyZW50RWxlbWVudCgpIHtcbiAgICByZXR1cm4gdGhpcy5ib3VuZHMucGFyZW50RWxlbWVudCgpO1xuICB9XG5cbiAgZmlyc3ROb2RlKCkge1xuICAgIHJldHVybiB0aGlzLmJvdW5kcy5maXJzdE5vZGUoKTtcbiAgfVxuXG4gIGxhc3ROb2RlKCkge1xuICAgIHJldHVybiB0aGlzLmJvdW5kcy5sYXN0Tm9kZSgpO1xuICB9XG5cbiAgb3Bjb2RlcygpOiBMaW5rZWRMaXN0PFVwZGF0aW5nT3Bjb2RlPiB7XG4gICAgcmV0dXJuIHRoaXMudXBkYXRpbmc7XG4gIH1cblxuICBoYW5kbGVFeGNlcHRpb24oKSB7XG4gICAgdGhyb3cgXCJ0aGlzIHNob3VsZCBuZXZlciBoYXBwZW5cIjtcbiAgfVxuXG4gIGRlc3Ryb3koKSB7XG4gICAgdGhpcy5ib3VuZHMuZGVzdHJveSgpO1xuICAgIGNsZWFyKHRoaXMuYm91bmRzKTtcbiAgfVxufVxuIl19 enifed('glimmer-runtime/lib/vm/update', ['exports', 'glimmer-runtime/lib/bounds', 'glimmer-runtime/lib/builder', 'glimmer-util', 'glimmer-reference', 'glimmer-runtime/lib/compiled/expressions/args', 'glimmer-runtime/lib/opcodes', 'glimmer-runtime/lib/vm/append'], function (exports, _glimmerRuntimeLibBounds, _glimmerRuntimeLibBuilder, _glimmerUtil, _glimmerReference, _glimmerRuntimeLibCompiledExpressionsArgs, _glimmerRuntimeLibOpcodes, _glimmerRuntimeLibVmAppend) { 'use strict'; var UpdatingVM = (function () { function UpdatingVM(env, _ref) { var _ref$alwaysRevalidate = _ref.alwaysRevalidate; var alwaysRevalidate = _ref$alwaysRevalidate === undefined ? false : _ref$alwaysRevalidate; this.frameStack = new _glimmerUtil.Stack(); this.env = env; this.dom = env.getDOM(); this.alwaysRevalidate = alwaysRevalidate; } UpdatingVM.prototype.execute = function execute(opcodes, handler) { var frameStack = this.frameStack; this.try(opcodes, handler); while (true) { if (frameStack.isEmpty()) break; var opcode = this.frameStack.current.nextStatement(); if (opcode === null) { this.frameStack.pop(); continue; } _glimmerUtil.LOGGER.debug('[VM] OP ' + opcode.type); _glimmerUtil.LOGGER.trace(opcode); opcode.evaluate(this); } }; UpdatingVM.prototype.goto = function goto(op) { this.frameStack.current.goto(op); }; UpdatingVM.prototype.try = function _try(ops, handler) { this.frameStack.push(new UpdatingVMFrame(this, ops, handler)); }; UpdatingVM.prototype.throw = function _throw() { this.frameStack.current.handleException(); this.frameStack.pop(); }; UpdatingVM.prototype.evaluateOpcode = function evaluateOpcode(opcode) { opcode.evaluate(this); }; return UpdatingVM; })(); exports.default = UpdatingVM; var BlockOpcode = (function (_UpdatingOpcode) { babelHelpers.inherits(BlockOpcode, _UpdatingOpcode); function BlockOpcode(ops, state, bounds, children) { _UpdatingOpcode.call(this); this.type = "block"; this.next = null; this.prev = null; var env = state.env; var scope = state.scope; var dynamicScope = state.dynamicScope; this.ops = ops; this.children = children; this.env = env; this.scope = scope; this.dynamicScope = dynamicScope; this.bounds = bounds; } BlockOpcode.prototype.parentElement = function parentElement() { return this.bounds.parentElement(); }; BlockOpcode.prototype.firstNode = function firstNode() { return this.bounds.firstNode(); }; BlockOpcode.prototype.lastNode = function lastNode() { return this.bounds.lastNode(); }; BlockOpcode.prototype.evaluate = function evaluate(vm) { vm.try(this.children, null); }; BlockOpcode.prototype.destroy = function destroy() { this.bounds.destroy(); }; BlockOpcode.prototype.didDestroy = function didDestroy() { this.env.didDestroy(this.bounds); }; BlockOpcode.prototype.toJSON = function toJSON() { var begin = this.ops.head(); var end = this.ops.tail(); var details = _glimmerUtil.dict(); details["guid"] = '' + this._guid; details["begin"] = begin.inspect(); details["end"] = end.inspect(); return { guid: this._guid, type: this.type, details: details, children: this.children.toArray().map(function (op) { return op.toJSON(); }) }; }; return BlockOpcode; })(_glimmerRuntimeLibOpcodes.UpdatingOpcode); exports.BlockOpcode = BlockOpcode; var TryOpcode = (function (_BlockOpcode) { babelHelpers.inherits(TryOpcode, _BlockOpcode); function TryOpcode(ops, state, bounds, children) { _BlockOpcode.call(this, ops, state, bounds, children); this.type = "try"; this.tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); } TryOpcode.prototype.didInitializeChildren = function didInitializeChildren() { this._tag.update(_glimmerReference.combineSlice(this.children)); }; TryOpcode.prototype.evaluate = function evaluate(vm) { vm.try(this.children, this); }; TryOpcode.prototype.handleException = function handleException() { var env = this.env; var scope = this.scope; var dynamicScope = this.dynamicScope; var elementStack = _glimmerRuntimeLibBuilder.ElementStack.resume(this.env, this.bounds, this.bounds.reset(env)); var vm = new _glimmerRuntimeLibVmAppend.default({ env: env, scope: scope, dynamicScope: dynamicScope, elementStack: elementStack }); var result = vm.execute(this.ops); this.children = result.opcodes(); this.didInitializeChildren(); }; TryOpcode.prototype.toJSON = function toJSON() { var json = _BlockOpcode.prototype.toJSON.call(this); var begin = this.ops.head(); var end = this.ops.tail(); json["details"]["begin"] = JSON.stringify(begin.inspect()); json["details"]["end"] = JSON.stringify(end.inspect()); return _BlockOpcode.prototype.toJSON.call(this); }; return TryOpcode; })(BlockOpcode); exports.TryOpcode = TryOpcode; var ListRevalidationDelegate = (function () { function ListRevalidationDelegate(opcode, marker) { this.opcode = opcode; this.marker = marker; this.didInsert = false; this.didDelete = false; this.map = opcode.map; this.updating = opcode['children']; } ListRevalidationDelegate.prototype.insert = function insert(key, item, memo, before) { var map = this.map; var opcode = this.opcode; var updating = this.updating; var nextSibling = null; var reference = null; if (before) { reference = map[before]; nextSibling = reference.bounds.firstNode(); } else { nextSibling = this.marker; } var vm = opcode.vmForInsertion(nextSibling); var tryOpcode = undefined; vm.execute(opcode.ops, function (vm) { vm.frame.setArgs(_glimmerRuntimeLibCompiledExpressionsArgs.EvaluatedArgs.positional([item, memo])); vm.frame.setOperand(item); vm.frame.setCondition(new _glimmerReference.ConstReference(true)); vm.frame.setKey(key); var state = vm.capture(); var tracker = vm.stack().pushUpdatableBlock(); tryOpcode = new TryOpcode(opcode.ops, state, tracker, vm.updatingOpcodeStack.current); }); tryOpcode.didInitializeChildren(); updating.insertBefore(tryOpcode, reference); map[key] = tryOpcode; this.didInsert = true; }; ListRevalidationDelegate.prototype.retain = function retain(key, item, memo) {}; ListRevalidationDelegate.prototype.move = function move(key, item, memo, before) { var map = this.map; var updating = this.updating; var entry = map[key]; var reference = map[before] || null; if (before) { _glimmerRuntimeLibBounds.move(entry, reference.firstNode()); } else { _glimmerRuntimeLibBounds.move(entry, this.marker); } updating.remove(entry); updating.insertBefore(entry, reference); }; ListRevalidationDelegate.prototype.delete = function _delete(key) { var map = this.map; var opcode = map[key]; _glimmerRuntimeLibBounds.clear(opcode); opcode.didDestroy(); this.updating.remove(opcode); delete map[key]; this.didDelete = true; }; ListRevalidationDelegate.prototype.done = function done() { if (this.didInsert || this.didDelete) { this.opcode.didInitializeChildren(); } }; return ListRevalidationDelegate; })(); exports.ListRevalidationDelegate = ListRevalidationDelegate; var ListBlockOpcode = (function (_BlockOpcode2) { babelHelpers.inherits(ListBlockOpcode, _BlockOpcode2); function ListBlockOpcode(ops, state, bounds, children, artifacts) { _BlockOpcode2.call(this, ops, state, bounds, children); this.type = "list-block"; this.map = _glimmerUtil.dict(); this.lastIterated = _glimmerReference.INITIAL; this.artifacts = artifacts; var _tag = this._tag = new _glimmerReference.UpdatableTag(_glimmerReference.CONSTANT_TAG); this.tag = _glimmerReference.combine([artifacts.tag, _tag]); } ListBlockOpcode.prototype.didInitializeChildren = function didInitializeChildren() { this.lastIterated = this.artifacts.tag.value(); this._tag.update(_glimmerReference.combineSlice(this.children)); }; ListBlockOpcode.prototype.evaluate = function evaluate(vm) { var artifacts = this.artifacts; var lastIterated = this.lastIterated; if (!artifacts.tag.validate(lastIterated)) { var bounds = this.bounds; var dom = vm.dom; var marker = dom.createComment(''); dom.insertAfter(bounds.parentElement(), marker, bounds.lastNode()); var target = new ListRevalidationDelegate(this, marker); var synchronizer = new _glimmerReference.IteratorSynchronizer({ target: target, artifacts: artifacts }); synchronizer.sync(); this.parentElement().removeChild(marker); } // Run now-updated updating opcodes _BlockOpcode2.prototype.evaluate.call(this, vm); }; ListBlockOpcode.prototype.vmForInsertion = function vmForInsertion(nextSibling) { var env = this.env; var scope = this.scope; var dynamicScope = this.dynamicScope; var elementStack = _glimmerRuntimeLibBuilder.ElementStack.forInitialRender(this.env, this.bounds.parentElement(), nextSibling); return new _glimmerRuntimeLibVmAppend.default({ env: env, scope: scope, dynamicScope: dynamicScope, elementStack: elementStack }); }; ListBlockOpcode.prototype.toJSON = function toJSON() { var json = _BlockOpcode2.prototype.toJSON.call(this); var map = this.map; var inner = Object.keys(map).map(function (key) { return JSON.stringify(key) + ': ' + map[key]._guid; }).join(", "); json["details"]["map"] = '{' + inner + '}'; return json; }; return ListBlockOpcode; })(BlockOpcode); exports.ListBlockOpcode = ListBlockOpcode; var UpdatingVMFrame = (function () { function UpdatingVMFrame(vm, ops, handler) { this.vm = vm; this.ops = ops; this.current = ops.head(); this.exceptionHandler = handler; } UpdatingVMFrame.prototype.goto = function goto(op) { this.current = op; }; UpdatingVMFrame.prototype.nextStatement = function nextStatement() { var current = this.current; var ops = this.ops; if (current) this.current = ops.nextNode(current); return current; }; UpdatingVMFrame.prototype.handleException = function handleException() { this.exceptionHandler.handleException(); }; return UpdatingVMFrame; })(); exports.UpdatingVMFrame = UpdatingVMFrame; }); // Tags //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItcnVudGltZS9saWIvdm0vdXBkYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztRQTJCYyxVQUFBO0FBTVosaUJBTlksVUFBQSxDQU1BLEdBQWdCLEVBQUUsSUFBNEIsRUFBQTt3Q0FBN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XG4gICAgcmV0dXJuIGN1cnJlbnQ7XG4gIH1cblxuICBoYW5kbGVFeGNlcHRpb24oKSB7XG4gICAgdGhpcy5leGNlcHRpb25IYW5kbGVyLmhhbmRsZUV4Y2VwdGlvbigpO1xuICB9XG59XG4iXX0= enifed('glimmer-util/index', ['exports', 'glimmer-util/lib/object-utils', 'glimmer-util/lib/namespaces', 'glimmer-util/lib/platform-utils', 'glimmer-util/lib/assert', 'glimmer-util/lib/array-utils', 'glimmer-util/lib/void-tag-names', 'glimmer-util/lib/logger', 'glimmer-util/lib/guid', 'glimmer-util/lib/collections', 'glimmer-util/lib/list-utils'], function (exports, _glimmerUtilLibObjectUtils, _glimmerUtilLibNamespaces, _glimmerUtilLibPlatformUtils, _glimmerUtilLibAssert, _glimmerUtilLibArrayUtils, _glimmerUtilLibVoidTagNames, _glimmerUtilLibLogger, _glimmerUtilLibGuid, _glimmerUtilLibCollections, _glimmerUtilLibListUtils) { /*globals console*/ 'use strict'; exports.getAttrNamespace = _glimmerUtilLibNamespaces.getAttrNamespace; exports.Option = _glimmerUtilLibPlatformUtils.Option; exports.Maybe = _glimmerUtilLibPlatformUtils.Maybe; exports.Opaque = _glimmerUtilLibPlatformUtils.Opaque; exports.opaque = _glimmerUtilLibPlatformUtils.opaque; exports.unwrap = _glimmerUtilLibPlatformUtils.unwrap; exports.assert = _glimmerUtilLibAssert.default; exports.forEach = _glimmerUtilLibArrayUtils.forEach; exports.map = _glimmerUtilLibArrayUtils.map; exports.isArray = _glimmerUtilLibArrayUtils.isArray; exports.indexOfArray = _glimmerUtilLibArrayUtils.indexOfArray; exports.voidMap = _glimmerUtilLibVoidTagNames.default; exports.LOGGER = _glimmerUtilLibLogger.default; exports.Logger = _glimmerUtilLibLogger.Logger; exports.LogLevel = _glimmerUtilLibLogger.LogLevel; /* tslint:disable:no-unused-variable */ /* tslint:enable:no-unused-variable */ exports.merge = _glimmerUtilLibObjectUtils.merge; exports.assign = _glimmerUtilLibObjectUtils.assign; exports.ensureGuid = _glimmerUtilLibGuid.ensureGuid; exports.initializeGuid = _glimmerUtilLibGuid.initializeGuid; exports.HasGuid = _glimmerUtilLibGuid.HasGuid; exports.types = _glimmerUtilLibObjectUtils; exports.Stack = _glimmerUtilLibCollections.Stack; exports.Dict = _glimmerUtilLibCollections.Dict; exports.DictWithNumberKeys = _glimmerUtilLibCollections.DictWithNumberKeys; exports.Set = _glimmerUtilLibCollections.Set; exports.DictSet = _glimmerUtilLibCollections.DictSet; exports.dict = _glimmerUtilLibCollections.dict; exports.EMPTY_SLICE = _glimmerUtilLibListUtils.EMPTY_SLICE; exports.LinkedList = _glimmerUtilLibListUtils.LinkedList; exports.LinkedListNode = _glimmerUtilLibListUtils.LinkedListNode; exports.ListNode = _glimmerUtilLibListUtils.ListNode; exports.CloneableListNode = _glimmerUtilLibListUtils.CloneableListNode; exports.ListSlice = _glimmerUtilLibListUtils.ListSlice; exports.Slice = _glimmerUtilLibListUtils.Slice; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O1VBTVMsZ0JBQWdCLDZCQUFoQixnQkFBZ0I7VUFDaEIsTUFBTSxnQ0FBTixNQUFNO1VBQUUsS0FBSyxnQ0FBTCxLQUFLO1VBQUUsTUFBTSxnQ0FBTixNQUFNO1VBQUUsTUFBTSxnQ0FBTixNQUFNO1VBQUUsTUFBTSxnQ0FBTixNQUFNO1VBQzFCLE1BQU0seUJBQWpCLE9BQU87VUFDUCxPQUFPLDZCQUFQLE9BQU87VUFBRSxHQUFHLDZCQUFILEdBQUc7VUFBRSxPQUFPLDZCQUFQLE9BQU87VUFBRSxZQUFZLDZCQUFaLFlBQVk7VUFDeEIsT0FBTywrQkFBbEIsT0FBTztVQUNJLE1BQU0seUJBQWpCLE9BQU87VUFBWSxNQUFNLHlCQUFOLE1BQU07VUFBRSxRQUFRLH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1bHQgYXMgdm9pZE1hcCB9IGZyb20gJy4vbGliL3ZvaWQtdGFnLW5hbWVzJztcbmV4cG9ydCB7IGRlZmF1bHQgYXMgTE9HR0VSLCBMb2dnZXIsIExvZ0xldmVsIH0gZnJvbSAnLi9saWIvbG9nZ2VyJztcblxuLyogdHNsaW50OmRpc2FibGU6bm8tdW51c2VkLXZhcmlhYmxlICovXG5pbXBvcnQgKiBhcyB0eXBlcyBmcm9tICcuL2xpYi9vYmplY3QtdXRpbHMnO1xuLyogdHNsaW50OmVuYWJsZTpuby11bnVzZWQtdmFyaWFibGUgKi9cbmV4cG9ydCB7IG1lcmdlLCBhc3NpZ24gfSBmcm9tICcuL2xpYi9vYmplY3QtdXRpbHMnO1xuZXhwb3J0IHsgZW5zdXJlR3VpZCwgaW5pdGlhbGl6ZUd1aWQsIEhhc0d1aWQgfSBmcm9tICcuL2xpYi9ndWlkJztcblxuZXhwb3J0IHsgdHlwZXMgfTtcbmV4cG9ydCB7IFN0YWNrLCBEaWN0LCBEaWN0V2l0aE51bWJlcktleXMsIFNldCwgRGljdFNldCwgZGljdCB9IGZyb20gJy4vbGliL2NvbGxlY3Rpb25zJztcbmV4cG9ydCB7IEVNUFRZX1NMSUNFLCBMaW5rZWRMaXN0LCBMaW5rZWRMaXN0Tm9kZSwgTGlzdE5vZGUsIENsb25lYWJsZUxpc3ROb2RlLCBMaXN0U2xpY2UsIFNsaWNlIH0gZnJvbSAnLi9saWIvbGlzdC11dGlscyc7XG5cbmV4cG9ydCB0eXBlIEZJWE1FPFQsIHN0cmluZz4gPSBUO1xuIl19 enifed('glimmer-util/lib/array-utils', ['exports'], function (exports) { 'use strict'; exports.forEach = forEach; exports.map = map; function forEach(array, callback) { var binding = arguments.length <= 2 || arguments[2] === undefined ? undefined : arguments[2]; var i = undefined, l = undefined; if (binding === undefined) { for (i = 0, l = array.length; i < l; i++) { callback(array[i], i, array); } } else { for (i = 0, l = array.length; i < l; i++) { callback.call(binding, array[i], i, array); } } } function map(array, callback) { var output = []; var i = undefined, l = undefined; for (i = 0, l = array.length; i < l; i++) { output.push(callback(array[i], i, array)); } return output; } var getIdx = undefined; if (Array.prototype.indexOf) { getIdx = function (array, obj, from) { return array.indexOf(obj, from); }; } else { getIdx = function (array, obj, from) { if (from === undefined || from === null) { from = 0; } else if (from < 0) { from = Math.max(0, array.length + from); } for (var i = from, l = array.length; i < l; i++) { if (array[i] === obj) { return i; } } return -1; }; } var isArray = Array.isArray || function (array) { return Object.prototype.toString.call(array) === '[object Array]'; }; exports.isArray = isArray; var indexOfArray = getIdx; exports.indexOfArray = indexOfArray; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvYXJyYXktdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQU0sYUFBQSxPQUFBLENBQXFCLEtBQVUsRUFBRSxRQUE4QyxFQUF3QjtZQUF0QixPQUFPLHlEQUFNLFNBQVM7O0FBQzNHLFlBQUksQ0FBQyxZQUFBO1lBQUUsQ0FBQyxZQUFBLENBQUM7QUFDVCxZQUFJLE9BQU8sS0FBSyxTQUFTLEVBQUU7QUFDekIsaUJBQUssQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsS0FBSyxDQUFDLE1BQU0sRUFBRSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQ3hDLHdCQUFRLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxLQUFLLENBQUMsQ0FBQzthQUM5QjtTQUNGLE1BQU07QUFDTCxpQkFBSyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDeEMsd0JBQVEsQ0FBQyxJQUFJLENBQUMs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JheSkge1xuICByZXR1cm4gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKGFycmF5KSA9PT0gJ1tvYmplY3QgQXJyYXldJztcbn0pO1xuXG5leHBvcnQgbGV0IGluZGV4T2ZBcnJheSA9IGdldElkeDsiXX0= enifed("glimmer-util/lib/assert", ["exports"], function (exports) { // import Logger from './logger'; // let alreadyWarned = false; // import Logger from './logger'; "use strict"; exports.debugAssert = debugAssert; exports.prodAssert = prodAssert; function debugAssert(test, msg) { // if (!alreadyWarned) { // alreadyWarned = true; // Logger.warn("Don't leave debug assertions on in public builds"); // } if (!test) { throw new Error(msg || "assertion failure"); } } function prodAssert() {} exports.default = debugAssert; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvYXNzZXJ0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUlNLGFBQUEsV0FBQSxDQUFzQixJQUFJLEVBQUUsR0FBRyxFQUFBOzs7OztBQU1uQyxZQUFJLENBQUMsSUFBSSxFQUFFO0FBQ1Qsa0JBQU0sSUFBSSxLQUFLLENBQUMsR0FBRyxJQUFJLG1CQUFtQixDQUFDLENBQUM7U0FDN0M7S0FDRjs7QUFFSyxhQUFBLFVBQUEsR0FBQSxFQUF5Qjs7c0JBRWhCLFdBQVciLCJmaWxlIjoiYXNzZXJ0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gaW1wb3J0IExvZ2dlciBmcm9tICcuL2xvZ2dlcic7XG5cbi8vIGxldCBhbHJlYWR5V2FybmVkID0gZmFsc2U7XG5cbmV4cG9ydCBmdW5jdGlvbiBkZWJ1Z0Fzc2VydCh0ZXN0LCBtc2cpIHtcbiAgLy8gaWYgKCFhbHJlYWR5V2FybmVkKSB7XG4gIC8vICAgYWxyZWFkeVdhcm5lZCA9IHRydWU7XG4gIC8vICAgTG9nZ2VyLndhcm4oXCJEb24ndCBsZWF2ZSBkZWJ1ZyBhc3NlcnRpb25zIG9uIGluIHB1YmxpYyBidWlsZHNcIik7XG4gIC8vIH1cblxuICBpZiAoIXRlc3QpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IobXNnIHx8IFwiYXNzZXJ0aW9uIGZhaWx1cmVcIik7XG4gIH1cbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHByb2RBc3NlcnQoKSB7fVxuXG5leHBvcnQgZGVmYXVsdCBkZWJ1Z0Fzc2VydDtcbiJdfQ== enifed('glimmer-util/lib/collections', ['exports', 'glimmer-util/lib/guid'], function (exports, _glimmerUtilLibGuid) { 'use strict'; exports.dict = dict; var proto = Object.create(null, { // without this, we will always still end up with (new // EmptyObject()).constructor === Object constructor: { value: undefined, enumerable: false, writable: true } }); function EmptyObject() {} EmptyObject.prototype = proto; function dict() { // let d = Object.create(null); // d.x = 1; // delete d.x; // return d; return new EmptyObject(); } var DictSet = (function () { function DictSet() { this.dict = dict(); } DictSet.prototype.add = function add(obj) { if (typeof obj === 'string') this.dict[obj] = obj;else this.dict[_glimmerUtilLibGuid.ensureGuid(obj)] = obj; return this; }; DictSet.prototype.delete = function _delete(obj) { if (typeof obj === 'string') delete this.dict[obj];else if (obj._guid) delete this.dict[obj._guid]; }; DictSet.prototype.forEach = function forEach(callback) { var dict = this.dict; Object.keys(dict).forEach(function (key) { return callback(dict[key]); }); }; DictSet.prototype.toArray = function toArray() { return Object.keys(this.dict); }; return DictSet; })(); exports.DictSet = DictSet; var Stack = (function () { function Stack() { this.stack = []; this.current = null; } Stack.prototype.push = function push(item) { this.current = item; this.stack.push(item); }; Stack.prototype.pop = function pop() { var item = this.stack.pop(); var len = this.stack.length; this.current = len === 0 ? null : this.stack[len - 1]; return item; }; Stack.prototype.isEmpty = function isEmpty() { return this.stack.length === 0; }; return Stack; })(); exports.Stack = Stack; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItd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N0cmluZ1tdIHtcbiAgICByZXR1cm4gT2JqZWN0LmtleXModGhpcy5kaWN0KTtcbiAgfVxufVxuXG5leHBvcnQgY2xhc3MgU3RhY2s8VD4ge1xuICBwcml2YXRlIHN0YWNrOiBUW10gPSBbXTtcbiAgcHVibGljIGN1cnJlbnQ6IFQgPSBudWxsO1xuXG4gIHB1c2goaXRlbTogVCkge1xuICAgIHRoaXMuY3VycmVudCA9IGl0ZW07XG4gICAgdGhpcy5zdGFjay5wdXNoKGl0ZW0pO1xuICB9XG5cbiAgcG9wKCk6IFQge1xuICAgIGxldCBpdGVtID0gdGhpcy5zdGFjay5wb3AoKTtcbiAgICBsZXQgbGVuID0gdGhpcy5zdGFjay5sZW5ndGg7XG4gICAgdGhpcy5jdXJyZW50ID0gbGVuID09PSAwID8gbnVsbCA6IHRoaXMuc3RhY2tbbGVuIC0gMV07XG5cbiAgICByZXR1cm4gaXRlbTtcbiAgfVxuXG4gIGlzRW1wdHkoKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRoaXMuc3RhY2subGVuZ3RoID09PSAwO1xuICB9XG59XG4iXX0= enifed("glimmer-util/lib/guid", ["exports"], function (exports) { "use strict"; exports.initializeGuid = initializeGuid; exports.ensureGuid = ensureGuid; var GUID = 0; function initializeGuid(object) { return object._guid = ++GUID; } function ensureGuid(object) { return object._guid || initializeGuid(object); } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvZ3VpZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLFFBQUksSUFBSSxHQUFHLENBQUMsQ0FBQzs7QUFNUCxhQUFBLGNBQUEsQ0FBeUIsTUFBZSxFQUFBO0FBQzVDLGVBQVEsTUFBTSxDQUFDLEtBQUssR0FBRyxFQUFFLElBQUksQ0FBRTtLQUNoQzs7QUFFSyxhQUFBLFVBQUEsQ0FBcUIsTUFBZSxFQUFBO0FBQ3hDLGVBQU8sTUFBTSxDQUFDLEtBQUssSUFBSSxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUM7S0FDL0MiLCJmaWxlIjoiZ3VpZC5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBHVUlEID0gMDtcblxuZXhwb3J0IGludGVyZmFjZSBIYXNHdWlkIHtcbiAgX2d1aWQ6IG51bWJlcjtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGluaXRpYWxpemVHdWlkKG9iamVjdDogSGFzR3VpZCk6IG51bWJlciB7XG4gIHJldHVybiAob2JqZWN0Ll9ndWlkID0gKytHVUlEKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGVuc3VyZUd1aWQob2JqZWN0OiBIYXNHdWlkKTogbnVtYmVyIHtcbiAgcmV0dXJuIG9iamVjdC5fZ3VpZCB8fCBpbml0aWFsaXplR3VpZChvYmplY3QpO1xufSJdfQ== enifed("glimmer-util/lib/list-utils", ["exports"], function (exports) { "use strict"; var ListNode = function ListNode(value) { this.next = null; this.prev = null; this.value = value; }; exports.ListNode = ListNode; var LinkedList = (function () { function LinkedList() { this.clear(); } LinkedList.fromSlice = function fromSlice(slice) { var list = new LinkedList(); slice.forEachNode(function (n) { return list.append(n.clone()); }); return list; }; LinkedList.prototype.head = function head() { return this._head; }; LinkedList.prototype.tail = function tail() { return this._tail; }; LinkedList.prototype.clear = function clear() { this._head = this._tail = null; }; LinkedList.prototype.isEmpty = function isEmpty() { return this._head === null; }; LinkedList.prototype.toArray = function toArray() { var out = []; this.forEachNode(function (n) { return out.push(n); }); return out; }; LinkedList.prototype.splice = function splice(start, end, reference) { var before = undefined; if (reference === null) { before = this._tail; this._tail = end; } else { before = reference.prev; end.next = reference; reference.prev = end; } if (before) { before.next = start; start.prev = before; } }; LinkedList.prototype.spliceList = function spliceList(list, reference) { if (list.isEmpty()) return; this.splice(list.head(), list.tail(), reference); }; LinkedList.prototype.nextNode = function nextNode(node) { return node.next; }; LinkedList.prototype.prevNode = function prevNode(node) { return node.prev; }; LinkedList.prototype.forEachNode = function forEachNode(callback) { var node = this._head; while (node !== null) { callback(node); node = node.next; } }; LinkedList.prototype.contains = function contains(needle) { var node = this._head; while (node !== null) { if (node === needle) return true; node = node.next; } return false; }; LinkedList.prototype.insertBefore = function insertBefore(node) { var reference = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; if (reference === null) return this.append(node); if (reference.prev) reference.prev.next = node;else this._head = node; node.prev = reference.prev; node.next = reference; reference.prev = node; return node; }; LinkedList.prototype.append = function append(node) { var tail = this._tail; if (tail) { tail.next = node; node.prev = tail; node.next = null; } else { this._head = node; } return this._tail = node; }; LinkedList.prototype.pop = function pop() { if (this._tail) return this.remove(this._tail); return null; }; LinkedList.prototype.prepend = function prepend(node) { if (this._head) return this.insertBefore(node, this._head); return this._head = this._tail = node; }; LinkedList.prototype.remove = function remove(node) { if (node.prev) node.prev.next = node.next;else this._head = node.next; if (node.next) node.next.prev = node.prev;else this._tail = node.prev; return node; }; return LinkedList; })(); exports.LinkedList = LinkedList; var LinkedListRemover = (function () { function LinkedListRemover(node) { this.node = node; } LinkedListRemover.prototype.destroy = function destroy() { var _node = this.node; var prev = _node.prev; var next = _node.next; prev.next = next; next.prev = prev; }; return LinkedListRemover; })(); var ListSlice = (function () { function ListSlice(head, tail) { this._head = head; this._tail = tail; } ListSlice.toList = function toList(slice) { var list = new LinkedList(); slice.forEachNode(function (n) { return list.append(n.clone()); }); return list; }; ListSlice.prototype.forEachNode = function forEachNode(callback) { var node = this._head; while (node !== null) { callback(node); node = this.nextNode(node); } }; ListSlice.prototype.contains = function contains(needle) { var node = this._head; while (node !== null) { if (node === needle) return true; node = node.next; } return false; }; ListSlice.prototype.head = function head() { return this._head; }; ListSlice.prototype.tail = function tail() { return this._tail; }; ListSlice.prototype.toArray = function toArray() { var out = []; this.forEachNode(function (n) { return out.push(n); }); return out; }; ListSlice.prototype.nextNode = function nextNode(node) { if (node === this._tail) return null; return node.next; }; ListSlice.prototype.prevNode = function prevNode(node) { if (node === this._head) return null; return node.prev; }; ListSlice.prototype.isEmpty = function isEmpty() { return false; }; return ListSlice; })(); exports.ListSlice = ListSlice; var EMPTY_SLICE = new ListSlice(null, null); exports.EMPTY_SLICE = EMPTY_SLICE; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbGlzdC11dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7UUFTTSxRQUFBLEdBS0osU0FMSSxRQUFBLENBS1EsS0FBUSxFQUFBO0FBSmIsWUFBQSxDQUFBLElBQUksR0FBZ0IsSUFBSSxDQUFDO0FBQ3pCLFlBQUEsQ0FBQSxJQUFJLEdBQWdCLElBQUksQ0FBQztBQUk5QixZQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztLQUNwQjs7OztRQU9HLFVBQUE7QUFVSixpQkFWSSxVQUFBLEdBVUo7QUFDRSxnQkFBSSxDQUFDLEtBQUssRUFBRSxDQUFDO1NBQ2Q7O0FBWkcsa0JBQUEsQ0FDRyxTQUFTLEdBQUEsbUJBQThCLEtBQWUsRUFBQTtBQUMzRCxnQkFBSSxJQUFJLEdBQUcsSUFBSSxVQUFVLEVBQUssQ0FBQztBQUMvQixpQkFBSyxDQUFDLFdBQVcsQ0FBQyxVQUFBLENBQUM7dUJBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7YUFBQSxDQUFDLENBQUM7QUFDL0MsbUJBQU8sSUFBSSxDQUFDO1NBQ2I7O0FBTEcsa0JBQUEsV0FjSixJQUFJLEdBQUEsZ0JBQUE7QUFDRixtQkFBTyxJQUFJLENBQUMsS0FBSyxDQUFDO1NBQ25COztBQWhCRyxrQkFBQSxXQWtCSixJQUFJLEdBQUEsZ0JBQUE7QUFDRixtQkFBTyxJQUFJLENBQUMsS0FBSyxDQUFDO1NBQ25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kZShub2RlOiBUKTogVCB7XG4gICAgaWYgKG5vZGUgPT09IHRoaXMuX3RhaWwpIHJldHVybiBudWxsO1xuICAgIHJldHVybiA8VD5ub2RlLm5leHQ7XG4gIH1cblxuICBwcmV2Tm9kZShub2RlOiBUKTogVCB7XG4gICAgaWYgKG5vZGUgPT09IHRoaXMuX2hlYWQpIHJldHVybiBudWxsO1xuICAgIHJldHVybiA8VD5ub2RlLnByZXY7XG4gIH1cblxuICBpc0VtcHR5KCkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuXG5leHBvcnQgY29uc3QgRU1QVFlfU0xJQ0UgPSBuZXcgTGlzdFNsaWNlKG51bGwsIG51bGwpOyJdfQ== enifed("glimmer-util/lib/logger", ["exports"], function (exports) { "use strict"; var LogLevel; exports.LogLevel = LogLevel; (function (LogLevel) { LogLevel[LogLevel["Trace"] = 0] = "Trace"; LogLevel[LogLevel["Debug"] = 1] = "Debug"; LogLevel[LogLevel["Warn"] = 2] = "Warn"; LogLevel[LogLevel["Error"] = 3] = "Error"; })(LogLevel || (exports.LogLevel = LogLevel = {})); var NullConsole = (function () { function NullConsole() {} NullConsole.prototype.log = function log(message) {}; NullConsole.prototype.warn = function warn(message) {}; NullConsole.prototype.error = function error(message) {}; NullConsole.prototype.trace = function trace() {}; return NullConsole; })(); var Logger = (function () { function Logger(_ref) { var console = _ref.console; var level = _ref.level; this.f = ALWAYS; this.force = ALWAYS; this.console = console; this.level = level; } Logger.prototype.skipped = function skipped(level) { return level < this.level; }; Logger.prototype.trace = function trace(message) { var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var _ref2$stackTrace = _ref2.stackTrace; var stackTrace = _ref2$stackTrace === undefined ? false : _ref2$stackTrace; if (this.skipped(LogLevel.Trace)) return; this.console.log(message); if (stackTrace) this.console.trace(); }; Logger.prototype.debug = function debug(message) { var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var _ref3$stackTrace = _ref3.stackTrace; var stackTrace = _ref3$stackTrace === undefined ? false : _ref3$stackTrace; if (this.skipped(LogLevel.Debug)) return; this.console.log(message); if (stackTrace) this.console.trace(); }; Logger.prototype.warn = function warn(message) { var _ref4 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var _ref4$stackTrace = _ref4.stackTrace; var stackTrace = _ref4$stackTrace === undefined ? false : _ref4$stackTrace; if (this.skipped(LogLevel.Warn)) return; this.console.warn(message); if (stackTrace) this.console.trace(); }; Logger.prototype.error = function error(message) { if (this.skipped(LogLevel.Error)) return; this.console.error(message); }; return Logger; })(); exports.Logger = Logger; var _console = typeof console === 'undefined' ? new NullConsole() : console; var ALWAYS = new Logger({ console: _console, level: LogLevel.Trace }); var LOG_LEVEL = LogLevel.Warn; exports.default = new Logger({ console: _console, level: LOG_LEVEL }); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbG9nZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLFFBQVksUUFLWCxDQUFBOztBQUxELEtBQUEsVUFBWSxRQUFRLEVBQUE7QUFDbEIsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0FBQ0wsZ0JBQUEsQ0FBQSxRQUFBLENBQUEsTUFBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsTUFBSSxDQUFBO0FBQ0osZ0JBQUEsQ0FBQSxRQUFBLENBQUEsT0FBQSxDQUFBLEdBQUEsQ0FBQSxDQUFBLEdBQUEsT0FBSyxDQUFBO0tBQ04sQ0FBQSxDQUxXLFFBQVEsYUFBUixRQUtYLEdBTFcsUUFBUSx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ZXR1cm47XG4gICAgdGhpcy5jb25zb2xlLmVycm9yKG1lc3NhZ2UpO1xuICB9XG59XG5cbmxldCBfY29uc29sZSA9ICh0eXBlb2YgY29uc29sZSA9PT0gJ3VuZGVmaW5lZCcpID8gbmV3IE51bGxDb25zb2xlKCkgOiBjb25zb2xlO1xuXG5jb25zdCBBTFdBWVMgPSBuZXcgTG9nZ2VyKHsgY29uc29sZTogX2NvbnNvbGUsIGxldmVsOiBMb2dMZXZlbC5UcmFjZSB9KTtcbmNvbnN0IExPR19MRVZFTCA9IExvZ0xldmVsLldhcm47XG5cbmV4cG9ydCBkZWZhdWx0IG5ldyBMb2dnZXIoeyBjb25zb2xlOiBfY29uc29sZSwgbGV2ZWw6IExPR19MRVZFTCB9KTtcbiJdfQ== enifed('glimmer-util/lib/namespaces', ['exports'], function (exports) { // There is a small whitelist of namespaced attributes specially // enumerated in // https://www.w3.org/TR/html/syntax.html#attributes-0 // // > When a foreign element has one of the namespaced attributes given by // > the local name and namespace of the first and second cells of a row // > from the following table, it must be written using the name given by // > the third cell from the same row. // // In all other cases, colons are interpreted as a regular character // with no special meaning: // // > No other namespaced attribute can be expressed in the HTML syntax. 'use strict'; exports.getAttrNamespace = getAttrNamespace; var XLINK = 'http://www.w3.org/1999/xlink'; var XML = 'http://www.w3.org/XML/1998/namespace'; var XMLNS = 'http://www.w3.org/2000/xmlns/'; var WHITELIST = { 'xlink:actuate': XLINK, 'xlink:arcrole': XLINK, 'xlink:href': XLINK, 'xlink:role': XLINK, 'xlink:show': XLINK, 'xlink:title': XLINK, 'xlink:type': XLINK, 'xml:base': XML, 'xml:lang': XML, 'xml:space': XML, 'xmlns': XMLNS, 'xmlns:xlink': XMLNS }; function getAttrNamespace(attrName) { return WHITELIST[attrName] || null; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvbmFtZXNwYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcH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1bmN0aW9uIGdldEF0dHJOYW1lc3BhY2UoYXR0ck5hbWUpIHtcbiAgcmV0dXJuIFdISVRFTElTVFthdHRyTmFtZV0gfHwgbnVsbDtcbn0iXX0= enifed('glimmer-util/lib/object-utils', ['exports'], function (exports) { /*globals console*/ /*globals console*/'use strict'; exports.merge = merge; exports.assign = assign; exports.shallowCopy = shallowCopy; exports.keySet = keySet; exports.keyLength = keyLength; function merge(options, defaults) { for (var prop in defaults) { if (options.hasOwnProperty(prop)) { continue; } options[prop] = defaults[prop]; } return options; } function assign(obj) { for (var _len = arguments.length, assignments = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { assignments[_key - 1] = arguments[_key]; } return assignments.reduce(function (obj, extensions) { if (typeof extensions !== 'object' || extensions === null) { return obj; } Object.keys(extensions).forEach(function (key) { return obj[key] = extensions[key]; }); return obj; }, obj); } function shallowCopy(obj) { return merge({}, obj); } function keySet(obj) { var set = {}; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { set[prop] = true; } } return set; } function keyLength(obj) { var count = 0; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { count++; } } return count; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvb2JqZWN0LXV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFFTSxhQUFBLEtBQUEsQ0FBZ0IsT0FBTyxFQUFFLFFBQVEsRUFBQTtBQUNyQyxhQUFLLElBQUksSUFBSSxJQUFJLFFBQVEsRUFBRTtBQUN6QixnQkFBSSxPQUFPLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxFQUFFO0FBQUUseUJBQVM7YUFBRTtBQUMvQyxtQkFBTyxDQUFDLElBQUksQ0FBQyxHQUFHLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQztTQUNoQztBQUNELGVBQU8sT0FBTyxDQUFDO0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blxuICByZXR1cm4gY291bnQ7XG59XG4iXX0= enifed("glimmer-util/lib/platform-utils", ["exports"], function (exports) { "use strict"; exports.opaque = opaque; exports.unwrap = unwrap; function opaque(value) { return value; } // tslint:disable-line function unwrap(val) { if (val === null || val === undefined) throw new Error("Expected value to be present"); return val; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcGxhdGZvcm0tdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBRU0sYUFBQSxNQUFBLENBQWlCLEtBQWEsRUFBQTtBQUNsQyxlQUFPLEtBQUssQ0FBQztLQUNkOzs7O0FBS0ssYUFBQSxNQUFBLENBQW9CLEdBQWEsRUFBQTtBQUNyQyxZQUFJLEdBQUcsS0FBSyxJQUFJLElBQUksR0FBRyxLQUFLLFNBQVMsRUFBRSxNQUFNLElBQUksS0FBSyxnQ0FBZ0MsQ0FBQztBQUN2RixlQUFPLEdBQUcsQ0FBQztLQUNaIiwiZmlsZSI6InBsYXRmb3JtLXV0aWxzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgT3BhcXVlID0ge30gfCB2b2lkO1xuXG5leHBvcnQgZnVuY3Rpb24gb3BhcXVlKHZhbHVlOiBPcGFxdWUpOiBPcGFxdWUge1xuICByZXR1cm4gdmFsdWU7XG59XG5cbmV4cG9ydCB0eXBlIE9wdGlvbjxUPiA9IFQgfCBudWxsOyAvLyB0c2xpbnQ6ZGlzYWJsZS1saW5lXG5leHBvcnQgdHlwZSBNYXliZTxUPiA9IE9wdGlvbjxUPiB8IHVuZGVmaW5lZDsgLy8gdHNsaW50OmRpc2FibGUtbGluZVxuXG5leHBvcnQgZnVuY3Rpb24gdW53cmFwPFQ+KHZhbDogTWF5YmU8VD4pOiBUIHtcbiAgaWYgKHZhbCA9PT0gbnVsbCB8fCB2YWwgPT09IHVuZGVmaW5lZCkgdGhyb3cgbmV3IEVycm9yKGBFeHBlY3RlZCB2YWx1ZSB0byBiZSBwcmVzZW50YCk7XG4gIHJldHVybiB2YWw7XG59XG4iXX0= enifed("glimmer-util/lib/quoting", ["exports"], function (exports) { "use strict"; exports.hash = hash; exports.repeat = repeat; function escapeString(str) { str = str.replace(/\\/g, "\\\\"); str = str.replace(/"/g, '\\"'); str = str.replace(/\n/g, "\\n"); return str; } exports.escapeString = escapeString; function string(str) { return '"' + escapeString(str) + '"'; } exports.string = string; function array(a) { return "[" + a + "]"; } exports.array = array; function hash(pairs) { return "{" + pairs.join(", ") + "}"; } function repeat(chars, times) { var str = ""; while (times--) { str += chars; } return str; } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvcXVvdGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLGFBQUEsWUFBQSxDQUFzQixHQUFHLEVBQUE7QUFDdkIsV0FBRyxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxDQUFDO0FBQ2pDLFdBQUcsR0FBRyxHQUFHLENBQUMsT0FBTyxDQUFDLElBQUksRUFBRSxLQUFLLENBQUMsQ0FBQztBQUMvQixXQUFHLEdBQUcsR0FBRyxDQUFDLE9BQU8sQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLENBQUM7QUFDaEMsZUFBTyxHQUFHLENBQUM7S0FDWjtZQUVRLFlBQVksR0FBWixZQUFZOztBQUVyQixhQUFBLE1BQUEsQ0FBZ0IsR0FBRyxFQUFBO0FBQ2pCLGVBQU8sR0FBRyxHQUFHLFlBQVksQ0FBQyxHQUFHLENBQUMsR0FBRyxHQUFHLENBQUM7S0FDdEM7WUFFUSxNQUFNLEdBQU4sTUFBTTs7QUFFZixhQUFBLEtBQUEsQ0FBZSxDQUFDLEVBQUE7QUFDZCxlQUFPLEdB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gXCJ9XCI7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiByZXBlYXQoY2hhcnMsIHRpbWVzKSB7XG4gIGxldCBzdHIgPSBcIlwiO1xuICB3aGlsZSAodGltZXMtLSkge1xuICAgIHN0ciArPSBjaGFycztcbiAgfVxuICByZXR1cm4gc3RyO1xufVxuIl19 enifed("glimmer-util/lib/void-tag-names", ["exports", "glimmer-util/lib/array-utils"], function (exports, _glimmerUtilLibArrayUtils) { "use strict"; // The HTML elements in this list are speced by // http://www.w3.org/TR/html-markup/syntax.html#syntax-elements, // and will be forced to close regardless of if they have a // self-closing /> at the end. var voidTagNames = "area base br col command embed hr img input keygen link meta param source track wbr"; var voidMap = {}; _glimmerUtilLibArrayUtils.forEach(voidTagNames.split(" "), function (tagName) { return voidMap[tagName] = true; }); exports.default = voidMap; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItdXRpbC9saWIvdm9pZC10YWctbmFtZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQU1BLE1BQUksWUFBWSxHQUFHLHFGQUFxRixDQUFDO0FBQ3pHLE1BQUksT0FBTyxHQUFHLEVBQUUsQ0FBQztBQUVqQiw0QkFUUyxPQUFPLENBU1IsWUFBWSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsRUFBRSxVQUFBLE9BQU87V0FBSSxPQUFPLENBQUMsT0FBTyxDQUFDLEdBQUcsSUFBSTtHQUFBLENBQUMsQ0FBQztvQkFFdEQsT0FBTyIsImZpbGUiOiJ2b2lkLXRhZy1uYW1lcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGZvckVhY2ggfSBmcm9tIFwiLi9hcnJheS11dGlsc1wiO1xuXG4vLyBUaGUgSFRNTCBlbGVtZW50cyBpbiB0aGlzIGxpc3QgYXJlIHNwZWNlZCBieVxuLy8gaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbC1tYXJrdXAvc3ludGF4Lmh0bWwjc3ludGF4LWVsZW1lbnRzLFxuLy8gYW5kIHdpbGwgYmUgZm9yY2VkIHRvIGNsb3NlIHJlZ2FyZGxlc3Mgb2YgaWYgdGhleSBoYXZlIGFcbi8vIHNlbGYtY2xvc2luZyAvPiBhdCB0aGUgZW5kLlxubGV0IHZvaWRUYWdOYW1lcyA9IFwiYXJlYSBiYXNlIGJyIGNvbCBjb21tYW5kIGVtYmVkIGhyIGltZyBpbnB1dCBrZXlnZW4gbGluayBtZXRhIHBhcmFtIHNvdXJjZSB0cmFjayB3YnJcIjtcbmxldCB2b2lkTWFwID0ge307XG5cbmZvckVhY2godm9pZFRhZ05hbWVzLnNwbGl0KFwiIFwiKSwgdGFnTmFtZSA9PiB2b2lkTWFwW3RhZ05hbWVdID0gdHJ1ZSk7XG5cbmV4cG9ydCBkZWZhdWx0IHZvaWRNYXA7XG4iXX0= enifed('glimmer-wire-format/index', ['exports'], function (exports) { 'use strict'; function is(variant) { return function (value) { return value[0] === variant; }; } var Expressions; exports.Expressions = Expressions; (function (Expressions) { Expressions.isUnknown = is('unknown'); Expressions.isArg = is('arg'); Expressions.isGet = is('get'); Expressions.isConcat = is('concat'); Expressions.isHelper = is('helper'); Expressions.isHasBlock = is('has-block'); Expressions.isHasBlockParams = is('has-block-params'); Expressions.isUndefined = is('undefined'); function isPrimitiveValue(value) { if (value === null) { return true; } return typeof value !== 'object'; } Expressions.isPrimitiveValue = isPrimitiveValue; })(Expressions || (exports.Expressions = Expressions = {})); var Statements; exports.Statements = Statements; (function (Statements) { Statements.isText = is('text'); Statements.isAppend = is('append'); Statements.isComment = is('comment'); Statements.isModifier = is('modifier'); Statements.isBlock = is('block'); Statements.isOpenElement = is('open-element'); Statements.isFlushElement = is('flush-element'); Statements.isCloseElement = is('close-element'); Statements.isStaticAttr = is('static-attr'); Statements.isDynamicAttr = is('dynamic-attr'); Statements.isYield = is('yield'); Statements.isDynamicArg = is('dynamic-arg'); Statements.isStaticArg = is('static-arg'); Statements.isTrustingAttr = is('trusting-attr'); })(Statements || (exports.Statements = Statements = {})); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXItd2lyZS1mb3JtYXQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBbUJBLGFBQUEsRUFBQSxDQUE2QixPQUFlLEVBQUE7QUFDMUMsZUFBTyxVQUFTLEtBQVksRUFBQTtBQUMxQixtQkFBTyxLQUFLLENBQUMsQ0FBQyxDQUFDLEtBQUssT0FBTyxDQUFDO1NBQzdCLENBQUM7S0FDSDtBQVVLLFFBQVcsV0FBVyxDQW9EM0I7O0FBcERELEtBQUEsVUFBaUIsV0FBVyxFQUFBO0FBcUNiLG1CQUFBLENBQUEsU0FBUyxHQUFVLEVBQUUsQ0FBVSxTQUFTLENBQUMsQ0FBQztBQUMxQyxtQkFBQSxDQUFBLEtBQUssR0FBYyxFQUFFLENBQU0sS0FBSyxDQUFDLENBQUM7QUFDbEMsbUJBQUEsQ0FBQSxLQUFLLEdBQWMsRUFBRSxDQUFNLEtBQUssQ0FBQyxDQUFDO0FBQ2xDLG1CQUFBLENBQUEsUUFBUSxHQUFXLEVBQUUsQ0FBUyxRQUFRLENBQUMsQ0FBQztBQUN4QyxtQkFBQSxDQUFBLFFBQVEsR0FBVyxFQUFFLENBQVMsUUFBUSxDQUFDLENBQUM7QUFDeEMsbUJBQUEsQ0FBQSxVQUFVLEdBQVMsRUFBRSxDQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQzdDLG1CQUFBLENBQUEsZ0JBQWdCLEdBQUcsRUFBRSxDQUFpQixrQkFBa0IsQ0FBQyxDQUFDO0FBQzFELG1CQUFBLENBQUEsV0FBVyxHQUFRLEVBQUUsQ0FBWSxXQUFXLENBQUMsQ0FBQztBQUUzRCxpQkFBQSxnQkFBQSxDQUFpQyxLQUFVLEVBQUE7QUFDekMsZ0JBQUks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dGVCbG9ja1xuICogQHR5cGVkZWYge3N0cmluZ30gU2VyaWFsaXplZFRlbXBsYXRlQmxvY2tKU09OXG4gKi9cbmV4cG9ydCB0eXBlIFNlcmlhbGl6ZWRUZW1wbGF0ZUJsb2NrSlNPTiA9IHN0cmluZztcblxuLyoqXG4gKiBBIEpTT04gb2JqZWN0IGNvbnRhaW5pbmcgdGhlIFNlcmlhbGl6ZWRUZW1wbGF0ZUJsb2NrIGFzIEpTT04gYW5kIFRlbXBsYXRlTWV0YS5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBTZXJpYWxpemVkVGVtcGxhdGVXaXRoTGF6eUJsb2NrPFQgZXh0ZW5kcyBUZW1wbGF0ZU1ldGE+IHtcbiAgaWQ/OiBzdHJpbmc7XG4gIGJsb2NrOiBTZXJpYWxpemVkVGVtcGxhdGVCbG9ja0pTT047XG4gIG1ldGE6IFQ7XG59XG5cbi8qKlxuICogQSBzdHJpbmcgb2YgSmF2YXNjcmlwdCBjb250YWluaW5nIGEgU2VyaWFsaXplZFRlbXBsYXRlV2l0aExhenlCbG9jayB0byBiZVxuICogY29uY2F0ZW5hdGVkIGludG8gYSBKYXZhc2NyaXB0IG1vZHVsZS5cbiAqIEB0eXBlZGVmIHtzdHJpbmd9IFRlbXBsYXRlSmF2YXNjcmlwdFxuICovXG5leHBvcnQgdHlwZSBUZW1wbGF0ZUphdmFzY3JpcHQgPSBzdHJpbmc7XG4iXX0= enifed('glimmer/index', ['exports', 'glimmer-compiler'], function (exports, _glimmerCompiler) { /* * @overview Glimmer * @copyright Copyright 2011-2015 Tilde Inc. and contributors * @license Licensed under MIT license * See https://raw.githubusercontent.com/tildeio/glimmer/master/LICENSE * @version VERSION_STRING_PLACEHOLDER */ 'use strict'; exports.precompile = _glimmerCompiler.precompile; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsaW1tZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztVQU9TLFVBQVUsb0JBQVYsVUFBVSIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBAb3ZlcnZpZXcgIEdsaW1tZXJcbiAqIEBjb3B5cmlnaHQgQ29weXJpZ2h0IDIwMTEtMjAxNSBUaWxkZSBJbmMuIGFuZCBjb250cmlidXRvcnNcbiAqIEBsaWNlbnNlICAgTGljZW5zZWQgdW5kZXIgTUlUIGxpY2Vuc2VcbiAqICAgICAgICAgICAgU2VlIGh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS90aWxkZWlvL2dsaW1tZXIvbWFzdGVyL0xJQ0VOU0VcbiAqIEB2ZXJzaW9uICAgVkVSU0lPTl9TVFJJTkdfUExBQ0VIT0xERVJcbiAqL1xuZXhwb3J0IHsgcHJlY29tcGlsZSB9IGZyb20gJ2dsaW1tZXItY29tcGlsZXInO1xuIl19 enifed('route-recognizer', ['exports'], function (exports) { 'use strict'; function Target(path, matcher, delegate) { this.path = path; this.matcher = matcher; this.delegate = delegate; } Target.prototype = { to: function(target, callback) { var delegate = this.delegate; if (delegate && delegate.willAddRoute) { target = delegate.willAddRoute(this.matcher.target, target); } this.matcher.add(this.path, target); if (callback) { if (callback.length === 0) { throw new Error("You must have an argument in the function passed to `to`"); } this.matcher.addChild(this.path, target, callback, this.delegate); } return this; } }; function Matcher(target) { this.routes = {}; this.children = {}; this.target = target; } Matcher.prototype = { add: function(path, handler) { this.routes[path] = handler; }, addChild: function(path, target, callback, delegate) { var matcher = new Matcher(target); this.children[path] = matcher; var match = generateMatch(path, matcher, delegate); if (delegate && delegate.contextEntered) { delegate.contextEntered(target, match); } callback(match); } }; function generateMatch(startingPath, matcher, delegate) { return function(path, nestedCallback) { var fullPath = startingPath + path; if (nestedCallback) { nestedCallback(generateMatch(fullPath, matcher, delegate)); } else { return new Target(startingPath + path, matcher, delegate); } }; } function addRoute(routeArray, path, handler) { var len = 0; for (var i=0; i 2 && key.slice(keyLength -2) === '[]') { isArray = true; key = key.slice(0, keyLength - 2); if(!queryParams[key]) { queryParams[key] = []; } } value = pair[1] ? decodeQueryParamPart(pair[1]) : ''; } if (isArray) { queryParams[key].push(value); } else { queryParams[key] = value; } } return queryParams; }, recognize: function(path) { var states = [ this.rootState ], pathLen, i, queryStart, queryParams = {}, hashStart, isSlashDropped = false; hashStart = path.indexOf('#'); if (hashStart !== -1) { path = path.substr(0, hashStart); } queryStart = path.indexOf('?'); if (queryStart !== -1) { var queryString = path.substr(queryStart + 1, path.length); path = path.substr(0, queryStart); queryParams = this.parseQueryString(queryString); } if (path.charAt(0) !== "/") { path = "/" + path; } var originalPath = path; if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { path = normalizePath(path); } else { path = decodeURI(path); originalPath = decodeURI(originalPath); } pathLen = path.length; if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { path = path.substr(0, pathLen - 1); originalPath = originalPath.substr(0, pathLen - 1); isSlashDropped = true; } for (i=0; i 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) { queryParams = array[len - 1].queryParams; head = slice.call(array, 0, len - 1); return [head, queryParams]; } else { return [array, null]; } } /** @private Coerces query param properties and array elements into strings. **/ function coerceQueryParamsToString(queryParams) { for (var key in queryParams) { if (typeof queryParams[key] === 'number') { queryParams[key] = '' + queryParams[key]; } else if (isArray(queryParams[key])) { for (var i = 0, l = queryParams[key].length; i < l; i++) { queryParams[key][i] = '' + queryParams[key][i]; } } } } /** @private */ function log(router, sequence, msg) { if (!router.log) { return; } if (arguments.length === 3) { router.log("Transition #" + sequence + ": " + msg); } else { msg = sequence; router.log(msg); } } function bind(context, fn) { var boundArgs = arguments; return function(value) { var args = slice.call(boundArgs, 2); args.push(value); return fn.apply(context, args); }; } function isParam(object) { return (typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number); } function forEach(array, callback) { for (var i=0, l=array.length; i < l && false !== callback(array[i]); i++) { } } function trigger(router, handlerInfos, ignoreFailure, args) { if (router.triggerEvent) { router.triggerEvent(handlerInfos, ignoreFailure, args); return; } var name = args.shift(); if (!handlerInfos) { if (ignoreFailure) { return; } throw new Error("Could not trigger event '" + name + "'. There are no active handlers"); } var eventWasHandled = false; function delayedEvent(name, args, handler) { handler.events[name].apply(handler, args); } for (var i=handlerInfos.length-1; i>=0; i--) { var handlerInfo = handlerInfos[i], handler = handlerInfo.handler; // If there is no handler, it means the handler hasn't resolved yet which // means that we should trigger the event later when the handler is available if (!handler) { handlerInfo.handlerPromise.then(bind(null, delayedEvent, name, args)); continue; } if (handler.events && handler.events[name]) { if (handler.events[name].apply(handler, args) === true) { eventWasHandled = true; } else { return; } } } // In the case that we got an UnrecognizedURLError as an event with no handler, // let it bubble up if (name === 'error' && args[0].name === 'UnrecognizedURLError') { throw args[0]; } else if (!eventWasHandled && !ignoreFailure) { throw new Error("Nothing handled the event '" + name + "'."); } } function getChangelist(oldObject, newObject) { var key; var results = { all: {}, changed: {}, removed: {} }; merge(results.all, newObject); var didChange = false; coerceQueryParamsToString(oldObject); coerceQueryParamsToString(newObject); // Calculate removals for (key in oldObject) { if (oldObject.hasOwnProperty(key)) { if (!newObject.hasOwnProperty(key)) { didChange = true; results.removed[key] = oldObject[key]; } } } // Calculate changes for (key in newObject) { if (newObject.hasOwnProperty(key)) { if (isArray(oldObject[key]) && isArray(newObject[key])) { if (oldObject[key].length !== newObject[key].length) { results.changed[key] = newObject[key]; didChange = true; } else { for (var i = 0, l = oldObject[key].length; i < l; i++) { if (oldObject[key][i] !== newObject[key][i]) { results.changed[key] = newObject[key]; didChange = true; } } } } else { if (oldObject[key] !== newObject[key]) { results.changed[key] = newObject[key]; didChange = true; } } } } return didChange && results; } function promiseLabel(label) { return 'Router: ' + label; } function subclass(parentConstructor, proto) { function C(props) { parentConstructor.call(this, props || {}); } C.prototype = oCreate(parentConstructor.prototype); merge(C.prototype, proto); return C; } function resolveHook(obj, hookName) { if (!obj) { return; } var underscored = "_" + hookName; return obj[underscored] && underscored || obj[hookName] && hookName; } function callHook(obj, _hookName, arg1, arg2) { var hookName = resolveHook(obj, _hookName); return hookName && obj[hookName].call(obj, arg1, arg2); } function applyHook(obj, _hookName, args) { var hookName = resolveHook(obj, _hookName); if (hookName) { if (args.length === 0) { return obj[hookName].call(obj); } else if (args.length === 1) { return obj[hookName].call(obj, args[0]); } else if (args.length === 2) { return obj[hookName].call(obj, args[0], args[1]); } else { return obj[hookName].apply(obj, args); } } } function TransitionState() { this.handlerInfos = []; this.queryParams = {}; this.params = {}; } TransitionState.prototype = { promiseLabel: function(label) { var targetName = ''; forEach(this.handlerInfos, function(handlerInfo) { if (targetName !== '') { targetName += '.'; } targetName += handlerInfo.name; }); return promiseLabel("'" + targetName + "': " + label); }, resolve: function(shouldContinue, payload) { // First, calculate params for this state. This is useful // information to provide to the various route hooks. var params = this.params; forEach(this.handlerInfos, function(handlerInfo) { params[handlerInfo.name] = handlerInfo.params || {}; }); payload = payload || {}; payload.resolveIndex = 0; var currentState = this; var wasAborted = false; // The prelude RSVP.resolve() asyncs us into the promise land. return rsvp.Promise.resolve(null, this.promiseLabel("Start transition")) .then(resolveOneHandlerInfo, null, this.promiseLabel('Resolve handler'))['catch'](handleError, this.promiseLabel('Handle error')); function innerShouldContinue() { return rsvp.Promise.resolve(shouldContinue(), currentState.promiseLabel("Check if should continue"))['catch'](function(reason) { // We distinguish between errors that occurred // during resolution (e.g. beforeModel/model/afterModel), // and aborts due to a rejecting promise from shouldContinue(). wasAborted = true; return rsvp.Promise.reject(reason); }, currentState.promiseLabel("Handle abort")); } function handleError(error) { // This is the only possible // reject value of TransitionState#resolve var handlerInfos = currentState.handlerInfos; var errorHandlerIndex = payload.resolveIndex >= handlerInfos.length ? handlerInfos.length - 1 : payload.resolveIndex; return rsvp.Promise.reject({ error: error, handlerWithError: currentState.handlerInfos[errorHandlerIndex].handler, wasAborted: wasAborted, state: currentState }); } function proceed(resolvedHandlerInfo) { var wasAlreadyResolved = currentState.handlerInfos[payload.resolveIndex].isResolved; // Swap the previously unresolved handlerInfo with // the resolved handlerInfo currentState.handlerInfos[payload.resolveIndex++] = resolvedHandlerInfo; if (!wasAlreadyResolved) { // Call the redirect hook. The reason we call it here // vs. afterModel is so that redirects into child // routes don't re-run the model hooks for this // already-resolved route. var handler = resolvedHandlerInfo.handler; callHook(handler, 'redirect', resolvedHandlerInfo.context, payload); } // Proceed after ensuring that the redirect hook // didn't abort this transition by transitioning elsewhere. return innerShouldContinue().then(resolveOneHandlerInfo, null, currentState.promiseLabel('Resolve handler')); } function resolveOneHandlerInfo() { if (payload.resolveIndex === currentState.handlerInfos.length) { // This is is the only possible // fulfill value of TransitionState#resolve return { error: null, state: currentState }; } var handlerInfo = currentState.handlerInfos[payload.resolveIndex]; return handlerInfo.resolve(innerShouldContinue, payload) .then(proceed, null, currentState.promiseLabel('Proceed')); } } }; /** A Transition is a thennable (a promise-like object) that represents an attempt to transition to another route. It can be aborted, either explicitly via `abort` or by attempting another transition while a previous one is still underway. An aborted transition can also be `retry()`d later. @class Transition @constructor @param {Object} router @param {Object} intent @param {Object} state @param {Object} error @private */ function Transition(router, intent, state, error) { var transition = this; this.state = state || router.state; this.intent = intent; this.router = router; this.data = this.intent && this.intent.data || {}; this.resolvedModels = {}; this.queryParams = {}; this.promise = undefined; this.error = undefined; this.params = undefined; this.handlerInfos = undefined; this.targetName = undefined; this.pivotHandler = undefined; this.sequence = undefined; this.isAborted = undefined; this.isActive = undefined; if (error) { this.promise = rsvp.Promise.reject(error); this.error = error; return; } if (state) { this.params = state.params; this.queryParams = state.queryParams; this.handlerInfos = state.handlerInfos; var len = state.handlerInfos.length; if (len) { this.targetName = state.handlerInfos[len-1].name; } for (var i = 0; i < len; ++i) { var handlerInfo = state.handlerInfos[i]; // TODO: this all seems hacky if (!handlerInfo.isResolved) { break; } this.pivotHandler = handlerInfo.handler; } this.sequence = Transition.currentSequence++; this.promise = state.resolve(checkForAbort, this)['catch'](function(result) { if (result.wasAborted || transition.isAborted) { return rsvp.Promise.reject(logAbort(transition)); } else { transition.trigger('error', result.error, transition, result.handlerWithError); transition.abort(); return rsvp.Promise.reject(result.error); } }, promiseLabel('Handle Abort')); } else { this.promise = rsvp.Promise.resolve(this.state); this.params = {}; } function checkForAbort() { if (transition.isAborted) { return rsvp.Promise.reject(undefined, promiseLabel("Transition aborted - reject")); } } } Transition.currentSequence = 0; Transition.prototype = { targetName: null, urlMethod: 'update', intent: null, pivotHandler: null, resolveIndex: 0, resolvedModels: null, isActive: true, state: null, queryParamsOnly: false, isTransition: true, isExiting: function(handler) { var handlerInfos = this.handlerInfos; for (var i = 0, len = handlerInfos.length; i < len; ++i) { var handlerInfo = handlerInfos[i]; if (handlerInfo.name === handler || handlerInfo.handler === handler) { return false; } } return true; }, /** The Transition's internal promise. Calling `.then` on this property is that same as calling `.then` on the Transition object itself, but this property is exposed for when you want to pass around a Transition's promise, but not the Transition object itself, since Transition object can be externally `abort`ed, while the promise cannot. @property promise @type {Object} @public */ promise: null, /** Custom state can be stored on a Transition's `data` object. This can be useful for decorating a Transition within an earlier hook and shared with a later hook. Properties set on `data` will be copied to new transitions generated by calling `retry` on this transition. @property data @type {Object} @public */ data: null, /** A standard promise hook that resolves if the transition succeeds and rejects if it fails/redirects/aborts. Forwards to the internal `promise` property which you can use in situations where you want to pass around a thennable, but not the Transition itself. @method then @param {Function} onFulfilled @param {Function} onRejected @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} @public */ then: function(onFulfilled, onRejected, label) { return this.promise.then(onFulfilled, onRejected, label); }, /** Forwards to the internal `promise` property which you can use in situations where you want to pass around a thennable, but not the Transition itself. @method catch @param {Function} onRejection @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} @public */ catch: function(onRejection, label) { return this.promise.catch(onRejection, label); }, /** Forwards to the internal `promise` property which you can use in situations where you want to pass around a thennable, but not the Transition itself. @method finally @param {Function} callback @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} @public */ finally: function(callback, label) { return this.promise.finally(callback, label); }, /** Aborts the Transition. Note you can also implicitly abort a transition by initiating another transition while a previous one is underway. @method abort @return {Transition} this transition @public */ abort: function() { if (this.isAborted) { return this; } log(this.router, this.sequence, this.targetName + ": transition was aborted"); this.intent.preTransitionState = this.router.state; this.isAborted = true; this.isActive = false; this.router.activeTransition = null; return this; }, /** Retries a previously-aborted transition (making sure to abort the transition if it's still active). Returns a new transition that represents the new attempt to transition. @method retry @return {Transition} new transition @public */ retry: function() { // TODO: add tests for merged state retry()s this.abort(); return this.router.transitionByIntent(this.intent, false); }, /** Sets the URL-changing method to be employed at the end of a successful transition. By default, a new Transition will just use `updateURL`, but passing 'replace' to this method will cause the URL to update using 'replaceWith' instead. Omitting a parameter will disable the URL change, allowing for transitions that don't update the URL at completion (this is also used for handleURL, since the URL has already changed before the transition took place). @method method @param {String} method the type of URL-changing method to use at the end of a transition. Accepted values are 'replace', falsy values, or any other non-falsy value (which is interpreted as an updateURL transition). @return {Transition} this transition @public */ method: function(method) { this.urlMethod = method; return this; }, /** Fires an event on the current list of resolved/resolving handlers within this transition. Useful for firing events on route hierarchies that haven't fully been entered yet. Note: This method is also aliased as `send` @method trigger @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error @param {String} name the name of the event to fire @public */ trigger: function (ignoreFailure) { var args = slice.call(arguments); if (typeof ignoreFailure === 'boolean') { args.shift(); } else { // Throw errors on unhandled trigger events by default ignoreFailure = false; } trigger(this.router, this.state.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args); }, /** Transitions are aborted and their promises rejected when redirects occur; this method returns a promise that will follow any redirects that occur and fulfill with the value fulfilled by any redirecting transitions that occur. @method followRedirects @return {Promise} a promise that fulfills with the same value that the final redirecting transition fulfills with @public */ followRedirects: function() { var router = this.router; return this.promise['catch'](function(reason) { if (router.activeTransition) { return router.activeTransition.followRedirects(); } return rsvp.Promise.reject(reason); }); }, toString: function() { return "Transition (sequence " + this.sequence + ")"; }, /** @private */ log: function(message) { log(this.router, this.sequence, message); } }; // Alias 'trigger' as 'send' Transition.prototype.send = Transition.prototype.trigger; /** @private Logs and returns a TransitionAborted error. */ function logAbort(transition) { log(transition.router, transition.sequence, "detected abort."); return new TransitionAborted(); } function TransitionAborted(message) { this.message = (message || "TransitionAborted"); this.name = "TransitionAborted"; } function TransitionIntent(props) { this.initialize(props); // TODO: wat this.data = this.data || {}; } TransitionIntent.prototype = { initialize: null, applyToState: null }; var DEFAULT_HANDLER = Object.freeze({}); function HandlerInfo(_props) { var props = _props || {}; // Set a default handler to ensure consistent object shape this._handler = DEFAULT_HANDLER; if (props.handler) { var name = props.name; // Setup a handlerPromise so that we can wait for asynchronously loaded handlers this.handlerPromise = rsvp.Promise.resolve(props.handler); // Wait until the 'handler' property has been updated when chaining to a handler // that is a promise if (isPromise(props.handler)) { this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); props.handler = undefined; } else if (props.handler) { // Store the name of the handler on the handler for easy checks later props.handler._handlerName = name; } } merge(this, props); this.initialize(props); } HandlerInfo.prototype = { name: null, getHandler: function() {}, fetchHandler: function() { var handler = this.getHandler(this.name); // Setup a handlerPromise so that we can wait for asynchronously loaded handlers this.handlerPromise = rsvp.Promise.resolve(handler); // Wait until the 'handler' property has been updated when chaining to a handler // that is a promise if (isPromise(handler)) { this.handlerPromise = this.handlerPromise.then(bind(this, this.updateHandler)); } else if (handler) { // Store the name of the handler on the handler for easy checks later handler._handlerName = this.name; return this.handler = handler; } return this.handler = undefined; }, _handlerPromise: undefined, params: null, context: null, // Injected by the handler info factory. factory: null, initialize: function() {}, log: function(payload, message) { if (payload.log) { payload.log(this.name + ': ' + message); } }, promiseLabel: function(label) { return promiseLabel("'" + this.name + "' " + label); }, getUnresolved: function() { return this; }, serialize: function() { return this.params || {}; }, updateHandler: function(handler) { // Store the name of the handler on the handler for easy checks later handler._handlerName = this.name; return this.handler = handler; }, resolve: function(shouldContinue, payload) { var checkForAbort = bind(this, this.checkForAbort, shouldContinue), beforeModel = bind(this, this.runBeforeModelHook, payload), model = bind(this, this.getModel, payload), afterModel = bind(this, this.runAfterModelHook, payload), becomeResolved = bind(this, this.becomeResolved, payload), self = this; return rsvp.Promise.resolve(this.handlerPromise, this.promiseLabel("Start handler")) .then(function(handler) { // We nest this chain in case the handlerPromise has an error so that // we don't have to bubble it through every step return rsvp.Promise.resolve(handler) .then(checkForAbort, null, self.promiseLabel("Check for abort")) .then(beforeModel, null, self.promiseLabel("Before model")) .then(checkForAbort, null, self.promiseLabel("Check if aborted during 'beforeModel' hook")) .then(model, null, self.promiseLabel("Model")) .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'model' hook")) .then(afterModel, null, self.promiseLabel("After model")) .then(checkForAbort, null, self.promiseLabel("Check if aborted in 'afterModel' hook")) .then(becomeResolved, null, self.promiseLabel("Become resolved")); }, function(error) { throw error; }); }, runBeforeModelHook: function(payload) { if (payload.trigger) { payload.trigger(true, 'willResolveModel', payload, this.handler); } return this.runSharedModelHook(payload, 'beforeModel', []); }, runAfterModelHook: function(payload, resolvedModel) { // Stash the resolved model on the payload. // This makes it possible for users to swap out // the resolved model in afterModel. var name = this.name; this.stashResolvedModel(payload, resolvedModel); return this.runSharedModelHook(payload, 'afterModel', [resolvedModel]) .then(function() { // Ignore the fulfilled value returned from afterModel. // Return the value stashed in resolvedModels, which // might have been swapped out in afterModel. return payload.resolvedModels[name]; }, null, this.promiseLabel("Ignore fulfillment value and return model value")); }, runSharedModelHook: function(payload, hookName, args) { this.log(payload, "calling " + hookName + " hook"); if (this.queryParams) { args.push(this.queryParams); } args.push(payload); var result = applyHook(this.handler, hookName, args); if (result && result.isTransition) { result = null; } return rsvp.Promise.resolve(result, this.promiseLabel("Resolve value returned from one of the model hooks")); }, // overridden by subclasses getModel: null, checkForAbort: function(shouldContinue, promiseValue) { return rsvp.Promise.resolve(shouldContinue(), this.promiseLabel("Check for abort")).then(function() { // We don't care about shouldContinue's resolve value; // pass along the original value passed to this fn. return promiseValue; }, null, this.promiseLabel("Ignore fulfillment value and continue")); }, stashResolvedModel: function(payload, resolvedModel) { payload.resolvedModels = payload.resolvedModels || {}; payload.resolvedModels[this.name] = resolvedModel; }, becomeResolved: function(payload, resolvedContext) { var params = this.serialize(resolvedContext); if (payload) { this.stashResolvedModel(payload, resolvedContext); payload.params = payload.params || {}; payload.params[this.name] = params; } return this.factory('resolved', { context: resolvedContext, name: this.name, handler: this.handler, params: params }); }, shouldSupercede: function(other) { // Prefer this newer handlerInfo over `other` if: // 1) The other one doesn't exist // 2) The names don't match // 3) This handler has a context that doesn't match // the other one (or the other one doesn't have one). // 4) This handler has parameters that don't match the other. if (!other) { return true; } var contextsMatch = (other.context === this.context); return other.name !== this.name || (this.hasOwnProperty('context') && !contextsMatch) || (this.hasOwnProperty('params') && !paramsMatch(this.params, other.params)); } }; Object.defineProperty(HandlerInfo.prototype, 'handler', { get: function() { // _handler could be set to either a handler object or undefined, so we // compare against a default reference to know when it's been set if (this._handler !== DEFAULT_HANDLER) { return this._handler; } return this.fetchHandler(); }, set: function(handler) { return this._handler = handler; } }); Object.defineProperty(HandlerInfo.prototype, 'handlerPromise', { get: function() { if (this._handlerPromise) { return this._handlerPromise; } this.fetchHandler(); return this._handlerPromise; }, set: function(handlerPromise) { return this._handlerPromise = handlerPromise; } }); function paramsMatch(a, b) { if ((!a) ^ (!b)) { // Only one is null. return false; } if (!a) { // Both must be null. return true; } // Note: this assumes that both params have the same // number of keys, but since we're comparing the // same handlers, they should. for (var k in a) { if (a.hasOwnProperty(k) && a[k] !== b[k]) { return false; } } return true; } var ResolvedHandlerInfo = subclass(HandlerInfo, { resolve: function(shouldContinue, payload) { // A ResolvedHandlerInfo just resolved with itself. if (payload && payload.resolvedModels) { payload.resolvedModels[this.name] = this.context; } return rsvp.Promise.resolve(this, this.promiseLabel("Resolve")); }, getUnresolved: function() { return this.factory('param', { name: this.name, handler: this.handler, params: this.params }); }, isResolved: true }); var UnresolvedHandlerInfoByObject = subclass(HandlerInfo, { getModel: function(payload) { this.log(payload, this.name + ": resolving provided model"); return rsvp.Promise.resolve(this.context); }, initialize: function(props) { this.names = props.names || []; this.context = props.context; }, /** @private Serializes a handler using its custom `serialize` method or by a default that looks up the expected property name from the dynamic segment. @param {Object} model the model to be serialized for this handler */ serialize: function(_model) { var model = _model || this.context, names = this.names, serializer = this.serializer || (this.handler && this.handler.serialize); var object = {}; if (isParam(model)) { object[names[0]] = model; return object; } // Use custom serialize if it exists. if (serializer) { return serializer(model, names); } if (names.length !== 1) { return; } var name = names[0]; if (/_id$/.test(name)) { object[name] = model.id; } else { object[name] = model; } return object; } }); // Generated by URL transitions and non-dynamic route segments in named Transitions. var UnresolvedHandlerInfoByParam = subclass (HandlerInfo, { initialize: function(props) { this.params = props.params || {}; }, getModel: function(payload) { var fullParams = this.params; if (payload && payload.queryParams) { fullParams = {}; merge(fullParams, this.params); fullParams.queryParams = payload.queryParams; } var handler = this.handler; var hookName = resolveHook(handler, 'deserialize') || resolveHook(handler, 'model'); return this.runSharedModelHook(payload, hookName, [fullParams]); } }); handlerInfoFactory.klasses = { resolved: ResolvedHandlerInfo, param: UnresolvedHandlerInfoByParam, object: UnresolvedHandlerInfoByObject }; function handlerInfoFactory(name, props) { var Ctor = handlerInfoFactory.klasses[name], handlerInfo = new Ctor(props || {}); handlerInfo.factory = handlerInfoFactory; return handlerInfo; } var NamedTransitionIntent = subclass(TransitionIntent, { name: null, pivotHandler: null, contexts: null, queryParams: null, initialize: function(props) { this.name = props.name; this.pivotHandler = props.pivotHandler; this.contexts = props.contexts || []; this.queryParams = props.queryParams; }, applyToState: function(oldState, recognizer, getHandler, isIntermediate, getSerializer) { var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)), pureArgs = partitionedArgs[0], handlers = recognizer.handlersFor(pureArgs[0]); var targetRouteName = handlers[handlers.length-1].handler; return this.applyToHandlers(oldState, handlers, getHandler, targetRouteName, isIntermediate, null, getSerializer); }, applyToHandlers: function(oldState, handlers, getHandler, targetRouteName, isIntermediate, checkingIfActive, getSerializer) { var i, len; var newState = new TransitionState(); var objects = this.contexts.slice(0); var invalidateIndex = handlers.length; // Pivot handlers are provided for refresh transitions if (this.pivotHandler) { for (i = 0, len = handlers.length; i < len; ++i) { if (handlers[i].handler === this.pivotHandler._handlerName) { invalidateIndex = i; break; } } } for (i = handlers.length - 1; i >= 0; --i) { var result = handlers[i]; var name = result.handler; var oldHandlerInfo = oldState.handlerInfos[i]; var newHandlerInfo = null; if (result.names.length > 0) { if (i >= invalidateIndex) { newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); } else { var serializer = getSerializer(name); newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, getHandler, result.names, objects, oldHandlerInfo, targetRouteName, i, serializer); } } else { // This route has no dynamic segment. // Therefore treat as a param-based handlerInfo // with empty params. This will cause the `model` // hook to be called with empty params, which is desirable. newHandlerInfo = this.createParamHandlerInfo(name, getHandler, result.names, objects, oldHandlerInfo); } if (checkingIfActive) { // If we're performing an isActive check, we want to // serialize URL params with the provided context, but // ignore mismatches between old and new context. newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context); var oldContext = oldHandlerInfo && oldHandlerInfo.context; if (result.names.length > 0 && newHandlerInfo.context === oldContext) { // If contexts match in isActive test, assume params also match. // This allows for flexibility in not requiring that every last // handler provide a `serialize` method newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params; } newHandlerInfo.context = oldContext; } var handlerToUse = oldHandlerInfo; if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { invalidateIndex = Math.min(i, invalidateIndex); handlerToUse = newHandlerInfo; } if (isIntermediate && !checkingIfActive) { handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context); } newState.handlerInfos.unshift(handlerToUse); } if (objects.length > 0) { throw new Error("More context objects were passed than there are dynamic segments for the route: " + targetRouteName); } if (!isIntermediate) { this.invalidateChildren(newState.handlerInfos, invalidateIndex); } merge(newState.queryParams, this.queryParams || {}); return newState; }, invalidateChildren: function(handlerInfos, invalidateIndex) { for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) { var handlerInfo = handlerInfos[i]; handlerInfos[i] = handlerInfo.getUnresolved(); } }, getHandlerInfoForDynamicSegment: function(name, getHandler, names, objects, oldHandlerInfo, targetRouteName, i, serializer) { var objectToUse; if (objects.length > 0) { // Use the objects provided for this transition. objectToUse = objects[objects.length - 1]; if (isParam(objectToUse)) { return this.createParamHandlerInfo(name, getHandler, names, objects, oldHandlerInfo); } else { objects.pop(); } } else if (oldHandlerInfo && oldHandlerInfo.name === name) { // Reuse the matching oldHandlerInfo return oldHandlerInfo; } else { if (this.preTransitionState) { var preTransitionHandlerInfo = this.preTransitionState.handlerInfos[i]; objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context; } else { // Ideally we should throw this error to provide maximal // information to the user that not enough context objects // were provided, but this proves too cumbersome in Ember // in cases where inner template helpers are evaluated // before parent helpers un-render, in which cases this // error somewhat prematurely fires. //throw new Error("Not enough context objects were provided to complete a transition to " + targetRouteName + ". Specifically, the " + name + " route needs an object that can be serialized into its dynamic URL segments [" + names.join(', ') + "]"); return oldHandlerInfo; } } return handlerInfoFactory('object', { name: name, getHandler: getHandler, serializer: serializer, context: objectToUse, names: names }); }, createParamHandlerInfo: function(name, getHandler, names, objects, oldHandlerInfo) { var params = {}; // Soak up all the provided string/numbers var numNames = names.length; while (numNames--) { // Only use old params if the names match with the new handler var oldParams = (oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params) || {}; var peek = objects[objects.length - 1]; var paramName = names[numNames]; if (isParam(peek)) { params[paramName] = "" + objects.pop(); } else { // If we're here, this means only some of the params // were string/number params, so try and use a param // value from a previous handler. if (oldParams.hasOwnProperty(paramName)) { params[paramName] = oldParams[paramName]; } else { throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route " + name); } } } return handlerInfoFactory('param', { name: name, getHandler: getHandler, params: params }); } }); /** Promise reject reasons passed to promise rejection handlers for failed transitions. */ function UnrecognizedURLError(message) { this.message = (message || "UnrecognizedURLError"); this.name = "UnrecognizedURLError"; Error.call(this); } UnrecognizedURLError.prototype = oCreate(Error.prototype); var URLTransitionIntent = subclass(TransitionIntent, { url: null, initialize: function(props) { this.url = props.url; }, applyToState: function(oldState, recognizer, getHandler) { var newState = new TransitionState(); var results = recognizer.recognize(this.url), i, len; if (!results) { throw new UnrecognizedURLError(this.url); } var statesDiffer = false; var url = this.url; // Checks if a handler is accessible by URL. If it is not, an error is thrown. // For the case where the handler is loaded asynchronously, the error will be // thrown once it is loaded. function checkHandlerAccessibility(handler) { if (handler && handler.inaccessibleByURL) { throw new UnrecognizedURLError(url); } return handler; } for (i = 0, len = results.length; i < len; ++i) { var result = results[i]; var name = result.handler; var newHandlerInfo = handlerInfoFactory('param', { name: name, getHandler: getHandler, params: result.params }); var handler = newHandlerInfo.handler; if (handler) { checkHandlerAccessibility(handler); } else { // If the hanlder is being loaded asynchronously, check if we can // access it after it has resolved newHandlerInfo.handlerPromise = newHandlerInfo.handlerPromise.then(checkHandlerAccessibility); } var oldHandlerInfo = oldState.handlerInfos[i]; if (statesDiffer || newHandlerInfo.shouldSupercede(oldHandlerInfo)) { statesDiffer = true; newState.handlerInfos[i] = newHandlerInfo; } else { newState.handlerInfos[i] = oldHandlerInfo; } } merge(newState.queryParams, results.queryParams); return newState; } }); var pop = Array.prototype.pop; function Router(_options) { var options = _options || {}; this.getHandler = options.getHandler || this.getHandler; this.getSerializer = options.getSerializer || this.getSerializer; this.updateURL = options.updateURL || this.updateURL; this.replaceURL = options.replaceURL || this.replaceURL; this.didTransition = options.didTransition || this.didTransition; this.willTransition = options.willTransition || this.willTransition; this.delegate = options.delegate || this.delegate; this.triggerEvent = options.triggerEvent || this.triggerEvent; this.log = options.log || this.log; this.dslCallBacks = []; // NOTE: set by Ember this.state = undefined; this.activeTransition = undefined; this._changedQueryParams = undefined; this.oldState = undefined; this.currentHandlerInfos = undefined; this.state = undefined; this.recognizer = new RouteRecognizer(); this.reset(); } function getTransitionByIntent(intent, isIntermediate) { var wasTransitioning = !!this.activeTransition; var oldState = wasTransitioning ? this.activeTransition.state : this.state; var newTransition; var newState = intent.applyToState(oldState, this.recognizer, this.getHandler, isIntermediate, this.getSerializer); var queryParamChangelist = getChangelist(oldState.queryParams, newState.queryParams); if (handlerInfosEqual(newState.handlerInfos, oldState.handlerInfos)) { // This is a no-op transition. See if query params changed. if (queryParamChangelist) { newTransition = this.queryParamsTransition(queryParamChangelist, wasTransitioning, oldState, newState); if (newTransition) { return newTransition; } } // No-op. No need to create a new transition. return this.activeTransition || new Transition(this); } if (isIntermediate) { setupContexts(this, newState); return; } // Create a new transition to the destination route. newTransition = new Transition(this, intent, newState); // Abort and usurp any previously active transition. if (this.activeTransition) { this.activeTransition.abort(); } this.activeTransition = newTransition; // Transition promises by default resolve with resolved state. // For our purposes, swap out the promise to resolve // after the transition has been finalized. newTransition.promise = newTransition.promise.then(function(result) { return finalizeTransition(newTransition, result.state); }, null, promiseLabel("Settle transition promise when transition is finalized")); if (!wasTransitioning) { notifyExistingHandlers(this, newState, newTransition); } fireQueryParamDidChange(this, newState, queryParamChangelist); return newTransition; } Router.prototype = { /** The main entry point into the router. The API is essentially the same as the `map` method in `route-recognizer`. This method extracts the String handler at the last `.to()` call and uses it as the name of the whole route. @param {Function} callback */ map: function(callback) { this.recognizer.delegate = this.delegate; this.recognizer.map(callback, function(recognizer, routes) { for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) { var route = routes[i]; recognizer.add(routes, { as: route.handler }); proceed = route.path === '/' || route.path === '' || route.handler.slice(-6) === '.index'; } }); }, hasRoute: function(route) { return this.recognizer.hasRoute(route); }, getHandler: function() {}, getSerializer: function() {}, queryParamsTransition: function(changelist, wasTransitioning, oldState, newState) { var router = this; fireQueryParamDidChange(this, newState, changelist); if (!wasTransitioning && this.activeTransition) { // One of the handlers in queryParamsDidChange // caused a transition. Just return that transition. return this.activeTransition; } else { // Running queryParamsDidChange didn't change anything. // Just update query params and be on our way. // We have to return a noop transition that will // perform a URL update at the end. This gives // the user the ability to set the url update // method (default is replaceState). var newTransition = new Transition(this); newTransition.queryParamsOnly = true; oldState.queryParams = finalizeQueryParamChange(this, newState.handlerInfos, newState.queryParams, newTransition); newTransition.promise = newTransition.promise.then(function(result) { updateURL(newTransition, oldState, true); if (router.didTransition) { router.didTransition(router.currentHandlerInfos); } return result; }, null, promiseLabel("Transition complete")); return newTransition; } }, // NOTE: this doesn't really belong here, but here // it shall remain until our ES6 transpiler can // handle cyclical deps. transitionByIntent: function(intent/*, isIntermediate*/) { try { return getTransitionByIntent.apply(this, arguments); } catch(e) { return new Transition(this, intent, null, e); } }, /** Clears the current and target route handlers and triggers exit on each of them starting at the leaf and traversing up through its ancestors. */ reset: function() { if (this.state) { forEach(this.state.handlerInfos.slice().reverse(), function(handlerInfo) { var handler = handlerInfo.handler; callHook(handler, 'exit'); }); } this.oldState = undefined; this.state = new TransitionState(); this.currentHandlerInfos = null; }, activeTransition: null, /** var handler = handlerInfo.handler; The entry point for handling a change to the URL (usually via the back and forward button). Returns an Array of handlers and the parameters associated with those parameters. @param {String} url a URL to process @return {Array} an Array of `[handler, parameter]` tuples */ handleURL: function(url) { // Perform a URL-based transition, but don't change // the URL afterward, since it already happened. var args = slice.call(arguments); if (url.charAt(0) !== '/') { args[0] = '/' + url; } return doTransition(this, args).method(null); }, /** Hook point for updating the URL. @param {String} url a URL to update to */ updateURL: function() { throw new Error("updateURL is not implemented"); }, /** Hook point for replacing the current URL, i.e. with replaceState By default this behaves the same as `updateURL` @param {String} url a URL to update to */ replaceURL: function(url) { this.updateURL(url); }, /** Transition into the specified named route. If necessary, trigger the exit callback on any handlers that are no longer represented by the target route. @param {String} name the name of the route */ transitionTo: function(/*name*/) { return doTransition(this, arguments); }, intermediateTransitionTo: function(/*name*/) { return doTransition(this, arguments, true); }, refresh: function(pivotHandler) { var state = this.activeTransition ? this.activeTransition.state : this.state; var handlerInfos = state.handlerInfos; var params = {}; for (var i = 0, len = handlerInfos.length; i < len; ++i) { var handlerInfo = handlerInfos[i]; params[handlerInfo.name] = handlerInfo.params || {}; } log(this, "Starting a refresh transition"); var intent = new NamedTransitionIntent({ name: handlerInfos[handlerInfos.length - 1].name, pivotHandler: pivotHandler || handlerInfos[0].handler, contexts: [], // TODO collect contexts...? queryParams: this._changedQueryParams || state.queryParams || {} }); return this.transitionByIntent(intent, false); }, /** Identical to `transitionTo` except that the current URL will be replaced if possible. This method is intended primarily for use with `replaceState`. @param {String} name the name of the route */ replaceWith: function(/*name*/) { return doTransition(this, arguments).method('replace'); }, /** Take a named route and context objects and generate a URL. @param {String} name the name of the route to generate a URL for @param {...Object} objects a list of objects to serialize @return {String} a URL */ generate: function(handlerName) { var partitionedArgs = extractQueryParams(slice.call(arguments, 1)), suppliedParams = partitionedArgs[0], queryParams = partitionedArgs[1]; // Construct a TransitionIntent with the provided params // and apply it to the present state of the router. var intent = new NamedTransitionIntent({ name: handlerName, contexts: suppliedParams }); var state = intent.applyToState(this.state, this.recognizer, this.getHandler, null, this.getSerializer); var params = {}; for (var i = 0, len = state.handlerInfos.length; i < len; ++i) { var handlerInfo = state.handlerInfos[i]; var handlerParams = handlerInfo.serialize(); merge(params, handlerParams); } params.queryParams = queryParams; return this.recognizer.generate(handlerName, params); }, applyIntent: function(handlerName, contexts) { var intent = new NamedTransitionIntent({ name: handlerName, contexts: contexts }); var state = this.activeTransition && this.activeTransition.state || this.state; return intent.applyToState(state, this.recognizer, this.getHandler, null, this.getSerializer); }, isActiveIntent: function(handlerName, contexts, queryParams, _state) { var state = _state || this.state, targetHandlerInfos = state.handlerInfos, handlerInfo, len; if (!targetHandlerInfos.length) { return false; } var targetHandler = targetHandlerInfos[targetHandlerInfos.length - 1].name; var recogHandlers = this.recognizer.handlersFor(targetHandler); var index = 0; for (len = recogHandlers.length; index < len; ++index) { handlerInfo = targetHandlerInfos[index]; if (handlerInfo.name === handlerName) { break; } } if (index === recogHandlers.length) { // The provided route name isn't even in the route hierarchy. return false; } var testState = new TransitionState(); testState.handlerInfos = targetHandlerInfos.slice(0, index + 1); recogHandlers = recogHandlers.slice(0, index + 1); var intent = new NamedTransitionIntent({ name: targetHandler, contexts: contexts }); var newState = intent.applyToHandlers(testState, recogHandlers, this.getHandler, targetHandler, true, true, this.getSerializer); var handlersEqual = handlerInfosEqual(newState.handlerInfos, testState.handlerInfos); if (!queryParams || !handlersEqual) { return handlersEqual; } // Get a hash of QPs that will still be active on new route var activeQPsOnNewHandler = {}; merge(activeQPsOnNewHandler, queryParams); var activeQueryParams = state.queryParams; for (var key in activeQueryParams) { if (activeQueryParams.hasOwnProperty(key) && activeQPsOnNewHandler.hasOwnProperty(key)) { activeQPsOnNewHandler[key] = activeQueryParams[key]; } } return handlersEqual && !getChangelist(activeQPsOnNewHandler, queryParams); }, isActive: function(handlerName) { var partitionedArgs = extractQueryParams(slice.call(arguments, 1)); return this.isActiveIntent(handlerName, partitionedArgs[0], partitionedArgs[1]); }, trigger: function(/*name*/) { var args = slice.call(arguments); trigger(this, this.currentHandlerInfos, false, args); }, /** Hook point for logging transition status updates. @param {String} message The message to log. */ log: null }; /** @private Fires queryParamsDidChange event */ function fireQueryParamDidChange(router, newState, queryParamChangelist) { // If queryParams changed trigger event if (queryParamChangelist) { // This is a little hacky but we need some way of storing // changed query params given that no activeTransition // is guaranteed to have occurred. router._changedQueryParams = queryParamChangelist.all; trigger(router, newState.handlerInfos, true, ['queryParamsDidChange', queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]); router._changedQueryParams = null; } } /** @private Takes an Array of `HandlerInfo`s, figures out which ones are exiting, entering, or changing contexts, and calls the proper handler hooks. For example, consider the following tree of handlers. Each handler is followed by the URL segment it handles. ``` |~index ("/") | |~posts ("/posts") | | |-showPost ("/:id") | | |-newPost ("/new") | | |-editPost ("/edit") | |~about ("/about/:id") ``` Consider the following transitions: 1. A URL transition to `/posts/1`. 1. Triggers the `*model` callbacks on the `index`, `posts`, and `showPost` handlers 2. Triggers the `enter` callback on the same 3. Triggers the `setup` callback on the same 2. A direct transition to `newPost` 1. Triggers the `exit` callback on `showPost` 2. Triggers the `enter` callback on `newPost` 3. Triggers the `setup` callback on `newPost` 3. A direct transition to `about` with a specified context object 1. Triggers the `exit` callback on `newPost` and `posts` 2. Triggers the `serialize` callback on `about` 3. Triggers the `enter` callback on `about` 4. Triggers the `setup` callback on `about` @param {Router} transition @param {TransitionState} newState */ function setupContexts(router, newState, transition) { var partition = partitionHandlers(router.state, newState); var i, l, handler; for (i=0, l=partition.exited.length; i= 0; --i) { var handlerInfo = handlerInfos[i]; merge(params, handlerInfo.params); if (handlerInfo.handler.inaccessibleByURL) { urlMethod = null; } } if (urlMethod) { params.queryParams = transition._visibleQueryParams || state.queryParams; var url = router.recognizer.generate(handlerName, params); if (urlMethod === 'replace') { router.replaceURL(url); } else { router.updateURL(url); } } } /** @private Updates the URL (if necessary) and calls `setupContexts` to update the router's array of `currentHandlerInfos`. */ function finalizeTransition(transition, newState) { try { log(transition.router, transition.sequence, "Resolved all models on destination route; finalizing transition."); var router = transition.router, handlerInfos = newState.handlerInfos; // Run all the necessary enter/setup/exit hooks setupContexts(router, newState, transition); // Check if a redirect occurred in enter/setup if (transition.isAborted) { // TODO: cleaner way? distinguish b/w targetHandlerInfos? router.state.handlerInfos = router.currentHandlerInfos; return rsvp.Promise.reject(logAbort(transition)); } updateURL(transition, newState, transition.intent.url); transition.isActive = false; router.activeTransition = null; trigger(router, router.currentHandlerInfos, true, ['didTransition']); if (router.didTransition) { router.didTransition(router.currentHandlerInfos); } log(router, transition.sequence, "TRANSITION COMPLETE."); // Resolve with the final handler. return handlerInfos[handlerInfos.length - 1].handler; } catch(e) { if (!(e instanceof TransitionAborted)) { //var erroneousHandler = handlerInfos.pop(); var infos = transition.state.handlerInfos; transition.trigger(true, 'error', e, transition, infos[infos.length-1].handler); transition.abort(); } throw e; } } /** @private Begins and returns a Transition based on the provided arguments. Accepts arguments in the form of both URL transitions and named transitions. @param {Router} router @param {Array[Object]} args arguments passed to transitionTo, replaceWith, or handleURL */ function doTransition(router, args, isIntermediate) { // Normalize blank transitions to root URL transitions. var name = args[0] || '/'; var lastArg = args[args.length-1]; var queryParams = {}; if (lastArg && lastArg.hasOwnProperty('queryParams')) { queryParams = pop.call(args).queryParams; } var intent; if (args.length === 0) { log(router, "Updating query params"); // A query param update is really just a transition // into the route you're already on. var handlerInfos = router.state.handlerInfos; intent = new NamedTransitionIntent({ name: handlerInfos[handlerInfos.length - 1].name, contexts: [], queryParams: queryParams }); } else if (name.charAt(0) === '/') { log(router, "Attempting URL transition to " + name); intent = new URLTransitionIntent({ url: name }); } else { log(router, "Attempting transition to " + name); intent = new NamedTransitionIntent({ name: args[0], contexts: slice.call(args, 1), queryParams: queryParams }); } return router.transitionByIntent(intent, isIntermediate); } function handlerInfosEqual(handlerInfos, otherHandlerInfos) { if (handlerInfos.length !== otherHandlerInfos.length) { return false; } for (var i = 0, len = handlerInfos.length; i < len; ++i) { if (handlerInfos[i] !== otherHandlerInfos[i]) { return false; } } return true; } function finalizeQueryParamChange(router, resolvedHandlers, newQueryParams, transition) { // We fire a finalizeQueryParamChange event which // gives the new route hierarchy a chance to tell // us which query params it's consuming and what // their final values are. If a query param is // no longer consumed in the final route hierarchy, // its serialized segment will be removed // from the URL. for (var k in newQueryParams) { if (newQueryParams.hasOwnProperty(k) && newQueryParams[k] === null) { delete newQueryParams[k]; } } var finalQueryParamsArray = []; trigger(router, resolvedHandlers, true, ['finalizeQueryParamChange', newQueryParams, finalQueryParamsArray, transition]); if (transition) { transition._visibleQueryParams = {}; } var finalQueryParams = {}; for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) { var qp = finalQueryParamsArray[i]; finalQueryParams[qp.key] = qp.value; if (transition && qp.visible !== false) { transition._visibleQueryParams[qp.key] = qp.value; } } return finalQueryParams; } function notifyExistingHandlers(router, newState, newTransition) { var oldHandlers = router.state.handlerInfos, changing = [], leavingIndex = null, leaving, leavingChecker, i, oldHandlerLen, oldHandler, newHandler; oldHandlerLen = oldHandlers.length; for (i = 0; i < oldHandlerLen; i++) { oldHandler = oldHandlers[i]; newHandler = newState.handlerInfos[i]; if (!newHandler || oldHandler.name !== newHandler.name) { leavingIndex = i; break; } if (!newHandler.isResolved) { changing.push(oldHandler); } } if (leavingIndex !== null) { leaving = oldHandlers.slice(leavingIndex, oldHandlerLen); leavingChecker = function(name) { for (var h = 0, len = leaving.length; h < len; h++) { if (leaving[h].name === name) { return true; } } return false; }; } trigger(router, oldHandlers, true, ['willTransition', newTransition]); if (router.willTransition) { router.willTransition(oldHandlers, newState.handlerInfos, newTransition); } } exports['default'] = Router; exports.Transition = Transition; Object.defineProperty(exports, '__esModule', { value: true }); }); /*! * @overview RSVP - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors * @license Licensed under MIT license * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE * @version 3.2.1 */ enifed('rsvp', ['exports'], function (exports) { 'use strict'; function indexOf(callbacks, callback) { for (var i=0, l=callbacks.length; i 1) { throw new Error('Second argument not supported'); } if (typeof o !== 'object') { throw new TypeError('Argument must be an object'); } F.prototype = o; return new F(); }); var queue = []; function scheduleFlush() { setTimeout(function() { var entry; for (var i = 0; i < queue.length; i++) { entry = queue[i]; var payload = entry.payload; payload.guid = payload.key + payload.id; payload.childGuid = payload.key + payload.childId; if (payload.error) { payload.stack = payload.error.stack; } config['trigger'](entry.name, entry.payload); } queue.length = 0; }, 50); } function instrument(eventName, promise, child) { if (1 === queue.push({ name: eventName, payload: { key: promise._guidKey, id: promise._id, eventName: eventName, detail: promise._result, childId: child && child._id, label: promise._label, timeStamp: now(), error: config["instrument-with-stack"] ? new Error(promise._label) : null }})) { scheduleFlush(); } } /** `RSVP.Promise.resolve` returns a promise that will become resolved with the passed `value`. It is shorthand for the following: ```javascript var promise = new RSVP.Promise(function(resolve, reject){ resolve(1); }); promise.then(function(value){ // value === 1 }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript var promise = RSVP.Promise.resolve(1); promise.then(function(value){ // value === 1 }); ``` @method resolve @static @param {*} object value that the returned promise will be resolved with @param {String} label optional string for identifying the returned promise. Useful for tooling. @return {Promise} a promise that will become fulfilled with the given `value` */ function resolve$1(object, label) { /*jshint validthis:true */ var Constructor = this; if (object && typeof object === 'object' && object.constructor === Constructor) { return object; } var promise = new Constructor(noop, label); resolve(promise, object); return promise; } function withOwnPromise() { return new TypeError('A promises callback cannot return that same promise.'); } function noop() {} var PENDING = void 0; var FULFILLED = 1; var REJECTED = 2; var GET_THEN_ERROR = new ErrorObject(); function getThen(promise) { try { return promise.then; } catch(error) { GET_THEN_ERROR.error = error; return GET_THEN_ERROR; } } function tryThen(then, value, fulfillmentHandler, rejectionHandler) { try { then.call(value, fulfillmentHandler, rejectionHandler); } catch(e) { return e; } } function handleForeignThenable(promise, thenable, then) { config.async(function(promise) { var sealed = false; var error = tryThen(then, thenable, function(value) { if (sealed) { return; } sealed = true; if (thenable !== value) { resolve(promise, value, undefined); } else { fulfill(promise, value); } }, function(reason) { if (sealed) { return; } sealed = true; reject(promise, reason); }, 'Settle: ' + (promise._label || ' unknown promise')); if (!sealed && error) { sealed = true; reject(promise, error); } }, promise); } function handleOwnThenable(promise, thenable) { if (thenable._state === FULFILLED) { fulfill(promise, thenable._result); } else if (thenable._state === REJECTED) { thenable._onError = null; reject(promise, thenable._result); } else { subscribe(thenable, undefined, function(value) { if (thenable !== value) { resolve(promise, value, undefined); } else { fulfill(promise, value); } }, function(reason) { reject(promise, reason); }); } } function handleMaybeThenable(promise, maybeThenable, then$$) { if (maybeThenable.constructor === promise.constructor && then$$ === then && constructor.resolve === resolve$1) { handleOwnThenable(promise, maybeThenable); } else { if (then$$ === GET_THEN_ERROR) { reject(promise, GET_THEN_ERROR.error); } else if (then$$ === undefined) { fulfill(promise, maybeThenable); } else if (isFunction(then$$)) { handleForeignThenable(promise, maybeThenable, then$$); } else { fulfill(promise, maybeThenable); } } } function resolve(promise, value) { if (promise === value) { fulfill(promise, value); } else if (objectOrFunction(value)) { handleMaybeThenable(promise, value, getThen(value)); } else { fulfill(promise, value); } } function publishRejection(promise) { if (promise._onError) { promise._onError(promise._result); } publish(promise); } function fulfill(promise, value) { if (promise._state !== PENDING) { return; } promise._result = value; promise._state = FULFILLED; if (promise._subscribers.length === 0) { if (config.instrument) { instrument('fulfilled', promise); } } else { config.async(publish, promise); } } function reject(promise, reason) { if (promise._state !== PENDING) { return; } promise._state = REJECTED; promise._result = reason; config.async(publishRejection, promise); } function subscribe(parent, child, onFulfillment, onRejection) { var subscribers = parent._subscribers; var length = subscribers.length; parent._onError = null; subscribers[length] = child; subscribers[length + FULFILLED] = onFulfillment; subscribers[length + REJECTED] = onRejection; if (length === 0 && parent._state) { config.async(publish, parent); } } function publish(promise) { var subscribers = promise._subscribers; var settled = promise._state; if (config.instrument) { instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise); } if (subscribers.length === 0) { return; } var child, callback, detail = promise._result; for (var i = 0; i < subscribers.length; i += 3) { child = subscribers[i]; callback = subscribers[i + settled]; if (child) { invokeCallback(settled, child, callback, detail); } else { callback(detail); } } promise._subscribers.length = 0; } function ErrorObject() { this.error = null; } var TRY_CATCH_ERROR = new ErrorObject(); function tryCatch(callback, detail) { try { return callback(detail); } catch(e) { TRY_CATCH_ERROR.error = e; return TRY_CATCH_ERROR; } } function invokeCallback(settled, promise, callback, detail) { var hasCallback = isFunction(callback), value, error, succeeded, failed; if (hasCallback) { value = tryCatch(callback, detail); if (value === TRY_CATCH_ERROR) { failed = true; error = value.error; value = null; } else { succeeded = true; } if (promise === value) { reject(promise, withOwnPromise()); return; } } else { value = detail; succeeded = true; } if (promise._state !== PENDING) { // noop } else if (hasCallback && succeeded) { resolve(promise, value); } else if (failed) { reject(promise, error); } else if (settled === FULFILLED) { fulfill(promise, value); } else if (settled === REJECTED) { reject(promise, value); } } function initializePromise(promise, resolver) { var resolved = false; try { resolver(function resolvePromise(value){ if (resolved) { return; } resolved = true; resolve(promise, value); }, function rejectPromise(reason) { if (resolved) { return; } resolved = true; reject(promise, reason); }); } catch(e) { reject(promise, e); } } function then(onFulfillment, onRejection, label) { var parent = this; var state = parent._state; if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) { config.instrument && instrument('chained', parent, parent); return parent; } parent._onError = null; var child = new parent.constructor(noop, label); var result = parent._result; config.instrument && instrument('chained', parent, child); if (state) { var callback = arguments[state - 1]; config.async(function(){ invokeCallback(state, child, callback, result); }); } else { subscribe(parent, child, onFulfillment, onRejection); } return child; } function makeSettledResult(state, position, value) { if (state === FULFILLED) { return { state: 'fulfilled', value: value }; } else { return { state: 'rejected', reason: value }; } } function Enumerator(Constructor, input, abortOnReject, label) { this._instanceConstructor = Constructor; this.promise = new Constructor(noop, label); this._abortOnReject = abortOnReject; if (this._validateInput(input)) { this._input = input; this.length = input.length; this._remaining = input.length; this._init(); if (this.length === 0) { fulfill(this.promise, this._result); } else { this.length = this.length || 0; this._enumerate(); if (this._remaining === 0) { fulfill(this.promise, this._result); } } } else { reject(this.promise, this._validationError()); } } Enumerator.prototype._validateInput = function(input) { return isArray(input); }; Enumerator.prototype._validationError = function() { return new Error('Array Methods must be provided an Array'); }; Enumerator.prototype._init = function() { this._result = new Array(this.length); }; Enumerator.prototype._enumerate = function() { var length = this.length; var promise = this.promise; var input = this._input; for (var i = 0; promise._state === PENDING && i < length; i++) { this._eachEntry(input[i], i); } }; Enumerator.prototype._settleMaybeThenable = function(entry, i) { var c = this._instanceConstructor; var resolve = c.resolve; if (resolve === resolve$1) { var then$$ = getThen(entry); if (then$$ === then && entry._state !== PENDING) { entry._onError = null; this._settledAt(entry._state, i, entry._result); } else if (typeof then$$ !== 'function') { this._remaining--; this._result[i] = this._makeResult(FULFILLED, i, entry); } else if (c === Promise) { var promise = new c(noop); handleMaybeThenable(promise, entry, then$$); this._willSettleAt(promise, i); } else { this._willSettleAt(new c(function(resolve) { resolve(entry); }), i); } } else { this._willSettleAt(resolve(entry), i); } }; Enumerator.prototype._eachEntry = function(entry, i) { if (isMaybeThenable(entry)) { this._settleMaybeThenable(entry, i); } else { this._remaining--; this._result[i] = this._makeResult(FULFILLED, i, entry); } }; Enumerator.prototype._settledAt = function(state, i, value) { var promise = this.promise; if (promise._state === PENDING) { this._remaining--; if (this._abortOnReject && state === REJECTED) { reject(promise, value); } else { this._result[i] = this._makeResult(state, i, value); } } if (this._remaining === 0) { fulfill(promise, this._result); } }; Enumerator.prototype._makeResult = function(state, i, value) { return value; }; Enumerator.prototype._willSettleAt = function(promise, i) { var enumerator = this; subscribe(promise, undefined, function(value) { enumerator._settledAt(FULFILLED, i, value); }, function(reason) { enumerator._settledAt(REJECTED, i, reason); }); }; /** `RSVP.Promise.all` accepts an array of promises, and returns a new promise which is fulfilled with an array of fulfillment values for the passed promises, or rejected with the reason of the first passed promise to be rejected. It casts all elements of the passed iterable to promises as it runs this algorithm. Example: ```javascript var promise1 = RSVP.resolve(1); var promise2 = RSVP.resolve(2); var promise3 = RSVP.resolve(3); var promises = [ promise1, promise2, promise3 ]; RSVP.Promise.all(promises).then(function(array){ // The array here would be [ 1, 2, 3 ]; }); ``` If any of the `promises` given to `RSVP.all` are rejected, the first promise that is rejected will be given as an argument to the returned promises's rejection handler. For example: Example: ```javascript var promise1 = RSVP.resolve(1); var promise2 = RSVP.reject(new Error("2")); var promise3 = RSVP.reject(new Error("3")); var promises = [ promise1, promise2, promise3 ]; RSVP.Promise.all(promises).then(function(array){ // Code here never runs because there are rejected promises! }, function(error) { // error.message === "2" }); ``` @method all @static @param {Array} entries array of promises @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} promise that is fulfilled when all `promises` have been fulfilled, or rejected if any of them become rejected. @static */ function all(entries, label) { return new Enumerator(this, entries, true /* abort on reject */, label).promise; } /** `RSVP.Promise.race` returns a new promise which is settled in the same way as the first passed promise to settle. Example: ```javascript var promise1 = new RSVP.Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); var promise2 = new RSVP.Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 2'); }, 100); }); RSVP.Promise.race([promise1, promise2]).then(function(result){ // result === 'promise 2' because it was resolved before promise1 // was resolved. }); ``` `RSVP.Promise.race` is deterministic in that only the state of the first settled promise matters. For example, even if other promises given to the `promises` array argument are resolved, but the first settled promise has become rejected before the other promises became fulfilled, the returned promise will become rejected: ```javascript var promise1 = new RSVP.Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); var promise2 = new RSVP.Promise(function(resolve, reject){ setTimeout(function(){ reject(new Error('promise 2')); }, 100); }); RSVP.Promise.race([promise1, promise2]).then(function(result){ // Code here never runs }, function(reason){ // reason.message === 'promise 2' because promise 2 became rejected before // promise 1 became fulfilled }); ``` An example real-world use case is implementing timeouts: ```javascript RSVP.Promise.race([ajax('foo.json'), timeout(5000)]) ``` @method race @static @param {Array} entries array of promises to observe @param {String} label optional string for describing the promise returned. Useful for tooling. @return {Promise} a promise which settles in the same way as the first passed promise to settle. */ function race(entries, label) { /*jshint validthis:true */ var Constructor = this; var promise = new Constructor(noop, label); if (!isArray(entries)) { reject(promise, new TypeError('You must pass an array to race.')); return promise; } var length = entries.length; function onFulfillment(value) { resolve(promise, value); } function onRejection(reason) { reject(promise, reason); } for (var i = 0; promise._state === PENDING && i < length; i++) { subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection); } return promise; } /** `RSVP.Promise.reject` returns a promise rejected with the passed `reason`. It is shorthand for the following: ```javascript var promise = new RSVP.Promise(function(resolve, reject){ reject(new Error('WHOOPS')); }); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript var promise = RSVP.Promise.reject(new Error('WHOOPS')); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` @method reject @static @param {*} reason value that the returned promise will be rejected with. @param {String} label optional string for identifying the returned promise. Useful for tooling. @return {Promise} a promise rejected with the given `reason`. */ function reject$1(reason, label) { /*jshint validthis:true */ var Constructor = this; var promise = new Constructor(noop, label); reject(promise, reason); return promise; } var guidKey = 'rsvp_' + now() + '-'; var counter = 0; function needsResolver() { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } function needsNew() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); } /** Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise’s eventual value or the reason why the promise cannot be fulfilled. Terminology ----------- - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - `thenable` is an object or function that defines a `then` method. - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - `exception` is a value that is thrown using the throw statement. - `reason` is a value that indicates why a promise was rejected. - `settled` the final resting state of a promise, fulfilled or rejected. A promise can be in one of three states: pending, fulfilled, or rejected. Promises that are fulfilled have a fulfillment value and are in the fulfilled state. Promises that are rejected have a rejection reason and are in the rejected state. A fulfillment value is never a thenable. Promises can also be said to *resolve* a value. If this value is also a promise, then the original promise's settled state will match the value's settled state. So a promise that *resolves* a promise that rejects will itself reject, and a promise that *resolves* a promise that fulfills will itself fulfill. Basic Usage: ------------ ```js var promise = new Promise(function(resolve, reject) { // on success resolve(value); // on failure reject(reason); }); promise.then(function(value) { // on fulfillment }, function(reason) { // on rejection }); ``` Advanced Usage: --------------- Promises shine when abstracting away asynchronous interactions such as `XMLHttpRequest`s. ```js function getJSON(url) { return new Promise(function(resolve, reject){ var xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.onreadystatechange = handler; xhr.responseType = 'json'; xhr.setRequestHeader('Accept', 'application/json'); xhr.send(); function handler() { if (this.readyState === this.DONE) { if (this.status === 200) { resolve(this.response); } else { reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } } }; }); } getJSON('/posts.json').then(function(json) { // on fulfillment }, function(reason) { // on rejection }); ``` Unlike callbacks, promises are great composable primitives. ```js Promise.all([ getJSON('/posts'), getJSON('/comments') ]).then(function(values){ values[0] // => postsJSON values[1] // => commentsJSON return values; }); ``` @class RSVP.Promise @param {function} resolver @param {String} label optional string for labeling the promise. Useful for tooling. @constructor */ function Promise(resolver, label) { this._id = counter++; this._label = label; this._state = undefined; this._result = undefined; this._subscribers = []; config.instrument && instrument('created', this); if (noop !== resolver) { typeof resolver !== 'function' && needsResolver(); this instanceof Promise ? initializePromise(this, resolver) : needsNew(); } } Promise.cast = resolve$1; // deprecated Promise.all = all; Promise.race = race; Promise.resolve = resolve$1; Promise.reject = reject$1; Promise.prototype = { constructor: Promise, _guidKey: guidKey, _onError: function (reason) { var promise = this; config.after(function() { if (promise._onError) { config['trigger']('error', reason, promise._label); } }); }, /** The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. ```js findUser().then(function(user){ // user is available }, function(reason){ // user is unavailable, and you are given the reason why }); ``` Chaining -------- The return value of `then` is itself a promise. This second, 'downstream' promise is resolved with the return value of the first promise's fulfillment or rejection handler, or rejected if the handler throws an exception. ```js findUser().then(function (user) { return user.name; }, function (reason) { return 'default name'; }).then(function (userName) { // If `findUser` fulfilled, `userName` will be the user's name, otherwise it // will be `'default name'` }); findUser().then(function (user) { throw new Error('Found user, but still unhappy'); }, function (reason) { throw new Error('`findUser` rejected and we're unhappy'); }).then(function (value) { // never reached }, function (reason) { // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. }); ``` If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. ```js findUser().then(function (user) { throw new PedagogicalException('Upstream error'); }).then(function (value) { // never reached }).then(function (value) { // never reached }, function (reason) { // The `PedgagocialException` is propagated all the way down to here }); ``` Assimilation ------------ Sometimes the value you want to propagate to a downstream promise can only be retrieved asynchronously. This can be achieved by returning a promise in the fulfillment or rejection handler. The downstream promise will then be pending until the returned promise is settled. This is called *assimilation*. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // The user's comments are now available }); ``` If the assimliated promise rejects, then the downstream promise will also reject. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // If `findCommentsByAuthor` fulfills, we'll have the value here }, function (reason) { // If `findCommentsByAuthor` rejects, we'll have the reason here }); ``` Simple Example -------------- Synchronous Example ```javascript var result; try { result = findResult(); // success } catch(reason) { // failure } ``` Errback Example ```js findResult(function(result, err){ if (err) { // failure } else { // success } }); ``` Promise Example; ```javascript findResult().then(function(result){ // success }, function(reason){ // failure }); ``` Advanced Example -------------- Synchronous Example ```javascript var author, books; try { author = findAuthor(); books = findBooksByAuthor(author); // success } catch(reason) { // failure } ``` Errback Example ```js function foundBooks(books) { } function failure(reason) { } findAuthor(function(author, err){ if (err) { failure(err); // failure } else { try { findBoooksByAuthor(author, function(books, err) { if (err) { failure(err); } else { try { foundBooks(books); } catch(reason) { failure(reason); } } }); } catch(error) { failure(err); } // success } }); ``` Promise Example; ```javascript findAuthor(). then(findBooksByAuthor). then(function(books){ // found books }).catch(function(reason){ // something went wrong }); ``` @method then @param {Function} onFulfillment @param {Function} onRejection @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} */ then: then, /** `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same as the catch block of a try/catch statement. ```js function findAuthor(){ throw new Error('couldn't find that author'); } // synchronous try { findAuthor(); } catch(reason) { // something went wrong } // async with promises findAuthor().catch(function(reason){ // something went wrong }); ``` @method catch @param {Function} onRejection @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} */ 'catch': function(onRejection, label) { return this.then(undefined, onRejection, label); }, /** `finally` will be invoked regardless of the promise's fate just as native try/catch/finally behaves Synchronous example: ```js findAuthor() { if (Math.random() > 0.5) { throw new Error(); } return new Author(); } try { return findAuthor(); // succeed or fail } catch(error) { return findOtherAuther(); } finally { // always runs // doesn't affect the return value } ``` Asynchronous example: ```js findAuthor().catch(function(reason){ return findOtherAuther(); }).finally(function(){ // author was either found, or not }); ``` @method finally @param {Function} callback @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} */ 'finally': function(callback, label) { var promise = this; var constructor = promise.constructor; return promise.then(function(value) { return constructor.resolve(callback()).then(function() { return value; }); }, function(reason) { return constructor.resolve(callback()).then(function() { return constructor.reject(reason); }); }, label); } }; function Result() { this.value = undefined; } var ERROR = new Result(); var GET_THEN_ERROR$1 = new Result(); function getThen$1(obj) { try { return obj.then; } catch(error) { ERROR.value= error; return ERROR; } } function tryApply(f, s, a) { try { f.apply(s, a); } catch(error) { ERROR.value = error; return ERROR; } } function makeObject(_, argumentNames) { var obj = {}; var name; var i; var length = _.length; var args = new Array(length); for (var x = 0; x < length; x++) { args[x] = _[x]; } for (i = 0; i < argumentNames.length; i++) { name = argumentNames[i]; obj[name] = args[i + 1]; } return obj; } function arrayResult(_) { var length = _.length; var args = new Array(length - 1); for (var i = 1; i < length; i++) { args[i - 1] = _[i]; } return args; } function wrapThenable(then, promise) { return { then: function(onFulFillment, onRejection) { return then.call(promise, onFulFillment, onRejection); } }; } /** `RSVP.denodeify` takes a 'node-style' function and returns a function that will return an `RSVP.Promise`. You can use `denodeify` in Node.js or the browser when you'd prefer to use promises over using callbacks. For example, `denodeify` transforms the following: ```javascript var fs = require('fs'); fs.readFile('myfile.txt', function(err, data){ if (err) return handleError(err); handleData(data); }); ``` into: ```javascript var fs = require('fs'); var readFile = RSVP.denodeify(fs.readFile); readFile('myfile.txt').then(handleData, handleError); ``` If the node function has multiple success parameters, then `denodeify` just returns the first one: ```javascript var request = RSVP.denodeify(require('request')); request('http://example.com').then(function(res) { // ... }); ``` However, if you need all success parameters, setting `denodeify`'s second parameter to `true` causes it to return all success parameters as an array: ```javascript var request = RSVP.denodeify(require('request'), true); request('http://example.com').then(function(result) { // result[0] -> res // result[1] -> body }); ``` Or if you pass it an array with names it returns the parameters as a hash: ```javascript var request = RSVP.denodeify(require('request'), ['res', 'body']); request('http://example.com').then(function(result) { // result.res // result.body }); ``` Sometimes you need to retain the `this`: ```javascript var app = require('express')(); var render = RSVP.denodeify(app.render.bind(app)); ``` The denodified function inherits from the original function. It works in all environments, except IE 10 and below. Consequently all properties of the original function are available to you. However, any properties you change on the denodeified function won't be changed on the original function. Example: ```javascript var request = RSVP.denodeify(require('request')), cookieJar = request.jar(); // <- Inheritance is used here request('http://example.com', {jar: cookieJar}).then(function(res) { // cookieJar.cookies holds now the cookies returned by example.com }); ``` Using `denodeify` makes it easier to compose asynchronous operations instead of using callbacks. For example, instead of: ```javascript var fs = require('fs'); fs.readFile('myfile.txt', function(err, data){ if (err) { ... } // Handle error fs.writeFile('myfile2.txt', data, function(err){ if (err) { ... } // Handle error console.log('done') }); }); ``` you can chain the operations together using `then` from the returned promise: ```javascript var fs = require('fs'); var readFile = RSVP.denodeify(fs.readFile); var writeFile = RSVP.denodeify(fs.writeFile); readFile('myfile.txt').then(function(data){ return writeFile('myfile2.txt', data); }).then(function(){ console.log('done') }).catch(function(error){ // Handle error }); ``` @method denodeify @static @for RSVP @param {Function} nodeFunc a 'node-style' function that takes a callback as its last argument. The callback expects an error to be passed as its first argument (if an error occurred, otherwise null), and the value from the operation as its second argument ('function(err, value){ }'). @param {Boolean|Array} [options] An optional paramter that if set to `true` causes the promise to fulfill with the callback's success arguments as an array. This is useful if the node function has multiple success paramters. If you set this paramter to an array with names, the promise will fulfill with a hash with these names as keys and the success parameters as values. @return {Function} a function that wraps `nodeFunc` to return an `RSVP.Promise` @static */ function denodeify(nodeFunc, options) { var fn = function() { var self = this; var l = arguments.length; var args = new Array(l + 1); var arg; var promiseInput = false; for (var i = 0; i < l; ++i) { arg = arguments[i]; if (!promiseInput) { // TODO: clean this up promiseInput = needsPromiseInput(arg); if (promiseInput === GET_THEN_ERROR$1) { var p = new Promise(noop); reject(p, GET_THEN_ERROR$1.value); return p; } else if (promiseInput && promiseInput !== true) { arg = wrapThenable(promiseInput, arg); } } args[i] = arg; } var promise = new Promise(noop); args[l] = function(err, val) { if (err) reject(promise, err); else if (options === undefined) resolve(promise, val); else if (options === true) resolve(promise, arrayResult(arguments)); else if (isArray(options)) resolve(promise, makeObject(arguments, options)); else resolve(promise, val); }; if (promiseInput) { return handlePromiseInput(promise, args, nodeFunc, self); } else { return handleValueInput(promise, args, nodeFunc, self); } }; fn.__proto__ = nodeFunc; return fn; } function handleValueInput(promise, args, nodeFunc, self) { var result = tryApply(nodeFunc, self, args); if (result === ERROR) { reject(promise, result.value); } return promise; } function handlePromiseInput(promise, args, nodeFunc, self){ return Promise.all(args).then(function(args){ var result = tryApply(nodeFunc, self, args); if (result === ERROR) { reject(promise, result.value); } return promise; }); } function needsPromiseInput(arg) { if (arg && typeof arg === 'object') { if (arg.constructor === Promise) { return true; } else { return getThen$1(arg); } } else { return false; } } /** This is a convenient alias for `RSVP.Promise.all`. @method all @static @for RSVP @param {Array} array Array of promises. @param {String} label An optional label. This is useful for tooling. */ function all$1(array, label) { return Promise.all(array, label); } function AllSettled(Constructor, entries, label) { this._superConstructor(Constructor, entries, false /* don't abort on reject */, label); } AllSettled.prototype = o_create(Enumerator.prototype); AllSettled.prototype._superConstructor = Enumerator; AllSettled.prototype._makeResult = makeSettledResult; AllSettled.prototype._validationError = function() { return new Error('allSettled must be called with an array'); }; /** `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing a fail-fast method, it waits until all the promises have returned and shows you all the results. This is useful if you want to handle multiple promises' failure states together as a set. Returns a promise that is fulfilled when all the given promises have been settled. The return promise is fulfilled with an array of the states of the promises passed into the `promises` array argument. Each state object will either indicate fulfillment or rejection, and provide the corresponding value or reason. The states will take one of the following formats: ```javascript { state: 'fulfilled', value: value } or { state: 'rejected', reason: reason } ``` Example: ```javascript var promise1 = RSVP.Promise.resolve(1); var promise2 = RSVP.Promise.reject(new Error('2')); var promise3 = RSVP.Promise.reject(new Error('3')); var promises = [ promise1, promise2, promise3 ]; RSVP.allSettled(promises).then(function(array){ // array == [ // { state: 'fulfilled', value: 1 }, // { state: 'rejected', reason: Error }, // { state: 'rejected', reason: Error } // ] // Note that for the second item, reason.message will be '2', and for the // third item, reason.message will be '3'. }, function(error) { // Not run. (This block would only be called if allSettled had failed, // for instance if passed an incorrect argument type.) }); ``` @method allSettled @static @for RSVP @param {Array} entries @param {String} label - optional string that describes the promise. Useful for tooling. @return {Promise} promise that is fulfilled with an array of the settled states of the constituent promises. */ function allSettled(entries, label) { return new AllSettled(Promise, entries, label).promise; } /** This is a convenient alias for `RSVP.Promise.race`. @method race @static @for RSVP @param {Array} array Array of promises. @param {String} label An optional label. This is useful for tooling. */ function race$1(array, label) { return Promise.race(array, label); } function PromiseHash(Constructor, object, label) { this._superConstructor(Constructor, object, true, label); } PromiseHash.prototype = o_create(Enumerator.prototype); PromiseHash.prototype._superConstructor = Enumerator; PromiseHash.prototype._init = function() { this._result = {}; }; PromiseHash.prototype._validateInput = function(input) { return input && typeof input === 'object'; }; PromiseHash.prototype._validationError = function() { return new Error('Promise.hash must be called with an object'); }; PromiseHash.prototype._enumerate = function() { var enumerator = this; var promise = enumerator.promise; var input = enumerator._input; var results = []; for (var key in input) { if (promise._state === PENDING && Object.prototype.hasOwnProperty.call(input, key)) { results.push({ position: key, entry: input[key] }); } } var length = results.length; enumerator._remaining = length; var result; for (var i = 0; promise._state === PENDING && i < length; i++) { result = results[i]; enumerator._eachEntry(result.entry, result.position); } }; /** `RSVP.hash` is similar to `RSVP.all`, but takes an object instead of an array for its `promises` argument. Returns a promise that is fulfilled when all the given promises have been fulfilled, or rejected if any of them become rejected. The returned promise is fulfilled with a hash that has the same key names as the `promises` object argument. If any of the values in the object are not promises, they will simply be copied over to the fulfilled object. Example: ```javascript var promises = { myPromise: RSVP.resolve(1), yourPromise: RSVP.resolve(2), theirPromise: RSVP.resolve(3), notAPromise: 4 }; RSVP.hash(promises).then(function(hash){ // hash here is an object that looks like: // { // myPromise: 1, // yourPromise: 2, // theirPromise: 3, // notAPromise: 4 // } }); ```` If any of the `promises` given to `RSVP.hash` are rejected, the first promise that is rejected will be given as the reason to the rejection handler. Example: ```javascript var promises = { myPromise: RSVP.resolve(1), rejectedPromise: RSVP.reject(new Error('rejectedPromise')), anotherRejectedPromise: RSVP.reject(new Error('anotherRejectedPromise')), }; RSVP.hash(promises).then(function(hash){ // Code here never runs because there are rejected promises! }, function(reason) { // reason.message === 'rejectedPromise' }); ``` An important note: `RSVP.hash` is intended for plain JavaScript objects that are just a set of keys and values. `RSVP.hash` will NOT preserve prototype chains. Example: ```javascript function MyConstructor(){ this.example = RSVP.resolve('Example'); } MyConstructor.prototype = { protoProperty: RSVP.resolve('Proto Property') }; var myObject = new MyConstructor(); RSVP.hash(myObject).then(function(hash){ // protoProperty will not be present, instead you will just have an // object that looks like: // { // example: 'Example' // } // // hash.hasOwnProperty('protoProperty'); // false // 'undefined' === typeof hash.protoProperty }); ``` @method hash @static @for RSVP @param {Object} object @param {String} label optional string that describes the promise. Useful for tooling. @return {Promise} promise that is fulfilled when all properties of `promises` have been fulfilled, or rejected if any of them become rejected. */ function hash(object, label) { return new PromiseHash(Promise, object, label).promise; } function HashSettled(Constructor, object, label) { this._superConstructor(Constructor, object, false, label); } HashSettled.prototype = o_create(PromiseHash.prototype); HashSettled.prototype._superConstructor = Enumerator; HashSettled.prototype._makeResult = makeSettledResult; HashSettled.prototype._validationError = function() { return new Error('hashSettled must be called with an object'); }; /** `RSVP.hashSettled` is similar to `RSVP.allSettled`, but takes an object instead of an array for its `promises` argument. Unlike `RSVP.all` or `RSVP.hash`, which implement a fail-fast method, but like `RSVP.allSettled`, `hashSettled` waits until all the constituent promises have returned and then shows you all the results with their states and values/reasons. This is useful if you want to handle multiple promises' failure states together as a set. Returns a promise that is fulfilled when all the given promises have been settled, or rejected if the passed parameters are invalid. The returned promise is fulfilled with a hash that has the same key names as the `promises` object argument. If any of the values in the object are not promises, they will be copied over to the fulfilled object and marked with state 'fulfilled'. Example: ```javascript var promises = { myPromise: RSVP.Promise.resolve(1), yourPromise: RSVP.Promise.resolve(2), theirPromise: RSVP.Promise.resolve(3), notAPromise: 4 }; RSVP.hashSettled(promises).then(function(hash){ // hash here is an object that looks like: // { // myPromise: { state: 'fulfilled', value: 1 }, // yourPromise: { state: 'fulfilled', value: 2 }, // theirPromise: { state: 'fulfilled', value: 3 }, // notAPromise: { state: 'fulfilled', value: 4 } // } }); ``` If any of the `promises` given to `RSVP.hash` are rejected, the state will be set to 'rejected' and the reason for rejection provided. Example: ```javascript var promises = { myPromise: RSVP.Promise.resolve(1), rejectedPromise: RSVP.Promise.reject(new Error('rejection')), anotherRejectedPromise: RSVP.Promise.reject(new Error('more rejection')), }; RSVP.hashSettled(promises).then(function(hash){ // hash here is an object that looks like: // { // myPromise: { state: 'fulfilled', value: 1 }, // rejectedPromise: { state: 'rejected', reason: Error }, // anotherRejectedPromise: { state: 'rejected', reason: Error }, // } // Note that for rejectedPromise, reason.message == 'rejection', // and for anotherRejectedPromise, reason.message == 'more rejection'. }); ``` An important note: `RSVP.hashSettled` is intended for plain JavaScript objects that are just a set of keys and values. `RSVP.hashSettled` will NOT preserve prototype chains. Example: ```javascript function MyConstructor(){ this.example = RSVP.Promise.resolve('Example'); } MyConstructor.prototype = { protoProperty: RSVP.Promise.resolve('Proto Property') }; var myObject = new MyConstructor(); RSVP.hashSettled(myObject).then(function(hash){ // protoProperty will not be present, instead you will just have an // object that looks like: // { // example: { state: 'fulfilled', value: 'Example' } // } // // hash.hasOwnProperty('protoProperty'); // false // 'undefined' === typeof hash.protoProperty }); ``` @method hashSettled @for RSVP @param {Object} object @param {String} label optional string that describes the promise. Useful for tooling. @return {Promise} promise that is fulfilled when when all properties of `promises` have been settled. @static */ function hashSettled(object, label) { return new HashSettled(Promise, object, label).promise; } /** `RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event loop in order to aid debugging. Promises A+ specifies that any exceptions that occur with a promise must be caught by the promises implementation and bubbled to the last handler. For this reason, it is recommended that you always specify a second rejection handler function to `then`. However, `RSVP.rethrow` will throw the exception outside of the promise, so it bubbles up to your console if in the browser, or domain/cause uncaught exception in Node. `rethrow` will also throw the error again so the error can be handled by the promise per the spec. ```javascript function throws(){ throw new Error('Whoops!'); } var promise = new RSVP.Promise(function(resolve, reject){ throws(); }); promise.catch(RSVP.rethrow).then(function(){ // Code here doesn't run because the promise became rejected due to an // error! }, function (err){ // handle the error here }); ``` The 'Whoops' error will be thrown on the next turn of the event loop and you can watch for it in your console. You can also handle it using a rejection handler given to `.then` or `.catch` on the returned promise. @method rethrow @static @for RSVP @param {Error} reason reason the promise became rejected. @throws Error @static */ function rethrow(reason) { setTimeout(function() { throw reason; }); throw reason; } /** `RSVP.defer` returns an object similar to jQuery's `$.Deferred`. `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s interface. New code should use the `RSVP.Promise` constructor instead. The object returned from `RSVP.defer` is a plain object with three properties: * promise - an `RSVP.Promise`. * reject - a function that causes the `promise` property on this object to become rejected * resolve - a function that causes the `promise` property on this object to become fulfilled. Example: ```javascript var deferred = RSVP.defer(); deferred.resolve("Success!"); deferred.promise.then(function(value){ // value here is "Success!" }); ``` @method defer @static @for RSVP @param {String} label optional string for labeling the promise. Useful for tooling. @return {Object} */ function defer(label) { var deferred = {}; deferred['promise'] = new Promise(function(resolve, reject) { deferred['resolve'] = resolve; deferred['reject'] = reject; }, label); return deferred; } /** `RSVP.map` is similar to JavaScript's native `map` method, except that it waits for all promises to become fulfilled before running the `mapFn` on each item in given to `promises`. `RSVP.map` returns a promise that will become fulfilled with the result of running `mapFn` on the values the promises become fulfilled with. For example: ```javascript var promise1 = RSVP.resolve(1); var promise2 = RSVP.resolve(2); var promise3 = RSVP.resolve(3); var promises = [ promise1, promise2, promise3 ]; var mapFn = function(item){ return item + 1; }; RSVP.map(promises, mapFn).then(function(result){ // result is [ 2, 3, 4 ] }); ``` If any of the `promises` given to `RSVP.map` are rejected, the first promise that is rejected will be given as an argument to the returned promise's rejection handler. For example: ```javascript var promise1 = RSVP.resolve(1); var promise2 = RSVP.reject(new Error('2')); var promise3 = RSVP.reject(new Error('3')); var promises = [ promise1, promise2, promise3 ]; var mapFn = function(item){ return item + 1; }; RSVP.map(promises, mapFn).then(function(array){ // Code here never runs because there are rejected promises! }, function(reason) { // reason.message === '2' }); ``` `RSVP.map` will also wait if a promise is returned from `mapFn`. For example, say you want to get all comments from a set of blog posts, but you need the blog posts first because they contain a url to those comments. ```javscript var mapFn = function(blogPost){ // getComments does some ajax and returns an RSVP.Promise that is fulfilled // with some comments data return getComments(blogPost.comments_url); }; // getBlogPosts does some ajax and returns an RSVP.Promise that is fulfilled // with some blog post data RSVP.map(getBlogPosts(), mapFn).then(function(comments){ // comments is the result of asking the server for the comments // of all blog posts returned from getBlogPosts() }); ``` @method map @static @for RSVP @param {Array} promises @param {Function} mapFn function to be called on each fulfilled promise. @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} promise that is fulfilled with the result of calling `mapFn` on each fulfilled promise or value when they become fulfilled. The promise will be rejected if any of the given `promises` become rejected. @static */ function map(promises, mapFn, label) { return Promise.all(promises, label).then(function(values) { if (!isFunction(mapFn)) { throw new TypeError("You must pass a function as map's second argument."); } var length = values.length; var results = new Array(length); for (var i = 0; i < length; i++) { results[i] = mapFn(values[i]); } return Promise.all(results, label); }); } /** This is a convenient alias for `RSVP.Promise.resolve`. @method resolve @static @for RSVP @param {*} value value that the returned promise will be resolved with @param {String} label optional string for identifying the returned promise. Useful for tooling. @return {Promise} a promise that will become fulfilled with the given `value` */ function resolve$2(value, label) { return Promise.resolve(value, label); } /** This is a convenient alias for `RSVP.Promise.reject`. @method reject @static @for RSVP @param {*} reason value that the returned promise will be rejected with. @param {String} label optional string for identifying the returned promise. Useful for tooling. @return {Promise} a promise rejected with the given `reason`. */ function reject$2(reason, label) { return Promise.reject(reason, label); } /** `RSVP.filter` is similar to JavaScript's native `filter` method, except that it waits for all promises to become fulfilled before running the `filterFn` on each item in given to `promises`. `RSVP.filter` returns a promise that will become fulfilled with the result of running `filterFn` on the values the promises become fulfilled with. For example: ```javascript var promise1 = RSVP.resolve(1); var promise2 = RSVP.resolve(2); var promise3 = RSVP.resolve(3); var promises = [promise1, promise2, promise3]; var filterFn = function(item){ return item > 1; }; RSVP.filter(promises, filterFn).then(function(result){ // result is [ 2, 3 ] }); ``` If any of the `promises` given to `RSVP.filter` are rejected, the first promise that is rejected will be given as an argument to the returned promise's rejection handler. For example: ```javascript var promise1 = RSVP.resolve(1); var promise2 = RSVP.reject(new Error('2')); var promise3 = RSVP.reject(new Error('3')); var promises = [ promise1, promise2, promise3 ]; var filterFn = function(item){ return item > 1; }; RSVP.filter(promises, filterFn).then(function(array){ // Code here never runs because there are rejected promises! }, function(reason) { // reason.message === '2' }); ``` `RSVP.filter` will also wait for any promises returned from `filterFn`. For instance, you may want to fetch a list of users then return a subset of those users based on some asynchronous operation: ```javascript var alice = { name: 'alice' }; var bob = { name: 'bob' }; var users = [ alice, bob ]; var promises = users.map(function(user){ return RSVP.resolve(user); }); var filterFn = function(user){ // Here, Alice has permissions to create a blog post, but Bob does not. return getPrivilegesForUser(user).then(function(privs){ return privs.can_create_blog_post === true; }); }; RSVP.filter(promises, filterFn).then(function(users){ // true, because the server told us only Alice can create a blog post. users.length === 1; // false, because Alice is the only user present in `users` users[0] === bob; }); ``` @method filter @static @for RSVP @param {Array} promises @param {Function} filterFn - function to be called on each resolved value to filter the final results. @param {String} label optional string describing the promise. Useful for tooling. @return {Promise} */ function filter(promises, filterFn, label) { return Promise.all(promises, label).then(function(values) { if (!isFunction(filterFn)) { throw new TypeError("You must pass a function as filter's second argument."); } var length = values.length; var filtered = new Array(length); for (var i = 0; i < length; i++) { filtered[i] = filterFn(values[i]); } return Promise.all(filtered, label).then(function(filtered) { var results = new Array(length); var newLength = 0; for (var i = 0; i < length; i++) { if (filtered[i]) { results[newLength] = values[i]; newLength++; } } results.length = newLength; return results; }); }); } var len = 0; var vertxNext; function asap(callback, arg) { queue$1[len] = callback; queue$1[len + 1] = arg; len += 2; if (len === 2) { // If len is 1, that means that we need to schedule an async flush. // If additional callbacks are queued before the queue is flushed, they // will be processed by this flush that we are scheduling. scheduleFlush$1(); } } var browserWindow = (typeof window !== 'undefined') ? window : undefined; var browserGlobal = browserWindow || {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; // test for web worker but not in IE10 var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node function useNextTick() { var nextTick = process.nextTick; // node version 0.10.x displays a deprecation warning when nextTick is used recursively // setImmediate should be used instead instead var version = process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/); if (Array.isArray(version) && version[1] === '0' && version[2] === '10') { nextTick = setImmediate; } return function() { nextTick(flush); }; } // vertx function useVertxTimer() { return function() { vertxNext(flush); }; } function useMutationObserver() { var iterations = 0; var observer = new BrowserMutationObserver(flush); var node = document.createTextNode(''); observer.observe(node, { characterData: true }); return function() { node.data = (iterations = ++iterations % 2); }; } // web worker function useMessageChannel() { var channel = new MessageChannel(); channel.port1.onmessage = flush; return function () { channel.port2.postMessage(0); }; } function useSetTimeout() { return function() { setTimeout(flush, 1); }; } var queue$1 = new Array(1000); function flush() { for (var i = 0; i < len; i+=2) { var callback = queue$1[i]; var arg = queue$1[i+1]; callback(arg); queue$1[i] = undefined; queue$1[i+1] = undefined; } len = 0; } function attemptVertex() { try { var r = require; var vertx = r('vertx'); vertxNext = vertx.runOnLoop || vertx.runOnContext; return useVertxTimer(); } catch(e) { return useSetTimeout(); } } var scheduleFlush$1; // Decide what async method to use to triggering processing of queued callbacks: if (isNode) { scheduleFlush$1 = useNextTick(); } else if (BrowserMutationObserver) { scheduleFlush$1 = useMutationObserver(); } else if (isWorker) { scheduleFlush$1 = useMessageChannel(); } else if (browserWindow === undefined && typeof require === 'function') { scheduleFlush$1 = attemptVertex(); } else { scheduleFlush$1 = useSetTimeout(); } // defaults config.async = asap; config.after = function(cb) { setTimeout(cb, 0); }; var cast = resolve$2; function async(callback, arg) { config.async(callback, arg); } function on() { config['on'].apply(config, arguments); } function off() { config['off'].apply(config, arguments); } // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__` if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') { var callbacks = window['__PROMISE_INSTRUMENTATION__']; configure('instrument', true); for (var eventName in callbacks) { if (callbacks.hasOwnProperty(eventName)) { on(eventName, callbacks[eventName]); } } } exports.cast = cast; exports.Promise = Promise; exports.EventTarget = EventTarget; exports.all = all$1; exports.allSettled = allSettled; exports.race = race$1; exports.hash = hash; exports.hashSettled = hashSettled; exports.rethrow = rethrow; exports.defer = defer; exports.denodeify = denodeify; exports.configure = configure; exports.on = on; exports.off = off; exports.resolve = resolve$2; exports.reject = reject$2; exports.async = async; exports.map = map; exports.filter = filter; Object.defineProperty(exports, '__esModule', { value: true }); }); requireModule("ember"); }());