diff --git a/apps/codelab/src/app/codelabs/angular/forms/samples/basic/main.ts b/apps/codelab/src/app/codelabs/angular/forms/samples/basic/main.ts index d31221695..77dc85c17 100644 --- a/apps/codelab/src/app/codelabs/angular/forms/samples/basic/main.ts +++ b/apps/codelab/src/app/codelabs/angular/forms/samples/basic/main.ts @@ -5,8 +5,15 @@ import * as code from './code'; class MyResourceLoader extends ResourceLoader { get(url: string): Promise { + let searchString = url.replace(/[\/\.-]/gi, '_'); + + // TODO(sancheez): fix load templates with relative url (relative url in Component) + if (url.startsWith(".")) { + searchString = searchString.substring(2); + } + const templateId = Object.keys(code).find((key) => - key.includes(url.replace(/[\/\.-]/gi, '_')) + key.includes(searchString) ); const template = code[templateId]; if (!template) { diff --git a/apps/codelab/src/app/codelabs/angular/material/samples/basic/main.ts b/apps/codelab/src/app/codelabs/angular/material/samples/basic/main.ts index df35b7995..bfd6e65a8 100644 --- a/apps/codelab/src/app/codelabs/angular/material/samples/basic/main.ts +++ b/apps/codelab/src/app/codelabs/angular/material/samples/basic/main.ts @@ -5,8 +5,15 @@ import * as code from './code'; class MyResourceLoader extends ResourceLoader { get(url: string): Promise { + let searchString = url.replace(/[\/\.-]/gi, '_'); + + // TODO(sancheez): fix load templates with relative url (relative url in Component) + if (url.startsWith(".")) { + searchString = searchString.substring(2); + } + const templateId = Object.keys(code).find((key) => - key.includes(url.replace(/[\/\.-]/gi, '_')) + key.includes(searchString) ); const template = code[templateId]; if (!template) { diff --git a/apps/codelab/src/app/codelabs/angular/router/samples/simple-router/main.ts b/apps/codelab/src/app/codelabs/angular/router/samples/simple-router/main.ts index 2588824af..b298a5c1e 100644 --- a/apps/codelab/src/app/codelabs/angular/router/samples/simple-router/main.ts +++ b/apps/codelab/src/app/codelabs/angular/router/samples/simple-router/main.ts @@ -5,9 +5,18 @@ import * as code from './code'; class MyResourceLoader extends ResourceLoader { get(url: string): Promise { + + let searchString = url.replace(/[\/\.-]/gi, '_'); + + // TODO(sancheez): fix load templates with relative url (relative url in Component) + if (url.startsWith(".")) { + searchString = searchString.substring(2); + } + const templateId = Object.keys(code).find((key) => - key.includes(url.replace(/[\/\.-]/gi, '_')) + key.includes(searchString) ); + const template = code[templateId]; if (!template) { console.log(template); diff --git a/apps/codelab/src/app/components/angular-test-runner/angular-test-runner.component.ts b/apps/codelab/src/app/components/angular-test-runner/angular-test-runner.component.ts index 3f3a9df2d..262977112 100644 --- a/apps/codelab/src/app/components/angular-test-runner/angular-test-runner.component.ts +++ b/apps/codelab/src/app/components/angular-test-runner/angular-test-runner.component.ts @@ -12,53 +12,11 @@ import { SimpleChanges, ViewChild, } from '@angular/core'; -import babel_traverse from '@babel/traverse'; -import * as babylon from 'babylon'; -import * as babel_types from 'babel-types'; +import { addMetaInformation, createSystemJsSandbox } from '@codelab/code-demos'; +import { ScriptLoaderService } from '@codelab/sandbox-runner'; import { BehaviorSubject, Subscription } from 'rxjs'; -import { handleTestMessage } from './tests'; import { TestRunResult } from '@codelab/utils'; -import { createSystemJsSandbox } from '@codelab/code-demos'; -import { getTypeScript, ScriptLoaderService } from '@codelab/sandbox-runner'; - -const ts = getTypeScript(); - -// TODO(kirjs): This is a duplicate -export function addMetaInformation(sandbox, files: { [key: string]: string }) { - // sandbox.evalJs(`System.registry.delete(System.normalizeSync('./code'));`); - - (sandbox.iframe.contentWindow as any).System.register( - 'code', - [], - function (exports) { - return { - setters: [], - execute: function () { - exports('ts', ts); - exports('babylon', babylon); - exports('babel_traverse', babel_traverse); - exports('babel_types', babel_types); - Object.entries(files) - .filter(([moduleName]) => moduleName.match(/\.ts$/)) - .forEach(([path, code]) => { - exports(path.replace(/[\/.-]/gi, '_'), code); - exports( - path.replace(/[\/.-]/gi, '_') + '_AST', - ts.createSourceFile(path, code, ts.ScriptTarget.ES5) - ); - }); - - Object.entries(files) - .filter(([moduleName]) => moduleName.match(/\.html/)) - .forEach(([path, code]) => { - const templatePath = path.replace(/[\/.-]/gi, '_'); - exports(templatePath, code); - }); - }, - }; - } - ); -} +import { handleTestMessage } from './tests'; @Component({ selector: 'codelab-simple-angular-test-runner', @@ -123,6 +81,11 @@ export class SimpleAngularTestRunnerComponent { id: 'testing', url: '/assets/runner', + }, + ({ evalJs }) => { + evalJs(this.scriptLoaderService.getScript('chai')); + evalJs(this.scriptLoaderService.getScript('zone')); + evalJs(this.scriptLoaderService.getScript('reflectMetadata')); } ); @@ -131,21 +94,19 @@ export class SimpleAngularTestRunnerComponent '
' ); - sandbox.evalJs(this.scriptLoaderService.getScript('chai')); sandbox.evalJs(this.scriptLoaderService.getScript('mocha')); sandbox.evalJs(this.scriptLoaderService.getScript('test-bootstrap')); - sandbox.evalJs(this.scriptLoaderService.getScript('shim')); - sandbox.evalJs(this.scriptLoaderService.getScript('zone')); - // sandbox.evalJs(this.scriptLoaderService.getScript('system-config')); - sandbox.evalJs(this.scriptLoaderService.getScript('ng-bundle')); this.subscription = this.changedFilesSubject.subscribe((files) => { + addMetaInformation(sandbox, this.code); + + const hasErrors = Object.entries(files) - .filter(([path]) => path.match(/\.js$/)) + .filter(([path]) => path.match(/\.js$/) && !path.startsWith('code')) .map(([path, code]) => { try { - sandbox.evalJs(`console.log('I remove modul')`); - addMetaInformation(sandbox, this.code); + + sandbox.evalJs(`console.log('I remove module')`); sandbox.evalJs(code); } catch (e) { console.groupCollapsed(e.message); @@ -158,7 +119,7 @@ export class SimpleAngularTestRunnerComponent .some((a) => a); if (!hasErrors) { - sandbox.evalJs(`System.import('${this.bootstrap}')`); + sandbox.evalJs(`System.import('./${this.bootstrap}')`); } }); } diff --git a/apps/codelab/src/app/shared/angular-code/bootstrap.ts b/apps/codelab/src/app/shared/angular-code/bootstrap.ts index 8388ba129..c07fa280d 100644 --- a/apps/codelab/src/app/shared/angular-code/bootstrap.ts +++ b/apps/codelab/src/app/shared/angular-code/bootstrap.ts @@ -5,8 +5,16 @@ import { AppModule } from './app.module'; class MyResourceLoader extends ResourceLoader { get(url: string): Promise { + + let searchString = url.replace(/[\/\.-]/gi, '_'); + + // TODO(sancheez): fix load templates with relative url (relative url in Component) + if (url.startsWith(".")) { + searchString = searchString.substring(2); + } + const templateId = Object.keys(code).find((key) => - key.includes(url.replace(/[\/\.-]/gi, '_')) + key.includes(searchString) ); const template = code[templateId]; if (!template) { diff --git a/libs/code-demos/assets/runner/js/chai.js b/libs/code-demos/assets/runner/js/chai.js new file mode 100644 index 000000000..5374225b3 --- /dev/null +++ b/libs/code-demos/assets/runner/js/chai.js @@ -0,0 +1,11432 @@ +var chai = (function () { + 'use strict'; + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + function getAugmentedNamespace(n) { + var f = n.default; + if (typeof f == "function") { + var a = function a () { + if (this instanceof a) { + var args = [null]; + args.push.apply(args, arguments); + var Ctor = Function.bind.apply(f, args); + return new Ctor(); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; + } + + var chai$1 = {exports: {}}; + + var chai = {}; + + /*! + * assertion-error + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */ + + /*! + * Return a function that will copy properties from + * one object to another excluding any originally + * listed. Returned function will create a new `{}`. + * + * @param {String} excluded properties ... + * @return {Function} + */ + + function exclude () { + var excludes = [].slice.call(arguments); + + function excludeProps (res, obj) { + Object.keys(obj).forEach(function (key) { + if (!~excludes.indexOf(key)) res[key] = obj[key]; + }); + } + + return function extendExclude () { + var args = [].slice.call(arguments) + , i = 0 + , res = {}; + + for (; i < args.length; i++) { + excludeProps(res, args[i]); + } + + return res; + }; + } + /*! + * Primary Exports + */ + + var assertionError = AssertionError$1; + + /** + * ### AssertionError + * + * An extension of the JavaScript `Error` constructor for + * assertion and validation scenarios. + * + * @param {String} message + * @param {Object} properties to include (optional) + * @param {callee} start stack function (optional) + */ + + function AssertionError$1 (message, _props, ssf) { + var extend = exclude('name', 'message', 'stack', 'constructor', 'toJSON') + , props = extend(_props || {}); + + // default values + this.message = message || 'Unspecified AssertionError'; + this.showDiff = false; + + // copy from properties + for (var key in props) { + this[key] = props[key]; + } + + // capture stack trace + ssf = ssf || AssertionError$1; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, ssf); + } else { + try { + throw new Error(); + } catch(e) { + this.stack = e.stack; + } + } + } + + /*! + * Inherit from Error.prototype + */ + + AssertionError$1.prototype = Object.create(Error.prototype); + + /*! + * Statically set name + */ + + AssertionError$1.prototype.name = 'AssertionError'; + + /*! + * Ensure correct constructor + */ + + AssertionError$1.prototype.constructor = AssertionError$1; + + /** + * Allow errors to be converted to JSON for static transfer. + * + * @param {Boolean} include stack (default: `true`) + * @return {Object} object that can be `JSON.stringify` + */ + + AssertionError$1.prototype.toJSON = function (stack) { + var extend = exclude('constructor', 'toJSON', 'stack') + , props = extend({ name: this.name }, this); + + // include stack if exists and not turned off + if (false !== stack && this.stack) { + props.stack = this.stack; + } + + return props; + }; + + var utils = {}; + + /* ! + * Chai - pathval utility + * Copyright(c) 2012-2014 Jake Luer + * @see https://github.com/logicalparadox/filtr + * MIT Licensed + */ + + /** + * ### .hasProperty(object, name) + * + * This allows checking whether an object has own + * or inherited from prototype chain named property. + * + * Basically does the same thing as the `in` + * operator but works properly with null/undefined values + * and other primitives. + * + * var obj = { + * arr: ['a', 'b', 'c'] + * , str: 'Hello' + * } + * + * The following would be the results. + * + * hasProperty(obj, 'str'); // true + * hasProperty(obj, 'constructor'); // true + * hasProperty(obj, 'bar'); // false + * + * hasProperty(obj.str, 'length'); // true + * hasProperty(obj.str, 1); // true + * hasProperty(obj.str, 5); // false + * + * hasProperty(obj.arr, 'length'); // true + * hasProperty(obj.arr, 2); // true + * hasProperty(obj.arr, 3); // false + * + * @param {Object} object + * @param {String|Symbol} name + * @returns {Boolean} whether it exists + * @namespace Utils + * @name hasProperty + * @api public + */ + + function hasProperty(obj, name) { + if (typeof obj === 'undefined' || obj === null) { + return false; + } + + // The `in` operator does not work with primitives. + return name in Object(obj); + } + + /* ! + * ## parsePath(path) + * + * Helper function used to parse string object + * paths. Use in conjunction with `internalGetPathValue`. + * + * var parsed = parsePath('myobject.property.subprop'); + * + * ### Paths: + * + * * Can be infinitely deep and nested. + * * Arrays are also valid using the formal `myobject.document[3].property`. + * * Literal dots and brackets (not delimiter) must be backslash-escaped. + * + * @param {String} path + * @returns {Object} parsed + * @api private + */ + + function parsePath(path) { + var str = path.replace(/([^\\])\[/g, '$1.['); + var parts = str.match(/(\\\.|[^.]+?)+/g); + return parts.map(function mapMatches(value) { + if ( + value === 'constructor' || + value === '__proto__' || + value === 'prototype' + ) { + return {}; + } + var regexp = /^\[(\d+)\]$/; + var mArr = regexp.exec(value); + var parsed = null; + if (mArr) { + parsed = { i: parseFloat(mArr[1]) }; + } else { + parsed = { p: value.replace(/\\([.[\]])/g, '$1') }; + } + + return parsed; + }); + } + + /* ! + * ## internalGetPathValue(obj, parsed[, pathDepth]) + * + * Helper companion function for `.parsePath` that returns + * the value located at the parsed address. + * + * var value = getPathValue(obj, parsed); + * + * @param {Object} object to search against + * @param {Object} parsed definition from `parsePath`. + * @param {Number} depth (nesting level) of the property we want to retrieve + * @returns {Object|Undefined} value + * @api private + */ + + function internalGetPathValue(obj, parsed, pathDepth) { + var temporaryValue = obj; + var res = null; + pathDepth = typeof pathDepth === 'undefined' ? parsed.length : pathDepth; + + for (var i = 0; i < pathDepth; i++) { + var part = parsed[i]; + if (temporaryValue) { + if (typeof part.p === 'undefined') { + temporaryValue = temporaryValue[part.i]; + } else { + temporaryValue = temporaryValue[part.p]; + } + + if (i === pathDepth - 1) { + res = temporaryValue; + } + } + } + + return res; + } + + /* ! + * ## internalSetPathValue(obj, value, parsed) + * + * Companion function for `parsePath` that sets + * the value located at a parsed address. + * + * internalSetPathValue(obj, 'value', parsed); + * + * @param {Object} object to search and define on + * @param {*} value to use upon set + * @param {Object} parsed definition from `parsePath` + * @api private + */ + + function internalSetPathValue(obj, val, parsed) { + var tempObj = obj; + var pathDepth = parsed.length; + var part = null; + // Here we iterate through every part of the path + for (var i = 0; i < pathDepth; i++) { + var propName = null; + var propVal = null; + part = parsed[i]; + + // If it's the last part of the path, we set the 'propName' value with the property name + if (i === pathDepth - 1) { + propName = typeof part.p === 'undefined' ? part.i : part.p; + // Now we set the property with the name held by 'propName' on object with the desired val + tempObj[propName] = val; + } else if (typeof part.p !== 'undefined' && tempObj[part.p]) { + tempObj = tempObj[part.p]; + } else if (typeof part.i !== 'undefined' && tempObj[part.i]) { + tempObj = tempObj[part.i]; + } else { + // If the obj doesn't have the property we create one with that name to define it + var next = parsed[i + 1]; + // Here we set the name of the property which will be defined + propName = typeof part.p === 'undefined' ? part.i : part.p; + // Here we decide if this property will be an array or a new object + propVal = typeof next.p === 'undefined' ? [] : {}; + tempObj[propName] = propVal; + tempObj = tempObj[propName]; + } + } + } + + /** + * ### .getPathInfo(object, path) + * + * This allows the retrieval of property info in an + * object given a string path. + * + * The path info consists of an object with the + * following properties: + * + * * parent - The parent object of the property referenced by `path` + * * name - The name of the final property, a number if it was an array indexer + * * value - The value of the property, if it exists, otherwise `undefined` + * * exists - Whether the property exists or not + * + * @param {Object} object + * @param {String} path + * @returns {Object} info + * @namespace Utils + * @name getPathInfo + * @api public + */ + + function getPathInfo(obj, path) { + var parsed = parsePath(path); + var last = parsed[parsed.length - 1]; + var info = { + parent: + parsed.length > 1 ? + internalGetPathValue(obj, parsed, parsed.length - 1) : + obj, + name: last.p || last.i, + value: internalGetPathValue(obj, parsed), + }; + info.exists = hasProperty(info.parent, info.name); + + return info; + } + + /** + * ### .getPathValue(object, path) + * + * This allows the retrieval of values in an + * object given a string path. + * + * var obj = { + * prop1: { + * arr: ['a', 'b', 'c'] + * , str: 'Hello' + * } + * , prop2: { + * arr: [ { nested: 'Universe' } ] + * , str: 'Hello again!' + * } + * } + * + * The following would be the results. + * + * getPathValue(obj, 'prop1.str'); // Hello + * getPathValue(obj, 'prop1.att[2]'); // b + * getPathValue(obj, 'prop2.arr[0].nested'); // Universe + * + * @param {Object} object + * @param {String} path + * @returns {Object} value or `undefined` + * @namespace Utils + * @name getPathValue + * @api public + */ + + function getPathValue(obj, path) { + var info = getPathInfo(obj, path); + return info.value; + } + + /** + * ### .setPathValue(object, path, value) + * + * Define the value in an object at a given string path. + * + * ```js + * var obj = { + * prop1: { + * arr: ['a', 'b', 'c'] + * , str: 'Hello' + * } + * , prop2: { + * arr: [ { nested: 'Universe' } ] + * , str: 'Hello again!' + * } + * }; + * ``` + * + * The following would be acceptable. + * + * ```js + * var properties = require('tea-properties'); + * properties.set(obj, 'prop1.str', 'Hello Universe!'); + * properties.set(obj, 'prop1.arr[2]', 'B'); + * properties.set(obj, 'prop2.arr[0].nested.value', { hello: 'universe' }); + * ``` + * + * @param {Object} object + * @param {String} path + * @param {Mixed} value + * @api private + */ + + function setPathValue(obj, path, val) { + var parsed = parsePath(path); + internalSetPathValue(obj, val, parsed); + return obj; + } + + var pathval = { + hasProperty: hasProperty, + getPathInfo: getPathInfo, + getPathValue: getPathValue, + setPathValue: setPathValue, + }; + + /*! + * Chai - flag utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /** + * ### .flag(object, key, [value]) + * + * Get or set a flag value on an object. If a + * value is provided it will be set, else it will + * return the currently set value or `undefined` if + * the value is not set. + * + * utils.flag(this, 'foo', 'bar'); // setter + * utils.flag(this, 'foo'); // getter, returns `bar` + * + * @param {Object} object constructed Assertion + * @param {String} key + * @param {Mixed} value (optional) + * @namespace Utils + * @name flag + * @api private + */ + + var flag$5 = function flag(obj, key, value) { + var flags = obj.__flags || (obj.__flags = Object.create(null)); + if (arguments.length === 3) { + flags[key] = value; + } else { + return flags[key]; + } + }; + + /*! + * Chai - test utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /*! + * Module dependencies + */ + + var flag$4 = flag$5; + + /** + * ### .test(object, expression) + * + * Test and object for expression. + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name test + */ + + var test = function test(obj, args) { + var negate = flag$4(obj, 'negate') + , expr = args[0]; + return negate ? !expr : expr; + }; + + var typeDetect = {exports: {}}; + + (function (module, exports) { + (function (global, factory) { + module.exports = factory() ; + }(commonjsGlobal, (function () { + /* ! + * type-detect + * Copyright(c) 2013 jake luer + * MIT Licensed + */ + var promiseExists = typeof Promise === 'function'; + + /* eslint-disable no-undef */ + var globalObject = typeof self === 'object' ? self : commonjsGlobal; // eslint-disable-line id-blacklist + + var symbolExists = typeof Symbol !== 'undefined'; + var mapExists = typeof Map !== 'undefined'; + var setExists = typeof Set !== 'undefined'; + var weakMapExists = typeof WeakMap !== 'undefined'; + var weakSetExists = typeof WeakSet !== 'undefined'; + var dataViewExists = typeof DataView !== 'undefined'; + var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; + var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; + var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; + var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; + var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); + var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); + var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; + var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); + var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; + var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); + var toStringLeftSliceLength = 8; + var toStringRightSliceLength = -1; + /** + * ### typeOf (obj) + * + * Uses `Object.prototype.toString` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */ + function typeDetect(obj) { + /* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */ + var typeofObj = typeof obj; + if (typeofObj !== 'object') { + return typeofObj; + } + + /* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */ + if (obj === null) { + return 'null'; + } + + /* ! Spec Conformance + * Test: `Object.prototype.toString.call(window)`` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: `Object.prototype.toString.call(this)`` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */ + if (obj === globalObject) { + return 'global'; + } + + /* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */ + if ( + Array.isArray(obj) && + (symbolToStringTagExists === false || !(Symbol.toStringTag in obj)) + ) { + return 'Array'; + } + + // Not caching existence of `window` and related properties due to potential + // for `window` to be unset before tests in quasi-browser environments. + if (typeof window === 'object' && window !== null) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The `Location` interface + * Test: `Object.prototype.toString.call(window.location)`` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */ + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The `Document` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: `Object.prototype.toString.call(document)`` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */ + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + + if (typeof window.navigator === 'object') { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: `Object.prototype.toString.call(navigator.mimeTypes)`` + * - IE <=10 === "[object MSMimeTypesCollection]" + */ + if (typeof window.navigator.mimeTypes === 'object' && + obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: `Object.prototype.toString.call(navigator.plugins)`` + * - IE <=10 === "[object MSPluginsCollection]" + */ + if (typeof window.navigator.plugins === 'object' && + obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + + if ((typeof window.HTMLElement === 'function' || + typeof window.HTMLElement === 'object') && + obj instanceof window.HTMLElement) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement` + * Test: `Object.prototype.toString.call(document.createElement('blockquote'))`` + * - IE <=10 === "[object HTMLBlockElement]" + */ + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + + /* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */ + var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); + if (typeof stringTag === 'string') { + return stringTag; + } + + var objPrototype = Object.getPrototypeOf(obj); + /* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */ + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + + /* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */ + if (objPrototype === Date.prototype) { + return 'Date'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: `Object.prototype.toString.call(Promise.resolve())`` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */ + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + + /* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */ + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + + /* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */ + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + + /* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */ + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + + /* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */ + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))`` + * - Edge <=13 === "[object Object]" + */ + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: `Object.prototype.toString.call(new Map().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: `Object.prototype.toString.call(new Set().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: `Object.prototype.toString.call([][Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: `Object.prototype.toString.call(''[Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + + /* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */ + if (objPrototype === null) { + return 'Object'; + } + + return Object + .prototype + .toString + .call(obj) + .slice(toStringLeftSliceLength, toStringRightSliceLength); + } + + return typeDetect; + + }))); + } (typeDetect)); + + /*! + * Chai - expectTypes utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /** + * ### .expectTypes(obj, types) + * + * Ensures that the object being tested against is of a valid type. + * + * utils.expectTypes(this, ['array', 'object', 'string']); + * + * @param {Mixed} obj constructed Assertion + * @param {Array} type A list of allowed types for this assertion + * @namespace Utils + * @name expectTypes + * @api public + */ + + var AssertionError = assertionError; + var flag$3 = flag$5; + var type$2 = typeDetect.exports; + + var expectTypes = function expectTypes(obj, types) { + var flagMsg = flag$3(obj, 'message'); + var ssfi = flag$3(obj, 'ssfi'); + + flagMsg = flagMsg ? flagMsg + ': ' : ''; + + obj = flag$3(obj, 'object'); + types = types.map(function (t) { return t.toLowerCase(); }); + types.sort(); + + // Transforms ['lorem', 'ipsum'] into 'a lorem, or an ipsum' + var str = types.map(function (t, index) { + var art = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(t.charAt(0)) ? 'an' : 'a'; + var or = types.length > 1 && index === types.length - 1 ? 'or ' : ''; + return or + art + ' ' + t; + }).join(', '); + + var objType = type$2(obj).toLowerCase(); + + if (!types.some(function (expected) { return objType === expected; })) { + throw new AssertionError( + flagMsg + 'object tested must be ' + str + ', but ' + objType + ' given', + undefined, + ssfi + ); + } + }; + + /*! + * Chai - getActual utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /** + * ### .getActual(object, [actual]) + * + * Returns the `actual` value for an Assertion. + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name getActual + */ + + var getActual$1 = function getActual(obj, args) { + return args.length > 4 ? args[4] : obj._obj; + }; + + /* ! + * Chai - getFuncName utility + * Copyright(c) 2012-2016 Jake Luer + * MIT Licensed + */ + + /** + * ### .getFuncName(constructorFn) + * + * Returns the name of a function. + * When a non-function instance is passed, returns `null`. + * This also includes a polyfill function if `aFunc.name` is not defined. + * + * @name getFuncName + * @param {Function} funct + * @namespace Utils + * @api public + */ + + var toString$1 = Function.prototype.toString; + var functionNameMatch$1 = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/; + function getFuncName(aFunc) { + if (typeof aFunc !== 'function') { + return null; + } + + var name = ''; + if (typeof Function.prototype.name === 'undefined' && typeof aFunc.name === 'undefined') { + // Here we run a polyfill if Function does not support the `name` property and if aFunc.name is not defined + var match = toString$1.call(aFunc).match(functionNameMatch$1); + if (match) { + name = match[1]; + } + } else { + // If we've got a `name` property we just use it + name = aFunc.name; + } + + return name; + } + + var getFuncName_1 = getFuncName; + + const ansiColors = { + bold: ['1', '22'], + dim: ['2', '22'], + italic: ['3', '23'], + underline: ['4', '24'], + // 5 & 6 are blinking + inverse: ['7', '27'], + hidden: ['8', '28'], + strike: ['9', '29'], + // 10-20 are fonts + // 21-29 are resets for 1-9 + black: ['30', '39'], + red: ['31', '39'], + green: ['32', '39'], + yellow: ['33', '39'], + blue: ['34', '39'], + magenta: ['35', '39'], + cyan: ['36', '39'], + white: ['37', '39'], + + brightblack: ['30;1', '39'], + brightred: ['31;1', '39'], + brightgreen: ['32;1', '39'], + brightyellow: ['33;1', '39'], + brightblue: ['34;1', '39'], + brightmagenta: ['35;1', '39'], + brightcyan: ['36;1', '39'], + brightwhite: ['37;1', '39'], + + grey: ['90', '39'], + }; + + const styles = { + special: 'cyan', + number: 'yellow', + bigint: 'yellow', + boolean: 'yellow', + undefined: 'grey', + null: 'bold', + string: 'green', + symbol: 'green', + date: 'magenta', + regexp: 'red', + }; + + const truncator = '…'; + + function colorise(value, styleType) { + const color = ansiColors[styles[styleType]] || ansiColors[styleType]; + if (!color) { + return String(value) + } + return `\u001b[${color[0]}m${String(value)}\u001b[${color[1]}m` + } + + function normaliseOptions({ + showHidden = false, + depth = 2, + colors = false, + customInspect = true, + showProxy = false, + maxArrayLength = Infinity, + breakLength = Infinity, + seen = [], + // eslint-disable-next-line no-shadow + truncate = Infinity, + stylize = String, + } = {}) { + const options = { + showHidden: Boolean(showHidden), + depth: Number(depth), + colors: Boolean(colors), + customInspect: Boolean(customInspect), + showProxy: Boolean(showProxy), + maxArrayLength: Number(maxArrayLength), + breakLength: Number(breakLength), + truncate: Number(truncate), + seen, + stylize, + }; + if (options.colors) { + options.stylize = colorise; + } + return options + } + + function truncate(string, length, tail = truncator) { + string = String(string); + const tailLength = tail.length; + const stringLength = string.length; + if (tailLength > length && stringLength > tailLength) { + return tail + } + if (stringLength > length && stringLength > tailLength) { + return `${string.slice(0, length - tailLength)}${tail}` + } + return string + } + + // eslint-disable-next-line complexity + function inspectList(list, options, inspectItem, separator = ', ') { + inspectItem = inspectItem || options.inspect; + const size = list.length; + if (size === 0) return '' + const originalLength = options.truncate; + let output = ''; + let peek = ''; + let truncated = ''; + for (let i = 0; i < size; i += 1) { + const last = i + 1 === list.length; + const secondToLast = i + 2 === list.length; + truncated = `${truncator}(${list.length - i})`; + const value = list[i]; + + // If there is more than one remaining we need to account for a separator of `, ` + options.truncate = originalLength - output.length - (last ? 0 : separator.length); + const string = peek || inspectItem(value, options) + (last ? '' : separator); + const nextLength = output.length + string.length; + const truncatedLength = nextLength + truncated.length; + + // If this is the last element, and adding it would + // take us over length, but adding the truncator wouldn't - then break now + if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) { + break + } + + // If this isn't the last or second to last element to scan, + // but the string is already over length then break here + if (!last && !secondToLast && truncatedLength > originalLength) { + break + } + + // Peek at the next string to determine if we should + // break early before adding this item to the output + peek = last ? '' : inspectItem(list[i + 1], options) + (secondToLast ? '' : separator); + + // If we have one element left, but this element and + // the next takes over length, the break early + if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) { + break + } + + output += string; + + // If the next element takes us to length - + // but there are more after that, then we should truncate now + if (!last && !secondToLast && nextLength + peek.length >= originalLength) { + truncated = `${truncator}(${list.length - i - 1})`; + break + } + + truncated = ''; + } + return `${output}${truncated}` + } + + function quoteComplexKey(key) { + if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) { + return key + } + return JSON.stringify(key) + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'") + } + + function inspectProperty([key, value], options) { + options.truncate -= 2; + if (typeof key === 'string') { + key = quoteComplexKey(key); + } else if (typeof key !== 'number') { + key = `[${options.inspect(key, options)}]`; + } + options.truncate -= key.length; + value = options.inspect(value, options); + return `${key}: ${value}` + } + + function inspectArray(array, options) { + // Object.keys will always output the Array indices first, so we can slice by + // `array.length` to get non-index properties + const nonIndexProperties = Object.keys(array).slice(array.length); + if (!array.length && !nonIndexProperties.length) return '[]' + options.truncate -= 4; + const listContents = inspectList(array, options); + options.truncate -= listContents.length; + let propertyContents = ''; + if (nonIndexProperties.length) { + propertyContents = inspectList( + nonIndexProperties.map(key => [key, array[key]]), + options, + inspectProperty + ); + } + return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ''} ]` + } + + const getArrayName = array => { + // We need to special case Node.js' Buffers, which report to be Uint8Array + if (typeof Buffer === 'function' && array instanceof Buffer) { + return 'Buffer' + } + if (array[Symbol.toStringTag]) { + return array[Symbol.toStringTag] + } + return getFuncName_1(array.constructor) + }; + + function inspectTypedArray(array, options) { + const name = getArrayName(array); + options.truncate -= name.length + 4; + // Object.keys will always output the Array indices first, so we can slice by + // `array.length` to get non-index properties + const nonIndexProperties = Object.keys(array).slice(array.length); + if (!array.length && !nonIndexProperties.length) return `${name}[]` + // As we know TypedArrays only contain Unsigned Integers, we can skip inspecting each one and simply + // stylise the toString() value of them + let output = ''; + for (let i = 0; i < array.length; i++) { + const string = `${options.stylize(truncate(array[i], options.truncate), 'number')}${ + i === array.length - 1 ? '' : ', ' + }`; + options.truncate -= string.length; + if (array[i] !== array.length && options.truncate <= 3) { + output += `${truncator}(${array.length - array[i] + 1})`; + break + } + output += string; + } + let propertyContents = ''; + if (nonIndexProperties.length) { + propertyContents = inspectList( + nonIndexProperties.map(key => [key, array[key]]), + options, + inspectProperty + ); + } + return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ''} ]` + } + + function inspectDate(dateObject, options) { + const stringRepresentation = dateObject.toJSON(); + + if (stringRepresentation === null) { + return 'Invalid Date' + } + + const split = stringRepresentation.split('T'); + const date = split[0]; + // If we need to - truncate the time portion, but never the date + return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, 'date') + } + + function inspectFunction(func, options) { + const name = getFuncName_1(func); + if (!name) { + return options.stylize('[Function]', 'special') + } + return options.stylize(`[Function ${truncate(name, options.truncate - 11)}]`, 'special') + } + + function inspectMapEntry([key, value], options) { + options.truncate -= 4; + key = options.inspect(key, options); + options.truncate -= key.length; + value = options.inspect(value, options); + return `${key} => ${value}` + } + + // IE11 doesn't support `map.entries()` + function mapToEntries(map) { + const entries = []; + map.forEach((value, key) => { + entries.push([key, value]); + }); + return entries + } + + function inspectMap(map, options) { + const size = map.size - 1; + if (size <= 0) { + return 'Map{}' + } + options.truncate -= 7; + return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }` + } + + const isNaN$1 = Number.isNaN || (i => i !== i); // eslint-disable-line no-self-compare + function inspectNumber(number, options) { + if (isNaN$1(number)) { + return options.stylize('NaN', 'number') + } + if (number === Infinity) { + return options.stylize('Infinity', 'number') + } + if (number === -Infinity) { + return options.stylize('-Infinity', 'number') + } + if (number === 0) { + return options.stylize(1 / number === Infinity ? '+0' : '-0', 'number') + } + return options.stylize(truncate(number, options.truncate), 'number') + } + + function inspectBigInt(number, options) { + let nums = truncate(number.toString(), options.truncate - 1); + if (nums !== truncator) nums += 'n'; + return options.stylize(nums, 'bigint') + } + + function inspectRegExp(value, options) { + const flags = value.toString().split('/')[2]; + const sourceLength = options.truncate - (2 + flags.length); + const source = value.source; + return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, 'regexp') + } + + // IE11 doesn't support `Array.from(set)` + function arrayFromSet(set) { + const values = []; + set.forEach(value => { + values.push(value); + }); + return values + } + + function inspectSet(set, options) { + if (set.size === 0) return 'Set{}' + options.truncate -= 7; + return `Set{ ${inspectList(arrayFromSet(set), options)} }` + } + + const stringEscapeChars = new RegExp( + "['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5" + + '\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', + 'g' + ); + + const escapeCharacters = { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + "'": "\\'", + '\\': '\\\\', + }; + const hex = 16; + const unicodeLength = 4; + function escape(char) { + return escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}` + } + + function inspectString(string, options) { + if (stringEscapeChars.test(string)) { + string = string.replace(stringEscapeChars, escape); + } + return options.stylize(`'${truncate(string, options.truncate - 2)}'`, 'string') + } + + function inspectSymbol(value) { + if ('description' in Symbol.prototype) { + return value.description ? `Symbol(${value.description})` : 'Symbol()' + } + return value.toString() + } + + let getPromiseValue = () => 'Promise{…}'; + try { + const { getPromiseDetails, kPending, kRejected } = process.binding('util'); + if (Array.isArray(getPromiseDetails(Promise.resolve()))) { + getPromiseValue = (value, options) => { + const [state, innerValue] = getPromiseDetails(value); + if (state === kPending) { + return 'Promise{}' + } + return `Promise${state === kRejected ? '!' : ''}{${options.inspect(innerValue, options)}}` + }; + } + } catch (notNode) { + /* ignore */ + } + var inspectPromise = getPromiseValue; + + function inspectObject$1(object, options) { + const properties = Object.getOwnPropertyNames(object); + const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : []; + if (properties.length === 0 && symbols.length === 0) { + return '{}' + } + options.truncate -= 4; + options.seen = options.seen || []; + if (options.seen.indexOf(object) >= 0) { + return '[Circular]' + } + options.seen.push(object); + const propertyContents = inspectList( + properties.map(key => [key, object[key]]), + options, + inspectProperty + ); + const symbolContents = inspectList( + symbols.map(key => [key, object[key]]), + options, + inspectProperty + ); + options.seen.pop(); + let sep = ''; + if (propertyContents && symbolContents) { + sep = ', '; + } + return `{ ${propertyContents}${sep}${symbolContents} }` + } + + const toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag ? Symbol.toStringTag : false; + + function inspectClass(value, options) { + let name = ''; + if (toStringTag && toStringTag in value) { + name = value[toStringTag]; + } + name = name || getFuncName_1(value.constructor); + // Babel transforms anonymous classes to the name `_class` + if (!name || name === '_class') { + name = ''; + } + options.truncate -= name.length; + return `${name}${inspectObject$1(value, options)}` + } + + function inspectArguments(args, options) { + if (args.length === 0) return 'Arguments[]' + options.truncate -= 13; + return `Arguments[ ${inspectList(args, options)} ]` + } + + const errorKeys = [ + 'stack', + 'line', + 'column', + 'name', + 'message', + 'fileName', + 'lineNumber', + 'columnNumber', + 'number', + 'description', + ]; + + function inspectObject(error, options) { + const properties = Object.getOwnPropertyNames(error).filter(key => errorKeys.indexOf(key) === -1); + const name = error.name; + options.truncate -= name.length; + let message = ''; + if (typeof error.message === 'string') { + message = truncate(error.message, options.truncate); + } else { + properties.unshift('message'); + } + message = message ? `: ${message}` : ''; + options.truncate -= message.length + 5; + const propertyContents = inspectList( + properties.map(key => [key, error[key]]), + options, + inspectProperty + ); + return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ''}` + } + + function inspectAttribute([key, value], options) { + options.truncate -= 3; + if (!value) { + return `${options.stylize(key, 'yellow')}` + } + return `${options.stylize(key, 'yellow')}=${options.stylize(`"${value}"`, 'string')}` + } + + function inspectHTMLCollection(collection, options) { + // eslint-disable-next-line no-use-before-define + return inspectList(collection, options, inspectHTML, '\n') + } + + function inspectHTML(element, options) { + const properties = element.getAttributeNames(); + const name = element.tagName.toLowerCase(); + const head = options.stylize(`<${name}`, 'special'); + const headClose = options.stylize(`>`, 'special'); + const tail = options.stylize(``, 'special'); + options.truncate -= name.length * 2 + 5; + let propertyContents = ''; + if (properties.length > 0) { + propertyContents += ' '; + propertyContents += inspectList( + properties.map(key => [key, element.getAttribute(key)]), + options, + inspectAttribute, + ' ' + ); + } + options.truncate -= propertyContents.length; + const truncate = options.truncate; + let children = inspectHTMLCollection(element.children, options); + if (children && children.length > truncate) { + children = `${truncator}(${element.children.length})`; + } + return `${head}${propertyContents}${headClose}${children}${tail}` + } + + /* ! + * loupe + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */ + + const symbolsSupported = typeof Symbol === 'function' && typeof Symbol.for === 'function'; + const chaiInspect = symbolsSupported ? Symbol.for('chai/inspect') : '@@chai/inspect'; + let nodeInspect = false; + try { + // eslint-disable-next-line global-require + const nodeUtil = require('util'); + nodeInspect = nodeUtil.inspect ? nodeUtil.inspect.custom : false; + } catch (noNodeInspect) { + nodeInspect = false; + } + + function FakeMap$1() { + // eslint-disable-next-line prefer-template + this.key = 'chai/loupe__' + Math.random() + Date.now(); + } + FakeMap$1.prototype = { + // eslint-disable-next-line object-shorthand + get: function get(key) { + return key[this.key] + }, + // eslint-disable-next-line object-shorthand + has: function has(key) { + return this.key in key + }, + // eslint-disable-next-line object-shorthand + set: function set(key, value) { + if (Object.isExtensible(key)) { + Object.defineProperty(key, this.key, { + // eslint-disable-next-line object-shorthand + value: value, + configurable: true, + }); + } + }, + }; + const constructorMap = new (typeof WeakMap === 'function' ? WeakMap : FakeMap$1)(); + const stringTagMap = {}; + const baseTypesMap = { + undefined: (value, options) => options.stylize('undefined', 'undefined'), + null: (value, options) => options.stylize(null, 'null'), + + boolean: (value, options) => options.stylize(value, 'boolean'), + Boolean: (value, options) => options.stylize(value, 'boolean'), + + number: inspectNumber, + Number: inspectNumber, + + bigint: inspectBigInt, + BigInt: inspectBigInt, + + string: inspectString, + String: inspectString, + + function: inspectFunction, + Function: inspectFunction, + + symbol: inspectSymbol, + // A Symbol polyfill will return `Symbol` not `symbol` from typedetect + Symbol: inspectSymbol, + + Array: inspectArray, + Date: inspectDate, + Map: inspectMap, + Set: inspectSet, + RegExp: inspectRegExp, + Promise: inspectPromise, + + // WeakSet, WeakMap are totally opaque to us + WeakSet: (value, options) => options.stylize('WeakSet{…}', 'special'), + WeakMap: (value, options) => options.stylize('WeakMap{…}', 'special'), + + Arguments: inspectArguments, + Int8Array: inspectTypedArray, + Uint8Array: inspectTypedArray, + Uint8ClampedArray: inspectTypedArray, + Int16Array: inspectTypedArray, + Uint16Array: inspectTypedArray, + Int32Array: inspectTypedArray, + Uint32Array: inspectTypedArray, + Float32Array: inspectTypedArray, + Float64Array: inspectTypedArray, + + Generator: () => '', + DataView: () => '', + ArrayBuffer: () => '', + + Error: inspectObject, + + HTMLCollection: inspectHTMLCollection, + NodeList: inspectHTMLCollection, + }; + + // eslint-disable-next-line complexity + const inspectCustom = (value, options, type) => { + if (chaiInspect in value && typeof value[chaiInspect] === 'function') { + return value[chaiInspect](options) + } + + if (nodeInspect && nodeInspect in value && typeof value[nodeInspect] === 'function') { + return value[nodeInspect](options.depth, options) + } + + if ('inspect' in value && typeof value.inspect === 'function') { + return value.inspect(options.depth, options) + } + + if ('constructor' in value && constructorMap.has(value.constructor)) { + return constructorMap.get(value.constructor)(value, options) + } + + if (stringTagMap[type]) { + return stringTagMap[type](value, options) + } + + return '' + }; + + const toString = Object.prototype.toString; + + // eslint-disable-next-line complexity + function inspect$3(value, options) { + options = normaliseOptions(options); + options.inspect = inspect$3; + const { customInspect } = options; + let type = value === null ? 'null' : typeof value; + if (type === 'object') { + type = toString.call(value).slice(8, -1); + } + + // If it is a base value that we already support, then use Loupe's inspector + if (baseTypesMap[type]) { + return baseTypesMap[type](value, options) + } + + // If `options.customInspect` is set to true then try to use the custom inspector + if (customInspect && value) { + const output = inspectCustom(value, options, type); + if (output) { + if (typeof output === 'string') return output + return inspect$3(output, options) + } + } + + const proto = value ? Object.getPrototypeOf(value) : false; + // If it's a plain Object then use Loupe's inspector + if (proto === Object.prototype || proto === null) { + return inspectObject$1(value, options) + } + + // Specifically account for HTMLElements + // eslint-disable-next-line no-undef + if (value && typeof HTMLElement === 'function' && value instanceof HTMLElement) { + return inspectHTML(value, options) + } + + if ('constructor' in value) { + // If it is a class, inspect it like an object but add the constructor name + if (value.constructor !== Object) { + return inspectClass(value, options) + } + + // If it is an object with an anonymous prototype, display it as an object. + return inspectObject$1(value, options) + } + + // last chance to check if it's an object + if (value === Object(value)) { + return inspectObject$1(value, options) + } + + // We have run out of options! Just stringify the value + return options.stylize(String(value), type) + } + + function registerConstructor(constructor, inspector) { + if (constructorMap.has(constructor)) { + return false + } + constructorMap.set(constructor, inspector); + return true + } + + function registerStringTag(stringTag, inspector) { + if (stringTag in stringTagMap) { + return false + } + stringTagMap[stringTag] = inspector; + return true + } + + const custom = chaiInspect; + + var loupe$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + inspect: inspect$3, + registerConstructor: registerConstructor, + registerStringTag: registerStringTag, + custom: custom, + default: inspect$3 + }); + + var require$$1 = /*@__PURE__*/getAugmentedNamespace(loupe$1); + + var config$5 = { + + /** + * ### config.includeStack + * + * User configurable property, influences whether stack trace + * is included in Assertion error message. Default of false + * suppresses stack trace in the error message. + * + * chai.config.includeStack = true; // enable stack on error + * + * @param {Boolean} + * @api public + */ + + includeStack: false, + + /** + * ### config.showDiff + * + * User configurable property, influences whether or not + * the `showDiff` flag should be included in the thrown + * AssertionErrors. `false` will always be `false`; `true` + * will be true when the assertion has requested a diff + * be shown. + * + * @param {Boolean} + * @api public + */ + + showDiff: true, + + /** + * ### config.truncateThreshold + * + * User configurable property, sets length threshold for actual and + * expected values in assertion errors. If this threshold is exceeded, for + * example for large data structures, the value is replaced with something + * like `[ Array(3) ]` or `{ Object (prop1, prop2) }`. + * + * Set it to zero if you want to disable truncating altogether. + * + * This is especially userful when doing assertions on arrays: having this + * set to a reasonable large value makes the failure messages readily + * inspectable. + * + * chai.config.truncateThreshold = 0; // disable truncating + * + * @param {Number} + * @api public + */ + + truncateThreshold: 40, + + /** + * ### config.useProxy + * + * User configurable property, defines if chai will use a Proxy to throw + * an error when a non-existent property is read, which protects users + * from typos when using property-based assertions. + * + * Set it to false if you want to disable this feature. + * + * chai.config.useProxy = false; // disable use of Proxy + * + * This feature is automatically disabled regardless of this config value + * in environments that don't support proxies. + * + * @param {Boolean} + * @api public + */ + + useProxy: true, + + /** + * ### config.proxyExcludedKeys + * + * User configurable property, defines which properties should be ignored + * instead of throwing an error if they do not exist on the assertion. + * This is only applied if the environment Chai is running in supports proxies and + * if the `useProxy` configuration setting is enabled. + * By default, `then` and `inspect` will not throw an error if they do not exist on the + * assertion object because the `.inspect` property is read by `util.inspect` (for example, when + * using `console.log` on the assertion object) and `.then` is necessary for promise type-checking. + * + * // By default these keys will not throw an error if they do not exist on the assertion object + * chai.config.proxyExcludedKeys = ['then', 'inspect']; + * + * @param {Array} + * @api public + */ + + proxyExcludedKeys: ['then', 'catch', 'inspect', 'toJSON'] + }; + + var loupe = require$$1; + var config$4 = config$5; + + var inspect_1 = inspect$2; + + /** + * ### .inspect(obj, [showHidden], [depth], [colors]) + * + * Echoes the value of a value. Tries to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Boolean} showHidden Flag that shows hidden (not enumerable) + * properties of objects. Default is false. + * @param {Number} depth Depth in which to descend in object. Default is 2. + * @param {Boolean} colors Flag to turn on ANSI escape codes to color the + * output. Default is false (no coloring). + * @namespace Utils + * @name inspect + */ + function inspect$2(obj, showHidden, depth, colors) { + var options = { + colors: colors, + depth: (typeof depth === 'undefined' ? 2 : depth), + showHidden: showHidden, + truncate: config$4.truncateThreshold ? config$4.truncateThreshold : Infinity, + }; + return loupe.inspect(obj, options); + } + + /*! + * Chai - flag utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /*! + * Module dependencies + */ + + var inspect$1 = inspect_1; + var config$3 = config$5; + + /** + * ### .objDisplay(object) + * + * Determines if an object or an array matches + * criteria to be inspected in-line for error + * messages or should be truncated. + * + * @param {Mixed} javascript object to inspect + * @name objDisplay + * @namespace Utils + * @api public + */ + + var objDisplay$1 = function objDisplay(obj) { + var str = inspect$1(obj) + , type = Object.prototype.toString.call(obj); + + if (config$3.truncateThreshold && str.length >= config$3.truncateThreshold) { + if (type === '[object Function]') { + return !obj.name || obj.name === '' + ? '[Function]' + : '[Function: ' + obj.name + ']'; + } else if (type === '[object Array]') { + return '[ Array(' + obj.length + ') ]'; + } else if (type === '[object Object]') { + var keys = Object.keys(obj) + , kstr = keys.length > 2 + ? keys.splice(0, 2).join(', ') + ', ...' + : keys.join(', '); + return '{ Object (' + kstr + ') }'; + } else { + return str; + } + } else { + return str; + } + }; + + /*! + * Chai - message composition utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /*! + * Module dependencies + */ + + var flag$2 = flag$5 + , getActual = getActual$1 + , objDisplay = objDisplay$1; + + /** + * ### .getMessage(object, message, negateMessage) + * + * Construct the error message based on flags + * and template tags. Template tags will return + * a stringified inspection of the object referenced. + * + * Message template tags: + * - `#{this}` current asserted object + * - `#{act}` actual value + * - `#{exp}` expected value + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name getMessage + * @api public + */ + + var getMessage$1 = function getMessage(obj, args) { + var negate = flag$2(obj, 'negate') + , val = flag$2(obj, 'object') + , expected = args[3] + , actual = getActual(obj, args) + , msg = negate ? args[2] : args[1] + , flagMsg = flag$2(obj, 'message'); + + if(typeof msg === "function") msg = msg(); + msg = msg || ''; + msg = msg + .replace(/#\{this\}/g, function () { return objDisplay(val); }) + .replace(/#\{act\}/g, function () { return objDisplay(actual); }) + .replace(/#\{exp\}/g, function () { return objDisplay(expected); }); + + return flagMsg ? flagMsg + ': ' + msg : msg; + }; + + /*! + * Chai - transferFlags utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /** + * ### .transferFlags(assertion, object, includeAll = true) + * + * Transfer all the flags for `assertion` to `object`. If + * `includeAll` is set to `false`, then the base Chai + * assertion flags (namely `object`, `ssfi`, `lockSsfi`, + * and `message`) will not be transferred. + * + * + * var newAssertion = new Assertion(); + * utils.transferFlags(assertion, newAssertion); + * + * var anotherAssertion = new Assertion(myObj); + * utils.transferFlags(assertion, anotherAssertion, false); + * + * @param {Assertion} assertion the assertion to transfer the flags from + * @param {Object} object the object to transfer the flags to; usually a new assertion + * @param {Boolean} includeAll + * @namespace Utils + * @name transferFlags + * @api private + */ + + var transferFlags = function transferFlags(assertion, object, includeAll) { + var flags = assertion.__flags || (assertion.__flags = Object.create(null)); + + if (!object.__flags) { + object.__flags = Object.create(null); + } + + includeAll = arguments.length === 3 ? includeAll : true; + + for (var flag in flags) { + if (includeAll || + (flag !== 'object' && flag !== 'ssfi' && flag !== 'lockSsfi' && flag != 'message')) { + object.__flags[flag] = flags[flag]; + } + } + }; + + var deepEql = {exports: {}}; + + /* globals Symbol: false, Uint8Array: false, WeakMap: false */ + /*! + * deep-eql + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */ + + var type$1 = typeDetect.exports; + function FakeMap() { + this._key = 'chai/deep-eql__' + Math.random() + Date.now(); + } + + FakeMap.prototype = { + get: function get(key) { + return key[this._key]; + }, + set: function set(key, value) { + if (Object.isExtensible(key)) { + Object.defineProperty(key, this._key, { + value: value, + configurable: true, + }); + } + }, + }; + + var MemoizeMap = typeof WeakMap === 'function' ? WeakMap : FakeMap; + /*! + * Check to see if the MemoizeMap has recorded a result of the two operands + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {MemoizeMap} memoizeMap + * @returns {Boolean|null} result + */ + function memoizeCompare(leftHandOperand, rightHandOperand, memoizeMap) { + // Technically, WeakMap keys can *only* be objects, not primitives. + if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { + return null; + } + var leftHandMap = memoizeMap.get(leftHandOperand); + if (leftHandMap) { + var result = leftHandMap.get(rightHandOperand); + if (typeof result === 'boolean') { + return result; + } + } + return null; + } + + /*! + * Set the result of the equality into the MemoizeMap + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {MemoizeMap} memoizeMap + * @param {Boolean} result + */ + function memoizeSet(leftHandOperand, rightHandOperand, memoizeMap, result) { + // Technically, WeakMap keys can *only* be objects, not primitives. + if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { + return; + } + var leftHandMap = memoizeMap.get(leftHandOperand); + if (leftHandMap) { + leftHandMap.set(rightHandOperand, result); + } else { + leftHandMap = new MemoizeMap(); + leftHandMap.set(rightHandOperand, result); + memoizeMap.set(leftHandOperand, leftHandMap); + } + } + + /*! + * Primary Export + */ + + deepEql.exports = deepEqual; + deepEql.exports.MemoizeMap = MemoizeMap; + + /** + * Assert deeply nested sameValue equality between two objects of any type. + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Object} [options] (optional) Additional options + * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. + * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of + complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular + references to blow the stack. + * @return {Boolean} equal match + */ + function deepEqual(leftHandOperand, rightHandOperand, options) { + // If we have a comparator, we can't assume anything; so bail to its check first. + if (options && options.comparator) { + return extensiveDeepEqual(leftHandOperand, rightHandOperand, options); + } + + var simpleResult = simpleEqual(leftHandOperand, rightHandOperand); + if (simpleResult !== null) { + return simpleResult; + } + + // Deeper comparisons are pushed through to a larger function + return extensiveDeepEqual(leftHandOperand, rightHandOperand, options); + } + + /** + * Many comparisons can be canceled out early via simple equality or primitive checks. + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @return {Boolean|null} equal match + */ + function simpleEqual(leftHandOperand, rightHandOperand) { + // Equal references (except for Numbers) can be returned early + if (leftHandOperand === rightHandOperand) { + // Handle +-0 cases + return leftHandOperand !== 0 || 1 / leftHandOperand === 1 / rightHandOperand; + } + + // handle NaN cases + if ( + leftHandOperand !== leftHandOperand && // eslint-disable-line no-self-compare + rightHandOperand !== rightHandOperand // eslint-disable-line no-self-compare + ) { + return true; + } + + // Anything that is not an 'object', i.e. symbols, functions, booleans, numbers, + // strings, and undefined, can be compared by reference. + if (isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { + // Easy out b/c it would have passed the first equality check + return false; + } + return null; + } + + /*! + * The main logic of the `deepEqual` function. + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Object} [options] (optional) Additional options + * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. + * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of + complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular + references to blow the stack. + * @return {Boolean} equal match + */ + function extensiveDeepEqual(leftHandOperand, rightHandOperand, options) { + options = options || {}; + options.memoize = options.memoize === false ? false : options.memoize || new MemoizeMap(); + var comparator = options && options.comparator; + + // Check if a memoized result exists. + var memoizeResultLeft = memoizeCompare(leftHandOperand, rightHandOperand, options.memoize); + if (memoizeResultLeft !== null) { + return memoizeResultLeft; + } + var memoizeResultRight = memoizeCompare(rightHandOperand, leftHandOperand, options.memoize); + if (memoizeResultRight !== null) { + return memoizeResultRight; + } + + // If a comparator is present, use it. + if (comparator) { + var comparatorResult = comparator(leftHandOperand, rightHandOperand); + // Comparators may return null, in which case we want to go back to default behavior. + if (comparatorResult === false || comparatorResult === true) { + memoizeSet(leftHandOperand, rightHandOperand, options.memoize, comparatorResult); + return comparatorResult; + } + // To allow comparators to override *any* behavior, we ran them first. Since it didn't decide + // what to do, we need to make sure to return the basic tests first before we move on. + var simpleResult = simpleEqual(leftHandOperand, rightHandOperand); + if (simpleResult !== null) { + // Don't memoize this, it takes longer to set/retrieve than to just compare. + return simpleResult; + } + } + + var leftHandType = type$1(leftHandOperand); + if (leftHandType !== type$1(rightHandOperand)) { + memoizeSet(leftHandOperand, rightHandOperand, options.memoize, false); + return false; + } + + // Temporarily set the operands in the memoize object to prevent blowing the stack + memoizeSet(leftHandOperand, rightHandOperand, options.memoize, true); + + var result = extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options); + memoizeSet(leftHandOperand, rightHandOperand, options.memoize, result); + return result; + } + + function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options) { + switch (leftHandType) { + case 'String': + case 'Number': + case 'Boolean': + case 'Date': + // If these types are their instance types (e.g. `new Number`) then re-deepEqual against their values + return deepEqual(leftHandOperand.valueOf(), rightHandOperand.valueOf()); + case 'Promise': + case 'Symbol': + case 'function': + case 'WeakMap': + case 'WeakSet': + return leftHandOperand === rightHandOperand; + case 'Error': + return keysEqual(leftHandOperand, rightHandOperand, [ 'name', 'message', 'code' ], options); + case 'Arguments': + case 'Int8Array': + case 'Uint8Array': + case 'Uint8ClampedArray': + case 'Int16Array': + case 'Uint16Array': + case 'Int32Array': + case 'Uint32Array': + case 'Float32Array': + case 'Float64Array': + case 'Array': + return iterableEqual(leftHandOperand, rightHandOperand, options); + case 'RegExp': + return regexpEqual(leftHandOperand, rightHandOperand); + case 'Generator': + return generatorEqual(leftHandOperand, rightHandOperand, options); + case 'DataView': + return iterableEqual(new Uint8Array(leftHandOperand.buffer), new Uint8Array(rightHandOperand.buffer), options); + case 'ArrayBuffer': + return iterableEqual(new Uint8Array(leftHandOperand), new Uint8Array(rightHandOperand), options); + case 'Set': + return entriesEqual(leftHandOperand, rightHandOperand, options); + case 'Map': + return entriesEqual(leftHandOperand, rightHandOperand, options); + case 'Temporal.PlainDate': + case 'Temporal.PlainTime': + case 'Temporal.PlainDateTime': + case 'Temporal.Instant': + case 'Temporal.ZonedDateTime': + case 'Temporal.PlainYearMonth': + case 'Temporal.PlainMonthDay': + return leftHandOperand.equals(rightHandOperand); + case 'Temporal.Duration': + return leftHandOperand.total('nanoseconds') === rightHandOperand.total('nanoseconds'); + case 'Temporal.TimeZone': + case 'Temporal.Calendar': + return leftHandOperand.toString() === rightHandOperand.toString(); + default: + return objectEqual(leftHandOperand, rightHandOperand, options); + } + } + + /*! + * Compare two Regular Expressions for equality. + * + * @param {RegExp} leftHandOperand + * @param {RegExp} rightHandOperand + * @return {Boolean} result + */ + + function regexpEqual(leftHandOperand, rightHandOperand) { + return leftHandOperand.toString() === rightHandOperand.toString(); + } + + /*! + * Compare two Sets/Maps for equality. Faster than other equality functions. + * + * @param {Set} leftHandOperand + * @param {Set} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */ + + function entriesEqual(leftHandOperand, rightHandOperand, options) { + // IE11 doesn't support Set#entries or Set#@@iterator, so we need manually populate using Set#forEach + if (leftHandOperand.size !== rightHandOperand.size) { + return false; + } + if (leftHandOperand.size === 0) { + return true; + } + var leftHandItems = []; + var rightHandItems = []; + leftHandOperand.forEach(function gatherEntries(key, value) { + leftHandItems.push([ key, value ]); + }); + rightHandOperand.forEach(function gatherEntries(key, value) { + rightHandItems.push([ key, value ]); + }); + return iterableEqual(leftHandItems.sort(), rightHandItems.sort(), options); + } + + /*! + * Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers. + * + * @param {Iterable} leftHandOperand + * @param {Iterable} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */ + + function iterableEqual(leftHandOperand, rightHandOperand, options) { + var length = leftHandOperand.length; + if (length !== rightHandOperand.length) { + return false; + } + if (length === 0) { + return true; + } + var index = -1; + while (++index < length) { + if (deepEqual(leftHandOperand[index], rightHandOperand[index], options) === false) { + return false; + } + } + return true; + } + + /*! + * Simple equality for generator objects such as those returned by generator functions. + * + * @param {Iterable} leftHandOperand + * @param {Iterable} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */ + + function generatorEqual(leftHandOperand, rightHandOperand, options) { + return iterableEqual(getGeneratorEntries(leftHandOperand), getGeneratorEntries(rightHandOperand), options); + } + + /*! + * Determine if the given object has an @@iterator function. + * + * @param {Object} target + * @return {Boolean} `true` if the object has an @@iterator function. + */ + function hasIteratorFunction(target) { + return typeof Symbol !== 'undefined' && + typeof target === 'object' && + typeof Symbol.iterator !== 'undefined' && + typeof target[Symbol.iterator] === 'function'; + } + + /*! + * Gets all iterator entries from the given Object. If the Object has no @@iterator function, returns an empty array. + * This will consume the iterator - which could have side effects depending on the @@iterator implementation. + * + * @param {Object} target + * @returns {Array} an array of entries from the @@iterator function + */ + function getIteratorEntries(target) { + if (hasIteratorFunction(target)) { + try { + return getGeneratorEntries(target[Symbol.iterator]()); + } catch (iteratorError) { + return []; + } + } + return []; + } + + /*! + * Gets all entries from a Generator. This will consume the generator - which could have side effects. + * + * @param {Generator} target + * @returns {Array} an array of entries from the Generator. + */ + function getGeneratorEntries(generator) { + var generatorResult = generator.next(); + var accumulator = [ generatorResult.value ]; + while (generatorResult.done === false) { + generatorResult = generator.next(); + accumulator.push(generatorResult.value); + } + return accumulator; + } + + /*! + * Gets all own and inherited enumerable keys from a target. + * + * @param {Object} target + * @returns {Array} an array of own and inherited enumerable keys from the target. + */ + function getEnumerableKeys(target) { + var keys = []; + for (var key in target) { + keys.push(key); + } + return keys; + } + + function getEnumerableSymbols(target) { + var keys = []; + var allKeys = Object.getOwnPropertySymbols(target); + for (var i = 0; i < allKeys.length; i += 1) { + var key = allKeys[i]; + if (Object.getOwnPropertyDescriptor(target, key).enumerable) { + keys.push(key); + } + } + return keys; + } + + /*! + * Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of + * each key. If any value of the given key is not equal, the function will return false (early). + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against + * @param {Object} [options] (Optional) + * @return {Boolean} result + */ + function keysEqual(leftHandOperand, rightHandOperand, keys, options) { + var length = keys.length; + if (length === 0) { + return true; + } + for (var i = 0; i < length; i += 1) { + if (deepEqual(leftHandOperand[keys[i]], rightHandOperand[keys[i]], options) === false) { + return false; + } + } + return true; + } + + /*! + * Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual` + * for each enumerable key in the object. + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */ + function objectEqual(leftHandOperand, rightHandOperand, options) { + var leftHandKeys = getEnumerableKeys(leftHandOperand); + var rightHandKeys = getEnumerableKeys(rightHandOperand); + var leftHandSymbols = getEnumerableSymbols(leftHandOperand); + var rightHandSymbols = getEnumerableSymbols(rightHandOperand); + leftHandKeys = leftHandKeys.concat(leftHandSymbols); + rightHandKeys = rightHandKeys.concat(rightHandSymbols); + + if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) { + if (iterableEqual(mapSymbols(leftHandKeys).sort(), mapSymbols(rightHandKeys).sort()) === false) { + return false; + } + return keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options); + } + + var leftHandEntries = getIteratorEntries(leftHandOperand); + var rightHandEntries = getIteratorEntries(rightHandOperand); + if (leftHandEntries.length && leftHandEntries.length === rightHandEntries.length) { + leftHandEntries.sort(); + rightHandEntries.sort(); + return iterableEqual(leftHandEntries, rightHandEntries, options); + } + + if (leftHandKeys.length === 0 && + leftHandEntries.length === 0 && + rightHandKeys.length === 0 && + rightHandEntries.length === 0) { + return true; + } + + return false; + } + + /*! + * Returns true if the argument is a primitive. + * + * This intentionally returns true for all objects that can be compared by reference, + * including functions and symbols. + * + * @param {Mixed} value + * @return {Boolean} result + */ + function isPrimitive(value) { + return value === null || typeof value !== 'object'; + } + + function mapSymbols(arr) { + return arr.map(function mapSymbol(entry) { + if (typeof entry === 'symbol') { + return entry.toString(); + } + + return entry; + }); + } + + var config$2 = config$5; + + /*! + * Chai - isProxyEnabled helper + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /** + * ### .isProxyEnabled() + * + * Helper function to check if Chai's proxy protection feature is enabled. If + * proxies are unsupported or disabled via the user's Chai config, then return + * false. Otherwise, return true. + * + * @namespace Utils + * @name isProxyEnabled + */ + + var isProxyEnabled$1 = function isProxyEnabled() { + return config$2.useProxy && + typeof Proxy !== 'undefined' && + typeof Reflect !== 'undefined'; + }; + + /*! + * Chai - addProperty utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + var addProperty; + var hasRequiredAddProperty; + + function requireAddProperty () { + if (hasRequiredAddProperty) return addProperty; + hasRequiredAddProperty = 1; + var chai = requireChai(); + var flag = flag$5; + var isProxyEnabled = isProxyEnabled$1; + var transferFlags$1 = transferFlags; + + /** + * ### .addProperty(ctx, name, getter) + * + * Adds a property to the prototype of an object. + * + * utils.addProperty(chai.Assertion.prototype, 'foo', function () { + * var obj = utils.flag(this, 'object'); + * new chai.Assertion(obj).to.be.instanceof(Foo); + * }); + * + * Can also be accessed directly from `chai.Assertion`. + * + * chai.Assertion.addProperty('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.be.foo; + * + * @param {Object} ctx object to which the property is added + * @param {String} name of property to add + * @param {Function} getter function to be used for name + * @namespace Utils + * @name addProperty + * @api public + */ + + addProperty = function addProperty(ctx, name, getter) { + getter = getter === undefined ? function () {} : getter; + + Object.defineProperty(ctx, name, + { get: function propertyGetter() { + // Setting the `ssfi` flag to `propertyGetter` causes this function to + // be the starting point for removing implementation frames from the + // stack trace of a failed assertion. + // + // However, we only want to use this function as the starting point if + // the `lockSsfi` flag isn't set and proxy protection is disabled. + // + // If the `lockSsfi` flag is set, then either this assertion has been + // overwritten by another assertion, or this assertion is being invoked + // from inside of another assertion. In the first case, the `ssfi` flag + // has already been set by the overwriting assertion. In the second + // case, the `ssfi` flag has already been set by the outer assertion. + // + // If proxy protection is enabled, then the `ssfi` flag has already been + // set by the proxy getter. + if (!isProxyEnabled() && !flag(this, 'lockSsfi')) { + flag(this, 'ssfi', propertyGetter); + } + + var result = getter.call(this); + if (result !== undefined) + return result; + + var newAssertion = new chai.Assertion(); + transferFlags$1(this, newAssertion); + return newAssertion; + } + , configurable: true + }); + }; + return addProperty; + } + + var fnLengthDesc = Object.getOwnPropertyDescriptor(function () {}, 'length'); + + /*! + * Chai - addLengthGuard utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /** + * ### .addLengthGuard(fn, assertionName, isChainable) + * + * Define `length` as a getter on the given uninvoked method assertion. The + * getter acts as a guard against chaining `length` directly off of an uninvoked + * method assertion, which is a problem because it references `function`'s + * built-in `length` property instead of Chai's `length` assertion. When the + * getter catches the user making this mistake, it throws an error with a + * helpful message. + * + * There are two ways in which this mistake can be made. The first way is by + * chaining the `length` assertion directly off of an uninvoked chainable + * method. In this case, Chai suggests that the user use `lengthOf` instead. The + * second way is by chaining the `length` assertion directly off of an uninvoked + * non-chainable method. Non-chainable methods must be invoked prior to + * chaining. In this case, Chai suggests that the user consult the docs for the + * given assertion. + * + * If the `length` property of functions is unconfigurable, then return `fn` + * without modification. + * + * Note that in ES6, the function's `length` property is configurable, so once + * support for legacy environments is dropped, Chai's `length` property can + * replace the built-in function's `length` property, and this length guard will + * no longer be necessary. In the mean time, maintaining consistency across all + * environments is the priority. + * + * @param {Function} fn + * @param {String} assertionName + * @param {Boolean} isChainable + * @namespace Utils + * @name addLengthGuard + */ + + var addLengthGuard = function addLengthGuard (fn, assertionName, isChainable) { + if (!fnLengthDesc.configurable) return fn; + + Object.defineProperty(fn, 'length', { + get: function () { + if (isChainable) { + throw Error('Invalid Chai property: ' + assertionName + '.length. Due' + + ' to a compatibility issue, "length" cannot directly follow "' + + assertionName + '". Use "' + assertionName + '.lengthOf" instead.'); + } + + throw Error('Invalid Chai property: ' + assertionName + '.length. See' + + ' docs for proper usage of "' + assertionName + '".'); + } + }); + + return fn; + }; + + /*! + * Chai - getProperties utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /** + * ### .getProperties(object) + * + * This allows the retrieval of property names of an object, enumerable or not, + * inherited or not. + * + * @param {Object} object + * @returns {Array} + * @namespace Utils + * @name getProperties + * @api public + */ + + var getProperties$1 = function getProperties(object) { + var result = Object.getOwnPropertyNames(object); + + function addProperty(property) { + if (result.indexOf(property) === -1) { + result.push(property); + } + } + + var proto = Object.getPrototypeOf(object); + while (proto !== null) { + Object.getOwnPropertyNames(proto).forEach(addProperty); + proto = Object.getPrototypeOf(proto); + } + + return result; + }; + + var config$1 = config$5; + var flag$1 = flag$5; + var getProperties = getProperties$1; + var isProxyEnabled = isProxyEnabled$1; + + /*! + * Chai - proxify utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + /** + * ### .proxify(object) + * + * Return a proxy of given object that throws an error when a non-existent + * property is read. By default, the root cause is assumed to be a misspelled + * property, and thus an attempt is made to offer a reasonable suggestion from + * the list of existing properties. However, if a nonChainableMethodName is + * provided, then the root cause is instead a failure to invoke a non-chainable + * method prior to reading the non-existent property. + * + * If proxies are unsupported or disabled via the user's Chai config, then + * return object without modification. + * + * @param {Object} obj + * @param {String} nonChainableMethodName + * @namespace Utils + * @name proxify + */ + + var builtins = ['__flags', '__methods', '_obj', 'assert']; + + var proxify = function proxify(obj, nonChainableMethodName) { + if (!isProxyEnabled()) return obj; + + return new Proxy(obj, { + get: function proxyGetter(target, property) { + // This check is here because we should not throw errors on Symbol properties + // such as `Symbol.toStringTag`. + // The values for which an error should be thrown can be configured using + // the `config.proxyExcludedKeys` setting. + if (typeof property === 'string' && + config$1.proxyExcludedKeys.indexOf(property) === -1 && + !Reflect.has(target, property)) { + // Special message for invalid property access of non-chainable methods. + if (nonChainableMethodName) { + throw Error('Invalid Chai property: ' + nonChainableMethodName + '.' + + property + '. See docs for proper usage of "' + + nonChainableMethodName + '".'); + } + + // If the property is reasonably close to an existing Chai property, + // suggest that property to the user. Only suggest properties with a + // distance less than 4. + var suggestion = null; + var suggestionDistance = 4; + getProperties(target).forEach(function(prop) { + if ( + !Object.prototype.hasOwnProperty(prop) && + builtins.indexOf(prop) === -1 + ) { + var dist = stringDistanceCapped( + property, + prop, + suggestionDistance + ); + if (dist < suggestionDistance) { + suggestion = prop; + suggestionDistance = dist; + } + } + }); + + if (suggestion !== null) { + throw Error('Invalid Chai property: ' + property + + '. Did you mean "' + suggestion + '"?'); + } else { + throw Error('Invalid Chai property: ' + property); + } + } + + // Use this proxy getter as the starting point for removing implementation + // frames from the stack trace of a failed assertion. For property + // assertions, this prevents the proxy getter from showing up in the stack + // trace since it's invoked before the property getter. For method and + // chainable method assertions, this flag will end up getting changed to + // the method wrapper, which is good since this frame will no longer be in + // the stack once the method is invoked. Note that Chai builtin assertion + // properties such as `__flags` are skipped since this is only meant to + // capture the starting point of an assertion. This step is also skipped + // if the `lockSsfi` flag is set, thus indicating that this assertion is + // being called from within another assertion. In that case, the `ssfi` + // flag is already set to the outer assertion's starting point. + if (builtins.indexOf(property) === -1 && !flag$1(target, 'lockSsfi')) { + flag$1(target, 'ssfi', proxyGetter); + } + + return Reflect.get(target, property); + } + }); + }; + + /** + * # stringDistanceCapped(strA, strB, cap) + * Return the Levenshtein distance between two strings, but no more than cap. + * @param {string} strA + * @param {string} strB + * @param {number} number + * @return {number} min(string distance between strA and strB, cap) + * @api private + */ + + function stringDistanceCapped(strA, strB, cap) { + if (Math.abs(strA.length - strB.length) >= cap) { + return cap; + } + + var memo = []; + // `memo` is a two-dimensional array containing distances. + // memo[i][j] is the distance between strA.slice(0, i) and + // strB.slice(0, j). + for (var i = 0; i <= strA.length; i++) { + memo[i] = Array(strB.length + 1).fill(0); + memo[i][0] = i; + } + for (var j = 0; j < strB.length; j++) { + memo[0][j] = j; + } + + for (var i = 1; i <= strA.length; i++) { + var ch = strA.charCodeAt(i - 1); + for (var j = 1; j <= strB.length; j++) { + if (Math.abs(i - j) >= cap) { + memo[i][j] = cap; + continue; + } + memo[i][j] = Math.min( + memo[i - 1][j] + 1, + memo[i][j - 1] + 1, + memo[i - 1][j - 1] + + (ch === strB.charCodeAt(j - 1) ? 0 : 1) + ); + } + } + + return memo[strA.length][strB.length]; + } + + /*! + * Chai - addMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + var addMethod; + var hasRequiredAddMethod; + + function requireAddMethod () { + if (hasRequiredAddMethod) return addMethod; + hasRequiredAddMethod = 1; + var addLengthGuard$1 = addLengthGuard; + var chai = requireChai(); + var flag = flag$5; + var proxify$1 = proxify; + var transferFlags$1 = transferFlags; + + /** + * ### .addMethod(ctx, name, method) + * + * Adds a method to the prototype of an object. + * + * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) { + * var obj = utils.flag(this, 'object'); + * new chai.Assertion(obj).to.be.equal(str); + * }); + * + * Can also be accessed directly from `chai.Assertion`. + * + * chai.Assertion.addMethod('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(fooStr).to.be.foo('bar'); + * + * @param {Object} ctx object to which the method is added + * @param {String} name of method to add + * @param {Function} method function to be used for name + * @namespace Utils + * @name addMethod + * @api public + */ + + addMethod = function addMethod(ctx, name, method) { + var methodWrapper = function () { + // Setting the `ssfi` flag to `methodWrapper` causes this function to be the + // starting point for removing implementation frames from the stack trace of + // a failed assertion. + // + // However, we only want to use this function as the starting point if the + // `lockSsfi` flag isn't set. + // + // If the `lockSsfi` flag is set, then either this assertion has been + // overwritten by another assertion, or this assertion is being invoked from + // inside of another assertion. In the first case, the `ssfi` flag has + // already been set by the overwriting assertion. In the second case, the + // `ssfi` flag has already been set by the outer assertion. + if (!flag(this, 'lockSsfi')) { + flag(this, 'ssfi', methodWrapper); + } + + var result = method.apply(this, arguments); + if (result !== undefined) + return result; + + var newAssertion = new chai.Assertion(); + transferFlags$1(this, newAssertion); + return newAssertion; + }; + + addLengthGuard$1(methodWrapper, name, false); + ctx[name] = proxify$1(methodWrapper, name); + }; + return addMethod; + } + + /*! + * Chai - overwriteProperty utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + var overwriteProperty; + var hasRequiredOverwriteProperty; + + function requireOverwriteProperty () { + if (hasRequiredOverwriteProperty) return overwriteProperty; + hasRequiredOverwriteProperty = 1; + var chai = requireChai(); + var flag = flag$5; + var isProxyEnabled = isProxyEnabled$1; + var transferFlags$1 = transferFlags; + + /** + * ### .overwriteProperty(ctx, name, fn) + * + * Overwrites an already existing property getter and provides + * access to previous value. Must return function to use as getter. + * + * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) { + * return function () { + * var obj = utils.flag(this, 'object'); + * if (obj instanceof Foo) { + * new chai.Assertion(obj.name).to.equal('bar'); + * } else { + * _super.call(this); + * } + * } + * }); + * + * + * Can also be accessed directly from `chai.Assertion`. + * + * chai.Assertion.overwriteProperty('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.be.ok; + * + * @param {Object} ctx object whose property is to be overwritten + * @param {String} name of property to overwrite + * @param {Function} getter function that returns a getter function to be used for name + * @namespace Utils + * @name overwriteProperty + * @api public + */ + + overwriteProperty = function overwriteProperty(ctx, name, getter) { + var _get = Object.getOwnPropertyDescriptor(ctx, name) + , _super = function () {}; + + if (_get && 'function' === typeof _get.get) + _super = _get.get; + + Object.defineProperty(ctx, name, + { get: function overwritingPropertyGetter() { + // Setting the `ssfi` flag to `overwritingPropertyGetter` causes this + // function to be the starting point for removing implementation frames + // from the stack trace of a failed assertion. + // + // However, we only want to use this function as the starting point if + // the `lockSsfi` flag isn't set and proxy protection is disabled. + // + // If the `lockSsfi` flag is set, then either this assertion has been + // overwritten by another assertion, or this assertion is being invoked + // from inside of another assertion. In the first case, the `ssfi` flag + // has already been set by the overwriting assertion. In the second + // case, the `ssfi` flag has already been set by the outer assertion. + // + // If proxy protection is enabled, then the `ssfi` flag has already been + // set by the proxy getter. + if (!isProxyEnabled() && !flag(this, 'lockSsfi')) { + flag(this, 'ssfi', overwritingPropertyGetter); + } + + // Setting the `lockSsfi` flag to `true` prevents the overwritten + // assertion from changing the `ssfi` flag. By this point, the `ssfi` + // flag is already set to the correct starting point for this assertion. + var origLockSsfi = flag(this, 'lockSsfi'); + flag(this, 'lockSsfi', true); + var result = getter(_super).call(this); + flag(this, 'lockSsfi', origLockSsfi); + + if (result !== undefined) { + return result; + } + + var newAssertion = new chai.Assertion(); + transferFlags$1(this, newAssertion); + return newAssertion; + } + , configurable: true + }); + }; + return overwriteProperty; + } + + /*! + * Chai - overwriteMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + var overwriteMethod; + var hasRequiredOverwriteMethod; + + function requireOverwriteMethod () { + if (hasRequiredOverwriteMethod) return overwriteMethod; + hasRequiredOverwriteMethod = 1; + var addLengthGuard$1 = addLengthGuard; + var chai = requireChai(); + var flag = flag$5; + var proxify$1 = proxify; + var transferFlags$1 = transferFlags; + + /** + * ### .overwriteMethod(ctx, name, fn) + * + * Overwrites an already existing method and provides + * access to previous function. Must return function + * to be used for name. + * + * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) { + * return function (str) { + * var obj = utils.flag(this, 'object'); + * if (obj instanceof Foo) { + * new chai.Assertion(obj.value).to.equal(str); + * } else { + * _super.apply(this, arguments); + * } + * } + * }); + * + * Can also be accessed directly from `chai.Assertion`. + * + * chai.Assertion.overwriteMethod('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.equal('bar'); + * + * @param {Object} ctx object whose method is to be overwritten + * @param {String} name of method to overwrite + * @param {Function} method function that returns a function to be used for name + * @namespace Utils + * @name overwriteMethod + * @api public + */ + + overwriteMethod = function overwriteMethod(ctx, name, method) { + var _method = ctx[name] + , _super = function () { + throw new Error(name + ' is not a function'); + }; + + if (_method && 'function' === typeof _method) + _super = _method; + + var overwritingMethodWrapper = function () { + // Setting the `ssfi` flag to `overwritingMethodWrapper` causes this + // function to be the starting point for removing implementation frames from + // the stack trace of a failed assertion. + // + // However, we only want to use this function as the starting point if the + // `lockSsfi` flag isn't set. + // + // If the `lockSsfi` flag is set, then either this assertion has been + // overwritten by another assertion, or this assertion is being invoked from + // inside of another assertion. In the first case, the `ssfi` flag has + // already been set by the overwriting assertion. In the second case, the + // `ssfi` flag has already been set by the outer assertion. + if (!flag(this, 'lockSsfi')) { + flag(this, 'ssfi', overwritingMethodWrapper); + } + + // Setting the `lockSsfi` flag to `true` prevents the overwritten assertion + // from changing the `ssfi` flag. By this point, the `ssfi` flag is already + // set to the correct starting point for this assertion. + var origLockSsfi = flag(this, 'lockSsfi'); + flag(this, 'lockSsfi', true); + var result = method(_super).apply(this, arguments); + flag(this, 'lockSsfi', origLockSsfi); + + if (result !== undefined) { + return result; + } + + var newAssertion = new chai.Assertion(); + transferFlags$1(this, newAssertion); + return newAssertion; + }; + + addLengthGuard$1(overwritingMethodWrapper, name, false); + ctx[name] = proxify$1(overwritingMethodWrapper, name); + }; + return overwriteMethod; + } + + /*! + * Chai - addChainingMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + var addChainableMethod; + var hasRequiredAddChainableMethod; + + function requireAddChainableMethod () { + if (hasRequiredAddChainableMethod) return addChainableMethod; + hasRequiredAddChainableMethod = 1; + /*! + * Module dependencies + */ + + var addLengthGuard$1 = addLengthGuard; + var chai = requireChai(); + var flag = flag$5; + var proxify$1 = proxify; + var transferFlags$1 = transferFlags; + + /*! + * Module variables + */ + + // Check whether `Object.setPrototypeOf` is supported + var canSetPrototype = typeof Object.setPrototypeOf === 'function'; + + // Without `Object.setPrototypeOf` support, this module will need to add properties to a function. + // However, some of functions' own props are not configurable and should be skipped. + var testFn = function() {}; + var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) { + var propDesc = Object.getOwnPropertyDescriptor(testFn, name); + + // Note: PhantomJS 1.x includes `callee` as one of `testFn`'s own properties, + // but then returns `undefined` as the property descriptor for `callee`. As a + // workaround, we perform an otherwise unnecessary type-check for `propDesc`, + // and then filter it out if it's not an object as it should be. + if (typeof propDesc !== 'object') + return true; + + return !propDesc.configurable; + }); + + // Cache `Function` properties + var call = Function.prototype.call, + apply = Function.prototype.apply; + + /** + * ### .addChainableMethod(ctx, name, method, chainingBehavior) + * + * Adds a method to an object, such that the method can also be chained. + * + * utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) { + * var obj = utils.flag(this, 'object'); + * new chai.Assertion(obj).to.be.equal(str); + * }); + * + * Can also be accessed directly from `chai.Assertion`. + * + * chai.Assertion.addChainableMethod('foo', fn, chainingBehavior); + * + * The result can then be used as both a method assertion, executing both `method` and + * `chainingBehavior`, or as a language chain, which only executes `chainingBehavior`. + * + * expect(fooStr).to.be.foo('bar'); + * expect(fooStr).to.be.foo.equal('foo'); + * + * @param {Object} ctx object to which the method is added + * @param {String} name of method to add + * @param {Function} method function to be used for `name`, when called + * @param {Function} chainingBehavior function to be called every time the property is accessed + * @namespace Utils + * @name addChainableMethod + * @api public + */ + + addChainableMethod = function addChainableMethod(ctx, name, method, chainingBehavior) { + if (typeof chainingBehavior !== 'function') { + chainingBehavior = function () { }; + } + + var chainableBehavior = { + method: method + , chainingBehavior: chainingBehavior + }; + + // save the methods so we can overwrite them later, if we need to. + if (!ctx.__methods) { + ctx.__methods = {}; + } + ctx.__methods[name] = chainableBehavior; + + Object.defineProperty(ctx, name, + { get: function chainableMethodGetter() { + chainableBehavior.chainingBehavior.call(this); + + var chainableMethodWrapper = function () { + // Setting the `ssfi` flag to `chainableMethodWrapper` causes this + // function to be the starting point for removing implementation + // frames from the stack trace of a failed assertion. + // + // However, we only want to use this function as the starting point if + // the `lockSsfi` flag isn't set. + // + // If the `lockSsfi` flag is set, then this assertion is being + // invoked from inside of another assertion. In this case, the `ssfi` + // flag has already been set by the outer assertion. + // + // Note that overwriting a chainable method merely replaces the saved + // methods in `ctx.__methods` instead of completely replacing the + // overwritten assertion. Therefore, an overwriting assertion won't + // set the `ssfi` or `lockSsfi` flags. + if (!flag(this, 'lockSsfi')) { + flag(this, 'ssfi', chainableMethodWrapper); + } + + var result = chainableBehavior.method.apply(this, arguments); + if (result !== undefined) { + return result; + } + + var newAssertion = new chai.Assertion(); + transferFlags$1(this, newAssertion); + return newAssertion; + }; + + addLengthGuard$1(chainableMethodWrapper, name, true); + + // Use `Object.setPrototypeOf` if available + if (canSetPrototype) { + // Inherit all properties from the object by replacing the `Function` prototype + var prototype = Object.create(this); + // Restore the `call` and `apply` methods from `Function` + prototype.call = call; + prototype.apply = apply; + Object.setPrototypeOf(chainableMethodWrapper, prototype); + } + // Otherwise, redefine all properties (slow!) + else { + var asserterNames = Object.getOwnPropertyNames(ctx); + asserterNames.forEach(function (asserterName) { + if (excludeNames.indexOf(asserterName) !== -1) { + return; + } + + var pd = Object.getOwnPropertyDescriptor(ctx, asserterName); + Object.defineProperty(chainableMethodWrapper, asserterName, pd); + }); + } + + transferFlags$1(this, chainableMethodWrapper); + return proxify$1(chainableMethodWrapper); + } + , configurable: true + }); + }; + return addChainableMethod; + } + + /*! + * Chai - overwriteChainableMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + + var overwriteChainableMethod; + var hasRequiredOverwriteChainableMethod; + + function requireOverwriteChainableMethod () { + if (hasRequiredOverwriteChainableMethod) return overwriteChainableMethod; + hasRequiredOverwriteChainableMethod = 1; + var chai = requireChai(); + var transferFlags$1 = transferFlags; + + /** + * ### .overwriteChainableMethod(ctx, name, method, chainingBehavior) + * + * Overwrites an already existing chainable method + * and provides access to the previous function or + * property. Must return functions to be used for + * name. + * + * utils.overwriteChainableMethod(chai.Assertion.prototype, 'lengthOf', + * function (_super) { + * } + * , function (_super) { + * } + * ); + * + * Can also be accessed directly from `chai.Assertion`. + * + * chai.Assertion.overwriteChainableMethod('foo', fn, fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.have.lengthOf(3); + * expect(myFoo).to.have.lengthOf.above(3); + * + * @param {Object} ctx object whose method / property is to be overwritten + * @param {String} name of method / property to overwrite + * @param {Function} method function that returns a function to be used for name + * @param {Function} chainingBehavior function that returns a function to be used for property + * @namespace Utils + * @name overwriteChainableMethod + * @api public + */ + + overwriteChainableMethod = function overwriteChainableMethod(ctx, name, method, chainingBehavior) { + var chainableBehavior = ctx.__methods[name]; + + var _chainingBehavior = chainableBehavior.chainingBehavior; + chainableBehavior.chainingBehavior = function overwritingChainableMethodGetter() { + var result = chainingBehavior(_chainingBehavior).call(this); + if (result !== undefined) { + return result; + } + + var newAssertion = new chai.Assertion(); + transferFlags$1(this, newAssertion); + return newAssertion; + }; + + var _method = chainableBehavior.method; + chainableBehavior.method = function overwritingChainableMethodWrapper() { + var result = method(_method).apply(this, arguments); + if (result !== undefined) { + return result; + } + + var newAssertion = new chai.Assertion(); + transferFlags$1(this, newAssertion); + return newAssertion; + }; + }; + return overwriteChainableMethod; + } + + /*! + * Chai - compareByInspect utility + * Copyright(c) 2011-2016 Jake Luer + * MIT Licensed + */ + + /*! + * Module dependencies + */ + + var inspect = inspect_1; + + /** + * ### .compareByInspect(mixed, mixed) + * + * To be used as a compareFunction with Array.prototype.sort. Compares elements + * using inspect instead of default behavior of using toString so that Symbols + * and objects with irregular/missing toString can still be sorted without a + * TypeError. + * + * @param {Mixed} first element to compare + * @param {Mixed} second element to compare + * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1 + * @name compareByInspect + * @namespace Utils + * @api public + */ + + var compareByInspect = function compareByInspect(a, b) { + return inspect(a) < inspect(b) ? -1 : 1; + }; + + /*! + * Chai - getOwnEnumerablePropertySymbols utility + * Copyright(c) 2011-2016 Jake Luer + * MIT Licensed + */ + + /** + * ### .getOwnEnumerablePropertySymbols(object) + * + * This allows the retrieval of directly-owned enumerable property symbols of an + * object. This function is necessary because Object.getOwnPropertySymbols + * returns both enumerable and non-enumerable property symbols. + * + * @param {Object} object + * @returns {Array} + * @namespace Utils + * @name getOwnEnumerablePropertySymbols + * @api public + */ + + var getOwnEnumerablePropertySymbols$1 = function getOwnEnumerablePropertySymbols(obj) { + if (typeof Object.getOwnPropertySymbols !== 'function') return []; + + return Object.getOwnPropertySymbols(obj).filter(function (sym) { + return Object.getOwnPropertyDescriptor(obj, sym).enumerable; + }); + }; + + /*! + * Chai - getOwnEnumerableProperties utility + * Copyright(c) 2011-2016 Jake Luer + * MIT Licensed + */ + + /*! + * Module dependencies + */ + + var getOwnEnumerablePropertySymbols = getOwnEnumerablePropertySymbols$1; + + /** + * ### .getOwnEnumerableProperties(object) + * + * This allows the retrieval of directly-owned enumerable property names and + * symbols of an object. This function is necessary because Object.keys only + * returns enumerable property names, not enumerable property symbols. + * + * @param {Object} object + * @returns {Array} + * @namespace Utils + * @name getOwnEnumerableProperties + * @api public + */ + + var getOwnEnumerableProperties = function getOwnEnumerableProperties(obj) { + return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj)); + }; + + /* ! + * Chai - checkError utility + * Copyright(c) 2012-2016 Jake Luer + * MIT Licensed + */ + + /** + * ### .checkError + * + * Checks that an error conforms to a given set of criteria and/or retrieves information about it. + * + * @api public + */ + + /** + * ### .compatibleInstance(thrown, errorLike) + * + * Checks if two instances are compatible (strict equal). + * Returns false if errorLike is not an instance of Error, because instances + * can only be compatible if they're both error instances. + * + * @name compatibleInstance + * @param {Error} thrown error + * @param {Error|ErrorConstructor} errorLike object to compare against + * @namespace Utils + * @api public + */ + + function compatibleInstance(thrown, errorLike) { + return errorLike instanceof Error && thrown === errorLike; + } + + /** + * ### .compatibleConstructor(thrown, errorLike) + * + * Checks if two constructors are compatible. + * This function can receive either an error constructor or + * an error instance as the `errorLike` argument. + * Constructors are compatible if they're the same or if one is + * an instance of another. + * + * @name compatibleConstructor + * @param {Error} thrown error + * @param {Error|ErrorConstructor} errorLike object to compare against + * @namespace Utils + * @api public + */ + + function compatibleConstructor(thrown, errorLike) { + if (errorLike instanceof Error) { + // If `errorLike` is an instance of any error we compare their constructors + return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor; + } else if (errorLike.prototype instanceof Error || errorLike === Error) { + // If `errorLike` is a constructor that inherits from Error, we compare `thrown` to `errorLike` directly + return thrown.constructor === errorLike || thrown instanceof errorLike; + } + + return false; + } + + /** + * ### .compatibleMessage(thrown, errMatcher) + * + * Checks if an error's message is compatible with a matcher (String or RegExp). + * If the message contains the String or passes the RegExp test, + * it is considered compatible. + * + * @name compatibleMessage + * @param {Error} thrown error + * @param {String|RegExp} errMatcher to look for into the message + * @namespace Utils + * @api public + */ + + function compatibleMessage(thrown, errMatcher) { + var comparisonString = typeof thrown === 'string' ? thrown : thrown.message; + if (errMatcher instanceof RegExp) { + return errMatcher.test(comparisonString); + } else if (typeof errMatcher === 'string') { + return comparisonString.indexOf(errMatcher) !== -1; // eslint-disable-line no-magic-numbers + } + + return false; + } + + /** + * ### .getFunctionName(constructorFn) + * + * Returns the name of a function. + * This also includes a polyfill function if `constructorFn.name` is not defined. + * + * @name getFunctionName + * @param {Function} constructorFn + * @namespace Utils + * @api private + */ + + var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\(\/]+)/; + function getFunctionName(constructorFn) { + var name = ''; + if (typeof constructorFn.name === 'undefined') { + // Here we run a polyfill if constructorFn.name is not defined + var match = String(constructorFn).match(functionNameMatch); + if (match) { + name = match[1]; + } + } else { + name = constructorFn.name; + } + + return name; + } + + /** + * ### .getConstructorName(errorLike) + * + * Gets the constructor name for an Error instance or constructor itself. + * + * @name getConstructorName + * @param {Error|ErrorConstructor} errorLike + * @namespace Utils + * @api public + */ + + function getConstructorName(errorLike) { + var constructorName = errorLike; + if (errorLike instanceof Error) { + constructorName = getFunctionName(errorLike.constructor); + } else if (typeof errorLike === 'function') { + // If `err` is not an instance of Error it is an error constructor itself or another function. + // If we've got a common function we get its name, otherwise we may need to create a new instance + // of the error just in case it's a poorly-constructed error. Please see chaijs/chai/issues/45 to know more. + constructorName = getFunctionName(errorLike).trim() || + getFunctionName(new errorLike()); // eslint-disable-line new-cap + } + + return constructorName; + } + + /** + * ### .getMessage(errorLike) + * + * Gets the error message from an error. + * If `err` is a String itself, we return it. + * If the error has no message, we return an empty string. + * + * @name getMessage + * @param {Error|String} errorLike + * @namespace Utils + * @api public + */ + + function getMessage(errorLike) { + var msg = ''; + if (errorLike && errorLike.message) { + msg = errorLike.message; + } else if (typeof errorLike === 'string') { + msg = errorLike; + } + + return msg; + } + + var checkError = { + compatibleInstance: compatibleInstance, + compatibleConstructor: compatibleConstructor, + compatibleMessage: compatibleMessage, + getMessage: getMessage, + getConstructorName: getConstructorName, + }; + + /*! + * Chai - isNaN utility + * Copyright(c) 2012-2015 Sakthipriyan Vairamani + * MIT Licensed + */ + + /** + * ### .isNaN(value) + * + * Checks if the given value is NaN or not. + * + * utils.isNaN(NaN); // true + * + * @param {Value} The value which has to be checked if it is NaN + * @name isNaN + * @api private + */ + + function isNaN(value) { + // Refer http://www.ecma-international.org/ecma-262/6.0/#sec-isnan-number + // section's NOTE. + return value !== value; + } + + // If ECMAScript 6's Number.isNaN is present, prefer that. + var _isNaN = Number.isNaN || isNaN; + + var type = typeDetect.exports; + + var flag = flag$5; + + function isObjectType(obj) { + var objectType = type(obj); + var objectTypes = ['Array', 'Object', 'function']; + + return objectTypes.indexOf(objectType) !== -1; + } + + /** + * ### .getOperator(message) + * + * Extract the operator from error message. + * Operator defined is based on below link + * https://nodejs.org/api/assert.html#assert_assert. + * + * Returns the `operator` or `undefined` value for an Assertion. + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name getOperator + * @api public + */ + + var getOperator = function getOperator(obj, args) { + var operator = flag(obj, 'operator'); + var negate = flag(obj, 'negate'); + var expected = args[3]; + var msg = negate ? args[2] : args[1]; + + if (operator) { + return operator; + } + + if (typeof msg === 'function') msg = msg(); + + msg = msg || ''; + if (!msg) { + return undefined; + } + + if (/\shave\s/.test(msg)) { + return undefined; + } + + var isObject = isObjectType(expected); + if (/\snot\s/.test(msg)) { + return isObject ? 'notDeepStrictEqual' : 'notStrictEqual'; + } + + return isObject ? 'deepStrictEqual' : 'strictEqual'; + }; + + /*! + * chai + * Copyright(c) 2011 Jake Luer + * MIT Licensed + */ + + var hasRequiredUtils; + + function requireUtils () { + if (hasRequiredUtils) return utils; + hasRequiredUtils = 1; + /*! + * Dependencies that are used for multiple exports are required here only once + */ + + var pathval$1 = pathval; + + /*! + * test utility + */ + + utils.test = test; + + /*! + * type utility + */ + + utils.type = typeDetect.exports; + + /*! + * expectTypes utility + */ + utils.expectTypes = expectTypes; + + /*! + * message utility + */ + + utils.getMessage = getMessage$1; + + /*! + * actual utility + */ + + utils.getActual = getActual$1; + + /*! + * Inspect util + */ + + utils.inspect = inspect_1; + + /*! + * Object Display util + */ + + utils.objDisplay = objDisplay$1; + + /*! + * Flag utility + */ + + utils.flag = flag$5; + + /*! + * Flag transferring utility + */ + + utils.transferFlags = transferFlags; + + /*! + * Deep equal utility + */ + + utils.eql = deepEql.exports; + + /*! + * Deep path info + */ + + utils.getPathInfo = pathval$1.getPathInfo; + + /*! + * Check if a property exists + */ + + utils.hasProperty = pathval$1.hasProperty; + + /*! + * Function name + */ + + utils.getName = getFuncName_1; + + /*! + * add Property + */ + + utils.addProperty = requireAddProperty(); + + /*! + * add Method + */ + + utils.addMethod = requireAddMethod(); + + /*! + * overwrite Property + */ + + utils.overwriteProperty = requireOverwriteProperty(); + + /*! + * overwrite Method + */ + + utils.overwriteMethod = requireOverwriteMethod(); + + /*! + * Add a chainable method + */ + + utils.addChainableMethod = requireAddChainableMethod(); + + /*! + * Overwrite chainable method + */ + + utils.overwriteChainableMethod = requireOverwriteChainableMethod(); + + /*! + * Compare by inspect method + */ + + utils.compareByInspect = compareByInspect; + + /*! + * Get own enumerable property symbols method + */ + + utils.getOwnEnumerablePropertySymbols = getOwnEnumerablePropertySymbols$1; + + /*! + * Get own enumerable properties method + */ + + utils.getOwnEnumerableProperties = getOwnEnumerableProperties; + + /*! + * Checks error against a given set of criteria + */ + + utils.checkError = checkError; + + /*! + * Proxify util + */ + + utils.proxify = proxify; + + /*! + * addLengthGuard util + */ + + utils.addLengthGuard = addLengthGuard; + + /*! + * isProxyEnabled helper + */ + + utils.isProxyEnabled = isProxyEnabled$1; + + /*! + * isNaN method + */ + + utils.isNaN = _isNaN; + + /*! + * getOperator method + */ + + utils.getOperator = getOperator; + return utils; + } + + /*! + * chai + * http://chaijs.com + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ + + var config = config$5; + + var assertion = function (_chai, util) { + /*! + * Module dependencies. + */ + + var AssertionError = _chai.AssertionError + , flag = util.flag; + + /*! + * Module export. + */ + + _chai.Assertion = Assertion; + + /*! + * Assertion Constructor + * + * Creates object for chaining. + * + * `Assertion` objects contain metadata in the form of flags. Three flags can + * be assigned during instantiation by passing arguments to this constructor: + * + * - `object`: This flag contains the target of the assertion. For example, in + * the assertion `expect(numKittens).to.equal(7);`, the `object` flag will + * contain `numKittens` so that the `equal` assertion can reference it when + * needed. + * + * - `message`: This flag contains an optional custom error message to be + * prepended to the error message that's generated by the assertion when it + * fails. + * + * - `ssfi`: This flag stands for "start stack function indicator". It + * contains a function reference that serves as the starting point for + * removing frames from the stack trace of the error that's created by the + * assertion when it fails. The goal is to provide a cleaner stack trace to + * end users by removing Chai's internal functions. Note that it only works + * in environments that support `Error.captureStackTrace`, and only when + * `Chai.config.includeStack` hasn't been set to `false`. + * + * - `lockSsfi`: This flag controls whether or not the given `ssfi` flag + * should retain its current value, even as assertions are chained off of + * this object. This is usually set to `true` when creating a new assertion + * from within another assertion. It's also temporarily set to `true` before + * an overwritten assertion gets called by the overwriting assertion. + * + * @param {Mixed} obj target of the assertion + * @param {String} msg (optional) custom error message + * @param {Function} ssfi (optional) starting point for removing stack frames + * @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked + * @api private + */ + + function Assertion (obj, msg, ssfi, lockSsfi) { + flag(this, 'ssfi', ssfi || Assertion); + flag(this, 'lockSsfi', lockSsfi); + flag(this, 'object', obj); + flag(this, 'message', msg); + + return util.proxify(this); + } + + Object.defineProperty(Assertion, 'includeStack', { + get: function() { + console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.'); + return config.includeStack; + }, + set: function(value) { + console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.'); + config.includeStack = value; + } + }); + + Object.defineProperty(Assertion, 'showDiff', { + get: function() { + console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.'); + return config.showDiff; + }, + set: function(value) { + console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.'); + config.showDiff = value; + } + }); + + Assertion.addProperty = function (name, fn) { + util.addProperty(this.prototype, name, fn); + }; + + Assertion.addMethod = function (name, fn) { + util.addMethod(this.prototype, name, fn); + }; + + Assertion.addChainableMethod = function (name, fn, chainingBehavior) { + util.addChainableMethod(this.prototype, name, fn, chainingBehavior); + }; + + Assertion.overwriteProperty = function (name, fn) { + util.overwriteProperty(this.prototype, name, fn); + }; + + Assertion.overwriteMethod = function (name, fn) { + util.overwriteMethod(this.prototype, name, fn); + }; + + Assertion.overwriteChainableMethod = function (name, fn, chainingBehavior) { + util.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior); + }; + + /** + * ### .assert(expression, message, negateMessage, expected, actual, showDiff) + * + * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass. + * + * @name assert + * @param {Philosophical} expression to be tested + * @param {String|Function} message or function that returns message to display if expression fails + * @param {String|Function} negatedMessage or function that returns negatedMessage to display if negated expression fails + * @param {Mixed} expected value (remember to check for negation) + * @param {Mixed} actual (optional) will default to `this.obj` + * @param {Boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails + * @api private + */ + + Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual, showDiff) { + var ok = util.test(this, arguments); + if (false !== showDiff) showDiff = true; + if (undefined === expected && undefined === _actual) showDiff = false; + if (true !== config.showDiff) showDiff = false; + + if (!ok) { + msg = util.getMessage(this, arguments); + var actual = util.getActual(this, arguments); + var assertionErrorObjectProperties = { + actual: actual + , expected: expected + , showDiff: showDiff + }; + + var operator = util.getOperator(this, arguments); + if (operator) { + assertionErrorObjectProperties.operator = operator; + } + + throw new AssertionError( + msg, + assertionErrorObjectProperties, + (config.includeStack) ? this.assert : flag(this, 'ssfi')); + } + }; + + /*! + * ### ._obj + * + * Quick reference to stored `actual` value for plugin developers. + * + * @api private + */ + + Object.defineProperty(Assertion.prototype, '_obj', + { get: function () { + return flag(this, 'object'); + } + , set: function (val) { + flag(this, 'object', val); + } + }); + }; + + /*! + * chai + * http://chaijs.com + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ + + var assertions = function (chai, _) { + var Assertion = chai.Assertion + , AssertionError = chai.AssertionError + , flag = _.flag; + + /** + * ### Language Chains + * + * The following are provided as chainable getters to improve the readability + * of your assertions. + * + * **Chains** + * + * - to + * - be + * - been + * - is + * - that + * - which + * - and + * - has + * - have + * - with + * - at + * - of + * - same + * - but + * - does + * - still + * - also + * + * @name language chains + * @namespace BDD + * @api public + */ + + [ 'to', 'be', 'been', 'is' + , 'and', 'has', 'have', 'with' + , 'that', 'which', 'at', 'of' + , 'same', 'but', 'does', 'still', "also" ].forEach(function (chain) { + Assertion.addProperty(chain); + }); + + /** + * ### .not + * + * Negates all assertions that follow in the chain. + * + * expect(function () {}).to.not.throw(); + * expect({a: 1}).to.not.have.property('b'); + * expect([1, 2]).to.be.an('array').that.does.not.include(3); + * + * Just because you can negate any assertion with `.not` doesn't mean you + * should. With great power comes great responsibility. It's often best to + * assert that the one expected output was produced, rather than asserting + * that one of countless unexpected outputs wasn't produced. See individual + * assertions for specific guidance. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.not.equal(1); // Not recommended + * + * @name not + * @namespace BDD + * @api public + */ + + Assertion.addProperty('not', function () { + flag(this, 'negate', true); + }); + + /** + * ### .deep + * + * Causes all `.equal`, `.include`, `.members`, `.keys`, and `.property` + * assertions that follow in the chain to use deep equality instead of strict + * (`===`) equality. See the `deep-eql` project page for info on the deep + * equality algorithm: https://github.com/chaijs/deep-eql. + * + * // Target object deeply (but not strictly) equals `{a: 1}` + * expect({a: 1}).to.deep.equal({a: 1}); + * expect({a: 1}).to.not.equal({a: 1}); + * + * // Target array deeply (but not strictly) includes `{a: 1}` + * expect([{a: 1}]).to.deep.include({a: 1}); + * expect([{a: 1}]).to.not.include({a: 1}); + * + * // Target object deeply (but not strictly) includes `x: {a: 1}` + * expect({x: {a: 1}}).to.deep.include({x: {a: 1}}); + * expect({x: {a: 1}}).to.not.include({x: {a: 1}}); + * + * // Target array deeply (but not strictly) has member `{a: 1}` + * expect([{a: 1}]).to.have.deep.members([{a: 1}]); + * expect([{a: 1}]).to.not.have.members([{a: 1}]); + * + * // Target set deeply (but not strictly) has key `{a: 1}` + * expect(new Set([{a: 1}])).to.have.deep.keys([{a: 1}]); + * expect(new Set([{a: 1}])).to.not.have.keys([{a: 1}]); + * + * // Target object deeply (but not strictly) has property `x: {a: 1}` + * expect({x: {a: 1}}).to.have.deep.property('x', {a: 1}); + * expect({x: {a: 1}}).to.not.have.property('x', {a: 1}); + * + * @name deep + * @namespace BDD + * @api public + */ + + Assertion.addProperty('deep', function () { + flag(this, 'deep', true); + }); + + /** + * ### .nested + * + * Enables dot- and bracket-notation in all `.property` and `.include` + * assertions that follow in the chain. + * + * expect({a: {b: ['x', 'y']}}).to.have.nested.property('a.b[1]'); + * expect({a: {b: ['x', 'y']}}).to.nested.include({'a.b[1]': 'y'}); + * + * If `.` or `[]` are part of an actual property name, they can be escaped by + * adding two backslashes before them. + * + * expect({'.a': {'[b]': 'x'}}).to.have.nested.property('\\.a.\\[b\\]'); + * expect({'.a': {'[b]': 'x'}}).to.nested.include({'\\.a.\\[b\\]': 'x'}); + * + * `.nested` cannot be combined with `.own`. + * + * @name nested + * @namespace BDD + * @api public + */ + + Assertion.addProperty('nested', function () { + flag(this, 'nested', true); + }); + + /** + * ### .own + * + * Causes all `.property` and `.include` assertions that follow in the chain + * to ignore inherited properties. + * + * Object.prototype.b = 2; + * + * expect({a: 1}).to.have.own.property('a'); + * expect({a: 1}).to.have.property('b'); + * expect({a: 1}).to.not.have.own.property('b'); + * + * expect({a: 1}).to.own.include({a: 1}); + * expect({a: 1}).to.include({b: 2}).but.not.own.include({b: 2}); + * + * `.own` cannot be combined with `.nested`. + * + * @name own + * @namespace BDD + * @api public + */ + + Assertion.addProperty('own', function () { + flag(this, 'own', true); + }); + + /** + * ### .ordered + * + * Causes all `.members` assertions that follow in the chain to require that + * members be in the same order. + * + * expect([1, 2]).to.have.ordered.members([1, 2]) + * .but.not.have.ordered.members([2, 1]); + * + * When `.include` and `.ordered` are combined, the ordering begins at the + * start of both arrays. + * + * expect([1, 2, 3]).to.include.ordered.members([1, 2]) + * .but.not.include.ordered.members([2, 3]); + * + * @name ordered + * @namespace BDD + * @api public + */ + + Assertion.addProperty('ordered', function () { + flag(this, 'ordered', true); + }); + + /** + * ### .any + * + * Causes all `.keys` assertions that follow in the chain to only require that + * the target have at least one of the given keys. This is the opposite of + * `.all`, which requires that the target have all of the given keys. + * + * expect({a: 1, b: 2}).to.not.have.any.keys('c', 'd'); + * + * See the `.keys` doc for guidance on when to use `.any` or `.all`. + * + * @name any + * @namespace BDD + * @api public + */ + + Assertion.addProperty('any', function () { + flag(this, 'any', true); + flag(this, 'all', false); + }); + + /** + * ### .all + * + * Causes all `.keys` assertions that follow in the chain to require that the + * target have all of the given keys. This is the opposite of `.any`, which + * only requires that the target have at least one of the given keys. + * + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); + * + * Note that `.all` is used by default when neither `.all` nor `.any` are + * added earlier in the chain. However, it's often best to add `.all` anyway + * because it improves readability. + * + * See the `.keys` doc for guidance on when to use `.any` or `.all`. + * + * @name all + * @namespace BDD + * @api public + */ + + Assertion.addProperty('all', function () { + flag(this, 'all', true); + flag(this, 'any', false); + }); + + /** + * ### .a(type[, msg]) + * + * Asserts that the target's type is equal to the given string `type`. Types + * are case insensitive. See the `type-detect` project page for info on the + * type detection algorithm: https://github.com/chaijs/type-detect. + * + * expect('foo').to.be.a('string'); + * expect({a: 1}).to.be.an('object'); + * expect(null).to.be.a('null'); + * expect(undefined).to.be.an('undefined'); + * expect(new Error).to.be.an('error'); + * expect(Promise.resolve()).to.be.a('promise'); + * expect(new Float32Array).to.be.a('float32array'); + * expect(Symbol()).to.be.a('symbol'); + * + * `.a` supports objects that have a custom type set via `Symbol.toStringTag`. + * + * var myObj = { + * [Symbol.toStringTag]: 'myCustomType' + * }; + * + * expect(myObj).to.be.a('myCustomType').but.not.an('object'); + * + * It's often best to use `.a` to check a target's type before making more + * assertions on the same target. That way, you avoid unexpected behavior from + * any assertion that does different things based on the target's type. + * + * expect([1, 2, 3]).to.be.an('array').that.includes(2); + * expect([]).to.be.an('array').that.is.empty; + * + * Add `.not` earlier in the chain to negate `.a`. However, it's often best to + * assert that the target is the expected type, rather than asserting that it + * isn't one of many unexpected types. + * + * expect('foo').to.be.a('string'); // Recommended + * expect('foo').to.not.be.an('array'); // Not recommended + * + * `.a` accepts an optional `msg` argument which is a custom error message to + * show when the assertion fails. The message can also be given as the second + * argument to `expect`. + * + * expect(1).to.be.a('string', 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.a('string'); + * + * `.a` can also be used as a language chain to improve the readability of + * your assertions. + * + * expect({b: 2}).to.have.a.property('b'); + * + * The alias `.an` can be used interchangeably with `.a`. + * + * @name a + * @alias an + * @param {String} type + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function an (type, msg) { + if (msg) flag(this, 'message', msg); + type = type.toLowerCase(); + var obj = flag(this, 'object') + , article = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(type.charAt(0)) ? 'an ' : 'a '; + + this.assert( + type === _.type(obj).toLowerCase() + , 'expected #{this} to be ' + article + type + , 'expected #{this} not to be ' + article + type + ); + } + + Assertion.addChainableMethod('an', an); + Assertion.addChainableMethod('a', an); + + /** + * ### .include(val[, msg]) + * + * When the target is a string, `.include` asserts that the given string `val` + * is a substring of the target. + * + * expect('foobar').to.include('foo'); + * + * When the target is an array, `.include` asserts that the given `val` is a + * member of the target. + * + * expect([1, 2, 3]).to.include(2); + * + * When the target is an object, `.include` asserts that the given object + * `val`'s properties are a subset of the target's properties. + * + * expect({a: 1, b: 2, c: 3}).to.include({a: 1, b: 2}); + * + * When the target is a Set or WeakSet, `.include` asserts that the given `val` is a + * member of the target. SameValueZero equality algorithm is used. + * + * expect(new Set([1, 2])).to.include(2); + * + * When the target is a Map, `.include` asserts that the given `val` is one of + * the values of the target. SameValueZero equality algorithm is used. + * + * expect(new Map([['a', 1], ['b', 2]])).to.include(2); + * + * Because `.include` does different things based on the target's type, it's + * important to check the target's type before using `.include`. See the `.a` + * doc for info on testing a target's type. + * + * expect([1, 2, 3]).to.be.an('array').that.includes(2); + * + * By default, strict (`===`) equality is used to compare array members and + * object properties. Add `.deep` earlier in the chain to use deep equality + * instead (WeakSet targets are not supported). See the `deep-eql` project + * page for info on the deep equality algorithm: https://github.com/chaijs/deep-eql. + * + * // Target array deeply (but not strictly) includes `{a: 1}` + * expect([{a: 1}]).to.deep.include({a: 1}); + * expect([{a: 1}]).to.not.include({a: 1}); + * + * // Target object deeply (but not strictly) includes `x: {a: 1}` + * expect({x: {a: 1}}).to.deep.include({x: {a: 1}}); + * expect({x: {a: 1}}).to.not.include({x: {a: 1}}); + * + * By default, all of the target's properties are searched when working with + * objects. This includes properties that are inherited and/or non-enumerable. + * Add `.own` earlier in the chain to exclude the target's inherited + * properties from the search. + * + * Object.prototype.b = 2; + * + * expect({a: 1}).to.own.include({a: 1}); + * expect({a: 1}).to.include({b: 2}).but.not.own.include({b: 2}); + * + * Note that a target object is always only searched for `val`'s own + * enumerable properties. + * + * `.deep` and `.own` can be combined. + * + * expect({a: {b: 2}}).to.deep.own.include({a: {b: 2}}); + * + * Add `.nested` earlier in the chain to enable dot- and bracket-notation when + * referencing nested properties. + * + * expect({a: {b: ['x', 'y']}}).to.nested.include({'a.b[1]': 'y'}); + * + * If `.` or `[]` are part of an actual property name, they can be escaped by + * adding two backslashes before them. + * + * expect({'.a': {'[b]': 2}}).to.nested.include({'\\.a.\\[b\\]': 2}); + * + * `.deep` and `.nested` can be combined. + * + * expect({a: {b: [{c: 3}]}}).to.deep.nested.include({'a.b[0]': {c: 3}}); + * + * `.own` and `.nested` cannot be combined. + * + * Add `.not` earlier in the chain to negate `.include`. + * + * expect('foobar').to.not.include('taco'); + * expect([1, 2, 3]).to.not.include(4); + * + * However, it's dangerous to negate `.include` when the target is an object. + * The problem is that it creates uncertain expectations by asserting that the + * target object doesn't have all of `val`'s key/value pairs but may or may + * not have some of them. It's often best to identify the exact output that's + * expected, and then write an assertion that only accepts that exact output. + * + * When the target object isn't even expected to have `val`'s keys, it's + * often best to assert exactly that. + * + * expect({c: 3}).to.not.have.any.keys('a', 'b'); // Recommended + * expect({c: 3}).to.not.include({a: 1, b: 2}); // Not recommended + * + * When the target object is expected to have `val`'s keys, it's often best to + * assert that each of the properties has its expected value, rather than + * asserting that each property doesn't have one of many unexpected values. + * + * expect({a: 3, b: 4}).to.include({a: 3, b: 4}); // Recommended + * expect({a: 3, b: 4}).to.not.include({a: 1, b: 2}); // Not recommended + * + * `.include` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. + * + * expect([1, 2, 3]).to.include(4, 'nooo why fail??'); + * expect([1, 2, 3], 'nooo why fail??').to.include(4); + * + * `.include` can also be used as a language chain, causing all `.members` and + * `.keys` assertions that follow in the chain to require the target to be a + * superset of the expected set, rather than an identical set. Note that + * `.members` ignores duplicates in the subset when `.include` is added. + * + * // Target object's keys are a superset of ['a', 'b'] but not identical + * expect({a: 1, b: 2, c: 3}).to.include.all.keys('a', 'b'); + * expect({a: 1, b: 2, c: 3}).to.not.have.all.keys('a', 'b'); + * + * // Target array is a superset of [1, 2] but not identical + * expect([1, 2, 3]).to.include.members([1, 2]); + * expect([1, 2, 3]).to.not.have.members([1, 2]); + * + * // Duplicates in the subset are ignored + * expect([1, 2, 3]).to.include.members([1, 2, 2, 2]); + * + * Note that adding `.any` earlier in the chain causes the `.keys` assertion + * to ignore `.include`. + * + * // Both assertions are identical + * expect({a: 1}).to.include.any.keys('a', 'b'); + * expect({a: 1}).to.have.any.keys('a', 'b'); + * + * The aliases `.includes`, `.contain`, and `.contains` can be used + * interchangeably with `.include`. + * + * @name include + * @alias contain + * @alias includes + * @alias contains + * @param {Mixed} val + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function SameValueZero(a, b) { + return (_.isNaN(a) && _.isNaN(b)) || a === b; + } + + function includeChainingBehavior () { + flag(this, 'contains', true); + } + + function include (val, msg) { + if (msg) flag(this, 'message', msg); + + var obj = flag(this, 'object') + , objType = _.type(obj).toLowerCase() + , flagMsg = flag(this, 'message') + , negate = flag(this, 'negate') + , ssfi = flag(this, 'ssfi') + , isDeep = flag(this, 'deep') + , descriptor = isDeep ? 'deep ' : ''; + + flagMsg = flagMsg ? flagMsg + ': ' : ''; + + var included = false; + + switch (objType) { + case 'string': + included = obj.indexOf(val) !== -1; + break; + + case 'weakset': + if (isDeep) { + throw new AssertionError( + flagMsg + 'unable to use .deep.include with WeakSet', + undefined, + ssfi + ); + } + + included = obj.has(val); + break; + + case 'map': + var isEql = isDeep ? _.eql : SameValueZero; + obj.forEach(function (item) { + included = included || isEql(item, val); + }); + break; + + case 'set': + if (isDeep) { + obj.forEach(function (item) { + included = included || _.eql(item, val); + }); + } else { + included = obj.has(val); + } + break; + + case 'array': + if (isDeep) { + included = obj.some(function (item) { + return _.eql(item, val); + }); + } else { + included = obj.indexOf(val) !== -1; + } + break; + + default: + // This block is for asserting a subset of properties in an object. + // `_.expectTypes` isn't used here because `.include` should work with + // objects with a custom `@@toStringTag`. + if (val !== Object(val)) { + throw new AssertionError( + flagMsg + 'the given combination of arguments (' + + objType + ' and ' + + _.type(val).toLowerCase() + ')' + + ' is invalid for this assertion. ' + + 'You can use an array, a map, an object, a set, a string, ' + + 'or a weakset instead of a ' + + _.type(val).toLowerCase(), + undefined, + ssfi + ); + } + + var props = Object.keys(val) + , firstErr = null + , numErrs = 0; + + props.forEach(function (prop) { + var propAssertion = new Assertion(obj); + _.transferFlags(this, propAssertion, true); + flag(propAssertion, 'lockSsfi', true); + + if (!negate || props.length === 1) { + propAssertion.property(prop, val[prop]); + return; + } + + try { + propAssertion.property(prop, val[prop]); + } catch (err) { + if (!_.checkError.compatibleConstructor(err, AssertionError)) { + throw err; + } + if (firstErr === null) firstErr = err; + numErrs++; + } + }, this); + + // When validating .not.include with multiple properties, we only want + // to throw an assertion error if all of the properties are included, + // in which case we throw the first property assertion error that we + // encountered. + if (negate && props.length > 1 && numErrs === props.length) { + throw firstErr; + } + return; + } + + // Assert inclusion in collection or substring in a string. + this.assert( + included + , 'expected #{this} to ' + descriptor + 'include ' + _.inspect(val) + , 'expected #{this} to not ' + descriptor + 'include ' + _.inspect(val)); + } + + Assertion.addChainableMethod('include', include, includeChainingBehavior); + Assertion.addChainableMethod('contain', include, includeChainingBehavior); + Assertion.addChainableMethod('contains', include, includeChainingBehavior); + Assertion.addChainableMethod('includes', include, includeChainingBehavior); + + /** + * ### .ok + * + * Asserts that the target is a truthy value (considered `true` in boolean context). + * However, it's often best to assert that the target is strictly (`===`) or + * deeply equal to its expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.ok; // Not recommended + * + * expect(true).to.be.true; // Recommended + * expect(true).to.be.ok; // Not recommended + * + * Add `.not` earlier in the chain to negate `.ok`. + * + * expect(0).to.equal(0); // Recommended + * expect(0).to.not.be.ok; // Not recommended + * + * expect(false).to.be.false; // Recommended + * expect(false).to.not.be.ok; // Not recommended + * + * expect(null).to.be.null; // Recommended + * expect(null).to.not.be.ok; // Not recommended + * + * expect(undefined).to.be.undefined; // Recommended + * expect(undefined).to.not.be.ok; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect(false, 'nooo why fail??').to.be.ok; + * + * @name ok + * @namespace BDD + * @api public + */ + + Assertion.addProperty('ok', function () { + this.assert( + flag(this, 'object') + , 'expected #{this} to be truthy' + , 'expected #{this} to be falsy'); + }); + + /** + * ### .true + * + * Asserts that the target is strictly (`===`) equal to `true`. + * + * expect(true).to.be.true; + * + * Add `.not` earlier in the chain to negate `.true`. However, it's often best + * to assert that the target is equal to its expected value, rather than not + * equal to `true`. + * + * expect(false).to.be.false; // Recommended + * expect(false).to.not.be.true; // Not recommended + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.true; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect(false, 'nooo why fail??').to.be.true; + * + * @name true + * @namespace BDD + * @api public + */ + + Assertion.addProperty('true', function () { + this.assert( + true === flag(this, 'object') + , 'expected #{this} to be true' + , 'expected #{this} to be false' + , flag(this, 'negate') ? false : true + ); + }); + + /** + * ### .false + * + * Asserts that the target is strictly (`===`) equal to `false`. + * + * expect(false).to.be.false; + * + * Add `.not` earlier in the chain to negate `.false`. However, it's often + * best to assert that the target is equal to its expected value, rather than + * not equal to `false`. + * + * expect(true).to.be.true; // Recommended + * expect(true).to.not.be.false; // Not recommended + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.false; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect(true, 'nooo why fail??').to.be.false; + * + * @name false + * @namespace BDD + * @api public + */ + + Assertion.addProperty('false', function () { + this.assert( + false === flag(this, 'object') + , 'expected #{this} to be false' + , 'expected #{this} to be true' + , flag(this, 'negate') ? true : false + ); + }); + + /** + * ### .null + * + * Asserts that the target is strictly (`===`) equal to `null`. + * + * expect(null).to.be.null; + * + * Add `.not` earlier in the chain to negate `.null`. However, it's often best + * to assert that the target is equal to its expected value, rather than not + * equal to `null`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.null; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect(42, 'nooo why fail??').to.be.null; + * + * @name null + * @namespace BDD + * @api public + */ + + Assertion.addProperty('null', function () { + this.assert( + null === flag(this, 'object') + , 'expected #{this} to be null' + , 'expected #{this} not to be null' + ); + }); + + /** + * ### .undefined + * + * Asserts that the target is strictly (`===`) equal to `undefined`. + * + * expect(undefined).to.be.undefined; + * + * Add `.not` earlier in the chain to negate `.undefined`. However, it's often + * best to assert that the target is equal to its expected value, rather than + * not equal to `undefined`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.undefined; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect(42, 'nooo why fail??').to.be.undefined; + * + * @name undefined + * @namespace BDD + * @api public + */ + + Assertion.addProperty('undefined', function () { + this.assert( + undefined === flag(this, 'object') + , 'expected #{this} to be undefined' + , 'expected #{this} not to be undefined' + ); + }); + + /** + * ### .NaN + * + * Asserts that the target is exactly `NaN`. + * + * expect(NaN).to.be.NaN; + * + * Add `.not` earlier in the chain to negate `.NaN`. However, it's often best + * to assert that the target is equal to its expected value, rather than not + * equal to `NaN`. + * + * expect('foo').to.equal('foo'); // Recommended + * expect('foo').to.not.be.NaN; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect(42, 'nooo why fail??').to.be.NaN; + * + * @name NaN + * @namespace BDD + * @api public + */ + + Assertion.addProperty('NaN', function () { + this.assert( + _.isNaN(flag(this, 'object')) + , 'expected #{this} to be NaN' + , 'expected #{this} not to be NaN' + ); + }); + + /** + * ### .exist + * + * Asserts that the target is not strictly (`===`) equal to either `null` or + * `undefined`. However, it's often best to assert that the target is equal to + * its expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.exist; // Not recommended + * + * expect(0).to.equal(0); // Recommended + * expect(0).to.exist; // Not recommended + * + * Add `.not` earlier in the chain to negate `.exist`. + * + * expect(null).to.be.null; // Recommended + * expect(null).to.not.exist; // Not recommended + * + * expect(undefined).to.be.undefined; // Recommended + * expect(undefined).to.not.exist; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect(null, 'nooo why fail??').to.exist; + * + * The alias `.exists` can be used interchangeably with `.exist`. + * + * @name exist + * @alias exists + * @namespace BDD + * @api public + */ + + function assertExist () { + var val = flag(this, 'object'); + this.assert( + val !== null && val !== undefined + , 'expected #{this} to exist' + , 'expected #{this} to not exist' + ); + } + + Assertion.addProperty('exist', assertExist); + Assertion.addProperty('exists', assertExist); + + /** + * ### .empty + * + * When the target is a string or array, `.empty` asserts that the target's + * `length` property is strictly (`===`) equal to `0`. + * + * expect([]).to.be.empty; + * expect('').to.be.empty; + * + * When the target is a map or set, `.empty` asserts that the target's `size` + * property is strictly equal to `0`. + * + * expect(new Set()).to.be.empty; + * expect(new Map()).to.be.empty; + * + * When the target is a non-function object, `.empty` asserts that the target + * doesn't have any own enumerable properties. Properties with Symbol-based + * keys are excluded from the count. + * + * expect({}).to.be.empty; + * + * Because `.empty` does different things based on the target's type, it's + * important to check the target's type before using `.empty`. See the `.a` + * doc for info on testing a target's type. + * + * expect([]).to.be.an('array').that.is.empty; + * + * Add `.not` earlier in the chain to negate `.empty`. However, it's often + * best to assert that the target contains its expected number of values, + * rather than asserting that it's not empty. + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.not.be.empty; // Not recommended + * + * expect(new Set([1, 2, 3])).to.have.property('size', 3); // Recommended + * expect(new Set([1, 2, 3])).to.not.be.empty; // Not recommended + * + * expect(Object.keys({a: 1})).to.have.lengthOf(1); // Recommended + * expect({a: 1}).to.not.be.empty; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect([1, 2, 3], 'nooo why fail??').to.be.empty; + * + * @name empty + * @namespace BDD + * @api public + */ + + Assertion.addProperty('empty', function () { + var val = flag(this, 'object') + , ssfi = flag(this, 'ssfi') + , flagMsg = flag(this, 'message') + , itemsCount; + + flagMsg = flagMsg ? flagMsg + ': ' : ''; + + switch (_.type(val).toLowerCase()) { + case 'array': + case 'string': + itemsCount = val.length; + break; + case 'map': + case 'set': + itemsCount = val.size; + break; + case 'weakmap': + case 'weakset': + throw new AssertionError( + flagMsg + '.empty was passed a weak collection', + undefined, + ssfi + ); + case 'function': + var msg = flagMsg + '.empty was passed a function ' + _.getName(val); + throw new AssertionError(msg.trim(), undefined, ssfi); + default: + if (val !== Object(val)) { + throw new AssertionError( + flagMsg + '.empty was passed non-string primitive ' + _.inspect(val), + undefined, + ssfi + ); + } + itemsCount = Object.keys(val).length; + } + + this.assert( + 0 === itemsCount + , 'expected #{this} to be empty' + , 'expected #{this} not to be empty' + ); + }); + + /** + * ### .arguments + * + * Asserts that the target is an `arguments` object. + * + * function test () { + * expect(arguments).to.be.arguments; + * } + * + * test(); + * + * Add `.not` earlier in the chain to negate `.arguments`. However, it's often + * best to assert which type the target is expected to be, rather than + * asserting that it’s not an `arguments` object. + * + * expect('foo').to.be.a('string'); // Recommended + * expect('foo').to.not.be.arguments; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect({}, 'nooo why fail??').to.be.arguments; + * + * The alias `.Arguments` can be used interchangeably with `.arguments`. + * + * @name arguments + * @alias Arguments + * @namespace BDD + * @api public + */ + + function checkArguments () { + var obj = flag(this, 'object') + , type = _.type(obj); + this.assert( + 'Arguments' === type + , 'expected #{this} to be arguments but got ' + type + , 'expected #{this} to not be arguments' + ); + } + + Assertion.addProperty('arguments', checkArguments); + Assertion.addProperty('Arguments', checkArguments); + + /** + * ### .equal(val[, msg]) + * + * Asserts that the target is strictly (`===`) equal to the given `val`. + * + * expect(1).to.equal(1); + * expect('foo').to.equal('foo'); + * + * Add `.deep` earlier in the chain to use deep equality instead. See the + * `deep-eql` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target object deeply (but not strictly) equals `{a: 1}` + * expect({a: 1}).to.deep.equal({a: 1}); + * expect({a: 1}).to.not.equal({a: 1}); + * + * // Target array deeply (but not strictly) equals `[1, 2]` + * expect([1, 2]).to.deep.equal([1, 2]); + * expect([1, 2]).to.not.equal([1, 2]); + * + * Add `.not` earlier in the chain to negate `.equal`. However, it's often + * best to assert that the target is equal to its expected value, rather than + * not equal to one of countless unexpected values. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.equal(2); // Not recommended + * + * `.equal` accepts an optional `msg` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to `expect`. + * + * expect(1).to.equal(2, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.equal(2); + * + * The aliases `.equals` and `eq` can be used interchangeably with `.equal`. + * + * @name equal + * @alias equals + * @alias eq + * @param {Mixed} val + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertEqual (val, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object'); + if (flag(this, 'deep')) { + var prevLockSsfi = flag(this, 'lockSsfi'); + flag(this, 'lockSsfi', true); + this.eql(val); + flag(this, 'lockSsfi', prevLockSsfi); + } else { + this.assert( + val === obj + , 'expected #{this} to equal #{exp}' + , 'expected #{this} to not equal #{exp}' + , val + , this._obj + , true + ); + } + } + + Assertion.addMethod('equal', assertEqual); + Assertion.addMethod('equals', assertEqual); + Assertion.addMethod('eq', assertEqual); + + /** + * ### .eql(obj[, msg]) + * + * Asserts that the target is deeply equal to the given `obj`. See the + * `deep-eql` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target object is deeply (but not strictly) equal to {a: 1} + * expect({a: 1}).to.eql({a: 1}).but.not.equal({a: 1}); + * + * // Target array is deeply (but not strictly) equal to [1, 2] + * expect([1, 2]).to.eql([1, 2]).but.not.equal([1, 2]); + * + * Add `.not` earlier in the chain to negate `.eql`. However, it's often best + * to assert that the target is deeply equal to its expected value, rather + * than not deeply equal to one of countless unexpected values. + * + * expect({a: 1}).to.eql({a: 1}); // Recommended + * expect({a: 1}).to.not.eql({b: 2}); // Not recommended + * + * `.eql` accepts an optional `msg` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to `expect`. + * + * expect({a: 1}).to.eql({b: 2}, 'nooo why fail??'); + * expect({a: 1}, 'nooo why fail??').to.eql({b: 2}); + * + * The alias `.eqls` can be used interchangeably with `.eql`. + * + * The `.deep.equal` assertion is almost identical to `.eql` but with one + * difference: `.deep.equal` causes deep equality comparisons to also be used + * for any other assertions that follow in the chain. + * + * @name eql + * @alias eqls + * @param {Mixed} obj + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertEql(obj, msg) { + if (msg) flag(this, 'message', msg); + this.assert( + _.eql(obj, flag(this, 'object')) + , 'expected #{this} to deeply equal #{exp}' + , 'expected #{this} to not deeply equal #{exp}' + , obj + , this._obj + , true + ); + } + + Assertion.addMethod('eql', assertEql); + Assertion.addMethod('eqls', assertEql); + + /** + * ### .above(n[, msg]) + * + * Asserts that the target is a number or a date greater than the given number or date `n` respectively. + * However, it's often best to assert that the target is equal to its expected + * value. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.be.above(1); // Not recommended + * + * Add `.lengthOf` earlier in the chain to assert that the target's `length` + * or `size` is greater than the given number `n`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.above(2); // Not recommended + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.above(2); // Not recommended + * + * Add `.not` earlier in the chain to negate `.above`. + * + * expect(2).to.equal(2); // Recommended + * expect(1).to.not.be.above(2); // Not recommended + * + * `.above` accepts an optional `msg` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to `expect`. + * + * expect(1).to.be.above(2, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.above(2); + * + * The aliases `.gt` and `.greaterThan` can be used interchangeably with + * `.above`. + * + * @name above + * @alias gt + * @alias greaterThan + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertAbove (n, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , doLength = flag(this, 'doLength') + , flagMsg = flag(this, 'message') + , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '') + , ssfi = flag(this, 'ssfi') + , objType = _.type(obj).toLowerCase() + , nType = _.type(n).toLowerCase() + , errorMessage + , shouldThrow = true; + + if (doLength && objType !== 'map' && objType !== 'set') { + new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); + } + + if (!doLength && (objType === 'date' && nType !== 'date')) { + errorMessage = msgPrefix + 'the argument to above must be a date'; + } else if (nType !== 'number' && (doLength || objType === 'number')) { + errorMessage = msgPrefix + 'the argument to above must be a number'; + } else if (!doLength && (objType !== 'date' && objType !== 'number')) { + var printObj = (objType === 'string') ? "'" + obj + "'" : obj; + errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date'; + } else { + shouldThrow = false; + } + + if (shouldThrow) { + throw new AssertionError(errorMessage, undefined, ssfi); + } + + if (doLength) { + var descriptor = 'length' + , itemsCount; + if (objType === 'map' || objType === 'set') { + descriptor = 'size'; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount > n + , 'expected #{this} to have a ' + descriptor + ' above #{exp} but got #{act}' + , 'expected #{this} to not have a ' + descriptor + ' above #{exp}' + , n + , itemsCount + ); + } else { + this.assert( + obj > n + , 'expected #{this} to be above #{exp}' + , 'expected #{this} to be at most #{exp}' + , n + ); + } + } + + Assertion.addMethod('above', assertAbove); + Assertion.addMethod('gt', assertAbove); + Assertion.addMethod('greaterThan', assertAbove); + + /** + * ### .least(n[, msg]) + * + * Asserts that the target is a number or a date greater than or equal to the given + * number or date `n` respectively. However, it's often best to assert that the target is equal to + * its expected value. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.be.at.least(1); // Not recommended + * expect(2).to.be.at.least(2); // Not recommended + * + * Add `.lengthOf` earlier in the chain to assert that the target's `length` + * or `size` is greater than or equal to the given number `n`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.at.least(2); // Not recommended + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.at.least(2); // Not recommended + * + * Add `.not` earlier in the chain to negate `.least`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.at.least(2); // Not recommended + * + * `.least` accepts an optional `msg` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to `expect`. + * + * expect(1).to.be.at.least(2, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.at.least(2); + * + * The aliases `.gte` and `.greaterThanOrEqual` can be used interchangeably with + * `.least`. + * + * @name least + * @alias gte + * @alias greaterThanOrEqual + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertLeast (n, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , doLength = flag(this, 'doLength') + , flagMsg = flag(this, 'message') + , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '') + , ssfi = flag(this, 'ssfi') + , objType = _.type(obj).toLowerCase() + , nType = _.type(n).toLowerCase() + , errorMessage + , shouldThrow = true; + + if (doLength && objType !== 'map' && objType !== 'set') { + new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); + } + + if (!doLength && (objType === 'date' && nType !== 'date')) { + errorMessage = msgPrefix + 'the argument to least must be a date'; + } else if (nType !== 'number' && (doLength || objType === 'number')) { + errorMessage = msgPrefix + 'the argument to least must be a number'; + } else if (!doLength && (objType !== 'date' && objType !== 'number')) { + var printObj = (objType === 'string') ? "'" + obj + "'" : obj; + errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date'; + } else { + shouldThrow = false; + } + + if (shouldThrow) { + throw new AssertionError(errorMessage, undefined, ssfi); + } + + if (doLength) { + var descriptor = 'length' + , itemsCount; + if (objType === 'map' || objType === 'set') { + descriptor = 'size'; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount >= n + , 'expected #{this} to have a ' + descriptor + ' at least #{exp} but got #{act}' + , 'expected #{this} to have a ' + descriptor + ' below #{exp}' + , n + , itemsCount + ); + } else { + this.assert( + obj >= n + , 'expected #{this} to be at least #{exp}' + , 'expected #{this} to be below #{exp}' + , n + ); + } + } + + Assertion.addMethod('least', assertLeast); + Assertion.addMethod('gte', assertLeast); + Assertion.addMethod('greaterThanOrEqual', assertLeast); + + /** + * ### .below(n[, msg]) + * + * Asserts that the target is a number or a date less than the given number or date `n` respectively. + * However, it's often best to assert that the target is equal to its expected + * value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.below(2); // Not recommended + * + * Add `.lengthOf` earlier in the chain to assert that the target's `length` + * or `size` is less than the given number `n`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.below(4); // Not recommended + * + * expect([1, 2, 3]).to.have.length(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.below(4); // Not recommended + * + * Add `.not` earlier in the chain to negate `.below`. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.not.be.below(1); // Not recommended + * + * `.below` accepts an optional `msg` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to `expect`. + * + * expect(2).to.be.below(1, 'nooo why fail??'); + * expect(2, 'nooo why fail??').to.be.below(1); + * + * The aliases `.lt` and `.lessThan` can be used interchangeably with + * `.below`. + * + * @name below + * @alias lt + * @alias lessThan + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertBelow (n, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , doLength = flag(this, 'doLength') + , flagMsg = flag(this, 'message') + , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '') + , ssfi = flag(this, 'ssfi') + , objType = _.type(obj).toLowerCase() + , nType = _.type(n).toLowerCase() + , errorMessage + , shouldThrow = true; + + if (doLength && objType !== 'map' && objType !== 'set') { + new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); + } + + if (!doLength && (objType === 'date' && nType !== 'date')) { + errorMessage = msgPrefix + 'the argument to below must be a date'; + } else if (nType !== 'number' && (doLength || objType === 'number')) { + errorMessage = msgPrefix + 'the argument to below must be a number'; + } else if (!doLength && (objType !== 'date' && objType !== 'number')) { + var printObj = (objType === 'string') ? "'" + obj + "'" : obj; + errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date'; + } else { + shouldThrow = false; + } + + if (shouldThrow) { + throw new AssertionError(errorMessage, undefined, ssfi); + } + + if (doLength) { + var descriptor = 'length' + , itemsCount; + if (objType === 'map' || objType === 'set') { + descriptor = 'size'; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount < n + , 'expected #{this} to have a ' + descriptor + ' below #{exp} but got #{act}' + , 'expected #{this} to not have a ' + descriptor + ' below #{exp}' + , n + , itemsCount + ); + } else { + this.assert( + obj < n + , 'expected #{this} to be below #{exp}' + , 'expected #{this} to be at least #{exp}' + , n + ); + } + } + + Assertion.addMethod('below', assertBelow); + Assertion.addMethod('lt', assertBelow); + Assertion.addMethod('lessThan', assertBelow); + + /** + * ### .most(n[, msg]) + * + * Asserts that the target is a number or a date less than or equal to the given number + * or date `n` respectively. However, it's often best to assert that the target is equal to its + * expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.at.most(2); // Not recommended + * expect(1).to.be.at.most(1); // Not recommended + * + * Add `.lengthOf` earlier in the chain to assert that the target's `length` + * or `size` is less than or equal to the given number `n`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.at.most(4); // Not recommended + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.at.most(4); // Not recommended + * + * Add `.not` earlier in the chain to negate `.most`. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.not.be.at.most(1); // Not recommended + * + * `.most` accepts an optional `msg` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to `expect`. + * + * expect(2).to.be.at.most(1, 'nooo why fail??'); + * expect(2, 'nooo why fail??').to.be.at.most(1); + * + * The aliases `.lte` and `.lessThanOrEqual` can be used interchangeably with + * `.most`. + * + * @name most + * @alias lte + * @alias lessThanOrEqual + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertMost (n, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , doLength = flag(this, 'doLength') + , flagMsg = flag(this, 'message') + , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '') + , ssfi = flag(this, 'ssfi') + , objType = _.type(obj).toLowerCase() + , nType = _.type(n).toLowerCase() + , errorMessage + , shouldThrow = true; + + if (doLength && objType !== 'map' && objType !== 'set') { + new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); + } + + if (!doLength && (objType === 'date' && nType !== 'date')) { + errorMessage = msgPrefix + 'the argument to most must be a date'; + } else if (nType !== 'number' && (doLength || objType === 'number')) { + errorMessage = msgPrefix + 'the argument to most must be a number'; + } else if (!doLength && (objType !== 'date' && objType !== 'number')) { + var printObj = (objType === 'string') ? "'" + obj + "'" : obj; + errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date'; + } else { + shouldThrow = false; + } + + if (shouldThrow) { + throw new AssertionError(errorMessage, undefined, ssfi); + } + + if (doLength) { + var descriptor = 'length' + , itemsCount; + if (objType === 'map' || objType === 'set') { + descriptor = 'size'; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount <= n + , 'expected #{this} to have a ' + descriptor + ' at most #{exp} but got #{act}' + , 'expected #{this} to have a ' + descriptor + ' above #{exp}' + , n + , itemsCount + ); + } else { + this.assert( + obj <= n + , 'expected #{this} to be at most #{exp}' + , 'expected #{this} to be above #{exp}' + , n + ); + } + } + + Assertion.addMethod('most', assertMost); + Assertion.addMethod('lte', assertMost); + Assertion.addMethod('lessThanOrEqual', assertMost); + + /** + * ### .within(start, finish[, msg]) + * + * Asserts that the target is a number or a date greater than or equal to the given + * number or date `start`, and less than or equal to the given number or date `finish` respectively. + * However, it's often best to assert that the target is equal to its expected + * value. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.be.within(1, 3); // Not recommended + * expect(2).to.be.within(2, 3); // Not recommended + * expect(2).to.be.within(1, 2); // Not recommended + * + * Add `.lengthOf` earlier in the chain to assert that the target's `length` + * or `size` is greater than or equal to the given number `start`, and less + * than or equal to the given number `finish`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.within(2, 4); // Not recommended + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.within(2, 4); // Not recommended + * + * Add `.not` earlier in the chain to negate `.within`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.within(2, 4); // Not recommended + * + * `.within` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. + * + * expect(4).to.be.within(1, 3, 'nooo why fail??'); + * expect(4, 'nooo why fail??').to.be.within(1, 3); + * + * @name within + * @param {Number} start lower bound inclusive + * @param {Number} finish upper bound inclusive + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + Assertion.addMethod('within', function (start, finish, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , doLength = flag(this, 'doLength') + , flagMsg = flag(this, 'message') + , msgPrefix = ((flagMsg) ? flagMsg + ': ' : '') + , ssfi = flag(this, 'ssfi') + , objType = _.type(obj).toLowerCase() + , startType = _.type(start).toLowerCase() + , finishType = _.type(finish).toLowerCase() + , errorMessage + , shouldThrow = true + , range = (startType === 'date' && finishType === 'date') + ? start.toISOString() + '..' + finish.toISOString() + : start + '..' + finish; + + if (doLength && objType !== 'map' && objType !== 'set') { + new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); + } + + if (!doLength && (objType === 'date' && (startType !== 'date' || finishType !== 'date'))) { + errorMessage = msgPrefix + 'the arguments to within must be dates'; + } else if ((startType !== 'number' || finishType !== 'number') && (doLength || objType === 'number')) { + errorMessage = msgPrefix + 'the arguments to within must be numbers'; + } else if (!doLength && (objType !== 'date' && objType !== 'number')) { + var printObj = (objType === 'string') ? "'" + obj + "'" : obj; + errorMessage = msgPrefix + 'expected ' + printObj + ' to be a number or a date'; + } else { + shouldThrow = false; + } + + if (shouldThrow) { + throw new AssertionError(errorMessage, undefined, ssfi); + } + + if (doLength) { + var descriptor = 'length' + , itemsCount; + if (objType === 'map' || objType === 'set') { + descriptor = 'size'; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount >= start && itemsCount <= finish + , 'expected #{this} to have a ' + descriptor + ' within ' + range + , 'expected #{this} to not have a ' + descriptor + ' within ' + range + ); + } else { + this.assert( + obj >= start && obj <= finish + , 'expected #{this} to be within ' + range + , 'expected #{this} to not be within ' + range + ); + } + }); + + /** + * ### .instanceof(constructor[, msg]) + * + * Asserts that the target is an instance of the given `constructor`. + * + * function Cat () { } + * + * expect(new Cat()).to.be.an.instanceof(Cat); + * expect([1, 2]).to.be.an.instanceof(Array); + * + * Add `.not` earlier in the chain to negate `.instanceof`. + * + * expect({a: 1}).to.not.be.an.instanceof(Array); + * + * `.instanceof` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. + * + * expect(1).to.be.an.instanceof(Array, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.an.instanceof(Array); + * + * Due to limitations in ES5, `.instanceof` may not always work as expected + * when using a transpiler such as Babel or TypeScript. In particular, it may + * produce unexpected results when subclassing built-in object such as + * `Array`, `Error`, and `Map`. See your transpiler's docs for details: + * + * - ([Babel](https://babeljs.io/docs/usage/caveats/#classes)) + * - ([TypeScript](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work)) + * + * The alias `.instanceOf` can be used interchangeably with `.instanceof`. + * + * @name instanceof + * @param {Constructor} constructor + * @param {String} msg _optional_ + * @alias instanceOf + * @namespace BDD + * @api public + */ + + function assertInstanceOf (constructor, msg) { + if (msg) flag(this, 'message', msg); + + var target = flag(this, 'object'); + var ssfi = flag(this, 'ssfi'); + var flagMsg = flag(this, 'message'); + + try { + var isInstanceOf = target instanceof constructor; + } catch (err) { + if (err instanceof TypeError) { + flagMsg = flagMsg ? flagMsg + ': ' : ''; + throw new AssertionError( + flagMsg + 'The instanceof assertion needs a constructor but ' + + _.type(constructor) + ' was given.', + undefined, + ssfi + ); + } + throw err; + } + + var name = _.getName(constructor); + if (name === null) { + name = 'an unnamed constructor'; + } + + this.assert( + isInstanceOf + , 'expected #{this} to be an instance of ' + name + , 'expected #{this} to not be an instance of ' + name + ); + } + Assertion.addMethod('instanceof', assertInstanceOf); + Assertion.addMethod('instanceOf', assertInstanceOf); + + /** + * ### .property(name[, val[, msg]]) + * + * Asserts that the target has a property with the given key `name`. + * + * expect({a: 1}).to.have.property('a'); + * + * When `val` is provided, `.property` also asserts that the property's value + * is equal to the given `val`. + * + * expect({a: 1}).to.have.property('a', 1); + * + * By default, strict (`===`) equality is used. Add `.deep` earlier in the + * chain to use deep equality instead. See the `deep-eql` project page for + * info on the deep equality algorithm: https://github.com/chaijs/deep-eql. + * + * // Target object deeply (but not strictly) has property `x: {a: 1}` + * expect({x: {a: 1}}).to.have.deep.property('x', {a: 1}); + * expect({x: {a: 1}}).to.not.have.property('x', {a: 1}); + * + * The target's enumerable and non-enumerable properties are always included + * in the search. By default, both own and inherited properties are included. + * Add `.own` earlier in the chain to exclude inherited properties from the + * search. + * + * Object.prototype.b = 2; + * + * expect({a: 1}).to.have.own.property('a'); + * expect({a: 1}).to.have.own.property('a', 1); + * expect({a: 1}).to.have.property('b'); + * expect({a: 1}).to.not.have.own.property('b'); + * + * `.deep` and `.own` can be combined. + * + * expect({x: {a: 1}}).to.have.deep.own.property('x', {a: 1}); + * + * Add `.nested` earlier in the chain to enable dot- and bracket-notation when + * referencing nested properties. + * + * expect({a: {b: ['x', 'y']}}).to.have.nested.property('a.b[1]'); + * expect({a: {b: ['x', 'y']}}).to.have.nested.property('a.b[1]', 'y'); + * + * If `.` or `[]` are part of an actual property name, they can be escaped by + * adding two backslashes before them. + * + * expect({'.a': {'[b]': 'x'}}).to.have.nested.property('\\.a.\\[b\\]'); + * + * `.deep` and `.nested` can be combined. + * + * expect({a: {b: [{c: 3}]}}) + * .to.have.deep.nested.property('a.b[0]', {c: 3}); + * + * `.own` and `.nested` cannot be combined. + * + * Add `.not` earlier in the chain to negate `.property`. + * + * expect({a: 1}).to.not.have.property('b'); + * + * However, it's dangerous to negate `.property` when providing `val`. The + * problem is that it creates uncertain expectations by asserting that the + * target either doesn't have a property with the given key `name`, or that it + * does have a property with the given key `name` but its value isn't equal to + * the given `val`. It's often best to identify the exact output that's + * expected, and then write an assertion that only accepts that exact output. + * + * When the target isn't expected to have a property with the given key + * `name`, it's often best to assert exactly that. + * + * expect({b: 2}).to.not.have.property('a'); // Recommended + * expect({b: 2}).to.not.have.property('a', 1); // Not recommended + * + * When the target is expected to have a property with the given key `name`, + * it's often best to assert that the property has its expected value, rather + * than asserting that it doesn't have one of many unexpected values. + * + * expect({a: 3}).to.have.property('a', 3); // Recommended + * expect({a: 3}).to.not.have.property('a', 1); // Not recommended + * + * `.property` changes the target of any assertions that follow in the chain + * to be the value of the property from the original target object. + * + * expect({a: 1}).to.have.property('a').that.is.a('number'); + * + * `.property` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. When not providing `val`, only use the + * second form. + * + * // Recommended + * expect({a: 1}).to.have.property('a', 2, 'nooo why fail??'); + * expect({a: 1}, 'nooo why fail??').to.have.property('a', 2); + * expect({a: 1}, 'nooo why fail??').to.have.property('b'); + * + * // Not recommended + * expect({a: 1}).to.have.property('b', undefined, 'nooo why fail??'); + * + * The above assertion isn't the same thing as not providing `val`. Instead, + * it's asserting that the target object has a `b` property that's equal to + * `undefined`. + * + * The assertions `.ownProperty` and `.haveOwnProperty` can be used + * interchangeably with `.own.property`. + * + * @name property + * @param {String} name + * @param {Mixed} val (optional) + * @param {String} msg _optional_ + * @returns value of property for chaining + * @namespace BDD + * @api public + */ + + function assertProperty (name, val, msg) { + if (msg) flag(this, 'message', msg); + + var isNested = flag(this, 'nested') + , isOwn = flag(this, 'own') + , flagMsg = flag(this, 'message') + , obj = flag(this, 'object') + , ssfi = flag(this, 'ssfi') + , nameType = typeof name; + + flagMsg = flagMsg ? flagMsg + ': ' : ''; + + if (isNested) { + if (nameType !== 'string') { + throw new AssertionError( + flagMsg + 'the argument to property must be a string when using nested syntax', + undefined, + ssfi + ); + } + } else { + if (nameType !== 'string' && nameType !== 'number' && nameType !== 'symbol') { + throw new AssertionError( + flagMsg + 'the argument to property must be a string, number, or symbol', + undefined, + ssfi + ); + } + } + + if (isNested && isOwn) { + throw new AssertionError( + flagMsg + 'The "nested" and "own" flags cannot be combined.', + undefined, + ssfi + ); + } + + if (obj === null || obj === undefined) { + throw new AssertionError( + flagMsg + 'Target cannot be null or undefined.', + undefined, + ssfi + ); + } + + var isDeep = flag(this, 'deep') + , negate = flag(this, 'negate') + , pathInfo = isNested ? _.getPathInfo(obj, name) : null + , value = isNested ? pathInfo.value : obj[name]; + + var descriptor = ''; + if (isDeep) descriptor += 'deep '; + if (isOwn) descriptor += 'own '; + if (isNested) descriptor += 'nested '; + descriptor += 'property '; + + var hasProperty; + if (isOwn) hasProperty = Object.prototype.hasOwnProperty.call(obj, name); + else if (isNested) hasProperty = pathInfo.exists; + else hasProperty = _.hasProperty(obj, name); + + // When performing a negated assertion for both name and val, merely having + // a property with the given name isn't enough to cause the assertion to + // fail. It must both have a property with the given name, and the value of + // that property must equal the given val. Therefore, skip this assertion in + // favor of the next. + if (!negate || arguments.length === 1) { + this.assert( + hasProperty + , 'expected #{this} to have ' + descriptor + _.inspect(name) + , 'expected #{this} to not have ' + descriptor + _.inspect(name)); + } + + if (arguments.length > 1) { + this.assert( + hasProperty && (isDeep ? _.eql(val, value) : val === value) + , 'expected #{this} to have ' + descriptor + _.inspect(name) + ' of #{exp}, but got #{act}' + , 'expected #{this} to not have ' + descriptor + _.inspect(name) + ' of #{act}' + , val + , value + ); + } + + flag(this, 'object', value); + } + + Assertion.addMethod('property', assertProperty); + + function assertOwnProperty (name, value, msg) { + flag(this, 'own', true); + assertProperty.apply(this, arguments); + } + + Assertion.addMethod('ownProperty', assertOwnProperty); + Assertion.addMethod('haveOwnProperty', assertOwnProperty); + + /** + * ### .ownPropertyDescriptor(name[, descriptor[, msg]]) + * + * Asserts that the target has its own property descriptor with the given key + * `name`. Enumerable and non-enumerable properties are included in the + * search. + * + * expect({a: 1}).to.have.ownPropertyDescriptor('a'); + * + * When `descriptor` is provided, `.ownPropertyDescriptor` also asserts that + * the property's descriptor is deeply equal to the given `descriptor`. See + * the `deep-eql` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * expect({a: 1}).to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 1, + * }); + * + * Add `.not` earlier in the chain to negate `.ownPropertyDescriptor`. + * + * expect({a: 1}).to.not.have.ownPropertyDescriptor('b'); + * + * However, it's dangerous to negate `.ownPropertyDescriptor` when providing + * a `descriptor`. The problem is that it creates uncertain expectations by + * asserting that the target either doesn't have a property descriptor with + * the given key `name`, or that it does have a property descriptor with the + * given key `name` but it’s not deeply equal to the given `descriptor`. It's + * often best to identify the exact output that's expected, and then write an + * assertion that only accepts that exact output. + * + * When the target isn't expected to have a property descriptor with the given + * key `name`, it's often best to assert exactly that. + * + * // Recommended + * expect({b: 2}).to.not.have.ownPropertyDescriptor('a'); + * + * // Not recommended + * expect({b: 2}).to.not.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 1, + * }); + * + * When the target is expected to have a property descriptor with the given + * key `name`, it's often best to assert that the property has its expected + * descriptor, rather than asserting that it doesn't have one of many + * unexpected descriptors. + * + * // Recommended + * expect({a: 3}).to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 3, + * }); + * + * // Not recommended + * expect({a: 3}).to.not.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 1, + * }); + * + * `.ownPropertyDescriptor` changes the target of any assertions that follow + * in the chain to be the value of the property descriptor from the original + * target object. + * + * expect({a: 1}).to.have.ownPropertyDescriptor('a') + * .that.has.property('enumerable', true); + * + * `.ownPropertyDescriptor` accepts an optional `msg` argument which is a + * custom error message to show when the assertion fails. The message can also + * be given as the second argument to `expect`. When not providing + * `descriptor`, only use the second form. + * + * // Recommended + * expect({a: 1}).to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 2, + * }, 'nooo why fail??'); + * + * // Recommended + * expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 2, + * }); + * + * // Recommended + * expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('b'); + * + * // Not recommended + * expect({a: 1}) + * .to.have.ownPropertyDescriptor('b', undefined, 'nooo why fail??'); + * + * The above assertion isn't the same thing as not providing `descriptor`. + * Instead, it's asserting that the target object has a `b` property + * descriptor that's deeply equal to `undefined`. + * + * The alias `.haveOwnPropertyDescriptor` can be used interchangeably with + * `.ownPropertyDescriptor`. + * + * @name ownPropertyDescriptor + * @alias haveOwnPropertyDescriptor + * @param {String} name + * @param {Object} descriptor _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertOwnPropertyDescriptor (name, descriptor, msg) { + if (typeof descriptor === 'string') { + msg = descriptor; + descriptor = null; + } + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object'); + var actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name); + if (actualDescriptor && descriptor) { + this.assert( + _.eql(descriptor, actualDescriptor) + , 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to match ' + _.inspect(descriptor) + ', got ' + _.inspect(actualDescriptor) + , 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to not match ' + _.inspect(descriptor) + , descriptor + , actualDescriptor + , true + ); + } else { + this.assert( + actualDescriptor + , 'expected #{this} to have an own property descriptor for ' + _.inspect(name) + , 'expected #{this} to not have an own property descriptor for ' + _.inspect(name) + ); + } + flag(this, 'object', actualDescriptor); + } + + Assertion.addMethod('ownPropertyDescriptor', assertOwnPropertyDescriptor); + Assertion.addMethod('haveOwnPropertyDescriptor', assertOwnPropertyDescriptor); + + /** + * ### .lengthOf(n[, msg]) + * + * Asserts that the target's `length` or `size` is equal to the given number + * `n`. + * + * expect([1, 2, 3]).to.have.lengthOf(3); + * expect('foo').to.have.lengthOf(3); + * expect(new Set([1, 2, 3])).to.have.lengthOf(3); + * expect(new Map([['a', 1], ['b', 2], ['c', 3]])).to.have.lengthOf(3); + * + * Add `.not` earlier in the chain to negate `.lengthOf`. However, it's often + * best to assert that the target's `length` property is equal to its expected + * value, rather than not equal to one of many unexpected values. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.not.have.lengthOf(4); // Not recommended + * + * `.lengthOf` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. + * + * expect([1, 2, 3]).to.have.lengthOf(2, 'nooo why fail??'); + * expect([1, 2, 3], 'nooo why fail??').to.have.lengthOf(2); + * + * `.lengthOf` can also be used as a language chain, causing all `.above`, + * `.below`, `.least`, `.most`, and `.within` assertions that follow in the + * chain to use the target's `length` property as the target. However, it's + * often best to assert that the target's `length` property is equal to its + * expected length, rather than asserting that its `length` property falls + * within some range of values. + * + * // Recommended + * expect([1, 2, 3]).to.have.lengthOf(3); + * + * // Not recommended + * expect([1, 2, 3]).to.have.lengthOf.above(2); + * expect([1, 2, 3]).to.have.lengthOf.below(4); + * expect([1, 2, 3]).to.have.lengthOf.at.least(3); + * expect([1, 2, 3]).to.have.lengthOf.at.most(3); + * expect([1, 2, 3]).to.have.lengthOf.within(2,4); + * + * Due to a compatibility issue, the alias `.length` can't be chained directly + * off of an uninvoked method such as `.a`. Therefore, `.length` can't be used + * interchangeably with `.lengthOf` in every situation. It's recommended to + * always use `.lengthOf` instead of `.length`. + * + * expect([1, 2, 3]).to.have.a.length(3); // incompatible; throws error + * expect([1, 2, 3]).to.have.a.lengthOf(3); // passes as expected + * + * @name lengthOf + * @alias length + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertLengthChain () { + flag(this, 'doLength', true); + } + + function assertLength (n, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , objType = _.type(obj).toLowerCase() + , flagMsg = flag(this, 'message') + , ssfi = flag(this, 'ssfi') + , descriptor = 'length' + , itemsCount; + + switch (objType) { + case 'map': + case 'set': + descriptor = 'size'; + itemsCount = obj.size; + break; + default: + new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); + itemsCount = obj.length; + } + + this.assert( + itemsCount == n + , 'expected #{this} to have a ' + descriptor + ' of #{exp} but got #{act}' + , 'expected #{this} to not have a ' + descriptor + ' of #{act}' + , n + , itemsCount + ); + } + + Assertion.addChainableMethod('length', assertLength, assertLengthChain); + Assertion.addChainableMethod('lengthOf', assertLength, assertLengthChain); + + /** + * ### .match(re[, msg]) + * + * Asserts that the target matches the given regular expression `re`. + * + * expect('foobar').to.match(/^foo/); + * + * Add `.not` earlier in the chain to negate `.match`. + * + * expect('foobar').to.not.match(/taco/); + * + * `.match` accepts an optional `msg` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to `expect`. + * + * expect('foobar').to.match(/taco/, 'nooo why fail??'); + * expect('foobar', 'nooo why fail??').to.match(/taco/); + * + * The alias `.matches` can be used interchangeably with `.match`. + * + * @name match + * @alias matches + * @param {RegExp} re + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + function assertMatch(re, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object'); + this.assert( + re.exec(obj) + , 'expected #{this} to match ' + re + , 'expected #{this} not to match ' + re + ); + } + + Assertion.addMethod('match', assertMatch); + Assertion.addMethod('matches', assertMatch); + + /** + * ### .string(str[, msg]) + * + * Asserts that the target string contains the given substring `str`. + * + * expect('foobar').to.have.string('bar'); + * + * Add `.not` earlier in the chain to negate `.string`. + * + * expect('foobar').to.not.have.string('taco'); + * + * `.string` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. + * + * expect('foobar').to.have.string('taco', 'nooo why fail??'); + * expect('foobar', 'nooo why fail??').to.have.string('taco'); + * + * @name string + * @param {String} str + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + Assertion.addMethod('string', function (str, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , flagMsg = flag(this, 'message') + , ssfi = flag(this, 'ssfi'); + new Assertion(obj, flagMsg, ssfi, true).is.a('string'); + + this.assert( + ~obj.indexOf(str) + , 'expected #{this} to contain ' + _.inspect(str) + , 'expected #{this} to not contain ' + _.inspect(str) + ); + }); + + /** + * ### .keys(key1[, key2[, ...]]) + * + * Asserts that the target object, array, map, or set has the given keys. Only + * the target's own inherited properties are included in the search. + * + * When the target is an object or array, keys can be provided as one or more + * string arguments, a single array argument, or a single object argument. In + * the latter case, only the keys in the given object matter; the values are + * ignored. + * + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); + * expect(['x', 'y']).to.have.all.keys(0, 1); + * + * expect({a: 1, b: 2}).to.have.all.keys(['a', 'b']); + * expect(['x', 'y']).to.have.all.keys([0, 1]); + * + * expect({a: 1, b: 2}).to.have.all.keys({a: 4, b: 5}); // ignore 4 and 5 + * expect(['x', 'y']).to.have.all.keys({0: 4, 1: 5}); // ignore 4 and 5 + * + * When the target is a map or set, each key must be provided as a separate + * argument. + * + * expect(new Map([['a', 1], ['b', 2]])).to.have.all.keys('a', 'b'); + * expect(new Set(['a', 'b'])).to.have.all.keys('a', 'b'); + * + * Because `.keys` does different things based on the target's type, it's + * important to check the target's type before using `.keys`. See the `.a` doc + * for info on testing a target's type. + * + * expect({a: 1, b: 2}).to.be.an('object').that.has.all.keys('a', 'b'); + * + * By default, strict (`===`) equality is used to compare keys of maps and + * sets. Add `.deep` earlier in the chain to use deep equality instead. See + * the `deep-eql` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target set deeply (but not strictly) has key `{a: 1}` + * expect(new Set([{a: 1}])).to.have.all.deep.keys([{a: 1}]); + * expect(new Set([{a: 1}])).to.not.have.all.keys([{a: 1}]); + * + * By default, the target must have all of the given keys and no more. Add + * `.any` earlier in the chain to only require that the target have at least + * one of the given keys. Also, add `.not` earlier in the chain to negate + * `.keys`. It's often best to add `.any` when negating `.keys`, and to use + * `.all` when asserting `.keys` without negation. + * + * When negating `.keys`, `.any` is preferred because `.not.any.keys` asserts + * exactly what's expected of the output, whereas `.not.all.keys` creates + * uncertain expectations. + * + * // Recommended; asserts that target doesn't have any of the given keys + * expect({a: 1, b: 2}).to.not.have.any.keys('c', 'd'); + * + * // Not recommended; asserts that target doesn't have all of the given + * // keys but may or may not have some of them + * expect({a: 1, b: 2}).to.not.have.all.keys('c', 'd'); + * + * When asserting `.keys` without negation, `.all` is preferred because + * `.all.keys` asserts exactly what's expected of the output, whereas + * `.any.keys` creates uncertain expectations. + * + * // Recommended; asserts that target has all the given keys + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); + * + * // Not recommended; asserts that target has at least one of the given + * // keys but may or may not have more of them + * expect({a: 1, b: 2}).to.have.any.keys('a', 'b'); + * + * Note that `.all` is used by default when neither `.all` nor `.any` appear + * earlier in the chain. However, it's often best to add `.all` anyway because + * it improves readability. + * + * // Both assertions are identical + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); // Recommended + * expect({a: 1, b: 2}).to.have.keys('a', 'b'); // Not recommended + * + * Add `.include` earlier in the chain to require that the target's keys be a + * superset of the expected keys, rather than identical sets. + * + * // Target object's keys are a superset of ['a', 'b'] but not identical + * expect({a: 1, b: 2, c: 3}).to.include.all.keys('a', 'b'); + * expect({a: 1, b: 2, c: 3}).to.not.have.all.keys('a', 'b'); + * + * However, if `.any` and `.include` are combined, only the `.any` takes + * effect. The `.include` is ignored in this case. + * + * // Both assertions are identical + * expect({a: 1}).to.have.any.keys('a', 'b'); + * expect({a: 1}).to.include.any.keys('a', 'b'); + * + * A custom error message can be given as the second argument to `expect`. + * + * expect({a: 1}, 'nooo why fail??').to.have.key('b'); + * + * The alias `.key` can be used interchangeably with `.keys`. + * + * @name keys + * @alias key + * @param {...String|Array|Object} keys + * @namespace BDD + * @api public + */ + + function assertKeys (keys) { + var obj = flag(this, 'object') + , objType = _.type(obj) + , keysType = _.type(keys) + , ssfi = flag(this, 'ssfi') + , isDeep = flag(this, 'deep') + , str + , deepStr = '' + , actual + , ok = true + , flagMsg = flag(this, 'message'); + + flagMsg = flagMsg ? flagMsg + ': ' : ''; + var mixedArgsMsg = flagMsg + 'when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments'; + + if (objType === 'Map' || objType === 'Set') { + deepStr = isDeep ? 'deeply ' : ''; + actual = []; + + // Map and Set '.keys' aren't supported in IE 11. Therefore, use .forEach. + obj.forEach(function (val, key) { actual.push(key); }); + + if (keysType !== 'Array') { + keys = Array.prototype.slice.call(arguments); + } + } else { + actual = _.getOwnEnumerableProperties(obj); + + switch (keysType) { + case 'Array': + if (arguments.length > 1) { + throw new AssertionError(mixedArgsMsg, undefined, ssfi); + } + break; + case 'Object': + if (arguments.length > 1) { + throw new AssertionError(mixedArgsMsg, undefined, ssfi); + } + keys = Object.keys(keys); + break; + default: + keys = Array.prototype.slice.call(arguments); + } + + // Only stringify non-Symbols because Symbols would become "Symbol()" + keys = keys.map(function (val) { + return typeof val === 'symbol' ? val : String(val); + }); + } + + if (!keys.length) { + throw new AssertionError(flagMsg + 'keys required', undefined, ssfi); + } + + var len = keys.length + , any = flag(this, 'any') + , all = flag(this, 'all') + , expected = keys; + + if (!any && !all) { + all = true; + } + + // Has any + if (any) { + ok = expected.some(function(expectedKey) { + return actual.some(function(actualKey) { + if (isDeep) { + return _.eql(expectedKey, actualKey); + } else { + return expectedKey === actualKey; + } + }); + }); + } + + // Has all + if (all) { + ok = expected.every(function(expectedKey) { + return actual.some(function(actualKey) { + if (isDeep) { + return _.eql(expectedKey, actualKey); + } else { + return expectedKey === actualKey; + } + }); + }); + + if (!flag(this, 'contains')) { + ok = ok && keys.length == actual.length; + } + } + + // Key string + if (len > 1) { + keys = keys.map(function(key) { + return _.inspect(key); + }); + var last = keys.pop(); + if (all) { + str = keys.join(', ') + ', and ' + last; + } + if (any) { + str = keys.join(', ') + ', or ' + last; + } + } else { + str = _.inspect(keys[0]); + } + + // Form + str = (len > 1 ? 'keys ' : 'key ') + str; + + // Have / include + str = (flag(this, 'contains') ? 'contain ' : 'have ') + str; + + // Assertion + this.assert( + ok + , 'expected #{this} to ' + deepStr + str + , 'expected #{this} to not ' + deepStr + str + , expected.slice(0).sort(_.compareByInspect) + , actual.sort(_.compareByInspect) + , true + ); + } + + Assertion.addMethod('keys', assertKeys); + Assertion.addMethod('key', assertKeys); + + /** + * ### .throw([errorLike], [errMsgMatcher], [msg]) + * + * When no arguments are provided, `.throw` invokes the target function and + * asserts that an error is thrown. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(); + * + * When one argument is provided, and it's an error constructor, `.throw` + * invokes the target function and asserts that an error is thrown that's an + * instance of that error constructor. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(TypeError); + * + * When one argument is provided, and it's an error instance, `.throw` invokes + * the target function and asserts that an error is thrown that's strictly + * (`===`) equal to that error instance. + * + * var err = new TypeError('Illegal salmon!'); + * var badFn = function () { throw err; }; + * + * expect(badFn).to.throw(err); + * + * When one argument is provided, and it's a string, `.throw` invokes the + * target function and asserts that an error is thrown with a message that + * contains that string. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw('salmon'); + * + * When one argument is provided, and it's a regular expression, `.throw` + * invokes the target function and asserts that an error is thrown with a + * message that matches that regular expression. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(/salmon/); + * + * When two arguments are provided, and the first is an error instance or + * constructor, and the second is a string or regular expression, `.throw` + * invokes the function and asserts that an error is thrown that fulfills both + * conditions as described above. + * + * var err = new TypeError('Illegal salmon!'); + * var badFn = function () { throw err; }; + * + * expect(badFn).to.throw(TypeError, 'salmon'); + * expect(badFn).to.throw(TypeError, /salmon/); + * expect(badFn).to.throw(err, 'salmon'); + * expect(badFn).to.throw(err, /salmon/); + * + * Add `.not` earlier in the chain to negate `.throw`. + * + * var goodFn = function () {}; + * + * expect(goodFn).to.not.throw(); + * + * However, it's dangerous to negate `.throw` when providing any arguments. + * The problem is that it creates uncertain expectations by asserting that the + * target either doesn't throw an error, or that it throws an error but of a + * different type than the given type, or that it throws an error of the given + * type but with a message that doesn't include the given string. It's often + * best to identify the exact output that's expected, and then write an + * assertion that only accepts that exact output. + * + * When the target isn't expected to throw an error, it's often best to assert + * exactly that. + * + * var goodFn = function () {}; + * + * expect(goodFn).to.not.throw(); // Recommended + * expect(goodFn).to.not.throw(ReferenceError, 'x'); // Not recommended + * + * When the target is expected to throw an error, it's often best to assert + * that the error is of its expected type, and has a message that includes an + * expected string, rather than asserting that it doesn't have one of many + * unexpected types, and doesn't have a message that includes some string. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(TypeError, 'salmon'); // Recommended + * expect(badFn).to.not.throw(ReferenceError, 'x'); // Not recommended + * + * `.throw` changes the target of any assertions that follow in the chain to + * be the error object that's thrown. + * + * var err = new TypeError('Illegal salmon!'); + * err.code = 42; + * var badFn = function () { throw err; }; + * + * expect(badFn).to.throw(TypeError).with.property('code', 42); + * + * `.throw` accepts an optional `msg` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to `expect`. When not providing two arguments, always use + * the second form. + * + * var goodFn = function () {}; + * + * expect(goodFn).to.throw(TypeError, 'x', 'nooo why fail??'); + * expect(goodFn, 'nooo why fail??').to.throw(); + * + * Due to limitations in ES5, `.throw` may not always work as expected when + * using a transpiler such as Babel or TypeScript. In particular, it may + * produce unexpected results when subclassing the built-in `Error` object and + * then passing the subclassed constructor to `.throw`. See your transpiler's + * docs for details: + * + * - ([Babel](https://babeljs.io/docs/usage/caveats/#classes)) + * - ([TypeScript](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work)) + * + * Beware of some common mistakes when using the `throw` assertion. One common + * mistake is to accidentally invoke the function yourself instead of letting + * the `throw` assertion invoke the function for you. For example, when + * testing if a function named `fn` throws, provide `fn` instead of `fn()` as + * the target for the assertion. + * + * expect(fn).to.throw(); // Good! Tests `fn` as desired + * expect(fn()).to.throw(); // Bad! Tests result of `fn()`, not `fn` + * + * If you need to assert that your function `fn` throws when passed certain + * arguments, then wrap a call to `fn` inside of another function. + * + * expect(function () { fn(42); }).to.throw(); // Function expression + * expect(() => fn(42)).to.throw(); // ES6 arrow function + * + * Another common mistake is to provide an object method (or any stand-alone + * function that relies on `this`) as the target of the assertion. Doing so is + * problematic because the `this` context will be lost when the function is + * invoked by `.throw`; there's no way for it to know what `this` is supposed + * to be. There are two ways around this problem. One solution is to wrap the + * method or function call inside of another function. Another solution is to + * use `bind`. + * + * expect(function () { cat.meow(); }).to.throw(); // Function expression + * expect(() => cat.meow()).to.throw(); // ES6 arrow function + * expect(cat.meow.bind(cat)).to.throw(); // Bind + * + * Finally, it's worth mentioning that it's a best practice in JavaScript to + * only throw `Error` and derivatives of `Error` such as `ReferenceError`, + * `TypeError`, and user-defined objects that extend `Error`. No other type of + * value will generate a stack trace when initialized. With that said, the + * `throw` assertion does technically support any type of value being thrown, + * not just `Error` and its derivatives. + * + * The aliases `.throws` and `.Throw` can be used interchangeably with + * `.throw`. + * + * @name throw + * @alias throws + * @alias Throw + * @param {Error|ErrorConstructor} errorLike + * @param {String|RegExp} errMsgMatcher error message + * @param {String} msg _optional_ + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @returns error for chaining (null if no error) + * @namespace BDD + * @api public + */ + + function assertThrows (errorLike, errMsgMatcher, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , ssfi = flag(this, 'ssfi') + , flagMsg = flag(this, 'message') + , negate = flag(this, 'negate') || false; + new Assertion(obj, flagMsg, ssfi, true).is.a('function'); + + if (errorLike instanceof RegExp || typeof errorLike === 'string') { + errMsgMatcher = errorLike; + errorLike = null; + } + + var caughtErr; + try { + obj(); + } catch (err) { + caughtErr = err; + } + + // If we have the negate flag enabled and at least one valid argument it means we do expect an error + // but we want it to match a given set of criteria + var everyArgIsUndefined = errorLike === undefined && errMsgMatcher === undefined; + + // If we've got the negate flag enabled and both args, we should only fail if both aren't compatible + // See Issue #551 and PR #683@GitHub + var everyArgIsDefined = Boolean(errorLike && errMsgMatcher); + var errorLikeFail = false; + var errMsgMatcherFail = false; + + // Checking if error was thrown + if (everyArgIsUndefined || !everyArgIsUndefined && !negate) { + // We need this to display results correctly according to their types + var errorLikeString = 'an error'; + if (errorLike instanceof Error) { + errorLikeString = '#{exp}'; + } else if (errorLike) { + errorLikeString = _.checkError.getConstructorName(errorLike); + } + + this.assert( + caughtErr + , 'expected #{this} to throw ' + errorLikeString + , 'expected #{this} to not throw an error but #{act} was thrown' + , errorLike && errorLike.toString() + , (caughtErr instanceof Error ? + caughtErr.toString() : (typeof caughtErr === 'string' ? caughtErr : caughtErr && + _.checkError.getConstructorName(caughtErr))) + ); + } + + if (errorLike && caughtErr) { + // We should compare instances only if `errorLike` is an instance of `Error` + if (errorLike instanceof Error) { + var isCompatibleInstance = _.checkError.compatibleInstance(caughtErr, errorLike); + + if (isCompatibleInstance === negate) { + // These checks were created to ensure we won't fail too soon when we've got both args and a negate + // See Issue #551 and PR #683@GitHub + if (everyArgIsDefined && negate) { + errorLikeFail = true; + } else { + this.assert( + negate + , 'expected #{this} to throw #{exp} but #{act} was thrown' + , 'expected #{this} to not throw #{exp}' + (caughtErr && !negate ? ' but #{act} was thrown' : '') + , errorLike.toString() + , caughtErr.toString() + ); + } + } + } + + var isCompatibleConstructor = _.checkError.compatibleConstructor(caughtErr, errorLike); + if (isCompatibleConstructor === negate) { + if (everyArgIsDefined && negate) { + errorLikeFail = true; + } else { + this.assert( + negate + , 'expected #{this} to throw #{exp} but #{act} was thrown' + , 'expected #{this} to not throw #{exp}' + (caughtErr ? ' but #{act} was thrown' : '') + , (errorLike instanceof Error ? errorLike.toString() : errorLike && _.checkError.getConstructorName(errorLike)) + , (caughtErr instanceof Error ? caughtErr.toString() : caughtErr && _.checkError.getConstructorName(caughtErr)) + ); + } + } + } + + if (caughtErr && errMsgMatcher !== undefined && errMsgMatcher !== null) { + // Here we check compatible messages + var placeholder = 'including'; + if (errMsgMatcher instanceof RegExp) { + placeholder = 'matching'; + } + + var isCompatibleMessage = _.checkError.compatibleMessage(caughtErr, errMsgMatcher); + if (isCompatibleMessage === negate) { + if (everyArgIsDefined && negate) { + errMsgMatcherFail = true; + } else { + this.assert( + negate + , 'expected #{this} to throw error ' + placeholder + ' #{exp} but got #{act}' + , 'expected #{this} to throw error not ' + placeholder + ' #{exp}' + , errMsgMatcher + , _.checkError.getMessage(caughtErr) + ); + } + } + } + + // If both assertions failed and both should've matched we throw an error + if (errorLikeFail && errMsgMatcherFail) { + this.assert( + negate + , 'expected #{this} to throw #{exp} but #{act} was thrown' + , 'expected #{this} to not throw #{exp}' + (caughtErr ? ' but #{act} was thrown' : '') + , (errorLike instanceof Error ? errorLike.toString() : errorLike && _.checkError.getConstructorName(errorLike)) + , (caughtErr instanceof Error ? caughtErr.toString() : caughtErr && _.checkError.getConstructorName(caughtErr)) + ); + } + + flag(this, 'object', caughtErr); + } + Assertion.addMethod('throw', assertThrows); + Assertion.addMethod('throws', assertThrows); + Assertion.addMethod('Throw', assertThrows); + + /** + * ### .respondTo(method[, msg]) + * + * When the target is a non-function object, `.respondTo` asserts that the + * target has a method with the given name `method`. The method can be own or + * inherited, and it can be enumerable or non-enumerable. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * + * expect(new Cat()).to.respondTo('meow'); + * + * When the target is a function, `.respondTo` asserts that the target's + * `prototype` property has a method with the given name `method`. Again, the + * method can be own or inherited, and it can be enumerable or non-enumerable. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * + * expect(Cat).to.respondTo('meow'); + * + * Add `.itself` earlier in the chain to force `.respondTo` to treat the + * target as a non-function object, even if it's a function. Thus, it asserts + * that the target has a method with the given name `method`, rather than + * asserting that the target's `prototype` property has a method with the + * given name `method`. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * Cat.hiss = function () {}; + * + * expect(Cat).itself.to.respondTo('hiss').but.not.respondTo('meow'); + * + * When not adding `.itself`, it's important to check the target's type before + * using `.respondTo`. See the `.a` doc for info on checking a target's type. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * + * expect(new Cat()).to.be.an('object').that.respondsTo('meow'); + * + * Add `.not` earlier in the chain to negate `.respondTo`. + * + * function Dog () {} + * Dog.prototype.bark = function () {}; + * + * expect(new Dog()).to.not.respondTo('meow'); + * + * `.respondTo` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. + * + * expect({}).to.respondTo('meow', 'nooo why fail??'); + * expect({}, 'nooo why fail??').to.respondTo('meow'); + * + * The alias `.respondsTo` can be used interchangeably with `.respondTo`. + * + * @name respondTo + * @alias respondsTo + * @param {String} method + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function respondTo (method, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , itself = flag(this, 'itself') + , context = ('function' === typeof obj && !itself) + ? obj.prototype[method] + : obj[method]; + + this.assert( + 'function' === typeof context + , 'expected #{this} to respond to ' + _.inspect(method) + , 'expected #{this} to not respond to ' + _.inspect(method) + ); + } + + Assertion.addMethod('respondTo', respondTo); + Assertion.addMethod('respondsTo', respondTo); + + /** + * ### .itself + * + * Forces all `.respondTo` assertions that follow in the chain to behave as if + * the target is a non-function object, even if it's a function. Thus, it + * causes `.respondTo` to assert that the target has a method with the given + * name, rather than asserting that the target's `prototype` property has a + * method with the given name. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * Cat.hiss = function () {}; + * + * expect(Cat).itself.to.respondTo('hiss').but.not.respondTo('meow'); + * + * @name itself + * @namespace BDD + * @api public + */ + + Assertion.addProperty('itself', function () { + flag(this, 'itself', true); + }); + + /** + * ### .satisfy(matcher[, msg]) + * + * Invokes the given `matcher` function with the target being passed as the + * first argument, and asserts that the value returned is truthy. + * + * expect(1).to.satisfy(function(num) { + * return num > 0; + * }); + * + * Add `.not` earlier in the chain to negate `.satisfy`. + * + * expect(1).to.not.satisfy(function(num) { + * return num > 2; + * }); + * + * `.satisfy` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. + * + * expect(1).to.satisfy(function(num) { + * return num > 2; + * }, 'nooo why fail??'); + * + * expect(1, 'nooo why fail??').to.satisfy(function(num) { + * return num > 2; + * }); + * + * The alias `.satisfies` can be used interchangeably with `.satisfy`. + * + * @name satisfy + * @alias satisfies + * @param {Function} matcher + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function satisfy (matcher, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object'); + var result = matcher(obj); + this.assert( + result + , 'expected #{this} to satisfy ' + _.objDisplay(matcher) + , 'expected #{this} to not satisfy' + _.objDisplay(matcher) + , flag(this, 'negate') ? false : true + , result + ); + } + + Assertion.addMethod('satisfy', satisfy); + Assertion.addMethod('satisfies', satisfy); + + /** + * ### .closeTo(expected, delta[, msg]) + * + * Asserts that the target is a number that's within a given +/- `delta` range + * of the given number `expected`. However, it's often best to assert that the + * target is equal to its expected value. + * + * // Recommended + * expect(1.5).to.equal(1.5); + * + * // Not recommended + * expect(1.5).to.be.closeTo(1, 0.5); + * expect(1.5).to.be.closeTo(2, 0.5); + * expect(1.5).to.be.closeTo(1, 1); + * + * Add `.not` earlier in the chain to negate `.closeTo`. + * + * expect(1.5).to.equal(1.5); // Recommended + * expect(1.5).to.not.be.closeTo(3, 1); // Not recommended + * + * `.closeTo` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. + * + * expect(1.5).to.be.closeTo(3, 1, 'nooo why fail??'); + * expect(1.5, 'nooo why fail??').to.be.closeTo(3, 1); + * + * The alias `.approximately` can be used interchangeably with `.closeTo`. + * + * @name closeTo + * @alias approximately + * @param {Number} expected + * @param {Number} delta + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function closeTo(expected, delta, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , flagMsg = flag(this, 'message') + , ssfi = flag(this, 'ssfi'); + + new Assertion(obj, flagMsg, ssfi, true).is.a('number'); + if (typeof expected !== 'number' || typeof delta !== 'number') { + flagMsg = flagMsg ? flagMsg + ': ' : ''; + var deltaMessage = delta === undefined ? ", and a delta is required" : ""; + throw new AssertionError( + flagMsg + 'the arguments to closeTo or approximately must be numbers' + deltaMessage, + undefined, + ssfi + ); + } + + this.assert( + Math.abs(obj - expected) <= delta + , 'expected #{this} to be close to ' + expected + ' +/- ' + delta + , 'expected #{this} not to be close to ' + expected + ' +/- ' + delta + ); + } + + Assertion.addMethod('closeTo', closeTo); + Assertion.addMethod('approximately', closeTo); + + // Note: Duplicates are ignored if testing for inclusion instead of sameness. + function isSubsetOf(subset, superset, cmp, contains, ordered) { + if (!contains) { + if (subset.length !== superset.length) return false; + superset = superset.slice(); + } + + return subset.every(function(elem, idx) { + if (ordered) return cmp ? cmp(elem, superset[idx]) : elem === superset[idx]; + + if (!cmp) { + var matchIdx = superset.indexOf(elem); + if (matchIdx === -1) return false; + + // Remove match from superset so not counted twice if duplicate in subset. + if (!contains) superset.splice(matchIdx, 1); + return true; + } + + return superset.some(function(elem2, matchIdx) { + if (!cmp(elem, elem2)) return false; + + // Remove match from superset so not counted twice if duplicate in subset. + if (!contains) superset.splice(matchIdx, 1); + return true; + }); + }); + } + + /** + * ### .members(set[, msg]) + * + * Asserts that the target array has the same members as the given array + * `set`. + * + * expect([1, 2, 3]).to.have.members([2, 1, 3]); + * expect([1, 2, 2]).to.have.members([2, 1, 2]); + * + * By default, members are compared using strict (`===`) equality. Add `.deep` + * earlier in the chain to use deep equality instead. See the `deep-eql` + * project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target array deeply (but not strictly) has member `{a: 1}` + * expect([{a: 1}]).to.have.deep.members([{a: 1}]); + * expect([{a: 1}]).to.not.have.members([{a: 1}]); + * + * By default, order doesn't matter. Add `.ordered` earlier in the chain to + * require that members appear in the same order. + * + * expect([1, 2, 3]).to.have.ordered.members([1, 2, 3]); + * expect([1, 2, 3]).to.have.members([2, 1, 3]) + * .but.not.ordered.members([2, 1, 3]); + * + * By default, both arrays must be the same size. Add `.include` earlier in + * the chain to require that the target's members be a superset of the + * expected members. Note that duplicates are ignored in the subset when + * `.include` is added. + * + * // Target array is a superset of [1, 2] but not identical + * expect([1, 2, 3]).to.include.members([1, 2]); + * expect([1, 2, 3]).to.not.have.members([1, 2]); + * + * // Duplicates in the subset are ignored + * expect([1, 2, 3]).to.include.members([1, 2, 2, 2]); + * + * `.deep`, `.ordered`, and `.include` can all be combined. However, if + * `.include` and `.ordered` are combined, the ordering begins at the start of + * both arrays. + * + * expect([{a: 1}, {b: 2}, {c: 3}]) + * .to.include.deep.ordered.members([{a: 1}, {b: 2}]) + * .but.not.include.deep.ordered.members([{b: 2}, {c: 3}]); + * + * Add `.not` earlier in the chain to negate `.members`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the target array doesn't have all of the same members as + * the given array `set` but may or may not have some of them. It's often best + * to identify the exact output that's expected, and then write an assertion + * that only accepts that exact output. + * + * expect([1, 2]).to.not.include(3).and.not.include(4); // Recommended + * expect([1, 2]).to.not.have.members([3, 4]); // Not recommended + * + * `.members` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. + * + * expect([1, 2]).to.have.members([1, 2, 3], 'nooo why fail??'); + * expect([1, 2], 'nooo why fail??').to.have.members([1, 2, 3]); + * + * @name members + * @param {Array} set + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + Assertion.addMethod('members', function (subset, msg) { + if (msg) flag(this, 'message', msg); + var obj = flag(this, 'object') + , flagMsg = flag(this, 'message') + , ssfi = flag(this, 'ssfi'); + + new Assertion(obj, flagMsg, ssfi, true).to.be.an('array'); + new Assertion(subset, flagMsg, ssfi, true).to.be.an('array'); + + var contains = flag(this, 'contains'); + var ordered = flag(this, 'ordered'); + + var subject, failMsg, failNegateMsg; + + if (contains) { + subject = ordered ? 'an ordered superset' : 'a superset'; + failMsg = 'expected #{this} to be ' + subject + ' of #{exp}'; + failNegateMsg = 'expected #{this} to not be ' + subject + ' of #{exp}'; + } else { + subject = ordered ? 'ordered members' : 'members'; + failMsg = 'expected #{this} to have the same ' + subject + ' as #{exp}'; + failNegateMsg = 'expected #{this} to not have the same ' + subject + ' as #{exp}'; + } + + var cmp = flag(this, 'deep') ? _.eql : undefined; + + this.assert( + isSubsetOf(subset, obj, cmp, contains, ordered) + , failMsg + , failNegateMsg + , subset + , obj + , true + ); + }); + + /** + * ### .oneOf(list[, msg]) + * + * Asserts that the target is a member of the given array `list`. However, + * it's often best to assert that the target is equal to its expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.oneOf([1, 2, 3]); // Not recommended + * + * Comparisons are performed using strict (`===`) equality. + * + * Add `.not` earlier in the chain to negate `.oneOf`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.oneOf([2, 3, 4]); // Not recommended + * + * It can also be chained with `.contain` or `.include`, which will work with + * both arrays and strings: + * + * expect('Today is sunny').to.contain.oneOf(['sunny', 'cloudy']) + * expect('Today is rainy').to.not.contain.oneOf(['sunny', 'cloudy']) + * expect([1,2,3]).to.contain.oneOf([3,4,5]) + * expect([1,2,3]).to.not.contain.oneOf([4,5,6]) + * + * `.oneOf` accepts an optional `msg` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to `expect`. + * + * expect(1).to.be.oneOf([2, 3, 4], 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.oneOf([2, 3, 4]); + * + * @name oneOf + * @param {Array<*>} list + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function oneOf (list, msg) { + if (msg) flag(this, 'message', msg); + var expected = flag(this, 'object') + , flagMsg = flag(this, 'message') + , ssfi = flag(this, 'ssfi') + , contains = flag(this, 'contains') + , isDeep = flag(this, 'deep'); + new Assertion(list, flagMsg, ssfi, true).to.be.an('array'); + + if (contains) { + this.assert( + list.some(function(possibility) { return expected.indexOf(possibility) > -1 }) + , 'expected #{this} to contain one of #{exp}' + , 'expected #{this} to not contain one of #{exp}' + , list + , expected + ); + } else { + if (isDeep) { + this.assert( + list.some(function(possibility) { return _.eql(expected, possibility) }) + , 'expected #{this} to deeply equal one of #{exp}' + , 'expected #{this} to deeply equal one of #{exp}' + , list + , expected + ); + } else { + this.assert( + list.indexOf(expected) > -1 + , 'expected #{this} to be one of #{exp}' + , 'expected #{this} to not be one of #{exp}' + , list + , expected + ); + } + } + } + + Assertion.addMethod('oneOf', oneOf); + + /** + * ### .change(subject[, prop[, msg]]) + * + * When one argument is provided, `.change` asserts that the given function + * `subject` returns a different value when it's invoked before the target + * function compared to when it's invoked afterward. However, it's often best + * to assert that `subject` is equal to its expected value. + * + * var dots = '' + * , addDot = function () { dots += '.'; } + * , getDots = function () { return dots; }; + * + * // Recommended + * expect(getDots()).to.equal(''); + * addDot(); + * expect(getDots()).to.equal('.'); + * + * // Not recommended + * expect(addDot).to.change(getDots); + * + * When two arguments are provided, `.change` asserts that the value of the + * given object `subject`'s `prop` property is different before invoking the + * target function compared to afterward. + * + * var myObj = {dots: ''} + * , addDot = function () { myObj.dots += '.'; }; + * + * // Recommended + * expect(myObj).to.have.property('dots', ''); + * addDot(); + * expect(myObj).to.have.property('dots', '.'); + * + * // Not recommended + * expect(addDot).to.change(myObj, 'dots'); + * + * Strict (`===`) equality is used to compare before and after values. + * + * Add `.not` earlier in the chain to negate `.change`. + * + * var dots = '' + * , noop = function () {} + * , getDots = function () { return dots; }; + * + * expect(noop).to.not.change(getDots); + * + * var myObj = {dots: ''} + * , noop = function () {}; + * + * expect(noop).to.not.change(myObj, 'dots'); + * + * `.change` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. When not providing two arguments, always + * use the second form. + * + * var myObj = {dots: ''} + * , addDot = function () { myObj.dots += '.'; }; + * + * expect(addDot).to.not.change(myObj, 'dots', 'nooo why fail??'); + * + * var dots = '' + * , addDot = function () { dots += '.'; } + * , getDots = function () { return dots; }; + * + * expect(addDot, 'nooo why fail??').to.not.change(getDots); + * + * `.change` also causes all `.by` assertions that follow in the chain to + * assert how much a numeric subject was increased or decreased by. However, + * it's dangerous to use `.change.by`. The problem is that it creates + * uncertain expectations by asserting that the subject either increases by + * the given delta, or that it decreases by the given delta. It's often best + * to identify the exact output that's expected, and then write an assertion + * that only accepts that exact output. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; } + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * The alias `.changes` can be used interchangeably with `.change`. + * + * @name change + * @alias changes + * @param {String} subject + * @param {String} prop name _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertChanges (subject, prop, msg) { + if (msg) flag(this, 'message', msg); + var fn = flag(this, 'object') + , flagMsg = flag(this, 'message') + , ssfi = flag(this, 'ssfi'); + new Assertion(fn, flagMsg, ssfi, true).is.a('function'); + + var initial; + if (!prop) { + new Assertion(subject, flagMsg, ssfi, true).is.a('function'); + initial = subject(); + } else { + new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop); + initial = subject[prop]; + } + + fn(); + + var final = prop === undefined || prop === null ? subject() : subject[prop]; + var msgObj = prop === undefined || prop === null ? initial : '.' + prop; + + // This gets flagged because of the .by(delta) assertion + flag(this, 'deltaMsgObj', msgObj); + flag(this, 'initialDeltaValue', initial); + flag(this, 'finalDeltaValue', final); + flag(this, 'deltaBehavior', 'change'); + flag(this, 'realDelta', final !== initial); + + this.assert( + initial !== final + , 'expected ' + msgObj + ' to change' + , 'expected ' + msgObj + ' to not change' + ); + } + + Assertion.addMethod('change', assertChanges); + Assertion.addMethod('changes', assertChanges); + + /** + * ### .increase(subject[, prop[, msg]]) + * + * When one argument is provided, `.increase` asserts that the given function + * `subject` returns a greater number when it's invoked after invoking the + * target function compared to when it's invoked beforehand. `.increase` also + * causes all `.by` assertions that follow in the chain to assert how much + * greater of a number is returned. It's often best to assert that the return + * value increased by the expected amount, rather than asserting it increased + * by any amount. + * + * var val = 1 + * , addTwo = function () { val += 2; } + * , getVal = function () { return val; }; + * + * expect(addTwo).to.increase(getVal).by(2); // Recommended + * expect(addTwo).to.increase(getVal); // Not recommended + * + * When two arguments are provided, `.increase` asserts that the value of the + * given object `subject`'s `prop` property is greater after invoking the + * target function compared to beforehand. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.increase(myObj, 'val'); // Not recommended + * + * Add `.not` earlier in the chain to negate `.increase`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the subject either decreases, or that it stays the same. + * It's often best to identify the exact output that's expected, and then + * write an assertion that only accepts that exact output. + * + * When the subject is expected to decrease, it's often best to assert that it + * decreased by the expected amount. + * + * var myObj = {val: 1} + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.not.increase(myObj, 'val'); // Not recommended + * + * When the subject is expected to stay the same, it's often best to assert + * exactly that. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.not.change(myObj, 'val'); // Recommended + * expect(noop).to.not.increase(myObj, 'val'); // Not recommended + * + * `.increase` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. When not providing two arguments, always + * use the second form. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.increase(myObj, 'val', 'nooo why fail??'); + * + * var val = 1 + * , noop = function () {} + * , getVal = function () { return val; }; + * + * expect(noop, 'nooo why fail??').to.increase(getVal); + * + * The alias `.increases` can be used interchangeably with `.increase`. + * + * @name increase + * @alias increases + * @param {String|Function} subject + * @param {String} prop name _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertIncreases (subject, prop, msg) { + if (msg) flag(this, 'message', msg); + var fn = flag(this, 'object') + , flagMsg = flag(this, 'message') + , ssfi = flag(this, 'ssfi'); + new Assertion(fn, flagMsg, ssfi, true).is.a('function'); + + var initial; + if (!prop) { + new Assertion(subject, flagMsg, ssfi, true).is.a('function'); + initial = subject(); + } else { + new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop); + initial = subject[prop]; + } + + // Make sure that the target is a number + new Assertion(initial, flagMsg, ssfi, true).is.a('number'); + + fn(); + + var final = prop === undefined || prop === null ? subject() : subject[prop]; + var msgObj = prop === undefined || prop === null ? initial : '.' + prop; + + flag(this, 'deltaMsgObj', msgObj); + flag(this, 'initialDeltaValue', initial); + flag(this, 'finalDeltaValue', final); + flag(this, 'deltaBehavior', 'increase'); + flag(this, 'realDelta', final - initial); + + this.assert( + final - initial > 0 + , 'expected ' + msgObj + ' to increase' + , 'expected ' + msgObj + ' to not increase' + ); + } + + Assertion.addMethod('increase', assertIncreases); + Assertion.addMethod('increases', assertIncreases); + + /** + * ### .decrease(subject[, prop[, msg]]) + * + * When one argument is provided, `.decrease` asserts that the given function + * `subject` returns a lesser number when it's invoked after invoking the + * target function compared to when it's invoked beforehand. `.decrease` also + * causes all `.by` assertions that follow in the chain to assert how much + * lesser of a number is returned. It's often best to assert that the return + * value decreased by the expected amount, rather than asserting it decreased + * by any amount. + * + * var val = 1 + * , subtractTwo = function () { val -= 2; } + * , getVal = function () { return val; }; + * + * expect(subtractTwo).to.decrease(getVal).by(2); // Recommended + * expect(subtractTwo).to.decrease(getVal); // Not recommended + * + * When two arguments are provided, `.decrease` asserts that the value of the + * given object `subject`'s `prop` property is lesser after invoking the + * target function compared to beforehand. + * + * var myObj = {val: 1} + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.decrease(myObj, 'val'); // Not recommended + * + * Add `.not` earlier in the chain to negate `.decrease`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the subject either increases, or that it stays the same. + * It's often best to identify the exact output that's expected, and then + * write an assertion that only accepts that exact output. + * + * When the subject is expected to increase, it's often best to assert that it + * increased by the expected amount. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.not.decrease(myObj, 'val'); // Not recommended + * + * When the subject is expected to stay the same, it's often best to assert + * exactly that. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.not.change(myObj, 'val'); // Recommended + * expect(noop).to.not.decrease(myObj, 'val'); // Not recommended + * + * `.decrease` accepts an optional `msg` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to `expect`. When not providing two arguments, always + * use the second form. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.decrease(myObj, 'val', 'nooo why fail??'); + * + * var val = 1 + * , noop = function () {} + * , getVal = function () { return val; }; + * + * expect(noop, 'nooo why fail??').to.decrease(getVal); + * + * The alias `.decreases` can be used interchangeably with `.decrease`. + * + * @name decrease + * @alias decreases + * @param {String|Function} subject + * @param {String} prop name _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertDecreases (subject, prop, msg) { + if (msg) flag(this, 'message', msg); + var fn = flag(this, 'object') + , flagMsg = flag(this, 'message') + , ssfi = flag(this, 'ssfi'); + new Assertion(fn, flagMsg, ssfi, true).is.a('function'); + + var initial; + if (!prop) { + new Assertion(subject, flagMsg, ssfi, true).is.a('function'); + initial = subject(); + } else { + new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop); + initial = subject[prop]; + } + + // Make sure that the target is a number + new Assertion(initial, flagMsg, ssfi, true).is.a('number'); + + fn(); + + var final = prop === undefined || prop === null ? subject() : subject[prop]; + var msgObj = prop === undefined || prop === null ? initial : '.' + prop; + + flag(this, 'deltaMsgObj', msgObj); + flag(this, 'initialDeltaValue', initial); + flag(this, 'finalDeltaValue', final); + flag(this, 'deltaBehavior', 'decrease'); + flag(this, 'realDelta', initial - final); + + this.assert( + final - initial < 0 + , 'expected ' + msgObj + ' to decrease' + , 'expected ' + msgObj + ' to not decrease' + ); + } + + Assertion.addMethod('decrease', assertDecreases); + Assertion.addMethod('decreases', assertDecreases); + + /** + * ### .by(delta[, msg]) + * + * When following an `.increase` assertion in the chain, `.by` asserts that + * the subject of the `.increase` assertion increased by the given `delta`. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); + * + * When following a `.decrease` assertion in the chain, `.by` asserts that the + * subject of the `.decrease` assertion decreased by the given `delta`. + * + * var myObj = {val: 1} + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); + * + * When following a `.change` assertion in the chain, `.by` asserts that the + * subject of the `.change` assertion either increased or decreased by the + * given `delta`. However, it's dangerous to use `.change.by`. The problem is + * that it creates uncertain expectations. It's often best to identify the + * exact output that's expected, and then write an assertion that only accepts + * that exact output. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; } + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * Add `.not` earlier in the chain to negate `.by`. However, it's often best + * to assert that the subject changed by its expected delta, rather than + * asserting that it didn't change by one of countless unexpected deltas. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * // Recommended + * expect(addTwo).to.increase(myObj, 'val').by(2); + * + * // Not recommended + * expect(addTwo).to.increase(myObj, 'val').but.not.by(3); + * + * `.by` accepts an optional `msg` argument which is a custom error message to + * show when the assertion fails. The message can also be given as the second + * argument to `expect`. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(3, 'nooo why fail??'); + * expect(addTwo, 'nooo why fail??').to.increase(myObj, 'val').by(3); + * + * @name by + * @param {Number} delta + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */ + + function assertDelta(delta, msg) { + if (msg) flag(this, 'message', msg); + + var msgObj = flag(this, 'deltaMsgObj'); + var initial = flag(this, 'initialDeltaValue'); + var final = flag(this, 'finalDeltaValue'); + var behavior = flag(this, 'deltaBehavior'); + var realDelta = flag(this, 'realDelta'); + + var expression; + if (behavior === 'change') { + expression = Math.abs(final - initial) === Math.abs(delta); + } else { + expression = realDelta === Math.abs(delta); + } + + this.assert( + expression + , 'expected ' + msgObj + ' to ' + behavior + ' by ' + delta + , 'expected ' + msgObj + ' to not ' + behavior + ' by ' + delta + ); + } + + Assertion.addMethod('by', assertDelta); + + /** + * ### .extensible + * + * Asserts that the target is extensible, which means that new properties can + * be added to it. Primitives are never extensible. + * + * expect({a: 1}).to.be.extensible; + * + * Add `.not` earlier in the chain to negate `.extensible`. + * + * var nonExtensibleObject = Object.preventExtensions({}) + * , sealedObject = Object.seal({}) + * , frozenObject = Object.freeze({}); + * + * expect(nonExtensibleObject).to.not.be.extensible; + * expect(sealedObject).to.not.be.extensible; + * expect(frozenObject).to.not.be.extensible; + * expect(1).to.not.be.extensible; + * + * A custom error message can be given as the second argument to `expect`. + * + * expect(1, 'nooo why fail??').to.be.extensible; + * + * @name extensible + * @namespace BDD + * @api public + */ + + Assertion.addProperty('extensible', function() { + var obj = flag(this, 'object'); + + // In ES5, if the argument to this method is a primitive, then it will cause a TypeError. + // In ES6, a non-object argument will be treated as if it was a non-extensible ordinary object, simply return false. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible + // The following provides ES6 behavior for ES5 environments. + + var isExtensible = obj === Object(obj) && Object.isExtensible(obj); + + this.assert( + isExtensible + , 'expected #{this} to be extensible' + , 'expected #{this} to not be extensible' + ); + }); + + /** + * ### .sealed + * + * Asserts that the target is sealed, which means that new properties can't be + * added to it, and its existing properties can't be reconfigured or deleted. + * However, it's possible that its existing properties can still be reassigned + * to different values. Primitives are always sealed. + * + * var sealedObject = Object.seal({}); + * var frozenObject = Object.freeze({}); + * + * expect(sealedObject).to.be.sealed; + * expect(frozenObject).to.be.sealed; + * expect(1).to.be.sealed; + * + * Add `.not` earlier in the chain to negate `.sealed`. + * + * expect({a: 1}).to.not.be.sealed; + * + * A custom error message can be given as the second argument to `expect`. + * + * expect({a: 1}, 'nooo why fail??').to.be.sealed; + * + * @name sealed + * @namespace BDD + * @api public + */ + + Assertion.addProperty('sealed', function() { + var obj = flag(this, 'object'); + + // In ES5, if the argument to this method is a primitive, then it will cause a TypeError. + // In ES6, a non-object argument will be treated as if it was a sealed ordinary object, simply return true. + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed + // The following provides ES6 behavior for ES5 environments. + + var isSealed = obj === Object(obj) ? Object.isSealed(obj) : true; + + this.assert( + isSealed + , 'expected #{this} to be sealed' + , 'expected #{this} to not be sealed' + ); + }); + + /** + * ### .frozen + * + * Asserts that the target is frozen, which means that new properties can't be + * added to it, and its existing properties can't be reassigned to different + * values, reconfigured, or deleted. Primitives are always frozen. + * + * var frozenObject = Object.freeze({}); + * + * expect(frozenObject).to.be.frozen; + * expect(1).to.be.frozen; + * + * Add `.not` earlier in the chain to negate `.frozen`. + * + * expect({a: 1}).to.not.be.frozen; + * + * A custom error message can be given as the second argument to `expect`. + * + * expect({a: 1}, 'nooo why fail??').to.be.frozen; + * + * @name frozen + * @namespace BDD + * @api public + */ + + Assertion.addProperty('frozen', function() { + var obj = flag(this, 'object'); + + // In ES5, if the argument to this method is a primitive, then it will cause a TypeError. + // In ES6, a non-object argument will be treated as if it was a frozen ordinary object, simply return true. + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen + // The following provides ES6 behavior for ES5 environments. + + var isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true; + + this.assert( + isFrozen + , 'expected #{this} to be frozen' + , 'expected #{this} to not be frozen' + ); + }); + + /** + * ### .finite + * + * Asserts that the target is a number, and isn't `NaN` or positive/negative + * `Infinity`. + * + * expect(1).to.be.finite; + * + * Add `.not` earlier in the chain to negate `.finite`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the subject either isn't a number, or that it's `NaN`, or + * that it's positive `Infinity`, or that it's negative `Infinity`. It's often + * best to identify the exact output that's expected, and then write an + * assertion that only accepts that exact output. + * + * When the target isn't expected to be a number, it's often best to assert + * that it's the expected type, rather than asserting that it isn't one of + * many unexpected types. + * + * expect('foo').to.be.a('string'); // Recommended + * expect('foo').to.not.be.finite; // Not recommended + * + * When the target is expected to be `NaN`, it's often best to assert exactly + * that. + * + * expect(NaN).to.be.NaN; // Recommended + * expect(NaN).to.not.be.finite; // Not recommended + * + * When the target is expected to be positive infinity, it's often best to + * assert exactly that. + * + * expect(Infinity).to.equal(Infinity); // Recommended + * expect(Infinity).to.not.be.finite; // Not recommended + * + * When the target is expected to be negative infinity, it's often best to + * assert exactly that. + * + * expect(-Infinity).to.equal(-Infinity); // Recommended + * expect(-Infinity).to.not.be.finite; // Not recommended + * + * A custom error message can be given as the second argument to `expect`. + * + * expect('foo', 'nooo why fail??').to.be.finite; + * + * @name finite + * @namespace BDD + * @api public + */ + + Assertion.addProperty('finite', function(msg) { + var obj = flag(this, 'object'); + + this.assert( + typeof obj === 'number' && isFinite(obj) + , 'expected #{this} to be a finite number' + , 'expected #{this} to not be a finite number' + ); + }); + }; + + /*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ + + var expect = function (chai, util) { + chai.expect = function (val, message) { + return new chai.Assertion(val, message); + }; + + /** + * ### .fail([message]) + * ### .fail(actual, expected, [message], [operator]) + * + * Throw a failure. + * + * expect.fail(); + * expect.fail("custom error message"); + * expect.fail(1, 2); + * expect.fail(1, 2, "custom error message"); + * expect.fail(1, 2, "custom error message", ">"); + * expect.fail(1, 2, undefined, ">"); + * + * @name fail + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @param {String} operator + * @namespace BDD + * @api public + */ + + chai.expect.fail = function (actual, expected, message, operator) { + if (arguments.length < 2) { + message = actual; + actual = undefined; + } + + message = message || 'expect.fail()'; + throw new chai.AssertionError(message, { + actual: actual + , expected: expected + , operator: operator + }, chai.expect.fail); + }; + }; + + /*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ + + var should = function (chai, util) { + var Assertion = chai.Assertion; + + function loadShould () { + // explicitly define this method as function as to have it's name to include as `ssfi` + function shouldGetter() { + if (this instanceof String + || this instanceof Number + || this instanceof Boolean + || typeof Symbol === 'function' && this instanceof Symbol + || typeof BigInt === 'function' && this instanceof BigInt) { + return new Assertion(this.valueOf(), null, shouldGetter); + } + return new Assertion(this, null, shouldGetter); + } + function shouldSetter(value) { + // See https://github.com/chaijs/chai/issues/86: this makes + // `whatever.should = someValue` actually set `someValue`, which is + // especially useful for `global.should = require('chai').should()`. + // + // Note that we have to use [[DefineProperty]] instead of [[Put]] + // since otherwise we would trigger this very setter! + Object.defineProperty(this, 'should', { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } + // modify Object.prototype to have `should` + Object.defineProperty(Object.prototype, 'should', { + set: shouldSetter + , get: shouldGetter + , configurable: true + }); + + var should = {}; + + /** + * ### .fail([message]) + * ### .fail(actual, expected, [message], [operator]) + * + * Throw a failure. + * + * should.fail(); + * should.fail("custom error message"); + * should.fail(1, 2); + * should.fail(1, 2, "custom error message"); + * should.fail(1, 2, "custom error message", ">"); + * should.fail(1, 2, undefined, ">"); + * + * + * @name fail + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @param {String} operator + * @namespace BDD + * @api public + */ + + should.fail = function (actual, expected, message, operator) { + if (arguments.length < 2) { + message = actual; + actual = undefined; + } + + message = message || 'should.fail()'; + throw new chai.AssertionError(message, { + actual: actual + , expected: expected + , operator: operator + }, should.fail); + }; + + /** + * ### .equal(actual, expected, [message]) + * + * Asserts non-strict equality (`==`) of `actual` and `expected`. + * + * should.equal(3, '3', '== coerces values to strings'); + * + * @name equal + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Should + * @api public + */ + + should.equal = function (val1, val2, msg) { + new Assertion(val1, msg).to.equal(val2); + }; + + /** + * ### .throw(function, [constructor/string/regexp], [string/regexp], [message]) + * + * Asserts that `function` will throw an error that is an instance of + * `constructor`, or alternately that it will throw an error with message + * matching `regexp`. + * + * should.throw(fn, 'function throws a reference error'); + * should.throw(fn, /function throws a reference error/); + * should.throw(fn, ReferenceError); + * should.throw(fn, ReferenceError, 'function throws a reference error'); + * should.throw(fn, ReferenceError, /function throws a reference error/); + * + * @name throw + * @alias Throw + * @param {Function} function + * @param {ErrorConstructor} constructor + * @param {RegExp} regexp + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Should + * @api public + */ + + should.Throw = function (fn, errt, errs, msg) { + new Assertion(fn, msg).to.Throw(errt, errs); + }; + + /** + * ### .exist + * + * Asserts that the target is neither `null` nor `undefined`. + * + * var foo = 'hi'; + * + * should.exist(foo, 'foo exists'); + * + * @name exist + * @namespace Should + * @api public + */ + + should.exist = function (val, msg) { + new Assertion(val, msg).to.exist; + }; + + // negation + should.not = {}; + + /** + * ### .not.equal(actual, expected, [message]) + * + * Asserts non-strict inequality (`!=`) of `actual` and `expected`. + * + * should.not.equal(3, 4, 'these numbers are not equal'); + * + * @name not.equal + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Should + * @api public + */ + + should.not.equal = function (val1, val2, msg) { + new Assertion(val1, msg).to.not.equal(val2); + }; + + /** + * ### .throw(function, [constructor/regexp], [message]) + * + * Asserts that `function` will _not_ throw an error that is an instance of + * `constructor`, or alternately that it will not throw an error with message + * matching `regexp`. + * + * should.not.throw(fn, Error, 'function does not throw'); + * + * @name not.throw + * @alias not.Throw + * @param {Function} function + * @param {ErrorConstructor} constructor + * @param {RegExp} regexp + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Should + * @api public + */ + + should.not.Throw = function (fn, errt, errs, msg) { + new Assertion(fn, msg).to.not.Throw(errt, errs); + }; + + /** + * ### .not.exist + * + * Asserts that the target is neither `null` nor `undefined`. + * + * var bar = null; + * + * should.not.exist(bar, 'bar does not exist'); + * + * @name not.exist + * @namespace Should + * @api public + */ + + should.not.exist = function (val, msg) { + new Assertion(val, msg).to.not.exist; + }; + + should['throw'] = should['Throw']; + should.not['throw'] = should.not['Throw']; + + return should; + } + chai.should = loadShould; + chai.Should = loadShould; + }; + + /*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ + + var assert = function (chai, util) { + /*! + * Chai dependencies. + */ + + var Assertion = chai.Assertion + , flag = util.flag; + + /*! + * Module export. + */ + + /** + * ### assert(expression, message) + * + * Write your own test expressions. + * + * assert('foo' !== 'bar', 'foo is not bar'); + * assert(Array.isArray([]), 'empty arrays are arrays'); + * + * @param {Mixed} expression to test for truthiness + * @param {String} message to display on error + * @name assert + * @namespace Assert + * @api public + */ + + var assert = chai.assert = function (express, errmsg) { + var test = new Assertion(null, null, chai.assert, true); + test.assert( + express + , errmsg + , '[ negation message unavailable ]' + ); + }; + + /** + * ### .fail([message]) + * ### .fail(actual, expected, [message], [operator]) + * + * Throw a failure. Node.js `assert` module-compatible. + * + * assert.fail(); + * assert.fail("custom error message"); + * assert.fail(1, 2); + * assert.fail(1, 2, "custom error message"); + * assert.fail(1, 2, "custom error message", ">"); + * assert.fail(1, 2, undefined, ">"); + * + * @name fail + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @param {String} operator + * @namespace Assert + * @api public + */ + + assert.fail = function (actual, expected, message, operator) { + if (arguments.length < 2) { + // Comply with Node's fail([message]) interface + + message = actual; + actual = undefined; + } + + message = message || 'assert.fail()'; + throw new chai.AssertionError(message, { + actual: actual + , expected: expected + , operator: operator + }, assert.fail); + }; + + /** + * ### .isOk(object, [message]) + * + * Asserts that `object` is truthy. + * + * assert.isOk('everything', 'everything is ok'); + * assert.isOk(false, 'this will fail'); + * + * @name isOk + * @alias ok + * @param {Mixed} object to test + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isOk = function (val, msg) { + new Assertion(val, msg, assert.isOk, true).is.ok; + }; + + /** + * ### .isNotOk(object, [message]) + * + * Asserts that `object` is falsy. + * + * assert.isNotOk('everything', 'this will fail'); + * assert.isNotOk(false, 'this will pass'); + * + * @name isNotOk + * @alias notOk + * @param {Mixed} object to test + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotOk = function (val, msg) { + new Assertion(val, msg, assert.isNotOk, true).is.not.ok; + }; + + /** + * ### .equal(actual, expected, [message]) + * + * Asserts non-strict equality (`==`) of `actual` and `expected`. + * + * assert.equal(3, '3', '== coerces values to strings'); + * + * @name equal + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.equal = function (act, exp, msg) { + var test = new Assertion(act, msg, assert.equal, true); + + test.assert( + exp == flag(test, 'object') + , 'expected #{this} to equal #{exp}' + , 'expected #{this} to not equal #{act}' + , exp + , act + , true + ); + }; + + /** + * ### .notEqual(actual, expected, [message]) + * + * Asserts non-strict inequality (`!=`) of `actual` and `expected`. + * + * assert.notEqual(3, 4, 'these numbers are not equal'); + * + * @name notEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notEqual = function (act, exp, msg) { + var test = new Assertion(act, msg, assert.notEqual, true); + + test.assert( + exp != flag(test, 'object') + , 'expected #{this} to not equal #{exp}' + , 'expected #{this} to equal #{act}' + , exp + , act + , true + ); + }; + + /** + * ### .strictEqual(actual, expected, [message]) + * + * Asserts strict equality (`===`) of `actual` and `expected`. + * + * assert.strictEqual(true, true, 'these booleans are strictly equal'); + * + * @name strictEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.strictEqual = function (act, exp, msg) { + new Assertion(act, msg, assert.strictEqual, true).to.equal(exp); + }; + + /** + * ### .notStrictEqual(actual, expected, [message]) + * + * Asserts strict inequality (`!==`) of `actual` and `expected`. + * + * assert.notStrictEqual(3, '3', 'no coercion for strict equality'); + * + * @name notStrictEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notStrictEqual = function (act, exp, msg) { + new Assertion(act, msg, assert.notStrictEqual, true).to.not.equal(exp); + }; + + /** + * ### .deepEqual(actual, expected, [message]) + * + * Asserts that `actual` is deeply equal to `expected`. + * + * assert.deepEqual({ tea: 'green' }, { tea: 'green' }); + * + * @name deepEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @alias deepStrictEqual + * @namespace Assert + * @api public + */ + + assert.deepEqual = assert.deepStrictEqual = function (act, exp, msg) { + new Assertion(act, msg, assert.deepEqual, true).to.eql(exp); + }; + + /** + * ### .notDeepEqual(actual, expected, [message]) + * + * Assert that `actual` is not deeply equal to `expected`. + * + * assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' }); + * + * @name notDeepEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notDeepEqual = function (act, exp, msg) { + new Assertion(act, msg, assert.notDeepEqual, true).to.not.eql(exp); + }; + + /** + * ### .isAbove(valueToCheck, valueToBeAbove, [message]) + * + * Asserts `valueToCheck` is strictly greater than (>) `valueToBeAbove`. + * + * assert.isAbove(5, 2, '5 is strictly greater than 2'); + * + * @name isAbove + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeAbove + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isAbove = function (val, abv, msg) { + new Assertion(val, msg, assert.isAbove, true).to.be.above(abv); + }; + + /** + * ### .isAtLeast(valueToCheck, valueToBeAtLeast, [message]) + * + * Asserts `valueToCheck` is greater than or equal to (>=) `valueToBeAtLeast`. + * + * assert.isAtLeast(5, 2, '5 is greater or equal to 2'); + * assert.isAtLeast(3, 3, '3 is greater or equal to 3'); + * + * @name isAtLeast + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeAtLeast + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isAtLeast = function (val, atlst, msg) { + new Assertion(val, msg, assert.isAtLeast, true).to.be.least(atlst); + }; + + /** + * ### .isBelow(valueToCheck, valueToBeBelow, [message]) + * + * Asserts `valueToCheck` is strictly less than (<) `valueToBeBelow`. + * + * assert.isBelow(3, 6, '3 is strictly less than 6'); + * + * @name isBelow + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeBelow + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isBelow = function (val, blw, msg) { + new Assertion(val, msg, assert.isBelow, true).to.be.below(blw); + }; + + /** + * ### .isAtMost(valueToCheck, valueToBeAtMost, [message]) + * + * Asserts `valueToCheck` is less than or equal to (<=) `valueToBeAtMost`. + * + * assert.isAtMost(3, 6, '3 is less than or equal to 6'); + * assert.isAtMost(4, 4, '4 is less than or equal to 4'); + * + * @name isAtMost + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeAtMost + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isAtMost = function (val, atmst, msg) { + new Assertion(val, msg, assert.isAtMost, true).to.be.most(atmst); + }; + + /** + * ### .isTrue(value, [message]) + * + * Asserts that `value` is true. + * + * var teaServed = true; + * assert.isTrue(teaServed, 'the tea has been served'); + * + * @name isTrue + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isTrue = function (val, msg) { + new Assertion(val, msg, assert.isTrue, true).is['true']; + }; + + /** + * ### .isNotTrue(value, [message]) + * + * Asserts that `value` is not true. + * + * var tea = 'tasty chai'; + * assert.isNotTrue(tea, 'great, time for tea!'); + * + * @name isNotTrue + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotTrue = function (val, msg) { + new Assertion(val, msg, assert.isNotTrue, true).to.not.equal(true); + }; + + /** + * ### .isFalse(value, [message]) + * + * Asserts that `value` is false. + * + * var teaServed = false; + * assert.isFalse(teaServed, 'no tea yet? hmm...'); + * + * @name isFalse + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isFalse = function (val, msg) { + new Assertion(val, msg, assert.isFalse, true).is['false']; + }; + + /** + * ### .isNotFalse(value, [message]) + * + * Asserts that `value` is not false. + * + * var tea = 'tasty chai'; + * assert.isNotFalse(tea, 'great, time for tea!'); + * + * @name isNotFalse + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotFalse = function (val, msg) { + new Assertion(val, msg, assert.isNotFalse, true).to.not.equal(false); + }; + + /** + * ### .isNull(value, [message]) + * + * Asserts that `value` is null. + * + * assert.isNull(err, 'there was no error'); + * + * @name isNull + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNull = function (val, msg) { + new Assertion(val, msg, assert.isNull, true).to.equal(null); + }; + + /** + * ### .isNotNull(value, [message]) + * + * Asserts that `value` is not null. + * + * var tea = 'tasty chai'; + * assert.isNotNull(tea, 'great, time for tea!'); + * + * @name isNotNull + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotNull = function (val, msg) { + new Assertion(val, msg, assert.isNotNull, true).to.not.equal(null); + }; + + /** + * ### .isNaN + * + * Asserts that value is NaN. + * + * assert.isNaN(NaN, 'NaN is NaN'); + * + * @name isNaN + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNaN = function (val, msg) { + new Assertion(val, msg, assert.isNaN, true).to.be.NaN; + }; + + /** + * ### .isNotNaN + * + * Asserts that value is not NaN. + * + * assert.isNotNaN(4, '4 is not NaN'); + * + * @name isNotNaN + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + assert.isNotNaN = function (val, msg) { + new Assertion(val, msg, assert.isNotNaN, true).not.to.be.NaN; + }; + + /** + * ### .exists + * + * Asserts that the target is neither `null` nor `undefined`. + * + * var foo = 'hi'; + * + * assert.exists(foo, 'foo is neither `null` nor `undefined`'); + * + * @name exists + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.exists = function (val, msg) { + new Assertion(val, msg, assert.exists, true).to.exist; + }; + + /** + * ### .notExists + * + * Asserts that the target is either `null` or `undefined`. + * + * var bar = null + * , baz; + * + * assert.notExists(bar); + * assert.notExists(baz, 'baz is either null or undefined'); + * + * @name notExists + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notExists = function (val, msg) { + new Assertion(val, msg, assert.notExists, true).to.not.exist; + }; + + /** + * ### .isUndefined(value, [message]) + * + * Asserts that `value` is `undefined`. + * + * var tea; + * assert.isUndefined(tea, 'no tea defined'); + * + * @name isUndefined + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isUndefined = function (val, msg) { + new Assertion(val, msg, assert.isUndefined, true).to.equal(undefined); + }; + + /** + * ### .isDefined(value, [message]) + * + * Asserts that `value` is not `undefined`. + * + * var tea = 'cup of chai'; + * assert.isDefined(tea, 'tea has been defined'); + * + * @name isDefined + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isDefined = function (val, msg) { + new Assertion(val, msg, assert.isDefined, true).to.not.equal(undefined); + }; + + /** + * ### .isFunction(value, [message]) + * + * Asserts that `value` is a function. + * + * function serveTea() { return 'cup of tea'; }; + * assert.isFunction(serveTea, 'great, we can have tea now'); + * + * @name isFunction + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isFunction = function (val, msg) { + new Assertion(val, msg, assert.isFunction, true).to.be.a('function'); + }; + + /** + * ### .isNotFunction(value, [message]) + * + * Asserts that `value` is _not_ a function. + * + * var serveTea = [ 'heat', 'pour', 'sip' ]; + * assert.isNotFunction(serveTea, 'great, we have listed the steps'); + * + * @name isNotFunction + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotFunction = function (val, msg) { + new Assertion(val, msg, assert.isNotFunction, true).to.not.be.a('function'); + }; + + /** + * ### .isObject(value, [message]) + * + * Asserts that `value` is an object of type 'Object' (as revealed by `Object.prototype.toString`). + * _The assertion does not match subclassed objects._ + * + * var selection = { name: 'Chai', serve: 'with spices' }; + * assert.isObject(selection, 'tea selection is an object'); + * + * @name isObject + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isObject = function (val, msg) { + new Assertion(val, msg, assert.isObject, true).to.be.a('object'); + }; + + /** + * ### .isNotObject(value, [message]) + * + * Asserts that `value` is _not_ an object of type 'Object' (as revealed by `Object.prototype.toString`). + * + * var selection = 'chai' + * assert.isNotObject(selection, 'tea selection is not an object'); + * assert.isNotObject(null, 'null is not an object'); + * + * @name isNotObject + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotObject = function (val, msg) { + new Assertion(val, msg, assert.isNotObject, true).to.not.be.a('object'); + }; + + /** + * ### .isArray(value, [message]) + * + * Asserts that `value` is an array. + * + * var menu = [ 'green', 'chai', 'oolong' ]; + * assert.isArray(menu, 'what kind of tea do we want?'); + * + * @name isArray + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isArray = function (val, msg) { + new Assertion(val, msg, assert.isArray, true).to.be.an('array'); + }; + + /** + * ### .isNotArray(value, [message]) + * + * Asserts that `value` is _not_ an array. + * + * var menu = 'green|chai|oolong'; + * assert.isNotArray(menu, 'what kind of tea do we want?'); + * + * @name isNotArray + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotArray = function (val, msg) { + new Assertion(val, msg, assert.isNotArray, true).to.not.be.an('array'); + }; + + /** + * ### .isString(value, [message]) + * + * Asserts that `value` is a string. + * + * var teaOrder = 'chai'; + * assert.isString(teaOrder, 'order placed'); + * + * @name isString + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isString = function (val, msg) { + new Assertion(val, msg, assert.isString, true).to.be.a('string'); + }; + + /** + * ### .isNotString(value, [message]) + * + * Asserts that `value` is _not_ a string. + * + * var teaOrder = 4; + * assert.isNotString(teaOrder, 'order placed'); + * + * @name isNotString + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotString = function (val, msg) { + new Assertion(val, msg, assert.isNotString, true).to.not.be.a('string'); + }; + + /** + * ### .isNumber(value, [message]) + * + * Asserts that `value` is a number. + * + * var cups = 2; + * assert.isNumber(cups, 'how many cups'); + * + * @name isNumber + * @param {Number} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNumber = function (val, msg) { + new Assertion(val, msg, assert.isNumber, true).to.be.a('number'); + }; + + /** + * ### .isNotNumber(value, [message]) + * + * Asserts that `value` is _not_ a number. + * + * var cups = '2 cups please'; + * assert.isNotNumber(cups, 'how many cups'); + * + * @name isNotNumber + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotNumber = function (val, msg) { + new Assertion(val, msg, assert.isNotNumber, true).to.not.be.a('number'); + }; + + /** + * ### .isFinite(value, [message]) + * + * Asserts that `value` is a finite number. Unlike `.isNumber`, this will fail for `NaN` and `Infinity`. + * + * var cups = 2; + * assert.isFinite(cups, 'how many cups'); + * + * assert.isFinite(NaN); // throws + * + * @name isFinite + * @param {Number} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isFinite = function (val, msg) { + new Assertion(val, msg, assert.isFinite, true).to.be.finite; + }; + + /** + * ### .isBoolean(value, [message]) + * + * Asserts that `value` is a boolean. + * + * var teaReady = true + * , teaServed = false; + * + * assert.isBoolean(teaReady, 'is the tea ready'); + * assert.isBoolean(teaServed, 'has tea been served'); + * + * @name isBoolean + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isBoolean = function (val, msg) { + new Assertion(val, msg, assert.isBoolean, true).to.be.a('boolean'); + }; + + /** + * ### .isNotBoolean(value, [message]) + * + * Asserts that `value` is _not_ a boolean. + * + * var teaReady = 'yep' + * , teaServed = 'nope'; + * + * assert.isNotBoolean(teaReady, 'is the tea ready'); + * assert.isNotBoolean(teaServed, 'has tea been served'); + * + * @name isNotBoolean + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.isNotBoolean = function (val, msg) { + new Assertion(val, msg, assert.isNotBoolean, true).to.not.be.a('boolean'); + }; + + /** + * ### .typeOf(value, name, [message]) + * + * Asserts that `value`'s type is `name`, as determined by + * `Object.prototype.toString`. + * + * assert.typeOf({ tea: 'chai' }, 'object', 'we have an object'); + * assert.typeOf(['chai', 'jasmine'], 'array', 'we have an array'); + * assert.typeOf('tea', 'string', 'we have a string'); + * assert.typeOf(/tea/, 'regexp', 'we have a regular expression'); + * assert.typeOf(null, 'null', 'we have a null'); + * assert.typeOf(undefined, 'undefined', 'we have an undefined'); + * + * @name typeOf + * @param {Mixed} value + * @param {String} name + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.typeOf = function (val, type, msg) { + new Assertion(val, msg, assert.typeOf, true).to.be.a(type); + }; + + /** + * ### .notTypeOf(value, name, [message]) + * + * Asserts that `value`'s type is _not_ `name`, as determined by + * `Object.prototype.toString`. + * + * assert.notTypeOf('tea', 'number', 'strings are not numbers'); + * + * @name notTypeOf + * @param {Mixed} value + * @param {String} typeof name + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notTypeOf = function (val, type, msg) { + new Assertion(val, msg, assert.notTypeOf, true).to.not.be.a(type); + }; + + /** + * ### .instanceOf(object, constructor, [message]) + * + * Asserts that `value` is an instance of `constructor`. + * + * var Tea = function (name) { this.name = name; } + * , chai = new Tea('chai'); + * + * assert.instanceOf(chai, Tea, 'chai is an instance of tea'); + * + * @name instanceOf + * @param {Object} object + * @param {Constructor} constructor + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.instanceOf = function (val, type, msg) { + new Assertion(val, msg, assert.instanceOf, true).to.be.instanceOf(type); + }; + + /** + * ### .notInstanceOf(object, constructor, [message]) + * + * Asserts `value` is not an instance of `constructor`. + * + * var Tea = function (name) { this.name = name; } + * , chai = new String('chai'); + * + * assert.notInstanceOf(chai, Tea, 'chai is not an instance of tea'); + * + * @name notInstanceOf + * @param {Object} object + * @param {Constructor} constructor + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notInstanceOf = function (val, type, msg) { + new Assertion(val, msg, assert.notInstanceOf, true) + .to.not.be.instanceOf(type); + }; + + /** + * ### .include(haystack, needle, [message]) + * + * Asserts that `haystack` includes `needle`. Can be used to assert the + * inclusion of a value in an array, a substring in a string, or a subset of + * properties in an object. + * + * assert.include([1,2,3], 2, 'array contains value'); + * assert.include('foobar', 'foo', 'string contains substring'); + * assert.include({ foo: 'bar', hello: 'universe' }, { foo: 'bar' }, 'object contains property'); + * + * Strict equality (===) is used. When asserting the inclusion of a value in + * an array, the array is searched for an element that's strictly equal to the + * given value. When asserting a subset of properties in an object, the object + * is searched for the given property keys, checking that each one is present + * and strictly equal to the given property value. For instance: + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.include([obj1, obj2], obj1); + * assert.include({foo: obj1, bar: obj2}, {foo: obj1}); + * assert.include({foo: obj1, bar: obj2}, {foo: obj1, bar: obj2}); + * + * @name include + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.include = function (exp, inc, msg) { + new Assertion(exp, msg, assert.include, true).include(inc); + }; + + /** + * ### .notInclude(haystack, needle, [message]) + * + * Asserts that `haystack` does not include `needle`. Can be used to assert + * the absence of a value in an array, a substring in a string, or a subset of + * properties in an object. + * + * assert.notInclude([1,2,3], 4, "array doesn't contain value"); + * assert.notInclude('foobar', 'baz', "string doesn't contain substring"); + * assert.notInclude({ foo: 'bar', hello: 'universe' }, { foo: 'baz' }, 'object doesn't contain property'); + * + * Strict equality (===) is used. When asserting the absence of a value in an + * array, the array is searched to confirm the absence of an element that's + * strictly equal to the given value. When asserting a subset of properties in + * an object, the object is searched to confirm that at least one of the given + * property keys is either not present or not strictly equal to the given + * property value. For instance: + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.notInclude([obj1, obj2], {a: 1}); + * assert.notInclude({foo: obj1, bar: obj2}, {foo: {a: 1}}); + * assert.notInclude({foo: obj1, bar: obj2}, {foo: obj1, bar: {b: 2}}); + * + * @name notInclude + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notInclude = function (exp, inc, msg) { + new Assertion(exp, msg, assert.notInclude, true).not.include(inc); + }; + + /** + * ### .deepInclude(haystack, needle, [message]) + * + * Asserts that `haystack` includes `needle`. Can be used to assert the + * inclusion of a value in an array or a subset of properties in an object. + * Deep equality is used. + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.deepInclude([obj1, obj2], {a: 1}); + * assert.deepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}}); + * assert.deepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}, bar: {b: 2}}); + * + * @name deepInclude + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.deepInclude = function (exp, inc, msg) { + new Assertion(exp, msg, assert.deepInclude, true).deep.include(inc); + }; + + /** + * ### .notDeepInclude(haystack, needle, [message]) + * + * Asserts that `haystack` does not include `needle`. Can be used to assert + * the absence of a value in an array or a subset of properties in an object. + * Deep equality is used. + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.notDeepInclude([obj1, obj2], {a: 9}); + * assert.notDeepInclude({foo: obj1, bar: obj2}, {foo: {a: 9}}); + * assert.notDeepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}, bar: {b: 9}}); + * + * @name notDeepInclude + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notDeepInclude = function (exp, inc, msg) { + new Assertion(exp, msg, assert.notDeepInclude, true).not.deep.include(inc); + }; + + /** + * ### .nestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'}); + * assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'}); + * + * @name nestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.nestedInclude = function (exp, inc, msg) { + new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc); + }; + + /** + * ### .notNestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' does not include 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.b': 'y'}); + * assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'}); + * + * @name notNestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notNestedInclude = function (exp, inc, msg) { + new Assertion(exp, msg, assert.notNestedInclude, true) + .not.nested.include(inc); + }; + + /** + * ### .deepNestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object while checking for deep equality. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}}); + * assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}}); + * + * @name deepNestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.deepNestedInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.deepNestedInclude, true) + .deep.nested.include(inc); + }; + + /** + * ### .notDeepNestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' does not include 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object while checking for deep equality. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}}) + * assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}}); + * + * @name notDeepNestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notDeepNestedInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.notDeepNestedInclude, true) + .not.deep.nested.include(inc); + }; + + /** + * ### .ownInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object while ignoring inherited properties. + * + * assert.ownInclude({ a: 1 }, { a: 1 }); + * + * @name ownInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.ownInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.ownInclude, true).own.include(inc); + }; + + /** + * ### .notOwnInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object while ignoring inherited properties. + * + * Object.prototype.b = 2; + * + * assert.notOwnInclude({ a: 1 }, { b: 2 }); + * + * @name notOwnInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notOwnInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.notOwnInclude, true).not.own.include(inc); + }; + + /** + * ### .deepOwnInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object while ignoring inherited properties and checking for deep equality. + * + * assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}}); + * + * @name deepOwnInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.deepOwnInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.deepOwnInclude, true) + .deep.own.include(inc); + }; + + /** + * ### .notDeepOwnInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object while ignoring inherited properties and checking for deep equality. + * + * assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}}); + * + * @name notDeepOwnInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notDeepOwnInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.notDeepOwnInclude, true) + .not.deep.own.include(inc); + }; + + /** + * ### .match(value, regexp, [message]) + * + * Asserts that `value` matches the regular expression `regexp`. + * + * assert.match('foobar', /^foo/, 'regexp matches'); + * + * @name match + * @param {Mixed} value + * @param {RegExp} regexp + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.match = function (exp, re, msg) { + new Assertion(exp, msg, assert.match, true).to.match(re); + }; + + /** + * ### .notMatch(value, regexp, [message]) + * + * Asserts that `value` does not match the regular expression `regexp`. + * + * assert.notMatch('foobar', /^foo/, 'regexp does not match'); + * + * @name notMatch + * @param {Mixed} value + * @param {RegExp} regexp + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notMatch = function (exp, re, msg) { + new Assertion(exp, msg, assert.notMatch, true).to.not.match(re); + }; + + /** + * ### .property(object, property, [message]) + * + * Asserts that `object` has a direct or inherited property named by + * `property`. + * + * assert.property({ tea: { green: 'matcha' }}, 'tea'); + * assert.property({ tea: { green: 'matcha' }}, 'toString'); + * + * @name property + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.property = function (obj, prop, msg) { + new Assertion(obj, msg, assert.property, true).to.have.property(prop); + }; + + /** + * ### .notProperty(object, property, [message]) + * + * Asserts that `object` does _not_ have a direct or inherited property named + * by `property`. + * + * assert.notProperty({ tea: { green: 'matcha' }}, 'coffee'); + * + * @name notProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notProperty = function (obj, prop, msg) { + new Assertion(obj, msg, assert.notProperty, true) + .to.not.have.property(prop); + }; + + /** + * ### .propertyVal(object, property, value, [message]) + * + * Asserts that `object` has a direct or inherited property named by + * `property` with a value given by `value`. Uses a strict equality check + * (===). + * + * assert.propertyVal({ tea: 'is good' }, 'tea', 'is good'); + * + * @name propertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.propertyVal = function (obj, prop, val, msg) { + new Assertion(obj, msg, assert.propertyVal, true) + .to.have.property(prop, val); + }; + + /** + * ### .notPropertyVal(object, property, value, [message]) + * + * Asserts that `object` does _not_ have a direct or inherited property named + * by `property` with value given by `value`. Uses a strict equality check + * (===). + * + * assert.notPropertyVal({ tea: 'is good' }, 'tea', 'is bad'); + * assert.notPropertyVal({ tea: 'is good' }, 'coffee', 'is good'); + * + * @name notPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notPropertyVal = function (obj, prop, val, msg) { + new Assertion(obj, msg, assert.notPropertyVal, true) + .to.not.have.property(prop, val); + }; + + /** + * ### .deepPropertyVal(object, property, value, [message]) + * + * Asserts that `object` has a direct or inherited property named by + * `property` with a value given by `value`. Uses a deep equality check. + * + * assert.deepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'matcha' }); + * + * @name deepPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.deepPropertyVal = function (obj, prop, val, msg) { + new Assertion(obj, msg, assert.deepPropertyVal, true) + .to.have.deep.property(prop, val); + }; + + /** + * ### .notDeepPropertyVal(object, property, value, [message]) + * + * Asserts that `object` does _not_ have a direct or inherited property named + * by `property` with value given by `value`. Uses a deep equality check. + * + * assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { black: 'matcha' }); + * assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'oolong' }); + * assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'coffee', { green: 'matcha' }); + * + * @name notDeepPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notDeepPropertyVal = function (obj, prop, val, msg) { + new Assertion(obj, msg, assert.notDeepPropertyVal, true) + .to.not.have.deep.property(prop, val); + }; + + /** + * ### .ownProperty(object, property, [message]) + * + * Asserts that `object` has a direct property named by `property`. Inherited + * properties aren't checked. + * + * assert.ownProperty({ tea: { green: 'matcha' }}, 'tea'); + * + * @name ownProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @api public + */ + + assert.ownProperty = function (obj, prop, msg) { + new Assertion(obj, msg, assert.ownProperty, true) + .to.have.own.property(prop); + }; + + /** + * ### .notOwnProperty(object, property, [message]) + * + * Asserts that `object` does _not_ have a direct property named by + * `property`. Inherited properties aren't checked. + * + * assert.notOwnProperty({ tea: { green: 'matcha' }}, 'coffee'); + * assert.notOwnProperty({}, 'toString'); + * + * @name notOwnProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @api public + */ + + assert.notOwnProperty = function (obj, prop, msg) { + new Assertion(obj, msg, assert.notOwnProperty, true) + .to.not.have.own.property(prop); + }; + + /** + * ### .ownPropertyVal(object, property, value, [message]) + * + * Asserts that `object` has a direct property named by `property` and a value + * equal to the provided `value`. Uses a strict equality check (===). + * Inherited properties aren't checked. + * + * assert.ownPropertyVal({ coffee: 'is good'}, 'coffee', 'is good'); + * + * @name ownPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */ + + assert.ownPropertyVal = function (obj, prop, value, msg) { + new Assertion(obj, msg, assert.ownPropertyVal, true) + .to.have.own.property(prop, value); + }; + + /** + * ### .notOwnPropertyVal(object, property, value, [message]) + * + * Asserts that `object` does _not_ have a direct property named by `property` + * with a value equal to the provided `value`. Uses a strict equality check + * (===). Inherited properties aren't checked. + * + * assert.notOwnPropertyVal({ tea: 'is better'}, 'tea', 'is worse'); + * assert.notOwnPropertyVal({}, 'toString', Object.prototype.toString); + * + * @name notOwnPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */ + + assert.notOwnPropertyVal = function (obj, prop, value, msg) { + new Assertion(obj, msg, assert.notOwnPropertyVal, true) + .to.not.have.own.property(prop, value); + }; + + /** + * ### .deepOwnPropertyVal(object, property, value, [message]) + * + * Asserts that `object` has a direct property named by `property` and a value + * equal to the provided `value`. Uses a deep equality check. Inherited + * properties aren't checked. + * + * assert.deepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'matcha' }); + * + * @name deepOwnPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */ + + assert.deepOwnPropertyVal = function (obj, prop, value, msg) { + new Assertion(obj, msg, assert.deepOwnPropertyVal, true) + .to.have.deep.own.property(prop, value); + }; + + /** + * ### .notDeepOwnPropertyVal(object, property, value, [message]) + * + * Asserts that `object` does _not_ have a direct property named by `property` + * with a value equal to the provided `value`. Uses a deep equality check. + * Inherited properties aren't checked. + * + * assert.notDeepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { black: 'matcha' }); + * assert.notDeepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'oolong' }); + * assert.notDeepOwnPropertyVal({ tea: { green: 'matcha' } }, 'coffee', { green: 'matcha' }); + * assert.notDeepOwnPropertyVal({}, 'toString', Object.prototype.toString); + * + * @name notDeepOwnPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */ + + assert.notDeepOwnPropertyVal = function (obj, prop, value, msg) { + new Assertion(obj, msg, assert.notDeepOwnPropertyVal, true) + .to.not.have.deep.own.property(prop, value); + }; + + /** + * ### .nestedProperty(object, property, [message]) + * + * Asserts that `object` has a direct or inherited property named by + * `property`, which can be a string using dot- and bracket-notation for + * nested reference. + * + * assert.nestedProperty({ tea: { green: 'matcha' }}, 'tea.green'); + * + * @name nestedProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.nestedProperty = function (obj, prop, msg) { + new Assertion(obj, msg, assert.nestedProperty, true) + .to.have.nested.property(prop); + }; + + /** + * ### .notNestedProperty(object, property, [message]) + * + * Asserts that `object` does _not_ have a property named by `property`, which + * can be a string using dot- and bracket-notation for nested reference. The + * property cannot exist on the object nor anywhere in its prototype chain. + * + * assert.notNestedProperty({ tea: { green: 'matcha' }}, 'tea.oolong'); + * + * @name notNestedProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notNestedProperty = function (obj, prop, msg) { + new Assertion(obj, msg, assert.notNestedProperty, true) + .to.not.have.nested.property(prop); + }; + + /** + * ### .nestedPropertyVal(object, property, value, [message]) + * + * Asserts that `object` has a property named by `property` with value given + * by `value`. `property` can use dot- and bracket-notation for nested + * reference. Uses a strict equality check (===). + * + * assert.nestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha'); + * + * @name nestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.nestedPropertyVal = function (obj, prop, val, msg) { + new Assertion(obj, msg, assert.nestedPropertyVal, true) + .to.have.nested.property(prop, val); + }; + + /** + * ### .notNestedPropertyVal(object, property, value, [message]) + * + * Asserts that `object` does _not_ have a property named by `property` with + * value given by `value`. `property` can use dot- and bracket-notation for + * nested reference. Uses a strict equality check (===). + * + * assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha'); + * assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'coffee.green', 'matcha'); + * + * @name notNestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notNestedPropertyVal = function (obj, prop, val, msg) { + new Assertion(obj, msg, assert.notNestedPropertyVal, true) + .to.not.have.nested.property(prop, val); + }; + + /** + * ### .deepNestedPropertyVal(object, property, value, [message]) + * + * Asserts that `object` has a property named by `property` with a value given + * by `value`. `property` can use dot- and bracket-notation for nested + * reference. Uses a deep equality check. + * + * assert.deepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yum' }); + * + * @name deepNestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.deepNestedPropertyVal = function (obj, prop, val, msg) { + new Assertion(obj, msg, assert.deepNestedPropertyVal, true) + .to.have.deep.nested.property(prop, val); + }; + + /** + * ### .notDeepNestedPropertyVal(object, property, value, [message]) + * + * Asserts that `object` does _not_ have a property named by `property` with + * value given by `value`. `property` can use dot- and bracket-notation for + * nested reference. Uses a deep equality check. + * + * assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { oolong: 'yum' }); + * assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yuck' }); + * assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.black', { matcha: 'yum' }); + * + * @name notDeepNestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notDeepNestedPropertyVal = function (obj, prop, val, msg) { + new Assertion(obj, msg, assert.notDeepNestedPropertyVal, true) + .to.not.have.deep.nested.property(prop, val); + }; + + /** + * ### .lengthOf(object, length, [message]) + * + * Asserts that `object` has a `length` or `size` with the expected value. + * + * assert.lengthOf([1,2,3], 3, 'array has length of 3'); + * assert.lengthOf('foobar', 6, 'string has length of 6'); + * assert.lengthOf(new Set([1,2,3]), 3, 'set has size of 3'); + * assert.lengthOf(new Map([['a',1],['b',2],['c',3]]), 3, 'map has size of 3'); + * + * @name lengthOf + * @param {Mixed} object + * @param {Number} length + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.lengthOf = function (exp, len, msg) { + new Assertion(exp, msg, assert.lengthOf, true).to.have.lengthOf(len); + }; + + /** + * ### .hasAnyKeys(object, [keys], [message]) + * + * Asserts that `object` has at least one of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'iDontExist', 'baz']); + * assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, iDontExist: 99, baz: 1337}); + * assert.hasAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + * assert.hasAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); + * + * @name hasAnyKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.hasAnyKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.hasAnyKeys, true).to.have.any.keys(keys); + }; + + /** + * ### .hasAllKeys(object, [keys], [message]) + * + * Asserts that `object` has all and only all of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + * assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337]); + * assert.hasAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + * assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']); + * + * @name hasAllKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.hasAllKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.hasAllKeys, true).to.have.all.keys(keys); + }; + + /** + * ### .containsAllKeys(object, [keys], [message]) + * + * Asserts that `object` has all of the `keys` provided but may have more keys not listed. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'baz']); + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, baz: 1337}); + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337}); + * assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}]); + * assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + * assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}]); + * assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']); + * + * @name containsAllKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.containsAllKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.containsAllKeys, true) + .to.contain.all.keys(keys); + }; + + /** + * ### .doesNotHaveAnyKeys(object, [keys], [message]) + * + * Asserts that `object` has none of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + * assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + * assert.doesNotHaveAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + * assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']); + * + * @name doesNotHaveAnyKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.doesNotHaveAnyKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.doesNotHaveAnyKeys, true) + .to.not.have.any.keys(keys); + }; + + /** + * ### .doesNotHaveAllKeys(object, [keys], [message]) + * + * Asserts that `object` does not have at least one of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + * assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + * assert.doesNotHaveAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + * assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']); + * + * @name doesNotHaveAllKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.doesNotHaveAllKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.doesNotHaveAllKeys, true) + .to.not.have.all.keys(keys); + }; + + /** + * ### .hasAnyDeepKeys(object, [keys], [message]) + * + * Asserts that `object` has at least one of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + * assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), [{one: 'one'}, {two: 'two'}]); + * assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {three: 'three'}]); + * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + * + * @name hasAnyDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.hasAnyDeepKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.hasAnyDeepKeys, true) + .to.have.any.deep.keys(keys); + }; + + /** + * ### .hasAllDeepKeys(object, [keys], [message]) + * + * Asserts that `object` has all and only all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne']]), {one: 'one'}); + * assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + * assert.hasAllDeepKeys(new Set([{one: 'one'}]), {one: 'one'}); + * assert.hasAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + * + * @name hasAllDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.hasAllDeepKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.hasAllDeepKeys, true) + .to.have.all.deep.keys(keys); + }; + + /** + * ### .containsAllDeepKeys(object, [keys], [message]) + * + * Asserts that `object` contains all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + * assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + * assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + * assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + * + * @name containsAllDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.containsAllDeepKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.containsAllDeepKeys, true) + .to.contain.all.deep.keys(keys); + }; + + /** + * ### .doesNotHaveAnyDeepKeys(object, [keys], [message]) + * + * Asserts that `object` has none of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + * assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + * assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + * assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + * + * @name doesNotHaveAnyDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.doesNotHaveAnyDeepKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.doesNotHaveAnyDeepKeys, true) + .to.not.have.any.deep.keys(keys); + }; + + /** + * ### .doesNotHaveAllDeepKeys(object, [keys], [message]) + * + * Asserts that `object` does not have at least one of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + * assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {one: 'one'}]); + * assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + * assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {fifty: 'fifty'}]); + * + * @name doesNotHaveAllDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.doesNotHaveAllDeepKeys = function (obj, keys, msg) { + new Assertion(obj, msg, assert.doesNotHaveAllDeepKeys, true) + .to.not.have.all.deep.keys(keys); + }; + + /** + * ### .throws(fn, [errorLike/string/regexp], [string/regexp], [message]) + * + * If `errorLike` is an `Error` constructor, asserts that `fn` will throw an error that is an + * instance of `errorLike`. + * If `errorLike` is an `Error` instance, asserts that the error thrown is the same + * instance as `errorLike`. + * If `errMsgMatcher` is provided, it also asserts that the error thrown will have a + * message matching `errMsgMatcher`. + * + * assert.throws(fn, 'Error thrown must have this msg'); + * assert.throws(fn, /Error thrown must have a msg that matches this/); + * assert.throws(fn, ReferenceError); + * assert.throws(fn, errorInstance); + * assert.throws(fn, ReferenceError, 'Error thrown must be a ReferenceError and have this msg'); + * assert.throws(fn, errorInstance, 'Error thrown must be the same errorInstance and have this msg'); + * assert.throws(fn, ReferenceError, /Error thrown must be a ReferenceError and match this/); + * assert.throws(fn, errorInstance, /Error thrown must be the same errorInstance and match this/); + * + * @name throws + * @alias throw + * @alias Throw + * @param {Function} fn + * @param {ErrorConstructor|Error} errorLike + * @param {RegExp|String} errMsgMatcher + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Assert + * @api public + */ + + assert.throws = function (fn, errorLike, errMsgMatcher, msg) { + if ('string' === typeof errorLike || errorLike instanceof RegExp) { + errMsgMatcher = errorLike; + errorLike = null; + } + + var assertErr = new Assertion(fn, msg, assert.throws, true) + .to.throw(errorLike, errMsgMatcher); + return flag(assertErr, 'object'); + }; + + /** + * ### .doesNotThrow(fn, [errorLike/string/regexp], [string/regexp], [message]) + * + * If `errorLike` is an `Error` constructor, asserts that `fn` will _not_ throw an error that is an + * instance of `errorLike`. + * If `errorLike` is an `Error` instance, asserts that the error thrown is _not_ the same + * instance as `errorLike`. + * If `errMsgMatcher` is provided, it also asserts that the error thrown will _not_ have a + * message matching `errMsgMatcher`. + * + * assert.doesNotThrow(fn, 'Any Error thrown must not have this message'); + * assert.doesNotThrow(fn, /Any Error thrown must not match this/); + * assert.doesNotThrow(fn, Error); + * assert.doesNotThrow(fn, errorInstance); + * assert.doesNotThrow(fn, Error, 'Error must not have this message'); + * assert.doesNotThrow(fn, errorInstance, 'Error must not have this message'); + * assert.doesNotThrow(fn, Error, /Error must not match this/); + * assert.doesNotThrow(fn, errorInstance, /Error must not match this/); + * + * @name doesNotThrow + * @param {Function} fn + * @param {ErrorConstructor} errorLike + * @param {RegExp|String} errMsgMatcher + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Assert + * @api public + */ + + assert.doesNotThrow = function (fn, errorLike, errMsgMatcher, msg) { + if ('string' === typeof errorLike || errorLike instanceof RegExp) { + errMsgMatcher = errorLike; + errorLike = null; + } + + new Assertion(fn, msg, assert.doesNotThrow, true) + .to.not.throw(errorLike, errMsgMatcher); + }; + + /** + * ### .operator(val1, operator, val2, [message]) + * + * Compares two values using `operator`. + * + * assert.operator(1, '<', 2, 'everything is ok'); + * assert.operator(1, '>', 2, 'this will fail'); + * + * @name operator + * @param {Mixed} val1 + * @param {String} operator + * @param {Mixed} val2 + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.operator = function (val, operator, val2, msg) { + var ok; + switch(operator) { + case '==': + ok = val == val2; + break; + case '===': + ok = val === val2; + break; + case '>': + ok = val > val2; + break; + case '>=': + ok = val >= val2; + break; + case '<': + ok = val < val2; + break; + case '<=': + ok = val <= val2; + break; + case '!=': + ok = val != val2; + break; + case '!==': + ok = val !== val2; + break; + default: + msg = msg ? msg + ': ' : msg; + throw new chai.AssertionError( + msg + 'Invalid operator "' + operator + '"', + undefined, + assert.operator + ); + } + var test = new Assertion(ok, msg, assert.operator, true); + test.assert( + true === flag(test, 'object') + , 'expected ' + util.inspect(val) + ' to be ' + operator + ' ' + util.inspect(val2) + , 'expected ' + util.inspect(val) + ' to not be ' + operator + ' ' + util.inspect(val2) ); + }; + + /** + * ### .closeTo(actual, expected, delta, [message]) + * + * Asserts that the target is equal `expected`, to within a +/- `delta` range. + * + * assert.closeTo(1.5, 1, 0.5, 'numbers are close'); + * + * @name closeTo + * @param {Number} actual + * @param {Number} expected + * @param {Number} delta + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.closeTo = function (act, exp, delta, msg) { + new Assertion(act, msg, assert.closeTo, true).to.be.closeTo(exp, delta); + }; + + /** + * ### .approximately(actual, expected, delta, [message]) + * + * Asserts that the target is equal `expected`, to within a +/- `delta` range. + * + * assert.approximately(1.5, 1, 0.5, 'numbers are close'); + * + * @name approximately + * @param {Number} actual + * @param {Number} expected + * @param {Number} delta + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.approximately = function (act, exp, delta, msg) { + new Assertion(act, msg, assert.approximately, true) + .to.be.approximately(exp, delta); + }; + + /** + * ### .sameMembers(set1, set2, [message]) + * + * Asserts that `set1` and `set2` have the same members in any order. Uses a + * strict equality check (===). + * + * assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members'); + * + * @name sameMembers + * @param {Array} set1 + * @param {Array} set2 + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.sameMembers = function (set1, set2, msg) { + new Assertion(set1, msg, assert.sameMembers, true) + .to.have.same.members(set2); + }; + + /** + * ### .notSameMembers(set1, set2, [message]) + * + * Asserts that `set1` and `set2` don't have the same members in any order. + * Uses a strict equality check (===). + * + * assert.notSameMembers([ 1, 2, 3 ], [ 5, 1, 3 ], 'not same members'); + * + * @name notSameMembers + * @param {Array} set1 + * @param {Array} set2 + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notSameMembers = function (set1, set2, msg) { + new Assertion(set1, msg, assert.notSameMembers, true) + .to.not.have.same.members(set2); + }; + + /** + * ### .sameDeepMembers(set1, set2, [message]) + * + * Asserts that `set1` and `set2` have the same members in any order. Uses a + * deep equality check. + * + * assert.sameDeepMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [{ b: 2 }, { a: 1 }, { c: 3 }], 'same deep members'); + * + * @name sameDeepMembers + * @param {Array} set1 + * @param {Array} set2 + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.sameDeepMembers = function (set1, set2, msg) { + new Assertion(set1, msg, assert.sameDeepMembers, true) + .to.have.same.deep.members(set2); + }; + + /** + * ### .notSameDeepMembers(set1, set2, [message]) + * + * Asserts that `set1` and `set2` don't have the same members in any order. + * Uses a deep equality check. + * + * assert.notSameDeepMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [{ b: 2 }, { a: 1 }, { f: 5 }], 'not same deep members'); + * + * @name notSameDeepMembers + * @param {Array} set1 + * @param {Array} set2 + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notSameDeepMembers = function (set1, set2, msg) { + new Assertion(set1, msg, assert.notSameDeepMembers, true) + .to.not.have.same.deep.members(set2); + }; + + /** + * ### .sameOrderedMembers(set1, set2, [message]) + * + * Asserts that `set1` and `set2` have the same members in the same order. + * Uses a strict equality check (===). + * + * assert.sameOrderedMembers([ 1, 2, 3 ], [ 1, 2, 3 ], 'same ordered members'); + * + * @name sameOrderedMembers + * @param {Array} set1 + * @param {Array} set2 + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.sameOrderedMembers = function (set1, set2, msg) { + new Assertion(set1, msg, assert.sameOrderedMembers, true) + .to.have.same.ordered.members(set2); + }; + + /** + * ### .notSameOrderedMembers(set1, set2, [message]) + * + * Asserts that `set1` and `set2` don't have the same members in the same + * order. Uses a strict equality check (===). + * + * assert.notSameOrderedMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'not same ordered members'); + * + * @name notSameOrderedMembers + * @param {Array} set1 + * @param {Array} set2 + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notSameOrderedMembers = function (set1, set2, msg) { + new Assertion(set1, msg, assert.notSameOrderedMembers, true) + .to.not.have.same.ordered.members(set2); + }; + + /** + * ### .sameDeepOrderedMembers(set1, set2, [message]) + * + * Asserts that `set1` and `set2` have the same members in the same order. + * Uses a deep equality check. + * + * assert.sameDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { a: 1 }, { b: 2 }, { c: 3 } ], 'same deep ordered members'); + * + * @name sameDeepOrderedMembers + * @param {Array} set1 + * @param {Array} set2 + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.sameDeepOrderedMembers = function (set1, set2, msg) { + new Assertion(set1, msg, assert.sameDeepOrderedMembers, true) + .to.have.same.deep.ordered.members(set2); + }; + + /** + * ### .notSameDeepOrderedMembers(set1, set2, [message]) + * + * Asserts that `set1` and `set2` don't have the same members in the same + * order. Uses a deep equality check. + * + * assert.notSameDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { a: 1 }, { b: 2 }, { z: 5 } ], 'not same deep ordered members'); + * assert.notSameDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { b: 2 }, { a: 1 }, { c: 3 } ], 'not same deep ordered members'); + * + * @name notSameDeepOrderedMembers + * @param {Array} set1 + * @param {Array} set2 + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notSameDeepOrderedMembers = function (set1, set2, msg) { + new Assertion(set1, msg, assert.notSameDeepOrderedMembers, true) + .to.not.have.same.deep.ordered.members(set2); + }; + + /** + * ### .includeMembers(superset, subset, [message]) + * + * Asserts that `subset` is included in `superset` in any order. Uses a + * strict equality check (===). Duplicates are ignored. + * + * assert.includeMembers([ 1, 2, 3 ], [ 2, 1, 2 ], 'include members'); + * + * @name includeMembers + * @param {Array} superset + * @param {Array} subset + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.includeMembers = function (superset, subset, msg) { + new Assertion(superset, msg, assert.includeMembers, true) + .to.include.members(subset); + }; + + /** + * ### .notIncludeMembers(superset, subset, [message]) + * + * Asserts that `subset` isn't included in `superset` in any order. Uses a + * strict equality check (===). Duplicates are ignored. + * + * assert.notIncludeMembers([ 1, 2, 3 ], [ 5, 1 ], 'not include members'); + * + * @name notIncludeMembers + * @param {Array} superset + * @param {Array} subset + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notIncludeMembers = function (superset, subset, msg) { + new Assertion(superset, msg, assert.notIncludeMembers, true) + .to.not.include.members(subset); + }; + + /** + * ### .includeDeepMembers(superset, subset, [message]) + * + * Asserts that `subset` is included in `superset` in any order. Uses a deep + * equality check. Duplicates are ignored. + * + * assert.includeDeepMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { b: 2 }, { a: 1 }, { b: 2 } ], 'include deep members'); + * + * @name includeDeepMembers + * @param {Array} superset + * @param {Array} subset + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.includeDeepMembers = function (superset, subset, msg) { + new Assertion(superset, msg, assert.includeDeepMembers, true) + .to.include.deep.members(subset); + }; + + /** + * ### .notIncludeDeepMembers(superset, subset, [message]) + * + * Asserts that `subset` isn't included in `superset` in any order. Uses a + * deep equality check. Duplicates are ignored. + * + * assert.notIncludeDeepMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { b: 2 }, { f: 5 } ], 'not include deep members'); + * + * @name notIncludeDeepMembers + * @param {Array} superset + * @param {Array} subset + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notIncludeDeepMembers = function (superset, subset, msg) { + new Assertion(superset, msg, assert.notIncludeDeepMembers, true) + .to.not.include.deep.members(subset); + }; + + /** + * ### .includeOrderedMembers(superset, subset, [message]) + * + * Asserts that `subset` is included in `superset` in the same order + * beginning with the first element in `superset`. Uses a strict equality + * check (===). + * + * assert.includeOrderedMembers([ 1, 2, 3 ], [ 1, 2 ], 'include ordered members'); + * + * @name includeOrderedMembers + * @param {Array} superset + * @param {Array} subset + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.includeOrderedMembers = function (superset, subset, msg) { + new Assertion(superset, msg, assert.includeOrderedMembers, true) + .to.include.ordered.members(subset); + }; + + /** + * ### .notIncludeOrderedMembers(superset, subset, [message]) + * + * Asserts that `subset` isn't included in `superset` in the same order + * beginning with the first element in `superset`. Uses a strict equality + * check (===). + * + * assert.notIncludeOrderedMembers([ 1, 2, 3 ], [ 2, 1 ], 'not include ordered members'); + * assert.notIncludeOrderedMembers([ 1, 2, 3 ], [ 2, 3 ], 'not include ordered members'); + * + * @name notIncludeOrderedMembers + * @param {Array} superset + * @param {Array} subset + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notIncludeOrderedMembers = function (superset, subset, msg) { + new Assertion(superset, msg, assert.notIncludeOrderedMembers, true) + .to.not.include.ordered.members(subset); + }; + + /** + * ### .includeDeepOrderedMembers(superset, subset, [message]) + * + * Asserts that `subset` is included in `superset` in the same order + * beginning with the first element in `superset`. Uses a deep equality + * check. + * + * assert.includeDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { a: 1 }, { b: 2 } ], 'include deep ordered members'); + * + * @name includeDeepOrderedMembers + * @param {Array} superset + * @param {Array} subset + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.includeDeepOrderedMembers = function (superset, subset, msg) { + new Assertion(superset, msg, assert.includeDeepOrderedMembers, true) + .to.include.deep.ordered.members(subset); + }; + + /** + * ### .notIncludeDeepOrderedMembers(superset, subset, [message]) + * + * Asserts that `subset` isn't included in `superset` in the same order + * beginning with the first element in `superset`. Uses a deep equality + * check. + * + * assert.notIncludeDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { a: 1 }, { f: 5 } ], 'not include deep ordered members'); + * assert.notIncludeDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { b: 2 }, { a: 1 } ], 'not include deep ordered members'); + * assert.notIncludeDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { b: 2 }, { c: 3 } ], 'not include deep ordered members'); + * + * @name notIncludeDeepOrderedMembers + * @param {Array} superset + * @param {Array} subset + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.notIncludeDeepOrderedMembers = function (superset, subset, msg) { + new Assertion(superset, msg, assert.notIncludeDeepOrderedMembers, true) + .to.not.include.deep.ordered.members(subset); + }; + + /** + * ### .oneOf(inList, list, [message]) + * + * Asserts that non-object, non-array value `inList` appears in the flat array `list`. + * + * assert.oneOf(1, [ 2, 1 ], 'Not found in list'); + * + * @name oneOf + * @param {*} inList + * @param {Array<*>} list + * @param {String} message + * @namespace Assert + * @api public + */ + + assert.oneOf = function (inList, list, msg) { + new Assertion(inList, msg, assert.oneOf, true).to.be.oneOf(list); + }; + + /** + * ### .changes(function, object, property, [message]) + * + * Asserts that a function changes the value of a property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 22 }; + * assert.changes(fn, obj, 'val'); + * + * @name changes + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.changes = function (fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === 'function') { + msg = prop; + prop = null; + } + + new Assertion(fn, msg, assert.changes, true).to.change(obj, prop); + }; + + /** + * ### .changesBy(function, object, property, delta, [message]) + * + * Asserts that a function changes the value of a property by an amount (delta). + * + * var obj = { val: 10 }; + * var fn = function() { obj.val += 2 }; + * assert.changesBy(fn, obj, 'val', 2); + * + * @name changesBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.changesBy = function (fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === 'function') { + var tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + + new Assertion(fn, msg, assert.changesBy, true) + .to.change(obj, prop).by(delta); + }; + + /** + * ### .doesNotChange(function, object, property, [message]) + * + * Asserts that a function does not change the value of a property. + * + * var obj = { val: 10 }; + * var fn = function() { console.log('foo'); }; + * assert.doesNotChange(fn, obj, 'val'); + * + * @name doesNotChange + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.doesNotChange = function (fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === 'function') { + msg = prop; + prop = null; + } + + return new Assertion(fn, msg, assert.doesNotChange, true) + .to.not.change(obj, prop); + }; + + /** + * ### .changesButNotBy(function, object, property, delta, [message]) + * + * Asserts that a function does not change the value of a property or of a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val += 10 }; + * assert.changesButNotBy(fn, obj, 'val', 5); + * + * @name changesButNotBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.changesButNotBy = function (fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === 'function') { + var tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + + new Assertion(fn, msg, assert.changesButNotBy, true) + .to.change(obj, prop).but.not.by(delta); + }; + + /** + * ### .increases(function, object, property, [message]) + * + * Asserts that a function increases a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 13 }; + * assert.increases(fn, obj, 'val'); + * + * @name increases + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.increases = function (fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === 'function') { + msg = prop; + prop = null; + } + + return new Assertion(fn, msg, assert.increases, true) + .to.increase(obj, prop); + }; + + /** + * ### .increasesBy(function, object, property, delta, [message]) + * + * Asserts that a function increases a numeric object property or a function's return value by an amount (delta). + * + * var obj = { val: 10 }; + * var fn = function() { obj.val += 10 }; + * assert.increasesBy(fn, obj, 'val', 10); + * + * @name increasesBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.increasesBy = function (fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === 'function') { + var tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + + new Assertion(fn, msg, assert.increasesBy, true) + .to.increase(obj, prop).by(delta); + }; + + /** + * ### .doesNotIncrease(function, object, property, [message]) + * + * Asserts that a function does not increase a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 8 }; + * assert.doesNotIncrease(fn, obj, 'val'); + * + * @name doesNotIncrease + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.doesNotIncrease = function (fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === 'function') { + msg = prop; + prop = null; + } + + return new Assertion(fn, msg, assert.doesNotIncrease, true) + .to.not.increase(obj, prop); + }; + + /** + * ### .increasesButNotBy(function, object, property, delta, [message]) + * + * Asserts that a function does not increase a numeric object property or function's return value by an amount (delta). + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 15 }; + * assert.increasesButNotBy(fn, obj, 'val', 10); + * + * @name increasesButNotBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.increasesButNotBy = function (fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === 'function') { + var tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + + new Assertion(fn, msg, assert.increasesButNotBy, true) + .to.increase(obj, prop).but.not.by(delta); + }; + + /** + * ### .decreases(function, object, property, [message]) + * + * Asserts that a function decreases a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 5 }; + * assert.decreases(fn, obj, 'val'); + * + * @name decreases + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.decreases = function (fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === 'function') { + msg = prop; + prop = null; + } + + return new Assertion(fn, msg, assert.decreases, true) + .to.decrease(obj, prop); + }; + + /** + * ### .decreasesBy(function, object, property, delta, [message]) + * + * Asserts that a function decreases a numeric object property or a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val -= 5 }; + * assert.decreasesBy(fn, obj, 'val', 5); + * + * @name decreasesBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.decreasesBy = function (fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === 'function') { + var tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + + new Assertion(fn, msg, assert.decreasesBy, true) + .to.decrease(obj, prop).by(delta); + }; + + /** + * ### .doesNotDecrease(function, object, property, [message]) + * + * Asserts that a function does not decreases a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 15 }; + * assert.doesNotDecrease(fn, obj, 'val'); + * + * @name doesNotDecrease + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.doesNotDecrease = function (fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === 'function') { + msg = prop; + prop = null; + } + + return new Assertion(fn, msg, assert.doesNotDecrease, true) + .to.not.decrease(obj, prop); + }; + + /** + * ### .doesNotDecreaseBy(function, object, property, delta, [message]) + * + * Asserts that a function does not decreases a numeric object property or a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 5 }; + * assert.doesNotDecreaseBy(fn, obj, 'val', 1); + * + * @name doesNotDecreaseBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.doesNotDecreaseBy = function (fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === 'function') { + var tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + + return new Assertion(fn, msg, assert.doesNotDecreaseBy, true) + .to.not.decrease(obj, prop).by(delta); + }; + + /** + * ### .decreasesButNotBy(function, object, property, delta, [message]) + * + * Asserts that a function does not decreases a numeric object property or a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 5 }; + * assert.decreasesButNotBy(fn, obj, 'val', 1); + * + * @name decreasesButNotBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.decreasesButNotBy = function (fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === 'function') { + var tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + + new Assertion(fn, msg, assert.decreasesButNotBy, true) + .to.decrease(obj, prop).but.not.by(delta); + }; + + /*! + * ### .ifError(object) + * + * Asserts if value is not a false value, and throws if it is a true value. + * This is added to allow for chai to be a drop-in replacement for Node's + * assert class. + * + * var err = new Error('I am a custom error'); + * assert.ifError(err); // Rethrows err! + * + * @name ifError + * @param {Object} object + * @namespace Assert + * @api public + */ + + assert.ifError = function (val) { + if (val) { + throw(val); + } + }; + + /** + * ### .isExtensible(object) + * + * Asserts that `object` is extensible (can have new properties added to it). + * + * assert.isExtensible({}); + * + * @name isExtensible + * @alias extensible + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.isExtensible = function (obj, msg) { + new Assertion(obj, msg, assert.isExtensible, true).to.be.extensible; + }; + + /** + * ### .isNotExtensible(object) + * + * Asserts that `object` is _not_ extensible. + * + * var nonExtensibleObject = Object.preventExtensions({}); + * var sealedObject = Object.seal({}); + * var frozenObject = Object.freeze({}); + * + * assert.isNotExtensible(nonExtensibleObject); + * assert.isNotExtensible(sealedObject); + * assert.isNotExtensible(frozenObject); + * + * @name isNotExtensible + * @alias notExtensible + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.isNotExtensible = function (obj, msg) { + new Assertion(obj, msg, assert.isNotExtensible, true).to.not.be.extensible; + }; + + /** + * ### .isSealed(object) + * + * Asserts that `object` is sealed (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * var sealedObject = Object.seal({}); + * var frozenObject = Object.seal({}); + * + * assert.isSealed(sealedObject); + * assert.isSealed(frozenObject); + * + * @name isSealed + * @alias sealed + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.isSealed = function (obj, msg) { + new Assertion(obj, msg, assert.isSealed, true).to.be.sealed; + }; + + /** + * ### .isNotSealed(object) + * + * Asserts that `object` is _not_ sealed. + * + * assert.isNotSealed({}); + * + * @name isNotSealed + * @alias notSealed + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.isNotSealed = function (obj, msg) { + new Assertion(obj, msg, assert.isNotSealed, true).to.not.be.sealed; + }; + + /** + * ### .isFrozen(object) + * + * Asserts that `object` is frozen (cannot have new properties added to it + * and its existing properties cannot be modified). + * + * var frozenObject = Object.freeze({}); + * assert.frozen(frozenObject); + * + * @name isFrozen + * @alias frozen + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.isFrozen = function (obj, msg) { + new Assertion(obj, msg, assert.isFrozen, true).to.be.frozen; + }; + + /** + * ### .isNotFrozen(object) + * + * Asserts that `object` is _not_ frozen. + * + * assert.isNotFrozen({}); + * + * @name isNotFrozen + * @alias notFrozen + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.isNotFrozen = function (obj, msg) { + new Assertion(obj, msg, assert.isNotFrozen, true).to.not.be.frozen; + }; + + /** + * ### .isEmpty(target) + * + * Asserts that the target does not contain any values. + * For arrays and strings, it checks the `length` property. + * For `Map` and `Set` instances, it checks the `size` property. + * For non-function objects, it gets the count of own + * enumerable string keys. + * + * assert.isEmpty([]); + * assert.isEmpty(''); + * assert.isEmpty(new Map); + * assert.isEmpty({}); + * + * @name isEmpty + * @alias empty + * @param {Object|Array|String|Map|Set} target + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.isEmpty = function(val, msg) { + new Assertion(val, msg, assert.isEmpty, true).to.be.empty; + }; + + /** + * ### .isNotEmpty(target) + * + * Asserts that the target contains values. + * For arrays and strings, it checks the `length` property. + * For `Map` and `Set` instances, it checks the `size` property. + * For non-function objects, it gets the count of own + * enumerable string keys. + * + * assert.isNotEmpty([1, 2]); + * assert.isNotEmpty('34'); + * assert.isNotEmpty(new Set([5, 6])); + * assert.isNotEmpty({ key: 7 }); + * + * @name isNotEmpty + * @alias notEmpty + * @param {Object|Array|String|Map|Set} target + * @param {String} message _optional_ + * @namespace Assert + * @api public + */ + + assert.isNotEmpty = function(val, msg) { + new Assertion(val, msg, assert.isNotEmpty, true).to.not.be.empty; + }; + + /*! + * Aliases. + */ + + (function alias(name, as){ + assert[as] = assert[name]; + return alias; + }) + ('isOk', 'ok') + ('isNotOk', 'notOk') + ('throws', 'throw') + ('throws', 'Throw') + ('isExtensible', 'extensible') + ('isNotExtensible', 'notExtensible') + ('isSealed', 'sealed') + ('isNotSealed', 'notSealed') + ('isFrozen', 'frozen') + ('isNotFrozen', 'notFrozen') + ('isEmpty', 'empty') + ('isNotEmpty', 'notEmpty'); + }; + + /*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */ + + var hasRequiredChai; + + function requireChai () { + if (hasRequiredChai) return chai; + hasRequiredChai = 1; + (function (exports) { + var used = []; + + /*! + * Chai version + */ + + exports.version = '4.3.3'; + + /*! + * Assertion Error + */ + + exports.AssertionError = assertionError; + + /*! + * Utils for plugins (not exported) + */ + + var util = requireUtils(); + + /** + * # .use(function) + * + * Provides a way to extend the internals of Chai. + * + * @param {Function} + * @returns {this} for chaining + * @api public + */ + + exports.use = function (fn) { + if (!~used.indexOf(fn)) { + fn(exports, util); + used.push(fn); + } + + return exports; + }; + + /*! + * Utility Functions + */ + + exports.util = util; + + /*! + * Configuration + */ + + var config = config$5; + exports.config = config; + + /*! + * Primary `Assertion` prototype + */ + + var assertion$1 = assertion; + exports.use(assertion$1); + + /*! + * Core Assertions + */ + + var core = assertions; + exports.use(core); + + /*! + * Expect interface + */ + + var expect$1 = expect; + exports.use(expect$1); + + /*! + * Should interface + */ + + var should$1 = should; + exports.use(should$1); + + /*! + * Assert interface + */ + + var assert$1 = assert; + exports.use(assert$1); + } (chai)); + return chai; + } + + (function (module) { + module.exports = requireChai(); + } (chai$1)); + + var index = /*@__PURE__*/getDefaultExportFromCjs(chai$1.exports); + + return index; + +})(); diff --git a/libs/code-demos/assets/runner/js/shim.js b/libs/code-demos/assets/runner/js/shim.js new file mode 100644 index 000000000..694ada712 --- /dev/null +++ b/libs/code-demos/assets/runner/js/shim.js @@ -0,0 +1,14 @@ +(function () { + 'use strict'; + + /** + * core-js 2.6.1 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2018 Denis Pushkarev + */ + !function(e,i,Jt){!function(r){var e={};function __webpack_require__(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=r,__webpack_require__.c=e,__webpack_require__.d=function(t,n,r){__webpack_require__.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r});},__webpack_require__.n=function(t){var n=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=129);}([function(t,n,r){var v=r(2),g=r(26),y=r(11),d=r(12),b=r(18),_="prototype",S=function(t,n,r){var e,i,o,u,c=t&S.F,a=t&S.G,f=t&S.P,s=t&S.B,l=a?v:t&S.S?v[n]||(v[n]={}):(v[n]||{})[_],h=a?g:g[n]||(g[n]={}),p=h[_]||(h[_]={});for(e in a&&(r=n),r)o=((i=!c&&l&&l[e]!==Jt)?l:r)[e],u=s&&i?b(o,v):f&&"function"==typeof o?b(Function.call,o):o,l&&d(l,e,o,t&S.U),h[e]!=o&&y(h,e,u),f&&p[e]!=o&&(p[e]=o);};v.core=g,S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128,t.exports=S;},function(t,n,r){var e=r(4);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t};},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof i&&(i=r);},function(t,n){t.exports=function(t){try{return !!t()}catch(n){return !0}};},function(t,n){t.exports=function(t){return "object"==typeof t?null!==t:"function"==typeof t};},function(t,n,r){var e=r(51)("wks"),i=r(33),o=r(2).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e;},function(t,n,r){var e=r(20),i=Math.min;t.exports=function(t){return 0"+i+""};t.exports=function(n,t){var r={};r[n]=t(o),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[f][u[r]];return s()};t.exports=Object.create||function create(t,n){var r;return null!==t?(a[f]=i(t),r=new a,a[f]=null,r[c]=t):r=s(),n===Jt?r:o(r,n)};},function(t,n,r){var e=r(95),i=r(69).concat("length","prototype");n.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return e(t,i)};},function(t,n,r){var e=r(2),i=r(8),o=r(7),u=r(5)("species");t.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}});};},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||e!==Jt&&e in t)throw TypeError(r+": incorrect invocation!");return t};},function(t,n,r){var h=r(18),p=r(108),v=r(81),g=r(1),y=r(6),d=r(83),b={},_={};(n=t.exports=function(t,n,r,e,i){var o,u,c,a,f=i?function(){return t}:d(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof f)throw TypeError(t+" is not iterable!");if(v(f)){for(o=y(t.length);l")}),d=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();t.exports=function(r,t,n){var e=p(r),o=!l(function(){var t={};return t[e]=function(){return 7},7!=""[r](t)}),i=o?!l(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===r&&(n.constructor={},n.constructor[g]=function(){return n}),n[e](""),!t}):Jt;if(!o||!i||"replace"===r&&!y||"split"===r&&!d){var u=/./[e],c=n(h,e,""[r],function maybeCallNative(t,n,r,e,i){return n.exec===v?o&&!i?{done:!0,value:u.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),a=c[1];f(String.prototype,r,c[0]),s(RegExp.prototype,e,2==t?function(t,n){return a.call(t,this,n)}:function(t){return a.call(t,this)});}};},function(t,n,r){var e=r(2).navigator;t.exports=e&&e.userAgent||"";},function(t,n,r){var d=r(2),b=r(0),_=r(12),S=r(41),x=r(29),m=r(40),w=r(39),E=r(4),O=r(3),M=r(57),I=r(42),P=r(72);t.exports=function(e,t,n,r,i,o){var u=d[e],c=u,a=i?"set":"add",f=c&&c.prototype,s={},l=function(t){var r=f[t];_(f,t,"delete"==t?function(t){return !(o&&!E(t))&&r.call(this,0===t?0:t)}:"has"==t?function has(t){return !(o&&!E(t))&&r.call(this,0===t?0:t)}:"get"==t?function get(t){return o&&!E(t)?Jt:r.call(this,0===t?0:t)}:"add"==t?function add(t){return r.call(this,0===t?0:t),this}:function set(t,n){return r.call(this,0===t?0:t,n),this});};if("function"==typeof c&&(o||f.forEach&&!O(function(){(new c).entries().next();}))){var h=new c,p=h[a](o?{}:-0,1)!=h,v=O(function(){h.has(1);}),g=M(function(t){new c(t);}),y=!o&&O(function(){for(var t=new c,n=5;n--;)t[a](n,n);return !t.has(-0)});g||(((c=t(function(t,n){w(t,c,e);var r=P(new u,t,c);return n!=Jt&&m(n,i,r[a],r),r})).prototype=f).constructor=c),(v||y)&&(l("delete"),l("has"),i&&l("get")),(y||p)&&l(a),o&&f.clear&&delete f.clear;}else c=r.getConstructor(t,e,i,a),S(c.prototype,n),x.NEED=!0;return I(c,e),b(b.G+b.W+b.F*((s[e]=c)!=u),s),o||r.setStrong(c,e,i),c};},function(t,n,r){for(var e,i=r(2),o=r(11),u=r(33),c=u("typed_array"),a=u("view"),f=!(!i.ArrayBuffer||!i.DataView),s=f,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(e=i[h[l++]])?(o(e.prototype,c,!0),o(e.prototype,a,!0)):s=!1;t.exports={ABV:f,CONSTR:s,TYPED:c,VIEW:a};},function(t,n,r){t.exports=r(30)||!r(3)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete r(2)[t];});},function(t,n,r){var e=r(0);t.exports=function(t){e(e.S,t,{of:function of(){for(var t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return new this(n)}});};},function(t,n,r){var e=r(0),u=r(10),c=r(18),a=r(40);t.exports=function(t){e(e.S,t,{from:function from(t){var n,r,e,i,o=arguments[1];return u(this),(n=o!==Jt)&&u(o),t==Jt?new this:(r=[],n?(e=0,i=c(o,arguments[2],2),a(t,!1,function(t){r.push(i(t,e++));})):a(t,!1,r.push,r),new this(r))}});};},function(t,n,r){var e=r(4),i=r(2).document,o=e(i)&&e(i.createElement);t.exports=function(t){return o?i.createElement(t):{}};},function(t,n,r){var e=r(2),i=r(26),o=r(30),u=r(94),c=r(8).f;t.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)});};},function(t,n,r){var e=r(51)("keys"),i=r(33);t.exports=function(t){return e[t]||(e[t]=i(t))};},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},function(t,n,r){var e=r(2).document;t.exports=e&&e.documentElement;},function(t,n,i){var r=i(4),e=i(1),o=function(t,n){if(e(t),!r(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r,e){try{(e=i(18)(Function.call,i(16).f(Object.prototype,"__proto__").set,2))(t,[]),r=!(t instanceof Array);}catch(n){r=!0;}return function setPrototypeOf(t,n){return o(t,n),r?t.__proto__=n:e(t,n),t}}({},!1):Jt),check:o};},function(t,n,r){var o=r(4),u=r(71).set;t.exports=function(t,n,r){var e,i=n.constructor;return i!==r&&"function"==typeof i&&(e=i.prototype)!==r.prototype&&o(e)&&u&&u(t,e),t};},function(t,n){t.exports="\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff";},function(t,n,r){var i=r(20),o=r(23);t.exports=function repeat(t){var n=String(o(this)),r="",e=i(t);if(e<0||e==Infinity)throw RangeError("Count can't be negative");for(;0>>=1)&&(n+=n))1&e&&(r+=n);return r};},function(t,n){t.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1};},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718>1,s=23===n?F(2,-24)-F(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=P(t))!=t||t===M?(i=t!=t?1:0,e=a):(e=A(k(t)/N),t*(o=F(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+f?s/o:s*F(2,1-f))*o&&(e++,o/=2),a<=e+f?(i=0,e=a):1<=e+f?(i=(t*o-1)*F(2,n),e+=f):(i=t*F(2,f-1)*F(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,a=r-1,f=t[a--],s=127&f;for(f>>=7;0>=-c,c+=n;0>8&255]}function packI32(t){return [255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){g(t[S],n,{get:function(){return this[r]}});}function get(t,n,r,e){var i=p(+r);if(t[L]>24);},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24);}},!0);}else m=function ArrayBuffer(t){s(this,m,b);var n=p(t);this._b=y.call(new Array(n),0),this[L]=n;},w=function DataView(t,n,r){s(this,w,_),s(t,m,_);var e=t[L],i=l(n);if(i<0||e>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return (n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n);},setUint8:function setUint8(t,n){set(this,1,t,packI8,n);},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2]);},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2]);},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2]);},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2]);},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2]);}, + setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2]);}});d(m,b),d(w,_),c(w[S],u.VIEW,!0),n[b]=m,n[_]=w;},function(t,n,r){t.exports=!r(7)&&!r(3)(function(){return 7!=Object.defineProperty(r(66)("div"),"a",{get:function(){return 7}}).a});},function(t,n,r){n.f=r(5);},function(t,n,r){var u=r(14),c=r(15),a=r(52)(!1),f=r(68)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=f&&u(e,r)&&o.push(r);for(;i>>0||(u.test(r)?16:10))}:e;},function(t,n){t.exports=Math.log1p||function log1p(t){return -1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)};},function(t,n,r){var o=r(75),e=Math.pow,u=e(2,-52),c=e(2,-23),a=e(2,127)*(2-c),f=e(2,-126);t.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}});},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return (i(t=+t)+i(-t))/2}});},function(t,n,r){var e=r(0),i=r(76);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i});},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(107)});},function(t,n,r){var e=r(0),a=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o>>16)*u+o*(r&i>>>16)<<16>>>0)}});},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}});},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(106)});},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}});},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(75)});},function(t,n,r){var e=r(0),i=r(76),o=Math.exp;e(e.S+e.F*r(3)(function(){return -2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}});},function(t,n,r){var e=r(0),i=r(76),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}});},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function trunc(t){return (0>10),n%1024+56320));}return r.join("")}});},function(t,n,r){var e=r(0),u=r(15),c=r(6);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o]*>)/g,v=/\$([$&`']|\d\d?)/g;r(59)("replace",2,function(i,o,x,m){return [function replace(t,n){var r=i(this),e=t==Jt?Jt:t[o];return e!==Jt?e.call(t,r,n):x.call(String(r),t,n)},function(t,n){var r=m(x,t,this,n);if(r.done)return r.value;var e=w(t),i=String(this),o="function"==typeof n;o||(n=String(n));var u=e.global;if(u){var c=e.unicode;e.lastIndex=0;}for(var a=[];;){var f=I(e,i);if(null===f)break;if(a.push(f),!u)break;""===String(f[0])&&(e.lastIndex=M(i,E(e.lastIndex),c));}for(var s,l="",h=0,p=0;p>>0,f=new RegExp(t.source,(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":"")+"g");(e=l.call(f,r))&&!(c<(i=f[v])&&(u.push(r.slice(c,e.index)),1>>0;if(0===a)return [];if(0===i.length)return null===m(c,i)?[i]:[];for(var f=0,s=0,l=[];s>>0,o=r>>>0;return (n>>>0)+(e>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}});},function(t,n,r){var e=r(0);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=r>>>0;return (n>>>0)-(e>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}});},function(t,n,r){var e=r(0);e(e.S,"Math",{imulh:function imulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>16,c=e>>16,a=(u*o>>>0)+(i*o>>>16);return u*c+(a>>16)+((i*c>>>0)+(65535&a)>>16)}});},function(t,n,r){var e=r(0);e(e.S,"Math",{RAD_PER_DEG:180/Math.PI});},function(t,n,r){var e=r(0),i=Math.PI/180;e(e.S,"Math",{radians:function radians(t){return t*i}});},function(t,n,r){var e=r(0);e(e.S,"Math",{scale:r(128)});},function(t,n,r){var e=r(0);e(e.S,"Math",{umulh:function umulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>>16,c=e>>>16,a=(u*o>>>0)+(i*o>>>16);return u*c+(a>>>16)+((i*c>>>0)+(65535&a)>>>16)}});},function(t,n,r){var e=r(0);e(e.S,"Math",{signbit:function signbit(t){return (t=+t)!=t?t:0==t?1/t==Infinity:0t())),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){s((()=>this._onFinish()))}_onStart(){this._onStartFns.forEach((t=>t())),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach((t=>t())),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const s="start"==t?this._onStartFns:this._onDoneFns;s.forEach((t=>t())),s.length=0}},t.animate=function(t,s=null){return{type:4,styles:s,timings:t}},t.animateChild=function(t=null){return{type:9,options:t}},t.animation=function(t,s=null){return{type:8,animation:t,options:s}},t.group=function(t,s=null){return{type:3,steps:t,options:s}},t.keyframes=function(t){return{type:5,steps:t}},t.query=function(t,s,n=null){return{type:11,selector:t,animation:s,options:n}},t.sequence=function(t,s=null){return{type:2,steps:t,options:s}},t.stagger=function(t,s){return{type:12,timings:t,animation:s}},t.state=function(t,s,n){return{type:0,name:t,styles:s,options:n}},t.style=function(t){return{type:6,styles:t,offset:null}},t.transition=function(t,s,n=null){return{type:1,expr:t,animation:s,options:n}},t.trigger=function(t,s){return{type:7,name:t,definitions:s,options:{}}},t.useAnimation=function(t,s=null){return{type:10,animation:t,options:s}},t["ɵAnimationGroupPlayer"]=class{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let n=0,i=0,o=0;const e=this.players.length;0==e?s((()=>this._onFinish())):this.players.forEach((t=>{t.onDone((()=>{++n==e&&this._onFinish()})),t.onDestroy((()=>{++i==e&&this._onDestroy()})),t.onStart((()=>{++o==e&&this._onStart()}))})),this.totalTime=this.players.reduce(((t,s)=>Math.max(t,s.totalTime)),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach((t=>t())),this._onDoneFns=[])}init(){this.players.forEach((t=>t.init()))}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach((t=>t())),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach((t=>t.play()))}pause(){this.players.forEach((t=>t.pause()))}restart(){this.players.forEach((t=>t.restart()))}finish(){this._onFinish(),this.players.forEach((t=>t.finish()))}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach((t=>t.destroy())),this._onDestroyFns.forEach((t=>t())),this._onDestroyFns=[])}reset(){this.players.forEach((t=>t.reset())),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const s=t*this.totalTime;this.players.forEach((t=>{const n=t.totalTime?Math.min(1,s/t.totalTime):1;t.setPosition(n)}))}getPosition(){const t=this.players.reduce(((t,s)=>null===t||s.totalTime>t.totalTime?s:t),null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach((t=>{t.beforeDestroy&&t.beforeDestroy()}))}triggerCallback(t){const s="start"==t?this._onStartFns:this._onDoneFns;s.forEach((t=>t())),s.length=0}},t["ɵPRE_STYLE"]="!"})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/animations/browser/browser.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/animations/browser/browser.js new file mode 100644 index 000000000..d5c8f7230 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/animations/browser/browser.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/animations"),require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/animations","@angular/core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngAnimationsBrowser={},e.ngAnimations,e.ngCore)}(this,(function(e,t,n){"use strict";function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=s(n);const r="\n - ";function o(e){return new n["ɵRuntimeError"](3e3,ngDevMode&&`The provided timing value "${e}" is invalid.`)}const a=new Set(["-moz-outline-radius","-moz-outline-radius-bottomleft","-moz-outline-radius-bottomright","-moz-outline-radius-topleft","-moz-outline-radius-topright","-ms-grid-columns","-ms-grid-rows","-webkit-line-clamp","-webkit-text-fill-color","-webkit-text-stroke","-webkit-text-stroke-color","accent-color","all","backdrop-filter","background","background-color","background-position","background-size","block-size","border","border-block-end","border-block-end-color","border-block-end-width","border-block-start","border-block-start-color","border-block-start-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-width","border-color","border-end-end-radius","border-end-start-radius","border-image-outset","border-image-slice","border-image-width","border-inline-end","border-inline-end-color","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-width","border-left","border-left-color","border-left-width","border-radius","border-right","border-right-color","border-right-width","border-start-end-radius","border-start-start-radius","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-width","border-width","bottom","box-shadow","caret-color","clip","clip-path","color","column-count","column-gap","column-rule","column-rule-color","column-rule-width","column-width","columns","filter","flex","flex-basis","flex-grow","flex-shrink","font","font-size","font-size-adjust","font-stretch","font-variation-settings","font-weight","gap","grid-column-gap","grid-gap","grid-row-gap","grid-template-columns","grid-template-rows","height","inline-size","input-security","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","left","letter-spacing","line-clamp","line-height","margin","margin-block-end","margin-block-start","margin-bottom","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","mask","mask-border","mask-position","mask-size","max-block-size","max-height","max-inline-size","max-lines","max-width","min-block-size","min-height","min-inline-size","min-width","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","outline","outline-color","outline-offset","outline-width","padding","padding-block-end","padding-block-start","padding-bottom","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","perspective","perspective-origin","right","rotate","row-gap","scale","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-coordinate","scroll-snap-destination","scrollbar-color","shape-image-threshold","shape-margin","shape-outside","tab-size","text-decoration","text-decoration-color","text-decoration-thickness","text-emphasis","text-emphasis-color","text-indent","text-shadow","text-underline-offset","top","transform","transform-origin","translate","vertical-align","visibility","width","word-spacing","z-index","zoom"]);function l(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function h(e){switch(e.length){case 0:return new t.NoopAnimationPlayer;case 1:return e[0];default:return new t["ɵAnimationGroupPlayer"](e)}}function u(e,s,i,o,a=new Map,l=new Map){const h=[],u=[];let c=-1,m=null;if(o.forEach((e=>{const n=e.get("offset"),i=n==c,r=i&&m||new Map;e.forEach(((e,n)=>{let i=n,o=e;if("offset"!==n)switch(i=s.normalizePropertyName(i,h),o){case t["ɵPRE_STYLE"]:o=a.get(n);break;case t.AUTO_STYLE:o=l.get(n);break;default:o=s.normalizeStyleValue(n,i,o,h)}r.set(i,o)})),i||u.push(r),m=r,c=n})),h.length)throw function(e){return new n["ɵRuntimeError"](3502,ngDevMode&&`Unable to animate due to the following errors:\n - ${e.map((e=>e.message)).join(r)}`)}(h);return u}function c(e,t,n,s){switch(t){case"start":e.onStart((()=>s(n&&m(n,"start",e))));break;case"done":e.onDone((()=>s(n&&m(n,"done",e))));break;case"destroy":e.onDestroy((()=>s(n&&m(n,"destroy",e))))}}function m(e,t,n){const s=n.totalTime,i=!!n.disabled,r=d(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,null==s?e.totalTime:s,i),o=e._data;return null!=o&&(r._data=o),r}function d(e,t,n,s,i="",r=0,o){return{element:e,triggerName:t,fromState:n,toState:s,phaseName:i,totalTime:r,disabled:!!o}}function p(e,t,n){let s=e.get(t);return s||e.set(t,s=n),s}function f(e){const t=e.indexOf(":");return[e.substring(1,t),e.slice(t+1)]}let y=(e,t)=>!1,g=(e,t,n)=>[],_=null;function v(e){const t=e.parentNode||e.host;return t===_?null:t}(l()||"undefined"!=typeof Element)&&("undefined"==typeof window||void 0===window.document?y=(e,t)=>e.contains(t):(_=(()=>document.documentElement)(),y=(e,t)=>{for(;t;){if(t===e)return!0;t=v(t)}return!1}),g=(e,t,n)=>{if(n)return Array.from(e.querySelectorAll(t));const s=e.querySelector(t);return s?[s]:[]});let S=null,E=!1;function w(e){S||(S=function(){if("undefined"!=typeof document)return document.body;return null}()||{},E=!!S.style&&"WebkitAppearance"in S.style);let t=!0;if(S.style&&!function(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in S.style,!t&&E)){t="Webkit"+e.charAt(0).toUpperCase()+e.slice(1)in S.style}return t}const b=y,T=g;class k{validateStyleProperty(e){return w(e)}matchesElement(e,t){return!1}containsElement(e,t){return b(e,t)}getParentElement(e){return v(e)}query(e,t,n){return T(e,t,n)}computeStyle(e,t,n){return n||""}animate(e,n,s,i,r,o=[],a){return new t.NoopAnimationPlayer(s,i)}}k.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:k,deps:[],target:i.ɵɵFactoryTarget.Injectable}),k.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:k}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:k,decorators:[{type:n.Injectable}]});class A{}A.NOOP=new k;const P="ng-enter",M="ng-leave",N="ng-trigger",D=".ng-trigger",C="ng-animating",R=".ng-animating";function F(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:x(parseFloat(t[1]),t[2])}function x(e,t){return"s"===t?1e3*e:e}function L(e,t,s){return e.hasOwnProperty("duration")?e:function(e,t,s){const i=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;let r,a=0,l="";if("string"==typeof e){const n=e.match(i);if(null===n)return t.push(o(e)),{duration:0,delay:0,easing:""};r=x(parseFloat(n[1]),n[2]);const s=n[3];null!=s&&(a=x(parseFloat(s),n[4]));const h=n[5];h&&(l=h)}else r=e;if(!s){let s=!1,i=t.length;r<0&&(t.push(new n["ɵRuntimeError"](3100,ngDevMode&&"Duration values below 0 are not allowed for this animation step.")),s=!0),a<0&&(t.push(new n["ɵRuntimeError"](3101,ngDevMode&&"Delay values below 0 are not allowed for this animation step.")),s=!0),s&&t.splice(i,0,o(e))}return{duration:r,delay:a,easing:l}}(e,t,s)}function z(e,t={}){return Object.keys(e).forEach((n=>{t[n]=e[n]})),t}function q(e){const t=new Map;return Object.keys(e).forEach((n=>{const s=e[n];t.set(n,s)})),t}function O(e){return e.length?e[0]instanceof Map?e:e.map((e=>q(e))):[]}function B(e){const t=new Map;return Array.isArray(e)?e.forEach((e=>I(e,t))):I(e,t),t}function I(e,t=new Map,n){if(n)for(let[e,s]of n)t.set(e,s);for(let[n,s]of e)t.set(n,s);return t}function Q(e,t,n){return n?t+":"+n+";":""}function K(e){let t="";for(let n=0;n{const i=J(s);n&&!n.has(s)&&n.set(s,e.style[i]),e.style[i]=t})),l()&&K(e))}function j(e,t){e.style&&(t.forEach(((t,n)=>{const s=J(n);e.style[s]=""})),l()&&K(e))}function U(e){return Array.isArray(e)?1==e.length?e[0]:t.sequence(e):e}function W(e,t,s){const i=t.params||{},r=Y(e);r.length&&r.forEach((e=>{i.hasOwnProperty(e)||s.push(function(e){return new n["ɵRuntimeError"](3001,ngDevMode&&`Unable to resolve the local animation param ${e} in the given list of values`)}(e))}))}const V=new RegExp("{{\\s*(.+?)\\s*}}","g");function Y(e){let t=[];if("string"==typeof e){let n;for(;n=V.exec(e);)t.push(n[1]);V.lastIndex=0}return t}function H(e,t,s){const i=e.toString(),r=i.replace(V,((e,i)=>{let r=t[i];return null==r&&(s.push(function(e){return new n["ɵRuntimeError"](3003,ngDevMode&&`Please provide a value for the animation param ${e}`)}(i)),r=""),r.toString()}));return r==i?e:r}function G(e){const t=[];let n=e.next();for(;!n.done;)t.push(n.value),n=e.next();return t}const Z=/-+([a-z0-9])/g;function J(e){return e.replace(Z,((...e)=>e[1].toUpperCase()))}function X(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ee(e,t){return 0===e||0===t}function te(e,t,s){switch(t.type){case 7:return e.visitTrigger(t,s);case 0:return e.visitState(t,s);case 1:return e.visitTransition(t,s);case 2:return e.visitSequence(t,s);case 3:return e.visitGroup(t,s);case 4:return e.visitAnimate(t,s);case 5:return e.visitKeyframes(t,s);case 6:return e.visitStyle(t,s);case 8:return e.visitReference(t,s);case 9:return e.visitAnimateChild(t,s);case 10:return e.visitAnimateRef(t,s);case 11:return e.visitQuery(t,s);case 12:return e.visitStagger(t,s);default:throw i=t.type,new n["ɵRuntimeError"](3004,ngDevMode&&`Unable to resolve animation metadata node #${i}`)}var i}function ne(e,t){return window.getComputedStyle(e)[t]}const se="undefined"==typeof ngDevMode||!!ngDevMode;function ie(e){const t="\n - ";return`\n - ${e.filter(Boolean).map((e=>e)).join(t)}`}const re="*";function oe(e,t){const s=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach((e=>function(e,t,s){if(":"==e[0]){const i=function(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,t)=>parseFloat(t)>parseFloat(e);case":decrement":return(e,t)=>parseFloat(t) *"}}(e,s);if("function"==typeof i)return void t.push(i);e=i}const i=e.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return s.push((r=e,new n["ɵRuntimeError"](3015,ngDevMode&&`The provided transition expression "${r}" is not supported`))),t;var r;const o=i[1],a=i[2],l=i[3];t.push(he(o,l));const h=o==re&&l==re;"<"!=a[0]||h||t.push(he(l,o))}(e,s,t))):s.push(e),s}const ae=new Set(["true","1"]),le=new Set(["false","0"]);function he(e,t){const n=ae.has(e)||le.has(e),s=ae.has(t)||le.has(t);return(i,r)=>{let o=e==re||e==i,a=t==re||t==r;return!o&&n&&"boolean"==typeof i&&(o=i?ae.has(e):le.has(e)),!a&&s&&"boolean"==typeof r&&(a=r?ae.has(t):le.has(t)),o&&a}}const ue=":self",ce=new RegExp("s*:selfs*,?","g");function me(e,t,n,s){return new de(e).build(t,n,s)}class de{constructor(e){this._driver=e}build(e,t,n){const s=new pe(t);this._resetContextStyleTimingState(s);const i=te(this,U(e),s);return("undefined"==typeof ngDevMode||ngDevMode)&&s.unsupportedCSSPropertiesFound.size&&function(e,t){t.length&&e.push(`The following provided properties are not recognized: ${t.join(", ")}`)}(n,[...s.unsupportedCSSPropertiesFound.keys()]),i}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles=new Map,e.collectedStyles.set("",new Map),e.currentTime=0}visitTrigger(e,t){let s=t.queryCount=0,i=t.depCount=0;const r=[],o=[];return"@"==e.name.charAt(0)&&t.errors.push(new n["ɵRuntimeError"](3006,ngDevMode&&"animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))")),e.definitions.forEach((e=>{if(this._resetContextStyleTimingState(t),0==e.type){const n=e,s=n.name;s.toString().split(/\s*,\s*/).forEach((e=>{n.name=e,r.push(this.visitState(n,t))})),n.name=s}else if(1==e.type){const n=this.visitTransition(e,t);s+=n.queryCount,i+=n.depCount,o.push(n)}else t.errors.push(new n["ɵRuntimeError"](3007,ngDevMode&&"only state() and transition() definitions can sit inside of a trigger()"))})),{type:7,name:e.name,states:r,transitions:o,queryCount:s,depCount:i,options:null}}visitState(e,t){const s=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(s.containsDynamicStyles){const r=new Set,o=i||{};if(s.styles.forEach((e=>{e instanceof Map&&e.forEach((e=>{Y(e).forEach((e=>{o.hasOwnProperty(e)||r.add(e)}))}))})),r.size){const s=G(r.values());t.errors.push(function(e,t){return new n["ɵRuntimeError"](3008,ngDevMode&&`state("${e}", ...) must define default values for all the following style substitutions: ${t.join(", ")}`)}(e.name,s))}}return{type:0,name:e.name,style:s,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const n=te(this,U(e.animation),t);return{type:1,matchers:oe(e.expr,t.errors),animation:n,queryCount:t.queryCount,depCount:t.depCount,options:fe(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map((e=>te(this,e,t))),options:fe(e.options)}}visitGroup(e,t){const n=t.currentTime;let s=0;const i=e.steps.map((e=>{t.currentTime=n;const i=te(this,e,t);return s=Math.max(s,t.currentTime),i}));return t.currentTime=s,{type:3,steps:i,options:fe(e.options)}}visitAnimate(e,n){const s=function(e,t){if(e.hasOwnProperty("duration"))return e;if("number"==typeof e){return ye(L(e,t).duration,0,"")}const n=e;if(n.split(/\s+/).some((e=>"{"==e.charAt(0)&&"{"==e.charAt(1)))){const e=ye(0,0,"");return e.dynamic=!0,e.strValue=n,e}const s=L(n,t);return ye(s.duration,s.delay,s.easing)}(e.timings,n.errors);let i;n.currentAnimateTimings=s;let r=e.styles?e.styles:t.style({});if(5==r.type)i=this.visitKeyframes(r,n);else{let r=e.styles,o=!1;if(!r){o=!0;const e={};s.easing&&(e.easing=s.easing),r=t.style(e)}n.currentTime+=s.duration+s.delay;const a=this.visitStyle(r,n);a.isEmptyStep=o,i=a}return n.currentAnimateTimings=null,{type:4,timings:s,style:i,options:null}}visitStyle(e,t){const n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,s){const i=[],r=Array.isArray(e.styles)?e.styles:[e.styles];for(let e of r)"string"==typeof e?e===t.AUTO_STYLE?i.push(e):s.errors.push((o=e,new n["ɵRuntimeError"](3002,ngDevMode&&`The provided style string value ${o} is not allowed.`))):i.push(q(e));var o;let a=!1,l=null;return i.forEach((e=>{if(e instanceof Map&&(e.has("easing")&&(l=e.get("easing"),e.delete("easing")),!a))for(let t of e.values())if(t.toString().indexOf("{{")>=0){a=!0;break}})),{type:6,styles:i,easing:l,offset:e.offset,containsDynamicStyles:a,options:null}}_validateStyleAst(e,t){const s=t.currentAnimateTimings;let i=t.currentTime,r=t.currentTime;s&&r>0&&(r-=s.duration+s.delay),e.styles.forEach((e=>{"string"!=typeof e&&e.forEach(((s,o)=>{if(("undefined"==typeof ngDevMode||ngDevMode)&&!this._driver.validateStyleProperty(o))return e.delete(o),void t.unsupportedCSSPropertiesFound.add(o);const a=t.collectedStyles.get(t.currentQuerySelector),l=a.get(o);let h=!0;l&&(r!=i&&r>=l.startTime&&i<=l.endTime&&(t.errors.push(function(e,t,s,i,r){return new n["ɵRuntimeError"](3010,ngDevMode&&`The CSS property "${e}" that exists between the times of "${t}ms" and "${s}ms" is also being animated in a parallel animation between the times of "${i}ms" and "${r}ms"`)}(o,l.startTime,l.endTime,r,i)),h=!1),r=l.startTime),h&&a.set(o,{startTime:r,endTime:i}),t.options&&W(s,t.options,t.errors)}))}))}visitKeyframes(e,t){const s={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(new n["ɵRuntimeError"](3011,ngDevMode&&"keyframes() must be placed inside of a call to animate()")),s;let i=0;const r=[];let o=!1,a=!1,l=0;const h=e.steps.map((e=>{const n=this._makeStyleAst(e,t);let s=null!=n.offset?n.offset:function(e){if("string"==typeof e)return null;let t=null;if(Array.isArray(e))e.forEach((e=>{if(e instanceof Map&&e.has("offset")){const n=e;t=parseFloat(n.get("offset")),n.delete("offset")}}));else if(e instanceof Map&&e.has("offset")){const n=e;t=parseFloat(n.get("offset")),n.delete("offset")}return t}(n.styles),h=0;return null!=s&&(i++,h=n.offset=s),a=a||h<0||h>1,o=o||h0&&i{const i=c>0?n==m?1:c*n:r[n],o=i*f;t.currentTime=d+p.delay+o,p.duration=o,this._validateStyleAst(e,t),e.offset=i,s.styles.push(e)})),s}visitReference(e,t){return{type:8,animation:te(this,U(e.animation),t),options:fe(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:fe(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:fe(e.options)}}visitQuery(e,t){const n=t.currentQuerySelector,s=e.options||{};t.queryCount++,t.currentQuery=e;const[i,r]=function(e){const t=!!e.split(/\s*,\s*/).find((e=>e==ue));t&&(e=e.replace(ce,""));return[e=e.replace(/@\*/g,D).replace(/@\w+/g,(e=>".ng-trigger-"+e.slice(1))).replace(/:animating/g,R),t]}(e.selector);t.currentQuerySelector=n.length?n+" "+i:i,p(t.collectedStyles,t.currentQuerySelector,new Map);const o=te(this,U(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:11,selector:i,limit:s.limit||0,optional:!!s.optional,includeSelf:r,animation:o,originalSelector:e.selector,options:fe(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(new n["ɵRuntimeError"](3013,ngDevMode&&"stagger() can only be used inside of query()"));const s="full"===e.timings?{duration:0,delay:0,easing:"full"}:L(e.timings,t.errors,!0);return{type:12,animation:te(this,U(e.animation),t),timings:s,options:null}}}class pe{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function fe(e){var t;return e?(e=z(e)).params&&(e.params=(t=e.params)?z(t):null):e={},e}function ye(e,t,n){return{duration:e,delay:t,easing:n}}function ge(e,t,n,s,i,r,o=null,a=!1){return{type:1,element:e,keyframes:t,preStyleProps:n,postStyleProps:s,duration:i,delay:r,totalTime:i+r,easing:o,subTimeline:a}}class _e{constructor(){this._map=new Map}get(e){return this._map.get(e)||[]}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const ve=new RegExp(":enter","g"),Se=new RegExp(":leave","g");function Ee(e,t,n,s,i,r=new Map,o=new Map,a,l,h=[]){return(new we).buildKeyframes(e,t,n,s,i,r,o,a,l,h)}class we{buildKeyframes(e,t,n,s,i,r,o,a,l,h=[]){l=l||new _e;const u=new Te(e,t,l,s,i,h,[]);u.options=a;const c=a.delay?F(a.delay):0;u.currentTimeline.delayNextStep(c),u.currentTimeline.setStyles([r],null,u.errors,a),te(this,n,u);const m=u.timelines.filter((e=>e.containsAnimation()));if(m.length&&o.size){let e;for(let n=m.length-1;n>=0;n--){const s=m[n];if(s.element===t){e=s;break}}e&&!e.allowOnlyTimelineStyles()&&e.setStyles([o],null,u.errors,a)}return m.length?m.map((e=>e.buildKeyframes())):[ge(t,[],[],[],0,c,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const n=t.subInstructions.get(t.element);if(n){const s=t.createSubContext(e.options),i=t.currentTimeline.currentTime,r=this._visitSubInstructions(n,s,s.options);i!=r&&t.transformIntoNewTimeline(r)}t.previousNode=e}visitAnimateRef(e,t){const n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,n),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,n){for(const s of e){const e=s?.delay;if(e){const i="number"==typeof e?e:F(H(e,s?.params??{},t.errors));n.delayNextStep(i)}}}_visitSubInstructions(e,t,n){let s=t.currentTimeline.currentTime;const i=null!=n.duration?F(n.duration):null,r=null!=n.delay?F(n.delay):null;return 0!==i&&e.forEach((e=>{const n=t.appendInstructionToTimeline(e,i,r);s=Math.max(s,n.duration+n.delay)})),s}visitReference(e,t){t.updateOptions(e.options,!0),te(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const n=t.subContextCount;let s=t;const i=e.options;if(i&&(i.params||i.delay)&&(s=t.createSubContext(i),s.transformIntoNewTimeline(),null!=i.delay)){6==s.previousNode.type&&(s.currentTimeline.snapshotCurrentStyles(),s.previousNode=be);const e=F(i.delay);s.delayNextStep(e)}e.steps.length&&(e.steps.forEach((e=>te(this,e,s))),s.currentTimeline.applyStylesToKeyframe(),s.subContextCount>n&&s.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const n=[];let s=t.currentTimeline.currentTime;const i=e.options&&e.options.delay?F(e.options.delay):0;e.steps.forEach((r=>{const o=t.createSubContext(e.options);i&&o.delayNextStep(i),te(this,r,o),s=Math.max(s,o.currentTimeline.currentTime),n.push(o.currentTimeline)})),n.forEach((e=>t.currentTimeline.mergeTimelineCollectedStyles(e))),t.transformIntoNewTimeline(s),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const n=e.strValue;return L(t.params?H(n,t.params,t.errors):n,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const n=t.currentAnimateTimings=this._visitTiming(e.timings,t),s=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),s.snapshotCurrentStyles());const i=e.style;5==i.type?this.visitKeyframes(i,t):(t.incrementTime(n.duration),this.visitStyle(i,t),s.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const n=t.currentTimeline,s=t.currentAnimateTimings;!s&&n.hasCurrentStyleProperties()&&n.forwardFrame();const i=s&&s.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(i):n.setStyles(e.styles,i,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const n=t.currentAnimateTimings,s=t.currentTimeline.duration,i=n.duration,r=t.createSubContext().currentTimeline;r.easing=n.easing,e.styles.forEach((e=>{const n=e.offset||0;r.forwardTime(n*i),r.setStyles(e.styles,e.easing,t.errors,t.options),r.applyStylesToKeyframe()})),t.currentTimeline.mergeTimelineCollectedStyles(r),t.transformIntoNewTimeline(s+i),t.previousNode=e}visitQuery(e,t){const n=t.currentTimeline.currentTime,s=e.options||{},i=s.delay?F(s.delay):0;i&&(6===t.previousNode.type||0==n&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=be);let r=n;const o=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!s.optional,t.errors);t.currentQueryTotal=o.length;let a=null;o.forEach(((n,s)=>{t.currentQueryIndex=s;const o=t.createSubContext(e.options,n);i&&o.delayNextStep(i),n===t.element&&(a=o.currentTimeline),te(this,e.animation,o),o.currentTimeline.applyStylesToKeyframe();const l=o.currentTimeline.currentTime;r=Math.max(r,l)})),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(r),a&&(t.currentTimeline.mergeTimelineCollectedStyles(a),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const n=t.parentContext,s=t.currentTimeline,i=e.timings,r=Math.abs(i.duration),o=r*(t.currentQueryTotal-1);let a=r*t.currentQueryIndex;switch(i.duration<0?"reverse":i.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const l=t.currentTimeline;a&&l.delayNextStep(a);const h=l.currentTime;te(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=s.currentTime-h+(s.startTime-n.currentTimeline.startTime)}}const be={};class Te{constructor(e,t,n,s,i,r,o,a){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=s,this._leaveClassName=i,this.errors=r,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=be,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new ke(this._driver,t,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const n=e;let s=this.options;null!=n.duration&&(s.duration=F(n.duration)),null!=n.delay&&(s.delay=F(n.delay));const i=n.params;if(i){let e=s.params;e||(e=this.options.params={}),Object.keys(i).forEach((n=>{t&&e.hasOwnProperty(n)||(e[n]=H(i[n],e,this.errors))}))}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const n=e.params={};Object.keys(t).forEach((e=>{n[e]=t[e]}))}}return e}createSubContext(e=null,t,n){const s=t||this.element,i=new Te(this._driver,s,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(s,n||0));return i.previousNode=this.previousNode,i.currentAnimateTimings=this.currentAnimateTimings,i.options=this._copyOptions(),i.updateOptions(e),i.currentQueryIndex=this.currentQueryIndex,i.currentQueryTotal=this.currentQueryTotal,i.parentContext=this,this.subContextCount++,i}transformIntoNewTimeline(e){return this.previousNode=be,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){const s={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+e.delay,easing:""},i=new Ae(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,s,e.stretchStartingKeyframe);return this.timelines.push(i),s}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,s,i,r,o){let a=[];if(i&&a.push(this.element),e.length>0){e=(e=e.replace(ve,"."+this._enterClassName)).replace(Se,"."+this._leaveClassName);const t=1!=s;let n=this._driver.query(this.element,e,t);0!==s&&(n=s<0?n.slice(n.length+s,n.length):n.slice(0,s)),a.push(...n)}return r||0!=a.length||o.push(function(e){return new n["ɵRuntimeError"](3014,ngDevMode&&`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`)}(t)),a}}class ke{constructor(e,t,n,s){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=s,this.duration=0,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1===this._keyframes.size&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new ke(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[e,n]of this._globalTimelineStyles)this._backFill.set(e,n||t.AUTO_STYLE),this._currentKeyframe.set(e,t.AUTO_STYLE);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,n,s,i){n&&this._previousKeyframe.set("easing",n);const r=i&&i.params||{},o=function(e,n){const s=new Map;let i;return e.forEach((e=>{if("*"===e){i=i||n.keys();for(let e of i)s.set(e,t.AUTO_STYLE)}else I(e,s)})),s}(e,this._globalTimelineStyles);for(let[e,n]of o){const i=H(n,r,s);this._pendingStyles.set(e,i),this._localTimelineStyles.has(e)||this._backFill.set(e,this._globalTimelineStyles.get(e)??t.AUTO_STYLE),this._updateStyle(e,i)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach(((e,t)=>{this._currentKeyframe.set(t,e)})),this._pendingStyles.clear(),this._localTimelineStyles.forEach(((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)})))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach(((e,t)=>{const n=this._styleSummary.get(t);(!n||e.time>n.time)&&this._updateStyle(t,e.value)}))}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,n=new Set,s=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach(((r,o)=>{const a=I(r,new Map,this._backFill);a.forEach(((s,i)=>{s===t["ɵPRE_STYLE"]?e.add(i):s===t.AUTO_STYLE&&n.add(i)})),s||a.set("offset",o/this.duration),i.push(a)}));const r=e.size?G(e.values()):[],o=n.size?G(n.values()):[];if(s){const e=i[0],t=new Map(e);e.set("offset",0),t.set("offset",1),i=[e,t]}return ge(this.element,i,r,o,this.duration,this.startTime,this.easing,!1)}}class Ae extends ke{constructor(e,t,n,s,i,r,o=!1){super(e,t,r.delay),this.keyframes=n,this.preStyleProps=s,this.postStyleProps=i,this._stretchStartingKeyframe=o,this.timings={duration:r.duration,delay:r.delay,easing:r.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:n,easing:s}=this.timings;if(this._stretchStartingKeyframe&&t){const i=[],r=n+t,o=t/r,a=I(e[0]);a.set("offset",0),i.push(a);const l=I(e[0]);l.set("offset",Pe(o)),i.push(l);const h=e.length-1;for(let s=1;s<=h;s++){let o=I(e[s]);const a=t+o.get("offset")*n;o.set("offset",Pe(a/r)),i.push(o)}n=r,t=0,s="",e=i}return ge(this.element,e,this.preStyleProps,this.postStyleProps,n,t,s,!0)}}function Pe(e,t=3){const n=Math.pow(10,t-1);return Math.round(e*n)/n}class Me{}const Ne=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]);function De(e,t,n,s,i,r,o,a,l,h,u,c,m){return{type:0,element:e,triggerName:t,isRemovalTransition:i,fromState:n,fromStyles:r,toState:s,toStyles:o,timelines:a,queriedElements:l,preStyleProps:h,postStyleProps:u,totalTime:c,errors:m}}const Ce={};class Re{constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,s){return function(e,t,n,s,i){return e.some((e=>e(t,n,s,i)))}(this.ast.matchers,e,t,n,s)}buildStyles(e,t,n){let s=this._stateStyles.get("*");return void 0!==e&&(s=this._stateStyles.get(e?.toString())||s),s?s.buildStyles(t,n):new Map}build(e,t,n,s,i,r,o,a,l,h){const u=[],c=this.ast.options&&this.ast.options.params||Ce,m=o&&o.params||Ce,d=this.buildStyles(n,m,u),f=a&&a.params||Ce,y=this.buildStyles(s,f,u),g=new Set,_=new Map,v=new Map,S="void"===s,E={params:Fe(f,c),delay:this.ast.options?.delay},w=h?[]:Ee(e,t,this.ast.animation,i,r,d,y,E,l,u);let b=0;if(w.forEach((e=>{b=Math.max(e.duration+e.delay,b)})),u.length)return De(t,this._triggerName,n,s,S,d,y,[],[],_,v,b,u);w.forEach((e=>{const n=e.element,s=p(_,n,new Set);e.preStyleProps.forEach((e=>s.add(e)));const i=p(v,n,new Set);e.postStyleProps.forEach((e=>i.add(e))),n!==t&&g.add(n)})),("undefined"==typeof ngDevMode||ngDevMode)&&function(e,t,n){if(!n.validateAnimatableStyleProperty)return;const s=new Set;e.forEach((({keyframes:e})=>{const t=new Map;e.forEach((e=>{for(const[i,r]of e.entries())if(!n.validateAnimatableStyleProperty(i))if(t.has(i)&&!s.has(i)){t.get(i)!==r&&s.add(i)}else t.set(i,r)}))})),s.size>0&&console.warn(`Warning: The animation trigger "${t}" is attempting to animate the following not animatable properties: `+Array.from(s).join(", ")+"\n(to check the list of all animatable properties visit https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)")}(w,this._triggerName,e);const T=G(g.values());return De(t,this._triggerName,n,s,S,d,y,w,T,_,v,b)}}function Fe(e,t){const n=z(t);for(const t in e)e.hasOwnProperty(t)&&null!=e[t]&&(n[t]=e[t]);return n}class xe{constructor(e,t,n){this.styles=e,this.defaultParams=t,this.normalizer=n}buildStyles(e,t){const n=new Map,s=z(this.defaultParams);return Object.keys(e).forEach((t=>{const n=e[t];null!==n&&(s[t]=n)})),this.styles.styles.forEach((e=>{"string"!=typeof e&&e.forEach(((e,i)=>{e&&(e=H(e,s,t));const r=this.normalizer.normalizePropertyName(i,t);e=this.normalizer.normalizeStyleValue(i,r,e,t),n.set(i,e)}))})),n}}class Le{constructor(e,t,n){var s,i;this.name=e,this.ast=t,this._normalizer=n,this.transitionFactories=[],this.states=new Map,t.states.forEach((e=>{const t=e.options&&e.options.params||{};this.states.set(e.name,new xe(e.style,t,n))})),ze(this.states,"true","1"),ze(this.states,"false","0"),t.transitions.forEach((t=>{this.transitionFactories.push(new Re(e,t,this.states))})),this.fallbackTransition=(s=e,i=this.states,this._normalizer,new Re(s,{type:1,animation:{type:2,steps:[],options:null},matchers:[(e,t)=>!0],options:null,queryCount:0,depCount:0},i))}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,s){return this.transitionFactories.find((i=>i.match(e,t,n,s)))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}}function ze(e,t,n){e.has(t)?e.has(n)||e.set(n,e.get(t)):e.has(n)&&e.set(t,e.get(n))}const qe=new _e;class Oe{constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n,this._animations=new Map,this._playersById=new Map,this.players=[]}register(e,t){const s=[],i=[],r=me(this._driver,t,s,i);if(s.length)throw function(e){return new n["ɵRuntimeError"](3503,ngDevMode&&`Unable to build the animation due to the following errors: ${e.map((e=>e.message)).join("\n")}`)}(s);i.length&&function(e){se&&console.warn(`Animation built with the following warnings:${ie(e)}`)}(i),this._animations.set(e,r)}_buildPlayer(e,t,n){const s=e.element,i=u(this._driver,this._normalizer,0,e.keyframes,t,n);return this._driver.animate(s,i,e.duration,e.delay,e.easing,[],!0)}create(e,s,i={}){const r=[],o=this._animations.get(e);let a;const l=new Map;if(o?(a=Ee(this._driver,s,o,P,M,new Map,new Map,i,qe,r),a.forEach((e=>{const t=p(l,e.element,new Map);e.postStyleProps.forEach((e=>t.set(e,null)))}))):(r.push(new n["ɵRuntimeError"](3300,ngDevMode&&"The requested animation doesn't exist or has already been destroyed")),a=[]),r.length)throw function(e){return new n["ɵRuntimeError"](3504,ngDevMode&&`Unable to create the animation due to the following errors:${e.map((e=>e.message)).join("\n")}`)}(r);l.forEach(((e,n)=>{e.forEach(((s,i)=>{e.set(i,this._driver.computeStyle(n,i,t.AUTO_STYLE))}))}));const u=h(a.map((e=>{const t=l.get(e.element);return this._buildPlayer(e,new Map,t)})));return this._playersById.set(e,u),u.onDestroy((()=>this.destroy(e))),this.players.push(u),u}destroy(e){const t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);const n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){const t=this._playersById.get(e);if(!t)throw function(e){return new n["ɵRuntimeError"](3301,ngDevMode&&`Unable to find the timeline player referenced by ${e}`)}(e);return t}listen(e,t,n,s){const i=d(t,"","","");return c(this._getPlayer(e),n,i,s),()=>{}}command(e,t,n,s){if("register"==n)return void this.register(e,s[0]);if("create"==n){const n=s[0]||{};return void this.create(e,t,n)}const i=this._getPlayer(e);switch(n){case"play":i.play();break;case"pause":i.pause();break;case"reset":i.reset();break;case"restart":i.restart();break;case"finish":i.finish();break;case"init":i.init();break;case"setPosition":i.setPosition(parseFloat(s[0]));break;case"destroy":this.destroy(e)}}}const Be="ng-animate-queued",Ie="ng-animate-disabled",Qe=[],Ke={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},$e={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0};class je{constructor(e,t=""){this.namespaceId=t;const n=e&&e.hasOwnProperty("value"),s=n?e.value:e;if(this.value=function(e){return null!=e?e:null}(s),n){const t=z(e);delete t.value,this.options=t}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const e=this.options.params;Object.keys(t).forEach((n=>{null==e[n]&&(e[n]=t[n])}))}}}const Ue="void",We=new je(Ue);class Ve{constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,et(t,this._hostClassName)}listen(e,t,s,i){if(!this._triggers.has(t))throw function(e,t){return new n["ɵRuntimeError"](3302,ngDevMode&&`Unable to listen on the animation trigger event "${e}" because the animation trigger "${t}" doesn't exist!`)}(s,t);if(null==s||0==s.length)throw function(e){return new n["ɵRuntimeError"](3303,ngDevMode&&`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`)}(t);if("start"!=(r=s)&&"done"!=r)throw function(e,t){return new n["ɵRuntimeError"](3400,ngDevMode&&`The provided animation trigger event "${e}" for the animation trigger "${t}" is not supported!`)}(s,t);var r;const o=p(this._elementListeners,e,[]),a={name:t,phase:s,callback:i};o.push(a);const l=p(this._engine.statesByElement,e,new Map);return l.has(t)||(et(e,N),et(e,"ng-trigger-"+t),l.set(t,We)),()=>{this._engine.afterFlush((()=>{const e=o.indexOf(a);e>=0&&o.splice(e,1),this._triggers.has(t)||l.delete(t)}))}}register(e,t){return!this._triggers.has(e)&&(this._triggers.set(e,t),!0)}_getTrigger(e){const t=this._triggers.get(e);if(!t)throw function(e){return new n["ɵRuntimeError"](3401,ngDevMode&&`The provided animation trigger "${e}" has not been registered!`)}(e);return t}trigger(e,t,n,s=!0){const i=this._getTrigger(t),r=new He(this.id,t,e);let o=this._engine.statesByElement.get(e);o||(et(e,N),et(e,"ng-trigger-"+t),this._engine.statesByElement.set(e,o=new Map));let a=o.get(t);const l=new je(n,this.id);!(n&&n.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),o.set(t,l),a||(a=We);if(!(l.value===Ue)&&a.value===l.value){if(!function(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!=s.length)return!1;for(let s=0;s{j(e,n),$(e,s)}))}return}const h=p(this._engine.playersByElement,e,[]);h.forEach((e=>{e.namespaceId==this.id&&e.triggerName==t&&e.queued&&e.destroy()}));let u=i.matchTransition(a.value,l.value,e,l.params),c=!1;if(!u){if(!s)return;u=i.fallbackTransition,c=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:u,fromState:a,toState:l,player:r,isFallbackTransition:c}),c||(et(e,Be),r.onStart((()=>{tt(e,Be)}))),r.onDone((()=>{let t=this.players.indexOf(r);t>=0&&this.players.splice(t,1);const n=this._engine.playersByElement.get(e);if(n){let e=n.indexOf(r);e>=0&&n.splice(e,1)}})),this.players.push(r),h.push(r),r}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach((t=>t.delete(e))),this._elementListeners.forEach(((t,n)=>{this._elementListeners.set(n,t.filter((t=>t.name!=e)))}))}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach((e=>e.destroy())),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const n=this._engine.driver.query(e,D,!0);n.forEach((e=>{if(e.__ng_removed)return;const n=this._engine.fetchNamespacesByElement(e);n.size?n.forEach((n=>n.triggerLeaveAnimation(e,t,!1,!0))):this.clearElementCache(e)})),this._engine.afterFlushAnimationsDone((()=>n.forEach((e=>this.clearElementCache(e)))))}triggerLeaveAnimation(e,t,n,s){const i=this._engine.statesByElement.get(e),r=new Map;if(i){const o=[];if(i.forEach(((t,n)=>{if(r.set(n,t.value),this._triggers.has(n)){const t=this.trigger(e,n,Ue,s);t&&o.push(t)}})),o.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,r),n&&h(o).onDone((()=>this._engine.processLeaveNode(e))),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),n=this._engine.statesByElement.get(e);if(t&&n){const s=new Set;t.forEach((t=>{const i=t.name;if(s.has(i))return;s.add(i);const r=this._triggers.get(i).fallbackTransition,o=n.get(i)||We,a=new je(Ue),l=new He(this.id,i,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:i,transition:r,fromState:o,toState:a,player:l,isFallbackTransition:!0})}))}}removeNode(e,t){const n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let s=!1;if(n.totalAnimations){const t=n.players.length?n.playersByQueriedElement.get(e):[];if(t&&t.length)s=!0;else{let t=e;for(;t=t.parentNode;){if(n.statesByElement.get(t)){s=!0;break}}}}if(this.prepareLeaveAnimationListeners(e),s)n.markElementAsRemoved(this.id,e,!1,t);else{const s=e.__ng_removed;s&&s!==Ke||(n.afterFlush((()=>this.clearElementCache(e))),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){et(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach((n=>{const s=n.player;if(s.destroyed)return;const i=n.element,r=this._elementListeners.get(i);r&&r.forEach((t=>{if(t.name==n.triggerName){const s=d(i,n.triggerName,n.fromState.value,n.toState.value);s._data=e,c(n.player,t.phase,s,t.callback)}})),s.markedForDestroy?this._engine.afterFlush((()=>{s.destroy()})):t.push(n)})),this._queue=[],t.sort(((e,t)=>{const n=e.transition.ast.depCount,s=t.transition.ast.depCount;return 0==n||0==s?n-s:this._engine.driver.containsElement(e.element,t.element)?1:-1}))}destroy(e){this.players.forEach((e=>e.destroy())),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find((t=>t.element===e))||t,t}}class Ye{constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(e,t)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach((t=>{t.players.forEach((t=>{t.queued&&e.push(t)}))})),e}createNamespace(e,t){const n=new Ve(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){const n=this._namespaceList,s=this.namespacesByHostElement;if(n.length-1>=0){let i=!1,r=this.driver.getParentElement(t);for(;r;){const t=s.get(r);if(t){const s=n.indexOf(t);n.splice(s+1,0,e),i=!0;break}r=this.driver.getParentElement(r)}i||n.unshift(e)}else n.push(e);return s.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let s=this._namespaceLookup[e];s&&s.register(t,n)&&this.totalAnimations++}destroy(e,t){if(!e)return;const n=this._fetchNamespace(e);this.afterFlush((()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[e];const t=this._namespaceList.indexOf(n);t>=0&&this._namespaceList.splice(t,1)})),this.afterFlushAnimationsDone((()=>n.destroy(t)))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,n=this.statesByElement.get(e);if(n)for(let e of n.values())if(e.namespaceId){const n=this._fetchNamespace(e.namespaceId);n&&t.add(n)}return t}trigger(e,t,n,s){if(Ge(t)){const i=this._fetchNamespace(e);if(i)return i.trigger(t,n,s),!0}return!1}insertNode(e,t,n,s){if(!Ge(t))return;const i=t.__ng_removed;if(i&&i.setForRemoval){i.setForRemoval=!1,i.setForMove=!0;const e=this.collectedLeaveElements.indexOf(t);e>=0&&this.collectedLeaveElements.splice(e,1)}if(e){const s=this._fetchNamespace(e);s&&s.insertNode(t,n)}s&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),et(e,Ie)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),tt(e,Ie))}removeNode(e,t,n,s){if(Ge(t)){const i=e?this._fetchNamespace(e):null;if(i?i.removeNode(t,s):this.markElementAsRemoved(e,t,!1,s),n){const n=this.namespacesByHostElement.get(t);n&&n.id!==e&&n.removeNode(t,s)}}else this._onRemovalComplete(t,s)}markElementAsRemoved(e,t,n,s,i){this.collectedLeaveElements.push(t),t.__ng_removed={namespaceId:e,setForRemoval:s,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:i}}listen(e,t,n,s,i){return Ge(t)?this._fetchNamespace(e).listen(t,n,s,i):()=>{}}_buildInstruction(e,t,n,s,i){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,s,e.fromState.options,e.toState.options,t,i)}destroyInnerAnimations(e){let t=this.driver.query(e,D,!0);t.forEach((e=>this.destroyActiveAnimationsForElement(e))),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,R,!0),t.forEach((e=>this.finishActiveQueriedAnimationOnElement(e))))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach((e=>{e.queued?e.markedForDestroy=!0:e.destroy()}))}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach((e=>e.finish()))}whenRenderingDone(){return new Promise((e=>{if(this.players.length)return h(this.players).onDone((()=>e()));e()}))}processLeaveNode(e){const t=e.__ng_removed;if(t&&t.setForRemoval){if(e.__ng_removed=Ke,t.namespaceId){this.destroyInnerAnimations(e);const n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(Ie)&&this.markElementAsDisabled(e,!1),this.driver.query(e,".ng-animate-disabled",!0).forEach((e=>{this.markElementAsDisabled(e,!1)}))}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach(((e,t)=>this._balanceNamespaceList(e,t))),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let e=0;ee())),this._flushFns=[],this._whenQuietFns.length){const e=this._whenQuietFns;this._whenQuietFns=[],t.length?h(t).onDone((()=>{e.forEach((e=>e()))})):e.forEach((e=>e()))}}reportError(e){throw function(e){return new n["ɵRuntimeError"](3402,ngDevMode&&`Unable to process animations due to the following failed trigger transitions\n ${e.map((e=>e.message)).join("\n")}`)}(e)}_flushAnimations(e,s){const i=new _e,r=[],o=new Map,a=[],l=new Map,u=new Map,c=new Map,m=new Set;this.disabledNodes.forEach((e=>{m.add(e);const t=this.driver.query(e,".ng-animate-queued",!0);for(let e=0;e{const n=P+_++;g.set(t,n),e.forEach((e=>et(e,n)))}));const v=[],S=new Set,E=new Set;for(let e=0;eS.add(e))):E.add(t))}const w=new Map,b=Xe(f,Array.from(S));b.forEach(((e,t)=>{const n=M+_++;w.set(t,n),e.forEach((e=>et(e,n)))})),e.push((()=>{y.forEach(((e,t)=>{const n=g.get(t);e.forEach((e=>tt(e,n)))})),b.forEach(((e,t)=>{const n=w.get(t);e.forEach((e=>tt(e,n)))})),v.forEach((e=>{this.processLeaveNode(e)}))}));const T=[],k=[];for(let e=this._namespaceList.length-1;e>=0;e--){this._namespaceList[e].drainQueuedTransitions(s).forEach((e=>{const t=e.player,n=e.element;if(T.push(t),this.collectedEnterElements.length){const s=n.__ng_removed;if(s&&s.setForMove){if(s.previousTriggersValues&&s.previousTriggersValues.has(e.triggerName)){const t=s.previousTriggersValues.get(e.triggerName),n=this.statesByElement.get(e.element);if(n&&n.has(e.triggerName)){const s=n.get(e.triggerName);s.value=t,n.set(e.triggerName,s)}}return void t.destroy()}}const s=!d||!this.driver.containsElement(d,n),o=w.get(n),h=g.get(n),m=this._buildInstruction(e,i,h,o,s);if(m.errors&&m.errors.length)return void k.push(m);if(s)return t.onStart((()=>j(n,m.fromStyles))),t.onDestroy((()=>$(n,m.toStyles))),void r.push(t);if(e.isFallbackTransition)return t.onStart((()=>j(n,m.fromStyles))),t.onDestroy((()=>$(n,m.toStyles))),void r.push(t);const f=[];m.timelines.forEach((e=>{e.stretchStartingKeyframe=!0,this.disabledNodes.has(e.element)||f.push(e)})),m.timelines=f,i.append(n,m.timelines);const y={instruction:m,player:t,element:n};a.push(y),m.queriedElements.forEach((e=>p(l,e,[]).push(t))),m.preStyleProps.forEach(((e,t)=>{if(e.size){let n=u.get(t);n||u.set(t,n=new Set),e.forEach(((e,t)=>n.add(t)))}})),m.postStyleProps.forEach(((e,t)=>{let n=c.get(t);n||c.set(t,n=new Set),e.forEach(((e,t)=>n.add(t)))}))}))}if(k.length){const e=[];k.forEach((t=>{e.push(function(e,t){return new n["ɵRuntimeError"](3505,ngDevMode&&`@${e} has failed due to:\n ${t.map((e=>e.message)).join("\n- ")}`)}(t.triggerName,t.errors))})),T.forEach((e=>e.destroy())),this.reportError(e)}const A=new Map,N=new Map;a.forEach((e=>{const t=e.element;i.has(t)&&(N.set(t,t),this._beforeAnimationBuild(e.player.namespaceId,e.instruction,A))})),r.forEach((e=>{const t=e.element;this._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach((e=>{p(A,t,[]).push(e),e.destroy()}))}));const D=v.filter((e=>it(e,u,c))),C=new Map;Je(C,this.driver,E,c,t.AUTO_STYLE).forEach((e=>{it(e,u,c)&&D.push(e)}));const F=new Map;y.forEach(((e,n)=>{Je(F,this.driver,new Set(e),u,t["ɵPRE_STYLE"])})),D.forEach((e=>{const t=C.get(e),n=F.get(e);C.set(e,new Map([...Array.from(t?.entries()??[]),...Array.from(n?.entries()??[])]))}));const x=[],L=[],z={};a.forEach((e=>{const{element:t,player:n,instruction:s}=e;if(i.has(t)){if(m.has(t))return n.onDestroy((()=>$(t,s.toStyles))),n.disabled=!0,n.overrideTotalTime(s.totalTime),void r.push(n);let e=z;if(N.size>1){let n=t;const s=[];for(;n=n.parentNode;){const t=N.get(n);if(t){e=t;break}s.push(n)}s.forEach((t=>N.set(t,e)))}const i=this._buildAnimation(n.namespaceId,s,A,o,F,C);if(n.setRealPlayer(i),e===z)x.push(n);else{const t=this.playersByElement.get(e);t&&t.length&&(n.parentPlayer=h(t)),r.push(n)}}else j(t,s.fromStyles),n.onDestroy((()=>$(t,s.toStyles))),L.push(n),m.has(t)&&r.push(n)})),L.forEach((e=>{const t=o.get(e.element);if(t&&t.length){const n=h(t);e.setRealPlayer(n)}})),r.forEach((e=>{e.parentPlayer?e.syncPlayerEvents(e.parentPlayer):e.destroy()}));for(let e=0;e!e.destroyed));i.length?nt(this,t,i):this.processLeaveNode(t)}return v.length=0,x.forEach((e=>{this.players.push(e),e.onDone((()=>{e.destroy();const t=this.players.indexOf(e);this.players.splice(t,1)})),e.play()})),x}elementContainsData(e,t){let n=!1;const s=t.__ng_removed;return s&&s.setForRemoval&&(n=!0),this.playersByElement.has(t)&&(n=!0),this.playersByQueriedElement.has(t)&&(n=!0),this.statesByElement.has(t)&&(n=!0),this._fetchNamespace(e).elementContainsData(t)||n}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,s,i){let r=[];if(t){const t=this.playersByQueriedElement.get(e);t&&(r=t)}else{const t=this.playersByElement.get(e);if(t){const e=!i||i==Ue;t.forEach((t=>{t.queued||(e||t.triggerName==s)&&r.push(t)}))}}return(n||s)&&(r=r.filter((e=>(!n||n==e.namespaceId)&&(!s||s==e.triggerName)))),r}_beforeAnimationBuild(e,t,n){const s=t.triggerName,i=t.element,r=t.isRemovalTransition?void 0:e,o=t.isRemovalTransition?void 0:s;for(const e of t.timelines){const s=e.element,a=s!==i,l=p(n,s,[]);this._getPreviousPlayers(s,a,r,o,t.toState).forEach((e=>{const t=e.getRealPlayer();t.beforeDestroy&&t.beforeDestroy(),e.destroy(),l.push(e)}))}j(i,t.fromStyles)}_buildAnimation(e,n,s,i,r,o){const a=n.triggerName,l=n.element,c=[],m=new Set,d=new Set,f=n.timelines.map((n=>{const h=n.element;m.add(h);const p=h.__ng_removed;if(p&&p.removedBeforeQueried)return new t.NoopAnimationPlayer(n.duration,n.delay);const f=h!==l,y=function(e){const t=[];return st(e,t),t}((s.get(h)||Qe).map((e=>e.getRealPlayer()))).filter((e=>{const t=e;return!!t.element&&t.element===h})),g=r.get(h),_=o.get(h),v=u(this.driver,this._normalizer,0,n.keyframes,g,_),S=this._buildPlayer(n,v,y);if(n.subTimeline&&i&&d.add(h),f){const t=new He(e,a,h);t.setRealPlayer(S),c.push(t)}return S}));c.forEach((e=>{p(this.playersByQueriedElement,e.element,[]).push(e),e.onDone((()=>function(e,t,n){let s=e.get(t);if(s){if(s.length){const e=s.indexOf(n);s.splice(e,1)}0==s.length&&e.delete(t)}return s}(this.playersByQueriedElement,e.element,e)))})),m.forEach((e=>et(e,C)));const y=h(f);return y.onDestroy((()=>{m.forEach((e=>tt(e,C))),$(l,n.toStyles)})),d.forEach((e=>{p(i,e,[]).push(y)})),y}_buildPlayer(e,n,s){return n.length>0?this.driver.animate(e.element,n,e.duration,e.delay,e.easing,s):new t.NoopAnimationPlayer(e.duration,e.delay)}}class He{constructor(e,n,s){this.namespaceId=e,this.triggerName=n,this.element=s,this._player=new t.NoopAnimationPlayer,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach(((t,n)=>{t.forEach((t=>c(e,n,void 0,t)))})),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart((()=>t.triggerCallback("start"))),e.onDone((()=>this.finish())),e.onDestroy((()=>this.destroy()))}_queueEvent(e,t){p(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function Ge(e){return e&&1===e.nodeType}function Ze(e,t){const n=e.style.display;return e.style.display=null!=t?t:"none",n}function Je(e,t,n,s,i){const r=[];n.forEach((e=>r.push(Ze(e))));const o=[];s.forEach(((n,s)=>{const r=new Map;n.forEach((e=>{const n=t.computeStyle(s,e,i);r.set(e,n),n&&0!=n.length||(s.__ng_removed=$e,o.push(s))})),e.set(s,r)}));let a=0;return n.forEach((e=>Ze(e,r[a++]))),o}function Xe(e,t){const n=new Map;if(e.forEach((e=>n.set(e,[]))),0==t.length)return n;const s=new Set(t),i=new Map;function r(e){if(!e)return 1;let t=i.get(e);if(t)return t;const o=e.parentNode;return t=n.has(o)?o:s.has(o)?1:r(o),i.set(e,t),t}return t.forEach((e=>{const t=r(e);1!==t&&n.get(t).push(e)})),n}function et(e,t){e.classList?.add(t)}function tt(e,t){e.classList?.remove(t)}function nt(e,t,n){h(n).onDone((()=>e.processLeaveNode(t)))}function st(e,n){for(let s=0;si.add(e))):t.set(e,s),n.delete(e),!0}class rt{constructor(e,t,n){this._element=e,this._startStyles=t,this._endStyles=n,this._state=0;let s=rt.initialStylesByElement.get(e);s||rt.initialStylesByElement.set(e,s=new Map),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&$(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&($(this._element,this._initialStyles),this._endStyles&&($(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(rt.initialStylesByElement.delete(this._element),this._startStyles&&(j(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(j(this._element,this._endStyles),this._endStyles=null),$(this._element,this._initialStyles),this._state=3)}}function ot(e){let t=null;return e.forEach(((e,n)=>{(function(e){return"display"===e||"position"===e})(n)&&(t=t||new Map,t.set(n,e))})),t}rt.initialStylesByElement=new WeakMap;class at{constructor(e,t,n,s){this.element=e,this.keyframes=t,this.options=n,this._specialStyles=s,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach((e=>e())),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map,this.domPlayer.addEventListener("finish",(()=>this._onFinish()))}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){const t=[];return e.forEach((e=>{t.push(Object.fromEntries(e))})),t}_triggerWebAnimation(e,t,n){return e.animate(this._convertKeyframesToObject(t),n)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach((e=>e())),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach((e=>e())),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e=new Map;if(this.hasStarted()){this._finalKeyframe.forEach(((t,n)=>{"offset"!==n&&e.set(n,this._finished?t:ne(this.element,n))}))}this.currentSnapshot=e}triggerCallback(e){const t="start"===e?this._onStartFns:this._onDoneFns;t.forEach((e=>e())),t.length=0}}e.AnimationDriver=A,e["ɵAnimation"]=class{constructor(e,t){this._driver=e;const s=[],i=[],r=me(e,t,s,i);if(s.length)throw function(e){return new n["ɵRuntimeError"](3500,ngDevMode&&`animation validation failed:\n${e.map((e=>e.message)).join("\n")}`)}(s);i.length&&function(e){se&&console.warn(`animation validation warnings:${ie(e)}`)}(i),this._animationAst=r}buildTimelines(e,t,s,i,r){const o=Array.isArray(t)?B(t):t,a=Array.isArray(s)?B(s):s,l=[];r=r||new _e;const h=Ee(this._driver,e,this._animationAst,P,M,o,a,i,r,l);if(l.length)throw function(e){return new n["ɵRuntimeError"](3501,ngDevMode&&`animation building failed:\n${e.map((e=>e.message)).join("\n")}`)}(l);return h}},e["ɵAnimationEngine"]=class{constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n,this._triggerCache={},this.onRemovalComplete=(e,t)=>{},this._transitionEngine=new Ye(e,t,n),this._timelineEngine=new Oe(e,t,n),this._transitionEngine.onRemovalComplete=(e,t)=>this.onRemovalComplete(e,t)}registerTrigger(e,t,s,i,r){const o=e+"-"+i;let a=this._triggerCache[o];if(!a){const e=[],t=[],s=me(this._driver,r,e,t);if(e.length)throw function(e,t){return new n["ɵRuntimeError"](3404,ngDevMode&&`The animation trigger "${e}" has failed to build due to the following errors:\n - ${t.map((e=>e.message)).join("\n - ")}`)}(i,e);t.length&&function(e,t){se&&console.warn(`The animation trigger "${e}" has built with the following warnings:${ie(t)}`)}(i,t),a=function(e,t,n){return new Le(e,t,n)}(i,s,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,i,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,n,s){this._transitionEngine.insertNode(e,t,n,s)}onRemove(e,t,n,s){this._transitionEngine.removeNode(e,t,s||!1,n)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,n,s){if("@"==n.charAt(0)){const[e,i]=f(n),r=s;this._timelineEngine.command(e,t,i,r)}else this._transitionEngine.trigger(e,t,n,s)}listen(e,t,n,s,i){if("@"==n.charAt(0)){const[e,s]=f(n);return this._timelineEngine.listen(e,t,s,i)}return this._transitionEngine.listen(e,t,n,s,i)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}},e["ɵAnimationStyleNormalizer"]=Me,e["ɵNoopAnimationDriver"]=k,e["ɵNoopAnimationStyleNormalizer"]=class{normalizePropertyName(e,t){return e}normalizeStyleValue(e,t,n,s){return n}},e["ɵWebAnimationsDriver"]=class{validateStyleProperty(e){return"undefined"!=typeof ngDevMode&&!ngDevMode||w(e)}validateAnimatableStyleProperty(e){if("undefined"==typeof ngDevMode||ngDevMode){return function(e){return a.has(e)}(X(e))}return!0}matchesElement(e,t){return!1}containsElement(e,t){return b(e,t)}getParentElement(e){return v(e)}query(e,t,n){return T(e,t,n)}computeStyle(e,t,n){return window.getComputedStyle(e)[t]}animate(e,t,n,s,i,r=[]){const o={duration:n,delay:s,fill:0==s?"both":"forwards"};i&&(o.easing=i);const a=new Map,l=r.filter((e=>e instanceof at));ee(n,s)&&l.forEach((e=>{e.currentSnapshot.forEach(((e,t)=>a.set(t,e)))}));let h=O(t).map((e=>I(e)));h=function(e,t,n){if(n.size&&t.length){let s=t[0],i=[];if(n.forEach(((e,t)=>{s.has(t)||i.push(t),s.set(t,e)})),i.length)for(let n=1;ns.set(t,ne(e,t))))}}return t}(e,h,a);const u=function(e,t){let n=null,s=null;return Array.isArray(t)&&t.length?(n=ot(t[0]),t.length>1&&(s=ot(t[t.length-1]))):t instanceof Map&&(n=ot(t)),n||s?new rt(e,n,s):null}(e,h);return new at(e,h,o,u)}},e["ɵWebAnimationsPlayer"]=at,e["ɵWebAnimationsStyleNormalizer"]=class extends Me{normalizePropertyName(e,t){return J(e)}normalizeStyleValue(e,t,s,i){let r="";const o=s.toString().trim();if(Ne.has(t)&&0!==s&&"0"!==s)if("number"==typeof s)r="px";else{const t=s.match(/^[+-]?[\d\.]+([a-z]*)$/);t&&0==t[1].length&&i.push(function(e,t){return new n["ɵRuntimeError"](3005,ngDevMode&&`Please provide a CSS unit value for ${e}:${t}`)}(e,s))}return o+r}},e["ɵallowPreviousPlayerStylesMerge"]=ee,e["ɵcontainsElement"]=b,e["ɵgetParentElement"]=v,e["ɵinvokeQuery"]=T,e["ɵnormalizeKeyframes"]=O,e["ɵvalidateStyleProperty"]=w})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/animations/browser/testing/testing.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/animations/browser/testing/testing.js new file mode 100644 index 000000000..b031a5d8e --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/animations/browser/testing/testing.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/animations"),require("@angular/animations/browser"),require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/animations","@angular/animations/browser","@angular/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ngAnimationsBrowserTesting={},t.ngAnimations,t.ngAnimationsBrowser)}(this,(function(t,e,r){"use strict";const i=new Set(["-moz-outline-radius","-moz-outline-radius-bottomleft","-moz-outline-radius-bottomright","-moz-outline-radius-topleft","-moz-outline-radius-topright","-ms-grid-columns","-ms-grid-rows","-webkit-line-clamp","-webkit-text-fill-color","-webkit-text-stroke","-webkit-text-stroke-color","accent-color","all","backdrop-filter","background","background-color","background-position","background-size","block-size","border","border-block-end","border-block-end-color","border-block-end-width","border-block-start","border-block-start-color","border-block-start-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-width","border-color","border-end-end-radius","border-end-start-radius","border-image-outset","border-image-slice","border-image-width","border-inline-end","border-inline-end-color","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-width","border-left","border-left-color","border-left-width","border-radius","border-right","border-right-color","border-right-width","border-start-end-radius","border-start-start-radius","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-width","border-width","bottom","box-shadow","caret-color","clip","clip-path","color","column-count","column-gap","column-rule","column-rule-color","column-rule-width","column-width","columns","filter","flex","flex-basis","flex-grow","flex-shrink","font","font-size","font-size-adjust","font-stretch","font-variation-settings","font-weight","gap","grid-column-gap","grid-gap","grid-row-gap","grid-template-columns","grid-template-rows","height","inline-size","input-security","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","left","letter-spacing","line-clamp","line-height","margin","margin-block-end","margin-block-start","margin-bottom","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","mask","mask-border","mask-position","mask-size","max-block-size","max-height","max-inline-size","max-lines","max-width","min-block-size","min-height","min-inline-size","min-width","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","outline","outline-color","outline-offset","outline-width","padding","padding-block-end","padding-block-start","padding-bottom","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","perspective","perspective-origin","right","rotate","row-gap","scale","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-coordinate","scroll-snap-destination","scrollbar-color","shape-image-threshold","shape-margin","shape-outside","tab-size","text-decoration","text-decoration-color","text-decoration-thickness","text-emphasis","text-emphasis-color","text-indent","text-shadow","text-underline-offset","top","transform","transform-origin","translate","vertical-align","visibility","width","word-spacing","z-index","zoom"]);"undefined"!=typeof process&&{}.toString.call(process);class o{validateStyleProperty(t){return r["ɵvalidateStyleProperty"](t)}validateAnimatableStyleProperty(t){return function(t){return i.has(t)}(t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())}matchesElement(t,e){return!1}containsElement(t,e){return r["ɵcontainsElement"](t,e)}getParentElement(t){return r["ɵgetParentElement"](t)}query(t,e,i){return r["ɵinvokeQuery"](t,e,i)}computeStyle(t,e,r){return r||""}animate(t,e,r,i,s,a=[]){const l=new n(t,e,r,i,s,a);return o.log.push(l),l}}o.log=[];class n extends e.NoopAnimationPlayer{constructor(t,e,i,o,s,a){super(i,o),this.element=t,this.keyframes=e,this.duration=i,this.delay=o,this.easing=s,this.previousPlayers=a,this.__finished=!1,this.__started=!1,this.previousStyles=new Map,this._onInitFns=[],this.currentSnapshot=new Map,this._keyframes=[],this._keyframes=r["ɵnormalizeKeyframes"](e),r["ɵallowPreviousPlayerStylesMerge"](i,o)&&a.forEach((t=>{if(t instanceof n){t.currentSnapshot.forEach(((t,e)=>this.previousStyles.set(e,t)))}}))}onInit(t){this._onInitFns.push(t)}init(){super.init(),this._onInitFns.forEach((t=>t())),this._onInitFns=[]}reset(){super.reset(),this.__started=!1}finish(){super.finish(),this.__finished=!0}destroy(){super.destroy(),this.__finished=!0}triggerMicrotask(){}play(){super.play(),this.__started=!0}hasStarted(){return this.__started}beforeDestroy(){const t=new Map;this.previousStyles.forEach(((e,r)=>t.set(r,e))),this.hasStarted()&&this._keyframes.forEach((r=>{for(let[i,o]of r)"offset"!==i&&t.set(i,this.__finished?o:e.AUTO_STYLE)})),this.currentSnapshot=t}}t.MockAnimationDriver=o,t.MockAnimationPlayer=n})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/a11y/a11y.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/a11y/a11y.js new file mode 100644 index 000000000..84e6a8eb0 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/a11y/a11y.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/cdk/platform"),require("rxjs"),require("@angular/cdk/keycodes"),require("rxjs/operators"),require("@angular/cdk/coercion"),require("@angular/cdk/observers"),require("@angular/cdk/layout")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","@angular/cdk/platform","rxjs","@angular/cdk/keycodes","rxjs/operators","@angular/cdk/coercion","@angular/cdk/observers","@angular/cdk/layout"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkA11y={},e.ngCommon,e.ngCore,e.ngCdkPlatform,e.rxjs,e.ngCdkKeycodes,e.rxjsOperators,e.ngCdkCoercion,e.ngCdkObservers,e.ngCdkLayout)}(this,(function(e,t,s,n,i,r,o,a,c,u){"use strict";function h(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var d=h(s),l=h(n),_=h(c);function m(e,t){return(e.getAttribute(t)||"").match(/\S+/g)||[]}const g="cdk-describedby-message",p="cdk-describedby-host";let b=0;class y{constructor(e,t){this._platform=t,this._messageRegistry=new Map,this._messagesContainer=null,this._id=""+b++,this._document=e,this._id=s.inject(s.APP_ID)+"-"+b++}describe(e,t,s){if(!this._canBeDescribed(e,t))return;const n=f(t,s);"string"!=typeof t?(v(t,this._id),this._messageRegistry.set(n,{messageElement:t,referenceCount:0})):this._messageRegistry.has(n)||this._createMessageElement(t,s),this._isElementDescribedByMessage(e,n)||this._addMessageReference(e,n)}removeDescription(e,t,s){if(!t||!this._isElementNode(e))return;const n=f(t,s);if(this._isElementDescribedByMessage(e,n)&&this._removeMessageReference(e,n),"string"==typeof t){const e=this._messageRegistry.get(n);e&&0===e.referenceCount&&this._deleteMessageElement(n)}0===this._messagesContainer?.childNodes.length&&(this._messagesContainer.remove(),this._messagesContainer=null)}ngOnDestroy(){const e=this._document.querySelectorAll(`[cdk-describedby-host="${this._id}"]`);for(let t=0;t0!=e.indexOf(g)));e.setAttribute("aria-describedby",t.join(" "))}_addMessageReference(e,t){const s=this._messageRegistry.get(t);!function(e,t,s){const n=m(e,t);n.some((e=>e.trim()==s.trim()))||(n.push(s.trim()),e.setAttribute(t,n.join(" ")))}(e,"aria-describedby",s.messageElement.id),e.setAttribute(p,this._id),s.referenceCount++}_removeMessageReference(e,t){const s=this._messageRegistry.get(t);s.referenceCount--,function(e,t,s){const n=m(e,t).filter((e=>e!=s.trim()));n.length?e.setAttribute(t,n.join(" ")):e.removeAttribute(t)}(e,"aria-describedby",s.messageElement.id),e.removeAttribute(p)}_isElementDescribedByMessage(e,t){const s=m(e,"aria-describedby"),n=this._messageRegistry.get(t),i=n&&n.messageElement.id;return!!i&&-1!=s.indexOf(i)}_canBeDescribed(e,t){if(!this._isElementNode(e))return!1;if(t&&"object"==typeof t)return!0;const s=null==t?"":`${t}`.trim(),n=e.getAttribute("aria-label");return!!s&&(!n||n.trim()!==s)}_isElementNode(e){return e.nodeType===this._document.ELEMENT_NODE}}function f(e,t){return"string"==typeof e?`${t||""}/${e}`:e}function v(e,t){e.id||(e.id=`cdk-describedby-message-${t}-${b++}`)}y.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:y,deps:[{token:t.DOCUMENT},{token:l.Platform}],target:d.ɵɵFactoryTarget.Injectable}),y.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:y,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:y,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:s.Inject,args:[t.DOCUMENT]}]},{type:l.Platform}]}});class I{constructor(e){this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new i.Subject,this._typeaheadSubscription=i.Subscription.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._pageUpAndDown={enabled:!1,delta:10},this._skipPredicateFn=e=>e.disabled,this._pressedLetters=[],this.tabOut=new i.Subject,this.change=new i.Subject,e instanceof s.QueryList&&(this._itemChangesSubscription=e.changes.subscribe((e=>{if(this._activeItem){const t=e.toArray().indexOf(this._activeItem);t>-1&&t!==this._activeItemIndex&&(this._activeItemIndex=t)}})))}skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){if(("undefined"==typeof ngDevMode||ngDevMode)&&this._items.length&&this._items.some((e=>"function"!=typeof e.getLabel)))throw Error("ListKeyManager items in typeahead mode must implement the `getLabel` method.");return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(o.tap((e=>this._pressedLetters.push(e))),o.debounceTime(e),o.filter((()=>this._pressedLetters.length>0)),o.map((()=>this._pressedLetters.join("")))).subscribe((e=>{const t=this._getItemsArray();for(let s=1;s!e[t]||this._allowedModifierKeys.indexOf(t)>-1));switch(t){case r.TAB:return void this.tabOut.next();case r.DOWN_ARROW:if(this._vertical&&s){this.setNextItemActive();break}return;case r.UP_ARROW:if(this._vertical&&s){this.setPreviousItemActive();break}return;case r.RIGHT_ARROW:if(this._horizontal&&s){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case r.LEFT_ARROW:if(this._horizontal&&s){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case r.HOME:if(this._homeAndEnd&&s){this.setFirstItemActive();break}return;case r.END:if(this._homeAndEnd&&s){this.setLastItemActive();break}return;case r.PAGE_UP:if(this._pageUpAndDown.enabled&&s){const e=this._activeItemIndex-this._pageUpAndDown.delta;this._setActiveItemByIndex(e>0?e:0,1);break}return;case r.PAGE_DOWN:if(this._pageUpAndDown.enabled&&s){const e=this._activeItemIndex+this._pageUpAndDown.delta,t=this._getItemsArray().length;this._setActiveItemByIndex(e=r.A&&t<=r.Z||t>=r.ZERO&&t<=r.NINE)&&this._letterKeyStream.next(String.fromCharCode(t))))}this._pressedLetters=[],e.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem}isTyping(){return this._pressedLetters.length>0}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._items.length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(e){const t=this._getItemsArray(),s="number"==typeof e?e:t.indexOf(e),n=t[s];this._activeItem=null==n?null:n,this._activeItemIndex=s}destroy(){this._typeaheadSubscription.unsubscribe(),this._itemChangesSubscription?.unsubscribe(),this._letterKeyStream.complete(),this.tabOut.complete(),this.change.complete(),this._pressedLetters=[]}_setActiveItemByDelta(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}_setActiveInWrapMode(e){const t=this._getItemsArray();for(let s=1;s<=t.length;s++){const n=(this._activeItemIndex+e*s+t.length)%t.length,i=t[n];if(!this._skipPredicateFn(i))return void this.setActiveItem(n)}}_setActiveInDefaultMode(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}_setActiveItemByIndex(e,t){const s=this._getItemsArray();if(s[e]){for(;this._skipPredicateFn(s[e]);)if(!s[e+=t])return;this.setActiveItem(e)}}_getItemsArray(){return this._items instanceof s.QueryList?this._items.toArray():this._items}}class A{constructor(e){this._platform=e}isDisabled(e){return e.hasAttribute("disabled")}isVisible(e){return function(e){return!!(e.offsetWidth||e.offsetHeight||"function"==typeof e.getClientRects&&e.getClientRects().length)}(e)&&"visible"===getComputedStyle(e).visibility}isTabbable(e){if(!this._platform.isBrowser)return!1;const t=function(e){try{return e.frameElement}catch{return null}}((s=e).ownerDocument&&s.ownerDocument.defaultView||window);var s;if(t){if(-1===E(t))return!1;if(!this.isVisible(t))return!1}let n=e.nodeName.toLowerCase(),i=E(e);return e.hasAttribute("contenteditable")?-1!==i:"iframe"!==n&&"object"!==n&&(!(this._platform.WEBKIT&&this._platform.IOS&&!function(e){let t=e.nodeName.toLowerCase(),s="input"===t&&e.type;return"text"===s||"password"===s||"select"===t||"textarea"===t}(e))&&("audio"===n?!!e.hasAttribute("controls")&&-1!==i:"video"===n?-1!==i&&(null!==i||(this._platform.FIREFOX||e.hasAttribute("controls"))):e.tabIndex>=0))}isFocusable(e,t){return function(e){if(function(e){return function(e){return"input"==e.nodeName.toLowerCase()}(e)&&"hidden"==e.type}(e))return!1;return function(e){let t=e.nodeName.toLowerCase();return"input"===t||"select"===t||"button"===t||"textarea"===t}(e)||function(e){return function(e){return"a"==e.nodeName.toLowerCase()}(e)&&e.hasAttribute("href")}(e)||e.hasAttribute("contenteditable")||T(e)}(e)&&!this.isDisabled(e)&&(t?.ignoreVisibility||this.isVisible(e))}}function T(e){if(!e.hasAttribute("tabindex")||void 0===e.tabIndex)return!1;let t=e.getAttribute("tabindex");return!(!t||isNaN(parseInt(t,10)))}function E(e){if(!T(e))return null;const t=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(t)?-1:t}A.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:A,deps:[{token:l.Platform}],target:d.ɵɵFactoryTarget.Injectable}),A.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:A,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:A,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:l.Platform}]}});class k{constructor(e,t,s,n,i=!1){this._element=e,this._checker=t,this._ngZone=s,this._document=n,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,i||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.remove()),t&&(t.removeEventListener("focus",this.endAnchorListener),t.remove()),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular((()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))})),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(e){return new Promise((t=>{this._executeOnStable((()=>t(this.focusInitialElement(e))))}))}focusFirstTabbableElementWhenReady(e){return new Promise((t=>{this._executeOnStable((()=>t(this.focusFirstTabbableElement(e))))}))}focusLastTabbableElementWhenReady(e){return new Promise((t=>{this._executeOnStable((()=>t(this.focusLastTabbableElement(e))))}))}_getRegionBoundary(e){const t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);if("undefined"==typeof ngDevMode||ngDevMode)for(let s=0;s=0;e--){const s=t[e].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[e]):null;if(s)return s}return null}_createAnchor(){const e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(o.take(1)).subscribe(e)}}class C{constructor(e,t,s){this._checker=e,this._ngZone=t,this._document=s}create(e,t=!1){return new k(e,this._checker,this._ngZone,this._document,t)}}C.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:C,deps:[{token:A},{token:d.NgZone},{token:t.DOCUMENT}],target:d.ɵɵFactoryTarget.Injectable}),C.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:C,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:C,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:A},{type:d.NgZone},{type:void 0,decorators:[{type:s.Inject,args:[t.DOCUMENT]}]}]}});class F{constructor(e,t,s){this._elementRef=e,this._focusTrapFactory=t,this._previouslyFocusedElement=null,this.focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement,!0)}get enabled(){return this.focusTrap.enabled}set enabled(e){this.focusTrap.enabled=a.coerceBooleanProperty(e)}get autoCapture(){return this._autoCapture}set autoCapture(e){this._autoCapture=a.coerceBooleanProperty(e)}ngOnDestroy(){this.focusTrap.destroy(),this._previouslyFocusedElement&&(this._previouslyFocusedElement.focus(),this._previouslyFocusedElement=null)}ngAfterContentInit(){this.focusTrap.attachAnchors(),this.autoCapture&&this._captureFocus()}ngDoCheck(){this.focusTrap.hasAttached()||this.focusTrap.attachAnchors()}ngOnChanges(e){const t=e.autoCapture;t&&!t.firstChange&&this.autoCapture&&this.focusTrap.hasAttached()&&this._captureFocus()}_captureFocus(){this._previouslyFocusedElement=n._getFocusedElementPierceShadowDom(),this.focusTrap.focusInitialElementWhenReady()}}F.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:F,deps:[{token:d.ElementRef},{token:C},{token:t.DOCUMENT}],target:d.ɵɵFactoryTarget.Directive}),F.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:F,selector:"[cdkTrapFocus]",inputs:{enabled:["cdkTrapFocus","enabled"],autoCapture:["cdkTrapFocusAutoCapture","autoCapture"]},exportAs:["cdkTrapFocus"],usesOnChanges:!0,ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:F,decorators:[{type:s.Directive,args:[{selector:"[cdkTrapFocus]",exportAs:"cdkTrapFocus"}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:C},{type:void 0,decorators:[{type:s.Inject,args:[t.DOCUMENT]}]}]},propDecorators:{enabled:[{type:s.Input,args:["cdkTrapFocus"]}],autoCapture:[{type:s.Input,args:["cdkTrapFocusAutoCapture"]}]}});class D extends k{constructor(e,t,s,n,i,r,o){super(e,t,s,n,o.defer),this._focusTrapManager=i,this._inertStrategy=r,this._focusTrapManager.register(this)}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._enabled?this._focusTrapManager.register(this):this._focusTrapManager.deregister(this)}destroy(){this._focusTrapManager.deregister(this),super.destroy()}_enable(){this._inertStrategy.preventFocus(this),this.toggleAnchors(!0)}_disable(){this._inertStrategy.allowFocus(this),this.toggleAnchors(!1)}}const M=new s.InjectionToken("FOCUS_TRAP_INERT_STRATEGY");class O{constructor(){this._listener=null}preventFocus(e){this._listener&&e._document.removeEventListener("focus",this._listener,!0),this._listener=t=>this._trapFocus(e,t),e._ngZone.runOutsideAngular((()=>{e._document.addEventListener("focus",this._listener,!0)}))}allowFocus(e){this._listener&&(e._document.removeEventListener("focus",this._listener,!0),this._listener=null)}_trapFocus(e,t){const s=t.target,n=e._element;!s||n.contains(s)||s.closest?.("div.cdk-overlay-pane")||setTimeout((()=>{e.enabled&&!n.contains(e._document.activeElement)&&e.focusFirstTabbableElement()}))}}class w{constructor(){this._focusTrapStack=[]}register(e){this._focusTrapStack=this._focusTrapStack.filter((t=>t!==e));let t=this._focusTrapStack;t.length&&t[t.length-1]._disable(),t.push(e),e._enable()}deregister(e){e._disable();const t=this._focusTrapStack,s=t.indexOf(e);-1!==s&&(t.splice(s,1),t.length&&t[t.length-1]._enable())}}w.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:w,deps:[],target:d.ɵɵFactoryTarget.Injectable}),w.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:w,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:w,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}]});class L{constructor(e,t,s,n,i){this._checker=e,this._ngZone=t,this._focusTrapManager=s,this._document=n,this._inertStrategy=i||new O}create(e,t={defer:!1}){let s;return s="boolean"==typeof t?{defer:t}:t,new D(e,this._checker,this._ngZone,this._document,this._focusTrapManager,this._inertStrategy,s)}}function N(e){return 0===e.buttons||0===e.offsetX&&0===e.offsetY}function x(e){const t=e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0];return!(!t||-1!==t.identifier||null!=t.radiusX&&1!==t.radiusX||null!=t.radiusY&&1!==t.radiusY)}L.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:L,deps:[{token:A},{token:d.NgZone},{token:w},{token:t.DOCUMENT},{token:M,optional:!0}],target:d.ɵɵFactoryTarget.Injectable}),L.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:L,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:L,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:A},{type:d.NgZone},{type:w},{type:void 0,decorators:[{type:s.Inject,args:[t.DOCUMENT]}]},{type:void 0,decorators:[{type:s.Optional},{type:s.Inject,args:[M]}]}]}});const R=new s.InjectionToken("cdk-input-modality-detector-options"),j={ignoreKeys:[r.ALT,r.CONTROL,r.MAC_META,r.META,r.SHIFT]},S=n.normalizePassiveListenerOptions({passive:!0,capture:!0});class P{constructor(e,t,s,r){this._platform=e,this._mostRecentTarget=null,this._modality=new i.BehaviorSubject(null),this._lastTouchMs=0,this._onKeydown=e=>{this._options?.ignoreKeys?.some((t=>t===e.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=n._getEventTarget(e))},this._onMousedown=e=>{Date.now()-this._lastTouchMs<650||(this._modality.next(N(e)?"keyboard":"mouse"),this._mostRecentTarget=n._getEventTarget(e))},this._onTouchstart=e=>{x(e)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=n._getEventTarget(e))},this._options={...j,...r},this.modalityDetected=this._modality.pipe(o.skip(1)),this.modalityChanged=this.modalityDetected.pipe(o.distinctUntilChanged()),e.isBrowser&&t.runOutsideAngular((()=>{s.addEventListener("keydown",this._onKeydown,S),s.addEventListener("mousedown",this._onMousedown,S),s.addEventListener("touchstart",this._onTouchstart,S)}))}get mostRecentModality(){return this._modality.value}ngOnDestroy(){this._modality.complete(),this._platform.isBrowser&&(document.removeEventListener("keydown",this._onKeydown,S),document.removeEventListener("mousedown",this._onMousedown,S),document.removeEventListener("touchstart",this._onTouchstart,S))}}P.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:P,deps:[{token:l.Platform},{token:d.NgZone},{token:t.DOCUMENT},{token:R,optional:!0}],target:d.ɵɵFactoryTarget.Injectable}),P.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:P,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:P,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:l.Platform},{type:d.NgZone},{type:Document,decorators:[{type:s.Inject,args:[t.DOCUMENT]}]},{type:void 0,decorators:[{type:s.Optional},{type:s.Inject,args:[R]}]}]}});const V=new s.InjectionToken("liveAnnouncerElement",{providedIn:"root",factory:B});function B(){return null}const U=new s.InjectionToken("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let Z=0;class K{constructor(e,t,s,n){this._ngZone=t,this._defaultOptions=n,this._document=s,this._liveElement=e||this._createLiveElement()}announce(e,...t){const s=this._defaultOptions;let n,i;return 1===t.length&&"number"==typeof t[0]?i=t[0]:[n,i]=t,this.clear(),clearTimeout(this._previousTimeout),n||(n=s&&s.politeness?s.politeness:"polite"),null==i&&s&&(i=s.duration),this._liveElement.setAttribute("aria-live",n),this._liveElement.id&&this._exposeAnnouncerToModals(this._liveElement.id),this._ngZone.runOutsideAngular((()=>(this._currentPromise||(this._currentPromise=new Promise((e=>this._currentResolve=e))),clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout((()=>{this._liveElement.textContent=e,"number"==typeof i&&(this._previousTimeout=setTimeout((()=>this.clear()),i)),this._currentResolve(),this._currentPromise=this._currentResolve=void 0}),100),this._currentPromise)))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement?.remove(),this._liveElement=null,this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0}_createLiveElement(){const e="cdk-live-announcer-element",t=this._document.getElementsByClassName(e),s=this._document.createElement("div");for(let e=0;e .cdk-overlay-container [aria-modal="true"]');for(let s=0;sthis._contentObserver.observe(this._elementRef).subscribe((()=>{const e=this._elementRef.nativeElement.textContent;e!==this._previousAnnouncedText&&(this._liveAnnouncer.announce(e,this._politeness,this.duration),this._previousAnnouncedText=e)})))))}ngOnDestroy(){this._subscription&&this._subscription.unsubscribe()}}W.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:W,deps:[{token:d.ElementRef},{token:K},{token:_.ContentObserver},{token:d.NgZone}],target:d.ɵɵFactoryTarget.Directive}),W.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:W,selector:"[cdkAriaLive]",inputs:{politeness:["cdkAriaLive","politeness"],duration:["cdkAriaLiveDuration","duration"]},exportAs:["cdkAriaLive"],ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:W,decorators:[{type:s.Directive,args:[{selector:"[cdkAriaLive]",exportAs:"cdkAriaLive"}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:K},{type:_.ContentObserver},{type:d.NgZone}]},propDecorators:{politeness:[{type:s.Input,args:["cdkAriaLive"]}],duration:[{type:s.Input,args:["cdkAriaLiveDuration"]}]}});const H=new s.InjectionToken("cdk-focus-monitor-default-options"),$=n.normalizePassiveListenerOptions({passive:!0,capture:!0});class q{constructor(e,t,s,r,o){this._ngZone=e,this._platform=t,this._inputModalityDetector=s,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=window.setTimeout((()=>this._windowFocused=!1))},this._stopInputModalityDetector=new i.Subject,this._rootNodeFocusAndBlurListener=e=>{for(let t=n._getEventTarget(e);t;t=t.parentElement)"focus"===e.type?this._onFocus(e,t):this._onBlur(e,t)},this._document=r,this._detectionMode=o?.detectionMode||0}monitor(e,t=!1){const s=a.coerceElement(e);if(!this._platform.isBrowser||1!==s.nodeType)return i.of(null);const r=n._getShadowRoot(s)||this._getDocument(),o=this._elementInfo.get(s);if(o)return t&&(o.checkChildren=!0),o.subject;const c={checkChildren:t,subject:new i.Subject,rootNode:r};return this._elementInfo.set(s,c),this._registerGlobalListeners(c),c.subject}stopMonitoring(e){const t=a.coerceElement(e),s=this._elementInfo.get(t);s&&(s.subject.complete(),this._setClasses(t),this._elementInfo.delete(t),this._removeGlobalListeners(s))}focusVia(e,t,s){const n=a.coerceElement(e);n===this._getDocument().activeElement?this._getClosestElementsInfo(n).forEach((([e,s])=>this._originChanged(e,t,s))):(this._setOrigin(t),"function"==typeof n.focus&&n.focus(s))}ngOnDestroy(){this._elementInfo.forEach(((e,t)=>this.stopMonitoring(t)))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_getFocusOrigin(e){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(e)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:e&&this._isLastInteractionFromInputLabel(e)?"mouse":"program"}_shouldBeAttributedToTouch(e){return 1===this._detectionMode||!!e?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(e,t){e.classList.toggle("cdk-focused",!!t),e.classList.toggle("cdk-touch-focused","touch"===t),e.classList.toggle("cdk-keyboard-focused","keyboard"===t),e.classList.toggle("cdk-mouse-focused","mouse"===t),e.classList.toggle("cdk-program-focused","program"===t)}_setOrigin(e,t=!1){this._ngZone.runOutsideAngular((()=>{if(this._origin=e,this._originFromTouchInteraction="touch"===e&&t,0===this._detectionMode){clearTimeout(this._originTimeoutId);const e=this._originFromTouchInteraction?650:1;this._originTimeoutId=setTimeout((()=>this._origin=null),e)}}))}_onFocus(e,t){const s=this._elementInfo.get(t),i=n._getEventTarget(e);s&&(s.checkChildren||t===i)&&this._originChanged(t,this._getFocusOrigin(i),s)}_onBlur(e,t){const s=this._elementInfo.get(t);!s||s.checkChildren&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(this._setClasses(t),this._emitOrigin(s,null))}_emitOrigin(e,t){e.subject.observers.length&&this._ngZone.run((()=>e.subject.next(t)))}_registerGlobalListeners(e){if(!this._platform.isBrowser)return;const t=e.rootNode,s=this._rootNodeFocusListenerCount.get(t)||0;s||this._ngZone.runOutsideAngular((()=>{t.addEventListener("focus",this._rootNodeFocusAndBlurListener,$),t.addEventListener("blur",this._rootNodeFocusAndBlurListener,$)})),this._rootNodeFocusListenerCount.set(t,s+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular((()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)})),this._inputModalityDetector.modalityDetected.pipe(o.takeUntil(this._stopInputModalityDetector)).subscribe((e=>{this._setOrigin(e,!0)})))}_removeGlobalListeners(e){const t=e.rootNode;if(this._rootNodeFocusListenerCount.has(t)){const e=this._rootNodeFocusListenerCount.get(t);e>1?this._rootNodeFocusListenerCount.set(t,e-1):(t.removeEventListener("focus",this._rootNodeFocusAndBlurListener,$),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,$),this._rootNodeFocusListenerCount.delete(t))}if(!--this._monitoredElementCount){this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId)}}_originChanged(e,t,s){this._setClasses(e,t),this._emitOrigin(s,t),this._lastFocusOrigin=t}_getClosestElementsInfo(e){const t=[];return this._elementInfo.forEach(((s,n)=>{(n===e||s.checkChildren&&n.contains(e))&&t.push([n,s])})),t}_isLastInteractionFromInputLabel(e){const{_mostRecentTarget:t,mostRecentModality:s}=this._inputModalityDetector;if("mouse"!==s||!t||t===e||"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.disabled)return!1;const n=e.labels;if(n)for(let e=0;e{this._focusOrigin=e,this.cdkFocusChange.emit(e)}))}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._monitorSubscription&&this._monitorSubscription.unsubscribe()}}Y.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:Y,deps:[{token:d.ElementRef},{token:q}],target:d.ɵɵFactoryTarget.Directive}),Y.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:Y,selector:"[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]",outputs:{cdkFocusChange:"cdkFocusChange"},exportAs:["cdkMonitorFocus"],ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:Y,decorators:[{type:s.Directive,args:[{selector:"[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]",exportAs:"cdkMonitorFocus"}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:q}]},propDecorators:{cdkFocusChange:[{type:s.Output}]}});const G="cdk-high-contrast-black-on-white",z="cdk-high-contrast-white-on-black",X="cdk-high-contrast-active";class Q{constructor(e,t){this._platform=e,this._document=t,this._breakpointSubscription=s.inject(u.BreakpointObserver).observe("(forced-colors: active)").subscribe((()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())}))}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);const t=this._document.defaultView||window,s=t&&t.getComputedStyle?t.getComputedStyle(e):null,n=(s&&s.backgroundColor||"").replace(/ /g,"");switch(e.remove(),n){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return 2;case"rgb(255,255,255)":case"rgb(255,250,239)":return 1}return 0}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const e=this._document.body.classList;e.remove(X,G,z),this._hasCheckedHighContrastMode=!0;const t=this.getHighContrastMode();1===t?e.add(X,G):2===t&&e.add(X,z)}}}Q.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:Q,deps:[{token:l.Platform},{token:t.DOCUMENT}],target:d.ɵɵFactoryTarget.Injectable}),Q.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:Q,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:Q,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:l.Platform},{type:void 0,decorators:[{type:s.Inject,args:[t.DOCUMENT]}]}]}});class J{constructor(e){e._applyBodyHighContrastModeCssClasses()}}J.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:J,deps:[{token:Q}],target:d.ɵɵFactoryTarget.NgModule}),J.ɵmod=d.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:d,type:J,declarations:[W,F,Y],imports:[c.ObserversModule],exports:[W,F,Y]}),J.ɵinj=d.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:J,imports:[c.ObserversModule]}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:J,decorators:[{type:s.NgModule,args:[{imports:[c.ObserversModule],declarations:[W,F,Y],exports:[W,F,Y]}]}],ctorParameters:function(){return[{type:Q}]}}),e.A11yModule=J,e.ActiveDescendantKeyManager=class extends I{setActiveItem(e){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(e),this.activeItem&&this.activeItem.setActiveStyles()}},e.AriaDescriber=y,e.CDK_DESCRIBEDBY_HOST_ATTRIBUTE=p,e.CDK_DESCRIBEDBY_ID_PREFIX=g,e.CdkAriaLive=W,e.CdkMonitorFocus=Y,e.CdkTrapFocus=F,e.ConfigurableFocusTrap=D,e.ConfigurableFocusTrapFactory=L,e.EventListenerFocusTrapInertStrategy=O,e.FOCUS_MONITOR_DEFAULT_OPTIONS=H,e.FOCUS_TRAP_INERT_STRATEGY=M,e.FocusKeyManager=class extends I{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}},e.FocusMonitor=q,e.FocusTrap=k,e.FocusTrapFactory=C,e.HighContrastModeDetector=Q,e.INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS=j,e.INPUT_MODALITY_DETECTOR_OPTIONS=R,e.InputModalityDetector=P,e.InteractivityChecker=A,e.IsFocusableConfig=class{constructor(){this.ignoreVisibility=!1}},e.LIVE_ANNOUNCER_DEFAULT_OPTIONS=U,e.LIVE_ANNOUNCER_ELEMENT_TOKEN=V,e.LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY=B,e.ListKeyManager=I,e.LiveAnnouncer=K,e.MESSAGES_CONTAINER_ID="cdk-describedby-message-container",e.isFakeMousedownFromScreenReader=N,e.isFakeTouchstartFromScreenReader=x})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/accordion/accordion.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/accordion/accordion.js new file mode 100644 index 000000000..9242aaafc --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/accordion/accordion.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/cdk/collections"),require("@angular/cdk/coercion"),require("rxjs")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/cdk/collections","@angular/cdk/coercion","rxjs"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkAccordion={},e.ngCore,e.ngCdkCollections,e.ngCdkCoercion,e.rxjs)}(this,(function(e,t,o,i,n){"use strict";function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var r=s(t),c=s(o);let d=0;const a=new t.InjectionToken("CdkAccordion");class l{constructor(){this._stateChanges=new n.Subject,this._openCloseAllActions=new n.Subject,this.id="cdk-accordion-"+d++,this._multi=!1}get multi(){return this._multi}set multi(e){this._multi=i.coerceBooleanProperty(e)}openAll(){this._multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(e){this._stateChanges.next(e)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}}l.ɵfac=r.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:l,deps:[],target:r.ɵɵFactoryTarget.Directive}),l.ɵdir=r.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:l,selector:"cdk-accordion, [cdkAccordion]",inputs:{multi:"multi"},providers:[{provide:a,useExisting:l}],exportAs:["cdkAccordion"],usesOnChanges:!0,ngImport:r}),r.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:l,decorators:[{type:t.Directive,args:[{selector:"cdk-accordion, [cdkAccordion]",exportAs:"cdkAccordion",providers:[{provide:a,useExisting:l}]}]}],propDecorators:{multi:[{type:t.Input}]}});let p=0;class h{constructor(e,o,i){this.accordion=e,this._changeDetectorRef=o,this._expansionDispatcher=i,this._openCloseAllSubscription=n.Subscription.EMPTY,this.closed=new t.EventEmitter,this.opened=new t.EventEmitter,this.destroyed=new t.EventEmitter,this.expandedChange=new t.EventEmitter,this.id="cdk-accordion-child-"+p++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=i.listen(((e,t)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===t&&this.id!==e&&(this.expanded=!1)})),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(e){if(e=i.coerceBooleanProperty(e),this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();const e=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,e)}else this.closed.emit();this._changeDetectorRef.markForCheck()}}get disabled(){return this._disabled}set disabled(e){this._disabled=i.coerceBooleanProperty(e)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe((e=>{this.disabled||(this.expanded=e)}))}}h.ɵfac=r.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:h,deps:[{token:a,optional:!0,skipSelf:!0},{token:r.ChangeDetectorRef},{token:c.UniqueSelectionDispatcher}],target:r.ɵɵFactoryTarget.Directive}),h.ɵdir=r.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:h,selector:"cdk-accordion-item, [cdkAccordionItem]",inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},providers:[{provide:a,useValue:void 0}],exportAs:["cdkAccordionItem"],ngImport:r}),r.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:h,decorators:[{type:t.Directive,args:[{selector:"cdk-accordion-item, [cdkAccordionItem]",exportAs:"cdkAccordionItem",providers:[{provide:a,useValue:void 0}]}]}],ctorParameters:function(){return[{type:l,decorators:[{type:t.Optional},{type:t.Inject,args:[a]},{type:t.SkipSelf}]},{type:r.ChangeDetectorRef},{type:c.UniqueSelectionDispatcher}]},propDecorators:{closed:[{type:t.Output}],opened:[{type:t.Output}],destroyed:[{type:t.Output}],expandedChange:[{type:t.Output}],expanded:[{type:t.Input}],disabled:[{type:t.Input}]}});class u{}u.ɵfac=r.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:u,deps:[],target:r.ɵɵFactoryTarget.NgModule}),u.ɵmod=r.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:r,type:u,declarations:[l,h],exports:[l,h]}),u.ɵinj=r.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:u}),r.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:u,decorators:[{type:t.NgModule,args:[{exports:[l,h],declarations:[l,h]}]}]}),e.CdkAccordion=l,e.CdkAccordionItem=h,e.CdkAccordionModule=u})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/bidi/bidi.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/bidi/bidi.js new file mode 100644 index 000000000..95f1252c4 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/bidi/bidi.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkBidi={},e.ngCore,e.ngCommon)}(this,(function(e,t,r){"use strict";function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=n(t);const o=new t.InjectionToken("cdk-dir-doc",{providedIn:"root",factory:function(){return t.inject(r.DOCUMENT)}});const a=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function s(e){const t=e?.toLowerCase()||"";return"auto"===t&&"undefined"!=typeof navigator&&navigator?.language?a.test(navigator.language)?"rtl":"ltr":"rtl"===t?"rtl":"ltr"}class c{constructor(e){if(this.value="ltr",this.change=new t.EventEmitter,e){const t=e.body?e.body.dir:null,r=e.documentElement?e.documentElement.dir:null;this.value=s(t||r||"ltr")}}ngOnDestroy(){this.change.complete()}}c.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:c,deps:[{token:o,optional:!0}],target:i.ɵɵFactoryTarget.Injectable}),c.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:c,providedIn:"root"}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:c,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[o]}]}]}});class d{constructor(){this._dir="ltr",this._isInitialized=!1,this.change=new t.EventEmitter}get dir(){return this._dir}set dir(e){const t=this._dir;this._dir=s(e),this._rawDir=e,t!==this._dir&&this._isInitialized&&this.change.emit(this._dir)}get value(){return this.dir}ngAfterContentInit(){this._isInitialized=!0}ngOnDestroy(){this.change.complete()}}d.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:d,deps:[],target:i.ɵɵFactoryTarget.Directive}),d.ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:d,selector:"[dir]",inputs:{dir:"dir"},outputs:{change:"dirChange"},host:{properties:{"attr.dir":"_rawDir"}},providers:[{provide:c,useExisting:d}],exportAs:["dir"],ngImport:i}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:d,decorators:[{type:t.Directive,args:[{selector:"[dir]",providers:[{provide:c,useExisting:d}],host:{"[attr.dir]":"_rawDir"},exportAs:"dir"}]}],propDecorators:{change:[{type:t.Output,args:["dirChange"]}],dir:[{type:t.Input}]}});class g{}g.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:g,deps:[],target:i.ɵɵFactoryTarget.NgModule}),g.ɵmod=i.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:i,type:g,declarations:[d],exports:[d]}),g.ɵinj=i.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:g}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:g,decorators:[{type:t.NgModule,args:[{exports:[d],declarations:[d]}]}]}),e.BidiModule=g,e.DIR_DOCUMENT=o,e.Dir=d,e.Directionality=c})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/cdk.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/cdk.js new file mode 100644 index 000000000..d23e70d76 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/cdk.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdk={},e.ngCore)}(this,(function(e,n){"use strict";const o=new n.Version("15.0.3");e.VERSION=o})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/clipboard/clipboard.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/clipboard/clipboard.js new file mode 100644 index 000000000..692567521 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/clipboard/clipboard.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkClipboard={},e.ngCommon,e.ngCore)}(this,(function(e,t,o){"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var n=r(o);class i{constructor(e,t){this._document=t;const o=this._textarea=this._document.createElement("textarea"),r=o.style;r.position="fixed",r.top=r.opacity="0",r.left="-999em",o.setAttribute("aria-hidden","true"),o.value=e,o.readOnly=!0,this._document.body.appendChild(o)}copy(){const e=this._textarea;let t=!1;try{if(e){const o=this._document.activeElement;e.select(),e.setSelectionRange(0,e.value.length),t=this._document.execCommand("copy"),o&&o.focus()}}catch{}return t}destroy(){const e=this._textarea;e&&(e.remove(),this._textarea=void 0)}}class s{constructor(e){this._document=e}copy(e){const t=this.beginCopy(e),o=t.copy();return t.destroy(),o}beginCopy(e){return new i(e,this._document)}}s.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:s,deps:[{token:t.DOCUMENT}],target:n.ɵɵFactoryTarget.Injectable}),s.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:s,providedIn:"root"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:s,decorators:[{type:o.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:o.Inject,args:[t.DOCUMENT]}]}]}});const a=new o.InjectionToken("CDK_COPY_TO_CLIPBOARD_CONFIG");class c{constructor(e,t,r){this._clipboard=e,this._ngZone=t,this.text="",this.attempts=1,this.copied=new o.EventEmitter,this._pending=new Set,r&&null!=r.attempts&&(this.attempts=r.attempts)}copy(e=this.attempts){if(e>1){let t=e;const o=this._clipboard.beginCopy(this.text);this._pending.add(o);const r=()=>{const e=o.copy();e||!--t||this._destroyed?(this._currentTimeout=null,this._pending.delete(o),o.destroy(),this.copied.emit(e)):this._currentTimeout=this._ngZone.runOutsideAngular((()=>setTimeout(r,1)))};r()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach((e=>e.destroy())),this._pending.clear(),this._destroyed=!0}}c.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:c,deps:[{token:s},{token:n.NgZone},{token:a,optional:!0}],target:n.ɵɵFactoryTarget.Directive}),c.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:c,selector:"[cdkCopyToClipboard]",inputs:{text:["cdkCopyToClipboard","text"],attempts:["cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"},host:{listeners:{click:"copy()"}},ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:c,decorators:[{type:o.Directive,args:[{selector:"[cdkCopyToClipboard]",host:{"(click)":"copy()"}}]}],ctorParameters:function(){return[{type:s},{type:n.NgZone},{type:void 0,decorators:[{type:o.Optional},{type:o.Inject,args:[a]}]}]},propDecorators:{text:[{type:o.Input,args:["cdkCopyToClipboard"]}],attempts:[{type:o.Input,args:["cdkCopyToClipboardAttempts"]}],copied:[{type:o.Output,args:["cdkCopyToClipboardCopied"]}]}});class p{}p.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:p,deps:[],target:n.ɵɵFactoryTarget.NgModule}),p.ɵmod=n.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:n,type:p,declarations:[c],exports:[c]}),p.ɵinj=n.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:p}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:p,decorators:[{type:o.NgModule,args:[{declarations:[c],exports:[c]}]}]}),e.CDK_COPY_TO_CLIPBOARD_CONFIG=a,e.CdkCopyToClipboard=c,e.Clipboard=s,e.ClipboardModule=p,e.PendingCopy=i})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/coercion/coercion.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/coercion/coercion.js new file mode 100644 index 000000000..2f46bcc6f --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/coercion/coercion.js @@ -0,0 +1 @@ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkCoercion={},e.ngCore)}(this,(function(e,r){"use strict";function n(e){return!isNaN(parseFloat(e))&&!isNaN(Number(e))}e._isNumberValue=n,e.coerceArray=function(e){return Array.isArray(e)?e:[e]},e.coerceBooleanProperty=function(e){return null!=e&&"false"!=`${e}`},e.coerceCssPixelValue=function(e){return null==e?"":"string"==typeof e?e:`${e}px`},e.coerceElement=function(e){return e instanceof r.ElementRef?e.nativeElement:e},e.coerceNumberProperty=function(e,r=0){return n(e)?Number(e):r},e.coerceStringArray=function(e,r=/\s+/){const n=[];if(null!=e){const o=Array.isArray(e)?e:`${e}`.split(r);for(const e of o){const r=`${e}`.trim();r&&n.push(r)}}return n}})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/collections/collections.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/collections/collections.js new file mode 100644 index 000000000..b5667c558 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/collections/collections.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("rxjs"),require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","rxjs","@angular/core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkCollections={},e.rxjs,e.ngCore)}(this,(function(e,t,s){"use strict";function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var n=i(s);class r{}function c(){return Error("Cannot pass multiple values into SelectionModel with single-value mode.")}class o{constructor(){this._listeners=[]}notify(e,t){for(let s of this._listeners)s(e,t)}listen(e){return this._listeners.push(e),()=>{this._listeners=this._listeners.filter((t=>e!==t))}}ngOnDestroy(){this._listeners=[]}}o.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:o,deps:[],target:n.ɵɵFactoryTarget.Injectable}),o.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:o,providedIn:"root"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:o,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}]});const h=new s.InjectionToken("_ViewRepeater");e.ArrayDataSource=class extends r{constructor(e){super(),this._data=e}connect(){return t.isObservable(this._data)?this._data:t.of(this._data)}disconnect(){}},e.DataSource=r,e.SelectionModel=class{constructor(e=!1,s,i=!0,n){this._multiple=e,this._emitChanges=i,this.compareWith=n,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new t.Subject,s&&s.length&&(e?s.forEach((e=>this._markSelected(e))):this._markSelected(s[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...e){this._verifyValueAssignment(e),e.forEach((e=>this._markSelected(e)));const t=this._hasQueuedChanges();return this._emitChangeEvent(),t}deselect(...e){this._verifyValueAssignment(e),e.forEach((e=>this._unmarkSelected(e)));const t=this._hasQueuedChanges();return this._emitChangeEvent(),t}setSelection(...e){this._verifyValueAssignment(e);const t=this.selected,s=new Set(e);e.forEach((e=>this._markSelected(e))),t.filter((e=>!s.has(e))).forEach((e=>this._unmarkSelected(e)));const i=this._hasQueuedChanges();return this._emitChangeEvent(),i}toggle(e){return this.isSelected(e)?this.deselect(e):this.select(e)}clear(e=!0){this._unmarkAll();const t=this._hasQueuedChanges();return e&&this._emitChangeEvent(),t}isSelected(e){if(this.compareWith){for(const t of this._selection)if(this.compareWith(t,e))return!0;return!1}return this._selection.has(e)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(e){this.isSelected(e)||(this._multiple||this._unmarkAll(),this.isSelected(e)||this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach((e=>this._unmarkSelected(e)))}_verifyValueAssignment(e){if(e.length>1&&!this._multiple&&("undefined"==typeof ngDevMode||ngDevMode))throw c()}_hasQueuedChanges(){return!(!this._deselectedToEmit.length&&!this._selectedToEmit.length)}},e.UniqueSelectionDispatcher=o,e._DisposeViewRepeaterStrategy=class{applyChanges(e,t,s,i,n){e.forEachOperation(((e,i,r)=>{let c,o;if(null==e.previousIndex){const n=s(e,i,r);c=t.createEmbeddedView(n.templateRef,n.context,n.index),o=1}else null==r?(t.remove(i),o=3):(c=t.get(i),t.move(c,r),o=2);n&&n({context:c?.context,operation:o,record:e})}))}detach(){}},e._RecycleViewRepeaterStrategy=class{constructor(){this.viewCacheSize=20,this._viewCache=[]}applyChanges(e,t,s,i,n){e.forEachOperation(((e,r,c)=>{let o,h;if(null==e.previousIndex){const n=()=>s(e,r,c);o=this._insertView(n,c,t,i(e)),h=o?1:0}else null==c?(this._detachAndCacheView(r,t),h=3):(o=this._moveView(r,c,t,i(e)),h=2);n&&n({context:o?.context,operation:h,record:e})}))}detach(){for(const e of this._viewCache)e.destroy();this._viewCache=[]}_insertView(e,t,s,i){const n=this._insertViewFromCache(t,s);if(n)return void(n.context.$implicit=i);const r=e();return s.createEmbeddedView(r.templateRef,r.context,r.index)}_detachAndCacheView(e,t){const s=t.detach(e);this._maybeCacheView(s,t)}_moveView(e,t,s,i){const n=s.get(e);return s.move(n,t),n.context.$implicit=i,n}_maybeCacheView(e,t){if(this._viewCache.length{this._portalOutlet.hasAttached()&&("undefined"==typeof ngDevMode||ngDevMode)&&_();const t=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),t},this._ariaLabelledBy=this._config.ariaLabelledBy||null,this._document=o}_contentAttached(){this._initializeFocusTrap(),this._handleBackdropClicks(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached()&&("undefined"==typeof ngDevMode||ngDevMode)&&_();const t=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),t}attachTemplatePortal(e){this._portalOutlet.hasAttached()&&("undefined"==typeof ngDevMode||ngDevMode)&&_();const t=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),t}_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,t){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular((()=>{const t=()=>{e.removeEventListener("blur",t),e.removeEventListener("mousedown",t),e.removeAttribute("tabindex")};e.addEventListener("blur",t),e.addEventListener("mousedown",t)}))),e.focus(t)}_focusByCssSelector(e,t){let o=this._elementRef.nativeElement.querySelector(e);o&&this._forceFocus(o,t)}_trapFocus(){const e=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||e.focus();break;case!0:case"first-tabbable":this._focusTrap.focusInitialElementWhenReady().then((e=>{e||this._focusDialogContainer()}));break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this._config.autoFocus)}}_restoreFocus(){const e=this._config.restoreFocus;let t=null;if("string"==typeof e?t=this._document.querySelector(e):"boolean"==typeof e?t=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(t=e),this._config.restoreFocus&&t&&"function"==typeof t.focus){const e=i._getFocusedElementPierceShadowDom(),o=this._elementRef.nativeElement;e&&e!==this._document.body&&e!==o&&!o.contains(e)||(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const e=this._elementRef.nativeElement,t=i._getFocusedElementPierceShadowDom();return e===t||e.contains(t)}_initializeFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=i._getFocusedElementPierceShadowDom())}_handleBackdropClicks(){this._overlayRef.backdropClick().subscribe((()=>{this._config.disableClose&&this._recaptureFocus()}))}}m.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:m,deps:[{token:f.ElementRef},{token:u.FocusTrapFactory},{token:n.DOCUMENT,optional:!0},{token:y},{token:u.InteractivityChecker},{token:f.NgZone},{token:p.OverlayRef},{token:u.FocusMonitor}],target:f.ɵɵFactoryTarget.Component}),m.ɵcmp=f.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"15.0.0",type:m,selector:"cdk-dialog-container",host:{attributes:{tabindex:"-1"},properties:{"attr.id":"_config.id || null","attr.role":"_config.role","attr.aria-modal":"_config.ariaModal","attr.aria-labelledby":"_config.ariaLabel ? null : _ariaLabelledBy","attr.aria-label":"_config.ariaLabel","attr.aria-describedby":"_config.ariaDescribedBy || null"},classAttribute:"cdk-dialog-container"},viewQueries:[{propertyName:"_portalOutlet",first:!0,predicate:a.CdkPortalOutlet,descendants:!0,static:!0}],usesInheritance:!0,ngImport:f,template:"\n",styles:[".cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}"],dependencies:[{kind:"directive",type:g.CdkPortalOutlet,selector:"[cdkPortalOutlet]",inputs:["cdkPortalOutlet"],outputs:["attached"],exportAs:["cdkPortalOutlet"]}],changeDetection:f.ChangeDetectionStrategy.Default,encapsulation:f.ViewEncapsulation.None}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:m,decorators:[{type:r.Component,args:[{selector:"cdk-dialog-container",encapsulation:r.ViewEncapsulation.None,changeDetection:r.ChangeDetectionStrategy.Default,host:{class:"cdk-dialog-container",tabindex:"-1","[attr.id]":"_config.id || null","[attr.role]":"_config.role","[attr.aria-modal]":"_config.ariaModal","[attr.aria-labelledby]":"_config.ariaLabel ? null : _ariaLabelledBy","[attr.aria-label]":"_config.ariaLabel","[attr.aria-describedby]":"_config.ariaDescribedBy || null"},template:"\n",styles:[".cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}"]}]}],ctorParameters:function(){return[{type:f.ElementRef},{type:u.FocusTrapFactory},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[n.DOCUMENT]}]},{type:void 0,decorators:[{type:r.Inject,args:[y]}]},{type:u.InteractivityChecker},{type:f.NgZone},{type:p.OverlayRef},{type:u.FocusMonitor}]},propDecorators:{_portalOutlet:[{type:r.ViewChild,args:[a.CdkPortalOutlet,{static:!0}]}]}});class v{constructor(e,t){this.overlayRef=e,this.config=t,this.closed=new l.Subject,this.disableClose=t.disableClose,this.backdropClick=e.backdropClick(),this.keydownEvents=e.keydownEvents(),this.outsidePointerEvents=e.outsidePointerEvents(),this.id=t.id,this.keydownEvents.subscribe((e=>{e.keyCode!==s.ESCAPE||this.disableClose||s.hasModifierKey(e)||(e.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))})),this.backdropClick.subscribe((()=>{this.disableClose||this.close(void 0,{focusOrigin:"mouse"})}))}close(e,t){if(this.containerInstance){const o=this.closed;this.containerInstance._closeInteractionType=t?.focusOrigin||"program",this.overlayRef.dispose(),o.next(e),o.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(e="",t=""){return this.overlayRef.updateSize({width:e,height:t}),this}addPanelClass(e){return this.overlayRef.addPanelClass(e),this}removePanelClass(e){return this.overlayRef.removePanelClass(e),this}}const C=new r.InjectionToken("DialogScrollStrategy"),D=new r.InjectionToken("DialogData"),b=new r.InjectionToken("DefaultDialogConfig");function k(e){return()=>e.scrollStrategies.block()}const O={provide:C,deps:[o.Overlay],useFactory:k};let A=0;class I{constructor(e,t,o,i,a,n){this._overlay=e,this._injector=t,this._defaultOptions=o,this._parentDialog=i,this._overlayContainer=a,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new l.Subject,this._afterOpenedAtThisLevel=new l.Subject,this._ariaHiddenElements=new Map,this.afterAllClosed=l.defer((()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(d.startWith(void 0)))),this._scrollStrategy=n}get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}open(e,t){if((t={...this._defaultOptions||new y,...t}).id=t.id||"cdk-dialog-"+A++,t.id&&this.getDialogById(t.id)&&("undefined"==typeof ngDevMode||ngDevMode))throw Error(`Dialog with id "${t.id}" exists already. The dialog id must be unique.`);const o=this._getOverlayConfig(t),i=this._overlay.create(o),a=new v(i,t),n=this._attachContainer(i,a,t);return a.containerInstance=n,this._attachDialogContent(e,a,n,t),this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(a),a.closed.subscribe((()=>this._removeOpenDialog(a,!0))),this.afterOpened.next(a),a}closeAll(){T(this.openDialogs,(e=>e.close()))}getDialogById(e){return this.openDialogs.find((t=>t.id===e))}ngOnDestroy(){T(this._openDialogsAtThisLevel,(e=>{!1===e.config.closeOnDestroy&&this._removeOpenDialog(e,!1)})),T(this._openDialogsAtThisLevel,(e=>e.close())),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){const t=new o.OverlayConfig({positionStrategy:e.positionStrategy||this._overlay.position().global().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation});return e.backdropClass&&(t.backdropClass=e.backdropClass),t}_attachContainer(e,t,i){const n=i.injector||i.viewContainerRef?.injector,s=[{provide:y,useValue:i},{provide:v,useValue:t},{provide:o.OverlayRef,useValue:e}];let l;i.container?"function"==typeof i.container?l=i.container:(l=i.container.type,s.push(...i.container.providers(i))):l=m;const c=new a.ComponentPortal(l,i.viewContainerRef,r.Injector.create({parent:n||this._injector,providers:s}),i.componentFactoryResolver);return e.attach(c).instance}_attachDialogContent(e,t,o,i){if(e instanceof r.TemplateRef){const n=this._createInjector(i,t,o,void 0);let r={$implicit:i.data,dialogRef:t};i.templateContext&&(r={...r,..."function"==typeof i.templateContext?i.templateContext():i.templateContext}),o.attachTemplatePortal(new a.TemplatePortal(e,null,r,n))}else{const n=this._createInjector(i,t,o,this._injector),r=o.attachComponentPortal(new a.ComponentPortal(e,i.viewContainerRef,n,i.componentFactoryResolver));t.componentInstance=r.instance}}_createInjector(e,t,o,i){const a=e.injector||e.viewContainerRef?.injector,n=[{provide:D,useValue:e.data},{provide:v,useValue:t}];return e.providers&&("function"==typeof e.providers?n.push(...e.providers(t,e,o)):n.push(...e.providers)),!e.direction||a&&a.get(c.Directionality,null,{optional:!0})||n.push({provide:c.Directionality,useValue:{value:e.direction,change:l.of()}}),r.Injector.create({parent:a||i,providers:n})}_removeOpenDialog(e,t){const o=this.openDialogs.indexOf(e);o>-1&&(this.openDialogs.splice(o,1),this.openDialogs.length||(this._ariaHiddenElements.forEach(((e,t)=>{e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")})),this._ariaHiddenElements.clear(),t&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const e=this._overlayContainer.getContainerElement();if(e.parentElement){const t=e.parentElement.children;for(let o=t.length-1;o>-1;o--){const i=t[o];i===e||"SCRIPT"===i.nodeName||"STYLE"===i.nodeName||i.hasAttribute("aria-live")||(this._ariaHiddenElements.set(i,i.getAttribute("aria-hidden")),i.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){const e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}}function T(e,t){let o=e.length;for(;o--;)t(e[o])}I.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:I,deps:[{token:p.Overlay},{token:f.Injector},{token:b,optional:!0},{token:I,optional:!0,skipSelf:!0},{token:p.OverlayContainer},{token:C}],target:f.ɵɵFactoryTarget.Injectable}),I.ɵprov=f.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:I}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:I,decorators:[{type:r.Injectable}],ctorParameters:function(){return[{type:p.Overlay},{type:f.Injector},{type:y,decorators:[{type:r.Optional},{type:r.Inject,args:[b]}]},{type:I,decorators:[{type:r.Optional},{type:r.SkipSelf}]},{type:p.OverlayContainer},{type:void 0,decorators:[{type:r.Inject,args:[C]}]}]}});class F{}F.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:F,deps:[],target:f.ɵɵFactoryTarget.NgModule}),F.ɵmod=f.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:f,type:F,declarations:[m],imports:[o.OverlayModule,a.PortalModule,t.A11yModule],exports:[a.PortalModule,m]}),F.ɵinj=f.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:F,providers:[I,O],imports:[o.OverlayModule,a.PortalModule,t.A11yModule,a.PortalModule]}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:F,decorators:[{type:r.NgModule,args:[{imports:[o.OverlayModule,a.PortalModule,t.A11yModule],exports:[a.PortalModule,m],declarations:[m],providers:[I,O]}]}]}),e.CdkDialogContainer=m,e.DEFAULT_DIALOG_CONFIG=b,e.DIALOG_DATA=D,e.DIALOG_SCROLL_STRATEGY=C,e.DIALOG_SCROLL_STRATEGY_PROVIDER=O,e.DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY=k,e.Dialog=I,e.DialogConfig=y,e.DialogModule=F,e.DialogRef=v,e.throwDialogContentAlreadyAttachedError=_})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/drag-drop/drag-drop.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/drag-drop/drag-drop.js new file mode 100644 index 000000000..29d661b35 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/drag-drop/drag-drop.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/cdk/scrolling"),require("@angular/cdk/platform"),require("@angular/cdk/coercion"),require("@angular/cdk/a11y"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/bidi")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/cdk/scrolling","@angular/cdk/platform","@angular/cdk/coercion","@angular/cdk/a11y","rxjs","rxjs/operators","@angular/cdk/bidi"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ngCdkDragDrop={},t.ngCore,t.ngCommon,t.ngCdkScrolling,t.ngCdkPlatform,t.ngCdkCoercion,t.ngCdkA11y,t.rxjs,t.rxjsOperators,t.ngCdkBidi)}(this,(function(t,e,i,s,r,n,o,a,l,c){"use strict";function h(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var d=h(e),p=h(s),g=h(c);function _(t,e,i){for(let s in e)if(e.hasOwnProperty(s)){const r=e[s];r?t.setProperty(s,r,i?.has(s)?"important":""):t.removeProperty(s)}return t}function u(t,e){const i=e?"":"none";_(t.style,{"touch-action":e?"":"none","-webkit-user-drag":e?"":"none","-webkit-tap-highlight-color":e?"":"transparent","user-select":i,"-ms-user-select":i,"-webkit-user-select":i,"-moz-user-select":i})}function m(t,e,i){_(t.style,{position:e?"":"fixed",top:e?"":"0",opacity:e?"":"0",left:e?"":"-999em"},i)}function v(t,e){return e&&"none"!=e?t+" "+e:t}function D(t){const e=t.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(t)*e}function f(t,e){return t.getPropertyValue(e).split(",").map((t=>t.trim()))}function y(t){const e=t.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height,x:e.x,y:e.y}}function b(t,e,i){const{top:s,bottom:r,left:n,right:o}=t;return i>=s&&i<=r&&e>=n&&e<=o}function S(t,e,i){t.top+=e,t.bottom=t.top+t.height,t.left+=i,t.right=t.left+t.width}function P(t,e,i,s){const{top:r,right:n,bottom:o,left:a,width:l,height:c}=t,h=l*e,d=c*e;return s>r-d&&sa-h&&i{this.positions.set(t,{scrollPosition:{top:t.scrollTop,left:t.scrollLeft},clientRect:y(t)})}))}handleScroll(t){const e=r._getEventTarget(t),i=this.positions.get(e);if(!i)return null;const s=i.scrollPosition;let n,o;if(e===this._document){const t=this.getViewportScrollPosition();n=t.top,o=t.left}else n=e.scrollTop,o=e.scrollLeft;const a=s.top-n,l=s.left-o;return this.positions.forEach(((t,i)=>{t.clientRect&&e!==i&&e.contains(i)&&S(t.clientRect,a,l)})),s.top=n,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}}function E(t){const e=t.cloneNode(!0),i=e.querySelectorAll("[id]"),s=t.nodeName.toLowerCase();e.removeAttribute("id");for(let t=0;t{if(this.beforeStarted.next(),this._handles.length){const e=this._getTargetHandle(t);!e||this._disabledHandles.has(e)||this.disabled||this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)},this._pointerMove=t=>{const e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging){if(Math.abs(e.x-this._pickupPositionOnPage.x)+Math.abs(e.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){const e=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),i=this._dropContainer;if(!e)return void this._endDragSequence(t);i&&(i.isDragging()||i.isReceiving())||(t.preventDefault(),this._hasStartedDragging=!0,this._ngZone.run((()=>this._startDragSequence(t))))}return}t.preventDefault();const i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{const t=this.constrainPosition?this._initialClientRect:this._pickupPositionOnPage,e=this._activeTransform;e.x=i.x-t.x+this._passiveTransform.x,e.y=i.y-t.y+this._passiveTransform.y,this._applyRootElementTransform(e.x,e.y)}this._moveEvents.observers.length&&this._ngZone.run((()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})}))},this._pointerUp=t=>{this._endDragSequence(t)},this._nativeDragStart=t=>{if(this._handles.length){const e=this._getTargetHandle(t);!e||this._disabledHandles.has(e)||this.disabled||t.preventDefault()}else this.disabled||t.preventDefault()},this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new w(i),n.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(t){const e=n.coerceBooleanProperty(t);e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach((t=>u(t,e))))}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map((t=>n.coerceElement(t))),this._handles.forEach((t=>u(t,this.disabled))),this._toggleNativeDragInteractions();const e=new Set;return this._disabledHandles.forEach((t=>{this._handles.indexOf(t)>-1&&e.add(t)})),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){const e=n.coerceElement(t);return e!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular((()=>{e.addEventListener("mousedown",this._pointerDown,T),e.addEventListener("touchstart",this._pointerDown,C),e.addEventListener("dragstart",this._nativeDragStart,T)})),this._initialTransform=void 0,this._rootElement=e),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?n.coerceElement(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe((()=>this._containInsideBoundaryOnResize()))),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&this._rootElement?.remove(),this._anchor?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeSubscriptions(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}isDragging(){return this._hasStartedDragging&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),u(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),u(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){const t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){const t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview?.remove(),this._previewRef?.destroy(),this._preview=this._previewRef=null}_destroyPlaceholder(){this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),this._hasStartedDragging))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then((()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}));else{this._passiveTransform.x=this._activeTransform.x;const e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run((()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})})),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){V(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const e=this._dropContainer;if(e){const i=this._rootElement,s=i.parentNode,r=this._placeholder=this._createPlaceholderElement(),n=this._anchor=this._anchor||this._document.createComment(""),o=this._getShadowRoot();s.insertBefore(n,i),this._initialTransform=i.style.transform||"",this._preview=this._createPreviewElement(),m(i,!1,L),this._document.body.appendChild(s.replaceChild(r,i)),this._getPreviewInsertionPoint(s,o).appendChild(this._preview),this.started.next({source:this,event:t}),e.start(),this._initialContainer=e,this._initialIndex=e.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(e?e.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();const i=this.isDragging(),s=V(e),n=!s&&0!==e.button,a=this._rootElement,l=r._getEventTarget(e),c=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now(),h=s?o.isFakeTouchstartFromScreenReader(e):o.isFakeMousedownFromScreenReader(e);if(l&&l.draggable&&"mousedown"===e.type&&e.preventDefault(),i||n||c||h)return;if(this._handles.length){const t=a.style;this._rootElementTapHighlight=t.webkitTapHighlightColor||"",t.webkitTapHighlightColor="transparent"}this._hasStartedDragging=this._hasMoved=!1,this._removeSubscriptions(),this._initialClientRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe((t=>this._updateOnScroll(t))),this._boundaryElement&&(this._boundaryRect=y(this._boundaryElement));const d=this._previewTemplate;this._pickupPositionInElement=d&&d.template&&!d.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialClientRect,t,e);const p=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:p.x,y:p.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){m(this._rootElement,!0,L),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._initialClientRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run((()=>{const e=this._dropContainer,i=e.getItemIndex(this),s=this._getPointerPositionOnPage(t),r=this._getDragDistance(s),n=e._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:r,dropPoint:s,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:n,distance:r,dropPoint:s,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,n,r,s,t),this._dropContainer=this._initialContainer}))}_updateActiveDropContainer({x:t,y:e},{x:i,y:s}){let r=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run((()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=r,this._dropContainer.enter(this,t,e,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)})})),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_createPreviewElement(){const t=this._previewTemplate,e=this.previewClass,i=t?t.template:null;let s;if(i&&t){const e=t.matchSize?this._initialClientRect:null,r=t.viewContainer.createEmbeddedView(i,t.context);r.detectChanges(),s=j(r,this._document),this._previewRef=r,t.matchSize?F(s,e):s.style.transform=A(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=E(this._rootElement),F(s,this._initialClientRect),this._initialTransform&&(s.style.transform=this._initialTransform);return _(s.style,{"pointer-events":"none",margin:"0",position:"fixed",top:"0",left:"0","z-index":`${this._config.zIndex||1e3}`},L),u(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach((t=>s.classList.add(t))):s.classList.add(e)),s}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const t=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);const e=function(t){const e=getComputedStyle(t),i=f(e,"transition-property"),s=i.find((t=>"transform"===t||"all"===t));if(!s)return 0;const r=i.indexOf(s),n=f(e,"transition-duration"),o=f(e,"transition-delay");return D(n[r])+D(o[r])}(this._preview);return 0===e?Promise.resolve():this._ngZone.runOutsideAngular((()=>new Promise((t=>{const i=e=>{(!e||r._getEventTarget(e)===this._preview&&"transform"===e.propertyName)&&(this._preview?.removeEventListener("transitionend",i),t(),clearTimeout(s))},s=setTimeout(i,1.5*e);this._preview.addEventListener("transitionend",i)}))))}_createPlaceholderElement(){const t=this._placeholderTemplate,e=t?t.template:null;let i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=j(this._placeholderRef,this._document)):i=E(this._rootElement),i.style.pointerEvents="none",i.classList.add("cdk-drag-placeholder"),i}_getPointerPositionInElement(t,e,i){const s=e===this._rootElement?null:e,r=s?s.getBoundingClientRect():t,n=V(i)?i.targetTouches[0]:i,o=this._getViewportScrollPosition(),a=n.pageX-r.left-o.left,l=n.pageY-r.top-o.top;return{x:r.left-t.left+a,y:r.top-t.top+l}}_getPointerPositionOnPage(t){const e=this._getViewportScrollPosition(),i=V(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,s=i.pageX-e.left,r=i.pageY-e.top;if(this._ownerSVGElement){const t=this._ownerSVGElement.getScreenCTM();if(t){const e=this._ownerSVGElement.createSVGPoint();return e.x=s,e.y=r,e.matrixTransform(t.inverse())}}return{x:s,y:r}}_getConstrainedPointerPosition(t){const e=this._dropContainer?this._dropContainer.lockAxis:null;let{x:i,y:s}=this.constrainPosition?this.constrainPosition(t,this,this._initialClientRect,this._pickupPositionInElement):t;if("x"===this.lockAxis||"x"===e?s=this._pickupPositionOnPage.y:"y"!==this.lockAxis&&"y"!==e||(i=this._pickupPositionOnPage.x),this._boundaryRect){const{x:t,y:e}=this._pickupPositionInElement,r=this._boundaryRect,{width:n,height:o}=this._getPreviewRect(),a=r.top+e,l=r.bottom-(o-e);i=M(i,r.left+t,r.right-(n-t)),s=M(s,a,l)}return{x:i,y:s}}_updatePointerDirectionDelta(t){const{x:e,y:i}=t,s=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,n=Math.abs(e-r.x),o=Math.abs(i-r.y);return n>this._config.pointerDirectionChangeThreshold&&(s.x=e>r.x?1:-1,r.x=e),o>this._config.pointerDirectionChangeThreshold&&(s.y=i>r.y?1:-1,r.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,u(this._rootElement,t))}_removeRootElementListeners(t){t.removeEventListener("mousedown",this._pointerDown,T),t.removeEventListener("touchstart",this._pointerDown,C),t.removeEventListener("dragstart",this._nativeDragStart,T)}_applyRootElementTransform(t,e){const i=A(t,e),s=this._rootElement.style;null==this._initialTransform&&(this._initialTransform=s.transform&&"none"!=s.transform?s.transform:""),s.transform=v(i,this._initialTransform)}_applyPreviewTransform(t,e){const i=this._previewTemplate?.template?void 0:this._initialTransform,s=A(t,e);this._preview.style.transform=v(s,i)}_getDragDistance(t){const e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(0===t&&0===e||this.isDragging()||!this._boundaryElement)return;const i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(0===s.width&&0===s.height||0===i.width&&0===i.height)return;const r=s.left-i.left,n=i.right-s.right,o=s.top-i.top,a=i.bottom-s.bottom;s.width>i.width?(r>0&&(t+=r),n>0&&(t-=n)):t=0,s.height>i.height?(o>0&&(e+=o),a>0&&(e-=a)):e=0,t===this._passiveTransform.x&&e===this._passiveTransform.y||this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){const e=this.dragStartDelay;return"number"==typeof e?e:V(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){const e=this._parentPositions.handleScroll(t);if(e){const i=r._getEventTarget(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&S(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=r._getShadowRoot(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){const i=this._previewContainer||"global";if("parent"===i)return t;if("global"===i){const t=this._document;return e||t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement||t.body}return n.coerceElement(i)}_getPreviewRect(){return this._previewRect&&(this._previewRect.width||this._previewRect.height)||(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialClientRect),this._previewRect}_getTargetHandle(t){return this._handles.find((e=>t.target&&(t.target===e||e.contains(t.target))))}}function A(t,e){return`translate3d(${Math.round(t)}px, ${Math.round(e)}px, 0)`}function M(t,e,i){return Math.max(e,Math.min(i,t))}function V(t){return"t"===t.type[0]}function j(t,e){const i=t.rootNodes;if(1===i.length&&i[0].nodeType===e.ELEMENT_NODE)return i[0];const s=e.createElement("div");return i.forEach((t=>s.appendChild(t))),s}function F(t,e){t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.transform=A(e.left,e.top)}function N(t,e,i){const s=z(e,t.length-1),r=z(i,t.length-1);if(s===r)return;const n=t[s],o=r0)return null;const o="horizontal"===this.orientation,a=r.findIndex((e=>e.drag===t)),l=r[n],c=r[a].clientRect,h=l.clientRect,d=a>n?1:-1,p=this._getItemOffsetPx(c,h,d),g=this._getSiblingOffsetPx(a,r,d),_=r.slice();return N(r,a,n),r.forEach(((e,i)=>{if(_[i]===e)return;const s=e.drag===t,r=s?p:g,n=s?t.getPlaceholderElement():e.drag.getRootElement();e.offset+=r,o?(n.style.transform=v(`translate3d(${Math.round(e.offset)}px, 0, 0)`,e.initialTransform),S(e.clientRect,0,r)):(n.style.transform=v(`translate3d(0, ${Math.round(e.offset)}px, 0)`,e.initialTransform),S(e.clientRect,r,0))})),this._previousSwap.overlaps=b(h,e,i),this._previousSwap.drag=l.drag,this._previousSwap.delta=o?s.x:s.y,{previousIndex:a,currentIndex:n}}enter(t,e,i,s){const r=null==s||s<0?this._getItemIndexFromPointerPosition(t,e,i):s,o=this._activeDraggables,a=o.indexOf(t),l=t.getPlaceholderElement();let c=o[r];if(c===t&&(c=o[r+1]),!c&&(null==r||-1===r||r-1&&o.splice(a,1),c&&!this._dragDropRegistry.isDragging(c)){const e=c.getRootElement();e.parentElement.insertBefore(l,e),o.splice(r,0,t)}else n.coerceElement(this._element).appendChild(l),o.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables.forEach((t=>{const e=t.getRootElement();if(e){const i=this._itemPositions.find((e=>e.drag===t))?.initialTransform;e.style.transform=i||""}})),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return("horizontal"===this.orientation&&"rtl"===this.direction?this._itemPositions.slice().reverse():this._itemPositions).findIndex((e=>e.drag===t))}updateOnScroll(t,e){this._itemPositions.forEach((({clientRect:i})=>{S(i,t,e)})),this._itemPositions.forEach((({drag:t})=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()}))}_cacheItemPositions(){const t="horizontal"===this.orientation;this._itemPositions=this._activeDraggables.map((t=>{const e=t.getVisibleElement();return{drag:t,offset:0,initialTransform:e.style.transform||"",clientRect:y(e)}})).sort(((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top))}_getItemOffsetPx(t,e,i){const s="horizontal"===this.orientation;let r=s?e.left-t.left:e.top-t.top;return-1===i&&(r+=s?e.width-t.width:e.height-t.height),r}_getSiblingOffsetPx(t,e,i){const s="horizontal"===this.orientation,r=e[t].clientRect,n=e[t+-1*i];let o=r[s?"width":"height"]*i;if(n){const t=s?"left":"top",e=s?"right":"bottom";-1===i?o-=n.clientRect[t]-r[e]:o+=r[t]-n.clientRect[e]}return o}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;const i=this._itemPositions,s="horizontal"===this.orientation;if(i[0].drag!==this._activeDraggables[0]){const r=i[i.length-1].clientRect;return s?t>=r.right:e>=r.bottom}{const r=i[0].clientRect;return s?t<=r.left:e<=r.top}}_getItemIndexFromPointerPosition(t,e,i,s){const r="horizontal"===this.orientation,n=this._itemPositions.findIndex((({drag:n,clientRect:o})=>{if(n===t)return!1;if(s){const t=r?s.x:s.y;if(n===this._previousSwap.drag&&this._previousSwap.overlaps&&t===this._previousSwap.delta)return!1}return r?e>=Math.floor(o.left)&&e=Math.floor(o.top)&&i!0,this.sortPredicate=()=>!0,this.beforeStarted=new a.Subject,this.entered=new a.Subject,this.exited=new a.Subject,this.dropped=new a.Subject,this.sorted=new a.Subject,this._isDragging=!1,this._draggables=[],this._siblings=[],this._activeSiblings=new Set,this._viewportScrollSubscription=a.Subscription.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new a.Subject,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),a.interval(0,a.animationFrameScheduler).pipe(l.takeUntil(this._stopScrollTimers)).subscribe((()=>{const t=this._scrollNode,e=this.autoScrollStep;1===this._verticalScrollDirection?t.scrollBy(0,-e):2===this._verticalScrollDirection&&t.scrollBy(0,e),1===this._horizontalScrollDirection?t.scrollBy(-e,0):2===this._horizontalScrollDirection&&t.scrollBy(e,0)}))},this.element=n.coerceElement(t),this._document=i,this.withScrollableParents([this.element]),e.registerDropContainer(this),this._parentPositions=new w(i),this._sortStrategy=new H(this.element,e),this._sortStrategy.withSortPredicate(((t,e)=>this.sortPredicate(t,e,this)))}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,s){this._draggingStarted(),null==s&&this.sortingDisabled&&(s=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,s,r,n,o,a={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:r,distance:n,dropPoint:o,event:a})}withItems(t){const e=this._draggables;if(this._draggables=t,t.forEach((t=>t._withDropContainer(this))),this.isDragging()){e.filter((t=>t.isDragging())).every((e=>-1===t.indexOf(e)))?this._reset():this._sortStrategy.withItems(this._draggables)}return this}withDirection(t){return this._sortStrategy.direction=t,this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){return this._sortStrategy.orientation=t,this}withScrollableParents(t){const e=n.coerceElement(this.element);return this._scrollableElements=-1===t.indexOf(e)?[e,...t]:t.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,s){if(this.sortingDisabled||!this._clientRect||!P(this._clientRect,.05,e,i))return;const r=this._sortStrategy.sort(t,e,i,s);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,s=0,r=0;if(this._parentPositions.positions.forEach(((n,o)=>{o!==this._document&&n.clientRect&&!i&&P(n.clientRect,.05,t,e)&&([s,r]=function(t,e,i,s){const r=B(e,s),n=Z(e,i);let o=0,a=0;if(r){const e=t.scrollTop;1===r?e>0&&(o=1):t.scrollHeight-e>t.clientHeight&&(o=2)}if(n){const e=t.scrollLeft;1===n?e>0&&(a=1):t.scrollWidth-e>t.clientWidth&&(a=2)}return[o,a]}(o,n.clientRect,t,e),(s||r)&&(i=o))})),!s&&!r){const{width:n,height:o}=this._viewportRuler.getViewportSize(),a={width:n,height:o,top:0,right:n,bottom:o,left:0};s=B(a,e),r=Z(a,t),i=window}!i||s===this._verticalScrollDirection&&r===this._horizontalScrollDirection&&i===this._scrollNode||(this._verticalScrollDirection=s,this._horizontalScrollDirection=r,this._scrollNode=i,(s||r)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){const t=n.coerceElement(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){const t=n.coerceElement(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(t).clientRect}_reset(){this._isDragging=!1;const t=n.coerceElement(this.element).style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach((t=>t._stopReceiving(this))),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_isOverContainer(t,e){return null!=this._clientRect&&b(this._clientRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find((s=>s._canReceive(t,e,i)))}_canReceive(t,e,i){if(!this._clientRect||!b(this._clientRect,e,i)||!this.enterPredicate(t,this))return!1;const s=this._getShadowRoot().elementFromPoint(e,i);if(!s)return!1;const r=n.coerceElement(this.element);return s===r||r.contains(s)}_startReceiving(t,e){const i=this._activeSiblings;!i.has(t)&&e.every((t=>this.enterPredicate(t,this)||this._draggables.indexOf(t)>-1))&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents())}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe((t=>{if(this.isDragging()){const e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()}))}_getShadowRoot(){if(!this._cachedShadowRoot){const t=r._getShadowRoot(n.coerceElement(this.element));this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){const t=this._sortStrategy.getActiveItemsSnapshot().filter((t=>t.isDragging()));this._siblings.forEach((e=>e._startReceiving(this,t)))}}function B(t,e){const{top:i,bottom:s,height:r}=t,n=.05*r;return e>=i-n&&e<=i+n?1:e>=s-n&&e<=s+n?2:0}function Z(t,e){const{left:i,right:s,width:r}=t,n=.05*r;return e>=i-n&&e<=i+n?1:e>=s-n&&e<=s+n?2:0}const q=r.normalizePassiveListenerOptions({passive:!1,capture:!0});class U{constructor(t,e){this._ngZone=t,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=t=>t.isDragging(),this.pointerMove=new a.Subject,this.pointerUp=new a.Subject,this.scroll=new a.Subject,this._preventDefaultWhileDragging=t=>{this._activeDragInstances.length>0&&t.preventDefault()},this._persistentTouchmoveListener=t=>{this._activeDragInstances.length>0&&(this._activeDragInstances.some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t))},this._document=e}registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t)}registerDragItem(t){this._dragInstances.add(t),1===this._dragInstances.size&&this._ngZone.runOutsideAngular((()=>{this._document.addEventListener("touchmove",this._persistentTouchmoveListener,q)}))}removeDropContainer(t){this._dropInstances.delete(t)}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,q)}startDragging(t,e){if(!(this._activeDragInstances.indexOf(t)>-1)&&(this._activeDragInstances.push(t),1===this._activeDragInstances.length)){const t=e.type.startsWith("touch");this._globalListeners.set(t?"touchend":"mouseup",{handler:t=>this.pointerUp.next(t),options:!0}).set("scroll",{handler:t=>this.scroll.next(t),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:q}),t||this._globalListeners.set("mousemove",{handler:t=>this.pointerMove.next(t),options:q}),this._ngZone.runOutsideAngular((()=>{this._globalListeners.forEach(((t,e)=>{this._document.addEventListener(e,t.handler,t.options)}))}))}}stopDragging(t){const e=this._activeDragInstances.indexOf(t);e>-1&&(this._activeDragInstances.splice(e,1),0===this._activeDragInstances.length&&this._clearGlobalListeners())}isDragging(t){return this._activeDragInstances.indexOf(t)>-1}scrolled(t){const e=[this.scroll];return t&&t!==this._document&&e.push(new a.Observable((e=>this._ngZone.runOutsideAngular((()=>{const i=t=>{this._activeDragInstances.length&&e.next(t)};return t.addEventListener("scroll",i,true),()=>{t.removeEventListener("scroll",i,true)}}))))),a.merge(...e)}ngOnDestroy(){this._dragInstances.forEach((t=>this.removeDragItem(t))),this._dropInstances.forEach((t=>this.removeDropContainer(t))),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach(((t,e)=>{this._document.removeEventListener(e,t.handler,t.options)})),this._globalListeners.clear()}}U.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:U,deps:[{token:d.NgZone},{token:i.DOCUMENT}],target:d.ɵɵFactoryTarget.Injectable}),U.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:U,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:U,decorators:[{type:e.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:d.NgZone},{type:void 0,decorators:[{type:e.Inject,args:[i.DOCUMENT]}]}]}});const W={dragStartThreshold:5,pointerDirectionChangeThreshold:5};class K{constructor(t,e,i,s){this._document=t,this._ngZone=e,this._viewportRuler=i,this._dragDropRegistry=s}createDrag(t,e=W){return new O(t,e,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(t){return new G(t,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}K.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:K,deps:[{token:i.DOCUMENT},{token:d.NgZone},{token:p.ViewportRuler},{token:U}],target:d.ɵɵFactoryTarget.Injectable}),K.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:K,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:K,decorators:[{type:e.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:e.Inject,args:[i.DOCUMENT]}]},{type:d.NgZone},{type:p.ViewportRuler},{type:U}]}});const $=new e.InjectionToken("CDK_DRAG_PARENT"),Y=new e.InjectionToken("CdkDropListGroup");class X{constructor(){this._items=new Set,this._disabled=!1}get disabled(){return this._disabled}set disabled(t){this._disabled=n.coerceBooleanProperty(t)}ngOnDestroy(){this._items.clear()}}X.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:X,deps:[],target:d.ɵɵFactoryTarget.Directive}),X.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:X,isStandalone:!0,selector:"[cdkDropListGroup]",inputs:{disabled:["cdkDropListGroupDisabled","disabled"]},providers:[{provide:Y,useExisting:X}],exportAs:["cdkDropListGroup"],ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:X,decorators:[{type:e.Directive,args:[{selector:"[cdkDropListGroup]",exportAs:"cdkDropListGroup",standalone:!0,providers:[{provide:Y,useExisting:X}]}]}],propDecorators:{disabled:[{type:e.Input,args:["cdkDropListGroupDisabled"]}]}});const J=new e.InjectionToken("CDK_DRAG_CONFIG");function Q(t,e){if(1!==t.nodeType)throw Error(`${e} must be attached to an element node. Currently attached to "${t.nodeName}".`)}let tt=0;const et=new e.InjectionToken("CdkDropList");class it{constructor(t,i,s,r,n,o,l){this.element=t,this._changeDetectorRef=s,this._scrollDispatcher=r,this._dir=n,this._group=o,this._destroyed=new a.Subject,this.connectedTo=[],this.id="cdk-drop-list-"+tt++,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.dropped=new e.EventEmitter,this.entered=new e.EventEmitter,this.exited=new e.EventEmitter,this.sorted=new e.EventEmitter,this._unsortedItems=new Set,("undefined"==typeof ngDevMode||ngDevMode)&&Q(t.nativeElement,"cdkDropList"),this._dropListRef=i.createDropList(t),this._dropListRef.data=this,l&&this._assignDefaults(l),this._dropListRef.enterPredicate=(t,e)=>this.enterPredicate(t.data,e.data),this._dropListRef.sortPredicate=(t,e,i)=>this.sortPredicate(t,e.data,i.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),it._dropLists.push(this),o&&o._items.add(this)}get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=n.coerceBooleanProperty(t)}addItem(t){this._unsortedItems.add(t),this._dropListRef.isDragging()&&this._syncItemsWithRef()}removeItem(t){this._unsortedItems.delete(t),this._dropListRef.isDragging()&&this._syncItemsWithRef()}getSortedItems(){return Array.from(this._unsortedItems).sort(((t,e)=>t._dragRef.getVisibleElement().compareDocumentPosition(e._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))}ngOnDestroy(){const t=it._dropLists.indexOf(this);t>-1&&it._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe(l.startWith(this._dir.value),l.takeUntil(this._destroyed)).subscribe((e=>t.withDirection(e))),t.beforeStarted.subscribe((()=>{const e=n.coerceArray(this.connectedTo).map((t=>{if("string"==typeof t){const e=it._dropLists.find((e=>e.id===t));return e||"undefined"!=typeof ngDevMode&&!ngDevMode||console.warn(`CdkDropList could not find connected drop list with id "${t}"`),e}return t}));if(this._group&&this._group._items.forEach((t=>{-1===e.indexOf(t)&&e.push(t)})),!this._scrollableParentsResolved){const t=this._scrollDispatcher.getAncestorScrollContainers(this.element).map((t=>t.getElementRef().nativeElement));this._dropListRef.withScrollableParents(t),this._scrollableParentsResolved=!0}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=n.coerceBooleanProperty(this.sortingDisabled),t.autoScrollDisabled=n.coerceBooleanProperty(this.autoScrollDisabled),t.autoScrollStep=n.coerceNumberProperty(this.autoScrollStep,2),t.connectedTo(e.filter((t=>t&&t!==this)).map((t=>t._dropListRef))).withOrientation(this.orientation)}))}_handleEvents(t){t.beforeStarted.subscribe((()=>{this._syncItemsWithRef(),this._changeDetectorRef.markForCheck()})),t.entered.subscribe((t=>{this.entered.emit({container:this,item:t.item.data,currentIndex:t.currentIndex})})),t.exited.subscribe((t=>{this.exited.emit({container:this,item:t.item.data}),this._changeDetectorRef.markForCheck()})),t.sorted.subscribe((t=>{this.sorted.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,container:this,item:t.item.data})})),t.dropped.subscribe((t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,item:t.item.data,isPointerOverContainer:t.isPointerOverContainer,distance:t.distance,dropPoint:t.dropPoint,event:t.event}),this._changeDetectorRef.markForCheck()}))}_assignDefaults(t){const{lockAxis:e,draggingDisabled:i,sortingDisabled:s,listAutoScrollDisabled:r,listOrientation:n}=t;this.disabled=null!=i&&i,this.sortingDisabled=null!=s&&s,this.autoScrollDisabled=null!=r&&r,this.orientation=n||"vertical",e&&(this.lockAxis=e)}_syncItemsWithRef(){this._dropListRef.withItems(this.getSortedItems().map((t=>t._dragRef)))}}it._dropLists=[],it.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:it,deps:[{token:d.ElementRef},{token:K},{token:d.ChangeDetectorRef},{token:p.ScrollDispatcher},{token:g.Directionality,optional:!0},{token:Y,optional:!0,skipSelf:!0},{token:J,optional:!0}],target:d.ɵɵFactoryTarget.Directive}),it.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:it,isStandalone:!0,selector:"[cdkDropList], cdk-drop-list",inputs:{connectedTo:["cdkDropListConnectedTo","connectedTo"],data:["cdkDropListData","data"],orientation:["cdkDropListOrientation","orientation"],id:"id",lockAxis:["cdkDropListLockAxis","lockAxis"],disabled:["cdkDropListDisabled","disabled"],sortingDisabled:["cdkDropListSortingDisabled","sortingDisabled"],enterPredicate:["cdkDropListEnterPredicate","enterPredicate"],sortPredicate:["cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:["cdkDropListAutoScrollDisabled","autoScrollDisabled"],autoScrollStep:["cdkDropListAutoScrollStep","autoScrollStep"]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},host:{properties:{"attr.id":"id","class.cdk-drop-list-disabled":"disabled","class.cdk-drop-list-dragging":"_dropListRef.isDragging()","class.cdk-drop-list-receiving":"_dropListRef.isReceiving()"},classAttribute:"cdk-drop-list"},providers:[{provide:Y,useValue:void 0},{provide:et,useExisting:it}],exportAs:["cdkDropList"],ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:it,decorators:[{type:e.Directive,args:[{selector:"[cdkDropList], cdk-drop-list",exportAs:"cdkDropList",standalone:!0,providers:[{provide:Y,useValue:void 0},{provide:et,useExisting:it}],host:{class:"cdk-drop-list","[attr.id]":"id","[class.cdk-drop-list-disabled]":"disabled","[class.cdk-drop-list-dragging]":"_dropListRef.isDragging()","[class.cdk-drop-list-receiving]":"_dropListRef.isReceiving()"}}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:K},{type:d.ChangeDetectorRef},{type:p.ScrollDispatcher},{type:g.Directionality,decorators:[{type:e.Optional}]},{type:X,decorators:[{type:e.Optional},{type:e.Inject,args:[Y]},{type:e.SkipSelf}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[J]}]}]},propDecorators:{connectedTo:[{type:e.Input,args:["cdkDropListConnectedTo"]}],data:[{type:e.Input,args:["cdkDropListData"]}],orientation:[{type:e.Input,args:["cdkDropListOrientation"]}],id:[{type:e.Input}],lockAxis:[{type:e.Input,args:["cdkDropListLockAxis"]}],disabled:[{type:e.Input,args:["cdkDropListDisabled"]}],sortingDisabled:[{type:e.Input,args:["cdkDropListSortingDisabled"]}],enterPredicate:[{type:e.Input,args:["cdkDropListEnterPredicate"]}],sortPredicate:[{type:e.Input,args:["cdkDropListSortPredicate"]}],autoScrollDisabled:[{type:e.Input,args:["cdkDropListAutoScrollDisabled"]}],autoScrollStep:[{type:e.Input,args:["cdkDropListAutoScrollStep"]}],dropped:[{type:e.Output,args:["cdkDropListDropped"]}],entered:[{type:e.Output,args:["cdkDropListEntered"]}],exited:[{type:e.Output,args:["cdkDropListExited"]}],sorted:[{type:e.Output,args:["cdkDropListSorted"]}]}});const st=new e.InjectionToken("CdkDragHandle");class rt{constructor(t,e){this.element=t,this._stateChanges=new a.Subject,this._disabled=!1,("undefined"==typeof ngDevMode||ngDevMode)&&Q(t.nativeElement,"cdkDragHandle"),this._parentDrag=e}get disabled(){return this._disabled}set disabled(t){this._disabled=n.coerceBooleanProperty(t),this._stateChanges.next(this)}ngOnDestroy(){this._stateChanges.complete()}}rt.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:rt,deps:[{token:d.ElementRef},{token:$,optional:!0,skipSelf:!0}],target:d.ɵɵFactoryTarget.Directive}),rt.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:rt,isStandalone:!0,selector:"[cdkDragHandle]",inputs:{disabled:["cdkDragHandleDisabled","disabled"]},host:{classAttribute:"cdk-drag-handle"},providers:[{provide:st,useExisting:rt}],ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:rt,decorators:[{type:e.Directive,args:[{selector:"[cdkDragHandle]",standalone:!0,host:{class:"cdk-drag-handle"},providers:[{provide:st,useExisting:rt}]}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:void 0,decorators:[{type:e.Inject,args:[$]},{type:e.Optional},{type:e.SkipSelf}]}]},propDecorators:{disabled:[{type:e.Input,args:["cdkDragHandleDisabled"]}]}});const nt=new e.InjectionToken("CdkDragPlaceholder");class ot{constructor(t){this.templateRef=t}}ot.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:ot,deps:[{token:d.TemplateRef}],target:d.ɵɵFactoryTarget.Directive}),ot.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:ot,isStandalone:!0,selector:"ng-template[cdkDragPlaceholder]",inputs:{data:"data"},providers:[{provide:nt,useExisting:ot}],ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:ot,decorators:[{type:e.Directive,args:[{selector:"ng-template[cdkDragPlaceholder]",standalone:!0,providers:[{provide:nt,useExisting:ot}]}]}],ctorParameters:function(){return[{type:d.TemplateRef}]},propDecorators:{data:[{type:e.Input}]}});const at=new e.InjectionToken("CdkDragPreview");class lt{constructor(t){this.templateRef=t,this._matchSize=!1}get matchSize(){return this._matchSize}set matchSize(t){this._matchSize=n.coerceBooleanProperty(t)}}lt.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:lt,deps:[{token:d.TemplateRef}],target:d.ɵɵFactoryTarget.Directive}),lt.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:lt,isStandalone:!0,selector:"ng-template[cdkDragPreview]",inputs:{data:"data",matchSize:"matchSize"},providers:[{provide:at,useExisting:lt}],ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:lt,decorators:[{type:e.Directive,args:[{selector:"ng-template[cdkDragPreview]",standalone:!0,providers:[{provide:at,useExisting:lt}]}]}],ctorParameters:function(){return[{type:d.TemplateRef}]},propDecorators:{data:[{type:e.Input}],matchSize:[{type:e.Input}]}});const ct="cdk-drag";class ht{constructor(t,i,s,r,n,o,c,h,d,p,g){this.element=t,this.dropContainer=i,this._ngZone=r,this._viewContainerRef=n,this._dir=c,this._changeDetectorRef=d,this._selfHandle=p,this._parentDrag=g,this._destroyed=new a.Subject,this.started=new e.EventEmitter,this.released=new e.EventEmitter,this.ended=new e.EventEmitter,this.entered=new e.EventEmitter,this.exited=new e.EventEmitter,this.dropped=new e.EventEmitter,this.moved=new a.Observable((t=>{const e=this._dragRef.moved.pipe(l.map((t=>({source:this,pointerPosition:t.pointerPosition,event:t.event,delta:t.delta,distance:t.distance})))).subscribe(t);return()=>{e.unsubscribe()}})),this._dragRef=h.createDrag(t,{dragStartThreshold:o&&null!=o.dragStartThreshold?o.dragStartThreshold:5,pointerDirectionChangeThreshold:o&&null!=o.pointerDirectionChangeThreshold?o.pointerDirectionChangeThreshold:5,zIndex:o?.zIndex}),this._dragRef.data=this,ht._dragInstances.push(this),o&&this._assignDefaults(o),i&&(this._dragRef._withDropContainer(i._dropListRef),i.addItem(this)),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}get disabled(){return this._disabled||this.dropContainer&&this.dropContainer.disabled}set disabled(t){this._disabled=n.coerceBooleanProperty(t),this._dragRef.disabled=this._disabled}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(t){this._dragRef.setFreeDragPosition(t)}ngAfterViewInit(){this._ngZone.runOutsideAngular((()=>{this._ngZone.onStable.pipe(l.take(1),l.takeUntil(this._destroyed)).subscribe((()=>{this._updateRootElement(),this._setupHandlesListener(),this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}))}))}ngOnChanges(t){const e=t.rootElementSelector,i=t.freeDragPosition;e&&!e.firstChange&&this._updateRootElement(),i&&!i.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this);const t=ht._dragInstances.indexOf(this);t>-1&&ht._dragInstances.splice(t,1),this._ngZone.runOutsideAngular((()=>{this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()}))}_updateRootElement(){const t=this.element.nativeElement;let e=t;this.rootElementSelector&&(e=void 0!==t.closest?t.closest(this.rootElementSelector):t.parentElement?.closest(this.rootElementSelector)),e&&("undefined"==typeof ngDevMode||ngDevMode)&&Q(e,"cdkDrag"),this._dragRef.withRootElement(e||t)}_getBoundaryElement(){const t=this.boundaryElement;return t?"string"==typeof t?this.element.nativeElement.closest(t):n.coerceElement(t):null}_syncInputs(t){t.beforeStarted.subscribe((()=>{if(!t.isDragging()){const e=this._dir,i=this.dragStartDelay,s=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,r=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.dragStartDelay="object"==typeof i&&i?i:n.coerceNumberProperty(i),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(s).withPreviewTemplate(r).withPreviewContainer(this.previewContainer||"global"),e&&t.withDirection(e.value)}})),t.beforeStarted.pipe(l.take(1)).subscribe((()=>{if(this._parentDrag)return void t.withParent(this._parentDrag._dragRef);let e=this.element.nativeElement.parentElement;for(;e;){if(e.classList.contains(ct)){t.withParent(ht._dragInstances.find((t=>t.element.nativeElement===e))?._dragRef||null);break}e=e.parentElement}}))}_handleEvents(t){t.started.subscribe((t=>{this.started.emit({source:this,event:t.event}),this._changeDetectorRef.markForCheck()})),t.released.subscribe((t=>{this.released.emit({source:this,event:t.event})})),t.ended.subscribe((t=>{this.ended.emit({source:this,distance:t.distance,dropPoint:t.dropPoint,event:t.event}),this._changeDetectorRef.markForCheck()})),t.entered.subscribe((t=>{this.entered.emit({container:t.container.data,item:this,currentIndex:t.currentIndex})})),t.exited.subscribe((t=>{this.exited.emit({container:t.container.data,item:this})})),t.dropped.subscribe((t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,isPointerOverContainer:t.isPointerOverContainer,item:this,distance:t.distance,dropPoint:t.dropPoint,event:t.event})}))}_assignDefaults(t){const{lockAxis:e,dragStartDelay:i,constrainPosition:s,previewClass:r,boundaryElement:n,draggingDisabled:o,rootElementSelector:a,previewContainer:l}=t;this.disabled=null!=o&&o,this.dragStartDelay=i||0,e&&(this.lockAxis=e),s&&(this.constrainPosition=s),r&&(this.previewClass=r),n&&(this.boundaryElement=n),a&&(this.rootElementSelector=a),l&&(this.previewContainer=l)}_setupHandlesListener(){this._handles.changes.pipe(l.startWith(this._handles),l.tap((t=>{const e=t.filter((t=>t._parentDrag===this)).map((t=>t.element));this._selfHandle&&this.rootElementSelector&&e.push(this.element),this._dragRef.withHandles(e)})),l.switchMap((t=>a.merge(...t.map((t=>t._stateChanges.pipe(l.startWith(t))))))),l.takeUntil(this._destroyed)).subscribe((t=>{const e=this._dragRef,i=t.element.nativeElement;t.disabled?e.disableHandle(i):e.enableHandle(i)}))}}ht._dragInstances=[],ht.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:ht,deps:[{token:d.ElementRef},{token:et,optional:!0,skipSelf:!0},{token:i.DOCUMENT},{token:d.NgZone},{token:d.ViewContainerRef},{token:J,optional:!0},{token:g.Directionality,optional:!0},{token:K},{token:d.ChangeDetectorRef},{token:st,optional:!0,self:!0},{token:$,optional:!0,skipSelf:!0}],target:d.ɵɵFactoryTarget.Directive}),ht.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:ht,isStandalone:!0,selector:"[cdkDrag]",inputs:{data:["cdkDragData","data"],lockAxis:["cdkDragLockAxis","lockAxis"],rootElementSelector:["cdkDragRootElement","rootElementSelector"],boundaryElement:["cdkDragBoundary","boundaryElement"],dragStartDelay:["cdkDragStartDelay","dragStartDelay"],freeDragPosition:["cdkDragFreeDragPosition","freeDragPosition"],disabled:["cdkDragDisabled","disabled"],constrainPosition:["cdkDragConstrainPosition","constrainPosition"],previewClass:["cdkDragPreviewClass","previewClass"],previewContainer:["cdkDragPreviewContainer","previewContainer"]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},host:{properties:{"class.cdk-drag-disabled":"disabled","class.cdk-drag-dragging":"_dragRef.isDragging()"},classAttribute:"cdk-drag"},providers:[{provide:$,useExisting:ht}],queries:[{propertyName:"_previewTemplate",first:!0,predicate:at,descendants:!0},{propertyName:"_placeholderTemplate",first:!0,predicate:nt,descendants:!0},{propertyName:"_handles",predicate:st,descendants:!0}],exportAs:["cdkDrag"],usesOnChanges:!0,ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:ht,decorators:[{type:e.Directive,args:[{selector:"[cdkDrag]",exportAs:"cdkDrag",standalone:!0,host:{class:ct,"[class.cdk-drag-disabled]":"disabled","[class.cdk-drag-dragging]":"_dragRef.isDragging()"},providers:[{provide:$,useExisting:ht}]}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:void 0,decorators:[{type:e.Inject,args:[et]},{type:e.Optional},{type:e.SkipSelf}]},{type:void 0,decorators:[{type:e.Inject,args:[i.DOCUMENT]}]},{type:d.NgZone},{type:d.ViewContainerRef},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[J]}]},{type:g.Directionality,decorators:[{type:e.Optional}]},{type:K},{type:d.ChangeDetectorRef},{type:rt,decorators:[{type:e.Optional},{type:e.Self},{type:e.Inject,args:[st]}]},{type:ht,decorators:[{type:e.Optional},{type:e.SkipSelf},{type:e.Inject,args:[$]}]}]},propDecorators:{_handles:[{type:e.ContentChildren,args:[st,{descendants:!0}]}],_previewTemplate:[{type:e.ContentChild,args:[at]}],_placeholderTemplate:[{type:e.ContentChild,args:[nt]}],data:[{type:e.Input,args:["cdkDragData"]}],lockAxis:[{type:e.Input,args:["cdkDragLockAxis"]}],rootElementSelector:[{type:e.Input,args:["cdkDragRootElement"]}],boundaryElement:[{type:e.Input,args:["cdkDragBoundary"]}],dragStartDelay:[{type:e.Input,args:["cdkDragStartDelay"]}],freeDragPosition:[{type:e.Input,args:["cdkDragFreeDragPosition"]}],disabled:[{type:e.Input,args:["cdkDragDisabled"]}],constrainPosition:[{type:e.Input,args:["cdkDragConstrainPosition"]}],previewClass:[{type:e.Input,args:["cdkDragPreviewClass"]}],previewContainer:[{type:e.Input,args:["cdkDragPreviewContainer"]}],started:[{type:e.Output,args:["cdkDragStarted"]}],released:[{type:e.Output,args:["cdkDragReleased"]}],ended:[{type:e.Output,args:["cdkDragEnded"]}],entered:[{type:e.Output,args:["cdkDragEntered"]}],exited:[{type:e.Output,args:["cdkDragExited"]}],dropped:[{type:e.Output,args:["cdkDragDropped"]}],moved:[{type:e.Output,args:["cdkDragMoved"]}]}});const dt=[it,X,ht,rt,lt,ot];class pt{}pt.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:pt,deps:[],target:d.ɵɵFactoryTarget.NgModule}),pt.ɵmod=d.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:d,type:pt,imports:[it,X,ht,rt,lt,ot],exports:[s.CdkScrollableModule,it,X,ht,rt,lt,ot]}),pt.ɵinj=d.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:pt,providers:[K],imports:[s.CdkScrollableModule]}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:pt,decorators:[{type:e.NgModule,args:[{imports:dt,exports:[s.CdkScrollableModule,...dt],providers:[K]}]}]}),t.CDK_DRAG_CONFIG=J,t.CDK_DRAG_HANDLE=st,t.CDK_DRAG_PARENT=$,t.CDK_DRAG_PLACEHOLDER=nt,t.CDK_DRAG_PREVIEW=at,t.CDK_DROP_LIST=et,t.CDK_DROP_LIST_GROUP=Y,t.CdkDrag=ht,t.CdkDragHandle=rt,t.CdkDragPlaceholder=ot,t.CdkDragPreview=lt,t.CdkDropList=it,t.CdkDropListGroup=X,t.DragDrop=K,t.DragDropModule=pt,t.DragDropRegistry=U,t.DragRef=O,t.DropListRef=G,t.copyArrayItem=function(t,e,i,s){const r=z(s,e.length);t.length&&e.splice(r,0,t[i])},t.moveItemInArray=N,t.transferArrayItem=function(t,e,i,s){const r=z(i,t.length-1),n=z(s,e.length);t.length&&e.splice(n,0,t.splice(r,1)[0])}})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/keycodes/keycodes.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/keycodes/keycodes.js new file mode 100644 index 000000000..3b80bc974 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/keycodes/keycodes.js @@ -0,0 +1 @@ +!function(E,_){"object"==typeof exports&&"undefined"!=typeof module?_(exports):"function"==typeof define&&define.amd?define(["exports"],_):_((E="undefined"!=typeof globalThis?globalThis:E||self).ngCdkKeycodes={})}(this,(function(E){"use strict";E.A=65,E.ALT=18,E.APOSTROPHE=192,E.AT_SIGN=64,E.B=66,E.BACKSLASH=220,E.BACKSPACE=8,E.C=67,E.CAPS_LOCK=20,E.CLOSE_SQUARE_BRACKET=221,E.COMMA=188,E.CONTEXT_MENU=93,E.CONTROL=17,E.D=68,E.DASH=189,E.DELETE=46,E.DOWN_ARROW=40,E.E=69,E.EIGHT=56,E.END=35,E.ENTER=13,E.EQUALS=187,E.ESCAPE=27,E.F=70,E.F1=112,E.F10=121,E.F11=122,E.F12=123,E.F2=113,E.F3=114,E.F4=115,E.F5=116,E.F6=117,E.F7=118,E.F8=119,E.F9=120,E.FF_EQUALS=61,E.FF_MINUS=173,E.FF_MUTE=181,E.FF_SEMICOLON=59,E.FF_VOLUME_DOWN=182,E.FF_VOLUME_UP=183,E.FIRST_MEDIA=166,E.FIVE=53,E.FOUR=52,E.G=71,E.H=72,E.HOME=36,E.I=73,E.INSERT=45,E.J=74,E.K=75,E.L=76,E.LAST_MEDIA=183,E.LEFT_ARROW=37,E.M=77,E.MAC_ENTER=3,E.MAC_META=224,E.MAC_WK_CMD_LEFT=91,E.MAC_WK_CMD_RIGHT=93,E.META=91,E.MUTE=173,E.N=78,E.NINE=57,E.NUMPAD_DIVIDE=111,E.NUMPAD_EIGHT=104,E.NUMPAD_FIVE=101,E.NUMPAD_FOUR=100,E.NUMPAD_MINUS=109,E.NUMPAD_MULTIPLY=106,E.NUMPAD_NINE=105,E.NUMPAD_ONE=97,E.NUMPAD_PERIOD=110,E.NUMPAD_PLUS=107,E.NUMPAD_SEVEN=103,E.NUMPAD_SIX=102,E.NUMPAD_THREE=99,E.NUMPAD_TWO=98,E.NUMPAD_ZERO=96,E.NUM_CENTER=12,E.NUM_LOCK=144,E.O=79,E.ONE=49,E.OPEN_SQUARE_BRACKET=219,E.P=80,E.PAGE_DOWN=34,E.PAGE_UP=33,E.PAUSE=19,E.PERIOD=190,E.PLUS_SIGN=43,E.PRINT_SCREEN=44,E.Q=81,E.QUESTION_MARK=63,E.R=82,E.RIGHT_ARROW=39,E.S=83,E.SCROLL_LOCK=145,E.SEMICOLON=186,E.SEVEN=55,E.SHIFT=16,E.SINGLE_QUOTE=222,E.SIX=54,E.SLASH=191,E.SPACE=32,E.T=84,E.TAB=9,E.THREE=51,E.TILDE=192,E.TWO=50,E.U=85,E.UP_ARROW=38,E.V=86,E.VOLUME_DOWN=174,E.VOLUME_UP=175,E.W=87,E.X=88,E.Y=89,E.Z=90,E.ZERO=48,E.hasModifierKey=function(E,..._){return _.length?_.some((_=>E[_])):E.altKey||E.shiftKey||E.ctrlKey||E.metaKey}})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/layout/layout.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/layout/layout.js new file mode 100644 index 000000000..d02919710 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/layout/layout.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/cdk/coercion"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/platform")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/cdk/coercion","rxjs","rxjs/operators","@angular/cdk/platform"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkLayout={},e.ngCore,e.ngCdkCoercion,e.rxjs,e.rxjsOperators,e.ngCdkPlatform)}(this,(function(e,t,r,n,a,i){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=o(t),d=o(i);class c{}c.ɵfac=s.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:s,type:c,deps:[],target:s.ɵɵFactoryTarget.NgModule}),c.ɵmod=s.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:s,type:c}),c.ɵinj=s.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:s,type:c}),s.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:s,type:c,decorators:[{type:t.NgModule,args:[{}]}]});const p=new Set;let m;class l{constructor(e){this._platform=e,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):h}matchMedia(e){return(this._platform.WEBKIT||this._platform.BLINK)&&function(e){if(p.has(e))return;try{m||(m=document.createElement("style"),m.setAttribute("type","text/css"),document.head.appendChild(m)),m.sheet&&(m.sheet.insertRule(`@media ${e} {body{ }}`,0),p.add(e))}catch(e){console.error(e)}}(e),this._matchMedia(e)}}function h(e){return{matches:"all"===e||""===e,media:e,addListener:()=>{},removeListener:()=>{}}}l.ɵfac=s.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:s,type:l,deps:[{token:d.Platform}],target:s.ɵɵFactoryTarget.Injectable}),l.ɵprov=s.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:s,type:l,providedIn:"root"}),s.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:s,type:l,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:d.Platform}]}});class u{constructor(e,t){this._mediaMatcher=e,this._zone=t,this._queries=new Map,this._destroySubject=new n.Subject}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(e){return g(r.coerceArray(e)).some((e=>this._registerQuery(e).mql.matches))}observe(e){const t=g(r.coerceArray(e)).map((e=>this._registerQuery(e).observable));let i=n.combineLatest(t);return i=n.concat(i.pipe(a.take(1)),i.pipe(a.skip(1),a.debounceTime(0))),i.pipe(a.map((e=>{const t={matches:!1,breakpoints:{}};return e.forEach((({matches:e,query:r})=>{t.matches=t.matches||e,t.breakpoints[r]=e})),t})))}_registerQuery(e){if(this._queries.has(e))return this._queries.get(e);const t=this._mediaMatcher.matchMedia(e),r={observable:new n.Observable((e=>{const r=t=>this._zone.run((()=>e.next(t)));return t.addListener(r),()=>{t.removeListener(r)}})).pipe(a.startWith(t),a.map((({matches:t})=>({query:e,matches:t}))),a.takeUntil(this._destroySubject)),mql:t};return this._queries.set(e,r),r}}function g(e){return e.map((e=>e.split(","))).reduce(((e,t)=>e.concat(t))).map((e=>e.trim()))}u.ɵfac=s.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:s,type:u,deps:[{token:l},{token:s.NgZone}],target:s.ɵɵFactoryTarget.Injectable}),u.ɵprov=s.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:s,type:u,providedIn:"root"}),s.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:s,type:u,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:l},{type:s.NgZone}]}});e.BreakpointObserver=u,e.Breakpoints={XSmall:"(max-width: 599.98px)",Small:"(min-width: 600px) and (max-width: 959.98px)",Medium:"(min-width: 960px) and (max-width: 1279.98px)",Large:"(min-width: 1280px) and (max-width: 1919.98px)",XLarge:"(min-width: 1920px)",Handset:"(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)",Tablet:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait), (min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",Web:"(min-width: 840px) and (orientation: portrait), (min-width: 1280px) and (orientation: landscape)",HandsetPortrait:"(max-width: 599.98px) and (orientation: portrait)",TabletPortrait:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait)",WebPortrait:"(min-width: 840px) and (orientation: portrait)",HandsetLandscape:"(max-width: 959.98px) and (orientation: landscape)",TabletLandscape:"(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",WebLandscape:"(min-width: 1280px) and (orientation: landscape)"},e.LayoutModule=c,e.MediaMatcher=l})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/listbox/listbox.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/listbox/listbox.js new file mode 100644 index 000000000..c47b00b50 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/listbox/listbox.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/cdk/a11y"),require("@angular/cdk/keycodes"),require("@angular/cdk/coercion"),require("@angular/cdk/collections"),require("rxjs"),require("rxjs/operators"),require("@angular/forms"),require("@angular/cdk/bidi")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/cdk/a11y","@angular/cdk/keycodes","@angular/cdk/coercion","@angular/cdk/collections","rxjs","rxjs/operators","@angular/forms","@angular/cdk/bidi"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkListbox={},e.ngCore,e.ngCdkA11y,e.ngCdkKeycodes,e.ngCdkCoercion,e.ngCdkCollections,e.rxjs,e.rxjsOperators,e.ngForms,e.ngCdkBidi)}(this,(function(e,t,i,s,n,a,o,l,r,d){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var h=c(t);let p=0;class u extends a.SelectionModel{constructor(e=!1,t,i=!0,s){super(!0,t,i,s),this.multiple=e}isMultipleSelection(){return this.multiple}select(...e){return this.multiple?super.select(...e):super.setSelection(...e)}}class g{constructor(){this._generatedId="cdk-option-"+p++,this._disabled=!1,this.element=t.inject(t.ElementRef).nativeElement,this.listbox=t.inject(b),this.destroyed=new o.Subject,this._clicked=new o.Subject}get id(){return this._id||this._generatedId}set id(e){this._id=e}get disabled(){return this.listbox.disabled||this._disabled}set disabled(e){this._disabled=n.coerceBooleanProperty(e)}get enabledTabIndex(){return void 0===this._enabledTabIndex?this.listbox.enabledTabIndex:this._enabledTabIndex}set enabledTabIndex(e){this._enabledTabIndex=e}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete()}isSelected(){return this.listbox.isSelected(this)}isActive(){return this.listbox.isActive(this)}toggle(){this.listbox.toggle(this)}select(){this.listbox.select(this)}deselect(){this.listbox.deselect(this)}focus(){this.element.focus()}getLabel(){return(this.typeaheadLabel??this.element.textContent?.trim())||""}setActiveStyles(){}setInactiveStyles(){}_handleFocus(){this.listbox.useActiveDescendant&&(this.listbox._setActiveOption(this),this.listbox.focus())}_getTabIndex(){return this.listbox.useActiveDescendant||this.disabled?-1:this.isActive()?this.enabledTabIndex:-1}}g.ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:h,type:g,deps:[],target:h.ɵɵFactoryTarget.Directive}),g.ɵdir=h.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:g,isStandalone:!0,selector:"[cdkOption]",inputs:{id:"id",value:["cdkOption","value"],typeaheadLabel:["cdkOptionTypeaheadLabel","typeaheadLabel"],disabled:["cdkOptionDisabled","disabled"],enabledTabIndex:["tabindex","enabledTabIndex"]},host:{attributes:{role:"option"},listeners:{click:"_clicked.next($event)",focus:"_handleFocus()"},properties:{id:"id","attr.aria-selected":"isSelected()","attr.tabindex":"_getTabIndex()","attr.aria-disabled":"disabled","class.cdk-option-active":"isActive()"},classAttribute:"cdk-option"},exportAs:["cdkOption"],ngImport:h}),h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:h,type:g,decorators:[{type:t.Directive,args:[{selector:"[cdkOption]",standalone:!0,exportAs:"cdkOption",host:{role:"option",class:"cdk-option","[id]":"id","[attr.aria-selected]":"isSelected()","[attr.tabindex]":"_getTabIndex()","[attr.aria-disabled]":"disabled","[class.cdk-option-active]":"isActive()","(click)":"_clicked.next($event)","(focus)":"_handleFocus()"}}]}],propDecorators:{id:[{type:t.Input}],value:[{type:t.Input,args:["cdkOption"]}],typeaheadLabel:[{type:t.Input,args:["cdkOptionTypeaheadLabel"]}],disabled:[{type:t.Input,args:["cdkOptionDisabled"]}],enabledTabIndex:[{type:t.Input,args:["tabindex"]}]}});class b{constructor(){this._generatedId="cdk-listbox-"+p++,this._disabled=!1,this._useActiveDescendant=!1,this._orientation="vertical",this._navigationWrapDisabled=!1,this._navigateDisabledOptions=!1,this.valueChange=new o.Subject,this.selectionModel=new u,this.destroyed=new o.Subject,this.element=t.inject(t.ElementRef).nativeElement,this.changeDetectorRef=t.inject(t.ChangeDetectorRef),this._invalid=!1,this._lastTriggered=null,this._onTouched=()=>{},this._onChange=()=>{},this._optionClicked=o.defer((()=>this.options.changes.pipe(l.startWith(this.options),l.switchMap((e=>o.merge(...e.map((e=>e._clicked.pipe(l.map((t=>({option:e,event:t})))))))))))),this._dir=t.inject(d.Directionality,{optional:!0}),this._skipDisabledPredicate=e=>e.disabled,this._skipNonePredicate=()=>!1,this._hasFocus=!1}get id(){return this._id||this._generatedId}set id(e){this._id=e}get enabledTabIndex(){return void 0===this._enabledTabIndex?0:this._enabledTabIndex}set enabledTabIndex(e){this._enabledTabIndex=e}get value(){return this._invalid?[]:this.selectionModel.selected}set value(e){this._setSelection(e)}get multiple(){return this.selectionModel.multiple}set multiple(e){this.selectionModel.multiple=n.coerceBooleanProperty(e),this.options&&this._updateInternalValue()}get disabled(){return this._disabled}set disabled(e){this._disabled=n.coerceBooleanProperty(e)}get useActiveDescendant(){return this._useActiveDescendant}set useActiveDescendant(e){this._useActiveDescendant=n.coerceBooleanProperty(e)}get orientation(){return this._orientation}set orientation(e){this._orientation="horizontal"===e?"horizontal":"vertical","horizontal"===e?this.listKeyManager?.withHorizontalOrientation(this._dir?.value||"ltr"):this.listKeyManager?.withVerticalOrientation()}get compareWith(){return this.selectionModel.compareWith}set compareWith(e){this.selectionModel.compareWith=e}get navigationWrapDisabled(){return this._navigationWrapDisabled}set navigationWrapDisabled(e){this._navigationWrapDisabled=n.coerceBooleanProperty(e),this.listKeyManager?.withWrap(!this._navigationWrapDisabled)}get navigateDisabledOptions(){return this._navigateDisabledOptions}set navigateDisabledOptions(e){this._navigateDisabledOptions=n.coerceBooleanProperty(e),this.listKeyManager?.skipPredicate(this._navigateDisabledOptions?this._skipNonePredicate:this._skipDisabledPredicate)}ngAfterContentInit(){("undefined"==typeof ngDevMode||ngDevMode)&&(this._verifyNoOptionValueCollisions(),this._verifyOptionValues()),this._initKeyManager(),o.merge(this.selectionModel.changed,this.options.changes).pipe(l.startWith(null),l.takeUntil(this.destroyed)).subscribe((()=>this._updateInternalValue())),this._optionClicked.pipe(l.filter((({option:e})=>!e.disabled)),l.takeUntil(this.destroyed)).subscribe((({option:e,event:t})=>this._handleOptionClicked(e,t)))}ngOnDestroy(){this.listKeyManager?.destroy(),this.destroyed.next(),this.destroyed.complete()}toggle(e){this.toggleValue(e.value)}toggleValue(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.toggle(e)}select(e){this.selectValue(e.value)}selectValue(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.select(e)}deselect(e){this.deselectValue(e.value)}deselectValue(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.deselect(e)}setAllSelected(e){e?(this._invalid&&this.selectionModel.clear(!1),this.selectionModel.select(...this.options.map((e=>e.value)))):this.selectionModel.clear()}isSelected(e){return this.isValueSelected(e.value)}isActive(e){return!(this.listKeyManager?.activeItem!==e)}isValueSelected(e){return!this._invalid&&this.selectionModel.isSelected(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}writeValue(e){this._setSelection(e),this._verifyOptionValues()}setDisabledState(e){this.disabled=e}focus(){this.element.focus()}triggerOption(e){if(e&&!e.disabled){this._lastTriggered=e;(this.multiple?this.selectionModel.toggle(e.value):this.selectionModel.select(e.value))&&(this._onChange(this.value),this.valueChange.next({value:this.value,listbox:this,option:e}))}}triggerRange(e,t,i,s){if(this.disabled||e&&e.disabled)return;this._lastTriggered=e;const n=this.compareWith??Object.is,a=[...this.options].slice(Math.max(0,Math.min(t,i)),Math.min(this.options.length,Math.max(t,i)+1)).filter((e=>!e.disabled)).map((e=>e.value)),o=[...this.value];for(const e of a){const t=o.findIndex((t=>n(t,e)));s&&-1===t?o.push(e):s||-1===t||o.splice(t,1)}this.selectionModel.setSelection(...o)&&(this._onChange(this.value),this.valueChange.next({value:this.value,listbox:this,option:e}))}_setActiveOption(e){this.listKeyManager.setActiveItem(e)}_handleFocus(){this.useActiveDescendant||(this.selectionModel.selected.length>0?this._setNextFocusToSelectedOption():this.listKeyManager.setNextItemActive(),this._focusActiveOption())}_handleKeydown(e){if(this._disabled)return;const{keyCode:t}=e,i=this.listKeyManager.activeItemIndex,n=["ctrlKey","metaKey"];if(this.multiple&&t===s.A&&s.hasModifierKey(e,...n))return this.triggerRange(null,0,this.options.length-1,this.options.length!==this.value.length),void e.preventDefault();if(this.multiple&&(t===s.SPACE||t===s.ENTER)&&s.hasModifierKey(e,"shiftKey"))return this.listKeyManager.activeItem&&null!=this.listKeyManager.activeItemIndex&&this.triggerRange(this.listKeyManager.activeItem,this._getLastTriggeredIndex()??this.listKeyManager.activeItemIndex,this.listKeyManager.activeItemIndex,!this.listKeyManager.activeItem.isSelected()),void e.preventDefault();if(this.multiple&&t===s.HOME&&s.hasModifierKey(e,...n)&&s.hasModifierKey(e,"shiftKey")){const t=this.listKeyManager.activeItem;if(t){const e=this.listKeyManager.activeItemIndex;this.listKeyManager.setFirstItemActive(),this.triggerRange(t,e,this.listKeyManager.activeItemIndex,!t.isSelected())}return void e.preventDefault()}if(this.multiple&&t===s.END&&s.hasModifierKey(e,...n)&&s.hasModifierKey(e,"shiftKey")){const t=this.listKeyManager.activeItem;if(t){const e=this.listKeyManager.activeItemIndex;this.listKeyManager.setLastItemActive(),this.triggerRange(t,e,this.listKeyManager.activeItemIndex,!t.isSelected())}return void e.preventDefault()}if(t===s.SPACE||t===s.ENTER)return this.triggerOption(this.listKeyManager.activeItem),void e.preventDefault();const a=t===s.UP_ARROW||t===s.DOWN_ARROW||t===s.LEFT_ARROW||t===s.RIGHT_ARROW||t===s.HOME||t===s.END;this.listKeyManager.onKeydown(e),a&&e.shiftKey&&i!==this.listKeyManager.activeItemIndex&&this.triggerOption(this.listKeyManager.activeItem)}_handleFocusIn(){this._hasFocus=!0}_handleFocusOut(e){const t=e.relatedTarget;this.element===t||this.element.contains(t)||(this._onTouched(),this._hasFocus=!1,this._setNextFocusToSelectedOption())}_getAriaActiveDescendant(){return this._useActiveDescendant?this.listKeyManager?.activeItem?.id:null}_getTabIndex(){return this.disabled?-1:this.useActiveDescendant||!this.listKeyManager.activeItem?this.enabledTabIndex:-1}_initKeyManager(){this.listKeyManager=new i.ActiveDescendantKeyManager(this.options).withWrap(!this._navigationWrapDisabled).withTypeAhead().withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._navigateDisabledOptions?this._skipNonePredicate:this._skipDisabledPredicate),"vertical"===this.orientation?this.listKeyManager.withVerticalOrientation():this.listKeyManager.withHorizontalOrientation(this._dir?.value||"ltr"),this.selectionModel.selected.length&&Promise.resolve().then((()=>this._setNextFocusToSelectedOption())),this.listKeyManager.change.subscribe((()=>this._focusActiveOption()))}_focusActiveOption(){this.useActiveDescendant||this.listKeyManager.activeItem?.focus(),this.changeDetectorRef.markForCheck()}_setSelection(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.setSelection(...this._coerceValue(e)),this._hasFocus||this._setNextFocusToSelectedOption()}_setNextFocusToSelectedOption(){const e=this.options?.find((e=>e.isSelected()));e&&this.listKeyManager.updateActiveItem(e)}_updateInternalValue(){const e=new Map;this.selectionModel.sort(((t,i)=>this._getIndexForValue(e,t)-this._getIndexForValue(e,i)));const t=this.selectionModel.selected;this._invalid=!this.multiple&&t.length>1||!!this._getInvalidOptionValues(t).length,this.changeDetectorRef.markForCheck()}_getIndexForValue(e,t){const i=this.compareWith||Object.is;if(!e.has(t)){let s=-1;for(let e=0;e{const e=this.compareWith??Object.is;for(let t=0;t1)throw Error("Listbox cannot have more than one selected value in multi-selection mode.");if(t.length)throw Error("Listbox has selected values that do not match any of its options.")}}_coerceValue(e){return null==e?[]:n.coerceArray(e)}_getInvalidOptionValues(e){const t=this.compareWith||Object.is,i=(this.options||[]).map((e=>e.value));return e.filter((e=>!i.some((i=>t(e,i)))))}_getLastTriggeredIndex(){const e=this.options.toArray().indexOf(this._lastTriggered);return-1===e?null:e}}b.ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:h,type:b,deps:[],target:h.ɵɵFactoryTarget.Directive}),b.ɵdir=h.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:b,isStandalone:!0,selector:"[cdkListbox]",inputs:{id:"id",enabledTabIndex:["tabindex","enabledTabIndex"],value:["cdkListboxValue","value"],multiple:["cdkListboxMultiple","multiple"],disabled:["cdkListboxDisabled","disabled"],useActiveDescendant:["cdkListboxUseActiveDescendant","useActiveDescendant"],orientation:["cdkListboxOrientation","orientation"],compareWith:["cdkListboxCompareWith","compareWith"],navigationWrapDisabled:["cdkListboxNavigationWrapDisabled","navigationWrapDisabled"],navigateDisabledOptions:["cdkListboxNavigatesDisabledOptions","navigateDisabledOptions"]},outputs:{valueChange:"cdkListboxValueChange"},host:{attributes:{role:"listbox"},listeners:{focus:"_handleFocus()",keydown:"_handleKeydown($event)",focusout:"_handleFocusOut($event)",focusin:"_handleFocusIn()"},properties:{id:"id","attr.tabindex":"_getTabIndex()","attr.aria-disabled":"disabled","attr.aria-multiselectable":"multiple","attr.aria-activedescendant":"_getAriaActiveDescendant()","attr.aria-orientation":"orientation"},classAttribute:"cdk-listbox"},providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((()=>b)),multi:!0}],queries:[{propertyName:"options",predicate:g,descendants:!0}],exportAs:["cdkListbox"],ngImport:h}),h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:h,type:b,decorators:[{type:t.Directive,args:[{selector:"[cdkListbox]",standalone:!0,exportAs:"cdkListbox",host:{role:"listbox",class:"cdk-listbox","[id]":"id","[attr.tabindex]":"_getTabIndex()","[attr.aria-disabled]":"disabled","[attr.aria-multiselectable]":"multiple","[attr.aria-activedescendant]":"_getAriaActiveDescendant()","[attr.aria-orientation]":"orientation","(focus)":"_handleFocus()","(keydown)":"_handleKeydown($event)","(focusout)":"_handleFocusOut($event)","(focusin)":"_handleFocusIn()"},providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((()=>b)),multi:!0}]}]}],propDecorators:{id:[{type:t.Input}],enabledTabIndex:[{type:t.Input,args:["tabindex"]}],value:[{type:t.Input,args:["cdkListboxValue"]}],multiple:[{type:t.Input,args:["cdkListboxMultiple"]}],disabled:[{type:t.Input,args:["cdkListboxDisabled"]}],useActiveDescendant:[{type:t.Input,args:["cdkListboxUseActiveDescendant"]}],orientation:[{type:t.Input,args:["cdkListboxOrientation"]}],compareWith:[{type:t.Input,args:["cdkListboxCompareWith"]}],navigationWrapDisabled:[{type:t.Input,args:["cdkListboxNavigationWrapDisabled"]}],navigateDisabledOptions:[{type:t.Input,args:["cdkListboxNavigatesDisabledOptions"]}],valueChange:[{type:t.Output,args:["cdkListboxValueChange"]}],options:[{type:t.ContentChildren,args:[g,{descendants:!0}]}]}});const v=[b,g];class y{}y.ɵfac=h.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:h,type:y,deps:[],target:h.ɵɵFactoryTarget.NgModule}),y.ɵmod=h.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:h,type:y,imports:[b,g],exports:[b,g]}),y.ɵinj=h.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:h,type:y}),h.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:h,type:y,decorators:[{type:t.NgModule,args:[{imports:[...v],exports:[...v]}]}]}),e.CdkListbox=b,e.CdkListboxModule=y,e.CdkOption=g})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/menu/menu.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/menu/menu.js new file mode 100644 index 000000000..177c929ff --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/menu/menu.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/cdk/overlay"),require("@angular/cdk/keycodes"),require("rxjs/operators"),require("@angular/cdk/collections"),require("rxjs"),require("@angular/cdk/portal"),require("@angular/cdk/a11y"),require("@angular/cdk/coercion"),require("@angular/cdk/bidi"),require("@angular/cdk/platform")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/cdk/overlay","@angular/cdk/keycodes","rxjs/operators","@angular/cdk/collections","rxjs","@angular/cdk/portal","@angular/cdk/a11y","@angular/cdk/coercion","@angular/cdk/bidi","@angular/cdk/platform"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkMenu={},e.ngCore,e.ngCdkOverlay,e.ngCdkKeycodes,e.rxjsOperators,e.ngCdkCollections,e.rxjs,e.ngCdkPortal,e.ngCdkA11y,e.ngCdkCoercion,e.ngCdkBidi,e.ngCdkPlatform)}(this,(function(e,t,i,s,n,r,o,a,c,u,l,d){"use strict";function h(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var p=h(t);class g{}g.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:g,deps:[],target:p.ɵɵFactoryTarget.Directive}),g.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:g,isStandalone:!0,selector:"[cdkMenuGroup]",host:{attributes:{role:"group"},classAttribute:"cdk-menu-group"},providers:[{provide:r.UniqueSelectionDispatcher,useClass:r.UniqueSelectionDispatcher}],exportAs:["cdkMenuGroup"],ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:g,decorators:[{type:t.Directive,args:[{selector:"[cdkMenuGroup]",exportAs:"cdkMenuGroup",standalone:!0,host:{role:"group",class:"cdk-menu-group"},providers:[{provide:r.UniqueSelectionDispatcher,useClass:r.UniqueSelectionDispatcher}]}]}]});const m=new t.InjectionToken("cdk-menu"),y=new t.InjectionToken("cdk-menu-stack"),k={provide:y,deps:[[new t.Optional,new t.SkipSelf,new t.Inject(y)]],useFactory:e=>e||new M},_=e=>({provide:y,deps:[[new t.Optional,new t.SkipSelf,new t.Inject(y)]],useFactory:t=>t||M.inline(e)});let v=0;class M{constructor(){this.id=""+v++,this._elements=[],this._close=new o.Subject,this._empty=new o.Subject,this._hasFocus=new o.Subject,this.closed=this._close,this.hasFocus=this._hasFocus.pipe(n.startWith(!1),n.debounceTime(0),n.distinctUntilChanged()),this.emptied=this._empty,this._inlineMenuOrientation=null}static inline(e){const t=new M;return t._inlineMenuOrientation=e,t}push(e){this._elements.push(e)}close(e,t){const{focusNextOnEmpty:i,focusParentTrigger:s}={...t};if(this._elements.indexOf(e)>=0){let t;do{t=this._elements.pop(),this._close.next({item:t,focusParentTrigger:s})}while(t!==e);this.isEmpty()&&this._empty.next(i)}}closeSubMenuOf(e){let t=!1;if(this._elements.indexOf(e)>=0)for(t=this.peek()!==e;this.peek()!==e;)this._close.next({item:this._elements.pop()});return t}closeAll(e){const{focusNextOnEmpty:t,focusParentTrigger:i}={...e};if(!this.isEmpty()){for(;!this.isEmpty();){const e=this._elements.pop();e&&this._close.next({item:e,focusParentTrigger:i})}this._empty.next(t)}}isEmpty(){return!this._elements.length}length(){return this._elements.length}peek(){return this._elements[this._elements.length-1]}hasInlineMenu(){return null!=this._inlineMenuOrientation}inlineMenuOrientation(){return this._inlineMenuOrientation}setHasFocus(e){this._hasFocus.next(e)}}M.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:M,deps:[],target:p.ɵɵFactoryTarget.Injectable}),M.ɵprov=p.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:M}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:M,decorators:[{type:t.Injectable}]});const b=new t.InjectionToken("cdk-menu-trigger");class f{constructor(){this.injector=t.inject(t.Injector),this.viewContainerRef=t.inject(t.ViewContainerRef),this.menuStack=t.inject(y),this.opened=new t.EventEmitter,this.closed=new t.EventEmitter,this.overlayRef=null,this.destroyed=new o.Subject,this.stopOutsideClicksListener=o.merge(this.closed,this.destroyed)}ngOnDestroy(){this._destroyOverlay(),this.destroyed.next(),this.destroyed.complete()}isOpen(){return!!this.overlayRef?.hasAttached()}registerChildMenu(e){this.childMenu=e}getMenuContentPortal(){const e=this.menuTemplateRef!==this._menuPortal?.templateRef;return!this.menuTemplateRef||this._menuPortal&&!e||(this._menuPortal=new a.TemplatePortal(this.menuTemplateRef,this.viewContainerRef,this.menuData,this._getChildMenuInjector())),this._menuPortal}isElementInsideMenuStack(e){for(let t=e;t;t=t?.parentElement??null)if(t.getAttribute("data-cdk-menu-stack-id")===this.menuStack.id)return!0;return!1}_destroyOverlay(){this.overlayRef&&(this.overlayRef.dispose(),this.overlayRef=null)}_getChildMenuInjector(){return this._childMenuInjector=this._childMenuInjector||t.Injector.create({providers:[{provide:b,useValue:this},{provide:y,useValue:this.menuStack}],parent:this.injector}),this._childMenuInjector}}f.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:f,deps:[],target:p.ɵɵFactoryTarget.Directive}),f.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:f,host:{properties:{"attr.aria-controls":"childMenu?.id","attr.data-cdk-menu-stack-id":"menuStack.id"}},ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:f,decorators:[{type:t.Directive,args:[{host:{"[attr.aria-controls]":"childMenu?.id","[attr.data-cdk-menu-stack-id]":"menuStack.id"}}]}]});const I=new t.InjectionToken("cdk-menu-aim");function T(e,t){return e.y-t*e.x}function D(e,t,i){const{left:s,right:n,top:r,bottom:o}=e;return t*s+i>=r&&t*s+i<=o||t*n+i>=r&&t*n+i<=o||(r-i)/t>=s&&(r-i)/t<=n||(o-i)/t>=s&&(o-i)/t<=n}class x{constructor(){this._ngZone=t.inject(t.NgZone),this._points=[],this._destroyed=new o.Subject}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}initialize(e,t){this._menu=e,this._pointerTracker=t,this._subscribeToMouseMoves()}toggle(e){"horizontal"===this._menu.orientation&&e(),this._checkConfigured();const t=!!this._timeoutId;this._points.length>1&&!t?this._isMovingToSubmenu()?this._startTimeout(e):e():t||e()}_startTimeout(e){const t=setTimeout((()=>{this._pointerTracker.activeElement&&t===this._timeoutId&&e(),this._timeoutId=null}),300);this._timeoutId=t}_isMovingToSubmenu(){const e=this._getSubmenuBounds();if(!e)return!1;let t=0;const i=this._points[this._points.length-1];for(let r=this._points.length-2;r>=0;r--){const o=this._points[r],a=(s=i,((n=o).y-s.y)/(n.x-s.x));D(e,a,T(i,a))&&t++}var s,n;return t>=Math.floor(2.5)}_getSubmenuBounds(){return this._pointerTracker?.previousElement?.getMenu()?.nativeElement.getBoundingClientRect()}_checkConfigured(){("undefined"==typeof ngDevMode||ngDevMode)&&(this._pointerTracker||function(){throw Error("expected an instance of PointerFocusTracker to be provided")}(),this._menu||function(){throw Error("expected a reference to the parent menu")}())}_subscribeToMouseMoves(){this._ngZone.runOutsideAngular((()=>{o.fromEvent(this._menu.nativeElement,"mousemove").pipe(n.filter(((e,t)=>t%3==0)),n.takeUntil(this._destroyed)).subscribe((e=>{this._points.push({x:e.clientX,y:e.clientY}),this._points.length>5&&this._points.shift()}))}))}}x.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:x,deps:[],target:p.ɵɵFactoryTarget.Injectable}),x.ɵprov=p.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:x}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:x,decorators:[{type:t.Injectable}]});class O{}O.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:O,deps:[],target:p.ɵɵFactoryTarget.Directive}),O.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:O,isStandalone:!0,selector:"[cdkTargetMenuAim]",providers:[{provide:I,useClass:x}],exportAs:["cdkTargetMenuAim"],ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:O,decorators:[{type:t.Directive,args:[{selector:"[cdkTargetMenuAim]",exportAs:"cdkTargetMenuAim",standalone:!0,providers:[{provide:I,useClass:x}]}]}]});class C extends f{constructor(){super(),this._elementRef=t.inject(t.ElementRef),this._overlay=t.inject(i.Overlay),this._ngZone=t.inject(t.NgZone),this._parentMenu=t.inject(m,{optional:!0}),this._menuAim=t.inject(I,{optional:!0}),this._directionality=t.inject(l.Directionality,{optional:!0}),this._setRole(),this._registerCloseHandler(),this._subscribeToMenuStackClosed(),this._subscribeToMouseEnter(),this._subscribeToMenuStackHasFocus(),this._setType()}toggle(){this.isOpen()?this.close():this.open()}open(){this.isOpen()||(this.opened.next(),this.overlayRef=this.overlayRef||this._overlay.create(this._getOverlayConfig()),this.overlayRef.attach(this.getMenuContentPortal()),this._subscribeToOutsideClicks())}close(){this.isOpen()&&(this.closed.next(),this.overlayRef.detach()),this._closeSiblingTriggers()}getMenu(){return this.childMenu}_toggleOnKeydown(e){const t="vertical"===this._parentMenu?.orientation;switch(e.keyCode){case s.SPACE:case s.ENTER:s.hasModifierKey(e)||(e.preventDefault(),this.toggle(),this.childMenu?.focusFirstItem("keyboard"));break;case s.RIGHT_ARROW:s.hasModifierKey(e)||this._parentMenu&&t&&"rtl"!==this._directionality?.value&&(e.preventDefault(),this.open(),this.childMenu?.focusFirstItem("keyboard"));break;case s.LEFT_ARROW:s.hasModifierKey(e)||this._parentMenu&&t&&"rtl"===this._directionality?.value&&(e.preventDefault(),this.open(),this.childMenu?.focusFirstItem("keyboard"));break;case s.DOWN_ARROW:case s.UP_ARROW:s.hasModifierKey(e)||t||(e.preventDefault(),this.open(),e.keyCode===s.DOWN_ARROW?this.childMenu?.focusFirstItem("keyboard"):this.childMenu?.focusLastItem("keyboard"))}}_setHasFocus(e){this._parentMenu||this.menuStack.setHasFocus(e)}_subscribeToMouseEnter(){this._ngZone.runOutsideAngular((()=>{o.fromEvent(this._elementRef.nativeElement,"mouseenter").pipe(n.filter((()=>!this.menuStack.isEmpty()&&!this.isOpen())),n.takeUntil(this.destroyed)).subscribe((()=>{const e=()=>this._ngZone.run((()=>{this._closeSiblingTriggers(),this.open()}));this._menuAim?this._menuAim.toggle(e):e()}))}))}_closeSiblingTriggers(){if(this._parentMenu){!this.menuStack.closeSubMenuOf(this._parentMenu)&&this.menuStack.peek()!==this._parentMenu&&this.menuStack.closeAll()}else this.menuStack.closeAll()}_getOverlayConfig(){return new i.OverlayConfig({positionStrategy:this._getOverlayPositionStrategy(),scrollStrategy:this._overlay.scrollStrategies.reposition(),direction:this._directionality||void 0})}_getOverlayPositionStrategy(){return this._overlay.position().flexibleConnectedTo(this._elementRef).withLockedPosition().withGrowAfterOpen().withPositions(this._getOverlayPositions())}_getOverlayPositions(){return this.menuPosition??(this._parentMenu&&"horizontal"!==this._parentMenu.orientation?i.STANDARD_DROPDOWN_ADJACENT_POSITIONS:i.STANDARD_DROPDOWN_BELOW_POSITIONS)}_registerCloseHandler(){this._parentMenu||this.menuStack.closed.pipe(n.takeUntil(this.destroyed)).subscribe((({item:e})=>{e===this.childMenu&&this.close()}))}_subscribeToOutsideClicks(){this.overlayRef&&this.overlayRef.outsidePointerEvents().pipe(n.takeUntil(this.stopOutsideClicksListener)).subscribe((e=>{const t=d._getEventTarget(e),i=this._elementRef.nativeElement;t===i||i.contains(t)||(this.isElementInsideMenuStack(t)?this._closeSiblingTriggers():this.menuStack.closeAll())}))}_subscribeToMenuStackHasFocus(){this._parentMenu||this.menuStack.hasFocus.pipe(n.takeUntil(this.destroyed)).subscribe((e=>{e||this.menuStack.closeAll()}))}_subscribeToMenuStackClosed(){this._parentMenu||this.menuStack.closed.subscribe((({focusParentTrigger:e})=>{e&&!this.menuStack.length()&&this._elementRef.nativeElement.focus()}))}_setRole(){this._parentMenu||this._elementRef.nativeElement.setAttribute("role","button")}_setType(){const e=this._elementRef.nativeElement;"BUTTON"!==e.nodeName||e.getAttribute("type")||e.setAttribute("type","button")}}C.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:C,deps:[],target:p.ɵɵFactoryTarget.Directive}),C.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:C,isStandalone:!0,selector:"[cdkMenuTriggerFor]",inputs:{menuTemplateRef:["cdkMenuTriggerFor","menuTemplateRef"],menuPosition:["cdkMenuPosition","menuPosition"],menuData:["cdkMenuTriggerData","menuData"]},outputs:{opened:"cdkMenuOpened",closed:"cdkMenuClosed"},host:{attributes:{"aria-haspopup":"menu"},listeners:{focusin:"_setHasFocus(true)",focusout:"_setHasFocus(false)",keydown:"_toggleOnKeydown($event)",click:"toggle()"},properties:{"attr.aria-expanded":"isOpen()"},classAttribute:"cdk-menu-trigger"},providers:[{provide:b,useExisting:C},k],exportAs:["cdkMenuTriggerFor"],usesInheritance:!0,ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:C,decorators:[{type:t.Directive,args:[{selector:"[cdkMenuTriggerFor]",exportAs:"cdkMenuTriggerFor",standalone:!0,host:{class:"cdk-menu-trigger","aria-haspopup":"menu","[attr.aria-expanded]":"isOpen()","(focusin)":"_setHasFocus(true)","(focusout)":"_setHasFocus(false)","(keydown)":"_toggleOnKeydown($event)","(click)":"toggle()"},inputs:["menuTemplateRef: cdkMenuTriggerFor","menuPosition: cdkMenuPosition","menuData: cdkMenuTriggerData"],outputs:["opened: cdkMenuOpened","closed: cdkMenuClosed"],providers:[{provide:b,useExisting:C},k]}]}],ctorParameters:function(){return[]}});class S{constructor(){this._dir=t.inject(l.Directionality,{optional:!0}),this._elementRef=t.inject(t.ElementRef),this._ngZone=t.inject(t.NgZone),this._menuAim=t.inject(I,{optional:!0}),this._menuStack=t.inject(y),this._parentMenu=t.inject(m,{optional:!0}),this._menuTrigger=t.inject(C,{optional:!0,self:!0}),this._disabled=!1,this.triggered=new t.EventEmitter,this.hasMenu=!!this._menuTrigger,this._tabindex=-1,this.closeOnSpacebarTrigger=!0,this.destroyed=new o.Subject,this._setupMouseEnter(),this._setType(),this._isStandaloneItem()&&(this._tabindex=0)}get disabled(){return this._disabled}set disabled(e){this._disabled=u.coerceBooleanProperty(e)}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete()}focus(){this._elementRef.nativeElement.focus()}trigger(e){const{keepOpen:t}={...e};this.disabled||this.hasMenu||(this.triggered.next(),t||this._menuStack.closeAll({focusParentTrigger:!0}))}isMenuOpen(){return!!this._menuTrigger?.isOpen()}getMenu(){return this._menuTrigger?.getMenu()}getMenuTrigger(){return this._menuTrigger}getLabel(){return this.typeaheadLabel||this._elementRef.nativeElement.textContent?.trim()||""}_resetTabIndex(){this._isStandaloneItem()||(this._tabindex=-1)}_setTabIndex(e){this.disabled||e&&this._menuStack.isEmpty()||(this._tabindex=0)}_onKeydown(e){switch(e.keyCode){case s.SPACE:case s.ENTER:s.hasModifierKey(e)||(e.preventDefault(),this.trigger({keepOpen:e.keyCode===s.SPACE&&!this.closeOnSpacebarTrigger}));break;case s.RIGHT_ARROW:s.hasModifierKey(e)||this._parentMenu&&this._isParentVertical()&&("rtl"!==this._dir?.value?this._forwardArrowPressed(e):this._backArrowPressed(e));break;case s.LEFT_ARROW:s.hasModifierKey(e)||this._parentMenu&&this._isParentVertical()&&("rtl"!==this._dir?.value?this._backArrowPressed(e):this._forwardArrowPressed(e))}}_isStandaloneItem(){return!this._parentMenu}_backArrowPressed(e){const t=this._parentMenu;(this._menuStack.hasInlineMenu()||this._menuStack.length()>1)&&(e.preventDefault(),this._menuStack.close(t,{focusNextOnEmpty:"horizontal"===this._menuStack.inlineMenuOrientation()?1:2,focusParentTrigger:!0}))}_forwardArrowPressed(e){this.hasMenu||"horizontal"!==this._menuStack.inlineMenuOrientation()||(e.preventDefault(),this._menuStack.closeAll({focusNextOnEmpty:0,focusParentTrigger:!0}))}_setupMouseEnter(){if(!this._isStandaloneItem()){const e=()=>this._ngZone.run((()=>this._menuStack.closeSubMenuOf(this._parentMenu)));this._ngZone.runOutsideAngular((()=>o.fromEvent(this._elementRef.nativeElement,"mouseenter").pipe(n.filter((()=>!this._menuStack.isEmpty()&&!this.hasMenu)),n.takeUntil(this.destroyed)).subscribe((()=>{this._menuAim?this._menuAim.toggle(e):e()}))))}}_isParentVertical(){return"vertical"===this._parentMenu?.orientation}_setType(){const e=this._elementRef.nativeElement;"BUTTON"!==e.nodeName||e.getAttribute("type")||e.setAttribute("type","button")}}S.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:S,deps:[],target:p.ɵɵFactoryTarget.Directive}),S.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:S,isStandalone:!0,selector:"[cdkMenuItem]",inputs:{disabled:["cdkMenuItemDisabled","disabled"],typeaheadLabel:["cdkMenuitemTypeaheadLabel","typeaheadLabel"]},outputs:{triggered:"cdkMenuItemTriggered"},host:{attributes:{role:"menuitem"},listeners:{blur:"_resetTabIndex()",focus:"_setTabIndex()",click:"trigger()",keydown:"_onKeydown($event)"},properties:{tabindex:"_tabindex","attr.aria-disabled":"disabled || null"},classAttribute:"cdk-menu-item"},exportAs:["cdkMenuItem"],ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:S,decorators:[{type:t.Directive,args:[{selector:"[cdkMenuItem]",exportAs:"cdkMenuItem",standalone:!0,host:{role:"menuitem",class:"cdk-menu-item","[tabindex]":"_tabindex","[attr.aria-disabled]":"disabled || null","(blur)":"_resetTabIndex()","(focus)":"_setTabIndex()","(click)":"trigger()","(keydown)":"_onKeydown($event)"}}]}],ctorParameters:function(){return[]},propDecorators:{disabled:[{type:t.Input,args:["cdkMenuItemDisabled"]}],typeaheadLabel:[{type:t.Input,args:["cdkMenuitemTypeaheadLabel"]}],triggered:[{type:t.Output,args:["cdkMenuItemTriggered"]}]}});class E{constructor(e){this._items=e,this.entered=this._getItemPointerEntries(),this.exited=this._getItemPointerExits(),this._destroyed=new o.Subject,this.entered.subscribe((e=>this.activeElement=e)),this.exited.subscribe((()=>{this.previousElement=this.activeElement,this.activeElement=void 0}))}destroy(){this._destroyed.next(),this._destroyed.complete()}_getItemPointerEntries(){return o.defer((()=>this._items.changes.pipe(n.startWith(this._items),n.mergeMap((e=>e.map((e=>o.fromEvent(e._elementRef.nativeElement,"mouseenter").pipe(n.mapTo(e),n.takeUntil(this._items.changes)))))),n.mergeAll())))}_getItemPointerExits(){return o.defer((()=>this._items.changes.pipe(n.startWith(this._items),n.mergeMap((e=>e.map((e=>o.fromEvent(e._elementRef.nativeElement,"mouseout").pipe(n.mapTo(e),n.takeUntil(this._items.changes)))))),n.mergeAll())))}}let A=0;class R extends g{constructor(){super(...arguments),this.nativeElement=t.inject(t.ElementRef).nativeElement,this.ngZone=t.inject(t.NgZone),this.menuStack=t.inject(y),this.menuAim=t.inject(I,{optional:!0,self:!0}),this.dir=t.inject(l.Directionality,{optional:!0}),this.id="cdk-menu-"+A++,this.orientation="vertical",this.isInline=!1,this.destroyed=new o.Subject,this._menuStackHasFocus=!1}ngAfterContentInit(){this.isInline||this.menuStack.push(this),this._setKeyManager(),this._subscribeToMenuStackHasFocus(),this._subscribeToMenuOpen(),this._subscribeToMenuStackClosed(),this._setUpPointerTracker()}ngOnDestroy(){this.keyManager?.destroy(),this.destroyed.next(),this.destroyed.complete(),this.pointerTracker?.destroy()}focusFirstItem(e="program"){this.keyManager.setFocusOrigin(e),this.keyManager.setFirstItemActive()}focusLastItem(e="program"){this.keyManager.setFocusOrigin(e),this.keyManager.setLastItemActive()}_getTabIndex(){const e=this._menuStackHasFocus?-1:0;return this.isInline?e:null}closeOpenMenu(e,t){const{focusParentTrigger:i}={...t},s=this.keyManager,n=this.triggerItem;e===n?.getMenuTrigger()?.getMenu()&&(n?.getMenuTrigger()?.close(),i&&(n?s.setActiveItem(n):s.setFirstItemActive()))}_setKeyManager(){this.keyManager=new c.FocusKeyManager(this.items).withWrap().withTypeAhead().withHomeAndEnd(),"horizontal"===this.orientation?this.keyManager.withHorizontalOrientation(this.dir?.value||"ltr"):this.keyManager.withVerticalOrientation()}_subscribeToMenuOpen(){const e=o.merge(this.items.changes,this.destroyed);this.items.changes.pipe(n.startWith(this.items),n.mergeMap((t=>t.filter((e=>e.hasMenu)).map((t=>t.getMenuTrigger().opened.pipe(n.mapTo(t),n.takeUntil(e)))))),n.mergeAll(),n.switchMap((e=>(this.triggerItem=e,e.getMenuTrigger().closed))),n.takeUntil(this.destroyed)).subscribe((()=>this.triggerItem=void 0))}_subscribeToMenuStackClosed(){this.menuStack.closed.pipe(n.takeUntil(this.destroyed)).subscribe((({item:e,focusParentTrigger:t})=>this.closeOpenMenu(e,{focusParentTrigger:t})))}_subscribeToMenuStackHasFocus(){this.isInline&&this.menuStack.hasFocus.pipe(n.takeUntil(this.destroyed)).subscribe((e=>{this._menuStackHasFocus=e}))}_setUpPointerTracker(){this.menuAim&&(this.ngZone.runOutsideAngular((()=>{this.pointerTracker=new E(this.items)})),this.menuAim.initialize(this,this.pointerTracker))}}R.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:R,deps:null,target:p.ɵɵFactoryTarget.Directive}),R.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:R,inputs:{id:"id"},host:{attributes:{role:"menu"},listeners:{focus:"focusFirstItem()",focusin:"menuStack.setHasFocus(true)",focusout:"menuStack.setHasFocus(false)"},properties:{tabindex:"_getTabIndex()",id:"id","attr.aria-orientation":"orientation","attr.data-cdk-menu-stack-id":"menuStack.id"}},queries:[{propertyName:"items",predicate:S,descendants:!0}],usesInheritance:!0,ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:R,decorators:[{type:t.Directive,args:[{host:{role:"menu",class:"","[tabindex]":"_getTabIndex()","[id]":"id","[attr.aria-orientation]":"orientation","[attr.data-cdk-menu-stack-id]":"menuStack.id","(focus)":"focusFirstItem()","(focusin)":"menuStack.setHasFocus(true)","(focusout)":"menuStack.setHasFocus(false)"}}]}],propDecorators:{id:[{type:t.Input}],items:[{type:t.ContentChildren,args:[S,{descendants:!0}]}]}});class F extends R{constructor(){super(),this._parentTrigger=t.inject(b,{optional:!0}),this.closed=new t.EventEmitter,this.orientation="vertical",this.isInline=!this._parentTrigger,this.destroyed.subscribe(this.closed),this._parentTrigger?.registerChildMenu(this)}ngAfterContentInit(){super.ngAfterContentInit(),this._subscribeToMenuStackEmptied()}ngOnDestroy(){super.ngOnDestroy(),this.closed.complete()}_handleKeyEvent(e){const t=this.keyManager;switch(e.keyCode){case s.LEFT_ARROW:case s.RIGHT_ARROW:s.hasModifierKey(e)||(e.preventDefault(),t.setFocusOrigin("keyboard"),t.onKeydown(e));break;case s.ESCAPE:s.hasModifierKey(e)||(e.preventDefault(),this.menuStack.close(this,{focusNextOnEmpty:2,focusParentTrigger:!0}));break;case s.TAB:s.hasModifierKey(e,"altKey","metaKey","ctrlKey")||this.menuStack.closeAll({focusParentTrigger:!0});break;default:t.onKeydown(e)}}_toggleMenuFocus(e){const t=this.keyManager;switch(e){case 0:t.setFocusOrigin("keyboard"),t.setNextItemActive();break;case 1:t.setFocusOrigin("keyboard"),t.setPreviousItemActive();break;case 2:t.activeItem&&(t.setFocusOrigin("keyboard"),t.setActiveItem(t.activeItem))}}_subscribeToMenuStackEmptied(){this.menuStack.emptied.pipe(n.takeUntil(this.destroyed)).subscribe((e=>this._toggleMenuFocus(e)))}}F.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:F,deps:[],target:p.ɵɵFactoryTarget.Directive}),F.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:F,isStandalone:!0,selector:"[cdkMenu]",outputs:{closed:"closed"},host:{attributes:{role:"menu"},listeners:{keydown:"_handleKeyEvent($event)"},properties:{"class.cdk-menu-inline":"isInline"},classAttribute:"cdk-menu"},providers:[{provide:g,useExisting:F},{provide:m,useExisting:F},_("vertical")],exportAs:["cdkMenu"],usesInheritance:!0,ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:F,decorators:[{type:t.Directive,args:[{selector:"[cdkMenu]",exportAs:"cdkMenu",standalone:!0,host:{role:"menu",class:"cdk-menu","[class.cdk-menu-inline]":"isInline","(keydown)":"_handleKeyEvent($event)"},providers:[{provide:g,useExisting:F},{provide:m,useExisting:F},_("vertical")]}]}],ctorParameters:function(){return[]},propDecorators:{closed:[{type:t.Output}]}});class P extends R{constructor(){super(...arguments),this.orientation="horizontal",this.isInline=!0}ngAfterContentInit(){super.ngAfterContentInit(),this._subscribeToMenuStackEmptied()}_handleKeyEvent(e){const t=this.keyManager;switch(e.keyCode){case s.UP_ARROW:case s.DOWN_ARROW:case s.LEFT_ARROW:case s.RIGHT_ARROW:if(!s.hasModifierKey(e)){if(e.keyCode===s.LEFT_ARROW||e.keyCode===s.RIGHT_ARROW){e.preventDefault();const i=t.activeItem?.isMenuOpen();t.activeItem?.getMenuTrigger()?.close(),t.setFocusOrigin("keyboard"),t.onKeydown(e),i&&t.activeItem?.getMenuTrigger()?.open()}}break;case s.ESCAPE:s.hasModifierKey(e)||(e.preventDefault(),t.activeItem?.getMenuTrigger()?.close());break;case s.TAB:s.hasModifierKey(e,"altKey","metaKey","ctrlKey")||t.activeItem?.getMenuTrigger()?.close();break;default:t.onKeydown(e)}}_toggleOpenMenu(e){const t=this.keyManager;switch(e){case 0:t.setFocusOrigin("keyboard"),t.setNextItemActive(),t.activeItem?.getMenuTrigger()?.open();break;case 1:t.setFocusOrigin("keyboard"),t.setPreviousItemActive(),t.activeItem?.getMenuTrigger()?.open();break;case 2:t.activeItem&&(t.setFocusOrigin("keyboard"),t.setActiveItem(t.activeItem))}}_subscribeToMenuStackEmptied(){this.menuStack?.emptied.pipe(n.takeUntil(this.destroyed)).subscribe((e=>this._toggleOpenMenu(e)))}}P.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:P,deps:null,target:p.ɵɵFactoryTarget.Directive}),P.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:P,isStandalone:!0,selector:"[cdkMenuBar]",host:{attributes:{role:"menubar"},listeners:{keydown:"_handleKeyEvent($event)"},classAttribute:"cdk-menu-bar"},providers:[{provide:g,useExisting:P},{provide:m,useExisting:P},{provide:y,useFactory:()=>M.inline("horizontal")}],exportAs:["cdkMenuBar"],usesInheritance:!0,ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:P,decorators:[{type:t.Directive,args:[{selector:"[cdkMenuBar]",exportAs:"cdkMenuBar",standalone:!0,host:{role:"menubar",class:"cdk-menu-bar","(keydown)":"_handleKeyEvent($event)"},providers:[{provide:g,useExisting:P},{provide:m,useExisting:P},{provide:y,useFactory:()=>M.inline("horizontal")}]}]}]});class w extends S{constructor(){super(...arguments),this._checked=!1,this.closeOnSpacebarTrigger=!1}get checked(){return this._checked}set checked(e){this._checked=u.coerceBooleanProperty(e)}}w.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:w,deps:null,target:p.ɵɵFactoryTarget.Directive}),w.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:w,inputs:{checked:["cdkMenuItemChecked","checked"]},host:{properties:{"attr.aria-checked":"!!checked","attr.aria-disabled":"disabled || null"}},usesInheritance:!0,ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:w,decorators:[{type:t.Directive,args:[{host:{"[attr.aria-checked]":"!!checked","[attr.aria-disabled]":"disabled || null"}}]}],propDecorators:{checked:[{type:t.Input,args:["cdkMenuItemChecked"]}]}});let j=0;class V extends w{constructor(){super(),this._selectionDispatcher=t.inject(r.UniqueSelectionDispatcher),this._id=""+j++,this._registerDispatcherListener()}ngOnDestroy(){super.ngOnDestroy(),this._removeDispatcherListener()}trigger(e){super.trigger(e),this.disabled||this._selectionDispatcher.notify(this._id,"")}_registerDispatcherListener(){this._removeDispatcherListener=this._selectionDispatcher.listen((e=>{this.checked=this._id===e}))}}V.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:V,deps:[],target:p.ɵɵFactoryTarget.Directive}),V.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:V,isStandalone:!0,selector:"[cdkMenuItemRadio]",host:{attributes:{role:"menuitemradio"},properties:{"class.cdk-menu-item-radio":"true"}},providers:[{provide:w,useExisting:V},{provide:S,useExisting:w}],exportAs:["cdkMenuItemRadio"],usesInheritance:!0,ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:V,decorators:[{type:t.Directive,args:[{selector:"[cdkMenuItemRadio]",exportAs:"cdkMenuItemRadio",standalone:!0,host:{role:"menuitemradio","[class.cdk-menu-item-radio]":"true"},providers:[{provide:w,useExisting:V},{provide:S,useExisting:w}]}]}],ctorParameters:function(){return[]}});class N extends w{trigger(e){super.trigger(e),this.disabled||(this.checked=!this.checked)}}N.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:N,deps:null,target:p.ɵɵFactoryTarget.Directive}),N.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:N,isStandalone:!0,selector:"[cdkMenuItemCheckbox]",host:{attributes:{role:"menuitemcheckbox"},properties:{"class.cdk-menu-item-checkbox":"true"}},providers:[{provide:w,useExisting:N},{provide:S,useExisting:w}],exportAs:["cdkMenuItemCheckbox"],usesInheritance:!0,ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:N,decorators:[{type:t.Directive,args:[{selector:"[cdkMenuItemCheckbox]",exportAs:"cdkMenuItemCheckbox",standalone:!0,host:{role:"menuitemcheckbox","[class.cdk-menu-item-checkbox]":"true"},providers:[{provide:w,useExisting:N},{provide:S,useExisting:w}]}]}]});const K=i.STANDARD_DROPDOWN_BELOW_POSITIONS.map((e=>{const t="start"===e.overlayX?2:-2,i="top"===e.overlayY?2:-2;return{...e,offsetX:t,offsetY:i}}));class U{update(e){U._openContextMenuTrigger!==e&&(U._openContextMenuTrigger?.close(),U._openContextMenuTrigger=e)}}U.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:U,deps:[],target:p.ɵɵFactoryTarget.Injectable}),U.ɵprov=p.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:U,providedIn:"root"}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:U,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}]});class W extends f{constructor(){super(),this._overlay=t.inject(i.Overlay),this._directionality=t.inject(l.Directionality,{optional:!0}),this._contextMenuTracker=t.inject(U),this._disabled=!1,this._setMenuStackCloseListener()}get disabled(){return this._disabled}set disabled(e){this._disabled=u.coerceBooleanProperty(e)}open(e){this._open(e,!1)}close(){this.menuStack.closeAll()}_openOnContextMenu(e){this.disabled||(e.preventDefault(),e.stopPropagation(),this._contextMenuTracker.update(this),this._open({x:e.clientX,y:e.clientY},!0),2===e.button?this.childMenu?.focusFirstItem("mouse"):0===e.button?this.childMenu?.focusFirstItem("keyboard"):this.childMenu?.focusFirstItem("program"))}_getOverlayConfig(e){return new i.OverlayConfig({positionStrategy:this._getOverlayPositionStrategy(e),scrollStrategy:this._overlay.scrollStrategies.reposition(),direction:this._directionality||void 0})}_getOverlayPositionStrategy(e){return this._overlay.position().flexibleConnectedTo(e).withLockedPosition().withGrowAfterOpen().withPositions(this.menuPosition??K)}_setMenuStackCloseListener(){this.menuStack.closed.pipe(n.takeUntil(this.destroyed)).subscribe((({item:e})=>{e===this.childMenu&&this.isOpen()&&(this.closed.next(),this.overlayRef.detach())}))}_subscribeToOutsideClicks(e){if(this.overlayRef){let t=this.overlayRef.outsidePointerEvents();if(e){const[e,i]=o.partition(t,(({type:e})=>"auxclick"===e));t=o.merge(i,e.pipe(n.skip(1)))}t.pipe(n.takeUntil(this.stopOutsideClicksListener)).subscribe((e=>{this.isElementInsideMenuStack(d._getEventTarget(e))||this.menuStack.closeAll()}))}}_open(e,t){this.disabled||(this.isOpen()?(this.menuStack.closeSubMenuOf(this.childMenu),this.overlayRef.getConfig().positionStrategy.setOrigin(e),this.overlayRef.updatePosition()):(this.opened.next(),this.overlayRef?(this.overlayRef.getConfig().positionStrategy.setOrigin(e),this.overlayRef.updatePosition()):this.overlayRef=this._overlay.create(this._getOverlayConfig(e)),this.overlayRef.attach(this.getMenuContentPortal()),this._subscribeToOutsideClicks(t)))}}W.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:W,deps:[],target:p.ɵɵFactoryTarget.Directive}),W.ɵdir=p.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:W,isStandalone:!0,selector:"[cdkContextMenuTriggerFor]",inputs:{menuTemplateRef:["cdkContextMenuTriggerFor","menuTemplateRef"],menuPosition:["cdkContextMenuPosition","menuPosition"],menuData:["cdkContextMenuTriggerData","menuData"],disabled:["cdkContextMenuDisabled","disabled"]},outputs:{opened:"cdkContextMenuOpened",closed:"cdkContextMenuClosed"},host:{listeners:{contextmenu:"_openOnContextMenu($event)"},properties:{"attr.data-cdk-menu-stack-id":"null"}},providers:[{provide:b,useExisting:W},{provide:y,useClass:M}],exportAs:["cdkContextMenuTriggerFor"],usesInheritance:!0,ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:W,decorators:[{type:t.Directive,args:[{selector:"[cdkContextMenuTriggerFor]",exportAs:"cdkContextMenuTriggerFor",standalone:!0,host:{"[attr.data-cdk-menu-stack-id]":"null","(contextmenu)":"_openOnContextMenu($event)"},inputs:["menuTemplateRef: cdkContextMenuTriggerFor","menuPosition: cdkContextMenuPosition","menuData: cdkContextMenuTriggerData"],outputs:["opened: cdkContextMenuOpened","closed: cdkContextMenuClosed"],providers:[{provide:b,useExisting:W},{provide:y,useClass:M}]}]}],ctorParameters:function(){return[]},propDecorators:{disabled:[{type:t.Input,args:["cdkContextMenuDisabled"]}]}});const L=[P,F,S,V,N,C,g,W,O];class H{}H.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:H,deps:[],target:p.ɵɵFactoryTarget.NgModule}),H.ɵmod=p.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:p,type:H,imports:[i.OverlayModule,P,F,S,V,N,C,g,W,O],exports:[P,F,S,V,N,C,g,W,O]}),H.ɵinj=p.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:H,imports:[i.OverlayModule]}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:p,type:H,decorators:[{type:t.NgModule,args:[{imports:[i.OverlayModule,...L],exports:L}]}]}),e.CDK_MENU=m,e.CdkContextMenuTrigger=W,e.CdkMenu=F,e.CdkMenuBar=P,e.CdkMenuBase=R,e.CdkMenuGroup=g,e.CdkMenuItem=S,e.CdkMenuItemCheckbox=N,e.CdkMenuItemRadio=V,e.CdkMenuItemSelectable=w,e.CdkMenuModule=H,e.CdkMenuTrigger=C,e.CdkMenuTriggerBase=f,e.CdkTargetMenuAim=O,e.ContextMenuTracker=U,e.MENU_AIM=I,e.MENU_STACK=y,e.MENU_TRIGGER=b,e.MenuStack=M,e.PARENT_OR_NEW_INLINE_MENU_STACK_PROVIDER=_,e.PARENT_OR_NEW_MENU_STACK_PROVIDER=k,e.PointerFocusTracker=E,e.TargetMenuAim=x})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/observers/observers.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/observers/observers.js new file mode 100644 index 000000000..d95cd3295 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/observers/observers.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/coercion"),require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["exports","@angular/cdk/coercion","@angular/core","rxjs","rxjs/operators"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkObservers={},e.ngCdkCoercion,e.ngCore,e.rxjs,e.rxjsOperators)}(this,(function(e,t,r,n,s){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=o(r);class c{create(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)}}c.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:c,deps:[],target:i.ɵɵFactoryTarget.Injectable}),c.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:c,providedIn:"root"}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:c,decorators:[{type:r.Injectable,args:[{providedIn:"root"}]}]});class a{constructor(e){this._mutationObserverFactory=e,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach(((e,t)=>this._cleanupObserver(t)))}observe(e){const r=t.coerceElement(e);return new n.Observable((e=>{const t=this._observeElement(r).subscribe(e);return()=>{t.unsubscribe(),this._unobserveElement(r)}}))}_observeElement(e){if(this._observedElements.has(e))this._observedElements.get(e).count++;else{const t=new n.Subject,r=this._mutationObserverFactory.create((e=>t.next(e)));r&&r.observe(e,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(e,{observer:r,stream:t,count:1})}return this._observedElements.get(e).stream}_unobserveElement(e){this._observedElements.has(e)&&(this._observedElements.get(e).count--,this._observedElements.get(e).count||this._cleanupObserver(e))}_cleanupObserver(e){if(this._observedElements.has(e)){const{observer:t,stream:r}=this._observedElements.get(e);t&&t.disconnect(),r.complete(),this._observedElements.delete(e)}}}a.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:a,deps:[{token:c}],target:i.ɵɵFactoryTarget.Injectable}),a.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:a,providedIn:"root"}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:a,decorators:[{type:r.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:c}]}});class b{constructor(e,t,n){this._contentObserver=e,this._elementRef=t,this._ngZone=n,this.event=new r.EventEmitter,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(e){this._disabled=t.coerceBooleanProperty(e),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(e){this._debounce=t.coerceNumberProperty(e),this._subscribe()}ngAfterContentInit(){this._currentSubscription||this.disabled||this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const e=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular((()=>{this._currentSubscription=(this.debounce?e.pipe(s.debounceTime(this.debounce)):e).subscribe(this.event)}))}_unsubscribe(){this._currentSubscription?.unsubscribe()}}b.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:b,deps:[{token:a},{token:i.ElementRef},{token:i.NgZone}],target:i.ɵɵFactoryTarget.Directive}),b.ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:b,selector:"[cdkObserveContent]",inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"],ngImport:i}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:b,decorators:[{type:r.Directive,args:[{selector:"[cdkObserveContent]",exportAs:"cdkObserveContent"}]}],ctorParameters:function(){return[{type:a},{type:i.ElementRef},{type:i.NgZone}]},propDecorators:{event:[{type:r.Output,args:["cdkObserveContent"]}],disabled:[{type:r.Input,args:["cdkObserveContentDisabled"]}],debounce:[{type:r.Input}]}});class u{}u.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:u,deps:[],target:i.ɵɵFactoryTarget.NgModule}),u.ɵmod=i.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:i,type:u,declarations:[b],exports:[b]}),u.ɵinj=i.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:u,providers:[c]}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:i,type:u,decorators:[{type:r.NgModule,args:[{exports:[b],declarations:[b],providers:[c]}]}]}),e.CdkObserveContent=b,e.ContentObserver=a,e.MutationObserverFactory=c,e.ObserversModule=u})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/overlay/overlay.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/overlay/overlay.js new file mode 100644 index 000000000..c0ff56902 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/overlay/overlay.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/scrolling"),require("@angular/common"),require("@angular/core"),require("@angular/cdk/coercion"),require("@angular/cdk/platform"),require("@angular/cdk/bidi"),require("@angular/cdk/portal"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/keycodes")):"function"==typeof define&&define.amd?define(["exports","@angular/cdk/scrolling","@angular/common","@angular/core","@angular/cdk/coercion","@angular/cdk/platform","@angular/cdk/bidi","@angular/cdk/portal","rxjs","rxjs/operators","@angular/cdk/keycodes"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ngCdkOverlay={},t.ngCdkScrolling,t.ngCommon,t.ngCore,t.ngCdkCoercion,t.ngCdkPlatform,t.ngCdkBidi,t.ngCdkPortal,t.rxjs,t.rxjsOperators,t.ngCdkKeycodes)}(this,(function(t,e,i,s,o,n,r,a,l,h,c){"use strict";function d(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var p=d(e),_=d(i),g=d(s),u=d(n),y=d(r);const v=n.supportsScrollBehavior();class f{constructor(t,e){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=e}attach(){}enable(){if(this._canBeEnabled()){const t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=o.coerceCssPixelValue(-this._previousScrollPosition.left),t.style.top=o.coerceCssPixelValue(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const t=this._document.documentElement,e=this._document.body,i=t.style,s=e.style,o=i.scrollBehavior||"",n=s.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),v&&(i.scrollBehavior=s.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),v&&(i.scrollBehavior=o,s.scrollBehavior=n)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,e=this._viewportRuler.getViewportSize();return t.scrollHeight>e.height||t.scrollWidth>e.width}}function m(){return Error("Scroll strategy has already been attached.")}class b{constructor(t,e,i,s){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=i,this._config=s,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run((()=>this._overlayRef.detach()))}}attach(t){if(this._overlayRef&&("undefined"==typeof ngDevMode||ngDevMode))throw m();this._overlayRef=t}enable(){if(this._scrollSubscription)return;const t=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe((()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()}))):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class k{enable(){}disable(){}attach(){}}function C(t,e){return e.some((e=>{const i=t.bottome.bottom,o=t.righte.right;return i||s||o||n}))}function O(t,e){return e.some((e=>{const i=t.tope.bottom,o=t.lefte.right;return i||s||o||n}))}class w{constructor(t,e,i,s){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this._config=s,this._scrollSubscription=null}attach(t){if(this._overlayRef&&("undefined"==typeof ngDevMode||ngDevMode))throw m();this._overlayRef=t}enable(){if(!this._scrollSubscription){const t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe((()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:e,height:i}=this._viewportRuler.getViewportSize();C(t,[{width:e,height:i,bottom:i,right:e,top:0,left:0}])&&(this.disable(),this._ngZone.run((()=>this._overlayRef.detach())))}}))}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class S{constructor(t,e,i,s){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this.noop=()=>new k,this.close=t=>new b(this._scrollDispatcher,this._ngZone,this._viewportRuler,t),this.block=()=>new f(this._viewportRuler,this._document),this.reposition=t=>new w(this._scrollDispatcher,this._viewportRuler,this._ngZone,t),this._document=s}}S.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:S,deps:[{token:p.ScrollDispatcher},{token:p.ViewportRuler},{token:g.NgZone},{token:i.DOCUMENT}],target:g.ɵɵFactoryTarget.Injectable}),S.ɵprov=g.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:S,providedIn:"root"}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:S,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:p.ScrollDispatcher},{type:p.ViewportRuler},{type:g.NgZone},{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]}]}});class P{constructor(t){if(this.scrollStrategy=new k,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){const e=Object.keys(t);for(const i of e)void 0!==t[i]&&(this[i]=t[i])}}}class E{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}}function x(t,e){if("top"!==e&&"bottom"!==e&&"center"!==e)throw Error(`ConnectedPosition: Invalid ${t} "${e}". Expected "top", "bottom" or "center".`)}function D(t,e){if("start"!==e&&"end"!==e&&"center"!==e)throw Error(`ConnectedPosition: Invalid ${t} "${e}". Expected "start", "end" or "center".`)}class R{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const e=this._attachedOverlays.indexOf(t);e>-1&&this._attachedOverlays.splice(e,1),0===this._attachedOverlays.length&&this.detach()}}R.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:R,deps:[{token:i.DOCUMENT}],target:g.ɵɵFactoryTarget.Injectable}),R.ɵprov=g.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:R,providedIn:"root"}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:R,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]}]}});class I extends R{constructor(t,e){super(t),this._ngZone=e,this._keydownListener=t=>{const e=this._attachedOverlays;for(let i=e.length-1;i>-1;i--)if(e[i]._keydownEvents.observers.length>0){const s=e[i]._keydownEvents;this._ngZone?this._ngZone.run((()=>s.next(t))):s.next(t);break}}}add(t){super.add(t),this._isAttached||(this._ngZone?this._ngZone.runOutsideAngular((()=>this._document.body.addEventListener("keydown",this._keydownListener))):this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}I.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:I,deps:[{token:i.DOCUMENT},{token:g.NgZone,optional:!0}],target:g.ɵɵFactoryTarget.Injectable}),I.ɵprov=g.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:I,providedIn:"root"}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:I,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]},{type:g.NgZone,decorators:[{type:s.Optional}]}]}});class M extends R{constructor(t,e,i){super(t),this._platform=e,this._ngZone=i,this._cursorStyleIsSet=!1,this._pointerDownListener=t=>{this._pointerDownEventTarget=n._getEventTarget(t)},this._clickListener=t=>{const e=n._getEventTarget(t),i="click"===t.type&&this._pointerDownEventTarget?this._pointerDownEventTarget:e;this._pointerDownEventTarget=null;const s=this._attachedOverlays.slice();for(let o=s.length-1;o>-1;o--){const n=s[o];if(n._outsidePointerEvents.observers.length<1||!n.hasAttached())continue;if(n.overlayElement.contains(e)||n.overlayElement.contains(i))break;const r=n._outsidePointerEvents;this._ngZone?this._ngZone.run((()=>r.next(t))):r.next(t)}}}add(t){if(super.add(t),!this._isAttached){const t=this._document.body;this._ngZone?this._ngZone.runOutsideAngular((()=>this._addEventListeners(t))):this._addEventListeners(t),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=t.style.cursor,t.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("pointerdown",this._pointerDownListener,!0),t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(t){t.addEventListener("pointerdown",this._pointerDownListener,!0),t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0)}}M.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:M,deps:[{token:i.DOCUMENT},{token:u.Platform},{token:g.NgZone,optional:!0}],target:g.ɵɵFactoryTarget.Injectable}),M.ɵprov=g.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:M,providedIn:"root"}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:M,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]},{type:u.Platform},{type:g.NgZone,decorators:[{type:s.Optional}]}]}});class B{constructor(t,e){this._platform=e,this._document=t}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||n._isTestEnvironment()){const e=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let t=0;tthis._backdropClick.next(t),this._backdropTransitionendHandler=t=>{this._disposeBackdrop(t.target)},this._keydownEvents=new l.Subject,this._outsidePointerEvents=new l.Subject,s.scrollStrategy&&(this._scrollStrategy=s.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=s.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);const e=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(h.take(1)).subscribe((()=>{this.hasAttached()&&this.updatePosition()})),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe((()=>this.dispose()))),this._outsideClickDispatcher.add(this),"function"==typeof e?.onDestroy&&e.onDestroy((()=>{this.hasAttached()&&this._ngZone.runOutsideAngular((()=>Promise.resolve().then((()=>this.detach()))))})),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){const t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._disposeBackdrop(this._backdropElement),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._previousHostParent=this._pane=this._host=null,t&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config={...this._config,...t},this._updateElementSize()}setDirection(t){this._config={...this._config,direction:t},this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){const t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const t=this._pane.style;t.width=o.coerceCssPixelValue(this._config.width),t.height=o.coerceCssPixelValue(this._config.height),t.minWidth=o.coerceCssPixelValue(this._config.minWidth),t.minHeight=o.coerceCssPixelValue(this._config.minHeight),t.maxWidth=o.coerceCssPixelValue(this._config.maxWidth),t.maxHeight=o.coerceCssPixelValue(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){const t="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._animationsDisabled&&this._backdropElement.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),this._animationsDisabled||"undefined"==typeof requestAnimationFrame?this._backdropElement.classList.add(t):this._ngZone.runOutsideAngular((()=>{requestAnimationFrame((()=>{this._backdropElement&&this._backdropElement.classList.add(t)}))}))}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){const t=this._backdropElement;t&&(this._animationsDisabled?this._disposeBackdrop(t):(t.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular((()=>{t.addEventListener("transitionend",this._backdropTransitionendHandler)})),t.style.pointerEvents="none",this._backdropTimeout=this._ngZone.runOutsideAngular((()=>setTimeout((()=>{this._disposeBackdrop(t)}),500)))))}_toggleClasses(t,e,i){const s=o.coerceArray(e||[]).filter((t=>!!t));s.length&&(i?t.classList.add(...s):t.classList.remove(...s))}_detachContentWhenStable(){this._ngZone.runOutsideAngular((()=>{const t=this._ngZone.onStable.pipe(h.takeUntil(l.merge(this._attachments,this._detachments))).subscribe((()=>{this._pane&&this._host&&0!==this._pane.children.length||(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),t.unsubscribe())}))}))}_disposeScrollStrategy(){const t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())}_disposeBackdrop(t){t&&(t.removeEventListener("click",this._backdropClickHandler),t.removeEventListener("transitionend",this._backdropTransitionendHandler),t.remove(),this._backdropElement===t&&(this._backdropElement=null)),this._backdropTimeout&&(clearTimeout(this._backdropTimeout),this._backdropTimeout=void 0)}}const T="cdk-overlay-connected-position-bounding-box",L=/([A-Za-z%]+)$/;class A{constructor(t,e,i,s,o){this._viewportRuler=e,this._document=i,this._platform=s,this._overlayContainer=o,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new l.Subject,this._resizeSubscription=l.Subscription.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}get positions(){return this._preferredPositions}attach(t){if(this._overlayRef&&t!==this._overlayRef&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("This position strategy is already attached to an overlay");this._validatePositions(),t.hostElement.classList.add(T),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe((()=>{this._isInitialRender=!0,this.apply()}))}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const t=this._originRect,e=this._overlayRect,i=this._viewportRect,s=this._containerRect,o=[];let n;for(let r of this._preferredPositions){let a=this._getOriginPoint(t,s,r),l=this._getOverlayPoint(a,e,r),h=this._getOverlayFit(l,e,i,r);if(h.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(r,a);this._canFitWithFlexibleDimensions(h,l,i)?o.push({position:r,origin:a,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(a,r)}):(!n||n.overlayFit.visibleAreae&&(e=s,t=i)}return this._isPushed=!1,void this._applyPosition(t.position,t.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(n.position,n.originPoint);this._applyPosition(n.position,n.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Y(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(T),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;const t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const e=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,e)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e,i){let s,o;if("center"==i.originX)s=t.left+t.width/2;else{const e=this._isRtl()?t.right:t.left,o=this._isRtl()?t.left:t.right;s="start"==i.originX?e:o}return e.left<0&&(s-=e.left),o="center"==i.originY?t.top+t.height/2:"top"==i.originY?t.top:t.bottom,e.top<0&&(o-=e.top),{x:s,y:o}}_getOverlayPoint(t,e,i){let s,o;return s="center"==i.overlayX?-e.width/2:"start"===i.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,o="center"==i.overlayY?-e.height/2:"top"==i.overlayY?0:-e.height,{x:t.x+s,y:t.y+o}}_getOverlayFit(t,e,i,s){const o=X(e);let{x:n,y:r}=t,a=this._getOffset(s,"x"),l=this._getOffset(s,"y");a&&(n+=a),l&&(r+=l);let h=0-n,c=n+o.width-i.width,d=0-r,p=r+o.height-i.height,_=this._subtractOverflows(o.width,h,c),g=this._subtractOverflows(o.height,d,p),u=_*g;return{visibleArea:u,isCompletelyWithinViewport:o.width*o.height===u,fitsInViewportVertically:g===o.height,fitsInViewportHorizontally:_==o.width}}_canFitWithFlexibleDimensions(t,e,i){if(this._hasFlexibleDimensions){const s=i.bottom-e.y,o=i.right-e.x,n=j(this._overlayRef.getConfig().minHeight),r=j(this._overlayRef.getConfig().minWidth),a=t.fitsInViewportVertically||null!=n&&n<=s,l=t.fitsInViewportHorizontally||null!=r&&r<=o;return a&&l}return!1}_pushOverlayOnScreen(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};const s=X(e),o=this._viewportRect,n=Math.max(t.x+s.width-o.width,0),r=Math.max(t.y+s.height-o.height,0),a=Math.max(o.top-i.top-t.y,0),l=Math.max(o.left-i.left-t.x,0);let h=0,c=0;return h=s.width<=o.width?l||-n:t.xs&&!this._isInitialRender&&!this._growAfterOpen&&(n=t.y-s/2)}const a="start"===e.overlayX&&!s||"end"===e.overlayX&&s;let l,h,c;if("end"===e.overlayX&&!s||"start"===e.overlayX&&s)c=i.width-t.x+this._viewportMargin,l=t.x-this._viewportMargin;else if(a)h=t.x,l=i.right-t.x;else{const e=Math.min(i.right-t.x+i.left,t.x),s=this._lastBoundingBoxSize.width;l=2*e,h=t.x-e,l>s&&!this._isInitialRender&&!this._growAfterOpen&&(h=t.x-s/2)}return{top:n,left:h,bottom:r,right:c,width:l,height:o}}_setBoundingBoxStyles(t,e){const i=this._calculateBoundingBoxRect(t,e);this._isInitialRender||this._growAfterOpen||(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const s={};if(this._hasExactPosition())s.top=s.left="0",s.bottom=s.right=s.maxHeight=s.maxWidth="",s.width=s.height="100%";else{const t=this._overlayRef.getConfig().maxHeight,n=this._overlayRef.getConfig().maxWidth;s.height=o.coerceCssPixelValue(i.height),s.top=o.coerceCssPixelValue(i.top),s.bottom=o.coerceCssPixelValue(i.bottom),s.width=o.coerceCssPixelValue(i.width),s.left=o.coerceCssPixelValue(i.left),s.right=o.coerceCssPixelValue(i.right),"center"===e.overlayX?s.alignItems="center":s.alignItems="end"===e.overlayX?"flex-end":"flex-start","center"===e.overlayY?s.justifyContent="center":s.justifyContent="bottom"===e.overlayY?"flex-end":"flex-start",t&&(s.maxHeight=o.coerceCssPixelValue(t)),n&&(s.maxWidth=o.coerceCssPixelValue(n))}this._lastBoundingBoxSize=i,Y(this._boundingBox.style,s)}_resetBoundingBoxStyles(){Y(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Y(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){const i={},s=this._hasExactPosition(),n=this._hasFlexibleDimensions,r=this._overlayRef.getConfig();if(s){const s=this._viewportRuler.getViewportScrollPosition();Y(i,this._getExactOverlayY(e,t,s)),Y(i,this._getExactOverlayX(e,t,s))}else i.position="static";let a="",l=this._getOffset(e,"x"),h=this._getOffset(e,"y");l&&(a+=`translateX(${l}px) `),h&&(a+=`translateY(${h}px)`),i.transform=a.trim(),r.maxHeight&&(s?i.maxHeight=o.coerceCssPixelValue(r.maxHeight):n&&(i.maxHeight="")),r.maxWidth&&(s?i.maxWidth=o.coerceCssPixelValue(r.maxWidth):n&&(i.maxWidth="")),Y(this._pane.style,i)}_getExactOverlayY(t,e,i){let s={top:"",bottom:""},n=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(n=this._pushOverlayOnScreen(n,this._overlayRect,i)),"bottom"===t.overlayY){const t=this._document.documentElement.clientHeight;s.bottom=t-(n.y+this._overlayRect.height)+"px"}else s.top=o.coerceCssPixelValue(n.y);return s}_getExactOverlayX(t,e,i){let s,n={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),s=this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left","right"===s){const t=this._document.documentElement.clientWidth;n.right=t-(r.x+this._overlayRect.width)+"px"}else n.left=o.coerceCssPixelValue(r.x);return n}_getScrollVisibility(){const t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map((t=>t.getElementRef().nativeElement.getBoundingClientRect()));return{isOriginClipped:O(t,i),isOriginOutsideView:C(t,i),isOverlayClipped:O(e,i),isOverlayOutsideView:C(e,i)}}_subtractOverflows(t,...e){return e.reduce(((t,e)=>t-Math.max(e,0)),t)}_getNarrowedViewportRect(){const t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return"x"===e?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY}_validatePositions(){if("undefined"==typeof ngDevMode||ngDevMode){if(!this._preferredPositions.length)throw Error("FlexibleConnectedPositionStrategy: At least one position is required.");this._preferredPositions.forEach((t=>{D("originX",t.originX),x("originY",t.originY),D("overlayX",t.overlayX),x("overlayY",t.overlayY)}))}}_addPanelClasses(t){this._pane&&o.coerceArray(t).forEach((t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))}))}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach((t=>{this._pane.classList.remove(t)})),this._appliedPanelClasses=[])}_getOriginRect(){const t=this._origin;if(t instanceof s.ElementRef)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();const e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}}}function Y(t,e){for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function j(t){if("number"!=typeof t&&null!=t){const[e,i]=t.split(L);return i&&"px"!==i?null:parseFloat(e)}return t||null}function X(t){return{top:Math.floor(t.top),right:Math.floor(t.right),bottom:Math.floor(t.bottom),left:Math.floor(t.left),width:Math.floor(t.width),height:Math.floor(t.height)}}const F="cdk-global-overlay-wrapper";class N{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._alignItems="",this._xPosition="",this._xOffset="",this._width="",this._height="",this._isDisposed=!1}attach(t){const e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(F),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:s,height:o,maxWidth:n,maxHeight:r}=i,a=!("100%"!==s&&"100vw"!==s||n&&"100%"!==n&&"100vw"!==n),l=!("100%"!==o&&"100vh"!==o||r&&"100%"!==r&&"100vh"!==r),h=this._xPosition,c=this._xOffset,d="rtl"===this._overlayRef.getConfig().direction;let p="",_="",g="";a?g="flex-start":"center"===h?(g="center",d?_=c:p=c):d?"left"===h||"end"===h?(g="flex-end",p=c):"right"!==h&&"start"!==h||(g="flex-start",_=c):"left"===h||"start"===h?(g="flex-start",p=c):"right"!==h&&"end"!==h||(g="flex-end",_=c),t.position=this._cssPosition,t.marginLeft=a?"0":p,t.marginTop=l?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=a?"0":_,e.justifyContent=g,e.alignItems=l?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,i=e.style;e.classList.remove(F),i.justifyContent=i.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}}class H{constructor(t,e,i,s){this._viewportRuler=t,this._document=e,this._platform=i,this._overlayContainer=s}global(){return new N}flexibleConnectedTo(t){return new A(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}H.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:H,deps:[{token:p.ViewportRuler},{token:i.DOCUMENT},{token:u.Platform},{token:B}],target:g.ɵɵFactoryTarget.Injectable}),H.ɵprov=g.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:H,providedIn:"root"}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:H,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:p.ViewportRuler},{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]},{type:u.Platform},{type:B}]}});let W=0;class Z{constructor(t,e,i,s,o,n,r,a,l,h,c,d){this.scrollStrategies=t,this._overlayContainer=e,this._componentFactoryResolver=i,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=n,this._ngZone=r,this._document=a,this._directionality=l,this._location=h,this._outsideClickDispatcher=c,this._animationsModuleType=d}create(t){const e=this._createHostElement(),i=this._createPaneElement(e),s=this._createPortalOutlet(i),o=new P(t);return o.direction=o.direction||this._directionality.value,new V(s,e,i,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,"NoopAnimations"===this._animationsModuleType)}position(){return this._positionBuilder}_createPaneElement(t){const e=this._document.createElement("div");return e.id="cdk-overlay-"+W++,e.classList.add("cdk-overlay-pane"),t.appendChild(e),e}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(s.ApplicationRef)),new a.DomPortalOutlet(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}Z.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:Z,deps:[{token:S},{token:B},{token:g.ComponentFactoryResolver},{token:H},{token:I},{token:g.Injector},{token:g.NgZone},{token:i.DOCUMENT},{token:y.Directionality},{token:_.Location},{token:M},{token:s.ANIMATION_MODULE_TYPE,optional:!0}],target:g.ɵɵFactoryTarget.Injectable}),Z.ɵprov=g.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:Z,providedIn:"root"}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:Z,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:S},{type:B},{type:g.ComponentFactoryResolver},{type:H},{type:I},{type:g.Injector},{type:g.NgZone},{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]},{type:y.Directionality},{type:_.Location},{type:M},{type:void 0,decorators:[{type:s.Inject,args:[s.ANIMATION_MODULE_TYPE]},{type:s.Optional}]}]}});const z=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],U=new s.InjectionToken("cdk-connected-overlay-scroll-strategy");class q{constructor(t){this.elementRef=t}}q.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:q,deps:[{token:g.ElementRef}],target:g.ɵɵFactoryTarget.Directive}),q.ɵdir=g.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:q,selector:"[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",exportAs:["cdkOverlayOrigin"],ngImport:g}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:q,decorators:[{type:s.Directive,args:[{selector:"[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",exportAs:"cdkOverlayOrigin"}]}],ctorParameters:function(){return[{type:g.ElementRef}]}});class ${constructor(t,e,i,o,n){this._overlay=t,this._dir=n,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=l.Subscription.EMPTY,this._attachSubscription=l.Subscription.EMPTY,this._detachSubscription=l.Subscription.EMPTY,this._positionSubscription=l.Subscription.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new s.EventEmitter,this.positionChange=new s.EventEmitter,this.attach=new s.EventEmitter,this.detach=new s.EventEmitter,this.overlayKeydown=new s.EventEmitter,this.overlayOutsideClick=new s.EventEmitter,this._templatePortal=new a.TemplatePortal(e,i),this._scrollStrategyFactory=o,this.scrollStrategy=this._scrollStrategyFactory()}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}get hasBackdrop(){return this._hasBackdrop}set hasBackdrop(t){this._hasBackdrop=o.coerceBooleanProperty(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=o.coerceBooleanProperty(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=o.coerceBooleanProperty(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=o.coerceBooleanProperty(t)}get push(){return this._push}set push(t){this._push=o.coerceBooleanProperty(t)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){this.positions&&this.positions.length||(this.positions=z);const t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe((()=>this.attach.emit())),this._detachSubscription=t.detachments().subscribe((()=>this.detach.emit())),t.keydownEvents().subscribe((t=>{this.overlayKeydown.next(t),t.keyCode!==c.ESCAPE||this.disableClose||c.hasModifierKey(t)||(t.preventDefault(),this._detachOverlay())})),this._overlayRef.outsidePointerEvents().subscribe((t=>{this.overlayOutsideClick.next(t)}))}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),e=new P({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(e.width=this.width),(this.height||0===this.height)&&(e.height=this.height),(this.minWidth||0===this.minWidth)&&(e.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(e.minHeight=this.minHeight),this.backdropClass&&(e.backdropClass=this.backdropClass),this.panelClass&&(e.panelClass=this.panelClass),e}_updatePositionStrategy(t){const e=this.positions.map((t=>({originX:t.originX,originY:t.originY,overlayX:t.overlayX,overlayY:t.overlayY,offsetX:t.offsetX||this.offsetX,offsetY:t.offsetY||this.offsetY,panelClass:t.panelClass||void 0})));return t.setOrigin(this._getFlexibleConnectedPositionStrategyOrigin()).withPositions(e).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const t=this._overlay.position().flexibleConnectedTo(this._getFlexibleConnectedPositionStrategyOrigin());return this._updatePositionStrategy(t),t}_getFlexibleConnectedPositionStrategyOrigin(){return this.origin instanceof q?this.origin.elementRef:this.origin}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe((t=>{this.backdropClick.emit(t)})):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(h.takeWhile((()=>this.positionChange.observers.length>0))).subscribe((t=>{this.positionChange.emit(t),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()})))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}$.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:$,deps:[{token:Z},{token:g.TemplateRef},{token:g.ViewContainerRef},{token:U},{token:y.Directionality,optional:!0}],target:g.ɵɵFactoryTarget.Directive}),$.ɵdir=g.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:$,selector:"[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",inputs:{origin:["cdkConnectedOverlayOrigin","origin"],positions:["cdkConnectedOverlayPositions","positions"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],usesOnChanges:!0,ngImport:g}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:$,decorators:[{type:s.Directive,args:[{selector:"[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",exportAs:"cdkConnectedOverlay"}]}],ctorParameters:function(){return[{type:Z},{type:g.TemplateRef},{type:g.ViewContainerRef},{type:void 0,decorators:[{type:s.Inject,args:[U]}]},{type:y.Directionality,decorators:[{type:s.Optional}]}]},propDecorators:{origin:[{type:s.Input,args:["cdkConnectedOverlayOrigin"]}],positions:[{type:s.Input,args:["cdkConnectedOverlayPositions"]}],positionStrategy:[{type:s.Input,args:["cdkConnectedOverlayPositionStrategy"]}],offsetX:[{type:s.Input,args:["cdkConnectedOverlayOffsetX"]}],offsetY:[{type:s.Input,args:["cdkConnectedOverlayOffsetY"]}],width:[{type:s.Input,args:["cdkConnectedOverlayWidth"]}],height:[{type:s.Input,args:["cdkConnectedOverlayHeight"]}],minWidth:[{type:s.Input,args:["cdkConnectedOverlayMinWidth"]}],minHeight:[{type:s.Input,args:["cdkConnectedOverlayMinHeight"]}],backdropClass:[{type:s.Input,args:["cdkConnectedOverlayBackdropClass"]}],panelClass:[{type:s.Input,args:["cdkConnectedOverlayPanelClass"]}],viewportMargin:[{type:s.Input,args:["cdkConnectedOverlayViewportMargin"]}],scrollStrategy:[{type:s.Input,args:["cdkConnectedOverlayScrollStrategy"]}],open:[{type:s.Input,args:["cdkConnectedOverlayOpen"]}],disableClose:[{type:s.Input,args:["cdkConnectedOverlayDisableClose"]}],transformOriginSelector:[{type:s.Input,args:["cdkConnectedOverlayTransformOriginOn"]}],hasBackdrop:[{type:s.Input,args:["cdkConnectedOverlayHasBackdrop"]}],lockPosition:[{type:s.Input,args:["cdkConnectedOverlayLockPosition"]}],flexibleDimensions:[{type:s.Input,args:["cdkConnectedOverlayFlexibleDimensions"]}],growAfterOpen:[{type:s.Input,args:["cdkConnectedOverlayGrowAfterOpen"]}],push:[{type:s.Input,args:["cdkConnectedOverlayPush"]}],backdropClick:[{type:s.Output}],positionChange:[{type:s.Output}],attach:[{type:s.Output}],detach:[{type:s.Output}],overlayKeydown:[{type:s.Output}],overlayOutsideClick:[{type:s.Output}]}});const K={provide:U,deps:[Z],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};class G{}G.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:G,deps:[],target:g.ɵɵFactoryTarget.NgModule}),G.ɵmod=g.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:g,type:G,declarations:[$,q],imports:[r.BidiModule,a.PortalModule,e.ScrollingModule],exports:[$,q,e.ScrollingModule]}),G.ɵinj=g.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:G,providers:[Z,K],imports:[r.BidiModule,a.PortalModule,e.ScrollingModule,e.ScrollingModule]}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:G,decorators:[{type:s.NgModule,args:[{imports:[r.BidiModule,a.PortalModule,e.ScrollingModule],exports:[$,q,e.ScrollingModule],declarations:[$,q],providers:[Z,K]}]}]});class J extends B{constructor(t,e){super(t,e)}ngOnDestroy(){super.ngOnDestroy(),this._fullScreenEventName&&this._fullScreenListener&&this._document.removeEventListener(this._fullScreenEventName,this._fullScreenListener)}_createContainer(){super._createContainer(),this._adjustParentForFullscreenChange(),this._addFullscreenChangeListener((()=>this._adjustParentForFullscreenChange()))}_adjustParentForFullscreenChange(){if(!this._containerElement)return;(this.getFullscreenElement()||this._document.body).appendChild(this._containerElement)}_addFullscreenChangeListener(t){const e=this._getEventName();e&&(this._fullScreenListener&&this._document.removeEventListener(e,this._fullScreenListener),this._document.addEventListener(e,t),this._fullScreenListener=t)}_getEventName(){if(!this._fullScreenEventName){const t=this._document;t.fullscreenEnabled?this._fullScreenEventName="fullscreenchange":t.webkitFullscreenEnabled?this._fullScreenEventName="webkitfullscreenchange":t.mozFullScreenEnabled?this._fullScreenEventName="mozfullscreenchange":t.msFullscreenEnabled&&(this._fullScreenEventName="MSFullscreenChange")}return this._fullScreenEventName}getFullscreenElement(){const t=this._document;return t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement||null}}J.ɵfac=g.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:J,deps:[{token:i.DOCUMENT},{token:u.Platform}],target:g.ɵɵFactoryTarget.Injectable}),J.ɵprov=g.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:J,providedIn:"root"}),g.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:g,type:J,decorators:[{type:s.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:s.Inject,args:[i.DOCUMENT]}]},{type:u.Platform}]}}),Object.defineProperty(t,"CdkScrollable",{enumerable:!0,get:function(){return e.CdkScrollable}}),Object.defineProperty(t,"ScrollDispatcher",{enumerable:!0,get:function(){return e.ScrollDispatcher}}),Object.defineProperty(t,"ViewportRuler",{enumerable:!0,get:function(){return e.ViewportRuler}}),t.BlockScrollStrategy=f,t.CdkConnectedOverlay=$,t.CdkOverlayOrigin=q,t.CloseScrollStrategy=b,t.ConnectedOverlayPositionChange=E,t.ConnectionPositionPair=class{constructor(t,e,i,s,o){this.offsetX=i,this.offsetY=s,this.panelClass=o,this.originX=t.originX,this.originY=t.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY}},t.FlexibleConnectedPositionStrategy=A,t.FullscreenOverlayContainer=J,t.GlobalPositionStrategy=N,t.NoopScrollStrategy=k,t.Overlay=Z,t.OverlayConfig=P,t.OverlayContainer=B,t.OverlayKeyboardDispatcher=I,t.OverlayModule=G,t.OverlayOutsideClickDispatcher=M,t.OverlayPositionBuilder=H,t.OverlayRef=V,t.RepositionScrollStrategy=w,t.STANDARD_DROPDOWN_ADJACENT_POSITIONS=[{originX:"end",originY:"top",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"start",overlayY:"bottom"},{originX:"start",originY:"top",overlayX:"end",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"end",overlayY:"bottom"}],t.STANDARD_DROPDOWN_BELOW_POSITIONS=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"}],t.ScrollStrategyOptions=S,t.ScrollingVisibility=class{},t.validateHorizontalPosition=D,t.validateVerticalPosition=x})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/platform/platform.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/platform/platform.js new file mode 100644 index 000000000..95d5fbb01 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/platform/platform.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkPlatform={},e.ngCore,e.ngCommon)}(this,(function(e,t,o){"use strict";function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var r=n(t);let i,s;try{i="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch{i=!1}class a{constructor(e){this._platformId=e,this.isBrowser=this._platformId?o.isPlatformBrowser(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!i)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}a.ɵfac=r.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:a,deps:[{token:t.PLATFORM_ID}],target:r.ɵɵFactoryTarget.Injectable}),a.ɵprov=r.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:a,providedIn:"root"}),r.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:a,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:Object,decorators:[{type:t.Inject,args:[t.PLATFORM_ID]}]}]}});class c{}c.ɵfac=r.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:c,deps:[],target:r.ɵɵFactoryTarget.NgModule}),c.ɵmod=r.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:r,type:c}),c.ɵinj=r.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:c}),r.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:r,type:c,decorators:[{type:t.NgModule,args:[{}]}]});const d=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];let u,l,f,p;function m(){if(null==u&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>u=!0}))}finally{u=u||!1}return u}function g(){if(null==p){const e="undefined"!=typeof document?document.head:null;p=!(!e||!e.createShadowRoot&&!e.attachShadow)}return p}e.Platform=a,e.PlatformModule=c,e._getEventTarget=function(e){return e.composedPath?e.composedPath()[0]:e.target},e._getFocusedElementPierceShadowDom=function(){let e="undefined"!=typeof document&&document?document.activeElement:null;for(;e&&e.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e},e._getShadowRoot=function(e){if(g()){const t=e.getRootNode?e.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&t instanceof ShadowRoot)return t}return null},e._isTestEnvironment=function(){return"undefined"!=typeof __karma__&&!!__karma__||"undefined"!=typeof jasmine&&!!jasmine||"undefined"!=typeof jest&&!!jest||"undefined"!=typeof Mocha&&!!Mocha},e._supportsShadowDom=g,e.getRtlScrollAxisType=function(){if("object"!=typeof document||!document)return 0;if(null==l){const e=document.createElement("div"),t=e.style;e.dir="rtl",t.width="1px",t.overflow="auto",t.visibility="hidden",t.pointerEvents="none",t.position="absolute";const o=document.createElement("div"),n=o.style;n.width="2px",n.height="1px",e.appendChild(o),document.body.appendChild(e),l=0,0===e.scrollLeft&&(e.scrollLeft=1,l=0===e.scrollLeft?1:2),e.remove()}return l},e.getSupportedInputTypes=function(){if(s)return s;if("object"!=typeof document||!document)return s=new Set(d),s;let e=document.createElement("input");return s=new Set(d.filter((t=>(e.setAttribute("type",t),e.type===t)))),s},e.normalizePassiveListenerOptions=function(e){return m()?e:!!e.capture},e.supportsPassiveEventListeners=m,e.supportsScrollBehavior=function(){if(null==f){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return f=!1,f;if("scrollBehavior"in document.documentElement.style)f=!0;else{const e=Element.prototype.scrollTo;f=!!e&&!/\{\s*\[native code\]\s*\}/.test(e.toString())}}return f}})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/portal/portal.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/portal/portal.js new file mode 100644 index 000000000..b9aa00c2b --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/portal/portal.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ngCdkPortal={},t.ngCore,t.ngCommon)}(this,(function(t,e,o){"use strict";function r(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,r.get?r:{enumerable:!0,get:function(){return t[o]}})}})),e.default=t,Object.freeze(e)}var n=r(e);function a(){throw Error("Host already has a portal attached")}class s{attach(t){return("undefined"==typeof ngDevMode||ngDevMode)&&(null==t&&function(){throw Error("Attempting to attach a portal to a null PortalOutlet")}(),t.hasAttached()&&a()),this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;null!=t?(this._attachedHost=null,t.detach()):("undefined"==typeof ngDevMode||ngDevMode)&&function(){throw Error("Attempting to detach a portal that is not attached to a host")}()}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class i extends s{constructor(t,e,o,r,n){super(),this.component=t,this.viewContainerRef=e,this.injector=o,this.componentFactoryResolver=r,this.projectableNodes=n}}class c extends s{constructor(t,e,o,r){super(),this.templateRef=t,this.viewContainerRef=e,this.context=o,this.injector=r}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}}class l extends s{constructor(t){super(),this.element=t instanceof e.ElementRef?t.nativeElement:t}}class d{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){return("undefined"==typeof ngDevMode||ngDevMode)&&(t||function(){throw Error("Must provide a portal to attach")}(),this.hasAttached()&&a(),this._isDisposed&&function(){throw Error("This PortalOutlet has already been disposed")}()),t instanceof i?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof c?(this._attachedPortal=t,this.attachTemplatePortal(t)):this.attachDomPortal&&t instanceof l?(this._attachedPortal=t,this.attachDomPortal(t)):void(("undefined"==typeof ngDevMode||ngDevMode)&&function(){throw Error("Attempting to attach an unknown Portal type. BasePortalOutlet accepts either a ComponentPortal or a TemplatePortal.")}())}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class p extends d{constructor(t,e,o,r,n){super(),this.outletElement=t,this._componentFactoryResolver=e,this._appRef=o,this._defaultInjector=r,this.attachDomPortal=t=>{if(!this._document&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("Cannot attach DOM portal without _document constructor parameter");const e=t.element;if(!e.parentNode&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("DOM portal content must be attached to a parent node.");const o=this._document.createComment("dom-portal");e.parentNode.insertBefore(o,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn((()=>{o.parentNode&&o.parentNode.replaceChild(e,o)}))},this._document=n}attachComponentPortal(t){const o=t.componentFactoryResolver||this._componentFactoryResolver;if(("undefined"==typeof ngDevMode||ngDevMode)&&!o)throw Error("Cannot attach component portal to outlet without a ComponentFactoryResolver.");const r=o.resolveComponentFactory(t.component);let n;if(t.viewContainerRef)n=t.viewContainerRef.createComponent(r,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector,t.projectableNodes||void 0),this.setDisposeFn((()=>n.destroy()));else{if(("undefined"==typeof ngDevMode||ngDevMode)&&!this._appRef)throw Error("Cannot attach component portal to outlet without an ApplicationRef.");n=r.create(t.injector||this._defaultInjector||e.Injector.NULL),this._appRef.attachView(n.hostView),this.setDisposeFn((()=>{this._appRef.viewCount>0&&this._appRef.detachView(n.hostView),n.destroy()}))}return this.outletElement.appendChild(this._getComponentRootNode(n)),this._attachedPortal=t,n}attachTemplatePortal(t){let e=t.viewContainerRef,o=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return o.rootNodes.forEach((t=>this.outletElement.appendChild(t))),o.detectChanges(),this.setDisposeFn((()=>{let t=e.indexOf(o);-1!==t&&e.remove(t)})),this._attachedPortal=t,o}dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}class h extends c{constructor(t,e){super(t,e)}}h.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:h,deps:[{token:n.TemplateRef},{token:n.ViewContainerRef}],target:n.ɵɵFactoryTarget.Directive}),h.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:h,selector:"[cdkPortal]",exportAs:["cdkPortal"],usesInheritance:!0,ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:h,decorators:[{type:e.Directive,args:[{selector:"[cdkPortal]",exportAs:"cdkPortal"}]}],ctorParameters:function(){return[{type:n.TemplateRef},{type:n.ViewContainerRef}]}});class u extends h{}u.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:u,deps:null,target:n.ɵɵFactoryTarget.Directive}),u.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:u,selector:"[cdk-portal], [portal]",providers:[{provide:h,useExisting:u}],exportAs:["cdkPortal"],usesInheritance:!0,ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:u,decorators:[{type:e.Directive,args:[{selector:"[cdk-portal], [portal]",exportAs:"cdkPortal",providers:[{provide:h,useExisting:u}]}]}]});class m extends d{constructor(t,o,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=o,this._isInitialized=!1,this.attached=new e.EventEmitter,this.attachDomPortal=t=>{if(!this._document&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("Cannot attach DOM portal without _document constructor parameter");const e=t.element;if(!e.parentNode&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("DOM portal content must be attached to a parent node.");const o=this._document.createComment("dom-portal");t.setAttachedHost(this),e.parentNode.insertBefore(o,e),this._getRootNode().appendChild(e),this._attachedPortal=t,super.setDisposeFn((()=>{o.parentNode&&o.parentNode.replaceChild(e,o)}))},this._document=r}get portal(){return this._attachedPortal}set portal(t){(!this.hasAttached()||t||this._isInitialized)&&(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t||null)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(t){t.setAttachedHost(this);const e=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,o=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),r=e.createComponent(o,e.length,t.injector||e.injector,t.projectableNodes||void 0);return e!==this._viewContainerRef&&this._getRootNode().appendChild(r.hostView.rootNodes[0]),super.setDisposeFn((()=>r.destroy())),this._attachedPortal=t,this._attachedRef=r,this.attached.emit(r),r}attachTemplatePortal(t){t.setAttachedHost(this);const e=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return super.setDisposeFn((()=>this._viewContainerRef.clear())),this._attachedPortal=t,this._attachedRef=e,this.attached.emit(e),e}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}m.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:m,deps:[{token:n.ComponentFactoryResolver},{token:n.ViewContainerRef},{token:o.DOCUMENT}],target:n.ɵɵFactoryTarget.Directive}),m.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:m,selector:"[cdkPortalOutlet]",inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],usesInheritance:!0,ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:m,decorators:[{type:e.Directive,args:[{selector:"[cdkPortalOutlet]",exportAs:"cdkPortalOutlet",inputs:["portal: cdkPortalOutlet"]}]}],ctorParameters:function(){return[{type:n.ComponentFactoryResolver},{type:n.ViewContainerRef},{type:void 0,decorators:[{type:e.Inject,args:[o.DOCUMENT]}]}]},propDecorators:{attached:[{type:e.Output}]}});class f extends m{}f.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:f,deps:null,target:n.ɵɵFactoryTarget.Directive}),f.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:f,selector:"[cdkPortalHost], [portalHost]",inputs:{portal:["cdkPortalHost","portal"]},providers:[{provide:m,useExisting:f}],exportAs:["cdkPortalHost"],usesInheritance:!0,ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:f,decorators:[{type:e.Directive,args:[{selector:"[cdkPortalHost], [portalHost]",exportAs:"cdkPortalHost",inputs:["portal: cdkPortalHost"],providers:[{provide:m,useExisting:f}]}]}]});class g{}g.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:g,deps:[],target:n.ɵɵFactoryTarget.NgModule}),g.ɵmod=n.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:n,type:g,declarations:[h,m,u,f],exports:[h,m,u,f]}),g.ɵinj=n.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:g}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:n,type:g,decorators:[{type:e.NgModule,args:[{exports:[h,m,u,f],declarations:[h,m,u,f]}]}]});t.BasePortalHost=class extends d{},t.BasePortalOutlet=d,t.CdkPortal=h,t.CdkPortalOutlet=m,t.ComponentPortal=i,t.DomPortal=l,t.DomPortalHost=class extends p{},t.DomPortalOutlet=p,t.Portal=s,t.PortalHostDirective=f,t.PortalInjector=class{constructor(t,e){this._parentInjector=t,this._customTokens=e}get(t,e){const o=this._customTokens.get(t);return void 0!==o?o:this._parentInjector.get(t,e)}},t.PortalModule=g,t.TemplatePortal=c,t.TemplatePortalDirective=u})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/scrolling/scrolling.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/scrolling/scrolling.js new file mode 100644 index 000000000..22f03d0e3 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/scrolling/scrolling.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/coercion"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/platform"),require("@angular/common"),require("@angular/cdk/bidi"),require("@angular/cdk/collections")):"function"==typeof define&&define.amd?define(["exports","@angular/cdk/coercion","@angular/core","rxjs","rxjs/operators","@angular/cdk/platform","@angular/common","@angular/cdk/bidi","@angular/cdk/collections"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkScrolling={},e.ngCdkCoercion,e.ngCore,e.rxjs,e.rxjsOperators,e.ngCdkPlatform,e.ngCommon,e.ngCdkBidi,e.ngCdkCollections)}(this,(function(e,t,r,i,n,o,s,a,l){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var d=c(r),h=c(o),p=c(a),u=c(l);const g=new r.InjectionToken("VIRTUAL_SCROLL_STRATEGY");class f{constructor(e,t,r){this._scrolledIndexChange=new i.Subject,this.scrolledIndexChange=this._scrolledIndexChange.pipe(n.distinctUntilChanged()),this._viewport=null,this._itemSize=e,this._minBufferPx=t,this._maxBufferPx=r}attach(e){this._viewport=e,this._updateTotalContentSize(),this._updateRenderedRange()}detach(){this._scrolledIndexChange.complete(),this._viewport=null}updateItemAndBufferSize(e,t,r){if(r0?n/this._itemSize:0;if(t.end>i){const e=Math.ceil(r/this._itemSize),s=Math.max(0,Math.min(o,i-e));o!=s&&(o=s,n=s*this._itemSize,t.start=Math.floor(o)),t.end=Math.max(0,Math.min(i,t.start+e))}const s=n-t.start*this._itemSize;if(s0&&(t.end=Math.min(i,t.end+r),t.start=Math.max(0,Math.floor(o-this._minBufferPx/this._itemSize)))}}this._viewport.setRenderedRange(t),this._viewport.setRenderedContentOffset(this._itemSize*t.start),this._scrolledIndexChange.next(Math.floor(o))}}function m(e){return e._scrollStrategy}class _{constructor(){this._itemSize=20,this._minBufferPx=100,this._maxBufferPx=200,this._scrollStrategy=new f(this.itemSize,this.minBufferPx,this.maxBufferPx)}get itemSize(){return this._itemSize}set itemSize(e){this._itemSize=t.coerceNumberProperty(e)}get minBufferPx(){return this._minBufferPx}set minBufferPx(e){this._minBufferPx=t.coerceNumberProperty(e)}get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(e){this._maxBufferPx=t.coerceNumberProperty(e)}ngOnChanges(){this._scrollStrategy.updateItemAndBufferSize(this.itemSize,this.minBufferPx,this.maxBufferPx)}}_.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:_,deps:[],target:d.ɵɵFactoryTarget.Directive}),_.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:_,isStandalone:!0,selector:"cdk-virtual-scroll-viewport[itemSize]",inputs:{itemSize:"itemSize",minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},providers:[{provide:g,useFactory:m,deps:[r.forwardRef((()=>_))]}],usesOnChanges:!0,ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:_,decorators:[{type:r.Directive,args:[{selector:"cdk-virtual-scroll-viewport[itemSize]",standalone:!0,providers:[{provide:g,useFactory:m,deps:[r.forwardRef((()=>_))]}]}]}],propDecorators:{itemSize:[{type:r.Input}],minBufferPx:[{type:r.Input}],maxBufferPx:[{type:r.Input}]}});class v{constructor(e,t,r){this._ngZone=e,this._platform=t,this._scrolled=new i.Subject,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe((()=>this._scrolled.next(e))))}deregister(e){const t=this.scrollContainers.get(e);t&&(t.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=20){return this._platform.isBrowser?new i.Observable((t=>{this._globalSubscription||this._addGlobalListener();const r=e>0?this._scrolled.pipe(n.auditTime(e)).subscribe(t):this._scrolled.subscribe(t);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}})):i.of()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach(((e,t)=>this.deregister(t))),this._scrolled.complete()}ancestorScrolled(e,t){const r=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(n.filter((e=>!e||r.indexOf(e)>-1)))}getAncestorScrollContainers(e){const t=[];return this.scrollContainers.forEach(((r,i)=>{this._scrollableContainsElement(i,e)&&t.push(i)})),t}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(e,r){let i=t.coerceElement(r),n=e.getElementRef().nativeElement;do{if(i==n)return!0}while(i=i.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular((()=>{const e=this._getWindow();return i.fromEvent(e.document,"scroll").subscribe((()=>this._scrolled.next()))}))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}v.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:v,deps:[{token:d.NgZone},{token:h.Platform},{token:s.DOCUMENT,optional:!0}],target:d.ɵɵFactoryTarget.Injectable}),v.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:v,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:v,decorators:[{type:r.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:d.NgZone},{type:h.Platform},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[s.DOCUMENT]}]}]}});class y{constructor(e,t,r,o){this.elementRef=e,this.scrollDispatcher=t,this.ngZone=r,this.dir=o,this._destroyed=new i.Subject,this._elementScrolled=new i.Observable((e=>this.ngZone.runOutsideAngular((()=>i.fromEvent(this.elementRef.nativeElement,"scroll").pipe(n.takeUntil(this._destroyed)).subscribe(e)))))}ngOnInit(){this.scrollDispatcher.register(this)}ngOnDestroy(){this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){const t=this.elementRef.nativeElement,r=this.dir&&"rtl"==this.dir.value;null==e.left&&(e.left=r?e.end:e.start),null==e.right&&(e.right=r?e.start:e.end),null!=e.bottom&&(e.top=t.scrollHeight-t.clientHeight-e.bottom),r&&0!=o.getRtlScrollAxisType()?(null!=e.left&&(e.right=t.scrollWidth-t.clientWidth-e.left),2==o.getRtlScrollAxisType()?e.left=e.right:1==o.getRtlScrollAxisType()&&(e.left=e.right?-e.right:e.right)):null!=e.right&&(e.left=t.scrollWidth-t.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){const t=this.elementRef.nativeElement;o.supportsScrollBehavior()?t.scrollTo(e):(null!=e.top&&(t.scrollTop=e.top),null!=e.left&&(t.scrollLeft=e.left))}measureScrollOffset(e){const t="left",r="right",i=this.elementRef.nativeElement;if("top"==e)return i.scrollTop;if("bottom"==e)return i.scrollHeight-i.clientHeight-i.scrollTop;const n=this.dir&&"rtl"==this.dir.value;return"start"==e?e=n?r:t:"end"==e&&(e=n?t:r),n&&2==o.getRtlScrollAxisType()?e==t?i.scrollWidth-i.clientWidth-i.scrollLeft:i.scrollLeft:n&&1==o.getRtlScrollAxisType()?e==t?i.scrollLeft+i.scrollWidth-i.clientWidth:-i.scrollLeft:e==t?i.scrollLeft:i.scrollWidth-i.clientWidth-i.scrollLeft}}y.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:y,deps:[{token:d.ElementRef},{token:v},{token:d.NgZone},{token:p.Directionality,optional:!0}],target:d.ɵɵFactoryTarget.Directive}),y.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:y,isStandalone:!0,selector:"[cdk-scrollable], [cdkScrollable]",ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:y,decorators:[{type:r.Directive,args:[{selector:"[cdk-scrollable], [cdkScrollable]",standalone:!0}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:v},{type:d.NgZone},{type:p.Directionality,decorators:[{type:r.Optional}]}]}});class S{constructor(e,t,r){this._platform=e,this._change=new i.Subject,this._changeListener=e=>{this._change.next(e)},this._document=r,t.runOutsideAngular((()=>{if(e.isBrowser){const e=this._getWindow();e.addEventListener("resize",this._changeListener),e.addEventListener("orientationchange",this._changeListener)}this.change().subscribe((()=>this._viewportSize=null))}))}ngOnDestroy(){if(this._platform.isBrowser){const e=this._getWindow();e.removeEventListener("resize",this._changeListener),e.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){const e=this.getViewportScrollPosition(),{width:t,height:r}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+r,right:e.left+t,height:r,width:t}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const e=this._document,t=this._getWindow(),r=e.documentElement,i=r.getBoundingClientRect();return{top:-i.top||e.body.scrollTop||t.scrollY||r.scrollTop||0,left:-i.left||e.body.scrollLeft||t.scrollX||r.scrollLeft||0}}change(e=20){return e>0?this._change.pipe(n.auditTime(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}}S.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:S,deps:[{token:h.Platform},{token:d.NgZone},{token:s.DOCUMENT,optional:!0}],target:d.ɵɵFactoryTarget.Injectable}),S.ɵprov=d.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:S,providedIn:"root"}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:S,decorators:[{type:r.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:h.Platform},{type:d.NgZone},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[s.DOCUMENT]}]}]}});const k=new r.InjectionToken("VIRTUAL_SCROLLABLE");class w extends y{constructor(e,t,r,i){super(e,t,r,i)}measureViewportSize(e){const t=this.elementRef.nativeElement;return"horizontal"===e?t.clientWidth:t.clientHeight}}w.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:w,deps:[{token:d.ElementRef},{token:v},{token:d.NgZone},{token:p.Directionality,optional:!0}],target:d.ɵɵFactoryTarget.Directive}),w.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:w,usesInheritance:!0,ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:w,decorators:[{type:r.Directive}],ctorParameters:function(){return[{type:d.ElementRef},{type:v},{type:d.NgZone},{type:p.Directionality,decorators:[{type:r.Optional}]}]}});const C="undefined"!=typeof requestAnimationFrame?i.animationFrameScheduler:i.asapScheduler;class b extends w{constructor(e,t,n,s,a,l,c,d){if(super(e,l,n,a),this.elementRef=e,this._changeDetectorRef=t,this._scrollStrategy=s,this.scrollable=d,this._platform=r.inject(o.Platform),this._detachedSubject=new i.Subject,this._renderedRangeSubject=new i.Subject,this._orientation="vertical",this._appendOnly=!1,this.scrolledIndexChange=new i.Observable((e=>this._scrollStrategy.scrolledIndexChange.subscribe((t=>Promise.resolve().then((()=>this.ngZone.run((()=>e.next(t))))))))),this.renderedRangeStream=this._renderedRangeSubject,this._totalContentSize=0,this._totalContentWidth="",this._totalContentHeight="",this._renderedRange={start:0,end:0},this._dataLength=0,this._viewportSize=0,this._renderedContentOffset=0,this._renderedContentOffsetNeedsRewrite=!1,this._isChangeDetectionPending=!1,this._runAfterChangeDetection=[],this._viewportChanges=i.Subscription.EMPTY,!s&&("undefined"==typeof ngDevMode||ngDevMode))throw Error('Error: cdk-virtual-scroll-viewport requires the "itemSize" property to be set.');this._viewportChanges=c.change().subscribe((()=>{this.checkViewportSize()})),this.scrollable||(this.elementRef.nativeElement.classList.add("cdk-virtual-scrollable"),this.scrollable=this)}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this._calculateSpacerSize())}get appendOnly(){return this._appendOnly}set appendOnly(e){this._appendOnly=t.coerceBooleanProperty(e)}ngOnInit(){this._platform.isBrowser&&(this.scrollable===this&&super.ngOnInit(),this.ngZone.runOutsideAngular((()=>Promise.resolve().then((()=>{this._measureViewportSize(),this._scrollStrategy.attach(this),this.scrollable.elementScrolled().pipe(n.startWith(null),n.auditTime(0,C)).subscribe((()=>this._scrollStrategy.onContentScrolled())),this._markChangeDetectionNeeded()})))))}ngOnDestroy(){this.detach(),this._scrollStrategy.detach(),this._renderedRangeSubject.complete(),this._detachedSubject.complete(),this._viewportChanges.unsubscribe(),super.ngOnDestroy()}attach(e){if(this._forOf&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("CdkVirtualScrollViewport is already attached.");this.ngZone.runOutsideAngular((()=>{this._forOf=e,this._forOf.dataStream.pipe(n.takeUntil(this._detachedSubject)).subscribe((e=>{const t=e.length;t!==this._dataLength&&(this._dataLength=t,this._scrollStrategy.onDataLengthChanged()),this._doChangeDetection()}))}))}detach(){this._forOf=null,this._detachedSubject.next()}getDataLength(){return this._dataLength}getViewportSize(){return this._viewportSize}getRenderedRange(){return this._renderedRange}measureBoundingClientRectWithScrollOffset(e){return this.getElementRef().nativeElement.getBoundingClientRect()[e]}setTotalContentSize(e){this._totalContentSize!==e&&(this._totalContentSize=e,this._calculateSpacerSize(),this._markChangeDetectionNeeded())}setRenderedRange(e){var t,r;t=this._renderedRange,r=e,(t.start!=r.start||t.end!=r.end)&&(this.appendOnly&&(e={start:0,end:Math.max(this._renderedRange.end,e.end)}),this._renderedRangeSubject.next(this._renderedRange=e),this._markChangeDetectionNeeded((()=>this._scrollStrategy.onContentRendered())))}getOffsetToRenderedContentStart(){return this._renderedContentOffsetNeedsRewrite?null:this._renderedContentOffset}setRenderedContentOffset(e,t="to-start"){e=this.appendOnly&&"to-start"===t?0:e;const r=this.dir&&"rtl"==this.dir.value,i="horizontal"==this.orientation,n=i?"X":"Y";let o=`translate${n}(${Number((i&&r?-1:1)*e)}px)`;this._renderedContentOffset=e,"to-end"===t&&(o+=` translate${n}(-100%)`,this._renderedContentOffsetNeedsRewrite=!0),this._renderedContentTransform!=o&&(this._renderedContentTransform=o,this._markChangeDetectionNeeded((()=>{this._renderedContentOffsetNeedsRewrite?(this._renderedContentOffset-=this.measureRenderedContentSize(),this._renderedContentOffsetNeedsRewrite=!1,this.setRenderedContentOffset(this._renderedContentOffset)):this._scrollStrategy.onRenderedOffsetChanged()})))}scrollToOffset(e,t="auto"){const r={behavior:t};"horizontal"===this.orientation?r.start=e:r.top=e,this.scrollable.scrollTo(r)}scrollToIndex(e,t="auto"){this._scrollStrategy.scrollToIndex(e,t)}measureScrollOffset(e){let t;return t=this.scrollable==this?e=>super.measureScrollOffset(e):e=>this.scrollable.measureScrollOffset(e),Math.max(0,t(e??("horizontal"===this.orientation?"start":"top"))-this.measureViewportOffset())}measureViewportOffset(e){let t;const r="left",i="right",n="rtl"==this.dir?.value;t="start"==e?n?i:r:"end"==e?n?r:i:e||("horizontal"===this.orientation?"left":"top");const o=this.scrollable.measureBoundingClientRectWithScrollOffset(t);return this.elementRef.nativeElement.getBoundingClientRect()[t]-o}measureRenderedContentSize(){const e=this._contentWrapper.nativeElement;return"horizontal"===this.orientation?e.offsetWidth:e.offsetHeight}measureRangeSize(e){return this._forOf?this._forOf.measureRangeSize(e,this.orientation):0}checkViewportSize(){this._measureViewportSize(),this._scrollStrategy.onDataLengthChanged()}_measureViewportSize(){this._viewportSize=this.scrollable.measureViewportSize(this.orientation)}_markChangeDetectionNeeded(e){e&&this._runAfterChangeDetection.push(e),this._isChangeDetectionPending||(this._isChangeDetectionPending=!0,this.ngZone.runOutsideAngular((()=>Promise.resolve().then((()=>{this._doChangeDetection()})))))}_doChangeDetection(){this._isChangeDetectionPending=!1,this._contentWrapper.nativeElement.style.transform=this._renderedContentTransform,this.ngZone.run((()=>this._changeDetectorRef.markForCheck()));const e=this._runAfterChangeDetection;this._runAfterChangeDetection=[];for(const t of e)t()}_calculateSpacerSize(){this._totalContentHeight="horizontal"===this.orientation?"":`${this._totalContentSize}px`,this._totalContentWidth="horizontal"===this.orientation?`${this._totalContentSize}px`:""}}function R(e,t,r){const i=r;if(!i.getBoundingClientRect)return 0;const n=i.getBoundingClientRect();return"horizontal"===e?"start"===t?n.left:n.right:"start"===t?n.top:n.bottom}b.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:b,deps:[{token:d.ElementRef},{token:d.ChangeDetectorRef},{token:d.NgZone},{token:g,optional:!0},{token:p.Directionality,optional:!0},{token:v},{token:S},{token:k,optional:!0}],target:d.ɵɵFactoryTarget.Component}),b.ɵcmp=d.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"15.0.0",type:b,isStandalone:!0,selector:"cdk-virtual-scroll-viewport",inputs:{orientation:"orientation",appendOnly:"appendOnly"},outputs:{scrolledIndexChange:"scrolledIndexChange"},host:{properties:{"class.cdk-virtual-scroll-orientation-horizontal":'orientation === "horizontal"',"class.cdk-virtual-scroll-orientation-vertical":'orientation !== "horizontal"'},classAttribute:"cdk-virtual-scroll-viewport"},providers:[{provide:y,useFactory:(e,t)=>e||t,deps:[[new r.Optional,new r.Inject(k)],b]}],viewQueries:[{propertyName:"_contentWrapper",first:!0,predicate:["contentWrapper"],descendants:!0,static:!0}],usesInheritance:!0,ngImport:d,template:'\x3c!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n--\x3e\n
\n \n
\n\x3c!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n--\x3e\n
\n',styles:["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"],changeDetection:d.ChangeDetectionStrategy.OnPush,encapsulation:d.ViewEncapsulation.None}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:b,decorators:[{type:r.Component,args:[{selector:"cdk-virtual-scroll-viewport",host:{class:"cdk-virtual-scroll-viewport","[class.cdk-virtual-scroll-orientation-horizontal]":'orientation === "horizontal"',"[class.cdk-virtual-scroll-orientation-vertical]":'orientation !== "horizontal"'},encapsulation:r.ViewEncapsulation.None,changeDetection:r.ChangeDetectionStrategy.OnPush,standalone:!0,providers:[{provide:y,useFactory:(e,t)=>e||t,deps:[[new r.Optional,new r.Inject(k)],b]}],template:'\x3c!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n--\x3e\n
\n \n
\n\x3c!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n--\x3e\n
\n',styles:["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"]}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:d.ChangeDetectorRef},{type:d.NgZone},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[g]}]},{type:p.Directionality,decorators:[{type:r.Optional}]},{type:v},{type:S},{type:w,decorators:[{type:r.Optional},{type:r.Inject,args:[k]}]}]},propDecorators:{orientation:[{type:r.Input}],appendOnly:[{type:r.Input}],scrolledIndexChange:[{type:r.Output}],_contentWrapper:[{type:r.ViewChild,args:["contentWrapper",{static:!0}]}]}});class x{constructor(e,t,r,o,s,a){this._viewContainerRef=e,this._template=t,this._differs=r,this._viewRepeater=o,this._viewport=s,this.viewChange=new i.Subject,this._dataSourceChanges=new i.Subject,this.dataStream=this._dataSourceChanges.pipe(n.startWith(null),n.pairwise(),n.switchMap((([e,t])=>this._changeDataSource(e,t))),n.shareReplay(1)),this._differ=null,this._needsUpdate=!1,this._destroyed=new i.Subject,this.dataStream.subscribe((e=>{this._data=e,this._onRenderedDataChange()})),this._viewport.renderedRangeStream.pipe(n.takeUntil(this._destroyed)).subscribe((e=>{this._renderedRange=e,this.viewChange.observers.length&&a.run((()=>this.viewChange.next(this._renderedRange))),this._onRenderedDataChange()})),this._viewport.attach(this)}get cdkVirtualForOf(){return this._cdkVirtualForOf}set cdkVirtualForOf(e){this._cdkVirtualForOf=e,l.isDataSource(e)?this._dataSourceChanges.next(e):this._dataSourceChanges.next(new l.ArrayDataSource(i.isObservable(e)?e:Array.from(e||[])))}get cdkVirtualForTrackBy(){return this._cdkVirtualForTrackBy}set cdkVirtualForTrackBy(e){this._needsUpdate=!0,this._cdkVirtualForTrackBy=e?(t,r)=>e(t+(this._renderedRange?this._renderedRange.start:0),r):void 0}set cdkVirtualForTemplate(e){e&&(this._needsUpdate=!0,this._template=e)}get cdkVirtualForTemplateCacheSize(){return this._viewRepeater.viewCacheSize}set cdkVirtualForTemplateCacheSize(e){this._viewRepeater.viewCacheSize=t.coerceNumberProperty(e)}measureRangeSize(e,t){if(e.start>=e.end)return 0;if((e.startthis._renderedRange.end)&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("Error: attempted to measure an item that isn't rendered.");const r=e.start-this._renderedRange.start,i=e.end-e.start;let n,o;for(let e=0;e-1;e--){const t=this._viewContainerRef.get(e+r);if(t&&t.rootNodes.length){o=t.rootNodes[t.rootNodes.length-1];break}}return n&&o?R(t,"end",o)-R(t,"start",n):0}ngDoCheck(){if(this._differ&&this._needsUpdate){const e=this._differ.diff(this._renderedItems);e?this._applyChanges(e):this._updateContext(),this._needsUpdate=!1}}ngOnDestroy(){this._viewport.detach(),this._dataSourceChanges.next(void 0),this._dataSourceChanges.complete(),this.viewChange.complete(),this._destroyed.next(),this._destroyed.complete(),this._viewRepeater.detach()}_onRenderedDataChange(){this._renderedRange&&(this._renderedItems=this._data.slice(this._renderedRange.start,this._renderedRange.end),this._differ||(this._differ=this._differs.find(this._renderedItems).create(((e,t)=>this.cdkVirtualForTrackBy?this.cdkVirtualForTrackBy(e,t):t))),this._needsUpdate=!0)}_changeDataSource(e,t){return e&&e.disconnect(this),this._needsUpdate=!0,t?t.connect(this):i.of()}_updateContext(){const e=this._data.length;let t=this._viewContainerRef.length;for(;t--;){const r=this._viewContainerRef.get(t);r.context.index=this._renderedRange.start+t,r.context.count=e,this._updateComputedContextProperties(r.context),r.detectChanges()}}_applyChanges(e){this._viewRepeater.applyChanges(e,this._viewContainerRef,((e,t,r)=>this._getEmbeddedViewArgs(e,r)),(e=>e.item)),e.forEachIdentityChange((e=>{this._viewContainerRef.get(e.currentIndex).context.$implicit=e.item}));const t=this._data.length;let r=this._viewContainerRef.length;for(;r--;){const e=this._viewContainerRef.get(r);e.context.index=this._renderedRange.start+r,e.context.count=t,this._updateComputedContextProperties(e.context)}}_updateComputedContextProperties(e){e.first=0===e.index,e.last=e.index===e.count-1,e.even=e.index%2==0,e.odd=!e.even}_getEmbeddedViewArgs(e,t){return{templateRef:this._template,context:{$implicit:e.item,cdkVirtualForOf:this._cdkVirtualForOf,index:-1,count:-1,first:!1,last:!1,odd:!1,even:!1},index:t}}}x.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:x,deps:[{token:d.ViewContainerRef},{token:d.TemplateRef},{token:d.IterableDiffers},{token:l._VIEW_REPEATER_STRATEGY},{token:b,skipSelf:!0},{token:d.NgZone}],target:d.ɵɵFactoryTarget.Directive}),x.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:x,isStandalone:!0,selector:"[cdkVirtualFor][cdkVirtualForOf]",inputs:{cdkVirtualForOf:"cdkVirtualForOf",cdkVirtualForTrackBy:"cdkVirtualForTrackBy",cdkVirtualForTemplate:"cdkVirtualForTemplate",cdkVirtualForTemplateCacheSize:"cdkVirtualForTemplateCacheSize"},providers:[{provide:l._VIEW_REPEATER_STRATEGY,useClass:l._RecycleViewRepeaterStrategy}],ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:x,decorators:[{type:r.Directive,args:[{selector:"[cdkVirtualFor][cdkVirtualForOf]",providers:[{provide:l._VIEW_REPEATER_STRATEGY,useClass:l._RecycleViewRepeaterStrategy}],standalone:!0}]}],ctorParameters:function(){return[{type:d.ViewContainerRef},{type:d.TemplateRef},{type:d.IterableDiffers},{type:u._RecycleViewRepeaterStrategy,decorators:[{type:r.Inject,args:[l._VIEW_REPEATER_STRATEGY]}]},{type:b,decorators:[{type:r.SkipSelf}]},{type:d.NgZone}]},propDecorators:{cdkVirtualForOf:[{type:r.Input}],cdkVirtualForTrackBy:[{type:r.Input}],cdkVirtualForTemplate:[{type:r.Input}],cdkVirtualForTemplateCacheSize:[{type:r.Input}]}});class V extends w{constructor(e,t,r,i){super(e,t,r,i)}measureBoundingClientRectWithScrollOffset(e){return this.getElementRef().nativeElement.getBoundingClientRect()[e]-this.measureScrollOffset(e)}}V.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:V,deps:[{token:d.ElementRef},{token:v},{token:d.NgZone},{token:p.Directionality,optional:!0}],target:d.ɵɵFactoryTarget.Directive}),V.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:V,isStandalone:!0,selector:"[cdkVirtualScrollingElement]",host:{classAttribute:"cdk-virtual-scrollable"},providers:[{provide:k,useExisting:V}],usesInheritance:!0,ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:V,decorators:[{type:r.Directive,args:[{selector:"[cdkVirtualScrollingElement]",providers:[{provide:k,useExisting:V}],standalone:!0,host:{class:"cdk-virtual-scrollable"}}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:v},{type:d.NgZone},{type:p.Directionality,decorators:[{type:r.Optional}]}]}});class D extends w{constructor(e,t,o){super(new r.ElementRef(document.documentElement),e,t,o),this._elementScrolled=new i.Observable((e=>this.ngZone.runOutsideAngular((()=>i.fromEvent(document,"scroll").pipe(n.takeUntil(this._destroyed)).subscribe(e)))))}measureBoundingClientRectWithScrollOffset(e){return this.getElementRef().nativeElement.getBoundingClientRect()[e]}}D.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:D,deps:[{token:v},{token:d.NgZone},{token:p.Directionality,optional:!0}],target:d.ɵɵFactoryTarget.Directive}),D.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:D,isStandalone:!0,selector:"cdk-virtual-scroll-viewport[scrollWindow]",providers:[{provide:k,useExisting:D}],usesInheritance:!0,ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:D,decorators:[{type:r.Directive,args:[{selector:"cdk-virtual-scroll-viewport[scrollWindow]",providers:[{provide:k,useExisting:D}],standalone:!0}]}],ctorParameters:function(){return[{type:v},{type:d.NgZone},{type:p.Directionality,decorators:[{type:r.Optional}]}]}});class O{}O.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:O,deps:[],target:d.ɵɵFactoryTarget.NgModule}),O.ɵmod=d.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:d,type:O,imports:[y],exports:[y]}),O.ɵinj=d.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:O}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:O,decorators:[{type:r.NgModule,args:[{exports:[y],imports:[y]}]}]});class z{}z.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:z,deps:[],target:d.ɵɵFactoryTarget.NgModule}),z.ɵmod=d.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:d,type:z,imports:[a.BidiModule,O,b,_,x,D,V],exports:[a.BidiModule,O,_,x,b,D,V]}),z.ɵinj=d.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:z,imports:[a.BidiModule,O,b,a.BidiModule,O]}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:z,decorators:[{type:r.NgModule,args:[{imports:[a.BidiModule,O,b,_,x,D,V],exports:[a.BidiModule,O,_,x,b,D,V]}]}]}),e.CdkFixedSizeVirtualScroll=_,e.CdkScrollable=y,e.CdkScrollableModule=O,e.CdkVirtualForOf=x,e.CdkVirtualScrollViewport=b,e.CdkVirtualScrollable=w,e.CdkVirtualScrollableElement=V,e.CdkVirtualScrollableWindow=D,e.DEFAULT_RESIZE_TIME=20,e.DEFAULT_SCROLL_TIME=20,e.FixedSizeVirtualScrollStrategy=f,e.ScrollDispatcher=v,e.ScrollingModule=z,e.VIRTUAL_SCROLLABLE=k,e.VIRTUAL_SCROLL_STRATEGY=g,e.ViewportRuler=S,e._fixedSizeVirtualScrollStrategyFactory=m})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/stepper/stepper.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/stepper/stepper.js new file mode 100644 index 000000000..5f810bf04 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/stepper/stepper.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/a11y"),require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("@angular/cdk/keycodes"),require("@angular/core"),require("@angular/cdk/platform"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["exports","@angular/cdk/a11y","@angular/cdk/bidi","@angular/cdk/coercion","@angular/cdk/keycodes","@angular/core","@angular/cdk/platform","rxjs","rxjs/operators"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkStepper={},e.ngCdkA11y,e.ngCdkBidi,e.ngCdkCoercion,e.ngCdkKeycodes,e.ngCore,e.ngCdkPlatform,e.rxjs,e.rxjsOperators)}(this,(function(e,t,r,s,n,i,o,a,p){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var d=c(r),l=c(i);class h{constructor(e){this._elementRef=e}focus(){this._elementRef.nativeElement.focus()}}h.ɵfac=l.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:l,type:h,deps:[{token:l.ElementRef}],target:l.ɵɵFactoryTarget.Directive}),h.ɵdir=l.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:h,selector:"[cdkStepHeader]",host:{attributes:{role:"tab"}},ngImport:l}),l.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:l,type:h,decorators:[{type:i.Directive,args:[{selector:"[cdkStepHeader]",host:{role:"tab"}}]}],ctorParameters:function(){return[{type:l.ElementRef}]}});class u{constructor(e){this.template=e}}u.ɵfac=l.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:l,type:u,deps:[{token:l.TemplateRef}],target:l.ɵɵFactoryTarget.Directive}),u.ɵdir=l.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:u,selector:"[cdkStepLabel]",ngImport:l}),l.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:l,type:u,decorators:[{type:i.Directive,args:[{selector:"[cdkStepLabel]"}]}],ctorParameters:function(){return[{type:l.TemplateRef}]}});let g=0;const y={NUMBER:"number",EDIT:"edit",DONE:"done",ERROR:"error"},_=new i.InjectionToken("STEPPER_GLOBAL_OPTIONS");class m{constructor(e,t){this._stepper=e,this.interacted=!1,this.interactedStream=new i.EventEmitter,this._editable=!0,this._optional=!1,this._completedOverride=null,this._customError=null,this._stepperOptions=t||{},this._displayDefaultIndicatorType=!1!==this._stepperOptions.displayDefaultIndicatorType}get editable(){return this._editable}set editable(e){this._editable=s.coerceBooleanProperty(e)}get optional(){return this._optional}set optional(e){this._optional=s.coerceBooleanProperty(e)}get completed(){return null==this._completedOverride?this._getDefaultCompleted():this._completedOverride}set completed(e){this._completedOverride=s.coerceBooleanProperty(e)}_getDefaultCompleted(){return this.stepControl?this.stepControl.valid&&this.interacted:this.interacted}get hasError(){return null==this._customError?this._getDefaultError():this._customError}set hasError(e){this._customError=s.coerceBooleanProperty(e)}_getDefaultError(){return this.stepControl&&this.stepControl.invalid&&this.interacted}select(){this._stepper.selected=this}reset(){this.interacted=!1,null!=this._completedOverride&&(this._completedOverride=!1),null!=this._customError&&(this._customError=!1),this.stepControl&&this.stepControl.reset()}ngOnChanges(){this._stepper._stateChanged()}_markAsInteracted(){this.interacted||(this.interacted=!0,this.interactedStream.emit(this))}_showError(){return this._stepperOptions.showError??null!=this._customError}}m.ɵfac=l.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:l,type:m,deps:[{token:i.forwardRef((()=>I))},{token:_,optional:!0}],target:l.ɵɵFactoryTarget.Component}),m.ɵcmp=l.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"15.0.0",type:m,selector:"cdk-step",inputs:{stepControl:"stepControl",label:"label",errorMessage:"errorMessage",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],state:"state",editable:"editable",optional:"optional",completed:"completed",hasError:"hasError"},outputs:{interactedStream:"interacted"},queries:[{propertyName:"stepLabel",first:!0,predicate:u,descendants:!0}],viewQueries:[{propertyName:"content",first:!0,predicate:i.TemplateRef,descendants:!0,static:!0}],exportAs:["cdkStep"],usesOnChanges:!0,ngImport:l,template:"",isInline:!0,changeDetection:l.ChangeDetectionStrategy.OnPush,encapsulation:l.ViewEncapsulation.None}),l.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:l,type:m,decorators:[{type:i.Component,args:[{selector:"cdk-step",exportAs:"cdkStep",template:"",encapsulation:i.ViewEncapsulation.None,changeDetection:i.ChangeDetectionStrategy.OnPush}]}],ctorParameters:function(){return[{type:I,decorators:[{type:i.Inject,args:[i.forwardRef((()=>I))]}]},{type:void 0,decorators:[{type:i.Optional},{type:i.Inject,args:[_]}]}]},propDecorators:{stepLabel:[{type:i.ContentChild,args:[u]}],content:[{type:i.ViewChild,args:[i.TemplateRef,{static:!0}]}],stepControl:[{type:i.Input}],interactedStream:[{type:i.Output,args:["interacted"]}],label:[{type:i.Input}],errorMessage:[{type:i.Input}],ariaLabel:[{type:i.Input,args:["aria-label"]}],ariaLabelledby:[{type:i.Input,args:["aria-labelledby"]}],state:[{type:i.Input}],editable:[{type:i.Input}],optional:[{type:i.Input}],completed:[{type:i.Input}],hasError:[{type:i.Input}]}});class I{constructor(e,t,r){this._dir=e,this._changeDetectorRef=t,this._elementRef=r,this._destroyed=new a.Subject,this.steps=new i.QueryList,this._sortedHeaders=new i.QueryList,this._linear=!1,this._selectedIndex=0,this.selectionChange=new i.EventEmitter,this._orientation="horizontal",this._groupId=g++}get linear(){return this._linear}set linear(e){this._linear=s.coerceBooleanProperty(e)}get selectedIndex(){return this._selectedIndex}set selectedIndex(e){const t=s.coerceNumberProperty(e);if(this.steps&&this._steps){if(!this._isValidIndex(t)&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.");this.selected?._markAsInteracted(),this._selectedIndex!==t&&!this._anyControlsInvalidOrPending(t)&&(t>=this._selectedIndex||this.steps.toArray()[t].editable)&&this._updateSelectedItemIndex(t)}else this._selectedIndex=t}get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(e){this.selectedIndex=e&&this.steps?this.steps.toArray().indexOf(e):-1}get orientation(){return this._orientation}set orientation(e){this._orientation=e,this._keyManager&&this._keyManager.withVerticalOrientation("vertical"===e)}ngAfterContentInit(){this._steps.changes.pipe(p.startWith(this._steps),p.takeUntil(this._destroyed)).subscribe((e=>{this.steps.reset(e.filter((e=>e._stepper===this))),this.steps.notifyOnChanges()}))}ngAfterViewInit(){this._stepHeader.changes.pipe(p.startWith(this._stepHeader),p.takeUntil(this._destroyed)).subscribe((e=>{this._sortedHeaders.reset(e.toArray().sort(((e,t)=>e._elementRef.nativeElement.compareDocumentPosition(t._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))),this._sortedHeaders.notifyOnChanges()})),this._keyManager=new t.FocusKeyManager(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation("vertical"===this._orientation),(this._dir?this._dir.change:a.of()).pipe(p.startWith(this._layoutDirection()),p.takeUntil(this._destroyed)).subscribe((e=>this._keyManager.withHorizontalOrientation(e))),this._keyManager.updateActiveItem(this._selectedIndex),this.steps.changes.subscribe((()=>{this.selected||(this._selectedIndex=Math.max(this._selectedIndex-1,0))})),this._isValidIndex(this._selectedIndex)||(this._selectedIndex=0)}ngOnDestroy(){this._keyManager?.destroy(),this.steps.destroy(),this._sortedHeaders.destroy(),this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach((e=>e.reset())),this._stateChanged()}_getStepLabelId(e){return`cdk-step-label-${this._groupId}-${e}`}_getStepContentId(e){return`cdk-step-content-${this._groupId}-${e}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(e){const t=e-this._selectedIndex;return t<0?"rtl"===this._layoutDirection()?"next":"previous":t>0?"rtl"===this._layoutDirection()?"previous":"next":"current"}_getIndicatorType(e,t=y.NUMBER){const r=this.steps.toArray()[e],s=this._isCurrentStep(e);return r._displayDefaultIndicatorType?this._getDefaultIndicatorLogic(r,s):this._getGuidelineLogic(r,s,t)}_getDefaultIndicatorLogic(e,t){return e._showError()&&e.hasError&&!t?y.ERROR:!e.completed||t?y.NUMBER:e.editable?y.EDIT:y.DONE}_getGuidelineLogic(e,t,r=y.NUMBER){return e._showError()&&e.hasError&&!t?y.ERROR:e.completed&&!t?y.DONE:e.completed&&t?r:e.editable&&t?y.EDIT:r}_isCurrentStep(e){return this._selectedIndex===e}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex}_updateSelectedItemIndex(e){const t=this.steps.toArray();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:this._selectedIndex,selectedStep:t[e],previouslySelectedStep:t[this._selectedIndex]}),this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItem(e),this._selectedIndex=e,this._stateChanged()}_onKeydown(e){const t=n.hasModifierKey(e),r=e.keyCode,s=this._keyManager;null==s.activeItemIndex||t||r!==n.SPACE&&r!==n.ENTER?s.setFocusOrigin("keyboard").onKeydown(e):(this.selectedIndex=s.activeItemIndex,e.preventDefault())}_anyControlsInvalidOrPending(e){return!!(this._linear&&e>=0)&&this.steps.toArray().slice(0,e).some((e=>{const t=e.stepControl;return(t?t.invalid||t.pending||!e.interacted:!e.completed)&&!e.optional&&!e._completedOverride}))}_layoutDirection(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}_containsFocus(){const e=this._elementRef.nativeElement,t=o._getFocusedElementPierceShadowDom();return e===t||e.contains(t)}_isValidIndex(e){return e>-1&&(!this.steps||e{for(;this._currentSchedule.tasks.length||this._currentSchedule.endTasks.length;){const e=this._currentSchedule;this._currentSchedule=new E;for(const t of e.tasks)t();for(const t of e.endTasks)t()}this._currentSchedule=null})))}_getScheduleObservable(){return this._ngZone.isStable?c.from(Promise.resolve(void 0)):this._ngZone.onStable.pipe(l.take(1))}}T.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:T,deps:[{token:f.NgZone}],target:f.ɵɵFactoryTarget.Injectable}),T.ɵprov=f.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:T}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:T,decorators:[{type:a.Injectable}],ctorParameters:function(){return[{type:f.NgZone}]}});const O="";class V{constructor(e,t){this.template=e,this._differs=t}ngOnChanges(e){if(!this._columnsDiffer){const t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t)}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(e){return this instanceof x?e.headerCell.template:this instanceof M?e.footerCell.template:e.cell.template}}V.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:V,deps:[{token:f.TemplateRef},{token:f.IterableDiffers}],target:f.ɵɵFactoryTarget.Directive}),V.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:V,usesOnChanges:!0,ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:V,decorators:[{type:a.Directive}],ctorParameters:function(){return[{type:f.TemplateRef},{type:f.IterableDiffers}]}});const N=m(class extends V{});class x extends N{constructor(e,t,o){super(e,t),this._table=o}ngOnChanges(e){super.ngOnChanges(e)}}x.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:x,deps:[{token:f.TemplateRef},{token:f.IterableDiffers},{token:y,optional:!0}],target:f.ɵɵFactoryTarget.Directive}),x.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:x,selector:"[cdkHeaderRowDef]",inputs:{columns:["cdkHeaderRowDef","columns"],sticky:["cdkHeaderRowDefSticky","sticky"]},usesInheritance:!0,usesOnChanges:!0,ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:x,decorators:[{type:a.Directive,args:[{selector:"[cdkHeaderRowDef]",inputs:["columns: cdkHeaderRowDef","sticky: cdkHeaderRowDefSticky"]}]}],ctorParameters:function(){return[{type:f.TemplateRef},{type:f.IterableDiffers},{type:void 0,decorators:[{type:a.Inject,args:[y]},{type:a.Optional}]}]}});const F=m(class extends V{});class M extends F{constructor(e,t,o){super(e,t),this._table=o}ngOnChanges(e){super.ngOnChanges(e)}}M.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:M,deps:[{token:f.TemplateRef},{token:f.IterableDiffers},{token:y,optional:!0}],target:f.ɵɵFactoryTarget.Directive}),M.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:M,selector:"[cdkFooterRowDef]",inputs:{columns:["cdkFooterRowDef","columns"],sticky:["cdkFooterRowDefSticky","sticky"]},usesInheritance:!0,usesOnChanges:!0,ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:M,decorators:[{type:a.Directive,args:[{selector:"[cdkFooterRowDef]",inputs:["columns: cdkFooterRowDef","sticky: cdkFooterRowDefSticky"]}]}],ctorParameters:function(){return[{type:f.TemplateRef},{type:f.IterableDiffers},{type:void 0,decorators:[{type:a.Inject,args:[y]},{type:a.Optional}]}]}});class A extends V{constructor(e,t,o){super(e,t),this._table=o}}A.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:A,deps:[{token:f.TemplateRef},{token:f.IterableDiffers},{token:y,optional:!0}],target:f.ɵɵFactoryTarget.Directive}),A.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:A,selector:"[cdkRowDef]",inputs:{columns:["cdkRowDefColumns","columns"],when:["cdkRowDefWhen","when"]},usesInheritance:!0,ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:A,decorators:[{type:a.Directive,args:[{selector:"[cdkRowDef]",inputs:["columns: cdkRowDefColumns","when: cdkRowDefWhen"]}]}],ctorParameters:function(){return[{type:f.TemplateRef},{type:f.IterableDiffers},{type:void 0,decorators:[{type:a.Inject,args:[y]},{type:a.Optional}]}]}});class P{constructor(e){this._viewContainer=e,P.mostRecentCellOutlet=this}ngOnDestroy(){P.mostRecentCellOutlet===this&&(P.mostRecentCellOutlet=null)}}P.mostRecentCellOutlet=null,P.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:P,deps:[{token:f.ViewContainerRef}],target:f.ɵɵFactoryTarget.Directive}),P.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:P,selector:"[cdkCellOutlet]",ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:P,decorators:[{type:a.Directive,args:[{selector:"[cdkCellOutlet]"}]}],ctorParameters:function(){return[{type:f.ViewContainerRef}]}});class H{}H.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:H,deps:[],target:f.ɵɵFactoryTarget.Component}),H.ɵcmp=f.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"15.0.0",type:H,selector:"cdk-header-row, tr[cdk-header-row]",host:{attributes:{role:"row"},classAttribute:"cdk-header-row"},ngImport:f,template:"",isInline:!0,dependencies:[{kind:"directive",type:P,selector:"[cdkCellOutlet]"}],changeDetection:f.ChangeDetectionStrategy.Default,encapsulation:f.ViewEncapsulation.None}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:H,decorators:[{type:a.Component,args:[{selector:"cdk-header-row, tr[cdk-header-row]",template:O,host:{class:"cdk-header-row",role:"row"},changeDetection:a.ChangeDetectionStrategy.Default,encapsulation:a.ViewEncapsulation.None}]}]});class L{}L.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:L,deps:[],target:f.ɵɵFactoryTarget.Component}),L.ɵcmp=f.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"15.0.0",type:L,selector:"cdk-footer-row, tr[cdk-footer-row]",host:{attributes:{role:"row"},classAttribute:"cdk-footer-row"},ngImport:f,template:"",isInline:!0,dependencies:[{kind:"directive",type:P,selector:"[cdkCellOutlet]"}],changeDetection:f.ChangeDetectionStrategy.Default,encapsulation:f.ViewEncapsulation.None}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:L,decorators:[{type:a.Component,args:[{selector:"cdk-footer-row, tr[cdk-footer-row]",template:O,host:{class:"cdk-footer-row",role:"row"},changeDetection:a.ChangeDetectionStrategy.Default,encapsulation:a.ViewEncapsulation.None}]}]});class j{}j.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:j,deps:[],target:f.ɵɵFactoryTarget.Component}),j.ɵcmp=f.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"15.0.0",type:j,selector:"cdk-row, tr[cdk-row]",host:{attributes:{role:"row"},classAttribute:"cdk-row"},ngImport:f,template:"",isInline:!0,dependencies:[{kind:"directive",type:P,selector:"[cdkCellOutlet]"}],changeDetection:f.ChangeDetectionStrategy.Default,encapsulation:f.ViewEncapsulation.None}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:j,decorators:[{type:a.Component,args:[{selector:"cdk-row, tr[cdk-row]",template:O,host:{class:"cdk-row",role:"row"},changeDetection:a.ChangeDetectionStrategy.Default,encapsulation:a.ViewEncapsulation.None}]}]});class B{constructor(e){this.templateRef=e,this._contentClassName="cdk-no-data-row"}}B.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:B,deps:[{token:f.TemplateRef}],target:f.ɵɵFactoryTarget.Directive}),B.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:B,selector:"ng-template[cdkNoDataRow]",ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:B,decorators:[{type:a.Directive,args:[{selector:"ng-template[cdkNoDataRow]"}]}],ctorParameters:function(){return[{type:f.TemplateRef}]}});const U=["top","bottom","left","right"];class W{constructor(e,t,o,r,n=!0,s=!0,i){this._isNativeHtmlTable=e,this._stickCellCss=t,this.direction=o,this._coalescedStyleScheduler=r,this._isBrowser=n,this._needsPositionStickyOnElement=s,this._positionListener=i,this._cachedCellWidths=[],this._borderCellCss={top:`${t}-border-elem-top`,bottom:`${t}-border-elem-bottom`,left:`${t}-border-elem-left`,right:`${t}-border-elem-right`}}clearStickyPositioning(e,t){const o=[];for(const t of e)if(t.nodeType===t.ELEMENT_NODE){o.push(t);for(let e=0;e{for(const e of o)this._removeStickyStyle(e,t)}))}updateStickyColumns(e,t,o,r=!0){if(!e.length||!this._isBrowser||!t.some((e=>e))&&!o.some((e=>e)))return void(this._positionListener&&(this._positionListener.stickyColumnsUpdated({sizes:[]}),this._positionListener.stickyEndColumnsUpdated({sizes:[]})));const n=e[0],s=n.children.length,i=this._getCellWidths(n,r),a=this._getStickyStartColumnPositions(i,t),c=this._getStickyEndColumnPositions(i,o),l=t.lastIndexOf(!0),d=o.indexOf(!0);this._coalescedStyleScheduler.schedule((()=>{const r="rtl"===this.direction,n=r?"right":"left",h=r?"left":"right";for(const r of e)for(let e=0;et[o]?e:null))}),this._positionListener.stickyEndColumnsUpdated({sizes:-1===d?[]:i.slice(d).map(((e,t)=>o[t+d]?e:null)).reverse()}))}))}stickRows(e,t,o){if(!this._isBrowser)return;const r="bottom"===o?e.slice().reverse():e,n="bottom"===o?t.slice().reverse():t,s=[],i=[],a=[];for(let e=0,t=0;e{for(let e=0;e{t.some((e=>!e))?this._removeStickyStyle(o,["bottom"]):this._addStickyStyle(o,"bottom",0,!1)}))}_removeStickyStyle(e,t){for(const o of t)e.style[o]="",e.classList.remove(this._borderCellCss[o]);U.some((o=>-1===t.indexOf(o)&&e.style[o]))?e.style.zIndex=this._getCalculatedZIndex(e):(e.style.zIndex="",this._needsPositionStickyOnElement&&(e.style.position=""),e.classList.remove(this._stickCellCss))}_addStickyStyle(e,t,o,r){e.classList.add(this._stickCellCss),r&&e.classList.add(this._borderCellCss[t]),e.style[t]=`${o}px`,e.style.zIndex=this._getCalculatedZIndex(e),this._needsPositionStickyOnElement&&(e.style.cssText+="position: -webkit-sticky; position: sticky; ")}_getCalculatedZIndex(e){const t={top:100,bottom:10,left:1,right:1};let o=0;for(const r of U)e.style[r]&&(o+=t[r]);return o?`${o}`:""}_getCellWidths(e,t=!0){if(!t&&this._cachedCellWidths.length)return this._cachedCellWidths;const o=[],r=e.children;for(let e=0;e0;n--)t[n]&&(o[n]=r,r+=e[n]);return o}}function Z(e){return Error(`Could not find column with id "${e}".`)}const q=new a.InjectionToken("CDK_SPL");class ${}$.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:$,deps:[],target:f.ɵɵFactoryTarget.Directive}),$.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:$,selector:"cdk-table[recycleRows], table[cdk-table][recycleRows]",providers:[{provide:r._VIEW_REPEATER_STRATEGY,useClass:r._RecycleViewRepeaterStrategy}],ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:$,decorators:[{type:a.Directive,args:[{selector:"cdk-table[recycleRows], table[cdk-table][recycleRows]",providers:[{provide:r._VIEW_REPEATER_STRATEGY,useClass:r._RecycleViewRepeaterStrategy}]}]}]});class z{constructor(e,t){this.viewContainer=e,this.elementRef=t}}z.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:z,deps:[{token:f.ViewContainerRef},{token:f.ElementRef}],target:f.ɵɵFactoryTarget.Directive}),z.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:z,selector:"[rowOutlet]",ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:z,decorators:[{type:a.Directive,args:[{selector:"[rowOutlet]"}]}],ctorParameters:function(){return[{type:f.ViewContainerRef},{type:f.ElementRef}]}});class Y{constructor(e,t){this.viewContainer=e,this.elementRef=t}}Y.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:Y,deps:[{token:f.ViewContainerRef},{token:f.ElementRef}],target:f.ɵɵFactoryTarget.Directive}),Y.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:Y,selector:"[headerRowOutlet]",ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:Y,decorators:[{type:a.Directive,args:[{selector:"[headerRowOutlet]"}]}],ctorParameters:function(){return[{type:f.ViewContainerRef},{type:f.ElementRef}]}});class G{constructor(e,t){this.viewContainer=e,this.elementRef=t}}G.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:G,deps:[{token:f.ViewContainerRef},{token:f.ElementRef}],target:f.ɵɵFactoryTarget.Directive}),G.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:G,selector:"[footerRowOutlet]",ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:G,decorators:[{type:a.Directive,args:[{selector:"[footerRowOutlet]"}]}],ctorParameters:function(){return[{type:f.ViewContainerRef},{type:f.ElementRef}]}});class K{constructor(e,t){this.viewContainer=e,this.elementRef=t}}K.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:K,deps:[{token:f.ViewContainerRef},{token:f.ElementRef}],target:f.ɵɵFactoryTarget.Directive}),K.ɵdir=f.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:K,selector:"[noDataRowOutlet]",ngImport:f}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:K,decorators:[{type:a.Directive,args:[{selector:"[noDataRowOutlet]"}]}],ctorParameters:function(){return[{type:f.ViewContainerRef},{type:f.ElementRef}]}});const J='\n \n \n \n \n \n \n';class Q{constructor(e,t,o,r,n,s,i,l,d,h,p,u){this._differs=e,this._changeDetectorRef=t,this._elementRef=o,this._dir=n,this._platform=i,this._viewRepeater=l,this._coalescedStyleScheduler=d,this._viewportRuler=h,this._stickyPositioningListener=p,this._ngZone=u,this._onDestroy=new c.Subject,this._columnDefsByName=new Map,this._customColumnDefs=new Set,this._customRowDefs=new Set,this._customHeaderRowDefs=new Set,this._customFooterRowDefs=new Set,this._headerRowDefChanged=!0,this._footerRowDefChanged=!0,this._stickyColumnStylesNeedReset=!0,this._forceRecalculateCellWidths=!0,this._cachedRenderRowsMap=new Map,this.stickyCssClass="cdk-table-sticky",this.needsPositionStickyOnElement=!0,this._isShowingNoDataRow=!1,this._multiTemplateDataRows=!1,this._fixedLayout=!1,this.contentChanged=new a.EventEmitter,this.viewChange=new c.BehaviorSubject({start:0,end:Number.MAX_VALUE}),r||this._elementRef.nativeElement.setAttribute("role","table"),this._document=s,this._isNativeHtmlTable="TABLE"===this._elementRef.nativeElement.nodeName}get trackBy(){return this._trackByFn}set trackBy(e){"undefined"!=typeof ngDevMode&&!ngDevMode||null==e||"function"==typeof e||console.warn(`trackBy must be a function, but received ${JSON.stringify(e)}.`),this._trackByFn=e}get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&this._switchDataSource(e)}get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(e){this._multiTemplateDataRows=o.coerceBooleanProperty(e),this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles())}get fixedLayout(){return this._fixedLayout}set fixedLayout(e){this._fixedLayout=o.coerceBooleanProperty(e),this._forceRecalculateCellWidths=!0,this._stickyColumnStylesNeedReset=!0}ngOnInit(){this._setupStickyStyler(),this._isNativeHtmlTable&&this._applyNativeTableSections(),this._dataDiffer=this._differs.find([]).create(((e,t)=>this.trackBy?this.trackBy(t.dataIndex,t.data):t)),this._viewportRuler.change().pipe(l.takeUntil(this._onDestroy)).subscribe((()=>{this._forceRecalculateCellWidths=!0}))}ngAfterContentChecked(){if(this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&!this._rowDefs.length&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("Missing definitions for header, footer, and row; cannot determine which columns should be rendered.");const e=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||e,this._forceRecalculateCellWidths=e,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=!1),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=!1),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates()}ngOnDestroy(){[this._rowOutlet.viewContainer,this._headerRowOutlet.viewContainer,this._footerRowOutlet.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach((e=>{e.clear()})),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._onDestroy.next(),this._onDestroy.complete(),r.isDataSource(this.dataSource)&&this.dataSource.disconnect(this)}renderRows(){this._renderRows=this._getAllRenderRows();const e=this._dataDiffer.diff(this._renderRows);if(!e)return this._updateNoDataRow(),void this.contentChanged.next();const t=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(e,t,((e,t,o)=>this._getEmbeddedViewArgs(e.item,o)),(e=>e.item.data),(e=>{1===e.operation&&e.context&&this._renderCellTemplateForItem(e.record.item.rowDef,e.context)})),this._updateRowIndexContext(),e.forEachIdentityChange((e=>{t.get(e.currentIndex).context.$implicit=e.item.data})),this._updateNoDataRow(),this._ngZone&&a.NgZone.isInAngularZone()?this._ngZone.onStable.pipe(l.take(1),l.takeUntil(this._onDestroy)).subscribe((()=>{this.updateStickyColumnStyles()})):this.updateStickyColumnStyles(),this.contentChanged.next()}addColumnDef(e){this._customColumnDefs.add(e)}removeColumnDef(e){this._customColumnDefs.delete(e)}addRowDef(e){this._customRowDefs.add(e)}removeRowDef(e){this._customRowDefs.delete(e)}addHeaderRowDef(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=!0}removeHeaderRowDef(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=!0}addFooterRowDef(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=!0}removeFooterRowDef(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=!0}setNoDataRow(e){this._customNoDataRow=e}updateStickyHeaderRowStyles(){const e=this._getRenderedRows(this._headerRowOutlet),t=this._elementRef.nativeElement.querySelector("thead");t&&(t.style.display=e.length?"":"none");const o=this._headerRowDefs.map((e=>e.sticky));this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,o,"top"),this._headerRowDefs.forEach((e=>e.resetStickyChanged()))}updateStickyFooterRowStyles(){const e=this._getRenderedRows(this._footerRowOutlet),t=this._elementRef.nativeElement.querySelector("tfoot");t&&(t.style.display=e.length?"":"none");const o=this._footerRowDefs.map((e=>e.sticky));this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,o,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,o),this._footerRowDefs.forEach((e=>e.resetStickyChanged()))}updateStickyColumnStyles(){const e=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),o=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this._fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...t,...o],["left","right"]),this._stickyColumnStylesNeedReset=!1),e.forEach(((e,t)=>{this._addStickyColumnStyles([e],this._headerRowDefs[t])})),this._rowDefs.forEach((e=>{const o=[];for(let r=0;r{this._addStickyColumnStyles([e],this._footerRowDefs[t])})),Array.from(this._columnDefsByName.values()).forEach((e=>e.resetStickyChanged()))}_getAllRenderRows(){const e=[],t=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(let o=0;o{const n=o&&o.has(r)?o.get(r):[];if(n.length){const e=n.shift();return e.dataIndex=t,e}return{data:e,rowDef:r,dataIndex:t}}))}_cacheColumnDefs(){this._columnDefsByName.clear();X(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach((e=>{if(this._columnDefsByName.has(e.name)&&("undefined"==typeof ngDevMode||ngDevMode))throw t=e.name,Error(`Duplicate column definition name provided: "${t}".`);var t;this._columnDefsByName.set(e.name,e)}))}_cacheRowDefs(){this._headerRowDefs=X(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=X(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=X(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);const e=this._rowDefs.filter((e=>!e.when));if(!this.multiTemplateDataRows&&e.length>1&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("There can only be one default row without a when predicate function.");this._defaultRowDef=e[0]}_renderUpdatedColumns(){const e=(e,t)=>e||!!t.getColumnsDiff(),t=this._rowDefs.reduce(e,!1);t&&this._forceRenderDataRows();const o=this._headerRowDefs.reduce(e,!1);o&&this._forceRenderHeaderRows();const r=this._footerRowDefs.reduce(e,!1);return r&&this._forceRenderFooterRows(),t||o||r}_switchDataSource(e){this._data=[],r.isDataSource(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear()),this._dataSource=e}_observeRenderChanges(){if(!this.dataSource)return;let e;if(r.isDataSource(this.dataSource)?e=this.dataSource.connect(this):c.isObservable(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=c.of(this.dataSource)),void 0===e&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("Provided data source did not match an array, Observable, or DataSource");this._renderChangeSubscription=e.pipe(l.takeUntil(this._onDestroy)).subscribe((e=>{this._data=e||[],this.renderRows()}))}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach(((e,t)=>this._renderRow(this._headerRowOutlet,e,t))),this.updateStickyHeaderRowStyles()}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach(((e,t)=>this._renderRow(this._footerRowOutlet,e,t))),this.updateStickyFooterRowStyles()}_addStickyColumnStyles(e,t){const o=Array.from(t.columns||[]).map((e=>{const t=this._columnDefsByName.get(e);if(!t&&("undefined"==typeof ngDevMode||ngDevMode))throw Z(e);return t})),r=o.map((e=>e.sticky)),n=o.map((e=>e.stickyEnd));this._stickyStyler.updateStickyColumns(e,r,n,!this._fixedLayout||this._forceRecalculateCellWidths)}_getRenderedRows(e){const t=[];for(let o=0;o!o.when||o.when(t,e)));else{let r=this._rowDefs.find((o=>o.when&&o.when(t,e)))||this._defaultRowDef;r&&o.push(r)}if(!o.length&&("undefined"==typeof ngDevMode||ngDevMode))throw function(e){return Error(`Could not find a matching row definition for theprovided row data: ${JSON.stringify(e)}`)}(e);return o}_getEmbeddedViewArgs(e,t){const o=e.rowDef,r={$implicit:e.data};return{templateRef:o.template,context:r,index:t}}_renderRow(e,t,o,r={}){const n=e.viewContainer.createEmbeddedView(t.template,r,o);return this._renderCellTemplateForItem(t,r),n}_renderCellTemplateForItem(e,t){for(let o of this._getCellTemplates(e))P.mostRecentCellOutlet&&P.mostRecentCellOutlet._viewContainer.createEmbeddedView(o,t);this._changeDetectorRef.markForCheck()}_updateRowIndexContext(){const e=this._rowOutlet.viewContainer;for(let t=0,o=e.length;t{const o=this._columnDefsByName.get(t);if(!o&&("undefined"==typeof ngDevMode||ngDevMode))throw Z(t);return e.extractCellTemplate(o)})):[]}_applyNativeTableSections(){const e=this._document.createDocumentFragment(),t=[{tag:"thead",outlets:[this._headerRowOutlet]},{tag:"tbody",outlets:[this._rowOutlet,this._noDataRowOutlet]},{tag:"tfoot",outlets:[this._footerRowOutlet]}];for(const o of t){const t=this._document.createElement(o.tag);t.setAttribute("role","rowgroup");for(const e of o.outlets)t.appendChild(e.elementRef.nativeElement);e.appendChild(t)}this._elementRef.nativeElement.appendChild(e)}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows()}_checkStickyStates(){const e=(e,t)=>e||t.hasStickyChanged();this._headerRowDefs.reduce(e,!1)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,!1)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,!1)&&(this._stickyColumnStylesNeedReset=!0,this.updateStickyColumnStyles())}_setupStickyStyler(){const e=this._dir?this._dir.value:"ltr";this._stickyStyler=new W(this._isNativeHtmlTable,this.stickyCssClass,e,this._coalescedStyleScheduler,this._platform.isBrowser,this.needsPositionStickyOnElement,this._stickyPositioningListener),(this._dir?this._dir.change:c.of()).pipe(l.takeUntil(this._onDestroy)).subscribe((e=>{this._stickyStyler.direction=e,this.updateStickyColumnStyles()}))}_getOwnDefs(e){return e.filter((e=>!e._table||e._table===this))}_updateNoDataRow(){const e=this._customNoDataRow||this._noDataRow;if(!e)return;const t=0===this._rowOutlet.viewContainer.length;if(t===this._isShowingNoDataRow)return;const o=this._noDataRowOutlet.viewContainer;if(t){const t=o.createEmbeddedView(e.templateRef),r=t.rootNodes[0];1===t.rootNodes.length&&r?.nodeType===this._document.ELEMENT_NODE&&(r.setAttribute("role","row"),r.classList.add(e._contentClassName))}else o.clear();this._isShowingNoDataRow=t}}function X(e,t){return e.concat(Array.from(t))}Q.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:Q,deps:[{token:f.IterableDiffers},{token:f.ChangeDetectorRef},{token:f.ElementRef},{token:"role",attribute:!0},{token:h.Directionality,optional:!0},{token:i.DOCUMENT},{token:p.Platform},{token:r._VIEW_REPEATER_STRATEGY},{token:b},{token:u.ViewportRuler},{token:q,optional:!0,skipSelf:!0},{token:f.NgZone,optional:!0}],target:f.ɵɵFactoryTarget.Component}),Q.ɵcmp=f.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"15.0.0",type:Q,selector:"cdk-table, table[cdk-table]",inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:"multiTemplateDataRows",fixedLayout:"fixedLayout"},outputs:{contentChanged:"contentChanged"},host:{properties:{"class.cdk-table-fixed-layout":"fixedLayout"},classAttribute:"cdk-table"},providers:[{provide:y,useExisting:Q},{provide:r._VIEW_REPEATER_STRATEGY,useClass:r._DisposeViewRepeaterStrategy},{provide:b,useClass:T},{provide:q,useValue:null}],queries:[{propertyName:"_noDataRow",first:!0,predicate:B,descendants:!0},{propertyName:"_contentColumnDefs",predicate:k,descendants:!0},{propertyName:"_contentRowDefs",predicate:A,descendants:!0},{propertyName:"_contentHeaderRowDefs",predicate:x,descendants:!0},{propertyName:"_contentFooterRowDefs",predicate:M,descendants:!0}],viewQueries:[{propertyName:"_rowOutlet",first:!0,predicate:z,descendants:!0,static:!0},{propertyName:"_headerRowOutlet",first:!0,predicate:Y,descendants:!0,static:!0},{propertyName:"_footerRowOutlet",first:!0,predicate:G,descendants:!0,static:!0},{propertyName:"_noDataRowOutlet",first:!0,predicate:K,descendants:!0,static:!0}],exportAs:["cdkTable"],ngImport:f,template:'\n \n \n \n \n \n \n',isInline:!0,styles:[".cdk-table-fixed-layout{table-layout:fixed}"],dependencies:[{kind:"directive",type:z,selector:"[rowOutlet]"},{kind:"directive",type:Y,selector:"[headerRowOutlet]"},{kind:"directive",type:G,selector:"[footerRowOutlet]"},{kind:"directive",type:K,selector:"[noDataRowOutlet]"}],changeDetection:f.ChangeDetectionStrategy.Default,encapsulation:f.ViewEncapsulation.None}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:Q,decorators:[{type:a.Component,args:[{selector:"cdk-table, table[cdk-table]",exportAs:"cdkTable",template:J,host:{class:"cdk-table","[class.cdk-table-fixed-layout]":"fixedLayout"},encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.Default,providers:[{provide:y,useExisting:Q},{provide:r._VIEW_REPEATER_STRATEGY,useClass:r._DisposeViewRepeaterStrategy},{provide:b,useClass:T},{provide:q,useValue:null}],styles:[".cdk-table-fixed-layout{table-layout:fixed}"]}]}],ctorParameters:function(){return[{type:f.IterableDiffers},{type:f.ChangeDetectorRef},{type:f.ElementRef},{type:void 0,decorators:[{type:a.Attribute,args:["role"]}]},{type:h.Directionality,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Inject,args:[i.DOCUMENT]}]},{type:p.Platform},{type:void 0,decorators:[{type:a.Inject,args:[r._VIEW_REPEATER_STRATEGY]}]},{type:T,decorators:[{type:a.Inject,args:[b]}]},{type:u.ViewportRuler},{type:void 0,decorators:[{type:a.Optional},{type:a.SkipSelf},{type:a.Inject,args:[q]}]},{type:f.NgZone,decorators:[{type:a.Optional}]}]},propDecorators:{trackBy:[{type:a.Input}],dataSource:[{type:a.Input}],multiTemplateDataRows:[{type:a.Input}],fixedLayout:[{type:a.Input}],contentChanged:[{type:a.Output}],_rowOutlet:[{type:a.ViewChild,args:[z,{static:!0}]}],_headerRowOutlet:[{type:a.ViewChild,args:[Y,{static:!0}]}],_footerRowOutlet:[{type:a.ViewChild,args:[G,{static:!0}]}],_noDataRowOutlet:[{type:a.ViewChild,args:[K,{static:!0}]}],_contentColumnDefs:[{type:a.ContentChildren,args:[k,{descendants:!0}]}],_contentRowDefs:[{type:a.ContentChildren,args:[A,{descendants:!0}]}],_contentHeaderRowDefs:[{type:a.ContentChildren,args:[x,{descendants:!0}]}],_contentFooterRowDefs:[{type:a.ContentChildren,args:[M,{descendants:!0}]}],_noDataRow:[{type:a.ContentChild,args:[B]}]}});class ee{constructor(e,t){this._table=e,this._options=t,this.justify="start",this._options=t||{}}get name(){return this._name}set name(e){this._name=e,this._syncColumnDefName()}ngOnInit(){if(this._syncColumnDefName(),void 0===this.headerText&&(this.headerText=this._createDefaultHeaderText()),this.dataAccessor||(this.dataAccessor=this._options.defaultDataAccessor||((e,t)=>e[t])),this._table)this.columnDef.cell=this.cell,this.columnDef.headerCell=this.headerCell,this._table.addColumnDef(this.columnDef);else if("undefined"==typeof ngDevMode||ngDevMode)throw Error("Text column could not find a parent table for registration.")}ngOnDestroy(){this._table&&this._table.removeColumnDef(this.columnDef)}_createDefaultHeaderText(){const e=this.name;if(!e&&("undefined"==typeof ngDevMode||ngDevMode))throw Error("Table text column must have a name.");return this._options&&this._options.defaultHeaderTextTransform?this._options.defaultHeaderTextTransform(e):e[0].toUpperCase()+e.slice(1)}_syncColumnDefName(){this.columnDef&&(this.columnDef.name=this.name)}}ee.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:ee,deps:[{token:Q,optional:!0},{token:g,optional:!0}],target:f.ɵɵFactoryTarget.Component}),ee.ɵcmp=f.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"15.0.0",type:ee,selector:"cdk-text-column",inputs:{name:"name",headerText:"headerText",dataAccessor:"dataAccessor",justify:"justify"},viewQueries:[{propertyName:"columnDef",first:!0,predicate:k,descendants:!0,static:!0},{propertyName:"cell",first:!0,predicate:_,descendants:!0,static:!0},{propertyName:"headerCell",first:!0,predicate:D,descendants:!0,static:!0}],ngImport:f,template:'\n \n \n {{headerText}}\n \n \n {{dataAccessor(data, name)}}\n \n \n ',isInline:!0,dependencies:[{kind:"directive",type:_,selector:"[cdkCellDef]"},{kind:"directive",type:D,selector:"[cdkHeaderCellDef]"},{kind:"directive",type:k,selector:"[cdkColumnDef]",inputs:["sticky","cdkColumnDef","stickyEnd"]},{kind:"directive",type:I,selector:"cdk-cell, td[cdk-cell]"},{kind:"directive",type:v,selector:"cdk-header-cell, th[cdk-header-cell]"}],changeDetection:f.ChangeDetectionStrategy.Default,encapsulation:f.ViewEncapsulation.None}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:ee,decorators:[{type:a.Component,args:[{selector:"cdk-text-column",template:'\n \n \n {{headerText}}\n \n \n {{dataAccessor(data, name)}}\n \n \n ',encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.Default}]}],ctorParameters:function(){return[{type:Q,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[g]}]}]},propDecorators:{name:[{type:a.Input}],headerText:[{type:a.Input}],dataAccessor:[{type:a.Input}],justify:[{type:a.Input}],columnDef:[{type:a.ViewChild,args:[k,{static:!0}]}],cell:[{type:a.ViewChild,args:[_,{static:!0}]}],headerCell:[{type:a.ViewChild,args:[D,{static:!0}]}]}});const te=[Q,A,_,P,D,w,k,I,j,v,S,H,x,L,M,z,Y,G,ee,B,$,K];class oe{}oe.ɵfac=f.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:oe,deps:[],target:f.ɵɵFactoryTarget.NgModule}),oe.ɵmod=f.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:f,type:oe,declarations:[Q,A,_,P,D,w,k,I,j,v,S,H,x,L,M,z,Y,G,ee,B,$,K],imports:[s.ScrollingModule],exports:[Q,A,_,P,D,w,k,I,j,v,S,H,x,L,M,z,Y,G,ee,B,$,K]}),oe.ɵinj=f.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:oe,imports:[s.ScrollingModule]}),f.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:f,type:oe,decorators:[{type:a.NgModule,args:[{exports:te,declarations:te,imports:[s.ScrollingModule]}]}]}),Object.defineProperty(e,"DataSource",{enumerable:!0,get:function(){return r.DataSource}}),e.BaseCdkCell=R,e.BaseRowDef=V,e.CDK_ROW_TEMPLATE=O,e.CDK_TABLE=y,e.CDK_TABLE_TEMPLATE=J,e.CdkCell=I,e.CdkCellDef=_,e.CdkCellOutlet=P,e.CdkColumnDef=k,e.CdkFooterCell=S,e.CdkFooterCellDef=w,e.CdkFooterRow=L,e.CdkFooterRowDef=M,e.CdkHeaderCell=v,e.CdkHeaderCellDef=D,e.CdkHeaderRow=H,e.CdkHeaderRowDef=x,e.CdkNoDataRow=B,e.CdkRecycleRows=$,e.CdkRow=j,e.CdkRowDef=A,e.CdkTable=Q,e.CdkTableModule=oe,e.CdkTextColumn=ee,e.DataRowOutlet=z,e.FooterRowOutlet=G,e.HeaderRowOutlet=Y,e.NoDataRowOutlet=K,e.STICKY_DIRECTIONS=U,e.STICKY_POSITIONING_LISTENER=q,e.StickyStyler=W,e.TEXT_COLUMN_OPTIONS=g,e._COALESCED_STYLE_SCHEDULER=b,e._CoalescedStyleScheduler=T,e._Schedule=E,e.mixinHasStickyInput=m})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/testing/testing.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/testing/testing.js new file mode 100644 index 000000000..254af56c7 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/testing/testing.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("rxjs")):"function"==typeof define&&define.amd?define(["exports","rxjs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ngCdkTesting={},t.rxjs)}(this,(function(t,e){"use strict";const n=new e.BehaviorSubject({isDisabled:!1});let r;function s(t){t.onDetectChangesNow?.()}function o(t){a(),r=n.subscribe(t)}function a(){r?.unsubscribe(),r=null}async function i(t,e){if(n.getValue().isDisabled)return await t();if(r||o(s),e){await new Promise((t=>n.next({isDisabled:!0,onDetectChangesNow:t})));try{return await t()}finally{await new Promise((t=>n.next({isDisabled:!1,onDetectChangesNow:t})))}}else{n.next({isDisabled:!0});try{return await t()}finally{n.next({isDisabled:!1})}}}async function l(t){return i((()=>Promise.all(t())),!0)}class c{constructor(t){this.locatorFactory=t}async host(){return this.locatorFactory.rootElement}documentRootLocatorFactory(){return this.locatorFactory.documentRootLocatorFactory()}locatorFor(...t){return this.locatorFactory.locatorFor(...t)}locatorForOptional(...t){return this.locatorFactory.locatorForOptional(...t)}locatorForAll(...t){return this.locatorFactory.locatorForAll(...t)}async forceStabilize(){return this.locatorFactory.forceStabilize()}async waitForTasksOutsideAngular(){return this.locatorFactory.waitForTasksOutsideAngular()}}class u{constructor(t,e){this.harnessType=t,this._predicates=[],this._descriptions=[],this._addBaseOptions(e)}static async stringMatches(t,e){return t=await t,null===e?null===t:null!==t&&("string"==typeof e?t===e:e.test(t))}add(t,e){return this._descriptions.push(t),this._predicates.push(e),this}addOption(t,e,n){return void 0!==e&&this.add(`${t} = ${function(t){if(void 0===t)return"undefined";try{return JSON.stringify(t,((t,e)=>e instanceof RegExp?`◬MAT_RE_ESCAPE◬${e.toString().replace(/"/g,"◬MAT_RE_ESCAPE◬")}◬MAT_RE_ESCAPE◬`:e)).replace(/"◬MAT_RE_ESCAPE◬|◬MAT_RE_ESCAPE◬"/g,"").replace(/◬MAT_RE_ESCAPE◬/g,'"')}catch{return"{...}"}}(e)}`,(t=>n(t,e))),this}async filter(t){if(0===t.length)return[];const e=await l((()=>t.map((t=>this.evaluate(t)))));return t.filter(((t,n)=>e[n]))}async evaluate(t){return(await l((()=>this._predicates.map((e=>e(t)))))).reduce(((t,e)=>t&&e),!0)}getDescription(){return this._descriptions.join(", ")}getSelector(){if(!this._ancestor)return(this.harnessType.hostSelector||"").trim();const[t,e]=h(this._ancestor),[n,r]=h(this.harnessType.hostSelector||""),s=[];return t.forEach((t=>{const o=d(t,e);return n.forEach((t=>s.push(`${o} ${d(t,r)}`)))})),s.join(", ")}_addBaseOptions(t){this._ancestor=t.ancestor||"",this._ancestor&&this._descriptions.push(`has ancestor matching selector "${this._ancestor}"`);const e=t.selector;void 0!==e&&this.add(`host matches selector "${e}"`,(async t=>(await t.host()).matchesSelector(e)))}}function h(t){const e=[];return[t.replace(/(["'][^["']*["'])/g,((t,n)=>{const r=`__cdkPlaceholder-${e.length}__`;return e.push(n),r})).split(",").map((t=>t.trim())),e]}function d(t,e){return t.replace(/__cdkPlaceholder-(\d+)__/g,((t,n)=>e[+n]))}async function E(t,e){const n=(await t)[0];if(null==n)throw Error("Failed to find element matching one of the following queries:\n"+e.map((t=>`(${t})`)).join(",\n"));return n}function g(t){return`HarnessLoader for element matching selector: "${t}"`}var m;t.TestKey=void 0,(m=t.TestKey||(t.TestKey={}))[m.BACKSPACE=0]="BACKSPACE",m[m.TAB=1]="TAB",m[m.ENTER=2]="ENTER",m[m.SHIFT=3]="SHIFT",m[m.CONTROL=4]="CONTROL",m[m.ALT=5]="ALT",m[m.ESCAPE=6]="ESCAPE",m[m.PAGE_UP=7]="PAGE_UP",m[m.PAGE_DOWN=8]="PAGE_DOWN",m[m.END=9]="END",m[m.HOME=10]="HOME",m[m.LEFT_ARROW=11]="LEFT_ARROW",m[m.UP_ARROW=12]="UP_ARROW",m[m.RIGHT_ARROW=13]="RIGHT_ARROW",m[m.DOWN_ARROW=14]="DOWN_ARROW",m[m.INSERT=15]="INSERT",m[m.DELETE=16]="DELETE",m[m.F1=17]="F1",m[m.F2=18]="F2",m[m.F3=19]="F3",m[m.F4=20]="F4",m[m.F5=21]="F5",m[m.F6=22]="F6",m[m.F7=23]="F7",m[m.F8=24]="F8",m[m.F9=25]="F9",m[m.F10=26]="F10",m[m.F11=27]="F11",m[m.F12=28]="F12",m[m.META=29]="META",t.ComponentHarness=c,t.ContentContainerComponentHarness=class extends c{async getChildLoader(t){return(await this.getRootHarnessLoader()).getChildLoader(t)}async getAllChildLoaders(t){return(await this.getRootHarnessLoader()).getAllChildLoaders(t)}async getHarness(t){return(await this.getRootHarnessLoader()).getHarness(t)}async getHarnessOrNull(t){return(await this.getRootHarnessLoader()).getHarnessOrNull(t)}async getAllHarnesses(t){return(await this.getRootHarnessLoader()).getAllHarnesses(t)}async hasHarness(t){return(await this.getRootHarnessLoader()).hasHarness(t)}async getRootHarnessLoader(){return this.locatorFactory.rootHarnessLoader()}},t.HarnessEnvironment=class{constructor(t){this.rawRootElement=t}get rootElement(){return this._rootElement=this._rootElement||this.createTestElement(this.rawRootElement),this._rootElement}set rootElement(t){this._rootElement=t}documentRootLocatorFactory(){return this.createEnvironment(this.getDocumentRoot())}locatorFor(...t){return()=>E(this._getAllHarnessesAndTestElements(t),function(t){return t.map((t=>"string"==typeof t?`TestElement for element matching selector: "${t}"`:function(t){const e=t instanceof u?t:new u(t,{}),{name:n,hostSelector:r}=e.harnessType,s=`${n} with host element matching selector: "${r}"`,o=e.getDescription();return s+(o?` satisfying the constraints: ${e.getDescription()}`:"")}(t)))}(t))}locatorForOptional(...t){return async()=>(await this._getAllHarnessesAndTestElements(t))[0]||null}locatorForAll(...t){return()=>this._getAllHarnessesAndTestElements(t)}async rootHarnessLoader(){return this}async harnessLoaderFor(t){return this.createEnvironment(await E(this.getAllRawElements(t),[g(t)]))}async harnessLoaderForOptional(t){const e=await this.getAllRawElements(t);return e[0]?this.createEnvironment(e[0]):null}async harnessLoaderForAll(t){return(await this.getAllRawElements(t)).map((t=>this.createEnvironment(t)))}getHarness(t){return this.locatorFor(t)()}getHarnessOrNull(t){return this.locatorForOptional(t)()}getAllHarnesses(t){return this.locatorForAll(t)()}async hasHarness(t){return null!==await this.locatorForOptional(t)()}async getChildLoader(t){return this.createEnvironment(await E(this.getAllRawElements(t),[g(t)]))}async getAllChildLoaders(t){return(await this.getAllRawElements(t)).map((t=>this.createEnvironment(t)))}createComponentHarness(t,e){return new t(this.createEnvironment(e))}async _getAllHarnessesAndTestElements(t){if(!t.length)throw Error("CDK Component harness query must contain at least one element.");const{allQueries:e,harnessQueries:n,elementQueries:r,harnessTypes:s}=function(t){const e=[],n=[],r=[],s=new Set;for(const o of t)if("string"==typeof o)e.push(o),r.push(o);else{const t=o instanceof u?o:new u(o,{});e.push(t),n.push(t),s.add(t.harnessType)}return{allQueries:e,harnessQueries:n,elementQueries:r,harnessTypes:s}}(t),o=await this.getAllRawElements([...r,...n.map((t=>t.getSelector()))].join(",")),a=0===r.length&&1===s.size||0===n.length,i=await l((()=>o.map((async t=>{const n=this.createTestElement(t);return async function(t){let e=!1,n=new Set;const r=[];for(const s of t)s&&(s instanceof c?n.has(s.constructor)||(n.add(s.constructor),r.push(s)):e||(e=!0,r.push(s)));return r}(await l((()=>e.map((e=>this._getQueryResultForElement(e,t,n,a))))))}))));return[].concat(...i)}async _getQueryResultForElement(t,e,n,r=!1){if("string"==typeof t)return r||await n.matchesSelector(t)?n:null;if(r||await n.matchesSelector(t.getSelector())){const n=this.createComponentHarness(t.harnessType,e);return await t.evaluate(n)?n:null}return null}},t.HarnessPredicate=u,t._getTextWithExcludedElements=function(t,e){const n=t.cloneNode(!0),r=n.querySelectorAll(e);for(let t=0;t{"cdk-text-field-autofill-start"!==e.animationName||t.classList.contains(r)?"cdk-text-field-autofill-end"===e.animationName&&t.classList.contains(r)&&(t.classList.remove(r),this._ngZone.run((()=>n.next({target:e.target,isAutofilled:!1})))):(t.classList.add(r),this._ngZone.run((()=>n.next({target:e.target,isAutofilled:!0}))))};return this._ngZone.runOutsideAngular((()=>{t.addEventListener("animationstart",a,h),t.classList.add("cdk-text-field-autofill-monitored")})),this._monitoredElements.set(t,{subject:n,unlisten:()=>{t.removeEventListener("animationstart",a,h)}}),n}stopMonitoring(e){const t=s.coerceElement(e),i=this._monitoredElements.get(t);i&&(i.unlisten(),i.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))}ngOnDestroy(){this._monitoredElements.forEach(((e,t)=>this.stopMonitoring(t)))}}d.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:d,deps:[{token:l.Platform},{token:c.NgZone}],target:c.ɵɵFactoryTarget.Injectable}),d.ɵprov=c.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:d,providedIn:"root"}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:d,decorators:[{type:i.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:l.Platform},{type:c.NgZone}]}});class u{constructor(e,t){this._elementRef=e,this._autofillMonitor=t,this.cdkAutofill=new i.EventEmitter}ngOnInit(){this._autofillMonitor.monitor(this._elementRef).subscribe((e=>this.cdkAutofill.emit(e)))}ngOnDestroy(){this._autofillMonitor.stopMonitoring(this._elementRef)}}u.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:u,deps:[{token:c.ElementRef},{token:d}],target:c.ɵɵFactoryTarget.Directive}),u.ɵdir=c.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:u,selector:"[cdkAutofill]",outputs:{cdkAutofill:"cdkAutofill"},ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:u,decorators:[{type:i.Directive,args:[{selector:"[cdkAutofill]"}]}],ctorParameters:function(){return[{type:c.ElementRef},{type:d}]},propDecorators:{cdkAutofill:[{type:i.Output}]}});class m{constructor(e,t,i,s){this._elementRef=e,this._platform=t,this._ngZone=i,this._destroyed=new o.Subject,this._enabled=!0,this._previousMinRows=-1,this._isViewInited=!1,this._handleFocusEvent=e=>{this._hasFocus="focus"===e.type},this._document=s,this._textareaElement=this._elementRef.nativeElement}get minRows(){return this._minRows}set minRows(e){this._minRows=s.coerceNumberProperty(e),this._setMinHeight()}get maxRows(){return this._maxRows}set maxRows(e){this._maxRows=s.coerceNumberProperty(e),this._setMaxHeight()}get enabled(){return this._enabled}set enabled(e){e=s.coerceBooleanProperty(e),this._enabled!==e&&((this._enabled=e)?this.resizeToFitContent(!0):this.reset())}get placeholder(){return this._textareaElement.placeholder}set placeholder(e){this._cachedPlaceholderHeight=void 0,e?this._textareaElement.setAttribute("placeholder",e):this._textareaElement.removeAttribute("placeholder"),this._cacheTextareaPlaceholderHeight()}_setMinHeight(){const e=this.minRows&&this._cachedLineHeight?this.minRows*this._cachedLineHeight+"px":null;e&&(this._textareaElement.style.minHeight=e)}_setMaxHeight(){const e=this.maxRows&&this._cachedLineHeight?this.maxRows*this._cachedLineHeight+"px":null;e&&(this._textareaElement.style.maxHeight=e)}ngAfterViewInit(){this._platform.isBrowser&&(this._initialHeight=this._textareaElement.style.height,this.resizeToFitContent(),this._ngZone.runOutsideAngular((()=>{const e=this._getWindow();o.fromEvent(e,"resize").pipe(n.auditTime(16),n.takeUntil(this._destroyed)).subscribe((()=>this.resizeToFitContent(!0))),this._textareaElement.addEventListener("focus",this._handleFocusEvent),this._textareaElement.addEventListener("blur",this._handleFocusEvent)})),this._isViewInited=!0,this.resizeToFitContent(!0))}ngOnDestroy(){this._textareaElement.removeEventListener("focus",this._handleFocusEvent),this._textareaElement.removeEventListener("blur",this._handleFocusEvent),this._destroyed.next(),this._destroyed.complete()}_cacheTextareaLineHeight(){if(this._cachedLineHeight)return;let e=this._textareaElement.cloneNode(!1);e.rows=1,e.style.position="absolute",e.style.visibility="hidden",e.style.border="none",e.style.padding="0",e.style.height="",e.style.minHeight="",e.style.maxHeight="",e.style.overflow="hidden",this._textareaElement.parentNode.appendChild(e),this._cachedLineHeight=e.clientHeight,e.remove(),this._setMinHeight(),this._setMaxHeight()}_measureScrollHeight(){const e=this._textareaElement,t=e.style.marginBottom||"",i=this._platform.FIREFOX,s=i&&this._hasFocus,o=i?"cdk-textarea-autosize-measuring-firefox":"cdk-textarea-autosize-measuring";s&&(e.style.marginBottom=`${e.clientHeight}px`),e.classList.add(o);const n=e.scrollHeight-4;return e.classList.remove(o),s&&(e.style.marginBottom=t),n}_cacheTextareaPlaceholderHeight(){if(!this._isViewInited||null!=this._cachedPlaceholderHeight)return;if(!this.placeholder)return void(this._cachedPlaceholderHeight=0);const e=this._textareaElement.value;this._textareaElement.value=this._textareaElement.placeholder,this._cachedPlaceholderHeight=this._measureScrollHeight(),this._textareaElement.value=e}ngDoCheck(){this._platform.isBrowser&&this.resizeToFitContent()}resizeToFitContent(e=!1){if(!this._enabled)return;if(this._cacheTextareaLineHeight(),this._cacheTextareaPlaceholderHeight(),!this._cachedLineHeight)return;const t=this._elementRef.nativeElement,i=t.value;if(!e&&this._minRows===this._previousMinRows&&i===this._previousValue)return;const s=this._measureScrollHeight(),o=Math.max(s,this._cachedPlaceholderHeight||0);t.style.height=`${o}px`,this._ngZone.runOutsideAngular((()=>{"undefined"!=typeof requestAnimationFrame?requestAnimationFrame((()=>this._scrollToCaretPosition(t))):setTimeout((()=>this._scrollToCaretPosition(t)))})),this._previousValue=i,this._previousMinRows=this._minRows}reset(){void 0!==this._initialHeight&&(this._textareaElement.style.height=this._initialHeight)}_noopInputHandler(){}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_scrollToCaretPosition(e){const{selectionStart:t,selectionEnd:i}=e;!this._destroyed.isStopped&&this._hasFocus&&e.setSelectionRange(t,i)}}m.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:m,deps:[{token:c.ElementRef},{token:l.Platform},{token:c.NgZone},{token:r.DOCUMENT,optional:!0}],target:c.ɵɵFactoryTarget.Directive}),m.ɵdir=c.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:m,selector:"textarea[cdkTextareaAutosize]",inputs:{minRows:["cdkAutosizeMinRows","minRows"],maxRows:["cdkAutosizeMaxRows","maxRows"],enabled:["cdkTextareaAutosize","enabled"],placeholder:"placeholder"},host:{attributes:{rows:"1"},listeners:{input:"_noopInputHandler()"},classAttribute:"cdk-textarea-autosize"},exportAs:["cdkTextareaAutosize"],ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:m,decorators:[{type:i.Directive,args:[{selector:"textarea[cdkTextareaAutosize]",exportAs:"cdkTextareaAutosize",host:{class:"cdk-textarea-autosize",rows:"1","(input)":"_noopInputHandler()"}}]}],ctorParameters:function(){return[{type:c.ElementRef},{type:l.Platform},{type:c.NgZone},{type:void 0,decorators:[{type:i.Optional},{type:i.Inject,args:[r.DOCUMENT]}]}]},propDecorators:{minRows:[{type:i.Input,args:["cdkAutosizeMinRows"]}],maxRows:[{type:i.Input,args:["cdkAutosizeMaxRows"]}],enabled:[{type:i.Input,args:["cdkTextareaAutosize"]}],placeholder:[{type:i.Input}]}});class g{}g.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:g,deps:[],target:c.ɵɵFactoryTarget.NgModule}),g.ɵmod=c.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:c,type:g,declarations:[u,m],exports:[u,m]}),g.ɵinj=c.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:g}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:c,type:g,decorators:[{type:i.NgModule,args:[{declarations:[u,m],exports:[u,m]}]}]}),e.AutofillMonitor=d,e.CdkAutofill=u,e.CdkTextareaAutosize=m,e.TextFieldModule=g})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/tree/tree.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/tree/tree.js new file mode 100644 index 000000000..f6cfbee9a --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/cdk/tree/tree.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/collections"),require("rxjs"),require("rxjs/operators"),require("@angular/core"),require("@angular/cdk/coercion"),require("@angular/cdk/bidi")):"function"==typeof define&&define.amd?define(["exports","@angular/cdk/collections","rxjs","rxjs/operators","@angular/core","@angular/cdk/coercion","@angular/cdk/bidi"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCdkTree={},e.ngCdkCollections,e.rxjs,e.rxjsOperators,e.ngCore,e.ngCdkCoercion,e.ngCdkBidi)}(this,(function(e,t,r,n,s,i,o){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var d=a(s),c=a(o);class l{constructor(){this.expansionModel=new t.SelectionModel(!0)}toggle(e){this.expansionModel.toggle(this._trackByValue(e))}expand(e){this.expansionModel.select(this._trackByValue(e))}collapse(e){this.expansionModel.deselect(this._trackByValue(e))}isExpanded(e){return this.expansionModel.isSelected(this._trackByValue(e))}toggleDescendants(e){this.expansionModel.isSelected(this._trackByValue(e))?this.collapseDescendants(e):this.expandDescendants(e)}collapseAll(){this.expansionModel.clear()}expandDescendants(e){let t=[e];t.push(...this.getDescendants(e)),this.expansionModel.select(...t.map((e=>this._trackByValue(e))))}collapseDescendants(e){let t=[e];t.push(...this.getDescendants(e)),this.expansionModel.deselect(...t.map((e=>this._trackByValue(e))))}_trackByValue(e){return this.trackBy?this.trackBy(e):e}}const h=new s.InjectionToken("CDK_TREE_NODE_OUTLET_NODE");class p{constructor(e,t){this.viewContainer=e,this._node=t}}p.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:p,deps:[{token:d.ViewContainerRef},{token:h,optional:!0}],target:d.ɵɵFactoryTarget.Directive}),p.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:p,selector:"[cdkTreeNodeOutlet]",ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:p,decorators:[{type:s.Directive,args:[{selector:"[cdkTreeNodeOutlet]"}]}],ctorParameters:function(){return[{type:d.ViewContainerRef},{type:void 0,decorators:[{type:s.Inject,args:[h]},{type:s.Optional}]}]}});class u{constructor(e){this.$implicit=e}}class g{constructor(e){this.template=e}}function f(){return Error("A valid data source must be provided.")}function _(){return Error("There can only be one default row without a when predicate function.")}function y(){return Error("Could not find a matching node definition for the provided node data.")}function v(){return Error("Could not find a tree control for the tree.")}function D(){return Error("Could not find functions for nested/flat tree in tree control.")}g.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:g,deps:[{token:d.TemplateRef}],target:d.ɵɵFactoryTarget.Directive}),g.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:g,selector:"[cdkTreeNodeDef]",inputs:{when:["cdkTreeNodeDefWhen","when"]},ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:g,decorators:[{type:s.Directive,args:[{selector:"[cdkTreeNodeDef]",inputs:["when: cdkTreeNodeDefWhen"]}]}],ctorParameters:function(){return[{type:d.TemplateRef}]}});class m{constructor(e,t){this._differs=e,this._changeDetectorRef=t,this._onDestroy=new r.Subject,this._levels=new Map,this.viewChange=new r.BehaviorSubject({start:0,end:Number.MAX_VALUE})}get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&this._switchDataSource(e)}ngOnInit(){if(this._dataDiffer=this._differs.find([]).create(this.trackBy),!this.treeControl&&("undefined"==typeof ngDevMode||ngDevMode))throw v()}ngOnDestroy(){this._nodeOutlet.viewContainer.clear(),this.viewChange.complete(),this._onDestroy.next(),this._onDestroy.complete(),this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null)}ngAfterContentChecked(){const e=this._nodeDefs.filter((e=>!e.when));if(e.length>1&&("undefined"==typeof ngDevMode||ngDevMode))throw _();this._defaultNodeDef=e[0],this.dataSource&&this._nodeDefs&&!this._dataSubscription&&this._observeRenderChanges()}_switchDataSource(e){this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null),e||this._nodeOutlet.viewContainer.clear(),this._dataSource=e,this._nodeDefs&&this._observeRenderChanges()}_observeRenderChanges(){let e;if(t.isDataSource(this._dataSource)?e=this._dataSource.connect(this):r.isObservable(this._dataSource)?e=this._dataSource:Array.isArray(this._dataSource)&&(e=r.of(this._dataSource)),e)this._dataSubscription=e.pipe(n.takeUntil(this._onDestroy)).subscribe((e=>this.renderNodeChanges(e)));else if("undefined"==typeof ngDevMode||ngDevMode)throw f()}renderNodeChanges(e,t=this._dataDiffer,r=this._nodeOutlet.viewContainer,n){const s=t.diff(e);s&&(s.forEachOperation(((t,s,i)=>{if(null==t.previousIndex)this.insertNode(e[i],i,r,n);else if(null==i)r.remove(s),this._levels.delete(t.item);else{const e=r.get(s);r.move(e,i)}})),this._changeDetectorRef.detectChanges())}_getNodeDef(e,t){if(1===this._nodeDefs.length)return this._nodeDefs.first;const r=this._nodeDefs.find((r=>r.when&&r.when(t,e)))||this._defaultNodeDef;if(!r&&("undefined"==typeof ngDevMode||ngDevMode))throw y();return r}insertNode(e,t,r,n){const s=this._getNodeDef(e,t),i=new u(e);this.treeControl.getLevel?i.level=this.treeControl.getLevel(e):void 0!==n&&this._levels.has(n)?i.level=this._levels.get(n)+1:i.level=0,this._levels.set(e,i.level);(r||this._nodeOutlet.viewContainer).createEmbeddedView(s.template,i,t),k.mostRecentTreeNode&&(k.mostRecentTreeNode.data=e)}}m.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:m,deps:[{token:d.IterableDiffers},{token:d.ChangeDetectorRef}],target:d.ɵɵFactoryTarget.Component}),m.ɵcmp=d.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"15.0.0",type:m,selector:"cdk-tree",inputs:{dataSource:"dataSource",treeControl:"treeControl",trackBy:"trackBy"},host:{attributes:{role:"tree"},classAttribute:"cdk-tree"},queries:[{propertyName:"_nodeDefs",predicate:g,descendants:!0}],viewQueries:[{propertyName:"_nodeOutlet",first:!0,predicate:p,descendants:!0,static:!0}],exportAs:["cdkTree"],ngImport:d,template:"",isInline:!0,dependencies:[{kind:"directive",type:p,selector:"[cdkTreeNodeOutlet]"}],changeDetection:d.ChangeDetectionStrategy.Default,encapsulation:d.ViewEncapsulation.None}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:m,decorators:[{type:s.Component,args:[{selector:"cdk-tree",exportAs:"cdkTree",template:"",host:{class:"cdk-tree",role:"tree"},encapsulation:s.ViewEncapsulation.None,changeDetection:s.ChangeDetectionStrategy.Default}]}],ctorParameters:function(){return[{type:d.IterableDiffers},{type:d.ChangeDetectorRef}]},propDecorators:{dataSource:[{type:s.Input}],treeControl:[{type:s.Input}],trackBy:[{type:s.Input}],_nodeOutlet:[{type:s.ViewChild,args:[p,{static:!0}]}],_nodeDefs:[{type:s.ContentChildren,args:[g,{descendants:!0}]}]}});class k{constructor(e,t){this._elementRef=e,this._tree=t,this._destroyed=new r.Subject,this._dataChanges=new r.Subject,k.mostRecentTreeNode=this,this.role="treeitem"}get role(){return"treeitem"}set role(e){this._elementRef.nativeElement.setAttribute("role",e)}get data(){return this._data}set data(e){e!==this._data&&(this._data=e,this._setRoleFromData(),this._dataChanges.next())}get isExpanded(){return this._tree.treeControl.isExpanded(this._data)}get level(){return this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._data):this._parentNodeAriaLevel}ngOnInit(){this._parentNodeAriaLevel=function(e){let t=e.parentElement;for(;t&&!C(t);)t=t.parentElement;if(t)return t.classList.contains("cdk-nested-tree-node")?i.coerceNumberProperty(t.getAttribute("aria-level")):0;if("undefined"==typeof ngDevMode||ngDevMode)throw Error("Incorrect tree structure containing detached node.");return-1}(this._elementRef.nativeElement),this._elementRef.nativeElement.setAttribute("aria-level",`${this.level+1}`)}ngOnDestroy(){k.mostRecentTreeNode===this&&(k.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}focus(){this._elementRef.nativeElement.focus()}_setRoleFromData(){if(!this._tree.treeControl.isExpandable&&!this._tree.treeControl.getChildren&&("undefined"==typeof ngDevMode||ngDevMode))throw D();this.role="treeitem"}}function C(e){const t=e.classList;return!(!t?.contains("cdk-nested-tree-node")&&!t?.contains("cdk-tree"))}k.mostRecentTreeNode=null,k.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:k,deps:[{token:d.ElementRef},{token:m}],target:d.ɵɵFactoryTarget.Directive}),k.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:k,selector:"cdk-tree-node",inputs:{role:"role"},host:{properties:{"attr.aria-expanded":"isExpanded"},classAttribute:"cdk-tree-node"},exportAs:["cdkTreeNode"],ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:k,decorators:[{type:s.Directive,args:[{selector:"cdk-tree-node",exportAs:"cdkTreeNode",host:{class:"cdk-tree-node","[attr.aria-expanded]":"isExpanded"}}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:m}]},propDecorators:{role:[{type:s.Input}]}});class N extends k{constructor(e,t,r){super(e,t),this._differs=r}ngAfterContentInit(){if(this._dataDiffer=this._differs.find([]).create(this._tree.trackBy),!this._tree.treeControl.getChildren&&("undefined"==typeof ngDevMode||ngDevMode))throw D();const e=this._tree.treeControl.getChildren(this.data);Array.isArray(e)?this.updateChildrenNodes(e):r.isObservable(e)&&e.pipe(n.takeUntil(this._destroyed)).subscribe((e=>this.updateChildrenNodes(e))),this.nodeOutlet.changes.pipe(n.takeUntil(this._destroyed)).subscribe((()=>this.updateChildrenNodes()))}ngOnInit(){super.ngOnInit()}ngOnDestroy(){this._clear(),super.ngOnDestroy()}updateChildrenNodes(e){const t=this._getNodeOutlet();if(e&&(this._children=e),t&&this._children){const e=t.viewContainer;this._tree.renderNodeChanges(this._children,this._dataDiffer,e,this._data)}else this._dataDiffer.diff([])}_clear(){const e=this._getNodeOutlet();e&&(e.viewContainer.clear(),this._dataDiffer.diff([]))}_getNodeOutlet(){const e=this.nodeOutlet;return e&&e.find((e=>!e._node||e._node===this))}}N.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:N,deps:[{token:d.ElementRef},{token:m},{token:d.IterableDiffers}],target:d.ɵɵFactoryTarget.Directive}),N.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:N,selector:"cdk-nested-tree-node",inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},host:{classAttribute:"cdk-nested-tree-node"},providers:[{provide:k,useExisting:N},{provide:h,useExisting:N}],queries:[{propertyName:"nodeOutlet",predicate:p,descendants:!0}],exportAs:["cdkNestedTreeNode"],usesInheritance:!0,ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:N,decorators:[{type:s.Directive,args:[{selector:"cdk-nested-tree-node",exportAs:"cdkNestedTreeNode",inputs:["role","disabled","tabIndex"],providers:[{provide:k,useExisting:N},{provide:h,useExisting:N}],host:{class:"cdk-nested-tree-node"}}]}],ctorParameters:function(){return[{type:d.ElementRef},{type:m},{type:d.IterableDiffers}]},propDecorators:{nodeOutlet:[{type:s.ContentChildren,args:[p,{descendants:!0}]}]}});const b=/([A-Za-z%]+)$/;class T{constructor(e,t,s,i){this._treeNode=e,this._tree=t,this._element=s,this._dir=i,this._destroyed=new r.Subject,this.indentUnits="px",this._indent=40,this._setPadding(),i&&i.change.pipe(n.takeUntil(this._destroyed)).subscribe((()=>this._setPadding(!0))),e._dataChanges.subscribe((()=>this._setPadding()))}get level(){return this._level}set level(e){this._setLevelInput(e)}get indent(){return this._indent}set indent(e){this._setIndentInput(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_paddingIndent(){const e=this._treeNode.data&&this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._treeNode.data):null,t=null==this._level?e:this._level;return"number"==typeof t?`${t*this._indent}${this.indentUnits}`:null}_setPadding(e=!1){const t=this._paddingIndent();if(t!==this._currentPadding||e){const e=this._element.nativeElement,r=this._dir&&"rtl"===this._dir.value?"paddingRight":"paddingLeft",n="paddingLeft"===r?"paddingRight":"paddingLeft";e.style[r]=t||"",e.style[n]="",this._currentPadding=t}}_setLevelInput(e){this._level=i.coerceNumberProperty(e,null),this._setPadding()}_setIndentInput(e){let t=e,r="px";if("string"==typeof e){const n=e.split(b);t=n[0],r=n[1]||r}this.indentUnits=r,this._indent=i.coerceNumberProperty(t),this._setPadding()}}T.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:T,deps:[{token:k},{token:m},{token:d.ElementRef},{token:c.Directionality,optional:!0}],target:d.ɵɵFactoryTarget.Directive}),T.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:T,selector:"[cdkTreeNodePadding]",inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]},ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:T,decorators:[{type:s.Directive,args:[{selector:"[cdkTreeNodePadding]"}]}],ctorParameters:function(){return[{type:k},{type:m},{type:d.ElementRef},{type:c.Directionality,decorators:[{type:s.Optional}]}]},propDecorators:{level:[{type:s.Input,args:["cdkTreeNodePadding"]}],indent:[{type:s.Input,args:["cdkTreeNodePaddingIndent"]}]}});class x{constructor(e,t){this._tree=e,this._treeNode=t,this._recursive=!1}get recursive(){return this._recursive}set recursive(e){this._recursive=i.coerceBooleanProperty(e)}_toggle(e){this.recursive?this._tree.treeControl.toggleDescendants(this._treeNode.data):this._tree.treeControl.toggle(this._treeNode.data),e.stopPropagation()}}x.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:x,deps:[{token:m},{token:k}],target:d.ɵɵFactoryTarget.Directive}),x.ɵdir=d.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.0",type:x,selector:"[cdkTreeNodeToggle]",inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]},host:{listeners:{click:"_toggle($event)"}},ngImport:d}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:x,decorators:[{type:s.Directive,args:[{selector:"[cdkTreeNodeToggle]",host:{"(click)":"_toggle($event)"}}]}],ctorParameters:function(){return[{type:m},{type:k}]},propDecorators:{recursive:[{type:s.Input,args:["cdkTreeNodeToggleRecursive"]}]}});const I=[N,g,T,x,m,k,p];class E{}E.ɵfac=d.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:E,deps:[],target:d.ɵɵFactoryTarget.NgModule}),E.ɵmod=d.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.0",ngImport:d,type:E,declarations:[N,g,T,x,m,k,p],exports:[N,g,T,x,m,k,p]}),E.ɵinj=d.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:E}),d.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.0",ngImport:d,type:E,decorators:[{type:s.NgModule,args:[{exports:I,declarations:I}]}]}),e.BaseTreeControl=l,e.CDK_TREE_NODE_OUTLET_NODE=h,e.CdkNestedTreeNode=N,e.CdkTree=m,e.CdkTreeModule=E,e.CdkTreeNode=k,e.CdkTreeNodeDef=g,e.CdkTreeNodeOutlet=p,e.CdkTreeNodeOutletContext=u,e.CdkTreeNodePadding=T,e.CdkTreeNodeToggle=x,e.FlatTreeControl=class extends l{constructor(e,t,r){super(),this.getLevel=e,this.isExpandable=t,this.options=r,this.options&&(this.trackBy=this.options.trackBy)}getDescendants(e){const t=[];for(let r=this.dataNodes.indexOf(e)+1;rthis._trackByValue(e))))}},e.NestedTreeControl=class extends l{constructor(e,t){super(),this.getChildren=e,this.options=t,this.options&&(this.trackBy=this.options.trackBy)}expandAll(){this.expansionModel.clear();const e=this.dataNodes.reduce(((e,t)=>[...e,...this.getDescendants(t),t]),[]);this.expansionModel.select(...e.map((e=>this._trackByValue(e))))}getDescendants(e){const t=[];return this._getDescendants(t,e),t.splice(1)}_getDescendants(e,t){e.push(t);const s=this.getChildren(t);Array.isArray(s)?s.forEach((t=>this._getDescendants(e,t))):r.isObservable(s)&&s.pipe(n.take(1),n.filter(Boolean)).subscribe((t=>{for(const r of t)this._getDescendants(e,r)}))}},e.getTreeControlFunctionsMissingError=D,e.getTreeControlMissingError=v,e.getTreeMissingMatchingNodeDefError=y,e.getTreeMultipleDefaultNodeDefsError=_,e.getTreeNoValidDataSourceError=f})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/common.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/common.js new file mode 100644 index 000000000..145f2e94b --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/common.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCommon={},e.ngCore)}(this,(function(e,t){"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(t);let i=null;function o(){return i}const a=new t.InjectionToken("DocumentToken");class s{historyGo(e){throw new Error("Not implemented")}}function u(){return t["ɵɵinject"](c)}s.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:s,deps:[],target:n.ɵɵFactoryTarget.Injectable}),s.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:s,providedIn:"platform",useFactory:u}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:s,decorators:[{type:t.Injectable,args:[{providedIn:"platform",useFactory:u}]}]});const l=new t.InjectionToken("Location Initialized");class c extends s{constructor(e){super(),this._doc=e,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return o().getBaseHref(this._doc)}onPopState(e){const t=o().getGlobalEventTarget(this._doc,"window");return t.addEventListener("popstate",e,!1),()=>t.removeEventListener("popstate",e)}onHashChange(e){const t=o().getGlobalEventTarget(this._doc,"window");return t.addEventListener("hashchange",e,!1),()=>t.removeEventListener("hashchange",e)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(e){this.location.pathname=e}pushState(e,t,r){h()?this._history.pushState(e,t,r):this.location.hash=r}replaceState(e,t,r){h()?this._history.replaceState(e,t,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(e=0){this._history.go(e)}getState(){return this._history.state}}function h(){return!!window.history.pushState}function d(){return new c(t["ɵɵinject"](a))}function g(e,t){if(0==e.length)return t;if(0==t.length)return e;let r=0;return e.endsWith("/")&&r++,t.startsWith("/")&&r++,2==r?e+t.substring(1):1==r?e+t:e+"/"+t}function D(e){const t=e.match(/#|\?|$/),r=t&&t.index||e.length,n=r-("/"===e[r-1]?1:0);return e.slice(0,n)+e.slice(r)}function p(e){return e&&"?"!==e[0]?"?"+e:e}c.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:c,deps:[{token:a}],target:n.ɵɵFactoryTarget.Injectable}),c.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:c,providedIn:"platform",useFactory:d}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:c,decorators:[{type:t.Injectable,args:[{providedIn:"platform",useFactory:d}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:t.Inject,args:[a]}]}]}});class m{historyGo(e){throw new Error("Not implemented")}}m.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:m,deps:[],target:n.ɵɵFactoryTarget.Injectable}),m.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:m,providedIn:"root",useFactory:()=>t.inject(y)}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:m,decorators:[{type:t.Injectable,args:[{providedIn:"root",useFactory:()=>t.inject(y)}]}]});const f=new t.InjectionToken("appBaseHref");class y extends m{constructor(e,r){super(),this._platformLocation=e,this._removeListenerFns=[],this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??t.inject(a).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return g(this._baseHref,e)}path(e=!1){const t=this._platformLocation.pathname+p(this._platformLocation.search),r=this._platformLocation.hash;return r&&e?`${t}${r}`:t}pushState(e,t,r,n){const i=this.prepareExternalUrl(r+p(n));this._platformLocation.pushState(e,t,i)}replaceState(e,t,r,n){const i=this.prepareExternalUrl(r+p(n));this._platformLocation.replaceState(e,t,i)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(e=0){this._platformLocation.historyGo?.(e)}}y.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:y,deps:[{token:s},{token:f,optional:!0}],target:n.ɵɵFactoryTarget.Injectable}),y.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:y,providedIn:"root"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:y,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[{type:s},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[f]}]}]}});class F extends m{constructor(e,t){super(),this._platformLocation=e,this._baseHref="",this._removeListenerFns=[],null!=t&&(this._baseHref=t)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}path(e=!1){let t=this._platformLocation.hash;return null==t&&(t="#"),t.length>0?t.substring(1):t}prepareExternalUrl(e){const t=g(this._baseHref,e);return t.length>0?"#"+t:t}pushState(e,t,r,n){let i=this.prepareExternalUrl(r+p(n));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(e,t,i)}replaceState(e,t,r,n){let i=this.prepareExternalUrl(r+p(n));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(e,t,i)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(e=0){this._platformLocation.historyGo?.(e)}}F.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:F,deps:[{token:s},{token:f,optional:!0}],target:n.ɵɵFactoryTarget.Injectable}),F.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:F}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:F,decorators:[{type:t.Injectable}],ctorParameters:function(){return[{type:s},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[f]}]}]}});class C{constructor(e){this._subject=new t.EventEmitter,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=e;const r=this._locationStrategy.getBaseHref();this._basePath=function(e){if(new RegExp("^(https?:)?//").test(e)){const[,t]=e.split(/\/\/[^\/]+/);return t}return e}(D(E(r))),this._locationStrategy.onPopState((e=>{this._subject.emit({url:this.path(!0),pop:!0,state:e.state,type:e.type})}))}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(e=!1){return this.normalize(this._locationStrategy.path(e))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(e,t=""){return this.path()==this.normalize(e+p(t))}normalize(e){return C.stripTrailingSlash(function(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._basePath,E(e)))}prepareExternalUrl(e){return e&&"/"!==e[0]&&(e="/"+e),this._locationStrategy.prepareExternalUrl(e)}go(e,t="",r=null){this._locationStrategy.pushState(r,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+p(t)),r)}replaceState(e,t="",r=null){this._locationStrategy.replaceState(r,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+p(t)),r)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(e=0){this._locationStrategy.historyGo?.(e)}onUrlChange(e){return this._urlChangeListeners.push(e),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe((e=>{this._notifyUrlChangeListeners(e.url,e.state)}))),()=>{const t=this._urlChangeListeners.indexOf(e);this._urlChangeListeners.splice(t,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(e="",t){this._urlChangeListeners.forEach((r=>r(e,t)))}subscribe(e,t,r){return this._subject.subscribe({next:e,error:t,complete:r})}}function v(){return new C(t["ɵɵinject"](m))}function E(e){return e.replace(/\/index.html$/,"")}C.normalizeQueryParams=p,C.joinWithSlash=g,C.stripTrailingSlash=D,C.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:C,deps:[{token:m}],target:n.ɵɵFactoryTarget.Injectable}),C.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:C,providedIn:"root",useFactory:v}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:C,decorators:[{type:t.Injectable,args:[{providedIn:"root",useFactory:v}]}],ctorParameters:function(){return[{type:m}]}});const b={ADP:[void 0,void 0,0],AFN:[void 0,"؋",0],ALL:[void 0,void 0,0],AMD:[void 0,"֏",2],AOA:[void 0,"Kz"],ARS:[void 0,"$"],AUD:["A$","$"],AZN:[void 0,"₼"],BAM:[void 0,"KM"],BBD:[void 0,"$"],BDT:[void 0,"৳"],BHD:[void 0,void 0,3],BIF:[void 0,void 0,0],BMD:[void 0,"$"],BND:[void 0,"$"],BOB:[void 0,"Bs"],BRL:["R$"],BSD:[void 0,"$"],BWP:[void 0,"P"],BYN:[void 0,void 0,2],BYR:[void 0,void 0,0],BZD:[void 0,"$"],CAD:["CA$","$",2],CHF:[void 0,void 0,2],CLF:[void 0,void 0,4],CLP:[void 0,"$",0],CNY:["CN¥","¥"],COP:[void 0,"$",2],CRC:[void 0,"₡",2],CUC:[void 0,"$"],CUP:[void 0,"$"],CZK:[void 0,"Kč",2],DJF:[void 0,void 0,0],DKK:[void 0,"kr",2],DOP:[void 0,"$"],EGP:[void 0,"E£"],ESP:[void 0,"₧",0],EUR:["€"],FJD:[void 0,"$"],FKP:[void 0,"£"],GBP:["£"],GEL:[void 0,"₾"],GHS:[void 0,"GH₵"],GIP:[void 0,"£"],GNF:[void 0,"FG",0],GTQ:[void 0,"Q"],GYD:[void 0,"$",2],HKD:["HK$","$"],HNL:[void 0,"L"],HRK:[void 0,"kn"],HUF:[void 0,"Ft",2],IDR:[void 0,"Rp",2],ILS:["₪"],INR:["₹"],IQD:[void 0,void 0,0],IRR:[void 0,void 0,0],ISK:[void 0,"kr",0],ITL:[void 0,void 0,0],JMD:[void 0,"$"],JOD:[void 0,void 0,3],JPY:["¥",void 0,0],KHR:[void 0,"៛"],KMF:[void 0,"CF",0],KPW:[void 0,"₩",0],KRW:["₩",void 0,0],KWD:[void 0,void 0,3],KYD:[void 0,"$"],KZT:[void 0,"₸"],LAK:[void 0,"₭",0],LBP:[void 0,"L£",0],LKR:[void 0,"Rs"],LRD:[void 0,"$"],LTL:[void 0,"Lt"],LUF:[void 0,void 0,0],LVL:[void 0,"Ls"],LYD:[void 0,void 0,3],MGA:[void 0,"Ar",0],MGF:[void 0,void 0,0],MMK:[void 0,"K",0],MNT:[void 0,"₮",2],MRO:[void 0,void 0,0],MUR:[void 0,"Rs",2],MXN:["MX$","$"],MYR:[void 0,"RM"],NAD:[void 0,"$"],NGN:[void 0,"₦"],NIO:[void 0,"C$"],NOK:[void 0,"kr",2],NPR:[void 0,"Rs"],NZD:["NZ$","$"],OMR:[void 0,void 0,3],PHP:["₱"],PKR:[void 0,"Rs",2],PLN:[void 0,"zł"],PYG:[void 0,"₲",0],RON:[void 0,"lei"],RSD:[void 0,void 0,0],RUB:[void 0,"₽"],RWF:[void 0,"RF",0],SBD:[void 0,"$"],SEK:[void 0,"kr",2],SGD:[void 0,"$"],SHP:[void 0,"£"],SLE:[void 0,void 0,2],SLL:[void 0,void 0,0],SOS:[void 0,void 0,0],SRD:[void 0,"$"],SSP:[void 0,"£"],STD:[void 0,void 0,0],STN:[void 0,"Db"],SYP:[void 0,"£",0],THB:[void 0,"฿"],TMM:[void 0,void 0,0],TND:[void 0,void 0,3],TOP:[void 0,"T$"],TRL:[void 0,void 0,0],TRY:[void 0,"₺"],TTD:[void 0,"$"],TWD:["NT$","$",2],TZS:[void 0,void 0,2],UAH:[void 0,"₴"],UGX:[void 0,void 0,0],USD:["$"],UYI:[void 0,void 0,0],UYU:[void 0,"$"],UYW:[void 0,void 0,4],UZS:[void 0,void 0,2],VEF:[void 0,"Bs",2],VND:["₫",void 0,0],VUV:[void 0,void 0,0],XAF:["FCFA",void 0,0],XCD:["EC$","$"],XOF:["F CFA",void 0,0],XPF:["CFPF",void 0,0],XXX:["¤"],YER:[void 0,void 0,0],ZAR:[void 0,"R"],ZMK:[void 0,void 0,0],ZMW:[void 0,"ZK"],ZWD:[void 0,void 0,0]};var w,S,A,_,I,L,B;function T(e){return t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].LocaleId]}function k(e,r,n){const i=t["ɵfindLocaleData"](e),o=H([i[t["ɵLocaleDataIndex"].DayPeriodsFormat],i[t["ɵLocaleDataIndex"].DayPeriodsStandalone]],r);return H(o,n)}function O(e,r,n){const i=t["ɵfindLocaleData"](e),o=H([i[t["ɵLocaleDataIndex"].DaysFormat],i[t["ɵLocaleDataIndex"].DaysStandalone]],r);return H(o,n)}function P(e,r,n){const i=t["ɵfindLocaleData"](e),o=H([i[t["ɵLocaleDataIndex"].MonthsFormat],i[t["ɵLocaleDataIndex"].MonthsStandalone]],r);return H(o,n)}function R(e,r){return H(t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].Eras],r)}function M(e,r){return H(t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].DateFormat],r)}function V(e,r){return H(t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].TimeFormat],r)}function x(e,r){return H(t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].DateTimeFormat],r)}function N(r,n){const i=t["ɵfindLocaleData"](r),o=i[t["ɵLocaleDataIndex"].NumberSymbols][n];if(void 0===o){if(n===e.NumberSymbol.CurrencyDecimal)return i[t["ɵLocaleDataIndex"].NumberSymbols][e.NumberSymbol.Decimal];if(n===e.NumberSymbol.CurrencyGroup)return i[t["ɵLocaleDataIndex"].NumberSymbols][e.NumberSymbol.Group]}return o}function $(e,r){return t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].NumberFormats][r]}e.NumberFormatStyle=void 0,(w=e.NumberFormatStyle||(e.NumberFormatStyle={}))[w.Decimal=0]="Decimal",w[w.Percent=1]="Percent",w[w.Currency=2]="Currency",w[w.Scientific=3]="Scientific",e.Plural=void 0,(S=e.Plural||(e.Plural={}))[S.Zero=0]="Zero",S[S.One=1]="One",S[S.Two=2]="Two",S[S.Few=3]="Few",S[S.Many=4]="Many",S[S.Other=5]="Other",e.FormStyle=void 0,(A=e.FormStyle||(e.FormStyle={}))[A.Format=0]="Format",A[A.Standalone=1]="Standalone",e.TranslationWidth=void 0,(_=e.TranslationWidth||(e.TranslationWidth={}))[_.Narrow=0]="Narrow",_[_.Abbreviated=1]="Abbreviated",_[_.Wide=2]="Wide",_[_.Short=3]="Short",e.FormatWidth=void 0,(I=e.FormatWidth||(e.FormatWidth={}))[I.Short=0]="Short",I[I.Medium=1]="Medium",I[I.Long=2]="Long",I[I.Full=3]="Full",e.NumberSymbol=void 0,(L=e.NumberSymbol||(e.NumberSymbol={}))[L.Decimal=0]="Decimal",L[L.Group=1]="Group",L[L.List=2]="List",L[L.PercentSign=3]="PercentSign",L[L.PlusSign=4]="PlusSign",L[L.MinusSign=5]="MinusSign",L[L.Exponential=6]="Exponential",L[L.SuperscriptingExponent=7]="SuperscriptingExponent",L[L.PerMille=8]="PerMille",L[L[1/0]=9]="Infinity",L[L.NaN=10]="NaN",L[L.TimeSeparator=11]="TimeSeparator",L[L.CurrencyDecimal=12]="CurrencyDecimal",L[L.CurrencyGroup=13]="CurrencyGroup",e.WeekDay=void 0,(B=e.WeekDay||(e.WeekDay={}))[B.Sunday=0]="Sunday",B[B.Monday=1]="Monday",B[B.Tuesday=2]="Tuesday",B[B.Wednesday=3]="Wednesday",B[B.Thursday=4]="Thursday",B[B.Friday=5]="Friday",B[B.Saturday=6]="Saturday";const j=t["ɵgetLocalePluralCase"];function z(e){if(!e[t["ɵLocaleDataIndex"].ExtraData])throw new Error(`Missing extra locale data for the locale "${e[t["ɵLocaleDataIndex"].LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function W(e){const r=t["ɵfindLocaleData"](e);z(r);return(r[t["ɵLocaleDataIndex"].ExtraData][2]||[]).map((e=>"string"==typeof e?G(e):[G(e[0]),G(e[1])]))}function U(e,r,n){const i=t["ɵfindLocaleData"](e);z(i);const o=H([i[t["ɵLocaleDataIndex"].ExtraData][0],i[t["ɵLocaleDataIndex"].ExtraData][1]],r)||[];return H(o,n)||[]}function H(e,t){for(let r=t;r>-1;r--)if(void 0!==e[r])return e[r];throw new Error("Locale data API: locale data undefined")}function G(e){const[t,r]=e.split(":");return{hours:+t,minutes:+r}}function Y(e,r,n="en"){const i=function(e){return t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].Currencies]}(n)[e]||b[e]||[],o=i[1];return"narrow"===r&&"string"==typeof o?o:i[0]||e}function K(e){let t;const r=b[e];return r&&(t=r[2]),"number"==typeof t?t:2}const Z=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,X={},q=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var J,Q,ee;function te(t,r,n,i){let o=function(e){if(De(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){const[t,r=1,n=1]=e.split("-").map((e=>+e));return re(t,r-1,n)}const t=parseFloat(e);if(!isNaN(e-t))return new Date(t);let r;if(r=e.match(Z))return function(e){const t=new Date(0);let r=0,n=0;const i=e[8]?t.setUTCFullYear:t.setFullYear,o=e[8]?t.setUTCHours:t.setHours;e[9]&&(r=Number(e[9]+e[10]),n=Number(e[9]+e[11]));i.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const a=Number(e[4]||0)-r,s=Number(e[5]||0)-n,u=Number(e[6]||0),l=Math.floor(1e3*parseFloat("0."+(e[7]||0)));return o.call(t,a,s,u,l),t}(r)}const t=new Date(e);if(!De(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(t);r=ne(n,r)||r;let a,s=[];for(;r;){if(a=q.exec(r),!a){s.push(r);break}{s=s.concat(a.slice(1));const e=s.pop();if(!e)break;r=e}}let u=o.getTimezoneOffset();i&&(u=ge(i,u),o=function(e,t,r){const n=r?-1:1,i=e.getTimezoneOffset(),o=ge(t,i);return function(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,n*(o-i))}(o,i,!0));let l="";return s.forEach((t=>{const r=function(t){if(de[t])return de[t];let r;switch(t){case"G":case"GG":case"GGG":r=se(ee.Eras,e.TranslationWidth.Abbreviated);break;case"GGGG":r=se(ee.Eras,e.TranslationWidth.Wide);break;case"GGGGG":r=se(ee.Eras,e.TranslationWidth.Narrow);break;case"y":r=ae(Q.FullYear,1,0,!1,!0);break;case"yy":r=ae(Q.FullYear,2,0,!0,!0);break;case"yyy":r=ae(Q.FullYear,3,0,!1,!0);break;case"yyyy":r=ae(Q.FullYear,4,0,!1,!0);break;case"Y":r=he(1);break;case"YY":r=he(2,!0);break;case"YYY":r=he(3);break;case"YYYY":r=he(4);break;case"M":case"L":r=ae(Q.Month,1,1);break;case"MM":case"LL":r=ae(Q.Month,2,1);break;case"MMM":r=se(ee.Months,e.TranslationWidth.Abbreviated);break;case"MMMM":r=se(ee.Months,e.TranslationWidth.Wide);break;case"MMMMM":r=se(ee.Months,e.TranslationWidth.Narrow);break;case"LLL":r=se(ee.Months,e.TranslationWidth.Abbreviated,e.FormStyle.Standalone);break;case"LLLL":r=se(ee.Months,e.TranslationWidth.Wide,e.FormStyle.Standalone);break;case"LLLLL":r=se(ee.Months,e.TranslationWidth.Narrow,e.FormStyle.Standalone);break;case"w":r=ce(1);break;case"ww":r=ce(2);break;case"W":r=ce(1,!0);break;case"d":r=ae(Q.Date,1);break;case"dd":r=ae(Q.Date,2);break;case"c":case"cc":r=ae(Q.Day,1);break;case"ccc":r=se(ee.Days,e.TranslationWidth.Abbreviated,e.FormStyle.Standalone);break;case"cccc":r=se(ee.Days,e.TranslationWidth.Wide,e.FormStyle.Standalone);break;case"ccccc":r=se(ee.Days,e.TranslationWidth.Narrow,e.FormStyle.Standalone);break;case"cccccc":r=se(ee.Days,e.TranslationWidth.Short,e.FormStyle.Standalone);break;case"E":case"EE":case"EEE":r=se(ee.Days,e.TranslationWidth.Abbreviated);break;case"EEEE":r=se(ee.Days,e.TranslationWidth.Wide);break;case"EEEEE":r=se(ee.Days,e.TranslationWidth.Narrow);break;case"EEEEEE":r=se(ee.Days,e.TranslationWidth.Short);break;case"a":case"aa":case"aaa":r=se(ee.DayPeriods,e.TranslationWidth.Abbreviated);break;case"aaaa":r=se(ee.DayPeriods,e.TranslationWidth.Wide);break;case"aaaaa":r=se(ee.DayPeriods,e.TranslationWidth.Narrow);break;case"b":case"bb":case"bbb":r=se(ee.DayPeriods,e.TranslationWidth.Abbreviated,e.FormStyle.Standalone,!0);break;case"bbbb":r=se(ee.DayPeriods,e.TranslationWidth.Wide,e.FormStyle.Standalone,!0);break;case"bbbbb":r=se(ee.DayPeriods,e.TranslationWidth.Narrow,e.FormStyle.Standalone,!0);break;case"B":case"BB":case"BBB":r=se(ee.DayPeriods,e.TranslationWidth.Abbreviated,e.FormStyle.Format,!0);break;case"BBBB":r=se(ee.DayPeriods,e.TranslationWidth.Wide,e.FormStyle.Format,!0);break;case"BBBBB":r=se(ee.DayPeriods,e.TranslationWidth.Narrow,e.FormStyle.Format,!0);break;case"h":r=ae(Q.Hours,1,-12);break;case"hh":r=ae(Q.Hours,2,-12);break;case"H":r=ae(Q.Hours,1);break;case"HH":r=ae(Q.Hours,2);break;case"m":r=ae(Q.Minutes,1);break;case"mm":r=ae(Q.Minutes,2);break;case"s":r=ae(Q.Seconds,1);break;case"ss":r=ae(Q.Seconds,2);break;case"S":r=ae(Q.FractionalSeconds,1);break;case"SS":r=ae(Q.FractionalSeconds,2);break;case"SSS":r=ae(Q.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":r=ue(J.Short);break;case"ZZZZZ":r=ue(J.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":r=ue(J.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":r=ue(J.Long);break;default:return null}return de[t]=r,r}(t);l+=r?r(o,n,u):"''"===t?"'":t.replace(/(^'|'$)/g,"").replace(/''/g,"'")})),l}function re(e,t,r){const n=new Date(0);return n.setFullYear(e,t,r),n.setHours(0,0,0),n}function ne(t,r){const n=T(t);if(X[n]=X[n]||{},X[n][r])return X[n][r];let i="";switch(r){case"shortDate":i=M(t,e.FormatWidth.Short);break;case"mediumDate":i=M(t,e.FormatWidth.Medium);break;case"longDate":i=M(t,e.FormatWidth.Long);break;case"fullDate":i=M(t,e.FormatWidth.Full);break;case"shortTime":i=V(t,e.FormatWidth.Short);break;case"mediumTime":i=V(t,e.FormatWidth.Medium);break;case"longTime":i=V(t,e.FormatWidth.Long);break;case"fullTime":i=V(t,e.FormatWidth.Full);break;case"short":const r=ne(t,"shortTime"),n=ne(t,"shortDate");i=ie(x(t,e.FormatWidth.Short),[r,n]);break;case"medium":const o=ne(t,"mediumTime"),a=ne(t,"mediumDate");i=ie(x(t,e.FormatWidth.Medium),[o,a]);break;case"long":const s=ne(t,"longTime"),u=ne(t,"longDate");i=ie(x(t,e.FormatWidth.Long),[s,u]);break;case"full":const l=ne(t,"fullTime"),c=ne(t,"fullDate");i=ie(x(t,e.FormatWidth.Full),[l,c])}return i&&(X[n][r]=i),i}function ie(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,(function(e,r){return null!=t&&r in t?t[r]:e}))),e}function oe(e,t,r="-",n,i){let o="";(e<0||i&&e<=0)&&(i?e=1-e:(e=-e,o=r));let a=String(e);for(;a.length0||u>-n)&&(u+=n),t===Q.Hours)0===u&&-12===n&&(u=12);else if(t===Q.FractionalSeconds)return l=r,oe(u,3).substring(0,l);var l;const c=N(s,e.NumberSymbol.MinusSign);return oe(u,r,c,i,o)}}function se(t,r,n=e.FormStyle.Format,i=!1){return function(e,o){return function(e,t,r,n,i,o){switch(r){case ee.Months:return P(t,i,n)[e.getMonth()];case ee.Days:return O(t,i,n)[e.getDay()];case ee.DayPeriods:const a=e.getHours(),s=e.getMinutes();if(o){const e=W(t),r=U(t,i,n),o=e.findIndex((e=>{if(Array.isArray(e)){const[t,r]=e,n=a>=t.hours&&s>=t.minutes,i=a0?Math.floor(o/60):Math.ceil(o/60);switch(t){case J.Short:return(o>=0?"+":"")+oe(s,2,a)+oe(Math.abs(o%60),2,a);case J.ShortGMT:return"GMT"+(o>=0?"+":"")+oe(s,1,a);case J.Long:return"GMT"+(o>=0?"+":"")+oe(s,2,a)+":"+oe(Math.abs(o%60),2,a);case J.Extended:return 0===i?"Z":(o>=0?"+":"")+oe(s,2,a)+":"+oe(Math.abs(o%60),2,a);default:throw new Error(`Unknown zone width "${t}"`)}}}!function(e){e[e.Short=0]="Short",e[e.ShortGMT=1]="ShortGMT",e[e.Long=2]="Long",e[e.Extended=3]="Extended"}(J||(J={})),function(e){e[e.FullYear=0]="FullYear",e[e.Month=1]="Month",e[e.Date=2]="Date",e[e.Hours=3]="Hours",e[e.Minutes=4]="Minutes",e[e.Seconds=5]="Seconds",e[e.FractionalSeconds=6]="FractionalSeconds",e[e.Day=7]="Day"}(Q||(Q={})),function(e){e[e.DayPeriods=0]="DayPeriods",e[e.Days=1]="Days",e[e.Months=2]="Months",e[e.Eras=3]="Eras"}(ee||(ee={}));function le(e){return re(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function ce(t,r=!1){return function(n,i){let o;if(r){const e=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,t=n.getDate();o=1+Math.floor((t+e)/7)}else{const e=le(n),t=function(e){const t=re(e,0,1).getDay();return re(e,0,1+(t<=4?4:11)-t)}(e.getFullYear()),r=e.getTime()-t.getTime();o=1+Math.round(r/6048e5)}return oe(o,t,N(i,e.NumberSymbol.MinusSign))}}function he(t,r=!1){return function(n,i){return oe(le(n).getFullYear(),t,N(i,e.NumberSymbol.MinusSign),r)}}const de={};function ge(e,t){e=e.replace(/:/g,"");const r=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(r)?t:r}function De(e){return e instanceof Date&&!isNaN(e.valueOf())}const pe=/^(\d+)?\.((\d+)(-(\d+))?)?$/,me=".",fe="0";function ye(t,r,n,i,o,a,s=!1){let u="",l=!1;if(isFinite(t)){let c=function(e){let t,r,n,i,o,a=Math.abs(e)+"",s=0;(r=a.indexOf(me))>-1&&(a=a.replace(me,""));(n=a.search(/e/i))>0?(r<0&&(r=n),r+=+a.slice(n+1),a=a.substring(0,n)):r<0&&(r=a.length);for(n=0;a.charAt(n)===fe;n++);if(n===(o=a.length))t=[0],r=1;else{for(o--;a.charAt(o)===fe;)o--;for(r-=n,t=[],i=0;n<=o;n++,i++)t[i]=Number(a.charAt(n))}r>22&&(t=t.splice(0,21),s=r-1,r=1);return{digits:t,exponent:s,integerLen:r}}(t);s&&(c=function(e){if(0===e.digits[0])return e;const t=e.digits.length-e.integerLen;e.exponent?e.exponent+=2:(0===t?e.digits.push(0,0):1===t&&e.digits.push(0),e.integerLen+=2);return e}(c));let h=r.minInt,d=r.minFrac,g=r.maxFrac;if(a){const e=a.match(pe);if(null===e)throw new Error(`${a} is not a valid digit info`);const t=e[1],r=e[3],n=e[5];null!=t&&(h=be(t)),null!=r&&(d=be(r)),null!=n?g=be(n):null!=r&&d>g&&(g=d)}!function(e,t,r){if(t>r)throw new Error(`The minimum number of digits after fraction (${t}) is higher than the maximum (${r}).`);let n=e.digits,i=n.length-e.integerLen;const o=Math.min(Math.max(t,i),r);let a=o+e.integerLen,s=n[a];if(a>0){n.splice(Math.max(e.integerLen,a));for(let e=a;e=5)if(a-1<0){for(let t=0;t>a;t--)n.unshift(0),e.integerLen++;n.unshift(1),e.integerLen++}else n[a-1]++;for(;i=l?n.pop():u=!1),t>=10?1:0}),0);c&&(n.unshift(c),e.integerLen++)}(c,d,g);let D=c.digits,p=c.integerLen;const m=c.exponent;let f=[];for(l=D.every((e=>!e));p0?f=D.splice(p,D.length):(f=D,D=[0]);const y=[];for(D.length>=r.lgSize&&y.unshift(D.splice(-r.lgSize,D.length).join(""));D.length>r.gSize;)y.unshift(D.splice(-r.gSize,D.length).join(""));D.length&&y.unshift(D.join("")),u=y.join(N(n,i)),f.length&&(u+=N(n,o)+f.join("")),m&&(u+=N(n,e.NumberSymbol.Exponential)+"+"+m)}else u=N(n,e.NumberSymbol.Infinity);return u=t<0&&!l?r.negPre+u+r.negSuf:r.posPre+u+r.posSuf,u}function Fe(t,r,n,i,o){const a=Ee($(r,e.NumberFormatStyle.Currency),N(r,e.NumberSymbol.MinusSign));a.minFrac=K(i),a.maxFrac=a.minFrac;return ye(t,a,r,e.NumberSymbol.CurrencyGroup,e.NumberSymbol.CurrencyDecimal,o).replace("¤",n).replace("¤","").trim()}function Ce(t,r,n){return ye(t,Ee($(r,e.NumberFormatStyle.Percent),N(r,e.NumberSymbol.MinusSign)),r,e.NumberSymbol.Group,e.NumberSymbol.Decimal,n,!0).replace(new RegExp("%","g"),N(r,e.NumberSymbol.PercentSign))}function ve(t,r,n){return ye(t,Ee($(r,e.NumberFormatStyle.Decimal),N(r,e.NumberSymbol.MinusSign)),r,e.NumberSymbol.Group,e.NumberSymbol.Decimal,n)}function Ee(e,t="-"){const r={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},n=e.split(";"),i=n[0],o=n[1],a=-1!==i.indexOf(me)?i.split(me):[i.substring(0,i.lastIndexOf(fe)+1),i.substring(i.lastIndexOf(fe)+1)],s=a[0],u=a[1]||"";r.posPre=s.substring(0,s.indexOf("#"));for(let e=0;e-1)return i;if(i=r.getPluralCategory(e,n),t.indexOf(i)>-1)return i;if(t.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${e}"`)}we.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:we,deps:[],target:n.ɵɵFactoryTarget.Injectable}),we.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:we,providedIn:"root",useFactory:e=>new Ae(e),deps:[{token:t.LOCALE_ID}]}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:we,decorators:[{type:t.Injectable,args:[{providedIn:"root",useFactory:e=>new Ae(e),deps:[t.LOCALE_ID]}]}]});class Ae extends we{constructor(e){super(),this.locale=e}getPluralCategory(t,r){switch(j(r||this.locale)(t)){case e.Plural.Zero:return"zero";case e.Plural.One:return"one";case e.Plural.Two:return"two";case e.Plural.Few:return"few";case e.Plural.Many:return"many";default:return"other"}}}Ae.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ae,deps:[{token:t.LOCALE_ID}],target:n.ɵɵFactoryTarget.Injectable}),Ae.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ae}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ae,decorators:[{type:t.Injectable}],ctorParameters:function(){return[{type:void 0,decorators:[{type:t.Inject,args:[t.LOCALE_ID]}]}]}});class _e{constructor(e,t,r,n){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=r,this._renderer=n,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(t["ɵisListLikeIterable"](this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){const e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}}_applyKeyValueChanges(e){e.forEachAddedItem((e=>this._toggleClass(e.key,e.currentValue))),e.forEachChangedItem((e=>this._toggleClass(e.key,e.currentValue))),e.forEachRemovedItem((e=>{e.previousValue&&this._toggleClass(e.key,!1)}))}_applyIterableChanges(e){e.forEachAddedItem((e=>{if("string"!=typeof e.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${t["ɵstringify"](e.item)}`);this._toggleClass(e.item,!0)})),e.forEachRemovedItem((e=>this._toggleClass(e.item,!1)))}_applyClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach((e=>this._toggleClass(e,!0))):Object.keys(e).forEach((t=>this._toggleClass(t,!!e[t]))))}_removeClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach((e=>this._toggleClass(e,!1))):Object.keys(e).forEach((e=>this._toggleClass(e,!1))))}_toggleClass(e,t){(e=e.trim())&&e.split(/\s+/g).forEach((e=>{t?this._renderer.addClass(this._ngEl.nativeElement,e):this._renderer.removeClass(this._ngEl.nativeElement,e)}))}}_e.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:_e,deps:[{token:n.IterableDiffers},{token:n.KeyValueDiffers},{token:n.ElementRef},{token:n.Renderer2}],target:n.ɵɵFactoryTarget.Directive}),_e.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.4",type:_e,isStandalone:!0,selector:"[ngClass]",inputs:{klass:["class","klass"],ngClass:"ngClass"},ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:_e,decorators:[{type:t.Directive,args:[{selector:"[ngClass]",standalone:!0}]}],ctorParameters:function(){return[{type:n.IterableDiffers},{type:n.KeyValueDiffers},{type:n.ElementRef},{type:n.Renderer2}]},propDecorators:{klass:[{type:t.Input,args:["class"]}],ngClass:[{type:t.Input,args:["ngClass"]}]}});class Ie{constructor(e){this._viewContainerRef=e,this.ngComponentOutlet=null}ngOnChanges(e){const{_viewContainerRef:r,ngComponentOutletNgModule:n,ngComponentOutletNgModuleFactory:i}=this;if(r.clear(),this._componentRef=void 0,this.ngComponentOutlet){const o=this.ngComponentOutletInjector||r.parentInjector;(e.ngComponentOutletNgModule||e.ngComponentOutletNgModuleFactory)&&(this._moduleRef&&this._moduleRef.destroy(),this._moduleRef=n?t.createNgModule(n,Le(o)):i?i.create(Le(o)):void 0),this._componentRef=r.createComponent(this.ngComponentOutlet,{index:r.length,injector:o,ngModuleRef:this._moduleRef,projectableNodes:this.ngComponentOutletContent})}}ngOnDestroy(){this._moduleRef&&this._moduleRef.destroy()}}function Le(e){return e.get(t.NgModuleRef).injector}Ie.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ie,deps:[{token:n.ViewContainerRef}],target:n.ɵɵFactoryTarget.Directive}),Ie.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.4",type:Ie,isStandalone:!0,selector:"[ngComponentOutlet]",inputs:{ngComponentOutlet:"ngComponentOutlet",ngComponentOutletInjector:"ngComponentOutletInjector",ngComponentOutletContent:"ngComponentOutletContent",ngComponentOutletNgModule:"ngComponentOutletNgModule",ngComponentOutletNgModuleFactory:"ngComponentOutletNgModuleFactory"},usesOnChanges:!0,ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ie,decorators:[{type:t.Directive,args:[{selector:"[ngComponentOutlet]",standalone:!0}]}],ctorParameters:function(){return[{type:n.ViewContainerRef}]},propDecorators:{ngComponentOutlet:[{type:t.Input}],ngComponentOutletInjector:[{type:t.Input}],ngComponentOutletContent:[{type:t.Input}],ngComponentOutletNgModule:[{type:t.Input}],ngComponentOutletNgModuleFactory:[{type:t.Input}]}});const Be="undefined"==typeof ngDevMode||!!ngDevMode;class Te{constructor(e,t,r,n){this.$implicit=e,this.ngForOf=t,this.index=r,this.count=n}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}class ke{constructor(e,t,r){this._viewContainer=e,this._template=t,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){Be&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn(`trackBy must be a function, but received ${JSON.stringify(e)}. See https://angular.io/api/common/NgForOf#change-propagation for more information.`),this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const r=this._ngForOf;if(!this._differ&&r)if(Be)try{this._differ=this._differs.find(r).create(this.ngForTrackBy)}catch{let n=`Cannot find a differ supporting object '${r}' of type '${e=r,e.name||typeof e}'. NgFor only supports binding to Iterables, such as Arrays.`;throw"object"==typeof r&&(n+=" Did you mean to use the keyvalue pipe?"),new t["ɵRuntimeError"](-2200,n)}else this._differ=this._differs.find(r).create(this.ngForTrackBy)}var e;if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const t=this._viewContainer;e.forEachOperation(((e,r,n)=>{if(null==e.previousIndex)t.createEmbeddedView(this._template,new Te(e.item,this._ngForOf,-1,-1),null===n?void 0:n);else if(null==n)t.remove(null===r?void 0:r);else if(null!==r){const i=t.get(r);t.move(i,n),Oe(i,e)}}));for(let e=0,r=t.length;e{Oe(t.get(e.currentIndex),e)}))}static ngTemplateContextGuard(e,t){return!0}}function Oe(e,t){e.context.$implicit=t.item}ke.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:ke,deps:[{token:n.ViewContainerRef},{token:n.TemplateRef},{token:n.IterableDiffers}],target:n.ɵɵFactoryTarget.Directive}),ke.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.4",type:ke,isStandalone:!0,selector:"[ngFor][ngForOf]",inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:ke,decorators:[{type:t.Directive,args:[{selector:"[ngFor][ngForOf]",standalone:!0}]}],ctorParameters:function(){return[{type:n.ViewContainerRef},{type:n.TemplateRef},{type:n.IterableDiffers}]},propDecorators:{ngForOf:[{type:t.Input}],ngForTrackBy:[{type:t.Input}],ngForTemplate:[{type:t.Input}]}});class Pe{constructor(e,t){this._viewContainer=e,this._context=new Re,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=t}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){Me("ngIfThen",e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){Me("ngIfElse",e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(e,t){return!0}}Pe.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Pe,deps:[{token:n.ViewContainerRef},{token:n.TemplateRef}],target:n.ɵɵFactoryTarget.Directive}),Pe.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.4",type:Pe,isStandalone:!0,selector:"[ngIf]",inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Pe,decorators:[{type:t.Directive,args:[{selector:"[ngIf]",standalone:!0}]}],ctorParameters:function(){return[{type:n.ViewContainerRef},{type:n.TemplateRef}]},propDecorators:{ngIf:[{type:t.Input}],ngIfThen:[{type:t.Input}],ngIfElse:[{type:t.Input}]}});class Re{constructor(){this.$implicit=null,this.ngIf=null}}function Me(e,r){if(!!(r&&!r.createEmbeddedView))throw new Error(`${e} must be a TemplateRef, but received '${t["ɵstringify"](r)}'.`)}class Ve{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}class xe{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(e){this._ngSwitch=e,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(e)}_matchCase(e){const t=e==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||t,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),t}_updateDefaultCases(e){if(this._defaultViews&&e!==this._defaultUsed){this._defaultUsed=e;for(let t=0;tthis._setStyle(e.key,null))),e.forEachAddedItem((e=>this._setStyle(e.key,e.currentValue))),e.forEachChangedItem((e=>this._setStyle(e.key,e.currentValue)))}}Ue.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ue,deps:[{token:n.ElementRef},{token:n.KeyValueDiffers},{token:n.Renderer2}],target:n.ɵɵFactoryTarget.Directive}),Ue.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.4",type:Ue,isStandalone:!0,selector:"[ngStyle]",inputs:{ngStyle:"ngStyle"},ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ue,decorators:[{type:t.Directive,args:[{selector:"[ngStyle]",standalone:!0}]}],ctorParameters:function(){return[{type:n.ElementRef},{type:n.KeyValueDiffers},{type:n.Renderer2}]},propDecorators:{ngStyle:[{type:t.Input,args:["ngStyle"]}]}});class He{constructor(e){this._viewContainerRef=e,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null,this.ngTemplateOutletInjector=null}ngOnChanges(e){if(e.ngTemplateOutlet||e.ngTemplateOutletInjector){const e=this._viewContainerRef;if(this._viewRef&&e.remove(e.indexOf(this._viewRef)),this.ngTemplateOutlet){const{ngTemplateOutlet:t,ngTemplateOutletContext:r,ngTemplateOutletInjector:n}=this;this._viewRef=e.createEmbeddedView(t,r,n?{injector:n}:void 0)}else this._viewRef=null}else this._viewRef&&e.ngTemplateOutletContext&&this.ngTemplateOutletContext&&(this._viewRef.context=this.ngTemplateOutletContext)}}He.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:He,deps:[{token:n.ViewContainerRef}],target:n.ɵɵFactoryTarget.Directive}),He.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.4",type:He,isStandalone:!0,selector:"[ngTemplateOutlet]",inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},usesOnChanges:!0,ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:He,decorators:[{type:t.Directive,args:[{selector:"[ngTemplateOutlet]",standalone:!0}]}],ctorParameters:function(){return[{type:n.ViewContainerRef}]},propDecorators:{ngTemplateOutletContext:[{type:t.Input}],ngTemplateOutlet:[{type:t.Input}],ngTemplateOutletInjector:[{type:t.Input}]}});const Ge=[_e,Ie,ke,Pe,He,Ue,xe,Ne,$e,ze,We];function Ye(e,r){return new t["ɵRuntimeError"](2100,ngDevMode&&`InvalidPipeArgument: '${r}' for pipe '${t["ɵstringify"](e)}'`)}const Ke=new class{createSubscription(e,t){return e.then(t,(e=>{throw e}))}dispose(e){}},Ze=new class{createSubscription(e,t){return e.subscribe({next:t,error:e=>{throw e}})}dispose(e){e.unsubscribe()}};class Xe{constructor(e){this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null,this._ref=e}ngOnDestroy(){this._subscription&&this._dispose(),this._ref=null}transform(e){return this._obj?e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue:(e&&this._subscribe(e),this._latestValue)}_subscribe(e){this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,(t=>this._updateLatestValue(e,t)))}_selectStrategy(e){if(t["ɵisPromise"](e))return Ke;if(t["ɵisSubscribable"](e))return Ze;throw Ye(Xe,e)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())}}Xe.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Xe,deps:[{token:n.ChangeDetectorRef}],target:n.ɵɵFactoryTarget.Pipe}),Xe.ɵpipe=n.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"15.0.4",ngImport:n,type:Xe,isStandalone:!0,name:"async",pure:!1}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Xe,decorators:[{type:t.Pipe,args:[{name:"async",pure:!1,standalone:!0}]}],ctorParameters:function(){return[{type:n.ChangeDetectorRef}]}});class qe{transform(e){if(null==e)return null;if("string"!=typeof e)throw Ye(qe,e);return e.toLowerCase()}}qe.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:qe,deps:[],target:n.ɵɵFactoryTarget.Pipe}),qe.ɵpipe=n.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"15.0.4",ngImport:n,type:qe,isStandalone:!0,name:"lowercase"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:qe,decorators:[{type:t.Pipe,args:[{name:"lowercase",standalone:!0}]}]});const Je=/(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g;class Qe{transform(e){if(null==e)return null;if("string"!=typeof e)throw Ye(Qe,e);return e.replace(Je,(e=>e[0].toUpperCase()+e.slice(1).toLowerCase()))}}Qe.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Qe,deps:[],target:n.ɵɵFactoryTarget.Pipe}),Qe.ɵpipe=n.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"15.0.4",ngImport:n,type:Qe,isStandalone:!0,name:"titlecase"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Qe,decorators:[{type:t.Pipe,args:[{name:"titlecase",standalone:!0}]}]});class et{transform(e){if(null==e)return null;if("string"!=typeof e)throw Ye(et,e);return e.toUpperCase()}}et.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:et,deps:[],target:n.ɵɵFactoryTarget.Pipe}),et.ɵpipe=n.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"15.0.4",ngImport:n,type:et,isStandalone:!0,name:"uppercase"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:et,decorators:[{type:t.Pipe,args:[{name:"uppercase",standalone:!0}]}]});const tt=new t.InjectionToken("DATE_PIPE_DEFAULT_TIMEZONE"),rt=new t.InjectionToken("DATE_PIPE_DEFAULT_OPTIONS");class nt{constructor(e,t,r){this.locale=e,this.defaultTimezone=t,this.defaultOptions=r}transform(e,t,r,n){if(null==e||""===e||e!=e)return null;try{const i=t??this.defaultOptions?.dateFormat??"mediumDate",o=r??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return te(e,i,n||this.locale,o)}catch(e){throw Ye(nt,e.message)}}}nt.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:nt,deps:[{token:t.LOCALE_ID},{token:tt,optional:!0},{token:rt,optional:!0}],target:n.ɵɵFactoryTarget.Pipe}),nt.ɵpipe=n.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"15.0.4",ngImport:n,type:nt,isStandalone:!0,name:"date"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:nt,decorators:[{type:t.Pipe,args:[{name:"date",pure:!0,standalone:!0}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:t.Inject,args:[t.LOCALE_ID]}]},{type:void 0,decorators:[{type:t.Inject,args:[tt]},{type:t.Optional}]},{type:void 0,decorators:[{type:t.Inject,args:[rt]},{type:t.Optional}]}]}});const it=/#/g;class ot{constructor(e){this._localization=e}transform(e,t,r){if(null==e)return"";if("object"!=typeof t||null===t)throw Ye(ot,t);return t[Se(e,Object.keys(t),this._localization,r)].replace(it,e.toString())}}ot.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:ot,deps:[{token:we}],target:n.ɵɵFactoryTarget.Pipe}),ot.ɵpipe=n.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"15.0.4",ngImport:n,type:ot,isStandalone:!0,name:"i18nPlural"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:ot,decorators:[{type:t.Pipe,args:[{name:"i18nPlural",pure:!0,standalone:!0}]}],ctorParameters:function(){return[{type:we}]}});class at{transform(e,t){if(null==e)return"";if("object"!=typeof t||"string"!=typeof e)throw Ye(at,t);return t.hasOwnProperty(e)?t[e]:t.hasOwnProperty("other")?t.other:""}}at.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:at,deps:[],target:n.ɵɵFactoryTarget.Pipe}),at.ɵpipe=n.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"15.0.4",ngImport:n,type:at,isStandalone:!0,name:"i18nSelect"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:at,decorators:[{type:t.Pipe,args:[{name:"i18nSelect",pure:!0,standalone:!0}]}]});class st{transform(e){return JSON.stringify(e,null,2)}}st.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:st,deps:[],target:n.ɵɵFactoryTarget.Pipe}),st.ɵpipe=n.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"15.0.4",ngImport:n,type:st,isStandalone:!0,name:"json",pure:!1}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:st,decorators:[{type:t.Pipe,args:[{name:"json",pure:!1,standalone:!0}]}]});class ut{constructor(e){this.differs=e,this.keyValues=[],this.compareFn=lt}transform(e,t=lt){if(!e||!(e instanceof Map)&&"object"!=typeof e)return null;this.differ||(this.differ=this.differs.find(e).create());const r=this.differ.diff(e),n=t!==this.compareFn;return r&&(this.keyValues=[],r.forEachItem((e=>{var t,r;this.keyValues.push((t=e.key,r=e.currentValue,{key:t,value:r}))}))),(r||n)&&(this.keyValues.sort(t),this.compareFn=t),this.keyValues}}function lt(e,t){const r=e.key,n=t.key;if(r===n)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(null===r)return 1;if(null===n)return-1;if("string"==typeof r&&"string"==typeof n)return rnew St(t["ɵɵinject"](a),window)});class St{constructor(e,t){this.document=e,this.window=t,this.offset=()=>[0,0]}setOffset(e){Array.isArray(e)?this.offset=()=>e:this.offset=e}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(e){this.supportsScrolling()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(!this.supportsScrolling())return;const t=function(e,t){const r=e.getElementById(t)||e.getElementsByName(t)[0];if(r)return r;if("function"==typeof e.createTreeWalker&&e.body&&(e.body.createShadowRoot||e.body.attachShadow)){const r=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let n=r.currentNode;for(;n;){const e=n.shadowRoot;if(e){const r=e.getElementById(t)||e.querySelector(`[name="${t}"]`);if(r)return r}n=r.nextNode()}}return null}(this.document,e);t&&(this.scrollToElement(t),t.focus())}setHistoryScrollRestoration(e){if(this.supportScrollRestoration()){const t=this.window.history;t&&t.scrollRestoration&&(t.scrollRestoration=e)}}scrollToElement(e){const t=e.getBoundingClientRect(),r=t.left+this.window.pageXOffset,n=t.top+this.window.pageYOffset,i=this.offset();this.window.scrollTo(r-i[0],n-i[1])}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const e=At(this.window.history)||At(Object.getPrototypeOf(this.window.history));return!(!e||!e.writable&&!e.set)}catch{return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch{return!1}}}function At(e){return Object.getOwnPropertyDescriptor(e,"scrollRestoration")}function _t(e,t){return It(e)?new URL(e):new URL(e,t.location.href)}function It(e){return/^https?:\/\//.test(e)}function Lt(e){return It(e)?new URL(e).hostname:e}const Bt=e=>e.src,Tt=new t.InjectionToken("ImageLoader",{providedIn:"root",factory:()=>Bt});function kt(e,r){return function(n){(function(e){if("string"!=typeof e||""===e.trim())return!1;try{return new URL(e),!0}catch{return!1}})(n)||function(e,r){throw new t["ɵRuntimeError"](2959,ngDevMode&&`Image loader has detected an invalid path (\`${e}\`). To fix this, supply a path using one of the following formats: ${r.join(" or ")}`)}(n,r||[]),n=function(e){return e.endsWith("/")?e.slice(0,-1):e}(n);return[{provide:Tt,useValue:r=>{return It(r.src)&&function(e,r){throw new t["ɵRuntimeError"](2959,ngDevMode&&`Image loader has detected a \`\` tag with an invalid \`ngSrc\` attribute: ${r}. This image loader expects \`ngSrc\` to be a relative URL - however the provided value is an absolute URL. To fix this, provide \`ngSrc\` as a path relative to the base URL configured for this loader (\`${e}\`).`)}(n,r.src),e(n,{...r,src:(i=r.src,i.startsWith("/")?i.slice(1):i)});var i}}]}}const Ot=kt((function(e,t){let r="format=auto";t.width&&(r+=`,width=${t.width}`);return`${e}/cdn-cgi/image/${r}/${t.src}`}),ngDevMode?["https:///cdn-cgi/image//"]:void 0);const Pt={name:"Cloudinary",testUrl:function(e){return Rt.test(e)}},Rt=/https?\:\/\/[^\/]+\.cloudinary\.com\/.+/;const Mt=kt((function(e,t){let r="f_auto,q_auto";t.width&&(r+=`,w_${t.width}`);return`${e}/image/upload/${r}/${t.src}`}),ngDevMode?["https://res.cloudinary.com/mysite","https://mysite.cloudinary.com","https://subdomain.mysite.com"]:void 0);const Vt={name:"ImageKit",testUrl:function(e){return xt.test(e)}},xt=/https?\:\/\/[^\/]+\.imagekit\.io\/.+/;const Nt=kt((function(e,t){let r="tr:q-auto";t.width&&(r+=`,w-${t.width}`);return`${e}/${r}/${t.src}`}),ngDevMode?["https://ik.imagekit.io/mysite","https://subdomain.mysite.com"]:void 0);const $t={name:"Imgix",testUrl:function(e){return jt.test(e)}},jt=/https?\:\/\/[^\/]+\.imgix\.net\/.+/;const zt=kt((function(e,t){const r=new URL(`${e}/${t.src}`);r.searchParams.set("auto","format"),t.width&&r.searchParams.set("w",t.width.toString());return r.href}),ngDevMode?["https://somepath.imgix.net/"]:void 0);function Wt(e,t=!0){return`The NgOptimizedImage directive ${t?`(activated on an element with the \`ngSrc="${e}"\`) `:""}has detected that`}function Ut(e){if(!ngDevMode)throw new t["ɵRuntimeError"](2958,`Unexpected invocation of the ${e} in the prod mode. Please make sure that the prod mode is enabled for production builds.`)}class Ht{constructor(){this.images=new Map,this.alreadyWarned=new Set,this.window=null,this.observer=null,Ut("LCP checker");const e=t.inject(a).defaultView;void 0!==e&&"undefined"!=typeof PerformanceObserver&&(this.window=e,this.observer=this.initPerformanceObserver())}initPerformanceObserver(){const e=new PerformanceObserver((e=>{const r=e.getEntries();if(0===r.length)return;const n=r[r.length-1].element?.src??"";if(n.startsWith("data:")||n.startsWith("blob:"))return;this.images.get(n)&&!this.alreadyWarned.has(n)&&(this.alreadyWarned.add(n),function(e){const r=Wt(e);console.warn(t["ɵformatRuntimeError"](2955,`${r} this image is the Largest Contentful Paint (LCP) element but was not marked "priority". This image should be marked "priority" in order to prioritize its loading. To fix this, add the "priority" attribute.`))}(n))}));return e.observe({type:"largest-contentful-paint",buffered:!0}),e}registerImage(e,t){this.observer&&this.images.set(_t(e,this.window).href,t)}unregisterImage(e){this.observer&&this.images.delete(_t(e,this.window).href)}ngOnDestroy(){this.observer&&(this.observer.disconnect(),this.images.clear(),this.alreadyWarned.clear())}}Ht.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ht,deps:[],target:n.ɵɵFactoryTarget.Injectable}),Ht.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ht,providedIn:"root"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Ht,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[]}});const Gt=new Set(["localhost","127.0.0.1","0.0.0.0"]),Yt=new t.InjectionToken("PRECONNECT_CHECK_BLOCKLIST");class Kt{constructor(){this.document=t.inject(a),this.preconnectLinks=null,this.alreadySeen=new Set,this.window=null,this.blocklist=new Set(Gt),Ut("preconnect link checker");const e=this.document.defaultView;void 0!==e&&(this.window=e);const r=t.inject(Yt,{optional:!0});r&&this.populateBlocklist(r)}populateBlocklist(e){Array.isArray(e)?Zt(e,(e=>{this.blocklist.add(Lt(e))})):this.blocklist.add(Lt(e))}assertPreconnect(e,r){if(!this.window)return;const n=_t(e,this.window);this.blocklist.has(n.hostname)||this.alreadySeen.has(n.origin)||(this.alreadySeen.add(n.origin),this.preconnectLinks||(this.preconnectLinks=this.queryPreconnectLinks()),this.preconnectLinks.has(n.origin)||console.warn(t["ɵformatRuntimeError"](2956,`${Wt(r)} there is no preconnect tag present for this image. Preconnecting to the origin(s) that serve priority images ensures that these images are delivered as soon as possible. To fix this, please add the following element into the of the document:\n `)))}queryPreconnectLinks(){const e=new Set,t=Array.from(this.document.querySelectorAll("link[rel=preconnect]"));for(let r of t){const t=_t(r.href,this.window);e.add(t.origin)}return e}ngOnDestroy(){this.preconnectLinks?.clear(),this.alreadySeen.clear()}}function Zt(e,t){for(let r of e)Array.isArray(r)?Zt(r,t):t(r)}Kt.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Kt,deps:[],target:n.ɵɵFactoryTarget.Injectable}),Kt.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Kt,providedIn:"root"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:Kt,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}],ctorParameters:function(){return[]}});const Xt=new t.InjectionToken("NG_OPTIMIZED_PRELOADED_IMAGES",{providedIn:"root",factory:()=>new Set});class qt{constructor(){this.preloadedImages=t.inject(Xt),this.document=t.inject(a)}createPreloadLinkTag(e,r,n,i){if(ngDevMode&&this.preloadedImages.size>=5)throw new t["ɵRuntimeError"](2961,ngDevMode&&'The `NgOptimizedImage` directive has detected that more than 5 images were marked as priority. This might negatively affect an overall performance of the page. To fix this, remove the "priority" attribute from images with less priority.');if(this.preloadedImages.has(r))return;this.preloadedImages.add(r);const o=e.createElement("link");e.setAttribute(o,"as","image"),e.setAttribute(o,"href",r),e.setAttribute(o,"rel","preload"),e.setAttribute(o,"fetchpriority","high"),i&&e.setAttribute(o,"imageSizes",i),n&&e.setAttribute(o,"imageSrcset",n),e.appendChild(this.document.head,o)}}qt.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:qt,deps:[],target:n.ɵɵFactoryTarget.Injectable}),qt.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:qt,providedIn:"root"}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:qt,decorators:[{type:t.Injectable,args:[{providedIn:"root"}]}]});const Jt=/^((\s*\d+w\s*(,|$)){1,})$/,Qt=/^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/,er=[1,2],tr=.1,rr=1e3,nr=[$t,Vt,Pt],ir={breakpoints:[16,32,48,64,96,128,256,384,640,750,828,1080,1200,1920,2048,3840]},or=new t.InjectionToken("ImageConfig",{providedIn:"root",factory:()=>ir});class ar{constructor(){this.imageLoader=t.inject(Tt),this.config=function(e){let t={};e.breakpoints&&(t.breakpoints=e.breakpoints.sort(((e,t)=>e-t)));return Object.assign({},ir,e,t)}(t.inject(or)),this.renderer=t.inject(t.Renderer2),this.imgElement=t.inject(t.ElementRef).nativeElement,this.injector=t.inject(t.Injector),this.isServer=Et(t.inject(t.PLATFORM_ID)),this.preloadLinkChecker=t.inject(qt),this.lcpObserver=ngDevMode?this.injector.get(Ht):null,this._renderedSrc=null,this._priority=!1,this._disableOptimizedSrcset=!1,this._fill=!1}set width(e){ngDevMode&&cr(this,e,"width"),this._width=sr(e)}get width(){return this._width}set height(e){ngDevMode&&cr(this,e,"height"),this._height=sr(e)}get height(){return this._height}set priority(e){this._priority=ur(e)}get priority(){return this._priority}set disableOptimizedSrcset(e){this._disableOptimizedSrcset=ur(e)}get disableOptimizedSrcset(){return this._disableOptimizedSrcset}set fill(e){this._fill=ur(e)}get fill(){return this._fill}ngOnInit(){if(ngDevMode)if(lr(this,"ngSrc",this.ngSrc),function(e,r){if(null==r)return;lr(e,"ngSrcset",r);const n=r,i=Jt.test(n),o=Qt.test(n);o&&function(e,r){if(!r.split(",").every((e=>""===e||parseFloat(e)<=3)))throw new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc)} the \`ngSrcset\` contains an unsupported image density:\`${r}\`. NgOptimizedImage generally recommends a max image density of 2x but supports image densities up to 3x. The human eye cannot distinguish between image densities greater than 2x - which makes them unnecessary for most use cases. Images that will be pinch-zoomed are typically the primary use case for 3x images. Please remove the high density descriptor and try again.`)}(e,n);if(!i&&!o)throw new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc)} \`ngSrcset\` has an invalid value (\`${r}\`). To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`)}(this,this.ngSrcset),function(e){if(e.src)throw new t["ɵRuntimeError"](2950,`${Wt(e.ngSrc)} both \`src\` and \`ngSrc\` have been set. Supplying both of these attributes breaks lazy loading. The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. To fix this, please remove the \`src\` attribute.`)}(this),this.ngSrcset&&function(e){if(e.srcset)throw new t["ɵRuntimeError"](2951,`${Wt(e.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. Supplying both of these attributes breaks lazy loading. The NgOptimizedImage directive sets \`srcset\` itself based on the value of \`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`)}(this),function(e){let r=e.ngSrc.trim();if(r.startsWith("data:"))throw r.length>50&&(r=r.substring(0,50)+"..."),new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc,!1)} \`ngSrc\` is a Base64-encoded string (${r}). NgOptimizedImage does not support Base64-encoded strings. To fix this, disable the NgOptimizedImage directive for this element by removing \`ngSrc\` and using a standard \`src\` attribute instead.`)}(this),function(e){const r=e.ngSrc.trim();if(r.startsWith("blob:"))throw new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc)} \`ngSrc\` was set to a blob URL (${r}). Blob URLs are not supported by the NgOptimizedImage directive. To fix this, disable the NgOptimizedImage directive for this element by removing \`ngSrc\` and using a regular \`src\` attribute instead.`)}(this),this.fill?(function(e){if(e.width||e.height)throw new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc)} the attributes \`height\` and/or \`width\` are present along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing element, the size attributes have no effect and should be removed.`)}(this),function(e,r,n){const i=n.listen(r,"load",(()=>{i();const n=parseFloat(r.clientHeight);e.fill&&0===n&&console.warn(t["ɵformatRuntimeError"](2952,`${Wt(e.ngSrc)} the height of the fill-mode image is zero. This is likely because the containing element does not have the CSS 'position' property set to one of the following: "relative", "fixed", or "absolute". To fix this problem, make sure the container element has the CSS 'position' property defined and the height of the element is not zero.`))}))}(this,this.imgElement,this.renderer)):(function(e){let r=[];void 0===e.width&&r.push("width");void 0===e.height&&r.push("height");if(r.length>0)throw new t["ɵRuntimeError"](2954,`${Wt(e.ngSrc)} these required attributes are missing: ${r.map((e=>`"${e}"`)).join(", ")}. Including "width" and "height" attributes will prevent image-related layout shifts. To fix this, include "width" and "height" attributes on the image tag or turn on "fill" mode with the \`fill\` attribute.`)}(this),function(e,r,n){const i=n.listen(r,"load",(()=>{i();const n=parseFloat(r.clientWidth),o=parseFloat(r.clientHeight),a=n/o,s=0!==n&&0!==o,u=parseFloat(r.naturalWidth),l=parseFloat(r.naturalHeight),c=u/l,h=e.width,d=e.height,g=h/d,D=Math.abs(g-c)>tr,p=s&&Math.abs(c-a)>tr;if(D)console.warn(t["ɵformatRuntimeError"](2952,`${Wt(e.ngSrc)} the aspect ratio of the image does not match the aspect ratio indicated by the width and height attributes. \nIntrinsic image size: ${u}w x ${l}h (aspect-ratio: ${c}). \nSupplied width and height attributes: ${h}w x ${d}h (aspect-ratio: ${g}). \nTo fix this, update the width and height attributes.`));else if(p)console.warn(t["ɵformatRuntimeError"](2952,`${Wt(e.ngSrc)} the aspect ratio of the rendered image does not match the image's intrinsic aspect ratio. \nIntrinsic image size: ${u}w x ${l}h (aspect-ratio: ${c}). \nRendered image size: ${n}w x ${o}h (aspect-ratio: ${a}). \nThis issue can occur if "width" and "height" attributes are added to an image without updating the corresponding image styling. To fix this, adjust image styling. In most cases, adding "height: auto" or "width: auto" to the image styling will fix this issue.`));else if(!e.ngSrcset&&s){const r=2*n,i=2*o,a=l-i>=rr;(u-r>=rr||a)&&console.warn(t["ɵformatRuntimeError"](2960,`${Wt(e.ngSrc)} the intrinsic image is significantly larger than necessary. \nRendered image size: ${n}w x ${o}h. \nIntrinsic image size: ${u}w x ${l}h. \nRecommended intrinsic image size: ${r}w x ${i}h. \nNote: Recommended intrinsic image size is calculated assuming a maximum DPR of 2. To improve loading time, resize the image or consider using the "ngSrcset" and "sizes" attributes.`))}}))}(this,this.imgElement,this.renderer)),function(e){if(e.loading&&e.priority)throw new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc)} the \`loading\` attribute was used on an image that was marked "priority". Setting \`loading\` on priority images is not allowed because these images will always be eagerly loaded. To fix this, remove the “loading” attribute from the priority image.`);const r=["auto","eager","lazy"];if("string"==typeof e.loading&&!r.includes(e.loading))throw new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc)} the \`loading\` attribute has an invalid value (\`${e.loading}\`). To fix this, provide a valid value ("lazy", "eager", or "auto").`)}(this),this.ngSrcset||function(e){if(e.sizes?.match(/((\)|,)\s|^)\d+px/))throw new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc,!1)} \`sizes\` was set to a string including pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`)}(this),function(e,r){if(r===Bt){let r="";for(const t of nr)if(t.testUrl(e)){r=t.name;break}r&&console.warn(t["ɵformatRuntimeError"](2962,`NgOptimizedImage: It looks like your images may be hosted on the ${r} CDN, but your app is not using Angular's built-in loader for that CDN. We recommend switching to use the built-in by calling \`provide${r}Loader()\` in your \`providers\` and passing it your instance's base URL. If you don't want to use the built-in loader, define a custom loader function using IMAGE_LOADER to silence this warning.`))}}(this.ngSrc,this.imageLoader),this.priority){this.injector.get(Kt).assertPreconnect(this.getRewrittenSrc(),this.ngSrc)}else if(null!==this.lcpObserver){this.injector.get(t.NgZone).runOutsideAngular((()=>{this.lcpObserver.registerImage(this.getRewrittenSrc(),this.ngSrc)}))}this.setHostAttributes()}setHostAttributes(){this.fill?this.sizes||(this.sizes="100vw"):(this.setHostAttribute("width",this.width.toString()),this.setHostAttribute("height",this.height.toString())),this.setHostAttribute("loading",this.getLoadingBehavior()),this.setHostAttribute("fetchpriority",this.getFetchPriority());const e=this.getRewrittenSrc();let t;this.setHostAttribute("src",e),this.sizes&&this.setHostAttribute("sizes",this.sizes),this.ngSrcset?t=this.getRewrittenSrcset():this.shouldGenerateAutomaticSrcset()&&(t=this.getAutomaticSrcset()),t&&this.setHostAttribute("srcset",t),this.isServer&&this.priority&&this.preloadLinkChecker.createPreloadLinkTag(this.renderer,e,t,this.sizes)}ngOnChanges(e){ngDevMode&&function(e,r,n){n.forEach((n=>{if(r.hasOwnProperty(n)&&!r[n].isFirstChange())throw"ngSrc"===n&&(e={ngSrc:r[n].previousValue}),function(e,r){let n;n="width"===r||"height"===r?`Changing \`${r}\` may result in different attribute value applied to the underlying image element and cause layout shifts on a page.`:`Changing the \`${r}\` would have no effect on the underlying image element, because the resource loading has already occurred.`;return new t["ɵRuntimeError"](2953,`${Wt(e.ngSrc)} \`${r}\` was updated after initialization. The NgOptimizedImage directive will not react to this input change. ${n} To fix this, either switch \`${r}\` to a static value or wrap the image element in an *ngIf that is gated on the necessary value.`)}(e,n)}))}(this,e,["ngSrc","ngSrcset","width","height","priority","fill","loading","sizes","disableOptimizedSrcset"])}getLoadingBehavior(){return this.priority||void 0===this.loading?this.priority?"eager":"lazy":this.loading}getFetchPriority(){return this.priority?"high":"auto"}getRewrittenSrc(){if(!this._renderedSrc){const e={src:this.ngSrc};this._renderedSrc=this.imageLoader(e)}return this._renderedSrc}getRewrittenSrcset(){const e=Jt.test(this.ngSrcset);return this.ngSrcset.split(",").filter((e=>""!==e)).map((t=>{t=t.trim();const r=e?parseFloat(t):parseFloat(t)*this.width;return`${this.imageLoader({src:this.ngSrc,width:r})} ${t}`})).join(", ")}getAutomaticSrcset(){return this.sizes?this.getResponsiveSrcset():this.getFixedSrcset()}getResponsiveSrcset(){const{breakpoints:e}=this.config;let t=e;"100vw"===this.sizes?.trim()&&(t=e.filter((e=>e>=640)));return t.map((e=>`${this.imageLoader({src:this.ngSrc,width:e})} ${e}w`)).join(", ")}getFixedSrcset(){return er.map((e=>`${this.imageLoader({src:this.ngSrc,width:this.width*e})} ${e}x`)).join(", ")}shouldGenerateAutomaticSrcset(){return!this._disableOptimizedSrcset&&!this.srcset&&this.imageLoader!==Bt&&!(this.width>1920||this.height>1080)}ngOnDestroy(){ngDevMode&&(this.priority||null===this._renderedSrc||null===this.lcpObserver||this.lcpObserver.unregisterImage(this._renderedSrc))}setHostAttribute(e,t){this.renderer.setAttribute(this.imgElement,e,t)}}function sr(e){return"string"==typeof e?parseInt(e,10):e}function ur(e){return null!=e&&"false"!=`${e}`}function lr(e,r,n){const i="string"==typeof n,o=i&&""===n.trim();if(!i||o)throw new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc)} \`${r}\` has an invalid value (\`${n}\`). To fix this, change the value to a non-empty string.`)}function cr(e,r,n){const i="number"==typeof r&&r>0,o="string"==typeof r&&/^\d+$/.test(r.trim())&&parseInt(r)>0;if(!i&&!o)throw new t["ɵRuntimeError"](2952,`${Wt(e.ngSrc)} \`${n}\` has an invalid value (\`${r}\`). To fix this, provide \`${n}\` as a number greater than 0.`)}ar.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:ar,deps:[],target:n.ɵɵFactoryTarget.Directive}),ar.ɵdir=n.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"15.0.4",type:ar,isStandalone:!0,selector:"img[ngSrc]",inputs:{ngSrc:"ngSrc",ngSrcset:"ngSrcset",sizes:"sizes",width:"width",height:"height",loading:"loading",priority:"priority",disableOptimizedSrcset:"disableOptimizedSrcset",fill:"fill",src:"src",srcset:"srcset"},host:{properties:{"style.position":'fill ? "absolute" : null',"style.width":'fill ? "100%" : null',"style.height":'fill ? "100%" : null',"style.inset":'fill ? "0px" : null'}},usesOnChanges:!0,ngImport:n}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:ar,decorators:[{type:t.Directive,args:[{standalone:!0,selector:"img[ngSrc]",host:{"[style.position]":'fill ? "absolute" : null',"[style.width]":'fill ? "100%" : null',"[style.height]":'fill ? "100%" : null',"[style.inset]":'fill ? "0px" : null'}}]}],propDecorators:{ngSrc:[{type:t.Input}],ngSrcset:[{type:t.Input}],sizes:[{type:t.Input}],width:[{type:t.Input}],height:[{type:t.Input}],loading:[{type:t.Input}],priority:[{type:t.Input}],disableOptimizedSrcset:[{type:t.Input}],fill:[{type:t.Input}],src:[{type:t.Input}],srcset:[{type:t.Input}]}}),e.APP_BASE_HREF=f,e.AsyncPipe=Xe,e.CommonModule=ft,e.CurrencyPipe=dt,e.DATE_PIPE_DEFAULT_OPTIONS=rt,e.DATE_PIPE_DEFAULT_TIMEZONE=tt,e.DOCUMENT=a,e.DatePipe=nt,e.DecimalPipe=ct,e.HashLocationStrategy=F,e.I18nPluralPipe=ot,e.I18nSelectPipe=at,e.IMAGE_CONFIG=or,e.IMAGE_LOADER=Tt,e.JsonPipe=st,e.KeyValuePipe=ut,e.LOCATION_INITIALIZED=l,e.Location=C,e.LocationStrategy=m,e.LowerCasePipe=qe,e.NgClass=_e,e.NgComponentOutlet=Ie,e.NgFor=ke,e.NgForOf=ke,e.NgForOfContext=Te,e.NgIf=Pe,e.NgIfContext=Re,e.NgLocaleLocalization=Ae,e.NgLocalization=we,e.NgOptimizedImage=ar,e.NgPlural=ze,e.NgPluralCase=We,e.NgStyle=Ue,e.NgSwitch=xe,e.NgSwitchCase=Ne,e.NgSwitchDefault=$e,e.NgTemplateOutlet=He,e.PRECONNECT_CHECK_BLOCKLIST=Yt,e.PathLocationStrategy=y,e.PercentPipe=ht,e.PlatformLocation=s,e.SlicePipe=pt,e.TitleCasePipe=Qe,e.UpperCasePipe=et,e.VERSION=bt,e.ViewportScroller=wt,e.XhrFactory=class{},e.formatCurrency=Fe,e.formatDate=te,e.formatNumber=ve,e.formatPercent=Ce,e.getCurrencySymbol=Y,e.getLocaleCurrencyCode=function(e){return t["ɵgetLocaleCurrencyCode"](e)},e.getLocaleCurrencyName=function(e){return t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].CurrencyName]||null},e.getLocaleCurrencySymbol=function(e){return t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].CurrencySymbol]||null},e.getLocaleDateFormat=M,e.getLocaleDateTimeFormat=x,e.getLocaleDayNames=O,e.getLocaleDayPeriods=k,e.getLocaleDirection=function(e){return t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].Directionality]},e.getLocaleEraNames=R,e.getLocaleExtraDayPeriodRules=W,e.getLocaleExtraDayPeriods=U,e.getLocaleFirstDayOfWeek=function(e){return t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].FirstDayOfWeek]},e.getLocaleId=T,e.getLocaleMonthNames=P,e.getLocaleNumberFormat=$,e.getLocaleNumberSymbol=N,e.getLocalePluralCase=j,e.getLocaleTimeFormat=V,e.getLocaleWeekEndRange=function(e){return t["ɵfindLocaleData"](e)[t["ɵLocaleDataIndex"].WeekendRange]},e.getNumberOfCurrencyDigits=K,e.isPlatformBrowser=function(e){return e===yt},e.isPlatformServer=Et,e.isPlatformWorkerApp=function(e){return e===Ct},e.isPlatformWorkerUi=function(e){return e===vt},e.provideCloudflareLoader=Ot,e.provideCloudinaryLoader=Mt,e.provideImageKitLoader=Nt,e.provideImgixLoader=zt,e.registerLocaleData=function(e,r,n){return t["ɵregisterLocaleData"](e,r,n)},e["ɵBrowserPlatformLocation"]=c,e["ɵDomAdapter"]=class{},e["ɵNullViewportScroller"]=class{setOffset(e){}getScrollPosition(){return[0,0]}scrollToPosition(e){}scrollToAnchor(e){}setHistoryScrollRestoration(e){}},e["ɵPLATFORM_BROWSER_ID"]=yt,e["ɵPLATFORM_SERVER_ID"]=Ft,e["ɵPLATFORM_WORKER_APP_ID"]=Ct,e["ɵPLATFORM_WORKER_UI_ID"]=vt,e["ɵgetDOM"]=o,e["ɵparseCookieValue"]=function(e,t){t=encodeURIComponent(t);for(const r of e.split(";")){const e=r.indexOf("="),[n,i]=-1==e?[r,""]:[r.slice(0,e),r.slice(e+1)];if(n.trim()===t)return decodeURIComponent(i)}return null},e["ɵsetRootDomAdapter"]=function(e){i||(i=e)}})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/http/http.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/http/http.js new file mode 100644 index 000000000..10d4550a9 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/http/http.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","rxjs","rxjs/operators"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCommonHttp={},e.ngCommon,e.ngCore,e.rxjs,e.rxjsOperators)}(this,(function(e,t,r,s,n){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=o(t),i=o(r);class p{}class c{}class l{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach((e=>{const t=e.indexOf(":");if(t>0){const r=e.slice(0,t),s=r.toLowerCase(),n=e.slice(t+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(n):this.headers.set(s,[n])}}))}:()=>{("undefined"==typeof ngDevMode||ngDevMode)&&function(e){for(const[t,r]of Object.entries(e))if("string"!=typeof r&&!Array.isArray(r))throw new Error(`Unexpected value of the \`${t}\` header provided. Expecting either a string or an array, but got: \`${r}\`.`)}(e),this.headers=new Map,Object.keys(e).forEach((t=>{let r=e[t];const s=t.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(this.headers.set(s,r),this.maybeSetNormalizedName(t,s))}))}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof l?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach((e=>this.applyUpdate(e))),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach((t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))}))}clone(e){const t=new l;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof l?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let r=e.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(e.name,t);const s=("a"===e.op?this.headers.get(t):void 0)||[];s.push(...r),this.headers.set(t,s);break;case"d":const n=e.value;if(n){let e=this.headers.get(t);if(!e)return;e=e.filter((e=>-1===n.indexOf(e))),0===e.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,e)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach((t=>e(this.normalizedNames.get(t),this.headers.get(t))))}}class d{encodeKey(e){return m(e)}encodeValue(e){return m(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const u=/%(\d[a-f0-9])/gi,h={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function m(e){return encodeURIComponent(e).replace(u,((e,t)=>h[t]??e))}function y(e){return`${e}`}class g{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new d,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,t){const r=new Map;e.length>0&&e.replace(/^\?/,"").split("&").forEach((e=>{const s=e.indexOf("="),[n,o]=-1==s?[t.decodeKey(e),""]:[t.decodeKey(e.slice(0,s)),t.decodeValue(e.slice(s+1))],a=r.get(n)||[];a.push(o),r.set(n,a)}));return r}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach((t=>{const r=e.fromObject[t],s=Array.isArray(r)?r.map(y):[y(r)];this.map.set(t,s)}))):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach((r=>{const s=e[r];Array.isArray(s)?s.forEach((e=>{t.push({param:r,value:e,op:"a"})})):t.push({param:r,value:s,op:"a"})})),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map((e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map((e=>t+"="+this.encoder.encodeValue(e))).join("&")})).filter((e=>""!==e)).join("&")}clone(e){const t=new g({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach((e=>this.map.set(e,this.cloneFrom.map.get(e)))),this.updates.forEach((e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(y(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let t=this.map.get(e.param)||[];const r=t.indexOf(y(e.value));-1!==r&&t.splice(r,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}}})),this.cloneFrom=this.updates=null)}}class f{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}}function v(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function b(e){return"undefined"!=typeof Blob&&e instanceof Blob}function w(e){return"undefined"!=typeof FormData&&e instanceof FormData}class T{constructor(e,t,r,s){let n;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||s?(this.body=void 0!==r?r:null,n=s):n=r,n&&(this.reportProgress=!!n.reportProgress,this.withCredentials=!!n.withCredentials,n.responseType&&(this.responseType=n.responseType),n.headers&&(this.headers=n.headers),n.context&&(this.context=n.context),n.params&&(this.params=n.params)),this.headers||(this.headers=new l),this.context||(this.context=new f),this.params){const e=this.params.toString();if(0===e.length)this.urlWithParams=t;else{const r=t.indexOf("?"),s=-1===r?"?":rt.set(r,e.setHeaders[r])),i)),e.setParams&&(p=Object.keys(e.setParams).reduce(((t,r)=>t.set(r,e.setParams[r])),p)),new T(t,r,n,{params:p,headers:i,context:c,reportProgress:a,responseType:s,withCredentials:o})}}var I;e.HttpEventType=void 0,(I=e.HttpEventType||(e.HttpEventType={}))[I.Sent=0]="Sent",I[I.UploadProgress=1]="UploadProgress",I[I.ResponseHeader=2]="ResponseHeader",I[I.DownloadProgress=3]="DownloadProgress",I[I.Response=4]="Response",I[I.User=5]="User";class E{constructor(e,t=200,r="OK"){this.headers=e.headers||new l,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||r,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class C extends E{constructor(t={}){super(t),this.type=e.HttpEventType.ResponseHeader}clone(e={}){return new C({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class j extends E{constructor(t={}){super(t),this.type=e.HttpEventType.Response,this.body=void 0!==t.body?t.body:null}clone(e={}){return new j({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class x extends E{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function N(e,t){return{body:t,headers:e.headers,context:e.context,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}class P{constructor(e){this.handler=e}request(e,t,r={}){let o;if(e instanceof T)o=e;else{let s,n;s=r.headers instanceof l?r.headers:new l(r.headers),r.params&&(n=r.params instanceof g?r.params:new g({fromObject:r.params})),o=new T(e,t,void 0!==r.body?r.body:null,{headers:s,context:r.context,params:n,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const a=s.of(o).pipe(n.concatMap((e=>this.handler.handle(e))));if(e instanceof T||"events"===r.observe)return a;const i=a.pipe(n.filter((e=>e instanceof j)));switch(r.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return i.pipe(n.map((e=>{if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body})));case"blob":return i.pipe(n.map((e=>{if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body})));case"text":return i.pipe(n.map((e=>{if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body})));default:return i.pipe(n.map((e=>e.body)))}case"response":return i;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(e,t={}){return this.request("DELETE",e,t)}get(e,t={}){return this.request("GET",e,t)}head(e,t={}){return this.request("HEAD",e,t)}jsonp(e,t){return this.request("JSONP",e,{params:(new g).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,t={}){return this.request("OPTIONS",e,t)}patch(e,t,r={}){return this.request("PATCH",e,N(r,t))}post(e,t,r={}){return this.request("POST",e,N(r,t))}put(e,t,r={}){return this.request("PUT",e,N(r,t))}}function k(e,t){return t(e)}function H(e,t){return(r,s)=>t.intercept(r,{handle:t=>e(t,s)})}P.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:P,deps:[{token:p}],target:i.ɵɵFactoryTarget.Injectable}),P.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:P}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:P,decorators:[{type:r.Injectable}],ctorParameters:function(){return[{type:p}]}});const O=new r.InjectionToken("HTTP_INTERCEPTORS"),F=new r.InjectionToken("HTTP_INTERCEPTOR_FNS");function D(){let e=null;return(t,s)=>{if(null===e){const t=r.inject(O,{optional:!0})??[];e=t.reduceRight(H,k)}return e(t,s)}}class M extends p{constructor(e,t){super(),this.backend=e,this.injector=t,this.chain=null}handle(e){if(null===this.chain){const e=Array.from(new Set(this.injector.get(F)));this.chain=e.reduceRight(((e,t)=>function(e,t,r){return(s,n)=>r.runInContext((()=>t(s,(t=>e(t,n)))))}(e,t,this.injector)),k)}return this.chain(e,(e=>this.backend.handle(e)))}}M.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:M,deps:[{token:c},{token:i.EnvironmentInjector}],target:i.ɵɵFactoryTarget.Injectable}),M.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:M}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:M,decorators:[{type:r.Injectable}],ctorParameters:function(){return[{type:c},{type:i.EnvironmentInjector}]}});let R,S=0;class V{}function L(){return"object"==typeof window?window:{}}class A{constructor(e,t){this.callbackMap=e,this.document=t,this.resolvedPromise=Promise.resolve()}nextCallback(){return"ng_jsonp_callback_"+S++}handle(t){if("JSONP"!==t.method)throw new Error("JSONP requests must use JSONP request method.");if("json"!==t.responseType)throw new Error("JSONP requests must use Json response type.");if(t.headers.keys().length>0)throw new Error("JSONP requests do not support headers.");return new s.Observable((r=>{const s=this.nextCallback(),n=t.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/,`=${s}$1`),o=this.document.createElement("script");o.src=n;let a=null,i=!1;this.callbackMap[s]=e=>{delete this.callbackMap[s],a=e,i=!0};const p=()=>{o.parentNode&&o.parentNode.removeChild(o),delete this.callbackMap[s]};return o.addEventListener("load",(e=>{this.resolvedPromise.then((()=>{p(),i?(r.next(new j({body:a,status:200,statusText:"OK",url:n})),r.complete()):r.error(new x({url:n,status:0,statusText:"JSONP Error",error:new Error("JSONP injected script did not invoke callback.")}))}))})),o.addEventListener("error",(e=>{p(),r.error(new x({error:e,status:0,statusText:"JSONP Error",url:n}))})),this.document.body.appendChild(o),r.next({type:e.HttpEventType.Sent}),()=>{i||this.removeListeners(o),p()}}))}removeListeners(e){R||(R=this.document.implementation.createHTMLDocument()),R.adoptNode(e)}}function U(e,t){return"JSONP"===e.method?r.inject(A).handle(e):t(e)}A.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:A,deps:[{token:V},{token:t.DOCUMENT}],target:i.ɵɵFactoryTarget.Injectable}),A.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:A}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:A,decorators:[{type:r.Injectable}],ctorParameters:function(){return[{type:V},{type:void 0,decorators:[{type:r.Inject,args:[t.DOCUMENT]}]}]}});class z{constructor(e){this.injector=e}intercept(e,t){return this.injector.runInContext((()=>U(e,(e=>t.handle(e)))))}}z.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:z,deps:[{token:i.EnvironmentInjector}],target:i.ɵɵFactoryTarget.Injectable}),z.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:z}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:z,decorators:[{type:r.Injectable}],ctorParameters:function(){return[{type:i.EnvironmentInjector}]}});const q=/^\)\]\}',?\n/;class X{constructor(e){this.xhrFactory=e}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new s.Observable((r=>{const s=this.xhrFactory.build();if(s.open(t.method,t.urlWithParams),t.withCredentials&&(s.withCredentials=!0),t.headers.forEach(((e,t)=>s.setRequestHeader(e,t.join(",")))),t.headers.has("Accept")||s.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const e=t.detectContentTypeHeader();null!==e&&s.setRequestHeader("Content-Type",e)}if(t.responseType){const e=t.responseType.toLowerCase();s.responseType="json"!==e?e:"text"}const n=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const e=s.statusText||"OK",r=new l(s.getAllResponseHeaders()),n=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(s)||t.url;return o=new C({headers:r,status:s.status,statusText:e,url:n}),o},i=()=>{let{headers:e,status:n,statusText:o,url:i}=a(),p=null;204!==n&&(p=void 0===s.response?s.responseText:s.response),0===n&&(n=p?200:0);let c=n>=200&&n<300;if("json"===t.responseType&&"string"==typeof p){const e=p;p=p.replace(q,"");try{p=""!==p?JSON.parse(p):null}catch(t){p=e,c&&(c=!1,p={error:t,text:p})}}c?(r.next(new j({body:p,headers:e,status:n,statusText:o,url:i||void 0})),r.complete()):r.error(new x({error:p,headers:e,status:n,statusText:o,url:i||void 0}))},p=e=>{const{url:t}=a(),n=new x({error:e,status:s.status||0,statusText:s.statusText||"Unknown Error",url:t||void 0});r.error(n)};let c=!1;const d=n=>{c||(r.next(a()),c=!0);let o={type:e.HttpEventType.DownloadProgress,loaded:n.loaded};n.lengthComputable&&(o.total=n.total),"text"===t.responseType&&s.responseText&&(o.partialText=s.responseText),r.next(o)},u=t=>{let s={type:e.HttpEventType.UploadProgress,loaded:t.loaded};t.lengthComputable&&(s.total=t.total),r.next(s)};return s.addEventListener("load",i),s.addEventListener("error",p),s.addEventListener("timeout",p),s.addEventListener("abort",p),t.reportProgress&&(s.addEventListener("progress",d),null!==n&&s.upload&&s.upload.addEventListener("progress",u)),s.send(n),r.next({type:e.HttpEventType.Sent}),()=>{s.removeEventListener("error",p),s.removeEventListener("abort",p),s.removeEventListener("load",i),s.removeEventListener("timeout",p),t.reportProgress&&(s.removeEventListener("progress",d),null!==n&&s.upload&&s.upload.removeEventListener("progress",u)),s.readyState!==s.DONE&&s.abort()}}))}}X.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:X,deps:[{token:a.XhrFactory}],target:i.ɵɵFactoryTarget.Injectable}),X.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:X}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:X,decorators:[{type:r.Injectable}],ctorParameters:function(){return[{type:a.XhrFactory}]}});const J=new r.InjectionToken("XSRF_ENABLED"),K="XSRF-TOKEN",B=new r.InjectionToken("XSRF_COOKIE_NAME",{providedIn:"root",factory:()=>K}),_="X-XSRF-TOKEN",$=new r.InjectionToken("XSRF_HEADER_NAME",{providedIn:"root",factory:()=>_});class W{}class G{constructor(e,t,r){this.doc=e,this.platform=t,this.cookieName=r,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=t["ɵparseCookieValue"](e,this.cookieName),this.lastCookieString=e),this.lastToken}}function Y(e,t){const s=e.url.toLowerCase();if(!r.inject(J)||"GET"===e.method||"HEAD"===e.method||s.startsWith("http://")||s.startsWith("https://"))return t(e);const n=r.inject(W).getToken(),o=r.inject($);return null==n||e.headers.has(o)||(e=e.clone({headers:e.headers.set(o,n)})),t(e)}G.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:G,deps:[{token:t.DOCUMENT},{token:r.PLATFORM_ID},{token:B}],target:i.ɵɵFactoryTarget.Injectable}),G.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:G}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:G,decorators:[{type:r.Injectable}],ctorParameters:function(){return[{type:void 0,decorators:[{type:r.Inject,args:[t.DOCUMENT]}]},{type:void 0,decorators:[{type:r.Inject,args:[r.PLATFORM_ID]}]},{type:void 0,decorators:[{type:r.Inject,args:[B]}]}]}});class Q{constructor(e){this.injector=e}intercept(e,t){return this.injector.runInContext((()=>Y(e,(e=>t.handle(e)))))}}var Z;function ee(e,t){return{"ɵkind":e,"ɵproviders":t}}function te(...t){if(ngDevMode){const r=new Set(t.map((e=>e.ɵkind)));if(r.has(e.HttpFeatureKind.NoXsrfProtection)&&r.has(e.HttpFeatureKind.CustomXsrfConfiguration))throw new Error(ngDevMode?"Configuration error: found both withXsrfConfiguration() and withNoXsrfProtection() in the same call to provideHttpClient(), which is a contradiction.":"")}const s=[P,X,M,{provide:p,useExisting:M},{provide:c,useExisting:X},{provide:F,useValue:Y,multi:!0},{provide:J,useValue:!0},{provide:W,useClass:G}];for(const e of t)s.push(...e.ɵproviders);return r.makeEnvironmentProviders(s)}Q.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:Q,deps:[{token:i.EnvironmentInjector}],target:i.ɵɵFactoryTarget.Injectable}),Q.ɵprov=i.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:Q}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:Q,decorators:[{type:r.Injectable}],ctorParameters:function(){return[{type:i.EnvironmentInjector}]}}),e.HttpFeatureKind=void 0,(Z=e.HttpFeatureKind||(e.HttpFeatureKind={}))[Z.Interceptors=0]="Interceptors",Z[Z.LegacyInterceptors=1]="LegacyInterceptors",Z[Z.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",Z[Z.NoXsrfProtection=3]="NoXsrfProtection",Z[Z.JsonpSupport=4]="JsonpSupport",Z[Z.RequestsMadeViaParent=5]="RequestsMadeViaParent";const re=new r.InjectionToken("LEGACY_INTERCEPTOR_FN");function se(){return ee(e.HttpFeatureKind.LegacyInterceptors,[{provide:re,useFactory:D},{provide:F,useExisting:re,multi:!0}])}function ne({cookieName:t,headerName:r}){const s=[];return void 0!==t&&s.push({provide:B,useValue:t}),void 0!==r&&s.push({provide:$,useValue:r}),ee(e.HttpFeatureKind.CustomXsrfConfiguration,s)}function oe(){return ee(e.HttpFeatureKind.NoXsrfProtection,[{provide:J,useValue:!1}])}function ae(){return ee(e.HttpFeatureKind.JsonpSupport,[A,{provide:V,useFactory:L},{provide:F,useValue:U,multi:!0}])}class ie{static disable(){return{ngModule:ie,providers:[oe().ɵproviders]}}static withOptions(e={}){return{ngModule:ie,providers:ne(e).ɵproviders}}}ie.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:ie,deps:[],target:i.ɵɵFactoryTarget.NgModule}),ie.ɵmod=i.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.4",ngImport:i,type:ie}),ie.ɵinj=i.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:ie,providers:[Q,{provide:O,useExisting:Q,multi:!0},{provide:W,useClass:G},ne({cookieName:K,headerName:_}).ɵproviders,{provide:J,useValue:!0}]}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:ie,decorators:[{type:r.NgModule,args:[{providers:[Q,{provide:O,useExisting:Q,multi:!0},{provide:W,useClass:G},ne({cookieName:K,headerName:_}).ɵproviders,{provide:J,useValue:!0}]}]}]});class pe{}pe.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:pe,deps:[],target:i.ɵɵFactoryTarget.NgModule}),pe.ɵmod=i.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.4",ngImport:i,type:pe}),pe.ɵinj=i.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:pe,providers:[te(se(),ne({cookieName:K,headerName:_}))]}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:pe,decorators:[{type:r.NgModule,args:[{providers:[te(se(),ne({cookieName:K,headerName:_}))]}]}]});class ce{}ce.ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:ce,deps:[],target:i.ɵɵFactoryTarget.NgModule}),ce.ɵmod=i.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.4",ngImport:i,type:ce}),ce.ɵinj=i.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:ce,providers:[ae().ɵproviders]}),i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:i,type:ce,decorators:[{type:r.NgModule,args:[{providers:[ae().ɵproviders]}]}]});const le=t.XhrFactory;e.HTTP_INTERCEPTORS=O,e.HttpBackend=c,e.HttpClient=P,e.HttpClientJsonpModule=ce,e.HttpClientModule=pe,e.HttpClientXsrfModule=ie,e.HttpContext=f,e.HttpContextToken=class{constructor(e){this.defaultValue=e}},e.HttpErrorResponse=x,e.HttpHandler=p,e.HttpHeaderResponse=C,e.HttpHeaders=l,e.HttpParams=g,e.HttpRequest=T,e.HttpResponse=j,e.HttpResponseBase=E,e.HttpUrlEncodingCodec=d,e.HttpXhrBackend=X,e.HttpXsrfTokenExtractor=W,e.JsonpClientBackend=A,e.JsonpInterceptor=z,e.XhrFactory=le,e.provideHttpClient=te,e.withInterceptors=function(t){return ee(e.HttpFeatureKind.Interceptors,t.map((e=>({provide:F,useValue:e,multi:!0}))))},e.withInterceptorsFromDi=se,e.withJsonpSupport=ae,e.withNoXsrfProtection=oe,e.withRequestsMadeViaParent=function(){return ee(e.HttpFeatureKind.RequestsMadeViaParent,[{provide:c,useFactory:()=>{const e=r.inject(p,{skipSelf:!0,optional:!0});if(ngDevMode&&null===e)throw new Error("withRequestsMadeViaParent() can only be used when the parent injector also configures HttpClient");return e}}])},e.withXsrfConfiguration=ne,e["ɵHttpInterceptingHandler"]=M,e["ɵHttpInterceptorHandler"]=M})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/http/testing/testing.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/http/testing/testing.js new file mode 100644 index 000000000..e91dc4faf --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/http/testing/testing.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common/http"),require("@angular/core"),require("rxjs")):"function"==typeof define&&define.amd?define(["exports","@angular/common/http","@angular/core","rxjs"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCommonHttpTesting={},e.ngCommonHttp,e.ngCore,e.rxjs)}(this,(function(e,t,r,n){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=o(r);class i{}class a{constructor(e,t){this.request=e,this.observer=t,this._cancelled=!1}get cancelled(){return this._cancelled}flush(e,r={}){if(this.cancelled)throw new Error("Cannot flush a cancelled request.");const n=this.request.urlWithParams,o=r.headers instanceof t.HttpHeaders?r.headers:new t.HttpHeaders(r.headers);e=function(e,t){if(null===t)return null;switch(e){case"arraybuffer":return function(e){if("undefined"==typeof ArrayBuffer)throw new Error("ArrayBuffer responses are not supported on this platform.");if(e instanceof ArrayBuffer)return e;throw new Error("Automatic conversion to ArrayBuffer is not supported for response type.")}(t);case"blob":return function(e){if("undefined"==typeof Blob)throw new Error("Blob responses are not supported on this platform.");if(e instanceof Blob)return e;if(ArrayBuffer&&e instanceof ArrayBuffer)return new Blob([e]);throw new Error("Automatic conversion to Blob is not supported for response type.")}(t);case"json":return u(t);case"text":return function(e){if("string"==typeof e)return e;if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)throw new Error("Automatic conversion to text is not supported for ArrayBuffers.");if("undefined"!=typeof Blob&&e instanceof Blob)throw new Error("Automatic conversion to text is not supported for Blobs.");return JSON.stringify(u(e,"text"))}(t);default:throw new Error(`Unsupported responseType: ${e}`)}}(this.request.responseType,e);let s=r.statusText,i=void 0!==r.status?r.status:200;if(void 0===r.status&&(null===e?(i=204,s=s||"No Content"):s=s||"OK"),void 0===s)throw new Error("statusText is required when setting a custom status.");i>=200&&i<300?(this.observer.next(new t.HttpResponse({body:e,headers:o,status:i,statusText:s,url:n})),this.observer.complete()):this.observer.error(new t.HttpErrorResponse({error:e,headers:o,status:i,statusText:s,url:n}))}error(e,r={}){if(this.cancelled)throw new Error("Cannot return an error for a cancelled request.");if(r.status&&r.status>=200&&r.status<300)throw new Error("error() called with a successful status.");const n=r.headers instanceof t.HttpHeaders?r.headers:new t.HttpHeaders(r.headers);this.observer.error(new t.HttpErrorResponse({error:e,headers:n,status:r.status||0,statusText:r.statusText||"",url:this.request.urlWithParams}))}event(e){if(this.cancelled)throw new Error("Cannot send events to a cancelled request.");this.observer.next(e)}}function u(e,t="JSON"){if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer)throw new Error(`Automatic conversion to ${t} is not supported for ArrayBuffers.`);if("undefined"!=typeof Blob&&e instanceof Blob)throw new Error(`Automatic conversion to ${t} is not supported for Blobs.`);if("string"==typeof e||"number"==typeof e||"object"==typeof e||"boolean"==typeof e||Array.isArray(e))return e;throw new Error(`Automatic conversion to ${t} is not supported for response type.`)}class c{constructor(){this.open=[]}handle(e){return new n.Observable((r=>{const n=new a(e,r);return this.open.push(n),r.next({type:t.HttpEventType.Sent}),()=>{n._cancelled=!0}}))}_match(e){return"string"==typeof e?this.open.filter((t=>t.request.urlWithParams===e)):"function"==typeof e?this.open.filter((t=>e(t.request))):this.open.filter((t=>!(e.method&&t.request.method!==e.method.toUpperCase()||e.url&&t.request.urlWithParams!==e.url)))}match(e){const t=this._match(e);return t.forEach((e=>{const t=this.open.indexOf(e);-1!==t&&this.open.splice(t,1)})),t}expectOne(e,t){t=t||this.descriptionFromMatcher(e);const r=this.match(e);if(r.length>1)throw new Error(`Expected one matching request for criteria "${t}", found ${r.length} requests.`);if(0===r.length){let e=`Expected one matching request for criteria "${t}", found none.`;if(this.open.length>0){e+=` Requests received are: ${this.open.map(f).join(", ")}.`}throw new Error(e)}return r[0]}expectNone(e,t){t=t||this.descriptionFromMatcher(e);const r=this.match(e);if(r.length>0)throw new Error(`Expected zero matching requests for criteria "${t}", found ${r.length}.`)}verify(e={}){let t=this.open;if(e.ignoreCancelled&&(t=t.filter((e=>!e.cancelled))),t.length>0){const e=t.map(f).join(", ");throw new Error(`Expected no open requests, found ${t.length}: ${e}`)}}descriptionFromMatcher(e){if("string"==typeof e)return`Match URL: ${e}`;if("object"==typeof e){return`Match method: ${e.method||"(any)"}, URL: ${e.url||"(any)"}`}return`Match by function: ${e.name}`}}function f(e){const t=e.request.urlWithParams;return`${e.request.method} ${t}`}function p(){return[c,{provide:t.HttpBackend,useExisting:c},{provide:i,useExisting:c}]}c.ɵfac=s.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:s,type:c,deps:[],target:s.ɵɵFactoryTarget.Injectable}),c.ɵprov=s.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:s,type:c}),s.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:s,type:c,decorators:[{type:r.Injectable}]});class l{}l.ɵfac=s.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:s,type:l,deps:[],target:s.ɵɵFactoryTarget.NgModule}),l.ɵmod=s.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"15.0.4",ngImport:s,type:l,imports:[t.HttpClientModule]}),l.ɵinj=s.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"15.0.4",ngImport:s,type:l,providers:[p()],imports:[t.HttpClientModule]}),s.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:s,type:l,decorators:[{type:r.NgModule,args:[{imports:[t.HttpClientModule],providers:[p()]}]}]}),e.HttpClientTestingModule=l,e.HttpTestingController=i,e.TestRequest=a,e.provideHttpClientTesting=p})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/testing/testing.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/testing/testing.js new file mode 100644 index 000000000..246697512 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/common/testing/testing.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("rxjs")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","rxjs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ngCommonTesting={},t.ngCore,t.ngCommon,t.rxjs)}(this,(function(t,e,s,h){"use strict";function r(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(s){if("default"!==s){var h=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,h.get?h:{enumerable:!0,get:function(){return t[s]}})}})),e.default=t,Object.freeze(e)}var n=r(e);function a(t){return t&&"?"!==t[0]?"?"+t:t}class i{constructor(){this.urlChanges=[],this._history=[new o("","",null)],this._historyIndex=0,this._subject=new e.EventEmitter,this._basePath="",this._locationStrategy=null,this._urlChangeListeners=[],this._urlChangeSubscription=null}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}setInitialPath(t){this._history[this._historyIndex].path=t}setBaseHref(t){this._basePath=t}path(){return this._history[this._historyIndex].path}getState(){return this._history[this._historyIndex].state}isCurrentPathEqualTo(t,e=""){const s=t.endsWith("/")?t.substring(0,t.length-1):t;return(this.path().endsWith("/")?this.path().substring(0,this.path().length-1):this.path())==s+(e.length>0?"?"+e:"")}simulateUrlPop(t){this._subject.emit({url:t,pop:!0,type:"popstate"})}simulateHashChange(t){const e=this.prepareExternalUrl(t);this.pushHistory(e,"",null),this.urlChanges.push("hash: "+t),this._subject.emit({url:t,pop:!0,type:"popstate"}),this._subject.emit({url:t,pop:!0,type:"hashchange"})}prepareExternalUrl(t){return t.length>0&&!t.startsWith("/")&&(t="/"+t),this._basePath+t}go(t,e="",s=null){t=this.prepareExternalUrl(t),this.pushHistory(t,e,s);const h=this._history[this._historyIndex-1];if(h.path==t&&h.query==e)return;const r=t+(e.length>0?"?"+e:"");this.urlChanges.push(r),this._notifyUrlChangeListeners(t+a(e),s)}replaceState(t,e="",s=null){t=this.prepareExternalUrl(t);const h=this._history[this._historyIndex];if(h.state=s,h.path==t&&h.query==e)return;h.path=t,h.query=e;const r=t+(e.length>0?"?"+e:"");this.urlChanges.push("replace: "+r),this._notifyUrlChangeListeners(t+a(e),s)}forward(){this._historyIndex0&&(this._historyIndex--,this._subject.emit({url:this.path(),state:this.getState(),pop:!0,type:"popstate"}))}historyGo(t=0){const e=this._historyIndex+t;e>=0&&e{this._notifyUrlChangeListeners(t.url,t.state)}))),()=>{const e=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(e,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach((s=>s(t,e)))}subscribe(t,e,s){return this._subject.subscribe({next:t,error:e,complete:s})}normalize(t){return null}pushHistory(t,e,s){this._historyIndex>0&&this._history.splice(this._historyIndex+1),this._history.push(new o(t,e,s)),this._historyIndex=this._history.length-1}}i.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:i,deps:[],target:n.ɵɵFactoryTarget.Injectable}),i.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:i}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:i,decorators:[{type:e.Injectable}]});class o{constructor(t,e,s){this.path=t,this.query=e,this.state=s}}class l extends s.LocationStrategy{constructor(){super(),this.internalBaseHref="/",this.internalPath="/",this.internalTitle="",this.urlChanges=[],this._subject=new e.EventEmitter,this.stateChanges=[]}simulatePopState(t){this.internalPath=t,this._subject.emit(new u(this.path()))}path(t=!1){return this.internalPath}prepareExternalUrl(t){return t.startsWith("/")&&this.internalBaseHref.endsWith("/")?this.internalBaseHref+t.substring(1):this.internalBaseHref+t}pushState(t,e,s,h){this.stateChanges.push(t),this.internalTitle=e;const r=s+(h.length>0?"?"+h:"");this.internalPath=r;const n=this.prepareExternalUrl(r);this.urlChanges.push(n)}replaceState(t,e,s,h){this.stateChanges[(this.stateChanges.length||1)-1]=t,this.internalTitle=e;const r=s+(h.length>0?"?"+h:"");this.internalPath=r;const n=this.prepareExternalUrl(r);this.urlChanges.push("replace: "+n)}onPopState(t){this._subject.subscribe({next:t})}getBaseHref(){return this.internalBaseHref}back(){if(this.urlChanges.length>0){this.urlChanges.pop(),this.stateChanges.pop();const t=this.urlChanges.length>0?this.urlChanges[this.urlChanges.length-1]:"";this.simulatePopState(t)}}forward(){throw"not implemented"}getState(){return this.stateChanges[(this.stateChanges.length||1)-1]}}l.ɵfac=n.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:l,deps:[],target:n.ɵɵFactoryTarget.Injectable}),l.ɵprov=n.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:l}),n.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"15.0.4",ngImport:n,type:l,decorators:[{type:e.Injectable}],ctorParameters:function(){return[]}});class u{constructor(t){this.newUrl=t,this.pop=!0,this.type="popstate"}}const p=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;function c(t,e){let s,h;/^((http[s]?|ftp):\/\/)/.test(t)||(s="http://empty.com/");try{h=new URL(t,s)}catch(r){const n=p.exec(s||""+t);if(!n)throw new Error(`Invalid URL: ${t} with base: ${e}`);const a=n[4].split(":");h={protocol:n[1],hostname:a[0],port:a[1]||"",pathname:n[5],search:n[6],hash:n[8]}}return h.pathname&&0===h.pathname.indexOf(e)&&(h.pathname=h.pathname.substring(e.length)),{hostname:!s&&h.hostname||"",protocol:!s&&h.protocol||"",port:!s&&h.port||"",pathname:h.pathname||"/",search:h.search||"",hash:h.hash||""}}const g=new e.InjectionToken("MOCK_PLATFORM_LOCATION_CONFIG");class C{constructor(t){if(this.baseHref="",this.hashUpdate=new h.Subject,this.popStateSubject=new h.Subject,this.urlChangeIndex=0,this.urlChanges=[{hostname:"",protocol:"",port:"",pathname:"/",search:"",hash:"",state:null}],t){this.baseHref=t.appBaseHref||"";const e=this.parseChanges(null,t.startUrl||"http://_empty_/",this.baseHref);this.urlChanges[0]={...e}}}get hostname(){return this.urlChanges[this.urlChangeIndex].hostname}get protocol(){return this.urlChanges[this.urlChangeIndex].protocol}get port(){return this.urlChanges[this.urlChangeIndex].port}get pathname(){return this.urlChanges[this.urlChangeIndex].pathname}get search(){return this.urlChanges[this.urlChangeIndex].search}get hash(){return this.urlChanges[this.urlChangeIndex].hash}get state(){return this.urlChanges[this.urlChangeIndex].state}getBaseHrefFromDOM(){return this.baseHref}onPopState(t){const e=this.popStateSubject.subscribe(t);return()=>e.unsubscribe()}onHashChange(t){const e=this.hashUpdate.subscribe(t);return()=>e.unsubscribe()}get href(){let t=`${this.protocol}//${this.hostname}${this.port?":"+this.port:""}`;return t+=`${"/"===this.pathname?"":this.pathname}${this.search}${this.hash}`,t}get url(){return`${this.pathname}${this.search}${this.hash}`}parseChanges(t,e,s=""){return t=JSON.parse(JSON.stringify(t)),{...c(e,s),state:t}}replaceState(t,e,s){const{pathname:h,search:r,state:n,hash:a}=this.parseChanges(t,s);this.urlChanges[this.urlChangeIndex]={...this.urlChanges[this.urlChangeIndex],pathname:h,search:r,hash:a,state:n}}pushState(t,e,s){const{pathname:h,search:r,state:n,hash:a}=this.parseChanges(t,s);this.urlChangeIndex>0&&this.urlChanges.splice(this.urlChangeIndex+1),this.urlChanges.push({...this.urlChanges[this.urlChangeIndex],pathname:h,search:r,hash:a,state:n}),this.urlChangeIndex=this.urlChanges.length-1}forward(){const t=this.url,e=this.hash;this.urlChangeIndex0&&this.urlChangeIndex--,this.emitEvents(e,t)}historyGo(t=0){const e=this.url,s=this.hash,h=this.urlChangeIndex+t;h>=0&&h0&&t.forEach((e=>this.closedByChildren[e]=!0)),this.isVoid=i,this.closedByParent=r||i,this.implicitNamespacePrefix=s||null,this.contentType=n,this.ignoreFirstLf=a,this.preventNamespaceInheritance=o}isClosedByChild(e){return this.isVoid||e.toLowerCase()in this.closedByChildren}getContentType(e){if("object"==typeof this.contentType){return(void 0===e?void 0:this.contentType[e])??this.contentType.default}return this.contentType}}let c,u;function p(t){return u||(c=new l,u={base:new l({isVoid:!0}),meta:new l({isVoid:!0}),area:new l({isVoid:!0}),embed:new l({isVoid:!0}),link:new l({isVoid:!0}),img:new l({isVoid:!0}),input:new l({isVoid:!0}),param:new l({isVoid:!0}),hr:new l({isVoid:!0}),br:new l({isVoid:!0}),source:new l({isVoid:!0}),track:new l({isVoid:!0}),wbr:new l({isVoid:!0}),p:new l({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new l({closedByChildren:["tbody","tfoot"]}),tbody:new l({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new l({closedByChildren:["tbody"],closedByParent:!0}),tr:new l({closedByChildren:["tr"],closedByParent:!0}),td:new l({closedByChildren:["td","th"],closedByParent:!0}),th:new l({closedByChildren:["td","th"],closedByParent:!0}),col:new l({isVoid:!0}),svg:new l({implicitNamespacePrefix:"svg"}),foreignObject:new l({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new l({implicitNamespacePrefix:"math"}),li:new l({closedByChildren:["li"],closedByParent:!0}),dt:new l({closedByChildren:["dt","dd"]}),dd:new l({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new l({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new l({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new l({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new l({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new l({closedByChildren:["optgroup"],closedByParent:!0}),option:new l({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new l({ignoreFirstLf:!0}),listing:new l({ignoreFirstLf:!0}),style:new l({contentType:e.TagContentType.RAW_TEXT}),script:new l({contentType:e.TagContentType.RAW_TEXT}),title:new l({contentType:{default:e.TagContentType.ESCAPABLE_RAW_TEXT,svg:e.TagContentType.PARSABLE_DATA}}),textarea:new l({contentType:e.TagContentType.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),u[t]??u[t.toLowerCase()]??c}const h=new RegExp("(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=([\"']?)([^\\]\"']*)\\5)?\\])|(\\))|(\\s*,\\s*)","g");class d{constructor(){this.element=null,this.classNames=[],this.attrs=[],this.notSelectors=[]}static parse(e){const t=[],s=(e,t)=>{t.notSelectors.length>0&&!t.element&&0==t.classNames.length&&0==t.attrs.length&&(t.element="*"),e.push(t)};let n,r=new d,i=r,a=!1;for(h.lastIndex=0;n=h.exec(e);){if(n[1]){if(a)throw new Error("Nesting :not in a selector is not allowed");a=!0,i=new d,r.notSelectors.push(i)}const e=n[2];if(e){const t=n[3];"#"===t?i.addAttribute("id",e.slice(1)):"."===t?i.addClassName(e.slice(1)):i.setElement(e)}const o=n[4];if(o&&i.addAttribute(i.unescapeAttribute(o),n[6]),n[7]&&(a=!1,i=r),n[8]){if(a)throw new Error("Multiple selectors in :not are not supported");s(t,r),r=i=new d}}return s(t,r),t}unescapeAttribute(e){let t="",s=!1;for(let n=0;n0?` class="${this.classNames.join(" ")}"`:"";let s="";for(let e=0;e`:`<${e}${t}${s}>`}getAttrs(){const e=[];return this.classNames.length>0&&e.push("class",this.classNames.join(" ")),e.concat(this.attrs)}addAttribute(e,t=""){this.attrs.push(e,t&&t.toLowerCase()||"")}addClassName(e){this.classNames.push(e.toLowerCase())}toString(){let e=this.element||"";if(this.classNames&&this.classNames.forEach((t=>e+=`.${t}`)),this.attrs)for(let t=0;te+=`:not(${t})`)),e}}class m{constructor(){this._elementMap=new Map,this._elementPartialMap=new Map,this._classMap=new Map,this._classPartialMap=new Map,this._attrValueMap=new Map,this._attrValuePartialMap=new Map,this._listContexts=[]}static createNotMatcher(e){const t=new m;return t.addSelectables(e,null),t}addSelectables(e,t){let s=null;e.length>1&&(s=new g(e),this._listContexts.push(s));for(let n=0;n0&&(!this.listContext||!this.listContext.alreadyMatched)){s=!m.createNotMatcher(this.notSelectors).match(e,null)}return!s||!t||this.listContext&&this.listContext.alreadyMatched||(this.listContext&&(this.listContext.alreadyMatched=!0),t(this.selector,this.cbContext)),s}}var f,y;e.ViewEncapsulation=void 0,(f=e.ViewEncapsulation||(e.ViewEncapsulation={}))[f.Emulated=0]="Emulated",f[f.None=2]="None",f[f.ShadowDom=3]="ShadowDom",e.ChangeDetectionStrategy=void 0,(y=e.ChangeDetectionStrategy||(e.ChangeDetectionStrategy={}))[y.OnPush=0]="OnPush",y[y.Default=1]="Default";const x={name:"custom-elements"},w={name:"no-errors-schema"},S=Function;var E,_;function b(e){const t=function(e){const t=e.classNames&&e.classNames.length?[8,...e.classNames]:[];return[e.element&&"*"!==e.element?e.element:"",...e.attrs,...t]}(e),s=e.notSelectors&&e.notSelectors.length?e.notSelectors.map((e=>function(e){const t=e.classNames&&e.classNames.length?[8,...e.classNames]:[];return e.element?[5,e.element,...e.attrs,...t]:e.attrs.length?[3,...e.attrs,...t]:e.classNames&&e.classNames.length?[9,...e.classNames]:[]}(e))):[];return t.concat(...s)}function T(e){return e?d.parse(e).map(b):[]}!function(e){e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL"}(E||(E={})),function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Ignore=2]="Ignore"}(_||(_={}));var C=Object.freeze({__proto__:null,emitDistinctChangesOnlyDefaultValue:true,get ViewEncapsulation(){return e.ViewEncapsulation},get ChangeDetectionStrategy(){return e.ChangeDetectionStrategy},CUSTOM_ELEMENTS_SCHEMA:x,NO_ERRORS_SCHEMA:w,Type:S,get SecurityContext(){return E},get MissingTranslationStrategy(){return _},parseSelectorToR3Selector:T});const I=/-+([a-z0-9])/g;function k(e,t,s){const n=e.indexOf(t);return-1==n?s:[e.slice(0,n).trim(),e.slice(n+1).trim()]}function N(e){throw new Error(`Internal Error: ${e}`)}function P(e){let t=[];for(let s=0;s=55296&&n<=56319&&e.length>s+1){const t=e.charCodeAt(s+1);t>=56320&&t<=57343&&(s++,n=(n-55296<<10)+t-56320+65536)}n<=127?t.push(n):n<=2047?t.push(n>>6&31|192,63&n|128):n<=65535?t.push(n>>12|224,n>>6&63|128,63&n|128):n<=2097151&&t.push(n>>18&7|240,n>>12&63|128,n>>6&63|128,63&n|128)}return t}function A(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(A).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;if(!e.toString)return"object";const t=e.toString();if(null==t)return""+t;const s=t.indexOf("\n");return-1===s?t:t.substring(0,s)}class L{constructor(e){this.full=e;const t=e.split(".");this.major=t[0],this.minor=t[1],this.patch=t.slice(2).join(".")}}const M=(()=>"undefined"!=typeof global&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self)();class R{constructor(e){this.digits=e}static zero(){return new R([0])}static one(){return new R([1])}clone(){return new R(this.digits.slice())}add(e){const t=this.clone();return t.addToSelf(e),t}addToSelf(e){const t=Math.max(this.digits.length,e.digits.length);let s=0;for(let n=0;n=10?(this.digits[n]=t-10,s=1):(this.digits[n]=t,s=0)}s>0&&(this.digits[t]=1)}toString(){let e="";for(let t=this.digits.length-1;t>=0;t--)e+=this.digits[t];return e}}class O{constructor(e){this.powerOfTwos=[e]}getValue(){return this.powerOfTwos[0]}multiplyBy(e){const t=R.zero();return this.multiplyByAndAddTo(e,t),t}multiplyByAndAddTo(e,t){for(let s=0;0!==e;e>>>=1,s++)if(1&e){const e=this.getMultipliedByPowerOfTwo(s);t.addToSelf(e)}}getMultipliedByPowerOfTwo(e){for(let t=this.powerOfTwos.length;t<=e;t++){const e=this.powerOfTwos[t-1];this.powerOfTwos[t]=e.add(e)}return this.powerOfTwos[e]}}function $(e){return e.id||D(e)}function D(e){return function(e){const t=P(e),s=function(e,t){const s=e.length+3>>>2,n=[];for(let r=0;r>5]|=128<<24-n%32,s[15+(n+64>>9<<4)]=n;for(let e=0;e>>4).toString(16)+(15&n).toString(16)}return t.toLowerCase()}(function(e){return e.reduce(((e,t)=>e.concat(function(e){let t=[];for(let s=0;s<4;s++)t.push(e>>>8*(3-s)&255);return t}(t))),[])}([i,a,o,l,c]))}((t=e.nodes,t.map((e=>e.visit(V,null)))).join("")+`[${e.meaning}]`);var t}function B(e){return e.id||q(e)}function q(e){const t=new U;return W(e.nodes.map((e=>e.visit(t,null))).join(""),e.meaning)}class F{visitText(e,t){return e.value}visitContainer(e,t){return`[${e.children.map((e=>e.visit(this))).join(", ")}]`}visitIcu(e,t){const s=Object.keys(e.cases).map((t=>`${t} {${e.cases[t].visit(this)}}`));return`{${e.expression}, ${e.type}, ${s.join(", ")}}`}visitTagPlaceholder(e,t){return e.isVoid?``:`${e.children.map((e=>e.visit(this))).join(", ")}`}visitPlaceholder(e,t){return e.value?`${e.value}`:``}visitIcuPlaceholder(e,t){return`${e.value.visit(this)}`}}const V=new F;class U extends F{visitIcu(e,t){let s=Object.keys(e.cases).map((t=>`${t} {${e.cases[t].visit(this)}}`));return`{${e.type}, ${s.join(", ")}}`}}function H(e,t,s,n){return e<20?[t&s|~t&n,1518500249]:e<40?[t^s^n,1859775393]:e<60?[t&s|t&n|s&n,2400959708]:[t^s^n,3395469782]}function j(e){const t=P(e);let s=z(t,0),n=z(t,102072);return 0!=s||0!=n&&1!=n||(s^=319790063,n^=-1801410264),[s,n]}function W(e,t=""){let s=j(e);if(t){const e=j(t);s=function(e,t){const s=e[0],n=e[1],r=t[0],i=t[1],a=Q(n,i),o=a[0],l=a[1];return[Y(Y(s,r),o),l]}(function(e,t){const s=e[0],n=e[1];return[s<>>32-t,n<>>32-t]}(s,1),e)}return function(e,t){const s=te.toThePowerOf(0).multiplyBy(t);return te.toThePowerOf(4).multiplyByAndAddTo(e,s),s.toString()}(2147483647&s[0],s[1])}function z(e,t){let s,n=2654435769,r=2654435769;const i=e.length;for(s=0;s+12<=i;s+=12){n=Y(n,ee(e,s,G.Little)),r=Y(r,ee(e,s+4,G.Little));const i=K(n,r,t=Y(t,ee(e,s+8,G.Little)));n=i[0],r=i[1],t=i[2]}return n=Y(n,ee(e,s,G.Little)),r=Y(r,ee(e,s+4,G.Little)),t=Y(t,i),K(n,r,t=Y(t,ee(e,s+8,G.Little)<<8))[2]}function K(e,t,s){return e=X(e,t),e=X(e,s),e^=s>>>13,t=X(t,s),t=X(t,e),t^=e<<8,s=X(s,e),s=X(s,t),s^=t>>>13,e=X(e,t),e=X(e,s),e^=s>>>12,t=X(t,s),t=X(t,e),t^=e<<16,s=X(s,e),s=X(s,t),s^=t>>>5,e=X(e,t),e=X(e,s),e^=s>>>3,t=X(t,s),t=X(t,e),t^=e<<10,s=X(s,e),s=X(s,t),[e,t,s^=t>>>15]}var G;function Y(e,t){return Q(e,t)[1]}function Q(e,t){const s=(65535&e)+(65535&t),n=(e>>>16)+(t>>>16)+(s>>>16);return[n>>>16,n<<16|65535&s]}function X(e,t){const s=(65535&e)-(65535&t);return(e>>16)-(t>>16)+(s>>16)<<16|65535&s}function J(e,t){return e<>>32-t}function Z(e,t){return t>=e.length?0:e[t]}function ee(e,t,s){let n=0;if(s===G.Big)for(let s=0;s<4;s++)n+=Z(e,t+s)<<24-8*s;else for(let s=0;s<4;s++)n+=Z(e,t+s)<<8*s;return n}!function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"}(G||(G={}));const te=new class{constructor(e){this.base=e,this.exponents=[new O(R.one())]}toThePowerOf(e){for(let t=this.exponents.length;t<=e;t++){const e=this.exponents[t-1].multiplyBy(this.base);this.exponents[t]=new O(e)}return this.exponents[e]}}(256);var se,ne;e.TypeModifier=void 0,(se=e.TypeModifier||(e.TypeModifier={}))[se.None=0]="None",se[se.Const=1]="Const";class re{constructor(t=e.TypeModifier.None){this.modifiers=t}hasModifier(e){return 0!=(this.modifiers&e)}}e.BuiltinTypeName=void 0,(ne=e.BuiltinTypeName||(e.BuiltinTypeName={}))[ne.Dynamic=0]="Dynamic",ne[ne.Bool=1]="Bool",ne[ne.String=2]="String",ne[ne.Int=3]="Int",ne[ne.Number=4]="Number",ne[ne.Function=5]="Function",ne[ne.Inferred=6]="Inferred",ne[ne.None=7]="None";class ie extends re{constructor(e,t){super(t),this.name=e}visitType(e,t){return e.visitBuiltinType(this,t)}}class ae extends re{constructor(e,t,s=null){super(t),this.value=e,this.typeParams=s}visitType(e,t){return e.visitExpressionType(this,t)}}class oe extends re{constructor(e,t){super(t),this.of=e}visitType(e,t){return e.visitArrayType(this,t)}}class le extends re{constructor(e,t){super(t),this.valueType=e||null}visitType(e,t){return e.visitMapType(this,t)}}const ce=new ie(e.BuiltinTypeName.Dynamic),ue=new ie(e.BuiltinTypeName.Inferred),pe=new ie(e.BuiltinTypeName.Bool),he=new ie(e.BuiltinTypeName.Int),de=new ie(e.BuiltinTypeName.Number),me=new ie(e.BuiltinTypeName.String),ge=new ie(e.BuiltinTypeName.Function),ve=new ie(e.BuiltinTypeName.None);var fe,ye;function xe(e,t){return null==e||null==t?e==t:e.isEquivalent(t)}function we(e,t,s){const n=e.length;if(n!==t.length)return!1;for(let r=0;re.isEquivalent(t)))}e.UnaryOperator=void 0,(fe=e.UnaryOperator||(e.UnaryOperator={}))[fe.Minus=0]="Minus",fe[fe.Plus=1]="Plus",e.BinaryOperator=void 0,(ye=e.BinaryOperator||(e.BinaryOperator={}))[ye.Equals=0]="Equals",ye[ye.NotEquals=1]="NotEquals",ye[ye.Identical=2]="Identical",ye[ye.NotIdentical=3]="NotIdentical",ye[ye.Minus=4]="Minus",ye[ye.Plus=5]="Plus",ye[ye.Divide=6]="Divide",ye[ye.Multiply=7]="Multiply",ye[ye.Modulo=8]="Modulo",ye[ye.And=9]="And",ye[ye.Or=10]="Or",ye[ye.BitwiseAnd=11]="BitwiseAnd",ye[ye.Lower=12]="Lower",ye[ye.LowerEquals=13]="LowerEquals",ye[ye.Bigger=14]="Bigger",ye[ye.BiggerEquals=15]="BiggerEquals",ye[ye.NullishCoalesce=16]="NullishCoalesce";class Ee{constructor(e,t){this.type=e||null,this.sourceSpan=t||null}prop(e,t){return new Qe(this,e,null,t)}key(e,t,s){return new Xe(this,e,t,s)}callFn(e,t,s){return new Ne(this,e,null,t,s)}instantiate(e,t,s){return new Ae(this,e,t,s)}conditional(e,t=null,s){return new je(this,e,t,null,s)}equals(t,s){return new Ye(e.BinaryOperator.Equals,this,t,null,s)}notEquals(t,s){return new Ye(e.BinaryOperator.NotEquals,this,t,null,s)}identical(t,s){return new Ye(e.BinaryOperator.Identical,this,t,null,s)}notIdentical(t,s){return new Ye(e.BinaryOperator.NotIdentical,this,t,null,s)}minus(t,s){return new Ye(e.BinaryOperator.Minus,this,t,null,s)}plus(t,s){return new Ye(e.BinaryOperator.Plus,this,t,null,s)}divide(t,s){return new Ye(e.BinaryOperator.Divide,this,t,null,s)}multiply(t,s){return new Ye(e.BinaryOperator.Multiply,this,t,null,s)}modulo(t,s){return new Ye(e.BinaryOperator.Modulo,this,t,null,s)}and(t,s){return new Ye(e.BinaryOperator.And,this,t,null,s)}bitwiseAnd(t,s,n=!0){return new Ye(e.BinaryOperator.BitwiseAnd,this,t,null,s,n)}or(t,s){return new Ye(e.BinaryOperator.Or,this,t,null,s)}lower(t,s){return new Ye(e.BinaryOperator.Lower,this,t,null,s)}lowerEquals(t,s){return new Ye(e.BinaryOperator.LowerEquals,this,t,null,s)}bigger(t,s){return new Ye(e.BinaryOperator.Bigger,this,t,null,s)}biggerEquals(t,s){return new Ye(e.BinaryOperator.BiggerEquals,this,t,null,s)}isBlank(e){return this.equals(nt,e)}nullishCoalesce(t,s){return new Ye(e.BinaryOperator.NullishCoalesce,this,t,null,s)}toStmt(){return new ut(this,null)}}class _e extends Ee{constructor(e,t,s){super(t,s),this.name=e}isEquivalent(e){return e instanceof _e&&this.name===e.name}isConstant(){return!1}visitExpression(e,t){return e.visitReadVarExpr(this,t)}set(e){return new Ce(this.name,e,null,this.sourceSpan)}}class be extends Ee{constructor(e,t,s){super(t,s),this.expr=e}visitExpression(e,t){return e.visitTypeofExpr(this,t)}isEquivalent(e){return e instanceof be&&e.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}}class Te extends Ee{constructor(e,t,s){super(t,s),this.node=e}isEquivalent(e){return e instanceof Te&&this.node===e.node}isConstant(){return!1}visitExpression(e,t){return e.visitWrappedNodeExpr(this,t)}}class Ce extends Ee{constructor(e,t,s,n){super(s||t.type,n),this.name=e,this.value=t}isEquivalent(e){return e instanceof Ce&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return!1}visitExpression(e,t){return e.visitWriteVarExpr(this,t)}toDeclStmt(e,t){return new lt(this.name,this.value,e,t,this.sourceSpan)}toConstDecl(){return this.toDeclStmt(ue,e.StmtModifier.Final)}}class Ie extends Ee{constructor(e,t,s,n,r){super(n||s.type,r),this.receiver=e,this.index=t,this.value=s}isEquivalent(e){return e instanceof Ie&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)&&this.value.isEquivalent(e.value)}isConstant(){return!1}visitExpression(e,t){return e.visitWriteKeyExpr(this,t)}}class ke extends Ee{constructor(e,t,s,n,r){super(n||s.type,r),this.receiver=e,this.name=t,this.value=s}isEquivalent(e){return e instanceof ke&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name&&this.value.isEquivalent(e.value)}isConstant(){return!1}visitExpression(e,t){return e.visitWritePropExpr(this,t)}}class Ne extends Ee{constructor(e,t,s,n,r=!1){super(s,n),this.fn=e,this.args=t,this.pure=r}isEquivalent(e){return e instanceof Ne&&this.fn.isEquivalent(e.fn)&&Se(this.args,e.args)&&this.pure===e.pure}isConstant(){return!1}visitExpression(e,t){return e.visitInvokeFunctionExpr(this,t)}}class Pe extends Ee{constructor(e,t,s,n){super(s,n),this.tag=e,this.template=t}isEquivalent(e){return e instanceof Pe&&this.tag.isEquivalent(e.tag)&&we(this.template.elements,e.template.elements,((e,t)=>e.text===t.text))&&Se(this.template.expressions,e.template.expressions)}isConstant(){return!1}visitExpression(e,t){return e.visitTaggedTemplateExpr(this,t)}}class Ae extends Ee{constructor(e,t,s,n){super(s,n),this.classExpr=e,this.args=t}isEquivalent(e){return e instanceof Ae&&this.classExpr.isEquivalent(e.classExpr)&&Se(this.args,e.args)}isConstant(){return!1}visitExpression(e,t){return e.visitInstantiateExpr(this,t)}}class Le extends Ee{constructor(e,t,s){super(t,s),this.value=e}isEquivalent(e){return e instanceof Le&&this.value===e.value}isConstant(){return!0}visitExpression(e,t){return e.visitLiteralExpr(this,t)}}class Me{constructor(e,t){this.elements=e,this.expressions=t}}class Re{constructor(e,t,s){this.text=e,this.sourceSpan=t,this.rawText=s??t?.toString()??Fe(Be(e))}}class Oe{constructor(e,t){this.text=e,this.sourceSpan=t}}class $e{constructor(e,t,s){this.text=e,this.sourceSpan=t,this.associatedMessage=s}}class De extends Ee{constructor(e,t,s,n,r){super(me,r),this.metaBlock=e,this.messageParts=t,this.placeHolderNames=s,this.expressions=n}isEquivalent(e){return!1}isConstant(){return!1}visitExpression(e,t){return e.visitLocalizedString(this,t)}serializeI18nHead(){let e=this.metaBlock.description||"";return this.metaBlock.meaning&&(e=`${this.metaBlock.meaning}|${e}`),this.metaBlock.customId&&(e=`${e}@@${this.metaBlock.customId}`),this.metaBlock.legacyIds&&this.metaBlock.legacyIds.forEach((t=>{e=`${e}␟${t}`})),Ve(e,this.messageParts[0].text,this.getMessagePartSourceSpan(0))}getMessagePartSourceSpan(e){return this.messageParts[e]?.sourceSpan??this.sourceSpan}getPlaceholderSourceSpan(e){return this.placeHolderNames[e]?.sourceSpan??this.expressions[e]?.sourceSpan??this.sourceSpan}serializeI18nTemplatePart(e){const t=this.placeHolderNames[e-1],s=this.messageParts[e];let n=t.text;return 0===t.associatedMessage?.legacyIds.length&&(n+=`@@${W(t.associatedMessage.messageString,t.associatedMessage.meaning)}`),Ve(n,s.text,this.getMessagePartSourceSpan(e))}}const Be=e=>e.replace(/\\/g,"\\\\"),qe=e=>e.replace(/:/g,"\\:"),Fe=e=>e.replace(/`/g,"\\`").replace(/\${/g,"$\\{");function Ve(e,t,s){return""===e?{cooked:t,raw:Fe((n=Be(t),n.replace(/^:/,"\\:"))),range:s}:{cooked:`:${e}:${t}`,raw:Fe(`:${qe(Be(e))}:${Be(t)}`),range:s};var n}class Ue extends Ee{constructor(e,t,s=null,n){super(t,n),this.value=e,this.typeParams=s}isEquivalent(e){return e instanceof Ue&&this.value.name===e.value.name&&this.value.moduleName===e.value.moduleName&&this.value.runtime===e.value.runtime}isConstant(){return!1}visitExpression(e,t){return e.visitExternalExpr(this,t)}}class He{constructor(e,t,s){this.moduleName=e,this.name=t,this.runtime=s}}class je extends Ee{constructor(e,t,s=null,n,r){super(n||t.type,r),this.condition=e,this.falseCase=s,this.trueCase=t}isEquivalent(e){return e instanceof je&&this.condition.isEquivalent(e.condition)&&this.trueCase.isEquivalent(e.trueCase)&&xe(this.falseCase,e.falseCase)}isConstant(){return!1}visitExpression(e,t){return e.visitConditionalExpr(this,t)}}class We extends Ee{constructor(e,t){super(pe,t),this.condition=e}isEquivalent(e){return e instanceof We&&this.condition.isEquivalent(e.condition)}isConstant(){return!1}visitExpression(e,t){return e.visitNotExpr(this,t)}}class ze{constructor(e,t=null){this.name=e,this.type=t}isEquivalent(e){return this.name===e.name}}class Ke extends Ee{constructor(e,t,s,n,r){super(s,n),this.params=e,this.statements=t,this.name=r}isEquivalent(e){return e instanceof Ke&&Se(this.params,e.params)&&Se(this.statements,e.statements)}isConstant(){return!1}visitExpression(e,t){return e.visitFunctionExpr(this,t)}toDeclStmt(e,t){return new ct(e,this.params,this.statements,this.type,t,this.sourceSpan)}}class Ge extends Ee{constructor(e,t,s,n,r=!0){super(s||de,n),this.operator=e,this.expr=t,this.parens=r}isEquivalent(e){return e instanceof Ge&&this.operator===e.operator&&this.expr.isEquivalent(e.expr)}isConstant(){return!1}visitExpression(e,t){return e.visitUnaryOperatorExpr(this,t)}}class Ye extends Ee{constructor(e,t,s,n,r,i=!0){super(n||t.type,r),this.operator=e,this.rhs=s,this.parens=i,this.lhs=t}isEquivalent(e){return e instanceof Ye&&this.operator===e.operator&&this.lhs.isEquivalent(e.lhs)&&this.rhs.isEquivalent(e.rhs)}isConstant(){return!1}visitExpression(e,t){return e.visitBinaryOperatorExpr(this,t)}}class Qe extends Ee{constructor(e,t,s,n){super(s,n),this.receiver=e,this.name=t}isEquivalent(e){return e instanceof Qe&&this.receiver.isEquivalent(e.receiver)&&this.name===e.name}isConstant(){return!1}visitExpression(e,t){return e.visitReadPropExpr(this,t)}set(e){return new ke(this.receiver,this.name,e,null,this.sourceSpan)}}class Xe extends Ee{constructor(e,t,s,n){super(s,n),this.receiver=e,this.index=t}isEquivalent(e){return e instanceof Xe&&this.receiver.isEquivalent(e.receiver)&&this.index.isEquivalent(e.index)}isConstant(){return!1}visitExpression(e,t){return e.visitReadKeyExpr(this,t)}set(e){return new Ie(this.receiver,this.index,e,null,this.sourceSpan)}}class Je extends Ee{constructor(e,t,s){super(t,s),this.entries=e}isConstant(){return this.entries.every((e=>e.isConstant()))}isEquivalent(e){return e instanceof Je&&Se(this.entries,e.entries)}visitExpression(e,t){return e.visitLiteralArrayExpr(this,t)}}class Ze{constructor(e,t,s){this.key=e,this.value=t,this.quoted=s}isEquivalent(e){return this.key===e.key&&this.value.isEquivalent(e.value)}}class et extends Ee{constructor(e,t,s){super(t,s),this.entries=e,this.valueType=null,t&&(this.valueType=t.valueType)}isEquivalent(e){return e instanceof et&&Se(this.entries,e.entries)}isConstant(){return this.entries.every((e=>e.value.isConstant()))}visitExpression(e,t){return e.visitLiteralMapExpr(this,t)}}class tt extends Ee{constructor(e,t){super(e[e.length-1].type,t),this.parts=e}isEquivalent(e){return e instanceof tt&&Se(this.parts,e.parts)}isConstant(){return!1}visitExpression(e,t){return e.visitCommaExpr(this,t)}}const st=new Le(null,null,null),nt=new Le(null,ue,null);var rt;e.StmtModifier=void 0,(rt=e.StmtModifier||(e.StmtModifier={}))[rt.None=0]="None",rt[rt.Final=1]="Final",rt[rt.Private=2]="Private",rt[rt.Exported=4]="Exported",rt[rt.Static=8]="Static";class it{constructor(e,t,s){this.text=e,this.multiline=t,this.trailingNewline=s}toString(){return this.multiline?` ${this.text} `:this.text}}class at extends it{constructor(e){super("",!0,!0),this.tags=e}toString(){return function(e){if(0===e.length)return"";if(1===e.length&&e[0].tagName&&!e[0].text)return`*${kt(e[0])} `;let t="*\n";for(const s of e)t+=" *",t+=kt(s).replace(/\n/g,"\n * "),t+="\n";return t+=" ",t}(this.tags)}}class ot{constructor(t=e.StmtModifier.None,s=null,n){this.modifiers=t,this.sourceSpan=s,this.leadingComments=n}hasModifier(e){return 0!=(this.modifiers&e)}addLeadingComment(e){this.leadingComments=this.leadingComments??[],this.leadingComments.push(e)}}class lt extends ot{constructor(e,t,s,n,r,i){super(n,r,i),this.name=e,this.value=t,this.type=s||t&&t.type||null}isEquivalent(e){return e instanceof lt&&this.name===e.name&&(this.value?!!e.value&&this.value.isEquivalent(e.value):!e.value)}visitStatement(e,t){return e.visitDeclareVarStmt(this,t)}}class ct extends ot{constructor(e,t,s,n,r,i,a){super(r,i,a),this.name=e,this.params=t,this.statements=s,this.type=n||null}isEquivalent(e){return e instanceof ct&&Se(this.params,e.params)&&Se(this.statements,e.statements)}visitStatement(e,t){return e.visitDeclareFunctionStmt(this,t)}}class ut extends ot{constructor(t,s,n){super(e.StmtModifier.None,s,n),this.expr=t}isEquivalent(e){return e instanceof ut&&this.expr.isEquivalent(e.expr)}visitStatement(e,t){return e.visitExpressionStmt(this,t)}}class pt extends ot{constructor(t,s=null,n){super(e.StmtModifier.None,s,n),this.value=t}isEquivalent(e){return e instanceof pt&&this.value.isEquivalent(e.value)}visitStatement(e,t){return e.visitReturnStmt(this,t)}}class ht extends ot{constructor(t,s,n=[],r,i){super(e.StmtModifier.None,r,i),this.condition=t,this.trueCase=s,this.falseCase=n}isEquivalent(e){return e instanceof ht&&this.condition.isEquivalent(e.condition)&&Se(this.trueCase,e.trueCase)&&Se(this.falseCase,e.falseCase)}visitStatement(e,t){return e.visitIfStmt(this,t)}}function dt(e,t=!1,s=!0){return new it(e,t,s)}function mt(e=[]){return new at(e)}function gt(e,t,s){return new _e(e,t,s)}function vt(e,t=null,s){return new Ue(e,null,t,s)}function ft(e,t,s){return new ae(e,t,s)}function yt(e){return new be(e)}function xt(e,t,s){return new Je(e,t,s)}function wt(e,t=null){return new et(e.map((e=>new Ze(e.key,e.value,e.quoted))),t,null)}function St(e,t){return new We(e,t)}function Et(e,t,s,n,r){return new Ke(e,t,s,n,r)}function _t(e,t,s,n,r){return new ht(e,t,s,n,r)}function bt(e,t,s,n){return new Pe(e,t,s,n)}function Tt(e,t,s){return new Le(e,t,s)}function Ct(e,t,s,n,r){return new De(e,t,s,n,r)}function It(e){return e instanceof Le&&null===e.value}function kt(e){let t="";if(e.tagName&&(t+=` @${e.tagName}`),e.text){if(e.text.match(/\/\*|\*\//))throw new Error('JSDoc text cannot contain "/*" and "*/"');t+=" "+e.text.replace(/@/g,"\\@")}return t}var Nt=Object.freeze({__proto__:null,get TypeModifier(){return e.TypeModifier},Type:re,get BuiltinTypeName(){return e.BuiltinTypeName},BuiltinType:ie,ExpressionType:ae,ArrayType:oe,MapType:le,DYNAMIC_TYPE:ce,INFERRED_TYPE:ue,BOOL_TYPE:pe,INT_TYPE:he,NUMBER_TYPE:de,STRING_TYPE:me,FUNCTION_TYPE:ge,NONE_TYPE:ve,get UnaryOperator(){return e.UnaryOperator},get BinaryOperator(){return e.BinaryOperator},nullSafeIsEquivalent:xe,areAllEquivalent:Se,Expression:Ee,ReadVarExpr:_e,TypeofExpr:be,WrappedNodeExpr:Te,WriteVarExpr:Ce,WriteKeyExpr:Ie,WritePropExpr:ke,InvokeFunctionExpr:Ne,TaggedTemplateExpr:Pe,InstantiateExpr:Ae,LiteralExpr:Le,TemplateLiteral:Me,TemplateLiteralElement:Re,LiteralPiece:Oe,PlaceholderPiece:$e,LocalizedString:De,ExternalExpr:Ue,ExternalReference:He,ConditionalExpr:je,NotExpr:We,FnParam:ze,FunctionExpr:Ke,UnaryOperatorExpr:Ge,BinaryOperatorExpr:Ye,ReadPropExpr:Qe,ReadKeyExpr:Xe,LiteralArrayExpr:Je,LiteralMapEntry:Ze,LiteralMapExpr:et,CommaExpr:tt,NULL_EXPR:st,TYPED_NULL_EXPR:nt,get StmtModifier(){return e.StmtModifier},LeadingComment:it,JSDocComment:at,Statement:ot,DeclareVarStmt:lt,DeclareFunctionStmt:ct,ExpressionStatement:ut,ReturnStatement:pt,IfStmt:ht,RecursiveAstVisitor:class{visitType(e,t){return e}visitExpression(e,t){return e.type&&e.type.visitType(this,t),e}visitBuiltinType(e,t){return this.visitType(e,t)}visitExpressionType(e,t){return e.value.visitExpression(this,t),null!==e.typeParams&&e.typeParams.forEach((e=>this.visitType(e,t))),this.visitType(e,t)}visitArrayType(e,t){return this.visitType(e,t)}visitMapType(e,t){return this.visitType(e,t)}visitWrappedNodeExpr(e,t){return e}visitTypeofExpr(e,t){return this.visitExpression(e,t)}visitReadVarExpr(e,t){return this.visitExpression(e,t)}visitWriteVarExpr(e,t){return e.value.visitExpression(this,t),this.visitExpression(e,t)}visitWriteKeyExpr(e,t){return e.receiver.visitExpression(this,t),e.index.visitExpression(this,t),e.value.visitExpression(this,t),this.visitExpression(e,t)}visitWritePropExpr(e,t){return e.receiver.visitExpression(this,t),e.value.visitExpression(this,t),this.visitExpression(e,t)}visitInvokeFunctionExpr(e,t){return e.fn.visitExpression(this,t),this.visitAllExpressions(e.args,t),this.visitExpression(e,t)}visitTaggedTemplateExpr(e,t){return e.tag.visitExpression(this,t),this.visitAllExpressions(e.template.expressions,t),this.visitExpression(e,t)}visitInstantiateExpr(e,t){return e.classExpr.visitExpression(this,t),this.visitAllExpressions(e.args,t),this.visitExpression(e,t)}visitLiteralExpr(e,t){return this.visitExpression(e,t)}visitLocalizedString(e,t){return this.visitExpression(e,t)}visitExternalExpr(e,t){return e.typeParams&&e.typeParams.forEach((e=>e.visitType(this,t))),this.visitExpression(e,t)}visitConditionalExpr(e,t){return e.condition.visitExpression(this,t),e.trueCase.visitExpression(this,t),e.falseCase.visitExpression(this,t),this.visitExpression(e,t)}visitNotExpr(e,t){return e.condition.visitExpression(this,t),this.visitExpression(e,t)}visitFunctionExpr(e,t){return this.visitAllStatements(e.statements,t),this.visitExpression(e,t)}visitUnaryOperatorExpr(e,t){return e.expr.visitExpression(this,t),this.visitExpression(e,t)}visitBinaryOperatorExpr(e,t){return e.lhs.visitExpression(this,t),e.rhs.visitExpression(this,t),this.visitExpression(e,t)}visitReadPropExpr(e,t){return e.receiver.visitExpression(this,t),this.visitExpression(e,t)}visitReadKeyExpr(e,t){return e.receiver.visitExpression(this,t),e.index.visitExpression(this,t),this.visitExpression(e,t)}visitLiteralArrayExpr(e,t){return this.visitAllExpressions(e.entries,t),this.visitExpression(e,t)}visitLiteralMapExpr(e,t){return e.entries.forEach((e=>e.value.visitExpression(this,t))),this.visitExpression(e,t)}visitCommaExpr(e,t){return this.visitAllExpressions(e.parts,t),this.visitExpression(e,t)}visitAllExpressions(e,t){e.forEach((e=>e.visitExpression(this,t)))}visitDeclareVarStmt(e,t){return e.value&&e.value.visitExpression(this,t),e.type&&e.type.visitType(this,t),e}visitDeclareFunctionStmt(e,t){return this.visitAllStatements(e.statements,t),e.type&&e.type.visitType(this,t),e}visitExpressionStmt(e,t){return e.expr.visitExpression(this,t),e}visitReturnStmt(e,t){return e.value.visitExpression(this,t),e}visitIfStmt(e,t){return e.condition.visitExpression(this,t),this.visitAllStatements(e.trueCase,t),this.visitAllStatements(e.falseCase,t),e}visitAllStatements(e,t){e.forEach((e=>e.visitStatement(this,t)))}},leadingComment:dt,jsDocComment:mt,variable:gt,importExpr:vt,importType:function(e,t,s){return null!=e?ft(vt(e,t,null),s):null},expressionType:ft,typeofExpr:yt,literalArr:xt,literalMap:wt,unary:function(e,t,s,n){return new Ge(e,t,s,n)},not:St,fn:Et,ifStmt:_t,taggedTemplate:bt,literal:Tt,localizedString:Ct,isNull:It});const Pt=gt(""),At={};class Lt extends Ee{constructor(e){super(e.type),this.resolved=e,this.original=e}visitExpression(e,t){return t===At?this.original.visitExpression(e,t):this.resolved.visitExpression(e,t)}isEquivalent(e){return e instanceof Lt&&this.resolved.isEquivalent(e.resolved)}isConstant(){return!0}fixup(e){this.resolved=e,this.shared=!0}}class Mt{constructor(e=!1){this.isClosureCompilerEnabled=e,this.statements=[],this.literals=new Map,this.literalFactories=new Map,this.nextNameIndex=0}getConstLiteral(t,s){if(t instanceof Le&&!Dt(t)||t instanceof Lt)return t;const n=this.keyOf(t);let r=this.literals.get(n),i=!1;if(r||(r=new Lt(t),this.literals.set(n,r),i=!0),!i&&!r.shared||i&&s){const s=this.freshName();let n,i;this.isClosureCompilerEnabled&&Dt(t)?(n=gt(s).set(new Ke([],[new pt(t)])),i=gt(s).callFn([])):(n=gt(s).set(t),i=gt(s)),this.statements.push(n.toDeclStmt(ue,e.StmtModifier.Final)),r.fixup(i)}return r}getLiteralFactory(e){if(e instanceof Je){const t=e.entries.map((e=>e.isConstant()?e:Pt)),s=this.keyOf(xt(t));return this._getLiteralFactory(s,e.entries,(e=>xt(e)))}{const t=wt(e.entries.map((e=>({key:e.key,value:e.value.isConstant()?e.value:Pt,quoted:e.quoted})))),s=this.keyOf(t);return this._getLiteralFactory(s,e.entries.map((e=>e.value)),(t=>wt(t.map(((t,s)=>({key:e.entries[s].key,value:t,quoted:e.entries[s].quoted}))))))}}_getLiteralFactory(t,s,n){let r=this.literalFactories.get(t);const i=s.filter((e=>!e.isConstant()));if(!r){const i=s.map(((e,t)=>e.isConstant()?this.getConstLiteral(e,!0):gt(`a${t}`))),a=Et(i.filter($t).map((e=>new ze(e.name,ce))),[new pt(n(i))],ue),o=this.freshName();this.statements.push(gt(o).set(a).toDeclStmt(ue,e.StmtModifier.Final)),r=gt(o),this.literalFactories.set(t,r)}return{literalFactory:r,literalFactoryArguments:i}}uniqueName(e){return`${e}${this.nextNameIndex++}`}freshName(){return this.uniqueName("_c")}keyOf(e){return e.visitExpression(new Rt,At)}}class Rt{constructor(){this.visitWrappedNodeExpr=Ot,this.visitWriteVarExpr=Ot,this.visitWriteKeyExpr=Ot,this.visitWritePropExpr=Ot,this.visitInvokeFunctionExpr=Ot,this.visitTaggedTemplateExpr=Ot,this.visitInstantiateExpr=Ot,this.visitConditionalExpr=Ot,this.visitNotExpr=Ot,this.visitAssertNotNullExpr=Ot,this.visitCastExpr=Ot,this.visitFunctionExpr=Ot,this.visitUnaryOperatorExpr=Ot,this.visitBinaryOperatorExpr=Ot,this.visitReadPropExpr=Ot,this.visitReadKeyExpr=Ot,this.visitCommaExpr=Ot,this.visitLocalizedString=Ot}visitLiteralExpr(e){return`${"string"==typeof e.value?'"'+e.value+'"':e.value}`}visitLiteralArrayExpr(e,t){return`[${e.entries.map((e=>e.visitExpression(this,t))).join(",")}]`}visitLiteralMapExpr(e,t){return`{${e.entries.map((e=>`${(e=>{const t=e.quoted?'"':"";return`${t}${e.key}${t}`})(e)}:${e.value.visitExpression(this,t)}`)).join(",")}`}visitExternalExpr(e){return e.value.moduleName?`EX:${e.value.moduleName}:${e.value.name}`:`EX:${e.value.runtime.name}`}visitReadVarExpr(e){return`VAR:${e.name}`}visitTypeofExpr(e,t){return`TYPEOF:${e.expr.visitExpression(this,t)}`}}function Ot(e){throw new Error(`Invalid state: Visitor ${this.constructor.name} doesn't handle ${e.constructor.name}`)}function $t(e){return e instanceof _e}function Dt(e){return e instanceof Le&&"string"==typeof e.value&&e.value.length>=50}const Bt="@angular/core";class qt{}qt.NEW_METHOD="factory",qt.TRANSFORM_METHOD="transform",qt.PATCH_DEPS="patchedDeps",qt.core={name:null,moduleName:Bt},qt.namespaceHTML={name:"ɵɵnamespaceHTML",moduleName:Bt},qt.namespaceMathML={name:"ɵɵnamespaceMathML",moduleName:Bt},qt.namespaceSVG={name:"ɵɵnamespaceSVG",moduleName:Bt},qt.element={name:"ɵɵelement",moduleName:Bt},qt.elementStart={name:"ɵɵelementStart",moduleName:Bt},qt.elementEnd={name:"ɵɵelementEnd",moduleName:Bt},qt.advance={name:"ɵɵadvance",moduleName:Bt},qt.syntheticHostProperty={name:"ɵɵsyntheticHostProperty",moduleName:Bt},qt.syntheticHostListener={name:"ɵɵsyntheticHostListener",moduleName:Bt},qt.attribute={name:"ɵɵattribute",moduleName:Bt},qt.attributeInterpolate1={name:"ɵɵattributeInterpolate1",moduleName:Bt},qt.attributeInterpolate2={name:"ɵɵattributeInterpolate2",moduleName:Bt},qt.attributeInterpolate3={name:"ɵɵattributeInterpolate3",moduleName:Bt},qt.attributeInterpolate4={name:"ɵɵattributeInterpolate4",moduleName:Bt},qt.attributeInterpolate5={name:"ɵɵattributeInterpolate5",moduleName:Bt},qt.attributeInterpolate6={name:"ɵɵattributeInterpolate6",moduleName:Bt},qt.attributeInterpolate7={name:"ɵɵattributeInterpolate7",moduleName:Bt},qt.attributeInterpolate8={name:"ɵɵattributeInterpolate8",moduleName:Bt},qt.attributeInterpolateV={name:"ɵɵattributeInterpolateV",moduleName:Bt},qt.classProp={name:"ɵɵclassProp",moduleName:Bt},qt.elementContainerStart={name:"ɵɵelementContainerStart",moduleName:Bt},qt.elementContainerEnd={name:"ɵɵelementContainerEnd",moduleName:Bt},qt.elementContainer={name:"ɵɵelementContainer",moduleName:Bt},qt.styleMap={name:"ɵɵstyleMap",moduleName:Bt},qt.styleMapInterpolate1={name:"ɵɵstyleMapInterpolate1",moduleName:Bt},qt.styleMapInterpolate2={name:"ɵɵstyleMapInterpolate2",moduleName:Bt},qt.styleMapInterpolate3={name:"ɵɵstyleMapInterpolate3",moduleName:Bt},qt.styleMapInterpolate4={name:"ɵɵstyleMapInterpolate4",moduleName:Bt},qt.styleMapInterpolate5={name:"ɵɵstyleMapInterpolate5",moduleName:Bt},qt.styleMapInterpolate6={name:"ɵɵstyleMapInterpolate6",moduleName:Bt},qt.styleMapInterpolate7={name:"ɵɵstyleMapInterpolate7",moduleName:Bt},qt.styleMapInterpolate8={name:"ɵɵstyleMapInterpolate8",moduleName:Bt},qt.styleMapInterpolateV={name:"ɵɵstyleMapInterpolateV",moduleName:Bt},qt.classMap={name:"ɵɵclassMap",moduleName:Bt},qt.classMapInterpolate1={name:"ɵɵclassMapInterpolate1",moduleName:Bt},qt.classMapInterpolate2={name:"ɵɵclassMapInterpolate2",moduleName:Bt},qt.classMapInterpolate3={name:"ɵɵclassMapInterpolate3",moduleName:Bt},qt.classMapInterpolate4={name:"ɵɵclassMapInterpolate4",moduleName:Bt},qt.classMapInterpolate5={name:"ɵɵclassMapInterpolate5",moduleName:Bt},qt.classMapInterpolate6={name:"ɵɵclassMapInterpolate6",moduleName:Bt},qt.classMapInterpolate7={name:"ɵɵclassMapInterpolate7",moduleName:Bt},qt.classMapInterpolate8={name:"ɵɵclassMapInterpolate8",moduleName:Bt},qt.classMapInterpolateV={name:"ɵɵclassMapInterpolateV",moduleName:Bt},qt.styleProp={name:"ɵɵstyleProp",moduleName:Bt},qt.stylePropInterpolate1={name:"ɵɵstylePropInterpolate1",moduleName:Bt},qt.stylePropInterpolate2={name:"ɵɵstylePropInterpolate2",moduleName:Bt},qt.stylePropInterpolate3={name:"ɵɵstylePropInterpolate3",moduleName:Bt},qt.stylePropInterpolate4={name:"ɵɵstylePropInterpolate4",moduleName:Bt},qt.stylePropInterpolate5={name:"ɵɵstylePropInterpolate5",moduleName:Bt},qt.stylePropInterpolate6={name:"ɵɵstylePropInterpolate6",moduleName:Bt},qt.stylePropInterpolate7={name:"ɵɵstylePropInterpolate7",moduleName:Bt},qt.stylePropInterpolate8={name:"ɵɵstylePropInterpolate8",moduleName:Bt},qt.stylePropInterpolateV={name:"ɵɵstylePropInterpolateV",moduleName:Bt},qt.nextContext={name:"ɵɵnextContext",moduleName:Bt},qt.resetView={name:"ɵɵresetView",moduleName:Bt},qt.templateCreate={name:"ɵɵtemplate",moduleName:Bt},qt.text={name:"ɵɵtext",moduleName:Bt},qt.enableBindings={name:"ɵɵenableBindings",moduleName:Bt},qt.disableBindings={name:"ɵɵdisableBindings",moduleName:Bt},qt.getCurrentView={name:"ɵɵgetCurrentView",moduleName:Bt},qt.textInterpolate={name:"ɵɵtextInterpolate",moduleName:Bt},qt.textInterpolate1={name:"ɵɵtextInterpolate1",moduleName:Bt},qt.textInterpolate2={name:"ɵɵtextInterpolate2",moduleName:Bt},qt.textInterpolate3={name:"ɵɵtextInterpolate3",moduleName:Bt},qt.textInterpolate4={name:"ɵɵtextInterpolate4",moduleName:Bt},qt.textInterpolate5={name:"ɵɵtextInterpolate5",moduleName:Bt},qt.textInterpolate6={name:"ɵɵtextInterpolate6",moduleName:Bt},qt.textInterpolate7={name:"ɵɵtextInterpolate7",moduleName:Bt},qt.textInterpolate8={name:"ɵɵtextInterpolate8",moduleName:Bt},qt.textInterpolateV={name:"ɵɵtextInterpolateV",moduleName:Bt},qt.restoreView={name:"ɵɵrestoreView",moduleName:Bt},qt.pureFunction0={name:"ɵɵpureFunction0",moduleName:Bt},qt.pureFunction1={name:"ɵɵpureFunction1",moduleName:Bt},qt.pureFunction2={name:"ɵɵpureFunction2",moduleName:Bt},qt.pureFunction3={name:"ɵɵpureFunction3",moduleName:Bt},qt.pureFunction4={name:"ɵɵpureFunction4",moduleName:Bt},qt.pureFunction5={name:"ɵɵpureFunction5",moduleName:Bt},qt.pureFunction6={name:"ɵɵpureFunction6",moduleName:Bt},qt.pureFunction7={name:"ɵɵpureFunction7",moduleName:Bt},qt.pureFunction8={name:"ɵɵpureFunction8",moduleName:Bt},qt.pureFunctionV={name:"ɵɵpureFunctionV",moduleName:Bt},qt.pipeBind1={name:"ɵɵpipeBind1",moduleName:Bt},qt.pipeBind2={name:"ɵɵpipeBind2",moduleName:Bt},qt.pipeBind3={name:"ɵɵpipeBind3",moduleName:Bt},qt.pipeBind4={name:"ɵɵpipeBind4",moduleName:Bt},qt.pipeBindV={name:"ɵɵpipeBindV",moduleName:Bt},qt.hostProperty={name:"ɵɵhostProperty",moduleName:Bt},qt.property={name:"ɵɵproperty",moduleName:Bt},qt.propertyInterpolate={name:"ɵɵpropertyInterpolate",moduleName:Bt},qt.propertyInterpolate1={name:"ɵɵpropertyInterpolate1",moduleName:Bt},qt.propertyInterpolate2={name:"ɵɵpropertyInterpolate2",moduleName:Bt},qt.propertyInterpolate3={name:"ɵɵpropertyInterpolate3",moduleName:Bt},qt.propertyInterpolate4={name:"ɵɵpropertyInterpolate4",moduleName:Bt},qt.propertyInterpolate5={name:"ɵɵpropertyInterpolate5",moduleName:Bt},qt.propertyInterpolate6={name:"ɵɵpropertyInterpolate6",moduleName:Bt},qt.propertyInterpolate7={name:"ɵɵpropertyInterpolate7",moduleName:Bt},qt.propertyInterpolate8={name:"ɵɵpropertyInterpolate8",moduleName:Bt},qt.propertyInterpolateV={name:"ɵɵpropertyInterpolateV",moduleName:Bt},qt.i18n={name:"ɵɵi18n",moduleName:Bt},qt.i18nAttributes={name:"ɵɵi18nAttributes",moduleName:Bt},qt.i18nExp={name:"ɵɵi18nExp",moduleName:Bt},qt.i18nStart={name:"ɵɵi18nStart",moduleName:Bt},qt.i18nEnd={name:"ɵɵi18nEnd",moduleName:Bt},qt.i18nApply={name:"ɵɵi18nApply",moduleName:Bt},qt.i18nPostprocess={name:"ɵɵi18nPostprocess",moduleName:Bt},qt.pipe={name:"ɵɵpipe",moduleName:Bt},qt.projection={name:"ɵɵprojection",moduleName:Bt},qt.projectionDef={name:"ɵɵprojectionDef",moduleName:Bt},qt.reference={name:"ɵɵreference",moduleName:Bt},qt.inject={name:"ɵɵinject",moduleName:Bt},qt.injectAttribute={name:"ɵɵinjectAttribute",moduleName:Bt},qt.directiveInject={name:"ɵɵdirectiveInject",moduleName:Bt},qt.invalidFactory={name:"ɵɵinvalidFactory",moduleName:Bt},qt.invalidFactoryDep={name:"ɵɵinvalidFactoryDep",moduleName:Bt},qt.templateRefExtractor={name:"ɵɵtemplateRefExtractor",moduleName:Bt},qt.forwardRef={name:"forwardRef",moduleName:Bt},qt.resolveForwardRef={name:"resolveForwardRef",moduleName:Bt},qt.ɵɵdefineInjectable={name:"ɵɵdefineInjectable",moduleName:Bt},qt.declareInjectable={name:"ɵɵngDeclareInjectable",moduleName:Bt},qt.InjectableDeclaration={name:"ɵɵInjectableDeclaration",moduleName:Bt},qt.resolveWindow={name:"ɵɵresolveWindow",moduleName:Bt},qt.resolveDocument={name:"ɵɵresolveDocument",moduleName:Bt},qt.resolveBody={name:"ɵɵresolveBody",moduleName:Bt},qt.defineComponent={name:"ɵɵdefineComponent",moduleName:Bt},qt.declareComponent={name:"ɵɵngDeclareComponent",moduleName:Bt},qt.setComponentScope={name:"ɵɵsetComponentScope",moduleName:Bt},qt.ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleName:Bt},qt.ViewEncapsulation={name:"ViewEncapsulation",moduleName:Bt},qt.ComponentDeclaration={name:"ɵɵComponentDeclaration",moduleName:Bt},qt.FactoryDeclaration={name:"ɵɵFactoryDeclaration",moduleName:Bt},qt.declareFactory={name:"ɵɵngDeclareFactory",moduleName:Bt},qt.FactoryTarget={name:"ɵɵFactoryTarget",moduleName:Bt},qt.defineDirective={name:"ɵɵdefineDirective",moduleName:Bt},qt.declareDirective={name:"ɵɵngDeclareDirective",moduleName:Bt},qt.DirectiveDeclaration={name:"ɵɵDirectiveDeclaration",moduleName:Bt},qt.InjectorDef={name:"ɵɵInjectorDef",moduleName:Bt},qt.InjectorDeclaration={name:"ɵɵInjectorDeclaration",moduleName:Bt},qt.defineInjector={name:"ɵɵdefineInjector",moduleName:Bt},qt.declareInjector={name:"ɵɵngDeclareInjector",moduleName:Bt},qt.NgModuleDeclaration={name:"ɵɵNgModuleDeclaration",moduleName:Bt},qt.ModuleWithProviders={name:"ModuleWithProviders",moduleName:Bt},qt.defineNgModule={name:"ɵɵdefineNgModule",moduleName:Bt},qt.declareNgModule={name:"ɵɵngDeclareNgModule",moduleName:Bt},qt.setNgModuleScope={name:"ɵɵsetNgModuleScope",moduleName:Bt},qt.registerNgModuleType={name:"ɵɵregisterNgModuleType",moduleName:Bt},qt.PipeDeclaration={name:"ɵɵPipeDeclaration",moduleName:Bt},qt.definePipe={name:"ɵɵdefinePipe",moduleName:Bt},qt.declarePipe={name:"ɵɵngDeclarePipe",moduleName:Bt},qt.declareClassMetadata={name:"ɵɵngDeclareClassMetadata",moduleName:Bt},qt.setClassMetadata={name:"ɵsetClassMetadata",moduleName:Bt},qt.queryRefresh={name:"ɵɵqueryRefresh",moduleName:Bt},qt.viewQuery={name:"ɵɵviewQuery",moduleName:Bt},qt.loadQuery={name:"ɵɵloadQuery",moduleName:Bt},qt.contentQuery={name:"ɵɵcontentQuery",moduleName:Bt},qt.NgOnChangesFeature={name:"ɵɵNgOnChangesFeature",moduleName:Bt},qt.InheritDefinitionFeature={name:"ɵɵInheritDefinitionFeature",moduleName:Bt},qt.CopyDefinitionFeature={name:"ɵɵCopyDefinitionFeature",moduleName:Bt},qt.StandaloneFeature={name:"ɵɵStandaloneFeature",moduleName:Bt},qt.ProvidersFeature={name:"ɵɵProvidersFeature",moduleName:Bt},qt.HostDirectivesFeature={name:"ɵɵHostDirectivesFeature",moduleName:Bt},qt.listener={name:"ɵɵlistener",moduleName:Bt},qt.getInheritedFactory={name:"ɵɵgetInheritedFactory",moduleName:Bt},qt.sanitizeHtml={name:"ɵɵsanitizeHtml",moduleName:Bt},qt.sanitizeStyle={name:"ɵɵsanitizeStyle",moduleName:Bt},qt.sanitizeResourceUrl={name:"ɵɵsanitizeResourceUrl",moduleName:Bt},qt.sanitizeScript={name:"ɵɵsanitizeScript",moduleName:Bt},qt.sanitizeUrl={name:"ɵɵsanitizeUrl",moduleName:Bt},qt.sanitizeUrlOrResourceUrl={name:"ɵɵsanitizeUrlOrResourceUrl",moduleName:Bt},qt.trustConstantHtml={name:"ɵɵtrustConstantHtml",moduleName:Bt},qt.trustConstantResourceUrl={name:"ɵɵtrustConstantResourceUrl",moduleName:Bt},qt.validateIframeAttribute={name:"ɵɵvalidateIframeAttribute",moduleName:Bt};class Ft{constructor(e=null){this.file=e,this.sourcesContent=new Map,this.lines=[],this.lastCol0=0,this.hasMappings=!1}addSource(e,t=null){return this.sourcesContent.has(e)||this.sourcesContent.set(e,t),this}addLine(){return this.lines.push([]),this.lastCol0=0,this}addMapping(e,t,s,n){if(!this.currentLine)throw new Error("A line must be added before mappings can be added");if(null!=t&&!this.sourcesContent.has(t))throw new Error(`Unknown source file "${t}"`);if(null==e)throw new Error("The column in the generated code must be provided");if(e{e.set(n,r),t.push(n),s.push(this.sourcesContent.get(n)||null)}));let n="",r=0,i=0,a=0,o=0;return this.lines.forEach((t=>{r=0,n+=t.map((t=>{let s=Vt(t.col0-r);return r=t.col0,null!=t.sourceUrl&&(s+=Vt(e.get(t.sourceUrl)-i),i=e.get(t.sourceUrl),s+=Vt(t.sourceLine0-a),a=t.sourceLine0,s+=Vt(t.sourceCol0-o),o=t.sourceCol0),s})).join(","),n+=";"})),n=n.slice(0,-1),{file:this.file||"",version:3,sourceRoot:"",sources:t,sourcesContent:s,mappings:n}}toJsComment(){return this.hasMappings?"//# sourceMappingURL=data:application/json;base64,"+function(e){let t="";const s=P(e);for(let e=0;e>2),t+=Ut((3&n)<<4|(null===r?0:r>>4)),t+=null===r?"=":Ut((15&r)<<2|(null===i?0:i>>6)),t+=null===r||null===i?"=":Ut(63&i)}return t}(JSON.stringify(this,null,0)):""}}function Vt(e){e=e<0?1+(-e<<1):e<<1;let t="";do{let s=31&e;(e>>=5)>0&&(s|=32),t+=Ut(s)}while(e>0);return t}function Ut(e){if(e<0||e>=64)throw new Error("Can only encode value in the range [0, 63]");return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e]}const Ht=/'|\\|\n|\r|\$/g,jt=/^[$A-Z_][0-9A-Z_$]*$/i,Wt=" ";class zt{constructor(e){this.indent=e,this.partsLength=0,this.parts=[],this.srcSpans=[]}}class Kt{constructor(e){this._indent=e,this._lines=[new zt(e)]}static createRoot(){return new Kt(0)}get _currentLine(){return this._lines[this._lines.length-1]}println(e,t=""){this.print(e||null,t,!0)}lineIsEmpty(){return 0===this._currentLine.parts.length}lineLength(){return this._currentLine.indent*Wt.length+this._currentLine.partsLength}print(e,t,s=!1){t.length>0&&(this._currentLine.parts.push(t),this._currentLine.partsLength+=t.length,this._currentLine.srcSpans.push(e&&e.sourceSpan||null)),s&&this._lines.push(new zt(this._indent))}removeEmptyLastLine(){this.lineIsEmpty()&&this._lines.pop()}incIndent(){this._indent++,this.lineIsEmpty()&&(this._currentLine.indent=this._indent)}decIndent(){this._indent--,this.lineIsEmpty()&&(this._currentLine.indent=this._indent)}toSource(){return this.sourceLines.map((e=>e.parts.length>0?Qt(e.indent)+e.parts.join(""):"")).join("\n")}toSourceMapGenerator(e,t=0){const s=new Ft(e);let n=!1;const r=()=>{n||(s.addSource(e," ").addMapping(0,e,0,0),n=!0)};for(let e=0;e{s.addLine();const i=e.srcSpans,a=e.parts;let o=e.indent*Wt.length,l=0;for(;le)return s.srcSpans[t];e-=n.length}}return null}get sourceLines(){return this._lines.length&&0===this._lines[this._lines.length-1].parts.length?this._lines.slice(0,-1):this._lines}}class Gt{constructor(e){this._escapeDollarInStrings=e}printLeadingComments(e,t){if(void 0!==e.leadingComments)for(const s of e.leadingComments)s instanceof at?t.print(e,`/*${s.toString()}*/`,s.trailingNewline):s.multiline?t.print(e,`/* ${s.text} */`,s.trailingNewline):s.text.split("\n").forEach((s=>{t.println(e,`// ${s}`)}))}visitExpressionStmt(e,t){return this.printLeadingComments(e,t),e.expr.visitExpression(this,t),t.println(e,";"),null}visitReturnStmt(e,t){return this.printLeadingComments(e,t),t.print(e,"return "),e.value.visitExpression(this,t),t.println(e,";"),null}visitIfStmt(e,t){this.printLeadingComments(e,t),t.print(e,"if ("),e.condition.visitExpression(this,t),t.print(e,") {");const s=null!=e.falseCase&&e.falseCase.length>0;return e.trueCase.length<=1&&!s?(t.print(e," "),this.visitAllStatements(e.trueCase,t),t.removeEmptyLastLine(),t.print(e," ")):(t.println(),t.incIndent(),this.visitAllStatements(e.trueCase,t),t.decIndent(),s&&(t.println(e,"} else {"),t.incIndent(),this.visitAllStatements(e.falseCase,t),t.decIndent())),t.println(e,"}"),null}visitWriteVarExpr(e,t){const s=t.lineIsEmpty();return s||t.print(e,"("),t.print(e,`${e.name} = `),e.value.visitExpression(this,t),s||t.print(e,")"),null}visitWriteKeyExpr(e,t){const s=t.lineIsEmpty();return s||t.print(e,"("),e.receiver.visitExpression(this,t),t.print(e,"["),e.index.visitExpression(this,t),t.print(e,"] = "),e.value.visitExpression(this,t),s||t.print(e,")"),null}visitWritePropExpr(e,t){const s=t.lineIsEmpty();return s||t.print(e,"("),e.receiver.visitExpression(this,t),t.print(e,`.${e.name} = `),e.value.visitExpression(this,t),s||t.print(e,")"),null}visitInvokeFunctionExpr(e,t){return e.fn.visitExpression(this,t),t.print(e,"("),this.visitAllExpressions(e.args,t,","),t.print(e,")"),null}visitTaggedTemplateExpr(e,t){e.tag.visitExpression(this,t),t.print(e,"`"+e.template.elements[0].rawText);for(let s=1;s{t.print(e,`${Yt(s.key,this._escapeDollarInStrings,s.quoted)}:`),s.value.visitExpression(this,t)}),e.entries,t,","),t.print(e,"}"),null}visitCommaExpr(e,t){return t.print(e,"("),this.visitAllExpressions(e.parts,t,","),t.print(e,")"),null}visitAllExpressions(e,t,s){this.visitAllObjects((e=>e.visitExpression(this,t)),e,t,s)}visitAllObjects(e,t,s,n){let r=!1;for(let i=0;i0&&(s.lineLength()>80?(s.print(null,n,!0),r||(s.incIndent(),s.incIndent(),r=!0)):s.print(null,n,!1)),e(t[i]);r&&(s.decIndent(),s.decIndent())}visitAllStatements(e,t){e.forEach((e=>e.visitStatement(this,t)))}}function Yt(e,t,s=!0){if(null==e)return null;const n=e.replace(Ht,((...e)=>"$"==e[0]?t?"\\$":"$":"\n"==e[0]?"\\n":"\r"==e[0]?"\\r":`\\${e[0]}`));return s||!jt.test(n)?`'${n}'`:n}function Qt(e){let t="";for(let s=0;se.value)));return t?Et([],[new pt(s)]):s}function is(e,t){return{expression:e,forwardRef:t}}function as({expression:e,forwardRef:t}){switch(t){case 0:case 1:return e;case 2:return os(e)}}function os(e){return vt(qt.forwardRef).callFn([Et([],[new pt(e)])])}var ls;function cs(t){const s=gt("t");let n=null;const r=hs(t)?s:new Ye(e.BinaryOperator.Or,s,t.internalType);let i=null;null!==t.deps?"invalid"!==t.deps&&(i=new Ae(r,ps(t.deps,t.target))):(n=gt(`ɵ${t.name}_BaseFactory`),i=n.callFn([r]));const a=[];let o=null;function l(e){const t=gt("r");a.push(t.set(st).toDeclStmt());const n=null!==i?t.set(i).toStmt():vt(qt.invalidFactory).callFn([]).toStmt();return a.push(_t(s,[n],[t.set(e).toStmt()])),t}if(hs(t)){const e=ps(t.delegateDeps,t.target);o=l(new(t.delegateType===ls.Class?Ae:Ne)(t.delegate,e))}else o=function(e){return void 0!==e.expression}(t)?l(t.expression):i;if(null===o)a.push(vt(qt.invalidFactory).callFn([]).toStmt());else if(null!==n){const s=vt(qt.getInheritedFactory).callFn([t.internalType]),i=new Ye(e.BinaryOperator.Or,n,n.set(s));a.push(new pt(i.callFn([r])))}else a.push(new pt(o));let c=Et([new ze("t",ce)],a,ue,void 0,`${t.name}_Factory`);return null!==n&&(c=Et([],[new lt(n.name),new pt(c)]).callFn([],void 0,!0)),{expression:c,statements:[],type:us(t)}}function us(e){const t=null!==e.deps&&"invalid"!==e.deps?function(e){let t=!1;const s=e.map((e=>{const s=function(e){const t=[];null!==e.attributeNameType&&t.push({key:"attribute",value:e.attributeNameType,quoted:!1});e.optional&&t.push({key:"optional",value:Tt(!0),quoted:!1});e.host&&t.push({key:"host",value:Tt(!0),quoted:!1});e.self&&t.push({key:"self",value:Tt(!0),quoted:!1});e.skipSelf&&t.push({key:"skipSelf",value:Tt(!0),quoted:!1});return t.length>0?wt(t):null}(e);return null!==s?(t=!0,s):Tt(null)}));return t?ft(xt(s)):ve}(e.deps):ve;return ft(vt(qt.FactoryDeclaration,[Xt(e.type.type,e.typeArgumentCount),t]))}function ps(t,s){return t.map(((t,n)=>function(t,s,n){if(null===t.token)return vt(qt.invalidFactoryDep).callFn([Tt(n)]);if(null===t.attributeNameType){const n=0|(t.self?2:0)|(t.skipSelf?4:0)|(t.host?1:0)|(t.optional?8:0)|(s===e.FactoryTarget.Pipe?16:0);let r=0!==n||t.optional?Tt(n):null;const i=[t.token];r&&i.push(r);const a=function(t){switch(t){case e.FactoryTarget.Component:case e.FactoryTarget.Directive:case e.FactoryTarget.Pipe:return qt.directiveInject;case e.FactoryTarget.NgModule:case e.FactoryTarget.Injectable:default:return qt.inject}}(s);return vt(a).callFn(i)}return vt(qt.injectAttribute).callFn([t.token])}(t,s,n)))}function hs(e){return void 0!==e.delegateType}!function(e){e[e.Class=0]="Class",e[e.Function=1]="Function"}(ls||(ls={})),e.FactoryTarget=void 0,function(e){e[e.Directive=0]="Directive",e[e.Component=1]="Component",e[e.Injectable=2]="Injectable",e[e.Pipe=3]="Pipe",e[e.NgModule=4]="NgModule"}(e.FactoryTarget||(e.FactoryTarget={}));class ds{constructor(e,t){this.value=e,this.sourceSpan=t}visit(e){throw new Error("visit() not implemented for Comment")}}class ms{constructor(e,t){this.value=e,this.sourceSpan=t}visit(e){return e.visitText(this)}}class gs{constructor(e,t,s){this.value=e,this.sourceSpan=t,this.i18n=s}visit(e){return e.visitBoundText(this)}}class vs{constructor(e,t,s,n,r,i){this.name=e,this.value=t,this.sourceSpan=s,this.keySpan=n,this.valueSpan=r,this.i18n=i}visit(e){return e.visitTextAttribute(this)}}class fs{constructor(e,t,s,n,r,i,a,o,l){this.name=e,this.type=t,this.securityContext=s,this.value=n,this.unit=r,this.sourceSpan=i,this.keySpan=a,this.valueSpan=o,this.i18n=l}static fromBoundElementProperty(e,t){if(void 0===e.keySpan)throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${e.name}: ${e.sourceSpan}`);return new fs(e.name,e.type,e.securityContext,e.value,e.unit,e.sourceSpan,e.keySpan,e.valueSpan,t)}visit(e){return e.visitBoundAttribute(this)}}class ys{constructor(e,t,s,n,r,i,a,o){this.name=e,this.type=t,this.handler=s,this.target=n,this.phase=r,this.sourceSpan=i,this.handlerSpan=a,this.keySpan=o}static fromParsedEvent(e){const t=0===e.type?e.targetOrPhase:null,s=1===e.type?e.targetOrPhase:null;if(void 0===e.keySpan)throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${e.name}: ${e.sourceSpan}`);return new ys(e.name,e.type,e.handler,t,s,e.sourceSpan,e.handlerSpan,e.keySpan)}visit(e){return e.visitBoundEvent(this)}}class xs{constructor(e,t,s,n,r,i,a,o,l,c){this.name=e,this.attributes=t,this.inputs=s,this.outputs=n,this.children=r,this.references=i,this.sourceSpan=a,this.startSourceSpan=o,this.endSourceSpan=l,this.i18n=c}visit(e){return e.visitElement(this)}}class ws{constructor(e,t,s,n,r,i,a,o,l,c,u,p){this.tagName=e,this.attributes=t,this.inputs=s,this.outputs=n,this.templateAttrs=r,this.children=i,this.references=a,this.variables=o,this.sourceSpan=l,this.startSourceSpan=c,this.endSourceSpan=u,this.i18n=p}visit(e){return e.visitTemplate(this)}}class Ss{constructor(e,t,s,n){this.selector=e,this.attributes=t,this.sourceSpan=s,this.i18n=n,this.name="ng-content"}visit(e){return e.visitContent(this)}}class Es{constructor(e,t,s,n,r){this.name=e,this.value=t,this.sourceSpan=s,this.keySpan=n,this.valueSpan=r}visit(e){return e.visitVariable(this)}}class _s{constructor(e,t,s,n,r){this.name=e,this.value=t,this.sourceSpan=s,this.keySpan=n,this.valueSpan=r}visit(e){return e.visitReference(this)}}class bs{constructor(e,t,s,n){this.vars=e,this.placeholders=t,this.sourceSpan=s,this.i18n=n}visit(e){return e.visitIcu(this)}}function Ts(e,t){const s=[];if(e.visit)for(const s of t)e.visit(s)||s.visit(e);else for(const n of t){const t=n.visit(e);t&&s.push(t)}return s}class Cs{constructor(e,t,s,n,r,i){this.nodes=e,this.placeholders=t,this.placeholderToMessage=s,this.meaning=n,this.description=r,this.customId=i,this.id=this.customId,this.legacyIds=[],this.messageString=function(e){const t=new Os;return e.map((e=>e.visit(t))).join("")}(this.nodes),e.length?this.sources=[{filePath:e[0].sourceSpan.start.file.url,startLine:e[0].sourceSpan.start.line+1,startCol:e[0].sourceSpan.start.col+1,endLine:e[e.length-1].sourceSpan.end.line+1,endCol:e[0].sourceSpan.start.col+1}]:this.sources=[]}}class Is{constructor(e,t){this.value=e,this.sourceSpan=t}visit(e,t){return e.visitText(this,t)}}class ks{constructor(e,t){this.children=e,this.sourceSpan=t}visit(e,t){return e.visitContainer(this,t)}}class Ns{constructor(e,t,s,n){this.expression=e,this.type=t,this.cases=s,this.sourceSpan=n}visit(e,t){return e.visitIcu(this,t)}}class Ps{constructor(e,t,s,n,r,i,a,o,l){this.tag=e,this.attrs=t,this.startName=s,this.closeName=n,this.children=r,this.isVoid=i,this.sourceSpan=a,this.startSourceSpan=o,this.endSourceSpan=l}visit(e,t){return e.visitTagPlaceholder(this,t)}}class As{constructor(e,t,s){this.value=e,this.name=t,this.sourceSpan=s}visit(e,t){return e.visitPlaceholder(this,t)}}class Ls{constructor(e,t,s){this.value=e,this.name=t,this.sourceSpan=s}visit(e,t){return e.visitIcuPlaceholder(this,t)}}class Ms{visitText(e,t){return new Is(e.value,e.sourceSpan)}visitContainer(e,t){const s=e.children.map((e=>e.visit(this,t)));return new ks(s,e.sourceSpan)}visitIcu(e,t){const s={};Object.keys(e.cases).forEach((n=>s[n]=e.cases[n].visit(this,t)));const n=new Ns(e.expression,e.type,s,e.sourceSpan);return n.expressionPlaceholder=e.expressionPlaceholder,n}visitTagPlaceholder(e,t){const s=e.children.map((e=>e.visit(this,t)));return new Ps(e.tag,e.attrs,e.startName,e.closeName,s,e.isVoid,e.sourceSpan,e.startSourceSpan,e.endSourceSpan)}visitPlaceholder(e,t){return new As(e.value,e.name,e.sourceSpan)}visitIcuPlaceholder(e,t){return new Ls(e.value,e.name,e.sourceSpan)}}class Rs{visitText(e,t){}visitContainer(e,t){e.children.forEach((e=>e.visit(this)))}visitIcu(e,t){Object.keys(e.cases).forEach((t=>{e.cases[t].visit(this)}))}visitTagPlaceholder(e,t){e.children.forEach((e=>e.visit(this)))}visitPlaceholder(e,t){}visitIcuPlaceholder(e,t){}}class Os{visitText(e){return e.value}visitContainer(e){return e.children.map((e=>e.visit(this))).join("")}visitIcu(e){const t=Object.keys(e.cases).map((t=>`${t} {${e.cases[t].visit(this)}}`));return`{${e.expressionPlaceholder}, ${e.type}, ${t.join(" ")}}`}visitTagPlaceholder(e){const t=e.children.map((e=>e.visit(this))).join("");return`{$${e.startName}}${t}{$${e.closeName}}`}visitPlaceholder(e){return`{$${e.name}}`}visitIcuPlaceholder(e){return`{$${e.name}}`}}class $s{createNameMapper(e){return null}}class Ds extends Rs{constructor(e,t){super(),this.mapName=t,this.internalToPublic={},this.publicToNextId={},this.publicToInternal={},e.nodes.forEach((e=>e.visit(this)))}toPublicName(e){return this.internalToPublic.hasOwnProperty(e)?this.internalToPublic[e]:null}toInternalName(e){return this.publicToInternal.hasOwnProperty(e)?this.publicToInternal[e]:null}visitText(e,t){return null}visitTagPlaceholder(e,t){this.visitPlaceholderName(e.startName),super.visitTagPlaceholder(e,t),this.visitPlaceholderName(e.closeName)}visitPlaceholder(e,t){this.visitPlaceholderName(e.name)}visitIcuPlaceholder(e,t){this.visitPlaceholderName(e.name)}visitPlaceholderName(e){if(!e||this.internalToPublic.hasOwnProperty(e))return;let t=this.mapName(e);if(this.publicToInternal.hasOwnProperty(t)){const e=this.publicToNextId[t];this.publicToNextId[t]=e+1,t=`${t}_${e}`}else this.publicToNextId[t]=1;this.internalToPublic[e]=t,this.publicToInternal[t]=e}}const Bs=new class{visitTag(e){const t=this._serializeAttributes(e.attrs);if(0==e.children.length)return`<${e.name}${t}/>`;const s=e.children.map((e=>e.visit(this)));return`<${e.name}${t}>${s.join("")}`}visitText(e){return e.value}visitDeclaration(e){return``}_serializeAttributes(e){const t=Object.keys(e).map((t=>`${t}="${e[t]}"`)).join(" ");return t.length>0?" "+t:""}visitDoctype(e){return``}};function qs(e){return e.map((e=>e.visit(Bs))).join("")}class Fs{constructor(e){this.attrs={},Object.keys(e).forEach((t=>{this.attrs[t]=zs(e[t])}))}visit(e){return e.visitDeclaration(this)}}class Vs{constructor(e,t){this.rootTag=e,this.dtd=t}visit(e){return e.visitDoctype(this)}}class Us{constructor(e,t={},s=[]){this.name=e,this.children=s,this.attrs={},Object.keys(t).forEach((e=>{this.attrs[e]=zs(t[e])}))}visit(e){return e.visitTag(this)}}class Hs{constructor(e){this.value=zs(e)}visit(e){return e.visitText(this)}}class js extends Hs{constructor(e=0){super(`\n${new Array(e+1).join(" ")}`)}}const Ws=[[/&/g,"&"],[/"/g,"""],[/'/g,"'"],[//g,">"]];function zs(e){return Ws.reduce(((e,t)=>e.replace(t[0],t[1])),e)}const Ks="messagebundle",Gs="ph",Ys="ex";class Qs extends $s{write(e,t){const s=new Zs,n=new Xs;let r=new Us(Ks);return e.forEach((e=>{const t={id:e.id};e.description&&(t.desc=e.description),e.meaning&&(t.meaning=e.meaning);let s=[];e.sources.forEach((e=>{s.push(new Us("source",{},[new Hs(`${e.filePath}:${e.startLine}${e.endLine!==e.startLine?","+e.endLine:""}`)]))})),r.children.push(new js(2),new Us("msg",t,[...s,...n.serialize(e.nodes)]))})),r.children.push(new js),qs([new Fs({version:"1.0",encoding:"UTF-8"}),new js,new Vs(Ks,'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'),new js,s.addDefaultExamples(r),new js])}load(e,t){throw new Error("Unsupported")}digest(e){return Js(e)}createNameMapper(e){return new Ds(e,en)}}class Xs{visitText(e,t){return[new Hs(e.value)]}visitContainer(e,t){const s=[];return e.children.forEach((e=>s.push(...e.visit(this)))),s}visitIcu(e,t){const s=[new Hs(`{${e.expressionPlaceholder}, ${e.type}, `)];return Object.keys(e.cases).forEach((t=>{s.push(new Hs(`${t} {`),...e.cases[t].visit(this),new Hs("} "))})),s.push(new Hs("}")),s}visitTagPlaceholder(e,t){const s=new Hs(`<${e.tag}>`),n=new Us(Ys,{},[s]),r=new Us(Gs,{name:e.startName},[n,s]);if(e.isVoid)return[r];const i=new Hs(``),a=new Us(Ys,{},[i]),o=new Us(Gs,{name:e.closeName},[a,i]);return[r,...this.serialize(e.children),o]}visitPlaceholder(e,t){const s=new Hs(`{{${e.value}}}`),n=new Us(Ys,{},[s]);return[new Us(Gs,{name:e.name},[n,s])]}visitIcuPlaceholder(e,t){const s=e.value.expression,n=e.value.type,r=Object.keys(e.value.cases).map((e=>e+" {...}")).join(" "),i=new Hs(`{${s}, ${n}, ${r}}`),a=new Us(Ys,{},[i]);return[new Us(Gs,{name:e.name},[a,i])]}serialize(e){return[].concat(...e.map((e=>e.visit(this))))}}function Js(e){return B(e)}class Zs{addDefaultExamples(e){return e.visit(this),e}visitTag(e){if(e.name===Gs){if(!e.children||0==e.children.length){const t=new Hs(e.attrs.name||"...");e.children=[new Us(Ys,{},[t])]}}else e.children&&e.children.forEach((e=>e.visit(this)))}visitText(e){}visitDeclaration(e){}visitDoctype(e){}}function en(e){return e.toUpperCase().replace(/[^A-Z0-9_]/g,"_")}const tn="i18n",sn="i18n-";function nn(e){return e===tn||e.startsWith(sn)}function rn(e){return e instanceof Cs}function an(e){return rn(e)&&1===e.nodes.length&&e.nodes[0]instanceof Ns}function on(e){return!!e.i18n}function ln(e){return e.nodes[0]}function cn(e,t=0){return`�${e}${t>0?`:${t}`:""}�`}function un(e=0){let t=e;return()=>t++}function pn(e){const t={};return e.forEach(((e,s)=>{t[s]=Tt(e.length>1?`[${e.join("|")}]`:e[0])})),t}function hn(e,t,...s){const n=e.get(t)||[];n.push(...s),e.set(t,n)}function dn(e,t=0,s=0){const n=t,r=new Map,i=e instanceof Cs?e.nodes.find((e=>e instanceof ks)):e;return i&&i.children.filter((e=>e instanceof As)).forEach(((e,t)=>{const i=cn(n+t,s);hn(r,e.name,i)})),r}function mn(e={},t){const s={};return e&&Object.keys(e).length&&Object.keys(e).forEach((n=>s[gn(n,t)]=e[n])),s}function gn(e,t=!0){const s=en(e);if(!t)return s;const n=s.split("_");if(1===n.length)return e.toLowerCase();let r;/^\d+$/.test(n[n.length-1])&&(r=n.pop());let i=n.shift().toLowerCase();return n.length&&(i+=n.map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join("")),r?`${i}_${r}`:i}function vn(e){return`MSG_${e}`.toUpperCase()}function fn(e){return new lt(e.name,void 0,ue,void 0,e.sourceSpan)}const yn=/[-.]/,xn="_t",wn="ctx",Sn="rf",En="restoredCtx",_n=new Set([qt.element,qt.elementStart,qt.elementEnd,qt.elementContainer,qt.elementContainerStart,qt.elementContainerEnd,qt.i18nExp,qt.listener,qt.classProp,qt.syntheticHostListener,qt.hostProperty,qt.syntheticHostProperty,qt.property,qt.propertyInterpolate1,qt.propertyInterpolate2,qt.propertyInterpolate3,qt.propertyInterpolate4,qt.propertyInterpolate5,qt.propertyInterpolate6,qt.propertyInterpolate7,qt.propertyInterpolate8,qt.propertyInterpolateV,qt.attribute,qt.attributeInterpolate1,qt.attributeInterpolate2,qt.attributeInterpolate3,qt.attributeInterpolate4,qt.attributeInterpolate5,qt.attributeInterpolate6,qt.attributeInterpolate7,qt.attributeInterpolate8,qt.attributeInterpolateV,qt.styleProp,qt.stylePropInterpolate1,qt.stylePropInterpolate2,qt.stylePropInterpolate3,qt.stylePropInterpolate4,qt.stylePropInterpolate5,qt.stylePropInterpolate6,qt.stylePropInterpolate7,qt.stylePropInterpolate8,qt.stylePropInterpolateV,qt.textInterpolate,qt.textInterpolate1,qt.textInterpolate2,qt.textInterpolate3,qt.textInterpolate4,qt.textInterpolate5,qt.textInterpolate6,qt.textInterpolate7,qt.textInterpolate8,qt.textInterpolateV]);function bn(e,t,s){return vt(t,null,e).callFn(s,e)}function Tn(e,t){let s=null;return()=>(s||(e.push(new lt(xn,void 0,ce)),s=gt(t)),s)}function Cn(e){throw new Error(`Invalid state: Visitor ${this.constructor.name} doesn't handle ${e.constructor.name}`)}function In(e){return Array.isArray(e)?xt(e.map(In)):Tt(e,ue)}function kn(e,t){return Object.getOwnPropertyNames(e).length>0?function(e,t){return wt(Object.getOwnPropertyNames(e).map((s=>{const n=e[s];let r,i,a,o;return Array.isArray(n)?([i,r]=n,a=s,o=i!==r):(a=r=s,i=n,o=!1),{key:a,quoted:yn.test(a),value:t&&o?xt([In(i),In(r)]):In(i)}})))}(e,t):null}function Nn(e){for(;It(e[e.length-1]);)e.pop();return e}function Pn(e,t){if(Array.isArray(e.predicate)){let s=[];return e.predicate.forEach((e=>{const t=e.split(",").map((e=>Tt(e.trim())));s.push(...t)})),t.getConstLiteral(xt(s),!0)}switch(e.predicate.forwardRef){case 0:case 2:return e.predicate.expression;case 1:return vt(qt.resolveForwardRef).callFn([e.predicate.expression])}}class An{constructor(){this.values=[]}set(e,t){t&&this.values.push({key:e,value:t,quoted:!1})}toLiteralMap(){return wt(this.values)}}function Ln(e){const{expressions:t,strings:s}=e;return 1===t.length&&2===s.length&&""===s[0]&&""===s[1]?1:t.length+s.length}function Mn(e){const t=[];let s=null,n=null,r=0;for(const i of e){const e=("function"==typeof i.paramsOrFn?i.paramsOrFn():i.paramsOrFn)??[],a=Array.isArray(e)?e:[e];r<500&&n===i.reference&&_n.has(n)?(s=s.callFn(a,s.sourceSpan),r++):(null!==s&&t.push(s.toStmt()),s=bn(i.span,i.reference,a),n=i.reference,r=0)}return null!==s&&t.push(s.toStmt()),t}function Rn(t,s){let n=null;const r={name:t.name,type:t.type,internalType:t.internalType,typeArgumentCount:t.typeArgumentCount,deps:[],target:e.FactoryTarget.Injectable};if(void 0!==t.useClass){const e=t.useClass.expression.isEquivalent(t.internalType);let i;void 0!==t.deps&&(i=t.deps),n=void 0!==i?cs({...r,delegate:t.useClass.expression,delegateDeps:i,delegateType:ls.Class}):e?cs(r):{statements:[],expression:$n(t.type.value,t.useClass.expression,s)}}else n=void 0!==t.useFactory?void 0!==t.deps?cs({...r,delegate:t.useFactory,delegateDeps:t.deps||[],delegateType:ls.Function}):{statements:[],expression:Et([],[new pt(t.useFactory.callFn([]))])}:void 0!==t.useValue?cs({...r,expression:t.useValue.expression}):void 0!==t.useExisting?cs({...r,expression:vt(qt.inject).callFn([t.useExisting.expression])}):{statements:[],expression:$n(t.type.value,t.internalType,s)};const i=t.internalType,a=new An;a.set("token",i),a.set("factory",n.expression),null!==t.providedIn.expression.value&&a.set("providedIn",as(t.providedIn));return{expression:vt(qt.ɵɵdefineInjectable).callFn([a.toLiteralMap()],void 0,!0),type:On(t),statements:n.statements}}function On(e){return new ae(vt(qt.InjectableDeclaration,[Xt(e.type.type,e.typeArgumentCount)]))}function $n(e,t,s){if(e.node===t.node)return t.prop("ɵfac");if(!s)return Dn(t);return Dn(vt(qt.resolveForwardRef).callFn([t]))}function Dn(e){return Et([new ze("t",ce)],[new pt(e.prop("ɵfac").callFn([gt("t")]))])}const Bn=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];class qn{constructor(e,t){this.start=e,this.end=t}static fromArray(e){return e?(function(e,t){if(!(null==t||Array.isArray(t)&&2==t.length))throw new Error(`Expected '${e}' to be an array, [start, end].`);if(null!=t){const e=t[0],s=t[1];Bn.forEach((t=>{if(t.test(e)||t.test(s))throw new Error(`['${e}', '${s}'] contains unusable interpolation symbol.`)}))}}("interpolation",e),new qn(e[0],e[1])):Fn}}const Fn=new qn("{{","}}"),Vn=10,Un=44,Hn=46,jn=47,Wn=58,zn=59,Kn=60,Gn=61,Yn=62,Qn=65,Xn=97,Jn=122,Zn=123,er=125;function tr(e){return e>=9&&e<=32||160==e}function sr(e){return 48<=e&&e<=57}function nr(e){return e>=Xn&&e<=Jn||e>=Qn&&e<=90}function rr(e){return e===Vn||13===e}function ir(e){return 48<=e&&e<=55}function ar(e){return 39===e||34===e||96===e}class or{constructor(e,t,s,n){this.file=e,this.offset=t,this.line=s,this.col=n}toString(){return null!=this.offset?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){const t=this.file.content,s=t.length;let n=this.offset,r=this.line,i=this.col;for(;n>0&&e<0;){n--,e++;if(t.charCodeAt(n)==Vn){r--;const e=t.substring(0,n-1).lastIndexOf(String.fromCharCode(Vn));i=e>0?n-e:n}else i--}for(;n0;){const s=t.charCodeAt(n);n++,e--,s==Vn?(r++,i=0):i++}return new or(this.file,n,r,i)}getContext(e,t){const s=this.file.content;let n=this.offset;if(null!=n){n>s.length-1&&(n=s.length-1);let r=n,i=0,a=0;for(;i0&&(n--,i++,"\n"!=s[n]||++a!=t););for(i=0,a=0;i]${t.after}")`:this.msg}toString(){const e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}}function hr(e,t,s){const n=new lr("",`in ${e} ${t} in ${s}`);return new cr(new or(n,-1,-1,-1),new or(n,-1,-1,-1))}let dr=0;function mr(e){if(!e||!e.reference)return null;const t=e.reference;if(t.__anonymousType)return t.__anonymousType;if(t.__forward_ref__)return"__forward_ref__";let s=A(t);return s.indexOf("(")>=0?(s="anonymous_"+dr++,t.__anonymousType=s):s=gr(s),s}function gr(e){return e.replace(/\W/g,"_")}const vr='(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';class fr extends Gt{constructor(){super(!1)}visitWrappedNodeExpr(e,t){throw new Error("Cannot emit a WrappedNodeExpr in Javascript.")}visitDeclareVarStmt(e,t){return t.print(e,`var ${e.name}`),e.value&&(t.print(e," = "),e.value.visitExpression(this,t)),t.println(e,";"),null}visitTaggedTemplateExpr(e,t){const s=e.template.elements;return e.tag.visitExpression(this,t),t.print(e,`(${vr}(`),t.print(e,`[${s.map((e=>Yt(e.text,!1))).join(", ")}], `),t.print(e,`[${s.map((e=>Yt(e.rawText,!1))).join(", ")}])`),e.template.expressions.forEach((s=>{t.print(e,", "),s.visitExpression(this,t)})),t.print(e,")"),null}visitFunctionExpr(e,t){return t.print(e,`function${e.name?" "+e.name:""}(`),this._visitParams(e.params,t),t.println(e,") {"),t.incIndent(),this.visitAllStatements(e.statements,t),t.decIndent(),t.print(e,"}"),null}visitDeclareFunctionStmt(e,t){return t.print(e,`function ${e.name}(`),this._visitParams(e.params,t),t.println(e,") {"),t.incIndent(),this.visitAllStatements(e.statements,t),t.decIndent(),t.println(e,"}"),null}visitLocalizedString(e,t){t.print(e,`$localize(${vr}(`);const s=[e.serializeI18nHead()];for(let t=1;tYt(e.cooked,!1))).join(", ")}], `),t.print(e,`[${s.map((e=>Yt(e.raw,!1))).join(", ")}])`),e.expressions.forEach((s=>{t.print(e,", "),s.visitExpression(this,t)})),t.print(e,")"),null}_visitParams(e,t){this.visitAllObjects((e=>t.print(null,e.name)),e,t,",")}}let yr;function xr(e){return function(){if(void 0===yr&&(yr=null,M.trustedTypes))try{yr=M.trustedTypes.createPolicy("angular#unsafe-jit",{createScript:e=>e})}catch{}return yr}()?.createScript(e)||e}function wr(...e){if(!M.trustedTypes)return new Function(...e);const t=`(function anonymous(${e.slice(0,-1).join(",")}\n) { ${e[e.length-1]}\n})`,s=M.eval(xr(t));return void 0===s.bind?new Function(...e):(s.toString=()=>t,s.bind(M))}class Sr{evaluateStatements(e,t,s,n){const r=new Er(s),i=Kt.createRoot();return t.length>0&&!t[0].isEquivalent(Tt("use strict").toStmt())&&(t=[Tt("use strict").toStmt(),...t]),r.visitAllStatements(t,i),r.createReturnStmt(i),this.evaluateCode(e,i,r.getArgs(),n)}evaluateCode(e,t,s,n){let r=`"use strict";${t.toSource()}\n//# sourceURL=${e}`;const i=[],a=[];for(const e in s)a.push(s[e]),i.push(e);if(n){const s=wr(...i.concat("return null;")).toString(),n=s.slice(0,s.indexOf("return null;")).split("\n").length-1;r+=`\n${t.toSourceMapGenerator(e,n).toJsComment()}`}const o=wr(...i.concat(r));return this.executeFunction(o,a)}executeFunction(e,t){return e(...t)}}class Er extends fr{constructor(e){super(),this.refResolver=e,this._evalArgNames=[],this._evalArgValues=[],this._evalExportedVars=[]}createReturnStmt(e){new pt(new et(this._evalExportedVars.map((e=>new Ze(e,gt(e),!1))))).visitStatement(this,e)}getArgs(){const e={};for(let t=0;t0&&t.set("imports",xt(e.imports));return{expression:vt(qt.defineInjector).callFn([t.toLiteralMap()],void 0,!0),type:br(e),statements:[]}}function br(e){return new ae(vt(qt.InjectorDeclaration,[new ae(e.type.type)]))}class Tr{constructor(e){this.context=e}resolveExternalReference(e){if("@angular/core"!==e.moduleName)throw new Error(`Cannot resolve external reference to ${e.moduleName}, only references to @angular/core are supported.`);if(!this.context.hasOwnProperty(e.name))throw new Error(`No value provided for @angular/core symbol '${e.name}'.`);return this.context[e.name]}}var Cr,Ir,kr,Nr;function Pr(t){const{adjacentType:s,internalType:n,bootstrap:r,declarations:i,imports:a,exports:o,schemas:l,containsForwardDecls:c,selectorScopeMode:u,id:p}=t,h=[],d=new An;if(d.set("type",n),r.length>0&&d.set("bootstrap",rs(r,c)),u===e.R3SelectorScopeMode.Inline)i.length>0&&d.set("declarations",rs(i,c)),a.length>0&&d.set("imports",rs(a,c)),o.length>0&&d.set("exports",rs(o,c));else if(u===e.R3SelectorScopeMode.SideEffect){const e=function(e){const{adjacentType:t,declarations:s,imports:n,exports:r,containsForwardDecls:i}=e,a=new An;s.length>0&&a.set("declarations",rs(s,i));n.length>0&&a.set("imports",rs(n,i));r.length>0&&a.set("exports",rs(r,i));if(0===Object.keys(a.values).length)return null;const o=(c=new Ne(vt(qt.setNgModuleScope),[t,a.toLiteralMap()]),ss("ngJitMode",c)),l=new Ke([],[o.toStmt()]);var c;return new Ne(l,[]).toStmt()}(t);null!==e&&h.push(e)}null!==l&&l.length>0&&d.set("schemas",xt(l.map((e=>e.value)))),null!==p&&(d.set("id",p),h.push(vt(qt.registerNgModuleType).callFn([s,p]).toStmt()));return{expression:vt(qt.defineNgModule).callFn([d.toLiteralMap()],void 0,!0),type:Ar(t),statements:h}}function Ar({type:e,declarations:t,exports:s,imports:n,includeImportTypes:r,publicDeclarationTypes:i}){return new ae(vt(qt.NgModuleDeclaration,[new ae(e.type),null===i?Lr(t):Mr(i),r?Lr(n):ve,Lr(s)]))}function Lr(e){const t=e.map((e=>yt(e.type)));return e.length>0?ft(xt(t)):ve}function Mr(e){const t=e.map((e=>yt(e)));return e.length>0?ft(xt(t)):ve}function Rr(e){const t=[];t.push({key:"name",value:Tt(e.pipeName),quoted:!1}),t.push({key:"type",value:e.type.value,quoted:!1}),t.push({key:"pure",value:Tt(e.pure),quoted:!1}),e.isStandalone&&t.push({key:"standalone",value:Tt(!0),quoted:!1});return{expression:vt(qt.definePipe).callFn([wt(t)],void 0,!0),type:Or(e),statements:[]}}function Or(e){return new ae(vt(qt.PipeDeclaration,[Xt(e.type.type,e.typeArgumentCount),new ae(new Le(e.pipeName)),new ae(new Le(e.isStandalone))]))}e.R3SelectorScopeMode=void 0,(Cr=e.R3SelectorScopeMode||(e.R3SelectorScopeMode={}))[Cr.Inline=0]="Inline",Cr[Cr.SideEffect=1]="SideEffect",Cr[Cr.Omit=2]="Omit",e.R3TemplateDependencyKind=void 0,(Ir=e.R3TemplateDependencyKind||(e.R3TemplateDependencyKind={}))[Ir.Directive=0]="Directive",Ir[Ir.Pipe=1]="Pipe",Ir[Ir.NgModule=2]="NgModule";class $r{constructor(e,t,s,n){this.input=t,this.errLocation=s,this.ctxLocation=n,this.message=`Parser Error: ${e} ${s} [${t}] in ${n}`}}class Dr{constructor(e,t){this.start=e,this.end=t}toAbsolute(e){return new li(e+this.start,e+this.end)}}class Br{constructor(e,t){this.span=e,this.sourceSpan=t}toString(){return"AST"}}class qr extends Br{constructor(e,t,s){super(e,t),this.nameSpan=s}}class Fr extends Br{visit(e,t=null){}}class Vr extends Br{visit(e,t=null){return e.visitImplicitReceiver(this,t)}}class Ur extends Vr{visit(e,t=null){return e.visitThisReceiver?.(this,t)}}class Hr extends Br{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitChain(this,t)}}class jr extends Br{constructor(e,t,s,n,r){super(e,t),this.condition=s,this.trueExp=n,this.falseExp=r}visit(e,t=null){return e.visitConditional(this,t)}}class Wr extends qr{constructor(e,t,s,n,r){super(e,t,s),this.receiver=n,this.name=r}visit(e,t=null){return e.visitPropertyRead(this,t)}}class zr extends qr{constructor(e,t,s,n,r,i){super(e,t,s),this.receiver=n,this.name=r,this.value=i}visit(e,t=null){return e.visitPropertyWrite(this,t)}}class Kr extends qr{constructor(e,t,s,n,r){super(e,t,s),this.receiver=n,this.name=r}visit(e,t=null){return e.visitSafePropertyRead(this,t)}}class Gr extends Br{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitKeyedRead(this,t)}}class Yr extends Br{constructor(e,t,s,n){super(e,t),this.receiver=s,this.key=n}visit(e,t=null){return e.visitSafeKeyedRead(this,t)}}class Qr extends Br{constructor(e,t,s,n,r){super(e,t),this.receiver=s,this.key=n,this.value=r}visit(e,t=null){return e.visitKeyedWrite(this,t)}}class Xr extends qr{constructor(e,t,s,n,r,i){super(e,t,i),this.exp=s,this.name=n,this.args=r}visit(e,t=null){return e.visitPipe(this,t)}}class Jr extends Br{constructor(e,t,s){super(e,t),this.value=s}visit(e,t=null){return e.visitLiteralPrimitive(this,t)}}class Zr extends Br{constructor(e,t,s){super(e,t),this.expressions=s}visit(e,t=null){return e.visitLiteralArray(this,t)}}class ei extends Br{constructor(e,t,s,n){super(e,t),this.keys=s,this.values=n}visit(e,t=null){return e.visitLiteralMap(this,t)}}class ti extends Br{constructor(e,t,s,n){super(e,t),this.strings=s,this.expressions=n}visit(e,t=null){return e.visitInterpolation(this,t)}}class si extends Br{constructor(e,t,s,n,r){super(e,t),this.operation=s,this.left=n,this.right=r}visit(e,t=null){return e.visitBinary(this,t)}}class ni extends si{constructor(e,t,s,n,r,i,a){super(e,t,r,i,a),this.operator=s,this.expr=n,this.left=null,this.right=null,this.operation=null}static createMinus(e,t,s){return new ni(e,t,"-",s,"-",new Jr(e,t,0),s)}static createPlus(e,t,s){return new ni(e,t,"+",s,"-",s,new Jr(e,t,0))}visit(e,t=null){return void 0!==e.visitUnary?e.visitUnary(this,t):e.visitBinary(this,t)}}class ri extends Br{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitPrefixNot(this,t)}}class ii extends Br{constructor(e,t,s){super(e,t),this.expression=s}visit(e,t=null){return e.visitNonNullAssert(this,t)}}class ai extends Br{constructor(e,t,s,n,r){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=r}visit(e,t=null){return e.visitCall(this,t)}}class oi extends Br{constructor(e,t,s,n,r){super(e,t),this.receiver=s,this.args=n,this.argumentSpan=r}visit(e,t=null){return e.visitSafeCall(this,t)}}class li{constructor(e,t){this.start=e,this.end=t}}class ci extends Br{constructor(e,t,s,n,r){super(new Dr(0,null===t?0:t.length),new li(n,null===t?n:n+t.length)),this.ast=e,this.source=t,this.location=s,this.errors=r}visit(e,t=null){return e.visitASTWithSource?e.visitASTWithSource(this,t):this.ast.visit(e,t)}toString(){return`${this.source} in ${this.location}`}}class ui{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}}class pi{constructor(e,t,s){this.sourceSpan=e,this.key=t,this.value=s}}class hi{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.receiver,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitPrefixNot(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitSafeCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitAll(e,t){for(const s of e)this.visit(s,t)}}class di{visitImplicitReceiver(e,t){return e}visitThisReceiver(e,t){return e}visitInterpolation(e,t){return new ti(e.span,e.sourceSpan,e.strings,this.visitAll(e.expressions))}visitLiteralPrimitive(e,t){return new Jr(e.span,e.sourceSpan,e.value)}visitPropertyRead(e,t){return new Wr(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name)}visitPropertyWrite(e,t){return new zr(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name,e.value.visit(this))}visitSafePropertyRead(e,t){return new Kr(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name)}visitLiteralArray(e,t){return new Zr(e.span,e.sourceSpan,this.visitAll(e.expressions))}visitLiteralMap(e,t){return new ei(e.span,e.sourceSpan,e.keys,this.visitAll(e.values))}visitUnary(e,t){switch(e.operator){case"+":return ni.createPlus(e.span,e.sourceSpan,e.expr.visit(this));case"-":return ni.createMinus(e.span,e.sourceSpan,e.expr.visit(this));default:throw new Error(`Unknown unary operator ${e.operator}`)}}visitBinary(e,t){return new si(e.span,e.sourceSpan,e.operation,e.left.visit(this),e.right.visit(this))}visitPrefixNot(e,t){return new ri(e.span,e.sourceSpan,e.expression.visit(this))}visitNonNullAssert(e,t){return new ii(e.span,e.sourceSpan,e.expression.visit(this))}visitConditional(e,t){return new jr(e.span,e.sourceSpan,e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this))}visitPipe(e,t){return new Xr(e.span,e.sourceSpan,e.exp.visit(this),e.name,this.visitAll(e.args),e.nameSpan)}visitKeyedRead(e,t){return new Gr(e.span,e.sourceSpan,e.receiver.visit(this),e.key.visit(this))}visitKeyedWrite(e,t){return new Qr(e.span,e.sourceSpan,e.receiver.visit(this),e.key.visit(this),e.value.visit(this))}visitCall(e,t){return new ai(e.span,e.sourceSpan,e.receiver.visit(this),this.visitAll(e.args),e.argumentSpan)}visitSafeCall(e,t){return new oi(e.span,e.sourceSpan,e.receiver.visit(this),this.visitAll(e.args),e.argumentSpan)}visitAll(e){const t=[];for(let s=0;se=>xt(e),createLiteralMapConverter:e=>t=>wt(e.map(((e,s)=>({key:e.key,value:t[s],quoted:e.quoted})))),createPipeConverter:e=>{throw new Error(`Illegal State: Actions are not allowed to contain pipes. Pipe: ${e}`)}},s);const l=new Ni(e,t,n,!1,r,i),c=[];Pi(o.visit(l,Nr.Statement),c),function(e,t,s){for(let n=e-1;n>=0;n--)s.unshift(Ti(t,n))}(l.temporaryCount,n,c),l.usesImplicitReceiver&&e.notifyImplicitReceiverUse();const u=c.length-1;if(u>=0){const e=c[u];e instanceof ut&&(c[u]=new pt(e.expr))}return c}xi.event=gt("$event");class Si{constructor(e,t){this.stmts=e,this.currValExpr=t}}function Ei(e,t,s,n){e||(e=new Mi);const r=new Ni(e,t,n,!1),i=s.visit(r,Nr.Expression),a=_i(r,n);return r.usesImplicitReceiver&&e.notifyImplicitReceiverUse(),new Si(a,i)}function _i(e,t){const s=[];for(let n=0;ne.visit(this,t)));return new Ri(e.span,e.sourceSpan,s,this._converterFactory.createPipeConverter(e.name,s.length))}visitLiteralArray(e,t){const s=e.expressions.map((e=>e.visit(this,t)));return new Ri(e.span,e.sourceSpan,s,this._converterFactory.createLiteralArrayConverter(e.expressions.length))}visitLiteralMap(e,t){const s=e.values.map((e=>e.visit(this,t)));return new Ri(e.span,e.sourceSpan,s,this._converterFactory.createLiteralMapConverter(e.keys))}}class Ni{constructor(e,t,s,n,r,i){this._localResolver=e,this._implicitReceiver=t,this.bindingId=s,this.supportsInterpolation=n,this.baseSourceSpan=r,this.implicitReceiverAccesses=i,this._nodeMap=new Map,this._resultMap=new Map,this._currentTemporary=0,this.temporaryCount=0,this.usesImplicitReceiver=!1}visitUnary(t,s){let n;switch(t.operator){case"+":n=e.UnaryOperator.Plus;break;case"-":n=e.UnaryOperator.Minus;break;default:throw new Error(`Unsupported operator ${t.operator}`)}return Ii(s,new Ge(n,this._visit(t.expr,Nr.Expression),void 0,this.convertSourceSpan(t.span)))}visitBinary(t,s){let n;switch(t.operation){case"+":n=e.BinaryOperator.Plus;break;case"-":n=e.BinaryOperator.Minus;break;case"*":n=e.BinaryOperator.Multiply;break;case"/":n=e.BinaryOperator.Divide;break;case"%":n=e.BinaryOperator.Modulo;break;case"&&":n=e.BinaryOperator.And;break;case"||":n=e.BinaryOperator.Or;break;case"==":n=e.BinaryOperator.Equals;break;case"!=":n=e.BinaryOperator.NotEquals;break;case"===":n=e.BinaryOperator.Identical;break;case"!==":n=e.BinaryOperator.NotIdentical;break;case"<":n=e.BinaryOperator.Lower;break;case">":n=e.BinaryOperator.Bigger;break;case"<=":n=e.BinaryOperator.LowerEquals;break;case">=":n=e.BinaryOperator.BiggerEquals;break;case"??":return this.convertNullishCoalesce(t,s);default:throw new Error(`Unsupported operation ${t.operation}`)}return Ii(s,new Ye(n,this._visit(t.left,Nr.Expression),this._visit(t.right,Nr.Expression),void 0,this.convertSourceSpan(t.span)))}visitChain(e,t){return function(e,t){if(e!==Nr.Statement)throw new Error(`Expected a statement, but saw ${t}`)}(t,e),this.visitAll(e.expressions,t)}visitConditional(e,t){return Ii(t,this._visit(e.condition,Nr.Expression).conditional(this._visit(e.trueExp,Nr.Expression),this._visit(e.falseExp,Nr.Expression),this.convertSourceSpan(e.span)))}visitPipe(e,t){throw new Error(`Illegal state: Pipes should have been converted into functions. Pipe: ${e.name}`)}visitImplicitReceiver(e,t){return Ci(t,e),this.usesImplicitReceiver=!0,this._implicitReceiver}visitThisReceiver(e,t){return this.visitImplicitReceiver(e,t)}visitInterpolation(e,t){if(!this.supportsInterpolation)throw new Error("Unexpected interpolation");Ci(t,e);let s=[];for(let t=0;t=9&&(s=[xt(s)]),new Li(s)}visitKeyedRead(e,t){const s=this.leftMostSafeNode(e);return s?this.convertSafeAccess(e,s,t):Ii(t,this._visit(e.receiver,Nr.Expression).key(this._visit(e.key,Nr.Expression)))}visitKeyedWrite(e,t){const s=this._visit(e.receiver,Nr.Expression),n=this._visit(e.key,Nr.Expression),r=this._visit(e.value,Nr.Expression);return s===this._implicitReceiver&&this._localResolver.maybeRestoreView(),Ii(t,s.key(n).set(r))}visitLiteralArray(e,t){throw new Error("Illegal State: literal arrays should have been converted into functions")}visitLiteralMap(e,t){throw new Error("Illegal State: literal maps should have been converted into functions")}visitLiteralPrimitive(e,t){const s=null===e.value||void 0===e.value||!0===e.value||!0===e.value?ue:void 0;return Ii(t,Tt(e.value,s,this.convertSourceSpan(e.span)))}_getLocal(e,t){return this._localResolver.globals?.has(e)&&t instanceof Ur?null:this._localResolver.getLocal(e)}visitPrefixNot(e,t){return Ii(t,St(this._visit(e.expression,Nr.Expression)))}visitNonNullAssert(e,t){return Ii(t,this._visit(e.expression,Nr.Expression))}visitPropertyRead(e,t){const s=this.leftMostSafeNode(e);if(s)return this.convertSafeAccess(e,s,t);{let s=null;const n=this.usesImplicitReceiver,r=this._visit(e.receiver,Nr.Expression);return r===this._implicitReceiver&&(s=this._getLocal(e.name,e.receiver),s&&(this.usesImplicitReceiver=n,this.addImplicitReceiverAccess(e.name))),null==s&&(s=r.prop(e.name,this.convertSourceSpan(e.span))),Ii(t,s)}}visitPropertyWrite(e,t){const s=this._visit(e.receiver,Nr.Expression),n=this.usesImplicitReceiver;let r=null;if(s===this._implicitReceiver){const t=this._getLocal(e.name,e.receiver);if(t){if(!(t instanceof Qe)){const t=e.name,s=e.value instanceof Wr?e.value.name:void 0;throw new Error(`Cannot assign value "${s}" to template variable "${t}". Template variables are read-only.`)}r=t,this.usesImplicitReceiver=n,this.addImplicitReceiverAccess(e.name)}}return null===r&&(r=s.prop(e.name,this.convertSourceSpan(e.span))),Ii(t,r.set(this._visit(e.value,Nr.Expression)))}visitSafePropertyRead(e,t){return this.convertSafeAccess(e,this.leftMostSafeNode(e),t)}visitSafeKeyedRead(e,t){return this.convertSafeAccess(e,this.leftMostSafeNode(e),t)}visitAll(e,t){return e.map((e=>this._visit(e,t)))}visitCall(e,t){const s=this.leftMostSafeNode(e);if(s)return this.convertSafeAccess(e,s,t);const n=this.visitAll(e.args,Nr.Expression);if(e instanceof Ri)return Ii(t,e.converter(n));const r=e.receiver;if(r instanceof Wr&&r.receiver instanceof Vr&&!(r.receiver instanceof Ur)&&"$any"===r.name){if(1!==n.length)throw new Error(`Invalid call to $any, expected 1 argument but received ${n.length||"none"}`);return Ii(t,n[0])}return Ii(t,this._visit(r,Nr.Expression).callFn(n,this.convertSourceSpan(e.span)))}visitSafeCall(e,t){return this.convertSafeAccess(e,this.leftMostSafeNode(e),t)}_visit(e,t){const s=this._resultMap.get(e);return s||(this._nodeMap.get(e)||e).visit(this,t)}convertSafeAccess(e,t,s){let n,r=this._visit(t.receiver,Nr.Expression);this.needsTemporaryInSafeAccess(t.receiver)&&(n=this.allocateTemporary(),r=n.set(r),this._resultMap.set(t.receiver,n));const i=r.isBlank();t instanceof oi?this._nodeMap.set(t,new ai(t.span,t.sourceSpan,t.receiver,t.args,t.argumentSpan)):t instanceof Yr?this._nodeMap.set(t,new Gr(t.span,t.sourceSpan,t.receiver,t.key)):this._nodeMap.set(t,new Wr(t.span,t.sourceSpan,t.nameSpan,t.receiver,t.name));const a=this._visit(e,Nr.Expression);return this._nodeMap.delete(t),n&&this.releaseTemporary(n),Ii(s,i.conditional(st,a))}convertNullishCoalesce(e,t){const s=this._visit(e.left,Nr.Expression),n=this._visit(e.right,Nr.Expression),r=this.allocateTemporary();return this.releaseTemporary(r),Ii(t,r.set(s).notIdentical(st).and(r.notIdentical(Tt(void 0))).conditional(r,n))}leftMostSafeNode(e){const t=(e,t)=>(this._nodeMap.get(t)||t).visit(e);return e.visit({visitUnary:e=>null,visitBinary:e=>null,visitChain:e=>null,visitConditional:e=>null,visitCall(e){return t(this,e.receiver)},visitSafeCall(e){return t(this,e.receiver)||e},visitImplicitReceiver:e=>null,visitThisReceiver:e=>null,visitInterpolation:e=>null,visitKeyedRead(e){return t(this,e.receiver)},visitKeyedWrite:e=>null,visitLiteralArray:e=>null,visitLiteralMap:e=>null,visitLiteralPrimitive:e=>null,visitPipe:e=>null,visitPrefixNot:e=>null,visitNonNullAssert:e=>null,visitPropertyRead(e){return t(this,e.receiver)},visitPropertyWrite:e=>null,visitSafePropertyRead(e){return t(this,e.receiver)||e},visitSafeKeyedRead(e){return t(this,e.receiver)||e}})}needsTemporaryInSafeAccess(e){const t=(e,t)=>t&&(this._nodeMap.get(t)||t).visit(e);return e.visit({visitUnary(e){return t(this,e.expr)},visitBinary(e){return t(this,e.left)||t(this,e.right)},visitChain:e=>!1,visitConditional(e){return t(this,e.condition)||t(this,e.trueExp)||t(this,e.falseExp)},visitCall:e=>!0,visitSafeCall:e=>!0,visitImplicitReceiver:e=>!1,visitThisReceiver:e=>!1,visitInterpolation(e){return((e,s)=>s.some((s=>t(e,s))))(this,e.expressions)},visitKeyedRead:e=>!1,visitKeyedWrite:e=>!1,visitLiteralArray:e=>!0,visitLiteralMap:e=>!0,visitLiteralPrimitive:e=>!1,visitPipe:e=>!0,visitPrefixNot(e){return t(this,e.expression)},visitNonNullAssert(e){return t(this,e.expression)},visitPropertyRead:e=>!1,visitPropertyWrite:e=>!1,visitSafePropertyRead:e=>!1,visitSafeKeyedRead:e=>!1})}allocateTemporary(){const e=this._currentTemporary++;return this.temporaryCount=Math.max(this._currentTemporary,this.temporaryCount),new _e(bi(this.bindingId,e))}releaseTemporary(e){if(this._currentTemporary--,e.name!=bi(this.bindingId,this._currentTemporary))throw new Error(`Temporary ${e.name} released out of order`)}convertSourceSpan(e){if(this.baseSourceSpan){const t=this.baseSourceSpan.start.moveBy(e.start),s=this.baseSourceSpan.start.moveBy(e.end),n=this.baseSourceSpan.fullStart.moveBy(e.start);return new cr(t,s,n)}return null}addImplicitReceiverAccess(e){this.implicitReceiverAccesses&&this.implicitReceiverAccesses.add(e)}}function Pi(e,t){Array.isArray(e)?e.forEach((e=>Pi(e,t))):t.push(e)}function Ai(){throw new Error("Unsupported operation")}class Li extends Ee{constructor(e){super(null,null),this.args=e,this.isConstant=Ai,this.isEquivalent=Ai,this.visitExpression=Ai}}class Mi{constructor(e){this.globals=e}notifyImplicitReceiverUse(){}maybeRestoreView(){}getLocal(e){return e===xi.event.name?xi.event:null}}class Ri extends ai{constructor(e,t,s,n){super(e,t,new Fr(e,t),s,null),this.converter=n}}let Oi;function $i(){return Oi||(Oi={},Di(E.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),Di(E.STYLE,["*|style"]),Di(E.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]),Di(E.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])),Oi}function Di(e,t){for(const s of t)Oi[s.toLowerCase()]=e}const Bi=new Set(["sandbox","allow","allowfullscreen","referrerpolicy","csp","fetchpriority"]);function qi(e){return Bi.has(e.toLowerCase())}const Fi=new Set(["inherit","initial","revert","unset","alternate","alternate-reverse","normal","reverse","backwards","both","forwards","none","paused","running","ease","ease-in","ease-in-out","ease-out","linear","step-start","step-end","end","jump-both","jump-end","jump-none","jump-start","start"]);class Vi{constructor(){this.strictStyling=!0,this._animationDeclarationKeyframesRe=/(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g}shimCssText(e,t,s=""){const n=e.match(oa)||[];e=function(e){return e.replace(aa,"")}(e),e=this._insertDirectives(e);return[this._scopeCssText(e,t,s),...n].join("\n")}_insertDirectives(e){return e=this._insertPolyfillDirectivesInCssText(e),this._insertPolyfillRulesInCssText(e)}_scopeKeyframesRelatedCss(e,t){const s=new Set,n=ya(e,(e=>this._scopeLocalKeyframeDeclarations(e,t,s)));return ya(n,(e=>this._scopeAnimationRule(e,t,s)))}_scopeLocalKeyframeDeclarations(e,t,s){return{...e,selector:e.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/,((e,n,r,i,a)=>(s.add(Sa(i,r)),`${n}${r}${t}_${i}${r}${a}`)))}}_scopeAnimationKeyframe(e,t,s){return e.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/,((e,n,r,i,a)=>`${n}${r}${i=`${s.has(Sa(i,r))?t+"_":""}${i}`}${r}${a}`))}_scopeAnimationRule(e,t,s){let n=e.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation(?:\s*):(?:\s*))([^;]+)/g,((e,n,r)=>n+r.replace(this._animationDeclarationKeyframesRe,((e,n,r="",i,a)=>i?`${n}${this._scopeAnimationKeyframe(`${r}${i}${r}`,t,s)}`:Fi.has(a)?e:`${n}${this._scopeAnimationKeyframe(a,t,s)}`))));return n=n.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g,((e,n,r)=>`${n}${r.split(",").map((e=>this._scopeAnimationKeyframe(e,t,s))).join(",")}`)),{...e,content:n}}_insertPolyfillDirectivesInCssText(e){return e.replace(Hi,(function(...e){return e[2]+"{"}))}_insertPolyfillRulesInCssText(e){return e.replace(ji,((...e)=>{const t=e[0].replace(e[1],"").replace(e[2],"");return e[4]+t}))}_scopeCssText(e,t,s){const n=this._extractUnscopedRulesFromCssText(e);return e=this._insertPolyfillHostInCssText(e),e=this._convertColonHost(e),e=this._convertColonHostContext(e),e=this._convertShadowDOMSelectors(e),t&&(e=this._scopeKeyframesRelatedCss(e,t),e=this._scopeSelectors(e,t,s)),(e=e+"\n"+n).trim()}_extractUnscopedRulesFromCssText(e){let t,s="";for(Wi.lastIndex=0;null!==(t=Wi.exec(e));){s+=t[0].replace(t[2],"").replace(t[1],t[4])+"\n\n"}return s}_convertColonHost(e){return e.replace(Yi,((e,t,s)=>{if(t){const e=[],n=t.split(",").map((e=>e.trim()));for(const t of n){if(!t)break;const n=Ji+t.replace(zi,"")+s;e.push(n)}return e.join(",")}return Ji+s}))}_convertColonHostContext(e){return e.replace(Qi,(e=>{const t=[[]];let s;for(;s=Xi.exec(e);){const n=(s[1]??"").trim().split(",").map((e=>e.trim())).filter((e=>""!==e)),r=t.length;Ea(t,n.length);for(let e=0;efunction(e,t){const s=Ji;na.lastIndex=0;const n=na.test(t);if(0===e.length)return s+t;const r=[e.pop()||""];for(;e.length>0;){const t=r.length,s=e.pop();for(let e=0;en?`${e}${t}`:`${e}${s}${t}, ${e} ${s}${t}`)).join(",")}(t,e))).join(", ")}))}_convertShadowDOMSelectors(e){return ea.reduce(((e,t)=>e.replace(t," ")),e)}_scopeSelectors(e,t,s){return ya(e,(e=>{let n=e.selector,r=e.content;return"@"!==e.selector[0]?n=this._scopeSelector(e.selector,t,s,this.strictStyling):e.selector.startsWith("@media")||e.selector.startsWith("@supports")||e.selector.startsWith("@document")||e.selector.startsWith("@layer")||e.selector.startsWith("@container")?r=this._scopeSelectors(e.content,t,s):(e.selector.startsWith("@font-face")||e.selector.startsWith("@page"))&&(r=this._stripScopingSelectors(e.content)),new fa(n,r)}))}_stripScopingSelectors(e){return ya(e,(e=>{const t=e.selector.replace(ta," ").replace(Zi," ");return new fa(t,e.content)}))}_scopeSelector(e,t,s,n){return e.split(",").map((e=>e.trim().split(ta))).map((e=>{const[r,...i]=e;return[(e=>this._selectorNeedsScoping(e,t)?n?this._applyStrictSelectorScope(e,t,s):this._applySelectorScope(e,t,s):e)(r),...i].join(" ")})).join(", ")}_selectorNeedsScoping(e,t){return!this._makeScopeMatcher(t).test(e)}_makeScopeMatcher(e){return e=e.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),new RegExp("^("+e+")"+sa,"m")}_applySelectorScope(e,t,s){return this._applySimpleSelectorScope(e,t,s)}_applySimpleSelectorScope(e,t,s){if(na.lastIndex=0,na.test(e)){const n=this.strictStyling?`[${s}]`:t;return e.replace(Zi,((e,t)=>t.replace(/([^:]*)(:*)(.*)/,((e,t,s,r)=>t+n+s+r)))).replace(na,n+" ")}return t+" "+e}_applyStrictSelectorScope(e,t,s){const n="["+(t=t.replace(/\[is=([^\]]*)\]/g,((e,...t)=>t[0])))+"]",r=e=>{let r=e.trim();if(!r)return"";if(e.indexOf(Ji)>-1)r=this._applySimpleSelectorScope(e,t,s);else{const t=e.replace(na,"");if(t.length>0){const e=t.match(/([^:]*)(:*)(.*)/);e&&(r=e[1]+n+e[2]+e[3])}}return r},i=new Ui(e);let a,o="",l=0;const c=/( |>|\+|~(?!=))\s*/g;let u=!((e=i.content()).indexOf(Ji)>-1);for(;null!==(a=c.exec(e));){const t=a[1],s=e.slice(l,a.index).trim();u=u||s.indexOf(Ji)>-1;o+=`${u?r(s):s} ${t} `,l=c.lastIndex}const p=e.substring(l);return u=u||p.indexOf(Ji)>-1,o+=u?r(p):p,i.restore(o)}_insertPolyfillHostInCssText(e){return e.replace(ia,Ki).replace(ra,zi)}}class Ui{constructor(e){this.placeholders=[],this.index=0,e=this._escapeRegexMatches(e,/(\[[^\]]*\])/g),e=this._escapeRegexMatches(e,/(\\.)/g),this._content=e.replace(/(:nth-[-\w]+)(\([^)]+\))/g,((e,t,s)=>{const n=`__ph-${this.index}__`;return this.placeholders.push(s),this.index++,t+n}))}restore(e){return e.replace(/__ph-(\d+)__/g,((e,t)=>this.placeholders[+t]))}content(){return this._content}_escapeRegexMatches(e,t){return e.replace(t,((e,t)=>{const s=`__ph-${this.index}__`;return this.placeholders.push(t),this.index++,s}))}}const Hi=/polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim,ji=/(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,Wi=/(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,zi="-shadowcsshost",Ki="-shadowcsscontext",Gi="(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",Yi=new RegExp(zi+Gi,"gim"),Qi=new RegExp(Ki+Gi,"gim"),Xi=new RegExp(Ki+Gi,"im"),Ji=zi+"-no-combinator",Zi=/-shadowcsshost-no-combinator([^\s]*)/,ea=[/::shadow/g,/::content/g,/\/shadow-deep\//g,/\/shadow\//g],ta=/(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g,sa="([>\\s~+[.,{:][\\s\\S]*)?$",na=/-shadowcsshost/gim,ra=/:host/gim,ia=/:host-context/gim,aa=/\/\*[\s\S]*?\*\//g;const oa=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;const la="%BLOCK%",ca=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,ua=new Map([["{","}"]]),pa="%COMMA_IN_PLACEHOLDER%",ha="%SEMI_IN_PLACEHOLDER%",da="%COLON_IN_PLACEHOLDER%",ma=new RegExp(pa,"g"),ga=new RegExp(ha,"g"),va=new RegExp(da,"g");class fa{constructor(e,t){this.selector=e,this.content=t}}function ya(e,t){const s=function(e){let t=e,s=null;for(let e=0;e{const s=e[2];let i="",a=e[4],o="";a&&a.startsWith("{%BLOCK%")&&(i=n.blocks[r++],a=a.substring(la.length+1),o="{");const l=t(new fa(s,i));return`${e[1]}${l.selector}${e[3]}${o}${l.content}${a}`})))}class xa{constructor(e,t){this.escapedString=e,this.blocks=t}}const wa={";":ha,",":pa,":":da};function Sa(e,t){return t?e.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g,"$1"):e}function Ea(e,t){const s=e.length;for(let n=1;ne.charAt(0)+"-"+e.charAt(1))).toLowerCase()}class Ta{constructor(e){this._directiveExpr=e,this._hasInitialValues=!1,this.hasBindings=!1,this.hasBindingsWithPipes=!1,this._classMapInput=null,this._styleMapInput=null,this._singleStyleInputs=null,this._singleClassInputs=null,this._lastStylingInput=null,this._firstStylingInput=null,this._stylesIndex=new Map,this._classesIndex=new Map,this._initialStyleValues=[],this._initialClassValues=[]}registerBoundInput(e){let t=null,s=e.name;switch(e.type){case 0:t=this.registerInputBasedOnName(s,e.value,e.sourceSpan);break;case 3:t=this.registerStyleInput(s,!1,e.value,e.sourceSpan,e.unit);break;case 2:t=this.registerClassInput(s,!1,e.value,e.sourceSpan)}return!!t}registerInputBasedOnName(e,t,s){let n=null;const r=e.substring(0,6),i="style"===e||"style."===r||"style!"===r;if(i||!i&&("class"===e||"class."===r||"class!"===r)){const r="."!==e.charAt(5),a=e.slice(r?5:6);n=i?this.registerStyleInput(a,r,t,s):this.registerClassInput(a,r,t,s)}return n}registerStyleInput(e,t,s,n,r){if(Na(s))return null;(function(e){return e.startsWith("--")})(e)||(e=ba(e));const{property:i,hasOverrideFlag:a,suffix:o}=Ia(e),l={name:i,suffix:r="string"==typeof r&&0!==r.length?r:o,value:s,sourceSpan:n,hasOverrideFlag:a};return t?this._styleMapInput=l:((this._singleStyleInputs=this._singleStyleInputs||[]).push(l),Ca(this._stylesIndex,i)),this._lastStylingInput=l,this._firstStylingInput=this._firstStylingInput||l,this._checkForPipes(s),this.hasBindings=!0,l}registerClassInput(e,t,s,n){if(Na(s))return null;const{property:r,hasOverrideFlag:i}=Ia(e),a={name:r,value:s,sourceSpan:n,hasOverrideFlag:i,suffix:null};return t?this._classMapInput=a:((this._singleClassInputs=this._singleClassInputs||[]).push(a),Ca(this._classesIndex,r)),this._lastStylingInput=a,this._firstStylingInput=this._firstStylingInput||a,this._checkForPipes(s),this.hasBindings=!0,a}_checkForPipes(e){e instanceof ci&&e.ast instanceof Xr&&(this.hasBindingsWithPipes=!0)}registerStyleAttr(e){this._initialStyleValues=function(e){const t=[];let s=0,n=0,r=0,i=0,a=0,o=null,l=!1;for(;s0,0===r?r=39:39===r&&92!==e.charCodeAt(s-1)&&(r=0);break;case 34:l=l||i>0,0===r?r=34:34===r&&92!==e.charCodeAt(s-1)&&(r=0);break;case 58:o||0!==n||0!==r||(o=ba(e.substring(a,s-1).trim()),i=s);break;case 59:if(o&&i>0&&0===n&&0===r){const n=e.substring(i,s-1).trim();t.push(o,l?_a(n):n),a=s,i=0,o=null,l=!1}}if(o&&i){const s=e.slice(i).trim();t.push(o,l?_a(s):s)}return t}(e),this._hasInitialValues=!0}registerClassAttr(e){this._initialClassValues=e.trim().split(/\s+/g),this._hasInitialValues=!0}populateInitialStylingAttrs(e){if(this._initialClassValues.length){e.push(Tt(1));for(let t=0;t{const t=e(r);return Array.isArray(t)?t:[t]}}]}}_buildSingleInputs(e,t,s,n,r){const i=[];return t.forEach((t=>{const a=i[i.length-1],o=t.value.visit(s);let l=e,c=2;o instanceof ti&&(c+=o.expressions.length,n&&(l=n(o)));const u={sourceSpan:t.sourceSpan,allocateBindingSlots:c,supportsInterpolation:!!n,params:e=>{const s=[];s.push(Tt(t.name));const n=e(o);return Array.isArray(n)?s.push(...n):s.push(n),r||null===t.suffix||s.push(Tt(t.suffix)),s}};a&&a.reference===l?a.calls.push(u):i.push({reference:l,calls:[u]})})),i}_buildClassInputs(e){return this._singleClassInputs?this._buildSingleInputs(qt.classProp,this._singleClassInputs,e,null,!0):[]}_buildStyleInputs(e){return this._singleStyleInputs?this._buildSingleInputs(qt.styleProp,this._singleStyleInputs,e,ka,!1):[]}buildUpdateLevelInstructions(e){const t=[];if(this.hasBindings){const s=this.buildStyleMapInstruction(e);s&&t.push(s);const n=this.buildClassMapInstruction(e);n&&t.push(n),t.push(...this._buildStyleInputs(e)),t.push(...this._buildClassInputs(e))}return t}}function Ca(e,t){e.has(t)||e.set(t,e.size)}function Ia(e){let t=!1;const s=e.indexOf("!important");-1!==s&&(e=s>0?e.substring(0,s):"",t=!0);let n=null,r=e;const i=e.lastIndexOf(".");return i>0&&(n=e.slice(i+1),r=e.substring(0,i)),{property:r,suffix:n,hasOverrideFlag:t}}function ka(e){switch(Ln(e)){case 1:return qt.styleProp;case 3:return qt.stylePropInterpolate1;case 5:return qt.stylePropInterpolate2;case 7:return qt.stylePropInterpolate3;case 9:return qt.stylePropInterpolate4;case 11:return qt.stylePropInterpolate5;case 13:return qt.stylePropInterpolate6;case 15:return qt.stylePropInterpolate7;case 17:return qt.stylePropInterpolate8;default:return qt.stylePropInterpolateV}}function Na(e){return e instanceof ci&&(e=e.ast),e instanceof Fr}var Pa;e.TokenType=void 0,(Pa=e.TokenType||(e.TokenType={}))[Pa.Character=0]="Character",Pa[Pa.Identifier=1]="Identifier",Pa[Pa.PrivateIdentifier=2]="PrivateIdentifier",Pa[Pa.Keyword=3]="Keyword",Pa[Pa.String=4]="String",Pa[Pa.Operator=5]="Operator",Pa[Pa.Number=6]="Number",Pa[Pa.Error=7]="Error";const Aa=["var","let","as","null","undefined","true","false","if","else","this"];class La{tokenize(e){const t=new Da(e),s=[];let n=t.scanToken();for(;null!=n;)s.push(n),n=t.scanToken();return s}}class Ma{constructor(e,t,s,n,r){this.index=e,this.end=t,this.type=s,this.numValue=n,this.strValue=r}isCharacter(t){return this.type==e.TokenType.Character&&this.numValue==t}isNumber(){return this.type==e.TokenType.Number}isString(){return this.type==e.TokenType.String}isOperator(t){return this.type==e.TokenType.Operator&&this.strValue==t}isIdentifier(){return this.type==e.TokenType.Identifier}isPrivateIdentifier(){return this.type==e.TokenType.PrivateIdentifier}isKeyword(){return this.type==e.TokenType.Keyword}isKeywordLet(){return this.type==e.TokenType.Keyword&&"let"==this.strValue}isKeywordAs(){return this.type==e.TokenType.Keyword&&"as"==this.strValue}isKeywordNull(){return this.type==e.TokenType.Keyword&&"null"==this.strValue}isKeywordUndefined(){return this.type==e.TokenType.Keyword&&"undefined"==this.strValue}isKeywordTrue(){return this.type==e.TokenType.Keyword&&"true"==this.strValue}isKeywordFalse(){return this.type==e.TokenType.Keyword&&"false"==this.strValue}isKeywordThis(){return this.type==e.TokenType.Keyword&&"this"==this.strValue}isError(){return this.type==e.TokenType.Error}toNumber(){return this.type==e.TokenType.Number?this.numValue:-1}toString(){switch(this.type){case e.TokenType.Character:case e.TokenType.Identifier:case e.TokenType.Keyword:case e.TokenType.Operator:case e.TokenType.PrivateIdentifier:case e.TokenType.String:case e.TokenType.Error:return this.strValue;case e.TokenType.Number:return this.numValue.toString();default:return null}}}function Ra(t,s,n){return new Ma(t,s,e.TokenType.Character,n,String.fromCharCode(n))}function Oa(t,s,n){return new Ma(t,s,e.TokenType.Operator,0,n)}const $a=new Ma(-1,-1,e.TokenType.Character,0,"");class Da{constructor(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?0:this.input.charCodeAt(this.index)}scanToken(){const e=this.input,t=this.length;let s=this.peek,n=this.index;for(;s<=32;){if(++n>=t){s=0;break}s=e.charCodeAt(n)}if(this.peek=s,this.index=n,n>=t)return null;if(Ba(s))return this.scanIdentifier();if(sr(s))return this.scanNumber(n);const r=n;switch(s){case Hn:return this.advance(),sr(this.peek)?this.scanNumber(r):Ra(r,this.index,Hn);case 40:case 41:case Zn:case er:case 91:case 93:case Un:case Wn:case zn:return this.scanCharacter(r,s);case 39:case 34:return this.scanString();case 35:return this.scanPrivateIdentifier();case 43:case 45:case 42:case jn:case 37:case 94:return this.scanOperator(r,String.fromCharCode(s));case 63:return this.scanQuestion(r);case Kn:case Yn:return this.scanComplexOperator(r,String.fromCharCode(s),Gn,"=");case 33:case Gn:return this.scanComplexOperator(r,String.fromCharCode(s),Gn,"=",Gn,"=");case 38:return this.scanComplexOperator(r,"&",38,"&");case 124:return this.scanComplexOperator(r,"|",124,"|");case 160:for(;tr(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,t){return this.advance(),Ra(e,this.index,t)}scanOperator(e,t){return this.advance(),Oa(e,this.index,t)}scanComplexOperator(e,t,s,n,r,i){this.advance();let a=t;return this.peek==s&&(this.advance(),a+=n),null!=r&&this.peek==r&&(this.advance(),a+=i),Oa(e,this.index,a)}scanIdentifier(){const t=this.index;for(this.advance();qa(this.peek);)this.advance();const s=this.input.substring(t,this.index);return Aa.indexOf(s)>-1?(n=t,r=this.index,i=s,new Ma(n,r,e.TokenType.Keyword,0,i)):function(t,s,n){return new Ma(t,s,e.TokenType.Identifier,0,n)}(t,this.index,s);var n,r,i}scanPrivateIdentifier(){const t=this.index;if(this.advance(),!Ba(this.peek))return this.error("Invalid character [#]",-1);for(;qa(this.peek);)this.advance();const s=this.input.substring(t,this.index);return n=t,r=this.index,i=s,new Ma(n,r,e.TokenType.PrivateIdentifier,0,i);var n,r,i}scanNumber(t){let s=this.index===t,n=!1;for(this.advance();;){if(sr(this.peek));else if(95===this.peek){if(!sr(this.input.charCodeAt(this.index-1))||!sr(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);n=!0}else if(this.peek===Hn)s=!1;else{if(101!=(r=this.peek)&&69!=r)break;if(this.advance(),Fa(this.peek)&&this.advance(),!sr(this.peek))return this.error("Invalid exponent",-1);s=!1}this.advance()}var r;let i=this.input.substring(t,this.index);n&&(i=i.replace(/_/g,""));const a=s?function(e){const t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}(i):parseFloat(i);return o=t,l=this.index,c=a,new Ma(o,l,e.TokenType.Number,c,"");var o,l,c}scanString(){const t=this.index,s=this.peek;this.advance();let n="",r=this.index;const i=this.input;for(;this.peek!=s;)if(92==this.peek){let e;if(n+=i.substring(r,this.index),this.advance(),this.peek=this.peek,117==this.peek){const t=i.substring(this.index+1,this.index+5);if(!/^[0-9a-f]+$/i.test(t))return this.error(`Invalid unicode escape [\\u${t}]`,0);e=parseInt(t,16);for(let e=0;e<5;e++)this.advance()}else e=Va(this.peek),this.advance();n+=String.fromCharCode(e),r=this.index}else{if(0==this.peek)return this.error("Unterminated quote",0);this.advance()}const a=i.substring(r,this.index);return this.advance(),o=t,l=this.index,c=n+a,new Ma(o,l,e.TokenType.String,0,c);var o,l,c}scanQuestion(e){this.advance();let t="?";return 63!==this.peek&&this.peek!==Hn||(t+=this.peek===Hn?".":"?",this.advance()),Oa(e,this.index,t)}error(t,s){const n=this.index+s;return function(t,s,n){return new Ma(t,s,e.TokenType.Error,0,n)}(n,this.index,`Lexer Error: ${t} at column ${n} in expression [${this.input}]`)}}function Ba(e){return Xn<=e&&e<=Jn||Qn<=e&&e<=90||95==e||36==e}function qa(e){return nr(e)||sr(e)||95==e||36==e}function Fa(e){return 45==e||43==e}function Va(e){switch(e){case 110:return Vn;case 102:return 12;case 114:return 13;case 116:return 9;case 118:return 11;default:return e}}class Ua{constructor(e,t,s){this.strings=e,this.expressions=t,this.offsets=s}}class Ha{constructor(e,t,s){this.templateBindings=e,this.warnings=t,this.errors=s}}class ja{constructor(e){this._lexer=e,this.errors=[]}parseAction(e,t,s,n,r=Fn){this._checkNoInterpolation(e,s,r);const i=this._stripComments(e),a=this._lexer.tokenize(i);let o=1;t&&(o|=2);const l=new za(e,s,n,a,o,this.errors,0).parseChain();return new ci(l,e,s,n,this.errors)}parseBinding(e,t,s,n=Fn){const r=this._parseBindingAst(e,t,s,n);return new ci(r,e,t,s,this.errors)}checkSimpleExpression(e){const t=new Ka;return e.visit(t),t.errors}parseSimpleBinding(e,t,s,n=Fn){const r=this._parseBindingAst(e,t,s,n),i=this.checkSimpleExpression(r);return i.length>0&&this._reportError(`Host binding expression cannot contain ${i.join(" ")}`,e,t),new ci(r,e,t,s,this.errors)}_reportError(e,t,s,n){this.errors.push(new $r(e,t,s,n))}_parseBindingAst(e,t,s,n){this._checkNoInterpolation(e,t,n);const r=this._stripComments(e),i=this._lexer.tokenize(r);return new za(e,t,s,i,0,this.errors,0).parseChain()}parseTemplateBindings(e,t,s,n,r){const i=this._lexer.tokenize(t);return new za(t,s,r,i,0,this.errors,0).parseTemplateBindings({source:e,span:new li(n,n+e.length)})}parseInterpolation(e,t,s,n,r=Fn){const{strings:i,expressions:a,offsets:o}=this.splitInterpolation(e,t,n,r);if(0===a.length)return null;const l=[];for(let n=0;ne.text)),l,e,t,s)}parseInterpolationExpression(e,t,s){const n=this._stripComments(e),r=this._lexer.tokenize(n),i=new za(e,t,s,r,0,this.errors,0).parseChain();return this.createInterpolationAst(["",""],[i],e,t,s)}createInterpolationAst(e,t,s,n,r){const i=new Dr(0,s.length),a=new ti(i,i.toAbsolute(r),e,t);return new ci(a,s,n,r,this.errors)}splitInterpolation(e,t,s,n=Fn){const r=[],i=[],a=[],o=s?function(e){let t=new Map,s=0,n=0,r=0;for(;re+t.length),0);n+=e,s+=e}t.set(n,s),r++}return t}(s):null;let l=0,c=!1,u=!1,{start:p,end:h}=n;for(;l-1)break;r>-1&&i>-1&&this._reportError(`Got interpolation (${s}${n}) where expression was expected`,e,`at column ${r} in`,t)}_getInterpolationEndIndex(e,t,s){for(const n of this._forEachUnquotedChar(e,s)){if(e.startsWith(t,n))return n;if(e.startsWith("//",n))return e.indexOf(t,n)}return-1}*_forEachUnquotedChar(e,t){let s=null,n=0;for(let r=t;r=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){if(this.index>0){return this.peek(-1).end+this.offset}return 0===this.tokens.length?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let s=this.currentEndIndex;if(void 0!==t&&t>this.currentEndIndex&&(s=t),e>s){const t=s;s=e,e=t}return new Dr(e,s)}sourceSpan(e,t){const s=`${e}@${this.inputIndex}:${t}`;return this.sourceSpanCache.has(s)||this.sourceSpanCache.set(s,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(s)}advance(){this.index++}withContext(e,t){this.context|=e;const s=t();return this.context^=e,s}consumeOptionalCharacter(e){return!!this.next.isCharacter(e)&&(this.advance(),!0)}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return!!this.next.isOperator(e)&&(this.advance(),!0)}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===$a?"end of input":`token ${e}`}expectIdentifierOrKeyword(){const e=this.next;return e.isIdentifier()||e.isKeyword()?(this.advance(),e.toString()):(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null)}expectIdentifierOrKeywordOrString(){const e=this.next;return e.isIdentifier()||e.isKeyword()||e.isString()?(this.advance(),e.toString()):(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),"")}parseChain(){const e=[],t=this.inputIndex;for(;this.index":case"<=":case">=":this.advance();const n=this.parseAdditive();s=new si(this.span(t),this.sourceSpan(t),e,s,n);continue}break}return s}parseAdditive(){const t=this.inputIndex;let s=this.parseMultiplicative();for(;this.next.type==e.TokenType.Operator;){const e=this.next.strValue;switch(e){case"+":case"-":this.advance();let n=this.parseMultiplicative();s=new si(this.span(t),this.sourceSpan(t),e,s,n);continue}break}return s}parseMultiplicative(){const t=this.inputIndex;let s=this.parsePrefix();for(;this.next.type==e.TokenType.Operator;){const e=this.next.strValue;switch(e){case"*":case"%":case"/":this.advance();let n=this.parsePrefix();s=new si(this.span(t),this.sourceSpan(t),e,s,n);continue}break}return s}parsePrefix(){if(this.next.type==e.TokenType.Operator){const e=this.inputIndex;let t;switch(this.next.strValue){case"+":return this.advance(),t=this.parsePrefix(),ni.createPlus(this.span(e),this.sourceSpan(e),t);case"-":return this.advance(),t=this.parsePrefix(),ni.createMinus(this.span(e),this.sourceSpan(e),t);case"!":return this.advance(),t=this.parsePrefix(),new ri(this.span(e),this.sourceSpan(e),t)}}return this.parseCallChain()}parseCallChain(){const e=this.inputIndex;let t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(Hn))t=this.parseAccessMember(t,e,!1);else if(this.consumeOptionalOperator("?."))t=this.consumeOptionalCharacter(40)?this.parseCall(t,e,!0):this.consumeOptionalCharacter(91)?this.parseKeyedReadOrWrite(t,e,!0):this.parseAccessMember(t,e,!0);else if(this.consumeOptionalCharacter(91))t=this.parseKeyedReadOrWrite(t,e,!1);else if(this.consumeOptionalCharacter(40))t=this.parseCall(t,e,!1);else{if(!this.consumeOptionalOperator("!"))return t;t=new ii(this.span(e),this.sourceSpan(e),t)}}parsePrimary(){const e=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;const e=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),e}if(this.next.isKeywordNull())return this.advance(),new Jr(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new Jr(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new Jr(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new Jr(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new Ur(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;const t=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new Zr(this.span(e),this.sourceSpan(e),t)}if(this.next.isCharacter(Zn))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new Vr(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){const t=this.next.toNumber();return this.advance(),new Jr(this.span(e),this.sourceSpan(e),t)}if(this.next.isString()){const t=this.next.toString();return this.advance(),new Jr(this.span(e),this.sourceSpan(e),t)}return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new Fr(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new Fr(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new Fr(this.span(e),this.sourceSpan(e)))}parseExpressionList(e){const t=[];do{if(this.next.isCharacter(e))break;t.push(this.parsePipe())}while(this.consumeOptionalCharacter(Un));return t}parseLiteralMap(){const e=[],t=[],s=this.inputIndex;if(this.expectCharacter(Zn),!this.consumeOptionalCharacter(er)){this.rbracesExpected++;do{const s=this.inputIndex,n=this.next.isString(),r=this.expectIdentifierOrKeywordOrString();if(e.push({key:r,quoted:n}),n)this.expectCharacter(Wn),t.push(this.parsePipe());else if(this.consumeOptionalCharacter(Wn))t.push(this.parsePipe());else{const e=this.span(s),n=this.sourceSpan(s);t.push(new Wr(e,n,n,new Vr(e,n),r))}}while(this.consumeOptionalCharacter(Un));this.rbracesExpected--,this.expectCharacter(er)}return new ei(this.span(s),this.sourceSpan(s),e,t)}parseAccessMember(e,t,s){const n=this.inputIndex,r=this.withContext(Wa.Writable,(()=>{const t=this.expectIdentifierOrKeyword()??"";return 0===t.length&&this.error("Expected identifier for property access",e.span.end),t})),i=this.sourceSpan(n);let a;if(s)this.consumeOptionalAssignment()?(this.error("The '?.' operator cannot be used in the assignment"),a=new Fr(this.span(t),this.sourceSpan(t))):a=new Kr(this.span(t),this.sourceSpan(t),i,e,r);else if(this.consumeOptionalAssignment()){if(!(1&this.parseFlags))return this.error("Bindings cannot contain assignments"),new Fr(this.span(t),this.sourceSpan(t));const s=this.parseConditional();a=new zr(this.span(t),this.sourceSpan(t),i,e,r,s)}else a=new Wr(this.span(t),this.sourceSpan(t),i,e,r);return a}parseCall(e,t,s){const n=this.inputIndex;this.rparensExpected++;const r=this.parseCallArguments(),i=this.span(n,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(41),this.rparensExpected--;const a=this.span(t),o=this.sourceSpan(t);return s?new oi(a,o,e,r,i):new ai(a,o,e,r,i)}consumeOptionalAssignment(){return 2&this.parseFlags&&this.next.isOperator("!")&&this.peek(1).isOperator("=")?(this.advance(),this.advance(),!0):this.consumeOptionalOperator("=")}parseCallArguments(){if(this.next.isCharacter(41))return[];const e=[];do{e.push(this.parsePipe())}while(this.consumeOptionalCharacter(Un));return e}expectTemplateBindingKey(){let e="",t=!1;const s=this.currentAbsoluteOffset;do{e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-")}while(t);return{source:e,span:new li(s,s+e.length)}}parseTemplateBindings(e){const t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index{this.rbracketsExpected++;const n=this.parsePipe();if(n instanceof Fr&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(93),!this.consumeOptionalOperator("="))return s?new Yr(this.span(t),this.sourceSpan(t),e,n):new Gr(this.span(t),this.sourceSpan(t),e,n);if(!s){const s=this.parseConditional();return new Qr(this.span(t),this.sourceSpan(t),e,n,s)}return this.error("The '?.' operator cannot be used in the assignment"),new Fr(this.span(t),this.sourceSpan(t))}))}parseDirectiveKeywordBindings(e){const t=[];this.consumeOptionalCharacter(Wn);const s=this.getDirectiveBoundTarget();let n=this.currentAbsoluteOffset;const r=this.parseAsBinding(e);r||(this.consumeStatementTerminator(),n=this.currentAbsoluteOffset);const i=new li(e.span.start,n);return t.push(new pi(i,e,s)),r&&t.push(r),t}getDirectiveBoundTarget(){if(this.next===$a||this.peekKeywordAs()||this.peekKeywordLet())return null;const e=this.parsePipe(),{start:t,end:s}=e.span,n=this.input.substring(t,s);return new ci(e,n,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();const t=this.expectTemplateBindingKey();this.consumeStatementTerminator();const s=new li(e.span.start,this.currentAbsoluteOffset);return new ui(s,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;const e=this.currentAbsoluteOffset;this.advance();const t=this.expectTemplateBindingKey();let s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();const n=new li(e,this.currentAbsoluteOffset);return new ui(n,t,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(zn)||this.consumeOptionalCharacter(Un)}error(e,t=null){this.errors.push(new $r(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return null==e&&(e=this.index),ee.visit(t,s)||t.visit(e,s):t=>t.visit(e,s);return t.forEach((e=>{const t=r(e);t&&n.push(t)})),n}const so={AElig:"Æ",AMP:"&",amp:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",af:"⁡",Aring:"Å",angst:"Å",Ascr:"𝒜",Assign:"≔",colone:"≔",coloneq:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",setminus:"∖",setmn:"∖",smallsetminus:"∖",ssetmn:"∖",Barv:"⫧",Barwed:"⌆",doublebarwedge:"⌆",Bcy:"Б",Because:"∵",becaus:"∵",because:"∵",Bernoullis:"ℬ",Bscr:"ℬ",bernou:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",breve:"˘",Bumpeq:"≎",HumpDownHump:"≎",bump:"≎",CHcy:"Ч",COPY:"©",copy:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",DD:"ⅅ",Cayleys:"ℭ",Cfr:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",cedil:"¸",CenterDot:"·",centerdot:"·",middot:"·",Chi:"Χ",CircleDot:"⊙",odot:"⊙",CircleMinus:"⊖",ominus:"⊖",CirclePlus:"⊕",oplus:"⊕",CircleTimes:"⊗",otimes:"⊗",ClockwiseContourIntegral:"∲",cwconint:"∲",CloseCurlyDoubleQuote:"”",rdquo:"”",rdquor:"”",CloseCurlyQuote:"’",rsquo:"’",rsquor:"’",Colon:"∷",Proportion:"∷",Colone:"⩴",Congruent:"≡",equiv:"≡",Conint:"∯",DoubleContourIntegral:"∯",ContourIntegral:"∮",conint:"∮",oint:"∮",Copf:"ℂ",complexes:"ℂ",Coproduct:"∐",coprod:"∐",CounterClockwiseContourIntegral:"∳",awconint:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",asympeq:"≍",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",ddagger:"‡",Darr:"↡",Dashv:"⫤",DoubleLeftTee:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",nabla:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",acute:"´",DiacriticalDot:"˙",dot:"˙",DiacriticalDoubleAcute:"˝",dblac:"˝",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"˜",tilde:"˜",Diamond:"⋄",diam:"⋄",diamond:"⋄",DifferentialD:"ⅆ",dd:"ⅆ",Dopf:"𝔻",Dot:"¨",DoubleDot:"¨",die:"¨",uml:"¨",DotDot:"⃜",DotEqual:"≐",doteq:"≐",esdot:"≐",DoubleDownArrow:"⇓",Downarrow:"⇓",dArr:"⇓",DoubleLeftArrow:"⇐",Leftarrow:"⇐",lArr:"⇐",DoubleLeftRightArrow:"⇔",Leftrightarrow:"⇔",hArr:"⇔",iff:"⇔",DoubleLongLeftArrow:"⟸",Longleftarrow:"⟸",xlArr:"⟸",DoubleLongLeftRightArrow:"⟺",Longleftrightarrow:"⟺",xhArr:"⟺",DoubleLongRightArrow:"⟹",Longrightarrow:"⟹",xrArr:"⟹",DoubleRightArrow:"⇒",Implies:"⇒",Rightarrow:"⇒",rArr:"⇒",DoubleRightTee:"⊨",vDash:"⊨",DoubleUpArrow:"⇑",Uparrow:"⇑",uArr:"⇑",DoubleUpDownArrow:"⇕",Updownarrow:"⇕",vArr:"⇕",DoubleVerticalBar:"∥",par:"∥",parallel:"∥",shortparallel:"∥",spar:"∥",DownArrow:"↓",ShortDownArrow:"↓",darr:"↓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",duarr:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",leftharpoondown:"↽",lhard:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",rhard:"⇁",rightharpoondown:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",top:"⊤",DownTeeArrow:"↧",mapstodown:"↧",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",in:"∈",isin:"∈",isinv:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",eqsim:"≂",esim:"≂",Equilibrium:"⇌",rightleftharpoons:"⇌",rlhar:"⇌",Escr:"ℰ",expectation:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",exist:"∃",ExponentialE:"ⅇ",ee:"ⅇ",exponentiale:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",blacksquare:"▪",squarf:"▪",squf:"▪",Fopf:"𝔽",ForAll:"∀",forall:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",gt:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",ggg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",ge:"≥",geq:"≥",GreaterEqualLess:"⋛",gel:"⋛",gtreqless:"⋛",GreaterFullEqual:"≧",gE:"≧",geqq:"≧",GreaterGreater:"⪢",GreaterLess:"≷",gl:"≷",gtrless:"≷",GreaterSlantEqual:"⩾",geqslant:"⩾",ges:"⩾",GreaterTilde:"≳",gsim:"≳",gtrsim:"≳",Gscr:"𝒢",Gt:"≫",NestedGreaterGreater:"≫",gg:"≫",HARDcy:"Ъ",Hacek:"ˇ",caron:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",Poincareplane:"ℌ",HilbertSpace:"ℋ",Hscr:"ℋ",hamilt:"ℋ",Hopf:"ℍ",quaternions:"ℍ",HorizontalLine:"─",boxh:"─",Hstrok:"Ħ",HumpEqual:"≏",bumpe:"≏",bumpeq:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Im:"ℑ",image:"ℑ",imagpart:"ℑ",Igrave:"Ì",Imacr:"Ī",ImaginaryI:"ⅈ",ii:"ⅈ",Int:"∬",Integral:"∫",int:"∫",Intersection:"⋂",bigcap:"⋂",xcap:"⋂",InvisibleComma:"⁣",ic:"⁣",InvisibleTimes:"⁢",it:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",imagline:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",lt:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Lscr:"ℒ",lagran:"ℒ",Larr:"↞",twoheadleftarrow:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",lang:"⟨",langle:"⟨",LeftArrow:"←",ShortLeftArrow:"←",larr:"←",leftarrow:"←",slarr:"←",LeftArrowBar:"⇤",larrb:"⇤",LeftArrowRightArrow:"⇆",leftrightarrows:"⇆",lrarr:"⇆",LeftCeiling:"⌈",lceil:"⌈",LeftDoubleBracket:"⟦",lobrk:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",dharl:"⇃",downharpoonleft:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",lfloor:"⌊",LeftRightArrow:"↔",harr:"↔",leftrightarrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",dashv:"⊣",LeftTeeArrow:"↤",mapstoleft:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",vartriangleleft:"⊲",vltri:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",ltrie:"⊴",trianglelefteq:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",uharl:"↿",upharpoonleft:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",leftharpoonup:"↼",lharu:"↼",LeftVectorBar:"⥒",LessEqualGreater:"⋚",leg:"⋚",lesseqgtr:"⋚",LessFullEqual:"≦",lE:"≦",leqq:"≦",LessGreater:"≶",lessgtr:"≶",lg:"≶",LessLess:"⪡",LessSlantEqual:"⩽",leqslant:"⩽",les:"⩽",LessTilde:"≲",lesssim:"≲",lsim:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",lAarr:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",longleftarrow:"⟵",xlarr:"⟵",LongLeftRightArrow:"⟷",longleftrightarrow:"⟷",xharr:"⟷",LongRightArrow:"⟶",longrightarrow:"⟶",xrarr:"⟶",Lopf:"𝕃",LowerLeftArrow:"↙",swarr:"↙",swarrow:"↙",LowerRightArrow:"↘",searr:"↘",searrow:"↘",Lsh:"↰",lsh:"↰",Lstrok:"Ł",Lt:"≪",NestedLessLess:"≪",ll:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mscr:"ℳ",phmmat:"ℳ",Mfr:"𝔐",MinusPlus:"∓",mnplus:"∓",mp:"∓",Mopf:"𝕄",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",ZeroWidthSpace:"​",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",nbsp:" ",Nopf:"ℕ",naturals:"ℕ",Not:"⫬",NotCongruent:"≢",nequiv:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",npar:"∦",nparallel:"∦",nshortparallel:"∦",nspar:"∦",NotElement:"∉",notin:"∉",notinva:"∉",NotEqual:"≠",ne:"≠",NotEqualTilde:"≂̸",nesim:"≂̸",NotExists:"∄",nexist:"∄",nexists:"∄",NotGreater:"≯",ngt:"≯",ngtr:"≯",NotGreaterEqual:"≱",nge:"≱",ngeq:"≱",NotGreaterFullEqual:"≧̸",ngE:"≧̸",ngeqq:"≧̸",NotGreaterGreater:"≫̸",nGtv:"≫̸",NotGreaterLess:"≹",ntgl:"≹",NotGreaterSlantEqual:"⩾̸",ngeqslant:"⩾̸",nges:"⩾̸",NotGreaterTilde:"≵",ngsim:"≵",NotHumpDownHump:"≎̸",nbump:"≎̸",NotHumpEqual:"≏̸",nbumpe:"≏̸",NotLeftTriangle:"⋪",nltri:"⋪",ntriangleleft:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",nltrie:"⋬",ntrianglelefteq:"⋬",NotLess:"≮",nless:"≮",nlt:"≮",NotLessEqual:"≰",nle:"≰",nleq:"≰",NotLessGreater:"≸",ntlg:"≸",NotLessLess:"≪̸",nLtv:"≪̸",NotLessSlantEqual:"⩽̸",nleqslant:"⩽̸",nles:"⩽̸",NotLessTilde:"≴",nlsim:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",npr:"⊀",nprec:"⊀",NotPrecedesEqual:"⪯̸",npre:"⪯̸",npreceq:"⪯̸",NotPrecedesSlantEqual:"⋠",nprcue:"⋠",NotReverseElement:"∌",notni:"∌",notniva:"∌",NotRightTriangle:"⋫",nrtri:"⋫",ntriangleright:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",nrtrie:"⋭",ntrianglerighteq:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",nsqsube:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",nsqsupe:"⋣",NotSubset:"⊂⃒",nsubset:"⊂⃒",vnsub:"⊂⃒",NotSubsetEqual:"⊈",nsube:"⊈",nsubseteq:"⊈",NotSucceeds:"⊁",nsc:"⊁",nsucc:"⊁",NotSucceedsEqual:"⪰̸",nsce:"⪰̸",nsucceq:"⪰̸",NotSucceedsSlantEqual:"⋡",nsccue:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",nsupset:"⊃⃒",vnsup:"⊃⃒",NotSupersetEqual:"⊉",nsupe:"⊉",nsupseteq:"⊉",NotTilde:"≁",nsim:"≁",NotTildeEqual:"≄",nsime:"≄",nsimeq:"≄",NotTildeFullEqual:"≇",ncong:"≇",NotTildeTilde:"≉",nap:"≉",napprox:"≉",NotVerticalBar:"∤",nmid:"∤",nshortmid:"∤",nsmid:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",ohm:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",ldquo:"“",OpenCurlyQuote:"‘",lsquo:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",oline:"‾",OverBrace:"⏞",OverBracket:"⎴",tbrk:"⎴",OverParenthesis:"⏜",PartialD:"∂",part:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",plusmn:"±",pm:"±",Popf:"ℙ",primes:"ℙ",Pr:"⪻",Precedes:"≺",pr:"≺",prec:"≺",PrecedesEqual:"⪯",pre:"⪯",preceq:"⪯",PrecedesSlantEqual:"≼",prcue:"≼",preccurlyeq:"≼",PrecedesTilde:"≾",precsim:"≾",prsim:"≾",Prime:"″",Product:"∏",prod:"∏",Proportional:"∝",prop:"∝",propto:"∝",varpropto:"∝",vprop:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',quot:'"',Qfr:"𝔔",Qopf:"ℚ",rationals:"ℚ",Qscr:"𝒬",RBarr:"⤐",drbkarow:"⤐",REG:"®",circledR:"®",reg:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",twoheadrightarrow:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",Rfr:"ℜ",real:"ℜ",realpart:"ℜ",ReverseElement:"∋",SuchThat:"∋",ni:"∋",niv:"∋",ReverseEquilibrium:"⇋",leftrightharpoons:"⇋",lrhar:"⇋",ReverseUpEquilibrium:"⥯",duhar:"⥯",Rho:"Ρ",RightAngleBracket:"⟩",rang:"⟩",rangle:"⟩",RightArrow:"→",ShortRightArrow:"→",rarr:"→",rightarrow:"→",srarr:"→",RightArrowBar:"⇥",rarrb:"⇥",RightArrowLeftArrow:"⇄",rightleftarrows:"⇄",rlarr:"⇄",RightCeiling:"⌉",rceil:"⌉",RightDoubleBracket:"⟧",robrk:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",dharr:"⇂",downharpoonright:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rfloor:"⌋",RightTee:"⊢",vdash:"⊢",RightTeeArrow:"↦",map:"↦",mapsto:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",vartriangleright:"⊳",vrtri:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",rtrie:"⊵",trianglerighteq:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",uharr:"↾",upharpoonright:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",rharu:"⇀",rightharpoonup:"⇀",RightVectorBar:"⥓",Ropf:"ℝ",reals:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",rAarr:"⇛",Rscr:"ℛ",realine:"ℛ",Rsh:"↱",rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortUpArrow:"↑",UpArrow:"↑",uarr:"↑",uparrow:"↑",Sigma:"Σ",SmallCircle:"∘",compfn:"∘",Sopf:"𝕊",Sqrt:"√",radic:"√",Square:"□",squ:"□",square:"□",SquareIntersection:"⊓",sqcap:"⊓",SquareSubset:"⊏",sqsub:"⊏",sqsubset:"⊏",SquareSubsetEqual:"⊑",sqsube:"⊑",sqsubseteq:"⊑",SquareSuperset:"⊐",sqsup:"⊐",sqsupset:"⊐",SquareSupersetEqual:"⊒",sqsupe:"⊒",sqsupseteq:"⊒",SquareUnion:"⊔",sqcup:"⊔",Sscr:"𝒮",Star:"⋆",sstarf:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",sube:"⊆",subseteq:"⊆",Succeeds:"≻",sc:"≻",succ:"≻",SucceedsEqual:"⪰",sce:"⪰",succeq:"⪰",SucceedsSlantEqual:"≽",sccue:"≽",succcurlyeq:"≽",SucceedsTilde:"≿",scsim:"≿",succsim:"≿",Sum:"∑",sum:"∑",Sup:"⋑",Supset:"⋑",Superset:"⊃",sup:"⊃",supset:"⊃",SupersetEqual:"⊇",supe:"⊇",supseteq:"⊇",THORN:"Þ",TRADE:"™",trade:"™",TSHcy:"Ћ",TScy:"Ц",Tab:"\t",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",there4:"∴",therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",Tilde:"∼",sim:"∼",thicksim:"∼",thksim:"∼",TildeEqual:"≃",sime:"≃",simeq:"≃",TildeFullEqual:"≅",cong:"≅",TildeTilde:"≈",ap:"≈",approx:"≈",asymp:"≈",thickapprox:"≈",thkap:"≈",Topf:"𝕋",TripleDot:"⃛",tdot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",lowbar:"_",UnderBrace:"⏟",UnderBracket:"⎵",bbrk:"⎵",UnderParenthesis:"⏝",Union:"⋃",bigcup:"⋃",xcup:"⋃",UnionPlus:"⊎",uplus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",udarr:"⇅",UpDownArrow:"↕",updownarrow:"↕",varr:"↕",UpEquilibrium:"⥮",udhar:"⥮",UpTee:"⊥",bot:"⊥",bottom:"⊥",perp:"⊥",UpTeeArrow:"↥",mapstoup:"↥",UpperLeftArrow:"↖",nwarr:"↖",nwarrow:"↖",UpperRightArrow:"↗",nearr:"↗",nearrow:"↗",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",bigvee:"⋁",xvee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",mid:"∣",shortmid:"∣",smid:"∣",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"❘",VerticalTilde:"≀",wr:"≀",wreath:"≀",VeryThinSpace:" ",hairsp:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",bigwedge:"⋀",xwedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",Zeta:"Ζ",Zfr:"ℨ",zeetrf:"ℨ",Zopf:"ℤ",integers:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",mstpos:"∾",acE:"∾̳",acd:"∿",acirc:"â",acy:"а",aelig:"æ",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",and:"∧",wedge:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",angle:"∠",ange:"⦤",angmsd:"∡",measuredangle:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angzarr:"⍼",aogon:"ą",aopf:"𝕒",apE:"⩰",apacir:"⩯",ape:"≊",approxeq:"≊",apid:"≋",apos:"'",aring:"å",ascr:"𝒶",ast:"*",midast:"*",atilde:"ã",auml:"ä",awint:"⨑",bNot:"⫭",backcong:"≌",bcong:"≌",backepsilon:"϶",bepsi:"϶",backprime:"‵",bprime:"‵",backsim:"∽",bsim:"∽",backsimeq:"⋍",bsime:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrktbrk:"⎶",bcy:"б",bdquo:"„",ldquor:"„",bemptyv:"⦰",beta:"β",beth:"ℶ",between:"≬",twixt:"≬",bfr:"𝔟",bigcirc:"◯",xcirc:"◯",bigodot:"⨀",xodot:"⨀",bigoplus:"⨁",xoplus:"⨁",bigotimes:"⨂",xotime:"⨂",bigsqcup:"⨆",xsqcup:"⨆",bigstar:"★",starf:"★",bigtriangledown:"▽",xdtri:"▽",bigtriangleup:"△",xutri:"△",biguplus:"⨄",xuplus:"⨄",bkarow:"⤍",rbarr:"⤍",blacklozenge:"⧫",lozf:"⧫",blacktriangle:"▴",utrif:"▴",blacktriangledown:"▾",dtrif:"▾",blacktriangleleft:"◂",ltrif:"◂",blacktriangleright:"▸",rtrif:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",minusb:"⊟",boxplus:"⊞",plusb:"⊞",boxtimes:"⊠",timesb:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bumpE:"⪮",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cemptyv:"⦲",cent:"¢",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",cire:"≗",circlearrowleft:"↺",olarr:"↺",circlearrowright:"↻",orarr:"↻",circledS:"Ⓢ",oS:"Ⓢ",circledast:"⊛",oast:"⊛",circledcirc:"⊚",ocir:"⊚",circleddash:"⊝",odash:"⊝",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",comma:",",commat:"@",comp:"∁",complement:"∁",congdot:"⩭",copf:"𝕔",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",curlyeqprec:"⋞",cuesc:"⋟",curlyeqsucc:"⋟",cularr:"↶",curvearrowleft:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curvearrowright:"↷",curarrm:"⤼",curlyvee:"⋎",cuvee:"⋎",curlywedge:"⋏",cuwed:"⋏",curren:"¤",cwint:"∱",cylcty:"⌭",dHar:"⥥",dagger:"†",daleth:"ℸ",dash:"‐",hyphen:"‐",dbkarow:"⤏",rBarr:"⤏",dcaron:"ď",dcy:"д",ddarr:"⇊",downdownarrows:"⇊",ddotseq:"⩷",eDDot:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",diamondsuit:"♦",diams:"♦",digamma:"ϝ",gammad:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",llcorner:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",doteqdot:"≑",eDot:"≑",dotminus:"∸",minusd:"∸",dotplus:"∔",plusdo:"∔",dotsquare:"⊡",sdotb:"⊡",drcorn:"⌟",lrcorner:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",triangledown:"▿",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",eqcirc:"≖",ecirc:"ê",ecolon:"≕",eqcolon:"≕",ecy:"э",edot:"ė",efDot:"≒",fallingdotseq:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",eqslantgtr:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",eqslantless:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",varnothing:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",straightepsilon:"ϵ",varepsilon:"ϵ",equals:"=",equest:"≟",questeq:"≟",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",risingdotseq:"≓",erarr:"⥱",escr:"ℯ",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",fork:"⋔",pitchfork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",half:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",sfrown:"⌢",fscr:"𝒻",gEl:"⪌",gtreqqless:"⪌",gacute:"ǵ",gamma:"γ",gap:"⪆",gtrapprox:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gimel:"ℷ",gjcy:"ѓ",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gneqq:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gnsim:"⋧",gopf:"𝕘",gscr:"ℊ",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtrdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrarr:"⥸",gvertneqq:"≩︀",gvnE:"≩︀",hardcy:"ъ",harrcir:"⥈",harrw:"↭",leftrightsquigarrow:"↭",hbar:"ℏ",hslash:"ℏ",planck:"ℏ",plankv:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",mldr:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",searhk:"⤥",hkswarow:"⤦",swarhk:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",larrhk:"↩",hookrightarrow:"↪",rarrhk:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hstrok:"ħ",hybull:"⁃",iacute:"í",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",ifr:"𝔦",igrave:"ì",iiiint:"⨌",qint:"⨌",iiint:"∭",tint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",imath:"ı",inodot:"ı",imof:"⊷",imped:"Ƶ",incare:"℅",infin:"∞",infintie:"⧝",intcal:"⊺",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iquest:"¿",iscr:"𝒾",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",varkappa:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAtail:"⤛",lBarr:"⤎",lEg:"⪋",lesseqqgtr:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lambda:"λ",langd:"⦑",lap:"⪅",lessapprox:"⪅",laquo:"«",larrbfs:"⤟",larrfs:"⤝",larrlp:"↫",looparrowleft:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",leftarrowtail:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lcy:"л",ldca:"⤶",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leq:"≤",leftleftarrows:"⇇",llarr:"⇇",leftthreetimes:"⋋",lthree:"⋋",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessdot:"⋖",ltdot:"⋖",lfisht:"⥼",lfr:"𝔩",lgE:"⪑",lharul:"⥪",lhblk:"▄",ljcy:"љ",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lneqq:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lnsim:"⋦",loang:"⟬",loarr:"⇽",longmapsto:"⟼",xmap:"⟼",looparrowright:"↬",rarrlp:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",loz:"◊",lozenge:"◊",lpar:"(",lparlt:"⦓",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsime:"⪍",lsimg:"⪏",lsquor:"‚",sbquo:"‚",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",triangleleft:"◃",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",strns:"¯",male:"♂",malt:"✠",maltese:"✠",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",mfr:"𝔪",mho:"℧",micro:"µ",midcir:"⫰",minus:"−",minusdu:"⨪",mlcp:"⫛",models:"⊧",mopf:"𝕞",mscr:"𝓂",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nLeftarrow:"⇍",nlArr:"⇍",nLeftrightarrow:"⇎",nhArr:"⇎",nLl:"⋘̸",nLt:"≪⃒",nRightarrow:"⇏",nrArr:"⇏",nVDash:"⊯",nVdash:"⊮",nacute:"ń",nang:"∠⃒",napE:"⩰̸",napid:"≋̸",napos:"ʼn",natur:"♮",natural:"♮",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",neArr:"⇗",nearhk:"⤤",nedot:"≐̸",nesear:"⤨",toea:"⤨",nfr:"𝔫",nharr:"↮",nleftrightarrow:"↮",nhpar:"⫲",nis:"⋼",nisd:"⋺",njcy:"њ",nlE:"≦̸",nleqq:"≦̸",nlarr:"↚",nleftarrow:"↚",nldr:"‥",nopf:"𝕟",not:"¬",notinE:"⋹̸",notindot:"⋵̸",notinvb:"⋷",notinvc:"⋶",notnivb:"⋾",notnivc:"⋽",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",nrarr:"↛",nrightarrow:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nscr:"𝓃",nsub:"⊄",nsubE:"⫅̸",nsubseteqq:"⫅̸",nsup:"⊅",nsupE:"⫆̸",nsupseteqq:"⫆̸",ntilde:"ñ",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwnear:"⤧",oacute:"ó",ocirc:"ô",ocy:"о",odblac:"ő",odiv:"⨸",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",olcir:"⦾",olcross:"⦻",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",oopf:"𝕠",opar:"⦷",operp:"⦹",or:"∨",vee:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",oscr:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oslash:"ø",osol:"⊘",otilde:"õ",otimesas:"⨶",ouml:"ö",ovbar:"⌽",para:"¶",parsim:"⫳",parsl:"⫽",pcy:"п",percnt:"%",period:".",permil:"‰",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",straightphi:"ϕ",varphi:"ϕ",phone:"☎",pi:"π",piv:"ϖ",varpi:"ϖ",planckh:"ℎ",plus:"+",plusacir:"⨣",pluscir:"⨢",plusdu:"⨥",pluse:"⩲",plussim:"⨦",plustwo:"⨧",pointint:"⨕",popf:"𝕡",pound:"£",prE:"⪳",prap:"⪷",precapprox:"⪷",precnapprox:"⪹",prnap:"⪹",precneqq:"⪵",prnE:"⪵",precnsim:"⋨",prnsim:"⋨",prime:"′",profalar:"⌮",profline:"⌒",profsurf:"⌓",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quatint:"⨖",quest:"?",rAtail:"⤜",rHar:"⥤",race:"∽̱",racute:"ŕ",raemptyv:"⦳",rangd:"⦒",range:"⦥",raquo:"»",rarrap:"⥵",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rightarrowtail:"↣",rarrw:"↝",rightsquigarrow:"↝",ratail:"⤚",ratio:"∶",rbbrk:"❳",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdsh:"↳",rect:"▭",rfisht:"⥽",rfr:"𝔯",rharul:"⥬",rho:"ρ",rhov:"ϱ",varrho:"ϱ",rightrightarrows:"⇉",rrarr:"⇉",rightthreetimes:"⋌",rthree:"⋌",ring:"˚",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rsaquo:"›",rscr:"𝓇",rtimes:"⋊",rtri:"▹",triangleright:"▹",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",scE:"⪴",scap:"⪸",succapprox:"⪸",scaron:"š",scedil:"ş",scirc:"ŝ",scnE:"⪶",succneqq:"⪶",scnap:"⪺",succnapprox:"⪺",scnsim:"⋩",succnsim:"⋩",scpolint:"⨓",scy:"с",sdot:"⋅",sdote:"⩦",seArr:"⇘",sect:"§",semi:";",seswar:"⤩",tosa:"⤩",sext:"✶",sfr:"𝔰",sharp:"♯",shchcy:"щ",shcy:"ш",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",varsigma:"ς",simdot:"⩪",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",smashp:"⨳",smeparsl:"⧤",smile:"⌣",ssmile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",sqcaps:"⊓︀",sqcups:"⊔︀",sscr:"𝓈",star:"☆",sub:"⊂",subset:"⊂",subE:"⫅",subseteqq:"⫅",subdot:"⪽",subedot:"⫃",submult:"⫁",subnE:"⫋",subsetneqq:"⫋",subne:"⊊",subsetneq:"⊊",subplus:"⪿",subrarr:"⥹",subsim:"⫇",subsub:"⫕",subsup:"⫓",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",supE:"⫆",supseteqq:"⫆",supdot:"⪾",supdsub:"⫘",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supsetneqq:"⫌",supne:"⊋",supsetneq:"⊋",supplus:"⫀",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tcaron:"ť",tcedil:"ţ",tcy:"т",telrec:"⌕",tfr:"𝔱",theta:"θ",thetasym:"ϑ",thetav:"ϑ",vartheta:"ϑ",thorn:"þ",times:"×",timesbar:"⨱",timesd:"⨰",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tprime:"‴",triangle:"▵",utri:"▵",triangleq:"≜",trie:"≜",tridot:"◬",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",uHar:"⥣",uacute:"ú",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udblac:"ű",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uogon:"ų",uopf:"𝕦",upsi:"υ",upsilon:"υ",upuparrows:"⇈",uuarr:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",uuml:"ü",uwangle:"⦧",vBar:"⫨",vBarv:"⫩",vangrt:"⦜",varsubsetneq:"⊊︀",vsubne:"⊊︀",varsubsetneqq:"⫋︀",vsubnE:"⫋︀",varsupsetneq:"⊋︀",vsupne:"⊋︀",varsupsetneqq:"⫌︀",vsupnE:"⫌︀",vcy:"в",veebar:"⊻",veeeq:"≚",vellip:"⋮",vfr:"𝔳",vopf:"𝕧",vscr:"𝓋",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedgeq:"≙",weierp:"℘",wp:"℘",wfr:"𝔴",wopf:"𝕨",wscr:"𝓌",xfr:"𝔵",xi:"ξ",xnis:"⋻",xopf:"𝕩",xscr:"𝓍",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"};so.ngsp="";class no extends pr{constructor(e,t,s){super(s,e),this.tokenType=t}}class ro{constructor(e,t,s){this.tokens=e,this.errors=t,this.nonNormalizedIcuExpressions=s}}function io(e,t,s,n={}){const r=new po(new lr(e,t),s,n);return r.tokenize(),new ro(function(e){const t=[];let s;for(let n=0;n;" or "&#x;" syntax`}var co;!function(e){e.HEX="hexadecimal",e.DEC="decimal"}(co||(co={}));class uo{constructor(e){this.error=e}}class po{constructor(e,t,s){this._getTagDefinition=t,this._currentTokenStart=null,this._currentTokenType=null,this._expansionCaseStack=[],this._inInterpolation=!1,this.tokens=[],this.errors=[],this.nonNormalizedIcuExpressions=[],this._tokenizeIcu=s.tokenizeExpansionForms||!1,this._interpolationConfig=s.interpolationConfig||Fn,this._leadingTriviaCodePoints=s.leadingTriviaChars&&s.leadingTriviaChars.map((e=>e.codePointAt(0)||0));const n=s.range||{endPos:e.content.length,startPos:0,startLine:0,startCol:0};this._cursor=s.escapedString?new xo(e,n):new yo(e,n),this._preserveLineEndings=s.preserveLineEndings||!1,this._escapedString=s.escapedString||!1,this._i18nNormalizeLineEndingsInICUs=s.i18nNormalizeLineEndingsInICUs||!1;try{this._cursor.init()}catch(e){this.handleError(e)}}_processCarriageReturns(e){return this._preserveLineEndings?e:e.replace(ao,"\n")}tokenize(){for(;0!==this._cursor.peek();){const e=this._cursor.clone();try{this._attemptCharCode(Kn)?this._attemptCharCode(33)?this._attemptCharCode(91)?this._consumeCdata(e):this._attemptCharCode(45)?this._consumeComment(e):this._consumeDocType(e):this._attemptCharCode(jn)?this._consumeTagClose(e):this._consumeTagOpen(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,(()=>this._isTextEnd()),(()=>this._isTagStart()))}catch(e){this.handleError(e)}}this._beginToken(24),this._endToken([])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(this._cursor.peek()!==er&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===er){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,t=this._cursor.clone()){this._currentTokenStart=t,this._currentTokenType=e}_endToken(e,t){if(null===this._currentTokenStart)throw new no("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(t));if(null===this._currentTokenType)throw new no("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));const s={type:this._currentTokenType,parts:e,sourceSpan:(t??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(s),this._currentTokenStart=null,this._currentTokenType=null,s}_createError(e,t){this._isInExpansionForm()&&(e+=' (Do you have an unescaped "{" in your template? Use "{{ \'{\' }}") to escape it.)');const s=new no(e,this._currentTokenType,t);return this._currentTokenStart=null,this._currentTokenType=null,new uo(s)}handleError(e){if(e instanceof wo&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),!(e instanceof uo))throw e;this.errors.push(e.error)}_attemptCharCode(e){return this._cursor.peek()===e&&(this._cursor.advance(),!0)}_attemptCharCodeCaseInsensitive(e){return t=this._cursor.peek(),s=e,fo(t)===fo(s)&&(this._cursor.advance(),!0);var t,s}_requireCharCode(e){const t=this._cursor.clone();if(!this._attemptCharCode(e))throw this._createError(oo(this._cursor.peek()),this._cursor.getSpan(t))}_attemptStr(e){const t=e.length;if(this._cursor.charsLeft()this._attemptStr("--\x3e"))),this._beginToken(11),this._requireStr("--\x3e"),this._endToken([])}_consumeCdata(e){this._beginToken(12,e),this._requireStr("CDATA["),this._endToken([]),this._consumeRawText(!1,(()=>this._attemptStr("]]>"))),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(e){this._beginToken(18,e);const t=this._cursor.clone();this._attemptUntilChar(Yn);const s=this._cursor.getChars(t);this._cursor.advance(),this._endToken([s])}_consumePrefixAndName(){const e=this._cursor.clone();let t="";for(;this._cursor.peek()!==Wn&&!(((s=this._cursor.peek())57));)this._cursor.advance();var s;let n;this._cursor.peek()===Wn?(t=this._cursor.getChars(e),this._cursor.advance(),n=this._cursor.clone()):n=e,this._requireCharCodeUntilFn(mo,""===t?0:1);return[t,this._cursor.getChars(n)]}_consumeTagOpen(t){let s,n,r;try{if(!nr(this._cursor.peek()))throw this._createError(oo(this._cursor.peek()),this._cursor.getSpan(t));for(r=this._consumeTagOpenStart(t),n=r.parts[0],s=r.parts[1],this._attemptCharCodeUntilFn(ho);this._cursor.peek()!==jn&&this._cursor.peek()!==Yn&&this._cursor.peek()!==Kn&&0!==this._cursor.peek();)this._consumeAttributeName(),this._attemptCharCodeUntilFn(ho),this._attemptCharCode(Gn)&&(this._attemptCharCodeUntilFn(ho),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(ho);this._consumeTagOpenEnd()}catch(e){if(e instanceof uo)return void(r?r.type=4:(this._beginToken(5,t),this._endToken(["<"])));throw e}const i=this._getTagDefinition(s).getContentType(n);i===e.TagContentType.RAW_TEXT?this._consumeRawTextWithTagClose(n,s,!1):i===e.TagContentType.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(n,s,!0)}_consumeRawTextWithTagClose(e,t,s){this._consumeRawText(s,(()=>!!this._attemptCharCode(Kn)&&(!!this._attemptCharCode(jn)&&(this._attemptCharCodeUntilFn(ho),!!this._attemptStrCaseInsensitive(t)&&(this._attemptCharCodeUntilFn(ho),this._attemptCharCode(Yn)))))),this._beginToken(3),this._requireCharCodeUntilFn((e=>e===Yn),3),this._cursor.advance(),this._endToken([e,t])}_consumeTagOpenStart(e){this._beginToken(0,e);const t=this._consumePrefixAndName();return this._endToken(t)}_consumeAttributeName(){const e=this._cursor.peek();if(39===e||34===e)throw this._createError(oo(e),this._cursor.getSpan());this._beginToken(14);const t=this._consumePrefixAndName();this._endToken(t)}_consumeAttributeValue(){if(39===this._cursor.peek()||34===this._cursor.peek()){const e=this._cursor.peek();this._consumeQuote(e);const t=()=>this._cursor.peek()===e;this._consumeWithInterpolation(16,17,t,t),this._consumeQuote(e)}else{const e=()=>mo(this._cursor.peek());this._consumeWithInterpolation(16,17,e,e)}}_consumeQuote(e){this._beginToken(15),this._requireCharCode(e),this._endToken([String.fromCodePoint(e)])}_consumeTagOpenEnd(){const e=this._attemptCharCode(jn)?2:1;this._beginToken(e),this._requireCharCode(Yn),this._endToken([])}_consumeTagClose(e){this._beginToken(3,e),this._attemptCharCodeUntilFn(ho);const t=this._consumePrefixAndName();this._attemptCharCodeUntilFn(ho),this._requireCharCode(Yn),this._endToken(t)}_consumeExpansionFormStart(){this._beginToken(19),this._requireCharCode(Zn),this._endToken([]),this._expansionCaseStack.push(19),this._beginToken(7);const e=this._readUntil(Un),t=this._processCarriageReturns(e);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([t]);else{const s=this._endToken([e]);t!==e&&this.nonNormalizedIcuExpressions.push(s)}this._requireCharCode(Un),this._attemptCharCodeUntilFn(ho),this._beginToken(7);const s=this._readUntil(Un);this._endToken([s]),this._requireCharCode(Un),this._attemptCharCodeUntilFn(ho)}_consumeExpansionCaseStart(){this._beginToken(20);const e=this._readUntil(Zn).trim();this._endToken([e]),this._attemptCharCodeUntilFn(ho),this._beginToken(21),this._requireCharCode(Zn),this._endToken([]),this._attemptCharCodeUntilFn(ho),this._expansionCaseStack.push(21)}_consumeExpansionCaseEnd(){this._beginToken(22),this._requireCharCode(er),this._endToken([]),this._attemptCharCodeUntilFn(ho),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(23),this._requireCharCode(er),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(e,t,s,n){this._beginToken(e);const r=[];for(;!s();){const s=this._cursor.clone();this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(this._endToken([this._processCarriageReturns(r.join(""))],s),r.length=0,this._consumeInterpolation(t,s,n),this._beginToken(e)):38===this._cursor.peek()?(this._endToken([this._processCarriageReturns(r.join(""))]),r.length=0,this._consumeEntity(e),this._beginToken(e)):r.push(this._readChar())}this._inInterpolation=!1,this._endToken([this._processCarriageReturns(r.join(""))])}_consumeInterpolation(e,t,s){const n=[];this._beginToken(e,t),n.push(this._interpolationConfig.start);const r=this._cursor.clone();let i=null,a=!1;for(;0!==this._cursor.peek()&&(null===s||!s());){const e=this._cursor.clone();if(this._isTagStart())return this._cursor=e,n.push(this._getProcessedChars(r,e)),void this._endToken(n);if(null===i){if(this._attemptStr(this._interpolationConfig.end))return n.push(this._getProcessedChars(r,e)),n.push(this._interpolationConfig.end),void this._endToken(n);this._attemptStr("//")&&(a=!0)}const t=this._cursor.peek();this._cursor.advance(),92===t?this._cursor.advance():t===i?i=null:!a&&null===i&&ar(t)&&(i=t)}n.push(this._getProcessedChars(r,this._cursor)),this._endToken(n)}_getProcessedChars(e,t){return this._processCarriageReturns(t.getChars(e))}_isTextEnd(){if(this._isTagStart()||0===this._cursor.peek())return!0;if(this._tokenizeIcu&&!this._inInterpolation){if(this.isExpansionFormStart())return!0;if(this._cursor.peek()===er&&this._isInExpansionCase())return!0}return!1}_isTagStart(){if(this._cursor.peek()===Kn){const e=this._cursor.clone();e.advance();const t=e.peek();if(Xn<=t&&t<=Jn||Qn<=t&&t<=90||t===jn||33===t)return!0}return!1}_readUntil(e){const t=this._cursor.clone();return this._attemptUntilChar(e),this._cursor.getChars(t)}_isInExpansionCase(){return this._expansionCaseStack.length>0&&21===this._expansionCaseStack[this._expansionCaseStack.length-1]}_isInExpansionForm(){return this._expansionCaseStack.length>0&&19===this._expansionCaseStack[this._expansionCaseStack.length-1]}isExpansionFormStart(){if(this._cursor.peek()!==Zn)return!1;if(this._interpolationConfig){const e=this._cursor.clone(),t=this._attemptStr(this._interpolationConfig.start);return this._cursor=e,!t}return!0}}function ho(e){return!tr(e)||0===e}function mo(e){return tr(e)||e===Yn||e===Kn||e===jn||39===e||34===e||e===Gn||0===e}function go(e){return e===zn||0===e||!function(e){return e>=Xn&&e<=102||e>=Qn&&e<=70||sr(e)}(e)}function vo(e){return e===zn||0===e||!nr(e)}function fo(e){return e>=Xn&&e<=Jn?e-Xn+Qn:e}class yo{constructor(e,t){if(e instanceof yo){this.file=e.file,this.input=e.input,this.end=e.end;const t=e.state;this.state={peek:t.peek,offset:t.offset,line:t.line,column:t.column}}else{if(!t)throw new Error("Programming error: the range argument must be provided with a file argument.");this.file=e,this.input=e.content,this.end=t.endPos,this.state={peek:-1,offset:t.startPos,line:t.startLine,column:t.startCol}}}clone(){return new yo(this)}peek(){return this.state.peek}charsLeft(){return this.end-this.state.offset}diff(e){return this.state.offset-e.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(e,t){let s=e=e||this;if(t)for(;this.diff(e)>0&&-1!==t.indexOf(e.peek());)s===e&&(e=e.clone()),e.advance();const n=this.locationFromCursor(e),r=this.locationFromCursor(this),i=s!==e?this.locationFromCursor(s):n;return new cr(n,r,i)}getChars(e){return this.input.substring(e.state.offset,this.state.offset)}charAt(e){return this.input.charCodeAt(e)}advanceState(e){if(e.offset>=this.end)throw this.state=e,new wo('Unexpected character "EOF"',this);const t=this.charAt(e.offset);t===Vn?(e.line++,e.column=0):rr(t)||e.column++,e.offset++,this.updatePeek(e)}updatePeek(e){e.peek=e.offset>=this.end?0:this.charAt(e.offset)}locationFromCursor(e){return new or(e.file,e.state.offset,e.state.line,e.state.column)}}class xo extends yo{constructor(e,t){e instanceof xo?(super(e),this.internalState={...e.internalState}):(super(e,t),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new xo(this)}getChars(e){const t=e.clone();let s="";for(;t.internalState.offsetthis.internalState.peek;if(92===e())if(this.internalState={...this.state},this.advanceState(this.internalState),110===e())this.state.peek=Vn;else if(114===e())this.state.peek=13;else if(118===e())this.state.peek=11;else if(116===e())this.state.peek=9;else if(98===e())this.state.peek=8;else if(102===e())this.state.peek=12;else if(117===e())if(this.advanceState(this.internalState),e()===Zn){this.advanceState(this.internalState);const t=this.clone();let s=0;for(;e()!==er;)this.advanceState(this.internalState),s++;this.state.peek=this.decodeHexDigits(t,s)}else{const e=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(e,4)}else if(120===e()){this.advanceState(this.internalState);const e=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(e,2)}else if(ir(e())){let t="",s=0,n=this.clone();for(;ir(e())&&s<3;)n=this.clone(),t+=String.fromCodePoint(e()),this.advanceState(this.internalState),s++;this.state.peek=parseInt(t,8),this.internalState=n.internalState}else rr(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(e,t){const s=this.input.slice(e.internalState.offset,e.internalState.offset+t),n=parseInt(s,16);if(isNaN(n))throw e.state=e.internalState,new wo("Invalid hexadecimal escape sequence",e);return n}}class wo{constructor(e,t){this.msg=e,this.cursor=t}}class So extends pr{constructor(e,t,s){super(t,s),this.elementName=e}static create(e,t,s){return new So(e,t,s)}}class Eo{constructor(e,t){this.rootNodes=e,this.errors=t}}class _o{constructor(e){this.getTagDefinition=e}parse(e,t,s){const n=io(e,t,this.getTagDefinition,s),r=new bo(n.tokens,this.getTagDefinition);return r.build(),new Eo(r.rootNodes,n.errors.concat(r.errors))}}class bo{constructor(e,t){this.tokens=e,this.getTagDefinition=t,this._index=-1,this._elementStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;24!==this._peek.type;)0===this._peek.type||4===this._peek.type?this._consumeStartTag(this._advance()):3===this._peek.type?this._consumeEndTag(this._advance()):12===this._peek.type?(this._closeVoidElement(),this._consumeCdata(this._advance())):10===this._peek.type?(this._closeVoidElement(),this._consumeComment(this._advance())):5===this._peek.type||7===this._peek.type||6===this._peek.type?(this._closeVoidElement(),this._consumeText(this._advance())):19===this._peek.type?this._consumeExpansion(this._advance()):this._advance()}_advance(){const e=this._peek;return this._index0)return this.errors=this.errors.concat(r.errors),null;const i=new cr(e.sourceSpan.start,n.sourceSpan.end,e.sourceSpan.fullStart),a=new cr(t.sourceSpan.start,n.sourceSpan.end,t.sourceSpan.fullStart);return new Xa(e.parts[0],r.rootNodes,i,e.sourceSpan,a)}_collectExpansionExpTokens(e){const t=[],s=[21];for(;;){if(19!==this._peek.type&&21!==this._peek.type||s.push(this._peek.type),22===this._peek.type){if(!To(s,21))return this.errors.push(So.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(s.pop(),0===s.length)return t}if(23===this._peek.type){if(!To(s,19))return this.errors.push(So.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;s.pop()}if(24===this._peek.type)return this.errors.push(So.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;t.push(this._advance())}}_consumeText(e){const t=[e],s=e.sourceSpan;let n=e.parts[0];if(n.length>0&&"\n"===n[0]){const s=this._getParentElement();null!=s&&0===s.children.length&&this.getTagDefinition(s.name).ignoreFirstLf&&(n=n.substring(1),t[0]={type:e.type,sourceSpan:e.sourceSpan,parts:[n]})}for(;8===this._peek.type||5===this._peek.type||9===this._peek.type;)e=this._advance(),t.push(e),8===e.type?n+=e.parts.join("").replace(/&([^;]+);/g,Co):9===e.type?n+=e.parts[0]:n+=e.parts.join("");if(n.length>0){const r=e.sourceSpan;this._addToParent(new Ya(n,new cr(s.start,r.end,s.fullStart,s.details),t))}}_closeVoidElement(){const e=this._getParentElement();e&&this.getTagDefinition(e.name).isVoid&&this._elementStack.pop()}_consumeStartTag(e){const[t,s]=e.parts,n=[];for(;14===this._peek.type;)n.push(this._consumeAttr(this._advance()));const r=this._getElementFullName(t,s,this._getParentElement());let i=!1;if(2===this._peek.type){this._advance(),i=!0;const t=this.getTagDefinition(r);t.canSelfClose||null!==a(r)||t.isVoid||this.errors.push(So.create(r,e.sourceSpan,`Only void and foreign elements can be self closed "${e.parts[1]}"`))}else 1===this._peek.type&&(this._advance(),i=!1);const o=this._peek.sourceSpan.fullStart,l=new cr(e.sourceSpan.start,o,e.sourceSpan.fullStart),c=new cr(e.sourceSpan.start,o,e.sourceSpan.fullStart),u=new Za(r,n,[],l,c,void 0);this._pushElement(u),i?this._popElement(r,l):4===e.type&&(this._popElement(r,null),this.errors.push(So.create(r,l,`Opening tag "${r}" not terminated.`)))}_pushElement(e){const t=this._getParentElement();t&&this.getTagDefinition(t.name).isClosedByChild(e.name)&&this._elementStack.pop(),this._addToParent(e),this._elementStack.push(e)}_consumeEndTag(e){const t=this._getElementFullName(e.parts[0],e.parts[1],this._getParentElement());if(this.getTagDefinition(t).isVoid)this.errors.push(So.create(t,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));else if(!this._popElement(t,e.sourceSpan)){const s=`Unexpected closing tag "${t}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(So.create(t,e.sourceSpan,s))}}_popElement(e,t){let s=!1;for(let n=this._elementStack.length-1;n>=0;n--){const r=this._elementStack[n];if(r.name===e)return r.endSourceSpan=t,r.sourceSpan.end=null!==t?t.end:r.sourceSpan.end,this._elementStack.splice(n,this._elementStack.length-n),!s;this.getTagDefinition(r.name).closedByParent||(s=!0)}return!1}_consumeAttr(e){const t=o(e.parts[0],e.parts[1]);let s=e.sourceSpan.end;15===this._peek.type&&this._advance();let n="";const r=[];let i,a;if(16===this._peek.type)for(i=this._peek.sourceSpan,a=this._peek.sourceSpan.end;16===this._peek.type||17===this._peek.type||9===this._peek.type;){const e=this._advance();r.push(e),17===e.type?n+=e.parts.join("").replace(/&([^;]+);/g,Co):9===e.type?n+=e.parts[0]:n+=e.parts.join(""),a=s=e.sourceSpan.end}if(15===this._peek.type){s=this._advance().sourceSpan.end}const l=i&&a&&new cr(i.start,a,i.fullStart);return new Ja(t,n,new cr(e.sourceSpan.start,s,e.sourceSpan.fullStart),e.sourceSpan,l,r.length>0?r:void 0,void 0)}_getParentElement(){return this._elementStack.length>0?this._elementStack[this._elementStack.length-1]:null}_addToParent(e){const t=this._getParentElement();null!=t?t.children.push(e):this.rootNodes.push(e)}_getElementFullName(e,t,n){if(""===e&&""===(e=this.getTagDefinition(t).implicitNamespacePrefix||"")&&null!=n){const t=s(n.name)[1];this.getTagDefinition(t).preventNamespaceInheritance||(e=a(n.name))}return o(e,t)}}function To(e,t){return e.length>0&&e[e.length-1]===t}function Co(e,t){return void 0!==so[t]?so[t]||e:/^#x[a-f0-9]+$/i.test(t)?String.fromCodePoint(parseInt(t.slice(2),16)):/^#\d+$/.test(t)?String.fromCodePoint(parseInt(t.slice(1),10)):e}class Io extends _o{constructor(){super(p)}parse(e,t,s){return super.parse(e,t,s)}}const ko="ngPreserveWhitespaces",No=new Set(["pre","template","textarea","script","style"]),Po=" \f\n\r\t\v ᠎ - \u2028\u2029   \ufeff",Ao=new RegExp(`[^${Po}]`),Lo=new RegExp(`[${Po}]{2,}`,"g");function Mo(e){return e.replace(new RegExp("","g")," ")}class Ro{visitElement(e,t){return No.has(e.name)||e.attrs.some((e=>e.name===ko))?new Za(e.name,to(this,e.attrs),e.children,e.sourceSpan,e.startSourceSpan,e.endSourceSpan,e.i18n):new Za(e.name,e.attrs,function(e,t){const s=[];return t.forEach(((n,r)=>{const i={prev:t[r-1],next:t[r+1]},a=n.visit(e,i);a&&s.push(a)})),s}(this,e.children),e.sourceSpan,e.startSourceSpan,e.endSourceSpan,e.i18n)}visitAttribute(e,t){return e.name!==ko?e:null}visitText(e,t){const s=e.value.match(Ao),n=t&&(t.prev instanceof Qa||t.next instanceof Qa);if(s||n){const t=e.tokens.map((e=>5===e.type?function({type:e,parts:t,sourceSpan:s}){return{type:e,parts:[Oo(t[0])],sourceSpan:s}}(e):e)),s=Oo(e.value);return new Ya(s,e.sourceSpan,t,e.i18n)}return null}visitComment(e,t){return e}visitExpansion(e,t){return e}visitExpansionCase(e,t){return e}}function Oo(e){return Mo(e).replace(Lo," ")}function $o(e,t=!1){return wt(Object.keys(e).map((s=>({key:s,quoted:t,value:e[s]}))))}class Do{}const Bo=["[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|"],qo=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"})),Fo=Array.from(qo).reduce(((e,[t,s])=>(e.set(t,s),e)),new Map);class Vo extends Do{constructor(){super(),this._schema=new Map,this._eventSchema=new Map,Bo.forEach((e=>{const t=new Map,s=new Set,[n,r]=e.split("|"),i=r.split(","),[a,o]=n.split("^");a.split(",").forEach((e=>{this._schema.set(e.toLowerCase(),t),this._eventSchema.set(e.toLowerCase(),s)}));const l=o&&this._schema.get(o.toLowerCase());if(l){for(const[e,s]of l)t.set(e,s);for(const e of this._eventSchema.get(o.toLowerCase()))s.add(e)}i.forEach((e=>{if(e.length>0)switch(e[0]){case"*":s.add(e.substring(1));break;case"!":t.set(e.substring(1),"boolean");break;case"#":t.set(e.substring(1),"number");break;case"%":t.set(e.substring(1),"object");break;default:t.set(e,"string")}}))}))}hasProperty(e,t,s){if(s.some((e=>e.name===w.name)))return!0;if(e.indexOf("-")>-1){if(n(e)||r(e))return!1;if(s.some((e=>e.name===x.name)))return!0}return(this._schema.get(e.toLowerCase())||this._schema.get("unknown")).has(t)}hasElement(e,t){if(t.some((e=>e.name===w.name)))return!0;if(e.indexOf("-")>-1){if(n(e)||r(e))return!0;if(t.some((e=>e.name===x.name)))return!0}return this._schema.has(e.toLowerCase())}securityContext(e,t,s){s&&(t=this.getMappedPropName(t)),e=e.toLowerCase(),t=t.toLowerCase();let n=$i()[e+"|"+t];return n||(n=$i()["*|"+t],n||E.NONE)}getMappedPropName(e){return qo.get(e)??e}getDefaultComponentElementName(){return"ng-component"}validateProperty(e){if(e.toLowerCase().startsWith("on")){return{error:!0,msg:`Binding to event property '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...\nIf '${e}' is a directive input, make sure the directive is imported by the current module.`}}return{error:!1}}validateAttribute(e){if(e.toLowerCase().startsWith("on")){return{error:!0,msg:`Binding to event attribute '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...`}}return{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(e){const t=this._schema.get(e.toLowerCase())||this._schema.get("unknown");return Array.from(t.keys()).map((e=>Fo.get(e)??e))}allKnownEventsOfElement(e){return Array.from(this._eventSchema.get(e.toLowerCase())??[])}normalizeAnimationStyleProperty(e){return e.replace(I,((...e)=>e[1].toUpperCase()))}normalizeAnimationStyleValue(e,t,s){let n="";const r=s.toString().trim();let i=null;if(function(e){switch(e){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}(e)&&0!==s&&"0"!==s)if("number"==typeof s)n="px";else{const e=s.match(/^[+-]?[\d\.]+([a-z]*)$/);e&&0==e[1].length&&(i=`Please provide a CSS unit value for ${t}:${s}`)}return{error:i,value:r+n}}}const Uo=new Set(["iframe|srcdoc","*|innerhtml","*|outerhtml","embed|src","object|codebase","object|data"]);function Ho(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),Uo.has(e+"|"+t)||Uo.has("*|"+t)}const jo="animate-";class Wo{constructor(e,t,s,n){this._exprParser=e,this._interpolationConfig=t,this._schemaRegistry=s,this.errors=n}get interpolationConfig(){return this._interpolationConfig}createBoundHostProperties(e,t){const s=[];for(const n of Object.keys(e)){const r=e[n];"string"==typeof r?this.parsePropertyBinding(n,r,!0,t,t.start.offset,void 0,[],s,t):this._reportError(`Value of the host property binding "${n}" needs to be a string representing an expression but got "${r}" (${typeof r})`,t)}return s}createDirectiveHostEventAsts(e,t){const s=[];for(const n of Object.keys(e)){const r=e[n];"string"==typeof r?this.parseEvent(n,r,!1,t,t,[],s,t):this._reportError(`Value of the host listener "${n}" needs to be a string representing an expression but got "${r}" (${typeof r})`,t)}return s}parseInterpolation(e,t,s){const n=t.start.toString(),r=t.fullStart.offset;try{const i=this._exprParser.parseInterpolation(e,n,r,s,this._interpolationConfig);return i&&this._reportExpressionParserErrors(i.errors,t),i}catch(e){return this._reportError(`${e}`,t),this._exprParser.wrapLiteralPrimitive("ERROR",n,r)}}parseInterpolationExpression(e,t){const s=t.start.toString(),n=t.start.offset;try{const r=this._exprParser.parseInterpolationExpression(e,s,n);return r&&this._reportExpressionParserErrors(r.errors,t),r}catch(e){return this._reportError(`${e}`,t),this._exprParser.wrapLiteralPrimitive("ERROR",s,n)}}parseInlineTemplateBinding(e,t,s,n,r,i,a,o){const l=s.start.offset+"*".length,c=this._parseTemplateBindings(e,t,s,l,n);for(const e of c){const t=Go(s,e.sourceSpan),l=e.key.source,c=Go(s,e.key.span);if(e instanceof ui){const n=e.value?e.value.source:"$implicit",r=e.value?Go(s,e.value.span):void 0;a.push(new fi(l,n,t,c,r))}else if(e.value){const n=o?t:s,a=Go(s,e.value.ast.sourceSpan);this._parsePropertyAst(l,e.value,n,c,a,r,i)}else r.push([l,""]),this.parseLiteralAttr(l,null,c,n,void 0,r,i,c)}}_parseTemplateBindings(t,s,n,r,i){const a=n.start.toString();try{const o=this._exprParser.parseTemplateBindings(t,s,a,r,i);return this._reportExpressionParserErrors(o.errors,n),o.warnings.forEach((t=>{this._reportError(t,n,e.ParseErrorLevel.WARNING)})),o.templateBindings}catch(e){return this._reportError(`${e}`,n),[]}}parseLiteralAttr(t,s,n,r,i,a,o,l){zo(t)?(t=t.substring(1),void 0!==l&&(l=Go(l,new li(l.start.offset+1,l.end.offset))),s&&this._reportError('Assigning animation triggers via @prop="exp" attributes with an expression is invalid. Use property bindings (e.g. [@prop]="exp") or use an attribute without a value (e.g. @prop) instead.',n,e.ParseErrorLevel.ERROR),this._parseAnimation(t,s,n,r,l,i,a,o)):o.push(new gi(t,this._exprParser.wrapLiteralPrimitive(s,"",r),e.ParsedPropertyType.LITERAL_ATTR,n,l,i))}parsePropertyBinding(e,t,s,n,r,i,a,o,l){0===e.length&&this._reportError("Property name is missing in binding",n);let c=!1;e.startsWith(jo)?(c=!0,e=e.substring(jo.length),void 0!==l&&(l=Go(l,new li(l.start.offset+jo.length,l.end.offset)))):zo(e)&&(c=!0,e=e.substring(1),void 0!==l&&(l=Go(l,new li(l.start.offset+1,l.end.offset)))),c?this._parseAnimation(e,t,n,r,l,i,a,o):this._parsePropertyAst(e,this._parseBinding(t,s,i||n,r),n,l,i,a,o)}parsePropertyInterpolation(e,t,s,n,r,i,a,o){const l=this.parseInterpolation(t,n||s,o);return!!l&&(this._parsePropertyAst(e,l,s,a,n,r,i),!0)}_parsePropertyAst(t,s,n,r,i,a,o){a.push([t,s.source]),o.push(new gi(t,s,e.ParsedPropertyType.DEFAULT,n,r,i))}_parseAnimation(t,s,n,r,i,a,o,l){0===t.length&&this._reportError("Animation trigger is missing",n);const c=this._parseBinding(s||"undefined",!1,a||n,r);o.push([t,c.source]),l.push(new gi(t,c,e.ParsedPropertyType.ANIMATION,n,i,a))}_parseBinding(e,t,s,n){const r=(s&&s.start||"(unknown)").toString();try{const i=t?this._exprParser.parseSimpleBinding(e,r,n,this._interpolationConfig):this._exprParser.parseBinding(e,r,n,this._interpolationConfig);return i&&this._reportExpressionParserErrors(i.errors,s),i}catch(e){return this._reportError(`${e}`,s),this._exprParser.wrapLiteralPrimitive("ERROR",r,n)}}createBoundElementProperty(e,t,s=!1,n=!0){if(t.isAnimation)return new yi(t.name,4,E.NONE,t.expression,null,t.sourceSpan,t.keySpan,t.valueSpan);let r,i=null,a=null;const l=t.name.split(".");let c;if(l.length>1)if("attr"==l[0]){a=l.slice(1).join("."),s||this._validatePropertyOrAttributeName(a,t.sourceSpan,!0),c=Ko(this._schemaRegistry,e,a,!0);const n=a.indexOf(":");if(n>-1){const e=a.substring(0,n),t=a.substring(n+1);a=o(e,t)}r=1}else"class"==l[0]?(a=l[1],r=2,c=[E.NONE]):"style"==l[0]&&(i=l.length>2?l[2]:null,a=l[1],r=3,c=[E.STYLE]);if(null===a){const i=this._schemaRegistry.getMappedPropName(t.name);a=n?i:t.name,c=Ko(this._schemaRegistry,e,i,!1),r=0,s||this._validatePropertyOrAttributeName(i,t.sourceSpan,!1)}return new yi(a,r,c[0],t.expression,i,t.sourceSpan,t.keySpan,t.valueSpan)}parseEvent(e,t,s,n,r,i,a,o){0===e.length&&this._reportError("Event name is missing in binding",n),zo(e)?(e=e.slice(1),void 0!==o&&(o=Go(o,new li(o.start.offset+1,o.end.offset))),this._parseAnimationEvent(e,t,s,n,r,a,o)):this._parseRegularEvent(e,t,s,n,r,i,a,o)}calcPossibleSecurityContexts(e,t,s){const n=this._schemaRegistry.getMappedPropName(t);return Ko(this._schemaRegistry,e,n,s)}_parseAnimationEvent(e,t,s,n,r,i,a){const o=k(e,".",[e,""]);const l=o[0],c=o[1].toLowerCase(),u=this._parseAction(t,s,r);i.push(new vi(l,c,1,u,n,r,a)),0===l.length&&this._reportError("Animation event name is missing in binding",n),c?"start"!==c&&"done"!==c&&this._reportError(`The provided animation output phase value "${c}" for "@${l}" is not supported (use start or done)`,n):this._reportError(`The animation trigger output event (@${l}) is missing its phase value name (start or done are currently supported)`,n)}_parseRegularEvent(e,t,s,n,r,i,a,o){const[l,c]=k(e,":",[null,e]);const u=this._parseAction(t,s,r);i.push([e,u.source]),a.push(new vi(c,l,0,u,n,r,o))}_parseAction(e,t,s){const n=(s&&s.start||"(unknown").toString(),r=s&&s.start?s.start.offset:0;try{const i=this._exprParser.parseAction(e,t,n,r,this._interpolationConfig);return i&&this._reportExpressionParserErrors(i.errors,s),!i||i.ast instanceof Fr?(this._reportError("Empty expressions are not allowed",s),this._exprParser.wrapLiteralPrimitive("ERROR",n,r)):i}catch(e){return this._reportError(`${e}`,s),this._exprParser.wrapLiteralPrimitive("ERROR",n,r)}}_reportError(t,s,n=e.ParseErrorLevel.ERROR){this.errors.push(new pr(s,t,n))}_reportExpressionParserErrors(e,t){for(const s of e)this._reportError(s.message,t)}_validatePropertyOrAttributeName(t,s,n){const r=n?this._schemaRegistry.validateAttribute(t):this._schemaRegistry.validateProperty(t);r.error&&this._reportError(r.msg,s,e.ParseErrorLevel.ERROR)}}function zo(e){return"@"==e[0]}function Ko(e,t,s,n){const r=[];return d.parse(t).forEach((t=>{const i=t.element?[t.element]:e.allKnownElementNames(),a=new Set(t.notSelectors.filter((e=>e.isElementSelector())).map((e=>e.element))),o=i.filter((e=>!a.has(e)));r.push(...o.map((t=>e.securityContext(t,s,n))))})),0===r.length?[E.NONE]:Array.from(new Set(r)).sort()}function Go(e,t){const s=t.start-e.start.offset,n=t.end-e.end.offset;return new cr(e.start.moveBy(s),e.end.moveBy(n),e.fullStart.moveBy(s),e.details)}const Yo=/^([^:/?#]+):/;function Qo(e){let t=null,s=null,n=null,i=!1,a="";e.attrs.forEach((e=>{const r=e.name.toLowerCase();"select"==r?t=e.value:"href"==r?s=e.value:"rel"==r?n=e.value:"ngNonBindable"==e.name?i=!0:"ngProjectAs"==e.name&&e.value.length>0&&(a=e.value)})),t=function(e){if(null===e||0===e.length)return"*";return e}(t);const o=e.name.toLowerCase();let l=Xo.OTHER;return r(o)?l=Xo.NG_CONTENT:"style"==o?l=Xo.STYLE:"script"==o?l=Xo.SCRIPT:"link"==o&&"stylesheet"==n&&(l=Xo.STYLESHEET),new Jo(l,t,s,i,a)}var Xo;!function(e){e[e.NG_CONTENT=0]="NG_CONTENT",e[e.STYLE=1]="STYLE",e[e.STYLESHEET=2]="STYLESHEET",e[e.SCRIPT=3]="SCRIPT",e[e.OTHER=4]="OTHER"}(Xo||(Xo={}));class Jo{constructor(e,t,s,n,r){this.type=e,this.selectAttr=t,this.hrefAttr=s,this.nonBindable=n,this.projectAs=r}}const Zo=/^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/,el={start:"[(",end:")]"},tl={start:"[",end:"]"},sl={start:"(",end:")"};class nl{constructor(e,t){this.bindingParser=e,this.options=t,this.errors=[],this.styles=[],this.styleUrls=[],this.ngContentSelectors=[],this.commentNodes=[],this.inI18nBlock=!1}visitElement(e){const t=rn(e.i18n);t&&(this.inI18nBlock&&this.reportError("Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.",e.sourceSpan),this.inI18nBlock=!0);const s=Qo(e);if(s.type===Xo.SCRIPT)return null;if(s.type===Xo.STYLE){const t=1===(n=e).children.length&&n.children[0]instanceof Ya?n.children[0].value:null;return null!==t&&this.styles.push(t),null}if(s.type===Xo.STYLESHEET&&function(e){if(null==e||0===e.length||"/"==e[0])return!1;const t=e.match(Yo);return null===t||"package"==t[1]||"asset"==t[1]}(s.hrefAttr))return this.styleUrls.push(s.hrefAttr),null;var n;const r=i(e.name),a=[],o=[],l=[],c=[],u=[],p={},h=[],d=[];let m=!1;for(const t of e.attrs){let e=!1;const s=il(t.name);let n=!1;if(t.i18n&&(p[t.name]=t.i18n),s.startsWith("*")){m&&this.reportError("Can't have multiple template bindings on one element. Use only one attribute prefixed with *",t.sourceSpan),n=!0,m=!0;const e=t.value,r=s.substring("*".length),i=[],a=t.valueSpan?t.valueSpan.start.offset:t.sourceSpan.start.offset+t.name.length;this.bindingParser.parseInlineTemplateBinding(r,e,t.sourceSpan,a,[],h,i,!0),d.push(...i.map((e=>new Es(e.name,e.value,e.sourceSpan,e.keySpan,e.valueSpan))))}else e=this.parseAttribute(r,t,[],a,o,l,c);e||n||u.push(this.visitAttribute(t))}const g=to(s.nonBindable?rl:this,e.children);let v;if(s.type===Xo.NG_CONTENT){e.children&&!e.children.every((e=>function(e){return e instanceof Ya&&0==e.value.trim().length}(e)||function(e){return e instanceof eo}(e)))&&this.reportError(" element cannot have content.",e.sourceSpan);const t=s.selectAttr,n=e.attrs.map((e=>this.visitAttribute(e)));v=new Ss(t,n,e.sourceSpan,e.i18n),this.ngContentSelectors.push(t)}else if(r){const t=this.extractAttributes(e.name,a,p);v=new ws(e.name,u,t.bound,o,[],g,c,l,e.sourceSpan,e.startSourceSpan,e.endSourceSpan,e.i18n)}else{const t=this.extractAttributes(e.name,a,p);v=new xs(e.name,u,t.bound,o,g,c,e.sourceSpan,e.startSourceSpan,e.endSourceSpan,e.i18n)}if(m){const s=this.extractAttributes("ng-template",h,p),n=[];s.literal.forEach((e=>n.push(e))),s.bound.forEach((e=>n.push(e)));const i=v instanceof xs?{attributes:v.attributes,inputs:v.inputs,outputs:v.outputs}:{attributes:[],inputs:[],outputs:[]},a=r&&t?void 0:e.i18n,o=v instanceof ws?null:v.name;v=new ws(o,i.attributes,i.inputs,i.outputs,n,[v],[],d,e.sourceSpan,e.startSourceSpan,e.endSourceSpan,a)}return t&&(this.inI18nBlock=!1),v}visitAttribute(e){return new vs(e.name,e.value,e.sourceSpan,e.keySpan,e.valueSpan,e.i18n)}visitText(e){return this._visitTextWithInterpolation(e.value,e.sourceSpan,e.tokens,e.i18n)}visitExpansion(e){if(!e.i18n)return null;if(!rn(e.i18n))throw new Error(`Invalid type "${e.i18n.constructor}" for "i18n" property of ${e.sourceSpan.toString()}. Expected a "Message"`);const t=e.i18n,s={},n={};return Object.keys(t.placeholders).forEach((e=>{const r=t.placeholders[e];if(e.startsWith("VAR_")){const t=e.trim(),n=this.bindingParser.parseInterpolationExpression(r.text,r.sourceSpan);s[t]=new gs(n,r.sourceSpan)}else n[e]=this._visitTextWithInterpolation(r.text,r.sourceSpan,null)})),new bs(s,n,e.sourceSpan,t)}visitExpansionCase(e){return null}visitComment(e){return this.options.collectCommentNodes&&this.commentNodes.push(new ds(e.value||"",e.sourceSpan)),null}extractAttributes(e,t,s){const n=[],r=[];return t.forEach((t=>{const i=s[t.name];if(t.isLiteral)r.push(new vs(t.name,t.expression.source||"",t.sourceSpan,t.keySpan,t.valueSpan,i));else{const s=this.bindingParser.createBoundElementProperty(e,t,!0,!1);n.push(fs.fromBoundElementProperty(s,i))}})),{bound:n,literal:r}}parseAttribute(e,t,s,n,r,i,a){const o=il(t.name),l=t.value,c=t.sourceSpan,u=t.valueSpan?t.valueSpan.start.offset:c.start.offset;function p(e,s,n){const r=t.name.length-o.length,i=e.start.moveBy(s.length+r),a=i.moveBy(n.length);return new cr(i,a,i,n)}const h=o.match(Zo);if(h){if(null!=h[1]){const e=h[7],r=p(c,h[1],e);this.bindingParser.parsePropertyBinding(e,l,!1,c,u,t.valueSpan,s,n,r)}else if(h[2])if(e){const e=h[7],s=p(c,h[2],e);this.parseVariable(e,l,c,s,t.valueSpan,i)}else this.reportError('"let-" is only supported on ng-template elements.',c);else if(h[3]){const e=h[7],s=p(c,h[3],e);this.parseReference(e,l,c,s,t.valueSpan,a)}else if(h[4]){const e=[],n=h[7],i=p(c,h[4],n);this.bindingParser.parseEvent(n,l,!1,c,t.valueSpan||c,s,e,i),al(e,r)}else if(h[5]){const e=h[7],i=p(c,h[5],e);this.bindingParser.parsePropertyBinding(e,l,!1,c,u,t.valueSpan,s,n,i),this.parseAssignmentEvent(e,l,c,t.valueSpan,s,r,i)}else if(h[6]){const e=p(c,"",o);this.bindingParser.parseLiteralAttr(o,l,c,u,t.valueSpan,s,n,e)}return!0}let d=null;if(o.startsWith(el.start)?d=el:o.startsWith(tl.start)?d=tl:o.startsWith(sl.start)&&(d=sl),null!==d&&o.endsWith(d.end)&&o.length>d.start.length+d.end.length){const e=o.substring(d.start.length,o.length-d.end.length),i=p(c,d.start,e);if(d.start===el.start)this.bindingParser.parsePropertyBinding(e,l,!1,c,u,t.valueSpan,s,n,i),this.parseAssignmentEvent(e,l,c,t.valueSpan,s,r,i);else if(d.start===tl.start)this.bindingParser.parsePropertyBinding(e,l,!1,c,u,t.valueSpan,s,n,i);else{const n=[];this.bindingParser.parseEvent(e,l,!1,c,t.valueSpan||c,s,n,i),al(n,r)}return!0}const m=p(c,"",o);return this.bindingParser.parsePropertyInterpolation(o,l,c,t.valueSpan,s,n,m,t.valueTokens??null)}_visitTextWithInterpolation(e,t,s,n){const r=Mo(e),i=this.bindingParser.parseInterpolation(r,t,s);return i?new gs(i,t,n):new ms(r,t)}parseVariable(e,t,s,n,r,i){e.indexOf("-")>-1?this.reportError('"-" is not allowed in variable names',s):0===e.length&&this.reportError("Variable does not have a name",s),i.push(new Es(e,t,s,n,r))}parseReference(e,t,s,n,r,i){e.indexOf("-")>-1?this.reportError('"-" is not allowed in reference names',s):0===e.length?this.reportError("Reference does not have a name",s):i.some((t=>t.name===e))&&this.reportError(`Reference "#${e}" is defined more than once`,s),i.push(new _s(e,t,s,n,r))}parseAssignmentEvent(e,t,s,n,r,i,a){const o=[];this.bindingParser.parseEvent(`${e}Change`,`${t} =$event`,!0,s,n||s,r,o,a),al(o,i)}reportError(t,s,n=e.ParseErrorLevel.ERROR){this.errors.push(new pr(s,t,n))}}const rl=new class{visitElement(e){const t=Qo(e);if(t.type===Xo.SCRIPT||t.type===Xo.STYLE||t.type===Xo.STYLESHEET)return null;const s=to(this,e.children,null);return new xs(e.name,to(this,e.attrs),[],[],s,[],e.sourceSpan,e.startSourceSpan,e.endSourceSpan)}visitComment(e){return null}visitAttribute(e){return new vs(e.name,e.value,e.sourceSpan,e.keySpan,e.valueSpan,e.i18n)}visitText(e){return new ms(e.value,e.sourceSpan)}visitExpansion(e){return null}visitExpansionCase(e){return null}};function il(e){return/^data-/i.test(e)?e.substring(5):e}function al(e,t){t.push(...e.map((e=>ys.fromParsedEvent(e))))}var ol;!function(e){e[e.ELEMENT=0]="ELEMENT",e[e.TEMPLATE=1]="TEMPLATE"}(ol||(ol={}));class ll{constructor(e,t,s=0,n=null,r,i){this.index=e,this.ref=t,this.level=s,this.templateIndex=n,this.meta=r,this.registry=i,this.bindings=new Set,this.placeholders=new Map,this.isEmitted=!1,this._unresolvedCtxCount=0,this._registry=i||{getUniqueId:un(),icus:new Map},this.id=this._registry.getUniqueId()}appendTag(e,t,s,n){if(t.isVoid&&n)return;const r=t.isVoid||!n?t.startName:t.closeName,i={type:e,index:s,ctx:this.id,isVoid:t.isVoid,closed:n};hn(this.placeholders,r,i)}get icus(){return this._registry.icus}get isRoot(){return 0===this.level}get isResolved(){return 0===this._unresolvedCtxCount}getSerializedPlaceholders(){const e=new Map;return this.placeholders.forEach(((t,s)=>e.set(s,t.map(hl)))),e}appendBinding(e){this.bindings.add(e)}appendIcu(e,t){hn(this._registry.icus,e,t)}appendBoundText(e){dn(e,this.bindings.size,this.id).forEach(((e,t)=>hn(this.placeholders,t,...e)))}appendTemplate(e,t){this.appendTag(ol.TEMPLATE,e,t,!1),this.appendTag(ol.TEMPLATE,e,t,!0),this._unresolvedCtxCount++}appendElement(e,t,s){this.appendTag(ol.ELEMENT,e,t,s)}appendProjection(e,t){this.appendTag(ol.ELEMENT,e,t,!1),this.appendTag(ol.ELEMENT,e,t,!0)}forkChildContext(e,t,s){return new ll(e,this.ref,this.level+1,t,s,this._registry)}reconcileChildContext(e){["start","close"].forEach((t=>{const s=e.meta[`${t}Name`],n=(this.placeholders.get(s)||[]).find(pl(this.id,e.templateIndex));n&&(n.ctx=e.id)}));e.placeholders.forEach(((t,s)=>{const n=this.placeholders.get(s);if(!n)return void this.placeholders.set(s,t);const r=n.findIndex(pl(e.id,e.templateIndex));if(r>=0){const e=s.startsWith("CLOSE");if(s.endsWith("NG-TEMPLATE"))n.splice(r+(e?0:1),0,...t);else{t[e?t.length-1:0].tmpl=n[r],n.splice(r,1,...t)}}else n.push(...t);this.placeholders.set(s,n)})),this._unresolvedCtxCount--}}function cl(e,t,s,n){return cn(`${n?"/":""}${e}${t}`,s)}function ul(e,{index:t,ctx:s,isVoid:n},r){return n?cl(e,t,s)+cl(e,t,s,!0):cl(e,t,s,r)}function pl(e,t){return s=>"object"==typeof s&&s.type===ol.TEMPLATE&&s.index===t&&s.ctx===e}function hl(e){const t=(e,t)=>ul("#",e,t),s=(e,t)=>ul("*",e,t);switch(e.type){case ol.ELEMENT:return e.closed?t(e,!0)+(e.tmpl?s(e.tmpl,!0):""):e.tmpl?s(e.tmpl)+t(e)+(e.isVoid?s(e.tmpl,!0):""):t(e);case ol.TEMPLATE:return s(e,e.closed);default:return e}}const dl=new class{visitText(e){return e.value}visitContainer(e){return e.children.map((e=>e.visit(this))).join("")}visitIcu(e){const t=Object.keys(e.cases).map((t=>`${t} {${e.cases[t].visit(this)}}`));return`{${e.expressionPlaceholder}, ${e.type}, ${t.join(" ")}}`}visitTagPlaceholder(e){return e.isVoid?this.formatPh(e.startName):`${this.formatPh(e.startName)}${e.children.map((e=>e.visit(this))).join("")}${this.formatPh(e.closeName)}`}visitPlaceholder(e){return this.formatPh(e.name)}visitIcuPlaceholder(e,t){return this.formatPh(e.name)}formatPh(e){return`{${gn(e,!1)}}`}};function ml(e){return e.visit(dl)}const gl={A:"LINK",B:"BOLD_TEXT",BR:"LINE_BREAK",EM:"EMPHASISED_TEXT",H1:"HEADING_LEVEL1",H2:"HEADING_LEVEL2",H3:"HEADING_LEVEL3",H4:"HEADING_LEVEL4",H5:"HEADING_LEVEL5",H6:"HEADING_LEVEL6",HR:"HORIZONTAL_RULE",I:"ITALIC_TEXT",LI:"LIST_ITEM",LINK:"MEDIA_LINK",OL:"ORDERED_LIST",P:"PARAGRAPH",Q:"QUOTATION",S:"STRIKETHROUGH_TEXT",SMALL:"SMALL_TEXT",SUB:"SUBSTRIPT",SUP:"SUPERSCRIPT",TBODY:"TABLE_BODY",TD:"TABLE_CELL",TFOOT:"TABLE_FOOTER",TH:"TABLE_HEADER_CELL",THEAD:"TABLE_HEADER",TR:"TABLE_ROW",TT:"MONOSPACED_TEXT",U:"UNDERLINED_TEXT",UL:"UNORDERED_LIST"};class vl{constructor(){this._placeHolderNameCounts={},this._signatureToName={}}getStartTagPlaceholderName(e,t,s){const n=this._hashTag(e,t,s);if(this._signatureToName[n])return this._signatureToName[n];const r=e.toUpperCase(),i=gl[r]||`TAG_${r}`,a=this._generateUniqueName(s?i:`START_${i}`);return this._signatureToName[n]=a,a}getCloseTagPlaceholderName(e){const t=this._hashClosingTag(e);if(this._signatureToName[t])return this._signatureToName[t];const s=e.toUpperCase(),n=gl[s]||`TAG_${s}`,r=this._generateUniqueName(`CLOSE_${n}`);return this._signatureToName[t]=r,r}getPlaceholderName(e,t){const s=e.toUpperCase(),n=`PH: ${s}=${t}`;if(this._signatureToName[n])return this._signatureToName[n];const r=this._generateUniqueName(s);return this._signatureToName[n]=r,r}getUniquePlaceholder(e){return this._generateUniqueName(e.toUpperCase())}_hashTag(e,t,s){return`<${e}`+Object.keys(t).sort().map((e=>` ${e}=${t[e]}`)).join("")+(s?"/>":`>`)}_hashClosingTag(e){return this._hashTag(`/${e}`,{},!1)}_generateUniqueName(e){if(!this._placeHolderNameCounts.hasOwnProperty(e))return this._placeHolderNameCounts[e]=1,e;const t=this._placeHolderNameCounts[e];return this._placeHolderNameCounts[e]=t+1,`${e}_${t}`}}const fl=new ja(new La);function yl(e){const t=new wl(fl,e);return(e,s,n,r,i)=>t.toI18nMessage(e,s,n,r,i)}function xl(e,t){return t}class wl{constructor(e,t){this._expressionParser=e,this._interpolationConfig=t}toI18nMessage(e,t="",s="",n="",r){const i={isIcu:1==e.length&&e[0]instanceof Qa,icuDepth:0,placeholderRegistry:new vl,placeholderToContent:{},placeholderToMessage:{},visitNodeFn:r||xl},a=to(this,e,i);return new Cs(a,i.placeholderToContent,i.placeholderToMessage,t,s,n)}visitElement(e,t){const s=to(this,e.children,t),n={};e.attrs.forEach((e=>{n[e.name]=e.value}));const r=p(e.name).isVoid,i=t.placeholderRegistry.getStartTagPlaceholderName(e.name,n,r);t.placeholderToContent[i]={text:e.startSourceSpan.toString(),sourceSpan:e.startSourceSpan};let a="";r||(a=t.placeholderRegistry.getCloseTagPlaceholderName(e.name),t.placeholderToContent[a]={text:``,sourceSpan:e.endSourceSpan??e.sourceSpan});const o=new Ps(e.name,n,i,a,s,r,e.sourceSpan,e.startSourceSpan,e.endSourceSpan);return t.visitNodeFn(e,o)}visitAttribute(e,t){const s=void 0===e.valueTokens||1===e.valueTokens.length?new Is(e.value,e.valueSpan||e.sourceSpan):this._visitTextWithInterpolation(e.valueTokens,e.valueSpan||e.sourceSpan,t,e.i18n);return t.visitNodeFn(e,s)}visitText(e,t){const s=1===e.tokens.length?new Is(e.value,e.sourceSpan):this._visitTextWithInterpolation(e.tokens,e.sourceSpan,t,e.i18n);return t.visitNodeFn(e,s)}visitComment(e,t){return null}visitExpansion(e,t){t.icuDepth++;const s={},n=new Ns(e.switchValue,e.type,s,e.sourceSpan);if(e.cases.forEach((e=>{s[e.value]=new ks(e.expression.map((e=>e.visit(this,t))),e.expSourceSpan)})),t.icuDepth--,t.isIcu||t.icuDepth>0){const s=t.placeholderRegistry.getUniquePlaceholder(`VAR_${e.type}`);return n.expressionPlaceholder=s,t.placeholderToContent[s]={text:e.switchValue,sourceSpan:e.switchValueSourceSpan},t.visitNodeFn(e,n)}const r=t.placeholderRegistry.getPlaceholderName("ICU",e.sourceSpan.toString());t.placeholderToMessage[r]=this.toI18nMessage([e],"","","",void 0);const i=new Ls(n,r,e.sourceSpan);return t.visitNodeFn(e,i)}visitExpansionCase(e,t){throw new Error("Unreachable code")}_visitTextWithInterpolation(e,t,s,n){const r=[];let i=!1;for(const t of e)switch(t.type){case 8:case 17:i=!0;const e=t.parts[1],n=e.split(Sl)[2]||"INTERPOLATION",a=s.placeholderRegistry.getPlaceholderName(n,e);s.placeholderToContent[a]={text:t.parts.join(""),sourceSpan:t.sourceSpan},r.push(new As(e,a,t.sourceSpan));break;default:if(t.parts[0].length>0){const e=r[r.length-1];e instanceof Is?(e.value+=t.parts[0],e.sourceSpan=new cr(e.sourceSpan.start,t.sourceSpan.end,e.sourceSpan.fullStart,e.sourceSpan.details)):r.push(new Is(t.parts[0],t.sourceSpan))}}return i?(function(e,t){t instanceof Cs&&(!function(e){const t=e.nodes;if(1!==t.length||!(t[0]instanceof ks))throw new Error("Unexpected previous i18n message - expected it to consist of only a single `Container` node.")}(t),t=t.nodes[0]);if(t instanceof ks){!function(e,t){if(e.length!==t.length)throw new Error("The number of i18n message children changed between first and second pass.");if(e.some(((e,s)=>t[s].constructor!==e.constructor)))throw new Error("The types of the i18n message children changed between first and second pass.")}(t.children,e);for(let s=0;s(e instanceof Ga&&(t instanceof Ls&&e.i18n instanceof Cs&&(t.previousMessage=e.i18n),e.i18n=t),t);class bl{constructor(e=Fn,t=!1,s=!1){this.interpolationConfig=e,this.keepI18nAttrs=t,this.enableI18nLegacyMessageIdFormat=s,this.hasI18nMeta=!1,this._errors=[],this._createI18nMessage=yl(this.interpolationConfig)}_generateI18nMessage(e,t="",s){const{meaning:n,description:r,customId:i}=this._parseMetadata(t),a=this._createI18nMessage(e,n,r,i,s);return this._setMessageId(a,t),this._setLegacyIds(a,t),a}visitAllWithErrors(e){const t=e.map((e=>e.visit(this,null)));return new Eo(t,this._errors)}visitElement(e){let t;if(function(e){return e.attrs.some((e=>nn(e.name)))}(e)){this.hasI18nMeta=!0;const s=[],n={};for(const r of e.attrs)if(r.name===tn){const s=e.i18n||r.value;t=this._generateI18nMessage(e.children,s,_l),0===t.nodes.length&&(t=void 0),e.i18n=t}else if(r.name.startsWith(sn)){const t=r.name.slice(sn.length);Ho(e.name,t)?this._reportError(r,`Translating attribute '${t}' is disallowed for security reasons.`):n[t]=r.value}else s.push(r);if(Object.keys(n).length)for(const e of s){const t=n[e.name];void 0!==t&&e.value&&(e.i18n=this._generateI18nMessage([e],e.i18n||t))}this.keepI18nAttrs||(e.attrs=s)}return to(this,e.children,t),e}visitExpansion(e,t){let s;const n=e.i18n;if(this.hasI18nMeta=!0,n instanceof Ls){const r=n.name;s=this._generateI18nMessage([e],n);ln(s).name=r,null!==t&&(t.placeholderToMessage[r]=s)}else s=this._generateI18nMessage([e],t||n);return e.i18n=s,e}visitText(e){return e}visitAttribute(e){return e}visitComment(e){return e}visitExpansionCase(e){return e}_parseMetadata(e){return"string"==typeof e?function(e=""){let t,s,n;if(e=e.trim()){const r=e.indexOf("@@"),i=e.indexOf("|");let a;[a,t]=r>-1?[e.slice(0,r),e.slice(r+2)]:[e,""],[s,n]=i>-1?[a.slice(0,i),a.slice(i+1)]:["",a]}return{customId:t,meaning:s,description:n}}(e):e instanceof Cs?e:{}}_setMessageId(e,t){e.id||(e.id=t instanceof Cs&&t.id||B(e))}_setLegacyIds(e,t){if(this.enableI18nLegacyMessageIdFormat)e.legacyIds=[D(e),q(e)];else if("string"!=typeof t){const s=t instanceof Cs?t:t instanceof Ls?t.previousMessage:void 0;e.legacyIds=s?s.legacyIds:[]}}_reportError(e,t){this._errors.push(new El(e.sourceSpan,t))}}function Tl(e,t,s,n){const r=function(e){return e.nodes.map((e=>e.visit(Cl,null))).join("")}(t),i=[Tt(r)];Object.keys(n).length&&(i.push($o(mn(n,!0),!0)),i.push($o({original_code:wt(Object.keys(n).map((e=>({key:gn(e),quoted:!0,value:t.placeholders[e]?Tt(t.placeholders[e].sourceSpan.toString()):Tt(t.placeholderToMessage[e].nodes.map((e=>e.sourceSpan.toString())).join(""))}))))})));const a=s.set(gt("goog.getMsg").callFn(i)).toConstDecl();a.addLeadingComment(function(e){const t=[];return e.description?t.push({tagName:"desc",text:e.description}):t.push({tagName:"suppress",text:"{msgDescriptions}"}),e.meaning&&t.push({tagName:"meaning",text:e.meaning}),mt(t)}(t));return[a,new ut(e.set(s))]}const Cl=new class{formatPh(e){return`{$${gn(e)}}`}visitText(e){return e.value}visitContainer(e){return e.children.map((e=>e.visit(this))).join("")}visitIcu(e){return ml(e)}visitTagPlaceholder(e){return e.isVoid?this.formatPh(e.startName):`${this.formatPh(e.startName)}${e.children.map((e=>e.visit(this))).join("")}${this.formatPh(e.closeName)}`}visitPlaceholder(e){return this.formatPh(e.name)}visitIcuPlaceholder(e,t){return this.formatPh(e.name)}};function Il(e,t,s){const{messageParts:n,placeHolders:r}=function(e){const t=[],s=new kl(e.placeholderToMessage,t);return e.nodes.forEach((e=>e.visit(s))),function(e){const t=[],s=[];e[0]instanceof $e&&t.push(Nl(e[0].sourceSpan.start));for(let n=0;ns[e.text])),o=Ct(t,n,r,a,i),l=e.set(o);return[new ut(l)]}class kl{constructor(e,t){this.placeholderToMessage=e,this.pieces=t}visitText(e){if(this.pieces[this.pieces.length-1]instanceof Oe)this.pieces[this.pieces.length-1].text+=e.value;else{const t=new cr(e.sourceSpan.fullStart,e.sourceSpan.end,e.sourceSpan.fullStart,e.sourceSpan.details);this.pieces.push(new Oe(e.value,t))}}visitContainer(e){e.children.forEach((e=>e.visit(this)))}visitIcu(e){this.pieces.push(new Oe(ml(e),e.sourceSpan))}visitTagPlaceholder(e){this.pieces.push(this.createPlaceholderPiece(e.startName,e.startSourceSpan??e.sourceSpan)),e.isVoid||(e.children.forEach((e=>e.visit(this))),this.pieces.push(this.createPlaceholderPiece(e.closeName,e.endSourceSpan??e.sourceSpan)))}visitPlaceholder(e){this.pieces.push(this.createPlaceholderPiece(e.name,e.sourceSpan))}visitIcuPlaceholder(e){this.pieces.push(this.createPlaceholderPiece(e.name,e.sourceSpan,this.placeholderToMessage[e.name]))}createPlaceholderPiece(e,t,s){return new $e(gn(e,!1),t,s)}}function Nl(e){return new Oe("",new cr(e,e))}const Pl=new Set(["$event"]),Al=new Map([["window",qt.resolveWindow],["document",qt.resolveDocument],["body",qt.resolveBody]]),Ll=[" ","\n","\r","\t"];function Ml(e,t){return _t(gt(Sn).bitwiseAnd(Tt(e),null,!1),t)}function Rl(e,t=null,s=null){const{type:n,name:r,target:i,phase:a,handler:o}=e;if(i&&!Al.has(i))throw new Error(`Unexpected global target '${i}' defined for '${r}' event.\n Supported list of global targets: ${Array.from(Al.keys())}.`);const l="$event",c=new Set,u=null===s||0===s.bindingLevel?gt(wn):s.getOrCreateSharedContextVar(0),p=wi(s,u,o,"b",e.handlerSpan,c,Pl),h=[],d=s?.variableDeclarations(),m=s?.restoreViewStatement();if(d&&h.push(...d),h.push(...p),m){h.unshift(m);const e=h[h.length-1];e instanceof pt?h[h.length-1]=new pt(bn(e.value.sourceSpan,qt.resetView,[e.value])):h.push(new ut(bn(null,qt.resetView,[])))}const g=1===n?function(e,t){return`@${e}.${t}`}(r,a):r,v=t&&gr(t),f=[];c.has(l)&&f.push(new ze(l,ce));const y=Et(f,h,ue,null,v),x=[Tt(g),y];return i&&x.push(Tt(!1),vt(Al.get(i))),x}class Ol{constructor(e,t,s=0,n,r,i,a,o,l,c,u=function(){return{prepareStatements:[],constExpressions:[],i18nVarRefsCache:new Map}}()){this.constantPool=e,this.level=s,this.contextName=n,this.i18nContext=r,this.templateIndex=i,this.templateName=a,this._namespace=o,this.i18nUseExternalIds=c,this._constants=u,this._dataIndex=0,this._bindingContext=0,this._prefixCode=[],this._creationCodeFns=[],this._updateCodeFns=[],this._currentIndex=0,this._tempVariables=[],this._nestedTemplateFns=[],this.i18n=null,this._pureFunctionSlots=0,this._bindingSlots=0,this._ngContentReservedSlots=[],this._ngContentSelectorsOffset=0,this._implicitReceiverExpr=null,this.visitReference=Cn,this.visitVariable=Cn,this.visitTextAttribute=Cn,this.visitBoundAttribute=Cn,this.visitBoundEvent=Cn,this._bindingScope=t.nestedScope(s),this.fileBasedI18nSuffix=l.replace(/[^A-Za-z0-9]/g,"_")+"_",this._valueConverter=new $l(e,(()=>this.allocateDataSlot()),(e=>this.allocatePureFunctionSlots(e)),((e,t,s,n)=>{this._bindingScope.set(this.level,t,n),this.creationInstruction(null,qt.pipe,[Tt(s),Tt(e)])}))}buildTemplateFunction(e,t,s=0,n){this._ngContentSelectorsOffset=s,this._namespace!==qt.namespaceHTML&&this.creationInstruction(null,this._namespace),t.forEach((e=>this.registerContextVariables(e)));const r=this.i18nContext||rn(n)&&!an(n)&&!(1===(i=e).length&&i[0]instanceof xs&&e[0].i18n===n);var i;const a=Xl(e);if(r&&this.i18nStart(null,n,a),Ts(this,e),this._pureFunctionSlots+=this._bindingSlots,this._valueConverter.updatePipeSlotOffsets(this._bindingSlots),this._nestedTemplateFns.forEach((e=>e())),0===this.level&&this._ngContentReservedSlots.length){const e=[];if(this._ngContentReservedSlots.length>1||"*"!==this._ngContentReservedSlots[0]){const t=this._ngContentReservedSlots.map((e=>"*"!==e?T(e):e));e.push(this.constantPool.getConstLiteral(In(t),!0))}this.creationInstruction(null,qt.projectionDef,e,!0)}r&&this.i18nEnd(null,a);const o=Mn(this._creationCodeFns),l=Mn(this._updateCodeFns),c=this._bindingScope.viewSnapshotStatements(),u=this._bindingScope.variableDeclarations().concat(this._tempVariables),p=o.length>0?[Ml(1,c.concat(o))]:[],h=l.length>0?[Ml(2,u.concat(l))]:[];return Et([new ze(Sn,de),new ze(wn,null)],[...this._prefixCode,...p,...h],ue,null,this.templateName)}getLocal(e){return this._bindingScope.get(e)}notifyImplicitReceiverUse(){this._bindingScope.notifyImplicitReceiverUse()}maybeRestoreView(){this._bindingScope.maybeRestoreView()}i18nTranslate(e,t={},s,n){const r=s||this.i18nGenerateMainBlockVar(),i=function(e,t,s,n={},r){const i=[fn(t),_t(ec(),Tl(t,e,s,n),Il(t,e,mn(n,!1)))];r&&i.push(new ut(t.set(r(t))));return i}(e,r,this.i18nGenerateClosureVar(e.id),t,n);return this._constants.prepareStatements.push(...i),r}registerContextVariables(e){const t=this._bindingScope.freshReferenceName(),s=this.level,n=gt(e.name+t);this._bindingScope.set(s,e.name,n,1,((t,r)=>{let i;if(t.bindingLevel===s)t.isListenerScope()&&t.hasRestoreViewVariable()?(i=gt(En),t.notifyRestoredViewContextUse()):i=gt(wn);else{const e=t.getSharedContextName(s);i=e||ql(r)}return[n.set(i.prop(e.value||"$implicit")).toConstDecl()]}))}i18nAppendBindings(e){e.length>0&&e.forEach((e=>this.i18n.appendBinding(e)))}i18nBindProps(e){const t={};return Object.keys(e).forEach((s=>{const n=e[s];if(n instanceof ms)t[s]=Tt(n.value);else{const e=n.value.visit(this._valueConverter);if(this.allocateBindingSlots(e),e instanceof ti){const{strings:n,expressions:r}=e,{id:i,bindings:a}=this.i18n,o=function(e,t=0,s=0){if(!e.length)return"";let n="";const r=e.length-1;for(let i=0;i{if(1===e.length)i[t]=e[0];else{const s=cn(`I18N_EXP_${t}`);i[t]=Tt(s),r[t]=xt(e)}}));let a;(Array.from(n.values()).some((e=>e.length>1))||Object.keys(r).length)&&(a=e=>{const t=[e];return Object.keys(r).length&&t.push($o(r,!0)),bn(null,qt.i18nPostprocess,t)}),this.i18nTranslate(s,i,e.ref,a)}}i18nStart(e=null,t,s){const n=this.allocateDataSlot();this.i18n=this.i18nContext?this.i18nContext.forkChildContext(n,this.templateIndex,t):new ll(n,this.i18nGenerateMainBlockVar(),0,this.templateIndex,t);const{id:r,ref:i}=this.i18n,a=[Tt(n),this.addToConsts(i)];r>0&&a.push(Tt(r)),this.creationInstruction(e,s?qt.i18n:qt.i18nStart,a)}i18nEnd(e=null,t){if(!this.i18n)throw new Error("i18nEnd is executed with no i18n context present");this.i18nContext?(this.i18nContext.reconcileChildContext(this.i18n),this.i18nUpdateRef(this.i18nContext)):this.i18nUpdateRef(this.i18n);const{index:s,bindings:n}=this.i18n;if(n.size){for(const t of n)this.updateInstructionWithAdvance(this.getConstCount()-1,e,qt.i18nExp,(()=>this.convertPropertyBinding(t)));this.updateInstruction(e,qt.i18nApply,[Tt(s)])}t||this.creationInstruction(e,qt.i18nEnd),this.i18n=null}i18nAttributesInstruction(e,t,s){let n=!1;const r=[];if(t.forEach((t=>{const i=t.i18n,a=t.value.visit(this._valueConverter);if(this.allocateBindingSlots(a),a instanceof ti){const o=pn(dn(i));r.push(Tt(t.name),this.i18nTranslate(i,o)),a.expressions.forEach((t=>{n=!0,this.updateInstructionWithAdvance(e,s,qt.i18nExp,(()=>this.convertPropertyBinding(t)))}))}})),r.length>0){const e=Tt(this.allocateDataSlot()),t=this.addToConsts(xt(r));this.creationInstruction(s,qt.i18nAttributes,[e,t]),n&&this.updateInstruction(s,qt.i18nApply,[e])}}getNamespaceInstruction(e){switch(e){case"math":return qt.namespaceMathML;case"svg":return qt.namespaceSVG;default:return qt.namespaceHTML}}addNamespaceInstruction(e,t){this._namespace=e,this.creationInstruction(t.startSourceSpan,e)}interpolatedUpdateInstruction(e,t,s,n,r,i){this.updateInstructionWithAdvance(t,n.sourceSpan,e,(()=>[Tt(s),...this.getUpdateInstructionArguments(r),...i]))}visitContent(e){const t=this.allocateDataSlot(),s=this._ngContentSelectorsOffset+this._ngContentReservedSlots.length,n=[Tt(t)];this._ngContentReservedSlots.push(e.selector);const r=e.attributes.filter((e=>"select"!==e.name.toLowerCase())),i=this.getAttributeExpressions(e.name,r,[],[]);i.length>0?n.push(Tt(s),xt(i)):0!==s&&n.push(Tt(s)),this.creationInstruction(e.sourceSpan,qt.projection,n),this.i18n&&this.i18n.appendProjection(e.i18n,t)}visitElement(e){const t=this.allocateDataSlot(),r=new Ta(null);let i=!1;const a=rn(e.i18n)&&!an(e.i18n),o=[],[l,c]=s(e.name),u=n(e.name);for(const t of e.attributes){const{name:e,value:s}=t;"ngNonBindable"===e?i=!0:"style"===e?r.registerStyleAttr(s):"class"===e?r.registerClassAttr(s):o.push(t)}const p=[Tt(t)];u||p.push(Tt(c));const h=[],d=[];e.inputs.forEach((e=>{r.registerBoundInput(e)||(0===e.type&&e.i18n?d.push(e):h.push(e))}));const m=this.getAttributeExpressions(e.name,o,h,e.outputs,r,[],d);p.push(this.addAttrsToConsts(m));const g=this.prepareRefsArray(e.references);p.push(this.addToConsts(g));const v=this._namespace,f=this.getNamespaceInstruction(l);f!==v&&this.addNamespaceInstruction(f,e),this.i18n&&this.i18n.appendElement(e.i18n,t);const y=!a&&this.i18n?!Xl(e.children):e.children.length>0,x=!r.hasBindingsWithPipes&&0===e.outputs.length&&0===d.length&&!y,w=!x&&Xl(e.children);if(x)this.creationInstruction(e.sourceSpan,u?qt.elementContainer:qt.element,Nn(p));else{if(this.creationInstruction(e.startSourceSpan,u?qt.elementContainerStart:qt.elementStart,Nn(p)),i&&this.creationInstruction(e.startSourceSpan,qt.disableBindings),d.length>0&&this.i18nAttributesInstruction(t,d,e.startSourceSpan??e.sourceSpan),e.outputs.length>0)for(const s of e.outputs)this.creationInstruction(s.sourceSpan,qt.listener,this.prepareListenerParameter(e.name,s,t));a&&this.i18nStart(e.startSourceSpan,e.i18n,w)}const S=r.buildUpdateLevelInstructions(this._valueConverter),E=S.length-1;for(let e=0;e<=E;e++){const s=S[e];this._bindingSlots+=this.processStylingUpdateInstruction(t,s)}const _=Tt(void 0),b=[],T=[];h.forEach((n=>{const r=n.type;if(4===r){const e=n.value.visit(this._valueConverter),t=!(e instanceof Jr)||!!e.value;this.allocateBindingSlots(e),b.push({span:n.sourceSpan,paramsOrFn:Jl((()=>t?this.convertPropertyBinding(e):_),Jt(n.name))})}else{if(n.i18n)return;const i=n.value.visit(this._valueConverter);if(void 0!==i){const a=[],[o,l]=s(n.name),c=1===r;let u=Gl(n.securityContext,c);if(u||"iframe"===e.name.toLowerCase()&&qi(n.name)&&(u=vt(qt.validateIframeAttribute)),u&&a.push(u),o){const e=Tt(o);u?a.push(e):a.push(Tt(null),e)}if(this.allocateBindingSlots(i),0===r)i instanceof ti?this.interpolatedUpdateInstruction(jl(i),t,l,n,i,a):b.push({span:n.sourceSpan,paramsOrFn:Jl((()=>this.convertPropertyBinding(i)),l,a)});else if(1===r)if(i instanceof ti&&Ln(i)>1)this.interpolatedUpdateInstruction(function(e){switch(Ln(e)){case 3:return qt.attributeInterpolate1;case 5:return qt.attributeInterpolate2;case 7:return qt.attributeInterpolate3;case 9:return qt.attributeInterpolate4;case 11:return qt.attributeInterpolate5;case 13:return qt.attributeInterpolate6;case 15:return qt.attributeInterpolate7;case 17:return qt.attributeInterpolate8;default:return qt.attributeInterpolateV}}(i),t,l,n,i,a);else{const e=i instanceof ti?i.expressions[0]:i;T.push({span:n.sourceSpan,paramsOrFn:Jl((()=>this.convertPropertyBinding(e)),l,a)})}else this.updateInstructionWithAdvance(t,n.sourceSpan,qt.classProp,(()=>[Tt(t),Tt(l),this.convertPropertyBinding(i),...a]))}}}));for(const e of b)this.updateInstructionWithAdvance(t,e.span,qt.property,e.paramsOrFn);for(const e of T)this.updateInstructionWithAdvance(t,e.span,qt.attribute,e.paramsOrFn);if(Ts(this,e.children),!a&&this.i18n&&this.i18n.appendElement(e.i18n,t,!0),!x){const t=e.endSourceSpan??e.sourceSpan;a&&this.i18nEnd(t,w),i&&this.creationInstruction(t,qt.enableBindings),this.creationInstruction(t,u?qt.elementContainerEnd:qt.elementEnd)}}visitTemplate(e){const t="ng-template",n=this.allocateDataSlot();this.i18n&&this.i18n.appendTemplate(e.i18n,n);const r=e.tagName?s(e.tagName)[1]:e.tagName,i=`${this.contextName}${e.tagName?"_"+gr(e.tagName):""}_${n}`,a=`${i}_Template`,o=[Tt(n),gt(a),Tt(r)],l=this.getAttributeExpressions(t,e.attributes,e.inputs,e.outputs,void 0,e.templateAttrs);if(o.push(this.addAttrsToConsts(l)),e.references&&e.references.length){const t=this.prepareRefsArray(e.references);o.push(this.addToConsts(t)),o.push(vt(qt.templateRefExtractor))}const c=new Ol(this.constantPool,this._bindingScope,this.level+1,i,this.i18n,n,a,this._namespace,this.fileBasedI18nSuffix,this.i18nUseExternalIds,this._constants);if(this._nestedTemplateFns.push((()=>{const t=c.buildTemplateFunction(e.children,e.variables,this._ngContentReservedSlots.length+this._ngContentSelectorsOffset,e.i18n);this.constantPool.statements.push(t.toDeclStmt(a)),c._ngContentReservedSlots.length&&this._ngContentReservedSlots.push(...c._ngContentReservedSlots)})),this.creationInstruction(e.sourceSpan,qt.templateCreate,(()=>(o.splice(2,0,Tt(c.getConstCount()),Tt(c.getVarCount())),Nn(o)))),this.templatePropertyBindings(n,e.templateAttrs),r===t){const[t,s]=function(e,t){const s=[],n=[];for(const r of e)(t(r)?s:n).push(r);return[s,n]}(e.inputs,on);t.length>0&&this.i18nAttributesInstruction(n,t,e.startSourceSpan??e.sourceSpan),s.length>0&&this.templatePropertyBindings(n,s);for(const t of e.outputs)this.creationInstruction(t.sourceSpan,qt.listener,this.prepareListenerParameter("ng_template",t,n))}}visitBoundText(e){if(this.i18n){const t=e.value.visit(this._valueConverter);return this.allocateBindingSlots(t),void(t instanceof ti&&(this.i18n.appendBoundText(e.i18n),this.i18nAppendBindings(t.expressions)))}const t=this.allocateDataSlot();this.creationInstruction(e.sourceSpan,qt.text,[Tt(t)]);const s=e.value.visit(this._valueConverter);this.allocateBindingSlots(s),s instanceof ti?this.updateInstructionWithAdvance(t,e.sourceSpan,function(e){switch(Ln(e)){case 1:return qt.textInterpolate;case 3:return qt.textInterpolate1;case 5:return qt.textInterpolate2;case 7:return qt.textInterpolate3;case 9:return qt.textInterpolate4;case 11:return qt.textInterpolate5;case 13:return qt.textInterpolate6;case 15:return qt.textInterpolate7;case 17:return qt.textInterpolate8;default:return qt.textInterpolateV}}(s),(()=>this.getUpdateInstructionArguments(s))):N("Text nodes should be interpolated and never bound directly.")}visitText(e){this.i18n||this.creationInstruction(e.sourceSpan,qt.text,[Tt(this.allocateDataSlot()),Tt(e.value)])}visitIcu(e){let t=!1;this.i18n||(t=!0,this.i18nStart(null,e.i18n,!0));const s=this.i18n,n=this.i18nBindProps(e.vars),r=this.i18nBindProps(e.placeholders),i=e.i18n,a=e=>{const t=mn({...n,...r},!1);return bn(null,qt.i18nPostprocess,[e,$o(t,!0)])};if(an(s.meta))this.i18nTranslate(i,{},s.ref,a);else{const e=this.i18nTranslate(i,{},void 0,a);s.appendIcu(ln(i).name,e)}return t&&this.i18nEnd(null,!0),null}allocateDataSlot(){return this._dataIndex++}getConstCount(){return this._dataIndex}getVarCount(){return this._pureFunctionSlots}getConsts(){return this._constants}getNgContentSelectors(){return this._ngContentReservedSlots.length?this.constantPool.getConstLiteral(In(this._ngContentReservedSlots),!0):null}bindingContext(){return""+this._bindingContext++}templatePropertyBindings(e,t){const s=[];for(const n of t){if(!(n instanceof fs))continue;const t=n.value.visit(this._valueConverter);if(void 0!==t)if(this.allocateBindingSlots(t),t instanceof ti){const s=[];this.interpolatedUpdateInstruction(jl(t),e,n.name,n,t,s)}else s.push({span:n.sourceSpan,paramsOrFn:Jl((()=>this.convertPropertyBinding(t)),n.name)})}for(const t of s)this.updateInstructionWithAdvance(e,t.span,qt.property,t.paramsOrFn)}instructionFn(e,t,s,n,r=!1){e[r?"unshift":"push"]({span:t,reference:s,paramsOrFn:n})}processStylingUpdateInstruction(e,t){let s=0;if(t)for(const n of t.calls)s+=n.allocateBindingSlots,this.updateInstructionWithAdvance(e,n.sourceSpan,t.reference,(()=>n.params((e=>n.supportsInterpolation&&e instanceof ti?this.getUpdateInstructionArguments(e):this.convertPropertyBinding(e)))));return s}creationInstruction(e,t,s,n){this.instructionFn(this._creationCodeFns,e,t,s||[],n)}updateInstructionWithAdvance(e,t,s,n){this.addAdvanceInstructionIfNecessary(e,t),this.updateInstruction(t,s,n)}updateInstruction(e,t,s){this.instructionFn(this._updateCodeFns,e,t,s||[])}addAdvanceInstructionIfNecessary(e,t){if(e!==this._currentIndex){const s=e-this._currentIndex;if(s<1)throw new Error("advance instruction can only go forwards");this.instructionFn(this._updateCodeFns,t,qt.advance,[Tt(s)]),this._currentIndex=e}}allocatePureFunctionSlots(e){const t=this._pureFunctionSlots;return this._pureFunctionSlots+=e,t}allocateBindingSlots(e){this._bindingSlots+=e instanceof ti?e.expressions.length:1}getImplicitReceiverExpr(){return this._implicitReceiverExpr?this._implicitReceiverExpr:this._implicitReceiverExpr=0===this.level?gt(wn):this._bindingScope.getOrCreateSharedContextVar(0)}convertPropertyBinding(e){const t=Ei(this,this.getImplicitReceiverExpr(),e,this.bindingContext()),s=t.currValExpr;return this._tempVariables.push(...t.stmts),s}getUpdateInstructionArguments(e){const{args:t,stmts:s}=function(e,t,s,n){const r=new Ni(e,t,n,!0),i=r.visitInterpolation(s,Nr.Expression);return r.usesImplicitReceiver&&e.notifyImplicitReceiverUse(),{stmts:_i(r,n),args:i.args}}(this,this.getImplicitReceiverExpr(),e,this.bindingContext());return this._tempVariables.push(...s),t}getAttributeExpressions(e,t,s,n,r,i=[],a=[]){const o=new Set,l=[];let c;for(const s of t)if("ngProjectAs"===s.name&&(c=s),s.i18n){const{i18nVarRefsCache:e}=this._constants;let t;e.has(s.i18n)?t=e.get(s.i18n):(t=this.i18nTranslate(s.i18n),e.set(s.i18n,t)),l.push(Tt(s.name),t)}else l.push(...Vl(s.name),Yl(e,s));function u(e,t){"string"==typeof e?o.has(e)||(l.push(...Vl(e)),void 0!==t&&l.push(t),o.add(e)):l.push(Tt(e))}if(c&&l.push(...function(e){const t=T(e.value)[0];return[Tt(5),In(t)]}(c)),r&&r.populateInitialStylingAttrs(l),s.length||n.length){const e=l.length;for(let e=0;eu(e.name)))),a.length&&(l.push(Tt(6)),a.forEach((e=>u(e.name)))),l}addToConsts(e){if(It(e))return nt;const t=this._constants.constExpressions;for(let s=0;s0?this.addToConsts(xt(e)):nt}prepareRefsArray(e){if(!e||0===e.length)return nt;return In(e.flatMap((e=>{const t=this.allocateDataSlot(),s=this._bindingScope.freshReferenceName(),n=this.level,r=gt(s);return this._bindingScope.set(n,e.name,r,0,((e,s)=>{const n=s>0?[ql(s).toStmt()]:[],i=r.set(vt(qt.reference).callFn([Tt(t)]));return n.concat(i.toConstDecl())}),!0),[e.name,e.value]})))}prepareListenerParameter(e,t,s){return()=>{const n=t.name,r=1===t.type?es(n,t.phase):gr(n),i=`${this.templateName}_${e}_${r}_${s}_listener`,a=this._bindingScope.nestedScope(this._bindingScope.bindingLevel,Pl);return Rl(t,i,a)}}}class $l extends mi{constructor(e,t,s,n){super(),this.constantPool=e,this.allocateSlot=t,this.allocatePureFunctionSlots=s,this.definePipe=n,this._pipeBindExprs=[]}visitPipe(e,t){const s=this.allocateSlot(),n=`PIPE:${s}`,r=this.allocatePureFunctionSlots(2+e.args.length),i=new Wr(e.span,e.sourceSpan,e.nameSpan,new Vr(e.span,e.sourceSpan),n),{identifier:a,isVarLength:o}=function(e){const t=Dl[e.length];return{identifier:t||qt.pipeBindV,isVarLength:!t}}(e.args);this.definePipe(e.name,n,s,vt(a));const l=[e.exp,...e.args],c=o?this.visitAll([new Zr(e.span,e.sourceSpan,l)]):this.visitAll(l),u=new ai(e.span,e.sourceSpan,i,[new Jr(e.span,e.sourceSpan,s),new Jr(e.span,e.sourceSpan,r),...c],null);return this._pipeBindExprs.push(u),u}updatePipeSlotOffsets(e){this._pipeBindExprs.forEach((t=>{t.args[1].value+=e}))}visitLiteralArray(e,t){return new Ri(e.span,e.sourceSpan,this.visitAll(e.expressions),(e=>{const t=xt(e);return Fl(this.constantPool,t,this.allocatePureFunctionSlots)}))}visitLiteralMap(e,t){return new Ri(e.span,e.sourceSpan,this.visitAll(e.values),(t=>{const s=wt(t.map(((t,s)=>({key:e.keys[s].key,value:t,quoted:e.keys[s].quoted}))));return Fl(this.constantPool,s,this.allocatePureFunctionSlots)}))}}const Dl=[qt.pipeBind1,qt.pipeBind2,qt.pipeBind3,qt.pipeBind4];const Bl=[qt.pureFunction0,qt.pureFunction1,qt.pureFunction2,qt.pureFunction3,qt.pureFunction4,qt.pureFunction5,qt.pureFunction6,qt.pureFunction7,qt.pureFunction8];function ql(e){return vt(qt.nextContext).callFn(e>1?[Tt(e)]:[])}function Fl(e,t,s){const{literalFactory:n,literalFactoryArguments:r}=e.getLiteralFactory(t),i=s(1+r.length),{identifier:a,isVarLength:o}=function(e){const t=Bl[e.length];return{identifier:t||qt.pureFunctionV,isVarLength:!t}}(r),l=[Tt(i),n];return o?l.push(xt(r)):l.push(...r),vt(a).callFn(l)}function Vl(e){const[t,n]=s(e),r=Tt(n);return t?[Tt(0),Tt(t),r]:[r]}const Ul="$$shared_ctx$$";class Hl{constructor(e=0,t=null,s){if(this.bindingLevel=e,this.parent=t,this.globals=s,this.map=new Map,this.referenceNameIndex=0,this.restoreViewVariable=null,this.usesRestoredViewContext=!1,void 0!==s)for(const e of s)this.set(0,e,gt(e))}static createRootScope(){return new Hl}get(e){let t=this;for(;t;){let s=t.map.get(e);if(null!=s)return t!==this&&(s={retrievalLevel:s.retrievalLevel,lhs:s.lhs,declareLocalCallback:s.declareLocalCallback,declare:!1,priority:s.priority},this.map.set(e,s),this.maybeGenerateSharedContextVar(s),this.maybeRestoreView()),s.declareLocalCallback&&!s.declare&&(s.declare=!0),s.lhs;t=t.parent}return 0===this.bindingLevel?null:this.getComponentProperty(e)}set(e,t,s,n=0,r,i){if(this.map.has(t)){if(i)return this;N(`The name ${t} is already defined in scope to be ${this.map.get(t)}`)}return this.map.set(t,{retrievalLevel:e,lhs:s,declare:!1,declareLocalCallback:r,priority:n}),this}getLocal(e){return this.get(e)}notifyImplicitReceiverUse(){0!==this.bindingLevel&&(this.map.get("$$shared_ctx$$0").declare=!0)}nestedScope(e,t){const s=new Hl(e,this,t);return e>0&&s.generateSharedContextVar(0),s}getOrCreateSharedContextVar(e){const t=Ul+e;return this.map.has(t)||this.generateSharedContextVar(e),this.map.get(t).lhs}getSharedContextName(e){const t=this.map.get(Ul+e);return t&&t.declare?t.lhs:null}maybeGenerateSharedContextVar(e){if(1===e.priority&&e.retrievalLevel[t.set(ql(s)).toConstDecl()],declare:!1,priority:2})}getComponentProperty(e){const t=this.map.get("$$shared_ctx$$0");return t.declare=!0,this.maybeRestoreView(),t.lhs.prop(e)}maybeRestoreView(){this.isListenerScope()&&(this.parent.restoreViewVariable||(this.parent.restoreViewVariable=gt(this.parent.freshReferenceName())),this.restoreViewVariable=this.parent.restoreViewVariable)}restoreViewStatement(){if(this.restoreViewVariable){const e=bn(null,qt.restoreView,[this.restoreViewVariable]);return this.usesRestoredViewContext?gt(En).set(e).toConstDecl():e.toStmt()}return null}viewSnapshotStatements(){return this.restoreViewVariable?[this.restoreViewVariable.set(bn(null,qt.getCurrentView,[])).toConstDecl()]:[]}isListenerScope(){return this.parent&&this.parent.bindingLevel===this.bindingLevel}variableDeclarations(){let e=0;return Array.from(this.map.values()).filter((e=>e.declare)).sort(((e,t)=>t.retrievalLevel-e.retrievalLevel||t.priority-e.priority)).reduce(((t,s)=>{const n=this.bindingLevel-s.retrievalLevel,r=s.declareLocalCallback(this,n-e);return e=n,t.concat(r)}),[])}freshReferenceName(){let e=this;for(;e.parent;)e=e.parent;return"_r"+e.referenceNameIndex++}hasRestoreViewVariable(){return!!this.restoreViewVariable}notifyRestoredViewContextUse(){this.usesRestoredViewContext=!0}}function jl(e){switch(Ln(e)){case 1:return qt.propertyInterpolate;case 3:return qt.propertyInterpolate1;case 5:return qt.propertyInterpolate2;case 7:return qt.propertyInterpolate3;case 9:return qt.propertyInterpolate4;case 11:return qt.propertyInterpolate5;case 13:return qt.propertyInterpolate6;case 15:return qt.propertyInterpolate7;case 17:return qt.propertyInterpolate8;default:return qt.propertyInterpolateV}}function Wl(e,t,s={}){const{interpolationConfig:n,preserveWhitespaces:r,enableI18nLegacyMessageIdFormat:i}=s,a=Kl(n),o=(new Io).parse(e,t,{leadingTriviaChars:Ll,...s,tokenizeExpansionForms:!0});if(!s.alwaysAttemptHtmlToR3AstConversion&&o.errors&&o.errors.length>0){const e={interpolationConfig:n,preserveWhitespaces:r,errors:o.errors,nodes:[],styleUrls:[],styles:[],ngContentSelectors:[]};return s.collectCommentNodes&&(e.commentNodes=[]),e}let l=o.rootNodes;const c=new bl(n,!r,i),u=c.visitAllWithErrors(l);if(!s.alwaysAttemptHtmlToR3AstConversion&&u.errors&&u.errors.length>0){const e={interpolationConfig:n,preserveWhitespaces:r,errors:u.errors,nodes:[],styleUrls:[],styles:[],ngContentSelectors:[]};return s.collectCommentNodes&&(e.commentNodes=[]),e}l=u.rootNodes,r||(l=to(new Ro,l),c.hasI18nMeta&&(l=to(new bl(n,!1),l)));const{nodes:p,errors:h,styleUrls:d,styles:m,ngContentSelectors:g,commentNodes:v}=function(e,t,s){const n=new nl(t,s),r={nodes:to(n,e),errors:t.errors.concat(n.errors),styleUrls:n.styleUrls,styles:n.styles,ngContentSelectors:n.ngContentSelectors};return s.collectCommentNodes&&(r.commentNodes=n.commentNodes),r}(l,a,{collectCommentNodes:!!s.collectCommentNodes});h.push(...o.errors,...u.errors);const f={interpolationConfig:n,preserveWhitespaces:r,errors:h.length>0?h:null,nodes:p,styleUrls:d,styles:m,ngContentSelectors:g};return s.collectCommentNodes&&(f.commentNodes=v),f}const zl=new Vo;function Kl(e=Fn){return new Wo(new ja(new La),e,zl,[])}function Gl(e,t){switch(e){case E.HTML:return vt(qt.sanitizeHtml);case E.SCRIPT:return vt(qt.sanitizeScript);case E.STYLE:return t?vt(qt.sanitizeStyle):null;case E.URL:return vt(qt.sanitizeUrl);case E.RESOURCE_URL:return vt(qt.sanitizeResourceUrl);default:return null}}function Yl(e,t){const s=In(t.value);if(!Ho(e,t.name))return s;switch(zl.securityContext(e,t.name,!0)){case E.HTML:return bt(vt(qt.trustConstantHtml),new Me([new Re(t.value)],[]),void 0,t.valueSpan);case E.RESOURCE_URL:return bt(vt(qt.trustConstantResourceUrl),new Me([new Re(t.value)],[]),void 0,t.valueSpan);default:return s}}function Ql(e){return e instanceof ms||e instanceof gs||e instanceof bs}function Xl(e){return e.every(Ql)}function Jl(e,t,s){return()=>{const n=e(),r=Array.isArray(n)?n:[n];return s&&r.push(...s),t&&r.unshift(Tt(t)),r}}const Zl="ngI18nClosureMode";function ec(){return yt(gt(Zl)).notIdentical(Tt("undefined",me)).and(gt(Zl))}const tc=/attr\.([^\]]+)/;function sc(e,t,s){const n=new An,r=T(e.selector);return n.set("type",e.internalType),r.length>0&&n.set("selectors",In(r)),e.queries.length>0&&n.set("contentQueries",function(e,t,s){const n=[],r=[],i=Tn(r,xn);for(const s of e){n.push(vt(qt.contentQuery).callFn([gt("dirIndex"),...oc(s,t)]).toStmt());const e=i(),a=vt(qt.loadQuery).callFn([]),o=vt(qt.queryRefresh).callFn([e.set(a)]),l=gt(wn).prop(s.propertyName).set(s.first?e.prop("first"):e);r.push(o.and(l).toStmt())}const a=s?`${s}_ContentQueries`:null;return Et([new ze(Sn,de),new ze(wn,null),new ze("dirIndex",null)],[Ml(1,n),Ml(2,r)],ue,null,a)}(e.queries,t,e.name)),e.viewQueries.length&&n.set("viewQuery",function(e,t,s){const n=[],r=[],i=Tn(r,xn);e.forEach((e=>{const s=vt(qt.viewQuery).callFn(oc(e,t));n.push(s.toStmt());const a=i(),o=vt(qt.loadQuery).callFn([]),l=vt(qt.queryRefresh).callFn([a.set(o)]),c=gt(wn).prop(e.propertyName).set(e.first?a.prop("first"):a);r.push(l.and(c).toStmt())}));const a=s?`${s}_Query`:null;return Et([new ze(Sn,de),new ze(wn,null)],[Ml(1,n),Ml(2,r)],ue,null,a)}(e.viewQueries,t,e.name)),n.set("hostBindings",function(e,t,s,n,r,i,a){const o=gt(wn),l=new Ta(o),{styleAttr:c,classAttr:u}=e.specialAttributes;void 0!==c&&l.registerStyleAttr(c);void 0!==u&&l.registerClassAttr(u);const p=[],h=[],d=[],m=t,g=s.createDirectiveHostEventAsts(e.listeners,m);g&&g.length&&p.push(...function(e,t){const s=[],n=[],r=[];for(const r of e){let e=r.name&&gr(r.name);const i=1===r.type?es(e,r.targetOrPhase):e,a=t&&e?`${t}_${i}_HostBindingHandler`:null,o=Rl(ys.fromParsedEvent(r),a);1==r.type?n.push(o):s.push(o)}for(const e of n)r.push({reference:qt.syntheticHostListener,paramsOrFn:e,span:null});for(const e of s)r.push({reference:qt.listener,paramsOrFn:e,span:null});return r}(g,i));const v=s.createBoundHostProperties(e.properties,m),f=[];let y,x=0;v&&v.forEach((e=>{l.registerInputBasedOnName(e.name,e.expression,m)?x+=2:(f.push(e),x++)}));const w=()=>{if(!y){y=new $l(n,(()=>N("Unexpected node")),(e=>{const t=x;return x+=e,t}),(()=>N("Unexpected pipe")))}return y},S=[],_=[],b=[];for(const e of f){const t=e.expression.visit(w()),n=dc(o,t),{bindingName:i,instruction:a,isAttribute:l}=gc(e),c=s.calcPossibleSecurityContexts(r,i,l).filter((e=>e!==E.NONE));let u=null;c.length&&(u=2===c.length&&c.indexOf(E.URL)>-1&&c.indexOf(E.RESOURCE_URL)>-1?vt(qt.sanitizeUrlOrResourceUrl):Gl(c[0],l));const p=[Tt(i),n.currValExpr];u?p.push(u):qi(i)&&p.push(vt(qt.validateIframeAttribute)),d.push(...n.stmts),a===qt.hostProperty?S.push(p):a===qt.attribute?_.push(p):a===qt.syntheticHostProperty?b.push(p):h.push({reference:a,paramsOrFn:p,span:null})}for(const e of S)h.push({reference:qt.hostProperty,paramsOrFn:e,span:null});for(const e of _)h.push({reference:qt.attribute,paramsOrFn:e,span:null});for(const e of b)h.push({reference:qt.syntheticHostProperty,paramsOrFn:e,span:null});const T=function(e){const t=[];for(let s of Object.getOwnPropertyNames(e)){const n=e[s];t.push(Tt(s),n)}return t}(e.attributes);l.assignHostAttrs(T,a),l.hasBindings&&l.buildUpdateLevelInstructions(w()).forEach((e=>{for(const t of e.calls)x+=Math.max(t.allocateBindingSlots-2,0),h.push({reference:e.reference,paramsOrFn:mc(t,o,dc),span:null})}));x&&a.set("hostVars",Tt(x));if(p.length>0||h.length>0){const e=i?`${i}_HostBindings`:null,t=[];return p.length>0&&t.push(Ml(1,Mn(p))),h.length>0&&t.push(Ml(2,d.concat(Mn(h)))),Et([new ze(Sn,de),new ze(wn,null)],t,ue,null,e)}return null}(e.host,e.typeSourceSpan,s,t,e.selector||"",e.name,n)),n.set("inputs",kn(e.inputs,!0)),n.set("outputs",kn(e.outputs)),null!==e.exportAs&&n.set("exportAs",xt(e.exportAs.map((e=>Tt(e))))),e.isStandalone&&n.set("standalone",Tt(!0)),n}function nc(e,t){const s=[],n=t.providers,r=t.viewProviders;if(n||r){const e=[n||new Je([])];r&&e.push(r),s.push(vt(qt.ProvidersFeature).callFn(e))}t.usesInheritance&&s.push(vt(qt.InheritDefinitionFeature)),t.fullInheritance&&s.push(vt(qt.CopyDefinitionFeature)),t.lifecycle.usesOnChanges&&s.push(vt(qt.NgOnChangesFeature)),t.hasOwnProperty("template")&&t.isStandalone&&s.push(vt(qt.StandaloneFeature)),t.hostDirectives?.length&&s.push(vt(qt.HostDirectivesFeature).callFn([wc(t.hostDirectives)])),s.length&&e.set("features",xt(s))}function rc(e,t,s){const n=sc(e,t,s);nc(n,e);return{expression:vt(qt.defineDirective).callFn([n.toLiteralMap()],void 0,!0),type:hc(e),statements:[]}}function ic(t,s,n){const r=sc(t,s,n);nc(r,t);const i=t.selector&&d.parse(t.selector),a=i&&i[0];if(a){const e=a.getAttrs();e.length&&r.set("attrs",s.getConstLiteral(xt(e.map((e=>Tt(null!=e?e:void 0)))),!0))}const o=t.name,l=o?`${o}_Template`:null,c=t.changeDetection,u=t.template,p=new Ol(s,Hl.createRootScope(),0,o,null,null,l,qt.namespaceHTML,t.relativeContextFilePath,t.i18nUseExternalIds),h=p.buildTemplateFunction(u.nodes,[]),m=p.getNgContentSelectors();m&&r.set("ngContentSelectors",m),r.set("decls",Tt(p.getConstCount())),r.set("vars",Tt(p.getVarCount()));const{constExpressions:g,prepareStatements:v}=p.getConsts();if(g.length>0){let e=xt(g);v.length>0&&(e=Et([],[...v,new pt(e)])),r.set("consts",e)}if(r.set("template",h),t.declarations.length>0&&r.set("dependencies",function(e,t){switch(t){case 0:return e;case 1:return Et([],[new pt(e)]);case 2:const t=e.prop("map").callFn([vt(qt.resolveForwardRef)]);return Et([],[new pt(t)])}}(xt(t.declarations.map((e=>e.type))),t.declarationListEmitMode)),null===t.encapsulation&&(t.encapsulation=e.ViewEncapsulation.Emulated),t.styles&&t.styles.length){const n=t.encapsulation==e.ViewEncapsulation.Emulated?function(e,t,s){const n=new Vi;return e.map((e=>n.shimCssText(e,t,s)))}(t.styles,"_ngcontent-%COMP%","_nghost-%COMP%"):t.styles,i=n.reduce(((e,t)=>(t.trim().length>0&&e.push(s.getConstLiteral(Tt(t))),e)),[]);i.length>0&&r.set("styles",xt(i))}else t.encapsulation===e.ViewEncapsulation.Emulated&&(t.encapsulation=e.ViewEncapsulation.None);t.encapsulation!==e.ViewEncapsulation.Emulated&&r.set("encapsulation",Tt(t.encapsulation)),null!==t.animations&&r.set("data",wt([{key:"animation",value:t.animations,quoted:!1}])),null!=c&&c!==e.ChangeDetectionStrategy.Default&&r.set("changeDetection",Tt(c));return{expression:vt(qt.defineComponent).callFn([r.toLiteralMap()],void 0,!0),type:ac(t),statements:[]}}function ac(e){const t=pc(e);return t.push(uc(e.template.ngContentSelectors)),t.push(ft(Tt(e.isStandalone))),t.push(xc(e)),ft(vt(qt.ComponentDeclaration,t))}function oc(e,t){const s=[Pn(e,t),Tt(lc(e))];return e.read&&s.push(e.read),s}function lc(e){return(e.descendants?1:0)|(e.static?2:0)|(e.emitDistinctChangesOnly?4:0)}function cc(e){return wt(Object.keys(e).map((t=>({key:t,value:Tt(Array.isArray(e[t])?e[t][0]:e[t]),quoted:!0}))))}function uc(e){return e.length>0?ft(xt(e.map((e=>Tt(e))))):ve}function pc(e){const t=null!==e.selector?e.selector.replace(/\n/g,""):null;return[Xt(e.type.type,e.typeArgumentCount),null!==t?(s=t,ft(Tt(s))):ve,null!==e.exportAs?uc(e.exportAs):ve,ft(cc(e.inputs)),ft(cc(e.outputs)),uc(e.queries.map((e=>e.propertyName)))];var s}function hc(e){const t=pc(e);return t.push(ve),t.push(ft(Tt(e.isStandalone))),t.push(xc(e)),ft(vt(qt.DirectiveDeclaration,t))}function dc(e,t){return Ei(null,e,t,"b")}function mc(e,t,s){return e.params((e=>s(t,e).currValExpr))}function gc(e){let t,s=e.name;const n=s.match(tc);return n?(s=n[1],t=qt.attribute):e.isAnimation?(s=Jt(s),t=qt.syntheticHostProperty):t=qt.hostProperty,{bindingName:s,instruction:t,isAttribute:!!n}}const vc=/^(?:\[([^\]]+)\])|(?:\(([^\)]+)\))$/;function fc(e){const t={},s={},n={},r={};for(const i of Object.keys(e)){const a=e[i],o=i.match(vc);if(null===o)switch(i){case"class":if("string"!=typeof a)throw new Error("Class binding must be string");r.classAttr=a;break;case"style":if("string"!=typeof a)throw new Error("Style binding must be string");r.styleAttr=a;break;default:t[i]="string"==typeof a?Tt(a):a}else if(null!=o[1]){if("string"!=typeof a)throw new Error("Property binding must be string");n[o[1]]=a}else if(null!=o[2]){if("string"!=typeof a)throw new Error("Event binding must be string");s[o[2]]=a}}return{attributes:t,listeners:s,properties:n,specialAttributes:r}}function yc(e,t){const s=Kl();return s.createDirectiveHostEventAsts(e.listeners,t),s.createBoundHostProperties(e.properties,t),s.errors}function xc(e){return e.hostDirectives?.length?ft(xt(e.hostDirectives.map((e=>wt([{key:"directive",value:yt(e.directive.type),quoted:!1},{key:"inputs",value:cc(e.inputs||{}),quoted:!1},{key:"outputs",value:cc(e.outputs||{}),quoted:!1}]))))):ve}function wc(e){const t=[];let s=!1;for(const n of e){if(n.inputs||n.outputs){const e=[{key:"directive",value:n.directive.type,quoted:!1}];if(n.inputs){const t=Sc(n.inputs);t&&e.push({key:"inputs",value:t,quoted:!1})}if(n.outputs){const t=Sc(n.outputs);t&&e.push({key:"outputs",value:t,quoted:!1})}t.push(wt(e))}else t.push(n.directive.type);n.isForwardReference&&(s=!0)}return s?new Ke([],[new pt(xt(t))]):xt(t)}function Sc(e){const t=[];for(const s in e)e.hasOwnProperty(s)&&t.push(Tt(s),Tt(e[s]));return t.length>0?xt(t):null}class Ec{}class _c{constructor(t=new Sr){this.jitEvaluator=t,this.FactoryTarget=e.FactoryTarget,this.ResourceLoader=Ec,this.elementSchemaRegistry=new Vo}compilePipe(e,t,s){const n=Rr({name:s.name,type:ns(s.type),internalType:new Te(s.type),typeArgumentCount:0,deps:null,pipeName:s.pipeName,pure:s.pure,isStandalone:s.isStandalone});return this.jitExpression(n.expression,e,t,[])}compilePipeDeclaration(e,t,s){const n=function(e){return{name:e.type.name,type:ns(e.type),internalType:new Te(e.type),typeArgumentCount:0,pipeName:e.name,deps:null,pure:e.pure??!0,isStandalone:e.isStandalone??!1}}(s),r=Rr(n);return this.jitExpression(r.expression,e,t,[])}compileInjectable(e,t,s){const{expression:n,statements:r}=Rn({name:s.name,type:ns(s.type),internalType:new Te(s.type),typeArgumentCount:s.typeArgumentCount,providedIn:Bc(s.providedIn),useClass:$c(s,"useClass"),useFactory:Dc(s,"useFactory"),useValue:$c(s,"useValue"),useExisting:$c(s,"useExisting"),deps:s.deps?.map(qc)},!0);return this.jitExpression(n,e,t,r)}compileInjectableDeclaration(e,t,s){const{expression:n,statements:r}=Rn({name:s.type.name,type:ns(s.type),internalType:new Te(s.type),typeArgumentCount:0,providedIn:Bc(s.providedIn),useClass:$c(s,"useClass"),useFactory:Dc(s,"useFactory"),useValue:$c(s,"useValue"),useExisting:$c(s,"useExisting"),deps:s.deps?.map(Fc)},!0);return this.jitExpression(n,e,t,r)}compileInjector(e,t,s){const n=_r({name:s.name,type:ns(s.type),internalType:new Te(s.type),providers:s.providers&&s.providers.length>0?new Te(s.providers):null,imports:s.imports.map((e=>new Te(e)))});return this.jitExpression(n.expression,e,t,[])}compileInjectorDeclaration(e,t,s){const n=function(e){return{name:e.type.name,type:ns(e.type),internalType:new Te(e.type),providers:void 0!==e.providers&&e.providers.length>0?new Te(e.providers):null,imports:void 0!==e.imports?e.imports.map((e=>new Te(e))):[]}}(s),r=_r(n);return this.jitExpression(r.expression,e,t,[])}compileNgModule(t,s,n){const r=Pr({type:ns(n.type),internalType:new Te(n.type),adjacentType:new Te(n.type),bootstrap:n.bootstrap.map(ns),declarations:n.declarations.map(ns),publicDeclarationTypes:null,imports:n.imports.map(ns),includeImportTypes:!0,exports:n.exports.map(ns),selectorScopeMode:e.R3SelectorScopeMode.Inline,containsForwardDecls:!1,schemas:n.schemas?n.schemas.map(ns):null,id:n.id?new Te(n.id):null});return this.jitExpression(r.expression,t,s,[])}compileNgModuleDeclaration(e,t,s){const n=function(e){const t=new An;return t.set("type",new Te(e.type)),void 0!==e.bootstrap&&t.set("bootstrap",new Te(e.bootstrap)),void 0!==e.declarations&&t.set("declarations",new Te(e.declarations)),void 0!==e.imports&&t.set("imports",new Te(e.imports)),void 0!==e.exports&&t.set("exports",new Te(e.exports)),void 0!==e.schemas&&t.set("schemas",new Te(e.schemas)),void 0!==e.id&&t.set("id",new Te(e.id)),vt(qt.defineNgModule).callFn([t.toLiteralMap()])}(s);return this.jitExpression(n,e,t,[])}compileDirective(e,t,s){const n=Ic(s);return this.compileDirectiveFromMeta(e,t,n)}compileDirectiveDeclaration(e,t,s){const n=kc(s,this.createParseSourceSpan("Directive",s.type.name,t));return this.compileDirectiveFromMeta(e,t,n)}compileDirectiveFromMeta(e,t,s){const n=new Mt,r=rc(s,n,Kl());return this.jitExpression(r.expression,e,t,n.statements)}compileComponent(e,t,s){const{template:n,interpolation:r}=Oc(s.template,s.name,t,s.preserveWhitespaces,s.interpolation),i={...s,...Ic(s),selector:s.selector||this.elementSchemaRegistry.getDefaultComponentElementName(),template:n,declarations:s.declarations.map(Lc),declarationListEmitMode:0,styles:[...s.styles,...n.styles],encapsulation:s.encapsulation,interpolation:r,changeDetection:s.changeDetection,animations:null!=s.animations?new Te(s.animations):null,viewProviders:null!=s.viewProviders?new Te(s.viewProviders):null,relativeContextFilePath:"",i18nUseExternalIds:!0},a=`ng:///${s.name}.js`;return this.compileComponentFromMeta(e,a,i)}compileComponentDeclaration(t,s,n){const r=function(t,s,n){const{template:r,interpolation:i}=Oc(t.template,t.type.name,n,t.preserveWhitespaces??!1,t.interpolation),a=[];if(t.dependencies)for(const e of t.dependencies)switch(e.kind){case"directive":case"component":a.push(Mc(e));break;case"pipe":a.push(Rc(e))}else(t.components||t.directives||t.pipes)&&(t.components&&a.push(...t.components.map((e=>Mc(e,!0)))),t.directives&&a.push(...t.directives.map((e=>Mc(e)))),t.pipes&&a.push(...function(t){if(!t)return[];return Object.keys(t).map((s=>({kind:e.R3TemplateDependencyKind.Pipe,name:s,type:new Te(t[s])})))}(t.pipes)));return{...kc(t,s),template:r,styles:t.styles??[],declarations:a,viewProviders:void 0!==t.viewProviders?new Te(t.viewProviders):null,animations:void 0!==t.animations?new Te(t.animations):null,changeDetection:t.changeDetection??e.ChangeDetectionStrategy.Default,encapsulation:t.encapsulation??e.ViewEncapsulation.Emulated,interpolation:i,declarationListEmitMode:2,relativeContextFilePath:"",i18nUseExternalIds:!0}}(n,this.createParseSourceSpan("Component",n.type.name,s),s);return this.compileComponentFromMeta(t,s,r)}compileComponentFromMeta(e,t,s){const n=new Mt,r=ic(s,n,Kl(s.interpolation));return this.jitExpression(r.expression,e,t,n.statements)}compileFactory(e,t,s){const n=cs({name:s.name,type:ns(s.type),internalType:new Te(s.type),typeArgumentCount:s.typeArgumentCount,deps:(r=s.deps,null==r?null:r.map(qc)),target:s.target});var r;return this.jitExpression(n.expression,e,t,n.statements)}compileFactoryDeclaration(e,t,s){const n=cs({name:s.type.name,type:ns(s.type),internalType:new Te(s.type),typeArgumentCount:0,deps:Array.isArray(s.deps)?s.deps.map(Fc):s.deps,target:s.target});return this.jitExpression(n.expression,e,t,n.statements)}createParseSourceSpan(e,t,s){return hr(e,t,s)}jitExpression(t,s,n,r){const i=[...r,new lt("$def",t,void 0,e.StmtModifier.Exported)];return this.jitEvaluator.evaluateStatements(n,i,new Tr(s),!0).$def}}function bc(e){return{...e,predicate:Cc(e.predicate),read:e.read?new Te(e.read):null,static:e.static,emitDistinctChangesOnly:e.emitDistinctChangesOnly}}function Tc(e){return{propertyName:e.propertyName,first:e.first??!1,predicate:Cc(e.predicate),descendants:e.descendants??!1,read:e.read?new Te(e.read):null,static:e.static??!1,emitDistinctChangesOnly:e.emitDistinctChangesOnly??!0}}function Cc(e){return Array.isArray(e)?e:is(new Te(e),1)}function Ic(e){const t=Wc(e.inputs||[]),s=Wc(e.outputs||[]),n=e.propMetadata,r={},i={};for(const e in n)n.hasOwnProperty(e)&&n[e].forEach((t=>{"Input"===t.ngMetadataName?r[e]=t.bindingPropertyName?[t.bindingPropertyName,e]:e:jc(t)&&(i[e]=t.bindingPropertyName||e)}));return{...e,typeArgumentCount:0,typeSourceSpan:e.typeSourceSpan,type:ns(e.type),internalType:new Te(e.type),deps:null,host:Uc(e.propMetadata,e.typeSourceSpan,e.host),inputs:{...t,...r},outputs:{...s,...i},queries:e.queries.map(bc),providers:null!=e.providers?new Te(e.providers):null,viewQueries:e.viewQueries.map(bc),fullInheritance:!1,hostDirectives:Pc(e)}}function kc(e,t){return{name:e.type.name,type:ns(e.type),typeSourceSpan:t,internalType:new Te(e.type),selector:e.selector??null,inputs:e.inputs??{},outputs:e.outputs??{},host:Nc(e.host),queries:(e.queries??[]).map(Tc),viewQueries:(e.viewQueries??[]).map(Tc),providers:void 0!==e.providers?new Te(e.providers):null,exportAs:e.exportAs??null,usesInheritance:e.usesInheritance??!1,lifecycle:{usesOnChanges:e.usesOnChanges??!1},deps:null,typeArgumentCount:0,fullInheritance:!1,isStandalone:e.isStandalone??!1,hostDirectives:Pc(e)}}function Nc(e={}){return{attributes:Ac(e.attributes??{}),listeners:e.listeners??{},properties:e.properties??{},specialAttributes:{classAttr:e.classAttribute,styleAttr:e.styleAttribute}}}function Pc(e){return e.hostDirectives?.length?e.hostDirectives.map((e=>"function"==typeof e?{directive:ns(e),inputs:null,outputs:null,isForwardReference:!1}:{directive:ns(e.directive),isForwardReference:!1,inputs:e.inputs?Wc(e.inputs):null,outputs:e.outputs?Wc(e.outputs):null})):null}function Ac(e){const t={};for(const s of Object.keys(e))t[s]=new Te(e[s]);return t}function Lc(e){return{...e,type:new Te(e.type)}}function Mc(t,s=null){return{kind:e.R3TemplateDependencyKind.Directive,isComponent:s||"component"===t.kind,selector:t.selector,type:new Te(t.type),inputs:t.inputs??[],outputs:t.outputs??[],exportAs:t.exportAs??null}}function Rc(t){return{kind:e.R3TemplateDependencyKind.Pipe,name:t.name,type:new Te(t.type)}}function Oc(e,t,s,n,r){const i=r?qn.fromArray(r):Fn,a=Wl(e,s,{preserveWhitespaces:n,interpolationConfig:i});if(null!==a.errors){const e=a.errors.map((e=>e.toString())).join(", ");throw new Error(`Errors during JIT compilation of template for ${t}: ${e}`)}return{template:a,interpolation:i}}function $c(e,t){return e.hasOwnProperty(t)?is(new Te(e[t]),0):void 0}function Dc(e,t){return e.hasOwnProperty(t)?new Te(e[t]):void 0}function Bc(e){return is("function"==typeof e?new Te(e):new Le(e??null),0)}function qc(e){const t=null!=e.attribute,s=null===e.token?null:new Te(e.token);return Vc(t?new Te(e.attribute):s,t,e.host,e.optional,e.self,e.skipSelf)}function Fc(e){const t=e.attribute??!1;return Vc(null===e.token?null:new Te(e.token),t,e.host??!1,e.optional??!1,e.self??!1,e.skipSelf??!1)}function Vc(e,t,s,n,r,i){return{token:e,attributeNameType:t?Tt("unknown"):null,host:s,optional:n,self:r,skipSelf:i}}function Uc(e,t,s){const n=fc(s||{}),r=yc(n,t);if(r.length)throw new Error(r.map((e=>e.msg)).join("\n"));for(const t in e)e.hasOwnProperty(t)&&e[t].forEach((e=>{"HostBinding"===e.ngMetadataName?n.properties[e.hostPropertyName||t]=Zt("this",t):Hc(e)&&(n.listeners[e.eventName||t]=`${t}(${(e.args||[]).join(",")})`)}));return n}function Hc(e){return"HostListener"===e.ngMetadataName}function jc(e){return"Output"===e.ngMetadataName}function Wc(e){return e.reduce(((e,t)=>{const[s,n]=t.split(":",2).map((e=>e.trim()));return e[s]=n||s,e}),{})}function zc(e){(e.ng||(e.ng={})).ɵcompilerFacade=new _c}const Kc=new L("15.0.4");function Gc(e,t=!1){return null===e?t:e}const Yc="i18n",Qc="i18n-",Xc=/^i18n:?/;let Jc=!1;class Zc{constructor(e,t){this.messages=e,this.errors=t}}var eu;!function(e){e[e.Extract=0]="Extract",e[e.Merge=1]="Merge"}(eu||(eu={}));class tu{constructor(e,t){this._implicitTags=e,this._implicitAttrs=t}extract(e,t){return this._init(eu.Extract,t),e.forEach((e=>e.visit(this,null))),this._inI18nBlock&&this._reportError(e[e.length-1],"Unclosed block"),new Zc(this._messages,this._errors)}merge(e,t,s){this._init(eu.Merge,s),this._translations=t;const n=new Za("wrapper",[],e,void 0,void 0,void 0).visit(this,null);return this._inI18nBlock&&this._reportError(e[e.length-1],"Unclosed block"),new Eo(n.children,this._errors)}visitExpansionCase(e,t){const s=to(this,e.expression,t);if(this._mode===eu.Merge)return new Xa(e.value,s,e.sourceSpan,e.valueSourceSpan,e.expSourceSpan)}visitExpansion(e,t){this._mayBeAddBlockChildren(e);const s=this._inIcu;this._inIcu||(this._isInTranslatableSection&&this._addMessage([e]),this._inIcu=!0);const n=to(this,e.cases,t);return this._mode===eu.Merge&&(e=new Qa(e.switchValue,e.type,n,e.sourceSpan,e.switchValueSourceSpan)),this._inIcu=s,e}visitComment(e,t){const s=!!((n=e)instanceof eo&&n.value&&n.value.startsWith("i18n"));var n;if(s&&this._isInTranslatableSection)return void this._reportError(e,"Could not start a block inside a translatable section");const r=function(e){return!!(e instanceof eo&&e.value&&"/i18n"===e.value)}(e);if(!r||this._inI18nBlock){if(!this._inI18nNode&&!this._inIcu)if(this._inI18nBlock){if(r){if(this._depth==this._blockStartDepth){this._closeTranslatableSection(e,this._blockChildren),this._inI18nBlock=!1;const t=this._addMessage(this._blockChildren,this._blockMeaningAndDesc);return to(this,this._translateMessage(e,t))}return void this._reportError(e,"I18N blocks should not cross element boundaries")}}else if(s){if(!Jc&&console&&console.warn){Jc=!0;const t=e.sourceSpan.details?`, ${e.sourceSpan.details}`:"";console.warn(`I18n comments are deprecated, use an element instead (${e.sourceSpan.start}${t})`)}this._inI18nBlock=!0,this._blockStartDepth=this._depth,this._blockChildren=[],this._blockMeaningAndDesc=e.value.replace(Xc,"").trim(),this._openTranslatableSection(e)}}else this._reportError(e,"Trying to close an unopened block")}visitText(e,t){return this._isInTranslatableSection&&this._mayBeAddBlockChildren(e),e}visitElement(e,t){this._mayBeAddBlockChildren(e),this._depth++;const s=this._inI18nNode,n=this._inImplicitNode;let r,i=[];const a=e.attrs.find((e=>e.name===Yc))||null;const o=a?a.value:"",l=this._implicitTags.some((t=>e.name===t))&&!this._inIcu&&!this._isInTranslatableSection,c=!n&&l;if(this._inImplicitNode=n||l,this._isInTranslatableSection||this._inIcu)(a||c)&&this._reportError(e,"Could not mark an element as translatable inside a translatable section"),this._mode==eu.Extract&&to(this,e.children);else{if(a||c){this._inI18nNode=!0;const t=this._addMessage(e.children,o);r=this._translateMessage(e,t)}if(this._mode==eu.Extract){const t=a||c;t&&this._openTranslatableSection(e),to(this,e.children),t&&this._closeTranslatableSection(e,e.children)}}if(this._mode===eu.Merge){(r||e.children).forEach((e=>{const s=e.visit(this,t);s&&!this._isInTranslatableSection&&(i=i.concat(s))}))}if(this._visitAttributesOf(e),this._depth--,this._inI18nNode=s,this._inImplicitNode=n,this._mode===eu.Merge){const t=this._translateAttributes(e);return new Za(e.name,t,i,e.sourceSpan,e.startSourceSpan,e.endSourceSpan)}return null}visitAttribute(e,t){throw new Error("unreachable code")}_init(e,t){this._mode=e,this._inI18nBlock=!1,this._inI18nNode=!1,this._depth=0,this._inIcu=!1,this._msgCountAtSectionStart=void 0,this._errors=[],this._messages=[],this._inImplicitNode=!1,this._createI18nMessage=yl(t)}_visitAttributesOf(e){const t={},s=this._implicitAttrs[e.name]||[];e.attrs.filter((e=>e.name.startsWith(Qc))).forEach((e=>t[e.name.slice(Qc.length)]=e.value)),e.attrs.forEach((e=>{e.name in t?this._addMessage([e],t[e.name]):s.some((t=>e.name===t))&&this._addMessage([e])}))}_addMessage(e,t){if(0==e.length||1==e.length&&e[0]instanceof Ja&&!e[0].value)return null;const{meaning:s,description:n,id:r}=su(t),i=this._createI18nMessage(e,s,n,r);return this._messages.push(i),i}_translateMessage(e,t){if(t&&this._mode===eu.Merge){const s=this._translations.get(t);if(s)return s;this._reportError(e,`Translation unavailable for message id="${this._translations.digest(t)}"`)}return[]}_translateAttributes(e){const t=e.attrs,s={};t.forEach((e=>{e.name.startsWith(Qc)&&(s[e.name.slice(Qc.length)]=su(e.value))}));const n=[];return t.forEach((t=>{if(t.name!==Yc&&!t.name.startsWith(Qc))if(t.value&&""!=t.value&&s.hasOwnProperty(t.name)){const{meaning:r,description:i,id:a}=s[t.name],o=this._createI18nMessage([t],r,i,a),l=this._translations.get(o);if(l)if(0==l.length)n.push(new Ja(t.name,"",t.sourceSpan,void 0,void 0,void 0,void 0));else if(l[0]instanceof Ya){const e=l[0].value;n.push(new Ja(t.name,e,t.sourceSpan,void 0,void 0,void 0,void 0))}else this._reportError(e,`Unexpected translation for attribute "${t.name}" (id="${a||this._translations.digest(o)}")`);else this._reportError(e,`Translation unavailable for attribute "${t.name}" (id="${a||this._translations.digest(o)}")`)}else n.push(t)})),n}_mayBeAddBlockChildren(e){this._inI18nBlock&&!this._inIcu&&this._depth==this._blockStartDepth&&this._blockChildren.push(e)}_openTranslatableSection(e){this._isInTranslatableSection?this._reportError(e,"Unexpected section start"):this._msgCountAtSectionStart=this._messages.length}get _isInTranslatableSection(){return void 0!==this._msgCountAtSectionStart}_closeTranslatableSection(e,t){if(!this._isInTranslatableSection)return void this._reportError(e,"Unexpected section end");const s=this._msgCountAtSectionStart,n=t.reduce(((e,t)=>e+(t instanceof eo?0:1)),0);if(1==n)for(let e=this._messages.length-1;e>=s;e--){const t=this._messages[e].nodes;if(!(1==t.length&&t[0]instanceof Is)){this._messages.splice(e,1);break}}this._msgCountAtSectionStart=void 0}_reportError(e,t){this._errors.push(new El(e.sourceSpan,t))}}function su(e){if(!e)return{meaning:"",description:"",id:""};const t=e.indexOf("@@"),s=e.indexOf("|"),[n,r]=t>-1?[e.slice(0,t),e.slice(t+2)]:[e,""],[i,a]=s>-1?[n.slice(0,s),n.slice(s+1)]:["",n];return{meaning:i,description:a,id:r.trim()}}const nu=new class{constructor(){this.closedByParent=!1,this.isVoid=!1,this.ignoreFirstLf=!1,this.canSelfClose=!0,this.preventNamespaceInheritance=!1}requireExtraParent(e){return!1}isClosedByChild(e){return!1}getContentType(){return e.TagContentType.PARSABLE_DATA}};function ru(e){return nu}class iu extends _o{constructor(){super(ru)}parse(e,t,s){return super.parse(e,t,s)}}const au="x",ou="source",lu="trans-unit",cu="context";class uu extends $s{write(e,t){const s=new pu,n=[];e.forEach((e=>{let t=[];e.sources.forEach((e=>{let s=new Us("context-group",{purpose:"location"});s.children.push(new js(10),new Us(cu,{"context-type":"sourcefile"},[new Hs(e.filePath)]),new js(10),new Us(cu,{"context-type":"linenumber"},[new Hs(`${e.startLine}`)]),new js(8)),t.push(new js(8),s)}));const r=new Us(lu,{id:e.id,datatype:"html"});r.children.push(new js(8),new Us(ou,{},s.serialize(e.nodes)),...t),e.description&&r.children.push(new js(8),new Us("note",{priority:"1",from:"description"},[new Hs(e.description)])),e.meaning&&r.children.push(new js(8),new Us("note",{priority:"1",from:"meaning"},[new Hs(e.meaning)])),r.children.push(new js(6)),n.push(new js(6),r)}));const r=new Us("body",{},[...n,new js(4)]),i=new Us("file",{"source-language":t||"en",datatype:"plaintext",original:"ng2.template"},[new js(4),r,new js(2)]),a=new Us("xliff",{version:"1.2",xmlns:"urn:oasis:names:tc:xliff:document:1.2"},[new js(2),i,new js]);return qs([new Fs({version:"1.0",encoding:"UTF-8"}),new js,a,new js])}load(e,t){const s=new hu,{locale:n,msgIdToHtml:r,errors:i}=s.parse(e,t),a={},o=new du;if(Object.keys(r).forEach((e=>{const{i18nNodes:s,errors:n}=o.convert(r[e],t);i.push(...n),a[e]=s})),i.length)throw new Error(`xliff parse errors:\n${i.join("\n")}`);return{locale:n,i18nNodesByMsgId:a}}digest(e){return $(e)}}class pu{visitText(e,t){return[new Hs(e.value)]}visitContainer(e,t){const s=[];return e.children.forEach((e=>s.push(...e.visit(this)))),s}visitIcu(e,t){const s=[new Hs(`{${e.expressionPlaceholder}, ${e.type}, `)];return Object.keys(e.cases).forEach((t=>{s.push(new Hs(`${t} {`),...e.cases[t].visit(this),new Hs("} "))})),s.push(new Hs("}")),s}visitTagPlaceholder(e,t){const s=function(e){switch(e.toLowerCase()){case"br":return"lb";case"img":return"image";default:return`x-${e}`}}(e.tag);if(e.isVoid)return[new Us(au,{id:e.startName,ctype:s,"equiv-text":`<${e.tag}/>`})];const n=new Us(au,{id:e.startName,ctype:s,"equiv-text":`<${e.tag}>`}),r=new Us(au,{id:e.closeName,ctype:s,"equiv-text":``});return[n,...this.serialize(e.children),r]}visitPlaceholder(e,t){return[new Us(au,{id:e.name,"equiv-text":`{{${e.value}}}`})]}visitIcuPlaceholder(e,t){const s=`{${e.value.expression}, ${e.value.type}, ${Object.keys(e.value.cases).map((e=>e+" {...}")).join(" ")}}`;return[new Us(au,{id:e.name,"equiv-text":s})]}serialize(e){return[].concat(...e.map((e=>e.visit(this))))}}class hu{constructor(){this._locale=null}parse(e,t){this._unitMlString=null,this._msgIdToHtml={};const s=(new iu).parse(e,t);return this._errors=s.errors,to(this,s.rootNodes,null),{msgIdToHtml:this._msgIdToHtml,errors:this._errors,locale:this._locale}}visitElement(e,t){switch(e.name){case lu:this._unitMlString=null;const t=e.attrs.find((e=>"id"===e.name));if(t){const s=t.value;this._msgIdToHtml.hasOwnProperty(s)?this._addError(e,`Duplicated translations for msg ${s}`):(to(this,e.children,null),"string"==typeof this._unitMlString?this._msgIdToHtml[s]=this._unitMlString:this._addError(e,`Message ${s} misses a translation`))}else this._addError(e,' misses the "id" attribute');break;case ou:case"seg-source":case"alt-trans":break;case"target":const s=e.startSourceSpan.end.offset,n=e.endSourceSpan.start.offset,r=e.startSourceSpan.start.file.content.slice(s,n);this._unitMlString=r;break;case"file":const i=e.attrs.find((e=>"target-language"===e.name));i&&(this._locale=i.value),to(this,e.children,null);break;default:to(this,e.children,null)}}visitAttribute(e,t){}visitText(e,t){}visitComment(e,t){}visitExpansion(e,t){}visitExpansionCase(e,t){}_addError(e,t){this._errors.push(new El(e.sourceSpan,t))}}class du{convert(e,t){const s=(new iu).parse(e,t,{tokenizeExpansionForms:!0});this._errors=s.errors;return{i18nNodes:this._errors.length>0||0==s.rootNodes.length?[]:[].concat(...to(this,s.rootNodes)),errors:this._errors}}visitText(e,t){return new Is(e.value,e.sourceSpan)}visitElement(e,t){if(e.name===au){const t=e.attrs.find((e=>"id"===e.name));return t?new As("",t.value,e.sourceSpan):(this._addError(e,' misses the "id" attribute'),null)}return"mrk"===e.name?[].concat(...to(this,e.children)):(this._addError(e,"Unexpected tag"),null)}visitExpansion(e,t){const s={};return to(this,e.cases).forEach((t=>{s[t.value]=new ks(t.nodes,e.sourceSpan)})),new Ns(e.switchValue,e.type,s,e.sourceSpan)}visitExpansionCase(e,t){return{value:e.value,nodes:to(this,e.expression)}}visitComment(e,t){}visitAttribute(e,t){}_addError(e,t){this._errors.push(new El(e.sourceSpan,t))}}const mu="ph",gu="xliff",vu="source",fu="unit";class yu extends $s{write(e,t){const s=new xu,n=[];e.forEach((e=>{const t=new Us(fu,{id:e.id}),r=new Us("notes");(e.description||e.meaning)&&(e.description&&r.children.push(new js(8),new Us("note",{category:"description"},[new Hs(e.description)])),e.meaning&&r.children.push(new js(8),new Us("note",{category:"meaning"},[new Hs(e.meaning)]))),e.sources.forEach((e=>{r.children.push(new js(8),new Us("note",{category:"location"},[new Hs(`${e.filePath}:${e.startLine}${e.endLine!==e.startLine?","+e.endLine:""}`)]))})),r.children.push(new js(6)),t.children.push(new js(6),r);const i=new Us("segment");i.children.push(new js(8),new Us(vu,{},s.serialize(e.nodes)),new js(6)),t.children.push(new js(6),i,new js(4)),n.push(new js(4),t)}));const r=new Us("file",{original:"ng.template",id:"ngi18n"},[...n,new js(2)]),i=new Us(gu,{version:"2.0",xmlns:"urn:oasis:names:tc:xliff:document:2.0",srcLang:t||"en"},[new js(2),r,new js]);return qs([new Fs({version:"1.0",encoding:"UTF-8"}),new js,i,new js])}load(e,t){const s=new wu,{locale:n,msgIdToHtml:r,errors:i}=s.parse(e,t),a={},o=new Su;if(Object.keys(r).forEach((e=>{const{i18nNodes:s,errors:n}=o.convert(r[e],t);i.push(...n),a[e]=s})),i.length)throw new Error(`xliff2 parse errors:\n${i.join("\n")}`);return{locale:n,i18nNodesByMsgId:a}}digest(e){return B(e)}}class xu{visitText(e,t){return[new Hs(e.value)]}visitContainer(e,t){const s=[];return e.children.forEach((e=>s.push(...e.visit(this)))),s}visitIcu(e,t){const s=[new Hs(`{${e.expressionPlaceholder}, ${e.type}, `)];return Object.keys(e.cases).forEach((t=>{s.push(new Hs(`${t} {`),...e.cases[t].visit(this),new Hs("} "))})),s.push(new Hs("}")),s}visitTagPlaceholder(e,t){const s=function(e){switch(e.toLowerCase()){case"br":case"b":case"i":case"u":return"fmt";case"img":return"image";case"a":return"link";default:return"other"}}(e.tag);if(e.isVoid){return[new Us(mu,{id:(this._nextPlaceholderId++).toString(),equiv:e.startName,type:s,disp:`<${e.tag}/>`})]}const n=new Us("pc",{id:(this._nextPlaceholderId++).toString(),equivStart:e.startName,equivEnd:e.closeName,type:s,dispStart:`<${e.tag}>`,dispEnd:``}),r=[].concat(...e.children.map((e=>e.visit(this))));return r.length?r.forEach((e=>n.children.push(e))):n.children.push(new Hs("")),[n]}visitPlaceholder(e,t){const s=(this._nextPlaceholderId++).toString();return[new Us(mu,{id:s,equiv:e.name,disp:`{{${e.value}}}`})]}visitIcuPlaceholder(e,t){const s=Object.keys(e.value.cases).map((e=>e+" {...}")).join(" "),n=(this._nextPlaceholderId++).toString();return[new Us(mu,{id:n,equiv:e.name,disp:`{${e.value.expression}, ${e.value.type}, ${s}}`})]}serialize(e){return this._nextPlaceholderId=0,[].concat(...e.map((e=>e.visit(this))))}}class wu{constructor(){this._locale=null}parse(e,t){this._unitMlString=null,this._msgIdToHtml={};const s=(new iu).parse(e,t);return this._errors=s.errors,to(this,s.rootNodes,null),{msgIdToHtml:this._msgIdToHtml,errors:this._errors,locale:this._locale}}visitElement(e,t){switch(e.name){case fu:this._unitMlString=null;const t=e.attrs.find((e=>"id"===e.name));if(t){const s=t.value;this._msgIdToHtml.hasOwnProperty(s)?this._addError(e,`Duplicated translations for msg ${s}`):(to(this,e.children,null),"string"==typeof this._unitMlString?this._msgIdToHtml[s]=this._unitMlString:this._addError(e,`Message ${s} misses a translation`))}else this._addError(e,' misses the "id" attribute');break;case vu:break;case"target":const s=e.startSourceSpan.end.offset,n=e.endSourceSpan.start.offset,r=e.startSourceSpan.start.file.content.slice(s,n);this._unitMlString=r;break;case gu:const i=e.attrs.find((e=>"trgLang"===e.name));i&&(this._locale=i.value);const a=e.attrs.find((e=>"version"===e.name));if(a){const t=a.value;"2.0"!==t?this._addError(e,`The XLIFF file version ${t} is not compatible with XLIFF 2.0 serializer`):to(this,e.children,null)}break;default:to(this,e.children,null)}}visitAttribute(e,t){}visitText(e,t){}visitComment(e,t){}visitExpansion(e,t){}visitExpansionCase(e,t){}_addError(e,t){this._errors.push(new El(e.sourceSpan,t))}}class Su{convert(e,t){const s=(new iu).parse(e,t,{tokenizeExpansionForms:!0});this._errors=s.errors;return{i18nNodes:this._errors.length>0||0==s.rootNodes.length?[]:[].concat(...to(this,s.rootNodes)),errors:this._errors}}visitText(e,t){return new Is(e.value,e.sourceSpan)}visitElement(e,t){switch(e.name){case mu:const t=e.attrs.find((e=>"equiv"===e.name));if(t)return[new As("",t.value,e.sourceSpan)];this._addError(e,' misses the "equiv" attribute');break;case"pc":const s=e.attrs.find((e=>"equivStart"===e.name)),n=e.attrs.find((e=>"equivEnd"===e.name));if(s){if(n){const t=s.value,r=n.value;return[].concat(new As("",t,e.sourceSpan),...e.children.map((e=>e.visit(this,null))),new As("",r,e.sourceSpan))}this._addError(e,' misses the "equivEnd" attribute')}else this._addError(e,' misses the "equivStart" attribute');break;case"mrk":return[].concat(...to(this,e.children));default:this._addError(e,"Unexpected tag")}return null}visitExpansion(e,t){const s={};return to(this,e.cases).forEach((t=>{s[t.value]=new ks(t.nodes,e.sourceSpan)})),new Ns(e.switchValue,e.type,s,e.sourceSpan)}visitExpansionCase(e,t){return{value:e.value,nodes:[].concat(...to(this,e.expression))}}visitComment(e,t){}visitAttribute(e,t){}_addError(e,t){this._errors.push(new El(e.sourceSpan,t))}}const Eu="translationbundle",_u="translation";class bu extends $s{write(e,t){throw new Error("Unsupported")}load(e,t){const s=new Tu,{locale:n,msgIdToHtml:r,errors:i}=s.parse(e,t),a={},o=new Cu;if(Object.keys(r).forEach((e=>{!function(e,t,s){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){const n=s();return Object.defineProperty(e,t,{enumerable:!0,value:n}),n},set:e=>{throw new Error("Could not overwrite an XTB translation")}})}(a,e,(function(){const{i18nNodes:s,errors:n}=o.convert(r[e],t);if(n.length)throw new Error(`xtb parse errors:\n${n.join("\n")}`);return s}))})),i.length)throw new Error(`xtb parse errors:\n${i.join("\n")}`);return{locale:n,i18nNodesByMsgId:a}}digest(e){return Js(e)}createNameMapper(e){return new Ds(e,en)}}class Tu{constructor(){this._locale=null}parse(e,t){this._bundleDepth=0,this._msgIdToHtml={};const s=(new iu).parse(e,t);return this._errors=s.errors,to(this,s.rootNodes),{msgIdToHtml:this._msgIdToHtml,errors:this._errors,locale:this._locale}}visitElement(e,t){switch(e.name){case Eu:this._bundleDepth++,this._bundleDepth>1&&this._addError(e," elements can not be nested");const t=e.attrs.find((e=>"lang"===e.name));t&&(this._locale=t.value),to(this,e.children,null),this._bundleDepth--;break;case _u:const s=e.attrs.find((e=>"id"===e.name));if(s){const t=s.value;if(this._msgIdToHtml.hasOwnProperty(t))this._addError(e,`Duplicated translations for msg ${t}`);else{const s=e.startSourceSpan.end.offset,n=e.endSourceSpan.start.offset,r=e.startSourceSpan.start.file.content.slice(s,n);this._msgIdToHtml[t]=r}}else this._addError(e,' misses the "id" attribute');break;default:this._addError(e,"Unexpected tag")}}visitAttribute(e,t){}visitText(e,t){}visitComment(e,t){}visitExpansion(e,t){}visitExpansionCase(e,t){}_addError(e,t){this._errors.push(new El(e.sourceSpan,t))}}class Cu{convert(e,t){const s=(new iu).parse(e,t,{tokenizeExpansionForms:!0});this._errors=s.errors;return{i18nNodes:this._errors.length>0||0==s.rootNodes.length?[]:to(this,s.rootNodes),errors:this._errors}}visitText(e,t){return new Is(e.value,e.sourceSpan)}visitExpansion(e,t){const s={};return to(this,e.cases).forEach((t=>{s[t.value]=new ks(t.nodes,e.sourceSpan)})),new Ns(e.switchValue,e.type,s,e.sourceSpan)}visitExpansionCase(e,t){return{value:e.value,nodes:to(this,e.expression)}}visitElement(e,t){if("ph"===e.name){const t=e.attrs.find((e=>"name"===e.name));if(t)return new As("",t.value,e.sourceSpan);this._addError(e,' misses the "name" attribute')}else this._addError(e,"Unexpected tag");return null}visitComment(e,t){}visitAttribute(e,t){}_addError(e,t){this._errors.push(new El(e.sourceSpan,t))}}class Iu{constructor(e={},t,s,n,r=_.Warning,i){this._i18nNodesByMsgId=e,this.digest=s,this.mapperFactory=n,this._i18nToHtml=new ku(e,t,s,n,r,i)}static load(e,t,s,n,r){const{locale:i,i18nNodesByMsgId:a}=s.load(e,t);return new Iu(a,i,(e=>s.digest(e)),(e=>s.createNameMapper(e)),n,r)}get(e){const t=this._i18nToHtml.convert(e);if(t.errors.length)throw new Error(t.errors.join("\n"));return t.nodes}has(e){return this.digest(e)in this._i18nNodesByMsgId}}class ku{constructor(e={},t,s,n,r,i){this._i18nNodesByMsgId=e,this._locale=t,this._digest=s,this._mapperFactory=n,this._missingTranslationStrategy=r,this._console=i,this._contextStack=[],this._errors=[]}convert(e){this._contextStack.length=0,this._errors.length=0;const t=this._convertToText(e),s=e.nodes[0].sourceSpan.start.file.url,n=(new Io).parse(t,s,{tokenizeExpansionForms:!0});return{nodes:n.rootNodes,errors:[...this._errors,...n.errors]}}visitText(e,t){return zs(e.value)}visitContainer(e,t){return e.children.map((e=>e.visit(this))).join("")}visitIcu(e,t){const s=Object.keys(e.cases).map((t=>`${t} {${e.cases[t].visit(this)}}`));return`{${this._srcMsg.placeholders.hasOwnProperty(e.expression)?this._srcMsg.placeholders[e.expression].text:e.expression}, ${e.type}, ${s.join(" ")}}`}visitPlaceholder(e,t){const s=this._mapper(e.name);return this._srcMsg.placeholders.hasOwnProperty(s)?this._srcMsg.placeholders[s].text:this._srcMsg.placeholderToMessage.hasOwnProperty(s)?this._convertToText(this._srcMsg.placeholderToMessage[s]):(this._addError(e,`Unknown placeholder "${e.name}"`),"")}visitTagPlaceholder(e,t){const s=`${e.tag}`,n=Object.keys(e.attrs).map((t=>`${t}="${e.attrs[t]}"`)).join(" ");if(e.isVoid)return`<${s} ${n}/>`;return`<${s} ${n}>${e.children.map((e=>e.visit(this))).join("")}`}visitIcuPlaceholder(e,t){return this._convertToText(this._srcMsg.placeholderToMessage[e.name])}_convertToText(e){const t=this._digest(e),s=this._mapperFactory?this._mapperFactory(e):null;let n;if(this._contextStack.push({msg:this._srcMsg,mapper:this._mapper}),this._srcMsg=e,this._i18nNodesByMsgId.hasOwnProperty(t))n=this._i18nNodesByMsgId[t],this._mapper=e=>s?s.toInternalName(e):e;else{if(this._missingTranslationStrategy===_.Error){const s=this._locale?` for locale "${this._locale}"`:"";this._addError(e.nodes[0],`Missing translation for message "${t}"${s}`)}else if(this._console&&this._missingTranslationStrategy===_.Warning){const e=this._locale?` for locale "${this._locale}"`:"";this._console.warn(`Missing translation for message "${t}"${e}`)}n=e.nodes,this._mapper=e=>e}const r=n.map((e=>e.visit(this))).join(""),i=this._contextStack.pop();return this._srcMsg=i.msg,this._mapper=i.mapper,r}_addError(e,t){this._errors.push(new El(e.sourceSpan,t))}}class Nu extends Ms{convert(e,t){return t?e.map((e=>e.visit(this,t))):e}visitTagPlaceholder(e,t){const s=t.toPublicName(e.startName),n=e.closeName?t.toPublicName(e.closeName):e.closeName,r=e.children.map((e=>e.visit(this,t)));return new Ps(e.tag,e.attrs,s,n,r,e.isVoid,e.sourceSpan,e.startSourceSpan,e.endSourceSpan)}visitPlaceholder(e,t){return new As(e.value,t.toPublicName(e.name),e.sourceSpan)}visitIcuPlaceholder(e,t){return new Ls(e.value,t.toPublicName(e.name),e.sourceSpan)}}var Pu;!function(e){e[e.Directive=0]="Directive",e[e.Component=1]="Component",e[e.Injectable=2]="Injectable",e[e.Pipe=3]="Pipe",e[e.NgModule=4]="NgModule"}(Pu||(Pu={}));class Au{constructor(e,t){this.parentScope=e,this.template=t,this.namedEntities=new Map,this.childScopes=new Map}static newRootScope(){return new Au(null,null)}static apply(e){const t=Au.newRootScope();return t.ingest(e),t}ingest(e){e instanceof ws?(e.variables.forEach((e=>this.visitVariable(e))),e.children.forEach((e=>e.visit(this)))):e.forEach((e=>e.visit(this)))}visitElement(e){e.references.forEach((e=>this.visitReference(e))),e.children.forEach((e=>e.visit(this)))}visitTemplate(e){e.references.forEach((e=>this.visitReference(e)));const t=new Au(this,e);t.ingest(e),this.childScopes.set(e,t)}visitVariable(e){this.maybeDeclare(e)}visitReference(e){this.maybeDeclare(e)}visitContent(e){}visitBoundAttribute(e){}visitBoundEvent(e){}visitBoundText(e){}visitText(e){}visitTextAttribute(e){}visitIcu(e){}maybeDeclare(e){this.namedEntities.has(e.name)||this.namedEntities.set(e.name,e)}lookup(e){return this.namedEntities.has(e)?this.namedEntities.get(e):null!==this.parentScope?this.parentScope.lookup(e):null}getChildScope(e){const t=this.childScopes.get(e);if(void 0===t)throw new Error(`Assertion error: child scope for ${e} not found`);return t}}class Lu{constructor(e,t,s,n){this.matcher=e,this.directives=t,this.bindings=s,this.references=n}static apply(e,t){const s=new Map,n=new Map,r=new Map;return new Lu(t,s,n,r).ingest(e),{directives:s,bindings:n,references:r}}ingest(e){e.forEach((e=>e.visit(this)))}visitElement(e){this.visitElementOrTemplate(e.name,e)}visitTemplate(e){this.visitElementOrTemplate("ng-template",e)}visitElementOrTemplate(e,t){const n=function(e,t){const n=new d,r=s(e)[1];return n.setElement(r),Object.getOwnPropertyNames(t).forEach((e=>{const r=s(e)[1],i=t[e];n.addAttribute(r,i),"class"===e.toLowerCase()&&i.trim().split(/\s+/).forEach((e=>n.addClassName(e)))})),n}(e,function(e){const t={};return e instanceof ws&&"ng-template"!==e.tagName?e.templateAttrs.forEach((e=>t[e.name]="")):(e.attributes.forEach((e=>{nn(e.name)||(t[e.name]=e.value)})),e.inputs.forEach((e=>{t[e.name]=""})),e.outputs.forEach((e=>{t[e.name]=""}))),t}(t)),r=[];this.matcher.match(n,((e,t)=>r.push(...t))),r.length>0&&this.directives.set(t,r),t.references.forEach((e=>{let s=null;if(""===e.value.trim())s=r.find((e=>e.isComponent))||null;else if(s=r.find((t=>null!==t.exportAs&&t.exportAs.some((t=>t===e.value))))||null,null===s)return;null!==s?this.references.set(e,{directive:s,node:t}):this.references.set(e,t)}));const i=(e,s)=>{const n=r.find((t=>t[s].hasBindingPropertyName(e.name))),i=void 0!==n?n:t;this.bindings.set(e,i)};t.inputs.forEach((e=>i(e,"inputs"))),t.attributes.forEach((e=>i(e,"inputs"))),t instanceof ws&&t.templateAttrs.forEach((e=>i(e,"inputs"))),t.outputs.forEach((e=>i(e,"outputs"))),t.children.forEach((e=>e.visit(this)))}visitContent(e){}visitVariable(e){}visitReference(e){}visitTextAttribute(e){}visitBoundAttribute(e){}visitBoundEvent(e){}visitBoundAttributeOrEvent(e){}visitText(e){}visitBoundText(e){}visitIcu(e){}}class Mu extends hi{constructor(e,t,s,n,r,i,a){super(),this.bindings=e,this.symbols=t,this.usedPipes=s,this.nestingLevel=n,this.scope=r,this.template=i,this.level=a,this.pipesUsed=[],this.visitNode=e=>e.visit(this)}visit(e,t){e instanceof Br?e.visit(this,t):e.visit(this)}static applyWithScope(e,t){const s=new Map,n=new Map,r=new Map,i=new Set;return new Mu(s,n,i,r,t,e instanceof ws?e:null,0).ingest(e),{expressions:s,symbols:n,nestingLevel:r,usedPipes:i}}ingest(e){e instanceof ws?(e.variables.forEach(this.visitNode),e.children.forEach(this.visitNode),this.nestingLevel.set(e,this.level)):e.forEach(this.visitNode)}visitElement(e){e.inputs.forEach(this.visitNode),e.outputs.forEach(this.visitNode),e.children.forEach(this.visitNode)}visitTemplate(e){e.inputs.forEach(this.visitNode),e.outputs.forEach(this.visitNode),e.templateAttrs.forEach(this.visitNode),e.references.forEach(this.visitNode);const t=this.scope.getChildScope(e);new Mu(this.bindings,this.symbols,this.usedPipes,this.nestingLevel,t,e,this.level+1).ingest(e)}visitVariable(e){null!==this.template&&this.symbols.set(e,this.template)}visitReference(e){null!==this.template&&this.symbols.set(e,this.template)}visitText(e){}visitContent(e){}visitTextAttribute(e){}visitIcu(e){Object.keys(e.vars).forEach((t=>e.vars[t].visit(this))),Object.keys(e.placeholders).forEach((t=>e.placeholders[t].visit(this)))}visitBoundAttribute(e){e.value.visit(this)}visitBoundEvent(e){e.handler.visit(this)}visitBoundText(e){e.value.visit(this)}visitPipe(e,t){return this.usedPipes.add(e.name),super.visitPipe(e,t)}visitPropertyRead(e,t){return this.maybeMap(t,e,e.name),super.visitPropertyRead(e,t)}visitSafePropertyRead(e,t){return this.maybeMap(t,e,e.name),super.visitSafePropertyRead(e,t)}visitPropertyWrite(e,t){return this.maybeMap(t,e,e.name),super.visitPropertyWrite(e,t)}maybeMap(e,t,s){if(!(t.receiver instanceof Vr))return;let n=this.scope.lookup(s);null!==n&&this.bindings.set(t,n)}}class Ru{constructor(e,t,s,n,r,i,a,o,l){this.target=e,this.directives=t,this.bindings=s,this.references=n,this.exprTargets=r,this.symbols=i,this.nestingLevel=a,this.templateEntities=o,this.usedPipes=l}getEntitiesInTemplateScope(e){return this.templateEntities.get(e)??new Set}getDirectivesOfNode(e){return this.directives.get(e)||null}getReferenceTarget(e){return this.references.get(e)||null}getConsumerOfBinding(e){return this.bindings.get(e)||null}getExpressionTarget(e){return this.exprTargets.get(e)||null}getTemplateOfSymbol(e){return this.symbols.get(e)||null}getNestingLevel(e){return this.nestingLevel.get(e)||0}getUsedDirectives(){const e=new Set;return this.directives.forEach((t=>t.forEach((t=>e.add(t))))),Array.from(e.values())}getUsedPipes(){return Array.from(this.usedPipes)}}function Ou(e,t){return null===e||0===e.length?null:xt(e.map((e=>t(e))))}function $u(e,t){const s=Object.keys(e).map((s=>{const n=e[s];return{key:s,value:t(n),quoted:!0}}));return s.length>0?wt(s):null}function Du(e){const t=new An;return t.set("token",e.token),null!==e.attributeNameType&&t.set("attribute",Tt(!0)),e.host&&t.set("host",Tt(!0)),e.optional&&t.set("optional",Tt(!0)),e.self&&t.set("self",Tt(!0)),e.skipSelf&&t.set("skipSelf",Tt(!0)),t.toLiteralMap()}function Bu(e){const t=new An;return t.set("minVersion",Tt("14.0.0")),t.set("version",Tt("15.0.4")),t.set("type",e.internalType),e.isStandalone&&t.set("isStandalone",Tt(e.isStandalone)),null!==e.selector&&t.set("selector",Tt(e.selector)),t.set("inputs",kn(e.inputs,!0)),t.set("outputs",kn(e.outputs)),t.set("host",function(e){const t=new An;t.set("attributes",$u(e.attributes,(e=>e))),t.set("listeners",$u(e.listeners,Tt)),t.set("properties",$u(e.properties,Tt)),e.specialAttributes.styleAttr&&t.set("styleAttribute",Tt(e.specialAttributes.styleAttr));e.specialAttributes.classAttr&&t.set("classAttribute",Tt(e.specialAttributes.classAttr));return t.values.length>0?t.toLiteralMap():null}(e.host)),t.set("providers",e.providers),e.queries.length>0&&t.set("queries",xt(e.queries.map(qu))),e.viewQueries.length>0&&t.set("viewQueries",xt(e.viewQueries.map(qu))),null!==e.exportAs&&t.set("exportAs",In(e.exportAs)),e.usesInheritance&&t.set("usesInheritance",Tt(!0)),e.lifecycle.usesOnChanges&&t.set("usesOnChanges",Tt(!0)),e.hostDirectives?.length&&t.set("hostDirectives",xt(e.hostDirectives.map((e=>{const t=[{key:"directive",value:e.isForwardReference?os(e.directive.type):e.directive.type,quoted:!1}],s=e.inputs?Sc(e.inputs):null,n=e.outputs?Sc(e.outputs):null;return s&&t.push({key:"inputs",value:s,quoted:!1}),n&&t.push({key:"outputs",value:n,quoted:!1}),wt(t)})))),t.set("ngImport",vt(qt.core)),t}function qu(e){const t=new An;return t.set("propertyName",Tt(e.propertyName)),e.first&&t.set("first",Tt(!0)),t.set("predicate",Array.isArray(e.predicate)?In(e.predicate):as(e.predicate)),e.emitDistinctChangesOnly||t.set("emitDistinctChangesOnly",Tt(!1)),e.descendants&&t.set("descendants",Tt(!0)),t.set("read",e.read),e.static&&t.set("static",Tt(!0)),t.toLiteralMap()}const Fu="12.0.0";const Vu="12.0.0";const Uu="14.0.0";const Hu="14.0.0";zc(M),e.AST=Br,e.ASTWithName=qr,e.ASTWithSource=ci,e.AbsoluteSourceSpan=li,e.ArrayType=oe,e.AstMemoryEfficientTransformer=mi,e.AstTransformer=di,e.Attribute=Ja,e.Binary=si,e.BinaryOperatorExpr=Ye,e.BindingPipe=Xr,e.BoundElementProperty=yi,e.BuiltinType=ie,e.CUSTOM_ELEMENTS_SCHEMA=x,e.Call=ai,e.Chain=Hr,e.CommaExpr=tt,e.Comment=eo,e.CompilerConfig=class{constructor({defaultEncapsulation:t=e.ViewEncapsulation.Emulated,useJit:s=!0,missingTranslation:n=null,preserveWhitespaces:r,strictInjectionParameters:i}={}){var a;this.defaultEncapsulation=t,this.useJit=!!s,this.missingTranslation=n,this.preserveWhitespaces=Gc(void 0===(a=r)?null:a),this.strictInjectionParameters=!0===i}},e.Conditional=jr,e.ConditionalExpr=je,e.ConstantPool=Mt,e.CssSelector=d,e.DEFAULT_INTERPOLATION_CONFIG=Fn,e.DYNAMIC_TYPE=ce,e.DeclareFunctionStmt=ct,e.DeclareVarStmt=lt,e.DomElementSchemaRegistry=Vo,e.EOF=$a,e.Element=Za,e.ElementSchemaRegistry=Do,e.EmitterVisitorContext=Kt,e.EmptyExpr=Fr,e.Expansion=Qa,e.ExpansionCase=Xa,e.Expression=Ee,e.ExpressionBinding=pi,e.ExpressionStatement=ut,e.ExpressionType=ae,e.ExternalExpr=Ue,e.ExternalReference=He,e.FunctionExpr=Ke,e.HtmlParser=Io,e.HtmlTagDefinition=l,e.I18NHtmlParser=class{constructor(e,t,s,n=_.Warning,r){if(this._htmlParser=e,t){const e=function(e){switch(e=(e||"xlf").toLowerCase()){case"xmb":return new Qs;case"xtb":return new bu;case"xliff2":case"xlf2":return new yu;default:return new uu}}(s);this._translationBundle=Iu.load(t,"i18n",e,n,r)}else this._translationBundle=new Iu({},null,$,void 0,n,r)}parse(e,t,s={}){const n=s.interpolationConfig||Fn,r=this._htmlParser.parse(e,t,{interpolationConfig:n,...s});return r.errors.length?new Eo(r.rootNodes,r.errors):function(e,t,s,n,r){return new tu(n,r).merge(e,t,s)}(r.rootNodes,this._translationBundle,n,[],{})}},e.IfStmt=ht,e.ImplicitReceiver=Vr,e.InstantiateExpr=Ae,e.Interpolation=ti,e.InterpolationConfig=qn,e.InvokeFunctionExpr=Ne,e.JSDocComment=at,e.JitEvaluator=Sr,e.KeyedRead=Gr,e.KeyedWrite=Qr,e.LeadingComment=it,e.Lexer=La,e.LiteralArray=Zr,e.LiteralArrayExpr=Je,e.LiteralExpr=Le,e.LiteralMap=ei,e.LiteralMapExpr=et,e.LiteralPrimitive=Jr,e.LocalizedString=De,e.MapType=le,e.MessageBundle=class{constructor(e,t,s,n=null){this._htmlParser=e,this._implicitTags=t,this._implicitAttrs=s,this._locale=n,this._messages=[]}updateFromTemplate(e,t,s){const n=this._htmlParser.parse(e,t,{tokenizeExpansionForms:!0,interpolationConfig:s});if(n.errors.length)return n.errors;const r=function(e,t,s,n){return new tu(s,n).extract(e,t)}(n.rootNodes,s,this._implicitTags,this._implicitAttrs);return r.errors.length?r.errors:(this._messages.push(...r.messages),[])}getMessages(){return this._messages}write(e,t){const s={},n=new Nu;this._messages.forEach((t=>{const n=e.digest(t);s.hasOwnProperty(n)?s[n].sources.push(...t.sources):s[n]=t}));const r=Object.keys(s).map((r=>{const i=e.createNameMapper(s[r]),a=s[r],o=i?n.convert(a.nodes,i):a.nodes;let l=new Cs(o,{},{},a.meaning,a.description,r);return l.sources=a.sources,t&&l.sources.forEach((e=>e.filePath=t(e.filePath))),l}));return e.write(r,this._locale)}},e.NONE_TYPE=ve,e.NO_ERRORS_SCHEMA=w,e.NodeWithI18n=Ga,e.NonNullAssert=ii,e.NotExpr=We,e.ParseError=pr,e.ParseLocation=or,e.ParseSourceFile=lr,e.ParseSourceSpan=cr,e.ParseSpan=Dr,e.ParseTreeResult=Eo,e.ParsedEvent=vi,e.ParsedProperty=gi,e.ParsedVariable=fi,e.Parser=ja,e.ParserError=$r,e.PrefixNot=ri,e.PropertyRead=Wr,e.PropertyWrite=zr,e.R3BoundTarget=Ru,e.R3Identifiers=qt,e.R3TargetBinder=class{constructor(e){this.directiveMatcher=e}bind(e){if(!e.template)throw new Error("Binding without a template not yet supported");const t=Au.apply(e.template),s=function(e){const t=new Map;function s(e){if(t.has(e.template))return t.get(e.template);const n=e.namedEntities;let r;return r=null!==e.parentScope?new Map([...s(e.parentScope),...n]):new Map(n),t.set(e.template,r),r}const n=[e];for(;n.length>0;){const e=n.pop();for(const t of e.childScopes.values())n.push(t);s(e)}const r=new Map;for(const[e,s]of t)r.set(e,new Set(s.values()));return r}(t),{directives:n,bindings:r,references:i}=Lu.apply(e.template,this.directiveMatcher),{expressions:a,symbols:o,nestingLevel:l,usedPipes:c}=Mu.applyWithScope(e.template,t);return new Ru(e,n,r,i,a,o,l,s,c)}},e.ReadKeyExpr=Xe,e.ReadPropExpr=Qe,e.ReadVarExpr=_e,e.RecursiveAstVisitor=hi,e.RecursiveVisitor=class{constructor(){}visitElement(e,t){this.visitChildren(t,(t=>{t(e.attrs),t(e.children)}))}visitAttribute(e,t){}visitText(e,t){}visitComment(e,t){}visitExpansion(e,t){return this.visitChildren(t,(t=>{t(e.cases)}))}visitExpansionCase(e,t){}visitChildren(e,t){let s=[],n=this;return t((function(t){t&&s.push(to(n,t,e))})),Array.prototype.concat.apply([],s)}},e.ResourceLoader=Ec,e.ReturnStatement=pt,e.STRING_TYPE=me,e.SafeCall=oi,e.SafeKeyedRead=Yr,e.SafePropertyRead=Kr,e.SelectorContext=v,e.SelectorListContext=g,e.SelectorMatcher=m,e.Serializer=$s,e.SplitInterpolation=Ua,e.Statement=ot,e.TaggedTemplateExpr=Pe,e.TemplateBindingParseResult=Ha,e.TemplateLiteral=Me,e.TemplateLiteralElement=Re,e.Text=Ya,e.ThisReceiver=Ur,e.TmplAstBoundAttribute=fs,e.TmplAstBoundEvent=ys,e.TmplAstBoundText=gs,e.TmplAstContent=Ss,e.TmplAstElement=xs,e.TmplAstIcu=bs,e.TmplAstRecursiveVisitor=class{visitElement(e){Ts(this,e.attributes),Ts(this,e.inputs),Ts(this,e.outputs),Ts(this,e.children),Ts(this,e.references)}visitTemplate(e){Ts(this,e.attributes),Ts(this,e.inputs),Ts(this,e.outputs),Ts(this,e.children),Ts(this,e.references),Ts(this,e.variables)}visitContent(e){}visitVariable(e){}visitReference(e){}visitTextAttribute(e){}visitBoundAttribute(e){}visitBoundEvent(e){}visitText(e){}visitBoundText(e){}visitIcu(e){}},e.TmplAstReference=_s,e.TmplAstTemplate=ws,e.TmplAstText=ms,e.TmplAstTextAttribute=vs,e.TmplAstVariable=Es,e.Token=Ma,e.TreeError=So,e.Type=re,e.TypeofExpr=be,e.Unary=ni,e.UnaryOperatorExpr=Ge,e.VERSION=Kc,e.VariableBinding=ui,e.Version=L,e.WrappedNodeExpr=Te,e.WriteKeyExpr=Ie,e.WritePropExpr=ke,e.WriteVarExpr=Ce,e.Xliff=uu,e.Xliff2=yu,e.Xmb=Qs,e.XmlParser=iu,e.Xtb=bu,e._ParseAST=za,e.compileClassMetadata=function(e){return Et([],[ts(vt(qt.setClassMetadata).callFn([e.type,e.decorators,e.ctorParameters??Tt(null),e.propDecorators??Tt(null)])).toStmt()]).callFn([])},e.compileComponentFromMetadata=ic,e.compileDeclareClassMetadata=function(e){const t=new An;return t.set("minVersion",Tt("12.0.0")),t.set("version",Tt("15.0.4")),t.set("ngImport",vt(qt.core)),t.set("type",e.type),t.set("decorators",e.decorators),t.set("ctorParameters",e.ctorParameters),t.set("propDecorators",e.propDecorators),vt(qt.declareClassMetadata).callFn([t.toLiteralMap()])},e.compileDeclareComponentFromMetadata=function(t,s,n){const r=function(t,s,n){const r=Bu(t);r.set("template",function(e,t){if(null!==t.inlineTemplateLiteralExpression)return t.inlineTemplateLiteralExpression;if(t.isInline)return Tt(t.content,null,null);const s=t.content,n=new lr(s,t.sourceUrl),r=new or(n,0,0,0),i=function(e,t){const s=t.length;let n=0,r=0,i=0;do{n=t.indexOf("\n",r),-1!==n&&(r=n+1,i++)}while(-1!==n);return new or(e,s,i,s-r)}(n,s),a=new cr(r,i);return Tt(s,null,a)}(0,n)),n.isInline&&r.set("isInline",Tt(!0));r.set("styles",Ou(t.styles,Tt)),r.set("dependencies",function(t){const s=0!==t.declarationListEmitMode?os:e=>e;return Ou(t.declarations,(t=>{switch(t.kind){case e.R3TemplateDependencyKind.Directive:const n=new An;return n.set("kind",Tt(t.isComponent?"component":"directive")),n.set("type",s(t.type)),n.set("selector",Tt(t.selector)),n.set("inputs",Ou(t.inputs,Tt)),n.set("outputs",Ou(t.outputs,Tt)),n.set("exportAs",Ou(t.exportAs,Tt)),n.toLiteralMap();case e.R3TemplateDependencyKind.Pipe:const r=new An;return r.set("kind",Tt("pipe")),r.set("type",s(t.type)),r.set("name",Tt(t.name)),r.toLiteralMap();case e.R3TemplateDependencyKind.NgModule:const i=new An;return i.set("kind",Tt("ngmodule")),i.set("type",s(t.type)),i.toLiteralMap()}}))}(t)),r.set("viewProviders",t.viewProviders),r.set("animations",t.animations),void 0!==t.changeDetection&&r.set("changeDetection",vt(qt.ChangeDetectionStrategy).prop(e.ChangeDetectionStrategy[t.changeDetection]));t.encapsulation!==e.ViewEncapsulation.Emulated&&r.set("encapsulation",vt(qt.ViewEncapsulation).prop(e.ViewEncapsulation[t.encapsulation]));t.interpolation!==Fn&&r.set("interpolation",xt([Tt(t.interpolation.start),Tt(t.interpolation.end)]));!0===s.preserveWhitespaces&&r.set("preserveWhitespaces",Tt(!0));return r}(t,s,n);return{expression:vt(qt.declareComponent).callFn([r.toLiteralMap()]),type:ac(t),statements:[]}},e.compileDeclareDirectiveFromMetadata=function(e){const t=Bu(e);return{expression:vt(qt.declareDirective).callFn([t.toLiteralMap()]),type:hc(e),statements:[]}},e.compileDeclareFactoryFunction=function(t){const s=new An;var n;return s.set("minVersion",Tt("12.0.0")),s.set("version",Tt("15.0.4")),s.set("ngImport",vt(qt.core)),s.set("type",t.internalType),s.set("deps","invalid"===(n=t.deps)?Tt("invalid"):null===n?Tt(null):xt(n.map(Du))),s.set("target",vt(qt.FactoryTarget).prop(e.FactoryTarget[t.target])),{expression:vt(qt.declareFactory).callFn([s.toLiteralMap()]),statements:[],type:us(t)}},e.compileDeclareInjectableFromMetadata=function(e){const t=function(e){const t=new An;if(t.set("minVersion",Tt(Fu)),t.set("version",Tt("15.0.4")),t.set("ngImport",vt(qt.core)),t.set("type",e.internalType),void 0!==e.providedIn){const s=as(e.providedIn);null!==s.value&&t.set("providedIn",s)}void 0!==e.useClass&&t.set("useClass",as(e.useClass));void 0!==e.useExisting&&t.set("useExisting",as(e.useExisting));void 0!==e.useValue&&t.set("useValue",as(e.useValue));void 0!==e.useFactory&&t.set("useFactory",e.useFactory);void 0!==e.deps&&t.set("deps",xt(e.deps.map(Du)));return t}(e);return{expression:vt(qt.declareInjectable).callFn([t.toLiteralMap()]),type:On(e),statements:[]}},e.compileDeclareInjectorFromMetadata=function(e){const t=function(e){const t=new An;t.set("minVersion",Tt(Vu)),t.set("version",Tt("15.0.4")),t.set("ngImport",vt(qt.core)),t.set("type",e.internalType),t.set("providers",e.providers),e.imports.length>0&&t.set("imports",xt(e.imports));return t}(e);return{expression:vt(qt.declareInjector).callFn([t.toLiteralMap()]),type:br(e),statements:[]}},e.compileDeclareNgModuleFromMetadata=function(e){const t=function(e){const t=new An;t.set("minVersion",Tt(Uu)),t.set("version",Tt("15.0.4")),t.set("ngImport",vt(qt.core)),t.set("type",e.internalType),e.bootstrap.length>0&&t.set("bootstrap",rs(e.bootstrap,e.containsForwardDecls));e.declarations.length>0&&t.set("declarations",rs(e.declarations,e.containsForwardDecls));e.imports.length>0&&t.set("imports",rs(e.imports,e.containsForwardDecls));e.exports.length>0&&t.set("exports",rs(e.exports,e.containsForwardDecls));null!==e.schemas&&e.schemas.length>0&&t.set("schemas",xt(e.schemas.map((e=>e.value))));null!==e.id&&t.set("id",e.id);return t}(e);return{expression:vt(qt.declareNgModule).callFn([t.toLiteralMap()]),type:Ar(e),statements:[]}},e.compileDeclarePipeFromMetadata=function(e){const t=function(e){const t=new An;t.set("minVersion",Tt(Hu)),t.set("version",Tt("15.0.4")),t.set("ngImport",vt(qt.core)),t.set("type",e.internalType),e.isStandalone&&t.set("isStandalone",Tt(e.isStandalone));t.set("name",Tt(e.pipeName)),!1===e.pure&&t.set("pure",Tt(e.pure));return t}(e);return{expression:vt(qt.declarePipe).callFn([t.toLiteralMap()]),type:Or(e),statements:[]}},e.compileDirectiveFromMetadata=rc,e.compileFactoryFunction=cs,e.compileInjectable=Rn,e.compileInjector=_r,e.compileNgModule=Pr,e.compilePipeFromMetadata=Rr,e.computeMsgId=W,e.core=C,e.createInjectableType=On,e.createMayBeForwardRefExpression=is,e.devOnlyGuardedExpression=ts,e.emitDistinctChangesOnlyDefaultValue=true,e.getHtmlTagDefinition=p,e.getNsPrefix=a,e.getSafePropertyAccessString=Zt,e.identifierName=mr,e.isIdentifier=function(e){if(0==e.length)return!1;const t=new Da(e);if(!Ba(t.peek))return!1;for(t.advance();0!==t.peek;){if(!qa(t.peek))return!1;t.advance()}return!0},e.isNgContainer=n,e.isNgContent=r,e.isNgTemplate=i,e.jsDocComment=mt,e.leadingComment=dt,e.literalMap=wt,e.makeBindingParser=Kl,e.mergeNsAndName=o,e.outputAst=Nt,e.parseHostBindings=fc,e.parseTemplate=Wl,e.preserveWhitespacesDefault=Gc,e.publishFacade=zc,e.r3JitTypeSourceSpan=hr,e.sanitizeIdentifier=gr,e.splitNsName=s,e.verifyHostBindings=yc,e.visitAll=to})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/compiler/testing/testing.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/compiler/testing/testing.js new file mode 100644 index 000000000..776043b62 --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/compiler/testing/testing.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).ngCompilerTesting={})}(this,(function(e){"use strict";e.unusedExport=!0})); diff --git a/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/core/core.js b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/core/core.js new file mode 100644 index 000000000..a035bfe8d --- /dev/null +++ b/libs/code-demos/assets/runner/ng2/build-umd-bundles/bundles/@angular/core/core.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["exports","rxjs","rxjs/operators"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ngCore={},e.rxjs,e.rxjsOperators)}(this,(function(e,t,n){"use strict";function o(e){for(let t in e)if(e[t]===o)return t;throw Error("Could not find renamed property on target object.")}function r(e,t){for(const n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function i(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(i).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function s(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const l=o({__forward_ref__:o});function a(e){return e.__forward_ref__=a,e.toString=function(){return i(this())},e}function c(e){return u(e)?e():e}function u(e){return"function"==typeof e&&e.hasOwnProperty(l)&&e.__forward_ref__===a}function d(e){return e&&!!e.ɵproviders}const f="https://g.co/ng/security#xss";class p extends Error{constructor(e,t){super(h(e,t)),this.code=e}}function h(e,t){const n=`NG0${Math.abs(e)}`;let o=`${n}${t?": "+t.trim():""}`;if(ngDevMode&&e<0){const e=!o.match(/[.,;!?]$/);o=`${o}${e?".":""} Find more at https://angular.io/errors/${n}`}return o}function g(e){return"string"==typeof e?e:null==e?"":String(e)}function m(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():g(e)}function y(e,t){const n=t?`. Dependency path: ${t.join(" > ")} > ${e}`:"";throw new p(-200,`Circular dependency in DI detected for ${e}${n}`)}function v(){throw new Error("Cannot mix multi providers and regular providers")}function w(e,t,n){if(e&&t){const o=t.map((e=>e==n?"?"+n+"?":"..."));throw new Error(`Invalid provider for the NgModule '${i(e)}' - only instances of Provider and Type are allowed, got: [${o.join(", ")}]`)}throw d(n)?n.ɵfromNgModule?new p(207,"Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers."):new p(207,"Invalid providers present in a non-environment injector. 'EnvironmentProviders' can't be used for component providers."):new Error("Invalid provider")}function D(e,t){const n=t?` in ${t}`:"";throw new p(-201,ngDevMode&&`No provider for ${m(e)} found${n}`)}function _(e,t){"number"!=typeof e&&P(t,typeof e,"number","===")}function M(e,t,n){_(e,"Expected a number"),k(e,n,"Expected number to be less than or equal to"),S(e,t,"Expected number to be greater than or equal to")}function b(e,t){"string"!=typeof e&&P(t,null===e?"null":typeof e,"string","===")}function I(e,t){"function"!=typeof e&&P(t,null===e?"null":typeof e,"function","===")}function C(e,t,n){e!=t&&P(n,e,t,"==")}function x(e,t,n){e==t&&P(n,e,t,"!=")}function E(e,t,n){e!==t&&P(n,e,t,"===")}function T(e,t,n){e===t&&P(n,e,t,"!==")}function N(e,t,n){et||P(n,e,t,">")}function S(e,t,n){e>=t||P(n,e,t,">=")}function O(e,t){null==e&&P(t,e,null,"!=")}function P(e,t,n,o){throw new Error(`ASSERTION ERROR: ${e}`+(null==o?"":` [Expected=> ${n} ${o} ${t} <=Actual]`))}function j(e){"undefined"!=typeof Node&&e instanceof Node||"object"==typeof e&&null!=e&&"WebWorkerRenderNode"===e.constructor.name||P(`The provided value must be an instance of a DOM Node but got ${i(e)}`)}function R(e,t){O(e,"Array must be defined.");const n=e.length;(t<0||t>=n)&&P(`Index expected to be less than ${n} but got ${t}`)}function F(e,...t){if(-1!==t.indexOf(e))return!0;P(`Expected value to be one of ${JSON.stringify(t)} but was ${JSON.stringify(e)}.`)}function $(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}const V=$;function L(e){return{providers:e.providers||[],imports:e.imports||[]}}function H(e){return B(e,z)||B(e,W)}function B(e,t){return e.hasOwnProperty(t)?e[t]:null}function U(e){return e&&(e.hasOwnProperty(q)||e.hasOwnProperty(Z))?e[q]:null}const z=o({"ɵprov":o}),q=o({"ɵinj":o}),W=o({ngInjectableDef:o}),Z=o({ngInjectorDef:o});var Q;let G;function K(e){const t=G;return G=e,t}function J(t,n,o){const r=H(t);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:o&e.InjectFlags.Optional?null:void 0!==n?n:void D(i(t),"Injector")}e.InjectFlags=void 0,(Q=e.InjectFlags||(e.InjectFlags={}))[Q.Default=0]="Default",Q[Q.Host=1]="Host",Q[Q.Self=2]="Self",Q[Q.SkipSelf=4]="SkipSelf",Q[Q.Optional=8]="Optional";const Y=(()=>"undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof global&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self)();function X(){return!("undefined"!=typeof ngDevMode&&!ngDevMode)&&("object"!=typeof ngDevMode&&function(){const e="undefined"!=typeof location?location.toString():"",t={namedConstructors:-1!=e.indexOf("ngDevMode=namedConstructors"),firstCreatePass:0,tNode:0,tView:0,rendererCreateTextNode:0,rendererSetText:0,rendererCreateElement:0,rendererAddEventListener:0,rendererSetAttribute:0,rendererRemoveAttribute:0,rendererSetProperty:0,rendererSetClassName:0,rendererAddClass:0,rendererRemoveClass:0,rendererSetStyle:0,rendererRemoveStyle:0,rendererDestroy:0,rendererDestroyNode:0,rendererMoveNode:0,rendererRemoveNode:0,rendererAppendChild:0,rendererInsertBefore:0,rendererCreateComment:0},n=-1===e.indexOf("ngDevMode=false");Y.ngDevMode=n&&t}(),"undefined"!=typeof ngDevMode&&!!ngDevMode)}const ee={},te=/\n/gm,ne="__source";let oe;function re(e){const t=oe;return oe=e,t}function ie(t,n=e.InjectFlags.Default){if(void 0===oe)throw new p(-203,ngDevMode&&"inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with `EnvironmentInjector#runInContext`.");return null===oe?J(t,void 0,n):oe.get(t,n&e.InjectFlags.Optional?null:void 0,n)}function se(t,n=e.InjectFlags.Default){return(G||ie)(c(t),n)}function le(e){throw new p(202,ngDevMode&&`This constructor is not compatible with Angular Dependency Injection because its dependency at index ${e} of the parameter list is invalid.\nThis can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.\n\nPlease check that 1) the type for the parameter at index ${e} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`)}function ae(t,n=e.InjectFlags.Default){return se(t,ce(n))}function ce(e){return void 0===e||"number"==typeof e?e:0|(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function ue(t){const n=[];for(let o=0;o ");else if("object"==typeof t){let e=[];for(let n in t)if(t.hasOwnProperty(n)){let o=t[n];e.push(n+":"+("string"==typeof o?JSON.stringify(o):i(o)))}r=`{${e.join(", ")}}`}return`${n}${o?"("+o+")":""}[${r}]: ${e.replace(te,"\n ")}`}("\n"+e.message,r,n,o),e.ngTokenPath=r,e.ngTempTokenPath=null,e}function pe(e){return{toString:e}.toString()}var he,ge;e.ChangeDetectionStrategy=void 0,(he=e.ChangeDetectionStrategy||(e.ChangeDetectionStrategy={}))[he.OnPush=0]="OnPush",he[he.Default=1]="Default",e["ɵChangeDetectorStatus"]=void 0,(ge=e["ɵChangeDetectorStatus"]||(e["ɵChangeDetectorStatus"]={}))[ge.CheckOnce=0]="CheckOnce",ge[ge.Checked=1]="Checked",ge[ge.CheckAlways=2]="CheckAlways",ge[ge.Detached=3]="Detached",ge[ge.Errored=4]="Errored",ge[ge.Destroyed=5]="Destroyed",e.ViewEncapsulation=void 0,function(e){e[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom"}(e.ViewEncapsulation||(e.ViewEncapsulation={}));const me={},ye=[];("undefined"==typeof ngDevMode||ngDevMode)&&X()&&(Object.freeze(me),Object.freeze(ye));const ve=o({"ɵcmp":o}),we=o({"ɵdir":o}),De=o({"ɵpipe":o}),_e=o({"ɵmod":o}),Me=o({"ɵfac":o}),be=o({__NG_ELEMENT_ID__:o});let Ie=0;function Ce(t){return pe((()=>{("undefined"==typeof ngDevMode||ngDevMode)&&X();const n=t.type,o=!0===t.standalone,r={},i={type:n,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:r,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===e.ChangeDetectionStrategy.OnPush,directiveDefs:null,pipeDefs:null,standalone:o,dependencies:o&&t.dependencies||null,getStandaloneInjector:null,selectors:t.selectors||ye,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||e.ViewEncapsulation.Emulated,id:"c"+Ie++,styles:t.styles||ye,_:null,setInput:null,schemas:t.schemas||null,tView:null,findHostDirectiveDefs:null,hostDirectives:null},s=t.dependencies,l=t.features;return i.inputs=Ae(t.inputs,r),i.outputs=Ae(t.outputs),l&&l.forEach((e=>e(i))),i.directiveDefs=s?()=>("function"==typeof s?s():s).map(Ee).filter(Te):null,i.pipeDefs=s?()=>("function"==typeof s?s():s).map(Re).filter(Te):null,i}))}function xe(e,t,n){const o=e.ɵcmp;o.directiveDefs=()=>("function"==typeof t?t():t).map(Ee),o.pipeDefs=()=>("function"==typeof n?n():n).map(Re)}function Ee(e){return Pe(e)||je(e)}function Te(e){return null!==e}function Ne(e){return pe((()=>({type:e.type,bootstrap:e.bootstrap||ye,declarations:e.declarations||ye,imports:e.imports||ye,exports:e.exports||ye,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null})))}function ke(e,t){return pe((()=>{const n=$e(e,!0);n.declarations=t.declarations||ye,n.imports=t.imports||ye,n.exports=t.exports||ye}))}function Ae(e,t){if(null==e)return me;const n={};for(const o in e)if(e.hasOwnProperty(o)){let r=e[o],i=r;Array.isArray(r)&&(i=r[1],r=r[0]),n[r]=o,t&&(t[r]=i)}return n}const Se=Ce;function Oe(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function Pe(e){return e[ve]||null}function je(e){return e[we]||null}function Re(e){return e[De]||null}function Fe(e){const t=Pe(e)||je(e)||Re(e);return null!==t&&t.standalone}function $e(e,t){const n=e[_e]||null;if(!n&&!0===t)throw new Error(`Type ${i(e)} does not have 'ɵmod' property.`);return n}const Ve=20,Le=22,He=10;function Be(e){return Array.isArray(e)&&"object"==typeof e[1]}function Ue(e){return Array.isArray(e)&&!0===e[1]}function ze(e){return 0!=(4&e.flags)}function qe(e){return e.componentOffset>-1}function We(e){return 1==(1&e.flags)}function Ze(e){return null!==e.template}function Qe(e,t){Ge(e,t[1])}function Ge(e,t){Ke(e),e.hasOwnProperty("tView_")&&C(e.tView_,t,"This TNode does not belong to this TView.")}function Ke(e){O(e,"TNode must be defined"),e&&"object"==typeof e&&e.hasOwnProperty("directiveStylingLast")||P("Not of type TNode, got: "+e)}function Je(e){O(e,"Expected TIcu to be defined"),"number"!=typeof e.currentCaseLViewIndex&&P("Object is not of TIcu type.")}function Ye(e){O(e,"currentTNode should exist!"),O(e.parent,"currentTNode should have a parent")}function Xe(e){O(e,"LContainer must be defined"),C(Ue(e),!0,"Expecting LContainer")}function et(e){e&&C(Be(e),!0,"Expecting LView or undefined or null")}function tt(e){O(e,"LView must be defined"),C(Be(e),!0,"Expecting LView")}function nt(e,t){C(e.firstCreatePass,!0,t||"Should only be called in first create pass.")}function ot(e,t){C(e.firstUpdatePass,!0,t||"Should only be called in first update pass.")}function rt(e,t){it(e[1].expandoStartIndex,e.length,t)}function it(e,t,n){e<=n&&n{gt=e},yt=function(e,t,n){null!=gt&>(e,t,n)},vt="math";function wt(e){for(;Array.isArray(e);)e=e[0];return e}function Dt(e,t){return ngDevMode&&R(t,e),ngDevMode&&S(e,Le,"Expected to be past HEADER_OFFSET"),wt(t[e])}function _t(e,t){ngDevMode&&Qe(e,t),ngDevMode&&R(t,e.index);return wt(t[e.index])}function Mt(e,t){ngDevMode&&A(t,-1,"wrong index for TNode"),ngDevMode&&N(t,e.data.length,"wrong index for TNode");const n=e.data[t];return ngDevMode&&null!==n&&Ke(n),n}function bt(e,t){return ngDevMode&&R(e,t),e[t]}function It(e,t){ngDevMode&&R(t,e);const n=t[e];return Be(n)?n:n[0]}function Ct(e){return 4==(4&e[2])}function xt(e){return 64==(64&e[2])}function Et(e,t){return null==t?null:(ngDevMode&&R(e,t),e[t])}function Tt(e){e[18]=0}function Nt(e,t){e[5]+=t;let n=e,o=e[3];for(;null!==o&&(1===t&&1===n[5]||-1===t&&0===n[5]);)o[5]+=t,n=o,o=o[3]}const kt={lFrame:cn(null),bindingsEnabled:!0};let At=!1;function St(){return kt.bindingsEnabled}function Ot(){kt.bindingsEnabled=!0}function Pt(){kt.bindingsEnabled=!1}function jt(){return kt.lFrame.lView}function Rt(){return kt.lFrame.tView}function Ft(e){return kt.lFrame.contextLView=e,e[8]}function $t(e){return kt.lFrame.contextLView=null,e}function Vt(){let e=Lt();for(;null!==e&&64===e.type;)e=e.parent;return e}function Lt(){return kt.lFrame.currentTNode}function Ht(){const e=kt.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}function Bt(e,t){ngDevMode&&e&&Ge(e,kt.lFrame.tView);const n=kt.lFrame;n.currentTNode=e,n.isParent=t}function Ut(){return kt.lFrame.isParent}function zt(){kt.lFrame.isParent=!1}function qt(){return!ngDevMode&&P("Must never be called in production mode"),At}function Wt(e){!ngDevMode&&P("Must never be called in production mode"),At=e}function Zt(){const e=kt.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Qt(){return kt.lFrame.bindingIndex}function Gt(e){return kt.lFrame.bindingIndex=e}function Kt(){return kt.lFrame.bindingIndex++}function Jt(e){const t=kt.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function Yt(e){kt.lFrame.inI18n=e}function Xt(e,t){const n=kt.lFrame;n.bindingIndex=n.bindingRootIndex=e,en(t)}function en(e){kt.lFrame.currentDirectiveIndex=e}function tn(e){const t=kt.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function nn(){return kt.lFrame.currentQueryIndex}function on(e){kt.lFrame.currentQueryIndex=e}function rn(e){const t=e[1];return 2===t.type?(ngDevMode&&O(t.declTNode,"Embedded TNodes should have declaration parents."),t.declTNode):1===t.type?e[6]:null}function sn(t,n,o){if(ngDevMode&&et(t),o&e.InjectFlags.SkipSelf){ngDevMode&&Ge(n,t[1]);let r=n,i=t;for(;!(ngDevMode&&O(r,"Parent TNode should be defined"),r=r.parent,null!==r||o&e.InjectFlags.Host||(r=rn(i),null===r)||(ngDevMode&&O(i,"Parent LView should be defined"),i=i[15],10&r.type)););if(null===r)return!1;n=r,t=i}ngDevMode&&Qe(n,t);const r=kt.lFrame=an();return r.currentTNode=n,r.lView=t,!0}function ln(e){ngDevMode&&x(e[0],e[1],"????"),ngDevMode&&et(e);const t=an();ngDevMode&&(C(t.isParent,!0,"Expected clean LFrame"),C(t.lView,null,"Expected clean LFrame"),C(t.tView,null,"Expected clean LFrame"),C(t.selectedIndex,-1,"Expected clean LFrame"),C(t.elementDepthCount,0,"Expected clean LFrame"),C(t.currentDirectiveIndex,-1,"Expected clean LFrame"),C(t.currentNamespace,null,"Expected clean LFrame"),C(t.bindingRootIndex,-1,"Expected clean LFrame"),C(t.currentQueryIndex,0,"Expected clean LFrame"));const n=e[1];kt.lFrame=t,ngDevMode&&n.firstChild&&Ge(n.firstChild,n),t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function an(){const e=kt.lFrame,t=null===e?null:e.child;return null===t?cn(e):t}function cn(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function un(){const e=kt.lFrame;return kt.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const dn=un;function fn(){const e=un();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function pn(e){return(kt.lFrame.contextLView=function(e,t){for(;e>0;)ngDevMode&&O(t[15],"Declaration view should be defined if nesting level is greater than 0."),t=t[15],e--;return t}(e,kt.lFrame.contextLView))[8]}function hn(){return kt.lFrame.selectedIndex}function gn(e){ngDevMode&&-1!==e&&S(e,Le,"Index must be past HEADER_OFFSET (or -1)."),ngDevMode&&N(e,kt.lFrame.lView.length,"Can't set index passed end of LView"),kt.lFrame.selectedIndex=e}function mn(){const e=kt.lFrame;return Mt(e.tView,e.selectedIndex)}function yn(){kt.lFrame.currentNamespace="svg"}function vn(){kt.lFrame.currentNamespace=vt}function wn(){kt.lFrame.currentNamespace=null}function Dn(e,t){ngDevMode&&nt(e);for(let n=t.directiveStart,o=t.directiveEnd;n=o)break}else{t[a]<0&&(e[18]+=65536),(l>11>16&&(3&e[2])===t){e[2]+=2048,yt(4,s,i);try{i.call(s)}finally{yt(5,s,i)}}}else{yt(4,s,i);try{i.call(s)}finally{yt(5,s,i)}}}const xn=-1;class En{constructor(e,t,n){this.factory=e,this.resolving=!1,ngDevMode&&O(e,"Factory not specified"),ngDevMode&&C(typeof e,"function","Expected factory function."),this.canSeeViewProviders=t,this.injectImpl=n}}function Tn(e){let t="";return 1&e&&(t+="|Text"),2&e&&(t+="|Element"),4&e&&(t+="|Container"),8&e&&(t+="|ElementContainer"),16&e&&(t+="|Projection"),32&e&&(t+="|IcuContainer"),64&e&&(t+="|Placeholder"),t.length>0?t.substring(1):t}function Nn(e,t,n){O(e,"should be called with a TNode"),0==(e.type&t)&&P(n||`Expected [${Tn(t)}] but got ${Tn(e.type)}.`)}function kn(e,t,n){let o=0;for(;ot){s=i-1;break}}}for(;i>16;let o=t;for(;n>0;)o=o[15],n--;return o}let $n=!0;function Vn(e){const t=$n;return $n=e,t}let Ln=0;const Hn={};function Bn(e,t){const n=zn(e,t);if(-1!==n)return n;const o=t[1];o.firstCreatePass&&(e.injectorIndex=t.length,Un(o.data,e),Un(t,null),Un(o.blueprint,null));const r=qn(e,t),i=e.injectorIndex;if(jn(r)){const e=Rn(r),n=Fn(r,t),o=n[1].data;for(let r=0;r<8;r++)t[i+r]=n[e+r]|o[e+r]}return t[i+8]=r,i}function Un(e,t){e.push(0,0,0,0,0,0,0,0,t)}function zn(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:(ngDevMode&&R(t,e.injectorIndex),e.injectorIndex)}function qn(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,o=null,r=t;for(;null!==r;){if(o=so(r),null===o)return xn;if(ngDevMode&&o&&Qe(o,r[15]),n++,r=r[15],-1!==o.injectorIndex)return o.injectorIndex|n<<16}return xn}function Wn(e,t,n){!function(e,t,n){let o;ngDevMode&&C(t.firstCreatePass,!0,"expected firstCreatePass to be true"),"string"==typeof n?o=n.charCodeAt(0)||0:n.hasOwnProperty(be)&&(o=n[be]),null==o&&(o=n[be]=Ln++);const r=255&o,i=1<>5)]|=i}(e,t,n)}function Zn(t,n,o){if(o&e.InjectFlags.Optional||void 0!==t)return t;D(n,"NodeInjector")}function Qn(t,n,o,r){if(o&e.InjectFlags.Optional&&void 0===r&&(r=null),0==(o&(e.InjectFlags.Self|e.InjectFlags.Host))){const i=t[9],s=K(void 0);try{return i?i.get(n,r,o&e.InjectFlags.Optional):J(n,r,o&e.InjectFlags.Optional)}finally{K(s)}}return Zn(r,n,o)}function Gn(t,n,o,r=e.InjectFlags.Default,i){if(null!==t){if(1024&n[2]){const i=function(t,n,o,r,i){let s=t,l=n;for(;null!==s&&null!==l&&1024&l[2]&&!(256&l[2]);){ngDevMode&&Qe(s,l);const t=Kn(s,l,o,r|e.InjectFlags.Self,Hn);if(t!==Hn)return t;let n=s.parent;if(!n){const e=l[21];if(e){const t=e.get(o,Hn,r);if(t!==Hn)return t}n=so(l),l=l[15]}s=n}return i}(t,n,o,r,Hn);if(i!==Hn)return i}const i=Kn(t,n,o,r,Hn);if(i!==Hn)return i}return Qn(n,o,r,i)}function Kn(t,n,o,r,i){const s=function(e){if(ngDevMode&&O(e,"token must be defined"),"string"==typeof e)return e.charCodeAt(0)||0;const t=e.hasOwnProperty(be)?e[be]:void 0;return"number"==typeof t?t>=0?255&t:(ngDevMode&&C(t,-1,"Expecting to get Special Injector Id"),oo):t}(o);if("function"==typeof s){if(!sn(n,t,r))return r&e.InjectFlags.Host?Zn(i,o,r):Qn(n,o,r,i);try{const t=s(r);if(null!=t||r&e.InjectFlags.Optional)return t;D(o)}finally{dn()}}else if("number"==typeof s){let i=null,l=zn(t,n),a=xn,c=r&e.InjectFlags.Host?n[16][6]:null;for((-1===l||r&e.InjectFlags.SkipSelf)&&(a=-1===l?qn(t,n):n[l+8],a!==xn&&to(r,!1)?(i=n[1],l=Rn(a),n=Fn(a,n)):l=-1);-1!==l;){ngDevMode&<(n,l);const e=n[1];if(ngDevMode&&Qe(e.data[l+8],n),eo(s,l,e.data)){const e=Jn(l,n,o,i,r,c);if(e!==Hn)return e}a=n[l+8],a!==xn&&to(r,n[1].data[l+8]===c)&&eo(s,l,n)?(i=e,l=Rn(a),n=Fn(a,n)):l=-1}}return i}function Jn(t,n,o,r,i,s){const l=n[1],a=l.data[t+8],c=Yn(a,l,o,null==r?qe(a)&&$n:r!=l&&0!=(3&a.type),i&e.InjectFlags.Host&&s===a);return null!==c?Xn(n,l,c,a):Hn}function Yn(e,t,n,o,r){const i=e.providerIndexes,s=t.data,l=1048575&i,a=e.directiveStart,c=e.directiveEnd,u=i>>20,d=r?l+u:c;for(let e=o?l:l+u;e=a&&t.type===n)return e}if(r){const e=s[a];if(e&&Ze(e)&&e.type===n)return a}return null}function Xn(t,n,o,r){let i=t[o];const s=n.data;if(i instanceof En){const l=i;l.resolving&&y(m(s[o]));const a=Vn(l.canSeeViewProviders);l.resolving=!0;const c=l.injectImpl?K(l.injectImpl):null,u=sn(t,r,e.InjectFlags.Default);ngDevMode&&C(u,!0,"Because flags do not contain `SkipSelf' we expect this to always succeed.");try{i=t[o]=l.factory(void 0,s,t,r),n.firstCreatePass&&o>=r.directiveStart&&(ngDevMode&&function(e){void 0!==e.type&&null!=e.selectors&&void 0!==e.inputs||P("Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.")}(s[o]),function(e,t,n){ngDevMode&&nt(n);const{ngOnChanges:o,ngOnInit:r,ngDoCheck:i}=t.type.prototype;if(o){const o=dt(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,o),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,o)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,r),i&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,i))}(o,s[o],n))}finally{null!==c&&K(c),Vn(a),l.resolving=!1,dn()}}return i}function eo(e,t,n){const o=1<>5)]&o)}function to(t,n){return!(t&e.InjectFlags.Self||t&e.InjectFlags.Host&&n)}class no{constructor(e,t){this._tNode=e,this._lView=t}get(e,t,n){return Gn(this._tNode,this._lView,e,ce(n),t)}}function oo(){return new no(Vt(),jt())}function ro(e){return pe((()=>{const t=e.prototype.constructor,n=t[Me]||io(t),o=Object.prototype;let r=Object.getPrototypeOf(e.prototype).constructor;for(;r&&r!==o;){const e=r[Me]||io(r);if(e&&e!==n)return e;r=Object.getPrototypeOf(r)}return e=>new e}))}function io(e){return u(e)?()=>{const t=io(c(e));return t&&t()}:at(e)}function so(e){const t=e[1],n=t.type;return 2===n?(ngDevMode&&O(t.declTNode,"Embedded TNodes should have declaration parents."),t.declTNode):1===n?e[6]:null}function lo(e){return function(e,t){if(ngDevMode&&Nn(e,15),ngDevMode&&O(e,"expecting tNode"),"class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const e=n.length;let o=0;for(;o{const i=po(t);function s(...e){if(this instanceof s)return i.call(this,...e),this;const t=new s(...e);return function(n){r&&r(n,...e);return(n.hasOwnProperty(ao)?n[ao]:Object.defineProperty(n,ao,{value:[]})[ao]).push(t),o&&o(n),n}}return n&&(s.prototype=Object.create(n.prototype)),s.prototype.ngMetadataName=e,s.annotationCls=s,s}))}function po(e){return function(...t){if(e){const n=e(...t);for(const e in n)this[e]=n[e]}}}function ho(e,t,n){return pe((()=>{const o=po(t);function r(...e){if(this instanceof r)return o.apply(this,e),this;const t=new r(...e);return n.annotation=t,n;function n(e,n,o){const r=e.hasOwnProperty(co)?e[co]:Object.defineProperty(e,co,{value:[]})[co];for(;r.length<=o;)r.push(null);return(r[o]=r[o]||[]).push(t),e}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=e,r.annotationCls=r,r}))}function go(e,t,n,o){return pe((()=>{const r=po(t);function i(...e){if(this instanceof i)return r.apply(this,e),this;const t=new i(...e);return function(n,r){const i=n.constructor,s=i.hasOwnProperty(uo)?i[uo]:Object.defineProperty(i,uo,{value:{}})[uo];s[r]=s.hasOwnProperty(r)&&s[r]||[],s[r].unshift(t),o&&o(n,r,...e)}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=e,i.annotationCls=i,i}))}const mo=ho("Attribute",(e=>({attributeName:e,__NG_ELEMENT_ID__:()=>lo(e)})));class yo{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.ɵprov=void 0,"number"==typeof t?(("undefined"==typeof ngDevMode||ngDevMode)&&N(t,0,"Only negative numbers are supported here"),this.__NG_ELEMENT_ID__=t):void 0!==t&&(this.ɵprov=$({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}const vo=new yo("AnalyzeForEntryComponents");class wo{}const Do=go("ContentChildren",((e,t={})=>({selector:e,first:!1,isViewQuery:!1,descendants:!1,emitDistinctChangesOnly:true,...t})),wo),_o=go("ContentChild",((e,t={})=>({selector:e,first:!0,isViewQuery:!1,descendants:!0,...t})),wo),Mo=go("ViewChildren",((e,t={})=>({selector:e,first:!1,isViewQuery:!0,descendants:!0,emitDistinctChangesOnly:true,...t})),wo),bo=go("ViewChild",((e,t)=>({selector:e,first:!0,isViewQuery:!0,descendants:!0,...t})),wo);var Io,Co,xo;function Eo(e){const t=Y.ng;if(t&&t.ɵcompilerFacade)return t.ɵcompilerFacade;if("undefined"==typeof ngDevMode||ngDevMode){console.error(`JIT compilation failed for ${e.kind}`,e.type);let t=`The ${e.kind} '${e.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\n\n`;throw 1===e.usage?(t+=`The ${e.kind} is part of a library that has been partially compiled.\n`,t+="However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n",t+="\n",t+="Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\n"):t+="JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\n",t+="Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\n",t+="or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.",new Error(t)}throw new Error("JIT compiler unavailable")}e["ɵɵFactoryTarget"]=void 0,(Io=e["ɵɵFactoryTarget"]||(e["ɵɵFactoryTarget"]={}))[Io.Directive=0]="Directive",Io[Io.Component=1]="Component",Io[Io.Injectable=2]="Injectable",Io[Io.Pipe=3]="Pipe",Io[Io.NgModule=4]="NgModule",function(e){e[e.Directive=0]="Directive",e[e.Pipe=1]="Pipe",e[e.NgModule=2]="NgModule"}(Co||(Co={})),function(e){e[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom"}(xo||(xo={}));const To=Function;function No(e){return"function"==typeof e}function ko(e){return e.flat(Number.POSITIVE_INFINITY)}function Ao(e,t){e.forEach((e=>Array.isArray(e)?Ao(e,t):t(e)))}function So(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function Oo(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Po(e,t){const n=[];for(let o=0;o=0?e[1|o]=n:(o=~o,function(e,t,n,o){ngDevMode&&k(t,e.length,"Can't insert past array end.");let r=e.length;if(r==t)e.push(n,o);else if(1===r)e.push(o,e[0]),e[0]=n;else{for(r--,e.push(e[r-1],e[r]);r>t;){const t=r-2;e[r]=e[t],r--}e[t]=n,e[t+1]=o}}(e,o,t,n)),o}function Ro(e,t){const n=Fo(e,t);if(n>=0)return e[1|n]}function Fo(e,t){return function(e,t,n){ngDevMode&&C(Array.isArray(e),!0,"Expecting an array");let o=0,r=e.length>>n;for(;r!==o;){const i=o+(r-o>>1),s=e[i<t?r=i:o=i+1}return~(r<new e(...t)}_zipTypesAndAnnotations(e,t){let n;n=Po(void 0===e?t.length:e.length);for(let o=0;oe&&e.type)),o=e.map((e=>e&&Uo(e.decorators)));return this._zipTypesAndAnnotations(t,o)}const o=e.hasOwnProperty(co)&&e[co],r=this._reflect&&this._reflect.getOwnMetadata&&this._reflect.getOwnMetadata("design:paramtypes",e);return r||o?this._zipTypesAndAnnotations(r,o):Po(e.length)}parameters(e){if(!No(e))return[];const t=zo(e);let n=this._ownParameters(e,t);return n||t===Object||(n=this.parameters(t)),n||[]}_ownAnnotations(e,t){if(e.annotations&&e.annotations!==t.annotations){let t=e.annotations;return"function"==typeof t&&t.annotations&&(t=t.annotations),t}return e.decorators&&e.decorators!==t.decorators?Uo(e.decorators):e.hasOwnProperty(ao)?e[ao]:null}annotations(e){if(!No(e))return[];const t=zo(e),n=this._ownAnnotations(e,t)||[];return(t!==Object?this.annotations(t):[]).concat(n)}_ownPropMetadata(e,t){if(e.propMetadata&&e.propMetadata!==t.propMetadata){let t=e.propMetadata;return"function"==typeof t&&t.propMetadata&&(t=t.propMetadata),t}if(e.propDecorators&&e.propDecorators!==t.propDecorators){const t=e.propDecorators,n={};return Object.keys(t).forEach((e=>{n[e]=Uo(t[e])})),n}return e.hasOwnProperty(uo)?e[uo]:null}propMetadata(e){if(!No(e))return{};const t=zo(e),n={};if(t!==Object){const e=this.propMetadata(t);Object.keys(e).forEach((t=>{n[t]=e[t]}))}const o=this._ownPropMetadata(e,t);return o&&Object.keys(o).forEach((e=>{const t=[];n.hasOwnProperty(e)&&t.push(...n[e]),t.push(...o[e]),n[e]=t})),n}ownPropMetadata(e){return No(e)&&this._ownPropMetadata(e,zo(e))||{}}hasLifecycleHook(e,t){return e instanceof To&&t in e.prototype}}function Uo(e){return e?e.map((e=>new(0,e.type.annotationCls)(...e.args?e.args:[]))):[]}function zo(e){const t=e.prototype?Object.getPrototypeOf(e.prototype):null;return(t?t.constructor:null)||Object}const qo=de(ho("Inject",(e=>({token:e}))),-1),Wo=de(ho("Optional"),8),Zo=de(ho("Self"),2),Qo=de(ho("SkipSelf"),4),Go=de(ho("Host"),1);let Ko=null;function Jo(){return Ko=Ko||new Bo}function Yo(e){return Xo(Jo().parameters(e))}function Xo(e){return e.map((e=>function(e){const t={token:null,attribute:null,host:!1,optional:!1,self:!1,skipSelf:!1};if(Array.isArray(e)&&e.length>0)for(let n=0;n{const r=[];e.templateUrl&&r.push(o(e.templateUrl).then((t=>{e.template=t})));const i=e.styleUrls,s=e.styles||(e.styles=[]),l=e.styles.length;i&&i.forEach(((t,n)=>{s.push(""),r.push(o(t).then((o=>{s[l+n]=o,i.splice(i.indexOf(t),1),0==i.length&&(e.styleUrls=void 0)})))}));const a=Promise.all(r).then((()=>function(e){nr.delete(e)}(n)));t.push(a)})),rr(),Promise.all(t).then((()=>{}))}let tr=new Map;const nr=new Set;function or(e){return!!(e.templateUrl&&!e.hasOwnProperty("template")||e.styleUrls&&e.styleUrls.length)}function rr(){const e=tr;return tr=new Map,e}function ir(e){return"string"==typeof e?e:e.text()}const sr=new Map;let lr=!0;function ar(e,t){!function(e,t,n){if(t&&t!==n&&lr)throw new Error(`Duplicate module registered for ${e} - ${i(t)} vs ${i(t.name)}`)}(t,sr.get(t)||null,e),sr.set(t,e)}function cr(e){return sr.get(e)}const ur={name:"custom-elements"},dr={name:"no-errors-schema"};let fr=!1;let pr=!1;function hr(e,t,n,o){t||4!==n||(t="ng-template");const r=yr(o);let i=`Can't bind to '${e}' since it isn't a known property of '${t}'${vr(o)}.`;const s=`'${r?"@Component":"@NgModule"}.schemas'`,l=r?"included in the '@Component.imports' of this component":"a part of an @NgModule where this component is declared";if(wr.has(e)){i+=`\nIf the '${e}' is an Angular control flow directive, please make sure that either the '${wr.get(e)}' directive or the 'CommonModule' is ${l}.`}else i+=`\n1. If '${t}' is an Angular component and it has the '${e}' input, then verify that it is ${l}.`,t&&t.indexOf("-")>-1?(i+=`\n2. If '${t}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${s} of this component to suppress this message.`,i+=`\n3. To allow any property add 'NO_ERRORS_SCHEMA' to the ${s} of this component.`):i+=`\n2. To allow any property add 'NO_ERRORS_SCHEMA' to the ${s} of this component.`;gr(i)}function gr(e){if(pr)throw new p(303,e);console.error(h(303,e))}function mr(e){!ngDevMode&&P("Must never be called in production mode");const t=e[16][8];return t&&t.constructor?Pe(t.constructor):null}function yr(e){!ngDevMode&&P("Must never be called in production mode");return!!mr(e)?.standalone}function vr(e){!ngDevMode&&P("Must never be called in production mode");const t=mr(e)?.type?.name;return t?` (used in the '${t}' component template)`:""}const wr=new Map([["ngIf","NgIf"],["ngFor","NgFor"],["ngSwitchCase","NgSwitchCase"],["ngSwitchDefault","NgSwitchDefault"]]);function Dr(e,t){if(null!==e)for(let n=0;n-1)return!0}return!1}var _r;e.RendererStyleFlags2=void 0,(_r=e.RendererStyleFlags2||(e.RendererStyleFlags2={}))[_r.Important=1]="Important",_r[_r.DashCase=2]="DashCase";const Mr=/^>|^->||--!>|)/;function Ir(e){return e.replace(Mr,(e=>e.replace(br,"​$1​")))}const Cr=new Map;let xr=0;function Er(e){return ngDevMode&&_(e,"ID used for LView lookup must be a number"),Cr.get(e)||null}class Tr{constructor(e,t,n){this.lViewId=e,this.nodeIndex=t,this.native=n}get lView(){return Er(this.lViewId)}}function Nr(e){let t=Or(e);if(t){if(Be(t)){const o=t;let r,i,s;if(jr(e)){if(r=$r(o,e),-1==r)throw new Error("The provided component was not found in the application");i=e}else if((n=e)&&n.constructor&&n.constructor.ɵdir){if(r=function(e,t){let n=e[1].firstChild;for(;n;){const o=n.directiveStart,r=n.directiveEnd;for(let i=o;i=0){const e=wt(o[r]),n=kr(o,r,e);Sr(e,n),t=n;break}}}}var n;return t||null}function kr(e,t,n){return new Tr(e[Ve],t,n)}function Ar(e){let t,n=Or(e);if(Be(n)){const o=n,r=$r(o,e);t=It(r,o);const i=kr(o,r,t[0]);i.component=e,Sr(e,i),Sr(i.native,i)}else{const e=n,o=e.lView;ngDevMode&&tt(o),t=It(e.nodeIndex,o)}return t}function Sr(e,t){var n;ngDevMode&&O(e,"Target expected"),Be(t)?(e.__ngContext__=t[Ve],n=t,ngDevMode&&_(n[Ve],"LView must have an ID in order to be registered"),Cr.set(n[Ve],n)):e.__ngContext__=t}function Or(e){ngDevMode&&O(e,"Target expected");const t=e.__ngContext__;return"number"==typeof t?Er(t):t||null}function Pr(e){const t=Or(e);return t?Be(t)?t:t.lView:null}function jr(e){return e&&e.constructor&&e.constructor.ɵcmp}function Rr(e,t){const n=e[1];for(let o=Le;o0&&(n[r-1][4]=t),o0&&(e[n-1][4]=o[4]);const s=Oo(e,He+t);bi(o[1],r=o,r[11],2,null,null),r[0]=null,r[6]=null;const l=s[19];null!==l&&l.detachView(s[1]),o[3]=null,o[4]=null,o[2]&=-65}var r;return o}function ti(e,t){if(!(128&t[2])){const n=t[11];n.destroyNode&&bi(e,t,n,3,null,null),function(e){let t=e[13];if(!t)return ni(e[1],e);for(;t;){let n=null;if(Be(t))n=t[13];else{ngDevMode&&Xe(t);const e=t[10];e&&(n=e)}if(!n){for(;t&&!t[4]&&t!==e;)Be(t)&&ni(t[1],t),t=t[3];null===t&&(t=e),Be(t)&&ni(t[1],t),n=t&&t[4]}t=n}}(t)}}function ni(e,t){if(!(128&t[2])){t[2]&=-65,t[2]|=128,function(e,t){let n;if(null!=e&&null!=(n=e.destroyHooks))for(let e=0;e=0?o[r=t]():o[r=-t].unsubscribe(),e+=2}else{const t=o[r=n[e+1]];n[e].call(t)}if(null!==o){for(let e=r+1;e-1){ngDevMode&&Qe(r,o);const{encapsulation:i}=t.data[r.directiveStart+n];if(i===e.ViewEncapsulation.None||i===e.ViewEncapsulation.Emulated)return null}return _t(r,o)}}function ii(e,t,n,o,r){ngDevMode&&ngDevMode.rendererInsertBefore++,e.insertBefore(t,n,o,r)}function si(e,t,n){ngDevMode&&ngDevMode.rendererAppendChild++,ngDevMode&&O(t,"parent node must be defined"),e.appendChild(t,n)}function li(e,t,n,o,r){null!==o?ii(e,t,n,o,r):si(e,t,n)}function ai(e,t){return e.parentNode(t)}function ci(e,t,n){return gi(e,t,n)}function ui(e,t,n){return 40&e.type?_t(e,n):null}let di,fi,pi,hi,gi=ui;function mi(e,t){gi=e,di=t}function yi(e,t,n,o){const r=oi(e,o,t),i=t[11],s=ci(o.parent||t[6],o,t);if(null!=r)if(Array.isArray(n))for(let e=0;e) must have projection slots defined.")}(e),n.projection[o]}return null}function Di(e,t){const n=He+e+1;if(ne,createScript:e=>e,createScriptURL:e=>e})}catch{}return fi}function Ti(e){return Ei()?.createHTML(e)||e}function Ni(e,t,n){const o=jt(),r=mn(),i=_t(r,o);if(2===r.type&&"iframe"===t.toLowerCase()){const e=i;e.src="",e.srcdoc=Ti(""),_i(o[11],e);const t=ngDevMode&&`Angular has detected that the \`${n}\` was applied as a binding to an