(function() { /*! * @overview Ember - JavaScript Application Framework * @copyright Copyright 2011-2021 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 3.28.6 */ /* eslint-disable no-var */ /* globals global globalThis self */ var define, require; (function () { var globalObj = typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : null; if (globalObj === null) { throw new Error('unable to locate global object'); } if (typeof globalObj.define === 'function' && typeof globalObj.require === 'function') { define = globalObj.define; require = globalObj.require; return; } var registry = Object.create(null); var seen = Object.create(null); 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] = require(deps[i], name); } } callback.apply(this, reified); return exports; } require = function (name) { return internalRequire(name, null); }; // eslint-disable-next-line no-unused-vars define = function (name, deps, callback) { registry[name] = { deps: deps, callback: callback }; }; // setup `require` module require['default'] = require; require.has = function registryHas(moduleName) { return Boolean(registry[moduleName]) || Boolean(registry[moduleName + '/index']); }; require._eak_seen = require.entries = registry; })(); define("@ember/-internals/bootstrap/index", ["@ember/-internals/environment", "@ember/-internals/overrides", "@ember/debug", "require"], function (_environment, _overrides, _debug, _require) { "use strict"; (function bootstrap() { var Ember; var get = () => { if (!Ember) { // tslint:disable-next-line: no-require-imports Ember = (0, _require.default)("ember").default; } return Ember; }; if (true /* DEBUG */ ) { var defaultHandler = () => { return 'Usage of the Ember Global is deprecated. You should import the Ember module or the specific API instead.'; }; var handler = _overrides.onEmberGlobalAccess || defaultHandler; var _get = get; get = () => { var message = handler(); if (message !== null) { (true && !(false) && (0, _debug.deprecate)(message, false, { id: 'ember-global', until: '4.0.0', url: 'https://deprecations.emberjs.com/v3.x/#toc_ember-global', for: 'ember-source', since: { enabled: '3.27.0' } })); } return _get(); }; } function defineEmber(key) { Object.defineProperty(_environment.context.exports, key, { enumerable: true, configurable: true, get }); } // Bootstrap the global defineEmber('Ember'); defineEmber('Em'); // Bootstrap Node module // eslint-disable-next-line no-undef if (typeof module === 'object' && typeof module.require === 'function') { // tslint:disable-next-line: no-require-imports module.exports = Ember = (0, _require.default)("ember").default; } })(); }); define("@ember/-internals/browser-environment/index", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.hasDOM = _exports.isIE = _exports.isFirefox = _exports.isChrome = _exports.userAgent = _exports.history = _exports.location = _exports.window = void 0; // check if window exists and actually is the global var hasDom = typeof self === 'object' && self !== null && self.Object === Object && typeof Window !== 'undefined' && self.constructor === Window && typeof document === 'object' && document !== null && self.document === document && typeof location === 'object' && location !== null && self.location === location && typeof history === 'object' && history !== null && self.history === history && typeof navigator === 'object' && navigator !== null && self.navigator === navigator && typeof navigator.userAgent === 'string'; _exports.hasDOM = hasDom; var window = hasDom ? self : null; _exports.window = window; var location$1 = hasDom ? self.location : null; _exports.location = location$1; var history$1 = hasDom ? self.history : null; _exports.history = history$1; var userAgent = hasDom ? self.navigator.userAgent : 'Lynx (textmode)'; _exports.userAgent = userAgent; var isChrome = hasDom ? typeof chrome === 'object' && !(typeof opera === 'object') : false; _exports.isChrome = isChrome; var isFirefox = hasDom ? typeof InstallTrigger !== 'undefined' : false; _exports.isFirefox = isFirefox; var isIE = hasDom ? typeof MSInputMethodContext !== 'undefined' && typeof documentMode !== 'undefined' : false; _exports.isIE = isIE; }); define("@ember/-internals/console/index", ["exports", "@ember/debug", "@ember/deprecated-features"], function (_exports, _debug, _deprecatedFeatures) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; // Deliver message that the function is deprecated var DEPRECATION_MESSAGE = 'Use of Ember.Logger is deprecated. Please use `console` for logging.'; var DEPRECATION_ID = 'ember-console.deprecate-logger'; var DEPRECATION_URL = 'https://deprecations.emberjs.com/v3.x#toc_use-console-rather-than-ember-logger'; /** @module ember */ /** Inside Ember-Metal, simply uses the methods from `imports.console`. Override this to provide more robust logging functionality. @class Logger @deprecated Use 'console' instead @namespace Ember @public */ var DEPRECATED_LOGGER; if (_deprecatedFeatures.LOGGER) { DEPRECATED_LOGGER = { /** 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() { (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, { id: DEPRECATION_ID, until: '4.0.0', url: DEPRECATION_URL, for: 'ember-source', since: { enabled: '3.2.0' } })); return console.log(...arguments); // eslint-disable-line no-console }, /** 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() { (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, { id: DEPRECATION_ID, until: '4.0.0', url: DEPRECATION_URL, for: 'ember-source', since: { enabled: '3.2.0' } })); return console.warn(...arguments); // eslint-disable-line no-console }, /** 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() { (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, { id: DEPRECATION_ID, until: '4.0.0', url: DEPRECATION_URL, for: 'ember-source', since: { enabled: '3.2.0' } })); return console.error(...arguments); // eslint-disable-line no-console }, /** 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() { (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, { id: DEPRECATION_ID, until: '4.0.0', url: DEPRECATION_URL, for: 'ember-source', since: { enabled: '3.2.0' } })); return console.info(...arguments); // eslint-disable-line no-console }, /** 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() { (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, { id: DEPRECATION_ID, until: '4.0.0', url: DEPRECATION_URL, for: 'ember-source', since: { enabled: '3.2.0' } })); /* eslint-disable no-console */ if (console.debug) { return console.debug(...arguments); } return console.info(...arguments); /* eslint-enable no-console */ }, /** 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() { (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, { id: DEPRECATION_ID, until: '4.0.0', url: DEPRECATION_URL, for: 'ember-source', since: { enabled: '3.2.0' } })); return console.assert(...arguments); // eslint-disable-line no-console } }; } var _default = DEPRECATED_LOGGER; _exports.default = _default; }); define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner", "@ember/-internals/utils", "@ember/debug", "@ember/polyfills"], function (_exports, _owner, _utils, _debug, _polyfills) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.privatize = privatize; _exports.getFactoryFor = getFactoryFor; _exports.setFactoryFor = setFactoryFor; _exports.INIT_FACTORY = _exports.Container = _exports.Registry = void 0; var leakTracking; var containers; if (true /* DEBUG */ ) { // requires v8 // chrome --js-flags="--allow-natives-syntax --expose-gc" // node --allow-natives-syntax --expose-gc try { if (typeof gc === 'function') { leakTracking = (() => { // avoid syntax errors when --allow-natives-syntax not present var GetWeakSetValues = new Function('weakSet', 'return %GetWeakSetValues(weakSet, 0)'); containers = new WeakSet(); return { hasContainers() { gc(); return GetWeakSetValues(containers).length > 0; }, reset() { var values = GetWeakSetValues(containers); for (var i = 0; i < values.length; i++) { containers.delete(values[i]); } } }; })(); } } catch (e) {// ignore } } /** 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 */ class Container { constructor(registry, options = {}) { this.registry = registry; this.owner = options.owner || null; this.cache = (0, _utils.dictionary)(options.cache || null); this.factoryManagerCache = (0, _utils.dictionary)(options.factoryManagerCache || null); this.isDestroyed = false; this.isDestroying = false; if (true /* DEBUG */ ) { this.validationCache = (0, _utils.dictionary)(options.validationCache || null); if (containers !== undefined) { containers.add(this); } } } /** @private @property registry @type Registry @since 1.11.0 */ /** @private @property cache @type InheritingDict */ /** @private @property validationCache @type InheritingDict */ /** Given a fullName return a corresponding instance. The default behavior 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(fullName, options) { if (this.isDestroyed) { throw new Error(`Can not call \`.lookup\` after the owner has been destroyed`); } (true && !(this.registry.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.registry.isValidFullName(fullName))); return lookup(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() { this.isDestroying = true; destroyDestroyables(this); } finalizeDestroy() { resetCache(this); 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(fullName) { if (this.isDestroyed) return; if (fullName === undefined) { destroyDestroyables(this); resetCache(this); } else { resetMember(this, this.registry.normalize(fullName)); } } /** Returns an object that can be used to provide an owner to a manually created instance. @private @method ownerInjection @returns { Object } */ ownerInjection() { var injection = {}; (0, _owner.setOwner)(injection, this.owner); return injection; } /** Given a fullName, return the corresponding factory. The consumer of the factory is responsible for the destruction of any factory instances, as there is no way for the container to ensure instances are destroyed when it itself is destroyed. @public @method factoryFor @param {String} fullName @param {Object} [options] @param {String} [options.source] The fullname of the request source (used for local lookup) @return {any} */ factoryFor(fullName) { if (this.isDestroyed) { throw new Error(`Can not call \`.factoryFor\` after the owner has been destroyed`); } var normalizedName = this.registry.normalize(fullName); (true && !(this.registry.isValidFullName(normalizedName)) && (0, _debug.assert)('fullName must be a proper full name', this.registry.isValidFullName(normalizedName))); return factoryFor(this, normalizedName, fullName); } } _exports.Container = Container; if (true /* DEBUG */ ) { Container._leakTracking = leakTracking; } /* * Wrap a factory manager in a proxy which will not permit properties to be * set on the manager. */ function wrapManagerInDeprecationProxy(manager) { if (_utils.HAS_NATIVE_PROXY) { var validator = { set(_obj, prop) { throw new Error(`You attempted to set "${prop}" on a factory manager created by container#factoryFor. A factory manager is a read-only construct.`); } }; // Note: // We have to proxy access to the manager here so that private property // access doesn't cause the above errors to occur. var m = manager; var proxiedManager = { class: m.class, create(props) { return m.create(props); } }; return new Proxy(proxiedManager, validator); } return manager; } function isSingleton(container, fullName) { return container.registry.getOption(fullName, 'singleton') !== false; } function isInstantiatable(container, fullName) { return container.registry.getOption(fullName, 'instantiate') !== false; } function lookup(container, fullName, options = {}) { var normalizedName = fullName; if (options.singleton === true || options.singleton === undefined && isSingleton(container, fullName)) { var cached = container.cache[normalizedName]; if (cached !== undefined) { return cached; } } return instantiateFactory(container, normalizedName, fullName, options); } function factoryFor(container, normalizedName, fullName) { var cached = container.factoryManagerCache[normalizedName]; if (cached !== undefined) { return cached; } var factory = container.registry.resolve(normalizedName); if (factory === undefined) { return; } if (true /* DEBUG */ && factory && typeof factory._onLookup === 'function') { factory._onLookup(fullName); } var manager = new FactoryManager(container, factory, fullName, normalizedName); if (true /* DEBUG */ ) { manager = wrapManagerInDeprecationProxy(manager); } container.factoryManagerCache[normalizedName] = manager; return manager; } function isSingletonClass(container, fullName, { instantiate, singleton }) { return singleton !== false && !instantiate && isSingleton(container, fullName) && !isInstantiatable(container, fullName); } function isSingletonInstance(container, fullName, { instantiate, singleton }) { return singleton !== false && instantiate !== false && (singleton === true || isSingleton(container, fullName)) && isInstantiatable(container, fullName); } function isFactoryClass(container, fullname, { instantiate, singleton }) { return instantiate === false && (singleton === false || !isSingleton(container, fullname)) && !isInstantiatable(container, fullname); } function isFactoryInstance(container, fullName, { instantiate, singleton }) { return instantiate !== false && (singleton === false || !isSingleton(container, fullName)) && isInstantiatable(container, fullName); } function instantiateFactory(container, normalizedName, fullName, options) { var factoryManager = factoryFor(container, normalizedName, fullName); if (factoryManager === undefined) { return; } // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {} // By default majority of objects fall into this case if (isSingletonInstance(container, fullName, options)) { var instance = container.cache[normalizedName] = factoryManager.create(); // if this lookup happened _during_ destruction (emits a deprecation, but // is still possible) ensure that it gets destroyed if (container.isDestroying) { if (typeof instance.destroy === 'function') { instance.destroy(); } } return instance; } // SomeClass { singleton: false, instantiate: true } if (isFactoryInstance(container, fullName, options)) { return factoryManager.create(); } // SomeClass { singleton: true, instantiate: false } | { instantiate: false } | { singleton: false, instantiation: false } if (isSingletonClass(container, fullName, options) || isFactoryClass(container, fullName, options)) { return factoryManager.class; } throw new Error('Could not create factory'); } function processInjections(container, injections, result) { if (true /* DEBUG */ ) { container.registry.validateInjections(injections); } var hash = result.injections; for (var i = 0; i < injections.length; i++) { var { property, specifier } = injections[i]; hash[property] = lookup(container, specifier); if (!result.isDynamic) { result.isDynamic = !isSingleton(container, specifier); } } } function buildInjections(container, typeInjections, injections) { var injectionsHash = {}; (0, _owner.setOwner)(injectionsHash, container.owner); var result = { injections: injectionsHash, isDynamic: false }; if (typeInjections !== undefined) { processInjections(container, typeInjections, result); } if (injections !== undefined) { processInjections(container, injections, result); } return result; } function injectionsFor(container, fullName) { var registry = container.registry; var [type] = fullName.split(':'); var typeInjections = registry.getTypeInjections(type); var injections = registry.getInjections(fullName); return buildInjections(container, typeInjections, injections); } function destroyDestroyables(container) { 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 (value.destroy) { value.destroy(); } } } function resetCache(container) { container.cache = (0, _utils.dictionary)(null); container.factoryManagerCache = (0, _utils.dictionary)(null); } function resetMember(container, fullName) { var member = container.cache[fullName]; delete container.factoryManagerCache[fullName]; if (member) { delete container.cache[fullName]; if (member.destroy) { member.destroy(); } } } var INIT_FACTORY = (0, _utils.symbol)('INIT_FACTORY'); _exports.INIT_FACTORY = INIT_FACTORY; function getFactoryFor(obj) { return obj[INIT_FACTORY]; } function setFactoryFor(obj, factory) { obj[INIT_FACTORY] = factory; } class FactoryManager { constructor(container, factory, fullName, normalizedName) { this.container = container; this.owner = container.owner; this.class = factory; this.fullName = fullName; this.normalizedName = normalizedName; this.madeToString = undefined; this.injections = undefined; setFactoryFor(this, this); if (isInstantiatable(container, fullName) && (_utils.HAS_NATIVE_SYMBOL || INIT_FACTORY in factory)) { setFactoryFor(factory, this); } } toString() { if (this.madeToString === undefined) { this.madeToString = this.container.registry.makeToString(this.class, this.fullName); } return this.madeToString; } create(options) { var { container } = this; if (container.isDestroyed) { throw new Error(`Can not create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`); } var props = this.injections; if (props === undefined) { var { injections, isDynamic } = injectionsFor(this.container, this.normalizedName); setFactoryFor(injections, this); props = injections; if (!isDynamic) { this.injections = injections; } } if (options !== undefined) { props = (0, _polyfills.assign)({}, props, options); } if (true /* DEBUG */ ) { var lazyInjections; var validationCache = this.container.validationCache; // Ensure that all lazy injections are valid at instantiation time if (!validationCache[this.fullName] && this.class && typeof this.class._lazyInjections === 'function') { lazyInjections = this.class._lazyInjections(); lazyInjections = this.container.registry.normalizeInjectionsHash(lazyInjections); this.container.registry.validateInjections(lazyInjections); } validationCache[this.fullName] = true; (true && !(typeof this.class.create === 'function') && (0, _debug.assert)(`Failed to create an instance of '${this.normalizedName}'. Most likely an improperly defined class or an invalid module export.`, typeof this.class.create === 'function')); } return this.class.create(props); } } 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 */ class Registry { constructor(options = {}) { this.fallback = options.fallback || null; this.resolver = options.resolver || null; this.registrations = (0, _utils.dictionary)(options.registrations || null); this._typeInjections = (0, _utils.dictionary)(null); this._injections = (0, _utils.dictionary)(null); this._localLookupCache = Object.create(null); this._normalizeCache = (0, _utils.dictionary)(null); this._resolveCache = (0, _utils.dictionary)(null); this._failSet = new Set(); this._options = (0, _utils.dictionary)(null); this._typeOptions = (0, _utils.dictionary)(null); } /** A backup registry for resolving registrations when no matches can be found. @private @property fallback @type Registry */ /** An object that has a `resolve` method that resolves a name. @private @property resolver @type Resolver */ /** @private @property registrations @type InheritingDict */ /** @private @property _typeInjections @type InheritingDict */ /** @private @property _injections @type InheritingDict */ /** @private @property _normalizeCache @type InheritingDict */ /** @private @property _resolveCache @type InheritingDict */ /** @private @property _options @type InheritingDict */ /** @private @property _typeOptions @type InheritingDict */ /** Creates a container based on this registry. @private @method container @param {Object} options @return {Container} created container */ container(options) { return new Container(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(fullName, factory, options = {}) { (true && !(this.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.isValidFullName(fullName))); (true && !(factory !== undefined) && (0, _debug.assert)(`Attempting to register an unknown factory: '${fullName}'`, factory !== undefined)); var normalizedName = this.normalize(fullName); (true && !(!this._resolveCache[normalizedName]) && (0, _debug.assert)(`Cannot re-register: '${fullName}', as it has already been resolved.`, !this._resolveCache[normalizedName])); this._failSet.delete(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(fullName) { (true && !(this.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.isValidFullName(fullName))); var normalizedName = this.normalize(fullName); this._localLookupCache = Object.create(null); delete this.registrations[normalizedName]; delete this._resolveCache[normalizedName]; delete this._options[normalizedName]; this._failSet.delete(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(fullName) { var factory = resolve(this, this.normalize(fullName)); if (factory === undefined && this.fallback !== null) { factory = this.fallback.resolve(...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(fullName) { if (this.resolver !== null && this.resolver.lookupDescription) { return this.resolver.lookupDescription(fullName); } else if (this.fallback !== null) { return this.fallback.describe(fullName); } else { return fullName; } } /** A hook to enable custom fullName normalization behavior @private @method normalizeFullName @param {String} fullName @return {string} normalized fullName */ normalizeFullName(fullName) { if (this.resolver !== null && this.resolver.normalize) { return this.resolver.normalize(fullName); } else if (this.fallback !== null) { 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(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(factory, fullName) { var _a; if (this.resolver !== null && this.resolver.makeToString) { return this.resolver.makeToString(factory, fullName); } else if (this.fallback !== null) { return this.fallback.makeToString(factory, fullName); } else { return typeof factory === 'string' ? factory : (_a = factory.name) !== null && _a !== void 0 ? _a : '(unknown class)'; } } /** 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(fullName) { if (!this.isValidFullName(fullName)) { return false; } return has(this, this.normalize(fullName)); } /** 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(type, options) { this._typeOptions[type] = options; } getOptionsForType(type) { var optionsForType = this._typeOptions[type]; if (optionsForType === undefined && this.fallback !== null) { optionsForType = this.fallback.getOptionsForType(type); } return optionsForType; } /** @private @method options @param {String} fullName @param {Object} options */ options(fullName, options) { var normalizedName = this.normalize(fullName); this._options[normalizedName] = options; } getOptions(fullName) { var normalizedName = this.normalize(fullName); var options = this._options[normalizedName]; if (options === undefined && this.fallback !== null) { options = this.fallback.getOptions(fullName); } return options; } getOption(fullName, optionName) { var options = this._options[fullName]; if (options !== undefined && 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 !== null) { return this.fallback.getOption(fullName, optionName); } return undefined; } /** 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(type, property, fullName) { (true && !(this.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.isValidFullName(fullName))); var fullNameType = fullName.split(':')[0]; (true && !(fullNameType !== type) && (0, _debug.assert)(`Cannot inject a '${fullName}' on other ${type}(s).`, fullNameType !== type)); var injections = this._typeInjections[type] || (this._typeInjections[type] = []); injections.push({ property, specifier: 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(fullName, property, injectionName) { (true && !(this.isValidFullName(injectionName)) && (0, _debug.assert)(`Invalid injectionName, expected: 'type:name' got: ${injectionName}`, this.isValidFullName(injectionName))); var normalizedInjectionName = this.normalize(injectionName); if (fullName.indexOf(':') === -1) { return this.typeInjection(fullName, property, normalizedInjectionName); } (true && !(this.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.isValidFullName(fullName))); var normalizedName = this.normalize(fullName); var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []); injections.push({ property, specifier: normalizedInjectionName }); } /** @private @method knownForType @param {String} type the type to iterate over */ knownForType(type) { var localKnown = (0, _utils.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; } } var fallbackKnown, resolverKnown; if (this.fallback !== null) { fallbackKnown = this.fallback.knownForType(type); } if (this.resolver !== null && this.resolver.knownForType) { resolverKnown = this.resolver.knownForType(type); } return (0, _polyfills.assign)({}, fallbackKnown, localKnown, resolverKnown); } isValidFullName(fullName) { return VALID_FULL_NAME_REGEXP.test(fullName); } getInjections(fullName) { var injections = this._injections[fullName]; if (this.fallback !== null) { var fallbackInjections = this.fallback.getInjections(fullName); if (fallbackInjections !== undefined) { injections = injections === undefined ? fallbackInjections : injections.concat(fallbackInjections); } } return injections; } getTypeInjections(type) { var injections = this._typeInjections[type]; if (this.fallback !== null) { var fallbackInjections = this.fallback.getTypeInjections(type); if (fallbackInjections !== undefined) { injections = injections === undefined ? fallbackInjections : injections.concat(fallbackInjections); } } return injections; } } _exports.Registry = Registry; if (true /* DEBUG */ ) { var proto = Registry.prototype; proto.normalizeInjectionsHash = function (hash) { var injections = []; for (var key in hash) { if (Object.prototype.hasOwnProperty.call(hash, key)) { var { specifier } = hash[key]; (true && !(this.isValidFullName(specifier)) && (0, _debug.assert)(`Expected a proper full name, given '${specifier}'`, this.isValidFullName(specifier))); injections.push({ property: key, specifier }); } } return injections; }; proto.validateInjections = function (injections) { if (!injections) { return; } for (var i = 0; i < injections.length; i++) { var { specifier } = injections[i]; (true && !(this.has(specifier)) && (0, _debug.assert)(`Attempting to inject an unknown injection: '${specifier}'`, this.has(specifier))); } }; } function resolve(registry, _normalizedName) { var normalizedName = _normalizedName; var cached = registry._resolveCache[normalizedName]; if (cached !== undefined) { return cached; } if (registry._failSet.has(normalizedName)) { return; } var resolved; if (registry.resolver) { resolved = registry.resolver.resolve(normalizedName); } if (resolved === undefined) { resolved = registry.registrations[normalizedName]; } if (resolved === undefined) { registry._failSet.add(normalizedName); } else { registry._resolveCache[normalizedName] = resolved; } return resolved; } function has(registry, fullName) { return registry.resolve(fullName) !== undefined; } var privateNames = (0, _utils.dictionary)(null); var privateSuffix = `${Math.random()}${Date.now()}`.replace('.', ''); function privatize([fullName]) { var name = privateNames[fullName]; if (name) { return name; } var [type, rawName] = fullName.split(':'); return privateNames[fullName] = (0, _utils.intern)(`${type}:${rawName}-${privateSuffix}`); } /* 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 */ }); define("@ember/-internals/environment/index", ["exports", "@ember/deprecated-features"], function (_exports, _deprecatedFeatures) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.getLookup = getLookup; _exports.setLookup = setLookup; _exports.getENV = getENV; _exports.ENV = _exports.context = _exports.global = void 0; // from lodash to catch fake globals 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 var global$1 = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || typeof mainContext !== 'undefined' && mainContext || // set before strict mode in Ember loader/wrapper new Function('return this')(); // eval outside of strict mode _exports.global = global$1; var context = function (global, Ember) { return Ember === undefined ? { imports: global, exports: global, lookup: global } : { // import jQuery imports: Ember.imports || global, // export Ember exports: Ember.exports || global, // search for Namespaces lookup: Ember.lookup || global }; }(global$1, global$1.Ember); _exports.context = context; function getLookup() { return context.lookup; } function setLookup(value) { context.lookup = value; } /** 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 = { ENABLE_OPTIONAL_FEATURES: false, /** 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 */ EXTEND_PROTOTYPES: { Array: true, Function: true, String: true }, /** 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 */ LOG_STACKTRACE_ON_DEPRECATION: true, /** 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 */ LOG_VERSION: true, RAISE_ON_DEPRECATION: false, STRUCTURED_PROFILE: false, /** Whether to insert a `
` wrapper around the application template. See RFC #280. This is not intended to be set directly, as the implementation may change in the future. Use `@ember/optional-features` instead. @property _APPLICATION_TEMPLATE_WRAPPER @for EmberENV @type Boolean @default true @private */ _APPLICATION_TEMPLATE_WRAPPER: true, /** Whether to use Glimmer Component semantics (as opposed to the classic "Curly" components semantics) for template-only components. See RFC #278. This is not intended to be set directly, as the implementation may change in the future. Use `@ember/optional-features` instead. @property _TEMPLATE_ONLY_GLIMMER_COMPONENTS @for EmberENV @type Boolean @default false @private */ _TEMPLATE_ONLY_GLIMMER_COMPONENTS: false, /** Whether to perform extra bookkeeping needed to make the `captureRenderTree` API work. This has to be set before the ember JavaScript code is evaluated. This is usually done by setting `window.EmberENV = { _DEBUG_RENDER_TREE: true };` before the "vendor" `