(function() { /*! * @overview Ember - JavaScript Application Framework * @copyright Copyright 2011-2019 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.13.2 */ /*globals process */ var define, require, Ember; // Used in @ember/-internals/environment/lib/global.js mainContext = this; // eslint-disable-line no-undef (function() { 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; } 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 = Object.create(null); var seen = Object.create(null); define = function(name, deps, callback) { var value = {}; if (!callback) { value.deps = []; value.callback = deps; } else { value.deps = deps; value.callback = callback; } registry[name] = value; }; require = function(name) { return internalRequire(name, null); }; // setup `require` module require['default'] = require; require.has = function registryHas(moduleName) { return Boolean(registry[moduleName]) || Boolean(registry[moduleName + '/index']); }; require._eak_seen = registry; Ember.__loader = { define: define, require: require, registry: registry, }; } else { define = Ember.__loader.define; require = Ember.__loader.require; } })(); define("@ember/-internals/browser-environment/index", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.hasDOM = _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 ? Boolean(window.chrome) && !window.opera : false; _exports.isChrome = isChrome; var isFirefox = hasDom ? typeof InstallTrigger !== 'undefined' : false; _exports.isFirefox = isFirefox; }); 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 the app is using jQuery. See RFC #294. This is not intended to be set directly, as the implementation may change in the future. Use `@ember/optional-features` instead. @property _JQUERY_INTEGRATION @for EmberENV @type Boolean @default true @private */ _JQUERY_INTEGRATION: true, /** Whether the app defaults to using async observers. This is not intended to be set directly, as the implementation may change in the future. Use `@ember/optional-features` instead. @property _DEFAULT_ASYNC_OBSERVERS @for EmberENV @type Boolean @default false @private */ _DEFAULT_ASYNC_OBSERVERS: false, /** Controls the maximum number of scheduled rerenders without "settling". In general, applications should not need to modify this environment variable, but please open an issue so that we can determine if a better default value is needed. @property _RERENDER_LOOP_LIMIT @for EmberENV @type number @default 1000 @private */ _RERENDER_LOOP_LIMIT: 1000, EMBER_LOAD_HOOKS: {}, FEATURES: {} }; _exports.ENV = ENV; (function (EmberENV) { if (typeof EmberENV !== 'object' || EmberENV === null) return; for (var flag in EmberENV) { if (!EmberENV.hasOwnProperty(flag) || flag === 'EXTEND_PROTOTYPES' || flag === 'EMBER_LOAD_HOOKS') continue; var defaultValue = ENV[flag]; if (defaultValue === true) { ENV[flag] = EmberENV[flag] !== false; } else if (defaultValue === false) { ENV[flag] = EmberENV[flag] === true; } } var EXTEND_PROTOTYPES = EmberENV.EXTEND_PROTOTYPES; if (EXTEND_PROTOTYPES !== undefined) { if (typeof EXTEND_PROTOTYPES === 'object' && EXTEND_PROTOTYPES !== null) { ENV.EXTEND_PROTOTYPES.String = EXTEND_PROTOTYPES.String !== false; if (_deprecatedFeatures.FUNCTION_PROTOTYPE_EXTENSIONS) { ENV.EXTEND_PROTOTYPES.Function = EXTEND_PROTOTYPES.Function !== false; } ENV.EXTEND_PROTOTYPES.Array = EXTEND_PROTOTYPES.Array !== false; } else { var isEnabled = EXTEND_PROTOTYPES !== false; ENV.EXTEND_PROTOTYPES.String = isEnabled; if (_deprecatedFeatures.FUNCTION_PROTOTYPE_EXTENSIONS) { ENV.EXTEND_PROTOTYPES.Function = isEnabled; } ENV.EXTEND_PROTOTYPES.Array = isEnabled; } } // TODO this does not seem to be used by anything, // can we remove it? do we need to deprecate it? var EMBER_LOAD_HOOKS = EmberENV.EMBER_LOAD_HOOKS; if (typeof EMBER_LOAD_HOOKS === 'object' && EMBER_LOAD_HOOKS !== null) { for (var hookName in EMBER_LOAD_HOOKS) { if (!EMBER_LOAD_HOOKS.hasOwnProperty(hookName)) continue; var hooks = EMBER_LOAD_HOOKS[hookName]; if (Array.isArray(hooks)) { ENV.EMBER_LOAD_HOOKS[hookName] = hooks.filter(function (hook) { return typeof hook === 'function'; }); } } } var FEATURES = EmberENV.FEATURES; if (typeof FEATURES === 'object' && FEATURES !== null) { for (var feature in FEATURES) { if (!FEATURES.hasOwnProperty(feature)) continue; ENV.FEATURES[feature] = FEATURES[feature] === true; } } })(global$1.EmberENV || global$1.ENV); function getENV() { return ENV; } }); define("@ember/-internals/utils/index", ["exports", "@ember/polyfills", "@ember/debug"], function (_exports, _polyfills, _debug) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.symbol = symbol; _exports.isInternalSymbol = isInternalSymbol; _exports.dictionary = makeDictionary; _exports.uuid = uuid; _exports.generateGuid = generateGuid; _exports.guidFor = guidFor; _exports.intern = intern; _exports.wrap = wrap; _exports.getObservers = getObservers; _exports.getListeners = getListeners; _exports.setObservers = setObservers; _exports.setListeners = setListeners; _exports.inspect = inspect; _exports.lookupDescriptor = lookupDescriptor; _exports.canInvoke = canInvoke; _exports.tryInvoke = tryInvoke; _exports.makeArray = makeArray; _exports.getName = getName; _exports.setName = setName; _exports.toString = toString; _exports.isProxy = isProxy; _exports.setProxy = setProxy; _exports.isEmberArray = isEmberArray; _exports.setWithMandatorySetter = _exports.teardownMandatorySetter = _exports.setupMandatorySetter = _exports.EMBER_ARRAY = _exports.Cache = _exports.HAS_NATIVE_PROXY = _exports.HAS_NATIVE_SYMBOL = _exports.ROOT = _exports.checkHasSuper = _exports.GUID_KEY = _exports.getOwnPropertyDescriptors = void 0; /** 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; } /** Returns whether Type(value) is Object. Useful for checking whether a value is a valid WeakMap key. Refs: https://tc39.github.io/ecma262/#sec-typeof-operator-runtime-semantics-evaluation https://tc39.github.io/ecma262/#sec-weakmap.prototype.set @private @function isObject */ function isObject(value) { return value !== null && (typeof value === 'object' || typeof value === 'function'); } /** @module @ember/object */ /** 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 */ 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 OBJECT_GUIDS = new WeakMap(); var NON_OBJECT_GUIDS = new Map(); /** 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" + Date.now()); /** 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 `guidFor(obj)`, which return an existing guid if available. @private @method generateGuid @static @for @ember/object/internals @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 */ _exports.GUID_KEY = GUID_KEY; function generateGuid(obj, prefix) { if (prefix === void 0) { prefix = GUID_PREFIX; } var guid = prefix + uuid(); if (isObject(obj)) { OBJECT_GUIDS.set(obj, guid); } return guid; } /** 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, `EmberObject`-based or not. You can also use this method on DOM Element objects. @public @static @method guidFor @for @ember/object/internals @param {Object} obj any object, string, number, Element, or primitive @return {String} the unique guid for this instance. */ function guidFor(value) { var guid; if (isObject(value)) { guid = OBJECT_GUIDS.get(value); if (guid === undefined) { guid = GUID_PREFIX + uuid(); OBJECT_GUIDS.set(value, guid); } } else { guid = NON_OBJECT_GUIDS.get(value); if (guid === undefined) { var type = typeof value; if (type === 'string') { guid = 'st' + uuid(); } else if (type === 'number') { guid = 'nu' + uuid(); } else if (type === 'symbol') { guid = 'sy' + uuid(); } else { guid = '(' + value + ')'; } NON_OBJECT_GUIDS.set(value, guid); } } return guid; } var GENERATED_SYMBOLS = []; function isInternalSymbol(possibleSymbol) { return GENERATED_SYMBOLS.indexOf(possibleSymbol) !== -1; } 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. var id = GUID_KEY + Math.floor(Math.random() * Date.now()); var symbol = intern("__" + debugName + id + "__"); GENERATED_SYMBOLS.push(symbol); return symbol; } // 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 = Object.create(parent); dict['_dict'] = null; delete dict['_dict']; return dict; } var getOwnPropertyDescriptors; if (Object.getOwnPropertyDescriptors !== undefined) { getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors; } else { getOwnPropertyDescriptors = function getOwnPropertyDescriptors(obj) { var descriptors = {}; Object.keys(obj).forEach(function (key) { descriptors[key] = Object.getOwnPropertyDescriptor(obj, key); }); return descriptors; }; } var getOwnPropertyDescriptors$1 = getOwnPropertyDescriptors; _exports.getOwnPropertyDescriptors = getOwnPropertyDescriptors$1; 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; var HAS_SUPER_MAP = new WeakMap(); var ROOT = Object.freeze(function () {}); _exports.ROOT = ROOT; HAS_SUPER_MAP.set(ROOT, false); function hasSuper(func) { var hasSuper = HAS_SUPER_MAP.get(func); if (hasSuper === undefined) { hasSuper = checkHasSuper(func); HAS_SUPER_MAP.set(func, hasSuper); } return hasSuper; } var OBSERVERS_MAP = new WeakMap(); function setObservers(func, observers) { OBSERVERS_MAP.set(func, observers); } function getObservers(func) { return OBSERVERS_MAP.get(func); } var LISTENERS_MAP = new WeakMap(); function setListeners(func, listeners) { if (listeners) { LISTENERS_MAP.set(func, listeners); } } function getListeners(func) { return LISTENERS_MAP.get(func); } var IS_WRAPPED_FUNCTION_SET = new _polyfills._WeakSet(); /** 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 (!IS_WRAPPED_FUNCTION_SET.has(superFunc) && 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; } IS_WRAPPED_FUNCTION_SET.add(superWrapper); setObservers(superWrapper, getObservers(func)); setListeners(superWrapper, getListeners(func)); return superWrapper; } var objectToString = Object.prototype.toString; var functionToString = Function.prototype.toString; var isArray = Array.isArray; var objectKeys = Object.keys; var stringify = JSON.stringify; var LIST_LIMIT = 100; var DEPTH_LIMIT = 4; var SAFE_KEY = /^[\w$]+$/; /** @module @ember/debug */ /** 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 @static @param {Object} obj The object you want to inspect. @return {String} A description of the object @since 1.4.0 @private */ function inspect(obj) { // detect Node util.inspect call inspect(depth: number, opts: object) if (typeof obj === 'number' && arguments.length === 2) { return this; } return inspectValue(obj, 0); } function inspectValue(value, depth, seen) { var valueIsArray = false; switch (typeof value) { case 'undefined': return 'undefined'; case 'object': if (value === null) return 'null'; if (isArray(value)) { valueIsArray = true; break; } // is toString Object.prototype.toString or undefined then traverse if (value.toString === objectToString || value.toString === undefined) { break; } // custom toString return value.toString(); case 'function': return value.toString === functionToString ? value.name ? "[Function:" + value.name + "]" : "[Function]" : value.toString(); case 'string': return stringify(value); case 'symbol': case 'boolean': case 'number': default: return value.toString(); } if (seen === undefined) { seen = new _polyfills._WeakSet(); } else { if (seen.has(value)) return "[Circular]"; } seen.add(value); return valueIsArray ? inspectArray(value, depth + 1, seen) : inspectObject(value, depth + 1, seen); } function inspectKey(key) { return SAFE_KEY.test(key) ? key : stringify(key); } function inspectObject(obj, depth, seen) { if (depth > DEPTH_LIMIT) { return '[Object]'; } var s = '{'; var keys = objectKeys(obj); for (var i = 0; i < keys.length; i++) { s += i === 0 ? ' ' : ', '; if (i >= LIST_LIMIT) { s += "... " + (keys.length - LIST_LIMIT) + " more keys"; break; } var key = keys[i]; s += inspectKey(key) + ': ' + inspectValue(obj[key], depth, seen); } s += ' }'; return s; } function inspectArray(arr, depth, seen) { if (depth > DEPTH_LIMIT) { return '[Array]'; } var s = '['; for (var i = 0; i < arr.length; i++) { s += i === 0 ? ' ' : ', '; if (i >= LIST_LIMIT) { s += "... " + (arr.length - LIST_LIMIT) + " more items"; break; } s += inspectValue(arr[i], depth, seen); } s += ' ]'; return s; } function lookupDescriptor(obj, keyName) { var current = obj; do { var descriptor = Object.getOwnPropertyDescriptor(current, keyName); if (descriptor !== undefined) { return descriptor; } current = Object.getPrototypeOf(current); } while (current !== null); return null; } /** 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 !== null && obj !== undefined && typeof obj[methodName] === 'function'; } /** @module @ember/utils */ /** Checks to see if the `methodName` exists on the `obj`, and if it does, invokes it with the arguments passed. ```javascript import { tryInvoke } from '@ember/utils'; let d = new Date('03/15/2013'); tryInvoke(d, 'getTime'); // 1363320000000 tryInvoke(d, 'setFullYear', [2014]); // 1394856000000 tryInvoke(d, 'noSuchMethod', [2014]); // undefined ``` @method tryInvoke @for @ember/utils @static @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)) { var method = obj[methodName]; return method.apply(obj, args); } } var isArray$1 = Array.isArray; function makeArray(obj) { if (obj === null || obj === undefined) { return []; } return isArray$1(obj) ? obj : [obj]; } var NAMES = new WeakMap(); function setName(obj, name) { if (isObject(obj)) NAMES.set(obj, name); } function getName(obj) { return NAMES.get(obj); } var objectToString$1 = Object.prototype.toString; function isNone(obj) { return obj === null || obj === undefined; } /* A `toString` util function that supports objects without a `toString` method, e.g. an object created with `Object.create(null)`. */ function toString(obj) { if (typeof obj === 'string') { return obj; } if (null === obj) return 'null'; if (undefined === obj) return 'undefined'; if (Array.isArray(obj)) { // Reimplement Array.prototype.join according to spec (22.1.3.13) // Changing ToString(element) with this safe version of ToString. var r = ''; for (var k = 0; k < obj.length; k++) { if (k > 0) { r += ','; } if (!isNone(obj[k])) { r += toString(obj[k]); } } return r; } if (typeof obj.toString === 'function') { return obj.toString(); } return objectToString$1.call(obj); } var HAS_NATIVE_SYMBOL = function () { if (typeof Symbol !== 'function') { return false; } return typeof Symbol() === 'symbol'; }(); _exports.HAS_NATIVE_SYMBOL = HAS_NATIVE_SYMBOL; var HAS_NATIVE_PROXY = typeof Proxy === 'function'; _exports.HAS_NATIVE_PROXY = HAS_NATIVE_PROXY; var PROXIES = new _polyfills._WeakSet(); function isProxy(value) { if (isObject(value)) { return PROXIES.has(value); } return false; } function setProxy(object) { if (isObject(object)) { PROXIES.add(object); } } var Cache = /*#__PURE__*/ function () { function Cache(limit, func, store) { this.limit = limit; this.func = func; this.store = store; this.size = 0; this.misses = 0; this.hits = 0; this.store = store || new Map(); } var _proto = Cache.prototype; _proto.get = function get(key) { if (this.store.has(key)) { this.hits++; return this.store.get(key); } else { this.misses++; return this.set(key, this.func(key)); } }; _proto.set = function set(key, value) { if (this.limit > this.size) { this.size++; this.store.set(key, value); } return value; }; _proto.purge = function purge() { this.store.clear(); this.size = 0; this.hits = 0; this.misses = 0; }; return Cache; }(); _exports.Cache = Cache; var EMBER_ARRAY = symbol('EMBER_ARRAY'); _exports.EMBER_ARRAY = EMBER_ARRAY; function isEmberArray(obj) { return obj && obj[EMBER_ARRAY]; } var setupMandatorySetter; _exports.setupMandatorySetter = setupMandatorySetter; var teardownMandatorySetter; _exports.teardownMandatorySetter = teardownMandatorySetter; var setWithMandatorySetter; _exports.setWithMandatorySetter = setWithMandatorySetter; if (true /* DEBUG */ && true /* EMBER_METAL_TRACKED_PROPERTIES */ ) { var MANDATORY_SETTERS = new WeakMap(); var _propertyIsEnumerable = function _propertyIsEnumerable(obj, key) { return Object.prototype.propertyIsEnumerable.call(obj, key); }; _exports.setupMandatorySetter = setupMandatorySetter = function setupMandatorySetter(obj, keyName) { var desc = lookupDescriptor(obj, keyName) || {}; if (desc.get || desc.set) { // if it has a getter or setter, we can't install the mandatory setter. // native setters are allowed, we have to assume that they will resolve // to tracked properties. return; } if (desc && (!desc.configurable || !desc.writable)) { // if it isn't writable anyways, so we shouldn't provide the setter. // if it isn't configurable, we can't overwrite it anyways. return; } var setters = MANDATORY_SETTERS.get(obj); if (setters === undefined) { setters = {}; MANDATORY_SETTERS.set(obj, setters); } desc.hadOwnProperty = Object.hasOwnProperty.call(obj, keyName); setters[keyName] = desc; Object.defineProperty(obj, keyName, { configurable: true, enumerable: _propertyIsEnumerable(obj, keyName), get: function get() { if (desc.get) { return desc.get.call(this); } else { return desc.value; } }, set: function set(value) { (true && !(false) && (0, _debug.assert)("You attempted to update " + this + "." + String(keyName) + " to \"" + String(value) + "\", but it is being tracked by a tracking context, such as a template, computed property, or observer. In order to make sure the context updates properly, you must invalidate the property when updating it. You can mark the property as `@tracked`, or use `@ember/object#set` to do this.")); } }); }; _exports.teardownMandatorySetter = teardownMandatorySetter = function teardownMandatorySetter(obj, keyName) { var setters = MANDATORY_SETTERS.get(obj); if (setters !== undefined && setters[keyName] !== undefined) { Object.defineProperty(obj, keyName, setters[keyName]); setters[keyName] = undefined; } }; _exports.setWithMandatorySetter = setWithMandatorySetter = function setWithMandatorySetter(obj, keyName, value) { var setters = MANDATORY_SETTERS.get(obj); if (setters !== undefined && setters[keyName] !== undefined) { var setter = setters[keyName]; if (setter.set) { setter.set.call(obj, value); } else { setter.value = value; // If the object didn't have own property before, it would have changed // the enumerability after setting the value the first time. if (!setter.hadOwnProperty) { var desc = lookupDescriptor(obj, keyName); desc.enumerable = true; Object.defineProperty(obj, keyName, desc); } } } else { obj[keyName] = value; } }; } /* This package will be eagerly parsed and should have no dependencies on external packages. It is intended to be used to share utility methods that will be needed by every Ember application (and is **not** a dumping ground of useful utilities). Utility methods that are needed in < 80% of cases should be placed elsewhere (so they can be lazily evaluated / parsed). */ }); define("@ember/canary-features/index", ["exports", "@ember/-internals/environment", "@ember/polyfills"], function (_exports, _environment, _polyfills) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.isEnabled = isEnabled; _exports.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = _exports.EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT = _exports.EMBER_CUSTOM_COMPONENT_ARG_PROXY = _exports.EMBER_GLIMMER_FN_HELPER = _exports.EMBER_NATIVE_DECORATOR_SUPPORT = _exports.EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS = _exports.EMBER_GLIMMER_FORWARD_MODIFIERS_WITH_SPLATTRIBUTES = _exports.EMBER_METAL_TRACKED_PROPERTIES = _exports.EMBER_MODULE_UNIFICATION = _exports.EMBER_IMPROVED_INSTRUMENTATION = _exports.EMBER_LIBRARIES_ISREGISTERED = _exports.FEATURES = _exports.DEFAULT_FEATURES = void 0; /** Set `EmberENV.FEATURES` in your application's `config/environment.js` file to enable canary features in your application. See the [feature flag guide](https://guides.emberjs.com/release/configuring-ember/feature-flags/) for more details. @module @ember/canary-features @public */ var DEFAULT_FEATURES = { EMBER_LIBRARIES_ISREGISTERED: false, EMBER_IMPROVED_INSTRUMENTATION: false, EMBER_MODULE_UNIFICATION: false, EMBER_METAL_TRACKED_PROPERTIES: true, EMBER_GLIMMER_FORWARD_MODIFIERS_WITH_SPLATTRIBUTES: true, EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS: true, EMBER_NATIVE_DECORATOR_SUPPORT: true, EMBER_GLIMMER_FN_HELPER: true, EMBER_CUSTOM_COMPONENT_ARG_PROXY: true, EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT: true, EMBER_GLIMMER_SET_COMPONENT_TEMPLATE: true }; /** The hash of enabled Canary features. Add to this, any canary features before creating your application. @class FEATURES @static @since 1.1.0 @public */ _exports.DEFAULT_FEATURES = DEFAULT_FEATURES; var FEATURES = (0, _polyfills.assign)(DEFAULT_FEATURES, _environment.ENV.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} @since 1.1.0 @public */ _exports.FEATURES = FEATURES; function isEnabled(feature) { var featureValue = FEATURES[feature]; if (featureValue === true || featureValue === false) { return featureValue; } else if (_environment.ENV.ENABLE_OPTIONAL_FEATURES) { return true; } else { return false; } } function featureValue(value) { if (_environment.ENV.ENABLE_OPTIONAL_FEATURES && value === null) { return true; } return value; } var EMBER_LIBRARIES_ISREGISTERED = featureValue(FEATURES.EMBER_LIBRARIES_ISREGISTERED); _exports.EMBER_LIBRARIES_ISREGISTERED = EMBER_LIBRARIES_ISREGISTERED; var EMBER_IMPROVED_INSTRUMENTATION = featureValue(FEATURES.EMBER_IMPROVED_INSTRUMENTATION); _exports.EMBER_IMPROVED_INSTRUMENTATION = EMBER_IMPROVED_INSTRUMENTATION; var EMBER_MODULE_UNIFICATION = featureValue(FEATURES.EMBER_MODULE_UNIFICATION); _exports.EMBER_MODULE_UNIFICATION = EMBER_MODULE_UNIFICATION; var EMBER_METAL_TRACKED_PROPERTIES = featureValue(FEATURES.EMBER_METAL_TRACKED_PROPERTIES); _exports.EMBER_METAL_TRACKED_PROPERTIES = EMBER_METAL_TRACKED_PROPERTIES; var EMBER_GLIMMER_FORWARD_MODIFIERS_WITH_SPLATTRIBUTES = featureValue(FEATURES.EMBER_GLIMMER_FORWARD_MODIFIERS_WITH_SPLATTRIBUTES); _exports.EMBER_GLIMMER_FORWARD_MODIFIERS_WITH_SPLATTRIBUTES = EMBER_GLIMMER_FORWARD_MODIFIERS_WITH_SPLATTRIBUTES; var EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS = featureValue(FEATURES.EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS); _exports.EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS = EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS; var EMBER_NATIVE_DECORATOR_SUPPORT = featureValue(FEATURES.EMBER_NATIVE_DECORATOR_SUPPORT); _exports.EMBER_NATIVE_DECORATOR_SUPPORT = EMBER_NATIVE_DECORATOR_SUPPORT; var EMBER_GLIMMER_FN_HELPER = featureValue(FEATURES.EMBER_GLIMMER_FN_HELPER); _exports.EMBER_GLIMMER_FN_HELPER = EMBER_GLIMMER_FN_HELPER; var EMBER_CUSTOM_COMPONENT_ARG_PROXY = featureValue(FEATURES.EMBER_CUSTOM_COMPONENT_ARG_PROXY); _exports.EMBER_CUSTOM_COMPONENT_ARG_PROXY = EMBER_CUSTOM_COMPONENT_ARG_PROXY; var EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT = featureValue(FEATURES.EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT); _exports.EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT = EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT; var EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = featureValue(FEATURES.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE); _exports.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = EMBER_GLIMMER_SET_COMPONENT_TEMPLATE; }); define("@ember/debug/index", ["exports", "@ember/-internals/browser-environment", "@ember/error", "@ember/debug/lib/deprecate", "@ember/debug/lib/testing", "@ember/debug/lib/warn"], function (_exports, _browserEnvironment, _error, _deprecate2, _testing, _warn2) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); Object.defineProperty(_exports, "registerDeprecationHandler", { enumerable: true, get: function get() { return _deprecate2.registerHandler; } }); Object.defineProperty(_exports, "isTesting", { enumerable: true, get: function get() { return _testing.isTesting; } }); Object.defineProperty(_exports, "setTesting", { enumerable: true, get: function get() { return _testing.setTesting; } }); Object.defineProperty(_exports, "registerWarnHandler", { enumerable: true, get: function get() { return _warn2.registerHandler; } }); _exports._warnIfUsingStrippedFeatureFlags = _exports.getDebugFunction = _exports.setDebugFunction = _exports.deprecateFunc = _exports.runInDebug = _exports.debugFreeze = _exports.debugSeal = _exports.deprecate = _exports.debug = _exports.warn = _exports.info = _exports.assert = void 0; // These are the default production build versions: var noop = function noop() {}; var assert = noop; _exports.assert = assert; var info = noop; _exports.info = info; var warn = noop; _exports.warn = warn; var debug = noop; _exports.debug = debug; var deprecate = noop; _exports.deprecate = deprecate; var debugSeal = noop; _exports.debugSeal = debugSeal; var debugFreeze = noop; _exports.debugFreeze = debugFreeze; var runInDebug = noop; _exports.runInDebug = runInDebug; var setDebugFunction = noop; _exports.setDebugFunction = setDebugFunction; var getDebugFunction = noop; _exports.getDebugFunction = getDebugFunction; var deprecateFunc = function deprecateFunc() { return arguments[arguments.length - 1]; }; _exports.deprecateFunc = deprecateFunc; if (true /* DEBUG */ ) { _exports.setDebugFunction = setDebugFunction = function setDebugFunction(type, callback) { switch (type) { case 'assert': return _exports.assert = assert = callback; case 'info': return _exports.info = info = callback; case 'warn': return _exports.warn = warn = callback; case 'debug': return _exports.debug = debug = callback; case 'deprecate': return _exports.deprecate = deprecate = callback; case 'debugSeal': return _exports.debugSeal = debugSeal = callback; case 'debugFreeze': return _exports.debugFreeze = debugFreeze = callback; case 'runInDebug': return _exports.runInDebug = runInDebug = callback; case 'deprecateFunc': return _exports.deprecateFunc = deprecateFunc = callback; } }; _exports.getDebugFunction = getDebugFunction = function getDebugFunction(type) { switch (type) { case 'assert': return assert; case 'info': return info; case 'warn': return warn; case 'debug': return debug; case 'deprecate': return deprecate; case 'debugSeal': return debugSeal; case 'debugFreeze': return debugFreeze; case 'runInDebug': return runInDebug; case 'deprecateFunc': return deprecateFunc; } }; } /** @module @ember/debug */ if (true /* DEBUG */ ) { /** Verify that a certain expectation is met, or throw a exception otherwise. This is useful for communicating assumptions in the code to other human readers as well as catching bugs that accidentally violates these expectations. Assertions are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. However, because of that, they should not be used for checks that could reasonably fail during normal usage. Furthermore, care should be taken to avoid accidentally relying on side-effects produced from evaluating the condition itself, since the code will not run in production. ```javascript import { assert } from '@ember/debug'; // Test for truthiness assert('Must pass a string', typeof str === 'string'); // Fail unconditionally assert('This code path should never be run'); ``` @method assert @static @for @ember/debug @param {String} description Describes the expectation. This will become the text of the Error thrown if the assertion fails. @param {Boolean} condition Must be truthy for the assertion to pass. If falsy, an exception will be thrown. @public @since 1.0.0 */ setDebugFunction('assert', function assert(desc, test) { if (!test) { throw new _error.default("Assertion Failed: " + desc); } }); /** Display a debug notice. Calls to this function are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. ```javascript import { debug } from '@ember/debug'; debug('I\'m a debug notice!'); ``` @method debug @for @ember/debug @static @param {String} message A debug message to display. @public */ setDebugFunction('debug', function debug(message) { /* eslint-disable no-console */ if (console.debug) { console.debug("DEBUG: " + message); } else { console.log("DEBUG: " + message); } /* eslint-ensable no-console */ }); /** Display an info notice. Calls to this function are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. @method info @private */ setDebugFunction('info', function info() { var _console; (_console = console).info.apply(_console, arguments); /* eslint-disable-line no-console */ }); /** @module @ember/debug @public */ /** Alias an old, deprecated method with its new counterpart. Display a deprecation warning with the provided message and a stack trace (Chrome and Firefox only) when the assigned method is called. Calls to this function are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. ```javascript import { deprecateFunc } from '@ember/debug'; Ember.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod); ``` @method deprecateFunc @static @for @ember/debug @param {String} message A description of the deprecation. @param {Object} [options] The options object for `deprecate`. @param {Function} func The new function called to replace its deprecated counterpart. @return {Function} A new function that wraps the original function with a deprecation warning @private */ setDebugFunction('deprecateFunc', function deprecateFunc() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (args.length === 3) { var message = args[0], options = args[1], func = args[2]; return function () { deprecate(message, false, options); for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return func.apply(this, args); }; } else { var _message = args[0], _func = args[1]; return function () { deprecate(_message); return _func.apply(this, arguments); }; } }); /** @module @ember/debug @public */ /** Run a function meant for debugging. Calls to this function are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. ```javascript import Component from '@ember/component'; import { runInDebug } from '@ember/debug'; runInDebug(() => { Component.reopen({ didInsertElement() { console.log("I'm happy"); } }); }); ``` @method runInDebug @for @ember/debug @static @param {Function} func The function to be executed. @since 1.5.0 @public */ setDebugFunction('runInDebug', function runInDebug(func) { func(); }); setDebugFunction('debugSeal', function debugSeal(obj) { Object.seal(obj); }); setDebugFunction('debugFreeze', function debugFreeze(obj) { // re-freezing an already frozen object introduces a significant // performance penalty on Chrome (tested through 59). // // See: https://bugs.chromium.org/p/v8/issues/detail?id=6450 if (!Object.isFrozen(obj)) { Object.freeze(obj); } }); setDebugFunction('deprecate', _deprecate2.default); setDebugFunction('warn', _warn2.default); } var _warnIfUsingStrippedFeatureFlags; _exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags; if (true /* DEBUG */ && !(0, _testing.isTesting)()) { if (typeof window !== 'undefined' && (_browserEnvironment.isFirefox || _browserEnvironment.isChrome) && window.addEventListener) { window.addEventListener('load', function () { if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) { var downloadURL; if (_browserEnvironment.isChrome) { downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi'; } else if (_browserEnvironment.isFirefox) { downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/'; } debug("For more advanced debugging, install the Ember Inspector from " + downloadURL); } }, false); } } }); define("@ember/debug/lib/deprecate", ["exports", "@ember/-internals/environment", "@ember/debug/index", "@ember/debug/lib/handlers"], function (_exports, _environment, _index, _handlers) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.missingOptionsUntilDeprecation = _exports.missingOptionsIdDeprecation = _exports.missingOptionsDeprecation = _exports.registerHandler = _exports.default = void 0; /** @module @ember/debug @public */ /** Allows for runtime registration of handler functions that override the default deprecation behavior. Deprecations are invoked by calls to [@ember/debug/deprecate](/ember/release/classes/@ember%2Fdebug/methods/deprecate?anchor=deprecate). The following example demonstrates its usage by registering a handler that throws an error if the message contains the word "should", otherwise defers to the default handler. ```javascript import { registerDeprecationHandler } from '@ember/debug'; registerDeprecationHandler((message, options, next) => { if (message.indexOf('should') !== -1) { throw new Error(`Deprecation message with should: ${message}`); } else { // defer to whatever handler was registered before this one next(message, options); } }); ``` The handler function takes the following arguments: @public @static @method registerDeprecationHandler @for @ember/debug @param handler {Function} A function to handle deprecation calls. @since 2.1.0 */ var registerHandler = function registerHandler() {}; _exports.registerHandler = registerHandler; var missingOptionsDeprecation; _exports.missingOptionsDeprecation = missingOptionsDeprecation; var missingOptionsIdDeprecation; _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; var missingOptionsUntilDeprecation; _exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation; var deprecate = function deprecate() {}; if (true /* DEBUG */ ) { _exports.registerHandler = registerHandler = function registerHandler(handler) { (0, _handlers.registerHandler)('deprecate', handler); }; var formatMessage = function formatMessage(_message, options) { var message = _message; if (options && options.id) { message = message + (" [deprecation id: " + options.id + "]"); } if (options && options.url) { message += " See " + options.url + " for more details."; } return message; }; registerHandler(function logDeprecationToConsole(message, options) { var updatedMessage = formatMessage(message, options); console.warn("DEPRECATION: " + updatedMessage); // eslint-disable-line no-console }); var captureErrorForStack; if (new Error().stack) { captureErrorForStack = function captureErrorForStack() { return new Error(); }; } else { captureErrorForStack = function captureErrorForStack() { try { __fail__.fail(); } catch (e) { return e; } }; } registerHandler(function logDeprecationStackTrace(message, options, next) { if (_environment.ENV.LOG_STACKTRACE_ON_DEPRECATION) { var stackStr = ''; var error = captureErrorForStack(); var stack; if (error.stack) { if (error['arguments']) { // Chrome stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n'); stack.shift(); } else { // Firefox stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n'); } stackStr = "\n " + stack.slice(2).join('\n '); } var updatedMessage = formatMessage(message, options); console.warn("DEPRECATION: " + updatedMessage + stackStr); // eslint-disable-line no-console } else { next(message, options); } }); registerHandler(function raiseOnDeprecation(message, options, next) { if (_environment.ENV.RAISE_ON_DEPRECATION) { var updatedMessage = formatMessage(message); throw new Error(updatedMessage); } else { next(message, options); } }); _exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.'; _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `deprecate` you must provide `id` in options.'; _exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation = 'When calling `deprecate` you must provide `until` in options.'; /** @module @ember/debug @public */ /** Display a deprecation warning with the provided message and a stack trace (Chrome and Firefox only). * In a production build, this method is defined as an empty function (NOP). Uses of this method in Ember itself are stripped from the ember.prod.js build. @method deprecate @for @ember/debug @param {String} message A description of the deprecation. @param {Boolean} test A boolean. If falsy, the deprecation will be displayed. @param {Object} options @param {String} options.id A unique id for this deprecation. The id can be used by Ember debugging tools to change the behavior (raise, log or silence) for that specific deprecation. The id should be namespaced by dots, e.g. "view.helper.select". @param {string} options.until The version of Ember when this deprecation warning will be removed. @param {String} [options.url] An optional url to the transition guide on the emberjs.com website. @static @public @since 1.0.0 */ deprecate = function deprecate(message, test, options) { (0, _index.assert)(missingOptionsDeprecation, Boolean(options && (options.id || options.until))); (0, _index.assert)(missingOptionsIdDeprecation, Boolean(options.id)); (0, _index.assert)(missingOptionsUntilDeprecation, Boolean(options.until)); (0, _handlers.invoke)('deprecate', message, test, options); }; } var _default = deprecate; _exports.default = _default; }); define("@ember/debug/lib/handlers", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.invoke = _exports.registerHandler = _exports.HANDLERS = void 0; var HANDLERS = {}; _exports.HANDLERS = HANDLERS; var registerHandler = function registerHandler() {}; _exports.registerHandler = registerHandler; var invoke = function invoke() {}; _exports.invoke = invoke; if (true /* DEBUG */ ) { _exports.registerHandler = registerHandler = function registerHandler(type, callback) { var nextHandler = HANDLERS[type] || function () {}; HANDLERS[type] = function (message, options) { callback(message, options, nextHandler); }; }; _exports.invoke = invoke = function invoke(type, message, test, options) { if (test) { return; } var handlerForType = HANDLERS[type]; if (handlerForType) { handlerForType(message, options); } }; } }); define("@ember/debug/lib/testing", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.isTesting = isTesting; _exports.setTesting = setTesting; var testing = false; function isTesting() { return testing; } function setTesting(value) { testing = Boolean(value); } }); define("@ember/debug/lib/warn", ["exports", "@ember/debug/index", "@ember/debug/lib/handlers"], function (_exports, _index, _handlers) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.missingOptionsDeprecation = _exports.missingOptionsIdDeprecation = _exports.registerHandler = _exports.default = void 0; var registerHandler = function registerHandler() {}; _exports.registerHandler = registerHandler; var warn = function warn() {}; var missingOptionsDeprecation; _exports.missingOptionsDeprecation = missingOptionsDeprecation; var missingOptionsIdDeprecation; /** @module @ember/debug */ _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; if (true /* DEBUG */ ) { /** Allows for runtime registration of handler functions that override the default warning behavior. Warnings are invoked by calls made to [@ember/debug/warn](/ember/release/classes/@ember%2Fdebug/methods/warn?anchor=warn). The following example demonstrates its usage by registering a handler that does nothing overriding Ember's default warning behavior. ```javascript import { registerWarnHandler } from '@ember/debug'; // next is not called, so no warnings get the default behavior registerWarnHandler(() => {}); ``` The handler function takes the following arguments: @public @static @method registerWarnHandler @for @ember/debug @param handler {Function} A function to handle warnings. @since 2.1.0 */ _exports.registerHandler = registerHandler = function registerHandler(handler) { (0, _handlers.registerHandler)('warn', handler); }; registerHandler(function logWarning(message) { /* eslint-disable no-console */ console.warn("WARNING: " + message); /* eslint-enable no-console */ }); _exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.'; _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `warn` you must provide `id` in options.'; /** Display a warning with the provided message. * In a production build, this method is defined as an empty function (NOP). Uses of this method in Ember itself are stripped from the ember.prod.js build. ```javascript import { warn } from '@ember/debug'; import tomsterCount from './tomster-counter'; // a module in my project // Log a warning if we have more than 3 tomsters warn('Too many tomsters!', tomsterCount <= 3, { id: 'ember-debug.too-many-tomsters' }); ``` @method warn @for @ember/debug @static @param {String} message A warning to display. @param {Boolean} test An optional boolean. If falsy, the warning will be displayed. @param {Object} options An object that can be used to pass a unique `id` for this warning. The `id` can be used by Ember debugging tools to change the behavior (raise, log, or silence) for that specific warning. The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" @public @since 1.0.0 */ warn = function warn(message, test, options) { if (arguments.length === 2 && typeof test === 'object') { options = test; test = false; } (0, _index.assert)(missingOptionsDeprecation, Boolean(options)); (0, _index.assert)(missingOptionsIdDeprecation, Boolean(options && options.id)); (0, _handlers.invoke)('warn', message, test, options); }; } var _default = warn; _exports.default = _default; }); define("@ember/deprecated-features/index", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.MOUSE_ENTER_LEAVE_MOVE_EVENTS = _exports.FUNCTION_PROTOTYPE_EXTENSIONS = _exports.APP_CTRL_ROUTER_PROPS = _exports.ALIAS_METHOD = _exports.JQUERY_INTEGRATION = _exports.COMPONENT_MANAGER_STRING_LOOKUP = _exports.ROUTER_EVENTS = _exports.MERGE = _exports.LOGGER = _exports.EMBER_EXTEND_PROTOTYPES = _exports.SEND_ACTION = void 0; /* eslint-disable no-implicit-coercion */ // These versions should be the version that the deprecation was _introduced_, // not the version that the feature will be removed. var SEND_ACTION = !!'3.4.0'; _exports.SEND_ACTION = SEND_ACTION; var EMBER_EXTEND_PROTOTYPES = !!'3.2.0-beta.5'; _exports.EMBER_EXTEND_PROTOTYPES = EMBER_EXTEND_PROTOTYPES; var LOGGER = !!'3.2.0-beta.1'; _exports.LOGGER = LOGGER; var MERGE = !!'3.6.0-beta.1'; _exports.MERGE = MERGE; var ROUTER_EVENTS = !!'4.0.0'; _exports.ROUTER_EVENTS = ROUTER_EVENTS; var COMPONENT_MANAGER_STRING_LOOKUP = !!'3.8.0'; _exports.COMPONENT_MANAGER_STRING_LOOKUP = COMPONENT_MANAGER_STRING_LOOKUP; var JQUERY_INTEGRATION = !!'3.9.0'; _exports.JQUERY_INTEGRATION = JQUERY_INTEGRATION; var ALIAS_METHOD = !!'3.9.0'; _exports.ALIAS_METHOD = ALIAS_METHOD; var APP_CTRL_ROUTER_PROPS = !!'3.10.0-beta.1'; _exports.APP_CTRL_ROUTER_PROPS = APP_CTRL_ROUTER_PROPS; var FUNCTION_PROTOTYPE_EXTENSIONS = !!'3.11.0-beta.1'; _exports.FUNCTION_PROTOTYPE_EXTENSIONS = FUNCTION_PROTOTYPE_EXTENSIONS; var MOUSE_ENTER_LEAVE_MOVE_EVENTS = !!'3.13.0-beta.1'; _exports.MOUSE_ENTER_LEAVE_MOVE_EVENTS = MOUSE_ENTER_LEAVE_MOVE_EVENTS; }); define("@ember/error/index", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; /** @module @ember/error */ /** The JavaScript Error object used by Ember.assert. @class Error @namespace Ember @extends Error @constructor @public */ var _default = Error; _exports.default = _default; }); define("@ember/polyfills/index", ["exports", "@ember/deprecated-features", "@ember/polyfills/lib/merge", "@ember/polyfills/lib/assign", "@ember/polyfills/lib/weak_set"], function (_exports, _deprecatedFeatures, _merge, _assign, _weak_set) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); Object.defineProperty(_exports, "assign", { enumerable: true, get: function get() { return _assign.default; } }); Object.defineProperty(_exports, "assignPolyfill", { enumerable: true, get: function get() { return _assign.assign; } }); Object.defineProperty(_exports, "_WeakSet", { enumerable: true, get: function get() { return _weak_set.default; } }); _exports.merge = void 0; var merge = _deprecatedFeatures.MERGE ? _merge.default : undefined; // Export `assignPolyfill` for testing _exports.merge = merge; }); define("@ember/polyfills/lib/assign", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.assign = assign; _exports.default = void 0; /** @module @ember/polyfills */ /** Copy properties from a source object to a target object. Source arguments remain unchanged. ```javascript import { assign } from '@ember/polyfills'; var a = { first: 'Yehuda' }; var b = { last: 'Katz' }; var c = { company: 'Other Company' }; var d = { company: 'Tilde Inc.' }; assign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' }; ``` @method assign @for @ember/polyfills @param {Object} target The object to assign into @param {Object} ...args The objects to copy properties from @return {Object} @public @static */ function assign(target) { for (var i = 1; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) { continue; } var updates = Object.keys(arg); for (var _i = 0; _i < updates.length; _i++) { var prop = updates[_i]; target[prop] = arg[prop]; } } return target; } // Note: We use the bracket notation so // that the babel plugin does not // transform it. // https://www.npmjs.com/package/babel-plugin-transform-object-assign var _assign = Object.assign; var _default = _assign || assign; _exports.default = _default; }); define("@ember/polyfills/lib/merge", ["exports", "@ember/debug"], function (_exports, _debug) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = merge; /** Merge the contents of two objects together into the first object. ```javascript import { merge } from '@ember/polyfills'; merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } var a = { first: 'Yehuda' }; var b = { last: 'Katz' }; merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } ``` @method merge @static @for @ember/polyfills @param {Object} original The object to merge into @param {Object} updates The object to copy properties from @return {Object} @deprecated @public */ function merge(original, updates) { (true && !(false) && (0, _debug.deprecate)('Use of `merge` has been deprecated. Please use `assign` instead.', false, { id: 'ember-polyfills.deprecate-merge', until: '4.0.0', url: 'https://emberjs.com/deprecations/v3.x/#toc_ember-polyfills-deprecate-merge' })); if (updates === null || typeof updates !== 'object') { return original; } var props = Object.keys(updates); var prop; for (var i = 0; i < props.length; i++) { prop = props[i]; original[prop] = updates[prop]; } return original; } }); define("@ember/polyfills/lib/weak_set", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; /* globals WeakSet */ var _default = typeof WeakSet === 'function' ? WeakSet : /*#__PURE__*/ function () { function WeakSetPolyFill() { this._map = new WeakMap(); } var _proto = WeakSetPolyFill.prototype; _proto.add = function add(val) { this._map.set(val, true); return this; }; _proto.delete = function _delete(val) { return this._map.delete(val); }; _proto.has = function has(val) { return this._map.has(val); }; return WeakSetPolyFill; }(); _exports.default = _default; }); define("@glimmer/compiler", ["exports", "ember-babel", "node-module", "@glimmer/util", "@glimmer/wire-format", "@glimmer/syntax"], function (_exports, _emberBabel, _nodeModule, _util, _wireFormat, _syntax) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.precompile = precompile; _exports.TemplateVisitor = _exports.TemplateCompiler = _exports.defaultId = void 0; var SymbolTable = /*#__PURE__*/ function () { function SymbolTable() {} SymbolTable.top = function top() { return new ProgramSymbolTable(); }; var _proto = SymbolTable.prototype; _proto.child = function child(locals) { var _this = this; var symbols = locals.map(function (name) { return _this.allocate(name); }); return new BlockSymbolTable(this, locals, symbols); }; return SymbolTable; }(); var ProgramSymbolTable = /*#__PURE__*/ function (_SymbolTable) { (0, _emberBabel.inheritsLoose)(ProgramSymbolTable, _SymbolTable); function ProgramSymbolTable() { var _this2; _this2 = _SymbolTable.apply(this, arguments) || this; _this2.symbols = []; _this2.size = 1; _this2.named = (0, _util.dict)(); _this2.blocks = (0, _util.dict)(); return _this2; } var _proto2 = ProgramSymbolTable.prototype; _proto2.has = function has(_name) { return false; }; _proto2.get = function get(_name) { throw (0, _util.unreachable)(); }; _proto2.getLocalsMap = function getLocalsMap() { return {}; }; _proto2.getEvalInfo = function getEvalInfo() { return []; }; _proto2.allocateNamed = function allocateNamed(name) { var named = this.named[name]; if (!named) { named = this.named[name] = this.allocate(name); } return named; }; _proto2.allocateBlock = function allocateBlock(name) { var block = this.blocks[name]; if (!block) { block = this.blocks[name] = this.allocate("&" + name); } return block; }; _proto2.allocate = function allocate(identifier) { this.symbols.push(identifier); return this.size++; }; return ProgramSymbolTable; }(SymbolTable); var BlockSymbolTable = /*#__PURE__*/ function (_SymbolTable2) { (0, _emberBabel.inheritsLoose)(BlockSymbolTable, _SymbolTable2); function BlockSymbolTable(parent, symbols, slots) { var _this3; _this3 = _SymbolTable2.call(this) || this; _this3.parent = parent; _this3.symbols = symbols; _this3.slots = slots; return _this3; } var _proto3 = BlockSymbolTable.prototype; _proto3.has = function has(name) { return this.symbols.indexOf(name) !== -1 || this.parent.has(name); }; _proto3.get = function get(name) { var slot = this.symbols.indexOf(name); return slot === -1 ? this.parent.get(name) : this.slots[slot]; }; _proto3.getLocalsMap = function getLocalsMap() { var _this4 = this; var dict$$1 = this.parent.getLocalsMap(); this.symbols.forEach(function (symbol) { return dict$$1[symbol] = _this4.get(symbol); }); return dict$$1; }; _proto3.getEvalInfo = function getEvalInfo() { var locals = this.getLocalsMap(); return Object.keys(locals).map(function (symbol) { return locals[symbol]; }); }; _proto3.allocateNamed = function allocateNamed(name) { return this.parent.allocateNamed(name); }; _proto3.allocateBlock = function allocateBlock(name) { return this.parent.allocateBlock(name); }; _proto3.allocate = function allocate(identifier) { return this.parent.allocate(identifier); }; return BlockSymbolTable; }(SymbolTable); /** * Takes in an AST and outputs a list of actions to be consumed * by a compiler. For example, the template * * foo{{bar}}
baz
* * produces the actions * * [['startProgram', [programNode, 0]], * ['text', [textNode, 0, 3]], * ['mustache', [mustacheNode, 1, 3]], * ['openElement', [elementNode, 2, 3, 0]], * ['text', [textNode, 0, 1]], * ['closeElement', [elementNode, 2, 3], * ['endProgram', [programNode]]] * * This visitor walks the AST depth first and backwards. As * a result the bottom-most child template will appear at the * top of the actions list whereas the root template will appear * at the bottom of the list. For example, * *
{{#if}}foo{{else}}bar{{/if}}
* * produces the actions * * [['startProgram', [programNode, 0]], * ['text', [textNode, 0, 2, 0]], * ['openElement', [elementNode, 1, 2, 0]], * ['closeElement', [elementNode, 1, 2]], * ['endProgram', [programNode]], * ['startProgram', [programNode, 0]], * ['text', [textNode, 0, 1]], * ['endProgram', [programNode]], * ['startProgram', [programNode, 2]], * ['openElement', [elementNode, 0, 1, 1]], * ['block', [blockNode, 0, 1]], * ['closeElement', [elementNode, 0, 1]], * ['endProgram', [programNode]]] * * The state of the traversal is maintained by a stack of frames. * Whenever a node with children is entered (either a ProgramNode * or an ElementNode) a frame is pushed onto the stack. The frame * contains information about the state of the traversal of that * node. For example, * * - index of the current child node being visited * - the number of mustaches contained within its child nodes * - the list of actions generated by its child nodes */ var Frame = function Frame() { this.parentNode = null; this.children = null; this.childIndex = null; this.childCount = null; this.childTemplateCount = 0; this.mustacheCount = 0; this.actions = []; this.blankChildTextNodes = null; this.symbols = null; }; var TemplateVisitor = /*#__PURE__*/ function () { function TemplateVisitor() { this.frameStack = []; this.actions = []; this.programDepth = -1; } var _proto4 = TemplateVisitor.prototype; _proto4.visit = function visit(node) { this[node.type](node); } // Traversal methods ; _proto4.Program = function Program(program) { var _this$actions; this.programDepth++; var parentFrame = this.getCurrentFrame(); var programFrame = this.pushFrame(); if (!parentFrame) { program['symbols'] = SymbolTable.top(); } else { program['symbols'] = parentFrame.symbols.child(program.blockParams); } var startType, endType; if (this.programDepth === 0) { startType = 'startProgram'; endType = 'endProgram'; } else { startType = 'startBlock'; endType = 'endBlock'; } programFrame.parentNode = program; programFrame.children = program.body; programFrame.childCount = program.body.length; programFrame.blankChildTextNodes = []; programFrame.actions.push([endType, [program, this.programDepth]]); programFrame.symbols = program['symbols']; for (var i = program.body.length - 1; i >= 0; i--) { programFrame.childIndex = i; this.visit(program.body[i]); } programFrame.actions.push([startType, [program, programFrame.childTemplateCount, programFrame.blankChildTextNodes.reverse()]]); this.popFrame(); this.programDepth--; // Push the completed template into the global actions list if (parentFrame) { parentFrame.childTemplateCount++; } (_this$actions = this.actions).push.apply(_this$actions, programFrame.actions.reverse()); }; _proto4.ElementNode = function ElementNode(element) { var _parentFrame$actions; var parentFrame = this.currentFrame; var elementFrame = this.pushFrame(); elementFrame.parentNode = element; elementFrame.children = element.children; elementFrame.childCount = element.children.length; elementFrame.mustacheCount += element.modifiers.length; elementFrame.blankChildTextNodes = []; elementFrame.symbols = element['symbols'] = parentFrame.symbols.child(element.blockParams); var actionArgs = [element, parentFrame.childIndex, parentFrame.childCount]; elementFrame.actions.push(['closeElement', actionArgs]); for (var i = element.attributes.length - 1; i >= 0; i--) { this.visit(element.attributes[i]); } for (var _i = element.children.length - 1; _i >= 0; _i--) { elementFrame.childIndex = _i; this.visit(element.children[_i]); } var open = ['openElement', [].concat(actionArgs, [elementFrame.mustacheCount, elementFrame.blankChildTextNodes.reverse()])]; elementFrame.actions.push(open); this.popFrame(); // Propagate the element's frame state to the parent frame if (elementFrame.mustacheCount > 0) { parentFrame.mustacheCount++; } parentFrame.childTemplateCount += elementFrame.childTemplateCount; (_parentFrame$actions = parentFrame.actions).push.apply(_parentFrame$actions, elementFrame.actions); }; _proto4.AttrNode = function AttrNode(attr) { if (attr.value.type !== 'TextNode') { this.currentFrame.mustacheCount++; } }; _proto4.TextNode = function TextNode(text) { var frame = this.currentFrame; if (text.chars === '') { frame.blankChildTextNodes.push(domIndexOf(frame.children, text)); } frame.actions.push(['text', [text, frame.childIndex, frame.childCount]]); }; _proto4.BlockStatement = function BlockStatement(node) { var frame = this.currentFrame; frame.mustacheCount++; frame.actions.push(['block', [node, frame.childIndex, frame.childCount]]); if (node.inverse) { this.visit(node.inverse); } if (node.program) { this.visit(node.program); } }; _proto4.PartialStatement = function PartialStatement(node) { var frame = this.currentFrame; frame.mustacheCount++; frame.actions.push(['mustache', [node, frame.childIndex, frame.childCount]]); }; _proto4.CommentStatement = function CommentStatement(text) { var frame = this.currentFrame; frame.actions.push(['comment', [text, frame.childIndex, frame.childCount]]); }; _proto4.MustacheCommentStatement = function MustacheCommentStatement() {// Intentional empty: Handlebars comments should not affect output. }; _proto4.MustacheStatement = function MustacheStatement(mustache) { var frame = this.currentFrame; frame.mustacheCount++; frame.actions.push(['mustache', [mustache, frame.childIndex, frame.childCount]]); } // Frame helpers ; _proto4.getCurrentFrame = function getCurrentFrame() { return this.frameStack[this.frameStack.length - 1]; }; _proto4.pushFrame = function pushFrame() { var frame = new Frame(); this.frameStack.push(frame); return frame; }; _proto4.popFrame = function popFrame() { return this.frameStack.pop(); }; (0, _emberBabel.createClass)(TemplateVisitor, [{ key: "currentFrame", get: function get() { return this.getCurrentFrame(); } }]); return TemplateVisitor; }(); // Returns the index of `domNode` in the `nodes` array, skipping // over any nodes which do not represent DOM nodes. _exports.TemplateVisitor = TemplateVisitor; function domIndexOf(nodes, domNode) { var index = -1; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (node.type !== 'TextNode' && node.type !== 'ElementNode') { continue; } else { index++; } if (node === domNode) { return index; } } return -1; } var Block = /*#__PURE__*/ function () { function Block() { this.statements = []; } var _proto5 = Block.prototype; _proto5.push = function push(statement) { this.statements.push(statement); }; return Block; }(); var InlineBlock = /*#__PURE__*/ function (_Block) { (0, _emberBabel.inheritsLoose)(InlineBlock, _Block); function InlineBlock(table) { var _this5; _this5 = _Block.call(this) || this; _this5.table = table; return _this5; } var _proto6 = InlineBlock.prototype; _proto6.toJSON = function toJSON() { return { statements: this.statements, parameters: this.table.slots }; }; return InlineBlock; }(Block); var TemplateBlock = /*#__PURE__*/ function (_Block2) { (0, _emberBabel.inheritsLoose)(TemplateBlock, _Block2); function TemplateBlock(symbolTable) { var _this6; _this6 = _Block2.call(this) || this; _this6.symbolTable = symbolTable; _this6.type = 'template'; _this6.yields = new _util.DictSet(); _this6.named = new _util.DictSet(); _this6.blocks = []; _this6.hasEval = false; return _this6; } var _proto7 = TemplateBlock.prototype; _proto7.push = function push(statement) { this.statements.push(statement); }; _proto7.toJSON = function toJSON() { return { symbols: this.symbolTable.symbols, statements: this.statements, hasEval: this.hasEval }; }; return TemplateBlock; }(Block); var ComponentBlock = /*#__PURE__*/ function (_Block3) { (0, _emberBabel.inheritsLoose)(ComponentBlock, _Block3); function ComponentBlock(tag, table, selfClosing) { var _this7; _this7 = _Block3.call(this) || this; _this7.tag = tag; _this7.table = table; _this7.selfClosing = selfClosing; _this7.attributes = []; _this7.arguments = []; _this7.inParams = true; _this7.positionals = []; return _this7; } var _proto8 = ComponentBlock.prototype; _proto8.push = function push(statement) { if (this.inParams) { if ((0, _wireFormat.isFlushElement)(statement)) { this.inParams = false; } else if ((0, _wireFormat.isArgument)(statement)) { this.arguments.push(statement); } else if ((0, _wireFormat.isAttribute)(statement)) { this.attributes.push(statement); } else { throw new Error('Compile Error: only parameters allowed before flush-element'); } } else { this.statements.push(statement); } }; _proto8.toJSON = function toJSON() { var args = this.arguments; var keys = args.map(function (arg) { return arg[1]; }); var values = args.map(function (arg) { return arg[2]; }); var block = this.selfClosing ? null : { statements: this.statements, parameters: this.table.slots }; return [this.tag, this.attributes, [keys, values], block]; }; return ComponentBlock; }(Block); var Template = /*#__PURE__*/ function () { function Template(symbols) { this.block = new TemplateBlock(symbols); } var _proto9 = Template.prototype; _proto9.toJSON = function toJSON() { return this.block.toJSON(); }; return Template; }(); var JavaScriptCompiler = /*#__PURE__*/ function () { function JavaScriptCompiler(opcodes, symbols, options) { this.blocks = new _util.Stack(); this.values = []; this.opcodes = opcodes; this.template = new Template(symbols); this.options = options; } JavaScriptCompiler.process = function process(opcodes, symbols, options) { var compiler = new JavaScriptCompiler(opcodes, symbols, options); return compiler.process(); }; var _proto10 = JavaScriptCompiler.prototype; _proto10.process = function process() { var _this8 = this; this.opcodes.forEach(function (op) { var opcode = op[0]; var arg = op[1]; if (!_this8[opcode]) { throw new Error("unimplemented " + opcode + " on JavaScriptCompiler"); } _this8[opcode](arg); }); return this.template; } /// Nesting ; _proto10.startBlock = function startBlock(program) { var block = new InlineBlock(program['symbols']); this.blocks.push(block); }; _proto10.endBlock = function endBlock() { var template = this.template, blocks = this.blocks; var block = blocks.pop(); template.block.blocks.push(block.toJSON()); }; _proto10.startProgram = function startProgram() { this.blocks.push(this.template.block); }; _proto10.endProgram = function endProgram() {} /// Statements ; _proto10.text = function text(content) { this.push([_wireFormat.Ops.Text, content]); }; _proto10.append = function append(trusted) { this.push([_wireFormat.Ops.Append, this.popValue(), trusted]); }; _proto10.comment = function comment(value) { this.push([_wireFormat.Ops.Comment, value]); }; _proto10.modifier = function modifier(name) { var params = this.popValue(); var hash = this.popValue(); this.push([_wireFormat.Ops.Modifier, name, params, hash]); }; _proto10.block = function block(_ref) { var name = _ref[0], template = _ref[1], inverse = _ref[2]; var params = this.popValue(); var hash = this.popValue(); var blocks = this.template.block.blocks; this.push([_wireFormat.Ops.Block, name, params, hash, blocks[template], blocks[inverse]]); }; _proto10.openComponent = function openComponent(element) { var tag = this.options && this.options.customizeComponentName ? this.options.customizeComponentName(element.tag) : element.tag; var component = new ComponentBlock(tag, element['symbols'], element.selfClosing); this.blocks.push(component); }; _proto10.openElement = function openElement(_ref2) { var element = _ref2[0], simple = _ref2[1]; var tag = element.tag; if (element.blockParams.length > 0) { throw new Error("Compile Error: <" + element.tag + "> is not a component and doesn't support block parameters"); } else { this.push([_wireFormat.Ops.OpenElement, tag, simple]); } }; _proto10.flushElement = function flushElement() { this.push([_wireFormat.Ops.FlushElement]); }; _proto10.closeComponent = function closeComponent(_element) { var _this$endComponent = this.endComponent(), tag = _this$endComponent[0], attrs = _this$endComponent[1], args = _this$endComponent[2], block = _this$endComponent[3]; this.push([_wireFormat.Ops.Component, tag, attrs, args, block]); }; _proto10.closeDynamicComponent = function closeDynamicComponent(_element) { var _this$endComponent2 = this.endComponent(), attrs = _this$endComponent2[1], args = _this$endComponent2[2], block = _this$endComponent2[3]; this.push([_wireFormat.Ops.DynamicComponent, this.popValue(), attrs, args, block]); }; _proto10.closeElement = function closeElement(_element) { this.push([_wireFormat.Ops.CloseElement]); }; _proto10.staticAttr = function staticAttr(_ref3) { var name = _ref3[0], namespace = _ref3[1]; var value = this.popValue(); this.push([_wireFormat.Ops.StaticAttr, name, value, namespace]); }; _proto10.dynamicAttr = function dynamicAttr(_ref4) { var name = _ref4[0], namespace = _ref4[1]; var value = this.popValue(); this.push([_wireFormat.Ops.DynamicAttr, name, value, namespace]); }; _proto10.componentAttr = function componentAttr(_ref5) { var name = _ref5[0], namespace = _ref5[1]; var value = this.popValue(); this.push([_wireFormat.Ops.ComponentAttr, name, value, namespace]); }; _proto10.trustingAttr = function trustingAttr(_ref6) { var name = _ref6[0], namespace = _ref6[1]; var value = this.popValue(); this.push([_wireFormat.Ops.TrustingAttr, name, value, namespace]); }; _proto10.trustingComponentAttr = function trustingComponentAttr(_ref7) { var name = _ref7[0], namespace = _ref7[1]; var value = this.popValue(); this.push([_wireFormat.Ops.TrustingComponentAttr, name, value, namespace]); }; _proto10.staticArg = function staticArg(name) { var value = this.popValue(); this.push([_wireFormat.Ops.StaticArg, name, value]); }; _proto10.dynamicArg = function dynamicArg(name) { var value = this.popValue(); this.push([_wireFormat.Ops.DynamicArg, name, value]); }; _proto10.yield = function _yield(to) { var params = this.popValue(); this.push([_wireFormat.Ops.Yield, to, params]); }; _proto10.attrSplat = function attrSplat(to) { // consume (and disregard) the value pushed for the // ...attributes attribute this.popValue(); this.push([_wireFormat.Ops.AttrSplat, to]); }; _proto10.debugger = function _debugger(evalInfo) { this.push([_wireFormat.Ops.Debugger, evalInfo]); this.template.block.hasEval = true; }; _proto10.hasBlock = function hasBlock(name) { this.pushValue([_wireFormat.Ops.HasBlock, name]); }; _proto10.hasBlockParams = function hasBlockParams(name) { this.pushValue([_wireFormat.Ops.HasBlockParams, name]); }; _proto10.partial = function partial(evalInfo) { var params = this.popValue(); this.push([_wireFormat.Ops.Partial, params[0], evalInfo]); this.template.block.hasEval = true; } /// Expressions ; _proto10.literal = function literal(value) { if (value === undefined) { this.pushValue([_wireFormat.Ops.Undefined]); } else { this.pushValue(value); } }; _proto10.unknown = function unknown(name) { this.pushValue([_wireFormat.Ops.Unknown, name]); }; _proto10.get = function get(_ref8) { var head = _ref8[0], path = _ref8[1]; this.pushValue([_wireFormat.Ops.Get, head, path]); }; _proto10.maybeLocal = function maybeLocal(path) { this.pushValue([_wireFormat.Ops.MaybeLocal, path]); }; _proto10.concat = function concat() { this.pushValue([_wireFormat.Ops.Concat, this.popValue()]); }; _proto10.helper = function helper(name) { var params = this.popValue(); var hash = this.popValue(); this.pushValue([_wireFormat.Ops.Helper, name, params, hash]); } /// Stack Management Opcodes ; _proto10.prepareArray = function prepareArray(size) { var values = []; for (var i = 0; i < size; i++) { values.push(this.popValue()); } this.pushValue(values); }; _proto10.prepareObject = function prepareObject(size) { var keys = new Array(size); var values = new Array(size); for (var i = 0; i < size; i++) { keys[i] = this.popValue(); values[i] = this.popValue(); } this.pushValue([keys, values]); } /// Utilities ; _proto10.endComponent = function endComponent() { var component = this.blocks.pop(); return component.toJSON(); }; _proto10.push = function push(args) { while (args[args.length - 1] === null) { args.pop(); } this.currentBlock.push(args); }; _proto10.pushValue = function pushValue(val) { this.values.push(val); }; _proto10.popValue = function popValue() { return this.values.pop(); }; (0, _emberBabel.createClass)(JavaScriptCompiler, [{ key: "currentBlock", get: function get() { return this.blocks.current; } }]); return JavaScriptCompiler; }(); // 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. 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; } var SymbolAllocator = /*#__PURE__*/ function () { function SymbolAllocator(ops) { this.ops = ops; this.symbolStack = new _util.Stack(); } var _proto11 = SymbolAllocator.prototype; _proto11.process = function process() { var out = []; var ops = this.ops; for (var i = 0; i < ops.length; i++) { var op = ops[i]; var result = this.dispatch(op); if (result === undefined) { out.push(op); } else { out.push(result); } } return out; }; _proto11.dispatch = function dispatch(op) { var name = op[0]; var operand = op[1]; return this[name](operand); }; _proto11.startProgram = function startProgram(op) { this.symbolStack.push(op['symbols']); }; _proto11.endProgram = function endProgram(_op) { this.symbolStack.pop(); }; _proto11.startBlock = function startBlock(op) { this.symbolStack.push(op['symbols']); }; _proto11.endBlock = function endBlock(_op) { this.symbolStack.pop(); }; _proto11.flushElement = function flushElement(op) { this.symbolStack.push(op['symbols']); }; _proto11.closeElement = function closeElement(_op) { this.symbolStack.pop(); }; _proto11.closeComponent = function closeComponent(_op) { this.symbolStack.pop(); }; _proto11.closeDynamicComponent = function closeDynamicComponent(_op) { this.symbolStack.pop(); }; _proto11.attrSplat = function attrSplat(_op) { return ['attrSplat', this.symbols.allocateBlock('attrs')]; }; _proto11.get = function get(op) { var name = op[0], rest = op[1]; if (name === 0) { return ['get', [0, rest]]; } if (isLocal(name, this.symbols)) { var head = this.symbols.get(name); return ['get', [head, rest]]; } else if (name[0] === '@') { var _head = this.symbols.allocateNamed(name); return ['get', [_head, rest]]; } else { return ['maybeLocal', [name].concat(rest)]; } }; _proto11.maybeGet = function maybeGet(op) { var name = op[0], rest = op[1]; if (name === 0) { return ['get', [0, rest]]; } if (isLocal(name, this.symbols)) { var head = this.symbols.get(name); return ['get', [head, rest]]; } else if (name[0] === '@') { var _head2 = this.symbols.allocateNamed(name); return ['get', [_head2, rest]]; } else if (rest.length === 0) { return ['unknown', name]; } else { return ['maybeLocal', [name].concat(rest)]; } }; _proto11.yield = function _yield(op) { if (op === 0) { throw new Error('Cannot yield to this'); } return ['yield', this.symbols.allocateBlock(op)]; }; _proto11.debugger = function _debugger(_op) { return ['debugger', this.symbols.getEvalInfo()]; }; _proto11.hasBlock = function hasBlock(op) { if (op === 0) { throw new Error('Cannot hasBlock this'); } return ['hasBlock', this.symbols.allocateBlock(op)]; }; _proto11.hasBlockParams = function hasBlockParams(op) { if (op === 0) { throw new Error('Cannot hasBlockParams this'); } return ['hasBlockParams', this.symbols.allocateBlock(op)]; }; _proto11.partial = function partial(_op) { return ['partial', this.symbols.getEvalInfo()]; }; _proto11.text = function text(_op) {}; _proto11.comment = function comment(_op) {}; _proto11.openComponent = function openComponent(_op) {}; _proto11.openElement = function openElement(_op) {}; _proto11.staticArg = function staticArg(_op) {}; _proto11.dynamicArg = function dynamicArg(_op) {}; _proto11.staticAttr = function staticAttr(_op) {}; _proto11.trustingAttr = function trustingAttr(_op) {}; _proto11.trustingComponentAttr = function trustingComponentAttr(_op) {}; _proto11.dynamicAttr = function dynamicAttr(_op) {}; _proto11.componentAttr = function componentAttr(_op) {}; _proto11.modifier = function modifier(_op) {}; _proto11.append = function append(_op) {}; _proto11.block = function block(_op) {}; _proto11.literal = function literal(_op) {}; _proto11.helper = function helper(_op) {}; _proto11.unknown = function unknown(_op) {}; _proto11.maybeLocal = function maybeLocal(_op) {}; _proto11.prepareArray = function prepareArray(_op) {}; _proto11.prepareObject = function prepareObject(_op) {}; _proto11.concat = function concat(_op) {}; (0, _emberBabel.createClass)(SymbolAllocator, [{ key: "symbols", get: function get() { return this.symbolStack.current; } }]); return SymbolAllocator; }(); function isLocal(name, symbols) { return symbols && symbols.has(name); } function isTrustedValue(value) { return value.escaped !== undefined && !value.escaped; } var TemplateCompiler = /*#__PURE__*/ function () { function TemplateCompiler() { this.templateId = 0; this.templateIds = []; this.opcodes = []; this.includeMeta = false; } TemplateCompiler.compile = function compile(ast, options) { var templateVisitor = new TemplateVisitor(); templateVisitor.visit(ast); var compiler = new TemplateCompiler(); var opcodes = compiler.process(templateVisitor.actions); var symbols = new SymbolAllocator(opcodes).process(); return JavaScriptCompiler.process(symbols, ast['symbols'], options); }; var _proto12 = TemplateCompiler.prototype; _proto12.process = function process(actions) { var _this9 = this; actions.forEach(function (_ref9) { var name = _ref9[0], args = _ref9.slice(1); if (!_this9[name]) { throw new Error("Unimplemented " + name + " on TemplateCompiler"); } _this9[name].apply(_this9, args); }); return this.opcodes; }; _proto12.startProgram = function startProgram(_ref10) { var program = _ref10[0]; this.opcode(['startProgram', program], program); }; _proto12.endProgram = function endProgram() { this.opcode(['endProgram', null], null); }; _proto12.startBlock = function startBlock(_ref11) { var program = _ref11[0]; this.templateId++; this.opcode(['startBlock', program], program); }; _proto12.endBlock = function endBlock() { this.templateIds.push(this.templateId - 1); this.opcode(['endBlock', null], null); }; _proto12.text = function text(_ref12) { var action = _ref12[0]; this.opcode(['text', action.chars], action); }; _proto12.comment = function comment(_ref13) { var action = _ref13[0]; this.opcode(['comment', action.value], action); }; _proto12.openElement = function openElement(_ref14) { var action = _ref14[0]; var attributes = action.attributes; var simple = true; for (var i = 0; i < attributes.length; i++) { var attr = attributes[i]; if (attr.name === '...attributes') { simple = false; break; } } if (action.modifiers.length > 0) { simple = false; } var actionIsComponent = false; if (isDynamicComponent(action)) { var head, rest; var _action$tag$split = action.tag.split('.'); head = _action$tag$split[0]; rest = _action$tag$split.slice(1); if (head === 'this') { head = 0; } this.opcode(['get', [head, rest]]); this.opcode(['openComponent', action], action); actionIsComponent = true; } else if (isComponent(action)) { this.opcode(['openComponent', action], action); actionIsComponent = true; } else { this.opcode(['openElement', [action, simple]], action); } var typeAttr = null; var attrs = action.attributes; for (var _i2 = 0; _i2 < attrs.length; _i2++) { if (attrs[_i2].name === 'type') { typeAttr = attrs[_i2]; continue; } this.attribute([attrs[_i2]], !simple || actionIsComponent); } if (typeAttr) { this.attribute([typeAttr], !simple || actionIsComponent); } for (var _i3 = 0; _i3 < action.modifiers.length; _i3++) { this.modifier([action.modifiers[_i3]]); } this.opcode(['flushElement', action], null); }; _proto12.closeElement = function closeElement(_ref15) { var action = _ref15[0]; if (isDynamicComponent(action)) { this.opcode(['closeDynamicComponent', action], action); } else if (isComponent(action)) { this.opcode(['closeComponent', action], action); } else { this.opcode(['closeElement', action], action); } }; _proto12.attribute = function attribute(_ref16, isComponent) { var action = _ref16[0]; var name = action.name, value = action.value; var namespace = getAttrNamespace(name); var isStatic = this.prepareAttributeValue(value); if (name.charAt(0) === '@') { // Arguments if (isStatic) { this.opcode(['staticArg', name], action); } else if (action.value.type === 'MustacheStatement') { this.opcode(['dynamicArg', name], action); } else { this.opcode(['dynamicArg', name], action); } } else { var isTrusting = isTrustedValue(value); if (isStatic && name === '...attributes') { this.opcode(['attrSplat', null], action); } else if (isStatic && !isComponent) { this.opcode(['staticAttr', [name, namespace]], action); } else if (isTrusting) { this.opcode([isComponent ? 'trustingComponentAttr' : 'trustingAttr', [name, namespace]], action); } else if (action.value.type === 'MustacheStatement') { this.opcode([isComponent ? 'componentAttr' : 'dynamicAttr', [name, null]], action); } else { this.opcode([isComponent ? 'componentAttr' : 'dynamicAttr', [name, namespace]], action); } } }; _proto12.modifier = function modifier(_ref17) { var action = _ref17[0]; assertIsSimplePath(action.path, action.loc, 'modifier'); var parts = action.path.parts; this.prepareHelper(action); this.opcode(['modifier', parts[0]], action); }; _proto12.mustache = function mustache(_ref18) { var action = _ref18[0]; var path = action.path; if ((0, _syntax.isLiteral)(path)) { this.mustacheExpression(action); this.opcode(['append', !action.escaped], action); } else if (isYield(path)) { var to = assertValidYield(action); this.yield(to, action); } else if (isPartial(path)) { var params = assertValidPartial(action); this.partial(params, action); } else if (isDebugger(path)) { assertValidDebuggerUsage(action); this.debugger('debugger', action); } else { this.mustacheExpression(action); this.opcode(['append', !action.escaped], action); } }; _proto12.block = function block(_ref19) { var action /*, index, count*/ = _ref19[0]; this.prepareHelper(action); var templateId = this.templateIds.pop(); var inverseId = action.inverse === null ? null : this.templateIds.pop(); this.opcode(['block', [action.path.parts[0], templateId, inverseId]], action); } /// Internal actions, not found in the original processed actions ; _proto12.arg = function arg(_ref20) { var path = _ref20[0]; var _path$parts = path.parts, head = _path$parts[0], rest = _path$parts.slice(1); this.opcode(['get', ["@" + head, rest]], path); }; _proto12.mustacheExpression = function mustacheExpression(expr) { var path = expr.path; if ((0, _syntax.isLiteral)(path)) { this.opcode(['literal', path.value], expr); } else if (isBuiltInHelper(path)) { this.builtInHelper(expr); } else if (isArg(path)) { this.arg([path]); } else if (isHelperInvocation(expr)) { this.prepareHelper(expr); this.opcode(['helper', path.parts[0]], expr); } else if (path.this) { this.opcode(['get', [0, path.parts]], expr); } else { var _path$parts2 = path.parts, head = _path$parts2[0], parts = _path$parts2.slice(1); this.opcode(['maybeGet', [head, parts]], expr); } // } else if (isLocal(path, this.symbols)) { // let [head, ...parts] = path.parts; // this.opcode(['get', [head, parts]], expr); // } else if (isSimplePath(path)) { // this.opcode(['unknown', path.parts[0]], expr); // } else { // this.opcode(['maybeLocal', path.parts], expr); // } } /// Internal Syntax ; _proto12.yield = function _yield(to, action) { this.prepareParams(action.params); this.opcode(['yield', to], action); }; _proto12.debugger = function _debugger(_name, action) { this.opcode(['debugger', null], action); }; _proto12.hasBlock = function hasBlock(name, action) { this.opcode(['hasBlock', name], action); }; _proto12.hasBlockParams = function hasBlockParams(name, action) { this.opcode(['hasBlockParams', name], action); }; _proto12.partial = function partial(_params, action) { this.prepareParams(action.params); this.opcode(['partial', null], action); }; _proto12.builtInHelper = function builtInHelper(expr) { var path = expr.path; if (isHasBlock(path)) { var name = assertValidHasBlockUsage(expr.path.original, expr); this.hasBlock(name, expr); } else if (isHasBlockParams(path)) { var _name2 = assertValidHasBlockUsage(expr.path.original, expr); this.hasBlockParams(_name2, expr); } } /// Expressions, invoked recursively from prepareParams and prepareHash ; _proto12.SubExpression = function SubExpression(expr) { if (isBuiltInHelper(expr.path)) { this.builtInHelper(expr); } else { this.prepareHelper(expr); this.opcode(['helper', expr.path.parts[0]], expr); } }; _proto12.PathExpression = function PathExpression(expr) { if (expr.data) { this.arg([expr]); } else { var _expr$parts = expr.parts, head = _expr$parts[0], rest = _expr$parts.slice(1); if (expr.this) { this.opcode(['get', [0, expr.parts]], expr); } else { this.opcode(['get', [head, rest]], expr); } } }; _proto12.StringLiteral = function StringLiteral(action) { this.opcode(['literal', action.value], action); }; _proto12.BooleanLiteral = function BooleanLiteral(action) { this.opcode(['literal', action.value], action); }; _proto12.NumberLiteral = function NumberLiteral(action) { this.opcode(['literal', action.value], action); }; _proto12.NullLiteral = function NullLiteral(action) { this.opcode(['literal', action.value], action); }; _proto12.UndefinedLiteral = function UndefinedLiteral(action) { this.opcode(['literal', action.value], action); } /// Utilities ; _proto12.opcode = function opcode(_opcode, action) { if (action === void 0) { action = null; } // TODO: This doesn't really work if (this.includeMeta && action) { _opcode.push(this.meta(action)); } this.opcodes.push(_opcode); }; _proto12.prepareHelper = function prepareHelper(expr) { assertIsSimplePath(expr.path, expr.loc, 'helper'); var params = expr.params, hash = expr.hash; this.prepareHash(hash); this.prepareParams(params); }; _proto12.prepareParams = function prepareParams(params) { if (!params.length) { this.opcode(['literal', null], null); return; } for (var i = params.length - 1; i >= 0; i--) { var param = params[i]; this[param.type](param); } this.opcode(['prepareArray', params.length], null); }; _proto12.prepareHash = function prepareHash(hash) { var pairs = hash.pairs; if (!pairs.length) { this.opcode(['literal', null], null); return; } for (var i = pairs.length - 1; i >= 0; i--) { var _pairs$i = pairs[i], key = _pairs$i.key, value = _pairs$i.value; this[value.type](value); this.opcode(['literal', key], null); } this.opcode(['prepareObject', pairs.length], null); }; _proto12.prepareAttributeValue = function prepareAttributeValue(value) { // returns the static value if the value is static switch (value.type) { case 'TextNode': this.opcode(['literal', value.chars], value); return true; case 'MustacheStatement': this.attributeMustache([value]); return false; case 'ConcatStatement': this.prepareConcatParts(value.parts); this.opcode(['concat', null], value); return false; } }; _proto12.prepareConcatParts = function prepareConcatParts(parts) { for (var i = parts.length - 1; i >= 0; i--) { var part = parts[i]; if (part.type === 'MustacheStatement') { this.attributeMustache([part]); } else if (part.type === 'TextNode') { this.opcode(['literal', part.chars], null); } } this.opcode(['prepareArray', parts.length], null); }; _proto12.attributeMustache = function attributeMustache(_ref21) { var action = _ref21[0]; this.mustacheExpression(action); }; _proto12.meta = function meta(node) { var loc = node.loc; if (!loc) { return []; } var source = loc.source, start = loc.start, end = loc.end; return ['loc', [source || null, [start.line, start.column], [end.line, end.column]]]; }; return TemplateCompiler; }(); _exports.TemplateCompiler = TemplateCompiler; function isHelperInvocation(mustache) { return mustache.params && mustache.params.length > 0 || mustache.hash && mustache.hash.pairs.length > 0; } function isSimplePath(_ref22) { var parts = _ref22.parts; return parts.length === 1; } function isYield(path) { return path.original === 'yield'; } function isPartial(path) { return path.original === 'partial'; } function isDebugger(path) { return path.original === 'debugger'; } function isHasBlock(path) { return path.original === 'has-block'; } function isHasBlockParams(path) { return path.original === 'has-block-params'; } function isBuiltInHelper(path) { return isHasBlock(path) || isHasBlockParams(path); } function isArg(path) { return !!path['data']; } function isDynamicComponent(element) { var open = element.tag.charAt(0); var _element$tag$split = element.tag.split('.'), maybeLocal = _element$tag$split[0]; var isNamedArgument = open === '@'; var isLocal = element['symbols'].has(maybeLocal); var isThisPath = element.tag.indexOf('this.') === 0; return isLocal || isNamedArgument || isThisPath; } function isComponent(element) { var open = element.tag.charAt(0); var isPath = element.tag.indexOf('.') > -1; var isUpperCase = open === open.toUpperCase() && open !== open.toLowerCase(); return isUpperCase && !isPath || isDynamicComponent(element); } function assertIsSimplePath(path, loc, context) { if (!isSimplePath(path)) { throw new _syntax.SyntaxError("`" + path.original + "` is not a valid name for a " + context + " on line " + loc.start.line + ".", path.loc); } } function assertValidYield(statement) { var pairs = statement.hash.pairs; if (pairs.length === 1 && pairs[0].key !== 'to' || pairs.length > 1) { throw new _syntax.SyntaxError("yield only takes a single named argument: 'to'", statement.loc); } else if (pairs.length === 1 && pairs[0].value.type !== 'StringLiteral') { throw new _syntax.SyntaxError("you can only yield to a literal value", statement.loc); } else if (pairs.length === 0) { return 'default'; } else { return pairs[0].value.value; } } function assertValidPartial(statement) { var params = statement.params, hash = statement.hash, escaped = statement.escaped, loc = statement.loc; if (params && params.length !== 1) { throw new _syntax.SyntaxError("Partial found with no arguments. You must specify a template name. (on line " + loc.start.line + ")", statement.loc); } else if (hash && hash.pairs.length > 0) { throw new _syntax.SyntaxError("partial does not take any named arguments (on line " + loc.start.line + ")", statement.loc); } else if (!escaped) { throw new _syntax.SyntaxError("{{{partial ...}}} is not supported, please use {{partial ...}} instead (on line " + loc.start.line + ")", statement.loc); } return params; } function assertValidHasBlockUsage(type, call) { var params = call.params, hash = call.hash, loc = call.loc; if (hash && hash.pairs.length > 0) { throw new _syntax.SyntaxError(type + " does not take any named arguments", call.loc); } if (params.length === 0) { return 'default'; } else if (params.length === 1) { var param = params[0]; if (param.type === 'StringLiteral') { return param.value; } else { throw new _syntax.SyntaxError("you can only yield to a literal value (on line " + loc.start.line + ")", call.loc); } } else { throw new _syntax.SyntaxError(type + " only takes a single positional argument (on line " + loc.start.line + ")", call.loc); } } function assertValidDebuggerUsage(statement) { var params = statement.params, hash = statement.hash; if (hash && hash.pairs.length > 0) { throw new _syntax.SyntaxError("debugger does not take any named arguments", statement.loc); } if (params.length === 0) { return 'default'; } else { throw new _syntax.SyntaxError("debugger does not take any positional arguments", statement.loc); } } var defaultId = function () { if (typeof _nodeModule.require === 'function') { try { /* tslint:disable:no-require-imports */ var crypto = (0, _nodeModule.require)('crypto'); /* tslint:enable:no-require-imports */ var idFn = function idFn(src) { var hash = crypto.createHash('sha1'); hash.update(src, 'utf8'); // trim to 6 bytes of data (2^48 - 1) return hash.digest('base64').substring(0, 8); }; idFn('test'); return idFn; } catch (e) {} } return function idFn() { return null; }; }(); _exports.defaultId = defaultId; var defaultOptions = { id: defaultId, meta: {} }; function precompile(string, options) { if (options === void 0) { options = defaultOptions; } var ast = (0, _syntax.preprocess)(string, options); var _options = options, meta = _options.meta; var _TemplateCompiler$com = TemplateCompiler.compile(ast, options), block = _TemplateCompiler$com.block; var idFn = options.id || defaultId; var blockJSON = JSON.stringify(block.toJSON()); var templateJSONObject = { id: idFn(JSON.stringify(meta) + blockJSON), block: blockJSON, meta: meta }; // JSON is javascript return JSON.stringify(templateJSONObject); } }); define("@glimmer/syntax", ["exports", "ember-babel", "simple-html-tokenizer", "@glimmer/util", "handlebars"], function (_exports, _emberBabel, _simpleHtmlTokenizer, _util, _handlebars) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.preprocess = preprocess; _exports.cannotRemoveNode = cannotRemoveNode; _exports.cannotReplaceNode = cannotReplaceNode; _exports.cannotReplaceOrRemoveInKeyHandlerYet = cannotReplaceOrRemoveInKeyHandlerYet; _exports.traverse = traverse; _exports.print = build; _exports.isLiteral = isLiteral; _exports.printLiteral = printLiteral; _exports.SyntaxError = _exports.Walker = _exports.TraversalError = _exports.builders = _exports.AST = void 0; function buildMustache(path, params, hash, raw, loc) { if (typeof path === 'string') { path = buildPath(path); } return { type: 'MustacheStatement', path: path, params: params || [], hash: hash || buildHash([]), escaped: !raw, loc: buildLoc(loc || null) }; } function buildBlock(path, params, hash, program, inverse, loc) { return { type: 'BlockStatement', path: buildPath(path), params: params || [], hash: hash || buildHash([]), program: program || null, inverse: inverse || null, loc: buildLoc(loc || null) }; } function buildElementModifier(path, params, hash, loc) { return { type: 'ElementModifierStatement', path: buildPath(path), params: params || [], hash: hash || buildHash([]), loc: buildLoc(loc || null) }; } function buildPartial(name, params, hash, indent, loc) { return { type: 'PartialStatement', name: name, params: params || [], hash: hash || buildHash([]), indent: indent || '', strip: { open: false, close: false }, loc: buildLoc(loc || null) }; } function buildComment(value, loc) { return { type: 'CommentStatement', value: value, loc: buildLoc(loc || null) }; } function buildMustacheComment(value, loc) { return { type: 'MustacheCommentStatement', value: value, loc: buildLoc(loc || null) }; } function buildConcat(parts, loc) { return { type: 'ConcatStatement', parts: parts || [], loc: buildLoc(loc || null) }; } function buildElement(tag, attributes, modifiers, children, comments, blockParams, loc) { // this is used for backwards compat prior to `blockParams` being added to the AST if (Array.isArray(comments)) { if (isBlockParms(comments)) { blockParams = comments; comments = []; } else if (isLoc(blockParams)) { loc = blockParams; blockParams = []; } } else if (isLoc(comments)) { // this is used for backwards compat prior to `comments` being added to the AST loc = comments; comments = []; } else if (isLoc(blockParams)) { loc = blockParams; blockParams = []; } // this is used for backwards compat, prior to `selfClosing` being part of the ElementNode AST var selfClosing = false; if (typeof tag === 'object') { selfClosing = tag.selfClosing; tag = tag.name; } return { type: 'ElementNode', tag: tag || '', selfClosing: selfClosing, attributes: attributes || [], blockParams: blockParams || [], modifiers: modifiers || [], comments: comments || [], children: children || [], loc: buildLoc(loc || null) }; } function buildAttr(name, value, loc) { return { type: 'AttrNode', name: name, value: value, loc: buildLoc(loc || null) }; } function buildText(chars, loc) { return { type: 'TextNode', chars: chars || '', loc: buildLoc(loc || null) }; } // Expressions function buildSexpr(path, params, hash, loc) { return { type: 'SubExpression', path: buildPath(path), params: params || [], hash: hash || buildHash([]), loc: buildLoc(loc || null) }; } function buildPath(original, loc) { if (typeof original !== 'string') return original; var parts = original.split('.'); var thisHead = false; if (parts[0] === 'this') { thisHead = true; parts = parts.slice(1); } return { type: 'PathExpression', original: original, this: thisHead, parts: parts, data: false, loc: buildLoc(loc || null) }; } function buildLiteral(type, value, loc) { return { type: type, value: value, original: value, loc: buildLoc(loc || null) }; } // Miscellaneous function buildHash(pairs, loc) { return { type: 'Hash', pairs: pairs || [], loc: buildLoc(loc || null) }; } function buildPair(key, value, loc) { return { type: 'HashPair', key: key, value: value, loc: buildLoc(loc || null) }; } function buildProgram(body, blockParams, loc) { return { type: 'Program', body: body || [], blockParams: blockParams || [], loc: buildLoc(loc || null) }; } function buildSource(source) { return source || null; } function buildPosition(line, column) { return { line: line, column: column }; } var SYNTHETIC = { source: '(synthetic)', start: { line: 1, column: 0 }, end: { line: 1, column: 0 } }; function buildLoc() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (args.length === 1) { var loc = args[0]; if (loc && typeof loc === 'object') { return { source: buildSource(loc.source), start: buildPosition(loc.start.line, loc.start.column), end: buildPosition(loc.end.line, loc.end.column) }; } else { return SYNTHETIC; } } else { var startLine = args[0], startColumn = args[1], endLine = args[2], endColumn = args[3], source = args[4]; return { source: buildSource(source), start: buildPosition(startLine, startColumn), end: buildPosition(endLine, endColumn) }; } } function isBlockParms(arr) { return arr[0] === 'string'; } function isLoc(item) { return !Array.isArray(item); } var b = { mustache: buildMustache, block: buildBlock, partial: buildPartial, comment: buildComment, mustacheComment: buildMustacheComment, element: buildElement, elementModifier: buildElementModifier, attr: buildAttr, text: buildText, sexpr: buildSexpr, path: buildPath, concat: buildConcat, hash: buildHash, pair: buildPair, literal: buildLiteral, program: buildProgram, loc: buildLoc, pos: buildPosition, string: literal('StringLiteral'), boolean: literal('BooleanLiteral'), number: literal('NumberLiteral'), undefined: function (_undefined) { function undefined() { return _undefined.apply(this, arguments); } undefined.toString = function () { return _undefined.toString(); }; return undefined; }(function () { return buildLiteral('UndefinedLiteral', undefined); }), null: function _null() { return buildLiteral('NullLiteral', null); } }; _exports.builders = b; function literal(type) { return function (value) { return buildLiteral(type, value); }; } /** * Subclass of `Error` with additional information * about location of incorrect markup. */ var SyntaxError = function () { SyntaxError.prototype = Object.create(Error.prototype); SyntaxError.prototype.constructor = SyntaxError; function SyntaxError(message, location) { var error = Error.call(this, message); this.message = message; this.stack = error.stack; this.location = location; } return SyntaxError; }(); // Regex to validate the identifier for block parameters. // Based on the ID validation regex in Handlebars. _exports.SyntaxError = SyntaxError; var ID_INVERSE_PATTERN = /[!"#%-,\.\/;->@\[-\^`\{-~]/; // Checks the element's attributes to see if it uses block params. // If it does, registers the block params with the program and // removes the corresponding attributes from the element. function parseElementBlockParams(element) { var params = parseBlockParams(element); if (params) element.blockParams = params; } function parseBlockParams(element) { var l = element.attributes.length; var attrNames = []; for (var i = 0; i < l; i++) { attrNames.push(element.attributes[i].name); } var asIndex = attrNames.indexOf('as'); if (asIndex !== -1 && l > asIndex && attrNames[asIndex + 1].charAt(0) === '|') { // Some basic validation, since we're doing the parsing ourselves var paramsString = attrNames.slice(asIndex).join(' '); if (paramsString.charAt(paramsString.length - 1) !== '|' || paramsString.match(/\|/g).length !== 2) { throw new SyntaxError("Invalid block parameters syntax: '" + paramsString + "'", element.loc); } var params = []; for (var _i = asIndex + 1; _i < l; _i++) { var param = attrNames[_i].replace(/\|/g, ''); if (param !== '') { if (ID_INVERSE_PATTERN.test(param)) { throw new SyntaxError("Invalid identifier for block parameters: '" + param + "' in '" + paramsString + "'", element.loc); } params.push(param); } } if (params.length === 0) { throw new SyntaxError("Cannot use zero block parameters: '" + paramsString + "'", element.loc); } element.attributes = element.attributes.slice(0, asIndex); return params; } return null; } function childrenFor(node) { switch (node.type) { case 'Program': return node.body; case 'ElementNode': return node.children; } } function appendChild(parent, node) { childrenFor(parent).push(node); } function isLiteral(path) { return path.type === 'StringLiteral' || path.type === 'BooleanLiteral' || path.type === 'NumberLiteral' || path.type === 'NullLiteral' || path.type === 'UndefinedLiteral'; } function printLiteral(literal) { if (literal.type === 'UndefinedLiteral') { return 'undefined'; } else { return JSON.stringify(literal.value); } } var entityParser = new _simpleHtmlTokenizer.EntityParser(_simpleHtmlTokenizer.HTML5NamedCharRefs); var Parser = /*#__PURE__*/ function () { function Parser(source) { this.elementStack = []; this.currentAttribute = null; this.currentNode = null; this.tokenizer = new _simpleHtmlTokenizer.EventedTokenizer(this, entityParser); this.source = source.split(/(?:\r\n?|\n)/g); } var _proto = Parser.prototype; _proto.acceptNode = function acceptNode(node) { return this[node.type](node); }; _proto.currentElement = function currentElement() { return this.elementStack[this.elementStack.length - 1]; }; _proto.sourceForNode = function sourceForNode(node, endNode) { var firstLine = node.loc.start.line - 1; var currentLine = firstLine - 1; var firstColumn = node.loc.start.column; var string = []; var line; var lastLine; var lastColumn; if (endNode) { lastLine = endNode.loc.end.line - 1; lastColumn = endNode.loc.end.column; } else { lastLine = node.loc.end.line - 1; lastColumn = node.loc.end.column; } while (currentLine < lastLine) { currentLine++; line = this.source[currentLine]; if (currentLine === firstLine) { if (firstLine === lastLine) { string.push(line.slice(firstColumn, lastColumn)); } else { string.push(line.slice(firstColumn)); } } else if (currentLine === lastLine) { string.push(line.slice(0, lastColumn)); } else { string.push(line); } } return string.join('\n'); }; (0, _emberBabel.createClass)(Parser, [{ key: "currentAttr", get: function get() { return this.currentAttribute; } }, { key: "currentTag", get: function get() { var node = this.currentNode; return node; } }, { key: "currentStartTag", get: function get() { var node = this.currentNode; return node; } }, { key: "currentEndTag", get: function get() { var node = this.currentNode; return node; } }, { key: "currentComment", get: function get() { var node = this.currentNode; return node; } }, { key: "currentData", get: function get() { var node = this.currentNode; return node; } }]); return Parser; }(); var HandlebarsNodeVisitors = /*#__PURE__*/ function (_Parser) { (0, _emberBabel.inheritsLoose)(HandlebarsNodeVisitors, _Parser); function HandlebarsNodeVisitors() { var _this; _this = _Parser.apply(this, arguments) || this; _this.cursorCount = 0; return _this; } var _proto2 = HandlebarsNodeVisitors.prototype; _proto2.cursor = function cursor() { return "%cursor:" + this.cursorCount++ + "%"; }; _proto2.Program = function Program(program) { var body = []; this.cursorCount = 0; var node = b.program(body, program.blockParams, program.loc); var i, l = program.body.length; this.elementStack.push(node); if (l === 0) { return this.elementStack.pop(); } for (i = 0; i < l; i++) { this.acceptNode(program.body[i]); } // Ensure that that the element stack is balanced properly. var poppedNode = this.elementStack.pop(); if (poppedNode !== node) { var elementNode = poppedNode; throw new SyntaxError('Unclosed element `' + elementNode.tag + '` (on line ' + elementNode.loc.start.line + ').', elementNode.loc); } return node; }; _proto2.BlockStatement = function BlockStatement(block) { if (this.tokenizer['state'] === 'comment') { this.appendToCommentData(this.sourceForNode(block)); return; } if (this.tokenizer['state'] !== 'comment' && this.tokenizer['state'] !== 'data' && this.tokenizer['state'] !== 'beforeData') { throw new SyntaxError('A block may only be used inside an HTML element or another block.', block.loc); } var _acceptCallNodes = acceptCallNodes(this, block), path = _acceptCallNodes.path, params = _acceptCallNodes.params, hash = _acceptCallNodes.hash; var program = this.Program(block.program); var inverse = block.inverse ? this.Program(block.inverse) : null; if (path.original === 'in-element') { hash = addInElementHash(this.cursor(), hash, block.loc); } var node = b.block(path, params, hash, program, inverse, block.loc); var parentProgram = this.currentElement(); appendChild(parentProgram, node); }; _proto2.MustacheStatement = function MustacheStatement(rawMustache) { var tokenizer = this.tokenizer; if (tokenizer.state === 'comment') { this.appendToCommentData(this.sourceForNode(rawMustache)); return; } var mustache; var escaped = rawMustache.escaped, loc = rawMustache.loc; if (rawMustache.path.type.match(/Literal$/)) { mustache = { type: 'MustacheStatement', path: this.acceptNode(rawMustache.path), params: [], hash: b.hash(), escaped: escaped, loc: loc }; } else { var _acceptCallNodes2 = acceptCallNodes(this, rawMustache), path = _acceptCallNodes2.path, params = _acceptCallNodes2.params, hash = _acceptCallNodes2.hash; mustache = b.mustache(path, params, hash, !escaped, loc); } switch (tokenizer.state) { // Tag helpers case "tagOpen" /* tagOpen */ : case "tagName" /* tagName */ : throw new SyntaxError("Cannot use mustaches in an elements tagname: `" + this.sourceForNode(rawMustache, rawMustache.path) + "` at L" + loc.start.line + ":C" + loc.start.column, mustache.loc); case "beforeAttributeName" /* beforeAttributeName */ : addElementModifier(this.currentStartTag, mustache); break; case "attributeName" /* attributeName */ : case "afterAttributeName" /* afterAttributeName */ : this.beginAttributeValue(false); this.finishAttributeValue(); addElementModifier(this.currentStartTag, mustache); tokenizer.transitionTo("beforeAttributeName" /* beforeAttributeName */ ); break; case "afterAttributeValueQuoted" /* afterAttributeValueQuoted */ : addElementModifier(this.currentStartTag, mustache); tokenizer.transitionTo("beforeAttributeName" /* beforeAttributeName */ ); break; // Attribute values case "beforeAttributeValue" /* beforeAttributeValue */ : this.beginAttributeValue(false); appendDynamicAttributeValuePart(this.currentAttribute, mustache); tokenizer.transitionTo("attributeValueUnquoted" /* attributeValueUnquoted */ ); break; case "attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */ : case "attributeValueSingleQuoted" /* attributeValueSingleQuoted */ : case "attributeValueUnquoted" /* attributeValueUnquoted */ : appendDynamicAttributeValuePart(this.currentAttribute, mustache); break; // TODO: Only append child when the tokenizer state makes // sense to do so, otherwise throw an error. default: appendChild(this.currentElement(), mustache); } return mustache; }; _proto2.ContentStatement = function ContentStatement(content) { updateTokenizerLocation(this.tokenizer, content); this.tokenizer.tokenizePart(content.value); this.tokenizer.flushData(); }; _proto2.CommentStatement = function CommentStatement(rawComment) { var tokenizer = this.tokenizer; if (tokenizer.state === "comment" /* comment */ ) { this.appendToCommentData(this.sourceForNode(rawComment)); return null; } var value = rawComment.value, loc = rawComment.loc; var comment = b.mustacheComment(value, loc); switch (tokenizer.state) { case "beforeAttributeName" /* beforeAttributeName */ : this.currentStartTag.comments.push(comment); break; case "beforeData" /* beforeData */ : case "data" /* data */ : appendChild(this.currentElement(), comment); break; default: throw new SyntaxError("Using a Handlebars comment when in the `" + tokenizer['state'] + "` state is not supported: \"" + comment.value + "\" on line " + loc.start.line + ":" + loc.start.column, rawComment.loc); } return comment; }; _proto2.PartialStatement = function PartialStatement(partial) { var loc = partial.loc; throw new SyntaxError("Handlebars partials are not supported: \"" + this.sourceForNode(partial, partial.name) + "\" at L" + loc.start.line + ":C" + loc.start.column, partial.loc); }; _proto2.PartialBlockStatement = function PartialBlockStatement(partialBlock) { var loc = partialBlock.loc; throw new SyntaxError("Handlebars partial blocks are not supported: \"" + this.sourceForNode(partialBlock, partialBlock.name) + "\" at L" + loc.start.line + ":C" + loc.start.column, partialBlock.loc); }; _proto2.Decorator = function Decorator(decorator) { var loc = decorator.loc; throw new SyntaxError("Handlebars decorators are not supported: \"" + this.sourceForNode(decorator, decorator.path) + "\" at L" + loc.start.line + ":C" + loc.start.column, decorator.loc); }; _proto2.DecoratorBlock = function DecoratorBlock(decoratorBlock) { var loc = decoratorBlock.loc; throw new SyntaxError("Handlebars decorator blocks are not supported: \"" + this.sourceForNode(decoratorBlock, decoratorBlock.path) + "\" at L" + loc.start.line + ":C" + loc.start.column, decoratorBlock.loc); }; _proto2.SubExpression = function SubExpression(sexpr) { var _acceptCallNodes3 = acceptCallNodes(this, sexpr), path = _acceptCallNodes3.path, params = _acceptCallNodes3.params, hash = _acceptCallNodes3.hash; return b.sexpr(path, params, hash, sexpr.loc); }; _proto2.PathExpression = function PathExpression(path) { var original = path.original, loc = path.loc; var parts; if (original.indexOf('/') !== -1) { if (original.slice(0, 2) === './') { throw new SyntaxError("Using \"./\" is not supported in Glimmer and unnecessary: \"" + path.original + "\" on line " + loc.start.line + ".", path.loc); } if (original.slice(0, 3) === '../') { throw new SyntaxError("Changing context using \"../\" is not supported in Glimmer: \"" + path.original + "\" on line " + loc.start.line + ".", path.loc); } if (original.indexOf('.') !== -1) { throw new SyntaxError("Mixing '.' and '/' in paths is not supported in Glimmer; use only '.' to separate property paths: \"" + path.original + "\" on line " + loc.start.line + ".", path.loc); } parts = [path.parts.join('/')]; } else if (original === '.') { var locationInfo = "L" + loc.start.line + ":C" + loc.start.column; throw new SyntaxError("'.' is not a supported path in Glimmer; check for a path with a trailing '.' at " + locationInfo + ".", path.loc); } else { parts = path.parts; } var thisHead = false; // This is to fix a bug in the Handlebars AST where the path expressions in // `{{this.foo}}` (and similarly `{{foo-bar this.foo named=this.foo}}` etc) // are simply turned into `{{foo}}`. The fix is to push it back onto the // parts array and let the runtime see the difference. However, we cannot // simply use the string `this` as it means literally the property called // "this" in the current context (it can be expressed in the syntax as // `{{[this]}}`, where the square bracket are generally for this kind of // escaping – such as `{{foo.["bar.baz"]}}` would mean lookup a property // named literally "bar.baz" on `this.foo`). By convention, we use `null` // for this purpose. if (original.match(/^this(\..+)?$/)) { thisHead = true; } return { type: 'PathExpression', original: path.original, this: thisHead, parts: parts, data: path.data, loc: path.loc }; }; _proto2.Hash = function Hash(hash) { var pairs = []; for (var i = 0; i < hash.pairs.length; i++) { var pair = hash.pairs[i]; pairs.push(b.pair(pair.key, this.acceptNode(pair.value), pair.loc)); } return b.hash(pairs, hash.loc); }; _proto2.StringLiteral = function StringLiteral(string) { return b.literal('StringLiteral', string.value, string.loc); }; _proto2.BooleanLiteral = function BooleanLiteral(boolean) { return b.literal('BooleanLiteral', boolean.value, boolean.loc); }; _proto2.NumberLiteral = function NumberLiteral(number) { return b.literal('NumberLiteral', number.value, number.loc); }; _proto2.UndefinedLiteral = function UndefinedLiteral(undef) { return b.literal('UndefinedLiteral', undefined, undef.loc); }; _proto2.NullLiteral = function NullLiteral(nul) { return b.literal('NullLiteral', null, nul.loc); }; return HandlebarsNodeVisitors; }(Parser); function calculateRightStrippedOffsets(original, value) { if (value === '') { // if it is empty, just return the count of newlines // in original return { lines: original.split('\n').length - 1, columns: 0 }; } // otherwise, return the number of newlines prior to // `value` var difference = original.split(value)[0]; var lines = difference.split(/\n/); var lineCount = lines.length - 1; return { lines: lineCount, columns: lines[lineCount].length }; } function updateTokenizerLocation(tokenizer, content) { var line = content.loc.start.line; var column = content.loc.start.column; var offsets = calculateRightStrippedOffsets(content.original, content.value); line = line + offsets.lines; if (offsets.lines) { column = offsets.columns; } else { column = column + offsets.columns; } tokenizer.line = line; tokenizer.column = column; } function acceptCallNodes(compiler, node) { var path = compiler.PathExpression(node.path); var params = node.params ? node.params.map(function (e) { return compiler.acceptNode(e); }) : []; var hash = node.hash ? compiler.Hash(node.hash) : b.hash(); return { path: path, params: params, hash: hash }; } function addElementModifier(element, mustache) { var path = mustache.path, params = mustache.params, hash = mustache.hash, loc = mustache.loc; if (isLiteral(path)) { var _modifier = "{{" + printLiteral(path) + "}}"; var tag = "<" + element.name + " ... " + _modifier + " ..."; throw new SyntaxError("In " + tag + ", " + _modifier + " is not a valid modifier: \"" + path.original + "\" on line " + (loc && loc.start.line) + ".", mustache.loc); } var modifier = b.elementModifier(path, params, hash, loc); element.modifiers.push(modifier); } function addInElementHash(cursor, hash, loc) { var hasNextSibling = false; hash.pairs.forEach(function (pair) { if (pair.key === 'guid') { throw new SyntaxError('Cannot pass `guid` from user space', loc); } if (pair.key === 'nextSibling') { hasNextSibling = true; } }); var guid = b.literal('StringLiteral', cursor); var guidPair = b.pair('guid', guid); hash.pairs.unshift(guidPair); if (!hasNextSibling) { var nullLiteral = b.literal('NullLiteral', null); var nextSibling = b.pair('nextSibling', nullLiteral); hash.pairs.push(nextSibling); } return hash; } function appendDynamicAttributeValuePart(attribute, part) { attribute.isDynamic = true; attribute.parts.push(part); } function tuple() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return args; } // ensure stays in sync with typing // ParentNode and ChildKey types are derived from VisitorKeysMap var visitorKeys = { Program: tuple('body'), MustacheStatement: tuple('path', 'params', 'hash'), BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'), ElementModifierStatement: tuple('path', 'params', 'hash'), PartialStatement: tuple('name', 'params', 'hash'), CommentStatement: tuple(), MustacheCommentStatement: tuple(), ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'), AttrNode: tuple('value'), TextNode: tuple(), ConcatStatement: tuple('parts'), SubExpression: tuple('path', 'params', 'hash'), PathExpression: tuple(), StringLiteral: tuple(), BooleanLiteral: tuple(), NumberLiteral: tuple(), NullLiteral: tuple(), UndefinedLiteral: tuple(), Hash: tuple('pairs'), HashPair: tuple('value') }; var TraversalError = function () { TraversalError.prototype = Object.create(Error.prototype); TraversalError.prototype.constructor = TraversalError; function TraversalError(message, node, parent, key) { var error = Error.call(this, message); this.key = key; this.message = message; this.node = node; this.parent = parent; this.stack = error.stack; } return TraversalError; }(); _exports.TraversalError = TraversalError; function cannotRemoveNode(node, parent, key) { return new TraversalError('Cannot remove a node unless it is part of an array', node, parent, key); } function cannotReplaceNode(node, parent, key) { return new TraversalError('Cannot replace a node with multiple nodes unless it is part of an array', node, parent, key); } function cannotReplaceOrRemoveInKeyHandlerYet(node, key) { return new TraversalError('Replacing and removing in key handlers is not yet supported.', node, null, key); } function getEnterFunction(handler) { return typeof handler === 'function' ? handler : handler.enter; } function getExitFunction(handler) { return typeof handler !== 'function' ? handler.exit : undefined; } function getKeyHandler(handler, key) { var keyVisitor = typeof handler !== 'function' ? handler.keys : undefined; if (keyVisitor === undefined) return; var keyHandler = keyVisitor[key]; if (keyHandler !== undefined) { // widen specific key to all keys return keyHandler; } return keyVisitor.All; } function getNodeHandler(visitor, nodeType) { var handler = visitor[nodeType]; if (handler !== undefined) { // widen specific Node to all nodes return handler; } return visitor.All; } function visitNode(visitor, node) { var handler = getNodeHandler(visitor, node.type); var enter; var exit; if (handler !== undefined) { enter = getEnterFunction(handler); exit = getExitFunction(handler); } var result; if (enter !== undefined) { result = enter(node); } if (result !== undefined && result !== null) { if (JSON.stringify(node) === JSON.stringify(result)) { result = undefined; } else if (Array.isArray(result)) { visitArray(visitor, result); return result; } else { return visitNode(visitor, result) || result; } } if (result === undefined) { var keys = visitorKeys[node.type]; for (var i = 0; i < keys.length; i++) { // we know if it has child keys we can widen to a ParentNode visitKey(visitor, handler, node, keys[i]); } if (exit !== undefined) { result = exit(node); } } return result; } function visitKey(visitor, handler, node, key) { var value = node[key]; if (!value) { return; } var keyEnter; var keyExit; if (handler !== undefined) { var keyHandler = getKeyHandler(handler, key); if (keyHandler !== undefined) { keyEnter = getEnterFunction(keyHandler); keyExit = getExitFunction(keyHandler); } } if (keyEnter !== undefined) { if (keyEnter(node, key) !== undefined) { throw cannotReplaceOrRemoveInKeyHandlerYet(node, key); } } if (Array.isArray(value)) { visitArray(visitor, value); } else { var result = visitNode(visitor, value); if (result !== undefined) { assignKey(node, key, result); } } if (keyExit !== undefined) { if (keyExit(node, key) !== undefined) { throw cannotReplaceOrRemoveInKeyHandlerYet(node, key); } } } function visitArray(visitor, array) { for (var i = 0; i < array.length; i++) { var result = visitNode(visitor, array[i]); if (result !== undefined) { i += spliceArray(array, i, result) - 1; } } } function assignKey(node, key, result) { if (result === null) { throw cannotRemoveNode(node[key], node, key); } else if (Array.isArray(result)) { if (result.length === 1) { node[key] = result[0]; } else { if (result.length === 0) { throw cannotRemoveNode(node[key], node, key); } else { throw cannotReplaceNode(node[key], node, key); } } } else { node[key] = result; } } function spliceArray(array, index, result) { if (result === null) { array.splice(index, 1); return 0; } else if (Array.isArray(result)) { array.splice.apply(array, [index, 1].concat(result)); return result.length; } else { array.splice(index, 1, result); return 1; } } function traverse(node, visitor) { visitNode(visitor, node); } var ATTR_VALUE_REGEX_TEST = /[\xA0"&]/; var ATTR_VALUE_REGEX_REPLACE = new RegExp(ATTR_VALUE_REGEX_TEST.source, 'g'); var TEXT_REGEX_TEST = /[\xA0&<>]/; var TEXT_REGEX_REPLACE = new RegExp(TEXT_REGEX_TEST.source, 'g'); function attrValueReplacer(char) { switch (char.charCodeAt(0)) { case 160 /* NBSP */ : return ' '; case 34 /* QUOT */ : return '"'; case 38 /* AMP */ : return '&'; default: return char; } } function textReplacer(char) { switch (char.charCodeAt(0)) { case 160 /* NBSP */ : return ' '; case 38 /* AMP */ : return '&'; case 60 /* LT */ : return '<'; case 62 /* GT */ : return '>'; default: return char; } } function escapeAttrValue(attrValue) { if (ATTR_VALUE_REGEX_TEST.test(attrValue)) { return attrValue.replace(ATTR_VALUE_REGEX_REPLACE, attrValueReplacer); } return attrValue; } function escapeText(text) { if (TEXT_REGEX_TEST.test(text)) { return text.replace(TEXT_REGEX_REPLACE, textReplacer); } return text; } function unreachable() { throw new Error('unreachable'); } function build(ast) { if (!ast) { return ''; } var output = []; switch (ast.type) { case 'Program': { var chainBlock = ast['chained'] && ast.body[0]; if (chainBlock) { chainBlock['chained'] = true; } var body = buildEach(ast.body).join(''); output.push(body); } break; case 'ElementNode': output.push('<', ast.tag); if (ast.attributes.length) { output.push(' ', buildEach(ast.attributes).join(' ')); } if (ast.modifiers.length) { output.push(' ', buildEach(ast.modifiers).join(' ')); } if (ast.comments.length) { output.push(' ', buildEach(ast.comments).join(' ')); } if (ast.blockParams.length) { output.push(' ', 'as', ' ', "|" + ast.blockParams.join(' ') + "|"); } if (voidMap[ast.tag]) { if (ast.selfClosing) { output.push(' /'); } output.push('>'); } else { output.push('>'); output.push.apply(output, buildEach(ast.children)); output.push(''); } break; case 'AttrNode': if (ast.value.type === 'TextNode') { if (ast.value.chars !== '') { output.push(ast.name, '='); output.push('"', escapeAttrValue(ast.value.chars), '"'); } else { output.push(ast.name); } } else { output.push(ast.name, '='); // ast.value is mustache or concat output.push(build(ast.value)); } break; case 'ConcatStatement': output.push('"'); ast.parts.forEach(function (node) { if (node.type === 'TextNode') { output.push(escapeAttrValue(node.chars)); } else { output.push(build(node)); } }); output.push('"'); break; case 'TextNode': output.push(escapeText(ast.chars)); break; case 'MustacheStatement': { output.push(compactJoin(['{{', pathParams(ast), '}}'])); } break; case 'MustacheCommentStatement': { output.push(compactJoin(['{{!--', ast.value, '--}}'])); } break; case 'ElementModifierStatement': { output.push(compactJoin(['{{', pathParams(ast), '}}'])); } break; case 'PathExpression': output.push(ast.original); break; case 'SubExpression': { output.push('(', pathParams(ast), ')'); } break; case 'BooleanLiteral': output.push(ast.value ? 'true' : 'false'); break; case 'BlockStatement': { var lines = []; if (ast['chained']) { lines.push(['{{else ', pathParams(ast), '}}'].join('')); } else { lines.push(openBlock(ast)); } lines.push(build(ast.program)); if (ast.inverse) { if (!ast.inverse['chained']) { lines.push('{{else}}'); } lines.push(build(ast.inverse)); } if (!ast['chained']) { lines.push(closeBlock(ast)); } output.push(lines.join('')); } break; case 'PartialStatement': { output.push(compactJoin(['{{>', pathParams(ast), '}}'])); } break; case 'CommentStatement': { output.push(compactJoin([''])); } break; case 'StringLiteral': { output.push("\"" + ast.value + "\""); } break; case 'NumberLiteral': { output.push(String(ast.value)); } break; case 'UndefinedLiteral': { output.push('undefined'); } break; case 'NullLiteral': { output.push('null'); } break; case 'Hash': { output.push(ast.pairs.map(function (pair) { return build(pair); }).join(' ')); } break; case 'HashPair': { output.push(ast.key + "=" + build(ast.value)); } break; } return output.join(''); } function compact(array) { var newArray = []; array.forEach(function (a) { if (typeof a !== 'undefined' && a !== null && a !== '') { newArray.push(a); } }); return newArray; } function buildEach(asts) { return asts.map(build); } function pathParams(ast) { var path; switch (ast.type) { case 'MustacheStatement': case 'SubExpression': case 'ElementModifierStatement': case 'BlockStatement': if (isLiteral(ast.path)) { return String(ast.path.value); } path = build(ast.path); break; case 'PartialStatement': path = build(ast.name); break; default: return unreachable(); } return compactJoin([path, buildEach(ast.params).join(' '), build(ast.hash)], ' '); } function compactJoin(array, delimiter) { return compact(array).join(delimiter || ''); } function blockParams(block) { var params = block.program.blockParams; if (params.length) { return " as |" + params.join(' ') + "|"; } return null; } function openBlock(block) { return ['{{#', pathParams(block), blockParams(block), '}}'].join(''); } function closeBlock(block) { return ['{{/', build(block.path), '}}'].join(''); } var Walker = /*#__PURE__*/ function () { function Walker(order) { this.order = order; this.stack = []; } var _proto3 = Walker.prototype; _proto3.visit = function visit(node, callback) { if (!node) { return; } this.stack.push(node); if (this.order === 'post') { this.children(node, callback); callback(node, this); } else { callback(node, this); this.children(node, callback); } this.stack.pop(); }; _proto3.children = function children(node, callback) { var visitor = visitors[node.type]; if (visitor) { visitor(this, node, callback); } }; return Walker; }(); _exports.Walker = Walker; var visitors = { Program: function Program(walker, node, callback) { for (var i = 0; i < node.body.length; i++) { walker.visit(node.body[i], callback); } }, ElementNode: function ElementNode(walker, node, callback) { for (var i = 0; i < node.children.length; i++) { walker.visit(node.children[i], callback); } }, BlockStatement: function BlockStatement(walker, node, callback) { walker.visit(node.program, callback); walker.visit(node.inverse || null, callback); } }; var voidMap = Object.create(null); var voidTagNames = 'area base br col command embed hr img input keygen link meta param source track wbr'; voidTagNames.split(' ').forEach(function (tagName) { voidMap[tagName] = true; }); var TokenizerEventHandlers = /*#__PURE__*/ function (_HandlebarsNodeVisito) { (0, _emberBabel.inheritsLoose)(TokenizerEventHandlers, _HandlebarsNodeVisito); function TokenizerEventHandlers() { var _this2; _this2 = _HandlebarsNodeVisito.apply(this, arguments) || this; _this2.tagOpenLine = 0; _this2.tagOpenColumn = 0; return _this2; } var _proto4 = TokenizerEventHandlers.prototype; _proto4.reset = function reset() { this.currentNode = null; } // Comment ; _proto4.beginComment = function beginComment() { this.currentNode = b.comment(''); this.currentNode.loc = { source: null, start: b.pos(this.tagOpenLine, this.tagOpenColumn), end: null }; }; _proto4.appendToCommentData = function appendToCommentData(char) { this.currentComment.value += char; }; _proto4.finishComment = function finishComment() { this.currentComment.loc.end = b.pos(this.tokenizer.line, this.tokenizer.column); appendChild(this.currentElement(), this.currentComment); } // Data ; _proto4.beginData = function beginData() { this.currentNode = b.text(); this.currentNode.loc = { source: null, start: b.pos(this.tokenizer.line, this.tokenizer.column), end: null }; }; _proto4.appendToData = function appendToData(char) { this.currentData.chars += char; }; _proto4.finishData = function finishData() { this.currentData.loc.end = b.pos(this.tokenizer.line, this.tokenizer.column); appendChild(this.currentElement(), this.currentData); } // Tags - basic ; _proto4.tagOpen = function tagOpen() { this.tagOpenLine = this.tokenizer.line; this.tagOpenColumn = this.tokenizer.column; }; _proto4.beginStartTag = function beginStartTag() { this.currentNode = { type: 'StartTag', name: '', attributes: [], modifiers: [], comments: [], selfClosing: false, loc: SYNTHETIC }; }; _proto4.beginEndTag = function beginEndTag() { this.currentNode = { type: 'EndTag', name: '', attributes: [], modifiers: [], comments: [], selfClosing: false, loc: SYNTHETIC }; }; _proto4.finishTag = function finishTag() { var _this$tokenizer = this.tokenizer, line = _this$tokenizer.line, column = _this$tokenizer.column; var tag = this.currentTag; tag.loc = b.loc(this.tagOpenLine, this.tagOpenColumn, line, column); if (tag.type === 'StartTag') { this.finishStartTag(); if (voidMap[tag.name] || tag.selfClosing) { this.finishEndTag(true); } } else if (tag.type === 'EndTag') { this.finishEndTag(false); } }; _proto4.finishStartTag = function finishStartTag() { var _this$currentStartTag = this.currentStartTag, name = _this$currentStartTag.name, attributes = _this$currentStartTag.attributes, modifiers = _this$currentStartTag.modifiers, comments = _this$currentStartTag.comments, selfClosing = _this$currentStartTag.selfClosing; var loc = b.loc(this.tagOpenLine, this.tagOpenColumn); var element = b.element({ name: name, selfClosing: selfClosing }, attributes, modifiers, [], comments, [], loc); this.elementStack.push(element); }; _proto4.finishEndTag = function finishEndTag(isVoid) { var tag = this.currentTag; var element = this.elementStack.pop(); var parent = this.currentElement(); validateEndTag(tag, element, isVoid); element.loc.end.line = this.tokenizer.line; element.loc.end.column = this.tokenizer.column; parseElementBlockParams(element); appendChild(parent, element); }; _proto4.markTagAsSelfClosing = function markTagAsSelfClosing() { this.currentTag.selfClosing = true; } // Tags - name ; _proto4.appendToTagName = function appendToTagName(char) { this.currentTag.name += char; } // Tags - attributes ; _proto4.beginAttribute = function beginAttribute() { var tag = this.currentTag; if (tag.type === 'EndTag') { throw new SyntaxError("Invalid end tag: closing tag must not have attributes, " + ("in `" + tag.name + "` (on line " + this.tokenizer.line + ")."), tag.loc); } this.currentAttribute = { name: '', parts: [], isQuoted: false, isDynamic: false, start: b.pos(this.tokenizer.line, this.tokenizer.column), valueStartLine: 0, valueStartColumn: 0 }; }; _proto4.appendToAttributeName = function appendToAttributeName(char) { this.currentAttr.name += char; }; _proto4.beginAttributeValue = function beginAttributeValue(isQuoted) { this.currentAttr.isQuoted = isQuoted; this.currentAttr.valueStartLine = this.tokenizer.line; this.currentAttr.valueStartColumn = this.tokenizer.column; }; _proto4.appendToAttributeValue = function appendToAttributeValue(char) { var parts = this.currentAttr.parts; var lastPart = parts[parts.length - 1]; if (lastPart && lastPart.type === 'TextNode') { lastPart.chars += char; // update end location for each added char lastPart.loc.end.line = this.tokenizer.line; lastPart.loc.end.column = this.tokenizer.column; } else { // initially assume the text node is a single char var loc = b.loc(this.tokenizer.line, this.tokenizer.column, this.tokenizer.line, this.tokenizer.column); // correct for `\n` as first char if (char === '\n') { loc.start.line -= 1; loc.start.column = lastPart ? lastPart.loc.end.column : this.currentAttr.valueStartColumn; } var text = b.text(char, loc); parts.push(text); } }; _proto4.finishAttributeValue = function finishAttributeValue() { var _this$currentAttr = this.currentAttr, name = _this$currentAttr.name, parts = _this$currentAttr.parts, isQuoted = _this$currentAttr.isQuoted, isDynamic = _this$currentAttr.isDynamic, valueStartLine = _this$currentAttr.valueStartLine, valueStartColumn = _this$currentAttr.valueStartColumn; var value = assembleAttributeValue(parts, isQuoted, isDynamic, this.tokenizer.line); value.loc = b.loc(valueStartLine, valueStartColumn, this.tokenizer.line, this.tokenizer.column); var loc = b.loc(this.currentAttr.start.line, this.currentAttr.start.column, this.tokenizer.line, this.tokenizer.column); var attribute = b.attr(name, value, loc); this.currentStartTag.attributes.push(attribute); }; _proto4.reportSyntaxError = function reportSyntaxError(message) { throw new SyntaxError("Syntax error at line " + this.tokenizer.line + " col " + this.tokenizer.column + ": " + message, b.loc(this.tokenizer.line, this.tokenizer.column)); }; return TokenizerEventHandlers; }(HandlebarsNodeVisitors); function assembleAttributeValue(parts, isQuoted, isDynamic, line) { if (isDynamic) { if (isQuoted) { return assembleConcatenatedValue(parts); } else { if (parts.length === 1 || parts.length === 2 && parts[1].type === 'TextNode' && parts[1].chars === '/') { return parts[0]; } else { throw new SyntaxError("An unquoted attribute value must be a string or a mustache, " + "preceeded by whitespace or a '=' character, and " + ("followed by whitespace, a '>' character, or '/>' (on line " + line + ")"), b.loc(line, 0)); } } } else { return parts.length > 0 ? parts[0] : b.text(''); } } function assembleConcatenatedValue(parts) { for (var i = 0; i < parts.length; i++) { var part = parts[i]; if (part.type !== 'MustacheStatement' && part.type !== 'TextNode') { throw new SyntaxError('Unsupported node in quoted attribute value: ' + part['type'], part.loc); } } return b.concat(parts); } function validateEndTag(tag, element, selfClosing) { var error; if (voidMap[tag.name] && !selfClosing) { // EngTag is also called by StartTag for void and self-closing tags (i.e. // or
, so we need to check for that here. Otherwise, we would // throw an error for those cases. error = 'Invalid end tag ' + formatEndTagInfo(tag) + ' (void elements cannot have end tags).'; } else if (element.tag === undefined) { error = 'Closing tag ' + formatEndTagInfo(tag) + ' without an open tag.'; } else if (element.tag !== tag.name) { error = 'Closing tag ' + formatEndTagInfo(tag) + ' did not match last open tag `' + element.tag + '` (on line ' + element.loc.start.line + ').'; } if (error) { throw new SyntaxError(error, element.loc); } } function formatEndTagInfo(tag) { return '`' + tag.name + '` (on line ' + tag.loc.end.line + ')'; } var syntax = { parse: preprocess, builders: b, print: build, traverse: traverse, Walker: Walker }; function preprocess(html, options) { var parseOptions = options ? options.parseOptions : {}; var ast = typeof html === 'object' ? html : (0, _handlebars.parse)(html, parseOptions); var program = new TokenizerEventHandlers(html).acceptNode(ast); if (options && options.plugins && options.plugins.ast) { for (var i = 0, l = options.plugins.ast.length; i < l; i++) { var transform = options.plugins.ast[i]; var env = (0, _util.assign)({}, options, { syntax: syntax }, { plugins: undefined }); var pluginResult = transform(env); traverse(program, pluginResult.visitor); } } return program; } var nodes = /*#__PURE__*/ Object.freeze({}); // used by ember-compiler _exports.AST = nodes; }); define("@glimmer/util", ["exports", "ember-babel"], function (_exports, _emberBabel) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.assert = debugAssert; _exports.assign = assign; _exports.fillNulls = fillNulls; _exports.ensureGuid = ensureGuid; _exports.initializeGuid = initializeGuid; _exports.dict = dict; _exports.unwrap = unwrap; _exports.expect = expect; _exports.unreachable = unreachable; _exports.EMPTY_ARRAY = _exports.ListSlice = _exports.ListNode = _exports.LinkedList = _exports.EMPTY_SLICE = _exports.DictSet = _exports.Stack = void 0; function unwrap(val) { if (val === null || val === undefined) throw new Error("Expected value to be present"); return val; } function expect(val, message) { if (val === null || val === undefined) throw new Error(message); return val; } function unreachable(message) { if (message === void 0) { message = 'unreachable'; } return new Error(message); } // import Logger from './logger'; // let alreadyWarned = false; 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'); } } var objKeys = Object.keys; function assign(obj) { for (var i = 1; i < arguments.length; i++) { var assignment = arguments[i]; if (assignment === null || typeof assignment !== 'object') continue; var keys = objKeys(assignment); for (var j = 0; j < keys.length; j++) { var key = keys[j]; obj[key] = assignment[key]; } } return obj; } function fillNulls(count) { var arr = new Array(count); for (var i = 0; i < count; i++) { arr[i] = null; } return arr; } var GUID = 0; function initializeGuid(object) { return object._guid = ++GUID; } function ensureGuid(object) { return object._guid || initializeGuid(object); } function dict() { return Object.create(null); } var DictSet = /*#__PURE__*/ function () { function DictSet() { this.dict = dict(); } var _proto = DictSet.prototype; _proto.add = function add(obj) { if (typeof obj === 'string') this.dict[obj] = obj;else this.dict[ensureGuid(obj)] = obj; return this; }; _proto.delete = function _delete(obj) { if (typeof obj === 'string') delete this.dict[obj];else if (obj._guid) delete this.dict[obj._guid]; }; return DictSet; }(); _exports.DictSet = DictSet; var Stack = /*#__PURE__*/ function () { function Stack() { this.stack = []; this.current = null; } var _proto2 = Stack.prototype; _proto2.push = function push(item) { this.current = item; this.stack.push(item); }; _proto2.pop = function pop() { var item = this.stack.pop(); var len = this.stack.length; this.current = len === 0 ? null : this.stack[len - 1]; return item === undefined ? null : item; }; _proto2.isEmpty = function isEmpty() { return this.stack.length === 0; }; (0, _emberBabel.createClass)(Stack, [{ key: "size", get: function get() { return this.stack.length; } }]); return Stack; }(); _exports.Stack = Stack; var ListNode = function ListNode(value) { this.next = null; this.prev = null; this.value = value; }; _exports.ListNode = ListNode; var LinkedList = /*#__PURE__*/ function () { function LinkedList() { this.clear(); } var _proto3 = LinkedList.prototype; _proto3.head = function head() { return this._head; }; _proto3.tail = function tail() { return this._tail; }; _proto3.clear = function clear() { this._head = this._tail = null; }; _proto3.toArray = function toArray() { var out = []; this.forEachNode(function (n) { return out.push(n); }); return out; }; _proto3.nextNode = function nextNode(node) { return node.next; }; _proto3.forEachNode = function forEachNode(callback) { var node = this._head; while (node !== null) { callback(node); node = node.next; } }; _proto3.insertBefore = function insertBefore(node, reference) { if (reference === void 0) { reference = null; } 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; }; _proto3.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; }; _proto3.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 ListSlice = /*#__PURE__*/ function () { function ListSlice(head, tail) { this._head = head; this._tail = tail; } var _proto4 = ListSlice.prototype; _proto4.forEachNode = function forEachNode(callback) { var node = this._head; while (node !== null) { callback(node); node = this.nextNode(node); } }; _proto4.head = function head() { return this._head; }; _proto4.tail = function tail() { return this._tail; }; _proto4.toArray = function toArray() { var out = []; this.forEachNode(function (n) { return out.push(n); }); return out; }; _proto4.nextNode = function nextNode(node) { if (node === this._tail) return null; return node.next; }; return ListSlice; }(); _exports.ListSlice = ListSlice; var EMPTY_SLICE = new ListSlice(null, null); _exports.EMPTY_SLICE = EMPTY_SLICE; var EMPTY_ARRAY = Object.freeze([]); _exports.EMPTY_ARRAY = EMPTY_ARRAY; }); define("@glimmer/wire-format", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.is = is; _exports.isAttribute = isAttribute; _exports.isArgument = isArgument; _exports.isMaybeLocal = _exports.isGet = _exports.isFlushElement = _exports.Ops = void 0; var Opcodes; _exports.Ops = Opcodes; (function (Opcodes) { // Statements Opcodes[Opcodes["Text"] = 0] = "Text"; Opcodes[Opcodes["Append"] = 1] = "Append"; Opcodes[Opcodes["Comment"] = 2] = "Comment"; Opcodes[Opcodes["Modifier"] = 3] = "Modifier"; Opcodes[Opcodes["Block"] = 4] = "Block"; Opcodes[Opcodes["Component"] = 5] = "Component"; Opcodes[Opcodes["DynamicComponent"] = 6] = "DynamicComponent"; Opcodes[Opcodes["OpenElement"] = 7] = "OpenElement"; Opcodes[Opcodes["FlushElement"] = 8] = "FlushElement"; Opcodes[Opcodes["CloseElement"] = 9] = "CloseElement"; Opcodes[Opcodes["StaticAttr"] = 10] = "StaticAttr"; Opcodes[Opcodes["DynamicAttr"] = 11] = "DynamicAttr"; Opcodes[Opcodes["ComponentAttr"] = 12] = "ComponentAttr"; Opcodes[Opcodes["AttrSplat"] = 13] = "AttrSplat"; Opcodes[Opcodes["Yield"] = 14] = "Yield"; Opcodes[Opcodes["Partial"] = 15] = "Partial"; Opcodes[Opcodes["DynamicArg"] = 16] = "DynamicArg"; Opcodes[Opcodes["StaticArg"] = 17] = "StaticArg"; Opcodes[Opcodes["TrustingAttr"] = 18] = "TrustingAttr"; Opcodes[Opcodes["TrustingComponentAttr"] = 19] = "TrustingComponentAttr"; Opcodes[Opcodes["Debugger"] = 20] = "Debugger"; Opcodes[Opcodes["ClientSideStatement"] = 21] = "ClientSideStatement"; // Expressions Opcodes[Opcodes["Unknown"] = 22] = "Unknown"; Opcodes[Opcodes["Get"] = 23] = "Get"; Opcodes[Opcodes["MaybeLocal"] = 24] = "MaybeLocal"; Opcodes[Opcodes["HasBlock"] = 25] = "HasBlock"; Opcodes[Opcodes["HasBlockParams"] = 26] = "HasBlockParams"; Opcodes[Opcodes["Undefined"] = 27] = "Undefined"; Opcodes[Opcodes["Helper"] = 28] = "Helper"; Opcodes[Opcodes["Concat"] = 29] = "Concat"; Opcodes[Opcodes["ClientSideExpression"] = 30] = "ClientSideExpression"; })(Opcodes || (_exports.Ops = Opcodes = {})); function is(variant) { return function (value) { return Array.isArray(value) && value[0] === variant; }; } // Statements var isFlushElement = is(Opcodes.FlushElement); _exports.isFlushElement = isFlushElement; function isAttribute(val) { return val[0] === Opcodes.StaticAttr || val[0] === Opcodes.DynamicAttr || val[0] === Opcodes.ComponentAttr || val[0] === Opcodes.TrustingAttr || val[0] === Opcodes.TrustingComponentAttr || val[0] === Opcodes.AttrSplat || val[0] === Opcodes.Modifier; } function isArgument(val) { return val[0] === Opcodes.StaticArg || val[0] === Opcodes.DynamicArg; } // Expressions var isGet = is(Opcodes.Get); _exports.isGet = isGet; var isMaybeLocal = is(Opcodes.MaybeLocal); _exports.isMaybeLocal = isMaybeLocal; }); define("ember-babel", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.wrapNativeSuper = wrapNativeSuper; _exports.classCallCheck = classCallCheck; _exports.inheritsLoose = inheritsLoose; _exports.taggedTemplateLiteralLoose = taggedTemplateLiteralLoose; _exports.createClass = createClass; _exports.assertThisInitialized = assertThisInitialized; _exports.possibleConstructorReturn = possibleConstructorReturn; _exports.objectDestructuringEmpty = objectDestructuringEmpty; var setPrototypeOf = Object.setPrototypeOf; var nativeWrapperCache = new Map(); // Super minimal version of Babel's wrapNativeSuper. We only use this for // extending Function, for ComputedDecoratorImpl and AliasDecoratorImpl. We know // we will never directly create an instance of these classes so no need to // include `construct` code or other helpers. function wrapNativeSuper(Class) { if (nativeWrapperCache.has(Class)) { return nativeWrapperCache.get(Class); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); nativeWrapperCache.set(Class, Wrapper); return setPrototypeOf(Wrapper, Class); } function classCallCheck(instance, Constructor) { if (true /* DEBUG */ ) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } } /* Overrides default `inheritsLoose` to _also_ call `Object.setPrototypeOf`. This is needed so that we can use `loose` option with the `@babel/plugin-transform-classes` (because we want simple assignment to the prototype whereever possible) but also keep our constructor based prototypal inheritance working properly */ function inheritsLoose(subClass, superClass) { if (true /* DEBUG */ ) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function'); } } subClass.prototype = Object.create(superClass === null ? null : superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass !== null) { setPrototypeOf(subClass, superClass); } } function taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } 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); } } /* Differs from default implementation by avoiding boolean coercion of `protoProps` and `staticProps`. */ function createClass(Constructor, protoProps, staticProps) { if (protoProps !== null && protoProps !== undefined) { _defineProperties(Constructor.prototype, protoProps); } if (staticProps !== null && staticProps !== undefined) { _defineProperties(Constructor, staticProps); } return Constructor; } function assertThisInitialized(self) { if (true /* DEBUG */ && self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } /* Adds `DEBUG` guard to error being thrown, and avoids boolean coercion of `call`. */ function possibleConstructorReturn(self, call) { if (typeof call === 'object' && call !== null || typeof call === 'function') { return call; } return assertThisInitialized(self); } function objectDestructuringEmpty(obj) { if (true /* DEBUG */ && (obj === null || obj === undefined)) { throw new TypeError('Cannot destructure undefined'); } } }); define("ember-template-compiler/index", ["exports", "@ember/-internals/environment", "@ember/canary-features", "ember/version", "ember-template-compiler/lib/compat", "ember-template-compiler/lib/system/precompile", "ember-template-compiler/lib/system/compile", "ember-template-compiler/lib/system/compile-options", "ember-template-compiler/lib/plugins/index", "ember-template-compiler/lib/system/bootstrap", "ember-template-compiler/lib/system/initializer"], function (_exports, _environment, _canaryFeatures, _version, _compat, _precompile, _compile, _compileOptions, _index, _bootstrap, _initializer) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); Object.defineProperty(_exports, "precompile", { enumerable: true, get: function get() { return _precompile.default; } }); Object.defineProperty(_exports, "compile", { enumerable: true, get: function get() { return _compile.default; } }); Object.defineProperty(_exports, "compileOptions", { enumerable: true, get: function get() { return _compileOptions.default; } }); Object.defineProperty(_exports, "registerPlugin", { enumerable: true, get: function get() { return _compileOptions.registerPlugin; } }); Object.defineProperty(_exports, "unregisterPlugin", { enumerable: true, get: function get() { return _compileOptions.unregisterPlugin; } }); Object.defineProperty(_exports, "defaultPlugins", { enumerable: true, get: function get() { return _index.default; } }); _exports._Ember = void 0; var _Ember = typeof _environment.context.imports.Ember === 'object' && _environment.context.imports.Ember || {}; // private API used by ember-cli-htmlbars to setup ENV and FEATURES _exports._Ember = _Ember; if (!_Ember.ENV) { _Ember.ENV = _environment.ENV; } if (!_Ember.FEATURES) { _Ember.FEATURES = _canaryFeatures.FEATURES; } if (!_Ember.VERSION) { _Ember.VERSION = _version.default; } // used for adding Ember.Handlebars.compile for backwards compat (0, _compat.default)(_Ember); }); define("ember-template-compiler/lib/compat", ["exports", "ember-template-compiler/lib/system/compile", "ember-template-compiler/lib/system/compile-options", "ember-template-compiler/lib/system/precompile"], function (_exports, _compile, _compileOptions, _precompile) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = setupGlobal; function setupGlobal(Ember) { var EmberHandlebars = Ember.Handlebars; if (!EmberHandlebars) { Ember.Handlebars = EmberHandlebars = {}; } var EmberHTMLBars = Ember.HTMLBars; if (!EmberHTMLBars) { Ember.HTMLBars = EmberHTMLBars = {}; } EmberHTMLBars.precompile = EmberHandlebars.precompile = _precompile.default; EmberHTMLBars.compile = EmberHandlebars.compile = _compile.default; EmberHTMLBars.registerPlugin = _compileOptions.registerPlugin; } }); define("ember-template-compiler/lib/plugins/assert-if-helper-without-arguments", ["exports", "@ember/debug", "ember-template-compiler/lib/system/calculate-location-display"], function (_exports, _debug, _calculateLocationDisplay) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = assertIfHelperWithoutArguments; function assertIfHelperWithoutArguments(env) { var moduleName = env.meta.moduleName; return { name: 'assert-if-helper-without-arguments', visitor: { BlockStatement: function BlockStatement(node) { if (isInvalidBlockIf(node)) { (true && !(false) && (0, _debug.assert)(blockAssertMessage(node.path.original) + " " + (0, _calculateLocationDisplay.default)(moduleName, node.loc))); } }, MustacheStatement: function MustacheStatement(node) { if (isInvalidInlineIf(node)) { (true && !(false) && (0, _debug.assert)(inlineAssertMessage(node.path.original) + " " + (0, _calculateLocationDisplay.default)(moduleName, node.loc))); } }, SubExpression: function SubExpression(node) { if (isInvalidInlineIf(node)) { (true && !(false) && (0, _debug.assert)(inlineAssertMessage(node.path.original) + " " + (0, _calculateLocationDisplay.default)(moduleName, node.loc))); } } } }; } function blockAssertMessage(original) { return "#" + original + " requires a single argument."; } function inlineAssertMessage(original) { return "The inline form of the '" + original + "' helper expects two or three arguments."; } function isInvalidInlineIf(node) { return node.path.original === 'if' && (!node.params || node.params.length < 2 || node.params.length > 3); } function isInvalidBlockIf(node) { return node.path.original === 'if' && (!node.params || node.params.length !== 1); } }); define("ember-template-compiler/lib/plugins/assert-input-helper-without-block", ["exports", "@ember/debug", "ember-template-compiler/lib/system/calculate-location-display"], function (_exports, _debug, _calculateLocationDisplay) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = errorOnInputWithContent; function errorOnInputWithContent(env) { var moduleName = env.meta.moduleName; return { name: 'assert-input-helper-without-block', visitor: { BlockStatement: function BlockStatement(node) { if (node.path.original !== 'input') { return; } (true && !(false) && (0, _debug.assert)(assertMessage(moduleName, node))); } } }; } function assertMessage(moduleName, node) { var sourceInformation = (0, _calculateLocationDisplay.default)(moduleName, node.loc); return "The {{input}} helper cannot be used in block form. " + sourceInformation; } }); define("ember-template-compiler/lib/plugins/assert-local-variable-shadowing-helper-invocation", ["exports", "@ember/debug", "ember-template-compiler/lib/system/calculate-location-display"], function (_exports, _debug, _calculateLocationDisplay) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = assertLocalVariableShadowingHelperInvocation; function assertLocalVariableShadowingHelperInvocation(env) { var moduleName = env.meta.moduleName; var locals = []; return { name: 'assert-local-variable-shadowing-helper-invocation', visitor: { Program: { enter: function enter(node) { locals.push(node.blockParams); }, exit: function exit() { locals.pop(); } }, ElementNode: { keys: { children: { enter: function enter(node) { locals.push(node.blockParams); }, exit: function exit() { locals.pop(); } } } }, MustacheStatement: function MustacheStatement(node) { if (isPath(node.path) && hasArguments(node)) { var name = node.path.parts[0]; var type = 'helper'; (true && !(!isLocalVariable(node.path, locals)) && (0, _debug.assert)(messageFor(name, type) + " " + (0, _calculateLocationDisplay.default)(moduleName, node.loc), !isLocalVariable(node.path, locals))); } }, SubExpression: function SubExpression(node) { var name = node.path.parts[0]; var type = 'helper'; (true && !(!isLocalVariable(node.path, locals)) && (0, _debug.assert)(messageFor(name, type) + " " + (0, _calculateLocationDisplay.default)(moduleName, node.loc), !isLocalVariable(node.path, locals))); }, ElementModifierStatement: function ElementModifierStatement(node) { var name = node.path.parts[0]; var type = 'modifier'; (true && !(!isLocalVariable(node.path, locals)) && (0, _debug.assert)(messageFor(name, type) + " " + (0, _calculateLocationDisplay.default)(moduleName, node.loc), !isLocalVariable(node.path, locals))); } } }; } function isLocalVariable(node, locals) { return !node.this && node.parts.length === 1 && hasLocalVariable(node.parts[0], locals); } function hasLocalVariable(name, locals) { return locals.some(function (names) { return names.indexOf(name) !== -1; }); } function messageFor(name, type) { return "Cannot invoke the `" + name + "` " + type + " because it was shadowed by a local variable (i.e. a block param) with the same name. Please rename the local variable to resolve the conflict."; } function isPath(node) { return node.type === 'PathExpression'; } function hasArguments(node) { return node.params.length > 0 || node.hash.pairs.length > 0; } }); define("ember-template-compiler/lib/plugins/assert-modifiers-not-in-components", ["exports", "@ember/debug", "ember-template-compiler/lib/system/calculate-location-display"], function (_exports, _debug, _calculateLocationDisplay) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = assertModifiersNotInComponents; function assertModifiersNotInComponents(env) { var moduleName = env.meta.moduleName; var scopes = []; function isComponentInvocation(node) { return node.tag[0] === '@' || node.tag[0].toUpperCase() === node.tag[0] || node.tag.indexOf('.') > -1 || scopes.some(function (params) { return params.some(function (p) { return p === node.tag; }); }); } return { name: 'assert-modifiers-not-in-components', visitor: { Program: { enter: function enter(node) { scopes.push(node.blockParams); }, exit: function exit() { scopes.pop(); } }, ElementNode: { keys: { children: { enter: function enter(node) { scopes.push(node.blockParams); }, exit: function exit() { scopes.pop(); } } }, enter: function enter(node) { if (node.modifiers.length > 0 && isComponentInvocation(node)) { (true && !(false) && (0, _debug.assert)("Passing modifiers to components require the \"ember-glimmer-forward-modifiers-with-splattributes\" canary feature, which has not been stabilized yet. See RFC #435 for details. " + (0, _calculateLocationDisplay.default)(moduleName, node.loc))); } } } } }; } }); define("ember-template-compiler/lib/plugins/assert-reserved-named-arguments", ["exports", "@ember/debug", "ember-template-compiler/lib/system/calculate-location-display"], function (_exports, _debug, _calculateLocationDisplay) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = assertReservedNamedArguments; function assertReservedNamedArguments(env) { var moduleName = env.meta.moduleName; return { name: 'assert-reserved-named-arguments', visitor: { // In general, we don't assert on the invocation side to avoid creating migration // hazards (e.g. using angle bracket to invoke a classic component that uses // `this.someReservedName`. However, we want to avoid leaking special internal // things, such as `__ARGS__`, so those would need to be asserted on both sides. AttrNode: function AttrNode(_ref) { var name = _ref.name, loc = _ref.loc; if (name === '@__ARGS__') { (true && !(false) && (0, _debug.assert)(assertMessage(name) + " " + (0, _calculateLocationDisplay.default)(moduleName, loc))); } }, HashPair: function HashPair(_ref2) { var key = _ref2.key, loc = _ref2.loc; if (key === '__ARGS__') { (true && !(false) && (0, _debug.assert)(assertMessage(key) + " " + (0, _calculateLocationDisplay.default)(moduleName, loc))); } }, PathExpression: function PathExpression(_ref3) { var original = _ref3.original, loc = _ref3.loc; if (isReserved(original)) { (true && !(false) && (0, _debug.assert)(assertMessage(original) + " " + (0, _calculateLocationDisplay.default)(moduleName, loc))); } } } }; } var RESERVED = ['@arguments', '@args', '@block', '@else']; function isReserved(name) { return RESERVED.indexOf(name) !== -1 || Boolean(name.match(/^@[^a-z]/)); } function assertMessage(name) { return "'" + name + "' is reserved."; } }); define("ember-template-compiler/lib/plugins/assert-splattribute-expression", ["exports", "@ember/debug", "ember-template-compiler/lib/system/calculate-location-display"], function (_exports, _debug, _calculateLocationDisplay) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = assertSplattributeExpressions; function assertSplattributeExpressions(env) { var moduleName = env.meta.moduleName; return { name: 'assert-splattribute-expressions', visitor: { PathExpression: function PathExpression(_ref) { var original = _ref.original, loc = _ref.loc; if (original === '...attributes') { (true && !(false) && (0, _debug.assert)(errorMessage() + " " + (0, _calculateLocationDisplay.default)(moduleName, loc))); } } } }; } function errorMessage() { return '`...attributes` can only be used in the element position e.g. `
`. It cannot be used as a path.'; } }); define("ember-template-compiler/lib/plugins/deprecate-send-action", ["exports", "@ember/debug", "@ember/deprecated-features", "ember-template-compiler/lib/system/calculate-location-display"], function (_exports, _debug, _deprecatedFeatures, _calculateLocationDisplay) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = deprecateSendAction; var EVENTS = ['insert-newline', 'enter', 'escape-press', 'focus-in', 'focus-out', 'key-press', 'key-up', 'key-down']; function deprecateSendAction(env) { if (_deprecatedFeatures.SEND_ACTION) { var moduleName = env.meta.moduleName; var deprecationMessage = function deprecationMessage(node, eventName, actionName) { var sourceInformation = (0, _calculateLocationDisplay.default)(moduleName, node.loc); if (true /* EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS */ && node.type === 'ElementNode') { return "Passing actions to components as strings (like ``) is deprecated. Please use closure actions instead (``). " + sourceInformation; } else { return "Passing actions to components as strings (like `{{input " + eventName + "=\"" + actionName + "\"}}`) is deprecated. Please use closure actions instead (`{{input " + eventName + "=(action \"" + actionName + "\")}}`). " + sourceInformation; } }; return { name: 'deprecate-send-action', visitor: { ElementNode: function ElementNode(node) { if (!true /* EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS */ || node.tag !== 'Input') { return; } node.attributes.forEach(function (_ref) { var name = _ref.name, value = _ref.value; if (name.charAt(0) === '@') { var eventName = name.substring(1); if (EVENTS.indexOf(eventName) > -1) { if (value.type === 'TextNode') { (true && !(false) && (0, _debug.deprecate)(deprecationMessage(node, eventName, value.chars), false, { id: 'ember-component.send-action', until: '4.0.0', url: 'https://emberjs.com/deprecations/v3.x#toc_ember-component-send-action' })); } else if (value.type === 'MustacheStatement' && value.path.type === 'StringLiteral') { (true && !(false) && (0, _debug.deprecate)(deprecationMessage(node, eventName, value.path.original), false, { id: 'ember-component.send-action', until: '4.0.0', url: 'https://emberjs.com/deprecations/v3.x#toc_ember-component-send-action' })); } } } }); }, MustacheStatement: function MustacheStatement(node) { if (node.path.original !== 'input') { return; } node.hash.pairs.forEach(function (pair) { if (EVENTS.indexOf(pair.key) > -1 && pair.value.type === 'StringLiteral') { (true && !(false) && (0, _debug.deprecate)(deprecationMessage(node, pair.key, pair.value.original), false, { id: 'ember-component.send-action', until: '4.0.0', url: 'https://emberjs.com/deprecations/v3.x#toc_ember-component-send-action' })); } }); } } }; } return; } }); define("ember-template-compiler/lib/plugins/index", ["exports", "ember-template-compiler/lib/plugins/assert-if-helper-without-arguments", "ember-template-compiler/lib/plugins/assert-input-helper-without-block", "ember-template-compiler/lib/plugins/assert-local-variable-shadowing-helper-invocation", "ember-template-compiler/lib/plugins/assert-modifiers-not-in-components", "ember-template-compiler/lib/plugins/assert-reserved-named-arguments", "ember-template-compiler/lib/plugins/assert-splattribute-expression", "ember-template-compiler/lib/plugins/deprecate-send-action", "ember-template-compiler/lib/plugins/transform-action-syntax", "ember-template-compiler/lib/plugins/transform-attrs-into-args", "ember-template-compiler/lib/plugins/transform-component-invocation", "ember-template-compiler/lib/plugins/transform-each-in-into-each", "ember-template-compiler/lib/plugins/transform-has-block-syntax", "ember-template-compiler/lib/plugins/transform-in-element", "ember-template-compiler/lib/plugins/transform-input-type-syntax", "ember-template-compiler/lib/plugins/transform-link-to", "ember-template-compiler/lib/plugins/transform-old-class-binding-syntax", "ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings", "@ember/deprecated-features"], function (_exports, _assertIfHelperWithoutArguments, _assertInputHelperWithoutBlock, _assertLocalVariableShadowingHelperInvocation, _assertModifiersNotInComponents, _assertReservedNamedArguments, _assertSplattributeExpression, _deprecateSendAction, _transformActionSyntax, _transformAttrsIntoArgs, _transformComponentInvocation, _transformEachInIntoEach, _transformHasBlockSyntax, _transformInElement, _transformInputTypeSyntax, _transformLinkTo, _transformOldClassBindingSyntax, _transformQuotedBindingsIntoJustBindings, _deprecatedFeatures) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; var transforms = [_transformComponentInvocation.default, _transformOldClassBindingSyntax.default, _transformQuotedBindingsIntoJustBindings.default, _assertReservedNamedArguments.default, _transformActionSyntax.default, _transformAttrsIntoArgs.default, _transformEachInIntoEach.default, _transformHasBlockSyntax.default, _assertLocalVariableShadowingHelperInvocation.default, _transformLinkTo.default, _assertInputHelperWithoutBlock.default, _transformInElement.default, _assertIfHelperWithoutArguments.default, _assertSplattributeExpression.default]; if (!true /* EMBER_GLIMMER_ANGLE_BRACKET_BUILT_INS */ ) { transforms.push(_transformInputTypeSyntax.default); } if (!true /* EMBER_GLIMMER_FORWARD_MODIFIERS_WITH_SPLATTRIBUTES */ ) { transforms.push(_assertModifiersNotInComponents.default); } if (_deprecatedFeatures.SEND_ACTION) { transforms.push(_deprecateSendAction.default); } var _default = Object.freeze(transforms); _exports.default = _default; }); define("ember-template-compiler/lib/plugins/transform-action-syntax", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = transformActionSyntax; /** @module ember */ /** A Glimmer2 AST transformation that replaces all instances of ```handlebars