PageSourceSearch

https://ghostkollective.com/vendor-es2015.js

js ghostkollective.com collected 2026-10-07 00:07:13 UTC 2,468,576 bytes, 58,579 lines download raw bytes

1(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["vendor"],{
2
3/***/ "/d8p":
4/*!*****************************************************************!*\
5  !*** ./node_modules/rxjs/_esm2015/internal/operators/repeat.js ***!
6  \*****************************************************************/
7/*! exports provided: repeat */
8/***/ (function(module, __webpack_exports__, __webpack_require__) {
9
10"use strict";
11__webpack_require__.r(__webpack_exports__);
12/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; });
13/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
14/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/empty */ "EY2u");
15
16
17function repeat(count = -1) {
18    return (source) => {
19        if (count === 0) {
20            return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_1__["empty"])();
21        }
22        else if (count < 0) {
23            return source.lift(new RepeatOperator(-1, source));
24        }
25        else {
26            return source.lift(new RepeatOperator(count - 1, source));
27        }
28    };
29}
30class RepeatOperator {
31    constructor(count, source) {
32        this.count = count;
33        this.source = source;
34    }
35    call(subscriber, source) {
36        return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
37    }
38}
39class RepeatSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
40    constructor(destination, count, source) {
41        super(destination);
42        this.count = count;
43        this.source = source;
44    }
45    complete() {
46        if (!this.isStopped) {
47            const { source, count } = this;
48            if (count === 0) {
49                return super.complete();
50            }
51            else if (count > -1) {
52                this.count = count - 1;
53            }
54            source.subscribe(this._unsubscribeAndRecycle());
55        }
56    }
57}
58//# sourceMappingURL=repeat.js.map
59
60/***/ }),
61
62/***/ "/uUt":
63/*!*******************************************************************************!*\
64  !*** ./node_modules/rxjs/_esm2015/internal/operators/distinctUntilChanged.js ***!
65  \*******************************************************************************/
66/*! exports provided: distinctUntilChanged */
67/***/ (function(module, __webpack_exports__, __webpack_require__) {
68
69"use strict";
70__webpack_require__.r(__webpack_exports__);
71/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return distinctUntilChanged; });
72/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
73
74function distinctUntilChanged(compare, keySelector) {
75    return (source) => source.lift(new DistinctUntilChangedOperator(compare, keySelector));
76}
77class DistinctUntilChangedOperator {
78    constructor(compare, keySelector) {
79        this.compare = compare;
80        this.keySelector = keySelector;
81    }
82    call(subscriber, source) {
83        return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));
84    }
85}
86class DistinctUntilChangedSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
87    constructor(destination, compare, keySelector) {
88        super(destination);
89        this.keySelector = keySelector;
90        this.hasKey = false;
91        if (typeof compare === 'function') {
92            this.compare = compare;
93        }
94    }
95    compare(x, y) {
96        return x === y;
97    }
98    _next(value) {
99        let key;
100        try {
101            const { keySelector } = this;
102            key = keySelector ? keySelector(value) : value;
103        }
104        catch (err) {
105            return this.destination.error(err);
106        }
107        let result = false;
108        if (this.hasKey) {
109            try {
110                const { compare } = this;
111                result = compare(this.key, key);
112            }
113            catch (err) {
114                return this.destination.error(err);
115            }
116        }
117        else {
118            this.hasKey = true;
119        }
120        if (!result) {
121            this.key = key;
122            this.destination.next(value);
123        }
124    }
125}
126//# sourceMappingURL=distinctUntilChanged.js.map
127
128/***/ }),
129
130/***/ "02Lk":
131/*!*******************************************************************!*\
132  !*** ./node_modules/rxjs/_esm2015/internal/operators/distinct.js ***!
133  \*******************************************************************/
134/*! exports provided: distinct, DistinctSubscriber */
135/***/ (function(module, __webpack_exports__, __webpack_require__) {
136
137"use strict";
138__webpack_require__.r(__webpack_exports__);
139/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; });
140/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DistinctSubscriber", function() { return DistinctSubscriber; });
141/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
142
143function distinct(keySelector, flushes) {
144    return (source) => source.lift(new DistinctOperator(keySelector, flushes));
145}
146class DistinctOperator {
147    constructor(keySelector, flushes) {
148        this.keySelector = keySelector;
149        this.flushes = flushes;
150    }
151    call(subscriber, source) {
152        return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));
153    }
154}
155class DistinctSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
156    constructor(destination, keySelector, flushes) {
157        super(destination);
158        this.keySelector = keySelector;
159        this.values = new Set();
160        if (flushes) {
161            this.add(Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(flushes, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this)));
162        }
163    }
164    notifyNext() {
165        this.values.clear();
166    }
167    notifyError(error) {
168        this._error(error);
169    }
170    _next(value) {
171        if (this.keySelector) {
172            this._useKeySelector(value);
173        }
174        else {
175            this._finalizeNext(value, value);
176        }
177    }
178    _useKeySelector(value) {
179        let key;
180        const { destination } = this;
181        try {
182            key = this.keySelector(value);
183        }
184        catch (err) {
185            destination.error(err);
186            return;
187        }
188        this._finalizeNext(key, value);
189    }
190    _finalizeNext(key, value) {
191        const { values } = this;
192        if (!values.has(key)) {
193            values.add(key);
194            this.destination.next(value);
195        }
196    }
197}
198//# sourceMappingURL=distinct.js.map
199
200/***/ }),
201
202/***/ "04ZW":
203/*!****************************************************************************!*\
204  !*** ./node_modules/rxjs/_esm2015/internal/observable/fromEventPattern.js ***!
205  \****************************************************************************/
206/*! exports provided: fromEventPattern */
207/***/ (function(module, __webpack_exports__, __webpack_require__) {
208
209"use strict";
210__webpack_require__.r(__webpack_exports__);
211/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return fromEventPattern; });
212/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
213/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
214/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ "n6bG");
215/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operators/map */ "lJxs");
216
217
218
219
220function fromEventPattern(addHandler, removeHandler, resultSelector) {
221    if (resultSelector) {
222        return fromEventPattern(addHandler, removeHandler).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(args => Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector(...args) : resultSelector(args)));
223    }
224    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
225        const handler = (...e) => subscriber.next(e.length === 1 ? e[0] : e);
226        let retValue;
227        try {
228            retValue = addHandler(handler);
229        }
230        catch (err) {
231            subscriber.error(err);
232            return undefined;
233        }
234        if (!Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(removeHandler)) {
235            return undefined;
236        }
237        return () => removeHandler(handler, retValue);
238    });
239}
240//# sourceMappingURL=fromEventPattern.js.map
241
242/***/ }),
243
244/***/ "05l1":
245/*!************************************************************************!*\
246  !*** ./node_modules/rxjs/_esm2015/internal/operators/publishReplay.js ***!
247  \************************************************************************/
248/*! exports provided: publishReplay */
249/***/ (function(module, __webpack_exports__, __webpack_require__) {
250
251"use strict";
252__webpack_require__.r(__webpack_exports__);
253/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return publishReplay; });
254/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ReplaySubject */ "jtHE");
255/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "oB13");
256
257
258function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {
259    if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {
260        scheduler = selectorOrScheduler;
261    }
262    const selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;
263    const subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler);
264    return (source) => Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(() => subject, selector)(source);
265}
266//# sourceMappingURL=publishReplay.js.map
267
268/***/ }),
269
270/***/ "0EUg":
271/*!********************************************************************!*\
272  !*** ./node_modules/rxjs/_esm2015/internal/operators/concatAll.js ***!
273  \********************************************************************/
274/*! exports provided: concatAll */
275/***/ (function(module, __webpack_exports__, __webpack_require__) {
276
277"use strict";
278__webpack_require__.r(__webpack_exports__);
279/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return concatAll; });
280/* harmony import */ var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeAll */ "bHdf");
281
282function concatAll() {
283    return Object(_mergeAll__WEBPACK_IMPORTED_MODULE_0__["mergeAll"])(1);
284}
285//# sourceMappingURL=concatAll.js.map
286
287/***/ }),
288
289/***/ "0Pi8":
290/*!******************************************************************!*\
291  !*** ./node_modules/rxjs/_esm2015/internal/operators/endWith.js ***!
292  \******************************************************************/
293/*! exports provided: endWith */
294/***/ (function(module, __webpack_exports__, __webpack_require__) {
295
296"use strict";
297__webpack_require__.r(__webpack_exports__);
298/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return endWith; });
299/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/concat */ "GyhO");
300/* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/of */ "LRne");
301
302
303function endWith(...array) {
304    return (source) => Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(source, Object(_observable_of__WEBPACK_IMPORTED_MODULE_1__["of"])(...array));
305}
306//# sourceMappingURL=endWith.js.map
307
308/***/ }),
309
310/***/ "128B":
311/*!*****************************************************************!*\
312  !*** ./node_modules/rxjs/_esm2015/internal/operators/reduce.js ***!
313  \*****************************************************************/
314/*! exports provided: reduce */
315/***/ (function(module, __webpack_exports__, __webpack_require__) {
316
317"use strict";
318__webpack_require__.r(__webpack_exports__);
319/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; });
320/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scan */ "Kqap");
321/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./takeLast */ "BFxc");
322/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./defaultIfEmpty */ "xbPD");
323/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/pipe */ "mCNh");
324
325
326
327
328function reduce(accumulator, seed) {
329    if (arguments.length >= 2) {
330        return function reduceOperatorFunctionWithSeed(source) {
331            return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(accumulator, seed), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1), Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__["defaultIfEmpty"])(seed))(source);
332        };
333    }
334    return function reduceOperatorFunction(source) {
335        return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])((acc, value, index) => accumulator(acc, value, index + 1)), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1))(source);
336    };
337}
338//# sourceMappingURL=reduce.js.map
339
340/***/ }),
341
342/***/ "1G5W":
343/*!********************************************************************!*\
344  !*** ./node_modules/rxjs/_esm2015/internal/operators/takeUntil.js ***!
345  \********************************************************************/
346/*! exports provided: takeUntil */
347/***/ (function(module, __webpack_exports__, __webpack_require__) {
348
349"use strict";
350__webpack_require__.r(__webpack_exports__);
351/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return takeUntil; });
352/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
353
354function takeUntil(notifier) {
355    return (source) => source.lift(new TakeUntilOperator(notifier));
356}
357class TakeUntilOperator {
358    constructor(notifier) {
359        this.notifier = notifier;
360    }
361    call(subscriber, source) {
362        const takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
363        const notifierSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(this.notifier, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](takeUntilSubscriber));
364        if (notifierSubscription && !takeUntilSubscriber.seenValue) {
365            takeUntilSubscriber.add(notifierSubscription);
366            return source.subscribe(takeUntilSubscriber);
367        }
368        return takeUntilSubscriber;
369    }
370}
371class TakeUntilSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
372    constructor(destination) {
373        super(destination);
374        this.seenValue = false;
375    }
376    notifyNext() {
377        this.seenValue = true;
378        this.complete();
379    }
380    notifyComplete() {
381    }
382}
383//# sourceMappingURL=takeUntil.js.map
384
385/***/ }),
386
387/***/ "1Ykd":
388/*!*********************************************************************!*\
389  !*** ./node_modules/rxjs/_esm2015/internal/operators/sampleTime.js ***!
390  \*********************************************************************/
391/*! exports provided: sampleTime */
392/***/ (function(module, __webpack_exports__, __webpack_require__) {
393
394"use strict";
395__webpack_require__.r(__webpack_exports__);
396/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return sampleTime; });
397/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
398/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
399
400
401function sampleTime(period, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]) {
402    return (source) => source.lift(new SampleTimeOperator(period, scheduler));
403}
404class SampleTimeOperator {
405    constructor(period, scheduler) {
406        this.period = period;
407        this.scheduler = scheduler;
408    }
409    call(subscriber, source) {
410        return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));
411    }
412}
413class SampleTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
414    constructor(destination, period, scheduler) {
415        super(destination);
416        this.period = period;
417        this.scheduler = scheduler;
418        this.hasValue = false;
419        this.add(scheduler.schedule(dispatchNotification, period, { subscriber: this, period }));
420    }
421    _next(value) {
422        this.lastValue = value;
423        this.hasValue = true;
424    }
425    notifyNext() {
426        if (this.hasValue) {
427            this.hasValue = false;
428            this.destination.next(this.lastValue);
429        }
430    }
431}
432function dispatchNotification(state) {
433    let { subscriber, period } = state;
434    subscriber.notifyNext();
435    this.schedule(state, period);
436}
437//# sourceMappingURL=sampleTime.js.map
438
439/***/ }),
440
441/***/ "1uah":
442/*!***************************************************************!*\
443  !*** ./node_modules/rxjs/_esm2015/internal/observable/zip.js ***!
444  \***************************************************************/
445/*! exports provided: zip, ZipOperator, ZipSubscriber */
446/***/ (function(module, __webpack_exports__, __webpack_require__) {
447
448"use strict";
449__webpack_require__.r(__webpack_exports__);
450/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; });
451/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipOperator", function() { return ZipOperator; });
452/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipSubscriber", function() { return ZipSubscriber; });
453/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fromArray */ "yCtX");
454/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
455/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
456/* harmony import */ var _internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../internal/symbol/iterator */ "Lhse");
457/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
458
459
460
461
462
463function zip(...observables) {
464    const resultSelector = observables[observables.length - 1];
465    if (typeof resultSelector === 'function') {
466        observables.pop();
467    }
468    return Object(_fromArray__WEBPACK_IMPORTED_MODULE_0__["fromArray"])(observables, undefined).lift(new ZipOperator(resultSelector));
469}
470class ZipOperator {
471    constructor(resultSelector) {
472        this.resultSelector = resultSelector;
473    }
474    call(subscriber, source) {
475        return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));
476    }
477}
478class ZipSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"] {
479    constructor(destination, resultSelector, values = Object.create(null)) {
480        super(destination);
481        this.resultSelector = resultSelector;
482        this.iterators = [];
483        this.active = 0;
484        this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : undefined;
485    }
486    _next(value) {
487        const iterators = this.iterators;
488        if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(value)) {
489            iterators.push(new StaticArrayIterator(value));
490        }
491        else if (typeof value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_3__["iterator"]] === 'function') {
492            iterators.push(new StaticIterator(value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_3__["iterator"]]()));
493        }
494        else {
495            iterators.push(new ZipBufferIterator(this.destination, this, value));
496        }
497    }
498    _complete() {
499        const iterators = this.iterators;
500        const len = iterators.length;
501        this.unsubscribe();
502        if (len === 0) {
503            this.destination.complete();
504            return;
505        }
506        this.active = len;
507        for (let i = 0; i < len; i++) {
508            let iterator = iterators[i];
509            if (iterator.stillUnsubscribed) {
510                const destination = this.destination;
511                destination.add(iterator.subscribe());
512            }
513            else {
514                this.active--;
515            }
516        }
517    }
518    notifyInactive() {
519        this.active--;
520        if (this.active === 0) {
521            this.destination.complete();
522        }
523    }
524    checkIterators() {
525        const iterators = this.iterators;
526        const len = iterators.length;
527        const destination = this.destination;
528        for (let i = 0; i < len; i++) {
529            let iterator = iterators[i];
530            if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {
531                return;
532            }
533        }
534        let shouldComplete = false;
535        const args = [];
536        for (let i = 0; i < len; i++) {
537            let iterator = iterators[i];
538            let result = iterator.next();
539            if (iterator.hasCompleted()) {
540                shouldComplete = true;
541            }
542            if (result.done) {
543                destination.complete();
544                return;
545            }
546            args.push(result.value);
547        }
548        if (this.resultSelector) {
549            this._tryresultSelector(args);
550        }
551        else {
552            destination.next(args);
553        }
554        if (shouldComplete) {
555            destination.complete();
556        }
557    }
558    _tryresultSelector(args) {
559        let result;
560        try {
561            result = this.resultSelector.apply(this, args);
562        }
563        catch (err) {
564            this.destination.error(err);
565            return;
566        }
567        this.destination.next(result);
568    }
569}
570class StaticIterator {
571    constructor(iterator) {
572        this.iterator = iterator;
573        this.nextResult = iterator.next();
574    }
575    hasValue() {
576        return true;
577    }
578    next() {
579        const result = this.nextResult;
580        this.nextResult = this.iterator.next();
581        return result;
582    }
583    hasCompleted() {
584        const nextResult = this.nextResult;
585        return Boolean(nextResult && nextResult.done);
586    }
587}
588class StaticArrayIterator {
589    constructor(array) {
590        this.array = array;
591        this.index = 0;
592        this.length = 0;
593        this.length = array.length;
594    }
595    [_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_3__["iterator"]]() {
596        return this;
597    }
598    next(value) {
599        const i = this.index++;
600        const array = this.array;
601        return i < this.length ? { value: array[i], done: false } : { value: null, done: true };
602    }
603    hasValue() {
604        return this.array.length > this.index;
605    }
606    hasCompleted() {
607        return this.array.length === this.index;
608    }
609}
610class ZipBufferIterator extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_4__["SimpleOuterSubscriber"] {
611    constructor(destination, parent, observable) {
612        super(destination);
613        this.parent = parent;
614        this.observable = observable;
615        this.stillUnsubscribed = true;
616        this.buffer = [];
617        this.isComplete = false;
618    }
619    [_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_3__["iterator"]]() {
620        return this;
621    }
622    next() {
623        const buffer = this.buffer;
624        if (buffer.length === 0 && this.isComplete) {
625            return { value: null, done: true };
626        }
627        else {
628            return { value: buffer.shift(), done: false };
629        }
630    }
631    hasValue() {
632        return this.buffer.length > 0;
633    }
634    hasCompleted() {
635        return this.buffer.length === 0 && this.isComplete;
636    }
637    notifyComplete() {
638        if (this.buffer.length > 0) {
639            this.isComplete = true;
640            this.parent.notifyInactive();
641        }
642        else {
643            this.destination.complete();
644        }
645    }
646    notifyNext(innerValue) {
647        this.buffer.push(innerValue);
648        this.parent.checkIterators();
649    }
650    subscribe() {
651        return Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_4__["innerSubscribe"])(this.observable, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_4__["SimpleInnerSubscriber"](this));
652    }
653}
654//# sourceMappingURL=zip.js.map
655
656/***/ }),
657
658/***/ "2QA8":
659/*!********************************************************************!*\
660  !*** ./node_modules/rxjs/_esm2015/internal/symbol/rxSubscriber.js ***!
661  \********************************************************************/
662/*! exports provided: rxSubscriber, $$rxSubscriber */
663/***/ (function(module, __webpack_exports__, __webpack_require__) {
664
665"use strict";
666__webpack_require__.r(__webpack_exports__);
667/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rxSubscriber", function() { return rxSubscriber; });
668/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$$rxSubscriber", function() { return $$rxSubscriber; });
669const rxSubscriber = (() => typeof Symbol === 'function'
670    ? Symbol('rxSubscriber')
671    : '@@rxSubscriber_' + Math.random())();
672const $$rxSubscriber = rxSubscriber;
673//# sourceMappingURL=rxSubscriber.js.map
674
675/***/ }),
676
677/***/ "2QGa":
678/*!*********************************************************************!*\
679  !*** ./node_modules/rxjs/_esm2015/internal/observable/partition.js ***!
680  \*********************************************************************/
681/*! exports provided: partition */
682/***/ (function(module, __webpack_exports__, __webpack_require__) {
683
684"use strict";
685__webpack_require__.r(__webpack_exports__);
686/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; });
687/* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/not */ "F97/");
688/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeTo */ "SeVD");
689/* harmony import */ var _operators_filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/filter */ "pLZG");
690/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Observable */ "HDdC");
691
692
693
694
695function partition(source, predicate, thisArg) {
696    return [
697        Object(_operators_filter__WEBPACK_IMPORTED_MODULE_2__["filter"])(predicate, thisArg)(new _Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(source))),
698        Object(_operators_filter__WEBPACK_IMPORTED_MODULE_2__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(new _Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(source)))
699    ];
700}
701//# sourceMappingURL=partition.js.map
702
703/***/ }),
704
705/***/ "2Vo4":
706/*!****************************************************************!*\
707  !*** ./node_modules/rxjs/_esm2015/internal/BehaviorSubject.js ***!
708  \****************************************************************/
709/*! exports provided: BehaviorSubject */
710/***/ (function(module, __webpack_exports__, __webpack_require__) {
711
712"use strict";
713__webpack_require__.r(__webpack_exports__);
714/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return BehaviorSubject; });
715/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ "XNiG");
716/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "9ppp");
717
718
719class BehaviorSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"] {
720    constructor(_value) {
721        super();
722        this._value = _value;
723    }
724    get value() {
725        return this.getValue();
726    }
727    _subscribe(subscriber) {
728        const subscription = super._subscribe(subscriber);
729        if (subscription && !subscription.closed) {
730            subscriber.next(this._value);
731        }
732        return subscription;
733    }
734    getValue() {
735        if (this.hasError) {
736            throw this.thrownError;
737        }
738        else if (this.closed) {
739            throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_1__["ObjectUnsubscribedError"]();
740        }
741        else {
742            return this._value;
743        }
744    }
745    next(value) {
746        super.next(this._value = value);
747    }
748}
749//# sourceMappingURL=BehaviorSubject.js.map
750
751/***/ }),
752
753/***/ "2fFW":
754/*!*******************************************************!*\
755  !*** ./node_modules/rxjs/_esm2015/internal/config.js ***!
756  \*******************************************************/
757/*! exports provided: config */
758/***/ (function(module, __webpack_exports__, __webpack_require__) {
759
760"use strict";
761__webpack_require__.r(__webpack_exports__);
762/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; });
763let _enable_super_gross_mode_that_will_cause_bad_things = false;
764const config = {
765    Promise: undefined,
766    set useDeprecatedSynchronousErrorHandling(value) {
767        if (value) {
768            const error = new Error();
769            console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
770        }
771        else if (_enable_super_gross_mode_that_will_cause_bad_things) {
772            console.log('RxJS: Back to a better error behavior. Thank you. <3');
773        }
774        _enable_super_gross_mode_that_will_cause_bad_things = value;
775    },
776    get useDeprecatedSynchronousErrorHandling() {
777        return _enable_super_gross_mode_that_will_cause_bad_things;
778    },
779};
780//# sourceMappingURL=config.js.map
781
782/***/ }),
783
784/***/ "32Ea":
785/*!********************************************************************!*\
786  !*** ./node_modules/rxjs/_esm2015/internal/operators/skipWhile.js ***!
787  \********************************************************************/
788/*! exports provided: skipWhile */
789/***/ (function(module, __webpack_exports__, __webpack_require__) {
790
791"use strict";
792__webpack_require__.r(__webpack_exports__);
793/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return skipWhile; });
794/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
795
796function skipWhile(predicate) {
797    return (source) => source.lift(new SkipWhileOperator(predicate));
798}
799class SkipWhileOperator {
800    constructor(predicate) {
801        this.predicate = predicate;
802    }
803    call(subscriber, source) {
804        return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
805    }
806}
807class SkipWhileSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
808    constructor(destination, predicate) {
809        super(destination);
810        this.predicate = predicate;
811        this.skipping = true;
812        this.index = 0;
813    }
814    _next(value) {
815        const destination = this.destination;
816        if (this.skipping) {
817            this.tryCallPredicate(value);
818        }
819        if (!this.skipping) {
820            destination.next(value);
821        }
822    }
823    tryCallPredicate(value) {
824        try {
825            const result = this.predicate(value, this.index++);
826            this.skipping = Boolean(result);
827        }
828        catch (err) {
829            this.destination.error(err);
830        }
831    }
832}
833//# sourceMappingURL=skipWhile.js.map
834
835/***/ }),
836
837/***/ "3E0/":
838/*!****************************************************************!*\
839  !*** ./node_modules/rxjs/_esm2015/internal/operators/delay.js ***!
840  \****************************************************************/
841/*! exports provided: delay */
842/***/ (function(module, __webpack_exports__, __webpack_require__) {
843
844"use strict";
845__webpack_require__.r(__webpack_exports__);
846/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return delay; });
847/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
848/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isDate */ "mlxB");
849/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
850/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Notification */ "WMd4");
851
852
853
854
855function delay(delay, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) {
856    const absoluteDelay = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_1__["isDate"])(delay);
857    const delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
858    return (source) => source.lift(new DelayOperator(delayFor, scheduler));
859}
860class DelayOperator {
861    constructor(delay, scheduler) {
862        this.delay = delay;
863        this.scheduler = scheduler;
864    }
865    call(subscriber, source) {
866        return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
867    }
868}
869class DelaySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"] {
870    constructor(destination, delay, scheduler) {
871        super(destination);
872        this.delay = delay;
873        this.scheduler = scheduler;
874        this.queue = [];
875        this.active = false;
vendor: 4,620 bytes, lines 876-1016
876        this.errored = false;
877    }
878    static dispatch(state) {
879        const source = state.source;
880        const queue = source.queue;
881        const scheduler = state.scheduler;
882        const destination = state.destination;
883        while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
884            queue.shift().notification.observe(destination);
885        }
886        if (queue.length > 0) {
887            const delay = Math.max(0, queue[0].time - scheduler.now());
888            this.schedule(state, delay);
889        }
890        else {
891            this.unsubscribe();
892            source.active = false;
893        }
894    }
895    _schedule(scheduler) {
896        this.active = true;
897        const destination = this.destination;
898        destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
899            source: this, destination: this.destination, scheduler: scheduler
900        }));
901    }
902    scheduleNotification(notification) {
903        if (this.errored === true) {
904            return;
905        }
906        const scheduler = this.scheduler;
907        const message = new DelayMessage(scheduler.now() + this.delay, notification);
908        this.queue.push(message);
909        if (this.active === false) {
910            this._schedule(scheduler);
911        }
912    }
913    _next(value) {
914        this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_3__["Notification"].createNext(value));
915    }
916    _error(err) {
917        this.errored = true;
918        this.queue = [];
919        this.destination.error(err);
920        this.unsubscribe();
921    }
922    _complete() {
923        this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_3__["Notification"].createComplete());
924        this.unsubscribe();
925    }
926}
927class DelayMessage {
928    constructor(time, notification) {
929        this.time = time;
930        this.notification = notification;
931    }
932}
933//# sourceMappingURL=delay.js.map
934
935/***/ }),
936
937/***/ "3N8a":
938/*!**********************************************************************!*\
939  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js ***!
940  \**********************************************************************/
941/*! exports provided: AsyncAction */
942/***/ (function(module, __webpack_exports__, __webpack_require__) {
943
944"use strict";
945__webpack_require__.r(__webpack_exports__);
946/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncAction", function() { return AsyncAction; });
947/* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Action */ "7ve7");
948
949class AsyncAction extends _Action__WEBPACK_IMPORTED_MODULE_0__["Action"] {
950    constructor(scheduler, work) {
951        super(scheduler, work);
952        this.scheduler = scheduler;
953        this.work = work;
954        this.pending = false;
955    }
956    schedule(state, delay = 0) {
957        if (this.closed) {
958            return this;
959        }
960        this.state = state;
961        const id = this.id;
962        const scheduler = this.scheduler;
963        if (id != null) {
964            this.id = this.recycleAsyncId(scheduler, id, delay);
965        }
966        this.pending = true;
967        this.delay = delay;
968        this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
969        return this;
970    }
971    requestAsyncId(scheduler, id, delay = 0) {
972        return setInterval(scheduler.flush.bind(scheduler, this), delay);
973    }
974    recycleAsyncId(scheduler, id, delay = 0) {
975        if (delay !== null && this.delay === delay && this.pending === false) {
976            return id;
977        }
978        clearInterval(id);
979        return undefined;
980    }
981    execute(state, delay) {
982        if (this.closed) {
983            return new Error('executing a cancelled action');
984        }
985        this.pending = false;
986        const error = this._execute(state, delay);
987        if (error) {
988            return error;
989        }
990        else if (this.pending === false && this.id != null) {
991            this.id = this.recycleAsyncId(this.scheduler, this.id, null);
992        }
993    }
994    _execute(state, delay) {
995        let errored = false;
996        let errorValue = undefined;
997        try {
998            this.work(state);
999        }
1000        catch (e) {
1001            errored = true;
1002            errorValue = !!e && e || new Error(e);
1003        }
1004        if (errored) {
1005            this.unsubscribe();
1006            return errorValue;
1007        }
1008    }
1009    _unsubscribe() {
1010        const id = this.id;
1011        const scheduler = this.scheduler;
1012        const actions = scheduler.actions;
1013        const index = actions.indexOf(this);
1014        this.work = null;
1015        this.state = null;
1016        this.pending = false;
1017        this.scheduler = null;
1018        if (index !== -1) {
1019            actions.splice(index, 1);
1020        }
1021        if (id != null) {
1022            this.id = this.recycleAsyncId(scheduler, id, null);
1023        }
1024        this.delay = null;
1025    }
1026}
1027//# sourceMappingURL=AsyncAction.js.map
1028
1029/***/ }),
1030
1031/***/ "3UWI":
1032/*!********************************************************************!*\
1033  !*** ./node_modules/rxjs/_esm2015/internal/operators/auditTime.js ***!
1034  \********************************************************************/
1035/*! exports provided: auditTime */
1036/***/ (function(module, __webpack_exports__, __webpack_require__) {
1037
1038"use strict";
1039__webpack_require__.r(__webpack_exports__);
1040/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return auditTime; });
1041/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
1042/* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./audit */ "tnsW");
1043/* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/timer */ "PqYM");
1044
1045
1046
1047function auditTime(duration, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) {
1048    return Object(_audit__WEBPACK_IMPORTED_MODULE_1__["audit"])(() => Object(_observable_timer__WEBPACK_IMPORTED_MODULE_2__["timer"])(duration, scheduler));
1049}
1050//# sourceMappingURL=auditTime.js.map
1051
1052/***/ }),
1053
1054/***/ "4A3s":
1055/*!*************************************************************************!*\
1056  !*** ./node_modules/rxjs/_esm2015/internal/operators/ignoreElements.js ***!
1057  \*************************************************************************/
1058/*! exports provided: ignoreElements */
1059/***/ (function(module, __webpack_exports__, __webpack_require__) {
1060
1061"use strict";
1062__webpack_require__.r(__webpack_exports__);
1063/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return ignoreElements; });
1064/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
1065
1066function ignoreElements() {
1067    return function ignoreElementsOperatorFunction(source) {
1068        return source.lift(new IgnoreElementsOperator());
1069    };
1070}
1071class IgnoreElementsOperator {
1072    call(subscriber, source) {
1073        return source.subscribe(new IgnoreElementsSubscriber(subscriber));
1074    }
1075}
1076class IgnoreElementsSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
1077    _next(unused) {
1078    }
1079}
1080//# sourceMappingURL=ignoreElements.js.map
1081
1082/***/ }),
1083
1084/***/ "4I5i":
1085/*!*****************************************************************************!*\
1086  !*** ./node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js ***!
1087  \*****************************************************************************/
1088/*! exports provided: ArgumentOutOfRangeError */
1089/***/ (function(module, __webpack_exports__, __webpack_require__) {
1090
1091"use strict";
1092__webpack_require__.r(__webpack_exports__);
1093/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return ArgumentOutOfRangeError; });
1094const ArgumentOutOfRangeErrorImpl = (() => {
1095    function ArgumentOutOfRangeErrorImpl() {
1096        Error.call(this);
1097        this.message = 'argument out of range';
1098        this.name = 'ArgumentOutOfRangeError';
1099        return this;
1100    }
1101    ArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype);
1102    return ArgumentOutOfRangeErrorImpl;
1103})();
1104const ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;
1105//# sourceMappingURL=ArgumentOutOfRangeError.js.map
1106
1107/***/ }),
1108
1109/***/ "4O5X":
1110/*!****************************************************************************!*\
1111  !*** ./node_modules/rxjs/_esm2015/internal/observable/bindNodeCallback.js ***!
1112  \****************************************************************************/
1113/*! exports provided: bindNodeCallback */
1114/***/ (function(module, __webpack_exports__, __webpack_require__) {
1115
1116"use strict";
1117__webpack_require__.r(__webpack_exports__);
1118/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return bindNodeCallback; });
1119/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
1120/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AsyncSubject */ "NHP+");
1121/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/map */ "lJxs");
1122/* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/canReportError */ "8Qeq");
1123/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
1124/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
1125
1126
1127
1128
1129
1130
1131function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
1132    if (resultSelector) {
1133        if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(resultSelector)) {
1134            scheduler = resultSelector;
1135        }
1136        else {
1137            return (...args) => bindNodeCallback(callbackFunc, scheduler)(...args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(args => Object(_util_isArray__WEBPACK_IMPORTED_MODULE_5__["isArray"])(args) ? resultSelector(...args) : resultSelector(args)));
1138        }
1139    }
1140    return function (...args) {
1141        const params = {
1142            subject: undefined,
1143            args,
1144            callbackFunc,
1145            scheduler,
1146            context: this,
1147        };
1148        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
1149            const { context } = params;
1150            let { subject } = params;
1151            if (!scheduler) {
1152                if (!subject) {
1153                    subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
1154                    const handler = (...innerArgs) => {
1155                        const err = innerArgs.shift();
1156                        if (err) {
1157                            subject.error(err);
1158                            return;
1159                        }
1160                        subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
1161                        subject.complete();
1162                    };
1163                    try {
1164                        callbackFunc.apply(context, [...args, handler]);
1165                    }
1166                    catch (err) {
1167                        if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_3__["canReportError"])(subject)) {
1168                            subject.error(err);
1169                        }
1170                        else {
1171                            console.warn(err);
1172                        }
1173                    }
1174                }
1175                return subject.subscribe(subscriber);
1176            }
1177            else {
1178                return scheduler.schedule(dispatch, 0, { params, subscriber, context });
1179            }
1180        });
1181    };
1182}
1183function dispatch(state) {
1184    const { params, subscriber, context } = state;
1185    const { callbackFunc, args, scheduler } = params;
1186    let subject = params.subject;
1187    if (!subject) {
1188        subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
1189        const handler = (...innerArgs) => {
1190            const err = innerArgs.shift();
1191            if (err) {
1192                this.add(scheduler.schedule(dispatchError, 0, { err, subject }));
1193            }
1194            else {
1195                const value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
1196                this.add(scheduler.schedule(dispatchNext, 0, { value, subject }));
1197            }
1198        };
1199        try {
1200            callbackFunc.apply(context, [...args, handler]);
1201        }
1202        catch (err) {
1203            this.add(scheduler.schedule(dispatchError, 0, { err, subject }));
1204        }
1205    }
1206    this.add(subject.subscribe(subscriber));
1207}
1208function dispatchNext(arg) {
1209    const { value, subject } = arg;
1210    subject.next(value);
1211    subject.complete();
1212}
1213function dispatchError(arg) {
1214    const { err, subject } = arg;
1215    subject.error(err);
1216}
1217//# sourceMappingURL=bindNodeCallback.js.map
1218
1219/***/ }),
1220
1221/***/ "4f8F":
1222/*!***************************************************************!*\
1223  !*** ./node_modules/rxjs/_esm2015/internal/operators/race.js ***!
1224  \***************************************************************/
1225/*! exports provided: race */
1226/***/ (function(module, __webpack_exports__, __webpack_require__) {
1227
1228"use strict";
1229__webpack_require__.r(__webpack_exports__);
1230/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; });
1231/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
1232/* harmony import */ var _observable_race__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/race */ "Nv8m");
1233
1234
1235function race(...observables) {
1236    return function raceOperatorFunction(source) {
1237        if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
1238            observables = observables[0];
1239        }
1240        return source.lift.call(Object(_observable_race__WEBPACK_IMPORTED_MODULE_1__["race"])(source, ...observables));
1241    };
1242}
1243//# sourceMappingURL=race.js.map
1244
1245/***/ }),
1246
1247/***/ "4hIw":
1248/*!***********************************************************************!*\
1249  !*** ./node_modules/rxjs/_esm2015/internal/operators/timeInterval.js ***!
1250  \***********************************************************************/
1251/*! exports provided: timeInterval, TimeInterval */
1252/***/ (function(module, __webpack_exports__, __webpack_require__) {
1253
1254"use strict";
1255__webpack_require__.r(__webpack_exports__);
1256/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return timeInterval; });
1257/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeInterval", function() { return TimeInterval; });
1258/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
1259/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scan */ "Kqap");
1260/* harmony import */ var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/defer */ "NXyV");
1261/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ "lJxs");
1262
1263
1264
1265
1266function timeInterval(scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) {
1267    return (source) => Object(_observable_defer__WEBPACK_IMPORTED_MODULE_2__["defer"])(() => {
1268        return source.pipe(Object(_scan__WEBPACK_IMPORTED_MODULE_1__["scan"])(({ current }, value) => ({ value, current: scheduler.now(), last: current }), { current: scheduler.now(), value: undefined, last: undefined }), Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(({ current, last, value }) => new TimeInterval(value, current - last)));
1269    });
1270}
1271class TimeInterval {
1272    constructor(value, interval) {
1273        this.value = value;
1274        this.interval = interval;
1275    }
1276}
1277//# sourceMappingURL=timeInterval.js.map
1278
1279/***/ }),
1280
1281/***/ "4yVj":
1282/*!**************************************************************************!*\
1283  !*** ./node_modules/rxjs/_esm2015/internal/scheduled/schedulePromise.js ***!
1284  \**************************************************************************/
1285/*! exports provided: schedulePromise */
1286/***/ (function(module, __webpack_exports__, __webpack_require__) {
1287
1288"use strict";
1289__webpack_require__.r(__webpack_exports__);
1290/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "schedulePromise", function() { return schedulePromise; });
1291/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
1292/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "quSY");
1293
1294
1295function schedulePromise(input, scheduler) {
1296    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
1297        const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
1298        sub.add(scheduler.schedule(() => input.then(value => {
1299            sub.add(scheduler.schedule(() => {
1300                subscriber.next(value);
1301                sub.add(scheduler.schedule(() => subscriber.complete()));
1302            }));
1303        }, err => {
1304            sub.add(scheduler.schedule(() => subscriber.error(err)));
1305        })));
1306        return sub;
1307    });
1308}
1309//# sourceMappingURL=schedulePromise.js.map
1310
1311/***/ }),
1312
1313/***/ "5+tZ":
1314/*!*******************************************************************!*\
1315  !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeMap.js ***!
1316  \*******************************************************************/
1317/*! exports provided: mergeMap, MergeMapOperator, MergeMapSubscriber, flatMap */
1318/***/ (function(module, __webpack_exports__, __webpack_require__) {
1319
1320"use strict";
1321__webpack_require__.r(__webpack_exports__);
1322/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return mergeMap; });
1323/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapOperator", function() { return MergeMapOperator; });
1324/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapSubscriber", function() { return MergeMapSubscriber; });
1325/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return flatMap; });
1326/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map */ "lJxs");
1327/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/from */ "Cfvw");
1328/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
1329
1330
1331
1332function mergeMap(project, resultSelector, concurrent = Number.POSITIVE_INFINITY) {
1333    if (typeof resultSelector === 'function') {
1334        return (source) => source.pipe(mergeMap((a, i) => Object(_observable_from__WEBPACK_IMPORTED_MODULE_1__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_0__["map"])((b, ii) => resultSelector(a, b, i, ii))), concurrent));
1335    }
1336    else if (typeof resultSelector === 'number') {
1337        concurrent = resultSelector;
1338    }
1339    return (source) => source.lift(new MergeMapOperator(project, concurrent));
1340}
1341class MergeMapOperator {
1342    constructor(project, concurrent = Number.POSITIVE_INFINITY) {
1343        this.project = project;
1344        this.concurrent = concurrent;
1345    }
1346    call(observer, source) {
1347        return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));
1348    }
1349}
1350class MergeMapSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleOuterSubscriber"] {
1351    constructor(destination, project, concurrent = Number.POSITIVE_INFINITY) {
1352        super(destination);
1353        this.project = project;
1354        this.concurrent = concurrent;
1355        this.hasCompleted = false;
1356        this.buffer = [];
1357        this.active = 0;
1358        this.index = 0;
1359    }
1360    _next(value) {
1361        if (this.active < this.concurrent) {
1362            this._tryNext(value);
1363        }
1364        else {
1365            this.buffer.push(value);
1366        }
1367    }
1368    _tryNext(value) {
1369        let result;
1370        const index = this.index++;
1371        try {
1372            result = this.project(value, index);
1373        }
1374        catch (err) {
1375            this.destination.error(err);
1376            return;
1377        }
1378        this.active++;
1379        this._innerSub(result);
1380    }
1381    _innerSub(ish) {
1382        const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleInnerSubscriber"](this);
1383        const destination = this.destination;
1384        destination.add(innerSubscriber);
1385        const innerSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["innerSubscribe"])(ish, innerSubscriber);
1386        if (innerSubscription !== innerSubscriber) {
1387            destination.add(innerSubscription);
1388        }
1389    }
1390    _complete() {
1391        this.hasCompleted = true;
1392        if (this.active === 0 && this.buffer.length === 0) {
1393            this.destination.complete();
1394        }
1395        this.unsubscribe();
1396    }
1397    notifyNext(innerValue) {
1398        this.destination.next(innerValue);
1399    }
1400    notifyComplete() {
1401        const buffer = this.buffer;
1402        this.active--;
1403        if (buffer.length > 0) {
1404            this._next(buffer.shift());
1405        }
1406        else if (this.active === 0 && this.hasCompleted) {
1407            this.destination.complete();
1408        }
1409    }
1410}
1411const flatMap = mergeMap;
1412//# sourceMappingURL=mergeMap.js.map
1413
1414/***/ }),
1415
1416/***/ "51Bx":
1417/*!********************************************************************!*\
1418  !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeScan.js ***!
1419  \********************************************************************/
1420/*! exports provided: mergeScan, MergeScanOperator, MergeScanSubscriber */
1421/***/ (function(module, __webpack_exports__, __webpack_require__) {
1422
1423"use strict";
1424__webpack_require__.r(__webpack_exports__);
1425/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return mergeScan; });
1426/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanOperator", function() { return MergeScanOperator; });
1427/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanSubscriber", function() { return MergeScanSubscriber; });
1428/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
1429
1430function mergeScan(accumulator, seed, concurrent = Number.POSITIVE_INFINITY) {
1431    return (source) => source.lift(new MergeScanOperator(accumulator, seed, concurrent));
1432}
1433class MergeScanOperator {
1434    constructor(accumulator, seed, concurrent) {
1435        this.accumulator = accumulator;
1436        this.seed = seed;
1437        this.concurrent = concurrent;
1438    }
1439    call(subscriber, source) {
1440        return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent));
1441    }
1442}
1443class MergeScanSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
1444    constructor(destination, accumulator, acc, concurrent) {
1445        super(destination);
1446        this.accumulator = accumulator;
1447        this.acc = acc;
1448        this.concurrent = concurrent;
1449        this.hasValue = false;
1450        this.hasCompleted = false;
1451        this.buffer = [];
1452        this.active = 0;
1453        this.index = 0;
1454    }
1455    _next(value) {
1456        if (this.active < this.concurrent) {
1457            const index = this.index++;
1458            const destination = this.destination;
1459            let ish;
1460            try {
1461                const { accumulator } = this;
1462                ish = accumulator(this.acc, value, index);
1463            }
1464            catch (e) {
1465                return destination.error(e);
1466            }
1467            this.active++;
1468            this._innerSub(ish);
1469        }
1470        else {
1471            this.buffer.push(value);
1472        }
1473    }
1474    _innerSub(ish) {
1475        const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this);
1476        const destination = this.destination;
1477        destination.add(innerSubscriber);
1478        const innerSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(ish, innerSubscriber);
1479        if (innerSubscription !== innerSubscriber) {
1480            destination.add(innerSubscription);
1481        }
1482    }
1483    _complete() {
1484        this.hasCompleted = true;
1485        if (this.active === 0 && this.buffer.length === 0) {
1486            if (this.hasValue === false) {
1487                this.destination.next(this.acc);
1488            }
1489            this.destination.complete();
1490        }
1491        this.unsubscribe();
1492    }
1493    notifyNext(innerValue) {
1494        const { destination } = this;
1495        this.acc = innerValue;
1496        this.hasValue = true;
1497        destination.next(innerValue);
1498    }
1499    notifyComplete() {
1500        const buffer = this.buffer;
1501        this.active--;
1502        if (buffer.length > 0) {
1503            this._next(buffer.shift());
1504        }
1505        else if (this.active === 0 && this.hasCompleted) {
1506            if (this.hasValue === false) {
1507                this.destination.next(this.acc);
1508            }
1509            this.destination.complete();
1510        }
1511    }
1512}
1513//# sourceMappingURL=mergeScan.js.map
1514
1515/***/ }),
1516
1517/***/ "51Dv":
1518/*!****************************************************************!*\
1519  !*** ./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js ***!
1520  \****************************************************************/
1521/*! exports provided: InnerSubscriber */
1522/***/ (function(module, __webpack_exports__, __webpack_require__) {
1523
1524"use strict";
1525__webpack_require__.r(__webpack_exports__);
1526/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerSubscriber", function() { return InnerSubscriber; });
1527/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ "7o/Q");
1528
1529class InnerSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
1530    constructor(parent, outerValue, outerIndex) {
1531        super();
1532        this.parent = parent;
1533        this.outerValue = outerValue;
1534        this.outerIndex = outerIndex;
1535        this.index = 0;
1536    }
1537    _next(value) {
1538        this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
1539    }
1540    _error(error) {
1541        this.parent.notifyError(error, this);
1542        this.unsubscribe();
1543    }
1544    _complete() {
1545        this.parent.notifyComplete(this);
1546        this.unsubscribe();
1547    }
1548}
1549//# sourceMappingURL=InnerSubscriber.js.map
1550
1551/***/ }),
1552
1553/***/ "5B2Y":
1554/*!*****************************************************************************!*\
1555  !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduleObservable.js ***!
1556  \*****************************************************************************/
1557/*! exports provided: scheduleObservable */
1558/***/ (function(module, __webpack_exports__, __webpack_require__) {
1559
1560"use strict";
1561__webpack_require__.r(__webpack_exports__);
1562/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleObservable", function() { return scheduleObservable; });
1563/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
1564/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "quSY");
1565/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../symbol/observable */ "kJWO");
1566
1567
1568
1569function scheduleObservable(input, scheduler) {
1570    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
1571        const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
1572        sub.add(scheduler.schedule(() => {
1573            const observable = input[_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]]();
1574            sub.add(observable.subscribe({
1575                next(value) { sub.add(scheduler.schedule(() => subscriber.next(value))); },
1576                error(err) { sub.add(scheduler.schedule(() => subscriber.error(err))); },
1577                complete() { sub.add(scheduler.schedule(() => subscriber.complete())); },
1578            }));
1579        }));
1580        return sub;
1581    });
1582}
1583//# sourceMappingURL=scheduleObservable.js.map
1584
1585/***/ }),
1586
1587/***/ "5yfJ":
1588/*!*****************************************************************!*\
1589  !*** ./node_modules/rxjs/_esm2015/internal/observable/never.js ***!
1590  \*****************************************************************/
1591/*! exports provided: NEVER, never */
1592/***/ (function(module, __webpack_exports__, __webpack_require__) {
1593
1594"use strict";
1595__webpack_require__.r(__webpack_exports__);
1596/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return NEVER; });
1597/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "never", function() { return never; });
1598/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
1599/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/noop */ "KqfI");
1600
1601
1602const NEVER = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](_util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]);
1603function never() {
1604    return NEVER;
1605}
1606//# sourceMappingURL=never.js.map
1607
1608/***/ }),
1609
1610/***/ "6eBy":
1611/*!*******************************************************************!*\
1612  !*** ./node_modules/rxjs/_esm2015/internal/operators/debounce.js ***!
1613  \*******************************************************************/
1614/*! exports provided: debounce */
1615/***/ (function(module, __webpack_exports__, __webpack_require__) {
1616
1617"use strict";
1618__webpack_require__.r(__webpack_exports__);
1619/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; });
1620/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
1621
1622function debounce(durationSelector) {
1623    return (source) =>
1623 source.lift(new DebounceOperator(durationSelector));
1624}
1625class DebounceOperator {
1626    constructor(durationSelector) {
1627        this.durationSelector = durationSelector;
1628    }
1629    call(subscriber, source) {
1630        return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));
1631    }
1632}
1633class DebounceSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
1634    constructor(destination, durationSelector) {
1635        super(destination);
1636        this.durationSelector = durationSelector;
1637        this.hasValue = false;
1638    }
1639    _next(value) {
1640        try {
1641            const result = this.durationSelector.call(this, value);
1642            if (result) {
1643                this._tryNext(value, result);
1644            }
1645        }
1646        catch (err) {
1647            this.destination.error(err);
1648        }
1649    }
1650    _complete() {
1651        this.emitValue();
1652        this.destination.complete();
1653    }
1654    _tryNext(value, duration) {
1655        let subscription = this.durationSubscription;
1656        this.value = value;
1657        this.hasValue = true;
1658        if (subscription) {
1659            subscription.unsubscribe();
1660            this.remove(subscription);
1661        }
1662        subscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(duration, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this));
1663        if (subscription && !subscription.closed) {
1664            this.add(this.durationSubscription = subscription);
1665        }
1666    }
1667    notifyNext() {
1668        this.emitValue();
1669    }
1670    notifyComplete() {
1671        this.emitValue();
1672    }
1673    emitValue() {
1674        if (this.hasValue) {
1675            const value = this.value;
1676            const subscription = this.durationSubscription;
1677            if (subscription) {
1678                this.durationSubscription = undefined;
1679                subscription.unsubscribe();
1680                this.remove(subscription);
1681            }
1682            this.value = undefined;
1683            this.hasValue = false;
1684            super._next(value);
1685        }
1686    }
1687}
1688//# sourceMappingURL=debounce.js.map
1689
1690/***/ }),
1691
1692/***/ "7+OI":
1693/*!******************************************************************!*\
1694  !*** ./node_modules/rxjs/_esm2015/internal/util/isObservable.js ***!
1695  \******************************************************************/
1696/*! exports provided: isObservable */
1697/***/ (function(module, __webpack_exports__, __webpack_require__) {
1698
1699"use strict";
1700__webpack_require__.r(__webpack_exports__);
1701/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return isObservable; });
1702/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
1703
1704function isObservable(obj) {
1705    return !!obj && (obj instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));
1706}
1707//# sourceMappingURL=isObservable.js.map
1708
1709/***/ }),
1710
1711/***/ "7HRe":
1712/*!********************************************************************!*\
1713  !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduled.js ***!
1714  \********************************************************************/
1715/*! exports provided: scheduled */
1716/***/ (function(module, __webpack_exports__, __webpack_require__) {
1717
1718"use strict";
1719__webpack_require__.r(__webpack_exports__);
1720/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduled", function() { return scheduled; });
1721/* harmony import */ var _scheduleObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scheduleObservable */ "5B2Y");
1722/* harmony import */ var _schedulePromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./schedulePromise */ "4yVj");
1723/* harmony import */ var _scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scheduleArray */ "jZKg");
1724/* harmony import */ var _scheduleIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scheduleIterable */ "MBAA");
1725/* harmony import */ var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isInteropObservable */ "QIAL");
1726/* harmony import */ var _util_isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isPromise */ "c2HN");
1727/* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/isArrayLike */ "I55L");
1728/* harmony import */ var _util_isIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/isIterable */ "CMyj");
1729
1730
1731
1732
1733
1734
1735
1736
1737function scheduled(input, scheduler) {
1738    if (input != null) {
1739        if (Object(_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__["isInteropObservable"])(input)) {
1740            return Object(_scheduleObservable__WEBPACK_IMPORTED_MODULE_0__["scheduleObservable"])(input, scheduler);
1741        }
1742        else if (Object(_util_isPromise__WEBPACK_IMPORTED_MODULE_5__["isPromise"])(input)) {
1743            return Object(_schedulePromise__WEBPACK_IMPORTED_MODULE_1__["schedulePromise"])(input, scheduler);
1744        }
1745        else if (Object(_util_isArrayLike__WEBPACK_IMPORTED_MODULE_6__["isArrayLike"])(input)) {
1746            return Object(_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(input, scheduler);
1747        }
1748        else if (Object(_util_isIterable__WEBPACK_IMPORTED_MODULE_7__["isIterable"])(input) || typeof input === 'string') {
1749            return Object(_scheduleIterable__WEBPACK_IMPORTED_MODULE_3__["scheduleIterable"])(input, scheduler);
1750        }
1751    }
1752    throw new TypeError((input !== null && typeof input || input) + ' is not observable');
1753}
1754//# sourceMappingURL=scheduled.js.map
1755
1756/***/ }),
1757
1758/***/ "7Hc7":
1759/*!***************************************************************!*\
1760  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/asap.js ***!
1761  \***************************************************************/
1762/*! exports provided: asapScheduler, asap */
1763/***/ (function(module, __webpack_exports__, __webpack_require__) {
1764
1765"use strict";
1766__webpack_require__.r(__webpack_exports__);
1767/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return asapScheduler; });
1768/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asap", function() { return asap; });
1769/* harmony import */ var _AsapAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsapAction */ "Pz8W");
1770/* harmony import */ var _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsapScheduler */ "RUbi");
1771
1772
1773const asapScheduler = new _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__["AsapScheduler"](_AsapAction__WEBPACK_IMPORTED_MODULE_0__["AsapAction"]);
1774const asap = asapScheduler;
1775//# sourceMappingURL=asap.js.map
1776
1777/***/ }),
1778
1779/***/ "7o/Q":
1780/*!***********************************************************!*\
1781  !*** ./node_modules/rxjs/_esm2015/internal/Subscriber.js ***!
1782  \***********************************************************/
1783/*! exports provided: Subscriber, SafeSubscriber */
1784/***/ (function(module, __webpack_exports__, __webpack_require__) {
1785
1786"use strict";
1787__webpack_require__.r(__webpack_exports__);
1788/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return Subscriber; });
1789/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SafeSubscriber", function() { return SafeSubscriber; });
1790/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/isFunction */ "n6bG");
1791/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Observer */ "gRHU");
1792/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Subscription */ "quSY");
1793/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ "2QA8");
1794/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ "2fFW");
1795/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/hostReportError */ "NJ4a");
1796
1797
1798
1799
1800
1801
1802class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"] {
1803    constructor(destinationOrNext, error, complete) {
1804        super();
1805        this.syncErrorValue = null;
1806        this.syncErrorThrown = false;
1807        this.syncErrorThrowable = false;
1808        this.isStopped = false;
1809        switch (arguments.length) {
1810            case 0:
1811                this.destination = _Observer__WEBPACK_IMPORTED_MODULE_1__["empty"];
1812                break;
1813            case 1:
1814                if (!destinationOrNext) {
1815                    this.destination = _Observer__WEBPACK_IMPORTED_MODULE_1__["empty"];
1816                    break;
1817                }
1818                if (typeof destinationOrNext === 'object') {
1819                    if (destinationOrNext instanceof Subscriber) {
1820                        this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
1821                        this.destination = destinationOrNext;
1822                        destinationOrNext.add(this);
1823                    }
1824                    else {
1825                        this.syncErrorThrowable = true;
1826                        this.destination = new SafeSubscriber(this, destinationOrNext);
1827                    }
1828                    break;
1829                }
1830            default:
1831                this.syncErrorThrowable = true;
1832                this.destination = new SafeSubscriber(this, destinationOrNext, error, complete);
1833                break;
1834        }
1835    }
1836    [_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_3__["rxSubscriber"]]() { return this; }
1837    static create(next, error, complete) {
1838        const subscriber = new Subscriber(next, error, complete);
1839        subscriber.syncErrorThrowable = false;
1840        return subscriber;
1841    }
1842    next(value) {
1843        if (!this.isStopped) {
1844            this._next(value);
1845        }
1846    }
1847    error(err) {
1848        if (!this.isStopped) {
1849            this.isStopped = true;
1850            this._error(err);
1851        }
1852    }
1853    complete() {
1854        if (!this.isStopped) {
1855            this.isStopped = true;
1856            this._complete();
1857        }
1858    }
1859    unsubscribe() {
1860        if (this.closed) {
1861            return;
1862        }
1863        this.isStopped = true;
1864        super.unsubscribe();
1865    }
1866    _next(value) {
1867        this.destination.next(value);
1868    }
1869    _error(err) {
1870        this.destination.error(err);
1871        this.unsubscribe();
1872    }
1873    _complete() {
1874        this.destination.complete();
1875        this.unsubscribe();
1876    }
1877    _unsubscribeAndRecycle() {
1878        const { _parentOrParents } = this;
1879        this._parentOrParents = null;
1880        this.unsubscribe();
1881        this.closed = false;
1882        this.isStopped = false;
1883        this._parentOrParents = _parentOrParents;
1884        return this;
1885    }
1886}
1887class SafeSubscriber extends Subscriber {
1888    constructor(_parentSubscriber, observerOrNext, error, complete) {
1889        super();
1890        this._parentSubscriber = _parentSubscriber;
1891        let next;
1892        let context = this;
1893        if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_0__["isFunction"])(observerOrNext)) {
1894            next = observerOrNext;
1895        }
1896        else if (observerOrNext) {
1897            next = observerOrNext.next;
1898            error = observerOrNext.error;
1899            complete = observerOrNext.complete;
1900            if (observerOrNext !== _Observer__WEBPACK_IMPORTED_MODULE_1__["empty"]) {
1901                context = Object.create(observerOrNext);
1902                if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_0__["isFunction"])(context.unsubscribe)) {
1903                    this.add(context.unsubscribe.bind(context));
1904                }
1905                context.unsubscribe = this.unsubscribe.bind(this);
1906            }
1907        }
1908        this._context = context;
1909        this._next = next;
1910        this._error = error;
1911        this._complete = complete;
1912    }
1913    next(value) {
1914        if (!this.isStopped && this._next) {
1915            const { _parentSubscriber } = this;
1916            if (!_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
1917                this.__tryOrUnsub(this._next, value);
1918            }
1919            else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
1920                this.unsubscribe();
1921            }
1922        }
1923    }
1924    error(err) {
1925        if (!this.isStopped) {
1926            const { _parentSubscriber } = this;
1927            const { useDeprecatedSynchronousErrorHandling } = _config__WEBPACK_IMPORTED_MODULE_4__["config"];
1928            if (this._error) {
1929                if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
1930                    this.__tryOrUnsub(this._error, err);
1931                    this.unsubscribe();
1932                }
1933                else {
1934                    this.__tryOrSetError(_parentSubscriber, this._error, err);
1935                    this.unsubscribe();
1936                }
1937            }
1938            else if (!_parentSubscriber.syncErrorThrowable) {
1939                this.unsubscribe();
1940                if (useDeprecatedSynchronousErrorHandling) {
1941                    throw err;
1942                }
1943                Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__["hostReportError"])(err);
1944            }
1945            else {
1946                if (useDeprecatedSynchronousErrorHandling) {
1947                    _parentSubscriber.syncErrorValue = err;
1948                    _parentSubscriber.syncErrorThrown = true;
1949                }
1950                else {
1951                    Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__["hostReportError"])(err);
1952                }
1953                this.unsubscribe();
1954            }
1955        }
1956    }
1957    complete() {
1958        if (!this.isStopped) {
1959            const { _parentSubscriber } = this;
1960            if (this._complete) {
1961                const wrappedComplete = () => this._complete.call(this._context);
1962                if (!_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
1963                    this.__tryOrUnsub(wrappedComplete);
1964                    this.unsubscribe();
1965                }
1966                else {
1967                    this.__tryOrSetError(_parentSubscriber, wrappedComplete);
1968                    this.unsubscribe();
1969                }
1970            }
1971            else {
1972                this.unsubscribe();
1973            }
1974        }
1975    }
1976    __tryOrUnsub(fn, value) {
1977        try {
1978            fn.call(this._context, value);
1979        }
1980        catch (err) {
1981            this.unsubscribe();
1982            if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) {
1983                throw err;
1984            }
1985            else {
1986                Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__["hostReportError"])(err);
1987            }
1988        }
1989    }
1990    __tryOrSetError(parent, fn, value) {
1991        if (!_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) {
1992            throw new Error('bad call');
1993        }
1994        try {
1995            fn.call(this._context, value);
1996        }
1997        catch (err) {
1998            if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) {
1999                parent.syncErrorValue = err;
2000                parent.syncErrorThrown = true;
2001                return true;
2002            }
2003            else {
2004                Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__["hostReportError"])(err);
2005                return true;
2006            }
2007        }
2008        return false;
2009    }
2010    _unsubscribe() {
2011        const { _parentSubscriber } = this;
2012        this._context = null;
2013        this._parentSubscriber = null;
2014        _parentSubscriber.unsubscribe();
2015    }
2016}
2017//# sourceMappingURL=Subscriber.js.map
2018
2019/***/ }),
2020
2021/***/ "7ve7":
2022/*!*****************************************************************!*\
2023  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/Action.js ***!
2024  \*****************************************************************/
2025/*! exports provided: Action */
2026/***/ (function(module, __webpack_exports__, __webpack_require__) {
2027
2028"use strict";
2029__webpack_require__.r(__webpack_exports__);
2030/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Action", function() { return Action; });
2031/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscription */ "quSY");
2032
2033class Action extends _Subscription__WEBPACK_IMPORTED_MODULE_0__["Subscription"] {
2034    constructor(scheduler, work) {
2035        super();
2036    }
2037    schedule(state, delay = 0) {
2038        return this;
2039    }
2040}
2041//# sourceMappingURL=Action.js.map
2042
2043/***/ }),
2044
2045/***/ "7wxJ":
2046/*!*********************************************************************!*\
2047  !*** ./node_modules/rxjs/_esm2015/internal/operators/combineAll.js ***!
2048  \*********************************************************************/
2049/*! exports provided: combineAll */
2050/***/ (function(module, __webpack_exports__, __webpack_require__) {
2051
2052"use strict";
2053__webpack_require__.r(__webpack_exports__);
2054/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return combineAll; });
2055/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/combineLatest */ "itXk");
2056
2057function combineAll(project) {
2058    return (source) => source.lift(new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__["CombineLatestOperator"](project));
2059}
2060//# sourceMappingURL=combineAll.js.map
2061
2062/***/ }),
2063
2064/***/ "8Qeq":
2065/*!********************************************************************!*\
2066  !*** ./node_modules/rxjs/_esm2015/internal/util/canReportError.js ***!
2067  \********************************************************************/
2068/*! exports provided: canReportError */
2069/***/ (function(module, __webpack_exports__, __webpack_require__) {
2070
2071"use strict";
2072__webpack_require__.r(__webpack_exports__);
2073/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canReportError", function() { return canReportError; });
2074/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
2075
2076function canReportError(observer) {
2077    while (observer) {
2078        const { closed, destination, isStopped } = observer;
2079        if (closed || isStopped) {
2080            return false;
2081        }
2082        else if (destination && destination instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) {
2083            observer = destination;
2084        }
2085        else {
2086            observer = null;
2087        }
2088    }
2089    return true;
2090}
2091//# sourceMappingURL=canReportError.js.map
2092
2093/***/ }),
2094
2095/***/ "9M8c":
2096/*!**********************************************************************!*\
2097  !*** ./node_modules/rxjs/_esm2015/internal/operators/bufferCount.js ***!
2098  \**********************************************************************/
2099/*! exports provided: bufferCount */
2100/***/ (function(module, __webpack_exports__, __webpack_require__) {
2101
2102"use strict";
2103__webpack_require__.r(__webpack_exports__);
2104/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return bufferCount; });
2105/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
2106
2107function bufferCount(bufferSize, startBufferEvery = null) {
2108    return function bufferCountOperatorFunction(source) {
2109        return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));
2110    };
2111}
2112class BufferCountOperator {
2113    constructor(bufferSize, startBufferEvery) {
2114        this.bufferSize = bufferSize;
2115        this.startBufferEvery = startBufferEvery;
2116        if (!startBufferEvery || bufferSize === startBufferEvery) {
2117            this.subscriberClass = BufferCountSubscriber;
2118        }
2119        else {
2120            this.subscriberClass = BufferSkipCountSubscriber;
2121        }
2122    }
2123    call(subscriber, source) {
2124        return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));
2125    }
2126}
2127class BufferCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
2128    constructor(destination, bufferSize) {
2129        super(destination);
2130        this.bufferSize = bufferSize;
2131        this.buffer = [];
2132    }
2133    _next(value) {
2134        const buffer = this.buffer;
2135        buffer.push(value);
2136        if (buffer.length == this.bufferSize) {
2137            this.destination.next(buffer);
2138            this.buffer = [];
2139        }
2140    }
2141    _complete() {
2142        const buffer = this.buffer;
2143        if (buffer.length > 0) {
2144            this.destination.next(buffer);
2145        }
2146        super._complete();
2147    }
2148}
2149class BufferSkipCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
2150    constructor(destination, bufferSize, startBufferEvery) {
2151        super(destination);
2152        this.bufferSize = bufferSize;
2153        this.startBufferEvery = startBufferEvery;
2154        this.buffers = [];
2155        this.count = 0;
2156    }
2157    _next(value) {
2158        const { bufferSize, startBufferEvery, buffers, count } = this;
2159        this.count++;
2160        if (count % startBufferEvery === 0) {
2161            buffers.push([]);
2162        }
2163        for (let i = buffers.length; i--;) {
2164            const buffer = buffers[i];
2165            buffer.push(value);
2166            if (buffer.length === bufferSize) {
2167                buffers.splice(i, 1);
2168                this.destination.next(buffer);
2169            }
2170        }
2171    }
2172    _complete() {
2173        const { buffers, destination } = this;
2174        while (buffers.length > 0) {
2175            let buffer = buffers.shift();
2176            if (buffer.length > 0) {
2177                destination.next(buffer);
2178            }
2179        }
2180        super._complete();
2181    }
2182}
2183//# sourceMappingURL=bufferCount.js.map
2184
2185/***/ }),
2186
2187/***/ "9ihq":
2188/*!********************************************************************!*\
2189  !*** ./node_modules/rxjs/_esm2015/internal/operators/elementAt.js ***!
2190  \********************************************************************/
2191/*! exports provided: elementAt */
2192/***/ (function(module, __webpack_exports__, __webpack_require__) {
2193
2194"use strict";
2195__webpack_require__.r(__webpack_exports__);
2196/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return elementAt; });
2197/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "4I5i");
2198/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "pLZG");
2199/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./throwIfEmpty */ "XDbj");
2200/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultIfEmpty */ "xbPD");
2201/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./take */ "IzEk");
2202
2203
2204
2205
2206
2207function elementAt(index, defaultValue) {
2208    if (index < 0) {
2209        throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"]();
2210    }
2211    const hasDefaultValue = arguments.length >= 2;
2212    return (source) => source.pipe(Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])((v, i) => i === index), Object(_take__WEBPACK_IMPORTED_MODULE_4__["take"])(1), hasDefaultValue
2213        ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue)
2214        : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__["throwIfEmpty"])(() => new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"]()));
2215}
2216//# sourceMappingURL=elementAt.js.map
2217
2218/***/ }),
2219
2220/***/ "9ppp":
2221/*!*****************************************************************************!*\
2222  !*** ./node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js ***!
2223  \*****************************************************************************/
2224/*! exports provided: ObjectUnsubscribedError */
2225/***/ (function(module, __webpack_exports__, __webpack_require__) {
2226
2227"use strict";
2228__webpack_require__.r(__webpack_exports__);
2229/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return ObjectUnsubscribedError; });
2230const ObjectUnsubscribedErrorImpl = (() => {
2231    function ObjectUnsubscribedErrorImpl() {
2232        Error.call(this);
2233        this.message = 'object unsubscribed';
2234        this.name = 'ObjectUnsubscribedError';
2235        return this;
2236    }
2237    ObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype);
2238    return ObjectUnsubscribedErrorImpl;
2239})();
2240const ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
2241//# sourceMappingURL=ObjectUnsubscribedError.js.map
2242
2243/***/ }),
2244
2245/***/ "A3iJ":
2246/*!********************************************************************!*\
2247  !*** ./node_modules/rxjs/_esm2015/internal/operators/partition.js ***!
2248  \********************************************************************/
2249/*! exports provided: partition */
2250/***/ (function(module, __webpack_exports__, __webpack_require__) {
2251
2252"use strict";
2253__webpack_require__.r(__webpack_exports__);
2254/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; });
2255/* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/not */ "F97/");
2256/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "pLZG");
2257
2258
2259function partition(predicate, thisArg) {
2260    return (source) => [
2261        Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(predicate, thisArg)(source),
2262        Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(source)
2263    ];
2264}
2265//# sourceMappingURL=partition.js.map
2266
2267/***/ }),
2268
2269/***/ "BFxc":
2270/*!*******************************************************************!*\
2271  !*** ./node_modules/rxjs/_esm2015/internal/operators/takeLast.js ***!
2272  \*******************************************************************/
2273/*! exports provided: takeLast */
2274/***/ (function(module, __webpack_exports__, __webpack_require__) {
2275
2276"use strict";
2277__webpack_require__.r(__webpack_exports__);
2278/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return takeLast; });
2279/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
2280/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "4I5i");
2281/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/empty */ "EY2u");
2282
2283
2284
2285function takeLast(count) {
2286    return function takeLastOperatorFunction(source) {
2287        if (count === 0) {
2288            return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])();
2289        }
2290        else {
2291            return source.lift(new TakeLastOperator(count));
2292        }
2293    };
2294}
2295class TakeLastOperator {
2296    constructor(total) {
2297        this.total = total;
2298        if (this.total < 0) {
2299            throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__["ArgumentOutOfRangeError"];
2300        }
2301    }
2302    call(subscriber, source) {
2303        return source.subscribe(new TakeLastSubscriber(subscriber, this.total));
2304    }
2305}
2306class TakeLastSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
2307    constructor(destination, total) {
2308        super(destination);
2309        this.total = total;
2310        this.ring = new Array();
2311        this.count = 0;
2312    }
2313    _next(value) {
2314        const ring = this.ring;
2315        const total = this.total;
2316        const count = this.count++;
2317        if (ring.length < total) {
2318            ring.push(value);
2319        }
2320        else {
2321            const index = count % total;
2322            ring[index] = value;
2323        }
2324    }
2325    _complete() {
2326        const destination = this.destination;
2327        let count = this.count;
2328        if (count > 0) {
2329            const total = this.count >= this.total ? this.total : this.count;
2330            const ring = this.ring;
2331            for (let i = 0; i < total; i++) {
2332                const idx = (count++) % total;
2333                destination.next(ring[idx]);
2334            }
2335        }
2336        destination.complete();
2337    }
2338}
2339//# sourceMappingURL=takeLast.js.map
2340
2341/***/ }),
2342
2343/***/ "CMyj":
2344/*!****************************************************************!*\
2345  !*** ./node_modules/rxjs/_esm2015/internal/util/isIterable.js ***!
2346  \****************************************************************/
2347/*! exports provided: isIterable */
2348/***/ (function(module, __webpack_exports__, __webpack_require__) {
2349
2350"use strict";
2351__webpack_require__.r(__webpack_exports__);
2352/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIterable", function() { return isIterable; });
2353/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/iterator */ "Lhse");
2354
2355function isIterable(input) {
2356    return input && typeof input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]] === 'function';
2357}
2358//# sourceMappingURL=isIterable.js.map
2359
2360/***/ }),
2361
2362/***/ "CRDf":
2363/*!***************************************************************************!*\
2364  !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToObservable.js ***!
2365  \***************************************************************************/
2366/*! exports provided: subscribeToObservable */
2367/***/ (function(module, __webpack_exports__, __webpack_require__) {
2368
2369"use strict";
2370__webpack_require__.r(__webpack_exports__);
2371/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToObservable", function() { return subscribeToObservable; });
2372/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ "kJWO");
2373
2374const subscribeToObservable = (obj) => (subscriber) => {
2375    const obs = obj[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]]();
2376    if (typeof obs.subscribe !== 'function') {
2377        throw new TypeError('Provided object does not correctly implement Symbol.observable');
2378    }
2379    else {
2380        return obs.subscribe(subscriber);
2381    }
2382};
2383//# sourceMappingURL=subscribeToObservable.js.map
2384
2385/***/ }),
2386
2387/***/ "Cfvw":
2388/*!****************************************************************!*\
2389  !*** ./node_modules/rxjs/_esm2015/internal/observable/from.js ***!
2390  \****************************************************************/
2391/*! exports provided: from */
2392/***/ (function(module, __webpack_exports__, __webpack_require__) {
2393
2394"use strict";
2395__webpack_require__.r(__webpack_exports__);
2396/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "from", function() { return from; });
2397/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
2398/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeTo */ "SeVD");
2399/* harmony import */ var _scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduled/scheduled */ "7HRe");
2400
2401
2402
2403function from(input, scheduler) {
2404    if (!scheduler) {
2405        if (input instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
2406            return input;
2407        }
2408        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(in
2408put));
2409    }
2410    else {
2411        return Object(_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__["scheduled"])(input, scheduler);
2412    }
2413}
2414//# sourceMappingURL=from.js.map
2415
2416/***/ }),
2417
2418/***/ "CqXF":
2419/*!****************************************************************!*\
2420  !*** ./node_modules/rxjs/_esm2015/internal/operators/mapTo.js ***!
2421  \****************************************************************/
2422/*! exports provided: mapTo */
2423/***/ (function(module, __webpack_exports__, __webpack_require__) {
2424
2425"use strict";
2426__webpack_require__.r(__webpack_exports__);
2427/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return mapTo; });
2428/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
2429
2430function mapTo(value) {
2431    return (source) => source.lift(new MapToOperator(value));
2432}
2433class MapToOperator {
2434    constructor(value) {
2435        this.value = value;
2436    }
2437    call(subscriber, source) {
2438        return source.subscribe(new MapToSubscriber(subscriber, this.value));
2439    }
2440}
2441class MapToSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
2442    constructor(destination, value) {
2443        super(destination);
2444        this.value = value;
2445    }
2446    _next(x) {
2447        this.destination.next(this.value);
2448    }
2449}
2450//# sourceMappingURL=mapTo.js.map
2451
2452/***/ }),
2453
2454/***/ "D0XW":
2455/*!****************************************************************!*\
2456  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/async.js ***!
2457  \****************************************************************/
2458/*! exports provided: asyncScheduler, async */
2459/***/ (function(module, __webpack_exports__, __webpack_require__) {
2460
2461"use strict";
2462__webpack_require__.r(__webpack_exports__);
2463/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return asyncScheduler; });
2464/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "async", function() { return async; });
2465/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ "3N8a");
2466/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncScheduler */ "IjjT");
2467
2468
2469const asyncScheduler = new _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"](_AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"]);
2470const async = asyncScheduler;
2471//# sourceMappingURL=async.js.map
2472
2473/***/ }),
2474
2475/***/ "DH7j":
2476/*!*************************************************************!*\
2477  !*** ./node_modules/rxjs/_esm2015/internal/util/isArray.js ***!
2478  \*************************************************************/
2479/*! exports provided: isArray */
2480/***/ (function(module, __webpack_exports__, __webpack_require__) {
2481
2482"use strict";
2483__webpack_require__.r(__webpack_exports__);
2484/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; });
2485const isArray = (() => Array.isArray || ((x) => x && typeof x.length === 'number'))();
2486//# sourceMappingURL=isArray.js.map
2487
2488/***/ }),
2489
2490/***/ "EQ5u":
2491/*!*********************************************************************************!*\
2492  !*** ./node_modules/rxjs/_esm2015/internal/observable/ConnectableObservable.js ***!
2493  \*********************************************************************************/
2494/*! exports provided: ConnectableObservable, connectableObservableDescriptor */
2495/***/ (function(module, __webpack_exports__, __webpack_require__) {
2496
2497"use strict";
2498__webpack_require__.r(__webpack_exports__);
2499/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return ConnectableObservable; });
2500/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "connectableObservableDescriptor", function() { return connectableObservableDescriptor; });
2501/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "XNiG");
2502/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Observable */ "HDdC");
2503/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
2504/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Subscription */ "quSY");
2505/* harmony import */ var _operators_refCount__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../operators/refCount */ "x+ZX");
2506
2507
2508
2509
2510
2511class ConnectableObservable extends _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"] {
2512    constructor(source, subjectFactory) {
2513        super();
2514        this.source = source;
2515        this.subjectFactory = subjectFactory;
2516        this._refCount = 0;
2517        this._isComplete = false;
2518    }
2519    _subscribe(subscriber) {
2520        return this.getSubject().subscribe(subscriber);
2521    }
2522    getSubject() {
2523        const subject = this._subject;
2524        if (!subject || subject.isStopped) {
2525            this._subject = this.subjectFactory();
2526        }
2527        return this._subject;
2528    }
2529    connect() {
2530        let connection = this._connection;
2531        if (!connection) {
2532            this._isComplete = false;
2533            connection = this._connection = new _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"]();
2534            connection.add(this.source
2535                .subscribe(new ConnectableSubscriber(this.getSubject(), this)));
2536            if (connection.closed) {
2537                this._connection = null;
2538                connection = _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY;
2539            }
2540        }
2541        return connection;
2542    }
2543    refCount() {
2544        return Object(_operators_refCount__WEBPACK_IMPORTED_MODULE_4__["refCount"])()(this);
2545    }
2546}
2547const connectableObservableDescriptor = (() => {
2548    const connectableProto = ConnectableObservable.prototype;
2549    return {
2550        operator: { value: null },
2551        _refCount: { value: 0, writable: true },
2552        _subject: { value: null, writable: true },
2553        _connection: { value: null, writable: true },
2554        _subscribe: { value: connectableProto._subscribe },
2555        _isComplete: { value: connectableProto._isComplete, writable: true },
2556        getSubject: { value: connectableProto.getSubject },
2557        connect: { value: connectableProto.connect },
2558        refCount: { value: connectableProto.refCount }
2559    };
2560})();
2561class ConnectableSubscriber extends _Subject__WEBPACK_IMPORTED_MODULE_0__["SubjectSubscriber"] {
2562    constructor(destination, connectable) {
2563        super(destination);
2564        this.connectable = connectable;
2565    }
2566    _error(err) {
2567        this._unsubscribe();
2568        super._error(err);
2569    }
2570    _complete() {
2571        this.connectable._isComplete = true;
2572        this._unsubscribe();
2573        super._complete();
2574    }
2575    _unsubscribe() {
2576        const connectable = this.connectable;
2577        if (connectable) {
2578            this.connectable = null;
2579            const connection = connectable._connection;
2580            connectable._refCount = 0;
2581            connectable._subject = null;
2582            connectable._connection = null;
2583            if (connection) {
2584                connection.unsubscribe();
2585            }
2586        }
2587    }
2588}
2589class RefCountOperator {
2590    constructor(connectable) {
2591        this.connectable = connectable;
2592    }
2593    call(subscriber, source) {
2594        const { connectable } = this;
2595        connectable._refCount++;
2596        const refCounter = new RefCountSubscriber(subscriber, connectable);
2597        const subscription = source.subscribe(refCounter);
2598        if (!refCounter.closed) {
2599            refCounter.connection = connectable.connect();
2600        }
2601        return subscription;
2602    }
2603}
2604class RefCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"] {
2605    constructor(destination, connectable) {
2606        super(destination);
2607        this.connectable = connectable;
2608    }
2609    _unsubscribe() {
2610        const { connectable } = this;
2611        if (!connectable) {
2612            this.connection = null;
2613            return;
2614        }
2615        this.connectable = null;
2616        const refCount = connectable._refCount;
2617        if (refCount <= 0) {
2618            this.connection = null;
2619            return;
2620        }
2621        connectable._refCount = refCount - 1;
2622        if (refCount > 1) {
2623            this.connection = null;
2624            return;
2625        }
2626        const { connection } = this;
2627        const sharedConnection = connectable._connection;
2628        this.connection = null;
2629        if (sharedConnection && (!connection || sharedConnection === connection)) {
2630            sharedConnection.unsubscribe();
2631        }
2632    }
2633}
2634//# sourceMappingURL=ConnectableObservable.js.map
2635
2636/***/ }),
2637
2638/***/ "EY2u":
2639/*!*****************************************************************!*\
2640  !*** ./node_modules/rxjs/_esm2015/internal/observable/empty.js ***!
2641  \*****************************************************************/
2642/*! exports provided: EMPTY, empty */
2643/***/ (function(module, __webpack_exports__, __webpack_require__) {
2644
2645"use strict";
2646__webpack_require__.r(__webpack_exports__);
2647/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return EMPTY; });
2648/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; });
2649/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
2650
2651const EMPTY = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => subscriber.complete());
2652function empty(scheduler) {
2653    return scheduler ? emptyScheduled(scheduler) : EMPTY;
2654}
2655function emptyScheduled(scheduler) {
2656    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => scheduler.schedule(() => subscriber.complete()));
2657}
2658//# sourceMappingURL=empty.js.map
2659
2660/***/ }),
2661
2662/***/ "F97/":
2663/*!*********************************************************!*\
2664  !*** ./node_modules/rxjs/_esm2015/internal/util/not.js ***!
2665  \*********************************************************/
2666/*! exports provided: not */
2667/***/ (function(module, __webpack_exports__, __webpack_require__) {
2668
2669"use strict";
2670__webpack_require__.r(__webpack_exports__);
2671/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "not", function() { return not; });
2672function not(pred, thisArg) {
2673    function notPred() {
2674        return !(notPred.pred.apply(notPred.thisArg, arguments));
2675    }
2676    notPred.pred = pred;
2677    notPred.thisArg = thisArg;
2678    return notPred;
2679}
2680//# sourceMappingURL=not.js.map
2681
2682/***/ }),
2683
2684/***/ "FD9M":
2685/*!***********************************************************************!*\
2686  !*** ./node_modules/rxjs/_esm2015/internal/operators/bufferToggle.js ***!
2687  \***********************************************************************/
2688/*! exports provided: bufferToggle */
2689/***/ (function(module, __webpack_exports__, __webpack_require__) {
2690
2691"use strict";
2692__webpack_require__.r(__webpack_exports__);
2693/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return bufferToggle; });
2694/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscription */ "quSY");
2695/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "ZUHj");
2696/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "l7GE");
2697
2698
2699
2700function bufferToggle(openings, closingSelector) {
2701    return function bufferToggleOperatorFunction(source) {
2702        return source.lift(new BufferToggleOperator(openings, closingSelector));
2703    };
2704}
2705class BufferToggleOperator {
2706    constructor(openings, closingSelector) {
2707        this.openings = openings;
2708        this.closingSelector = closingSelector;
2709    }
2710    call(subscriber, source) {
2711        return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));
2712    }
2713}
2714class BufferToggleSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] {
2715    constructor(destination, openings, closingSelector) {
2716        super(destination);
2717        this.closingSelector = closingSelector;
2718        this.contexts = [];
2719        this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, openings));
2720    }
2721    _next(value) {
2722        const contexts = this.contexts;
2723        const len = contexts.length;
2724        for (let i = 0; i < len; i++) {
2725            contexts[i].buffer.push(value);
2726        }
2727    }
2728    _error(err) {
2729        const contexts = this.contexts;
2730        while (contexts.length > 0) {
2731            const context = contexts.shift();
2732            context.subscription.unsubscribe();
2733            context.buffer = null;
2734            context.subscription = null;
2735        }
2736        this.contexts = null;
2737        super._error(err);
2738    }
2739    _complete() {
2740        const contexts = this.contexts;
2741        while (contexts.length > 0) {
2742            const context = contexts.shift();
2743            this.destination.next(context.buffer);
2744            context.subscription.unsubscribe();
2745            context.buffer = null;
2746            context.subscription = null;
2747        }
2748        this.contexts = null;
2749        super._complete();
2750    }
2751    notifyNext(outerValue, innerValue) {
2752        outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);
2753    }
2754    notifyComplete(innerSub) {
2755        this.closeBuffer(innerSub.context);
2756    }
2757    openBuffer(value) {
2758        try {
2759            const closingSelector = this.closingSelector;
2760            const closingNotifier = closingSelector.call(this, value);
2761            if (closingNotifier) {
2762                this.trySubscribe(closingNotifier);
2763            }
2764        }
2765        catch (err) {
2766            this._error(err);
2767        }
2768    }
2769    closeBuffer(context) {
2770        const contexts = this.contexts;
2771        if (contexts && context) {
2772            const { buffer, subscription } = context;
2773            this.destination.next(buffer);
2774            contexts.splice(contexts.indexOf(context), 1);
2775            this.remove(subscription);
2776            subscription.unsubscribe();
2777        }
2778    }
2779    trySubscribe(closingNotifier) {
2780        const contexts = this.contexts;
2781        const buffer = [];
2782        const subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_0__["Subscription"]();
2783        const context = { buffer, subscription };
2784        contexts.push(context);
2785        const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, closingNotifier, context);
2786        if (!innerSubscription || innerSubscription.closed) {
2787            this.closeBuffer(context);
2788        }
2789        else {
2790            innerSubscription.context = context;
2791            this.add(innerSubscription);
2792            subscription.add(innerSubscription);
2793        }
2794    }
2795}
2796//# sourceMappingURL=bufferToggle.js.map
2797
2798/***/ }),
2799
2800/***/ "FQpF":
2801/*!*****************************************************************!*\
2802  !*** ./node_modules/rxjs/_esm2015/internal/operators/expand.js ***!
2803  \*****************************************************************/
2804/*! exports provided: expand, ExpandOperator, ExpandSubscriber */
2805/***/ (function(module, __webpack_exports__, __webpack_require__) {
2806
2807"use strict";
2808__webpack_require__.r(__webpack_exports__);
2809/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return expand; });
2810/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandOperator", function() { return ExpandOperator; });
2811/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandSubscriber", function() { return ExpandSubscriber; });
2812/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
2813
2814function expand(project, concurrent = Number.POSITIVE_INFINITY, scheduler) {
2815    concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;
2816    return (source) => source.lift(new ExpandOperator(project, concurrent, scheduler));
2817}
2818class ExpandOperator {
2819    constructor(project, concurrent, scheduler) {
2820        this.project = project;
2821        this.concurrent = concurrent;
2822        this.scheduler = scheduler;
2823    }
2824    call(subscriber, source) {
2825        return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));
2826    }
2827}
2828class ExpandSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
2829    constructor(destination, project, concurrent, scheduler) {
2830        super(destination);
2831        this.project = project;
2832        this.concurrent = concurrent;
2833        this.scheduler = scheduler;
2834        this.index = 0;
2835        this.active = 0;
2836        this.hasCompleted = false;
2837        if (concurrent < Number.POSITIVE_INFINITY) {
2838            this.buffer = [];
2839        }
2840    }
2841    static dispatch(arg) {
2842        const { subscriber, result, value, index } = arg;
2843        subscriber.subscribeToProjection(result, value, index);
2844    }
2845    _next(value) {
2846        const destination = this.destination;
2847        if (destination.closed) {
2848            this._complete();
2849            return;
2850        }
2851        const index = this.index++;
2852        if (this.active < this.concurrent) {
2853            destination.next(value);
2854            try {
2855                const { project } = this;
2856                const result = project(value, index);
2857                if (!this.scheduler) {
2858                    this.subscribeToProjection(result, value, index);
2859                }
2860                else {
2861                    const state = { subscriber: this, result, value, index };
2862                    const destination = this.destination;
2863                    destination.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state));
2864                }
2865            }
2866            catch (e) {
2867                destination.error(e);
2868            }
2869        }
2870        else {
2871            this.buffer.push(value);
2872        }
2873    }
2874    subscribeToProjection(result, value, index) {
2875        this.active++;
2876        const destination = this.destination;
2877        destination.add(Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(result, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this)));
2878    }
2879    _complete() {
2880        this.hasCompleted = true;
2881        if (this.hasCompleted && this.active === 0) {
2882            this.destination.complete();
2883        }
2884        this.unsubscribe();
2885    }
2886    notifyNext(innerValue) {
2887        this._next(innerValue);
2888    }
2889    notifyComplete() {
2890        const buffer = this.buffer;
2891        this.active--;
2892        if (buffer && buffer.length > 0) {
2893            this._next(buffer.shift());
2894        }
2895        if (this.hasCompleted && this.active === 0) {
2896            this.destination.complete();
2897        }
2898    }
2899}
2900//# sourceMappingURL=expand.js.map
2901
2902/***/ }),
2903
2904/***/ "FZB8":
2905/*!**************************************************************!*\
2906  !*** ./node_modules/rxjs/_esm2015/internal/operators/min.js ***!
2907  \**************************************************************/
2908/*! exports provided: min */
2909/***/ (function(module, __webpack_exports__, __webpack_require__) {
2910
2911"use strict";
2912__webpack_require__.r(__webpack_exports__);
2913/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; });
2914/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ "128B");
2915
2916function min(comparer) {
2917    const min = (typeof comparer === 'function')
2918        ? (x, y) => comparer(x, y) < 0 ? x : y
2919        : (x, y) => x < y ? x : y;
2920    return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(min);
2921}
2922//# sourceMappingURL=min.js.map
2923
2924/***/ }),
2925
2926/***/ "GJmQ":
2927/*!********************************************************************!*\
2928  !*** ./node_modules/rxjs/_esm2015/internal/operators/takeWhile.js ***!
2929  \********************************************************************/
2930/*! exports provided: takeWhile */
2931/***/ (function(module, __webpack_exports__, __webpack_require__) {
2932
2933"use strict";
2934__webpack_require__.r(__webpack_exports__);
2935/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return takeWhile; });
2936/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
2937
2938function takeWhile(predicate, inclusive = false) {
2939    return (source) => source.lift(new TakeWhileOperator(predicate, inclusive));
2940}
2941class TakeWhileOperator {
2942    constructor(predicate, inclusive) {
2943        this.predicate = predicate;
2944        this.inclusive = inclusive;
2945    }
2946    call(subscriber, source) {
2947        return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive));
2948    }
2949}
2950class TakeWhileSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
2951    constructor(destination, predicate, inclusive) {
2952        super(destination);
2953        this.predicate = predicate;
2954        this.inclusive = inclusive;
2955        this.index = 0;
2956    }
2957    _next(value) {
2958        const destination = this.destination;
2959        let result;
2960        try {
2961            result = this.predicate(value, this.index++);
2962        }
2963        catch (err) {
2964            destination.error(err);
2965            return;
2966        }
2967        this.nextOrComplete(value, result);
2968    }
2969    nextOrComplete(value, predicateResult) {
2970        const destination = this.destination;
2971        if (Boolean(predicateResult)) {
2972            destination.next(value);
2973        }
2974        else {
2975            if (this.inclusive) {
2976                destination.next(value);
2977            }
2978            destination.complete();
2979        }
2980    }
2981}
2982//# sourceMappingURL=takeWhile.js.map
2983
2984/***/ }),
2985
2986/***/ "Gi4w":
2987/*!****************************************************************!*\
2988  !*** ./node_modules/rxjs/_esm2015/internal/operators/every.js ***!
2989  \****************************************************************/
2990/*! exports provided: every */
2991/***/ (function(module, __webpack_exports__, __webpack_require__) {
2992
2993"use strict";
2994__webpack_require__.r(__webpack_exports__);
2995/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return every; });
2996/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
2997
2998function every(predicate, thisArg) {
2999    return (source) => source.lift(new EveryOperator(predicate, thisArg, source));
3000}
3001class EveryOperator {
3002    constructor(predicate, thisArg, source) {
3003        this.predicate = predicate;
3004        this.thisArg = thisArg;
3005        this.source = source;
3006    }
3007    call(observer, source) {
3008        return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));
3009    }
3010}
3011class EverySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
3012    constructor(destination, predicate, thisArg, source) {
3013        super(destination);
3014        this.predicate = predicate;
3015        this.thisArg = thisArg;
3016        this.source = source;
3017        this.index = 0;
3018        this.thisArg = thisArg || this;
3019    }
3020    notifyComplete(everyValueMatch) {
3021        this.destination.next(everyValueMatch);
3022        this.destination.complete();
3023    }
3024    _next(value) {
3025        let result = false;
3026        try {
3027            result = this.predicate.call(this.thisArg, value, this.index++, this.source);
3028        }
3029        catch (err) {
3030            this.destination.error(err);
3031            return;
3032        }
3033        if (!result) {
3034            this.notifyComplete(false);
3035        }
3036    }
3037    _complete() {
3038        this.notifyComplete(true);
3039    }
3040}
3041//# sourceMappingURL=every.js.map
3042
3043/***/ }),
3044
3045/***/ "GjHo":
3046/*!**************************************************************!*\
3047  !*** ./node_modules/rxjs/_esm2015/internal/operators/zip.js ***!
3048  \**************************************************************/
3049/*! exports provided: zip */
3050/***/ (function(module, __webpack_exports__, __webpack_require__) {
3051
3052"use strict";
3053__webpack_require__.r(__webpack_exports__);
3054/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; });
3055/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/zip */ "1uah");
3056
3057function zip(...observables) {
3058    return function zipOperatorFunction(source) {
3059        return source.lift.call(Object(_observable_zip__WEBPACK_IMPORTED_MODULE_0__["zip"])(source, ...observables));
3060    };
3061}
3062//# sourceMappingURL=zip.js.map
3063
3064/***/ }),
3065
3066/***/ "Gqsl":
3067/*!*********************************************************************!*\
3068  !*** ./node_modules/rxjs/_esm2015/internal/operators/repeatWhen.js ***!
3069  \*********************************************************************/
3070/*! exports provided: repeatWhen */
3071/***/ (function(module, __webpack_exports__, __webpack_require__) {
3072
3073"use strict";
3074__webpack_require__.r(__webpack_exports__);
3075/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return repeatWhen; });
3076/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "XNiG");
3077/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
3078
3079
3080function repeatWhen(notifier) {
3081    return (source) => source.lift(new RepeatWhenOperator(notifier));
3082}
3083class RepeatWhenOperator {
3084    constructor(notifier) {
3085        this.notifier = notifier;
3086    }
3087    call(subscriber, source) {
3088        return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));
3089    }
3090}
3091class RepeatWhenSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["SimpleOuterSubscriber"] {
3092    constructor(destination, notifier, source) {
3093        super(destination);
3094        this.notifier = notifier;
3095        this.source = source;
3096        this.sourceIsBeingSubscribedTo = true;
3097    }
3098    notifyNext() {
3099        this.sourceIsBeingSubscribedTo = true;
3100        this.source.subscribe(this);
3101    }
3102    notifyComplete() {
3103        if (this.sourceIsBeingSubscribedTo === false) {
3104            return super.complete();
3105        }
3106    }
3107    complete() {
3108        this.sourceIsBeingSubscribedTo = false;
3109        if (!this.isStopped) {
3110            if (!this.retries) {
3111                this.subscribeToRetries();
3112            }
3113            if (!this.retriesSubscription || this.retriesSubscription.closed) {
3114                return super.complete();
3115            }
3116            this._unsubscribeAndRecycle();
3117            this.notifications.next(undefined);
3118        }
3119    }
3120    _unsubscribe() {
3121        const { notifications, retriesSubscription } = this;
3122        if (notifications) {
3123            notifications.unsubscribe();
3124            this.notifications = undefined;
3125        }
3126        if (retriesSubscription) {
3127            retriesSubscription.unsubscribe();
3128            this.retriesSubscription = undefined;
3129        }
3130        this.retries = undefined;
3131    }
3132    _unsubscribeAndRecycle() {
3133        const { _unsubscribe } = this;
3134        this._unsubscribe = null;
3135        super._unsubscribeAndRecycle();
3136        this._unsubscribe = _unsubscribe;
3137        return this;
3138    }
3139    subscribeToRetries() {
3140        this.notifications = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
3141        let retries;
3142        try {
3143            const { notifier }
3143 = this;
3144            retries = notifier(this.notifications);
3145        }
3146        catch (e) {
3147            return super.complete();
3148        }
3149        this.retries = retries;
3150        this.retriesSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["innerSubscribe"])(retries, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["SimpleInnerSubscriber"](this));
3151    }
3152}
3153//# sourceMappingURL=repeatWhen.js.map
3154
3155/***/ }),
3156
3157/***/ "GyhO":
3158/*!******************************************************************!*\
3159  !*** ./node_modules/rxjs/_esm2015/internal/observable/concat.js ***!
3160  \******************************************************************/
3161/*! exports provided: concat */
3162/***/ (function(module, __webpack_exports__, __webpack_require__) {
3163
3164"use strict";
3165__webpack_require__.r(__webpack_exports__);
3166/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
3167/* harmony import */ var _of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./of */ "LRne");
3168/* harmony import */ var _operators_concatAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../operators/concatAll */ "0EUg");
3169
3170
3171function concat(...observables) {
3172    return Object(_operators_concatAll__WEBPACK_IMPORTED_MODULE_1__["concatAll"])()(Object(_of__WEBPACK_IMPORTED_MODULE_0__["of"])(...observables));
3173}
3174//# sourceMappingURL=concat.js.map
3175
3176/***/ }),
3177
3178/***/ "HDdC":
3179/*!***********************************************************!*\
3180  !*** ./node_modules/rxjs/_esm2015/internal/Observable.js ***!
3181  \***********************************************************/
3182/*! exports provided: Observable */
3183/***/ (function(module, __webpack_exports__, __webpack_require__) {
3184
3185"use strict";
3186__webpack_require__.r(__webpack_exports__);
3187/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return Observable; });
3188/* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/canReportError */ "8Qeq");
3189/* harmony import */ var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/toSubscriber */ "WyKG");
3190/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./symbol/observable */ "kJWO");
3191/* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/pipe */ "mCNh");
3192/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ "2fFW");
3193
3194
3195
3196
3197
3198class Observable {
3199    constructor(subscribe) {
3200        this._isScalar = false;
3201        if (subscribe) {
3202            this._subscribe = subscribe;
3203        }
3204    }
3205    lift(operator) {
3206        const observable = new Observable();
3207        observable.source = this;
3208        observable.operator = operator;
3209        return observable;
3210    }
3211    subscribe(observerOrNext, error, complete) {
3212        const { operator } = this;
3213        const sink = Object(_util_toSubscriber__WEBPACK_IMPORTED_MODULE_1__["toSubscriber"])(observerOrNext, error, complete);
3214        if (operator) {
3215            sink.add(operator.call(sink, this.source));
3216        }
3217        else {
3218            sink.add(this.source || (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
3219                this._subscribe(sink) :
3220                this._trySubscribe(sink));
3221        }
3222        if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) {
3223            if (sink.syncErrorThrowable) {
3224                sink.syncErrorThrowable = false;
3225                if (sink.syncErrorThrown) {
3226                    throw sink.syncErrorValue;
3227                }
3228            }
3229        }
3230        return sink;
3231    }
3232    _trySubscribe(sink) {
3233        try {
3234            return this._subscribe(sink);
3235        }
3236        catch (err) {
3237            if (_config__WEBPACK_IMPORTED_MODULE_4__["config"].useDeprecatedSynchronousErrorHandling) {
3238                sink.syncErrorThrown = true;
3239                sink.syncErrorValue = err;
3240            }
3241            if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_0__["canReportError"])(sink)) {
3242                sink.error(err);
3243            }
3244            else {
3245                console.warn(err);
3246            }
3247        }
3248    }
3249    forEach(next, promiseCtor) {
3250        promiseCtor = getPromiseCtor(promiseCtor);
3251        return new promiseCtor((resolve, reject) => {
3252            let subscription;
3253            subscription = this.subscribe((value) => {
3254                try {
3255                    next(value);
3256                }
3257                catch (err) {
3258                    reject(err);
3259                    if (subscription) {
3260                        subscription.unsubscribe();
3261                    }
3262                }
3263            }, reject, resolve);
3264        });
3265    }
3266    _subscribe(subscriber) {
3267        const { source } = this;
3268        return source && source.subscribe(subscriber);
3269    }
3270    [_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]]() {
3271        return this;
3272    }
3273    pipe(...operations) {
3274        if (operations.length === 0) {
3275            return this;
3276        }
3277        return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipeFromArray"])(operations)(this);
3278    }
3279    toPromise(promiseCtor) {
3280        promiseCtor = getPromiseCtor(promiseCtor);
3281        return new promiseCtor((resolve, reject) => {
3282            let value;
3283            this.subscribe((x) => value = x, (err) => reject(err), () => resolve(value));
3284        });
3285    }
3286}
3287Observable.create = (subscribe) => {
3288    return new Observable(subscribe);
3289};
3290function getPromiseCtor(promiseCtor) {
3291    if (!promiseCtor) {
3292        promiseCtor = _config__WEBPACK_IMPORTED_MODULE_4__["config"].Promise || Promise;
3293    }
3294    if (!promiseCtor) {
3295        throw new Error('no Promise impl found');
3296    }
3297    return promiseCtor;
3298}
3299//# sourceMappingURL=Observable.js.map
3300
3301/***/ }),
3302
3303/***/ "Hh5Z":
3304/*!*************************************************************************!*\
3305  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/QueueScheduler.js ***!
3306  \*************************************************************************/
3307/*! exports provided: QueueScheduler */
3308/***/ (function(module, __webpack_exports__, __webpack_require__) {
3309
3310"use strict";
3311__webpack_require__.r(__webpack_exports__);
3312/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueScheduler", function() { return QueueScheduler; });
3313/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncScheduler */ "IjjT");
3314
3315class QueueScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__["AsyncScheduler"] {
3316}
3317//# sourceMappingURL=QueueScheduler.js.map
3318
3319/***/ }),
3320
3321/***/ "Hkhx":
3322/*!*****************************************************************************!*\
3323  !*** ./node_modules/rxjs/_esm2015/internal/observable/onErrorResumeNext.js ***!
3324  \*****************************************************************************/
3325/*! exports provided: onErrorResumeNext */
3326/***/ (function(module, __webpack_exports__, __webpack_require__) {
3327
3328"use strict";
3329__webpack_require__.r(__webpack_exports__);
3330/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; });
3331/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
3332/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ "Cfvw");
3333/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
3334/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./empty */ "EY2u");
3335
3336
3337
3338
3339function onErrorResumeNext(...sources) {
3340    if (sources.length === 0) {
3341        return _empty__WEBPACK_IMPORTED_MODULE_3__["EMPTY"];
3342    }
3343    const [first, ...remainder] = sources;
3344    if (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(first)) {
3345        return onErrorResumeNext(...first);
3346    }
3347    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
3348        const subNext = () => subscriber.add(onErrorResumeNext(...remainder).subscribe(subscriber));
3349        return Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(first).subscribe({
3350            next(value) { subscriber.next(value); },
3351            error: subNext,
3352            complete: subNext,
3353        });
3354    });
3355}
3356//# sourceMappingURL=onErrorResumeNext.js.map
3357
3358/***/ }),
3359
3360/***/ "HrJb":
3361/*!****************************************************************!*\
3362  !*** ./node_modules/rxjs/_esm2015/internal/operators/count.js ***!
3363  \****************************************************************/
3364/*! exports provided: count */
3365/***/ (function(module, __webpack_exports__, __webpack_require__) {
3366
3367"use strict";
3368__webpack_require__.r(__webpack_exports__);
3369/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "count", function() { return count; });
3370/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
3371
3372function count(predicate) {
3373    return (source) => source.lift(new CountOperator(predicate, source));
3374}
3375class CountOperator {
3376    constructor(predicate, source) {
3377        this.predicate = predicate;
3378        this.source = source;
3379    }
3380    call(subscriber, source) {
3381        return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));
3382    }
3383}
3384class CountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
3385    constructor(destination, predicate, source) {
3386        super(destination);
3387        this.predicate = predicate;
3388        this.source = source;
3389        this.count = 0;
3390        this.index = 0;
3391    }
3392    _next(value) {
3393        if (this.predicate) {
3394            this._tryPredicate(value);
3395        }
3396        else {
3397            this.count++;
3398        }
3399    }
3400    _tryPredicate(value) {
3401        let result;
3402        try {
3403            result = this.predicate(value, this.index++, this.source);
3404        }
3405        catch (err) {
3406            this.destination.error(err);
3407            return;
3408        }
3409        if (result) {
3410            this.count++;
3411        }
3412    }
3413    _complete() {
3414        this.destination.next(this.count);
3415        this.destination.complete();
3416    }
3417}
3418//# sourceMappingURL=count.js.map
3419
3420/***/ }),
3421
3422/***/ "I55L":
3423/*!*****************************************************************!*\
3424  !*** ./node_modules/rxjs/_esm2015/internal/util/isArrayLike.js ***!
3425  \*****************************************************************/
3426/*! exports provided: isArrayLike */
3427/***/ (function(module, __webpack_exports__, __webpack_require__) {
3428
3429"use strict";
3430__webpack_require__.r(__webpack_exports__);
3431/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return isArrayLike; });
3432const isArrayLike = ((x) => x && typeof x.length === 'number' && typeof x !== 'function');
3433//# sourceMappingURL=isArrayLike.js.map
3434
3435/***/ }),
3436
3437/***/ "IAdc":
3438/*!******************************************************************!*\
3439  !*** ./node_modules/rxjs/_esm2015/internal/operators/toArray.js ***!
3440  \******************************************************************/
3441/*! exports provided: toArray */
3442/***/ (function(module, __webpack_exports__, __webpack_require__) {
3443
3444"use strict";
3445__webpack_require__.r(__webpack_exports__);
3446/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return toArray; });
3447/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ "128B");
3448
3449function toArrayReducer(arr, item, index) {
3450    if (index === 0) {
3451        return [item];
3452    }
3453    arr.push(item);
3454    return arr;
3455}
3456function toArray() {
3457    return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(toArrayReducer, []);
3458}
3459//# sourceMappingURL=toArray.js.map
3460
3461/***/ }),
3462
3463/***/ "IjjT":
3464/*!*************************************************************************!*\
3465  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js ***!
3466  \*************************************************************************/
3467/*! exports provided: AsyncScheduler */
3468/***/ (function(module, __webpack_exports__, __webpack_require__) {
3469
3470"use strict";
3471__webpack_require__.r(__webpack_exports__);
3472/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncScheduler", function() { return AsyncScheduler; });
3473/* harmony import */ var _Scheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Scheduler */ "Y/cZ");
3474
3475class AsyncScheduler extends _Scheduler__WEBPACK_IMPORTED_MODULE_0__["Scheduler"] {
vendor: 4,204 bytes, lines 3476-3596
3476    constructor(SchedulerAction, now = _Scheduler__WEBPACK_IMPORTED_MODULE_0__["Scheduler"].now) {
3477        super(SchedulerAction, () => {
3478            if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
3479                return AsyncScheduler.delegate.now();
3480            }
3481            else {
3482                return now();
3483            }
3484        });
3485        this.actions = [];
3486        this.active = false;
3487        this.scheduled = undefined;
3488    }
3489    schedule(work, delay = 0, state) {
3490        if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
3491            return AsyncScheduler.delegate.schedule(work, delay, state);
3492        }
3493        else {
3494            return super.schedule(work, delay, state);
3495        }
3496    }
3497    flush(action) {
3498        const { actions } = this;
3499        if (this.active) {
3500            actions.push(action);
3501            return;
3502        }
3503        let error;
3504        this.active = true;
3505        do {
3506            if (error = action.execute(action.state, action.delay)) {
3507                break;
3508            }
3509        } while (action = actions.shift());
3510        this.active = false;
3511        if (error) {
3512            while (action = actions.shift()) {
3513                action.unsubscribe();
3514            }
3515            throw error;
3516        }
3517    }
3518}
3519//# sourceMappingURL=AsyncScheduler.js.map
3520
3521/***/ }),
3522
3523/***/ "IzEk":
3524/*!***************************************************************!*\
3525  !*** ./node_modules/rxjs/_esm2015/internal/operators/take.js ***!
3526  \***************************************************************/
3527/*! exports provided: take */
3528/***/ (function(module, __webpack_exports__, __webpack_require__) {
3529
3530"use strict";
3531__webpack_require__.r(__webpack_exports__);
3532/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return take; });
3533/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
3534/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "4I5i");
3535/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/empty */ "EY2u");
3536
3537
3538
3539function take(count) {
3540    return (source) => {
3541        if (count === 0) {
3542            return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])();
3543        }
3544        else {
3545            return source.lift(new TakeOperator(count));
3546        }
3547    };
3548}
3549class TakeOperator {
3550    constructor(total) {
3551        this.total = total;
3552        if (this.total < 0) {
3553            throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__["ArgumentOutOfRangeError"];
3554        }
3555    }
3556    call(subscriber, source) {
3557        return source.subscribe(new TakeSubscriber(subscriber, this.total));
3558    }
3559}
3560class TakeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
3561    constructor(destination, total) {
3562        super(destination);
3563        this.total = total;
3564        this.count = 0;
3565    }
3566    _next(value) {
3567        const total = this.total;
3568        const count = ++this.count;
3569        if (count <= total) {
3570            this.destination.next(value);
3571            if (count === total) {
3572                this.destination.complete();
3573                this.unsubscribe();
3574            }
3575        }
3576    }
3577}
3578//# sourceMappingURL=take.js.map
3579
3580/***/ }),
3581
3582/***/ "JIr8":
3583/*!*********************************************************************!*\
3584  !*** ./node_modules/rxjs/_esm2015/internal/operators/catchError.js ***!
3585  \*********************************************************************/
3586/*! exports provided: catchError */
3587/***/ (function(module, __webpack_exports__, __webpack_require__) {
3588
3589"use strict";
3590__webpack_require__.r(__webpack_exports__);
3591/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return catchError; });
3592/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
3593
3594function catchError(selector) {
3595    return function catchErrorOperatorFunction(source) {
3596        const operator = new CatchOperator(selector);
3597        const caught = source.lift(operator);
3598        return (operator.caught = caught);
3599    };
3600}
3601class CatchOperator {
3602    constructor(selector) {
3603        this.selector = selector;
3604    }
3605    call(subscriber, source) {
3606        return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));
3607    }
3608}
3609class CatchSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
3610    constructor(destination, selector, caught) {
3611        super(destination);
3612        this.selector = selector;
3613        this.caught = caught;
3614    }
3615    error(err) {
3616        if (!this.isStopped) {
3617            let result;
3618            try {
3619                result = this.selector(err, this.caught);
3620            }
3621            catch (err2) {
3622                super.error(err2);
3623                return;
3624            }
3625            this._unsubscribeAndRecycle();
3626            const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this);
3627            this.add(innerSubscriber);
3628            const innerSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(result, innerSubscriber);
3629            if (innerSubscription !== innerSubscriber) {
3630                this.add(innerSubscription);
3631            }
3632        }
3633    }
3634}
3635//# sourceMappingURL=catchError.js.map
3636
3637/***/ }),
3638
3639/***/ "JX91":
3640/*!********************************************************************!*\
3641  !*** ./node_modules/rxjs/_esm2015/internal/operators/startWith.js ***!
3642  \********************************************************************/
3643/*! exports provided: startWith */
3644/***/ (function(module, __webpack_exports__, __webpack_require__) {
3645
3646"use strict";
3647__webpack_require__.r(__webpack_exports__);
3648/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return startWith; });
3649/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/concat */ "GyhO");
3650/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
3651
3652
3653function startWith(...array) {
3654    const scheduler = array[array.length - 1];
3655    if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(scheduler)) {
3656        array.pop();
3657        return (source) => Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(array, source, scheduler);
3658    }
3659    else {
3660        return (source) => Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(array, source);
3661    }
3662}
3663//# sourceMappingURL=startWith.js.map
3664
3665/***/ }),
3666
3667/***/ "JmF6":
3668/*!*****************************************************************!*\
3669  !*** ./node_modules/rxjs/_esm2015/internal/operators/zipAll.js ***!
3670  \*****************************************************************/
3671/*! exports provided: zipAll */
3672/***/ (function(module, __webpack_exports__, __webpack_require__) {
3673
3674"use strict";
3675__webpack_require__.r(__webpack_exports__);
3676/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return zipAll; });
3677/* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/zip */ "1uah");
3678
3679function zipAll(project) {
3680    return (source) => source.lift(new _observable_zip__WEBPACK_IMPORTED_MODULE_0__["ZipOperator"](project));
3681}
3682//# sourceMappingURL=zipAll.js.map
3683
3684/***/ }),
3685
3686/***/ "K7De":
3687/*!********************************************************************!*\
3688  !*** ./node_modules/rxjs/_esm2015/internal/operators/findIndex.js ***!
3689  \********************************************************************/
3690/*! exports provided: findIndex */
3691/***/ (function(module, __webpack_exports__, __webpack_require__) {
3692
3693"use strict";
3694__webpack_require__.r(__webpack_exports__);
3695/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; });
3696/* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operators/find */ "cBqT");
3697
3698function findIndex(predicate, thisArg) {
3699    return (source) => source.lift(new _operators_find__WEBPACK_IMPORTED_MODULE_0__["FindValueOperator"](predicate, source, true, thisArg));
3700}
3701//# sourceMappingURL=findIndex.js.map
3702
3703/***/ }),
3704
3705/***/ "Kj3r":
3706/*!***********************************************************************!*\
3707  !*** ./node_modules/rxjs/_esm2015/internal/operators/debounceTime.js ***!
3708  \***********************************************************************/
3709/*! exports provided: debounceTime */
3710/***/ (function(module, __webpack_exports__, __webpack_require__) {
3711
3712"use strict";
3713__webpack_require__.r(__webpack_exports__);
3714/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return debounceTime; });
3715/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
3716/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
3717
3718
3719function debounceTime(dueTime, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]) {
3720    return (source) =>
3720 source.lift(new DebounceTimeOperator(dueTime, scheduler));
3721}
3722class DebounceTimeOperator {
3723    constructor(dueTime, scheduler) {
3724        this.dueTime = dueTime;
3725        this.scheduler = scheduler;
3726    }
3727    call(subscriber, source) {
3728        return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
3729    }
3730}
3731class DebounceTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
3732    constructor(destination, dueTime, scheduler) {
3733        super(destination);
3734        this.dueTime = dueTime;
3735        this.scheduler = scheduler;
3736        this.debouncedSubscription = null;
3737        this.lastValue = null;
3738        this.hasValue = false;
3739    }
3740    _next(value) {
3741        this.clearDebounce();
3742        this.lastValue = value;
3743        this.hasValue = true;
3744        this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
3745    }
3746    _complete() {
3747        this.debouncedNext();
3748        this.destination.complete();
3749    }
3750    debouncedNext() {
3751        this.clearDebounce();
3752        if (this.hasValue) {
3753            const { lastValue } = this;
3754            this.lastValue = null;
3755            this.hasValue = false;
3756            this.destination.next(lastValue);
3757        }
3758    }
3759    clearDebounce() {
3760        const debouncedSubscription = this.debouncedSubscription;
3761        if (debouncedSubscription !== null) {
3762            this.remove(debouncedSubscription);
3763            debouncedSubscription.unsubscribe();
3764            this.debouncedSubscription = null;
3765        }
3766    }
3767}
3768function dispatchNext(subscriber) {
3769    subscriber.debouncedNext();
3770}
3771//# sourceMappingURL=debounceTime.js.map
3772
3773/***/ }),
3774
3775/***/ "Kqap":
3776/*!***************************************************************!*\
3777  !*** ./node_modules/rxjs/_esm2015/internal/operators/scan.js ***!
3778  \***************************************************************/
3779/*! exports provided: scan */
3780/***/ (function(module, __webpack_exports__, __webpack_require__) {
3781
3782"use strict";
3783__webpack_require__.r(__webpack_exports__);
3784/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return scan; });
3785/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
3786
3787function scan(accumulator, seed) {
3788    let hasSeed = false;
3789    if (arguments.length >= 2) {
3790        hasSeed = true;
3791    }
3792    return function scanOperatorFunction(source) {
3793        return source.lift(new ScanOperator(accumulator, seed, hasSeed));
3794    };
3795}
3796class ScanOperator {
3797    constructor(accumulator, seed, hasSeed = false) {
3798        this.accumulator = accumulator;
3799        this.seed = seed;
3800        this.hasSeed = hasSeed;
3801    }
3802    call(subscriber, source) {
3803        return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));
3804    }
3805}
3806class ScanSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
3807    constructor(destination, accumulator, _seed, hasSeed) {
3808        super(destination);
3809        this.accumulator = accumulator;
3810        this._seed = _seed;
3811        this.hasSeed = hasSeed;
3812        this.index = 0;
3813    }
3814    get seed() {
3815        return this._seed;
3816    }
3817    set seed(value) {
3818        this.hasSeed = true;
3819        this._seed = value;
3820    }
3821    _next(value) {
3822        if (!this.hasSeed) {
3823            this.seed = value;
3824            this.destination.next(value);
3825        }
3826        else {
3827            return this._tryNext(value);
3828        }
3829    }
3830    _tryNext(value) {
3831        const index = this.index++;
3832        let result;
3833        try {
3834            result = this.accumulator(this.seed, value, index);
3835        }
3836        catch (err) {
3837            this.destination.error(err);
3838        }
3839        this.seed = result;
3840        this.destination.next(result);
3841    }
3842}
3843//# sourceMappingURL=scan.js.map
3844
3845/***/ }),
3846
3847/***/ "KqfI":
3848/*!**********************************************************!*\
3849  !*** ./node_modules/rxjs/_esm2015/internal/util/noop.js ***!
3850  \**********************************************************/
3851/*! exports provided: noop */
3852/***/ (function(module, __webpack_exports__, __webpack_require__) {
3853
3854"use strict";
3855__webpack_require__.r(__webpack_exports__);
3856/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return noop; });
3857function noop() { }
3858//# sourceMappingURL=noop.js.map
3859
3860/***/ }),
3861
3862/***/ "LRne":
3863/*!**************************************************************!*\
3864  !*** ./node_modules/rxjs/_esm2015/internal/observable/of.js ***!
3865  \**************************************************************/
3866/*! exports provided: of */
3867/***/ (function(module, __webpack_exports__, __webpack_require__) {
3868
3869"use strict";
3870__webpack_require__.r(__webpack_exports__);
3871/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "of", function() { return of; });
3872/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
3873/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fromArray */ "yCtX");
3874/* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduled/scheduleArray */ "jZKg");
3875
3876
3877
3878function of(...args) {
3879    let scheduler = args[args.length - 1];
3880    if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(scheduler)) {
3881        args.pop();
3882        return Object(_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(args, scheduler);
3883    }
3884    else {
3885        return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(args);
3886    }
3887}
3888//# sourceMappingURL=of.js.map
3889
3890/***/ }),
3891
3892/***/ "Lhse":
3893/*!****************************************************************!*\
3894  !*** ./node_modules/rxjs/_esm2015/internal/symbol/iterator.js ***!
3895  \****************************************************************/
3896/*! exports provided: getSymbolIterator, iterator, $$iterator */
3897/***/ (function(module, __webpack_exports__, __webpack_require__) {
3898
3899"use strict";
3900__webpack_require__.r(__webpack_exports__);
3901/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSymbolIterator", function() { return getSymbolIterator; });
3902/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iterator", function() { return iterator; });
3903/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$$iterator", function() { return $$iterator; });
3904function getSymbolIterator() {
3905    if (typeof Symbol !== 'function' || !Symbol.iterator) {
3906        return '@@iterator';
3907    }
3908    return Symbol.iterator;
3909}
3910const iterator = getSymbolIterator();
3911const $$iterator = iterator;
3912//# sourceMappingURL=iterator.js.map
3913
3914/***/ }),
3915
3916/***/ "MBAA":
3917/*!***************************************************************************!*\
3918  !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduleIterable.js ***!
3919  \***************************************************************************/
3920/*! exports provided: scheduleIterable */
3921/***/ (function(module, __webpack_exports__, __webpack_require__) {
3922
3923"use strict";
3924__webpack_require__.r(__webpack_exports__);
3925/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleIterable", function() { return scheduleIterable; });
3926/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
3927/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "quSY");
3928/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../symbol/iterator */ "Lhse");
3929
3930
3931
3932function scheduleIterable(input, scheduler) {
3933    if (!input) {
3934        throw new Error('Iterable cannot be null');
3935    }
3936    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
3937        const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
3938        let iterator;
3939        sub.add(() => {
3940            if (iterator && typeof iterator.return === 'function') {
3941                iterator.return();
3942            }
3943        });
3944        sub.add(scheduler.schedule(() => {
3945            iterator = input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__["iterator"]]();
3946            sub.add(scheduler.schedule(function () {
3947                if (subscriber.closed) {
3948                    return;
3949                }
3950                let value;
3951                let done;
3952                try {
3953                    const result = iterator.next();
3954                    value = result.value;
3955                    done = result.done;
3956                }
3957                catch (err) {
3958                    subscriber.error(err);
3959                    return;
3960                }
3961                if (done) {
3962                    subscriber.complete();
3963                }
3964                else {
3965                    subscriber.next(value);
3966                    this.schedule();
3967                }
3968            }));
3969        }));
3970        return sub;
3971    });
3972}
3973//# sourceMappingURL=scheduleIterable.js.map
3974
3975/***/ }),
3976
3977/***/ "MtjB":
3978/*!********************************************************************!*\
3979  !*** ./node_modules/rxjs/_esm2015/internal/operators/retryWhen.js ***!
3980  \********************************************************************/
3981/*! exports provided: retryWhen */
3982/***/ (function(module, __webpack_exports__, __webpack_require__) {
3983
3984"use strict";
3985__webpack_require__.r(__webpack_exports__);
3986/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return retryWhen; });
3987/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "XNiG");
3988/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
3989
3990
3991function retryWhen(notifier) {
3992    return (source) => source.lift(new RetryWhenOperator(notifier, source));
3993}
3994class RetryWhenOperator {
3995    constructor(notifier, source) {
3996        this.notifier = notifier;
3997        this.source = source;
3998    }
3999    call(subscriber, source) {
4000        return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));
4001    }
4002}
4003class RetryWhenSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["SimpleOuterSubscriber"] {
4004    constructor(destination, notifier, source) {
4005        super(destination);
4006        this.notifier = notifier;
4007        this.source = source;
4008    }
4009    error(err) {
4010        if (!this.isStopped) {
4011            let errors = this.errors;
4012            let retries = this.retries;
4013            let retriesSubscription = this.retriesSubscription;
4014            if (!retries) {
4015                errors = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
4016                try {
4017                    const { notifier }
4017 = this;
4018                    retries = notifier(errors);
4019                }
4020                catch (e) {
4021                    return super.error(e);
4022                }
4023                retriesSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["innerSubscribe"])(retries, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["SimpleInnerSubscriber"](this));
4024            }
4025            else {
4026                this.errors = undefined;
4027                this.retriesSubscription = undefined;
4028            }
4029            this._unsubscribeAndRecycle();
4030            this.errors = errors;
4031            this.retries = retries;
4032            this.retriesSubscription = retriesSubscription;
4033            errors.next(err);
4034        }
4035    }
4036    _unsubscribe() {
4037        const { errors, retriesSubscription } = this;
4038        if (errors) {
4039            errors.unsubscribe();
4040            this.errors = undefined;
4041        }
4042        if (retriesSubscription) {
4043            retriesSubscription.unsubscribe();
4044            this.retriesSubscription = undefined;
4045        }
4046        this.retries = undefined;
4047    }
4048    notifyNext() {
4049        const { _unsubscribe } = this;
4050        this._unsubscribe = null;
4051        this._unsubscribeAndRecycle();
4052        this._unsubscribe = _unsubscribe;
4053        this.source.subscribe(this);
4054    }
4055}
4056//# sourceMappingURL=retryWhen.js.map
4057
4058/***/ }),
4059
4060/***/ "NHP+":
4061/*!*************************************************************!*\
4062  !*** ./node_modules/rxjs/_esm2015/internal/AsyncSubject.js ***!
4063  \*************************************************************/
4064/*! exports provided: AsyncSubject */
4065/***/ (function(module, __webpack_exports__, __webpack_require__) {
4066
4067"use strict";
4068__webpack_require__.r(__webpack_exports__);
4069/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return AsyncSubject; });
4070/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ "XNiG");
4071/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscription */ "quSY");
4072
4073
4074class AsyncSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"] {
4075    constructor() {
4076        super(...arguments);
4077        this.value = null;
4078        this.hasNext = false;
4079        this.hasCompleted = false;
4080    }
4081    _subscribe(subscriber) {
4082        if (this.hasError) {
4083            subscriber.error(this.thrownError);
4084            return _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"].EMPTY;
4085        }
4086        else if (this.hasCompleted && this.hasNext) {
4087            subscriber.next(this.value);
4088            subscriber.complete();
4089            return _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"].EMPTY;
4090        }
4091        return super._subscribe(subscriber);
4092    }
4093    next(value) {
4094        if (!this.hasCompleted) {
4095            this.value = value;
4096            this.hasNext = true;
4097        }
4098    }
4099    error(error) {
4100        if (!this.hasCompleted) {
4101            super.error(error);
4102        }
4103    }
4104    complete() {
4105        this.hasCompleted = true;
4106        if (this.hasNext) {
4107            super.next(this.value);
4108        }
4109        super.complete();
4110    }
4111}
4112//# sourceMappingURL=AsyncSubject.js.map
4113
4114/***/ }),
4115
4116/***/ "NJ4a":
4117/*!*********************************************************************!*\
4118  !*** ./node_modules/rxjs/_esm2015/internal/util/hostReportError.js ***!
4119  \*********************************************************************/
4120/*! exports provided: hostReportError */
4121/***/ (function(module, __webpack_exports__, __webpack_require__) {
4122
4123"use strict";
4124__webpack_require__.r(__webpack_exports__);
4125/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hostReportError", function() { return hostReportError; });
4126function hostReportError(err) {
4127    setTimeout(() => { throw err; }, 0);
4128}
4129//# sourceMappingURL=hostReportError.js.map
4130
4131/***/ }),
4132
4133/***/ "NJ9Y":
4134/*!***************************************************************!*\
4135  !*** ./node_modules/rxjs/_esm2015/internal/operators/last.js ***!
4136  \***************************************************************/
4137/*! exports provided: last */
4138/***/ (function(module, __webpack_exports__, __webpack_require__) {
4139
4140"use strict";
4141__webpack_require__.r(__webpack_exports__);
4142/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return last; });
4143/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ "sVev");
4144/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "pLZG");
4145/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./takeLast */ "BFxc");
4146/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./throwIfEmpty */ "XDbj");
4147/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaultIfEmpty */ "xbPD");
4148/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/identity */ "SpAZ");
4149
4150
4151
4152
4153
4154
4155function last(predicate, defaultValue) {
4156    const hasDefaultValue = arguments.length >= 2;
4157    return (source) => source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])((v, i) => predicate(v, i, source)) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_takeLast__WEBPACK_IMPORTED_MODULE_2__["takeLast"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__["throwIfEmpty"])(() => new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"]()));
4158}
4159//# sourceMappingURL=last.js.map
4160
4161/***/ }),
4162
4163/***/ "NNCq":
4164/*!*****************************************************************!*\
4165  !*** ./node_modules/rxjs/_esm2015/internal/observable/range.js ***!
4166  \*****************************************************************/
4167/*! exports provided: range, dispatch */
4168/***/ (function(module, __webpack_exports__, __webpack_require__) {
4169
4170"use strict";
4171__webpack_require__.r(__webpack_exports__);
4172/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
4173/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dis
4173patch; });
4174/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
4175
4176function range(start = 0, count, scheduler) {
4177    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
4178        if (count === undefined) {
4179            count = start;
4180            start = 0;
4181        }
4182        let index = 0;
4183        let current = start;
4184        if (scheduler) {
4185            return scheduler.schedule(dispatch, 0, {
4186                index, count, start, subscriber
4187            });
4188        }
4189        else {
4190            do {
4191                if (index++ >= count) {
4192                    subscriber.complete();
4193                    break;
4194                }
4195                subscriber.next(current++);
4196                if (subscriber.closed) {
4197                    break;
4198                }
4199            } while (true);
4200        }
4201        return undefined;
4202    });
4203}
4204function dispatch(state) {
4205    const { start, index, count, subscriber } = state;
4206    if (index >= count) {
4207        subscriber.complete();
4208        return;
4209    }
4210    subscriber.next(start);
4211    if (subscriber.closed) {
4212        return;
4213    }
4214    state.index = index + 1;
4215    state.start = start + 1;
4216    this.schedule(state);
4217}
4218//# sourceMappingURL=range.js.map
4219
4220/***/ }),
4221
4222/***/ "NXyV":
4223/*!*****************************************************************!*\
4224  !*** ./node_modules/rxjs/_esm2015/internal/observable/defer.js ***!
4225  \*****************************************************************/
4226/*! exports provided: defer */
4227/***/ (function(module, __webpack_exports__, __webpack_require__) {
4228
4229"use strict";
4230__webpack_require__.r(__webpack_exports__);
4231/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return defer; });
4232/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
4233/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ "Cfvw");
4234/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty */ "EY2u");
4235
4236
4237
4238function defer(observableFactory) {
4239    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
4240        let input;
4241        try {
4242            input = observableFactory();
4243        }
4244        catch (err) {
4245            subscriber.error(err);
4246            return undefined;
4247        }
4248        const source = input ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(input) : Object(_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])();
4249        return source.subscribe(subscriber);
4250    });
4251}
4252//# sourceMappingURL=defer.js.map
4253
4254/***/ }),
4255
4256/***/ "NfdI":
4257/*!******************************************************************!*\
4258  !*** ./node_modules/rxjs/_esm2015/internal/operators/publish.js ***!
4259  \******************************************************************/
4260/*! exports provided: publish */
4261/***/ (function(module, __webpack_exports__, __webpack_require__) {
4262
4263"use strict";
4264__webpack_require__.r(__webpack_exports__);
4265/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return publish; });
4266/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "XNiG");
4267/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "oB13");
4268
4269
4270function publish(selector) {
4271    return selector ?
4272        Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(() => new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](), selector) :
4273        Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]());
4274}
4275//# sourceMappingURL=publish.js.map
4276
4277/***/ }),
4278
4279/***/ "Nv8m":
4280/*!****************************************************************!*\
4281  !*** ./node_modules/rxjs/_esm2015/internal/observable/race.js ***!
4282  \****************************************************************/
4283/*! exports provided: race, RaceOperator, RaceSubscriber */
4284/***/ (function(module, __webpack_exports__, __webpack_require__) {
4285
4286"use strict";
4287__webpack_require__.r(__webpack_exports__);
4288/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; });
4289/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceOperator", function() { return RaceOperator; });
4290/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceSubscriber", function() { return RaceSubscriber; });
4291/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
4292/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fromArray */ "yCtX");
4293/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "l7GE");
4294/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "ZUHj");
4295
4296
4297
4298
4299function race(...observables) {
4300    if (observables.length === 1) {
4301        if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
4302            observables = observables[0];
4303        }
4304        else {
4305            return observables[0];
4306        }
4307    }
4308    return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(observables, undefined).lift(new RaceOperator());
4309}
4310class RaceOperator {
4311    call(subscriber, source) {
4312        return source.subscribe(new RaceSubscriber(subscriber));
4313    }
4314}
4315class RaceSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] {
4316    constructor(destination) {
4317        super(destination);
4318        this.hasFirst = false;
4319        this.observables = [];
4320        this.subscriptions = [];
4321    }
4322    _next(observable) {
4323        this.observables.push(observable);
4324    }
4325    _complete() {
4326        const observables = this.observables;
4327        const len = observables.length;
4328        if (len === 0) {
4329            this.destination.complete();
4330        }
4331        else {
4332            for (let i = 0; i < len && !this.hasFirst; i++) {
4333                const observable = observables[i];
4334                const subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, observable, undefined, i);
4335                if (this.subscriptions) {
4336                    this.subscriptions.push(subscription);
4337                }
4338                this.add(subscription);
4339            }
4340            this.observables = null;
4341        }
4342    }
4343    notifyNext(_outerValue, innerValue, outerIndex) {
4344        if (!this.hasFirst) {
4345            this.hasFirst = true;
4346            for (let i = 0; i < this.subscriptions.length; i++) {
4347                if (i !== outerIndex) {
4348                    let subscription = this.subscriptions[i];
4349                    subscription.unsubscribe();
4350                    this.remove(subscription);
4351                }
4352            }
4353            this.subscriptions = null;
4354        }
4355        this.destination.next(innerValue);
4356    }
4357}
4358//# sourceMappingURL=race.js.map
4359
4360/***/ }),
4361
4362/***/ "O4y0":
4363/*!*********************************************************************************!*\
4364  !*** ./node_modules/rxjs/_esm2015/internal/observable/SubscribeOnObservable.js ***!
4365  \*********************************************************************************/
4366/*! exports provided: SubscribeOnObservable */
4367/***/ (function(module, __webpack_exports__, __webpack_require__) {
4368
4369"use strict";
4370__webpack_require__.r(__webpack_exports__);
4371/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubscribeOnObservable", function() { return SubscribeOnObservable; });
4372/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
4373/* harmony import */ var _scheduler_asap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/asap */ "7Hc7");
4374/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isNumeric */ "Y7HM");
4375
4376
4377
4378class SubscribeOnObservable extends _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] {
4379    constructor(source, delayTime = 0, scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_1__["asap"]) {
4380        super();
4381        this.source = source;
4382        this.delayTime = delayTime;
4383        this.scheduler = scheduler;
4384        if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(delayTime) || delayTime < 0) {
4385            this.delayTime = 0;
4386        }
4387        if (!scheduler || typeof scheduler.schedule !== 'function') {
4388            this.scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_1__["asap"];
4389        }
4390    }
4391    static create(source, delay = 0, scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_1__["asap"]) {
4392        return new SubscribeOnObservable(source, delay, scheduler);
4393    }
4394    static dispatch(arg) {
4395        const { source, subscriber } = arg;
4396        return this.add(source.subscribe(subscriber));
4397    }
4398    _subscribe(subscriber) {
4399        const delay = this.delayTime;
4400        const source = this.source;
4401        const scheduler = this.scheduler;
4402        return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {
4403            source, subscriber
4404        });
4405    }
4406}
4407//# sourceMappingURL=SubscribeOnObservable.js.map
4408
4409/***/ }),
4410
4411/***/ "OQgR":
4412/*!******************************************************************!*\
4413  !*** ./node_modules/rxjs/_esm2015/internal/operators/groupBy.js ***!
4414  \******************************************************************/
4415/*! exports provided: groupBy, GroupedObservable */
4416/***/ (function(module, __webpack_exports__, __webpack_require__) {
4417
4418"use strict";
4419__webpack_require__.r(__webpack_exports__);
4420/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; });
4421/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return GroupedObservable; });
4422/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
4423/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "quSY");
4424/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observable */ "HDdC");
4425/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Subject */ "XNiG");
4426
4427
4428
4429
4430function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) {
4431    return (source) => source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));
4432}
4433class GroupByOperator {
4434    constructor(keySelector, elementSelector, durationSelector, subjectSelector) {
4435        this.keySelector = keySelector;
4436        this.elementSelector = elementSelector;
4437        this.durationSelector = durationSelector;
4438        this.subjectSelector = subjectSelector;
4439    }
4440    call(subscriber, source) {
4441        return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));
4442    }
4443}
4444class GroupBySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
4445    constructor(destination, keySelector, elementSelector, durationSelector, subjectSelector) {
4446        super(destination);
4447        this.keySelector = keySelector;
4448        this.elementSelector = elementSelector;
4449        this.durationSelector = durationSelector;
4450        this.subjectSelector = subjectSelector;
4451        this.groups = null;
4452        this.attemptedToUnsubscribe = false;
vendor: 6,899 bytes, lines 4453-4654
4453        this.count = 0;
4454    }
4455    _next(value) {
4456        let key;
4457        try {
4458            key = this.keySelector(value);
4459        }
4460        catch (err) {
4461            this.error(err);
4462            return;
4463        }
4464        this._group(value, key);
4465    }
4466    _group(value, key) {
4467        let groups = this.groups;
4468        if (!groups) {
4469            groups = this.groups = new Map();
4470        }
4471        let group = groups.get(key);
4472        let element;
4473        if (this.elementSelector) {
4474            try {
4475                element = this.elementSelector(value);
4476            }
4477            catch (err) {
4478                this.error(err);
4479            }
4480        }
4481        else {
4482            element = value;
4483        }
4484        if (!group) {
4485            group = (this.subjectSelector ? this.subjectSelector() : new _Subject__WEBPACK_IMPORTED_MODULE_3__["Subject"]());
4486            groups.set(key, group);
4487            const groupedObservable = new GroupedObservable(key, group, this);
4488            this.destination.next(groupedObservable);
4489            if (this.durationSelector) {
4490                let duration;
4491                try {
4492                    duration = this.durationSelector(new GroupedObservable(key, group));
4493                }
4494                catch (err) {
4495                    this.error(err);
4496                    return;
4497                }
4498                this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));
4499            }
4500        }
4501        if (!group.closed) {
4502            group.next(element);
4503        }
4504    }
4505    _error(err) {
4506        const groups = this.groups;
4507        if (groups) {
4508            groups.forEach((group, key) => {
4509                group.error(err);
4510            });
4511            groups.clear();
4512        }
4513        this.destination.error(err);
4514    }
4515    _complete() {
4516        const groups = this.groups;
4517        if (groups) {
4518            groups.forEach((group, key) => {
4519                group.complete();
4520            });
4521            groups.clear();
4522        }
4523        this.destination.complete();
4524    }
4525    removeGroup(key) {
4526        this.groups.delete(key);
4527    }
4528    unsubscribe() {
4529        if (!this.closed) {
4530            this.attemptedToUnsubscribe = true;
4531            if (this.count === 0) {
4532                super.unsubscribe();
4533            }
4534        }
4535    }
4536}
4537class GroupDurationSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
4538    constructor(key, group, parent) {
4539        super(group);
4540        this.key = key;
4541        this.group = group;
4542        this.parent = parent;
4543    }
4544    _next(value) {
4545        this.complete();
4546    }
4547    _unsubscribe() {
4548        const { parent, key } = this;
4549        this.key = this.parent = null;
4550        if (parent) {
4551            parent.removeGroup(key);
4552        }
4553    }
4554}
4555class GroupedObservable extends _Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"] {
4556    constructor(key, groupSubject, refCountSubscription) {
4557        super();
4558        this.key = key;
4559        this.groupSubject = groupSubject;
4560        this.refCountSubscription = refCountSubscription;
4561    }
4562    _subscribe(subscriber) {
4563        const subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
4564        const { refCountSubscription, groupSubject } = this;
4565        if (refCountSubscription && !refCountSubscription.closed) {
4566            subscription.add(new InnerRefCountSubscription(refCountSubscription));
4567        }
4568        subscription.add(groupSubject.subscribe(subscriber));
4569        return subscription;
4570    }
4571}
4572class InnerRefCountSubscription extends _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"] {
4573    constructor(parent) {
4574        super();
4575        this.parent = parent;
4576        parent.count++;
4577    }
4578    unsubscribe() {
4579        const parent = this.parent;
4580        if (!parent.closed && !this.closed) {
4581            super.unsubscribe();
4582            parent.count -= 1;
4583            if (parent.count === 0 && parent.attemptedToUnsubscribe) {
4584                parent.unsubscribe();
4585            }
4586        }
4587    }
4588}
4589//# sourceMappingURL=groupBy.js.map
4590
4591/***/ }),
4592
4593/***/ "OsX3":
4594/*!*********************************************************************!*\
4595  !*** ./node_modules/rxjs/_esm2015/internal/operators/bufferTime.js ***!
4596  \*********************************************************************/
4597/*! exports provided: bufferTime */
4598/***/ (function(module, __webpack_exports__, __webpack_require__) {
4599
4600"use strict";
4601__webpack_require__.r(__webpack_exports__);
4602/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return bufferTime; });
4603/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
4604/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
4605/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
4606
4607
4608
4609function bufferTime(bufferTimeSpan) {
4610    let length = arguments.length;
4611    let scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"];
4612    if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(arguments[arguments.length - 1])) {
4613        scheduler = arguments[arguments.length - 1];
4614        length--;
4615    }
4616    let bufferCreationInterval = null;
4617    if (length >= 2) {
4618        bufferCreationInterval = arguments[1];
4619    }
4620    let maxBufferSize = Number.POSITIVE_INFINITY;
4621    if (length >= 3) {
4622        maxBufferSize = arguments[2];
4623    }
4624    return function bufferTimeOperatorFunction(source) {
4625        return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));
4626    };
4627}
4628class BufferTimeOperator {
4629    constructor(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
4630        this.bufferTimeSpan = bufferTimeSpan;
4631        this.bufferCreationInterval = bufferCreationInterval;
4632        this.maxBufferSize = maxBufferSize;
4633        this.scheduler = scheduler;
4634    }
4635    call(subscriber, source) {
4636        return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler));
4637    }
4638}
4639class Context {
4640    constructor() {
4641        this.buffer = [];
4642    }
4643}
4644class BufferTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"] {
4645    constructor(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
4646        super(destination);
4647        this.bufferTimeSpan = bufferTimeSpan;
4648        this.bufferCreationInterval = bufferCreationInterval;
4649        this.maxBufferSize = maxBufferSize;
4650        this.scheduler = scheduler;
4651        this.contexts = [];
4652        const context = this.openContext();
4653        this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;
4654        if (this.timespanOnly) {
vendor: 5,925 bytes, lines 4655-4800
4655            const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan };
4656            this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
4657        }
4658        else {
4659            const closeState = { subscriber: this, context };
4660            const creationState = { bufferTimeSpan, bufferCreationInterval, subscriber: this, scheduler };
4661            this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState));
4662            this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState));
4663        }
4664    }
4665    _next(value) {
4666        const contexts = this.contexts;
4667        const len = contexts.length;
4668        let filledBufferContext;
4669        for (let i = 0; i < len; i++) {
4670            const context = contexts[i];
4671            const buffer = context.buffer;
4672            buffer.push(value);
4673            if (buffer.length == this.maxBufferSize) {
4674                filledBufferContext = context;
4675            }
4676        }
4677        if (filledBufferContext) {
4678            this.onBufferFull(filledBufferContext);
4679        }
4680    }
4681    _error(err) {
4682        this.contexts.length = 0;
4683        super._error(err);
4684    }
4685    _complete() {
4686        const { contexts, destination } = this;
4687        while (contexts.length > 0) {
4688            const context = contexts.shift();
4689            destination.next(context.buffer);
4690        }
4691        super._complete();
4692    }
4693    _unsubscribe() {
4694        this.contexts = null;
4695    }
4696    onBufferFull(context) {
4697        this.closeContext(context);
4698        const closeAction = context.closeAction;
4699        closeAction.unsubscribe();
4700        this.remove(closeAction);
4701        if (!this.closed && this.timespanOnly) {
4702            context = this.openContext();
4703            const bufferTimeSpan = this.bufferTimeSpan;
4704            const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan };
4705            this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
4706        }
4707    }
4708    openContext() {
4709        const context = new Context();
4710        this.contexts.push(context);
4711        return context;
4712    }
4713    closeContext(context) {
4714        this.destination.next(context.buffer);
4715        const contexts = this.contexts;
4716        const spliceIndex = contexts ? contexts.indexOf(context) : -1;
4717        if (spliceIndex >= 0) {
4718            contexts.splice(contexts.indexOf(context), 1);
4719        }
4720    }
4721}
4722function dispatchBufferTimeSpanOnly(state) {
4723    const subscriber = state.subscriber;
4724    const prevContext = state.context;
4725    if (prevContext) {
4726        subscriber.closeContext(prevContext);
4727    }
4728    if (!subscriber.closed) {
4729        state.context = subscriber.openContext();
4730        state.context.closeAction = this.schedule(state, state.bufferTimeSpan);
4731    }
4732}
4733function dispatchBufferCreation(state) {
4734    const { bufferCreationInterval, bufferTimeSpan, subscriber, scheduler } = state;
4735    const context = subscriber.openContext();
4736    const action = this;
4737    if (!subscriber.closed) {
4738        subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber, context }));
4739        action.schedule(state, bufferCreationInterval);
4740    }
4741}
4742function dispatchBufferClose(arg) {
4743    const { subscriber, context } = arg;
4744    subscriber.closeContext(context);
4745}
4746//# sourceMappingURL=bufferTime.js.map
4747
4748/***/ }),
4749
4750/***/ "PZkE":
4751/*!**********************************************************************************!*\
4752  !*** ./node_modules/rxjs/_esm2015/internal/operators/distinctUntilKeyChanged.js ***!
4753  \**********************************************************************************/
4754/*! exports provided: distinctUntilKeyChanged */
4755/***/ (function(module, __webpack_exports__, __webpack_require__) {
4756
4757"use strict";
4758__webpack_require__.r(__webpack_exports__);
4759/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return distinctUntilKeyChanged; });
4760/* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./distinctUntilChanged */ "/uUt");
4761
4762function distinctUntilKeyChanged(key, compare) {
4763    return Object(_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__["distinctUntilChanged"])((x, y) => compare ? compare(x[key], y[key]) : x[key] === y[key]);
4764}
4765//# sourceMappingURL=distinctUntilKeyChanged.js.map
4766
4767/***/ }),
4768
4769/***/ "PfrF":
4770/*!*********************************************************************!*\
4771  !*** ./node_modules/rxjs/_esm2015/internal/operators/bufferWhen.js ***!
4772  \*********************************************************************/
4773/*! exports provided: bufferWhen */
4774/***/ (function(module, __webpack_exports__, __webpack_require__) {
4775
4776"use strict";
4777__webpack_require__.r(__webpack_exports__);
4778/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return bufferWhen; });
4779/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscription */ "quSY");
4780/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
4781
4782
4783function bufferWhen(closingSelector) {
4784    return function (source) {
4785        return source.lift(new BufferWhenOperator(closingSelector));
4786    };
4787}
4788class BufferWhenOperator {
4789    constructor(closingSelector) {
4790        this.closingSelector = closingSelector;
4791    }
4792    call(subscriber, source) {
4793        return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));
4794    }
4795}
4796class BufferWhenSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["SimpleOuterSubscriber"] {
4797    constructor(destination, closingSelector) {
4798        super(destination);
4799        this.closingSelector = closingSelector;
4800        this.subscribing = false;
4801        this.openBuffer();
4802    }
4803    _next(value) {
4804        this.buffer.push(value);
4805    }
4806    _complete() {
4807        const buffer = this.buffer;
4808        if (buffer) {
4809            this.destination.next(buffer);
4810        }
4811        super._complete();
4812    }
4813    _unsubscribe() {
4814        this.buffer = undefined;
4815        this.subscribing = false;
4816    }
4817    notifyNext() {
4818        this.openBuffer();
4819    }
4820    notifyComplete() {
4821        if (this.subscribing) {
4822            this.complete();
4823        }
4824        else {
4825            this.openBuffer();
4826        }
4827    }
4828    openBuffer() {
4829        let { closingSubscription } = this;
4830        if (closingSubscription) {
4831            this.remove(closingSubscription);
4832            closingSubscription.unsubscribe();
4833        }
4834        const buffer = this.buffer;
4835        if (this.buffer) {
4836            this.destination.next(buffer);
4837        }
4838        this.buffer = [];
4839        let closingNotifier;
4840        try {
4841            const { closingSelector } = this;
4842            closingNotifier = closingSelector();
4843        }
4844        catch (err) {
4845            return this.error(err);
4846        }
4847        closingSubscription = new _Subscription__WEBPACK_IMPORTED_MODULE_0__["Subscription"]();
4848        this.closingSubscription = closingSubscription;
4849        this.add(closingSubscription);
4850        this.subscribing = true;
4851        closingSubscription.add(Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["innerSubscribe"])(closingNotifier, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["SimpleInnerSubscriber"](this)));
4852        this.subscribing = false;
4853    }
4854}
4855//# sourceMappingURL=bufferWhen.js.map
4856
4857/***/ }),
4858
4859/***/ "PqYM":
4860/*!*****************************************************************!*\
4861  !*** ./node_modules/rxjs/_esm2015/internal/observable/timer.js ***!
4862  \*****************************************************************/
4863/*! exports provided: timer */
4864/***/ (function(module, __webpack_exports__, __webpack_require__) {
4865
4866"use strict";
4867__webpack_require__.r(__webpack_exports__);
4868/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; });
4869/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
4870/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
4871/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isNumeric */ "Y7HM");
4872/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
4873
4874
4875
4876
4877function timer(dueTime = 0, periodOrScheduler, scheduler) {
4878    let period = -1;
4879    if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(periodOrScheduler)) {
4880        period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);
4881    }
4882    else if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(periodOrScheduler)) {
4883        scheduler = periodOrScheduler;
4884    }
4885    if (!Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(scheduler)) {
4886        scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
4887    }
4888    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
4889        const due = Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(dueTime)
4890            ? dueTime
4891            : (+dueTime - scheduler.now());
4892        return scheduler.schedule(dispatch, due, {
4893            index: 0, period, subscriber
4894        });
4895    });
4896}
4897function dispatch(state) {
4898    const { index, period, subscriber } = state;
4899    subscriber.next(index);
4900    if (subscriber.closed) {
4901        return;
4902    }
4903    else if (period === -1) {
4904        return subscriber.complete();
4905    }
4906    state.index = index + 1;
4907    this.schedule(state, period);
4908}
4909//# sourceMappingURL=timer.js.map
4910
4911/***/ }),
4912
4913/***/ "Pz8W":
4914/*!*********************************************************************!*\
4915  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AsapAction.js ***!
4916  \*********************************************************************/
4917/*! exports provided: AsapAction */
4918/***/ (function(module, __webpack_exports__, __webpack_require__) {
4919
4920"use strict";
4921__webpack_require__.r(__webpack_exports__);
4922/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapAction", function() { return AsapAction; });
4923/* harmony import */ var _util_Immediate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/Immediate */ "c7jc");
4924/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncAction */ "3N8a");
4925
4926
4927class AsapAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"] {
4928    constructor(scheduler, work) {
4929        super(scheduler, work);
4930        this.scheduler = scheduler;
4931        this.work = work;
4932    }
4933    requestAsyncId(scheduler, id, delay = 0) {
4934        if (delay !== null && delay > 0) {
4935            return super.requestAsyncId(scheduler, id, delay);
4936        }
4937        scheduler.actions.push(this);
4938        return scheduler.scheduled || (scheduler.scheduled = _util_Immediate__WEBPACK_IMPORTED_MODULE_0__["Immediate"].setImmediate(scheduler.flush.bind(scheduler, null)));
4939    }
4940    recycleAsyncId(scheduler, id, delay = 0) {
4941        if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
4942            return super.recycleAsyncId(scheduler, id, delay);
4943        }
4944        if (scheduler.actions.length === 0) {
4945            _util_Immediate__WEBPACK_IMPORTED_MODULE_0__["Immediate"].clearImmediate(id);
4946            scheduler.scheduled = undefined;
4947        }
4948        return undefined;
4949    }
4950}
4951//# sourceMappingURL=AsapAction.js.map
4952
4953/***/ }),
4954
4955/***/ "QIAL":
4956/*!*************************************************************************!*\
4957  !*** ./node_modules/rxjs/_esm2015/internal/util/isInteropObservable.js ***!
4958  \*************************************************************************/
4959/*! exports provided: isInteropObservable */
4960/***/ (function(module, __webpack_exports__, __webpack_require__) {
4961
4962"use strict";
4963__webpack_require__.r(__webpack_exports__);
4964/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInteropObservable", function() { return isInteropObservable; });
4965/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ "kJWO");
4966
4967function isInteropObservable(input) {
4968    return input && typeof input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]] === 'function';
4969}
4970//# sourceMappingURL=isInteropObservable.js.map
4971
4972/***/ }),
4973
4974/***/ "Qn8I":
4975/*!*****************************************************************!*\
4976  !*** ./node_modules/rxjs/_esm2015/internal/observable/using.js ***!
4977  \*****************************************************************/
4978/*! exports provided: using */
4979/***/ (function(module, __webpack_exports__, __webpack_require__) {
4980
4981"use strict";
4982__webpack_require__.r(__webpack_exports__);
4983/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "using", function() { return using; });
4984/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
4985/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ "Cfvw");
4986/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty */ "EY2u");
4987
4988
4989
4990function using(resourceFactory, observableFactory) {
4991    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
4992        let resource;
4993        try {
4994            resource = resourceFactory();
4995        }
4996        catch (err) {
4997            subscriber.error(err);
4998            return undefined;
4999        }
5000        let result;
5001        try {
5002            result = observableFactory(resource);
5003        }
5004        catch (err) {
5005            subscriber.error(err);
5006            return undefined;
5007        }
5008        const source = result ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(result) : _empty__WEBPACK_IMPORTED_MODULE_2__["EMPTY"];
5009        const subscription = source.subscribe(subscriber);
5010        return () => {
5011            subscription.unsubscribe();
5012            if (resource) {
5013                resource.unsubscribe();
5014            }
5015        };
5016    });
5017}
5018//# sourceMappingURL=using.js.map
5019
5020/***/ }),
5021
5022/***/ "QqCr":
5023/*!************************************************************************!*\
5024  !*** ./node_modules/rxjs/_esm2015/internal/observable/bindCallback.js ***!
5025  \************************************************************************/
5026/*! exports provided: bindCallback */
5027/***/ (function(module, __webpack_exports__, __webpack_require__) {
5028
5029"use strict";
5030__webpack_require__.r(__webpack_exports__);
5031/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return bindCallback; });
5032/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
5033/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AsyncSubject */ "NHP+");
5034/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/map */ "lJxs");
5035/* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/canReportError */ "8Qeq");
5036/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
5037/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
5038
5039
5040
5041
5042
5043
5044function bindCallback(callbackFunc, resultSelector, scheduler) {
5045    if (resultSelector) {
5046        if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(resultSelector)) {
5047            scheduler = resultSelector;
5048        }
5049        else {
5050            return (...args) => bindCallback(callbackFunc, scheduler)(...args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])((args) => Object(_util_isArray__WEBPACK_IMPORTED_MODULE_4__["isArray"])(args) ? resultSelector(...args) : resultSelector(args)));
5051        }
5052    }
5053    return function (...args) {
5054        const context = this;
5055        let subject;
5056        const params = {
5057            context,
5058            subject,
5059            callbackFunc,
5060            scheduler,
5061        };
5062        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
5063            if (!scheduler) {
5064                if (!subject) {
5065                    subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
5066                    const handler = (...innerArgs) => {
5067                        subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
5068                        subject.complete();
5069                    };
5070                    try {
5071                        callbackFunc.apply(context, [...args, handler]);
5072                    }
5073                    catch (err) {
5074                        if (Object(_util_canReportError__WEBPACK_IMPORTED_MODULE_3__["canReportError"])(subject)) {
5075                            subject.error(err);
5076                        }
5077                        else {
5078                            console.warn(err);
5079                        }
5080                    }
5081                }
5082                return subject.subscribe(subscriber);
5083            }
5084            else {
5085                const state = {
5086                    args, subscriber, params,
5087                };
5088                return scheduler.schedule(dispatch, 0, state);
5089            }
5090        });
5091    };
5092}
5093function dispatch(state) {
5094    const self = this;
5095    const { args, subscriber, params } = state;
5096    const { callbackFunc, context, scheduler } = params;
5097    let { subject } = params;
5098    if (!subject) {
5099        subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"]();
5100        const handler = (...innerArgs) => {
5101            const value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
5102            this.add(scheduler.schedule(dispatchNext, 0, { value, subject }));
5103        };
5104        try {
5105            callbackFunc.apply(context, [...args, handler]);
5106        }
5107        catch (err) {
5108            subject.error(err);
5109        }
5110    }
5111    this.add(subject.subscribe(subscriber));
5112}
5113function dispatchNext(state) {
5114    const { value, subject } = state;
5115    subject.next(value);
5116    subject.complete();
5117}
5118function dispatchError(state) {
5119    const { err, subject } = state;
5120    subject.error(err);
5121}
5122//# sourceMappingURL=bindCallback.js.map
5123
5124/***/ }),
5125
5126/***/ "RUbi":
5127/*!************************************************************************!*\
5128  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AsapScheduler.js ***!
5129  \************************************************************************/
5130/*! exports provided: AsapScheduler */
5131/***/ (function(module, __webpack_exports__, __webpack_require__) {
5132
5133"use strict";
5134__webpack_require__.r(__webpack_exports__);
5135/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapScheduler", function() { return AsapScheduler; });
5136/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncScheduler */ "IjjT");
5137
5138class AsapScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__["AsyncScheduler"] {
5139    flush(action) {
5140        this.active = true;
5141        this.scheduled = undefined;
5142        const { actions } = this;
5143        let error;
5144        let index = -1;
5145        let count = actions.length;
5146        action = action || actions.shift();
5147        do {
5148            if (error = action.execute(action.state, action.delay)) {
5149                break;
5150            }
5151        } while (++index < count && (action = actions.shift()));
5152        this.active = false;
5153        if (error) {
5154            while (++index < count && (action = actions.shift())) {
5155                action.unsubscribe();
5156            }
5157            throw error;
5158        }
5159    }
5160}
5161//# sourceMappingURL=AsapScheduler.js.map
5162
5163/***/ }),
5164
5165/***/ "SeVD":
5166/*!*****************************************************************!*\
5167  !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeTo.js ***!
5168  \*****************************************************************/
5169/*! exports provided: subscribeTo */
5170/***/ (function(module, __webpack_exports__, __webpack_require__) {
5171
5172"use strict";
5173__webpack_require__.r(__webpack_exports__);
5174/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeTo", function() { return subscribeTo; });
5175/* harmony import */ var _subscribeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subscribeToArray */ "ngJS");
5176/* harmony import */ var _subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscribeToPromise */ "a7t3");
5177/* harmony import */ var _subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subscribeToIterable */ "pLzU");
5178/* harmony import */ var _subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./subscribeToObservable */ "CRDf");
5179/* harmony import */ var _isArrayLike__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike */ "I55L");
5180/* harmony import */ var _isPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isPromise */ "c2HN");
5181/* harmony import */ var _isObject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isObject */ "XoHu");
5182/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../symbol/iterator */ "Lhse");
5183/* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../symbol/observable */ "kJWO");
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193const subscribeTo = (result) => {
5194    if (!!result && typeof result[_symbol_observable__WEBPACK_IMPORTED_MODULE_8__["observable"]] === 'function') {
5195        return Object(_subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__["subscribeToObservable"])(result);
5196    }
5197    else if (Object(_isArrayLike__WEBPACK_IMPORTED_MODULE_4__["isArrayLike"])(result)) {
5198        return Object(_subscribeToArray__WEBPACK_IMPORTED_MODULE_0__["subscribeToArray"])(result);
5199    }
5200    else if (Object(_isPromise__WEBPACK_IMPORTED_MODULE_5__["isPromise"])(result)) {
5201        return Object(_subscribeToPromise__WEBPACK_IMPORTED_MODULE_1__["subscribeToPromise"])(result);
5202    }
5203    else if (!!result && typeof result[_symbol_iterator__WEBPACK_IMPORTED_MODULE_7__["iterator"]] === 'function') {
5204        return Object(_subscribeToIterable__WEBPACK_IMPORTED_MODULE_2__["subscribeToIterable"])(result);
5205    }
5206    else {
5207        const value = Object(_isObject__WEBPACK_IMPORTED_MODULE_6__["isObject"])(result) ? 'an invali
5207d object' : `'${result}'`;
5208        const msg = `You provided ${value} where a stream was expected.`
5209            + ' You can provide an Observable, Promise, Array, or Iterable.';
5210        throw new TypeError(msg);
5211    }
5212};
5213//# sourceMappingURL=subscribeTo.js.map
5214
5215/***/ }),
5216
5217/***/ "SpAZ":
5218/*!**************************************************************!*\
5219  !*** ./node_modules/rxjs/_esm2015/internal/util/identity.js ***!
5220  \**************************************************************/
5221/*! exports provided: identity */
5222/***/ (function(module, __webpack_exports__, __webpack_require__) {
5223
5224"use strict";
5225__webpack_require__.r(__webpack_exports__);
5226/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; });
5227function identity(x) {
5228    return x;
5229}
5230//# sourceMappingURL=identity.js.map
5231
5232/***/ }),
5233
5234/***/ "SxV6":
5235/*!****************************************************************!*\
5236  !*** ./node_modules/rxjs/_esm2015/internal/operators/first.js ***!
5237  \****************************************************************/
5238/*! exports provided: first */
5239/***/ (function(module, __webpack_exports__, __webpack_require__) {
5240
5241"use strict";
5242__webpack_require__.r(__webpack_exports__);
5243/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; });
5244/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ "sVev");
5245/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ "pLZG");
5246/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./take */ "IzEk");
5247/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultIfEmpty */ "xbPD");
5248/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./throwIfEmpty */ "XDbj");
5249/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/identity */ "SpAZ");
5250
5251
5252
5253
5254
5255
5256function first(predicate, defaultValue) {
5257    const hasDefaultValue = arguments.length >= 2;
5258    return (source) => source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])((v, i) => predicate(v, i, source)) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_take__WEBPACK_IMPORTED_MODULE_2__["take"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__["throwIfEmpty"])(() => new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"]()));
5259}
5260//# sourceMappingURL=first.js.map
5261
5262/***/ }),
5263
5264/***/ "UGaM":
5265/*!**************************************************************************!*\
5266  !*** ./node_modules/rxjs/_esm2015/internal/operators/publishBehavior.js ***!
5267  \**************************************************************************/
5268/*! exports provided: publishBehavior */
5269/***/ (function(module, __webpack_exports__, __webpack_require__) {
5270
5271"use strict";
5272__webpack_require__.r(__webpack_exports__);
5273/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return publishBehavior; });
5274/* harmony import */ var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../BehaviorSubject */ "2Vo4");
5275/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "oB13");
5276
5277
5278function publishBehavior(value) {
5279    return (source) => Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__["BehaviorSubject"](value))(source);
5280}
5281//# sourceMappingURL=publishBehavior.js.map
5282
5283/***/ }),
5284
5285/***/ "UHp3":
5286/*!*********************************************************************!*\
5287  !*** ./node_modules/rxjs/_esm2015/internal/operators/windowTime.js ***!
5288  \*********************************************************************/
5289/*! exports provided: windowTime */
5290/***/ (function(module, __webpack_exports__, __webpack_require__) {
5291
5292"use strict";
5293__webpack_require__.r(__webpack_exports__);
5294/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return windowTime; });
5295/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "XNiG");
5296/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
5297/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
5298/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isNumeric */ "Y7HM");
5299/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
5300
5301
5302
5303
5304
5305function windowTime(windowTimeSpan) {
5306    let scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
5307    let windowCreationInterval = null;
5308    let maxWindowSize = Number.POSITIVE_INFINITY;
5309    if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(arguments[3])) {
5310        scheduler = arguments[3];
5311    }
5312    if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(arguments[2])) {
5313        scheduler = arguments[2];
5314    }
5315    else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_3__["isNumeric"])(arguments[2])) {
5316        maxWindowSize = Number(arguments[2]);
5317    }
5318    if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(arguments[1])) {
5319        scheduler = arguments[1];
5320    }
5321    else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_3__["isNumeric"])(arguments[1])) {
5322        windowCreationInterval = Number(arguments[1]);
5323    }
5324    return function windowTimeOperatorFunction(source) {
5325        return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
5326    };
5327}
5328class WindowTimeOperator {
5329    constructor(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
5330        this.windowTimeSpan = windowTimeSpan;
5331        this.windowCreationInterval = windowCreationInterval;
5332        this.maxWindowSize = maxWindowSize;
5333        this.scheduler = scheduler;
5334    }
5335    call(subscriber, source) {
5336        return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));
5337    }
5338}
5339class CountedSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"] {
5340    constructor() {
5341        super(...arguments);
5342        this._numberOfNextedValues = 0;
5343    }
5344    next(value) {
5345        this._numberOfNextedValues++;
5346        super.next(value);
5347    }
5348    get numberOfNextedValues() {
5349        return this._numberOfNextedValues;
5350    }
5351}
5352class WindowTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"] {
5353    constructor(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
5354        super(destination);
5355        this.destination = destination;
5356        this.windowTimeSpan = windowTimeSpan;
5357        this.windowCreationInterval = windowCreationInterval;
5358        this.maxWindowSize = maxWindowSize;
5359        this.scheduler = scheduler;
5360        this.windows = [];
5361        const window = this.openWindow();
5362        if (windowCreationInterval !== null && windowCreationInterval >= 0) {
5363            const closeState = { subscriber: this, window, context: null };
5364            const creationState = { windowTimeSpan, windowCreationInterval, subscriber: this, scheduler };
5365            this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));
5366            this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));
5367        }
5368        else {
5369            const timeSpanOnlyState = { subscriber: this, window, windowTimeSpan };
5370            this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
5371        }
5372    }
5373    _next(value) {
5374        const windows = this.windows;
5375        const len = windows.length;
5376        for (let i = 0; i < len; i++) {
5377            const window = windows[i];
5378            if (!window.closed) {
5379                window.next(value);
5380                if (window.numberOfNextedValues >= this.maxWindowSize) {
5381                    this.closeWindow(window);
5382                }
5383            }
5384        }
5385    }
5386    _error(err) {
5387        const windows = this.windows;
5388        while (windows.length > 0) {
5389            windows.shift().error(err);
5390        }
5391        this.destination.error(err);
5392    }
5393    _complete() {
5394        const windows = this.windows;
5395        while (windows.length > 0) {
5396            const window = windows.shift();
5397            if (!window.closed) {
5398                window.complete();
5399            }
5400        }
5401        this.destination.complete();
5402    }
5403    openWindow() {
5404        const window = new CountedSubject();
5405        this.windows.push(window);
5406        const destination = this.destination;
5407        destination.next(window);
5408        return window;
5409    }
5410    closeWindow(window) {
5411        window.complete();
5412        const windows = this.windows;
5413        windows.splice(windows.indexOf(window), 1);
5414    }
5415}
5416function dispatchWindowTimeSpanOnly(state) {
5417    const { subscriber, windowTimeSpan, window } = state;
5418    if (window) {
5419        subscriber.closeWindow(window);
5420    }
5421    state.window = subscriber.openWindow();
5422    this.schedule(state, windowTimeSpan);
5423}
5424function dispatchWindowCreation(state) {
5425    const { windowTimeSpan, subscriber, scheduler, windowCreationInterval } = state;
5426    const window = subscriber.openWindow();
5427    const action = this;
5428    let context = { action, subscription: null };
5429    const timeSpanState = { subscriber, window, context };
5430    context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);
5431    action.add(context.subscription);
5432    action.schedule(state, windowCreationInterval);
5433}
5434function dispatchWindowClose(state) {
5435    const { subscriber, window, context } = state;
5436    if (context && context.action && context.subscription) {
5437        context.action.remove(context.subscription);
5438    }
5439    subscriber.closeWindow(window);
5440}
5441//# sourceMappingURL=windowTime.js.map
5442
5443/***/ }),
5444
5445/***/ "UXbc":
5446/*!*********************************************************************!*\
5447  !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeMapTo.js ***!
5448  \*********************************************************************/
5449/*! exports provided: mergeMapTo */
5450/***/ (function(module, __webpack_exports__, __webpack_require__) {
5451
5452"use strict";
5453__webpack_require__.r(__webpack_exports__);
5454/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return mergeMapTo; });
5455/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ "5+tZ");
5456
5457function mergeMapTo(innerObservable, resultSelector, concurrent = Number.POSITIVE_INFINITY) {
5458    if (typeof resultSelector === 'function') {
5459        return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(() => innerObservable, resultSelector, concurrent);
5460    }
5461    if (typeof resultSelector === 'number') {
5462        concurrent = resultSelector;
5463    }
5464    return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(() => innerObservable, concurrent);
5465}
5466//# sourceMappingURL=mergeMapTo.js.map
5467
5468/***/ }),
5469
5470/***/ "UXun":
5471/*!**********************************************************************!*\
5472  !*** ./node_modules/rxjs/_esm2015/internal/operators/shareReplay.js ***!
5473  \**********************************************************************/
5474/*! exports provided: shareReplay */
5475/***/ (function(module, __webpack_exports__, __webpack_require__) {
5476
5477"use strict";
5478__webpack_require__.r(__webpack_exports__);
5479/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return shareReplay; });
5480/* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ReplaySubject */ "jtHE");
5481
5482function shareReplay(configOrBufferSize, windowTime, scheduler) {
5483    let config;
5484    if (configOrBufferSize && typeof configOrBufferSize === 'object') {
5485        config = configOrBufferSize;
5486    }
5487    else {
5488        config = {
5489            bufferSize: configOrBufferSize,
5490            windowTime,
5491            refCount: false,
5492            scheduler,
5493        };
5494    }
5495    return (source) => source.lift(shareReplayOperator(config));
5496}
5497function shareReplayOperator({ bufferSize = Number.POSITIVE_INFINITY, windowTime = Number.POSITIVE_INFINITY, refCount: useRefCount, scheduler, }) {
5498    let subject;
5499    let refCount = 0;
5500    let subscription;
5501    let hasError = false;
5502    let isComplete = false;
5503    return function shareReplayOperation(source) {
5504        refCount++;
5505        let innerSub;
5506        if (!subject || hasError) {
5507            hasError = false;
5508            subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler);
5509            innerSub = subject.subscribe(this);
5510            subscription = source.subscribe({
5511                next(value) {
5512                    subject.next(value);
5513                },
5514                error(err) {
5515                    hasError = true;
5516                    subject.error(err);
5517                },
5518                complete() {
5519                    isComplete = true;
5520                    subscription = undefined;
5521                    subject.complete();
5522                },
5523            });
5524            if (isComplete) {
5525                subscription = undefined;
5526            }
5527        }
5528        else {
5529            innerSub = subject.subscribe(this);
5530        }
5531        this.add(() => {
5532            refCount--;
5533            innerSub.unsubscribe();
5534            innerSub = undefined;
5535            if (subscription && !isComplete && useRefCount && refCount === 0) {
5536                subscription.unsubscribe();
5537                subscription = undefined;
5538                subject = undefined;
5539            }
5540        });
5541    };
5542}
5543//# sourceMappingURL=shareReplay.js.map
5544
5545/***/ }),
5546
5547/***/ "VRyK":
5548/*!*****************************************************************!*\
5549  !*** ./node_modules/rxjs/_esm2015/internal/observable/merge.js ***!
5550  \*****************************************************************/
5551/*! exports provided: merge */
5552/***/ (function(module, __webpack_exports__, __webpack_require__) {
5553
5554"use strict";
5555__webpack_require__.r(__webpack_exports__);
5556/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
5557/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
5558/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
5559/* harmony import */ var _operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/mergeAll */ "bHdf");
5560/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fromArray */ "yCtX");
5561
5562
5563
5564
5565function merge(...observables) {
vendor: 13,082 bytes, lines 5566-5907
5566    let concurrent = Number.POSITIVE_INFINITY;
5567    let scheduler = null;
5568    let last = observables[observables.length - 1];
5569    if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(last)) {
5570        scheduler = observables.pop();
5571        if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
5572            concurrent = observables.pop();
5573        }
5574    }
5575    else if (typeof last === 'number') {
5576        concurrent = observables.pop();
5577    }
5578    if (scheduler === null && observables.length === 1 && observables[0] instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) {
5579        return observables[0];
5580    }
5581    return Object(_operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__["mergeAll"])(concurrent)(Object(_fromArray__WEBPACK_IMPORTED_MODULE_3__["fromArray"])(observables, scheduler));
5582}
5583//# sourceMappingURL=merge.js.map
5584
5585/***/ }),
5586
5587/***/ "Vpsf":
5588/*!*******************************************************************************!*\
5589  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameAction.js ***!
5590  \*******************************************************************************/
5591/*! exports provided: AnimationFrameAction */
5592/***/ (function(module, __webpack_exports__, __webpack_require__) {
5593
5594"use strict";
5595__webpack_require__.r(__webpack_exports__);
5596/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameAction", function() { return AnimationFrameAction; });
5597/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ "3N8a");
5598
5599class AnimationFrameAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"] {
5600    constructor(scheduler, work) {
5601        super(scheduler, work);
5602        this.scheduler = scheduler;
5603        this.work = work;
5604    }
5605    requestAsyncId(scheduler, id, delay = 0) {
5606        if (delay !== null && delay > 0) {
5607            return super.requestAsyncId(scheduler, id, delay);
5608        }
5609        scheduler.actions.push(this);
5610        return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(() => scheduler.flush(null)));
5611    }
5612    recycleAsyncId(scheduler, id, delay = 0) {
5613        if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
5614            return super.recycleAsyncId(scheduler, id, delay);
5615        }
5616        if (scheduler.actions.length === 0) {
5617            cancelAnimationFrame(id);
5618            scheduler.scheduled = undefined;
5619        }
5620        return undefined;
5621    }
5622}
5623//# sourceMappingURL=AnimationFrameAction.js.map
5624
5625/***/ }),
5626
5627/***/ "WMd4":
5628/*!*************************************************************!*\
5629  !*** ./node_modules/rxjs/_esm2015/internal/Notification.js ***!
5630  \*************************************************************/
5631/*! exports provided: NotificationKind, Notification */
5632/***/ (function(module, __webpack_exports__, __webpack_require__) {
5633
5634"use strict";
5635__webpack_require__.r(__webpack_exports__);
5636/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return NotificationKind; });
5637/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return Notification; });
5638/* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observable/empty */ "EY2u");
5639/* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observable/of */ "LRne");
5640/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./observable/throwError */ "z6cu");
5641
5642
5643
5644var NotificationKind;
5645(function (NotificationKind) {
5646    NotificationKind["NEXT"] = "N";
5647    NotificationKind["ERROR"] = "E";
5648    NotificationKind["COMPLETE"] = "C";
5649})(NotificationKind || (NotificationKind = {}));
5650class Notification {
5651    constructor(kind, value, error) {
5652        this.kind = kind;
5653        this.value = value;
5654        this.error = error;
5655        this.hasValue = kind === 'N';
5656    }
5657    observe(observer) {
5658        switch (this.kind) {
5659            case 'N':
5660                return observer.next && observer.next(this.value);
5661            case 'E':
5662                return observer.error && observer.error(this.error);
5663            case 'C':
5664                return observer.complete && observer.complete();
5665        }
5666    }
5667    do(next, error, complete) {
5668        const kind = this.kind;
5669        switch (kind) {
5670            case 'N':
5671                return next && next(this.value);
5672            case 'E':
5673                return error && error(this.error);
5674            case 'C':
5675                return complete && complete();
5676        }
5677    }
5678    accept(nextOrObserver, error, complete) {
5679        if (nextOrObserver && typeof nextOrObserver.next === 'function') {
5680            return this.observe(nextOrObserver);
5681        }
5682        else {
5683            return this.do(nextOrObserver, error, complete);
5684        }
5685    }
5686    toObservable() {
5687        const kind = this.kind;
5688        switch (kind) {
5689            case 'N':
5690                return Object(_observable_of__WEBPACK_IMPORTED_MODULE_1__["of"])(this.value);
5691            case 'E':
5692                return Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_2__["throwError"])(this.error);
5693            case 'C':
5694                return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_0__["empty"])();
5695        }
5696        throw new Error('unexpected notification kind value');
5697    }
5698    static createNext(value) {
5699        if (typeof value !== 'undefined') {
5700            return new Notification('N', value);
5701        }
5702        return Notification.undefinedValueNotification;
5703    }
5704    static createError(err) {
5705        return new Notification('E', undefined, err);
5706    }
5707    static createComplete() {
5708        return Notification.completeNotification;
5709    }
5710}
5711Notification.completeNotification = new Notification('C');
5712Notification.undefinedValueNotification = new Notification('N', undefined);
5713//# sourceMappingURL=Notification.js.map
5714
5715/***/ }),
5716
5717/***/ "WPMC":
5718/*!********************************************************************!*\
5719  !*** ./node_modules/rxjs/_esm2015/internal/observable/generate.js ***!
5720  \********************************************************************/
5721/*! exports provided: generate */
5722/***/ (function(module, __webpack_exports__, __webpack_require__) {
5723
5724"use strict";
5725__webpack_require__.r(__webpack_exports__);
5726/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
5727/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
5728/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ "SpAZ");
5729/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
5730
5731
5732
5733function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
5734    let resultSelector;
5735    let initialState;
5736    if (arguments.length == 1) {
5737        const options = initialStateOrOptions;
5738        initialState = options.initialState;
5739        condition = options.condition;
5740        iterate = options.iterate;
5741        resultSelector = options.resultSelector || _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
5742        scheduler = options.scheduler;
5743    }
5744    else if (resultSelectorOrObservable === undefined || Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(resultSelectorOrObservable)) {
5745        initialState = initialStateOrOptions;
5746        resultSelector = _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
5747        scheduler = resultSelectorOrObservable;
5748    }
5749    else {
5750        initialState = initialStateOrOptions;
5751        resultSelector = resultSelectorOrObservable;
5752    }
5753    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
5754        let state = initialState;
5755        if (scheduler) {
5756            return scheduler.schedule(dispatch, 0, {
5757                subscriber,
5758                iterate,
5759                condition,
5760                resultSelector,
5761                state
5762            });
5763        }
5764        do {
5765            if (condition) {
5766                let conditionResult;
5767                try {
5768                    conditionResult = condition(state);
5769                }
5770                catch (err) {
5771                    subscriber.error(err);
5772                    return undefined;
5773                }
5774                if (!conditionResult) {
5775                    subscriber.complete();
5776                    break;
5777                }
5778            }
5779            let value;
5780            try {
5781                value = resultSelector(state);
5782            }
5783            catch (err) {
5784                subscriber.error(err);
5785                return undefined;
5786            }
5787            subscriber.next(value);
5788            if (subscriber.closed) {
5789                break;
5790            }
5791            try {
5792                state = iterate(state);
5793            }
5794            catch (err) {
5795                subscriber.error(err);
5796                return undefined;
5797            }
5798        } while (true);
5799        return undefined;
5800    });
5801}
5802function dispatch(state) {
5803    const { subscriber, condition } = state;
5804    if (subscriber.closed) {
5805        return undefined;
5806    }
5807    if (state.needIterate) {
5808        try {
5809            state.state = state.iterate(state.state);
5810        }
5811        catch (err) {
5812            subscriber.error(err);
5813            return undefined;
5814        }
5815    }
5816    else {
5817        state.needIterate = true;
5818    }
5819    if (condition) {
5820        let conditionResult;
5821        try {
5822            conditionResult = condition(state.state);
5823        }
5824        catch (err) {
5825            subscriber.error(err);
5826            return undefined;
5827        }
5828        if (!conditionResult) {
5829            subscriber.complete();
5830            return undefined;
5831        }
5832        if (subscriber.closed) {
5833            return undefined;
5834        }
5835    }
5836    let value;
5837    try {
5838        value = state.resultSelector(state.state);
5839    }
5840    catch (err) {
5841        subscriber.error(err);
5842        return undefined;
5843    }
5844    if (subscriber.closed) {
5845        return undefined;
5846    }
5847    subscriber.next(value);
5848    if (subscriber.closed) {
5849        return undefined;
5850    }
5851    return this.schedule(state);
5852}
5853//# sourceMappingURL=generate.js.map
5854
5855/***/ }),
5856
5857/***/ "WyKG":
5858/*!******************************************************************!*\
5859  !*** ./node_modules/rxjs/_esm2015/internal/util/toSubscriber.js ***!
5860  \******************************************************************/
5861/*! exports provided: toSubscriber */
5862/***/ (function(module, __webpack_exports__, __webpack_require__) {
5863
5864"use strict";
5865__webpack_require__.r(__webpack_exports__);
5866/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toSubscriber", function() { return toSubscriber; });
5867/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
5868/* harmony import */ var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../symbol/rxSubscriber */ "2QA8");
5869/* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observer */ "gRHU");
5870
5871
5872
5873function toSubscriber(nextOrObserver, error, complete) {
5874    if (nextOrObserver) {
5875        if (nextOrObserver instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) {
5876            return nextOrObserver;
5877        }
5878        if (nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]) {
5879            return nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]();
5880        }
5881    }
5882    if (!nextOrObserver && !error && !complete) {
5883        return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](_Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]);
5884    }
5885    return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](nextOrObserver, error, complete);
5886}
5887//# sourceMappingURL=toSubscriber.js.map
5888
5889/***/ }),
5890
5891/***/ "XDbj":
5892/*!***********************************************************************!*\
5893  !*** ./node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js ***!
5894  \***********************************************************************/
5895/*! exports provided: throwIfEmpty */
5896/***/ (function(module, __webpack_exports__, __webpack_require__) {
5897
5898"use strict";
5899__webpack_require__.r(__webpack_exports__);
5900/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return throwIfEmpty; });
5901/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ "sVev");
5902/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
5903
5904
5905function throwIfEmpty(errorFactory = defaultErrorFactory) {
5906    return (source) => {
5907        return source.lift(new ThrowIfEmptyOperator(errorFactory)
5907);
5908    };
5909}
5910class ThrowIfEmptyOperator {
5911    constructor(errorFactory) {
5912        this.errorFactory = errorFactory;
5913    }
5914    call(subscriber, source) {
5915        return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory));
5916    }
5917}
5918class ThrowIfEmptySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"] {
5919    constructor(destination, errorFactory) {
5920        super(destination);
5921        this.errorFactory = errorFactory;
5922        this.hasValue = false;
5923    }
5924    _next(value) {
5925        this.hasValue = true;
5926        this.destination.next(value);
5927    }
5928    _complete() {
5929        if (!this.hasValue) {
5930            let err;
5931            try {
5932                err = this.errorFactory();
5933            }
5934            catch (e) {
5935                err = e;
5936            }
5937            this.destination.error(err);
5938        }
5939        else {
5940            return this.destination.complete();
5941        }
5942    }
5943}
5944function defaultErrorFactory() {
5945    return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"]();
5946}
5947//# sourceMappingURL=throwIfEmpty.js.map
5948
5949/***/ }),
5950
5951/***/ "XNiG":
5952/*!********************************************************!*\
5953  !*** ./node_modules/rxjs/_esm2015/internal/Subject.js ***!
5954  \********************************************************/
5955/*! exports provided: SubjectSubscriber, Subject, AnonymousSubject */
5956/***/ (function(module, __webpack_exports__, __webpack_require__) {
5957
5958"use strict";
5959__webpack_require__.r(__webpack_exports__);
5960/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscriber", function() { return SubjectSubscriber; });
5961/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; });
5962/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnonymousSubject", function() { return AnonymousSubject; });
5963/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Observable */ "HDdC");
5964/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscriber */ "7o/Q");
5965/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Subscription */ "quSY");
5966/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "9ppp");
5967/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SubjectSubscription */ "Ylt2");
5968/* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ "2QA8");
5969
5970
5971
5972
5973
5974
5975class SubjectSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"] {
5976    constructor(destination) {
5977        super(destination);
5978        this.destination = destination;
5979    }
5980}
5981class Subject extends _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] {
5982    constructor() {
5983        super();
5984        this.observers = [];
5985        this.closed = false;
5986        this.isStopped = false;
5987        this.hasError = false;
5988        this.thrownError = null;
5989    }
5990    [_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_5__["rxSubscriber"]]() {
5991        return new SubjectSubscriber(this);
5992    }
5993    lift(operator) {
5994        const subject = new AnonymousSubject(this, this);
5995        subject.operator = operator;
5996        return subject;
5997    }
5998    next(value) {
5999        if (this.closed) {
6000            throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"]();
6001        }
6002        if (!this.isStopped) {
6003            const { observers } = this;
6004            const len = observers.length;
6005            const copy = observers.slice();
6006            for (let i = 0; i < len; i++) {
6007                copy[i].next(value);
6008            }
6009        }
6010    }
6011    error(err) {
6012        if (this.closed) {
6013            throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"]();
6014        }
6015        this.hasError = true;
6016        this.thrownError = err;
6017        this.isStopped = true;
6018        const { observers } = this;
6019        const len = observers.length;
6020        const copy = observers.slice();
6021        for (let i = 0; i < len; i++) {
6022            copy[i].error(err);
6023        }
6024        this.observers.length = 0;
6025    }
6026    complete() {
6027        if (this.closed) {
6028            throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"]();
6029        }
6030        this.isStopped = true;
6031        const { observers } = this;
6032        const len = observers.length;
6033        const copy = observers.slice();
6034        for (let i = 0; i < len; i++) {
6035            copy[i].complete();
6036        }
6037        this.observers.length = 0;
6038    }
6039    unsubscribe() {
6040        this.isStopped = true;
6041        this.closed = true;
6042        this.observers = null;
6043    }
6044    _trySubscribe(subscriber) {
6045        if (this.closed) {
6046            throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"]();
6047        }
6048        else {
6049            return super._trySubscribe(subscriber);
6050        }
6051    }
6052    _subscribe(subscriber) {
6053        if (this.closed) {
6054            throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__["ObjectUnsubscribedError"]();
6055        }
6056        else if (this.hasError) {
6057            subscriber.error(this.thrownError);
6058            return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
6059        }
6060        else if (this.isStopped) {
6061            subscriber.complete();
6062            return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
6063        }
6064        else {
6065            this.observers.push(subscriber);
6066            return new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_4__["SubjectSubscription"](this, subscriber);
6067        }
6068    }
6069    asObservable() {
6070        const observable = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
6071        observable.source = this;
6072        return observable;
6073    }
6074}
6075Subject.create = (destination, source) => {
6076    return new AnonymousSubject(destination, source);
6077};
6078class AnonymousSubject extends Subject {
6079    constructor(destination, source) {
6080        super();
6081        this.destination = destination;
6082        this.source = source;
6083    }
6084    next(value) {
6085        const { destination } = this;
6086        if (destination && destination.next) {
6087            destination.next(value);
6088        }
6089    }
6090    error(err) {
6091        const { destination } = this;
6092        if (destination && destination.error) {
6093            this.destination.error(err);
6094        }
6095    }
6096    complete() {
6097        const { destination } = this;
6098        if (destination && destination.complete) {
6099            this.destination.complete();
6100        }
6101    }
6102    _subscribe(subscriber) {
6103        const { source } = this;
6104        if (source) {
6105            return this.source.subscribe(subscriber);
6106        }
6107        else {
6108            return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
6109        }
6110    }
6111}
6112//# sourceMappingURL=Subject.js.map
6113
6114/***/ }),
6115
6116/***/ "XoHu":
6117/*!**************************************************************!*\
6118  !*** ./node_modules/rxjs/_esm2015/internal/util/isObject.js ***!
6119  \**************************************************************/
6120/*! exports provided: isObject */
6121/***/ (function(module, __webpack_exports__, __webpack_require__) {
6122
6123"use strict";
6124__webpack_require__.r(__webpack_exports__);
6125/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; });
6126function isObject(x) {
6127    return x !== null && typeof x === 'object';
6128}
6129//# sourceMappingURL=isObject.js.map
6130
6131/***/ }),
6132
6133/***/ "XqQ8":
6134/*!*********************************************************************!*\
6135  !*** ./node_modules/rxjs/_esm2015/internal/operators/exhaustMap.js ***!
6136  \*********************************************************************/
6137/*! exports provided: exhaustMap */
6138/***/ (function(module, __webpack_exports__, __webpack_require__) {
6139
6140"use strict";
6141__webpack_require__.r(__webpack_exports__);
6142/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return exhaustMap; });
6143/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map */ "lJxs");
6144/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/from */ "Cfvw");
6145/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
6146
6147
6148
6149function exhaustMap(project, resultSelector) {
6150    if (resultSelector) {
6151        return (source) => source.pipe(exhaustMap((a, i) => Object(_observable_from__WEBPACK_IMPORTED_MODULE_1__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_0__["map"])((b, ii) => resultSelector(a, b, i, ii)))));
6152    }
6153    return (source) => source.lift(new ExhaustMapOperator(project));
6154}
6155class ExhaustMapOperator {
6156    constructor(project) {
6157        this.project = project;
6158    }
6159    call(subscriber, source) {
6160        return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));
6161    }
6162}
6163class ExhaustMapSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleOuterSubscriber"] {
6164    constructor(destination, project) {
6165        super(destination);
6166        this.project = project;
6167        this.hasSubscription = false;
6168        this.hasCompleted = false;
6169        this.index = 0;
6170    }
6171    _next(value) {
6172        if (!this.hasSubscription) {
6173            this.tryNext(value);
6174        }
6175    }
6176    tryNext(value) {
6177        let result;
6178        const index = this.index++;
6179        try {
6180            result = this.project(value, index);
6181        }
6182        catch (err) {
6183            this.destination.error(err);
6184            return;
6185        }
6186        this.hasSubscription = true;
6187        this._innerSub(result);
6188    }
6189    _innerSub(result) {
6190        const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleInnerSubscriber"](this);
6191        const destination = this.destination;
6192        destination.add(innerSubscriber);
6193        const innerSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["innerSubscribe"])(result, innerSubscriber);
6194        if (innerSubscription !== innerSubscriber) {
6195            destination.add(innerSubscription);
6196        }
6197    }
6198    _complete() {
6199        this.hasCompleted = true;
6200        if (!this.hasSubscription) {
6201            this.destination.complete();
6202        }
6203        this.unsubscribe();
6204    }
6205    notifyNext(innerValue) {
6206        this.destination.next(innerValue);
6207    }
6208    notifyError(err) {
6209        this.destination.error(err);
6210    }
6211    notifyComplete() {
6212        this.hasSubscription = false;
6213        if (this.hasCompleted) {
6214            this.destination.complete();
6215        }
6216    }
6217}
6218//# sourceMappingURL=exhaustMap.js.map
6219
6220/***/ }),
6221
6222/***/ "Y/cZ":
6223/*!**********************************************************!*\
6224  !*** ./node_modules/rxjs/_esm2015/internal/Scheduler.js ***!
6225  \**********************************************************/
6226/*! exports provided: Scheduler */
6227/***/ (function(module, __webpack_exports__, __webpack_require__) {
6228
6229"use strict";
6230__webpack_require__.r(__webpack_exports__);
6231/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return Scheduler; });
6232class Scheduler {
6233    constructor(SchedulerAction, now = Scheduler.now) {
6234        this.SchedulerAction = SchedulerAction;
6235        this.now = now;
6236    }
6237    schedule(work, delay = 0, state) {
6238        return new this.SchedulerAction(this, work).schedule(state, delay);
6239    }
6240}
6241Scheduler.now = () => Date.now();
6242//# sourceMappingURL=Scheduler.js.map
6243
6244/***/ }),
6245
6246/***/ "Y6u4":
6247/*!******************************************************************!*\
6248  !*** ./node_modules/rxjs/_esm2015/internal/util/TimeoutError.js ***!
6249  \******************************************************************/
6250/*! exports provided: TimeoutError */
6251/***/ (function(module, __webpack_exports__, __webpack_require__) {
6252
6253"use strict";
6254__webpack_require__.r(__webpack_exports__);
6255/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return TimeoutError; });
6256const TimeoutErrorImpl = (() => {
6257    function TimeoutErrorImpl() {
6258        Error.call(this);
6259        this.message = 'Timeout has occurred';
6260        this.name = 'TimeoutError';
6261        return this;
6262    }
6263    TimeoutErrorImpl.prototype = Object.create(Error.prototype);
6264    return TimeoutErrorImpl;
6265})();
6266const TimeoutError = TimeoutErrorImpl;
6267//# sourceMappingURL=TimeoutError.js.map
6268
6269/***/ }),
6270
6271/***/ "Y6wi":
6272/*!********************************************************************!*\
6273  !*** ./node_modules/rxjs/_esm2015/internal/operators/switchAll.js ***!
6274  \********************************************************************/
6275/*! exports provided: switchAll */
6276/***/ (function(module, __webpack_exports__, __webpack_require__) {
6277
6278"use strict";
6279__webpack_require__.r(__webpack_exports__);
6280/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return switchAll; });
6281/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./switchMap */ "eIep");
6282/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ "SpAZ");
6283
6284
6285function switchAll() {
6286    return Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]);
6287}
6288//# sourceMappingURL=switchAll.js.map
6289
6290/***/ }),
6291
6292/***/ "Y7HM":
6293/*!***************************************************************!*\
6294  !*** ./node_modules/rxjs/_esm2015/internal/util/isNumeric.js ***!
6295  \***************************************************************/
6296/*! exports provided: isNumeric */
6297/***/ (function(module, __webpack_exports__, __webpack_require__) {
6298
6299"use strict";
6300__webpack_require__.r(__webpack_exports__);
6301/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumeric", function() { return isNumeric; });
6302/* harmony import */ var _isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray */ "DH7j");
6303
6304function isNumeric(val) {
6305    return !Object(_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(val) && (val - parseFloat(val) + 1) >= 0;
6306}
6307//# sourceMappingURL=isNumeric.js.map
6308
6309/***/ }),
6310
6311/***/ "Ylt2":
6312/*!********************************************************************!*\
6313  !*** ./node_modules/rxjs/_esm2015/internal/SubjectSubscription.js ***!
6314  \********************************************************************/
6315/*! exports provided: SubjectSubscription */
6316/***/ (function(module, __webpack_exports__, __webpack_require__) {
6317
6318"use strict";
6319__webpack_require__.r(__webpack_exports__);
6320/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function() { return SubjectSubscription; });
6321/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscription */ "quSY");
6322
6323class SubjectSubscription extends _Subscription__WEBPACK_IMPORTED_MODULE_0__["Subscription"] {
6324    constructor(subject, subscriber) {
6325        super();
6326        this.subject = subject;
6327        this.subscriber = subscriber;
6328        this.closed = false;
6329    }
6330    unsubscribe() {
6331        if (this.closed) {
6332            return;
6333        }
6334        this.closed = true;
6335        const subject = this.subject;
6336        const observers = subject.observers;
6337        this.subject = null;
6338        if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
6339            return;
6340        }
6341        const subscriberIndex = observers.indexOf(this.subscriber);
6342        if (subscriberIndex !== -1) {
6343            observers.splice(subscriberIndex, 1);
6344        }
6345    }
6346}
6347//# sourceMappingURL=SubjectSubscription.js.map
6348
6349/***/ }),
6350
6351/***/ "YuR2":
6352/*!**********************************************************************!*\
6353  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/QueueAction.js ***!
6354  \**********************************************************************/
6355/*! exports provided: QueueAction */
6356/***/ (function(module, __webpack_exports__, __webpack_require__) {
6357
6358"use strict";
6359__webpack_require__.r(__webpack_exports__);
6360/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueAction", function() { return QueueAction; });
6361/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ "3N8a");
6362
6363class QueueAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"] {
6364    constructor(scheduler, work) {
6365        super(scheduler, work);
6366        this.scheduler = scheduler;
6367        this.work = work;
6368    }
6369    schedule(state, delay = 0) {
6370        if (delay > 0) {
6371            return super.schedule(state, delay);
6372        }
6373        this.delay = delay;
6374        this.state = state;
6375        this.scheduler.flush(this);
6376        return this;
6377    }
6378    execute(state, delay) {
6379        return (delay > 0 || this.closed) ?
6380            super.execute(state, delay) :
6381            this._execute(state, delay);
6382    }
6383    requestAsyncId(scheduler, id, delay = 0) {
6384        if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
6385            return super.requestAsyncId(scheduler, id, delay);
6386        }
6387        return scheduler.flush(this);
6388    }
6389}
6390//# sourceMappingURL=QueueAction.js.map
6391
6392/***/ }),
6393
6394/***/ "ZUHj":
6395/*!***********************************************************************!*\
6396  !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js ***!
6397  \***********************************************************************/
6398/*! exports provided: subscribeToResult */
6399/***/ (function(module, __webpack_exports__, __webpack_require__) {
6400
6401"use strict";
6402__webpack_require__.r(__webpack_exports__);
6403/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToResult", function() { return subscribeToResult; });
6404/* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../InnerSubscriber */ "51Dv");
6405/* harmony import */ var _subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscribeTo */ "SeVD");
6406/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observable */ "HDdC");
6407
6408
6409
6410function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__["InnerSubscriber"](outerSubscriber, outerValue, outerIndex)) {
6411    if (innerSubscriber.closed) {
6412        return undefined;
6413    }
6414    if (result instanceof _Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]) {
6415        return result.subscribe(innerSubscriber);
6416    }
6417    return Object(_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(result)(innerSubscriber);
6418}
6419//# sourceMappingURL=subscribeToResult.js.map
6420
6421/***/ }),
6422
6423/***/ "Zy1z":
6424/*!*******************************************************************!*\
6425  !*** ./node_modules/rxjs/_esm2015/internal/operators/pairwise.js ***!
6426  \*******************************************************************/
6427/*! exports provided: pairwise */
6428/***/ (function(module, __webpack_exports__, __webpack_require__) {
6429
6430"use strict";
6431__webpack_require__.r(__webpack_exports__);
6432/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return pairwise; });
6433/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
6434
6435function pairwise() {
6436    return (source) => source.lift(new PairwiseOperator());
6437}
6438class PairwiseOperator {
6439    call(subscriber, source) {
6440        return source.subscribe(new PairwiseSubscriber(subscriber));
6441    }
6442}
6443class PairwiseSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
6444    constructor(destination) {
6445        super(destination);
6446        this.hasPrev = false;
6447    }
6448    _next(value) {
6449        let pair;
6450        if (this.hasPrev) {
6451            pair = [this.prev, value];
6452        }
6453        else {
6454            this.hasPrev = true;
6455        }
6456        this.prev = value;
6457        if (pair) {
6458            this.destination.next(pair);
6459        }
6460    }
6461}
6462//# sourceMappingURL=pairwise.js.map
6463
6464/***/ }),
6465
6466/***/ "Zyez":
6467/*!************************************************************************!*\
6468  !*** ./node_modules/rxjs/_esm2015/internal/operators/sequenceEqual.js ***!
6469  \************************************************************************/
6470/*! exports provided: sequenceEqual, SequenceEqualOperator, SequenceEqualSubscriber */
6471/***/ (function(module, __webpack_exports__, __webpack_require__) {
6472
6473"use strict";
6474__webpack_require__.r(__webpack_exports__);
6475/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return sequenceEqual; });
6476/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualOperator", function() { return SequenceEqualOperator; });
6477/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualSubscriber", function() { return SequenceEqualSubscriber; });
6478/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
6479
6480function sequenceEqual(compareTo, comparator) {
6481    return (source) => source.lift(new SequenceEqualOperator(compareTo, comparator));
6482}
6483class SequenceEqualOperator {
6484    constructor(compareTo, comparator) {
6485        this.compareTo = compareTo;
6486        this.comparator = comparator;
6487    }
6488    call(subscriber, source) {
6489        return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparator));
6490    }
6491}
6492class SequenceEqualSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
6493    constructor(destination, compareTo, comparator) {
6494        super(destination);
6495        this.compareTo = compareTo;
6496        this.comparator = comparator;
6497        this._a = [];
6498        this._b = [];
6499        this._oneComplete = false;
6500        this.destination.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, this)));
6501    }
6502    _next(value) {
6503        if (this._oneComplete && this._b.length === 0) {
6504            this.emit(false);
6505        }
6506        else {
6507            this._a.push(value);
6508            this.checkValues();
6509        }
6510    }
6511    _complete() {
6512        if (this._oneComplete) {
6513            this.emit(this._a.length === 0 && this._b.length === 0);
6514        }
6515        else {
6516            this._oneComplete = true;
6517        }
6518        this.unsubscribe();
6519    }
6520    checkValues() {
6521        const { _a, _b, comparator } = this;
6522        while (_a.length > 0 && _b.length > 0) {
6523            let a = _a.shift();
6524            let b = _b.shift();
6525            let areEqual = false;
6526            try {
6527                areEqual = comparator ? comparator(a, b) : a === b;
6528            }
6529            catch (e) {
6530                this.destination.error(e);
6531            }
6532            if (!areEqual) {
6533                this.emit(false);
6534            }
6535        }
6536    }
6537    emit(value) {
6538        const { destination } = this;
6539        destination.next(value);
6540        destination.complete();
6541    }
6542    nextB(value) {
6543        if (this._oneComplete && this._a.length === 0) {
6544            this.emit(false);
6545        }
6546        else {
6547            this._b.push(value);
6548            this.checkValues();
6549        }
6550    }
6551    completeB() {
6552        if (this._oneComplete) {
6553            this.emit(this._a.length === 0 && this._b.length === 0);
6554        }
6555        else {
6556            this._oneComplete = true;
6557        }
6558    }
6559}
6560class SequenceEqualCompareToSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
6561    constructor(destination, parent) {
6562        super(destination);
6563        this.parent = parent;
6564    }
6565    _next(value) {
6566        this.parent.nextB(value);
6567    }
6568    _error(err) {
6569        this.parent.error(err);
6570        this.unsubscribe();
6571    }
6572    _complete() {
6573        this.parent.completeB();
6574        this.unsubscribe();
6575    }
6576}
6577//# sourceMappingURL=sequenceEqual.js.map
6578
6579/***/ }),
6580
6581/***/ "a7t3":
6582/*!************************************************************************!*\
6583  !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToPromise.js ***!
6584  \************************************************************************/
6585/*! exports provided: subscribeToPromise */
6586/***/ (function(module, __webpack_exports__, __webpack_require__) {
6587
6588"use strict";
6589__webpack_require__.r(__webpack_exports__);
6590/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToPromise", function() { return subscribeToPromise; });
6591/* harmony import */ var _hostReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hostReportError */ "NJ4a");
6592
6593const subscribeToPromise = (promise) => (subscriber) => {
6594    promise.then((value) => {
6595        if (!subscriber.closed) {
6596            subscriber.next(value);
6597            subscriber.complete();
6598        }
6599    }, (err) => subscriber.error(err))
6600        .then(null, _hostReportError__WEBPACK_IMPORTED_MODULE_0__["hostReportError"]);
6601    return subscriber;
6602};
6603//# sourceMappingURL=subscribeToPromise.js.map
6604
6605/***/ }),
6606
6607/***/ "aGrj":
6608/*!**********************************************************************!*\
6609  !*** ./node_modules/rxjs/_esm2015/internal/operators/switchMapTo.js ***!
6610  \**********************************************************************/
6611/*! exports provided: switchMapTo */
6612/***/ (function(module, __webpack_exports__, __webpack_require__) {
6613
6614"use strict";
6615__webpack_require__.r(__webpack_exports__);
6616/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return switchMapTo; });
6617/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./switchMap */ "eIep");
6618
6619function switchMapTo(innerObservable, resultSelector) {
6620    return resultSelector ? Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(() => innerObservable, resultSelector) : Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(() => innerObservable);
6621}
6622//# sourceMappingURL=switchMapTo.js.map
6623
6624/***/ }),
6625
6626/***/ "bHdf":
6627/*!*******************************************************************!*\
6628  !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeAll.js ***!
6629  \*******************************************************************/
6630/*! exports provided: mergeAll */
6631/***/ (function(module, __webpack_exports__, __webpack_require__) {
6632
6633"use strict";
6634__webpack_require__.r(__webpack_exports__);
6635/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return mergeAll; });
6636/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ "5+tZ");
6637/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ "SpAZ");
6638
6639
6640function mergeAll(concurrent = Number.POSITIVE_INFINITY) {
6641    return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"], concurrent);
6642}
6643//# sourceMappingURL=mergeAll.js.map
6644
6645/***/ }),
6646
6647/***/ "bOdf":
6648/*!********************************************************************!*\
6649  !*** ./node_modules/rxjs/_esm2015/internal/operators/concatMap.js ***!
6650  \********************************************************************/
6651/*! exports provided: concatMap */
6652/***/ (function(module, __webpack_exports__, __webpack_require__) {
6653
6654"use strict";
6655__webpack_require__.r(__webpack_exports__);
6656/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return concatMap; });
6657/* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ "5+tZ");
6658
6659function concatMap(project, resultSelector) {
6660    return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(project, resultSelector, 1);
6661}
6662//# sourceMappingURL=concatMap.js.map
6663
6664/***/ }),
6665
6666/***/ "c2HN":
6667/*!***************************************************************!*\
6668  !*** ./node_modules/rxjs/_esm2015/internal/util/isPromise.js ***!
6669  \***************************************************************/
6670/*! exports provided: isPromise */
6671/***/ (function(module, __webpack_exports__, __webpack_require__) {
6672
6673"use strict";
6674__webpack_require__.r(__webpack_exports__);
6675/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromise", function() { return isPromise; });
6676function isPromise(value) {
6677    return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function';
6678}
6679//# sourceMappingURL=isPromise.js.map
6680
6681/***/ }),
6682
6683/***/ "c6ID":
6684/*!*****************************************************************!*\
6685  !*** ./node_modules/rxjs/_esm2015/internal/operators/sample.js ***!
6686  \*****************************************************************/
6687/*! exports provided: sample */
6688/***/ (function(module, __webpack_exports__, __webpack_require__) {
6689
6690"use strict";
6691__webpack_require__.r(__webpack_exports__);
6692/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return sample; });
6693/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
6694
6695function sample(notifier) {
6696    return (source) => source.lift(new SampleOperator(notifier));
6697}
6698class SampleOperator {
6699    constructor(notifier) {
6700        this.notifier = notifier;
6701    }
6702    call(subscriber, source) {
6703        const sampleSubscriber = new SampleSubscriber(subscriber);
6704        const subscription = source.subscribe(sampleSubscriber);
6705        subscription.add(Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(this.notifier, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](sampleSubscriber)));
6706        return subscription;
6707    }
6708}
6709class SampleSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
6710    constructor() {
6711        super(...arguments);
6712        this.hasValue = false;
6713    }
6714    _next(value) {
6715        this.value = value;
6716        this.hasValue = true;
6717    }
6718    notifyNext() {
6719        this.emitValue();
6720    }
6721    notifyComplete() {
6722        this.emitValue();
6723    }
6724    emitValue() {
6725        if (this.hasValue) {
6726            this.hasValue = false;
6727            this.destination.next(this.value);
6728        }
6729    }
6730}
6731//# sourceMappingURL=sample.js.map
6732
6733/***/ }),
6734
6735/***/ "c7jc":
6736/*!***************************************************************!*\
6737  !*** ./node_modules/rxjs/_esm2015/internal/util/Immediate.js ***!
6738  \***************************************************************/
6739/*! exports provided: Immediate, TestTools */
6740/***/ (function(module, __webpack_exports__, __webpack_require__) {
6741
6742"use strict";
6743__webpack_require__.r(__webpack_exports__);
6744/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Immediate", function() { return Immediate; });
6745/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestTools", function() { return TestTools; });
6746let nextHandle = 1;
6747const RESOLVED = (() => Promise.resolve())();
6748const activeHandles = {};
6749function findAndClearHandle(handle) {
6750    if (handle in activeHandles) {
6751        delete activeHandles[handle];
6752        return true;
6753    }
6754    return false;
6755}
6756const Immediate = {
6757    setImmediate(cb) {
6758        const handle = nextHandle++;
6759        activeHandles[handle] = true;
6760        RESOLVED.then(() => findAndClearHandle(handle) && cb());
6761        return handle;
6762    },
6763    clearImmediate(handle) {
6764        findAndClearHandle(handle);
6765    },
6766};
6767const TestTools = {
6768    pending() {
6769        return Object.keys(activeHandles).length;
6770    }
6771};
6772//# sourceMappingURL=Immediate.js.map
6773
6774/***/ }),
6775
6776/***/ "cBqT":
6777/*!***************************************************************!*\
6778  !*** ./node_modules/rxjs/_esm2015/internal/operators/find.js ***!
6779  \***************************************************************/
6780/*! exports provided: find, FindValueOperator, FindValueSubscriber */
6781/***/ (function(module, __webpack_exports__, __webpack_require__) {
6782
6783"use strict";
6784__webpack_require__.r(__webpack_exports__);
6785/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; });
6786/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueOperator", function() { return FindValueOperator; });
6787/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueSubscriber", function() { return FindValueSubscriber; });
6788/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
6789
6790function find(predicate, thisArg) {
6791    if (typeof predicate !== 'function') {
6792        throw new TypeError('predicate is not a function');
6793    }
6794    return (source) => source.lift(new FindValueOperator(predicate, source, false, thisArg));
6795}
6796class FindValueOperator {
6797    constructor(predicate, source, yieldIndex, thisArg) {
6798        this.predicate = predicate;
6799        this.source = source;
6800        this.yieldIndex = yieldIndex;
6801        this.thisArg = thisArg;
6802    }
6803    call(observer, source) {
6804        return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));
6805    }
6806}
6807class FindValueSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
6808    constructor(destination, predicate, source, yieldIndex, thisArg) {
6809        super(destination);
6810        this.predicate = predicate;
6811        this.source = source;
6812        this.yieldIndex = yieldIndex;
6813        this.thisArg = thisArg;
6814        this.index = 0;
6815    }
6816    notifyComplete(value) {
6817        const destination = this.destination;
6818        destination.next(value);
6819        destination.complete();
6820        this.unsubscribe();
6821    }
6822    _next(value) {
6823        const { predicate, thisArg } = this;
6824        const index = this.index++;
6825        try {
6826            const result = predicate.call(thisArg || this, value, index, this.source);
6827            if (result) {
6828                this.notifyComplete(this.yieldIndex ? index : value);
6829            }
6830        }
6831        catch (err) {
6832            this.destination.error(err);
6833        }
6834    }
6835    _complete() {
6836        this.notifyComplete(this.yieldIndex ? -1 : undefined);
6837    }
6838}
6839//# sourceMappingURL=find.js.map
6840
6841/***/ }),
6842
6843/***/ "coGc":
6844/*!********************************************************************!*\
6845  !*** ./node_modules/rxjs/_esm2015/internal/operators/delayWhen.js ***!
6846  \********************************************************************/
6847/*! exports provided: delayWhen */
6848/***/ (function(module, __webpack_exports__, __webpack_require__) {
6849
6850"use strict";
6851__webpack_require__.r(__webpack_exports__);
6852/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return delayWhen; });
6853/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
6854/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Observable */ "HDdC");
6855/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "l7GE");
6856/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "ZUHj");
6857
6858
6859
6860
6861function delayWhen(delayDurationSelector, subscriptionDelay) {
6862    if (subscriptionDelay) {
6863        return (source) => new SubscriptionDelayObservable(source, subscriptionDelay)
6864            .lift(new DelayWhenOperator(delayDurationSelector));
6865    }
6866    return (source) => source.lift(new DelayWhenOperator(delayDurationSelector));
6867}
6868class DelayWhenOperator {
6869    constructor(delayDurationSelector) {
6870        this.delayDurationSelector = delayDurationSelector;
6871    }
6872    call(subscriber, source) {
6873        return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));
6874    }
6875}
6876class DelayWhenSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] {
6877    constructor(destination, delayDurationSelector) {
6878        super(destination);
6879        this.delayDurationSelector = delayDurationSelector;
6880        this.completed = false;
6881        this.delayNotifierSubscriptions = [];
6882        this.index = 0;
6883    }
6884    notifyNext(outerValue, _innerValue, _outerIndex, _innerIndex, innerSub) {
6885        this.destination.next(outerValue);
6886        this.removeSubscription(innerSub);
6887        this.tryComplete();
6888    }
6889    notifyError(error, innerSub) {
6890        this._error(error);
6891    }
6892    notifyComplete(innerSub) {
6893        const value = this.removeSubscription(innerSub);
6894        if (value) {
6895            this.destination.next(value);
6896        }
6897        this.tryComplete();
6898    }
6899    _next(value) {
6900        const index = this.index++;
6901        try {
6902            const delayNotifier = this.delayDurationSelector(value, index);
6903            if (delayNotifier) {
6904                this.tryDelay(delayNotifier, value);
6905            }
6906        }
6907        catch (err) {
6908            this.destination.error(err);
6909        }
6910    }
6911    _complete() {
6912        this.completed = true;
6913        this.tryComplete();
6914        this.unsubscribe();
6915    }
6916    removeSubscription(subscription) {
6917        subscription.unsubscribe();
6918        const subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);
6919        if (subscriptionIdx !== -1) {
6920            this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);
6921        }
6922        return subscription.outerValue;
6923    }
6924    tryDelay(delayNotifier, value) {
6925        const notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, delayNotifier, value);
6926        if (notifierSubscription && !notifierSubscription.closed) {
6927            const destination = this.destination;
6928            destination.add(notifierSubscription);
6929            this.delayNotifierSubscriptions.push(notifierSubscription);
6930        }
6931    }
6932    tryComplete() {
6933        if (this.completed && this.delayNotifierSubscriptions.length === 0) {
6934            this.destination.complete();
6935        }
6936    }
6937}
6938class SubscriptionDelayObservable extends _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"] {
6939    constructor(source, subscriptionDelay) {
6940        super();
6941        this.source = source;
6942        this.subscriptionDelay = subscriptionDelay;
6943    }
6944    _subscribe(subscriber) {
6945        this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));
6946    }
6947}
6948class SubscriptionDelaySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
6949    constructor(parent, source) {
6950        super();
6951        this.parent = parent;
6952        this.source = source;
6953        this.sourceSubscribed = false;
6954    }
6955    _next(unused) {
6956        this.subscribeToSource();
6957    }
6958    _error(err) {
6959        this.unsubscribe();
6960        this.parent.error(err);
6961    }
6962    _complete() {
6963        this.unsubscribe();
6964        this.subscribeToSource();
6965    }
6966    subscribeToSource() {
6967        if (!this.sourceSubscribed) {
6968            this.sourceSubscribed = true;
6969            this.unsubscribe();
6970            this.source.subscribe(this.parent);
6971        }
6972    }
6973}
6974//# sourceMappingURL=delayWhen.js.map
6975
6976/***/ }),
6977
6978/***/ "cp0P":
6979/*!********************************************************************!*\
6980  !*** ./node_modules/rxjs/_esm2015/internal/observable/forkJoin.js ***!
6981  \********************************************************************/
6982/*! exports provided: forkJoin */
6983/***/ (function(module, __webpack_exports__, __webpack_require__) {
6984
6985"use strict";
6986__webpack_require__.r(__webpack_exports__);
6987/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return forkJoin; });
6988/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
6989/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
6990/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/map */ "lJxs");
6991/* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isObject */ "XoHu");
6992/* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./from */ "Cfvw");
6993
6994
6995
6996
6997
6998function forkJoin(...sources) {
6999    if (sources.length === 1) {
7000        const first = sources[0];
7001        if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(first)) {
7002            return forkJoinInternal(first, null);
7003        }
7004        if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_3__["isObject"])(first) && Object.getPrototypeOf(first) === Object.prototype) {
7005            const keys = Object.keys(first);
7006            return forkJoinInternal(keys.map(key => first[key]), keys);
7007        }
7008    }
7009    if (typeof sources[sources.length - 1] === 'function') {
7010        const resultSelector = sources.pop();
7011        sources = (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(sources[0])) ? sources[0] : sources;
7012        return forkJoinInternal(sources, null).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])((args) => resultSelector(...args)));
7013    }
7014    return forkJoinInternal(sources, null);
7015}
7016function forkJoinInternal(sources, keys) {
7017    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
7018        const len = sources.length;
7019        if (len === 0) {
7020            subscriber.complete();
7021            return;
7022        }
7023        const values = new Array(len);
7024        let completed = 0;
7025        let emitted = 0;
7026        for (let i = 0; i < len; i++) {
7027            const source = Object(_from__WEBPACK_IMPORTED_MODULE_4__["from"])(sources[i]);
7028            let hasValue = false;
7029            subscriber.add(source.subscribe({
7030                next: value => {
7031                    if (!hasValue) {
7032                        hasValue = true;
7033                        emitted++;
7034                    }
7035                    values[i] = value;
7036                },
7037                error: err => subscriber.error(err),
7038                complete: () => {
7039                    completed++;
7040                    if (completed === len || !hasValue) {
7041                        if (emitted === len) {
7042                            subscriber.next(keys ?
7043                                keys.reduce((result, key, i) => (result[key] = values[i], result), {}) :
7044                                values);
7045                        }
7046                        subscriber.complete();
7047                    }
7048                }
7049            }));
7050        }
7051    });
7052}
7053//# sourceMappingURL=forkJoin.js.map
7054
7055/***/ }),
7056
7057/***/ "cx9U":
7058/*!*****************************************************************!*\
7059  !*** ./node_modules/rxjs/_esm2015/internal/operators/single.js ***!
7060  \*****************************************************************/
7061/*! exports provided: single */
7062/***/ (function(module, __webpack_exports__, __webpack_require__) {
7063
7064"use strict";
7065__webpack_require__.r(__webpack_exports__);
7066/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "single", function() { return single; });
7067/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
7068/* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/EmptyError */ "sVev");
7069
7070
7071function single(predicate) {
7072    return (source) => source.lift(new SingleOperator(predicate, source));
7073}
7074class SingleOperator {
7075    constructor(predicate, source) {
7076        this.predicate = predicate;
7077        this.source = source;
7078    }
7079    call(subscriber, source) {
7080        return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));
7081    }
7082}
7083class SingleSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
7084    constructor(destination, predicate, source) {
7085        super(destination);
7086        this.predicate = predicate;
7087        this.source = source;
7088        this.seenValue = false;
7089        this.index = 0;
7090    }
7091    applySingleValue(value) {
7092        if (this.seenValue) {
7093            this.destination.error('Sequence contains more than one element');
7094        }
7095        else {
7096            this.seenValue = true;
7097            this.singleValue = value;
7098        }
7099    }
7100    _next(value) {
7101        const index = this.index++;
7102        if (this.predicate) {
7103            this.tryNext(value, index);
7104        }
7105        else {
7106            this.applySingleValue(value);
7107        }
7108    }
7109    tryNext(value, index) {
7110        try {
7111            if (this.predicate(value, index, this.source)) {
7112                this.applySingleValue(value);
7113            }
7114        }
7115        catch (err) {
7116            this.destination.error(err);
7117        }
7118    }
7119    _complete() {
7120        const destination = this.destination;
7121        if (this.index > 0) {
7122            destination.next(this.seenValue ? this.singleValue : undefined);
7123            destination.complete();
7124        }
7125        else {
7126            destination.error(new _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__["EmptyError"]);
7127        }
7128    }
7129}
7130//# sourceMappingURL=single.js.map
7131
7132/***/ }),
7133
7134/***/ "dkDA":
7135/*!**********************************************************************!*\
7136  !*** ./node_modules/rxjs/_esm2015/internal/operators/materialize.js ***!
7137  \**********************************************************************/
7138/*! exports provided: materialize */
7139/***/ (function(module, __webpack_exports__, __webpack_require__) {
7140
7141"use strict";
7142__webpack_require__.r(__webpack_exports__);
7143/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return materialize; });
7144/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
7145/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Notification */ "WMd4");
7146
7147
7148function materialize() {
7149    return function materializeOperatorFunction(source) {
7150        return source.lift(new MaterializeOperator());
7151    };
7152}
7153class MaterializeOperator {
7154    call(subscriber, source) {
7155        return source.subscribe(new MaterializeSubscriber(subscriber));
7156    }
7157}
7158class MaterializeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
7159    constructor(destination) {
7160        super(destination);
7161    }
7162    _next(value) {
7163        this.destination.next(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createNext(value));
7164    }
7165    _error(err) {
7166        const destination = this.destination;
7167        destination.next(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createError(err));
7168        destination.complete();
7169    }
7170    _complete() {
7171        const destination = this.destination;
7172        destination.next(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createComplete());
7173        destination.complete();
7174    }
7175}
7176//# sourceMappingURL=materialize.js.map
7177
7178/***/ }),
7179
7180/***/ "eIep":
7181/*!********************************************************************!*\
7182  !*** ./node_modules/rxjs/_esm2015/internal/operators/switchMap.js ***!
7183  \********************************************************************/
7184/*! exports provided: switchMap */
7185/***/ (function(module, __webpack_exports__, __webpack_require__) {
7186
7187"use strict";
7188__webpack_require__.r(__webpack_exports__);
7189/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return switchMap; });
7190/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map */ "lJxs");
7191/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/from */ "Cfvw");
7192/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
7193
7194
7195
7196function switchMap(project, resultSelector) {
7197    if (typeof resultSelector === 'function') {
7198        return (source) => source.pipe(switchMap((a, i) => Object(_observable_from__WEBPACK_IMPORTED_MODULE_1__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_0__["map"])((b, ii) => resultSelector(a, b, i, ii)))));
7199    }
7200    return (source) => source.lift(new SwitchMapOperator(project));
7201}
7202class SwitchMapOperator {
7203    constructor(project) {
7204        this.project = project;
7205    }
7206    call(subscriber, source) {
7207        return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));
7208    }
7209}
7210class SwitchMapSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleOuterSubscriber"] {
7211    constructor(destination, project) {
7212        super(destination);
7213        this.project = project;
7214        this.index = 0;
7215    }
7216    _next(value) {
7217        let result;
7218        const index = this.index++;
7219        try {
7220            result = this.project(value, index);
7221        }
7222        catch (error) {
7223            this.destination.error(error);
7224            return;
7225        }
7226        this._innerSub(result);
7227    }
7228    _innerSub(result) {
7229        const innerSubscription = this.innerSubscription;
7230        if (innerSubscription) {
7231            innerSubscription.unsubscribe();
7232        }
7233        const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleInnerSubscriber"](this);
7234        const destination = this.destination;
7235        destination.add(innerSubscriber);
7236        this.innerSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["innerSubscribe"])(result, innerSubscriber);
7237        if (this.innerSubscription !== innerSubscriber) {
7238            destination.add(this.innerSubscription);
7239        }
7240    }
7241    _complete() {
7242        const { innerSubscription } = this;
7243        if (!innerSubscription || innerSubscription.closed) {
7244            super._complete();
7245        }
7246        this.unsubscribe();
7247    }
7248    _unsubscribe() {
7249        this.innerSubscription = undefined;
7250    }
7251    notifyComplete() {
7252        this.innerSubscription = undefined;
7253        if (this.isStopped) {
7254            super._complete();
7255        }
7256    }
7257    notifyNext(innerValue) {
7258        this.destination.next(innerValue);
7259    }
7260}
7261//# sourceMappingURL=switchMap.js.map
7262
7263/***/ }),
7264
7265/***/ "eNwd":
7266/*!*************************************************************************!*\
7267  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/animationFrame.js ***!
7268  \*************************************************************************/
7269/*! exports provided: animationFrameScheduler, animationFrame */
7270/***/ (function(module, __webpack_exports__, __webpack_require__) {
7271
7272"use strict";
7273__webpack_require__.r(__webpack_exports__);
7274/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return animationFrameScheduler; });
7275/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrame", function() { return animationFrame; });
7276/* harmony import */ var _AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AnimationFrameAction */ "Vpsf");
7277/* harmony import */ var _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AnimationFrameScheduler */ "znLP");
7278
7279
7280const animationFrameScheduler = new _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__["AnimationFrameScheduler"](_AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__["AnimationFrameAction"]);
7281const animationFrame = animationFrameScheduler;
7282//# sourceMappingURL=animationFrame.js.map
7283
7284/***/ }),
7285
7286/***/ "f29J":
7287/*!*****************************************************************!*\
7288  !*** ./node_modules/rxjs/_esm2015/internal/operators/concat.js ***!
7289  \*****************************************************************/
7290/*! exports provided: concat */
7291/***/ (function(module, __webpack_exports__, __webpack_require__) {
7292
7293"use strict";
7294__webpack_require__.r(__webpack_exports__);
7295/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; });
7296/* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/concat */ "GyhO");
7297
7298function concat(...observables) {
7299    return (source) => source.lift.call(Object(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"])(source, ...observables));
7300}
7301//# sourceMappingURL=concat.js.map
7302
7303/***/ }),
7304
7305/***/ "fFD9":
7306/*!************************************************************************!*\
7307  !*** ./node_modules/rxjs/_esm2015/internal/operators/combineLatest.js ***!
7308  \************************************************************************/
7309/*! exports provided: combineLatest */
7310/***/ (function(module, __webpack_exports__, __webpack_require__) {
7311
7312"use strict";
7313__webpack_require__.r(__webpack_exports__);
7314/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; });
7315/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
7316/* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/combineLatest */ "itXk");
7317/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/from */ "Cfvw");
7318
7319
7320
7321const none = {};
7322function combineLatest(...observables) {
7323    let project = null;
7324    if (typeof observables[observables.length - 1] === 'function') {
7325        project = observables.pop();
7326    }
7327    if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
7328        observables = observables[0].slice();
7329    }
7330    return (source) => source.lift.call(Object(_observable_from__WEBPACK_IMPORTED_MODULE_2__["from"])([source, ...observables]), new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__["Comb
7330ineLatestOperator"](project));
7331}
7332//# sourceMappingURL=combineLatest.js.map
7333
7334/***/ }),
7335
7336/***/ "fXoL":
7337/*!******************************************************************!*\
7338  !*** ./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js ***!
7339  \******************************************************************/
7340/*! exports provided: ANALYZE_FOR_ENTRY_COMPONENTS, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory, ComponentFactoryResolver, ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ElementRef, EmbeddedViewRef, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory, NgModuleFactoryLoader, NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, SystemJsNgModuleLoader, SystemJsNgModuleLoaderConfig, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation, ViewRef, WrappedValue, asNativeElements, assertPlatform, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getPlatform, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ɵ0, ɵALLOW_MULTIPLE_PLATFORMS, ɵAPP_ID_RANDOM_PROVIDER, ɵCREATE_ATTRIBUTE_DECORATOR__POST_R3__, ɵChangeDetectorStatus, ɵCodegenComponentFactoryResolver, ɵCompiler_compileModuleAndAllComponentsAsync__POST_R3__, ɵCompiler_compileModuleAndAllComponentsSync__POST_R3__, ɵCompiler_compileModuleAsync__POST_R3__, ɵCompiler_compileModuleSync__POST_R3__, ɵComponentFactory, ɵConsole, ɵDEFAULT_LOCALE_ID, ɵEMPTY_ARRAY, ɵEMPTY_MAP, ɵINJECTOR_IMPL__POST_R3__, ɵINJECTOR_SCOPE, ɵLifecycleHooksFeature, ɵLocaleDataIndex, ɵNG_COMP_DEF, ɵNG_DIR_DEF, ɵNG_ELEMENT_ID, ɵNG_INJ_DEF, ɵNG_MOD_DEF, ɵNG_PIPE_DEF, ɵNG_PROV_DEF, ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, ɵNO_CHANGE, ɵNgModuleFactory, ɵNoopNgZone, ɵReflectionCapabilities, ɵRender3ComponentFactory, ɵRender3ComponentRef, ɵRender3NgModuleRef, ɵSWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__, ɵSWITCH_COMPILE_COMPONENT__POST_R3__, ɵSWITCH_COMPILE_DIRECTIVE__POST_R3__, ɵSWITCH_COMPILE_INJECTABLE__POST_R3__, ɵSWITCH_COMPILE_NGMODULE__POST_R3__, ɵSWITCH_COMPILE_PIPE__POST_R3__, ɵSWITCH_ELEMENT_REF_FACTORY__POST_R3__, ɵSWITCH_IVY_ENABLED__POST_R3__, ɵSWITCH_RENDERER2_FACTORY__POST_R3__, ɵSWITCH_TEMPLATE_REF_FACTORY__POST_R3__, ɵSWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__, ɵ_sanitizeHtml, ɵ_sanitizeUrl, ɵallowSanitizationBypassAndThrow, ɵand, ɵangular_packages_core_core_a, ɵangular_packages_core_core_b, ɵangular_packages_core_core_ba, ɵangular_packages_core_core_bb, ɵangular_packages_core_core_bc, ɵangular_packages_core_core_bd, ɵangular_packages_core_core_be, ɵangular_packages_core_core_bf, ɵangular_packages_core_core_bg, ɵangular_packages_core_core_bh, ɵangular_packages_core_core_bi, ɵangular_packages_core_core_bj, ɵangular_packages_core_core_bl, ɵangular_packages_core_core_bm, ɵangular_packages_core_core_bn, ɵangular_packages_core_core_bo, ɵangular_packages_core_core_bp, ɵangular_packages_core_core_bq, ɵangular_packages_core_core_br, ɵangular_packages_core_core_bs, ɵangular_packages_core_core_bv, ɵangular_packages_core_core_bw, ɵangular_packages_core_core_bx, ɵangular_packages_core_core_bz, ɵangular_packages_core_core_c, ɵangular_packages_core_core_cb, ɵangular_packages_core_core_cc, ɵangular_packages_core_core_d, ɵangular_packages_core_core_e, ɵangular_packages_core_core_f, ɵangular_packages_core_core_g, ɵangular_packages_core_core_h, ɵangular_packages_core_core_i, ɵangular_packages_core_core_j, ɵangular_packages_core_core_k, ɵangular_packages_core_core_l, ɵangular_packages_core_core_m, ɵangular_packages_core_core_n, ɵangular_packages_core_core_o, ɵangular_packages_core_core_p, ɵangular_packages_core_core_q, ɵangular_packages_core_core_r, ɵangular_packages_core_core_s, ɵangular_packages_core_core_t, ɵangular_packages_core_core_u, ɵangular_packages_core_core_v, ɵangular_packages_core_core_w, ɵangular_packages_core_core_x, ɵangular_packages_core_core_y, ɵangular_packages_core_core_z, ɵbypassSanitizationTrustHtml, ɵbypassSanitizationTrustResourceUrl, ɵbypassSanitizationTrustScript, ɵbypassSanitizationTrustStyle, ɵbypassSanitizationTrustUrl, ɵccf, ɵclearOverrides, ɵclearResolutionOfComponentResourcesQueue, ɵcmf, ɵcompileComponent, ɵcompileDirective, ɵcompileNgModule, ɵcompileNgModuleDefs, ɵcompileNgModuleFactory__PO
7340ST_R3__, ɵcompilePipe, ɵcreateInjector, ɵcrt, ɵdefaultIterableDiffers, ɵdefaultKeyValueDiffers, ɵdetectChanges, ɵdevModeEqual, ɵdid, ɵeld, ɵfindLocaleData, ɵflushModuleScopingQueueAsMuchAsPossible, ɵgetComponentViewDefinitionFactory, ɵgetDebugNodeR2, ɵgetDebugNode__POST_R3__, ɵgetDirectives, ɵgetHostElement, ɵgetInjectableDef, ɵgetLContext, ɵgetLocaleCurrencyCode, ɵgetLocalePluralCase, ɵgetModuleFactory__POST_R3__, ɵgetSanitizationBypassType, ɵglobal, ɵinitServicesIfNeeded, ɵinlineInterpolate, ɵinterpolate, ɵisBoundToModule__POST_R3__, ɵisDefaultChangeDetectionStrategy, ɵisListLikeIterable, ɵisObservable, ɵisPromise, ɵisSubscribable, ɵivyEnabled, ɵmakeDecorator, ɵmarkDirty, ɵmod, ɵmpd, ɵncd, ɵnoSideEffects, ɵnov, ɵoverrideComponentView, ɵoverrideProvider, ɵpad, ɵpatchComponentDefWithScope, ɵpid, ɵpod, ɵppd, ɵprd, ɵpublishDefaultGlobalUtils, ɵpublishGlobalUtil, ɵqud, ɵregisterLocaleData, ɵregisterModuleFactory, ɵregisterNgModuleType, ɵrenderComponent, ɵresetCompiledComponents, ɵresetJitOptions, ɵresolveComponentResources, ɵsetClassMetadata, ɵsetCurrentInjector, ɵsetDocument, ɵsetLocaleId, ɵstore, ɵstringify, ɵted, ɵtransitiveScopesFor, ɵunregisterLocaleData, ɵunv, ɵunwrapSafeValue, ɵvid, ɵwhenRendered, ɵɵCopyDefinitionFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinjectPipeChangeDetectorRef, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustC
7340onstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery */
7341/***/ (function(module, __webpack_exports__, __webpack_require__) {
7342
7343"use strict";
7344__webpack_require__.r(__webpack_exports__);
7345/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ANALYZE_FOR_ENTRY_COMPONENTS", function() { return ANALYZE_FOR_ENTRY_COMPONENTS; });
7346/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_BOOTSTRAP_LISTENER", function() { return APP_BOOTSTRAP_LISTENER; });
7347/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_ID", function() { return APP_ID; });
7348/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_INITIALIZER", function() { return APP_INITIALIZER; });
7349/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplicationInitStatus", function() { return ApplicationInitStatus; });
7350/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplicationModule", function() { return ApplicationModule; });
7351/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplicationRef", function() { return ApplicationRef; });
7352/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribute", function() { return Attribute; });
7353/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMPILER_OPTIONS", function() { return COMPILER_OPTIONS; });
7354/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CUSTOM_ELEMENTS_SCHEMA", function() { return CUSTOM_ELEMENTS_SCHEMA; });
7355/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangeDetectionStrategy", function() { return ChangeDetectionStrategy; });
7356/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangeDetectorRef", function() { return ChangeDetectorRef; });
7357/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Compiler", function() { return Compiler; });
7358/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompilerFactory", function() { return CompilerFactory; });
7359/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return Component; });
7360/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentFactory", function() { return ComponentFactory; });
7361/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentFactoryResolver", function() { return ComponentFactoryResolver; });
7362/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentRef", function() { return ComponentRef; });
7363/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentChild", function() { return ContentChild; });
7364/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentChildren", function() { return ContentChildren; });
7365/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_CURRENCY_CODE", function() { return DEFAULT_CURRENCY_CODE; });
7366/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DebugElement", function() { return DebugElement; });
7367/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DebugEventListener", function() { return DebugEventListener; });
7368/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DebugNode", function() { return DebugNode; });
7369/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultIterableDiffer", function() { return DefaultIterableDiffer; });
7370/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Directive", function() { return Directive; });
7371/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementRef", function() { return ElementRef; });
7372/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmbeddedViewRef", function() { return EmbeddedViewRef; });
7373/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; });
7374/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventEmitter", function() { return EventEmitter; });
7375/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Host", function() { return Host; });
7376/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HostBinding", function() { return HostBinding; });
7377/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HostListener", function() { return HostListener; });
7378/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INJECTOR", function() { return INJECTOR$1; });
7379/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Inject", function() { return Inject; });
7380/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InjectFlags", function() { return InjectFlags; });
7381/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Injectable", function() { return Injectable; });
7382/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InjectionToken", function() { return InjectionToken; });
7383/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Injector", function() { return Injector; });
7384/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
7385/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IterableDiffers", function() { return IterableDiffers; });
7386/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyValueDiffers", function() { return KeyValueDiffers; });
7387/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOCALE_ID", function() { return LOCALE_ID$1; });
7388/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MissingTranslationStrategy", function() { return MissingTranslationStrategy; });
7389/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleWithComponentFactories", function() { return ModuleWithComponentFactories; });
7390/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NO_ERRORS_SC
7390HEMA", function() { return NO_ERRORS_SCHEMA; });
7391/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModule", function() { return NgModule; });
7392/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleFactory", function() { return NgModuleFactory; });
7393/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleFactoryLoader", function() { return NgModuleFactoryLoader; });
7394/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModuleRef", function() { return NgModuleRef; });
7395/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgProbeToken", function() { return NgProbeToken; });
7396/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgZone", function() { return NgZone; });
7397/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Optional", function() { return Optional; });
7398/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; });
7399/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PACKAGE_ROOT_URL", function() { return PACKAGE_ROOT_URL; });
7400/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLATFORM_ID", function() { return PLATFORM_ID; });
7401/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLATFORM_INITIALIZER", function() { return PLATFORM_INITIALIZER; });
7402/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Pipe", function() { return Pipe; });
7403/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlatformRef", function() { return PlatformRef; });
7404/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Query", function() { return Query; });
7405/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueryList", function() { return QueryList; });
7406/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReflectiveInjector", function() { return ReflectiveInjector; });
7407/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReflectiveKey", function() { return ReflectiveKey; });
7408/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Renderer2", function() { return Renderer2; });
7409/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RendererFactory2", function() { return RendererFactory2; });
7410/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RendererStyleFlags2", function() { return RendererStyleFlags2; });
7411/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedReflectiveFactory", function() { return ResolvedReflectiveFactory; });
7412/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sanitizer", function() { return Sanitizer; });
7413/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SecurityContext", function() { return SecurityContext; });
7414/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Self", function() { return Self; });
7415/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleChange", function() { return SimpleChange; });
7416/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkipSelf", function() { return SkipSelf; });
7417/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemJsNgModuleLoader", function() { return SystemJsNgModuleLoader; });
7418/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemJsNgModuleLoaderConfig", function() { return SystemJsNgModuleLoaderConfig; });
7419/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRANSLATIONS", function() { return TRANSLATIONS; });
7420/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRANSLATIONS_FORMAT", function() { return TRANSLATIONS_FORMAT; });
7421/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateRef", function() { return TemplateRef; });
7422/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Testability", function() { return Testability; });
7423/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestabilityRegistry", function() { return TestabilityRegistry; });
7424/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Type", function() { return Type; });
7425/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
7426/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Version", function() { return Version; });
7427/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewChild", function() { return ViewChild; });
7428/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewChildren", function() { return ViewChildren; });
7429/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewContainerRef", function() { return ViewContainerRef; });
7430/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewEncapsulation", function() { return ViewEncapsulation; });
7431/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewRef", function() { return ViewRef$1; });
7432/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappedValue", function() { return WrappedValue; });
7433/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asNativeElements", function() { return asNativeElements; });
7434/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertPlatform", function() { return assertPlatform; });
7435/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPlatform", function() { return createPlatform; });
7436/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPlatformFactory", function() { return createPlatformFactory; });
7437/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defineInjectable", function() { return defineInjectable; });
7438/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "destroyPlatform", function() { return destroyPlatform; });
7439/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableProdMode", function() { return enableProdMode; });
7440/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forwardRef", function() { return forwardRef; });
7441/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDebugNode", function() { return getDebugNode$1; });
7442/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getModuleFactory", function() { return getModuleFactory; });
7443/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPlatform", function() { return getPlatform; });
7444/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return inject; });
7445/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDevMode", function() { return isDevMode; });
7446/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platformCore", function() { return platformCore; });
7447/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolveForwardRef", function() { return resolveForwardRef; });
7448/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestabilityGetter", function() { return setTestabilityGetter; });
7449/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ0", function() { return ɵ0$3; });
7450/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵALLOW_MULTIPLE_PLATFORMS", function() { return ALLOW_MULTIPLE_PLATFORMS; });
7451/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵAPP_ID_RANDOM_PROVIDER", function() { return APP_ID_RANDOM_PROVIDER; });
7452/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCREATE_ATTRIBUTE_DECORATOR__POST_R3__", function() { return CREATE_ATTRIBUTE_DECORATOR__POST_R3__; });
7453/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵChangeDetectorStatus", function() { return ChangeDetectorStatus; });
7454/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCodegenComponentFactoryResolver", function() { return CodegenComponentFactoryResolver; });
7455/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCompiler_compileModuleAndAllComponentsAsync__POST_R3__", function() { return Compiler_compileModuleAndAllComponentsAsync__POST_R3__; });
7456/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCompiler_compileModuleAndAllComponentsSync__POST_R3__", function() { return Compiler_compileModuleAndAllComponentsSync__POST_R3__; });
7457/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCompiler_compileModuleAsync__POST_R3__", function() { return Compiler_compileModuleAsync__POST_R3__; });
7458/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵCompiler_compileModuleSync__POST_R3__", function() { return Compiler_compileModuleSync__POST_R3__; });
7459/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵComponentFactory", function() { return ComponentFactory; });
7460/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵConsole", function() { return Console; });
7461/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDEFAULT_LOCALE_ID", function() { return DEFAULT_LOCALE_ID; });
7462/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵEMPTY_ARRAY", function() { return EMPTY_ARRAY$4; });
7463/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵEMPTY_MAP", function() { return EMPTY_MAP; });
7464/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵINJECTOR_IMPL__POST_R3__", function() { return INJECTOR_IMPL__POST_R3__; });
7465/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵINJECTOR_SCOPE", function() { return INJECTOR_SCOPE; });
7466/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵLifecycleHooksFeature", function() { return LifecycleHooksFeature; });
7467/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵLocaleDataIndex", function() { return LocaleDataIndex; });
7468/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_COMP_DEF", function() { return NG_COMP_DEF; });
7469/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_DIR_DEF", function() { return NG_DIR_DEF; });
7470/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_ELEMENT_ID", function() { return NG_ELEMENT_ID; });
7471/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_INJ_DEF", function() { return NG_INJ_DEF; });
7472/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_MOD_DEF", function() { return NG_MOD_DEF; });
7473/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_PIPE_DEF", function() { return NG_PIPE_DEF; });
7474/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNG_PROV_DEF", function() { return NG_PROV_DEF; });
7475/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR", function() { return NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR; });
7476/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNO_CHANGE", function() { return NO_CHANGE; });
7477/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNgModuleFactory", function() { return NgModuleFactory$1; });
7478/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNoopNgZone", function() { return NoopNgZone; });
7479/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵReflectionCapabilities", function() { return ReflectionCapabilities; });
7480/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵRender3ComponentFactory", function() { return ComponentFactory$1; });
7481/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵRender3ComponentRef", function() { return ComponentRef$1; });
7482/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵRender3NgModuleRef", function() { return NgModuleRef$1; });
7483/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__", function() { return SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__; });
7484/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_COMPONENT__POST_R3__", function() { return SWITCH_COMPILE_COMPONENT__POST_R3__; });
7485/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_DIRECTIVE__POST_R3__", function() { return SWITCH_COMPILE_DIRECTIVE__POST_R3__; });
7486/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_INJECTABLE__POST_R3__", function() { return SWITCH_COMPILE_INJECTABLE__POST_R3__; });
7487/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_NGMODULE__POST_R3__", function() { return SWITCH_COMPILE_NGMODULE__POST_R3__; });
7488/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_COMPILE_PIPE__PO
7488ST_R3__", function() { return SWITCH_COMPILE_PIPE__POST_R3__; });
7489/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_ELEMENT_REF_FACTORY__POST_R3__", function() { return SWITCH_ELEMENT_REF_FACTORY__POST_R3__; });
7490/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_IVY_ENABLED__POST_R3__", function() { return SWITCH_IVY_ENABLED__POST_R3__; });
7491/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_RENDERER2_FACTORY__POST_R3__", function() { return SWITCH_RENDERER2_FACTORY__POST_R3__; });
7492/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_TEMPLATE_REF_FACTORY__POST_R3__", function() { return SWITCH_TEMPLATE_REF_FACTORY__POST_R3__; });
7493/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__", function() { return SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__; });
7494/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ_sanitizeHtml", function() { return _sanitizeHtml; });
7495/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ_sanitizeUrl", function() { return _sanitizeUrl; });
7496/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵallowSanitizationBypassAndThrow", function() { return allowSanitizationBypassAndThrow; });
7497/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵand", function() { return anchorDef; });
7498/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_a", function() { return isForwardRef; });
7499/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_b", function() { return injectInjectorOnly; });
7500/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_ba", function() { return zoneSchedulerFactory; });
7501/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bb", function() { return USD_CURRENCY_CODE; });
7502/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bc", function() { return _def; });
7503/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bd", function() { return DebugContext; });
7504/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_be", function() { return NgOnChangesFeatureImpl; });
7505/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bf", function() { return SCHEDULER; });
7506/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bg", function() { return injectAttributeImpl; });
7507/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bh", function() { return getLView; });
7508/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bi", function() { return getBindingRoot; });
7509/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bj", function() { return nextContextImpl; });
7510/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bl", function() { return pureFunction1Internal; });
7511/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bm", function() { return pureFunction2Internal; });
7512/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bn", function() { return pureFunction3Internal; });
7513/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bo", function() { return pureFunction4Internal; });
7514/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bp", function() { return pureFunctionVInternal; });
7515/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bq", function() { return getUrlSanitizer; });
7516/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_br", function() { return makePropDecorator; });
7517/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bs", function() { return makeParamDecorator; });
7518/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bv", function() { return getClosureSafeProperty; });
7519/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bw", function() { return NullInjector; });
7520/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bx", function() { return getInjectImplementation; });
7521/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_bz", function() { return getNativeByTNode; });
7522/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_c", function() { return attachInjectFlag; });
7523/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_cb", function() { return getRootContext; });
7524/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_cc", function() { return i18nPostprocess; });
7525/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_d", function() { return ReflectiveInjector_; });
7526/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_e", function() { return ReflectiveDependency; });
7527/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_f", function() { return resolveReflectiveProviders; });
7528/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_g", function() { return _appIdRandomProviderFactory; });
7529/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_h", function() { return injectRen
7529derer2; });
7530/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_i", function() { return injectElementRef; });
7531/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_j", function() { return createElementRef; });
7532/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_k", function() { return getModuleFactory__PRE_R3__; });
7533/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_l", function() { return injectTemplateRef; });
7534/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_m", function() { return createTemplateRef; });
7535/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_n", function() { return injectViewContainerRef; });
7536/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_o", function() { return DebugNode__PRE_R3__; });
7537/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_p", function() { return DebugElement__PRE_R3__; });
7538/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_q", function() { return getDebugNodeR2__PRE_R3__; });
7539/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_r", function() { return injectChangeDetectorRef; });
7540/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_s", function() { return DefaultIterableDifferFactory; });
7541/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_t", function() { return DefaultKeyValueDifferFactory; });
7542/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_u", function() { return defaultIterableDiffersFactory; });
7543/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_v", function() { return defaultKeyValueDiffersFactory; });
7544/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_w", function() { return _iterableDiffersFactory; });
7545/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_x", function() { return _keyValueDiffersFactory; });
7546/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_y", function() { return _localeFactory; });
7547/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_core_core_z", function() { return APPLICATION_MODULE_PROVIDERS; });
7548/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustHtml", function() { return bypassSanitizationTrustHtml; });
7549/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustResourceUrl", function() { return bypassSanitizationTrustResourceUrl; });
7550/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustScript", function() { return bypassSanitizationTrustScript; });
7551/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustStyle", function() { return bypassSanitizationTrustStyle; });
7552/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbypassSanitizationTrustUrl", function() { return bypassSanitizationTrustUrl; });
7553/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵccf", function() { return createComponentFactory; });
7554/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵclearOverrides", function() { return clearOverrides; });
7555/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵclearResolutionOfComponentResourcesQueue", function() { return clearResolutionOfComponentResourcesQueue; });
7556/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcmf", function() { return createNgModuleFactory; });
7557/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileComponent", function() { return compileComponent; });
7558/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileDirective", function() { return compileDirective; });
7559/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileNgModule", function() { return compileNgModule; });
7560/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileNgModuleDefs", function() { return compileNgModuleDefs; });
7561/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompileNgModuleFactory__PO
7561ST_R3__", function() { return compileNgModuleFactory__POST_R3__; });
7562/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcompilePipe", function() { return compilePipe; });
7563/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcreateInjector", function() { return createInjector; });
7564/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵcrt", function() { return createRendererType2; });
7565/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdefaultIterableDiffers", function() { return defaultIterableDiffers; });
7566/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdefaultKeyValueDiffers", function() { return defaultKeyValueDiffers; });
7567/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdetectChanges", function() { return detectChanges; });
7568/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdevModeEqual", function() { return devModeEqual; });
7569/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵdid", function() { return directiveDef; });
7570/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵeld", function() { return elementDef; });
7571/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵfindLocaleData", function() { return findLocaleData; });
7572/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵflushModuleScopingQueueAsMuchAsPossible", function() { return flushModuleScopingQueueAsMuchAsPossible; });
7573/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetComponentViewDefinitionFactory", function() { return getComponentViewDefinitionFactory; });
7574/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetDebugNodeR2", function() { return getDebugNodeR2; });
7575/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetDebugNode__POST_R3__", function() { return getDebugNode__POST_R3__; });
7576/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetDirectives", function() { return getDirectives; });
7577/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetHostElement", function() { return getHostElement; });
7578/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetInjectableDef", function() { return getInjectableDef; });
7579/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetLContext", function() { return getLContext; });
7580/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetLocaleCurrencyCode", function() { return getLocaleCurrencyCode; });
7581/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetLocalePluralCase", function() { return getLocalePluralCase; });
7582/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetModuleFactory__POST_R3__", function() { return getModuleFactory__POST_R3__; });
7583/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetSanitizationBypassType", function() { return getSanitizationBypassType; });
7584/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵglobal", function() { return _global; });
7585/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinitServicesIfNeeded", function() { return initServicesIfNeeded; });
7586/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinlineInterpolate", function() { return inlineInterpolate; });
7587/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinterpolate", function() { return interpolate; });
7588/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisBoundToModule__POST_R3__", function() { return isBoundToModule__POST_R3__; });
7589/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisDefaultChangeDetectionStrategy", function() { return isDefaultChangeDetectionStrategy; });
7590/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisListLikeIterable", function() { return isListLikeIterable; });
7591/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisObservable", function() { return isObservable; });
7592/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisPromise", function() { return isPromise; });
7593/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵisSubscribable", function() { return isSubscribable; });
7594/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵivyEnabled", function() { return ivyEnabled; });
7595/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmakeDecorator", function() { return makeDecorator; });
7596/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmarkDirty", function() { return markDirty; });
7597/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmod", function() { return moduleDef; });
7598/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵmpd", function() { return moduleProvideDef; });
7599/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵncd", function() { return ngContentDef; });
7600/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵnoSideEffects", function() { return noSideEffects; });
7601/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵnov", function() { return nodeValue; });
7602/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵoverrideComponentView", function() { return overrideComponentView; });
7603/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵoverrideProvider", function() { return overrideProvider; });
7604/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpad", function() { return pureArrayDef; });
7605/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpatchComponentDefWithScope", function() { return patchComponentDefWithScope; });
7606/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpid", function() { return pipeDef; });
7607/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpod", function() { return pureObjectDef; });
7608/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵppd", function() { return purePipeDef; });
7609/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵprd", function() { return providerDef; });
7610/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpublishDefaultGlobalUtils", function() { return publishDefaultGlobalUtils; });
7611/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵpublishGlobalUtil", function() { return publishGlobalUtil; });
7612/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵqud", function() { return queryDef; });
7613/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵregisterLocaleData", function() { return registerLocaleData; });
7614/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵregisterModuleFactory", function() { return registerModuleFactory; });
7615/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵregisterNgModuleType", function() { return registerNgModuleType; });
7616/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵrenderComponent", function() { return renderComponent$1; });
7617/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵresetCompiledComponents", function() { return resetCompiledComponents; });
7618/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵresetJitOptions", function() { return resetJitOptions; });
7619/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵresolveComponentResources", function() { return resolve
7619ComponentResources; });
7620/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetClassMetadata", function() { return setClassMetadata; });
7621/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetCurrentInjector", function() { return setCurrentInjector; });
7622/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetDocument", function() { return setDocument; });
7623/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetLocaleId", function() { return setLocaleId; });
7624/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵstore", function() { return store; });
7625/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵstringify", function() { return stringify; });
7626/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵted", function() { return textDef; });
7627/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵtransitiveScopesFor", function() { return transitiveScopesFor; });
7628/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵunregisterLocaleData", function() { return unregisterAllLocaleData; });
7629/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵunv", function() { return unwrapValue; });
7630/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵunwrapSafeValue", function() { return unwrapSafeValue; });
7631/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵvid", function() { return viewDef; });
7632/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵwhenRendered", function() { return whenRendered; });
7633/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵCopyDefinitionFeature", function() { return ɵɵCopyDefinitionFeature; });
7634/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵInheritDefinitionFeature", function() { return ɵɵInheritDefinitionFeature; });
7635/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵNgOnChangesFeature", function() { return ɵɵNgOnChangesFeature; });
7636/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵProvidersFeature", function() { return ɵɵProvidersFeature; });
7637/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵadvance", function() { return ɵɵadvance; });
7638/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattribute", function() { return ɵɵattribute; });
7639/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate1", function() { return ɵɵattributeInterpolate1; });
7640/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate2", function() { return ɵɵattributeInterpolate2; });
7641/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate3", function() { return ɵɵattributeInterpolate3; });
7642/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate4", function() { return ɵɵattributeInterpolate4; });
7643/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate5", function() { return ɵɵattributeInterpolate5; });
7644/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate6", function() { return ɵɵattributeInterpolate6; });
7645/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate7", function() { return ɵɵattributeInterpolate7; });
7646/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolate8", function() { return ɵɵattributeInterpolate8; });
7647/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵattributeInterpolateV", function() { return ɵɵattributeInterpolateV; });
7648/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMap", function() { return ɵɵclassMap; });
7649/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate1", function() { return ɵɵclassMapInterpolate1; });
7650/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate2", function() { return ɵɵclassMapInterpolate2; });
7651/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate3", function() { return ɵɵclassMapInterpolate3; });
7652/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate4", function() { return ɵɵclassMapInterpolate4; });
7653/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate5", function() { return ɵɵclassMapInterpolate5; });
7654/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate6", function() { return ɵɵclassMapInterpolate6; });
7655/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate7", function() { return ɵɵclassMapInterpolate7; });
7656/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolate8", function() { return ɵɵclassMapInterpolate8; });
7657/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassMapInterpolateV", function() { return ɵɵclassMapInterpolateV; });
7658/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵclassProp", function() { return ɵɵclassProp; });
7659/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵcontentQuery", function() { return ɵɵcontentQuery; });
7660/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineComponent", function() { return ɵɵdefineComponent; });
7661/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineDirective", function() { return ɵɵdefineDirective; });
7662/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineInjectable", function() { return ɵɵdefineInjectable; });
7663/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineInjector", function() { return ɵɵdefineInjector; });
7664/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefineNgModule", function() { return ɵɵdefineNgModule; });
7665/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdefinePipe", function() { return ɵɵdefinePipe; });
7666/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdirectiveInject", function() { return ɵɵdirectiveInject; });
7667/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵdisableBindings", function() { return ɵɵdisableBindings; });
7668/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelement", function() { return ɵɵelement; });
7669/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementContainer", function() { return ɵɵelementContainer; });
7670/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementContainerEnd", function() { return ɵɵelementContainerEnd; });
7671/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementContainerStart", function() { return ɵɵelementContainerStart; });
7672/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementEnd", function() { return ɵɵelementEnd; });
7673/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵelementStart", function() { return ɵɵelementStart; });
7674/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵenableBindings", function() { return ɵɵenableBindings; });
7675/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵgetCurrentView", function() { return ɵɵgetCurrentView; });
7676/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵgetInheritedFactory", function() { return ɵɵgetInheritedFactory; });
7677/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵhostProperty", function() { return ɵɵhostProperty; });
7678/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18n", function() { return ɵɵi18n; });
7679/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nApply", function() { return ɵɵi18nApply; });
7680/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nAttributes", function() { return ɵɵi18nAttributes; });
7681/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nEnd", function() { return ɵɵi18nEnd; });
7682/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nExp", function() { return ɵɵi18nExp; });
7683/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nPostprocess", function() { return ɵɵi18nPostprocess; });
7684/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵi18nStart", function() { return ɵɵi18nStart; });
7685/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinject", function() { return ɵɵinject; });
7686/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinjectAttribute", function() { return ɵɵinjectAttribute; });
7687/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinjectPipeChangeDetectorRef", function() { return ɵɵinjectPipeChangeDetectorRef; });
7688/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinvalidFactory", function() { return ɵɵinvalidFactory; });
7689/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵinvalidFactoryDep", function() { return ɵɵinvalidFactoryDep; });
7690/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵlistener", function() { return ɵɵlistener; });
7691/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵloadQuery", function() { return ɵɵloadQuery; });
7692/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵnamespaceHTML", function() { return ɵɵnamespaceHTML; });
7693/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵnamespaceMathML", function() { return ɵɵnamespaceMathML; });
7694/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵnamespaceSVG", function() { return ɵɵnamespaceSVG; });
7695/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵnextContext", function() { return ɵɵnextContext; });
7696/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵngDeclareComponent", function() { return ɵɵngDeclareComponent; });
7697/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵngDeclareDirective", function() { return ɵɵngDeclareDirective; });
7698/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵngDeclarePipe", function() { return ɵɵngDeclarePipe; });
7699/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipe", function() { return ɵɵpipe; });
7700/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBind1", function() { return ɵɵpipeBind1; });
7701/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBind2", function() { return ɵɵpipeBind2; });
7702/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBind3", function() { return ɵɵpipeBind3; });
7703/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBind4", function() { return ɵɵpipeBind4; });
7704/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpipeBindV", function() { return ɵɵpipeBindV; });
7705/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵprojection", function() { return ɵɵprojection; });
7706/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵprojectionDef", function() { return ɵɵprojectionDef; });
7707/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵproperty", function() { return ɵɵproperty; });
7708/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate", function() { return ɵɵpropertyInterpolate; });
7709/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate1", function() { return ɵɵpropertyInterpolate1; });
7710/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate2", function() { return ɵɵpropertyInterpolate2; });
7711/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate3", function() { return ɵɵpropertyInterpolate3; });
7712/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate4", function() { return ɵɵpropertyInterpolate4; });
7713/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate5", function() { return ɵɵpropertyInterpolate5; });
7714/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate6", function() { return ɵɵpropertyInterpolate6; });
7715/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate7", function() { return ɵɵpropertyInterpolate7; });
7716/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolate8", function() { return ɵɵpropertyInterpolate8; });
7717/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpropertyInterpolateV", function() { return ɵɵpropertyInterpolateV; });
7718/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction0", function() { return ɵɵpureFunction0; });
7719/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction1", function() { return ɵɵpureFunction1; });
7720/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction2", function() { return ɵɵpureFunction2; });
7721/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction3", function() { return ɵɵpureFunction3; });
7722/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction4", function() { return ɵɵpureFunction4; });
7723/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction5", function() { return ɵɵpureFunction5; });
7724/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction6", function() { return ɵɵpureFunction6; });
7725/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction7", function() { return ɵɵpureFunction7; });
7726/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunction8", function() { return ɵɵpureFunction8; });
7727/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵpureFunctionV", function() { return ɵɵpureFunctionV; });
7728/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵqueryRefresh", function() { return ɵɵqueryRefresh; });
7729/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵreference", function() { return ɵɵreference; });
7730/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵresolveBody", function() { return ɵɵresolveBody; });
7731/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵresolveDocument", function() { return ɵɵresolveDocument; });
7732/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵresolveWindow", function() { return ɵɵresolveWindow; });
7733/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵrestoreView", function() { return ɵɵrestoreView; });
7734/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeHtml", function() { return ɵɵsanitizeHtml; });
7735/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeResourceUrl", function() { return ɵɵsanitizeResourceUrl; });
7736/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeScri
7736pt", function() { return ɵɵsanitizeScript; });
7737/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeStyle", function() { return ɵɵsanitizeStyle; });
7738/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeUrl", function() { return ɵɵsanitizeUrl; });
7739/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsanitizeUrlOrResourceUrl", function() { return ɵɵsanitizeUrlOrResourceUrl; });
7740/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsetComponentScope", function() { return ɵɵsetComponentScope; });
7741/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsetNgModuleScope", function() { return ɵɵsetNgModuleScope; });
7742/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMap", function() { return ɵɵstyleMap; });
7743/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate1", function() { return ɵɵstyleMapInterpolate1; });
7744/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate2", function() { return ɵɵstyleMapInterpolate2; });
7745/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate3", function() { return ɵɵstyleMapInterpolate3; });
7746/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate4", function() { return ɵɵstyleMapInterpolate4; });
7747/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate5", function() { return ɵɵstyleMapInterpolate5; });
7748/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate6", function() { return ɵɵstyleMapInterpolate6; });
7749/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate7", function() { return ɵɵstyleMapInterpolate7; });
7750/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolate8", function() { return ɵɵstyleMapInterpolate8; });
7751/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleMapInterpolateV", function() { return ɵɵstyleMapInterpolateV; });
7752/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstyleProp", function() { return ɵɵstyleProp; });
7753/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate1", function() { return ɵɵstylePropInterpolate1; });
7754/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate2", function() { return ɵɵstylePropInterpolate2; });
7755/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate3", function() { return ɵɵstylePropInterpolate3; });
7756/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate4", function() { return ɵɵstylePropInterpolate4; });
7757/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate5", function() { return ɵɵstylePropInterpolate5; });
7758/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate6", function() { return ɵɵstylePropInterpolate6; });
7759/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate7", function() { return ɵɵstylePropInterpolate7; });
7760/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolate8", function() { return ɵɵstylePropInterpolate8; });
7761/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵstylePropInterpolateV", function() { return ɵɵstylePropInterpolateV; });
7762/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsyntheticHostListener", function() { return ɵɵsyntheticHostListener; });
7763/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵsyntheticHostProperty", function() { return ɵɵsyntheticHostProperty; });
7764/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtemplate", function() { return ɵɵtemplate; });
7765/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtemplateRefExtractor", function() { return ɵɵtemplateRefExtractor; });
7766/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtext", function() { return ɵɵtext; });
7767/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate", function() { return ɵɵtextInterpolate; });
7768/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate1", function() { return ɵɵtextInterpolate1; });
7769/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate2", function() { return ɵɵtextInterpolate2; });
7770/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate3", function() { return ɵɵtextInterpolate3; });
7771/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate4", function() { return ɵɵtextInterpolate4; });
7772/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate5", function() { return ɵɵtextInterpolate5; });
7773/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate6", function() { return ɵɵtextInterpolate6; });
7774/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate7", function() { return ɵɵtextInterpolate7; });
7775/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolate8", function() { return ɵɵtextInterpolate8; });
7776/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtextInterpolateV", function() { return ɵɵtextInterpolateV; });
7777/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtrustC
vendor: 4,817 bytes, lines 7777-7923
7777onstantHtml", function() { return ɵɵtrustConstantHtml; });
7778/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵtrustConstantResourceUrl", function() { return ɵɵtrustConstantResourceUrl; });
7779/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵɵviewQuery", function() { return ɵɵviewQuery; });
7780/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "qCKp");
7781/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ "kU1M");
7782/**
7783 * @license Angular v11.2.11
7784 * (c) 2010-2021 Google LLC. https://angular.io/
7785 * License: MIT
7786 */
7787
7788
7789
7790
7791/**
7792 * @license
7793 * Copyright Google LLC All Rights Reserved.
7794 *
7795 * Use of this source code is governed by an MIT-style license that can be
7796 * found in the LICENSE file at https://angular.io/license
7797 */
7798function getClosureSafeProperty(objWithPropertyToExtract) {
7799    for (let key in objWithPropertyToExtract) {
7800        if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
7801            return key;
7802        }
7803    }
7804    throw Error('Could not find renamed property on target object.');
7805}
7806/**
7807 * Sets properties on a target object from a source object, but only if
7808 * the property doesn't already exist on the target object.
7809 * @param target The target to set properties on
7810 * @param source The source of the property keys and values to set
7811 */
7812function fillProperties(target, source) {
7813    for (const key in source) {
7814        if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {
7815            target[key] = source[key];
7816        }
7817    }
7818}
7819
7820/**
7821 * @license
7822 * Copyright Google LLC All Rights Reserved.
7823 *
7824 * Use of this source code is governed by an MIT-style license that can be
7825 * found in the LICENSE file at https://angular.io/license
7826 */
7827function stringify(token) {
7828    if (typeof token === 'string') {
7829        return token;
7830    }
7831    if (Array.isArray(token)) {
7832        return '[' + token.map(stringify).join(', ') + ']';
7833    }
7834    if (token == null) {
7835        return '' + token;
7836    }
7837    if (token.overriddenName) {
7838        return `${token.overriddenName}`;
7839    }
7840    if (token.name) {
7841        return `${token.name}`;
7842    }
7843    const res = token.toString();
7844    if (res == null) {
7845        return '' + res;
7846    }
7847    const newLineIndex = res.indexOf('\n');
7848    return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
7849}
7850/**
7851 * Concatenates two strings with separator, allocating new strings only when necessary.
7852 *
7853 * @param before before string.
7854 * @param separator separator string.
7855 * @param after after string.
7856 * @returns concatenated string.
7857 */
7858function concatStringsWithSpace(before, after) {
7859    return (before == null || before === '') ?
7860        (after === null ? '' : after) :
7861        ((after == null || after === '') ? before : before + ' ' + after);
7862}
7863
7864/**
7865 * @license
7866 * Copyright Google LLC All Rights Reserved.
7867 *
7868 * Use of this source code is governed by an MIT-style license that can be
7869 * found in the LICENSE file at https://angular.io/license
7870 */
7871const __forward_ref__ = getClosureSafeProperty({ __forward_ref__: getClosureSafeProperty });
7872/**
7873 * Allows to refer to references which are not yet defined.
7874 *
7875 * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of
7876 * DI is declared, but not yet defined. It is also used when the `token` which we use when creating
7877 * a query is not yet defined.
7878 *
7879 * @usageNotes
7880 * ### Example
7881 * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}
7882 * @publicApi
7883 */
7884function forwardRef(forwardRefFn) {
7885    forwardRefFn.__forward_ref__ = forwardRef;
7886    forwardRefFn.toString = function () {
7887        return stringify(this());
7888    };
7889    return forwardRefFn;
7890}
7891/**
7892 * Lazily retrieves the reference value from a forwardRef.
7893 *
7894 * Acts as the identity function when given a non-forward-ref value.
7895 *
7896 * @usageNotes
7897 * ### Example
7898 *
7899 * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}
7900 *
7901 * @see `forwardRef`
7902 * @publicApi
7903 */
7904function resolveForwardRef(type) {
7905    return isForwardRef(type) ? type() : type;
7906}
7907/** Checks whether a function is wrapped by a `forwardRef`. */
7908function isForwardRef(fn) {
7909    return typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) &&
7910        fn.__forward_ref__ === forwardRef;
7911}
7912
7913/**
7914 * @license
7915 * Copyright Google LLC All Rights Reserved.
7916 *
7917 * Use of this source code is governed by an MIT-style license that can be
7918 * found in the LICENSE file at https://angular.io/license
7919 */
7920// Base URL for the error details page.
7921// Keep this value in sync with a similar const in
7922// `packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts`.
7923const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
7924class RuntimeError extends Error {
7925    constructor(code, message) {
7926        super(formatRuntimeError(code, message));
7927        this.code = code;
7928    }
7929}
7930// Contains a set of error messages that have details guides at angular.io.
7931// Full list of available error guides can be found at https://angular.io/errors
7932/* tslint:disable:no-toplevel-property-access */
7933const RUNTIME_ERRORS_WITH_GUIDES = new Set([
7934    "100" /* EXPRESSION_CHANGED_AFTER_CHECKED */,
7935    "200" /* CYCLIC_DI_DEPENDENCY */,
7936    "201" /* PROVIDER_NOT_FOUND */,
7937    "300" /* MULTIPLE_COMPONENTS_MATCH */,
7938    "301" /* EXPORT_NOT_FOUND */,
7939    "302" /* PIPE_NOT_FOUND */,
7940]);
7941/* tslint:enable:no-toplevel-property-access */
7942/** Called to format a runtime error */
7943function formatRuntimeError(code, message) {
7944    const fullCode = code ? `NG0${code}: ` : '';
7945    let errorMessage = `${fullCode}${message}`;
7946    // Some runtime errors are still thrown without `ngDevMode` (for example
7947    // `throwProviderNotFoundError`), so we add `ngDevMode` check here to avoid pulling
7948    // `RUNTIME_ERRORS_WITH_GUIDES` symbol into prod bundles.
7949    // TODO: revisit all instances where `RuntimeError` is thrown and see if `ngDevMode` can be added
7950    // there instead to tree-shake more devmode-only code (and eventually remove `ngDevMode` check
7951    // from this code).
7952    if (ngDevMode && RUNTIME_ERRORS_WITH_GUIDES.has(code)) {
7953        errorMessage = `${errorMessage}. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/NG0${code}`;
7954    }
7955    return errorMessage;
7956}
7957
7958/**
7959 * @license
7960 * Copyright Google LLC All Rights Reserved.
7961 *
7962 * Use of this source code is governed by an MIT-style license that can be
7963 * found in the LICENSE file at https://angular.io/license
7964 */
7965/**
7966 * Used for stringify render output in Ivy.
7967 * Important! This function is very performance-sensitive and we should
7968 * be extra careful not to introduce megamorphic reads in it.
7969 * Check `core/test/render3/perf/render_stringify` for benchmarks and alternate implementations.
7970 */
vendor: 6,621 bytes, lines 7971-8141
7971function renderStringify(value) {
7972    if (typeof value === 'string')
7973        return value;
7974    if (value == null)
7975        return '';
7976    // Use `String` so that it invokes the `toString` method of the value. Note that this
7977    // appears to be faster than calling `value.toString` (see `render_stringify` benchmark).
7978    return String(value);
7979}
7980/**
7981 * Used to stringify a value so that it can be displayed in an error message.
7982 * Important! This function contains a megamorphic read and should only be
7983 * used for error messages.
7984 */
7985function stringifyForError(value) {
7986    if (typeof value === 'function')
7987        return value.name || value.toString();
7988    if (typeof value === 'object' && value != null && typeof value.type === 'function') {
7989        return value.type.name || value.type.toString();
7990    }
7991    return renderStringify(value);
7992}
7993
7994/** Called when directives inject each other (creating a circular dependency) */
7995function throwCyclicDependencyError(token, path) {
7996    const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';
7997    throw new RuntimeError("200" /* CYCLIC_DI_DEPENDENCY */, `Circular dependency in DI detected for ${token}${depPath}`);
7998}
7999function throwMixedMultiProviderError() {
8000    throw new Error(`Cannot mix multi providers and regular providers`);
8001}
8002function throwInvalidProviderError(ngModuleType, providers, provider) {
8003    let ngModuleDetail = '';
8004    if (ngModuleType && providers) {
8005        const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...');
8006        ngModuleDetail =
8007            ` - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`;
8008    }
8009    throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}'` + ngModuleDetail);
8010}
8011/** Throws an error when a token is not found in DI. */
8012function throwProviderNotFoundError(token, injectorName) {
8013    const injectorDetails = injectorName ? ` in ${injectorName}` : '';
8014    throw new RuntimeError("201" /* PROVIDER_NOT_FOUND */, `No provider for ${stringifyForError(token)} found${injectorDetails}`);
8015}
8016
8017/**
8018 * @license
8019 * Copyright Google LLC All Rights Reserved.
8020 *
8021 * Use of this source code is governed by an MIT-style license that can be
8022 * found in the LICENSE file at https://angular.io/license
8023 */
8024function assertNumber(actual, msg) {
8025    if (!(typeof actual === 'number')) {
8026        throwError(msg, typeof actual, 'number', '===');
8027    }
8028}
8029function assertNumberInRange(actual, minInclusive, maxInclusive) {
8030    assertNumber(actual, 'Expected a number');
8031    assertLessThanOrEqual(actual, maxInclusive, 'Expected number to be less than or equal to');
8032    assertGreaterThanOrEqual(actual, minInclusive, 'Expected number to be greater than or equal to');
8033}
8034function assertString(actual, msg) {
8035    if (!(typeof actual === 'string')) {
8036        throwError(msg, actual === null ? 'null' : typeof actual, 'string', '===');
8037    }
8038}
8039function assertFunction(actual, msg) {
8040    if (!(typeof actual === 'function')) {
8041        throwError(msg, actual === null ? 'null' : typeof actual, 'function', '===');
8042    }
8043}
8044function assertEqual(actual, expected, msg) {
8045    if (!(actual == expected)) {
8046        throwError(msg, actual, expected, '==');
8047    }
8048}
8049function assertNotEqual(actual, expected, msg) {
8050    if (!(actual != expected)) {
8051        throwError(msg, actual, expected, '!=');
8052    }
8053}
8054function assertSame(actual, expected, msg) {
8055    if (!(actual === expected)) {
8056        throwError(msg, actual, expected, '===');
8057    }
8058}
8059function assertNotSame(actual, expected, msg) {
8060    if (!(actual !== expected)) {
8061        throwError(msg, actual, expected, '!==');
8062    }
8063}
8064function assertLessThan(actual, expected, msg) {
8065    if (!(actual < expected)) {
8066        throwError(msg, actual, expected, '<');
8067    }
8068}
8069function assertLessThanOrEqual(actual, expected, msg) {
8070    if (!(actual <= expected)) {
8071        throwError(msg, actual, expected, '<=');
8072    }
8073}
8074function assertGreaterThan(actual, expected, msg) {
8075    if (!(actual > expected)) {
8076        throwError(msg, actual, expected, '>');
8077    }
8078}
8079function assertGreaterThanOrEqual(actual, expected, msg) {
8080    if (!(actual >= expected)) {
8081        throwError(msg, actual, expected, '>=');
8082    }
8083}
8084function assertNotDefined(actual, msg) {
8085    if (actual != null) {
8086        throwError(msg, actual, null, '==');
8087    }
8088}
8089function assertDefined(actual, msg) {
8090    if (actual == null) {
8091        throwError(msg, actual, null, '!=');
8092    }
8093}
8094function throwError(msg, actual, expected, comparison) {
8095    throw new Error(`ASSERTION ERROR: ${msg}` +
8096        (comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`));
8097}
8098function assertDomNode(node) {
8099    // If we're in a worker, `Node` will not be defined.
8100    if (!(typeof Node !== 'undefined' && node instanceof Node) &&
8101        !(typeof node === 'object' && node != null &&
8102            node.constructor.name === 'WebWorkerRenderNode')) {
8103        throwError(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);
8104    }
8105}
8106function assertIndexInRange(arr, index) {
8107    assertDefined(arr, 'Array must be defined.');
8108    const maxLen = arr.length;
8109    if (index < 0 || index >= maxLen) {
8110        throwError(`Index expected to be less than ${maxLen} but got ${index}`);
8111    }
8112}
8113function assertOneOf(value, ...validValues) {
8114    if (validValues.indexOf(value) !== -1)
8115        return true;
8116    throwError(`Expected value to be one of ${JSON.stringify(validValues)} but was ${JSON.stringify(value)}.`);
8117}
8118
8119/**
8120 * @license
8121 * Copyright Google LLC All Rights Reserved.
8122 *
8123 * Use of this source code is governed by an MIT-style license that can be
8124 * found in the LICENSE file at https://angular.io/license
8125 */
8126/**
8127 * Construct an `InjectableDef` which defines how a token will be constructed by the DI system, and
8128 * in which injectors (if any) it will be available.
8129 *
8130 * This should be assigned to a static `ɵprov` field on a type, which will then be an
8131 * `InjectableType`.
8132 *
8133 * Options:
8134 * * `providedIn` determines which injectors will include the injectable, by either associating it
8135 *   with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be
8136 *   provided in the `'root'` injector, which will be the application-level injector in most apps.
8137 * * `factory` gives the zero argument function which will create an instance of the injectable.
8138 *   The factory can call `inject` to access the `Injector` and request injection of dependencies.
8139 *
8140 * @codeGenApi
8141 * @publicApi This instruction has been emitted by ViewEngine for some time and is deployed to 
8141npm.
8142 */
8143function ɵɵdefineInjectable(opts) {
8144    return {
8145        token: opts.token,
8146        providedIn: opts.providedIn || null,
8147        factory: opts.factory,
8148        value: undefined,
8149    };
8150}
8151/**
8152 * @deprecated in v8, delete after v10. This API should be used only by generated code, and that
8153 * code should now use ɵɵdefineInjectable instead.
8154 * @publicApi
8155 */
8156const defineInjectable = ɵɵdefineInjectable;
8157/**
8158 * Construct an `InjectorDef` which configures an injector.
8159 *
8160 * This should be assigned to a static injector def (`ɵinj`) field on a type, which will then be an
8161 * `InjectorType`.
8162 *
8163 * Options:
8164 *
8165 * * `providers`: an optional array of providers to add to the injector. Each provider must
8166 *   either have a factory or point to a type which has a `ɵprov` static property (the
8167 *   type must be an `InjectableType`).
8168 * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s
8169 *   whose providers will also be added to the injector. Locally provided types will override
8170 *   providers from imports.
8171 *
8172 * @codeGenApi
8173 */
8174function ɵɵdefineInjector(options) {
8175    return { providers: options.providers || [], imports: options.imports || [] };
8176}
8177/**
8178 * Read the injectable def (`ɵprov`) for `type` in a way which is immune to accidentally reading
8179 * inherited value.
8180 *
8181 * @param type A type which may have its own (non-inherited) `ɵprov`.
8182 */
8183function getInjectableDef(type) {
8184    return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);
8185}
8186/**
8187 * Return definition only if it is defined directly on `type` and is not inherited from a base
8188 * class of `type`.
8189 */
8190function getOwnDefinition(type, field) {
8191    return type.hasOwnProperty(field) ? type[field] : null;
8192}
8193/**
8194 * Read the injectable def (`ɵprov`) for `type` or read the `ɵprov` from one of its ancestors.
8195 *
8196 * @param type A type which may have `ɵprov`, via inheritance.
8197 *
8198 * @deprecated Will be removed in a future version of Angular, where an error will occur in the
8199 *     scenario if we find the `ɵprov` on an ancestor only.
8200 */
8201function getInheritedInjectableDef(type) {
8202    const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);
8203    if (def) {
8204        const typeName = getTypeName(type);
8205        // TODO(FW-1307): Re-add ngDevMode when closure can handle it
8206        // ngDevMode &&
8207        console.warn(`DEPRECATED: DI is instantiating a token "${typeName}" that inherits its @Injectable decorator but does not provide one itself.\n` +
8208            `This will become an error in a future version of Angular. Please add @Injectable() to the "${typeName}" class.`);
8209        return def;
8210    }
8211    else {
8212        return null;
8213    }
8214}
8215/** Gets the name of a type, accounting for some cross-browser differences. */
8216function getTypeName(type) {
8217    // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers
8218    // it'll always return the name of the function itself, no matter how many other functions it
8219    // inherits from. On IE the function doesn't have its own `name` property, but it takes it from
8220    // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most
8221    // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around
8222    // the issue by converting the function to a string and parsing its name out that way via a regex.
8223    if (type.hasOwnProperty('name')) {
8224        return type.name;
8225    }
8226    const match = ('' + type).match(/^function\s*([^\s(]+)/);
8227    return match === null ? '' : match[1];
8228}
8229/**
8230 * Read the injector def type in a way which is immune to accidentally reading inherited value.
8231 *
8232 * @param type type which may have an injector def (`ɵinj`)
8233 */
8234function getInjectorDef(type) {
8235    return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF)) ?
8236        type[NG_INJ_DEF] :
8237        null;
8238}
8239const NG_PROV_DEF = getClosureSafeProperty({ ɵprov: getClosureSafeProperty });
8240const NG_INJ_DEF = getClosureSafeProperty({ ɵinj: getClosureSafeProperty });
8241// We need to keep these around so we can read off old defs if new defs are unavailable
8242const NG_INJECTABLE_DEF = getClosureSafeProperty({ ngInjectableDef: getClosureSafeProperty });
8243const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafeProperty });
8244
8245/**
8246 * @license
8247 * Copyright Google LLC All Rights Reserved.
8248 *
8249 * Use of this source code is governed by an MIT-style license that can be
8250 * found in the LICENSE file at https://angular.io/license
8251 */
8252/**
8253 * Injection flags for DI.
8254 *
8255 * @publicApi
8256 */
8257var InjectFlags;
8258(function (InjectFlags) {
8259    // TODO(alxhub): make this 'const' (and remove `InternalInjectFlags` enum) when ngc no longer
8260    // writes exports of it into ngfactory files.
8261    /** Check self and check parent injector if needed */
8262    InjectFlags[InjectFlags["Default"] = 0] = "Default";
8263    /**
8264     * Specifies that an injector should retrieve a dependency from any injector until reaching the
8265     * host element of the current component. (Only used with Element Injector)
8266     */
8267    InjectFlags[InjectFlags["Host"] = 1] = "Host";
8268    /** Don't ascend to ancestors of the node requesting injection. */
8269    InjectFlags[InjectFlags["Self"] = 2] = "Self";
8270    /** Skip the node that is requesting injection. */
8271    InjectFlags[InjectFlags["SkipSelf"] = 4] = "SkipSelf";
8272    /** Inject `defaultValue` instead if token not found. */
8273    InjectFlags[InjectFlags["Optional"] = 8] = "Optional";
8274})(InjectFlags || (InjectFlags = {}));
8275
8276/**
8277 * @license
8278 * Copyright Google LLC All Rights Reserved.
8279 *
8280 * Use of this source code is governed by an MIT-style license that can be
8281 * found in the LICENSE file at https://angular.io/license
8282 */
8283/**
8284 * Current implementation of inject.
8285 *
8286 * By default, it is `injectInjectorOnly`, which makes it `Injector`-only aware. It can be changed
8287 * to `directiveInject`, which brings in the `NodeInjector` system of ivy. It is designed this
8288 * way for two reasons:
8289 *  1. `Injector` should not depend on ivy logic.
8290 *  2. To maintain tree shake-ability we don't want to bring in unnecessary code.
8291 */
8292let _injectImplementation;
8293function getInjectImplementation() {
8294    return _injectImplementation;
8295}
8296/**
8297 * Sets the current inject implementation.
8298 */
8299function setInjectImplementation(impl) {
8300    const previous = _injectImplementation;
8301    _injectImplementation = impl;
8302    return previous;
8303}
8304/**
8305 * Injects `root` tokens in limp mode.
8306 *
8307 * If no injector exists, we can still inject tree-shakable providers which have `providedIn` set to
8308 * `"root"`. This is known as the limp mode injection. In such case the value is stored in the
8309 * `InjectableDef`.
8310 */
8311function injectRootLimpMode(token, notFoundValue, flags) {
8312    const injectableDef = getInjectableDef(token);
8313    if (injectableDef && injectableDef.providedIn == 'root') {
8314        return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() :
8315            injectableDef.value;
8316    }
8317    if (flags & InjectFlags.Optional)
8318        return null;
8319    if (notFoundValue !== undefined)
8320        return notFoundValue;
8321    throwProviderNotFoundError(stringify(token), 'Injector');
8322}
8323/**
8324 * Assert that `_injectImplementation` is not `fn`.
8325 *
8326 * This is useful, to prevent infinite recursion.
8327 *
8328 * @param fn Function which it should not equal to
8329 */
8330function assertInjectImplementationNotEqual(fn) {
8331    ngDevMode &&
8332        assertNotEqual(_injectImplementation, fn, 'Calling ɵɵinject would cause infinite recursion');
8333}
8334
8335/**
8336 * @license
8337 * Copyright Google LLC All Rights Reserved.
8338 *
8339 * Use of this source code is governed by an MIT-style license that can be
8340 * found in the LICENSE file at https://angular.io/license
8341 */
8342/**
8343 * Convince closure compiler that the wrapped function has no side-effects.
8344 *
8345 * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to
8346 * allow us to execute a function but have closure compiler mark the call as no-side-effects.
8347 * It is important that the return value for the `noSideEffects` function be assigned
8348 * to something which is retained otherwise the call to `noSideEffects` will be removed by closure
8349 * compiler.
8350 */
8351function noSideEffects(fn) {
8352    return { toString: fn }.toString();
8353}
8354
8355/**
8356 * @license
8357 * Copyright Google LLC All Rights Reserved.
8358 *
8359 * Use of this source code is governed by an MIT-style license that can be
8360 * found in the LICENSE file at https://angular.io/license
8361 */
8362/**
8363 * The strategy that the default change detector uses to detect changes.
8364 * When set, takes effect the next time change detection is triggered.
8365 *
8366 * @see {@link ChangeDetectorRef#usage-notes Change detection usage}
8367 *
8368 * @publicApi
8369 */
8370var ChangeDetectionStrategy;
8371(function (ChangeDetectionStrategy) {
8372    /**
8373     * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated
8374     * until reactivated by setting the strategy to `Default` (`CheckAlways`).
8375     * Change detection can still be explicitly invoked.
8376     * This strategy applies to all child directives and cannot be overridden.
8377     */
8378    ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
8379    /**
8380     * Use the default `CheckAlways` strategy, in which change detection is automatic until
8381     * explicitly deactivated.
8382     */
8383    ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
8384})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
8385/**
8386 * Defines the possible states of the default change detector.
8387 * @see `ChangeDetectorRef`
8388 */
8389var ChangeDetectorStatus;
8390(function (ChangeDetectorStatus) {
8391    /**
8392     * A state in which, after calling `detectChanges()`, the change detector
8393     * state becomes `Checked`, and must be explicitly invoked or reactivated.
8394     */
8395    ChangeDetectorStatus[ChangeDetectorStatus["CheckOnce"] = 0] = "CheckOnce";
8396    /**
8397     * A state in which change detection is skipped until the change detector mode
8398     * becomes `CheckOnce`.
8399     */
8400    ChangeDetectorStatus[ChangeDetectorStatus["Checked"] = 1] = "Checked";
8401    /**
8402     * A state in which change detection continues automatically until explicitly
8403     * deactivated.
8404     */
8405    ChangeDetectorStatus[ChangeDetectorStatus["CheckAlways"] = 2] = "CheckAlways";
8406    /**
8407     * A state in which a change detector sub tree is not a part of the main tree and
8408     * should be skipped.
8409     */
8410    ChangeDetectorStatus[ChangeDetectorStatus["Detached"] = 3] = "Detached";
8411    /**
8412     * Indicates that the change detector encountered an error checking a binding
8413     * or calling a directive lifecycle method and is now in an inconsistent state. Change
8414     * detectors in this state do not detect changes.
8415     */
8416    ChangeDetectorStatus[ChangeDetectorStatus["Errored"] = 4] = "
8416Errored";
8417    /**
8418     * Indicates that the change detector has been destroyed.
8419     */
8420    ChangeDetectorStatus[ChangeDetectorStatus["Destroyed"] = 5] = "Destroyed";
8421})(ChangeDetectorStatus || (ChangeDetectorStatus = {}));
8422/**
8423 * Reports whether a given strategy is currently the default for change detection.
8424 * @param changeDetectionStrategy The strategy to check.
8425 * @returns True if the given strategy is the current default, false otherwise.
8426 * @see `ChangeDetectorStatus`
8427 * @see `ChangeDetectorRef`
8428 */
8429function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
8430    return changeDetectionStrategy == null ||
8431        changeDetectionStrategy === ChangeDetectionStrategy.Default;
8432}
8433
8434/**
8435 * @license
8436 * Copyright Google LLC All Rights Reserved.
8437 *
8438 * Use of this source code is governed by an MIT-style license that can be
8439 * found in the LICENSE file at https://angular.io/license
8440 */
8441/**
8442 * Defines template and style encapsulation options available for Component's {@link Component}.
8443 *
8444 * See {@link Component#encapsulation encapsulation}.
8445 *
8446 * @usageNotes
8447 * ### Example
8448 *
8449 * {@example core/ts/metadata/encapsulation.ts region='longform'}
8450 *
8451 * @publicApi
8452 */
8453var ViewEncapsulation;
8454(function (ViewEncapsulation) {
8455    /**
8456     * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host
8457     * Element and pre-processing the style rules provided via {@link Component#styles styles} or
8458     * {@link Component#styleUrls styleUrls}, and adding the new Host Element attribute to all
8459     * selectors.
8460     *
8461     * This is the default option.
8462     */
8463    ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
8464    // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
8465    /**
8466     * Don't provide any template or style encapsulation.
8467     */
8468    ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
8469    /**
8470     * Use Shadow DOM to encapsulate styles.
8471     *
8472     * For the DOM this means using modern [Shadow
8473     * DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM) and
8474     * creating a ShadowRoot for Component's Host Element.
8475     */
8476    ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
8477})(ViewEncapsulation || (ViewEncapsulation = {}));
8478
8479/**
8480 * @license
8481 * Copyright Google LLC All Rights Reserved.
8482 *
8483 * Use of this source code is governed by an MIT-style license that can be
8484 * found in the LICENSE file at https://angular.io/license
8485 */
8486const __globalThis = typeof globalThis !== 'undefined' && globalThis;
8487const __window = typeof window !== 'undefined' && window;
8488const __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
8489    self instanceof WorkerGlobalScope && self;
8490const __global = typeof global !== 'undefined' && global;
8491// Always use __globalThis if available, which is the spec-defined global variable across all
8492// environments, then fallback to __global first, because in Node tests both __global and
8493// __window may be defined and _global should be __global in that case.
8494const _global = __globalThis || __global || __window || __self;
8495
8496/**
8497 * @license
8498 * Copyright Google LLC All Rights Reserved.
8499 *
8500 * Use of this source code is governed by an MIT-style license that can be
8501 * found in the LICENSE file at https://angular.io/license
8502 */
8503function ngDevModeResetPerfCounters() {
8504    const locationString = typeof location !== 'undefined' ? location.toString() : '';
8505    const newCounters = {
8506        namedConstructors: locationString.indexOf('ngDevMode=namedConstructors') != -1,
8507        firstCreatePass: 0,
8508        tNode: 0,
8509        tView: 0,
8510        rendererCreateTextNode: 0,
8511        rendererSetText: 0,
8512        rendererCreateElement: 0,
8513        rendererAddEventListener: 0,
8514        rendererSetAttribute: 0,
8515        rendererRemoveAttribute: 0,
8516        rendererSetProperty: 0,
8517        rendererSetClassName: 0,
8518        rendererAddClass: 0,
8519        rendererRemoveClass: 0,
8520        rendererSetStyle: 0,
8521        rendererRemoveStyle: 0,
8522        rendererDestroy: 0,
8523        rendererDestroyNode: 0,
8524        rendererMoveNode: 0,
8525        rendererRemoveNode: 0,
8526        rendererAppendChild: 0,
8527        rendererInsertBefore: 0,
8528        rendererCreateComment: 0,
8529    };
8530    // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.
8531    const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;
8532    _global['ngDevMode'] = allowNgDevModeTrue && newCounters;
8533    return newCounters;
8534}
8535/**
8536 * This function checks to see if the `ngDevMode` has been set. If yes,
8537 * then we honor it, otherwise we default to dev mode with additional checks.
8538 *
8539 * The idea is that unless we are doing production build where we explicitly
8540 * set `ngDevMode == false` we should be helping the developer by providing
8541 * as much early warning and errors as possible.
8542 *
8543 * `ɵɵdefineComponent` is guaranteed to have been called before any component template functions
8544 * (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode
8545 * is defined for the entire instruction set.
8546 *
8547 * When checking `ngDevMode` on toplevel, always init it before referencing it
8548 * (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can
8549 *  get a `ReferenceError` like in https://github.com/angular/angular/issues/31595.
8550 *
8551 * Details on possible values for `ngDevMode` can be found on its docstring.
8552 *
8553 * NOTE:
8554 * - changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`.
8555 */
8556function initNgDevMode() {
8557    // The below checks are to ensure that calling `initNgDevMode` multiple times does not
8558    // reset the counters.
8559    // If the `ngDevMode` is not an object, then it means we have not created the perf counters
8560    // yet.
8561    if (typeof ngDevMode === 'undefined' || ngDevMode) {
8562        if (typeof ngDevMode !== 'object') {
8563            ngDevModeResetPerfCounters();
8564        }
8565        return typeof ngDevMode !== 'undefined' && !!ngDevMode;
8566    }
8567    return false;
8568}
8569
8570/**
8571 * @license
8572 * Copyright Google LLC All Rights Reserved.
8573 *
8574 * Use of this source code is governed by an MIT-style license that can be
8575 * found in the LICENSE file at https://angular.io/license
8576 */
8577/**
8578 * This file contains reuseable "empty" symbols that can be used as default return values
8579 * in different parts of the rendering code. Because the same symbols are returned, this
8580 * allows for identity checks against these values to be consistently used by the framework
8581 * code.
8582 */
8583const EMPTY_OBJ = {};
8584const EMPTY_ARRAY = [];
8585// freezing the values prevents any code from accidentally inserting new values in
8586if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {
8587    // These property accesses can be ignored because ngDevMode will be set to false
8588    // when optimizing code and the whole if statement will be dropped.
8589    // tslint:disable-next-line:no-toplevel-property-access
8590    Object.freeze(EMPTY_OBJ);
8591    // tslint:disable-next-line:no-toplevel-property-access
8592    Object.freeze(EMPTY_ARRAY);
8593}
8594
8595/**
8596 * @license
8597 * Copyright Google LLC All Rights Reserved.
8598 *
8599 * Use of this source code is governed by an MIT-style license that can be
8600 * found in the LICENSE file at https://angular.io/license
8601 */
8602/**
8603 * This file contains reuseable "empty" symbols that can be used as default return values
8604 * in different parts of the rendering code. Because the same symbols are returned, this
8605 * allows for identity checks against these values to be consistently used by the framework
8606 * code.
8607 */
8608const EMPTY_ARRAY$1 = [];
8609// freezing the values prevents any code from accidentally inserting new values in
8610if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {
8611    // These property accesses can be ignored because ngDevMode will be set to false
8612    // when optimizing code and the whole if statement will be dropped.
8613    // tslint:disable-next-line:no-toplevel-property-access
8614    Object.freeze(EMPTY_ARRAY$1);
8615}
8616
8617/**
8618 * @license
8619 * Copyright Google LLC All Rights Reserved.
8620 *
8621 * Use of this source code is governed by an MIT-style license that can be
8622 * found in the LICENSE file at https://angular.io/license
8623 */
8624const NG_COMP_DEF = getClosureSafeProperty({ ɵcmp: getClosureSafeProperty });
8625const NG_DIR_DEF = getClosureSafeProperty({ ɵdir: getClosureSafeProperty });
8626const NG_PIPE_DEF = getClosureSafeProperty({ ɵpipe: getClosureSafeProperty });
8627const NG_MOD_DEF = getClosureSafeProperty({ ɵmod: getClosureSafeProperty });
8628const NG_LOC_ID_DEF = getClosureSafeProperty({ ɵloc: getClosureSafeProperty });
8629const NG_FACTORY_DEF = getClosureSafeProperty({ ɵfac: getClosureSafeProperty });
8630/**
8631 * If a directive is diPublic, bloomAdd sets a property on the type with this constant as
8632 * the key and the directive's unique ID as the value. This allows us to map directives to their
8633 * bloom filter bit for DI.
8634 */
8635// TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified.
8636const NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafeProperty });
8637
8638/**
8639 * @license
8640 * Copyright Google LLC All Rights Reserved.
8641 *
8642 * Use of this source code is governed by an MIT-style license that can be
8643 * found in the LICENSE file at https://angular.io/license
8644 */
8645let _renderCompCount = 0;
8646/**
8647 * Create a component definition object.
8648 *
8649 *
8650 * # Example
8651 * ```
8652 * class MyDirective {
8653 *   // Generated by Angular Template Compiler
8654 *   // [Symbol] syntax will not be supported by TypeScript until v2.7
8655 *   static ɵcmp = defineComponent({
8656 *     ...
8657 *   });
8658 * }
8659 * ```
8660 * @codeGenApi
8661 */
8662function ɵɵdefineComponent(componentDefinition) {
8663    return noSideEffects(() => {
8664        // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent.
8665        // See the `initNgDevMode` docstring for more information.
8666        (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();
8667        const type = componentDefinition.type;
8668        const declaredInputs = {};
8669        const def = {
8670            type: type,
8671            providersResolver: null,
8672            decls: componentDefinition.decls,
8673            vars: componentDefinition.vars,
8674            factory: null,
8675            template: componentDefinition.template || null,
8676            consts: componentDefinition.consts || null,
8677            ngContentSelectors: componentDefinition.ngContentSelectors,
8678            hostBindings: componentDefinition.hostBindings || null,
8679            hostVars: componentDefinition.hostVars || 0,
8680            hostAttrs: componentDefinition.hostAttrs || null,
8681            contentQueries: componentDefinition.contentQueries || null,
8682            declaredInputs: declaredInputs,
8683            inputs: null,
8684            outputs: null,
8685            exportAs: componentDefinition.exportAs || null,
8686            onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,
8687            directiveDefs: null,
8688            pipeDefs: null,
8689            selectors: componentDefinition.selectors || EMPTY_ARRAY$1,
8690            viewQuery: componentDefinition.viewQuery || null,
8691            features: componentDefinition.features || null,
8692            data: componentDefinition.data || {},
8693            // TODO(misko): convert ViewEncapsulation into const enum so that it can be used
8694            // directly in the next line. Also `None` should be 0 not 2.
8695            encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated,
8696            id: 'c',
8697            styles: componentDefinition.styles || EMPTY_ARRAY$1,
8698            _: null,
8699            setInput: null,
8700            schemas: componentDefinition.schemas || null,
8701            tView: null,
8702        };
8703        const directiveTypes = componentDefinition.directives;
8704        const feature = componentDefinition.features;
8705        const pipeTypes = componentDefinition.pipes;
8706        def.id += _renderCompCount++;
8707        def.inputs = invertObject(componentDefinition.inputs, declaredInputs),
8708            def.outputs = invertObject(componentDefinition.outputs),
8709            feature && feature.forEach((fn) => fn(def));
8710        def.directiveDefs = directiveTypes ?
8711            () => (typeof directiveTypes === 'function' ? directiveTypes() : directiveTypes)
8712                .map(extractDirectiveDef) :
8713            null;
8714        def.pipeDefs = pipeTypes ?
8715            () => (typeof pipeTypes === 'function' ? pipeTypes() : pipeTypes).map(extractPipeDef) :
8716            null;
8717        return def;
8718    });
8719}
8720/**
8721 * Generated next to NgModules to monkey-patch directive and pipe references onto a component's
8722 * definition, when generating a direct reference in the component file would otherwise create an
8723 * import cycle.
8724 *
8725 * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.
8726 *
8727 * @codeGenApi
8728 */
8729function ɵɵsetComponentScope(type, directives, pipes) {
8730    const def = type.ɵcmp;
8731    def.directiveDefs = () => directives.map(extractDirectiveDef);
8732    def.pipeDefs = () => pipes.map(extractPipeDef);
8733}
8734function extractDirectiveDef(type) {
8735    const def = getComponentDef(type) || getDirectiveDef(type);
8736    if (ngDevMode && !def) {
8737        throw new Error(`'${type.name}' is neither 'ComponentType' or 'DirectiveType'.`);
8738    }
8739    return def;
8740}
8741function extractPipeDef(type) {
8742    const def = getPipeDef(type);
8743    if (ngDevMode && !def) {
8744        throw new Error(`'${type.name}' is not a 'PipeType'.`);
8745    }
8746    return def;
8747}
8748const autoRegisterModuleById = {};
8749/**
8750 * @codeGenApi
8751 */
8752function ɵɵdefineNgModule(def) {
8753    const res = {
8754        type: def.type,
8755        bootstrap: def.bootstrap || EMPTY_ARRAY$1,
8756        declarations: def.declarations || EMPTY_ARRAY$1,
8757        imports: def.imports || EMPTY_ARRAY$1,
8758        exports: def.exports || EMPTY_ARRAY$1,
8759        transitiveCompileScopes: null,
8760        schemas: def.schemas || null,
8761        id: def.id || null,
8762    };
8763    if (def.id != null) {
8764        noSideEffects(() => {
8765            autoRegisterModuleById[def.id] = def.type;
8766        });
8767    }
8768    return res;
8769}
8770/**
8771 * Adds the module metadata that is necessary to compute the module's transitive scope to an
8772 * existing module definition.
8773 *
8774 * Scope metadata of modules is not used in production builds, so calls to this function can be
8775 * marked pure to tree-shake it from the bundle, allowing for all referenced declarations
8776 * to become eligible for tree-shaking as well.
8777 *
8778 * @codeGenApi
8779 */
8780function ɵɵsetNgModuleScope(type, scope) {
8781    return noSideEffects(() => {
8782        const ngModuleDef = getNgModuleDef(type, true);
8783        ngModuleDef.declarations = scope.declarations || EMPTY_ARRAY$1;
8784        ngModuleDef.imports = scope.imports || EMPTY_ARRAY$1;
8785        ngModuleDef.exports = scope.exports || EMPTY_ARRAY$1;
8786    });
8787}
8788/**
8789 * Inverts an inputs or outputs lookup such that the keys, which were the
8790 * minified keys, are part of the values, and the values are parsed so that
8791 * the publicName of the property is the new key
8792 *
8793 * e.g. for
8794 *
8795 * ```
8796 * class Comp {
8797 *   @Input()
8798 *   propName1: string;
8799 *
8800 *   @Input('publicName2')
8801 *   declaredPropName2: number;
8802 * }
8803 * ```
8804 *
8805 * will be serialized as
8806 *
8807 * ```
8808 * {
8809 *   propName1: 'propName1',
8810 *   declaredPropName2: ['publicName2', 'declaredPropName2'],
8811 * }
8812 * ```
8813 *
8814 * which is than translated by the minifier as:
8815 *
8816 * ```
8817 * {
8818 *   minifiedPropName1: 'propName1',
8819 *   minifiedPropName2: ['publicName2', 'declaredPropName2'],
8820 * }
8821 * ```
8822 *
8823 * becomes: (public name => minifiedName)
8824 *
8825 * ```
8826 * {
8827 *  'propName1': 'minifiedPropName1',
8828 *  'publicName2': 'minifiedPropName2',
8829 * }
8830 * ```
8831 *
8832 * Optionally the function can take `secondary` which will result in: (public name => declared name)
8833 *
8834 * ```
8835 * {
8836 *  'propName1': 'propName1',
8837 *  'publicName2': 'declaredPropName2',
8838 * }
8839 * ```
8840 *
8841
8842 */
8843function invertObject(obj, secondary) {
8844    if (obj == null)
8845        return EMPTY_OBJ;
8846    const newLookup = {};
8847    for (const minifiedKey in obj) {
8848        if (obj.hasOwnProperty(minifiedKey)) {
8849            let publicName = obj[minifiedKey];
8850            let declaredName = publicName;
8851            if (Array.isArray(publicName)) {
8852                declaredName = publicName[1];
8853                publicName = publicName[0];
8854            }
8855            newLookup[publicName] = minifiedKey;
8856            if (secondary) {
8857                (secondary[publicName] = declaredName);
8858            }
8859        }
8860    }
8861    return newLookup;
8862}
8863/**
8864 * Create a directive definition object.
8865 *
8866 * # Example
8867 * ```ts
8868 * class MyDirective {
8869 *   // Generated by Angular Template Compiler
8870 *   // [Symbol] syntax will not be supported by TypeScript until v2.7
8871 *   static ɵdir = ɵɵdefineDirective({
8872 *     ...
8873 *   });
8874 * }
8875 * ```
8876 *
8877 * @codeGenApi
8878 */
8879const ɵɵdefineDirective = ɵɵdefineComponent;
8880/**
8881 * Create a pipe definition object.
8882 *
8883 * # Example
8884 * ```
8885 * class MyPipe implements PipeTransform {
8886 *   // Generated by Angular Template Compiler
8887 *   static ɵpipe = definePipe({
8888 *     ...
8889 *   });
8890 * }
8891 * ```
8892 * @param pipeDef Pipe definition generated by the compiler
8893 *
8894 * @codeGenApi
8895 */
8896function ɵɵdefinePipe(pipeDef) {
8897    return {
8898        type: pipeDef.type,
8899        name: pipeDef.name,
8900        factory: null,
8901        pure: pipeDef.pure !== false,
8902        onDestroy: pipeDef.type.prototype.ngOnDestroy || null
8903    };
8904}
8905/**
8906 * The following getter methods retrieve the definition from the type. Currently the retrieval
8907 * honors inheritance, but in the future we may change the rule to require that definitions are
8908 * explicit. This would require some sort of migration strategy.
8909 */
8910function getComponentDef(type) {
8911    return type[NG_COMP_DEF] || null;
8912}
8913function getDirectiveDef(type) {
8914    return type[NG_DIR_DEF] || null;
8915}
8916function getPipeDef(type) {
8917    return type[NG_PIPE_DEF] || null;
8918}
8919function getNgModuleDef(type, throwNotFound) {
8920    const ngModuleDef = type[NG_MOD_DEF] || null;
8921    if (!ngModuleDef && throwNotFound === true) {
8922        throw new Error(`Type ${stringify(type)} does not have 'ɵmod' property.`);
8923    }
8924    return ngModuleDef;
8925}
8926function getNgLocaleIdDef(type) {
8927    return type[NG_LOC_ID_DEF] || null;
8928}
8929
8930/**
8931 * @license
8932 * Copyright Google LLC All Rights Reserved.
8933 *
8934 * Use of this source code is governed by an MIT-style license that can be
8935 * found in the LICENSE file at https://angular.io/license
8936 */
8937// Below are constants for LView indices to help us look up LView members
8938// without having to remember the specific indices.
8939// Uglify will inline these when minifying so there shouldn't be a cost.
8940const HOST = 0;
8941const TVIEW = 1;
8942const FLAGS = 2;
8943const PARENT = 3;
8944const NEXT = 4;
8945const TRANSPLANTED_VIEWS_TO_REFRESH = 5;
8946const T_HOST = 6;
8947const CLEANUP = 7;
8948const CONTEXT = 8;
8949const INJECTOR = 9;
8950const RENDERER_FACTORY = 10;
8951const RENDERER = 11;
8952const SANITIZER = 12;
8953const CHILD_HEAD = 13;
8954const CHILD_TAIL = 14;
8955// FIXME(misko): Investigate if the three declarations aren't all same thing.
8956const DECLARATION_VIEW = 15;
8957const DECLARATION_COMPONENT_VIEW = 16;
8958const DECLARATION_LCONTAINER = 17;
8959const PREORDER_HOOK_FLAGS = 18;
8960const QUERIES = 19;
8961/**
8962 * Size of LView's header. Necessary to adjust for it when setting slots.
8963 *
8964 * IMPORTANT: `HEADER_OFFSET` should only be referred to the in the `ɵɵ*` instructions to translate
8965 * instruction index into `LView` index. All other indexes should be in the `LView` index space and
8966 * there should be no need to refer to `HEADER_OFFSET` anywhere else.
8967 */
8968const HEADER_OFFSET = 20;
8969/**
8970 * Converts `TViewType` into human readable text.
8971 * Make sure this matches with `TViewType`
8972 */
8973const TViewTypeAsString = [
8974    'Root',
8975    'Component',
8976    'Embedded',
8977];
8978// Note: This hack is necessary so we don't erroneously get a circular dependency
8979// failure based on types.
8980const unusedValueExportToPlacateAjd = 1;
8981
8982/**
8983 * @license
8984 * Copyright Google LLC All Rights Reserved.
8985 *
8986 * Use of this source code is governed by an MIT-style license that can be
8987 * found in the LICENSE file at https://angular.io/license
8988 */
8989/**
8990 * Special location which allows easy identification of type. If we have an array which was
8991 * retrieved from the `LView` and that array has `true` at `TYPE` location, we know it is
8992 * `LContainer`.
8993 */
8994const TYPE = 1;
8995/**
8996 * Below are constants for LContainer indices to help us look up LContainer members
8997 * without having to remember the specific indices.
8998 * Uglify will inline these when minifying so there shouldn't be a cost.
8999 */
9000/**
9001 * Flag to signify that this `LContainer` may have transplanted views which need to be change
9002 * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.
9003 *
9004 * This flag, once set, is never unset for the `LContainer`. This means that when unset we can skip
9005 * a lot of work in `refreshEmbeddedViews`. But when set we still need to verify
9006 * that the `MOVED_VIEWS` are transplanted and on-push.
9007 */
9008const HAS_TRANSPLANTED_VIEWS = 2;
9009// PARENT, NEXT, TRANSPLANTED_VIEWS_TO_REFRESH are indices 3, 4, and 5
9010// As we already have these constants in LView, we don't need to re-create them.
9011// T_HOST is index 6
9012// We already have this constants in LView, we don't need to re-create it.
9013const NATIVE = 7;
9014const VIEW_REFS = 8;
9015const MOVED_VIEWS = 9;
9016/**
9017 * Size of LContainer's header. Represents the index after which all views in the
9018 * container will be inserted. We need to keep a record of current views so we know
9019 * which views are already in the DOM (and don't need to be re-added) and s
vendor: 10,584 bytes, lines 9019-9296
9019o we can
9020 * remove views from the DOM when they are no longer required.
9021 */
9022const CONTAINER_HEADER_OFFSET = 10;
9023// Note: This hack is necessary so we don't erroneously get a circular dependency
9024// failure based on types.
9025const unusedValueExportToPlacateAjd$1 = 1;
9026
9027/**
9028 * @license
9029 * Copyright Google LLC All Rights Reserved.
9030 *
9031 * Use of this source code is governed by an MIT-style license that can be
9032 * found in the LICENSE file at https://angular.io/license
9033 */
9034/**
9035 * True if `value` is `LView`.
9036 * @param value wrapped value of `RNode`, `LView`, `LContainer`
9037 */
9038function isLView(value) {
9039    return Array.isArray(value) && typeof value[TYPE] === 'object';
9040}
9041/**
9042 * True if `value` is `LContainer`.
9043 * @param value wrapped value of `RNode`, `LView`, `LContainer`
9044 */
9045function isLContainer(value) {
9046    return Array.isArray(value) && value[TYPE] === true;
9047}
9048function isContentQueryHost(tNode) {
9049    return (tNode.flags & 8 /* hasContentQuery */) !== 0;
9050}
9051function isComponentHost(tNode) {
9052    return (tNode.flags & 2 /* isComponentHost */) === 2 /* isComponentHost */;
9053}
9054function isDirectiveHost(tNode) {
9055    return (tNode.flags & 1 /* isDirectiveHost */) === 1 /* isDirectiveHost */;
9056}
9057function isComponentDef(def) {
9058    return def.template !== null;
9059}
9060function isRootView(target) {
9061    return (target[FLAGS] & 512 /* IsRoot */) !== 0;
9062}
9063
9064/**
9065 * @license
9066 * Copyright Google LLC All Rights Reserved.
9067 *
9068 * Use of this source code is governed by an MIT-style license that can be
9069 * found in the LICENSE file at https://angular.io/license
9070 */
9071// [Assert functions do not constraint type when they are guarded by a truthy
9072// expression.](https://github.com/microsoft/TypeScript/issues/37295)
9073function assertTNodeForLView(tNode, lView) {
9074    assertTNodeForTView(tNode, lView[TVIEW]);
9075}
9076function assertTNodeForTView(tNode, tView) {
9077    assertTNode(tNode);
9078    tNode.hasOwnProperty('tView_') &&
9079        assertEqual(tNode.tView_, tView, 'This TNode does not belong to this TView.');
9080}
9081function assertTNode(tNode) {
9082    assertDefined(tNode, 'TNode must be defined');
9083    if (!(tNode && typeof tNode === 'object' && tNode.hasOwnProperty('directiveStylingLast'))) {
9084        throwError('Not of type TNode, got: ' + tNode);
9085    }
9086}
9087function assertTIcu(tIcu) {
9088    assertDefined(tIcu, 'Expected TIcu to be defined');
9089    if (!(typeof tIcu.currentCaseLViewIndex === 'number')) {
9090        throwError('Object is not of TIcu type.');
9091    }
9092}
9093function assertComponentType(actual, msg = 'Type passed in is not ComponentType, it does not have \'ɵcmp\' property.') {
9094    if (!getComponentDef(actual)) {
9095        throwError(msg);
9096    }
9097}
9098function assertNgModuleType(actual, msg = 'Type passed in is not NgModuleType, it does not have \'ɵmod\' property.') {
9099    if (!getNgModuleDef(actual)) {
9100        throwError(msg);
9101    }
9102}
9103function assertCurrentTNodeIsParent(isParent) {
9104    assertEqual(isParent, true, 'currentTNode should be a parent');
9105}
9106function assertHasParent(tNode) {
9107    assertDefined(tNode, 'currentTNode should exist!');
9108    assertDefined(tNode.parent, 'currentTNode should have a parent');
9109}
9110function assertDataNext(lView, index, arr) {
9111    if (arr == null)
9112        arr = lView;
9113    assertEqual(arr.length, index, `index ${index} expected to be at the end of arr (length ${arr.length})`);
9114}
9115function assertLContainer(value) {
9116    assertDefined(value, 'LContainer must be defined');
9117    assertEqual(isLContainer(value), true, 'Expecting LContainer');
9118}
9119function assertLViewOrUndefined(value) {
9120    value && assertEqual(isLView(value), true, 'Expecting LView or undefined or null');
9121}
9122function assertLView(value) {
9123    assertDefined(value, 'LView must be defined');
9124    assertEqual(isLView(value), true, 'Expecting LView');
9125}
9126function assertFirstCreatePass(tView, errMessage) {
9127    assertEqual(tView.firstCreatePass, true, errMessage || 'Should only be called in first create pass.');
9128}
9129function assertFirstUpdatePass(tView, errMessage) {
9130    assertEqual(tView.firstUpdatePass, true, errMessage || 'Should only be called in first update pass.');
9131}
9132/**
9133 * This is a basic sanity check that an object is probably a directive def. DirectiveDef is
9134 * an interface, so we can't do a direct instanceof check.
9135 */
9136function assertDirectiveDef(obj) {
9137    if (obj.type === undefined || obj.selectors == undefined || obj.inputs === undefined) {
9138        throwError(`Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`);
9139    }
9140}
9141function assertIndexInDeclRange(lView, index) {
9142    const tView = lView[1];
9143    assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);
9144}
9145function assertIndexInVarsRange(lView, index) {
9146    const tView = lView[1];
9147    assertBetween(tView.bindingStartIndex, tView.expandoStartIndex, index);
9148}
9149function assertIndexInExpandoRange(lView, index) {
9150    const tView = lView[1];
9151    assertBetween(tView.expandoStartIndex, lView.length, index);
9152}
9153function assertBetween(lower, upper, index) {
9154    if (!(lower <= index && index < upper)) {
9155        throwError(`Index out of range (expecting ${lower} <= ${index} < ${upper})`);
9156    }
9157}
9158function assertProjectionSlots(lView, errMessage) {
9159    assertDefined(lView[DECLARATION_COMPONENT_VIEW], 'Component views should exist.');
9160    assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, errMessage ||
9161        'Components with projection nodes (<ng-content>) must have projection slots defined.');
9162}
9163function assertParentView(lView, errMessage) {
9164    assertDefined(lView, errMessage || 'Component views should always have a parent view (component\'s host view)');
9165}
9166/**
9167 * This is a basic sanity check that the `injectorIndex` seems to point to what looks like a
9168 * NodeInjector data structure.
9169 *
9170 * @param lView `LView` which should be checked.
9171 * @param injectorIndex index into the `LView` where the `NodeInjector` is expected.
9172 */
9173function assertNodeInjector(lView, injectorIndex) {
9174    assertIndexInExpandoRange(lView, injectorIndex);
9175    assertIndexInExpandoRange(lView, injectorIndex + 8 /* PARENT */);
9176    assertNumber(lView[injectorIndex + 0], 'injectorIndex should point to a bloom filter');
9177    assertNumber(lView[injectorIndex + 1], 'injectorIndex should point to a bloom filter');
9178    assertNumber(lView[injectorIndex + 2], 'injectorIndex should point to a bloom filter');
9179    assertNumber(lView[injectorIndex + 3], 'injectorIndex should point to a bloom filter');
9180    assertNumber(lView[injectorIndex + 4], 'injectorIndex should point to a bloom filter');
9181    assertNumber(lView[injectorIndex + 5], 'injectorIndex should point to a bloom filter');
9182    assertNumber(lView[injectorIndex + 6], 'injectorIndex should point to a bloom filter');
9183    assertNumber(lView[injectorIndex + 7], 'injectorIndex should point to a bloom filter');
9184    assertNumber(lView[injectorIndex + 8 /* PARENT */], 'injectorIndex should point to parent injector');
9185}
9186
9187/**
9188 * @license
9189 * Copyright Google LLC All Rights Reserved.
9190 *
9191 * Use of this source code is governed by an MIT-style license that can be
9192 * found in the LICENSE file at https://angular.io/license
9193 */
9194function getFactoryDef(type, throwNotFound) {
9195    const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);
9196    if (!hasFactoryDef && throwNotFound === true && ngDevMode) {
9197        throw new Error(`Type ${stringify(type)} does not have 'ɵfac' property.`);
9198    }
9199    return hasFactoryDef ? type[NG_FACTORY_DEF] : null;
9200}
9201
9202/**
9203 * @license
9204 * Copyright Google LLC All Rights Reserved.
9205 *
9206 * Use of this source code is governed by an MIT-style license that can be
9207 * found in the LICENSE file at https://angular.io/license
9208 */
9209/**
9210 * Represents a basic change from a previous to a new value for a single
9211 * property on a directive instance. Passed as a value in a
9212 * {@link SimpleChanges} object to the `ngOnChanges` hook.
9213 *
9214 * @see `OnChanges`
9215 *
9216 * @publicApi
9217 */
9218class SimpleChange {
9219    constructor(previousValue, currentValue, firstChange) {
9220        this.previousValue = previousValue;
9221        this.currentValue = currentValue;
9222        this.firstChange = firstChange;
9223    }
9224    /**
9225     * Check whether the new value is the first value assigned.
9226     */
9227    isFirstChange() {
9228        return this.firstChange;
9229    }
9230}
9231
9232/**
9233 * @license
9234 * Copyright Google LLC All Rights Reserved.
9235 *
9236 * Use of this source code is governed by an MIT-style license that can be
9237 * found in the LICENSE file at https://angular.io/license
9238 */
9239/**
9240 * The NgOnChangesFeature decorates a component with support for the ngOnChanges
9241 * lifecycle hook, so it should be included in any component that implements
9242 * that hook.
9243 *
9244 * If the component or directive uses inheritance, the NgOnChangesFeature MUST
9245 * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise
9246 * inherited properties will not be propagated to the ngOnChanges lifecycle
9247 * hook.
9248 *
9249 * Example usage:
9250 *
9251 * ```
9252 * static ɵcmp = defineComponent({
9253 *   ...
9254 *   inputs: {name: 'publicName'},
9255 *   features: [NgOnChangesFeature]
9256 * });
9257 * ```
9258 *
9259 * @codeGenApi
9260 */
9261function ɵɵNgOnChangesFeature() {
9262    return NgOnChangesFeatureImpl;
9263}
9264function NgOnChangesFeatureImpl(definition) {
9265    if (definition.type.prototype.ngOnChanges) {
9266        definition.setInput = ngOnChangesSetInput;
9267    }
9268    return rememberChangeHistoryAndInvokeOnChangesHook;
9269}
9270// This option ensures that the ngOnChanges lifecycle hook will be inherited
9271// from superclasses (in InheritDefinitionFeature).
9272/** @nocollapse */
9273// tslint:disable-next-line:no-toplevel-property-access
9274ɵɵNgOnChangesFeature.ngInherit = true;
9275/**
9276 * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate
9277 * `ngOnChanges`.
9278 *
9279 * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are
9280 * found it invokes `ngOnChanges` on the component instance.
9281 *
9282 * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`,
9283 *     it is guaranteed to be called with component instance.
9284 */
9285function rememberChangeHistoryAndInvokeOnChangesHook() {
9286    const simpleChangesStore = getSimpleChangesStore(this);
9287    const current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current;
9288    if (current) {
9289        const previous = simpleChangesStore.previous;
9290        if (previous === EMPTY_OBJ) {
9291            simpleChangesStore.previous = current;
9292        }
9293        else {
9294            // New changes are copied to the previous store, so that we don't lose history for inputs
9295            // which were not changed this time
9296            for (let key in current) {
9297                previous[key] = current[key];
9298            }
9299        }
9300        simpleChangesStore.current = null;
9301        this.ngOnChanges(current);
9302    }
9303}
9304function ngOnChangesSetInput(instance, value, publicName, privateName) {
9305    const simpleChangesStore = getSimpleChangesStore(instance) ||
9306        setSimpleChangesStore(instance, { previous: EMPTY_OBJ, current: null });
9307    const current = simpleChangesStore.current || (simpleChangesStore.current = {});
9308    const previous = simpleChangesStore.previous;
9309    const declaredName = this.declaredInputs[publicName];
9310    const previousChange = previous[declaredName];
9311    current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);
9312    instance[privateName] = value;
9313}
9314const SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';
9315function getSimpleChangesStore(instance) {
9316    return instance[SIMPLE_CHANGES_STORE] || null;
9317}
9318function setSimpleChangesStore(instance, store) {
9319    return instance[SIMPLE_CHANGES_STORE] = store;
9320}
9321
9322/**
9323 * @license
9324 * Copyright Google LLC All Rights Reserved.
9325 *
9326 * Use of this source code is governed by an MIT-style license that can be
9327 * found in the LICENSE file at https://angular.io/license
9328 */
9329let profilerCallback = null;
9330/**
9331 * Sets the callback function which will be invoked before and after performing certain actions at
9332 * runtime (for example, before and after running change detection).
9333 *
9334 * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
9335 * The contract of the function might be changed in any release and/or the function can be removed
9336 * completely.
9337 *
9338 * @param profiler function provided by the caller or null value to disable profiling.
9339 */
9340const setProfiler = (profiler) => {
9341    profilerCallback = profiler;
9342};
9343/**
9344 * Profiler function which wraps user code executed by the runtime.
9345 *
9346 * @param event ProfilerEvent corresponding to the execution context
9347 * @param instance component instance
9348 * @param hookOrListener lifecycle hook function or output listener. The value depends on the
9349 *  execution context
9350 * @returns
9351 */
9352const profiler = function (event, instance, hookOrListener) {
9353    if (profilerCallback != null /* both `null` and `undefined` */) {
9354        profilerCallback(event, instance, hookOrListener);
9355    }
9356};
9357
9358/**
9359 * @license
9360 * Copyright Google LLC All Rights Reserved.
9361 *
9362 * Use of this source code is governed by an MIT-style license that can be
9363 * found in the LICENSE file at https://angular.io/license
9364 */
9365const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
9366const MATH_ML_NAMESPACE = 'http://www.w3.org/1998/MathML/';
9367
9368/**
9369 * @license
9370 * Copyright Google LLC All Rights Reserved.
9371 *
9372 * Use of this source code is governed by an MIT-style license that can be
9373 * found in the LICENSE file at https://angular.io/license
9374 */
9375/**
9376 * This property will be monkey-patched on elements, components and directives
9377 */
9378const MONKEY_PATCH_KEY_NAME = '__ngContext__';
9379
9380/**
9381 * @license
9382 * Copyright Google LLC All Rights Reserved.
9383 *
9384 * Use of this source code is governed by an MIT-style license that can be
9385 * found in the LICENSE file at https://angular.io/license
9386 */
9387/**
9388 * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
9389 * inject the `DOCUMENT` token and are done.
9390 *
9391 * Ivy is special because it does not rely upon the DI and must get hold of the document some other
9392 * way.
9393 *
9394 * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
9395 * Wherever ivy needs the global document, it calls `getDocument()` instead.
9396 *
9397 * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
9398 * tell ivy what the global `document` is.
9399 *
9400 * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
9401 * by calling `setDocument()` when providing the `DOCUMENT` token.
9402 */
9403let DOCUMENT = undefined;
9404/**
9405 * Tell ivy what the `document` is for this platform.
9406 *
9407 * It is only necessary to call this if the current platform is not a browser.
9408 *
9409 * @param document The object representing the global `document` in this environment.
9410 */
9411function setDocument(document) {
9412    DOCUMENT = document;
9413}
9414/**
9415 * Access the object that represents the `document` for this platform.
9416 *
9417 * Ivy calls this whenever it needs to access the `document` object.
9418 * For example to create the renderer or to do sanitization.
9419 */
9420function getDocument() {
9421    if (DOCUMENT !== undefined) {
9422        return DOCUMENT;
9423    }
9424    else if (typeof document !== 'undefined') {
9425        return document;
9426    }
9427    // No "document" can be found. This should only happen if we are running iv
9427y outside Angular and
9428    // the current platform is not a browser. Since this is not a supported scenario at the moment
9429    // this should not happen in Angular apps.
9430    // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
9431    // public API. Meanwhile we just return `undefined` and let the application fail.
9432    return undefined;
9433}
9434
9435/**
9436 * @license
9437 * Copyright Google LLC All Rights Reserved.
9438 *
9439 * Use of this source code is governed by an MIT-style license that can be
9440 * found in the LICENSE file at https://angular.io/license
9441 */
9442// TODO: cleanup once the code is merged in angular/angular
9443var RendererStyleFlags3;
9444(function (RendererStyleFlags3) {
9445    RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
9446    RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
9447})(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
9448/** Returns whether the `renderer` is a `ProceduralRenderer3` */
9449function isProceduralRenderer(renderer) {
9450    return !!(renderer.listen);
9451}
9452const ɵ0 = (hostElement, rendererType) => {
9453    return getDocument();
9454};
9455const domRendererFactory3 = {
9456    createRenderer: ɵ0
9457};
9458// Note: This hack is necessary so we don't erroneously get a circular dependency
9459// failure based on types.
9460const unusedValueExportToPlacateAjd$2 = 1;
9461
9462/**
9463 * @license
9464 * Copyright Google LLC All Rights Reserved.
9465 *
9466 * Use of this source code is governed by an MIT-style license that can be
9467 * found in the LICENSE file at https://angular.io/license
9468 */
9469/**
9470 * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)
9471 * in same location in `LView`. This is because we don't want to pre-allocate space for it
9472 * because the storage is sparse. This file contains utilities for dealing with such data types.
9473 *
9474 * How do we know what is stored at a given location in `LView`.
9475 * - `Array.isArray(value) === false` => `RNode` (The normal storage value)
9476 * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.
9477 *   - `typeof value[TYPE] === 'object'` => `LView`
9478 *      - This happens when we have a component at a given location
9479 *   - `typeof value[TYPE] === true` => `LContainer`
9480 *      - This happens when we have `LContainer` binding at a given location.
9481 *
9482 *
9483 * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.
9484 */
9485/**
9486 * Returns `RNode`.
9487 * @param value wrapped value of `RNode`, `LView`, `LContainer`
9488 */
9489function unwrapRNode(value) {
9490    while (Array.isArray(value)) {
9491        value = value[HOST];
9492    }
9493    return value;
9494}
9495/**
9496 * Returns `LView` or `null` if not found.
9497 * @param value wrapped value of `RNode`, `LView`, `LContainer`
9498 */
9499function unwrapLView(value) {
9500    while (Array.isArray(value)) {
9501        // This check is same as `isLView()` but we don't call at as we don't want to call
9502        // `Array.isArray()` twice and give JITer more work for inlining.
9503        if (typeof value[TYPE] === 'object')
9504            return value;
9505        value = value[HOST];
9506    }
9507    return null;
9508}
9509/**
9510 * Returns `LContainer` or `null` if not found.
9511 * @param value wrapped value of `RNode`, `LView`, `LContainer`
9512 */
9513function unwrapLContainer(value) {
9514    while (Array.isArray(value)) {
9515        // This check is same as `isLContainer()` but we don't call at as we don't want to call
9516        // `Array.isArray()` twice and give JITer more work for inlining.
9517        if (value[TYPE] === true)
9518            return value;
9519        value = value[HOST];
9520    }
9521    return null;
9522}
9523/**
9524 * Retrieves an element value from the provided `viewData`, by unwrapping
9525 * from any containers, component views, or style contexts.
9526 */
9527function getNativeByIndex(index, lView) {
9528    ngDevMode && assertIndexInRange(lView, index);
9529    ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Expected to be past HEADER_OFFSET');
9530    return unwrapRNode(lView[index]);
9531}
9532/**
9533 * Retrieve an `RNode` for a given `TNode` and `LView`.
9534 *
9535 * This function guarantees in dev mode to retrieve a non-null `RNode`.
9536 *
9537 * @param tNode
9538 * @param lView
9539 */
9540function getNativeByTNode(tNode, lView) {
9541    ngDevMode && assertTNodeForLView(tNode, lView);
9542    ngDevMode && assertIndexInRange(lView, tNode.index);
9543    const node = unwrapRNode(lView[tNode.index]);
9544    ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
9545    return node;
9546}
9547/**
9548 * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.
9549 *
9550 * Some `TNode`s don't have associated `RNode`s. For example `Projection`
9551 *
9552 * @param tNode
9553 * @param lView
9554 */
9555function getNativeByTNodeOrNull(tNode, lView) {
9556    const index = tNode === null ? -1 : tNode.index;
9557    if (index !== -1) {
9558        ngDevMode && assertTNodeForLView(tNode, lView);
9559        const node = unwrapRNode(lView[index]);
9560        ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
9561        return node;
9562    }
9563    return null;
9564}
9565// fixme(misko): The return Type should be `TNode|null`
9566function getTNode(tView, index) {
9567    ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');
9568    ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');
9569    const tNode = tView.data[index];
9570    ngDevMode && tNode !== null && assertTNode(tNode);
9571    return tNode;
9572}
9573/** Retrieves a value from any `LView` or `TData`. */
9574function load(view, index) {
9575    ngDevMode && assertIndexInRange(view, index);
9576    return view[index];
9577}
9578function getComponentLViewByIndex(nodeIndex, hostView) {
9579    // Could be an LView or an LContainer. If LContainer, unwrap to find LView.
9580    ngDevMode && assertIndexInRange(hostView, nodeIndex);
9581    const slotValue = hostView[nodeIndex];
9582    const lView = isLView(slotValue) ? slotValue : slotValue[HOST];
9583    return lView;
9584}
9585/**
9586 * Returns the monkey-patch value data present on the target (which could be
9587 * a component, directive or a DOM node).
9588 */
9589function readPatchedData(target) {
9590    ngDevMode && assertDefined(target, 'Target expected');
9591    return target[MONKEY_PATCH_KEY_NAME] || null;
9592}
9593function readPatchedLView(target) {
9594    const value = readPatchedData(target);
9595    if (value) {
9596        return Array.isArray(value) ? value : value.lView;
9597    }
9598    return null;
9599}
9600/** Checks whether a given view is in creation mode */
9601function isCreationMode(view) {
9602    return (view[FLAGS] & 4 /* CreationMode */) === 4 /* CreationMode */;
9603}
9604/**
9605 * Returns a boolean for whether the view is attached to the change detection tree.
9606 *
9607 * Note: This determines whether a view should be checked, not whether it's inserted
9608 * into a container. For that, you'll want `viewAttachedToContainer` below.
9609 */
9610function viewAttachedToChangeDetector(view) {
9611    return (view[FLAGS] & 128 /* Attached */) === 128 /* Attached */;
9612}
9613/** Returns a boolean for whether the view is attached to a container. */
9614function viewAttachedToContainer(view) {
9615    return isLContainer(view[PARENT]);
9616}
9617function getConstant(consts, index) {
9618    if (index === null || index === undefined)
9619        return null;
9620    ngDevMode && assertIndexInRange(consts, index);
9621    return consts[index];
9622}
9623/**
9624 * Resets the pre-order hook flags of the view.
9625 * @param lView the LView on which the flags are reset
9626 */
9627function resetPreOrderHookFlags(lView) {
9628    lView[PREORDER_HOOK_FLAGS] = 0;
9629}
9630/**
9631 * Updates the `TRANSPLANTED_VIEWS_TO_REFRESH` counter on the `LContainer` as well as the parents
9632 * whose
9633 *  1. counter goes from 0 to 1, indicating that there is a new child that has a view to refresh
9634 *  or
9635 *  2. counter goes from 1 to 0, indicating there are no more descendant views to refresh
9636 */
9637function updateTransplantedViewCount(lContainer, amount) {
9638    lContainer[TRANSPLANTED_VIEWS_TO_REFRESH] += amount;
9639    let viewOrContainer = lContainer;
9640    let parent = lContainer[PARENT];
9641    while (parent !== null &&
9642        ((amount === 1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 1) ||
9643            (amount === -1 && viewOrContainer[TRANSPLANTED_VIEWS_TO_REFRESH] === 0))) {
9644        parent[TRANSPLANTED_VIEWS_TO_REFRESH] += amount;
9645        viewOrContainer = parent;
9646        parent = parent[PARENT];
9647    }
9648}
9649
9650/**
9651 * @license
9652 * Copyright Google LLC All Rights Reserved.
9653 *
9654 * Use of this source code is governed by an MIT-style license that can be
9655 * found in the LICENSE file at https://angular.io/license
9656 */
9657const instructionState = {
9658    lFrame: createLFrame(null),
9659    bindingsEnabled: true,
9660    isInCheckNoChangesMode: false,
9661};
9662/**
9663 * Returns true if the instruction state stack is empty.
9664 *
9665 * Intended to be called from tests only (tree shaken otherwise).
9666 */
9667function specOnlyIsInstructionStateEmpty() {
9668    return instructionState.lFrame.parent === null;
9669}
9670function getElementDepthCount() {
9671    return instructionState.lFrame.elementDepthCount;
9672}
9673function increaseElementDepthCount() {
9674    instructionState.lFrame.elementDepthCount++;
9675}
9676function decreaseElementDepthCount() {
9677    instructionState.lFrame.elementDepthCount--;
9678}
9679function getBindingsEnabled() {
9680    return instructionState.bindingsEnabled;
9681}
9682/**
9683 * Enables directive matching on elements.
9684 *
9685 *  * Example:
9686 * ```
9687 * <my-comp my-directive>
9688 *   Should match component / directive.
9689 * </my-comp>
9690 * <div ngNonBindable>
9691 *   <!-- ɵɵdisableBindings() -->
9692 *   <my-comp my-directive>
9693 *     Should not match component / directive because we are in ngNonBindable.
9694 *   </my-comp>
9695 *   <!-- ɵɵenableBindings() -->
9696 * </div>
9697 * ```
9698 *
9699 * @codeGenApi
9700 */
9701function ɵɵenableBindings() {
9702    instructionState.bindingsEnabled = true;
9703}
9704/**
9705 * Disables directive matching on element.
9706 *
9707 *  * Example:
9708 * ```
9709 * <my-comp my-directive>
9710 *   Should match component / directive.
9711 * </my-comp>
9712 * <div ngNonBindable>
9713 *   <!-- ɵɵdisableBindings() -->
9714 *   <my-comp my-directive>
9715 *     Should not match component / directive because we are in ngNonBindable.
9716 *   </my-comp>
9717 *   <!-- ɵɵenableBindings() -->
9718 * </div>
9719 * ```
9720 *
9721 * @codeGenApi
9722 */
9723function ɵɵdisableBindings() {
9724    instructionState.bindingsEnabled = false;
vendor: 5,958 bytes, lines 9725-9891
9725}
9726/**
9727 * Return the current `LView`.
9728 */
9729function getLView() {
9730    return instructionState.lFrame.lView;
9731}
9732/**
9733 * Return the current `TView`.
9734 */
9735function getTView() {
9736    return instructionState.lFrame.tView;
9737}
9738/**
9739 * Restores `contextViewData` to the given OpaqueViewState instance.
9740 *
9741 * Used in conjunction with the getCurrentView() instruction to save a snapshot
9742 * of the current view and restore it when listeners are invoked. This allows
9743 * walking the declaration view tree in listeners to get vars from parent views.
9744 *
9745 * @param viewToRestore The OpaqueViewState instance to restore.
9746 *
9747 * @codeGenApi
9748 */
9749function ɵɵrestoreView(viewToRestore) {
9750    instructionState.lFrame.contextLView = viewToRestore;
9751}
9752function getCurrentTNode() {
9753    let currentTNode = getCurrentTNodePlaceholderOk();
9754    while (currentTNode !== null && currentTNode.type === 64 /* Placeholder */) {
9755        currentTNode = currentTNode.parent;
9756    }
9757    return currentTNode;
9758}
9759function getCurrentTNodePlaceholderOk() {
9760    return instructionState.lFrame.currentTNode;
9761}
9762function getCurrentParentTNode() {
9763    const lFrame = instructionState.lFrame;
9764    const currentTNode = lFrame.currentTNode;
9765    return lFrame.isParent ? currentTNode : currentTNode.parent;
9766}
9767function setCurrentTNode(tNode, isParent) {
9768    ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView);
9769    const lFrame = instructionState.lFrame;
9770    lFrame.currentTNode = tNode;
9771    lFrame.isParent = isParent;
9772}
9773function isCurrentTNodeParent() {
9774    return instructionState.lFrame.isParent;
9775}
9776function setCurrentTNodeAsNotParent() {
9777    instructionState.lFrame.isParent = false;
9778}
9779function setCurrentTNodeAsParent() {
9780    instructionState.lFrame.isParent = true;
9781}
9782function getContextLView() {
9783    return instructionState.lFrame.contextLView;
9784}
9785function isInCheckNoChangesMode() {
9786    // TODO(misko): remove this from the LView since it is ngDevMode=true mode only.
9787    return instructionState.isInCheckNoChangesMode;
9788}
9789function setIsInCheckNoChangesMode(mode) {
9790    instructionState.isInCheckNoChangesMode = mode;
9791}
9792// top level variables should not be exported for performance reasons (PERF_NOTES.md)
9793function getBindingRoot() {
9794    const lFrame = instructionState.lFrame;
9795    let index = lFrame.bindingRootIndex;
9796    if (index === -1) {
9797        index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;
9798    }
9799    return index;
9800}
9801function getBindingIndex() {
9802    return instructionState.lFrame.bindingIndex;
9803}
9804function setBindingIndex(value) {
9805    return instructionState.lFrame.bindingIndex = value;
9806}
9807function nextBindingIndex() {
9808    return instructionState.lFrame.bindingIndex++;
9809}
9810function incrementBindingIndex(count) {
9811    const lFrame = instructionState.lFrame;
9812    const index = lFrame.bindingIndex;
9813    lFrame.bindingIndex = lFrame.bindingIndex + count;
9814    return index;
9815}
9816function isInI18nBlock() {
9817    return instructionState.lFrame.inI18n;
9818}
9819function setInI18nBlock(isInI18nBlock) {
9820    instructionState.lFrame.inI18n = isInI18nBlock;
9821}
9822/**
9823 * Set a new binding root index so that host template functions can execute.
9824 *
9825 * Bindings inside the host template are 0 index. But because we don't know ahead of time
9826 * how many host bindings we have we can't pre-compute them. For this reason they are all
9827 * 0 index and we just shift the root so that they match next available location in the LView.
9828 *
9829 * @param bindingRootIndex Root index for `hostBindings`
9830 * @param currentDirectiveIndex `TData[currentDirectiveIndex]` will point to the current directive
9831 *        whose `hostBindings` are being processed.
9832 */
9833function setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) {
9834    const lFrame = instructionState.lFrame;
9835    lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex;
9836    setCurrentDirectiveIndex(currentDirectiveIndex);
9837}
9838/**
9839 * When host binding is executing this points to the directive index.
9840 * `TView.data[getCurrentDirectiveIndex()]` is `DirectiveDef`
9841 * `LView[getCurrentDirectiveIndex()]` is directive instance.
9842 */
9843function getCurrentDirectiveIndex() {
9844    return instructionState.lFrame.currentDirectiveIndex;
9845}
9846/**
9847 * Sets an index of a directive whose `hostBindings` are being processed.
9848 *
9849 * @param currentDirectiveIndex `TData` index where current directive instance can be found.
9850 */
9851function setCurrentDirectiveIndex(currentDirectiveIndex) {
9852    instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex;
9853}
9854/**
9855 * Retrieve the current `DirectiveDef` which is active when `hostBindings` instruction is being
9856 * executed.
9857 *
9858 * @param tData Current `TData` where the `DirectiveDef` will be looked up at.
9859 */
9860function getCurrentDirectiveDef(tData) {
9861    const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;
9862    return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];
9863}
9864function getCurrentQueryIndex() {
9865    return instructionState.lFrame.currentQueryIndex;
9866}
9867function setCurrentQueryIndex(value) {
9868    instructionState.lFrame.currentQueryIndex = value;
9869}
9870/**
9871 * Returns a `TNode` of the location where the current `LView` is declared at.
9872 *
9873 * @param lView an `LView` that we want to find parent `TNode` for.
9874 */
9875function getDeclarationTNode(lView) {
9876    const tView = lView[TVIEW];
9877    // Return the declaration parent for embedded views
9878    if (tView.type === 2 /* Embedded */) {
9879        ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');
9880        return tView.declTNode;
9881    }
9882    // Components don't have `TView.declTNode` because each instance of component could be
9883    // inserted in different location, hence `TView.declTNode` is meaningless.
9884    // Falling back to `T_HOST` in case we cross component boundary.
9885    if (tView.type === 1 /* Component */) {
9886        return lView[T_HOST];
9887    }
9888    // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode.
9889    return null;
9890}
9891/**
9892 * This is a light weight version of the `enterView` which is needed by the DI system.
9893 *
9894 * @param lView `LView` location of the DI context.
9895 * @param tNode `TNode` for DI context
9896 * @param flags DI context flags. if `SkipSelf` flag is set than we walk up the declaration
9897 *     tree from `tNode`  until we find parent declared `TElementNode`.
9898 * @returns `true` if we have successfully entered DI associated with `tNode` (or with declared
9899 *     `TNode` if `flags` has  `SkipSelf`). Failing to enter DI implies that no associated
9900 *     `NodeInjector` can be found and we should instead use `ModuleInjector`.
9901 *     - If `true` than this call must be fallowed by `leaveDI`
9902 *     - If `false` than this call failed and we should NOT call `leaveDI`
9903 */
9904function enterDI(lView, tNode, flags) {
9905    ngDevMode && assertLViewOrUndefined(lView);
9906    if (flags & InjectFlags.SkipSelf) {
9907        ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]);
9908        let parentTNode = tNode;
9909        let parentLView = lView;
9910        while (true) {
9911            ngDevMode && assertDefined(parentTNode, 'Parent TNode should be defined');
9912            parentTNode = parentTNode.parent;
9913            if (parentTNode === null && !(flags & InjectFlags.Host)) {
9914                parentTNode = getDeclarationTNode(parentLView);
9915                if (parentTNode === null)
9916                    break;
9917                // In this case, a parent exists and is definitely an element. So it will definitely
9918                // have an existing lView as the declaration view, which is why we can assume it's defined.
9919                ngDevMode && assertDefined(parentLView, 'Parent LView should be defined');
9920                parentLView = parentLView[DECLARATION_VIEW];
9921                // In Ivy there are Comment nodes that correspond to ngIf and NgFor embedded directives
9922                // We want to skip those and look only at Elements and ElementContainers to ensure
9923                // we're looking at true parent nodes, and not content or other types.
9924                if (parentTNode.type & (2 /* Element */ | 8 /* ElementContainer */)) {
9925                    break;
9926                }
9927            }
9928            else {
9929                break;
9930            }
9931        }
9932        if (parentTNode === null) {
9933            // If we failed to find a parent TNode this means that we should use module injector.
9934            return false;
9935        }
9936        else {
9937            tNode = parentTNode;
9938            lView = parentLView;
9939        }
9940    }
9941    ngDevMode && assertTNodeForLView(tNode, lView);
9942    const lFrame = instructionState.lFrame = allocLFrame();
9943    lFrame.currentTNode = tNode;
9944    lFrame.lView = lView;
9945    return true;
9946}
9947/**
9948 * Swap the current lView with a new lView.
9949 *
9950 * For performance reasons we store the lView in the top level of the module.
9951 * This way we minimize the number of properties to read. Whenever a new view
9952 * is entered we have to store the lView for later, and when the view is
9953 * exited the state has to be restored
9954 *
9955 * @param newView New lView to become active
9956 * @returns the previously active lView;
9957 */
9958function enterView(newView) {
9959    ngDevMode && assertNotEqual(newView[0], newView[1], '????');
9960    ngDevMode && assertLViewOrUndefined(newView);
9961    const newLFrame = allocLFrame();
9962    if (ngDevMode) {
9963        assertEqual(newLFrame.isParent, true, 'Expected clean LFrame');
9964        assertEqual(newLFrame.lView, null, 'Expected clean LFrame');
9965        assertEqual(newLFrame.tView, null, 'Expected clean LFrame');
9966        assertEqual(newLFrame.selectedIndex, -1, 'Expected clean LFrame');
9967        assertEqual(newLFrame.elementDepthCount, 0, 'Expected clean LFrame');
9968        assertEqual(newLFrame.currentDirectiveIndex, -1, 'Expected clean LFrame');
9969        assertEqual(newLFrame.currentNamespace, null, 'Expected clean LFrame');
9970        assertEqual(newLFrame.bindingRootIndex, -1, 'Expected clean LFrame');
9971        assertEqual(newLFrame.currentQueryIndex, 0, 'Expected clean LFrame');
9972    }
9973    const tView = newView[TVIEW];
9974    instructionState.lFrame = newLFrame;
9975    ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView);
9976    newLFrame.currentTNode = tView.firstChild;
9977    newLFrame.lView = newView;
9978    newLFrame.tView = tView;
9979    newLFrame.contextLView = newView;
9980    newLFrame.bindingIndex = tView.bindingStartIndex;
9981    newLFrame.inI18n = false;
vendor: 5,686 bytes, lines 9982-10152
9982}
9983/**
9984 * Allocates next free LFrame. This function tries to reuse the `LFrame`s to lower memory pressure.
9985 */
9986function allocLFrame() {
9987    const currentLFrame = instructionState.lFrame;
9988    const childLFrame = currentLFrame === null ? null : currentLFrame.child;
9989    const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame;
9990    return newLFrame;
9991}
9992function createLFrame(parent) {
9993    const lFrame = {
9994        currentTNode: null,
9995        isParent: true,
9996        lView: null,
9997        tView: null,
9998        selectedIndex: -1,
9999        contextLView: null,
10000        elementDepthCount: 0,
10001        currentNamespace: null,
10002        currentDirectiveIndex: -1,
10003        bindingRootIndex: -1,
10004        bindingIndex: -1,
10005        currentQueryIndex: 0,
10006        parent: parent,
10007        child: null,
10008        inI18n: false,
10009    };
10010    parent !== null && (parent.child = lFrame); // link the new LFrame for reuse.
10011    return lFrame;
10012}
10013/**
10014 * A lightweight version of leave which is used with DI.
10015 *
10016 * This function only resets `currentTNode` and `LView` as those are the only properties
10017 * used with DI (`enterDI()`).
10018 *
10019 * NOTE: This function is reexported as `leaveDI`. However `leaveDI` has return type of `void` where
10020 * as `leaveViewLight` has `LFrame`. This is so that `leaveViewLight` can be used in `leaveView`.
10021 */
10022function leaveViewLight() {
10023    const oldLFrame = instructionState.lFrame;
10024    instructionState.lFrame = oldLFrame.parent;
10025    oldLFrame.currentTNode = null;
10026    oldLFrame.lView = null;
10027    return oldLFrame;
10028}
10029/**
10030 * This is a lightweight version of the `leaveView` which is needed by the DI system.
10031 *
10032 * NOTE: this function is an alias so that we can change the type of the function to have `void`
10033 * return type.
10034 */
10035const leaveDI = leaveViewLight;
10036/**
10037 * Leave the current `LView`
10038 *
10039 * This pops the `LFrame` with the associated `LView` from the stack.
10040 *
10041 * IMPORTANT: We must zero out the `LFrame` values here otherwise they will be retained. This is
10042 * because for performance reasons we don't release `LFrame` but rather keep it for next use.
10043 */
10044function leaveView() {
10045    const oldLFrame = leaveViewLight();
10046    oldLFrame.isParent = true;
10047    oldLFrame.tView = null;
10048    oldLFrame.selectedIndex = -1;
10049    oldLFrame.contextLView = null;
10050    oldLFrame.elementDepthCount = 0;
10051    oldLFrame.currentDirectiveIndex = -1;
10052    oldLFrame.currentNamespace = null;
10053    oldLFrame.bindingRootIndex = -1;
10054    oldLFrame.bindingIndex = -1;
10055    oldLFrame.currentQueryIndex = 0;
10056}
10057function nextContextImpl(level) {
10058    const contextLView = instructionState.lFrame.contextLView =
10059        walkUpViews(level, instructionState.lFrame.contextLView);
10060    return contextLView[CONTEXT];
10061}
10062function walkUpViews(nestingLevel, currentView) {
10063    while (nestingLevel > 0) {
10064        ngDevMode &&
10065            assertDefined(currentView[DECLARATION_VIEW], 'Declaration view should be defined if nesting level is greater than 0.');
10066        currentView = currentView[DECLARATION_VIEW];
10067        nestingLevel--;
10068    }
10069    return currentView;
10070}
10071/**
10072 * Gets the currently selected element index.
10073 *
10074 * Used with {@link property} instruction (and more in the future) to identify the index in the
10075 * current `LView` to act on.
10076 */
10077function getSelectedIndex() {
10078    return instructionState.lFrame.selectedIndex;
10079}
10080/**
10081 * Sets the most recent index passed to {@link select}
10082 *
10083 * Used with {@link property} instruction (and more in the future) to identify the index in the
10084 * current `LView` to act on.
10085 *
10086 * (Note that if an "exit function" was set earlier (via `setElementExitFn()`) then that will be
10087 * run if and when the provided `index` value is different from the current selected index value.)
10088 */
10089function setSelectedIndex(index) {
10090    ngDevMode && index !== -1 &&
10091        assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Index must be past HEADER_OFFSET (or -1).');
10092    ngDevMode &&
10093        assertLessThan(index, instructionState.lFrame.lView.length, 'Can\'t set index passed end of LView');
10094    instructionState.lFrame.selectedIndex = index;
10095}
10096/**
10097 * Gets the `tNode` that represents currently selected element.
10098 */
10099function getSelectedTNode() {
10100    const lFrame = instructionState.lFrame;
10101    return getTNode(lFrame.tView, lFrame.selectedIndex);
10102}
10103/**
10104 * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.
10105 *
10106 * @codeGenApi
10107 */
10108function ɵɵnamespaceSVG() {
10109    instructionState.lFrame.currentNamespace = SVG_NAMESPACE;
10110}
10111/**
10112 * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.
10113 *
10114 * @codeGenApi
10115 */
10116function ɵɵnamespaceMathML() {
10117    instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;
10118}
10119/**
10120 * Sets the namespace used to create elements to `null`, which forces element creation to use
10121 * `createElement` rather than `createElementNS`.
10122 *
10123 * @codeGenApi
10124 */
10125function ɵɵnamespaceHTML() {
10126    namespaceHTMLInternal();
10127}
10128/**
10129 * Sets the namespace used to create elements to `null`, which forces element creation to use
10130 * `createElement` rather than `createElementNS`.
10131 */
10132function namespaceHTMLInternal() {
10133    instructionState.lFrame.currentNamespace = null;
10134}
10135function getNamespace() {
10136    return instructionState.lFrame.currentNamespace;
10137}
10138
10139/**
10140 * @license
10141 * Copyright Google LLC All Rights Reserved.
10142 *
10143 * Use of this source code is governed by an MIT-style license that can be
10144 * found in the LICENSE file at https://angular.io/license
10145 */
10146/**
10147 * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.
10148 *
10149 * Must be run *only* on the first template pass.
10150 *
10151 * Sets up the pre-order hooks on the provided `tView`,
10152 * see {@link HookData}
10152 for details about the data structure.
10153 *
10154 * @param directiveIndex The index of the directive in LView
10155 * @param directiveDef The definition containing the hooks to setup in tView
10156 * @param tView The current TView
10157 */
10158function registerPreOrderHooks(directiveIndex, directiveDef, tView) {
10159    ngDevMode && assertFirstCreatePass(tView);
10160    const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype;
10161    if (ngOnChanges) {
10162        const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);
10163        (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges);
10164        (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = []))
10165            .push(directiveIndex, wrappedOnChanges);
10166    }
10167    if (ngOnInit) {
10168        (tView.preOrderHooks || (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit);
10169    }
10170    if (ngDoCheck) {
10171        (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck);
10172        (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck);
10173    }
10174}
10175/**
10176 *
10177 * Loops through the directives on the provided `tNode` and queues hooks to be
10178 * run that are not initialization hooks.
10179 *
10180 * Should be executed during `elementEnd()` and similar to
10181 * preserve hook execution order. Content, view, and destroy hooks for projected
10182 * components and directives must be called *before* their hosts.
10183 *
10184 * Sets up the content, view, and destroy hooks on the provided `tView`,
10185 * see {@link HookData} for details about the data structure.
10186 *
10187 * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up
10188 * separately at `elementStart`.
10189 *
10190 * @param tView The current TView
10191 * @param tNode The TNode whose directives are to be searched for hooks to queue
10192 */
10193function registerPostOrderHooks(tView, tNode) {
10194    ngDevMode && assertFirstCreatePass(tView);
10195    // It's necessary to loop through the directives at elementEnd() (rather than processing in
10196    // directiveCreate) so we can preserve the current hook order. Content, view, and destroy
10197    // hooks for projected components and directives must be called *before* their hosts.
10198    for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {
10199        const directiveDef = tView.data[i];
10200        ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');
10201        const lifecycleHooks = directiveDef.type.prototype;
10202        const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy } = lifecycleHooks;
10203        if (ngAfterContentInit) {
10204            (tView.contentHooks || (tView.contentHooks = [])).push(-i, ngAfterContentInit);
10205        }
10206        if (ngAfterContentChecked) {
10207            (tView.contentHooks || (tView.contentHooks = [])).push(i, ngAfterContentChecked);
10208            (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked);
10209        }
10210        if (ngAfterViewInit) {
10211            (tView.viewHooks || (tView.viewHooks = [])).push(-i, ngAfterViewInit);
10212        }
10213        if (ngAfterViewChecked) {
10214            (tView.viewHooks || (tView.viewHooks = [])).push(i, ngAfterViewChecked);
10215            (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked);
10216        }
10217        if (ngOnDestroy != null) {
10218            (tView.destroyHooks || (tView.destroyHooks = [])).push(i, ngOnDestroy);
10219        }
10220    }
10221}
10222/**
10223 * Executing hooks requires complex logic as we need to deal with 2 constraints.
10224 *
10225 * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only
10226 * once, across many change detection cycles. This must be true even if some hooks throw, or if
10227 * some recursively trigger a change detection cycle.
10228 * To solve that, it is required to track the state of the execution of these init hooks.
10229 * This is done by storing and maintaining flags in the view: the {@link InitPhaseState},
10230 * and the index within that phase. They can be seen as a cursor in the following structure:
10231 * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]]
10232 * They are are stored as flags in LView[FLAGS].
10233 *
10234 * 2. Pre-order hooks can be executed in batches, because of the select instruction.
10235 * To be able to pause and resume their execution, we also need some state about the hook's array
10236 * that is being processed:
10237 * - the index of the next hook to be executed
10238 * - the number of init hooks already found in the processed part of the  array
10239 * They are are stored as flags in LView[PREORDER_HOOK_FLAGS].
10240 */
10241/**
10242 * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were
10243 * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read
10244 * / write of the init-hooks related flags.
10245 * @param lView The LView where hooks are defined
10246 * @param hooks Hooks to be run
10247 * @param nodeIndex 3 cases depending on the value:
10248 * - undefined: all hooks from the array should be executed (post-order case)
10249 * - null: execute hooks only from the saved index until the end of the array (pre-order case, when
10250 * flushing the remaining hooks)
10251 * - number: execute hooks only from the saved index until that node index exclusive (pre-order
10252 * case, when executing select(number))
10253 */
10254function executeCheckHooks(lView, hooks, nodeIndex) {
10255    callHooks(lView, hooks, 3 /* InitPhaseCompleted */, nodeIndex);
10256}
10257/**
10258 * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,
10259 * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.
10260 * @param lView The LView where hooks are defined
10261 * @param hooks Hooks to be run
10262 * @param initPhase A phase for which hooks should be run
10263 * @param nodeIndex 3 cases depending on the value:
10264 * - undefined: all hooks from the array should be executed (post-order case)
10265 * - null: execute hooks only from the saved index until the end of the array (pre-order case, when
10266 * flushing the remaining hooks)
10267 * - number: execute hooks only from the saved index until that node index exclusive (pre-order
10268 * case, when executing select(number))
10269 */
10270function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {
10271    ngDevMode &&
10272        assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');
10273    if ((lView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) {
10274        callHooks(lView, hooks, initPhase, nodeIndex);
10275    }
10276}
10277function incrementInitPhaseFlags(lView, initPhase) {
10278    ngDevMode &&
10279        assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');
10280    let flags = lView[FLAGS];
10281    if ((flags & 3 /* InitPhaseStateMask */) === initPhase) {
10282        flags &= 2047 /* IndexWithinInitPhaseReset */;
10283        flags += 1 /* InitPhaseStateIncrementer */;
10284        lView[FLAGS] = flags;
10285    }
10286}
10287/**
10288 * Calls lifecycle hooks with their contexts, skipping init hooks if it's not
10289 * the first LView pass
10290 *
10291 * @param currentView The current view
10292 * @param arr The array in which the hooks are found
10293 * @param initPhaseState the current state of the init phase
10294 * @param currentNodeIndex 3 cases depending on the value:
10295 * - undefined: all hooks from the array should be executed (post-order case)
10296 * - null: execute hooks only from the saved index until the end of the array (pre-order case, when
10297 * flushing the remaining hooks)
10298 * - number: execute hooks only from the saved index until that node index exclusive (pre-order
10299 * case, when executing select(number))
10300 */
10301function callHooks(currentView, arr, initPhase, currentNodeIndex) {
10302    ngDevMode &&
10303        assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');
10304    const startIndex = currentNodeIndex !== undefined ?
10305        (currentView[PREORDER_HOOK_FLAGS] & 65535 /* IndexOfTheNextPreOrderHookMaskMask */) :
10306        0;
10307    const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;
10308    const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1
10309    let lastNodeIndexFound = 0;
10310    for (let i = startIndex; i < max; i++) {
10311        const hook = arr[i + 1];
10312        if (typeof hook === 'number') {
10313            lastNodeIndexFound = arr[i];
10314            if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {
10315                break;
10316            }
10317        }
10318        else {
10319            const isInitHook = arr[i] < 0;
10320            if (isInitHook)
10321                currentView[PREORDER_HOOK_FLAGS] += 65536 /* NumberOfInitHooksCalledIncrementer */;
10322            if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {
10323                callHook(currentView, initPhase, arr, i);
10324                currentView[PREORDER_HOOK_FLAGS] =
10325                    (currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* NumberOfInitHooksCalledMask */) + i +
10326                        2;
10327            }
10328            i++;
10329        }
10330    }
10331}
10332/**
10333 * Execute one hook against the current `LView`.
10334 *
10335 * @param currentView The current view
10336 * @param initPhaseState the current state of the init phase
10337 * @param arr The array in which the hooks are found
10338 * @param i The current index within the hook data array
10339 */
10340function callHook(currentView, initPhase, arr, i) {
10341    const isInitHook = arr[i] < 0;
10342    const hook = arr[i + 1];
10343    const directiveIndex = isInitHook ? -arr[i] : arr[i];
10344    const directive = currentView[directiveIndex];
10345    if (isInitHook) {
10346        const indexWithintInitPhase = currentView[FLAGS] >> 11 /* IndexWithinInitPhaseShift */;
10347        // The init phase state must be always checked here as it may have been recursively updated.
10348        if (indexWithintInitPhase <
10349            (currentView[PREORDER_HOOK_FLAGS] >> 16 /* NumberOfInitHooksCalledShift */) &&
10350            (currentView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) {
10351            currentView[FLAGS] += 2048 /* IndexWithinInitPhaseIncrementer */;
10352            profiler(4 /* LifecycleHookStart */, directive, hook);
10353            try {
10354                hook.call(directive);
10355            }
10356            finally {
10357                profiler(5 /* LifecycleHookEnd */, directive, hook);
10358            }
10359        }
10360    }
10361    else {
10362        profiler(4 /* LifecycleHookStart */, directive, hook);
10363        try {
10364            hook.call(directive);
10365        }
10366        finally {
10367            profiler(5 /* LifecycleHookEnd */, directive, hook);
10368        }
10369    }
10370}
10371
10372/**
10373 * @license
10374 * Copyright Google LLC All Rights Reserved.
10375 *
10376 * Use of this source code is governed by an MIT-style license that can be
10377 * found in the LICENSE file at https://angular.io/license
10378 */
10379const NO_PARENT_INJECTOR = -1;
10380/**
10381 * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in
10382 * `TView.data`. This allows us to store information about the current node's tokens (which
10383 * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be
10384 * shared, so they live in `LView`).
10385 *
10386 * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter
10387 * determines whether a directive is available on the associated node or not. This prevents us
10388 * from searching the directives array at this level unless it's probable the directive is in it.
10389 *
10390 * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.
10391 *
10392 * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed
10393 * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`
10394 * will differ based on where it is flattened into the main array, so it's not possible to know
10395 * the indices ahead of time and save their types here. The interfaces are still included here
10396 * for documentation purposes.
10397 *
10398 * export interface LInjector extends Array<any> {
10399 *
10400 *    // Cumulative bloom for directive IDs 0-31  (IDs are % BLOOM_SIZE)
10401 *    [0]: number;
10402 *
10403 *    // Cumulative bloom for directive IDs 32-63
10404 *    [1]: number;
10405 *
10406 *    // Cumulative bloom for directive IDs 64-95
10407 *    [2]: number;
10408 *
10409 *    // Cumulative bloom for directive IDs 96-127
10410 *    [3]: number;
10411 *
10412 *    // Cumulative bloom for directive IDs 128-159
10413 *    [4]: number;
10414 *
10415 *    // Cumulative bloom for directive IDs 160 - 191
10416 *    [5]: number;
10417 *
10418 *    // Cumulative bloom for directive IDs 192 - 223
10419 *    [6]: number;
10420 *
10421 *    // Cumulative bloom for directive IDs 224 - 255
10422 *    [7]: number;
10423 *
10424 *    // We need to store a reference to the injector's parent so DI can keep looking up
10425 *    // the injector tree until it finds the dependency it's looking for.
10426 *    [PARENT_INJECTOR]: number;
10427 * }
10428 *
10429 * export interface TInjector extends Array<any> {
10430 *
10431 *    // Shared node bloom for directive IDs 0-31  (IDs are % BLOOM_SIZE)
10432 *    [0]: number;
10433 *
10434 *    // Shared node bloom for directive IDs 32-63
10435 *    [1]: number;
10436 *
10437 *    // Shared node bloom for directive IDs 64-95
10438 *    [2]: number;
10439 *
10440 *    // Shared node bloom for directive IDs 96-127
10441 *    [3]: number;
10442 *
10443 *    // Shared node bloom for directive IDs 128-159
10444 *    [4]: number;
10445 *
10446 *    // Shared node bloom for directive IDs 160 - 191
10447 *    [5]: number;
10448 *
10449 *    // Shared node bloom for directive IDs 192 - 223
10450 *    [6]: number;
10451 *
10452 *    // Shared node bloom for directive IDs 224 - 255
10453 *    [7]: number;
10454 *
10455 *    // Necessary to find directive indices for a particular node.
10456 *    [TNODE]: TElementNode|TElementContainerNode|TContainerNode;
10457 *  }
10458 */
10459/**
10460 * Factory for creating instances of injectors in the NodeInjector.
10461 *
10462 * This factory is complicated by the fact that it can resolve `multi` factories as well.
10463 *
10464 * NOTE: Some of the fields are optional which means that this class has two hidden classes.
10465 * - One without `multi` support (most common)
10466 * - One with `multi` values, (rare).
10467 *
10468 * Since VMs can cache up to 4 inline hidden classes this is OK.
10469 *
10470 * - Single factory: Only `resolving` and `factory` is defined.
10471 * - `providers` factory: `componentProviders` is a number and `index = -1`.
10472 * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.
10473 */
10474class NodeInjectorFactory {
10475    constructor(
10476    /**
10477     * Factory to invoke in order to create a new instance.
10478     */
10479    factory, 
10480    /**
10481     * Set to `true` if the token is declared in `viewProviders` (or if it is component).
10482     */
10483    isViewProvider, injectImplementation) {
10484        this.factory = factory;
10485        /**
10486         * Marker set to true during factory invocation to see if we get into recursive loop.
10487         * Recursive loop causes an error to be displayed.
10488         */
10489        this.resolving = false;
10490        ngDevMode && assertDefined(factory, 'Factory not specified');
10491        ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');
10492        this.canSeeViewProviders = isViewProvider;
10493        this.injectImpl = injectImplementation;
10494    }
10495}
10496function isFactory(obj) {
10497    return obj instanceof NodeInjectorFactory;
10498}
10499// Note: This hack is necessary so we don't erroneously get a circular dependency
10500// failure based on types.
10501const unusedValueExportToPlacateAjd$3 = 1;
10502
10503/**
10504 * Converts `TNodeType` into human readable text.
10505 * Make sure this matches with `TNodeType`
10506 */
10507function toTNodeTypeAsString(tNodeType) {
10508    let text = '';
10509    (tNodeType & 1 /* Text */) && (text += '|Text');
10510    (tNodeType & 2 /* Element */) && (text += '|Element');
10511    (tNodeType & 4 /* Container */) && (text += '|Container');
10512    (tNodeType & 8 /* ElementContainer */) && (text += '|ElementContainer');
10513    (tNodeType & 16 /* Projection */) && (text += '|Projection');
10514    (tNodeType & 32 /* Icu */) && (text += '|IcuContainer');
10515    (tNodeType & 64 /* Placeholder */) && (text += '|Placeholder');
10516    return text.length > 0 ? text.substring(1) : text;
10517}
10518// Note: This hack is necessary so we don't erroneously get a circular dependency
10519// failure based on types.
10520const unusedValueExportToPlacateAjd$4 = 1;
10521/**
10522 * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
10523 *
10524 * ```
10525 * <div my-dir [class]="exp"></div>
10526 * ```
10527 * and
10528 * ```
10529 * @Directive({
10530 * })
10531 * class MyDirective {
10532 *   @Input()
10533 *   class: string;
10534 * }
10535 * ```
10536 *
10537 * In the above case it is necessary to write the reconciled styling information into the
10538 * directive's input.
10539 *
10540 * @param tNode
10541 */
10542function hasClassInput(tNode) {
10543    return (tNode.flags & 16 /* hasClassInput */) !== 0;
10544}
10545/**
10546 * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.
10547 *
10548 * ```
10549 * <div my-dir [style]="exp"></div>
10550 * ```
10551 * and
10552 * ```
10553 * @Directive({
10554 * })
10555 * class MyDirective {
10556 *   @Input()
10557 *   class: string;
10558 * }
10559 * ```
10560 *
10561 * In the above case it is necessary to write the reconciled styling information into the
10562 * directive's input.
10563 *
10564 * @param tNode
10565 */
10566function hasStyleInput(tNode) {
10567    return (tNode.flags & 32 /* hasStyleInput */) !== 0;
10568}
10569
10570/**
10571 * @license
10572 * Copyright Google LLC All Rights Reserved.
10573 *
10574 * Use of this source code is governed by an MIT-style license that can be
10575 * found in the LICENSE file at https://angular.io/license
10576 */
10577function assertTNodeType(tNode, expectedTypes, message) {
10578    assertDefined(tNode, 'should be called with a TNode');
10579    if ((tNode.type & expectedTypes) === 0) {
10580        throwError(message ||
10581            `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);
10582    }
10583}
10584function assertPureTNodeType(type) {
10585    if (!(type === 2 /* Element */ || //
10586        type === 1 /* Text */ || //
10587        type === 4 /* Container */ || //
10588        type === 8 /* ElementContainer */ || //
10589        type === 32 /* Icu */ || //
10590        type === 16 /* Projection */ || //
10591        type === 64 /* Placeholder */)) {
10592        throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);
10593    }
10594}
10595
10596/**
10597 * Assigns all attribute values to the provided element via the inferred renderer.
10598 *
10599 * This function accepts two forms of attribute entries:
10600 *
10601 * default: (key, value):
10602 *  attrs = [key1, value1, key2, value2]
10603 *
10604 * namespaced: (NAMESPACE_MARKER, uri, name, value)
10605 *  attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]
10606 *
10607 * The `attrs` array can contain a mix of both the default and namespaced entries.
10608 * The "default" values are set without a marker, but if the function comes across
10609 * a marker value then it will attempt to set a namespaced value. If the marker is
10610 * not of a namespaced value then the function will quit and return the index value
10611 * where it stopped during the iteration of the attrs array.
10612 *
10613 * See [AttributeMarker] to understand what the namespace marker value is.
10614 *
10615 * Note that this instruction does not support assigning style and class values to
10616 * an element. See `elementStart` and `elementHostAttrs` to learn how styling values
10617 * are applied to an element.
10618 * @param renderer The renderer to be used
10619 * @param native The element that the attributes will be assigned to
10620 * @param attrs The attribute array of values that will be assigned to the element
10621 * @returns the index value that was last accessed in the attributes array
10622 */
10623function setUpAttributes(renderer, native, attrs) {
10624    const isProc = isProceduralRenderer(renderer);
10625    let i = 0;
10626    while (i < attrs.length) {
10627        const value = attrs[i];
10628        if (typeof value === 'number') {
10629            // only namespaces are supported. Other value types (such as style/class
10630            // entries) are not supported in this function.
10631            if (value !== 0 /* NamespaceURI */) {
10632                break;
10633            }
10634            // we just landed on the marker value ... therefore
10635            // we should skip to the next entry
10636            i++;
10637            const namespaceURI = attrs[i++];
10638            const attrName = attrs[i++];
10639            const attrVal = attrs[i++];
10640            ngDevMode && ngDevMode.rendererSetAttribute++;
10641            isProc ?
10642                renderer.setAttribute(native, attrName, attrVal, namespaceURI) :
10643                native.setAttributeNS(namespaceURI, attrName, attrVal);
10644        }
10645        else {
10646            // attrName is string;
10647            const attrName = value;
10648            const attrVal = attrs[++i];
10649            // Standard attributes
10650            ngDevMode && ngDevMode.rendererSetAttribute++;
10651            if (isAnimationProp(attrName)) {
10652                if (isProc) {
10653                    renderer.setProperty(native, attrName, attrVal);
10654                }
10655            }
10656            else {
10657                isProc ?
10658                    renderer.setAttribute(native, attrName, attrVal) :
10659                    native.setAttribute(attrName, attrVal);
10660            }
10661            i++;
10662        }
10663    }
10664    // another piece of code may iterate over the same attributes array. Therefore
10665    // it may be helpful to return the exact spot where the attributes array exited
10666    // whether by running into an unsupported marker or if all the static values were
10667    // iterated over.
10668    return i;
10669}
10670/**
10671 * Test whether the given value is a marker that indicates that the following
10672 * attribute values in a `TAttributes` array are only the names of attributes,
10673 * and not name-value pairs.
10674 * @param marker The attribute marker to test.
10675 * @returns true if the marker is a "name-only" marker (e.g. `Bindings`, `Template` or `I18n`).
10676 */
10677function isNameOnlyAttributeMarker(marker) {
10678    return marker === 3 /* Bindings */ || marker === 4 /* Template */ ||
10679        marker === 6 /* I18n */;
10680}
10681function isAnimationProp(name) {
10682    // Perf note: accessing charCodeAt to check for the first character of a string is faster as
10683    // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that
10684    // charCodeAt doesn't allocate memory to return a substring.
10685    return name.charCodeAt(0) === 64 /* AT_SIGN */;
10686}
10687/**
10688 * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.
10689 *
10690 * This merge function keeps the order of attrs same.
10691 *
10692 * @param dst Location of where the merged `TAttributes` should end up.
10693 * @param src `TAttributes` which should be appended to `dst`
10694 */
10695function mergeHostAttrs(dst, src) {
10696    if (src === null || src.length === 0) {
10697        // do nothing
10698    }
10699    else if (dst === null || dst.length === 0) {
10700        // We have source, but dst is empty, just make a copy.
10701        dst = src.slice();
10702    }
10703    else {
10704        let srcMarker = -1 /* ImplicitAttributes */;
10705        for (let i = 0; i < src.length; i++) {
10706            const item = src[i];
10707            if (typeof item === 'number') {
10708                srcMarker = item;
10709            }
10710            else {
10711                if (srcMarker === 0 /* NamespaceURI */) {
10712                    // Case where we need to consume `key1`, `key2`, `value` items.
10713                }
vendor: 9,856 bytes, lines 10714-10970
10714                else if (srcMarker === -1 /* ImplicitAttributes */ ||
10715                    srcMarker === 2 /* Styles */) {
10716                    // Case where we have to consume `key1` and `value` only.
10717                    mergeHostAttribute(dst, srcMarker, item, null, src[++i]);
10718                }
10719                else {
10720                    // Case where we have to consume `key1` only.
10721                    mergeHostAttribute(dst, srcMarker, item, null, null);
10722                }
10723            }
10724        }
10725    }
10726    return dst;
10727}
10728/**
10729 * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account.
10730 *
10731 * @param dst `TAttributes` to append to.
10732 * @param marker Region where the `key`/`value` should be added.
10733 * @param key1 Key to add to `TAttributes`
10734 * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`)
10735 * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class.
10736 */
10737function mergeHostAttribute(dst, marker, key1, key2, value) {
10738    let i = 0;
10739    // Assume that new markers will be inserted at the end.
10740    let markerInsertPosition = dst.length;
10741    // scan until correct type.
10742    if (marker === -1 /* ImplicitAttributes */) {
10743        markerInsertPosition = -1;
10744    }
10745    else {
10746        while (i < dst.length) {
10747            const dstValue = dst[i++];
10748            if (typeof dstValue === 'number') {
10749                if (dstValue === marker) {
10750                    markerInsertPosition = -1;
10751                    break;
10752                }
10753                else if (dstValue > marker) {
10754                    // We need to save this as we want the markers to be inserted in specific order.
10755                    markerInsertPosition = i - 1;
10756                    break;
10757                }
10758            }
10759        }
10760    }
10761    // search until you find place of insertion
10762    while (i < dst.length) {
10763        const item = dst[i];
10764        if (typeof item === 'number') {
10765            // since `i` started as the index after the marker, we did not find it if we are at the next
10766            // marker
10767            break;
10768        }
10769        else if (item === key1) {
10770            // We already have same token
10771            if (key2 === null) {
10772                if (value !== null) {
10773                    dst[i + 1] = value;
10774                }
10775                return;
10776            }
10777            else if (key2 === dst[i + 1]) {
10778                dst[i + 2] = value;
10779                return;
10780            }
10781        }
10782        // Increment counter.
10783        i++;
10784        if (key2 !== null)
10785            i++;
10786        if (value !== null)
10787            i++;
10788    }
10789    // insert at location.
10790    if (markerInsertPosition !== -1) {
10791        dst.splice(markerInsertPosition, 0, marker);
10792        i = markerInsertPosition + 1;
10793    }
10794    dst.splice(i++, 0, key1);
10795    if (key2 !== null) {
10796        dst.splice(i++, 0, key2);
10797    }
10798    if (value !== null) {
10799        dst.splice(i++, 0, value);
10800    }
10801}
10802
10803/**
10804 * @license
10805 * Copyright Google LLC All Rights Reserved.
10806 *
10807 * Use of this source code is governed by an MIT-style license that can be
10808 * found in the LICENSE file at https://angular.io/license
10809 */
10810/// Parent Injector Utils ///////////////////////////////////////////////////////////////
10811function hasParentInjector(parentLocation) {
10812    return parentLocation !== NO_PARENT_INJECTOR;
10813}
10814function getParentInjectorIndex(parentLocation) {
10815    ngDevMode && assertNumber(parentLocation, 'Number expected');
10816    ngDevMode && assertNotEqual(parentLocation, -1, 'Not a valid state.');
10817    const parentInjectorIndex = parentLocation & 32767 /* InjectorIndexMask */;
10818    ngDevMode &&
10819        assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');
10820    return parentLocation & 32767 /* InjectorIndexMask */;
10821}
10822function getParentInjectorViewOffset(parentLocation) {
10823    return parentLocation >> 16 /* ViewOffsetShift */;
10824}
10825/**
10826 * Unwraps a parent injector location number to find the view offset from the current injector,
10827 * then walks up the declaration view tree until the view is found that contains the parent
10828 * injector.
10829 *
10830 * @param location The location of the parent injector, which contains the view offset
10831 * @param startView The LView instance from which to start walking up the view tree
10832 * @returns The LView instance that contains the parent injector
10833 */
10834function getParentInjectorView(location, startView) {
10835    let viewOffset = getParentInjectorViewOffset(location);
10836    let parentView = startView;
10837    // For most cases, the parent injector can be found on the host node (e.g. for component
10838    // or container), but we must keep the loop here to support the rarer case of deeply nested
10839    // <ng-template> tags or inline views, where the parent injector might live many views
10840    // above the child injector.
10841    while (viewOffset > 0) {
10842        parentView = parentView[DECLARATION_VIEW];
10843        viewOffset--;
10844    }
10845    return parentView;
10846}
10847
10848/**
10849 * @license
10850 * Copyright Google LLC All Rights Reserved.
10851 *
10852 * Use of this source code is governed by an MIT-style license that can be
10853 * found in the LICENSE file at https://angular.io/license
10854 */
10855/**
10856 * Defines if the call to `inject` should include `viewProviders` in its resolution.
10857 *
10858 * This is set to true when we try to instantiate a component. This value is reset in
10859 * `getNodeInjectable` to a value which matches the declaration location of the token about to be
10860 * instantiated. This is done so that if we are injecting a token which was declared outside of
10861 * `viewProviders` we don't accidentally pull `viewProviders` in.
10862 *
10863 * Example:
10864 *
10865 * ```
10866 * @Injectable()
10867 * class MyService {
10868 *   constructor(public value: String) {}
10869 * }
10870 *
10871 * @Component({
10872 *   providers: [
10873 *     MyService,
10874 *     {provide: String, value: 'providers' }
10875 *   ]
10876 *   viewProviders: [
10877 *     {provide: String, value: 'viewProviders'}
10878 *   ]
10879 * })
10880 * class MyComponent {
10881 *   constructor(myService: MyService, value: String) {
10882 *     // We expect that Component can see into `viewProviders`.
10883 *     expect(value).toEqual('viewProviders');
10884 *     // `MyService` was not declared in `viewProviders` hence it can't see it.
10885 *     expect(myService.value).toEqual('providers');
10886 *   }
10887 * }
10888 *
10889 * ```
10890 */
10891let includeViewProviders = true;
10892function setIncludeViewProviders(v) {
10893    const oldValue = includeViewProviders;
10894    includeViewProviders = v;
10895    return oldValue;
10896}
10897/**
10898 * The number of slots in each bloom filter (used by DI). The larger this number, the fewer
10899 * directives that will share slots, and thus, the fewer false positives when checking for
10900 * the existence of a directive.
10901 */
10902const BLOOM_SIZE = 256;
10903const BLOOM_MASK = BLOOM_SIZE - 1;
10904/**
10905 * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,
10906 * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash
10907 * number.
10908 */
10909const BLOOM_BUCKET_BITS = 5;
10910/** Counter used to generate unique IDs for directives. */
10911let nextNgElementId = 0;
10912/**
10913 * Registers this directive as present in its node's injector by flipping the directive's
10914 * corresponding bit in the injector's bloom filter.
10915 *
10916 * @param injectorIndex The index of the node injector where this token should be registered
10917 * @param tView The TView for the injector's bloom filters
10918 * @param type The directive token to register
10919 */
10920function bloomAdd(injectorIndex, tView, type) {
10921    ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');
10922    let id;
10923    if (typeof type === 'string') {
10924        id = type.charCodeAt(0) || 0;
10925    }
10926    else if (type.hasOwnProperty(NG_ELEMENT_ID)) {
10927        id = type[NG_ELEMENT_ID];
10928    }
10929    // Set a unique ID on the directive type, so if something tries to inject the directive,
10930    // we can easily retrieve the ID and hash it into the bloom bit that should be checked.
10931    if (id == null) {
10932        id = type[NG_ELEMENT_ID] = nextNgElementId++;
10933    }
10934    // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),
10935    // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.
10936    const bloomHash = id & BLOOM_MASK;
10937    // Create a mask that targets the specific bit associated with the directive.
10938    // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
10939    // to bit positions 0 - 31 in a 32 bit integer.
10940    const mask = 1 << bloomHash;
10941    // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.
10942    // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask
10943    // should be written to.
10944    tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;
10945}
10946/**
10947 * Creates (or gets an existing) injector for a given element or container.
10948 *
10949 * @param tNode for which an injector should be retrieved / created.
10950 * @param lView View where the node is stored
10951 * @returns Node injector
10952 */
10953function getOrCreateNodeInjectorForNode(tNode, lView) {
10954    const existingInjectorIndex = getInjectorIndex(tNode, lView);
10955    if (existingInjectorIndex !== -1) {
10956        return existingInjectorIndex;
10957    }
10958    const tView = lView[TVIEW];
10959    if (tView.firstCreatePass) {
10960        tNode.injectorIndex = lView.length;
10961        insertBloom(tView.data, tNode); // foundation for node bloom
10962        insertBloom(lView, null); // foundation for cumulative bloom
10963        insertBloom(tView.blueprint, null);
10964    }
10965    const parentLoc = getParentInjectorLocation(tNode, lView);
10966    const injectorIndex = tNode.injectorIndex;
10967    // If a parent injector can't be found, its location is set to -1.
10968    // In that case, we don't need to set up a cumulative bloom
10969    if (hasParentInjector(parentLoc)) {
10970        const parentIndex = getParentInjectorIndex(parentLoc);
10971        const parentLView = getParentInjectorView(parentLoc, lView);
10972        const parentData = parentLView[TVIEW].data;
10973        // Creates a cumulative bloom filter that merges the parent's bloom filter
10974        // and its own cumulative bloom (which contains tokens for all ancestors)
10975        for (let i = 0; i < 8 /* BLOOM_SIZE */; i++) {
10976            lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];
10977        }
10978    }
10979    lView[injectorIndex + 8 /* PARENT */] = parentLoc;
10980    return injectorIndex;
10981}
10982function insertBloom(arr, footer) {
10983    arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);
10984}
10985function getInjectorIndex(tNode, lView) {
10986    if (tNode.injectorIndex === -1 ||
10987        // If the injector index is the same as its parent's injector index, then the index has been
10988        // copied down from the parent node. No injector has been created yet on this node.
10989        (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||
10990        // After the first template pass, the injector index might exist but the parent values
10991        // might not have been calculated yet for this instance
10992        lView[tNode.injectorIndex + 8 /* PARENT */] === null) {
10993        return -1;
10994    }
10995    else {
10996        ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);
10997        return tNode.injectorIndex;
10998    }
10999}
11000/**
11001 * Finds the index of the parent injector, with a view offset if applicable. Used to set the
11002 * parent injector initially.
11003 *
11004 * @returns Returns a number that is the combination of the number of LViews that we have to go up
11005 * to find the LView containing the parent inject AND the index of the injector within that LView.
11006 */
11007function getParentInjectorLocation(tNode, lView) {
11008    if (tNode.parent && tNode.parent.injectorIndex !== -1) {
11009        // If we have a parent `TNode` and there is an injector associated with it we are done, because
11010        // the parent injector is within the current `LView`.
11011        return tNode.parent.injectorIndex; // ViewOffset is 0
11012    }
11013    // When parent injector location is computed it may be outside of the current view. (ie it could
11014    // be pointing to a declared parent location). This variable stores number of declaration parents
11015    // we need to walk up in order to find the parent injector location.
11016    let declarationViewOffset = 0;
11017    let parentTNode = null;
11018    let lViewCursor = lView;
11019    // The parent injector is not in the current `LView`. We will have to walk the declared parent
11020    // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent
11021    // `NodeInjector`.
11022    while (lViewCursor !== null) {
11023        // First determine the `parentTNode` location. The parent pointer differs based on `TView.type`.
11024        const tView = lViewCursor[TVIEW];
11025        const tViewType = tView.type;
11026        if (tViewType === 2 /* Embedded */) {
11027            ngDevMode &&
11028                assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');
11029            parentTNode = tView.declTNode;
11030        }
11031        else if (tViewType === 1 /* Component */) {
11032            // Components don't have `TView.declTNode` because each instance of component could be
11033            // inserted in different location, hence `TView.declTNode` is meaningless.
11034            parentTNode = lViewCursor[T_HOST];
11035        }
11036        else {
11037            ngDevMode && assertEqual(tView.type, 0 /* Root */, 'Root type expected');
11038            parentTNode = null;
11039        }
11040        if (parentTNode === null) {
11041            // If we have no parent, than we are done.
11042            return NO_PARENT_INJECTOR;
11043        }
11044        ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);
11045        // Every iteration of the loop requires that we go to the declared parent.
11046        declarationViewOffset++;
11047        lViewCursor = lViewCursor[DECLARATION_VIEW];
11048        if (parentTNode.injectorIndex !== -1) {
11049            // We found a NodeInjector which points to something.
11050            return (parentTNode.injectorIndex |
11051                (declarationViewOffset << 16 /* ViewOffsetShift */));
11052        }
11053    }
11054    return NO_PARENT_INJECTOR;
11055}
11056/**
vendor: 9,253 bytes, lines 11057-11267
11057 * Makes a type or an injection token public to the DI system by adding it to an
11058 * injector's bloom filter.
11059 *
11060 * @param di The node injector in which a directive will be added
11061 * @param token The type or the injection token to be made public
11062 */
11063function diPublicInInjector(injectorIndex, tView, token) {
11064    bloomAdd(injectorIndex, tView, token);
11065}
11066/**
11067 * Inject static attribute value into directive constructor.
11068 *
11069 * This method is used with `factory` functions which are generated as part of
11070 * `defineDirective` or `defineComponent`. The method retrieves the static value
11071 * of an attribute. (Dynamic attributes are not supported since they are not resolved
11072 *  at the time of injection and can change over time.)
11073 *
11074 * # Example
11075 * Given:
11076 * ```
11077 * @Component(...)
11078 * class MyComponent {
11079 *   constructor(@Attribute('title') title: string) { ... }
11080 * }
11081 * ```
11082 * When instantiated with
11083 * ```
11084 * <my-component title="Hello"></my-component>
11085 * ```
11086 *
11087 * Then factory method generated is:
11088 * ```
11089 * MyComponent.ɵcmp = defineComponent({
11090 *   factory: () => new MyComponent(injectAttribute('title'))
11091 *   ...
11092 * })
11093 * ```
11094 *
11095 * @publicApi
11096 */
11097function injectAttributeImpl(tNode, attrNameToInject) {
11098    ngDevMode && assertTNodeType(tNode, 12 /* AnyContainer */ | 3 /* AnyRNode */);
11099    ngDevMode && assertDefined(tNode, 'expecting tNode');
11100    if (attrNameToInject === 'class') {
11101        return tNode.classes;
11102    }
11103    if (attrNameToInject === 'style') {
11104        return tNode.styles;
11105    }
11106    const attrs = tNode.attrs;
11107    if (attrs) {
11108        const attrsLength = attrs.length;
11109        let i = 0;
11110        while (i < attrsLength) {
11111            const value = attrs[i];
11112            // If we hit a `Bindings` or `Template` marker then we are done.
11113            if (isNameOnlyAttributeMarker(value))
11114                break;
11115            // Skip namespaced attributes
11116            if (value === 0 /* NamespaceURI */) {
11117                // we skip the next two values
11118                // as namespaced attributes looks like
11119                // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',
11120                // 'existValue', ...]
11121                i = i + 2;
11122            }
11123            else if (typeof value === 'number') {
11124                // Skip to the first value of the marked attribute.
11125                i++;
11126                while (i < attrsLength && typeof attrs[i] === 'string') {
11127                    i++;
11128                }
11129            }
11130            else if (value === attrNameToInject) {
11131                return attrs[i + 1];
11132            }
11133            else {
11134                i = i + 2;
11135            }
11136        }
11137    }
11138    return null;
11139}
11140function notFoundValueOrThrow(notFoundValue, token, flags) {
11141    if (flags & InjectFlags.Optional) {
11142        return notFoundValue;
11143    }
11144    else {
11145        throwProviderNotFoundError(token, 'NodeInjector');
11146    }
11147}
11148/**
11149 * Returns the value associated to the given token from the ModuleInjector or throws exception
11150 *
11151 * @param lView The `LView` that contains the `tNode`
11152 * @param token The token to look for
11153 * @param flags Injection flags
11154 * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`
11155 * @returns the value from the injector or throws an exception
11156 */
11157function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {
11158    if (flags & InjectFlags.Optional && notFoundValue === undefined) {
11159        // This must be set or the NullInjector will throw for optional deps
11160        notFoundValue = null;
11161    }
11162    if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {
11163        const moduleInjector = lView[INJECTOR];
11164        // switch to `injectInjectorOnly` implementation for module injector, since module injector
11165        // should not have access to Component/Directive DI scope (that may happen through
11166        // `directiveInject` implementation)
11167        const previousInjectImplementation = setInjectImplementation(undefined);
11168        try {
11169            if (moduleInjector) {
11170                return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional);
11171            }
11172            else {
11173                return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional);
11174            }
11175        }
11176        finally {
11177            setInjectImplementation(previousInjectImplementation);
11178        }
11179    }
11180    return notFoundValueOrThrow(notFoundValue, token, flags);
11181}
11182/**
11183 * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.
11184 *
11185 * Look for the injector providing the token by walking up the node injector tree and then
11186 * the module injector tree.
11187 *
11188 * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom
11189 * filter. `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)
11190 *
11191 * @param tNode The Node where the search for the injector should start
11192 * @param lView The `LView` that contains the `tNode`
11193 * @param token The token to look for
11194 * @param flags Injection flags
11195 * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`
11196 * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided
11197 */
11198function getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default, notFoundValue) {
11199    if (tNode !== null) {
11200        const bloomHash = bloomHashBitOrFactory(token);
11201        // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef
11202        // so just call the factory function to create it.
11203        if (typeof bloomHash === 'function') {
11204            if (!enterDI(lView, tNode, flags)) {
11205                // Failed to enter DI, try module injector instead. If a token is injected with the @Host
11206                // flag, the module injector is not searched for that token in Ivy.
11207                return (flags & InjectFlags.Host) ?
11208                    notFoundValueOrThrow(notFoundValue, token, flags) :
11209                    lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
11210            }
11211            try {
11212                const value = bloomHash();
11213                if (value == null && !(flags & InjectFlags.Optional)) {
11214                    throwProviderNotFoundError(token);
11215                }
11216                else {
11217                    return value;
11218                }
11219            }
11220            finally {
11221                leaveDI();
11222            }
11223        }
11224        else if (typeof bloomHash === 'number') {
11225            // A reference to the previous injector TView that was found while climbing the element
11226            // injector tree. This is used to know if viewProviders can be accessed on the current
11227            // injector.
11228            let previousTView = null;
11229            let injectorIndex = getInjectorIndex(tNode, lView);
11230            let parentLocation = NO_PARENT_INJECTOR;
11231            let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;
11232            // If we should skip this injector, or if there is no injector on this node, start by
11233            // searching the parent injector.
11234            if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {
11235                parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) :
11236                    lView[injectorIndex + 8 /* PARENT */];
11237                if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {
11238                    injectorIndex = -1;
11239                }
11240                else {
11241                    previousTView = lView[TVIEW];
11242                    injectorIndex = getParentInjectorIndex(parentLocation);
11243                    lView = getParentInjectorView(parentLocation, lView);
11244                }
11245            }
11246            // Traverse up the injector tree until we find a potential match or until we know there
11247            // *isn't* a match.
11248            while (injectorIndex !== -1) {
11249                ngDevMode && assertNodeInjector(lView, injectorIndex);
11250                // Check the current injector. If it matches, see if it contains token.
11251                const tView = lView[TVIEW];
11252                ngDevMode &&
11253                    assertTNodeForLView(tView.data[injectorIndex + 8 /* TNODE */], lView);
11254                if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {
11255                    // At this point, we have an injector which *may* contain the token, so we step through
11256                    // the providers and directives associated with the injector's corresponding node to get
11257                    // the instance.
11258                    const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);
11259                    if (instance !== NOT_FOUND) {
11260                        return instance;
11261                    }
11262                }
11263                parentLocation = lView[injectorIndex + 8 /* PARENT */];
11264                if (parentLocation !== NO_PARENT_INJECTOR &&
11265                    shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* TNODE */] === hostTElementNode) &&
11266                    bloomHasToken(bloomHash, injectorIndex, lView)) {
11267                    // The def wasn't found anywhere on this node, so it was a fal
11267se positive.
11268                    // Traverse up the tree and continue searching.
11269                    previousTView = tView;
11270                    injectorIndex = getParentInjectorIndex(parentLocation);
11271                    lView = getParentInjectorView(parentLocation, lView);
11272                }
11273                else {
11274                    // If we should not search parent OR If the ancestor bloom filter value does not have the
11275                    // bit corresponding to the directive we can give up on traversing up to find the specific
11276                    // injector.
11277                    injectorIndex = -1;
11278                }
11279            }
11280        }
11281    }
11282    return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
11283}
11284const NOT_FOUND = {};
11285function createNodeInjector() {
11286    return new NodeInjector(getCurrentTNode(), getLView());
11287}
11288function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {
11289    const currentTView = lView[TVIEW];
11290    const tNode = currentTView.data[injectorIndex + 8 /* TNODE */];
11291    // First, we need to determine if view providers can be accessed by the starting element.
11292    // There are two possibilities
11293    const canAccessViewProviders = previousTView == null ?
11294        // 1) This is the first invocation `previousTView == null` which means that we are at the
11295        // `TNode` of where injector is starting to look. In such a case the only time we are allowed
11296        // to look into the ViewProviders is if:
11297        // - we are on a component
11298        // - AND the injector set `includeViewProviders` to true (implying that the token can see
11299        // ViewProviders because it is the Component or a Service which itself was declared in
11300        // ViewProviders)
11301        (isComponentHost(tNode) && includeViewProviders) :
11302        // 2) `previousTView != null` which means that we are now walking across the parent nodes.
11303        // In such a case we are only allowed to look into the ViewProviders if:
11304        // - We just crossed from child View to Parent View `previousTView != currentTView`
11305        // - AND the parent TNode is an Element.
11306        // This means that we just came from the Component's View and therefore are allowed to see
11307        // into the ViewProviders.
11308        (previousTView != currentTView && ((tNode.type & 3 /* AnyRNode */) !== 0));
11309    // This special case happens when there is a @host on the inject and when we are searching
11310    // on the host element node.
11311    const isHostSpecialCase = (flags & InjectFlags.Host) && hostTElementNode === tNode;
11312    const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);
11313    if (injectableIdx !== null) {
11314        return getNodeInjectable(lView, currentTView, injectableIdx, tNode);
11315    }
11316    else {
11317        return NOT_FOUND;
11318    }
11319}
11320/**
11321 * Searches for the given token among the node's directives and providers.
11322 *
11323 * @param tNode TNode on which directives are present.
11324 * @param tView The tView we are currently processing
11325 * @param token Provider token or type of a directive to look for.
11326 * @param canAccessViewProviders Whether view providers should be considered.
11327 * @param isHostSpecialCase Whether the host special case applies.
11328 * @returns Index of a found directive or provider, or null when none found.
11329 */
11330function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {
11331    const nodeProviderIndexes = tNode.providerIndexes;
11332    const tInjectables = tView.data;
11333    const injectablesStart = nodeProviderIndexes & 1048575 /* ProvidersStartIndexMask */;
11334    const directivesStart = tNode.directiveStart;
11335    const directiveEnd = tNode.directiveEnd;
11336    const cptViewProvidersCount = nodeProviderIndexes >> 20 /* CptViewProvidersCountShift */;
11337    const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;
11338    // When the host special case applies, only the viewProviders and the component are visible
11339    const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;
11340    for (let i = startingIndex; i < endIndex; i++) {
11341        const providerTokenOrDef = tInjectables[i];
11342        if (i < directivesStart && token === providerTokenOrDef ||
11343            i >= directivesStart && providerTokenOrDef.type === token) {
11344            return i;
11345        }
11346    }
11347    if (isHostSpecialCase) {
11348        const dirDef = tInjectables[directivesStart];
11349        if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {
11350            return directivesStart;
11351        }
11352    }
11353    return null;
11354}
11355/**
11356 * Retrieve or instantiate the injectable from the `LView` at particular `index`.
11357 *
11358 * This function checks to see if the value has already been instantiated and if so returns the
11359 * cached `injectable`. Otherwise if it detects that the value is still a factory it
11360 * instantiates the `injectable` and caches the value.
11361 */
vendor: 17,153 bytes, lines 11362-11778
11362function getNodeInjectable(lView, tView, index, tNode) {
11363    let value = lView[index];
11364    const tData = tView.data;
11365    if (isFactory(value)) {
11366        const factory = value;
11367        if (factory.resolving) {
11368            throwCyclicDependencyError(stringifyForError(tData[index]));
11369        }
11370        const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);
11371        factory.resolving = true;
11372        const previousInjectImplementation = factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null;
11373        const success = enterDI(lView, tNode, InjectFlags.Default);
11374        ngDevMode &&
11375            assertEqual(success, true, 'Because flags do not contain \`SkipSelf\' we expect this to always succeed.');
11376        try {
11377            value = lView[index] = factory.factory(undefined, tData, lView, tNode);
11378            // This code path is hit for both directives and providers.
11379            // For perf reasons, we want to avoid searching for hooks on providers.
11380            // It does no harm to try (the hooks just won't exist), but the extra
11381            // checks are unnecessary and this is a hot path. So we check to see
11382            // if the index of the dependency is in the directive range for this
11383            // tNode. If it's not, we know it's a provider and skip hook registration.
11384            if (tView.firstCreatePass && index >= tNode.directiveStart) {
11385                ngDevMode && assertDirectiveDef(tData[index]);
11386                registerPreOrderHooks(index, tData[index], tView);
11387            }
11388        }
11389        finally {
11390            previousInjectImplementation !== null &&
11391                setInjectImplementation(previousInjectImplementation);
11392            setIncludeViewProviders(previousIncludeViewProviders);
11393            factory.resolving = false;
11394            leaveDI();
11395        }
11396    }
11397    return value;
11398}
11399/**
11400 * Returns the bit in an injector's bloom filter that should be used to determine whether or not
11401 * the directive might be provided by the injector.
11402 *
11403 * When a directive is public, it is added to the bloom filter and given a unique ID that can be
11404 * retrieved on the Type. When the directive isn't public or the token is not a directive `null`
11405 * is returned as the node injector can not possibly provide that token.
11406 *
11407 * @param token the injection token
11408 * @returns the matching bit to check in the bloom filter or `null` if the token is not known.
11409 *   When the returned value is negative then it represents special values such as `Injector`.
11410 */
11411function bloomHashBitOrFactory(token) {
11412    ngDevMode && assertDefined(token, 'token must be defined');
11413    if (typeof token === 'string') {
11414        return token.charCodeAt(0) || 0;
11415    }
11416    const tokenId = 
11417    // First check with `hasOwnProperty` so we don't get an inherited ID.
11418    token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;
11419    // Negative token IDs are used for special objects such as `Injector`
11420    if (typeof tokenId === 'number') {
11421        if (tokenId >= 0) {
11422            return tokenId & BLOOM_MASK;
11423        }
11424        else {
11425            ngDevMode &&
11426                assertEqual(tokenId, -1 /* Injector */, 'Expecting to get Special Injector Id');
11427            return createNodeInjector;
11428        }
11429    }
11430    else {
11431        return tokenId;
11432    }
11433}
11434function bloomHasToken(bloomHash, injectorIndex, injectorView) {
11435    // Create a mask that targets the specific bit associated with the directive we're looking for.
11436    // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
11437    // to bit positions 0 - 31 in a 32 bit integer.
11438    const mask = 1 << bloomHash;
11439    // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of
11440    // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset
11441    // that should be used.
11442    const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];
11443    // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,
11444    // this injector is a potential match.
11445    return !!(value & mask);
11446}
11447/** Returns true if flags prevent parent injector from being searched for tokens */
11448function shouldSearchParent(flags, isFirstHostTNode) {
11449    return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode);
11450}
11451class NodeInjector {
11452    constructor(_tNode, _lView) {
11453        this._tNode = _tNode;
11454        this._lView = _lView;
11455    }
11456    get(token, notFoundValue) {
11457        return getOrCreateInjectable(this._tNode, this._lView, token, undefined, notFoundValue);
11458    }
11459}
11460/**
11461 * @codeGenApi
11462 */
11463function ɵɵgetInheritedFactory(type) {
11464    return noSideEffects(() => {
11465        const ownConstructor = type.prototype.constructor;
11466        const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);
11467        const objectPrototype = Object.prototype;
11468        let parent = Object.getPrototypeOf(type.prototype).constructor;
11469        // Go up the prototype until we hit `Object`.
11470        while (parent && parent !== objectPrototype) {
11471            const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);
11472            // If we hit something that has a factory and the factory isn't the same as the type,
11473            // we've found the inherited factory. Note the check that the factory isn't the type's
11474            // own factory is redundant in most cases, but if the user has custom decorators on the
11475            // class, this lookup will start one level down in the prototype chain, causing us to
11476            // find the own factory first and potentially triggering an infinite loop downstream.
11477            if (factory && factory !== ownFactory) {
11478                return factory;
11479            }
11480            parent = Object.getPrototypeOf(parent);
11481        }
11482        // There is no factory defined. Either this was improper usage of inheritance
11483        // (no Angular decorator on the superclass) or there is no constructor at all
11484        // in the inheritance chain. Since the two cases cannot be distinguished, the
11485        // latter has to be assumed.
11486        return t => new t();
11487    });
11488}
11489function getFactoryOf(type) {
11490    if (isForwardRef(type)) {
11491        return () => {
11492            const factory = getFactoryOf(resolveForwardRef(type));
11493            return factory && factory();
11494        };
11495    }
11496    return getFactoryDef(type);
11497}
11498
11499/**
11500 * @license
11501 * Copyright Google LLC All Rights Reserved.
11502 *
11503 * Use of this source code is governed by an MIT-style license that can be
11504 * found in the LICENSE file at https://angular.io/license
11505 */
11506/**
11507 * Facade for the attribute injection from DI.
11508 *
11509 * @codeGenApi
11510 */
11511function ɵɵinjectAttribute(attrNameToInject) {
11512    return injectAttributeImpl(getCurrentTNode(), attrNameToInject);
11513}
11514
11515/**
11516 * @license
11517 * Copyright Google LLC All Rights Reserved.
11518 *
11519 * Use of this source code is governed by an MIT-style license that can be
11520 * found in the LICENSE file at https://angular.io/license
11521 */
11522const ANNOTATIONS = '__annotations__';
11523const PARAMETERS = '__parameters__';
11524const PROP_METADATA = '__prop__metadata__';
11525/**
11526 * @suppress {globalThis}
11527 */
11528function makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {
11529    return noSideEffects(() => {
11530        const metaCtor = makeMetadataCtor(props);
11531        function DecoratorFactory(...args) {
11532            if (this instanceof DecoratorFactory) {
11533                metaCtor.call(this, ...args);
11534                return this;
11535            }
11536            const annotationInstance = new DecoratorFactory(...args);
11537            return function TypeDecorator(cls) {
11538                if (typeFn)
11539                    typeFn(cls, ...args);
11540                // Use of Object.defineProperty is important since it creates non-enumerable property which
11541                // prevents the property is copied during subclassing.
11542                const annotations = cls.hasOwnProperty(ANNOTATIONS) ?
11543                    cls[ANNOTATIONS] :
11544                    Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS];
11545                annotations.push(annotationInstance);
11546                if (additionalProcessing)
11547                    additionalProcessing(cls);
11548                return cls;
11549            };
11550        }
11551        if (parentClass) {
11552            DecoratorFactory.prototype = Object.create(parentClass.prototype);
11553        }
11554        DecoratorFactory.prototype.ngMetadataName = name;
11555        DecoratorFactory.annotationCls = DecoratorFactory;
11556        return DecoratorFactory;
11557    });
11558}
11559function makeMetadataCtor(props) {
11560    return function ctor(...args) {
11561        if (props) {
11562            const values = props(...args);
11563            for (const propName in values) {
11564                this[propName] = values[propName];
11565            }
11566        }
11567    };
11568}
11569function makeParamDecorator(name, props, parentClass) {
11570    return noSideEffects(() => {
11571        const metaCtor = makeMetadataCtor(props);
11572        function ParamDecoratorFactory(...args) {
11573            if (this instanceof ParamDecoratorFactory) {
11574                metaCtor.apply(this, args);
11575                return this;
11576            }
11577            const annotationInstance = new ParamDecoratorFactory(...args);
11578            ParamDecorator.annotation = annotationInstance;
11579            return ParamDecorator;
11580            function ParamDecorator(cls, unusedKey, index) {
11581                // Use of Object.defineProperty is important since it creates non-enumerable property which
11582                // prevents the property is copied during subclassing.
11583                const parameters = cls.hasOwnProperty(PARAMETERS) ?
11584                    cls[PARAMETERS] :
11585                    Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS];
11586                // there might be gaps if some in between parameters do not have annotations.
11587                // we pad with nulls.
11588                while (parameters.length <= index) {
11589                    parameters.push(null);
11590                }
11591                (parameters[index] = parameters[index] || []).push(annotationInstance);
11592                return cls;
11593            }
11594        }
11595        if (parentClass) {
11596            ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);
11597        }
11598        ParamDecoratorFactory.prototype.ngMetadataName = name;
11599        ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;
11600        return ParamDecoratorFactory;
11601    });
11602}
11603function makePropDecorator(name, props, parentClass, additionalProcessing) {
11604    return noSideEffects(() => {
11605        const metaCtor = makeMetadataCtor(props);
11606        function PropDecoratorFactory(...args) {
11607            if (this instanceof PropDecoratorFactory) {
11608                metaCtor.apply(this, args);
11609                return this;
11610            }
11611            const decoratorInstance = new PropDecoratorFactory(...args);
11612            function PropDecorator(target, name) {
11613                const constructor = target.constructor;
11614                // Use of Object.defineProperty is important because it creates a non-enumerable property
11615                // which prevents the property from being copied during subclassing.
11616                const meta = constructor.hasOwnProperty(PROP_METADATA) ?
11617                    constructor[PROP_METADATA] :
11618                    Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA];
11619                meta[name] = meta.hasOwnProperty(name) && meta[name] || [];
11620                meta[name].unshift(decoratorInstance);
11621                if (additionalProcessing)
11622                    additionalProcessing(target, name, ...args);
11623            }
11624            return PropDecorator;
11625        }
11626        if (parentClass) {
11627            PropDecoratorFactory.prototype = Object.create(parentClass.prototype);
11628        }
11629        PropDecoratorFactory.prototype.ngMetadataName = name;
11630        PropDecoratorFactory.annotationCls = PropDecoratorFactory;
11631        return PropDecoratorFactory;
11632    });
11633}
11634
11635/**
11636 * @license
11637 * Copyright Google LLC All Rights Reserved.
11638 *
11639 * Use of this source code is governed by an MIT-style license that can be
11640 * found in the LICENSE file at https://angular.io/license
11641 */
11642function CREATE_ATTRIBUTE_DECORATOR__PRE_R3__() {
11643    return makeParamDecorator('Attribute', (attributeName) => ({ attributeName }));
11644}
11645function CREATE_ATTRIBUTE_DECORATOR__POST_R3__() {
11646    return makeParamDecorator('Attribute', (attributeName) => ({ attributeName, __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName) }));
11647}
11648const CREATE_ATTRIBUTE_DECORATOR_IMPL = CREATE_ATTRIBUTE_DECORATOR__POST_R3__;
11649/**
11650 * Attribute decorator and metadata.
11651 *
11652 * @Annotation
11653 * @publicApi
11654 */
11655const Attribute = CREATE_ATTRIBUTE_DECORATOR_IMPL();
11656
11657/**
11658 * @license
11659 * Copyright Google LLC All Rights Reserved.
11660 *
11661 * Use of this source code is governed by an MIT-style license that can be
11662 * found in the LICENSE file at https://angular.io/license
11663 */
11664/**
11665 * Creates a token that can be used in a DI Provider.
11666 *
11667 * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a
11668 * runtime representation) such as when injecting an interface, callable type, array or
11669 * parameterized type.
11670 *
11671 * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by
11672 * the `Injector`. This provides additional level of type safety.
11673 *
11674 * ```
11675 * interface MyInterface {...}
11676 * var myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));
11677 * // myInterface is inferred to be MyInterface.
11678 * ```
11679 *
11680 * When creating an `InjectionToken`, you can optionally specify a factory function which returns
11681 * (possibly by creating) a default value of the parameterized type `T`. This sets up the
11682 * `InjectionToken` using this factory as a provider as if it was defined explicitly in the
11683 * application's root injector. If the factory function, which takes zero arguments, needs to inject
11684 * dependencies, it can do so using the `inject` function. See below for an example.
11685 *
11686 * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which
11687 * overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As
11688 * mentioned above, `'root'` is the default value for `providedIn`.
11689 *
11690 * @usageNotes
11691 * ### Basic Example
11692 *
11693 * ### Plain InjectionToken
11694 *
11695 * {@example core/di/ts/injector_spec.ts region='InjectionToken'}
11696 *
11697 * ### Tree-shakable InjectionToken
11698 *
11699 * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}
11700 *
11701 *
11702 * @publicApi
11703 */
11704class InjectionToken {
11705    constructor(_desc, options) {
11706        this._desc = _desc;
11707        /** @internal */
11708        this.ngMetadataName = 'InjectionToken';
11709        this.ɵprov = undefined;
11710        if (typeof options == 'number') {
11711            (typeof ngDevMode === 'undefined' || ngDevMode) &&
11712                assertLessThan(options, 0, 'Only negative numbers are supported here');
11713            // This is a special hack to assign __NG_ELEMENT_ID__ to this instance.
11714            // See `InjectorMarkers`
11715            this.__NG_ELEMENT_ID__ = options;
11716        }
11717        else if (options !== undefined) {
11718            this.ɵprov = ɵɵdefineInjectable({
11719                token: this,
11720                providedIn: options.providedIn || 'root',
11721                factory: options.factory,
11722            });
11723        }
11724    }
11725    toString() {
11726        return `InjectionToken ${this._desc}`;
11727    }
11728}
11729
11730/**
11731 * @license
11732 * Copyright Google LLC All Rights Reserved.
11733 *
11734 * Use of this source code is governed by an MIT-style license that can be
11735 * found in the LICENSE file at https://angular.io/license
11736 */
11737/**
11738 * A DI token that you can use to create a virtual [provider](guide/glossary#provider)
11739 * that will populate the `entryComponents` field of components and NgModules
11740 * based on its `useValue` property value.
11741 * All components that are referenced in the `useValue` value (either directly
11742 * or in a nested array or map) are added to the `entryComponents` property.
11743 *
11744 * @usageNotes
11745 *
11746 * The following example shows how the router can populate the `entryComponents`
11747 * field of an NgModule based on a router configuration that refers
11748 * to components.
11749 *
11750 * ```typescript
11751 * // helper function inside the router
11752 * function provideRoutes(routes) {
11753 *   return [
11754 *     {provide: ROUTES, useValue: routes},
11755 *     {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}
11756 *   ];
11757 * }
11758 *
11759 * // user code
11760 * let routes = [
11761 *   {path: '/root', component: RootComp},
11762 *   {path: '/teams', component: TeamsComp}
11763 * ];
11764 *
11765 * @NgModule({
11766 *   providers: [provideRoutes(routes)]
11767 * })
11768 * class ModuleWithRoutes {}
11769 * ```
11770 *
11771 * @publicApi
11772 * @deprecated Since 9.0.0. With Ivy, this property is no longer necessary.
11773 */
11774const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents');
11775// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not
11776// explicitly set. This value will be changed to `true` in v12.
11777// TODO(misko): switch the default in v12 to `true`. See: packages/compiler/src/core.ts
11778const emitDistinctChangesOnlyDefaultValue = false;
11779/**
11780 * Base class for query metadata.
11781 *
11782 * @see `ContentChildren`.
11783 * @see `ContentChild`.
11784 * @see `ViewChildren`.
11785 * @see `ViewChild`.
11786 *
11787 * @publicApi
11788 */
11789class Query {
11790}
11791const ɵ0$1 = (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: false, descendants: false, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data));
11792/**
11793 * ContentChildren decorator and metadata.
11794 *
11795 *
11796 * @Annotation
11797 * @publicApi
11798 */
11799const ContentChildren = makePropDecorator('ContentChildren', ɵ0$1, Query);
11800const ɵ1 = (selector, data = {}) => (Object.assign({ selector, first: true, isViewQuery: false, descendants: true }, data));
11801/**
11802 * ContentChild decorator and metadata.
11803 *
11804 *
11805 * @Annotation
11806 *
11807 * @publicApi
11808 */
11809const ContentChild = makePropDecorator('ContentChild', ɵ1, Query);
11810const ɵ2 = (selector, data = {}) => (Object.assign({ selector, first: false, isViewQuery: true, descendants: true, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data));
11811/**
11812 * ViewChildren decorator and metadata.
11813 *
11814 * @Annotation
11815 * @publicApi
11816 */
11817const ViewChildren = makePropDecorator('ViewChildren', ɵ2, Query);
11818const ɵ3 = (selector, data) => (Object.assign({ selector, first: true, isViewQuery: true, descendants: true }, data));
11819/**
11820 * ViewChild decorator and metadata.
11821 *
11822 * @Annotation
11823 * @publicApi
11824 */
11825const ViewChild = makePropDecorator('ViewChild', ɵ3, Query);
11826
11827/**
11828 * @license
11829 * Copyright Google LLC All Rights Reserved.
11830 *
11831 * Use of this source code is governed by an MIT-style license that can be
11832 * found in the LICENSE file at https://angular.io/license
11833 */
11834var R3ResolvedDependencyType;
11835(function (R3ResolvedDependencyType) {
11836    R3ResolvedDependencyType[R3ResolvedDependencyType["Token"] = 0] = "Token";
11837    R3ResolvedDependencyType[R3ResolvedDependencyType["Attribute"] = 1] = "Attribute";
11838    R3ResolvedDependencyType[R3ResolvedDependencyType["ChangeDetectorRef"] = 2] = "ChangeDetectorRef";
11839    R3ResolvedDependencyType[R3ResolvedDependencyType["Invalid"] = 3] = "Invalid";
11840})(R3ResolvedDependencyType || (R3ResolvedDependencyType = {}));
11841var R3FactoryTarget;
11842(function (R3FactoryTarget) {
11843    R3FactoryTarget[R3FactoryTarget["Directive"] = 0] = "Directive";
11844    R3FactoryTarget[R3FactoryTarget["Component"] = 1] = "Component";
11845    R3FactoryTarget[R3FactoryTarget["Injectable"] = 2] = "Injectable";
11846    R3FactoryTarget[R3FactoryTarget["Pipe"] = 3] = "Pipe";
11847    R3FactoryTarget[R3FactoryTarget["NgModule"] = 4] = "NgModule";
11848})(R3FactoryTarget || (R3FactoryTarget = {}));
11849var ViewEncapsulation$1;
11850(function (ViewEncapsulation) {
11851    ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
11852    // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
11853    ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
11854    ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
11855})(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
11856
11857/**
11858 * @license
11859 * Copyright Google LLC All Rights Reserved.
11860 *
11861 * Use of this source code is governed by an MIT-style license that can be
11862 * found in the LICENSE file at https://angular.io/license
11863 */
11864function getCompilerFacade() {
11865    const globalNg = _global['ng'];
11866    if (!globalNg || !globalNg.ɵcompilerFacade) {
11867        throw new Error(`Angular JIT compilation failed: '@angular/compiler' not loaded!\n` +
11868            `  - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.\n` +
11869            `  - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?\n` +
11870            `  - Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping.`);
11871    }
11872    return globalNg.ɵcompilerFacade;
11873}
11874
11875/**
11876 * @license
11877 * Copyright Google LLC All Rights Reserved.
11878 *
11879 * Use of this source code is governed by an MIT-style license that can be
11880 * found in the LICENSE file at https://angular.io/license
11881 */
11882/**
11883 * @description
11884 *
11885 * Represents a type that a Component or other object is instances of.
11886 *
11887 * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by
11888 * the `MyCustomComponent` constructor function.
11889 *
11890 * @publicApi
11891 */
11892const Type = Function;
11893function isType(v) {
11894    return typeof v === 'function';
11895}
11896
11897/**
11898 * @license
11899 * Copyright Google LLC All Rights Reserved.
11900 *
11901 * Use of this source code is governed by an MIT-style license that can be
11902 * found in the LICENSE file at https://angular.io/license
11903 */
11904/**
11905 * Equivalent to ES6 spread, add each item to an array.
vendor: 9,635 bytes, lines 11906-12214
11906 *
11907 * @param items The items to add
11908 * @param arr The array to which you want to add the items
11909 */
11910function addAllToArray(items, arr) {
11911    for (let i = 0; i < items.length; i++) {
11912        arr.push(items[i]);
11913    }
11914}
11915/**
11916 * Determines if the contents of two arrays is identical
11917 *
11918 * @param a first array
11919 * @param b second array
11920 * @param identityAccessor Optional function for extracting stable object identity from a value in
11921 *     the array.
11922 */
11923function arrayEquals(a, b, identityAccessor) {
11924    if (a.length !== b.length)
11925        return false;
11926    for (let i = 0; i < a.length; i++) {
11927        let valueA = a[i];
11928        let valueB = b[i];
11929        if (identityAccessor) {
11930            valueA = identityAccessor(valueA);
11931            valueB = identityAccessor(valueB);
11932        }
11933        if (valueB !== valueA) {
11934            return false;
11935        }
11936    }
11937    return true;
11938}
11939/**
11940 * Flattens an array.
11941 */
11942function flatten(list, dst) {
11943    if (dst === undefined)
11944        dst = list;
11945    for (let i = 0; i < list.length; i++) {
11946        let item = list[i];
11947        if (Array.isArray(item)) {
11948            // we need to inline it.
11949            if (dst === list) {
11950                // Our assumption that the list was already flat was wrong and
11951                // we need to clone flat since we need to write to it.
11952                dst = list.slice(0, i);
11953            }
11954            flatten(item, dst);
11955        }
11956        else if (dst !== list) {
11957            dst.push(item);
11958        }
11959    }
11960    return dst;
11961}
11962function deepForEach(input, fn) {
11963    input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
11964}
11965function addToArray(arr, index, value) {
11966    // perf: array.push is faster than array.splice!
11967    if (index >= arr.length) {
11968        arr.push(value);
11969    }
11970    else {
11971        arr.splice(index, 0, value);
11972    }
11973}
11974function removeFromArray(arr, index) {
11975    // perf: array.pop is faster than array.splice!
11976    if (index >= arr.length - 1) {
11977        return arr.pop();
11978    }
11979    else {
11980        return arr.splice(index, 1)[0];
11981    }
11982}
11983function newArray(size, value) {
11984    const list = [];
11985    for (let i = 0; i < size; i++) {
11986        list.push(value);
11987    }
11988    return list;
11989}
11990/**
11991 * Remove item from array (Same as `Array.splice()` but faster.)
11992 *
11993 * `Array.splice()` is not as fast because it has to allocate an array for the elements which were
11994 * removed. This causes memory pressure and slows down code when most of the time we don't
11995 * care about the deleted items array.
11996 *
11997 * https://jsperf.com/fast-array-splice (About 20x faster)
11998 *
11999 * @param array Array to splice
12000 * @param index Index of element in array to remove.
12001 * @param count Number of items to remove.
12002 */
12003function arraySplice(array, index, count) {
12004    const length = array.length - count;
12005    while (index < length) {
12006        array[index] = array[index + count];
12007        index++;
12008    }
12009    while (count--) {
12010        array.pop(); // shrink the array
12011    }
12012}
12013/**
12014 * Same as `Array.splice(index, 0, value)` but faster.
12015 *
12016 * `Array.splice()` is not fast because it has to allocate an array for the elements which were
12017 * removed. This causes memory pressure and slows down code when most of the time we don't
12018 * care about the deleted items array.
12019 *
12020 * @param array Array to splice.
12021 * @param index Index in array where the `value` should be added.
12022 * @param value Value to add to array.
12023 */
12024function arrayInsert(array, index, value) {
12025    ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\'t insert past array end.');
12026    let end = array.length;
12027    while (end > index) {
12028        const previousEnd = end - 1;
12029        array[end] = array[previousEnd];
12030        end = previousEnd;
12031    }
12032    array[index] = value;
12033}
12034/**
12035 * Same as `Array.splice2(index, 0, value1, value2)` but faster.
12036 *
12037 * `Array.splice()` is not fast because it has to allocate an array for the elements which were
12038 * removed. This causes memory pressure and slows down code when most of the time we don't
12039 * care about the deleted items array.
12040 *
12041 * @param array Array to splice.
12042 * @param index Index in array where the `value` should be added.
12043 * @param value1 Value to add to array.
12044 * @param value2 Value to add to array.
12045 */
12046function arrayInsert2(array, index, value1, value2) {
12047    ngDevMode && assertLessThanOrEqual(index, array.length, 'Can\'t insert past array end.');
12048    let end = array.length;
12049    if (end == index) {
12050        // inserting at the end.
12051        array.push(value1, value2);
12052    }
12053    else if (end === 1) {
12054        // corner case when we have less items in array than we have items to insert.
12055        array.push(value2, array[0]);
12056        array[0] = value1;
12057    }
12058    else {
12059        end--;
12060        array.push(array[end - 1], array[end]);
12061        while (end > index) {
12062            const previousEnd = end - 2;
12063            array[end] = array[previousEnd];
12064            end--;
12065        }
12066        array[index] = value1;
12067        array[index + 1] = value2;
12068    }
12069}
12070/**
12071 * Insert a `value` into an `array` so that the array remains sorted.
12072 *
12073 * NOTE:
12074 * - Duplicates are not allowed, and are ignored.
12075 * - This uses binary search algorithm for fast inserts.
12076 *
12077 * @param array A sorted array to insert into.
12078 * @param value The value to insert.
12079 * @returns index of the inserted value.
12080 */
12081function arrayInsertSorted(array, value) {
12082    let index = arrayIndexOfSorted(array, value);
12083    if (index < 0) {
12084        // if we did not find it insert it.
12085        index = ~index;
12086        arrayInsert(array, index, value);
12087    }
12088    return index;
12089}
12090/**
12091 * Remove `value` from a sorted `array`.
12092 *
12093 * NOTE:
12094 * - This uses binary search algorithm for fast removals.
12095 *
12096 * @param array A sorted array to remove from.
12097 * @param value The value to remove.
12098 * @returns index of the removed value.
12099 *   - positive index if value found and removed.
12100 *   - negative index if value not found. (`~index` to get the value where it should have been
12101 *     inserted)
12102 */
12103function arrayRemoveSorted(array, value) {
12104    const index = arrayIndexOfSorted(array, value);
12105    if (index >= 0) {
12106        arraySplice(array, index, 1);
12107    }
12108    return index;
12109}
12110/**
12111 * Get an index of an `value` in a sorted `array`.
12112 *
12113 * NOTE:
12114 * - This uses binary search algorithm for fast removals.
12115 *
12116 * @param array A sorted array to binary search.
12117 * @param value The value to look for.
12118 * @returns index of the value.
12119 *   - positive index if value found.
12120 *   - negative index if value not found. (`~index` to get the value where it should have been
12121 *     located)
12122 */
12123function arrayIndexOfSorted(array, value) {
12124    return _arrayIndexOfSorted(array, value, 0);
12125}
12126/**
12127 * Set a `value` for a `key`.
12128 *
12129 * @param keyValueArray to modify.
12130 * @param key The key to locate or create.
12131 * @param value The value to set for a `key`.
12132 * @returns index (always even) of where the value vas set.
12133 */
12134function keyValueArraySet(keyValueArray, key, value) {
12135    let index = keyValueArrayIndexOf(keyValueArray, key);
12136    if (index >= 0) {
12137        // if we found it set it.
12138        keyValueArray[index | 1] = value;
12139    }
12140    else {
12141        index = ~index;
12142        arrayInsert2(keyValueArray, index, key, value);
12143    }
12144    return index;
12145}
12146/**
12147 * Retrieve a `value` for a `key` (on `undefined` if not found.)
12148 *
12149 * @param keyValueArray to search.
12150 * @param key The key to locate.
12151 * @return The `value` stored at the `key` location or `undefined if not found.
12152 */
12153function keyValueArrayGet(keyValueArray, key) {
12154    const index = keyValueArrayIndexOf(keyValueArray, key);
12155    if (index >= 0) {
12156        // if we found it retrieve it.
12157        return keyValueArray[index | 1];
12158    }
12159    return undefined;
12160}
12161/**
12162 * Retrieve a `key` index value in the array or `-1` if not found.
12163 *
12164 * @param keyValueArray to search.
12165 * @param key The key to locate.
12166 * @returns index of where the key is (or should have been.)
12167 *   - positive (even) index if key found.
12168 *   - negative index if key not found. (`~index` (even) to get the index where it should have
12169 *     been inserted.)
12170 */
12171function keyValueArrayIndexOf(keyValueArray, key) {
12172    return _arrayIndexOfSorted(keyValueArray, key, 1);
12173}
12174/**
12175 * Delete a `key` (and `value`) from the `KeyValueArray`.
12176 *
12177 * @param keyValueArray to modify.
12178 * @param key The key to locate or delete (if exist).
12179 * @returns index of where the key was (or should have been.)
12180 *   - positive (even) index if key found and deleted.
12181 *   - negative index if key not found. (`~index` (even) to get the index where it should have
12182 *     been.)
12183 */
12184function keyValueArrayDelete(keyValueArray, key) {
12185    const index = keyValueArrayIndexOf(keyValueArray, key);
12186    if (index >= 0) {
12187        // if we found it remove it.
12188        arraySplice(keyValueArray, index, 2);
12189    }
12190    return index;
12191}
12192/**
12193 * INTERNAL: Get an index of an `value` in a sorted `array` by grouping search by `shift`.
12194 *
12195 * NOTE:
12196 * - This uses binary search algorithm for fast removals.
12197 *
12198 * @param array A sorted array to binary search.
12199 * @param value The value to look for.
12200 * @param shift grouping shift.
12201 *   - `0` means look at every location
12202 *   - `1` means only look at every other (even) location (the odd locations are to be ignored as
12203 *         they are values.)
12204 * @returns index of the value.
12205 *   - positive index if value found.
12206 *   - negative index if value not found. (`~index` to get the value where it should have been
12207 * inserted)
12208 */
12209function _arrayIndexOfSorted(array, value, shift) {
12210    ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array');
12211    let start = 0;
12212    let end = array.length >> shift;
12213    while (end !== start) {
12214        const middle = start + ((end - start) >> 1);
12214 // find the middle.
12215        const current = array[middle << shift];
12216        if (value === current) {
12217            return (middle << shift);
12218        }
12219        else if (current > value) {
12220            end = middle;
12221        }
12222        else {
12223            start = middle + 1; // We already searched middle so make it non-inclusive by adding 1
12224        }
12225    }
12226    return ~(end << shift);
12227}
12228
12229/**
12230 * @license
12231 * Copyright Google LLC All Rights Reserved.
12232 *
12233 * Use of this source code is governed by an MIT-style license that can be
12234 * found in the LICENSE file at https://angular.io/license
12235 */
12236/*
12237 * #########################
12238 * Attention: These Regular expressions have to hold even if the code is minified!
12239 * ##########################
12240 */
12241/**
12242 * Regular expression that detects pass-through constructors for ES5 output. This Regex
12243 * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also
12244 * it intends to capture the pattern where existing constructors have been downleveled from
12245 * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g.
12246 *
12247 * ```
12248 *   function MyClass() {
12249 *     var _this = _super.apply(this, arguments) || this;
12250 * ```
12251 *
12252 * ```
12253 *   function MyClass() {
12254 *     var _this = _super.apply(this, __spread(arguments)) || this;
12255 * ```
12256 *
12257 * More details can be found in: https://github.com/angular/angular/issues/38453.
12258 */
12259const ES5_DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*(arguments|[^()]+\(arguments\))\)/;
12260/** Regular expression that detects ES2015 classes which extend from other classes. */
12261const ES2015_INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/;
12262/**
12263 * Regular expression that detects ES2015 classes which extend from other classes and
12264 * have an explicit constructor defined.
12265 */
12266const ES2015_INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/;
12267/**
12268 * Regular expression that detects ES2015 classes which extend from other classes
12269 * and inherit a constructor.
12270 */
12271const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{\s*super\(\.\.\.arguments\)/;
12272/**
12273 * Determine whether a stringified type is a class which delegates its constructor
12274 * to its parent.
12275 *
12276 * This is not trivial since compiled code can actually contain a constructor function
12277 * even if the original source code did not. For instance, when the child class contains
12278 * an initialized instance property.
12279 */
12280function isDelegateCtor(typeStr) {
12281    return ES5_DELEGATE_CTOR.test(typeStr) ||
12282        ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||
12283        (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr));
12284}
12285class ReflectionCapabilities {
12286    constructor(reflect) {
12287        this._reflect = reflect || _global['Reflect'];
12288    }
12289    isReflectionEnabled() {
12290        return true;
12291    }
12292    factory(t) {
12293        return (...args) => new t(...args);
12294    }
12295    /** @internal */
12296    _zipTypesAndAnnotations(paramTypes, paramAnnotations) {
12297        let result;
12298        if (typeof paramTypes === 'undefined') {
12299            result = newArray(paramAnnotations.length);
12300        }
12301        else {
12302            result = newArray(paramTypes.length);
12303        }
12304        for (let i = 0; i < result.length; i++) {
12305            // TS outputs Object for parameters without types, while Traceur omits
12306            // the annotations. For now we preserve the Traceur behavior to aid
12307            // migration, but this can be revisited.
12308            if (typeof paramTypes === 'undefined') {
12309                result[i] = [];
12310            }
12311            else if (paramTypes[i] && paramTypes[i] != Object) {
12312                result[i] = [paramTypes[i]];
12313            }
12314            else {
12315                result[i] = [];
12316            }
12317            if (paramAnnotations && paramAnnotations[i] != null) {
12318                result[i] = result[i].concat(paramAnnotations[i]);
12319            }
12320        }
12321        return result;
12322    }
12323    _ownParameters(type, parentCtor) {
12324        const typeStr = type.toString();
12325        // If we have no decorators, we only have function.length as metadata.
12326        // In that case, to detect whether a child class declared an own constructor or not,
12327        // we need to look inside of that constructor to check whether it is
12328        // just calling the parent.
vendor: 4,428 bytes, lines 12329-12417
12329        // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439
12330        // that sets 'design:paramtypes' to []
12331        // if a class inherits from another class but has no ctor declared itself.
12332        if (isDelegateCtor(typeStr)) {
12333            return null;
12334        }
12335        // Prefer the direct API.
12336        if (type.parameters && type.parameters !== parentCtor.parameters) {
12337            return type.parameters;
12338        }
12339        // API of tsickle for lowering decorators to properties on the class.
12340        const tsickleCtorParams = type.ctorParameters;
12341        if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {
12342            // Newer tsickle uses a function closure
12343            // Retain the non-function case for compatibility with older tsickle
12344            const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;
12345            const paramTypes = ctorParameters.map((ctorParam) => ctorParam && ctorParam.type);
12346            const paramAnnotations = ctorParameters.map((ctorParam) => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));
12347            return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
12348        }
12349        // API for metadata created by invoking the decorators.
12350        const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];
12351        const paramTypes = this._reflect && this._reflect.getOwnMetadata &&
12352            this._reflect.getOwnMetadata('design:paramtypes', type);
12353        if (paramTypes || paramAnnotations) {
12354            return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
12355        }
12356        // If a class has no decorators, at least create metadata
12357        // based on function.length.
12358        // Note: We know that this is a real constructor as we checked
12359        // the content of the constructor above.
12360        return newArray(type.length);
12361    }
12362    parameters(type) {
12363        // Note: only report metadata if we have at least one class decorator
12364        // to stay in sync with the static reflector.
12365        if (!isType(type)) {
12366            return [];
12367        }
12368        const parentCtor = getParentCtor(type);
12369        let parameters = this._ownParameters(type, parentCtor);
12370        if (!parameters && parentCtor !== Object) {
12371            parameters = this.parameters(parentCtor);
12372        }
12373        return parameters || [];
12374    }
12375    _ownAnnotations(typeOrFunc, parentCtor) {
12376        // Prefer the direct API.
12377        if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {
12378            let annotations = typeOrFunc.annotations;
12379            if (typeof annotations === 'function' && annotations.annotations) {
12380                annotations = annotations.annotations;
12381            }
12382            return annotations;
12383        }
12384        // API of tsickle for lowering decorators to properties on the class.
12385        if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {
12386            return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);
12387        }
12388        // API for metadata created by invoking the decorators.
12389        if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {
12390            return typeOrFunc[ANNOTATIONS];
12391        }
12392        return null;
12393    }
12394    annotations(typeOrFunc) {
12395        if (!isType(typeOrFunc)) {
12396            return [];
12397        }
12398        const parentCtor = getParentCtor(typeOrFunc);
12399        const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];
12400        const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];
12401        return parentAnnotations.concat(ownAnnotations);
12402    }
12403    _ownPropMetadata(typeOrFunc, parentCtor) {
12404        // Prefer the direct API.
12405        if (typeOrFunc.propMetadata &&
12406            typeOrFunc.propMetadata !== parentCtor.propMetadata) {
12407            let propMetadata = typeOrFunc.propMetadata;
12408            if (typeof propMetadata === 'function' && propMetadata.propMetadata) {
12409                propMetadata = propMetadata.propMetadata;
12410            }
12411            return propMetadata;
12412        }
12413        // API of tsickle for lowering decorators to properties on the class.
12414        if (typeOrFunc.propDecorators &&
12415            typeOrFunc.propDecorators !== parentCtor.propDecorators) {
12416            const propDecorators = typeOrFunc.propDecorators;
12417            const propMetadata = {};
12418            Object.keys(propDecorators).forEach(prop => {
12419                propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);
12420            });
12421            return propMetadata;
12422        }
12423        // API for metadata created by invoking the decorators.
12424        if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {
12425            return typeOrFunc[PROP_METADATA];
12426        }
12427        return null;
12428    }
12429    propMetadata(typeOrFunc) {
12430        if (!isType(typeOrFunc)) {
12431            return {};
12432        }
12433        const parentCtor = getParentCtor(typeOrFunc);
12434        const propMetadata = {};
12435        if (parentCtor !== Object) {
12436            const parentPropMetadata = this.propMetadata(parentCtor);
12437            Object.keys(parentPropMetadata).forEach((propName) => {
12438                propMetadata[propName] = parentPropMetadata[propName];
12439            });
12440        }
12441        const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);
12442        if (ownPropMetadata) {
12443            Object.keys(ownPropMetadata).forEach((propName) => {
12444                const decorators = [];
12445                if (propMetadata.hasOwnProperty(propName)) {
12446                    decorators.push(...propMetadata[propName]);
12447                }
12448                decorators.push(...ownPropMetadata[propName]);
12449                propMetadata[propName] = decorators;
12450            });
12451        }
12452        return propMetadata;
12453    }
12454    ownPropMetadata(typeOrFunc) {
12455        if (!isType(typeOrFunc)) {
12456            return {};
12457        }
12458        return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};
12459    }
12460    hasLifecycleHook(type, lcProperty) {
12461        return type instanceof Type && lcProperty in type.prototype;
12462    }
12463    guards(type) {
12464        return {};
12465    }
12466    getter(name) {
12467        return new Function('o', 'return o.' + name + ';');
12468    }
12469    setter(name) {
12470        return new Function('o', 'v', 'return o.' + name + ' = v;');
12471    }
12472    method(name) {
12473        const functionBody = `if (!o.${name}) throw new Error('"${name}" is undefined');
12474        return o.${name}.apply(o, args);`;
12475        return new Function('o', 'args', functionBody);
12476    }
12477    // There is not a concept of import uri in Js, but this is useful in developing Dart applications.
12478    importUri(type) {
12479        // StaticSymbol
12480        if (typeof type === 'object' && type['filePath']) {
12481            return type['filePath'];
12482        }
12483        // Runtime type
12484        return `./${stringify(type)}`;
12485    }
12486    resourceUri(type) {
12487        return `./${stringify(type)}`;
12488    }
12489    resolveIdentifier(name, moduleUrl, members, runtime) {
12490        return runtime;
12491    }
12492    resolveEnum(enumIdentifier, name) {
12493        return enumIdentifier[name];
12494    }
12495}
12496function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {
12497    if (!decoratorInvocations) {
12498        return [];
12499    }
12500    return decoratorInvocations.map(decoratorInvocation => {
12501        const decoratorType = decoratorInvocation.type;
12502        const annotationCls = decoratorType.annotationCls;
12503        const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
12504        return new annotationCls(...annotationArgs);
12505    });
12506}
12507function getParentCtor(ctor) {
12508    const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;
12509    const parentCtor = parentProto ? parentProto.constructor : null;
12510    // Note: We always use `Object` as the null value
12511    // to simplify checking later on.
12512    return parentCtor || Object;
12513}
12514
12515/**
12516 * @license
12517 * Copyright Google LLC All Rights Reserved.
12518 *
12519 * Use of this source code is governed by an MIT-style license that can be
12520 * found in the LICENSE file at https://angular.io/license
12521 */
12522const _THROW_IF_NOT_FOUND = {};
12523const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
12524/*
12525 * Name of a property (that we patch onto DI decorator), which is used as an annotation of which
12526 * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators
12527 * in the code, thus making them tree-shakable.
12528 */
12529const DI_DECORATOR_FLAG = '__NG_DI_FLAG__';
12530const NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';
12531const NG_TOKEN_PATH = 'ngTokenPath';
12532const NEW_LINE = /\n/gm;
12533const NO_NEW_LINE = 'ɵ';
12534const SOURCE = '__source';
12535const ɵ0$2 = getClosureSafeProperty;
12536const USE_VALUE = getClosureSafeProperty({ provide: String, useValue: ɵ0$2 });
12537/**
12538 * Current injector value used by `inject`.
12539 * - `undefined`: it is an error to call `inject`
12540 * - `null`: `inject` can be called but there is no injector (limp-mode).
12541 * - Injector instance: Use the injector for resolution.
12542 */
12543let _currentInjector = undefined;
12544function setCurrentInjector(injector) {
12545    const former = _currentInjector;
12546    _currentInjector = injector;
12547    return former;
12548}
12549function injectInjectorOnly(token, flags = InjectFlags.Default) {
12550    if (_currentInjector === undefined) {
12551        throw new Error(`inject() must be called from an injection context`);
12552    }
12553    else if (_currentInjector === null) {
12554        return injectRootLimpMode(token, undefined, flags);
12555    }
12556    else {
12557        return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);
12558    }
12559}
12560function ɵɵinject(token, flags = InjectFlags.Default) {
12561    return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);
12562}
12563/**
12564 * Throws an error indicating that a factory function could not be generated by the compiler for a
12565 * particular class.
12566 *
12567 * This instruction allows the actual error message to be optimized away when ngDevMode is turned
12568 * off, saving bytes of generated code while still providing a good experience in dev mode.
12569 *
12570 * The name of the class is not mentioned here, but will be in the generated factory function name
12571 * and thus in the stack trace.
12572 *
12573 * @codeGenApi
12574 */
12575function ɵɵinvalidFactoryDep(index) {
12576    const msg = ngDevMode ?
12577        `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index}
12577 of the parameter list is invalid.
12578This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.
12579
12580Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.` :
12581        'invalid';
12582    throw new Error(msg);
12583}
12584/**
12585 * Injects a token from the currently active injector.
12586 *
12587 * Must be used in the context of a factory function such as one defined for an
12588 * `InjectionToken`. Throws an error if not called from such a context.
12589 *
12590 * Within such a factory function, using this function to request injection of a dependency
12591 * is faster and more type-safe than providing an additional array of dependencies
12592 * (as has been common with `useFactory` providers).
12593 *
12594 * @param token The injection token for the dependency to be injected.
12595 * @param flags Optional flags that control how injection is executed.
12596 * The flags correspond to injection strategies that can be specified with
12597 * parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`.
12598 * @returns the injected value if injection is successful, `null` otherwise.
12599 *
12600 * @usageNotes
12601 *
12602 * ### Example
12603 *
12604 * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}
12605 *
12606 * @publicApi
12607 */
12608const inject = ɵɵinject;
12609function injectArgs(types) {
12610    const args = [];
12611    for (let i = 0; i < types.length; i++) {
12612        const arg = resolveForwardRef(types[i]);
12613        if (Array.isArray(arg)) {
12614            if (arg.length === 0) {
12615                throw new Error('Arguments array must have arguments.');
12616            }
12617            let type = undefined;
12618            let flags = InjectFlags.Default;
12619            for (let j = 0; j < arg.length; j++) {
12620                const meta = arg[j];
12621                const flag = getInjectFlag(meta);
12622                if (typeof flag === 'number') {
12623                    // Special case when we handle @Inject decorator.
12624                    if (flag === -1 /* Inject */) {
12625                        type = meta.token;
12626                    }
12627                    else {
12628                        flags |= flag;
12629                    }
12630                }
12631                else {
12632                    type = meta;
12633                }
12634            }
12635            args.push(ɵɵinject(type, flags));
12636        }
12637        else {
12638            args.push(ɵɵinject(arg));
12639        }
12640    }
12641    return args;
12642}
12643/**
12644 * Attaches a given InjectFlag to a given decorator using monkey-patching.
12645 * Since DI decorators can be used in providers `deps` array (when provider is configured using
12646 * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we
12647 * attach the flag to make it available both as a static property and as a field on decorator
12648 * instance.
12649 *
12650 * @param decorator Provided DI decorator.
12651 * @param flag InjectFlag that should be applied.
12652 */
12653function attachInjectFlag(decorator, flag) {
12654    decorator[DI_DECORATOR_FLAG] = flag;
12655    decorator.prototype[DI_DECORATOR_FLAG] = flag;
12656    return decorator;
12657}
12658/**
12659 * Reads monkey-patched property that contains InjectFlag attached to a decorator.
12660 *
12661 * @param token Token that may contain monkey-patched DI flags property.
12662 */
12663function getInjectFlag(token) {
12664    return token[DI_DECORATOR_FLAG];
12665}
12666function catchInjectorError(e, token, injectorErrorName, source) {
12667    const tokenPath = e[NG_TEMP_TOKEN_PATH];
12668    if (token[SOURCE]) {
12669        tokenPath.unshift(token[SOURCE]);
12670    }
12671    e.message = formatError('\n' + e.message, tokenPath, injectorErrorName, source);
12672    e[NG_TOKEN_PATH] = tokenPath;
12673    e[NG_TEMP_TOKEN_PATH] = null;
12674    throw e;
12675}
12676function formatError(text, obj, injectorErrorName, source = null) {
12677    text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text;
12678    let context = stringify(obj);
12679    if (Array.isArray(obj)) {
12680        context = obj.map(stringify).join(' -> ');
12681    }
12682    else if (typeof obj === 'object') {
12683        let parts = [];
12684        for (let key in obj) {
12685            if (obj.hasOwnProperty(key)) {
12686                let value = obj[key];
12687                parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));
12688            }
12689        }
12690        context = `{${parts.join(', ')}}`;
12691    }
12692    return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\n  ')}`;
12693}
12694
12695/**
12696 * @license
12697 * Copyright Google LLC All Rights Reserved.
12698 *
12699 * Use of this source code is governed by an MIT-style license that can be
12700 * found in the LICENSE file at https://angular.io/license
12701 */
12702const ɵ0$3 = (token) => ({ token });
12703/**
12704 * Inject decorator and metadata.
12705 *
12706 * @Annotation
12707 * @publicApi
12708 */
12709const Inject = attachInjectFlag(
12710// Disable tslint because `DecoratorFlags` is a const enum which gets inlined.
12711// tslint:disable-next-line: no-toplevel-property-access
12712makeParamDecorator('Inject', ɵ0$3), -1 /* Inject */);
12713/**
12714 * Optional decorator and metadata.
12715 *
12716 * @Annotation
12717 * @publicApi
12718 */
12719const Optional = 
12720// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
12721// tslint:disable-next-line: no-toplevel-property-access
12722attachInjectFlag(makeParamDecorator('Optional'), 8 /* Optional */);
12723/**
12724 * Self decorator and metadata.
12725 *
12726 * @Annotation
12727 * @publicApi
12728 */
12729const Self = 
12730// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
12731// tslint:disable-next-line: no-toplevel-property-access
12732attachInjectFlag(makeParamDecorator('Self'), 2 /* Self */);
12733/**
12734 * `SkipSelf` decorator and metadata.
12735 *
12736 * @Annotation
12737 * @publicApi
12738 */
12739const SkipSelf = 
12740// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
12741// tslint:disable-next-line: no-toplevel-property-access
12742attachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* SkipSelf */);
12743/**
12744 * Host decorator and metadata.
12745 *
12746 * @Annotation
12747 * @publicApi
12748 */
12749const Host = 
12750// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
12751// tslint:disable-next-line: no-toplevel-property-access
12752attachInjectFlag(makeParamDecorator('Host'), 1 /* Host */);
12753
12754/**
12755 * @license
12756 * Copyright Google LLC All Rights Reserved.
12757 *
12758 * Use of this source code is governed by an MIT-style license that can be
12759 * found in the LICENSE file at https://angular.io/license
12760 */
12761let _reflect = null;
12762function getReflect() {
12763    return (_reflect = _reflect || new ReflectionCapabilities());
12764}
12765function reflectDependencies(type) {
12766    return convertDependencies(getReflect().parameters(type));
12767}
12768function convertDependencies(deps) {
12769    const compiler = getCompilerFacade();
12770    return deps.map(dep => reflectDependency(compiler, dep));
12771}
12772function reflectDependency(compiler, dep) {
12773    const meta = {
12774        token: null,
12775        host: false,
12776        optional: false,
12777        resolved: compiler.R3ResolvedDependencyType.Token,
12778        self: false,
12779        skipSelf: false,
12780    };
12781    function setTokenAndResolvedType(token) {
12782        meta.resolved = compiler.R3ResolvedDependencyType.Token;
12783        meta.token = token;
12784    }
12785    if (Array.isArray(dep) && dep.length > 0) {
12786        for (let j = 0; j < dep.length; j++) {
12787            const param = dep[j];
12788            if (param === undefined) {
12789                // param may be undefined if type of dep is not set by ngtsc
12790                continue;
12791            }
12792            const proto = Object.getPrototypeOf(param);
12793            if (param instanceof Optional || proto.ngMetadataName === 'Optional') {
12794                meta.optional = true;
12795            }
12796            else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {
12797                meta.skipSelf = true;
12798            }
12799            else if (param instanceof Self || proto.ngMetadataName === 'Self') {
12800                meta.self = true;
12801            }
12802            else if (param instanceof Host || proto.ngMetadataName === 'Host') {
12803                meta.host = true;
12804            }
12805            else if (param instanceof Inject) {
12806                meta.token = param.token;
12807            }
12808            else if (param instanceof Attribute) {
12809                if (param.attributeName === undefined) {
12810                    throw new Error(`Attribute name must be defined.`);
12811                }
12812                meta.token = param.attributeName;
12813                meta.resolved = compiler.R3ResolvedDependencyType.Attribute;
12814            }
12815            else if (param.__ChangeDetectorRef__ === true) {
12816                meta.token = param;
12817                meta.resolved = compiler.R3ResolvedDependencyType.ChangeDetectorRef;
12818            }
12819            else {
12820                setTokenAndResolvedType(param);
12821            }
12822        }
12823    }
12824    else if (dep === undefined || (Array.isArray(dep) && dep.length === 0)) {
12825        meta.token = undefined;
12826        meta.resolved = R3ResolvedDependencyType.Invalid;
12827    }
12828    else {
12829        setTokenAndResolvedType(dep);
12830    }
12831    return meta;
12832}
12833
12834/**
12835 * @license
12836 * Copyright Google LLC All Rights Reserved.
12837 *
12838 * Use of this source code is governed by an MIT-style license that can be
12839 * found in the LICENSE file at https://angular.io/license
12840 */
12841/**
12842 * Used to resolve resource URLs on `@Component` when used with JIT compilation.
12843 *
12844 * Example:
12845 * ```
12846 * @Component({
12847 *   selector: 'my-comp',
12848 *   templateUrl: 'my-comp.html', // This requires asynchronous resolution
12849 * })
12850 * class MyComponent{
12851 * }
12852 *
12853 * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process
12854 * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.
12855 *
12856 * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into
12857 * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.
12858 *
12859 * // Use browser's `fetch()` function as the default resource resolution strategy.
12860 * resolveComponentResources(fetch).then(() => {
12861 *   // After resolution all URLs have been converted into `template` strings.
12862 *   renderComponent(MyComponent);
12863 * });
12864 *
12865 * ```
12866 *
12867 * NOTE: In AOT the resolution happens during compilation, and so there should be no need
12868 * to call this method outside JIT mode.
12869 *
12870 * @param resourceResolver a function which is responsible for returning a `Promise` to the
12871 * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.
12872 */
12873function resolveComponentResources(resourceResolver) {
12874    // Store all promises which are fetching the resources.
12875    const componentResolved = [];
12876    // Cache so that we don't fetch the same resource more than once.
12877    const urlMap = new Map();
12878    function cachedResourceResolve(url) {
12879        let promise = urlMap.get(url);
12880        if (!promise) {
12881            const resp = resourceResolver(url);
12882            urlMap.set(url, promise = resp.then(unwrapResponse));
12883        }
12884        return promise;
12885    }
12886    componentResourceResolutionQueue.forEach((component, type) => {
12887        const promises = [];
12888        if (component.templateUrl) {
12889            promises.push(cachedResourceResolve(component.templateUrl).then((template) => {
12890                component.template = template;
12891            }));
12892        }
12893        const styleUrls = component.styleUrls;
12894        const styles = component.styles || (component.styles = []);
12895        const styleOffset = component.styles.length;
12896        styleUrls && styleUrls.forEach((styleUrl, index) => {
12897            styles.push(''); // pre-allocate array.
12898            promises.push(cachedResourceResolve(styleUrl).then((style) => {
12899                styles[styleOffset + index] = style;
12900                styleUrls.splice(styleUrls.indexOf(styleUrl), 1);
12901                if (styleUrls.length == 0) {
12902                    component.styleUrls = undefined;
12903                }
12904            }));
12905        });
12906        const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type));
12907        componentResolved.push(fullyResolved);
12908    });
12909    clearResolutionOfComponentResourcesQueue();
12910    return Promise.all(componentResolved).then(() => undefined);
12911}
12912let componentResourceResolutionQueue = new Map();
12913// Track when existing ɵcmp for a Type is waiting on resources.
12914const componentDefPendingResolution = new Set();
12915function maybeQueueResolutionOfComponentResources(type, metadata) {
12916    if (componentNeedsResolution(metadata)) {
12917        componentResourceResolutionQueue.set(type, metadata);
12918        componentDefPendingResolution.add(type);
12919    }
12920}
12921function isComponentDefPendingResolution(type) {
12922    return componentDefPendingResolution.has(type);
12923}
12924function componentNeedsResolution(component) {
12925    return !!((component.templateUrl && !component.hasOwnProperty('template')) ||
12926        component.styleUrls && component.styleUrls.length);
12927}
12928function clearResolutionOfComponentResourcesQueue() {
12929    const old = componentResourceResolutionQueue;
12930    componentResourceResolutionQueue = new Map();
12931    return old;
12932}
12933function restoreComponentResolutionQueue(queue) {
12934    componentDefPendingResolution.clear();
12935    queue.forEach((_, type) => componentDefPendingResolution.add(type));
12936    componentResourceResolutionQueue = queue;
12937}
12938function isComponentResourceResolutionQueueEmpty() {
12939    return componentResourceResolutionQueue.size === 0;
12940}
12941function unwrapResponse(response) {
12942    return typeof response == 'string' ? response : response.text();
12943}
12944function componentDefResolved(type) {
12945    componentDefPendingResolution.delete(type);
12946}
12947
12948/**
12949 * @license
12950 * Copyright Google LLC All Rights Reserved.
12951 *
12952 * Use of this source code is governed by an MIT-style license that can be
12953 * found in the LICENSE file at https://angular.io/license
12954 */
12955/**
12956 * The Trusted Types policy, or null if Trusted Types are not
12957 * enabled/supported, or undefined if the policy has not been created yet.
12958 */
12959let policy;
12960/**
12961 * Returns the Trusted Types policy, or null if Trusted Types are not
12962 * enabled/supported. The first call to this function will create the policy.
12963 */
12964function getPolicy() {
12965    if (policy === undefined) {
12966        policy = null;
12967        if (_global.trustedTypes) {
12968            try {
12969                policy = _global.trustedTypes.createPolicy('angular', {
12970                    createHTML: (s) => s,
12971                    createScript: (s) => s,
12972                    createScriptURL: (s) => s,
12973                });
12974            }
12975            catch (_a) {
12976                // trustedTypes.createPolicy throws if called with a name that is
12977                // already registered, even in report-only mode. Until the API changes,
12978                // catch the error not to break the applications functionally. In such
12979                // cases, the code will fall back to using strings.
12980            }
12981        }
12982    }
12983    return policy;
12984}
12985/**
12986 * Unsafely promote a string to a TrustedHTML, falling back to strings when
12987 * Trusted Types are not available.
12988 * @security This is a security-sensitive function; any use of this function
12989 * must go through security review. In particular, it must be assured that the
12990 * provided string will never cause an XSS vulnerability if used in a context
12991 * that will be interpreted as HTML by a browser, e.g. when assigning to
12992 * element.innerHTML.
12993 */
12994function trustedHTMLFromString(html) {
12995    var _a;
12996    return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createHTML(html)) || html;
12997}
12998/**
12999 * Unsafely promote a string to a TrustedScript, falling back to strings when
13000 * Trusted Types are not available.
13001 * @security In particular, it must be assured that the provided string will
13002 * never cause an XSS vulnerability if used in a context that will be
13003 * interpreted and executed as a script by a browser, e.g. when calling eval.
13004 */
13005function trustedScriptFromString(script) {
13006    var _a;
13007    return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;
13008}
13009/**
13010 * Unsafely promote a string to a TrustedScriptURL, falling back to strings
13011 * when Trusted Types are not available.
13012 * @security This is a security-sensitive function; any use of this function
13013 * must go through security review. In particular, it must be assured that the
13014 * provided string will never cause an XSS vulnerability if used in a context
13015 * that will cause a browser to load and execute a resource, e.g. when
13016 * assigning to script.src.
13017 */
13018function trustedScriptURLFromString(url) {
13019    var _a;
13020    return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScriptURL(url)) || url;
13021}
13022/**
13023 * Unsafely call the Function constructor with the given string arguments. It
13024 * is only available in development mode, and should be stripped out of
13025 * production code.
13026 * @security This is a security-sensitive function; any use of this function
13027 * must go through security review. In particular, it must be assured that it
13028 * is only called from development code, as use in production code can lead to
13029 * XSS vulnerabilities.
13030 */
13031function newTrustedFunctionForDev(...args) {
13032    if (typeof ngDevMode === 'undefined') {
13033        throw new Error('newTrustedFunctionForDev should never be called in production');
13034    }
13035    if (!_global.trustedTypes) {
13036        // In environments that don't support Trusted Types, fall back to the most
13037        // straightforward implementation:
13038        return new Function(...args);
13039    }
13040    // Chrome currently does not support passing TrustedScript to the Function
13041    // constructor. The following implements the workaround proposed on the page
13042    // below, where the Chromium bug is also referenced:
13043    // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor
13044    const fnArgs = args.slice(0, -1).join(',');
13045    const fnBody = args[args.length - 1];
13046    const body = `(function anonymous(${fnArgs}
13047) { ${fnBody}
13048})`;
13049    // Using eval directly confuses the compiler and prevents this module from
13050    // being stripped out of JS binaries even if not used. The global['eval']
13051    // indirection fixes that.
13052    const fn = _global['eval'](trustedScriptFromString(body));
13053    if (fn.bind === undefined) {
13054        // Workaround for a browser bug that only exists in Chrome 83, where passing
13055        // a TrustedScript to eval just returns the TrustedScript back without
13056        // evaluating it. In that case, fall back to the most straightforward
13057        // implementation:
13058        return new Function(...args);
13059    }
13060    // To completely mimic the behavior of calling "new Function", two more
13061    // things need to happen:
13062    // 1. Stringifying the resulting function should return its source code
13063    fn.toString = () => body;
13064    // 2. When calling the resulting function, `this` should refer to `global`
13065    return fn.bind(_global);
13066    // When Trusted Types support in Function constructors is widely available,
13067    // the implementation of this function can be simplified to:
13068    // return new Function(...args.map(a => trustedScriptFromString(a)));
13069}
13070
13071/**
13072 * @license
13073 * Copyright Google LLC All Rights Reserved.
13074 *
13075 * Use of this source code is governed by an MIT-style license that can be
13076 * found in the LICENSE file at https://angular.io/license
13077 */
13078/**
13079 * The Trusted Types policy, or null if Trusted Types are not
13080 * enabled/supported, or undefined if the policy has not been created yet.
13081 */
13082let policy$1;
13083/**
13084 * Returns the Trusted Types policy, or null if Trusted Types are not
13085 * enabled/supported. The first call to this function will create the policy.
13086 */
13087function getPolicy$1() {
13088    if (policy$1 === undefined) {
13089        policy$1 = null;
13090        if (_global.trustedTypes) {
13091            try {
13092                policy$1 = _global.trustedTypes
13093                    .createPolicy('angular#unsafe-bypass', {
13094                    createHTML: (s) => s,
13095                    createScript: (s) => s,
13096                    createScriptURL: (s) => s,
13097                });
13098            }
13099            catch (_a) {
13100                // trustedTypes.createPolicy throws if called with a name that is
13101                // already registered, even in report-only mode. Until the API changes,
13102                // catch the error not to break the applications functionally. In such
13103                // cases, the code will fall back to using strings.
13104            }
13105        }
13106    }
13107    return policy$1;
13108}
13109/**
13110 * Unsafely promote a string to a TrustedHTML, falling back to strings when
13111 * Trusted Types are not available.
13112 * @security This is a security-sensitive function; any use of this function
13113 * must go through security review. In particular, it must be assured that it
13114 * is only passed strings that come directly from custom sanitizers or the
13115 * bypassSecurityTrust* functions.
13116 */
13117function trustedHTMLFromStringBypass(html) {
13118    var _a;
13119    return ((_a = getPolicy$1()) === null || _a === void 0 ? void 0 : _a.createHTML(html)) || html;
13120}
13121/**
13122 * Unsafely promote a string to a TrustedScript, falling back to strings when
13123 * Trusted Types are not available.
13124 * @security This is a security-sensitive function; any use of this function
13125 * must go through security review. In particular, it must be assured that it
13126 * is only passed strings that come directly from custom sanitizers or the
13127 * bypassSecurityTrust* functions.
13128 */
13129function trustedScriptFromStringBypass(script) {
13130    var _a;
13131    return ((_a = getPolicy$1()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;
13132}
13133/**
13134 * Unsafely promote a string to a TrustedScriptURL, falling back to strings
13135 * when Trusted Types are not available.
13136 * @security This is a security-sensitive function; any use of this function
13137 * must go through security review. In particular, it must be assured that it
13138 * is only passed strings that come directly from custom sanitizers or the
13139 * bypassSecurityTrust* functions.
13140 */
13141function trustedScriptURLFromStringBypass(url) {
13142    var _a;
13143    return ((_a = getPolicy$1()) === null || _a === void 0 ? void 0 : _a.createScriptURL(url)) || url;
13144}
13145
13146/**
13147 * @license
13148 * Copyright Google LLC All Rights Reserved.
13149 *
13150 * Use of this source code is governed by an MIT-style license that can be
13151 * found in the LICENSE file at https://angular.io/license
13152 */
13153class SafeValueImpl {
13154    constructor(changingThisBreaksApplicationSecurity) {
13155        this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;
13156    }
13157    toString() {
13158        return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +
13159            ` (see https://g.co/ng/security#xss)`;
13160    }
13161}
13162class SafeHtmlImpl extends SafeValueImpl {
13163    getTypeName() {
13164        return "HTML" /* Html */;
13165    }
13166}
13167class SafeStyleImpl extends SafeValueImpl {
13168    getTypeName() {
13169        return "Style" /* Style */;
13170    }
13171}
13172class SafeScriptImpl extends SafeValueImpl {
13173    getTypeName() {
13174        return "Script" /* Script */;
13175    }
13176}
13177class SafeUrlImpl extends SafeValueImpl {
13178    getTypeName() {
13179        return "URL" /* Url */;
13180    }
13181}
13182class SafeResourceUrlImpl extends SafeValueImpl {
13183    getTypeName() {
13184        return "ResourceURL" /* ResourceUrl */;
13185    }
13186}
13187function unwrapSafeValue(value) {
13188    return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity :
13189        value;
13190}
13191function allowSanitizationBypassAndThrow(value, type) {
13192    const actualType = getSanitizationBypassType(value);
13193    if (actualType != null && actualType !== type) {
13194        // Allow ResourceURLs in URL contexts, they are strictly more trusted.
13195        if (actualType === "ResourceURL" /* ResourceUrl */ && type === "URL" /* Url */)
13196            return true;
13197        throw new Error(`Required a safe ${type}, got a ${actualType} (see https://g.co/ng/security#xss)`);
13198    }
13199    return actualType === type;
13200}
13201function getSanitizationBypassType(value) {
13202    return value instanceof SafeValueImpl && value.getTypeName() || null;
13203}
13204/**
13205 * Mark `html` string as trusted.
13206 *
13207 * This function wraps the trusted string in `String` and brands it in a way which makes it
13208 * recognizable to {@link htmlSanitizer} to be trusted implicitly.
13209 *
13210 * @param trustedHtml `html` string which needs to be implicitly trusted.
13211 * @returns a `html` which has been branded to be implicitly trusted.
13212 */
13213function bypassSanitizationTrustHtml(trustedHtml) {
13214    return new SafeHtmlImpl(trustedHtml);
13215}
13216/**
13217 * Mark `style` string as trusted.
13218 *
13219 * This function wraps the trusted string in `String` and brands it in a way which makes it
13220 * recognizable to {@link styleSanitizer} to be trusted implicitly.
13221 *
13222 * @param trustedStyle `style` string which needs to be implicitly trusted.
13223 * @returns a `style` hich has been branded to be implicitly trusted.
13224 */
13225function bypassSanitizationTrustStyle(trustedStyle) {
13226    return new SafeStyleImpl(trustedStyle);
13227}
13228/**
13229 * Mark `script` string as trusted.
13230 *
13231 * This function wraps the trusted string in `String` and brands it in a way which makes it
13232 * recognizable to {@link scriptSanitizer} to be trusted implicitly.
13233 *
13234 * @param trustedScript `script` string which needs to be implicitly trusted.
13235 * @returns a `script` which has been branded to be implicitly trusted.
13236 */
13237function bypassSanitizationTrustScript(trustedScript) {
13238    return new SafeScriptImpl(trustedScript);
13239}
13240/**
13241 * Mark `url` string as trusted.
13242 *
13243 * This function wraps the trusted string in `String` and brands it in a way which makes it
13244 * recognizable to {@link urlSanitizer} to be trusted implicitly.
13245 *
13246 * @param trustedUrl `url` string which needs to be implicitly trusted.
13247 * @returns a `url`  which has been branded to be implicitly trusted.
13248 */
13249function bypassSanitizationTrustUrl(trustedUrl) {
13250    return new SafeUrlImpl(trustedUrl);
13251}
13252/**
13253 * Mark `url` string as trusted.
13254 *
13255 * This function wraps the trusted string in `String` and brands it in a way which makes it
13256 * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.
13257 *
13258 * @param trustedResourceUrl `url` string which needs to be implicitly trusted.
13259 * @returns a `url` which has been branded to be implicitly trusted.
13260 */
13261function bypassSanitizationTrustResourceUrl(trustedResourceUrl) {
13262    return new SafeResourceUrlImpl(trustedResourceUrl);
13263}
13264
13265/**
13266 * @license
13267 * Copyright Google LLC All Rights Reserved.
13268 *
13269 * Use of this source code is governed by an MIT-style license that can be
13270 * found in the LICENSE file at https://angular.io/license
13271 */
13272/**
13273 * This helper is used to get hold of an inert tree of DOM elements containing dirty HTML
13274 * that needs sanitizing.
13275 * Depending upon browser support we use one of two strategies for doing this.
13276 * Default: DOMParser strategy
13277 * Fallback: InertDocument strategy
13278 */
13279function getInertBodyHelper(defaultDoc) {
13280    const inertDocumentHelper = new InertDocumentHelper(defaultDoc);
13281    return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;
13282}
13283/**
13284 * Uses DOMParser to create and fill an inert body element.
13285 * This is the default strategy used in browsers that support it.
13286 */
13287class DOMParserHelper {
13288    constructor(inertDocumentHelper) {
13289        this.inertDocumentHelper = inertDocumentHelper;
13290    }
13291    getInertBodyElement(html) {
13292        // We add these extra elements to ensure that the rest of the content is parsed as expected
13293        // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
13294        // `<head>` tag. Note that the `<body>` tag is closed implicitly to prevent unclosed tags
13295        // in `html` from consuming the otherwise explicit `</body>` tag.
13296        html = '<body><remove></remove>' + html;
13297        try {
13298            const body = new window.DOMParser()
13299                .parseFromString(trustedHTMLFromString(html), 'text/html')
13300                .body;
13301            if (body === null) {
13302                // In some browsers (e.g. Mozilla/5.0 iPad AppleWebKit Mobile) the `body` property only
13303                // becomes available in the following tick of the JS engine. In that case we fall back to
13304                // the `inertDocumentHelper` instead.
13305                return this.inertDocumentHelper.getInertBodyElement(html);
13306            }
13307            body.removeChild(body.firstChild);
13308            return body;
13309        }
13310        catch (_a) {
13311            return null;
13312        }
13313    }
13314}
13315/**
13316 * Use an HTML5 `template` element, if supported, or an inert body element created via
13317 * `createHtmlDocument` to create and fill an inert DOM element.
13318 * This is the fallback strategy if the browser does not support DOMParser.
13319 */
13320class InertDocumentHelper {
13321    constructor(defaultDoc) {
13322        this.defaultDoc = defaultDoc;
13323        this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');
13324        if (this.inertDocument.body == null) {
13325            // usually there should be only one body element in the document, but IE doesn't have any, so
13326            // we need to create one.
13327            const inertHtml = this.inertDocument.createElement('html');
13328            this.inertDocument.appendChild(inertHtml);
13329            const inertBodyElement = this.inertDocument.createElement('body');
13330            inertHtml.appendChild(inertBodyElement);
13331        }
13332    }
13333    getInertBodyElement(html) {
13334        // Prefer using <template> element if supported.
13335        const templateEl = this.inertDocument.createElement('template');
13336        if ('content' in templateEl) {
13337            templateEl.innerHTML = trustedHTMLFromString(html);
13338            return templateEl;
13339        }
13340        // Note that previously we used to do something like `this.inertDocument.body.innerHTML = html`
13341        // and we returned the inert `body` node. This was changed, because IE seems to treat setting
13342        // `innerHTML` on an inserted element differently, compared to one that hasn't been inserted
13343        // yet. In particular, IE appears to split some of the text into multiple text nodes rather
13344        // than keeping them in a single one which ends up messing with Ivy's i18n parsing further
13345        // down the line. This has been worked around by creating a new inert `body` and using it as
13346        // the root node in which we insert the HTML.
13347        const inertBody = this.inertDocument.createElement('body');
13348        inertBody.innerHTML = trustedHTMLFromString(html);
13349        // Support: IE 11 only
13350        // strip custom-namespaced attributes on IE<=11
13351        if (this.defaultDoc.documentMode) {
13352            this.stripCustomNsAttrs(inertBody);
13353        }
13354        return inertBody;
13355    }
13356    /**
13357     * When IE11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'
13358     * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.
13359     * 'ns1:xlink:foo').
13360     *
13361     * This is undesirable since we don't want to allow any of these custom attributes. This method
13362     * strips them all.
13363     */
13364    stripCustomNsAttrs(el) {
13365        const elAttrs = el.attributes;
13366        // loop backwards so that we can support removals.
13367        for (let i = elAttrs.length - 1; 0 < i; i--) {
13368            const attrib = elAttrs.item(i);
13369            const attrName = attrib.name;
13370            if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {
13371                el.removeAttribute(attrName);
13372            }
13373        }
13374        let childNode = el.firstChild;
13375        while (childNode) {
13376            if (childNode.nodeType === Node.ELEMENT_NODE)
13377                this.stripCustomNsAttrs(childNode);
13378            childNode = childNode.nextSibling;
13379        }
13380    }
13381}
13382/**
13383 * We need to determine whether the DOMParser exists in the global context and
13384 * supports parsing HTML; HTML parsing support is not as wide as other formats, see
13385 * https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Browser_compatibility.
13386 *
13387 * @suppress {uselessCode}
13388 */
13389function isDOMParserAvailable() {
13390    try {
13391        return !!new window.DOMParser().parseFromString(trustedHTMLFromString(''), 'text/html');
13392    }
13393    catch (_a) {
13394        return false;
13395    }
13396}
13397
13398/**
13399 * @license
13400 * Copyright Google LLC All Rights Reserved.
13401 *
13402 * Use of this source code is governed by an MIT-style license that can be
13403 * found in the LICENSE file at https://angular.io/license
13404 */
13405/**
13406 * A pattern that recognizes a commonly useful subset of URLs that are safe.
13407 *
13408 * This regular expression matches a subset of URLs that will not cause script
13409 * execution if used in URL context within a HTML document. Specifically, this
13410 * regular expression matches if (comment from here on and regex copied from
13411 * Soy's EscapingConventions):
13412 * (1) Either an allowed protocol (http, https, mailto or ftp).
13413 * (2) or no protocol.  A protocol must be followed by a colon. The below
13414 *     allows that by allowing colons only after one of the characters [/?#].
13415 *     A colon after a hash (#) must be in the fragment.
13416 *     Otherwise, a colon after a (?) must be in a query.
13417 *     Otherwise, a colon after a single solidus (/) must be in a path.
13418 *     Otherwise, a colon after a double solidus (//) must be in the authority
13419 *     (before port).
13420 *
13421 * The pattern disallows &, used in HTML entity declarations before
13422 * one of the characters in [/?#]. This disallows HTML entities used in the
13423 * protocol name, which should never happen, e.g. "h&#116;tp" for "http".
13424 * It also disallows HTML entities in the first path part of a relative path,
13425 * e.g. "foo&lt;bar/baz".  Our existing escaping functions should not produce
13426 * that. More importantly, it disallows masking of a colon,
13427 * e.g. "javascript&#58;...".
13428 *
13429 * This regular expression was taken from the Closure sanitization library.
13430 */
13431const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
13432/* A pattern that matches safe srcset values */
13433const SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi;
13434/** A pattern that matches safe data URLs. Only matches image, video and audio types. */
13435const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;
13436function _sanitizeUrl(url) {
13437    url = String(url);
13438    if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN))
13439        return url;
13440    if (typeof ngDevMode === 'undefined' || ngDevMode) {
13441        console.warn(`WARNING: sanitizing unsafe URL value ${url} (see https://g.co/ng/security#xss)`);
13442    }
13443    return 'unsafe:' + url;
13444}
13445function sanitizeSrcset(srcset) {
13446    srcset = String(srcset);
13447    return srcset.split(',').map((srcset) => _sanitizeUrl(srcset.trim())).join(', ');
13448}
13449
13450/**
13451 * @license
13452 * Copyright Google LLC All Rights Reserved.
13453 *
13454 * Use of this source code is governed by an MIT-style license that can be
13455 * found in the LICENSE file at https://angular.io/license
13456 */
13457function tagSet(tags) {
13458    const res = {};
13459    for (const t of tags.split(','))
13460        res[t] = true;
13461    return res;
13462}
13463function merge(...sets) {
13464    const res = {};
13465    for (const s of sets) {
13466        for (const v in s) {
13467            if (s.hasOwnProperty(v))
13468                res[v] = true;
13469        }
13470    }
13471    return res;
13472}
13473// Good source of info about elements and attributes
13474// https://html.spec.whatwg.org/#semantics
13475// https://simon.html5.org/html-elements
13476// Safe Void Elements - HTML5
13477// https://html.spec.whatwg.org/#void-elements
13478const VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');
13479// Elements that you can, intentionally, leave open (and which close themselves)
13480// https://html.spec.whatwg.org/#optional-tags
13481const OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');
13482const OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');
13483const OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);
13484// Safe Block Elements - HTML5
13485const BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +
13486    'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
13487    'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));
13488// Inline Elements - HTML5
13489const INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +
13490    'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +
13491    'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));
13492const VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);
13493// Attributes that have href and hence need to be sanitized
13494const URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');
13495// Attributes that have special href set hence need to be sanitized
13496const SRCSET_ATTRS = tagSet('srcset');
13497const HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +
13498    'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +
13499    'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +
13500    'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +
13501    'valign,value,vspace,width');
13502// Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018)
13503const ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' +
13504    'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' +
13505    'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' +
13506    'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' +
13507    'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' +
13508    'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' +
13509    'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext');
13510// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security
13511// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via
13512// innerHTML is required, SVG attributes should be added here.
13513// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those
13514// can be sanitized, but they increase security surface area without a legitimate use case, so they
13515// are left out here.
13516const VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS, ARIA_ATTRS);
13517// Elements whose content should not be traversed/preserved, if the elements themselves are invalid.
13518//
13519// Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)
13520// `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we
13521// don't want to preserve the content, if the elements themselves are going to be removed.
13522const SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');
13523/**
13524 * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe
13525 * attributes.
13526 */
13527class SanitizingHtmlSerializer {
13528    constructor() {
13529        // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just
13530        // because characters were re-encoded.
13531        this.sanitizedSomething = false;
13532        this.buf = [];
13533    }
13534    sanitizeChildren(el) {
13535        // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.
13536        // However this code never accesses properties off of `document` before deleting its contents
13537        // again, so it shouldn't be vulnerable to DOM clobbering.
13538        let current = el.firstChild;
13539        let traverseContent = true;
13540        while (current) {
13541            if (current.nodeType === Node.ELEMENT_NODE) {
13542                traverseContent = this.startElement(current);
13543            }
13544            else if (current.nodeType === Node.TEXT_NODE) {
13545                this.chars(current.nodeValue);
13546            }
13547            else {
13548                // Strip non-element, non-text nodes.
13549                this.sanitizedSomething = true;
13550            }
13551            if (traverseContent && current.firstChild) {
13552                current = current.firstChild;
13553                continue;
13554            }
13555            while (current) {
13556                // Leaving the element. Walk up and to the right, closing tags as we go.
13557                if (current.nodeType === Node.ELEMENT_NODE) {
13558                    this.endElement(current);
13559                }
13560                let next = this.checkClobberedElement(current, current.nextSibling);
13561                if (next) {
13562                    current = next;
13563                    break;
13564                }
13565                current = this.checkClobberedElement(current, current.parentNode);
13566            }
13567        }
13568        return this.buf.join('');
13569    }
13570    /**
13571     * Sanitizes an opening element tag (if valid) and returns whether the element's contents should
13572     * be traversed. Element content must always be traversed (even if the element itself is not
13573     * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.
13574     *
13575     * @param element The element to sanitize.
13576     * @return True if the element's contents should be traversed.
13577     */
13578    startElement(element) {
13579        const tagName = element.nodeName.toLowerCase();
13580        if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {
13581            this.sanitizedSomething = true;
13582            return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);
13583        }
13584        this.buf.push('<');
13585        this.buf.push(tagName);
13586        const elAttrs = element.attributes;
13587        for (let i = 0; i < elAttrs.length; i++) {
13588            const elAttr = elAttrs.item(i);
13589            const attrName = elAttr.name;
13590            const lower = attrName.toLowerCase();
13591            if (!VALID_ATTRS.hasOwnProperty(lower)) {
13592                this.sanitizedSomething = true;
13593                continue;
13594            }
13595            let value = elAttr.value;
13596            // TODO(martinprobst): Special case image URIs for data:image/...
13597            if (URI_ATTRS[lower])
13598                value = _sanitizeUrl(value);
13599            if (SRCSET_ATTRS[lower])
13600                value = sanitizeSrcset(value);
13601            this.buf.push(' ', attrName, '="', encodeEntities(value), '"');
13602        }
13603        this.buf.push('>');
13604        return true;
13605    }
13606    endElement(current) {
13607        const tagName = current.nodeName.toLowerCase();
13608        if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {
13609            this.buf.push('</');
13610            this.buf.push(tagName);
13611            this.buf.push('>');
13612        }
13613    }
13614    chars(chars) {
13615        this.buf.push(encodeEntities(chars));
13616    }
13617    checkClobberedElement(node, nextNode) {
13618        if (nextNode &&
13619            (node.compareDocumentPosition(nextNode) &
13620                Node.DOCUMENT_POSITION_CONTAINED_BY) === Node.DOCUMENT_POSITION_CONTAINED_BY) {
13621            throw new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`);
13622        }
13623        return nextNode;
13624    }
13625}
13626// Regular Expressions for parsing tags and attributes
13627const SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
13628// ! to ~ is the ASCII range.
13629const NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g;
13630/**
13631 * Escapes all potentially dangerous characters, so that the
13632 * resulting string can be safely inserted into attribute or
13633 * element text.
13634 * @param value
13635 */
13636function encodeEntities(value) {
13637    return value.replace(/&/g, '&amp;')
13638        .replace(SURROGATE_PAIR_REGEXP, function (match) {
vendor: 8,826 bytes, lines 13639-13860
13639        const hi = match.charCodeAt(0);
13640        const low = match.charCodeAt(1);
13641        return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
13642    })
13643        .replace(NON_ALPHANUMERIC_REGEXP, function (match) {
13644        return '&#' + match.charCodeAt(0) + ';';
13645    })
13646        .replace(/</g, '&lt;')
13647        .replace(/>/g, '&gt;');
13648}
13649let inertBodyHelper;
13650/**
13651 * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to
13652 * the DOM in a browser environment.
13653 */
13654function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
13655    let inertBodyElement = null;
13656    try {
13657        inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);
13658        // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).
13659        let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';
13660        inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
13661        // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser
13662        // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.
13663        let mXSSAttempts = 5;
13664        let parsedHtml = unsafeHtml;
13665        do {
13666            if (mXSSAttempts === 0) {
13667                throw new Error('Failed to sanitize html because the input is unstable');
13668            }
13669            mXSSAttempts--;
13670            unsafeHtml = parsedHtml;
13671            parsedHtml = inertBodyElement.innerHTML;
13672            inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
13673        } while (unsafeHtml !== parsedHtml);
13674        const sanitizer = new SanitizingHtmlSerializer();
13675        const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);
13676        if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {
13677            console.warn('WARNING: sanitizing HTML stripped some content, see https://g.co/ng/security#xss');
13678        }
13679        return trustedHTMLFromString(safeHtml);
13680    }
13681    finally {
13682        // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.
13683        if (inertBodyElement) {
13684            const parent = getTemplateContent(inertBodyElement) || inertBodyElement;
13685            while (parent.firstChild) {
13686                parent.removeChild(parent.firstChild);
13687            }
13688        }
13689    }
13690}
13691function getTemplateContent(el) {
13692    return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el) ?
13693        el.content :
13694        null;
13695}
13696function isTemplateElement(el) {
13697    return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';
13698}
13699
13700/**
13701 * @license
13702 * Copyright Google LLC All Rights Reserved.
13703 *
13704 * Use of this source code is governed by an MIT-style license that can be
13705 * found in the LICENSE file at https://angular.io/license
13706 */
13707/**
13708 * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
13709 * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
13710 * handled.
13711 *
13712 * See DomSanitizer for more details on security in Angular applications.
13713 *
13714 * @publicApi
13715 */
13716var SecurityContext;
13717(function (SecurityContext) {
13718    SecurityContext[SecurityContext["NONE"] = 0] = "NONE";
13719    SecurityContext[SecurityContext["HTML"] = 1] = "HTML";
13720    SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE";
13721    SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
13722    SecurityContext[SecurityContext["URL"] = 4] = "URL";
13723    SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
13724})(SecurityContext || (SecurityContext = {}));
13725
13726/**
13727 * @license
13728 * Copyright Google LLC All Rights Reserved.
13729 *
13730 * Use of this source code is governed by an MIT-style license that can be
13731 * found in the LICENSE file at https://angular.io/license
13732 */
13733/**
13734 * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing
13735 * dangerous content.
13736 *
13737 * This method parses the `html` and locates potentially dangerous content (such as urls and
13738 * javascript) and removes it.
13739 *
13740 * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.
13741 *
13742 * @param unsafeHtml untrusted `html`, typically from the user.
13743 * @returns `html` string which is safe to display to user, because all of the dangerous javascript
13744 * and urls have been removed.
13745 *
13746 * @codeGenApi
13747 */
13748function ɵɵsanitizeHtml(unsafeHtml) {
13749    const sanitizer = getSanitizer();
13750    if (sanitizer) {
13751        return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');
13752    }
13753    if (allowSanitizationBypassAndThrow(unsafeHtml, "HTML" /* Html */)) {
13754        return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));
13755    }
13756    return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));
13757}
13758/**
13759 * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing
13760 * dangerous content.
13761 *
13762 * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.
13763 *
13764 * @param unsafeStyle untrusted `style`, typically from the user.
13765 * @returns `style` string which is safe to bind to the `style` properties.
13766 *
13767 * @codeGenApi
13768 */
13769function ɵɵsanitizeStyle(unsafeStyle) {
13770    const sanitizer = getSanitizer();
13771    if (sanitizer) {
13772        return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';
13773    }
13774    if (allowSanitizationBypassAndThrow(unsafeStyle, "Style" /* Style */)) {
13775        return unwrapSafeValue(unsafeStyle);
13776    }
13777    return renderStringify(unsafeStyle);
13778}
13779/**
13780 * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing
13781 * dangerous
13782 * content.
13783 *
13784 * This method parses the `url` and locates potentially dangerous content (such as javascript) and
13785 * removes it.
13786 *
13787 * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.
13788 *
13789 * @param unsafeUrl untrusted `url`, typically from the user.
13790 * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
13791 * all of the dangerous javascript has been removed.
13792 *
13793 * @codeGenApi
13794 */
13795function ɵɵsanitizeUrl(unsafeUrl) {
13796    const sanitizer = getSanitizer();
13797    if (sanitizer) {
13798        return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';
13799    }
13800    if (allowSanitizationBypassAndThrow(unsafeUrl, "URL" /* Url */)) {
13801        return unwrapSafeValue(unsafeUrl);
13802    }
13803    return _sanitizeUrl(renderStringify(unsafeUrl));
13804}
13805/**
13806 * A `url` sanitizer which only lets trusted `url`s through.
13807 *
13808 * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.
13809 *
13810 * @param unsafeResourceUrl untrusted `url`, typically from the user.
13811 * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
13812 * only trusted `url`s have been allowed to pass.
13813 *
13814 * @codeGenApi
13815 */
13816function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
13817    const sanitizer = getSanitizer();
13818    if (sanitizer) {
13819        return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');
13820    }
13821    if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* ResourceUrl */)) {
13822        return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
13823    }
13824    throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
13825}
13826/**
13827 * A `script` sanitizer which only lets trusted javascript through.
13828 *
13829 * This passes only `script`s marked trusted by calling {@link
13830 * bypassSanitizationTrustScript}.
13831 *
13832 * @param unsafeScript untrusted `script`, typically from the user.
13833 * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,
13834 * because only trusted `scripts` have been allowed to pass.
13835 *
13836 * @codeGenApi
13837 */
13838function ɵɵsanitizeScript(unsafeScript) {
13839    const sanitizer = getSanitizer();
13840    if (sanitizer) {
13841        return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');
13842    }
13843    if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* Script */)) {
13844        return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
13845    }
13846    throw new Error('unsafe value used in a script context');
13847}
13848/**
13849 * A template tag function for promoting the associated constant literal to a
13850 * TrustedHTML. Interpolation is explicitly not allowed.
13851 *
13852 * @param html constant template literal containing trusted HTML.
13853 * @returns TrustedHTML wrapping `html`.
13854 *
13855 * @security This is a security-sensitive function and should only be used to
13856 * convert constant values of attributes and properties found in
13857 * application-provided Angular templates to TrustedHTML.
13858 *
13859 * @codeGenApi
13860 */
13861function ɵɵtrustConstantHtml(html) {
13862    // The following runtime check ensures that the function was called as a
13863    // template tag (e.g. ɵɵtrustConstantHtml`content`), without any interpolation
13864    // (e.g. not ɵɵtrustConstantHtml`content ${variable}`). A TemplateStringsArray
13865    // is an array with a `raw` property that is also an array. The associated
13866    // template literal has no interpolation if and only if the length of the
13867    // TemplateStringsArray is 1.
13868    if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {
13869        throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`);
13870    }
13871    return trustedHTMLFromString(html[0]);
13872}
13873/**
13874 * A template tag function for promoting the associated constant literal to a
13875 * TrustedScriptURL. Interpolation is explicitly not allowed.
13876 *
13877 * @param url constant template literal containing a trusted script URL.
13878 * @returns TrustedScriptURL wrapping `url`.
13879 *
13880 * @security This is a security-sensitive function and should only be used to
13881 * convert constant values of attributes and properties found in
13882 * application-provided Angular templates to TrustedScriptURL.
13883 *
13884 * @codeGenApi
13885 */
13886function ɵɵtrustConstantResourceUrl(url) {
13887    // The following runtime check ensures that the function was called as a
13888    // template tag (e.g. ɵɵtrustConstantResourceUrl`content`), without any
13889    // interpolation (e.g. not ɵɵtrustConstantResourceUrl`content ${variable}`). A
13890    // TemplateStringsArray is an array with a `raw` property that is also an
13891    // array. The associated template literal has no interpolation if and only if
13892    // the length of the TemplateStringsArray is 1.
13893    if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {
13894        throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`);
13895    }
13896    return trustedScriptURLFromString(url[0]);
13897}
13898/**
13899 * Detects which sanitizer to use for URL property, based on tag name and prop name.
13900 *
13901 * The rules are based on the RESOURCE_URL context config from
13902 * `packages/compiler/src/schema/dom_security_schema.ts`.
13903 * If tag and prop names don't match Resource URL schema, use URL sanitizer.
13904 */
13905function getUrlSanitizer(tag, prop) {
13906    if ((prop === 'src' &&
13907        (tag === 'embed' || tag === 'frame' || tag === 'iframe' || tag === 'media' ||
13908            tag === 'script')) ||
13909        (prop === 'href' && (tag === 'base' || tag === 'link'))) {
13910        return ɵɵsanitizeResourceUrl;
13911    }
13912    return ɵɵsanitizeUrl;
13913}
13914/**
13915 * Sanitizes URL, selecting sanitizer function based on tag and property names.
13916 *
13917 * This function is used in case we can't define security context at compile time, when only prop
13918 * name is available. This happens when we generate host bindings for Directives/Components. The
13919 * host element is unknown at compile time, so we defer calculation of specific sanitizer to
13920 * runtime.
13921 *
13922 * @param unsafeUrl untrusted `url`, typically from the user.
13923 * @param tag target element tag name.
13924 * @param prop name of the property that contains the value.
13925 * @returns `url` string which is safe to bind.
13926 *
13927 * @codeGenApi
13928 */
13929function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
13930    return getUrlSanitizer(tag, prop)(unsafeUrl);
13931}
13932function validateAgainstEventProperties(name) {
13933    if (name.toLowerCase().startsWith('on')) {
13934        const msg = `Binding to event property '${name}' is disallowed for security reasons, ` +
13935            `please use (${name.slice(2)})=...` +
13936            `\nIf '${name}' is a directive input, make sure the directive is imported by the` +
13937            ` current module.`;
13938        throw new Error(msg);
13939    }
13940}
13941function validateAgainstEventAttributes(name) {
13942    if (name.toLowerCase().startsWith('on')) {
13943        const msg = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
13944            `please use (${name.slice(2)})=...`;
13945        throw new Error(msg);
13946    }
13947}
13948function getSanitizer() {
13949    const lView = getLView();
13950    return lView && lView[SANITIZER];
13951}
13952
13953/**
13954 * @license
13955 * Copyright Google LLC All Rights Reserved.
13956 *
13957 * Use of this source code is governed by an MIT-style license that can be
13958 * found in the LICENSE file at https://angular.io/license
13959 */
13960const ERROR_TYPE = 'ngType';
13961const ERROR_DEBUG_CONTEXT = 'ngDebugContext';
13962const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
13963const ERROR_LOGGER = 'ngErrorLogger';
13964function wrappedError(message, originalError) {
13965    const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;
13966    const error = Error(msg);
13967    error[ERROR_ORIGINAL_ERROR] = originalError;
13968    return error;
13969}
13970
13971/**
13972 * @license
13973 * Copyright Google LLC All Rights Reserved.
13974 *
13975 * Use of this source code is governed by an MIT-style license that can be
13976 * found in the LICENSE file at https://angular.io/license
13977 */
13978function getType(error) {
13979    return error[ERROR_TYPE];
13980}
13981function getDebugContext(error) {
13982    return error[ERROR_DEBUG_CONTEXT];
13983}
13984function getOriginalError(error) {
13985    return error[ERROR_ORIGINAL_ERROR];
13986}
13987function getErrorLogger(error) {
13988    return error[ERROR_LOGGER] || defaultErrorLogger;
13989}
13990function defaultErrorLogger(console, ...values) {
13991    console.error(...values);
13992}
13993
13994/**
13995 * @license
13996 * Copyright Google LLC All Rights Reserved.
13997 *
13998 * Use of this source code is governed by an MIT-style license that can be
13999 * found in the LICENSE file at https://angular.io/license
14000 */
14001/**
14002 * Provides a hook for centralized exception handling.
14003 *
14004 * The default implementation of `ErrorHandler` prints error messages to the `console`. To
14005 * intercept error handling, write a custom exception handler that replaces this default as
14006 * appropriate for your app.
14007 *
14008 * @usageNotes
14009 * ### Example
14010 *
14011 * ```
14012 * class MyErrorHandler implements ErrorHandler {
14013 *   handleError(error) {
14014 *     // do something with the exception
14015 *   }
14016 * }
14017 *
14018 * @NgModule({
14019 *   providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
14020 * })
14021 * class MyModule {}
14022 * ```
14023 *
14024 * @publicApi
14025 */
14026class ErrorHandler {
14027    constructor() {
14028        /**
14029         * @internal
14030         */
14031        this._console = console;
14032    }
14033    handleError(error) {
14034        const originalError = this._findOriginalError(error);
14035        const context = this._findContext(error);
14036        // Note: Browser consoles show the place from where console.error was called.
14037        // We can use this to give users additional information about the error.
14038        const errorLogger = getErrorLogger(error);
14039        errorLogger(this._console, `ERROR`, error);
14040        if (originalError) {
14041            errorLogger(this._console, `ORIGINAL ERROR`, originalError);
14042        }
14043        if (context) {
14044            errorLogger(this._console, 'ERROR CONTEXT', context);
14045        }
14046    }
14047    /** @internal */
14048    _findContext(error) {
14049        if (error) {
14050            return getDebugContext(error) ? getDebugContext(error) :
14051                this._findContext(getOriginalError(error));
14052        }
14053        return null;
14054    }
14055    /** @internal */
14056    _findOriginalError(error) {
14057        let e = getOriginalError(error);
14058        while (e && getOriginalError(e)) {
14059            e = getOriginalError(e);
14060        }
14061        return e;
14062    }
14063}
14064
14065/**
14066 * @license
14067 * Copyright Google LLC All Rights Reserved.
14068 *
14069 * Use of this source code is governed by an MIT-style license that can be
14070 * found in the LICENSE file at https://angular.io/license
14071 */
14072/**
14073 * Defines a schema that allows an NgModule to contain the following:
14074 * - Non-Angular elements named with dash case (`-`).
14075 * - Element properties named with dash case (`-`).
14076 * Dash case is the naming convention for custom elements.
14077 *
14078 * @publicApi
14079 */
14080const CUSTOM_ELEMENTS_SCHEMA = {
14081    name: 'custom-elements'
14082};
14083/**
14084 * Defines a schema that allows any property on any element.
14085 *
14086 * @publicApi
14087 */
14088const NO_ERRORS_SCHEMA = {
14089    name: 'no-errors-schema'
14090};
14091
14092/**
14093 * @license
14094 * Copyright Google LLC All Rights Reserved.
14095 *
14096 * Use of this source code is governed by an MIT-style license that can be
14097 * found in the LICENSE file at https://angular.io/license
14098 */
14099/**
14100 * Disallowed strings in the comment.
14101 *
14102 * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
14103 */
14104const COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;
14105/**
14106 * Delimiter in the disallowed strings which needs to be wrapped with zero with character.
14107 */
14108const COMMENT_DELIMITER = /(<|>)/;
14109const COMMENT_DELIMITER_ESCAPED = '\u200B$1\u200B';
14110/**
14111 * Escape the content of comment strings so that it can be safely inserted into a comment node.
14112 *
14113 * The issue is that HTML does not specify any way to escape comment end text inside the comment.
14114 * Consider: `<!-- The way you close a comment is with ">", and "->" at the beginning or by "-->" or
14115 * "--!>" at the end. -->`. Above the `"-->"` is meant to be text not an end to the comment. This
14116 * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)
14117 *
14118 * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
14119 *
14120 * ```
14121 * div.innerHTML = div.innerHTML
14122 * ```
14123 *
14124 * One would expect that the above code would be safe to do, but it turns out that because comment
14125 * text is not escaped, the comment may contain text which will prematurely close the comment
14126 * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which
14127 * may contain such text and expect them to be safe.)
14128 *
14129 * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and
14130 * surrounding them with `_>_` where the `_` is a zero width space `\u200B`. The result is that if a
14131 * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the
14132 * text it will render normally but it will not cause the HTML parser to close/open the comment.
14133 *
14134 * @param value text to make safe for comment node by escaping the comment open/close character
14135 *     sequence.
14136 */
14137function escapeCommentText(value) {
14138    return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
14139}
14140
14141/**
14142 * @license
14143 * Copyright Google LLC All Rights Reserved.
14144 *
14145 * Use of this source code is governed by an MIT-style license that can be
14146 * found in the LICENSE file at https://angular.io/license
14147 */
14148/**
14149 * THIS FILE CONTAINS CODE WHICH SHOULD BE TREE SHAKEN AND NEVER CALLED FROM PRODUCTION CODE!!!
14150 */
14151/**
14152 * Creates an `Array` construction with a given name. This is useful when
14153 * looking for memory consumption to see what time of array it is.
14154 *
14155 *
14156 * @param name Name to give to the constructor
14157 * @returns A subclass of `Array` if possible. This can only be done in
14158 *          environments which support `class` construct.
14159 */
14160function createNamedArrayType(name) {
14161    // This should never be called in prod mode, so let's verify that is the case.
14162    if (ngDevMode) {
14163        try {
14164            // If this function were compromised the following could lead to arbitrary
14165            // script execution. We bless it with Trusted Types anyway since this
14166            // function is stripped out of production binaries.
14167            return (newTrustedFunctionForDev('Array', `return class ${name} extends Array{}`))(Array);
14168        }
14169        catch (e) {
14170            // If it does not work just give up and fall back to regular Array.
14171            return Array;
14172        }
14173    }
14174    else {
14175        throw new Error('Looks like we are in \'prod mode\', but we are creating a named Array type, which is wrong! Check your code');
14176    }
14177}
14178
14179/**
14180 * @license
14181 * Copyright Google LLC All Rights Reserved.
14182 *
14183 * Use of this source code is governed by an MIT-style license that can be
14184 * found in the LICENSE file at https://angular.io/license
14185 */
14186function normalizeDebugBindingName(name) {
14187    // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
14188    name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
14189    return `ng-reflect-${name}`;
14190}
14191const CAMEL_CASE_REGEXP = /([A-Z])/g;
14192function camelCaseToDashCase(input) {
14193    return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
14194}
14195function normalizeDebugBindingValue(value) {
14196    try {
14197        // Limit the size of the value as otherwise the DOM just gets polluted.
14198        return value != null ? value.toString().slice(0, 30) : value;
14199    }
14200    catch (e) {
14201        return '[ERROR] Exception while trying to serialize the value';
14202    }
14203}
14204
14205/**
14206 * @license
14207 * Copyright Google LLC All Rights Reserved.
14208 *
14209 * Use of this source code is governed by an MIT-style license that can be
14210 * found in the LICENSE file at https://angular.io/license
14211 */
14212/**
14213 * Returns the matching `LContext` data for a given DOM node, directive or component instance.
14214 *
14215 * This function will examine the provided DOM element, component, or directive instance\'s
14216 * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched
14217 * value will be that of the newly created `LContext`.
14218 *
14219 * If the monkey-patched value is the `LView` instance then the context value for that
14220 * target will be created and the monkey-patch reference will be updated. Therefore when this
14221 * function is called it may mutate the provided element\'s, component\'s or any of the associated
14222 * directive\'s monkey-patch values.
14223 *
14224 * If the monkey-patch value is not detected then the code will walk up the DOM until an element
14225 * is found which contains a monkey-patch reference. When that occurs then the provided element
14226 * will be updated with a new context (which is then returned). If the monkey-patch value is not
14227 * detected for a component/directive instance then it will throw an error (all components and
14228 * directives should be automatically monkey-patched by ivy).
14229 *
14230 * @param target Component, Directive or DOM Node.
14231 */
14232function getLContext(target) {
14233    let mpValue = readPatchedData(target);
14234    if (mpValue) {
14235        // only when it's an array is it considered an LView instance
14236        // ... otherwise it's an already constructed LContext instance
14237        if (Array.isArray(mpValue)) {
14238            const lView = mpValue;
14239            let nodeIndex;
14240            let component = undefined;
14241            let directives = undefined;
14242            if (isComponentInstance(target)) {
14243                nodeIndex = findViaComponent(lView, target);
14244                if (nodeIndex == -1) {
14245                    throw new Error('The provided component was not found in the application');
14246                }
14247                component = target;
14248            }
14249            else if (isDirectiveInstance(target)) {
14250                nodeIndex = findViaDirective(lView, target);
14251                if (nodeIndex == -1) {
14252                    throw new Error('The provided directive was not found in the application');
14253                }
14254                directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
14255            }
14256            else {
14257                nodeIndex = findViaNativeElement(lView, target);
14258                if (nodeIndex == -1) {
14259                    return null;
14260                }
14261            }
14262            // the goal is not to fill the entire context full of data because the lookups
14263            // are expensive. Instead, only the target data (the element, component, container, ICU
14264            // expression or directive details) are filled into the context. If called multiple times
14265            // with different target values then the missing target data will be filled in.
14266            const native = unwrapRNode(lView[nodeIndex]);
14267            const existingCtx = readPatchedData(native);
14268            const context = (existingCtx && !Array.isArray(existingCtx)) ?
14269                existingCtx :
14270                createLContext(lView, nodeIndex, native);
14271            // only when the component has been discovered then update the monkey-patch
14272            if (component && context.component === undefined) {
14273                context.component = component;
14274                attachPatchData(context.component, context);
14275            }
14276            // only when the directives have been discovered then update the monkey-patch
14277            if (directives && context.directives === undefined) {
14278                context.directives = directives;
14279                for (let i = 0; i < directives.length; i++) {
14280                    attachPatchData(directives[i], context);
14281                }
14282            }
vendor: 7,033 bytes, lines 14283-14477
14283            attachPatchData(context.native, context);
14284            mpValue = context;
14285        }
14286    }
14287    else {
14288        const rElement = target;
14289        ngDevMode && assertDomNode(rElement);
14290        // if the context is not found then we need to traverse upwards up the DOM
14291        // to find the nearest element that has already been monkey patched with data
14292        let parent = rElement;
14293        while (parent = parent.parentNode) {
14294            const parentContext = readPatchedData(parent);
14295            if (parentContext) {
14296                let lView;
14297                if (Array.isArray(parentContext)) {
14298                    lView = parentContext;
14299                }
14300                else {
14301                    lView = parentContext.lView;
14302                }
14303                // the edge of the app was also reached here through another means
14304                // (maybe because the DOM was changed manually).
14305                if (!lView) {
14306                    return null;
14307                }
14308                const index = findViaNativeElement(lView, rElement);
14309                if (index >= 0) {
14310                    const native = unwrapRNode(lView[index]);
14311                    const context = createLContext(lView, index, native);
14312                    attachPatchData(native, context);
14313                    mpValue = context;
14314                    break;
14315                }
14316            }
14317        }
14318    }
14319    return mpValue || null;
14320}
14321/**
14322 * Creates an empty instance of a `LContext` context
14323 */
14324function createLContext(lView, nodeIndex, native) {
14325    return {
14326        lView,
14327        nodeIndex,
14328        native,
14329        component: undefined,
14330        directives: undefined,
14331        localRefs: undefined,
14332    };
14333}
14334/**
14335 * Takes a component instance and returns the view for that component.
14336 *
14337 * @param componentInstance
14338 * @returns The component's view
14339 */
14340function getComponentViewByInstance(componentInstance) {
14341    let lView = readPatchedData(componentInstance);
14342    let view;
14343    if (Array.isArray(lView)) {
14344        const nodeIndex = findViaComponent(lView, componentInstance);
14345        view = getComponentLViewByIndex(nodeIndex, lView);
14346        const context = createLContext(lView, nodeIndex, view[HOST]);
14347        context.component = componentInstance;
14348        attachPatchData(componentInstance, context);
14349        attachPatchData(context.native, context);
14350    }
14351    else {
14352        const context = lView;
14353        view = getComponentLViewByIndex(context.nodeIndex, context.lView);
14354    }
14355    return view;
14356}
14357/**
14358 * Assigns the given data to the given target (which could be a component,
14359 * directive or DOM node instance) using monkey-patching.
14360 */
14361function attachPatchData(target, data) {
14362    target[MONKEY_PATCH_KEY_NAME] = data;
14363}
14364function isComponentInstance(instance) {
14365    return instance && instance.constructor && instance.constructor.ɵcmp;
14366}
14367function isDirectiveInstance(instance) {
14368    return instance && instance.constructor && instance.constructor.ɵdir;
14369}
14370/**
14371 * Locates the element within the given LView and returns the matching index
14372 */
14373function findViaNativeElement(lView, target) {
14374    const tView = lView[TVIEW];
14375    for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
14376        if (unwrapRNode(lView[i]) === target) {
14377            return i;
14378        }
14379    }
14380    return -1;
14381}
14382/**
14383 * Locates the next tNode (child, sibling or parent).
14384 */
14385function traverseNextElement(tNode) {
14386    if (tNode.child) {
14387        return tNode.child;
14388    }
14389    else if (tNode.next) {
14390        return tNode.next;
14391    }
14392    else {
14393        // Let's take the following template: <div><span>text</span></div><component/>
14394        // After checking the text node, we need to find the next parent that has a "next" TNode,
14395        // in this case the parent `div`, so that we can find the component.
14396        while (tNode.parent && !tNode.parent.next) {
14397            tNode = tNode.parent;
14398        }
14399        return tNode.parent && tNode.parent.next;
14400    }
14401}
14402/**
14403 * Locates the component within the given LView and returns the matching index
14404 */
14405function findViaComponent(lView, componentInstance) {
14406    const componentIndices = lView[TVIEW].components;
14407    if (componentIndices) {
14408        for (let i = 0; i < componentIndices.length; i++) {
14409            const elementComponentIndex = componentIndices[i];
14410            const componentView = getComponentLViewByIndex(elementComponentIndex, lView);
14411            if (componentView[CONTEXT] === componentInstance) {
14412                return elementComponentIndex;
14413            }
14414        }
14415    }
14416    else {
14417        const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);
14418        const rootComponent = rootComponentView[CONTEXT];
14419        if (rootComponent === componentInstance) {
14420            // we are dealing with the root element here therefore we know that the
14421            // element is the very first element after the HEADER data in the lView
14422            return HEADER_OFFSET;
14423        }
14424    }
14425    return -1;
14426}
14427/**
14428 * Locates the directive within the given LView and returns the matching index
14429 */
14430function findViaDirective(lView, directiveInstance) {
14431    // if a directive is monkey patched then it will (by default)
14432    // have a reference to the LView of the current view. The
14433    // element bound to the directive being search lives somewhere
14434    // in the view data. We loop through the nodes and check their
14435    // list of directives for the instance.
14436    let tNode = lView[TVIEW].firstChild;
14437    while (tNode) {
14438        const directiveIndexStart = tNode.directiveStart;
14439        const directiveIndexEnd = tNode.directiveEnd;
14440        for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {
14441            if (lView[i] === directiveInstance) {
14442                return tNode.index;
14443            }
14444        }
14445        tNode = traverseNextElement(tNode);
14446    }
14447    return -1;
14448}
14449/**
14450 * Returns a list of directives extracted from the given view based on the
14451 * provided list of directive index values.
14452 *
14453 * @param nodeIndex The node index
14454 * @param lView The target view data
14455 * @param includeComponents Whether or not to include components in returned directives
14456 */
14457function getDirectivesAtNodeIndex(nodeIndex, lView, includeComponents) {
14458    const tNode = lView[TVIEW].data[nodeIndex];
14459    let directiveStartIndex = tNode.directiveStart;
14460    if (directiveStartIndex == 0)
14461        return EMPTY_ARRAY$1;
14462    const directiveEndIndex = tNode.directiveEnd;
14463    if (!includeComponents && tNode.flags & 2 /* isComponentHost */)
14464        directiveStartIndex++;
14465    return lView.slice(directiveStartIndex, directiveEndIndex);
14466}
14467function getComponentAtNodeIndex(nodeIndex, lView) {
14468    const tNode = lView[TVIEW].data[nodeIndex];
14469    let directiveStartIndex = tNode.directiveStart;
14470    return tNode.flags & 2 /* isComponentHost */ ? lView[directiveStartIndex] : null;
14471}
14472/**
14473 * Returns a map of local references (local reference name => element or directive instance) that
14474 * exist on a given element.
14475 */
14476function discoverLocalRefs(lView, nodeIndex) {
14477    const tNode = lView[TVIEW].data[nodeIndex];
14478    if (tNode && tNode.localNames) {
14479        const result = {};
14480        let localIndex = tNode.index + 1;
14481        for (let i = 0; i < tNode.localNames.length; i += 2) {
14482            result[tNode.localNames[i]] = lView[localIndex];
14483            localIndex++;
14484        }
14485        return result;
14486    }
14487    return null;
14488}
14489
14490/**
14491 * @license
14492 * Copyright Google LLC All Rights Reserved.
14493 *
14494 * Use of this source code is governed by an MIT-style license that can be
14495 * found in the LICENSE file at https://angular.io/license
14496 */
14497const ɵ0$4 = () => (typeof requestAnimationFrame !== 'undefined' &&
14498    requestAnimationFrame || // browser only
14499    setTimeout // everything else
14500)
14501    .bind(_global);
14502const defaultScheduler = (ɵ0$4)();
14503/**
14504 *
14505 * @codeGenApi
14506 */
14507function ɵɵresolveWindow(element) {
14508    return { name: 'window', target: element.ownerDocument.defaultView };
14509}
14510/**
14511 *
14512 * @codeGenApi
14513 */
14514function ɵɵresolveDocument(element) {
14515    return { name: 'document', target: element.ownerDocument };
14516}
14517/**
14518 *
14519 * @codeGenApi
14520 */
14521function ɵɵresolveBody(element) {
14522    return { name: 'body', target: element.ownerDocument.body };
14523}
14524/**
14525 * The special delimiter we use to separate property names, prefixes, and suffixes
14526 * in property binding metadata. See storeBindingMetadata().
14527 *
14528 * We intentionally use the Unicode "REPLACEMENT CHARACTER" (U+FFFD) as a delimiter
14529 * because it is a very uncommon character that is unlikely to be part of a user's
14530 * property names or interpolation strings. If it is in fact used in a property
14531 * binding, DebugElement.properties will not return the correct value for that
14532 * binding. However, there should be no runtime effect for real applications.
14533 *
14534 * This character is typically rendered as a question mark inside of a diamond.
14535 * See https://en.wikipedia.org/wiki/Specials_(Unicode_block)
14536 *
14537 */
14538const INTERPOLATION_DELIMITER = `�`;
14539/**
14540 * Unwrap a value which might be behind a closure (for forward declaration reasons).
14541 */
14542function maybeUnwrapFn(value) {
14543    if (value instanceof Function) {
14544        return value();
14545    }
14546    else {
14547        return value;
14548    }
14549}
14550
14551/**
14552 * @license
14553 * Copyright Google LLC All Rights Reserved.
14554 *
14555 * Use of this source code is governed by an MIT-style license that can be
14556 * found in the LICENSE file at https://angular.io/license
14557 */
14558/** Called when there are multiple component selectors that match a given node */
14559function throwMultipleComponentError(tNode) {
14560    throw new RuntimeError("300" /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`);
14561}
14562/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
14563function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {
14564    const field = propName ? ` for '${propName}'` : '';
14565    let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${oldValue}'. Current value: '${currValue}'.`;
14566    if (creationMode) {
14567        msg +=
14568            ` It seems like the view has been created after its parent and its children have been dirty checked.` +
14569                ` Has it been created in a change detection hook?`;
14570    }
14571    // TODO: include debug context, see `viewDebugError` function in
14572    // `packages/core/src/view/errors.ts` for reference.
14573    throw new RuntimeError("100" /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
14574}
14575function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
14576    const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);
14577    let oldValue = prefix, newValue = prefix;
14578    for (let i = 0; i < chunks.length; i++) {
14579        const slotIdx = rootIndex + i;
14580        oldValue += `${lView[slotIdx]}${chunks[i]}`;
14581        newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i]}`;
14582    }
14583    return { propName, oldValue, newValue };
14584}
14585/**
14586 * Constructs an object that contains details for the ExpressionChangedAfterItHasBeenCheckedError:
14587 * - property name (for property bindings or interpolations)
14588 * - old and new values, enriched using information from metadata
14589 *
14590 * More information on the metadata storage format can be found in `storePropertyBindingMetadata`
14591 * function description.
14592 */
14593function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {
14594    const tData = lView[TVIEW].data;
14595    const metadata = tData[bindingIndex];
14596    if (typeof metadata === 'string') {
14597        // metadata for property interpolation
14598        if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {
14599            return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);
14600        }
14601        // metadata for property binding
14602        return { propName: metadata, oldValue, newValue };
14603    }
14604    // metadata is not available for this expression, check if this expression is a part of the
14605    // property interpolation by going from the current binding index left and look for a string that
14606    // contains INTERPOLATION_DELIMITER, the layout in tView.data for this case will look like this:
14607    // [..., 'id�Prefix � and � suffix', null, null, null, ...]
14608    if (metadata === null) {
14609        let idx = bindingIndex - 1;
14610        while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) {
14611            idx--;
14612        }
14613        const meta = tData[idx];
14614        if (typeof meta === 'string') {
14615            const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g'));
14616            // first interpolation delimiter separates property name from interpolation parts (in case of
14617            // property interpolations), so we subtract one from total number of found delimiters
14618            if (matches && (matches.length - 1) > bindingIndex - idx) {
14619                return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);
14620            }
14621        }
14622    }
14623    return { propName: undefined, oldValue, newValue };
14624}
14625
14626/**
14627 * @license
14628 * Copyright Google LLC All Rights Reserved.
14629 *
14630 * Use of this source code is governed by an MIT-style license that can be
14631 * found in the LICENSE file at https://angular.io/license
14632 */
14633/**
14634 * Flags for renderer-specific style modifiers.
14635 * @publicApi
14636 */
14637var RendererStyleFlags2;
14638(function (RendererStyleFlags2) {
14639    // TODO(misko): This needs to be refactored into a separate file so that it can be imported from
14640    // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails
14641    // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now.
14642    /**
14643     * Marks a style as important.
14644     */
14645    RendererStyleFlags2[RendererStyleFlags2["Important"] = 1] = "Important";
14646    /**
14647     * Marks a style as using dash case naming (this-is-dash-case).
14648     */
14649    RendererStyleFlags2[RendererStyleFlags2["DashCase"] = 2] = "DashCase";
14650})(RendererStyleFlags2 || (RendererStyleFlags2 = {}));
14651
14652/**
14653 * @license
14654 * Copyright Google LLC All Rights Reserved.
14655 *
14656 * Use of this source code is governed by an MIT-style license that can be
14657 * found in the LICENSE file at https://angular.io/license
14658 */
14659let _icuContainerIterate;
14660/**
14661 * Iterator which provides ability to visit all of the `TIcuContainerNode` root `RNode`s.
14662 */
14663function icuContainerIterate(tIcuContainerNode, lView) {
14664    return _icuContainerIterate(tIcuContainerNode, lView);
14665}
14666/**
14667 * Ensures that `IcuContainerVisitor`'s implementation is present.
14668 *
14669 * This function is invoked when i18n instruction comes across an ICU. The purpose is to allow the
14670 * bundler to tree shake ICU logic and only load it if ICU instruction is executed.
14671 */
14672function ensureIcuContainerVisitorLoaded(loader) {
14673    if (_icuContainerIterate === undefined) {
14674        // Do not inline this function. We want to keep `ensureIcuContainerVisitorLoaded` light, so it
14675        // can be inlined into call-site.
14676        _icuContainerIterate = loader();
14677    }
14678}
14679
14680/**
14681 * @license
14682 * Copyright Google LLC All Rights Reserved.
14683 *
14684 * Use of this source code is governed by an MIT-style license that can be
14685 * found in the LICENSE file at https://angular.io/license
14686 */
14687// Note: This hack is necessary so we don't erroneously get a circular dependency
14688// failure based on types.
14689const unusedValueExportToPlacateAjd$5 = 1;
14690
14691/**
14692 * @license
14693 * Copyright Google LLC All Rights Reserved.
14694 *
14695 * Use of this source code is governed by an MIT-style license that can be
14696 * found in the LICENSE file at https://angular.io/license
14697 */
14698/**
14699 * Gets the parent LView of the passed LView, if the PARENT is an LContainer, will get the parent of
14700 * that LContainer, which is an LView
14701 * @param lView the lView whose parent to get
14702 */
14703function getLViewParent(lView) {
14704    ngDevMode && assertLView(lView);
14705    const parent = lView[PARENT];
14706    return isLContainer(parent) ? parent[PARENT] : parent;
14707}
14708/**
14709 * Retrieve the root view from any component or `LView` by walking the parent `LView` until
14710 * reaching the root `LView`.
14711 *
14712 * @param componentOrLView any component or `LView`
14713 */
14714function getRootView(componentOrLView) {
14715    ngDevMode && assertDefined(componentOrLView, 'component');
14716    let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);
14717    while (lView && !(lView[FLAGS] & 512 /* IsRoot */)) {
14718        lView = getLViewParent(lView);
14719    }
14720    ngDevMode && assertLView(lView);
14721    return lView;
14722}
14723/**
14724 * Returns the `RootContext` instance that is associated with
14725 * the application where the target is situated. It does this by walking the parent views until it
14726 * gets to the root view, then getting the context off of that.
14727 *
14728 * @param viewOrComponent the `LView` or component to get the root context for.
14729 */
14730function getRootContext(viewOrComponent) {
14731    const rootView = getRootView(viewOrComponent);
14732    ngDevMode &&
14733        assertDefined(rootView[CONTEXT], 'RootView has no context. Perhaps it is disconnected?');
14734    return rootView[CONTEXT];
14735}
14736/**
14737 * Gets the first `LContainer` in the LView or `null` if none exists.
14738 */
14739function getFirstLContainer(lView) {
14740    return getNearestLContainer(lView[CHILD_HEAD]);
14741}
14742/**
14743 * Gets the next `LContainer` that is a sibling of the given container.
14744 */
14745function getNextLContainer(container) {
14746    return getNearestLContainer(container[NEXT]);
14747}
14748function getNearestLContainer(viewOrContainer) {
14749    while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {
14750        viewOrContainer = viewOrContainer[NEXT];
14751    }
14752    return viewOrContainer;
14753}
14754
14755/**
14756 * @license
14757 * Copyright Google LLC All Rights Reserved.
14758 *
14759 * Use of this source code is governed by an MIT-style license that can be
14760 * found in the LICENSE file at https://angular.io/license
14761 */
14762const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$2 + unusedValueExportToPlacateAjd;
14763/**
14764 * NOTE: for performance reasons, the possible actions are inlined within the function instead of
14765 * being passed as an argument.
14766 */
14767function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {
14768    // If this slot was allocated for a text node dynamically created by i18n, the text node itself
14769    // won't be created until i18nApply() in the update block, so this node should be skipped.
14770    // For more info, see "ICU expressions should work inside an ngTemplateOutlet inside an ngFor"
14771    // in `i18n_spec.ts`.
14772    if (lNodeToHandle != null) {
14773        let lContainer;
14774        let isComponent = false;
14775        // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is
14776        // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if
14777        // it has LContainer so that we can process all of those cases appropriately.
14778        if (isLContainer(lNodeToHandle)) {
14779            lContainer = lNodeToHandle;
14780        }
14781        else if (isLView(lNodeToHandle)) {
14782            isComponent = true;
14783            ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');
14784            lNodeToHandle = lNodeToHandle[HOST];
14785        }
14786        const rNode = unwrapRNode(lNodeToHandle);
14787        ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);
14788        if (action === 0 /* Create */ && parent !== null) {
14789            if (beforeNode == null) {
14790                nativeAppendChild(renderer, parent, rNode);
14791            }
14792            else {
14793                nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
14794            }
14795        }
14796        else if (action === 1 /* Insert */ && parent !== null) {
14797            nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
14798        }
14799        else if (action === 2 /* Detach */) {
14800            nativeRemoveNode(renderer, rNode, isComponent);
14801        }
14802        else if (action === 3 /* Destroy */) {
14803            ngDevMode && ngDevMode.rendererDestroyNode++;
14804            renderer.destroyNode(rNode);
14805        }
14806        if (lContainer != null) {
14807            applyContainer(renderer, action, lContainer, parent, beforeNode);
14808        }
14809    }
14810}
14811function createTextNode(renderer, value) {
14812    ngDevMode && ngDevMode.rendererCreateTextNode++;
14813    ngDevMode && ngDevMode.rendererSetText++;
14814    return isProceduralRenderer(renderer) ? renderer.createText(value) :
14815        renderer.createTextNode(value);
14816}
14817function updateTextNode(renderer, rNode, value) {
14818    ngDevMode && ngDevMode.rendererSetText++;
14819    isProceduralRenderer(renderer) ? renderer.setValue(rNode, value) : rNode.textContent = value;
14820}
14821function createCommentNode(renderer, value) {
14822    ngDevMode && ngDevMode.rendererCreateComment++;
14823    // isProceduralRenderer check is not needed because both `Renderer2` and `Renderer3` have the same
14824    // method name.
14825    return renderer.createComment(escapeCommentText(value));
14826}
14827/**
14828 * Creates a native element from a tag name, using a renderer.
14829 * @param renderer A renderer to use
14830 * @param name the tag name
14831 * @param namespace Optional namespace for element.
14832 * @returns the element created
14833 */
14834function createElementNode(renderer, name, namespace) {
14835    ngDevMode && ngDevMode.rendererCreateElement++;
14836    if (isProceduralRenderer(renderer)) {
14837        return renderer.createElement(name, namespace);
14838    }
14839    else {
14840        return namespace === null ? renderer.createElement(name) :
14841            renderer.createElementNS(namespace, name);
14842    }
14843}
14844/**
14845 * Removes all DOM elements associated with a view.
14846 *
14847 * Because some root nodes of the view may be containers, we sometimes need
14848 * to propagate deeply into the nested containers to remove all elements in the
14849 * views beneath it.
14850 *
14851 * @param tView The `TView' of the `LView` from which elements should be added or removed
14852 * @param lView The view from which elements should be added or removed
14853 */
14854function removeViewFromContainer(tView, lView) {
14855    const renderer = lView[RENDERER];
14856    applyView(tView, lView, renderer, 2 /* Detach */, null, null);
14857    lView[HOST] = null;
14858    lView[T_HOST] = null;
14859}
14860/**
14861 * Adds all DOM elements associated with a view.
14862 *
14863 * Because some root nodes of the view may be containers, we sometimes need
14864 * to propagate deeply into the nested containers to add all elements in the
14865 * views beneath it.
14866 *
14867 * @param tView The `TView' of the `LView` from which elements should be added or removed
14868 * @param parentTNode The `TNode` where the `LView` should be attached to.
14869 * @param renderer Current renderer to use for DOM manipulations.
14870 * @param lView The view from which elements should be added or removed
14871 * @param parentNativeNode The parent `RElement` where it should be inserted into.
14872 * @param beforeNode The node before which elements should be added, if insert mode
14873 */
14874function addViewToContainer(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {
14875    lView[HOST] = parentNativeNode;
14876    lView[T_HOST] = parentTNode;
14877    applyView(tView, lView, renderer, 1 /* Insert */, parentNativeNode, beforeNode);
14878}
14879/**
14880 * Detach a `LView` from the DOM by detaching its nodes.
14881 *
14882 * @param tView The `TView' of the `LView` to be detached
14883 * @param lView the `LView` to be detached.
14884 */
14885function renderDetachView(tView, lView) {
14886    applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null);
14887}
14888/**
14889 * Traverses down and up the tree of views and containers to remove listeners and
14890 * call onDestroy callbacks.
14891 *
vendor: 8,668 bytes, lines 14892-15091
14892 * Notes:
14893 *  - Because it's used for onDestroy calls, it needs to be bottom-up.
14894 *  - Must process containers instead of their views to avoid splicing
14895 *  when views are destroyed and re-added.
14896 *  - Using a while loop because it's faster than recursion
14897 *  - Destroy only called on movement to sibling or movement to parent (laterally or up)
14898 *
14899 *  @param rootView The view to destroy
14900 */
14901function destroyViewTree(rootView) {
14902    // If the view has no children, we can clean it up and return early.
14903    let lViewOrLContainer = rootView[CHILD_HEAD];
14904    if (!lViewOrLContainer) {
14905        return cleanUpView(rootView[TVIEW], rootView);
14906    }
14907    while (lViewOrLContainer) {
14908        let next = null;
14909        if (isLView(lViewOrLContainer)) {
14910            // If LView, traverse down to child.
14911            next = lViewOrLContainer[CHILD_HEAD];
14912        }
14913        else {
14914            ngDevMode && assertLContainer(lViewOrLContainer);
14915            // If container, traverse down to its first LView.
14916            const firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET];
14917            if (firstView)
14918                next = firstView;
14919        }
14920        if (!next) {
14921            // Only clean up view when moving to the side or up, as destroy hooks
14922            // should be called in order from the bottom up.
14923            while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) {
14924                if (isLView(lViewOrLContainer)) {
14925                    cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);
14926                }
14927                lViewOrLContainer = lViewOrLContainer[PARENT];
14928            }
14929            if (lViewOrLContainer === null)
14930                lViewOrLContainer = rootView;
14931            if (isLView(lViewOrLContainer)) {
14932                cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);
14933            }
14934            next = lViewOrLContainer && lViewOrLContainer[NEXT];
14935        }
14936        lViewOrLContainer = next;
14937    }
14938}
14939/**
14940 * Inserts a view into a container.
14941 *
14942 * This adds the view to the container's array of active views in the correct
14943 * position. It also adds the view's elements to the DOM if the container isn't a
14944 * root node of another view (in that case, the view's elements will be added when
14945 * the container's parent view is added later).
14946 *
14947 * @param tView The `TView' of the `LView` to insert
14948 * @param lView The view to insert
14949 * @param lContainer The container into which the view should be inserted
14950 * @param index Which index in the container to insert the child view into
14951 */
14952function insertView(tView, lView, lContainer, index) {
14953    ngDevMode && assertLView(lView);
14954    ngDevMode && assertLContainer(lContainer);
14955    const indexInContainer = CONTAINER_HEADER_OFFSET + index;
14956    const containerLength = lContainer.length;
14957    if (index > 0) {
14958        // This is a new view, we need to add it to the children.
14959        lContainer[indexInContainer - 1][NEXT] = lView;
14960    }
14961    if (index < containerLength - CONTAINER_HEADER_OFFSET) {
14962        lView[NEXT] = lContainer[indexInContainer];
14963        addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);
14964    }
14965    else {
14966        lContainer.push(lView);
14967        lView[NEXT] = null;
14968    }
14969    lView[PARENT] = lContainer;
14970    // track views where declaration and insertion points are different
14971    const declarationLContainer = lView[DECLARATION_LCONTAINER];
14972    if (declarationLContainer !== null && lContainer !== declarationLContainer) {
14973        trackMovedView(declarationLContainer, lView);
14974    }
14975    // notify query that a new view has been added
14976    const lQueries = lView[QUERIES];
14977    if (lQueries !== null) {
14978        lQueries.insertView(tView);
14979    }
14980    // Sets the attached flag
14981    lView[FLAGS] |= 128 /* Attached */;
14982}
14983/**
14984 * Track views created from the declaration container (TemplateRef) and inserted into a
14985 * different LContainer.
14986 */
14987function trackMovedView(declarationContainer, lView) {
14988    ngDevMode && assertDefined(lView, 'LView required');
14989    ngDevMode && assertLContainer(declarationContainer);
14990    const movedViews = declarationContainer[MOVED_VIEWS];
14991    const insertedLContainer = lView[PARENT];
14992    ngDevMode && assertLContainer(insertedLContainer);
14993    const insertedComponentLView = insertedLContainer[PARENT][DECLARATION_COMPONENT_VIEW];
14994    ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView');
14995    const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];
14996    ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView');
14997    if (declaredComponentLView !== insertedComponentLView) {
14998        // At this point the declaration-component is not same as insertion-component; this means that
14999        // this is a transplanted view. Mark the declared lView as having transplanted views so that
15000        // those views can participate in CD.
15001        declarationContainer[HAS_TRANSPLANTED_VIEWS] = true;
15002    }
15003    if (movedViews === null) {
15004        declarationContainer[MOVED_VIEWS] = [lView];
15005    }
15006    else {
15007        movedViews.push(lView);
15008    }
15009}
15010function detachMovedView(declarationContainer, lView) {
15011    ngDevMode && assertLContainer(declarationContainer);
15012    ngDevMode &&
15013        assertDefined(declarationContainer[MOVED_VIEWS], 'A projected view should belong to a non-empty projected views collection');
15014    const movedViews = declarationContainer[MOVED_VIEWS];
15015    const declarationViewIndex = movedViews.indexOf(lView);
15016    const insertionLContainer = lView[PARENT];
15017    ngDevMode && assertLContainer(insertionLContainer);
15018    // If the view was marked for refresh but then detached before it was checked (where the flag
15019    // would be cleared and the counter decremented), we need to decrement the view counter here
15020    // instead.
15021    if (lView[FLAGS] & 1024 /* RefreshTransplantedView */) {
15022        lView[FLAGS] &= ~1024 /* RefreshTransplantedView */;
15023        updateTransplantedViewCount(insertionLContainer, -1);
15024    }
15025    movedViews.splice(declarationViewIndex, 1);
15026}
15027/**
15028 * Detaches a view from a container.
15029 *
15030 * This method removes the view from the container's array of active views. It also
15031 * removes the view's elements from the DOM.
15032 *
15033 * @param lContainer The container from which to detach a view
15034 * @param removeIndex The index of the view to detach
15035 * @returns Detached LView instance.
15036 */
15037function detachView(lContainer, removeIndex) {
15038    if (lContainer.length <= CONTAINER_HEADER_OFFSET)
15039        return;
15040    const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;
15041    const viewToDetach = lContainer[indexInContainer];
15042    if (viewToDetach) {
15043        const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];
15044        if (declarationLContainer !== null && declarationLContainer !== lContainer) {
15045            detachMovedView(declarationLContainer, viewToDetach);
15046        }
15047        if (removeIndex > 0) {
15048            lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];
15049        }
15050        const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);
15051        removeViewFromContainer(viewToDetach[TVIEW], viewToDetach);
15052        // notify query that a view has been removed
15053        const lQueries = removedLView[QUERIES];
15054        if (lQueries !== null) {
15055            lQueries.detachView(removedLView[TVIEW]);
15056        }
15057        viewToDetach[PARENT] = null;
15058        viewToDetach[NEXT] = null;
15059        // Unsets the attached flag
15060        viewToDetach[FLAGS] &= ~128 /* Attached */;
15061    }
15062    return viewToDetach;
15063}
15064/**
15065 * A standalone function which destroys an LView,
15066 * conducting clean up (e.g. removing listeners, calling onDestroys).
15067 *
15068 * @param tView The `TView' of the `LView` to be destroyed
15069 * @param lView The view to be destroyed.
15070 */
15071function destroyLView(tView, lView) {
15072    if (!(lView[FLAGS] & 256 /* Destroyed */)) {
15073        const renderer = lView[RENDERER];
15074        if (isProceduralRenderer(renderer) && renderer.destroyNode) {
15075            applyView(tView, lView, renderer, 3 /* Destroy */, null, null);
15076        }
15077        destroyViewTree(lView);
15078    }
15079}
15080/**
15081 * Calls onDestroys hooks for all directives and pipes in a given view and then removes all
15082 * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks
15083 * can be propagated to @Output listeners.
15084 *
15085 * @param tView `TView` for the `LView` to clean up.
15086 * @param lView The LView to clean up
15087 */
15088function cleanUpView(tView, lView) {
15089    if (!(lView[FLAGS] & 256 /* Destroyed */)) {
15090        // Usually the Attached flag is removed when the view is detached from its parent, however
15091        // if it's a root view, the flag won't be unset hence why we're also removing on de
15091stroy.
15092        lView[FLAGS] &= ~128 /* Attached */;
15093        // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook
15094        // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If
15095        // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.
15096        // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is
15097        // really more of an "afterDestroy" hook if you think about it.
15098        lView[FLAGS] |= 256 /* Destroyed */;
15099        executeOnDestroys(tView, lView);
15100        processCleanups(tView, lView);
15101        // For component views only, the local renderer is destroyed at clean up time.
15102        if (lView[TVIEW].type === 1 /* Component */ && isProceduralRenderer(lView[RENDERER])) {
15103            ngDevMode && ngDevMode.rendererDestroy++;
15104            lView[RENDERER].destroy();
15105        }
15106        const declarationContainer = lView[DECLARATION_LCONTAINER];
15107        // we are dealing with an embedded view that is still inserted into a container
15108        if (declarationContainer !== null && isLContainer(lView[PARENT])) {
15109            // and this is a projected view
15110            if (declarationContainer !== lView[PARENT]) {
15111                detachMovedView(declarationContainer, lView);
15112            }
15113            // For embedded views still attached to a container: remove query result from this view.
15114            const lQueries = lView[QUERIES];
15115            if (lQueries !== null) {
15116                lQueries.detachView(tView);
15117            }
15118        }
15119    }
15120}
15121/** Removes listeners and unsubscribes from output subscriptions */
15122function processCleanups(tView, lView) {
15123    const tCleanup = tView.cleanup;
15124    const lCleanup = lView[CLEANUP];
15125    // `LCleanup` contains both share information with `TCleanup` as well as instance specific
15126    // information appended at the end. We need to know where the end of the `TCleanup` information
15127    // is, and we track this with `lastLCleanupIndex`.
15128    let lastLCleanupIndex = -1;
15129    if (tCleanup !== null) {
15130        for (let i = 0; i < tCleanup.length - 1; i += 2) {
15131            if (typeof tCleanup[i] === 'string') {
15132                // This is a native DOM listener
15133                const idxOrTargetGetter = tCleanup[i + 1];
15134                const target = typeof idxOrTargetGetter === 'function' ?
15135                    idxOrTargetGetter(lView) :
15136                    unwrapRNode(lView[idxOrTargetGetter]);
15137                const listener = lCleanup[lastLCleanupIndex = tCleanup[i + 2]];
15138                const useCaptureOrSubIdx = tCleanup[i + 3];
15139                if (typeof useCaptureOrSubIdx === 'boolean') {
15140                    // native DOM listener registered with Renderer3
15141                    target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);
15142                }
15143                else {
15144                    if (useCaptureOrSubIdx >= 0) {
15145                        // unregister
15146                        lCleanup[lastLCleanupIndex = useCaptureOrSubIdx]();
15147                    }
15148                    else {
15149                        // Subscription
15150                        lCleanup[lastLCleanupIndex = -useCaptureOrSubIdx].unsubscribe();
15151                    }
15152                }
15153                i += 2;
15154            }
15155            else {
15156                // This is a cleanup function that is grouped with the index of its context
15157                const context = lCleanup[lastLCleanupIndex = tCleanup[i + 1]];
15158                tCleanup[i].call(context);
15159            }
15160        }
15161    }
15162    if (lCleanup !== null) {
15163        for (let i = lastLCleanupIndex + 1; i < lCleanup.length; i++) {
15164            const instanceCleanupFn = lCleanup[i];
15165            ngDevMode && assertFunction(instanceCleanupFn, 'Expecting instance cleanup function.');
15166            instanceCleanupFn();
15167        }
15168        lView[CLEANUP] = null;
15169    }
15170}
15171/** Calls onDestroy hooks for this view */
15172function executeOnDestroys(tView, lView) {
15173    let destroyHooks;
15174    if (tView != null && (destroyHooks = tView.destroyHooks) != null) {
15175        for (let i = 0; i < destroyHooks.length; i += 2) {
15176            const context = lView[destroyHooks[i]];
15177            // Only call the destroy hook if the context has been requested.
15178            if (!(context instanceof NodeInjectorFactory)) {
15179                const toCall = destroyHooks[i + 1];
15180                if (Array.isArray(toCall)) {
15181                    for (let j = 0; j < toCall.length; j += 2) {
15182                        toCall[j + 1].call(context[toCall[j]]);
15183                    }
15184                }
15185                else {
15186                    toCall.call(context);
15187                }
15188            }
15189        }
15190    }
15191}
15192/**
15193 * Returns a native element if a node can be inserted into the given parent.
15194 *
15195 * There are two reasons why we may not be able to insert a element immediately.
15196 * - Projection: When creating a child content element of a component, we have to skip the
15197 *   insertion because the content of a component will be projected.
15198 *   `<component><content>delayed due to projection</content></component>`
15199 * - Parent container is disconnected: This can happen when we are inserting a view into
15200 *   parent container, which itself is disconnected. For example the parent container is part
15201 *   of a View which has not be inserted or is made for projection but has not been inserted
15202 *   into destination.
15203 *
15204 * @param tView: Current `TView`.
15205 * @param tNode: `TNode` for which we wish to retrieve render parent.
15206 * @param lView: Current `LView`.
15207 */
15208function getParentRElement(tView, tNode, lView) {
15209    return getClosestRElement(tView, tNode.parent, lView);
15210}
15211/**
15212 * Get closest `RElement` or `null` if it can't be found.
15213 *
15214 * If `TNode` is `TNodeType.Element` => return `RElement` at `LView[tNode.index]` location.
15215 * If `TNode` is `TNodeType.ElementContainer|IcuContain` => return the parent (recursively).
15216 * If `TNode` is `null` then return host `RElement`:
15217 *   - return `null` if projection
15218 *   - return `null` if parent container is disconnected (we have no parent.)
15219 *
15220 * @param tView: Current `TView`.
15221 * @param tNode: `TNode` for which we wish to retrieve `RElement` (or `null` if host element is
15222 *     needed).
15223 * @param lView: Current `LView`.
15224 * @returns `null` if the `RElement` can't be determined at this time (no parent / projection)
15225 */
15226function getClosestRElement(tView, tNode, lView) {
15227    let parentTNode = tNode;
15228    // Skip over element and ICU containers as those are represented by a comment node and
15229    // can't be used as a render parent.
15230    while (parentTNode !== null &&
15231        (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */))) {
15232        tNode = parentTNode;
15233        parentTNode = tNode.parent;
15234    }
15235    // If the parent tNode is null, then we are inserting across views: either into an embedded view
15236    // or a component view.
15237    if (parentTNode === null) {
15238        // We are inserting a root element of the component view into the component host element and
15239        // it should always be eager.
15240        return lView[HOST];
15241    }
15242    else {
15243        ngDevMode && assertTNodeType(parentTNode, 3 /* AnyRNode */ | 4 /* Container */);
15244        if (parentTNode.flags & 2 /* isComponentHost */) {
15245            ngDevMode && assertTNodeForLView(parentTNode, lView);
15246            const encapsulation = tView.data[parentTNode.directiveStart].encapsulation;
15247            // We've got a parent which is an element in the current view. We just need to verify if the
15248            // parent element is not a component. Component's content nodes are not inserted immediately
15249            // because they will be projected, and so doing insert at this point would be wasteful.
15250            // Since the projection would then move it to its final destination. Note that we can't
15251            // make this assumption when using the Shadow DOM, because the native projection placeholders
15252            // (<content> or <slot>) have to be in place as elements are being inserted.
15253            if (encapsulation === ViewEncapsulation.None ||
15254                encapsulation === ViewEncapsulation.Emulated) {
15255                return null;
15256            }
15257        }
15258        return getNativeByTNode(parentTNode, lView);
15259    }
15260}
15261/**
15262 * Inserts a native node before another native node for a given parent using {@link Renderer3}.
15263 * This is a utility function that can be used when native nodes were determined - it abstracts an
15264 * actual renderer being used.
15265 */
15266function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
15267    ngDevMode && ngDevMode.rendererInsertBefore++;
15268    if (isProceduralRenderer(renderer)) {
15269        renderer.insertBefore(parent, child, beforeNode, isMove);
15270    }
15271    else {
15272        parent.insertBefore(child, beforeNode, isMove);
15273    }
15274}
15275function nativeAppendChild(renderer, parent, child) {
15276    ngDevMode && ngDevMode.rendererAppendChild++;
15277    ngDevMode && assertDefined(parent, 'parent node must be defined');
15278    if (isProceduralRenderer(renderer)) {
15279        renderer.appendChild(parent, child);
15280    }
15281    else {
15282        parent.appendChild(child);
15283    }
15284}
15285function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
15286    if (beforeNode !== null) {
15287        nativeInsertBefore(renderer, parent, child, beforeNode, isMove);
15288    }
15289    else {
15290        nativeAppendChild(renderer, parent, child);
15291    }
15292}
vendor: 13,302 bytes, lines 15293-15591
15293/** Removes a node from the DOM given its native parent. */
15294function nativeRemoveChild(renderer, parent, child, isHostElement) {
15295    if (isProceduralRenderer(renderer)) {
15296        renderer.removeChild(parent, child, isHostElement);
15297    }
15298    else {
15299        parent.removeChild(child);
15300    }
15301}
15302/**
15303 * Returns a native parent of a given native node.
15304 */
15305function nativeParentNode(renderer, node) {
15306    return (isProceduralRenderer(renderer) ? renderer.parentNode(node) : node.parentNode);
15307}
15308/**
15309 * Returns a native sibling of a given native node.
15310 */
15311function nativeNextSibling(renderer, node) {
15312    return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling;
15313}
15314/**
15315 * Find a node in front of which `currentTNode` should be inserted.
15316 *
15317 * This method determines the `RNode` in front of which we should insert the `currentRNode`. This
15318 * takes `TNode.insertBeforeIndex` into account if i18n code has been invoked.
15319 *
15320 * @param parentTNode parent `TNode`
15321 * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)
15322 * @param lView current `LView`
15323 */
15324function getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {
15325    return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);
15326}
15327/**
15328 * Find a node in front of which `currentTNode` should be inserted. (Does not take i18n into
15329 * account)
15330 *
15331 * This method determines the `RNode` in front of which we should insert the `currentRNode`. This
15332 * does not take `TNode.insertBeforeIndex` into account.
15333 *
15334 * @param parentTNode parent `TNode`
15335 * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)
15336 * @param lView current `LView`
15337 */
15338function getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {
15339    if (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */)) {
15340        return getNativeByTNode(parentTNode, lView);
15341    }
15342    return null;
15343}
15344/**
15345 * Tree shakable boundary for `getInsertInFrontOfRNodeWithI18n` function.
15346 *
15347 * This function will only be set if i18n code runs.
15348 */
15349let _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n;
15350/**
15351 * Tree shakable boundary for `processI18nInsertBefore` function.
15352 *
15353 * This function will only be set if i18n code runs.
15354 */
15355let _processI18nInsertBefore;
15356function setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore) {
15357    _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n;
15358    _processI18nInsertBefore = processI18nInsertBefore;
15359}
15360/**
15361 * Appends the `child` native node (or a collection of nodes) to the `parent`.
15362 *
15363 * @param tView The `TView' to be appended
15364 * @param lView The current LView
15365 * @param childRNode The native child (or children) that should be appended
15366 * @param childTNode The TNode of the child element
15367 */
15368function appendChild(tView, lView, childRNode, childTNode) {
15369    const parentRNode = getParentRElement(tView, childTNode, lView);
15370    const renderer = lView[RENDERER];
15371    const parentTNode = childTNode.parent || lView[T_HOST];
15372    const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);
15373    if (parentRNode != null) {
15374        if (Array.isArray(childRNode)) {
15375            for (let i = 0; i < childRNode.length; i++) {
15376                nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false);
15377            }
15378        }
15379        else {
15380            nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);
15381        }
15382    }
15383    _processI18nInsertBefore !== undefined &&
15384        _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);
15385}
15386/**
15387 * Returns the first native node for a given LView, starting from the provided TNode.
15388 *
15389 * Native nodes are returned in the order in which those appear in the native tree (DOM).
15390 */
15391function getFirstNativeNode(lView, tNode) {
15392    if (tNode !== null) {
15393        ngDevMode &&
15394            assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */ | 32 /* Icu */ | 16 /* Projection */);
15395        const tNodeType = tNode.type;
15396        if (tNodeType & 3 /* AnyRNode */) {
15397            return getNativeByTNode(tNode, lView);
15398        }
15399        else if (tNodeType & 4 /* Container */) {
15400            return getBeforeNodeForView(-1, lView[tNode.index]);
15401        }
15402        else if (tNodeType & 8 /* ElementContainer */) {
15403            const elIcuContainerChild = tNode.child;
15404            if (elIcuContainerChild !== null) {
15405                return getFirstNativeNode(lView, elIcuContainerChild);
15406            }
15407            else {
15408                const rNodeOrLContainer = lView[tNode.index];
15409                if (isLContainer(rNodeOrLContainer)) {
15410                    return getBeforeNodeForView(-1, rNodeOrLContainer);
15411                }
15412                else {
15413                    return unwrapRNode(rNodeOrLContainer);
15414                }
15415            }
15416        }
15417        else if (tNodeType & 32 /* Icu */) {
15418            let nextRNode = icuContainerIterate(tNode, lView);
15419            let rNode = nextRNode();
15420            // If the ICU container has no nodes, than we use the ICU anchor as the node.
15421            return rNode || unwrapRNode(lView[tNode.index]);
15422        }
15423        else {
15424            const projectionNodes = getProjectionNodes(lView, tNode);
15425            if (projectionNodes !== null) {
15426                if (Array.isArray(projectionNodes)) {
15427                    return projectionNodes[0];
15428                }
15429                const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);
15430                ngDevMode && assertParentView(parentView);
15431                return getFirstNativeNode(parentView, projectionNodes);
15432            }
15433            else {
15434                return getFirstNativeNode(lView, tNode.next);
15435            }
15436        }
15437    }
15438    return null;
15439}
15440function getProjectionNodes(lView, tNode) {
15441    if (tNode !== null) {
15442        const componentView = lView[DECLARATION_COMPONENT_VIEW];
15443        const componentHost = componentView[T_HOST];
15444        const slotIdx = tNode.projection;
15445        ngDevMode && assertProjectionSlots(lView);
15446        return componentHost.projection[slotIdx];
15447    }
15448    return null;
15449}
15450function getBeforeNodeForView(viewIndexInContainer, lContainer) {
15451    const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;
15452    if (nextViewIndex < lContainer.length) {
15453        const lView = lContainer[nextViewIndex];
15454        const firstTNodeOfView = lView[TVIEW].firstChild;
15455        if (firstTNodeOfView !== null) {
15456            return getFirstNativeNode(lView, firstTNodeOfView);
15457        }
15458    }
15459    return lContainer[NATIVE];
15460}
15461/**
15462 * Removes a native node itself using a given renderer. To remove the node we are looking up its
15463 * parent from the native tree as not all platforms / browsers support the equivalent of
15464 * node.remove().
15465 *
15466 * @param renderer A renderer to be used
15467 * @param rNode The native node that should be removed
15468 * @param isHostElement A flag indicating if a node to be removed is a host of a component.
15469 */
15470function nativeRemoveNode(renderer, rNode, isHostElement) {
15471    ngDevMode && ngDevMode.rendererRemoveNode++;
15472    const nativeParent = nativeParentNode(renderer, rNode);
15473    if (nativeParent) {
15474        nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);
15475    }
15476}
15477/**
15478 * Performs the operation of `action` on the node. Typically this involves inserting or removing
15479 * nodes on the LView or projection boundary.
15480 */
15481function applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) {
15482    while (tNode != null) {
15483        ngDevMode && assertTNodeForLView(tNode, lView);
15484        ngDevMode &&
15485            assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */ | 16 /* Projection */ | 32 /* Icu */);
15486        const rawSlotValue = lView[tNode.index];
15487        const tNodeType = tNode.type;
15488        if (isProjection) {
15489            if (action === 0 /* Create */) {
15490                rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);
15491                tNode.flags |= 4 /* isProjected */;
15492            }
15493        }
15494        if ((tNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {
15495            if (tNodeType & 8 /* ElementContainer */) {
15496                applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);
15497                applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
15498            }
15499            else if (tNodeType & 32 /* Icu */) {
15500                const nextRNode = icuContainerIterate(tNode, lView);
15501                let rNode;
15502                while (rNode = nextRNode()) {
15503                    applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);
15504                }
15505                applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
15506            }
15507            else if (tNodeType & 16 /* Projection */) {
15508                applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);
15509            }
15510            else {
15511                ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 4 /* Container */);
15512                applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
15513            }
15514        }
15515        tNode = isProjection ? tNode.projectionNext : tNode.next;
15516    }
15517}
15518function applyView(tView, lView, renderer, action, parentRElement, beforeNode) {
15519    applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);
15520}
15521/**
15522 * `applyProjection` performs operation on the projection.
15523 *
15524 * Inserting a projection requires us to locate the projected nodes from the parent component. The
15525 * complication is that those nodes themselves could be re-projected from their parent component.
15526 *
15527 * @param tView The `TView` of `LView` which needs to be inserted, detached, destroyed
15528 * @param lView The `LView` which needs to be inserted, detached, destroyed.
15529 * @param tProjectionNode node to project
15530 */
15531function applyProjection(tView, lView, tProjectionNode) {
15532    const renderer = lView[RENDERER];
15533    const parentRNode = getParentRElement(tView, tProjectionNode, lView);
15534    const parentTNode = tProjectionNode.parent || lView[T_HOST];
15535    let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);
15536    applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, parentRNode, beforeNode);
15537}
15538/**
15539 * `applyProjectionRecursive` performs operation on the projection specified by `action` (insert,
15540 * detach, destroy)
15541 *
15542 * Inserting a projection requires us to locate the projected nodes from the parent component. The
15543 * complication is that those nodes themselves could be re-projected from their parent component.
15544 *
15545 * @param renderer Render to use
15546 * @param action action to perform (insert, detach, destroy)
15547 * @param lView The LView which needs to be inserted, detached, destroyed.
15548 * @param tProjectionNode node to project
15549 * @param parentRElement parent DOM element for insertion/removal.
15550 * @param beforeNode Before which node the insertions should happen.
15551 */
15552function applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) {
15553    const componentLView = lView[DECLARATION_COMPONENT_VIEW];
15554    const componentNode = componentLView[T_HOST];
15555    ngDevMode &&
15556        assertEqual(typeof tProjectionNode.projection, 'number', 'expecting projection index');
15557    const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection];
15558    if (Array.isArray(nodeToProjectOrRNodes)) {
15559        // This should not exist, it is a bit of a hack. When we bootstrap a top level node and we
15560        // need to support passing projectable nodes, so we cheat and put them in the TNode
15561        // of the Host TView. (Yes we put instance info at the T Level). We can get away with it
15562        // because we know that that TView is not shared and therefore it will not be a problem.
15563        // This should be refactored and cleaned up.
15564        for (let i = 0; i < nodeToProjectOrRNodes.length; i++) {
15565            const rNode = nodeToProjectOrRNodes[i];
15566            applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);
15567        }
15568    }
15569    else {
15570        let nodeToProject = nodeToProjectOrRNodes;
15571        const projectedComponentLView = componentLView[PARENT];
15572        applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);
15573    }
15574}
15575/**
15576 * `applyContainer` performs an operation on the container and its views as specified by
15577 * `action` (insert, detach, destroy)
15578 *
15579 * Inserting a Container is complicated by the fact that the container may have Views which
15580 * themselves have containers or projections.
15581 *
15582 * @param renderer Renderer to use
15583 * @param action action to perform (insert, detach, destroy)
15584 * @param lContainer The LContainer which needs to be inserted, detached, destroyed.
15585 * @param parentRElement parent DOM element for insertion/removal.
15586 * @param beforeNode Before which node the insertions should happen.
15587 */
15588function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {
15589    ngDevMode && assertLContainer(lContainer);
15590    const anchor = lContainer[NATIVE]; // LContainer has its own before node.
15591    const native = unwrapRNode(lContainer);
15592    // An LContainer can be created dynamically on any node by injecting ViewContainerRef.
15593    // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor
15594    // node (comment in the DOM) that will be different from the LContainer's host node. In this
15595    // particular case we need to execute action on 2 nodes:
15596    // - container's host node (this is done in the executeActionOnElementOrContainer)
15597    // - container's host node (this is done here)
15598    if (anchor !== native) {
15599        // This is very strange to me (Misko). I would expect that the native is same as anchor. I
15600        // don't see a reason why they should be different, but they are.
15601        //
15602        // If they are we need to process the second anchor as well.
15603        applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);
15604    }
15605    for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
15606        const lView = lContainer[i];
15607        applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);
15608    }
15609}
15610/**
15611 * Writes class/style to element.
15612 *
15613 * @param renderer Renderer to use.
15614 * @param isClassBased `true` if it should be written to `class` (`false` to write to `style`)
15615 * @param rNode The Node to write to.
15616 * @param prop Property to write to. This would be the class/style name.
15617 * @param value Value to write. If `null`/`undefined`/`false` this is considered a remove (set/add
15618 *        otherwise).
15619 */
15620function applyStyling(renderer, isClassBased, rNode, prop, value) {
15621    const isProcedural = isProceduralRenderer(renderer);
15622    if (isClassBased) {
15623        // We actually want JS true/false here because any truthy value should add the class
15624        if (!value) {
15625            ngDevMode && ngDevMode.rendererRemoveClass++;
15626            if (isProcedural) {
15627                renderer.removeClass(rNode, prop);
15628            }
15629            else {
15630                rNode.classList.remove(prop);
15631            }
15632        }
15633        else {
15634            ngDevMode && ngDevMode.rendererAddClass++;
15635            if (isProcedural) {
15636                renderer.addClass(rNode, prop);
15637            }
15638            else {
15639                ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected');
15640                rNode.classList.add(prop);
15641            }
15642        }
15643    }
15644    else {
15645        let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;
15646        if (value == null /** || value === undefined */) {
15647            ngDevMode && ngDevMode.rendererRemoveStyle++;
15648            if (isProcedural) {
15649                renderer.removeStyle(rNode, prop, flags);
15650            }
15651            else {
15652                rNode.style.removeProperty(prop);
15653            }
15654        }
15655        else {
15656            // A value is important if it ends with `!important`. The style
15657            // parser strips any semicolons at the end of the value.
15658            const isImportant = typeof value === 'string' ? value.endsWith('!important') : false;
15659            if (isImportant) {
15660                // !important has to be stripped from the value for it to be valid.
15661                value = value.slice(0, -10);
15662                flags |= RendererStyleFlags2.Important;
15663            }
15664            ngDevMode && ngDevMode.rendererSetStyle++;
15665            if (isProcedural) {
15666                renderer.setStyle(rNode, prop, value, flags);
15667            }
15668            else {
15669                ngDevMode && assertDefined(rNode.style, 'HTMLElement expected');
15670                rNode.style.setProperty(prop, value, isImportant ? 'important' : '');
15671            }
15672        }
15673    }
15674}
15675/**
15676 * Write `cssText` to `RElement`.
15677 *
15678 * This function does direct write without any reconciliation. Used for writing initial values, so
15679 * that static styling values do not pull in the style parser.
15680 *
15681 * @param renderer Renderer to use
15682 * @param element The element which needs to be updated.
15683 * @param newValue The new class list to write.
15684 */
15685function writeDirectStyle(renderer, element, newValue) {
15686    ngDevMode && assertString(newValue, '\'newValue\' should be a string');
15687    if (isProceduralRenderer(renderer)) {
15688        renderer.setAttribute(element, 'style', newValue);
15689    }
15690    else {
15691        element.style.cssText = newValue;
15692    }
15693    ngDevMode && ngDevMode.rendererSetStyle++;
15694}
15695/**
15696 * Write `className` to `RElement`.
15697 *
15698 * This function does direct write without any reconciliation. Used for writing initial values, so
15699 * that static styling values do not pull in the style parser.
15700 *
15701 * @param renderer Renderer to use
15702 * @param element The element which needs to be updated.
15703 * @param newValue The new class list to write.
15704 */
15705function writeDirectClass(renderer, element, newValue) {
15706    ngDevMode && assertString(newValue, '\'newValue\' should be a string');
15707    if (isProceduralRenderer(renderer)) {
15708        if (newValue === '') {
15709            // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
15710            renderer.removeAttribute(element, 'class');
15711        }
15712        else {
15713            renderer.setAttribute(element, 'class', newValue);
15714        }
15715    }
15716    else {
15717        element.className = newValue;
15718    }
15719    ngDevMode && ngDevMode.rendererSetClassName++;
15720}
15721
15722/**
15723 * @license
15724 * Copyright Google LLC All Rights Reserved.
15725 *
15726 * Use of this source code is governed by an MIT-style license that can be
15727 * found in the LICENSE file at https://angular.io/license
15728 */
15729/**
15730 * Returns an index of `classToSearch` in `className` taking token boundaries into account.
15731 *
15732 * `classIndexOf('AB A', 'A', 0)` will be 3 (not 0 since `AB!==A`)
15733 *
15734 * @param className A string containing classes (whitespace separated)
15735 * @param classToSearch A class name to locate
15736 * @param startingIndex Starting location of search
15737 * @returns an index of the located class (or -1 if not found)
15738 */
15739function classIndexOf(className, classToSearch, startingIndex) {
15740    ngDevMode && assertNotEqual(classToSearch, '', 'can not look for "" string.');
15741    let end = className.length;
15742    while (true) {
15743        const foundIndex = className.indexOf(classToSearch, startingIndex);
15744        if (foundIndex === -1)
15745            return foundIndex;
15746        if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* SPACE */) {
15747            // Ensure that it has leading whitespace
15748            const length = classToSearch.length;
15749            if (foundIndex + length === end ||
15750                className.charCodeAt(foundIndex + length) <= 32 /* SPACE */) {
15751                // Ensure that it has trailing whitespace
15752                return foundIndex;
15753            }
15754        }
15755        // False positive, keep searching from where we left off.
15756        startingIndex = foundIndex + 1;
15757    }
15758}
15759
15760/**
15761 * @license
15762 * Copyright Google LLC All Rights Reserved.
15763 *
15764 * Use of this source code is governed by an MIT-style license that can be
15765 * found in the LICENSE file at https://angular.io/license
15766 */
15767const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5;
15768const NG_TEMPLATE_SELECTOR = 'ng-template';
15769/**
15770 * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
15771 *
15772 * @param attrs `TAttributes` to search through.
15773 * @param cssClassToMatch class to match (lowercase)
15774 * @param isProjectionMode Whether or not class matching should look into the attribute `class` in
15775 *    addition to the `AttributeMarker.Classes`.
15776 */
15777function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {
15778    // TODO(misko): The fact that this function needs to know about `isProjectionMode` seems suspect.
15779    // It is strange to me that sometimes the class information comes in form of `class` attribute
15780    // and sometimes in form of `AttributeMarker.Classes`. Some investigation is needed to determine
15781    // if that is the right behavior.
15782    ngDevMode &&
15783        assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');
15784    let i = 0;
15785    while (i < attrs.length) {
15786        let item = attrs[i++];
15787        if (isProjectionMode && item === 'class') {
15788            item = attrs[i];
15789            if (classIndexOf(item.toLowerCase(), cssClassToMatch, 0) !== -1) {
15790                return true;
15791            }
15792        }
15793        else if (item === 1 /* Classes */) {
15794            // We found the classes section. Start searching for the class.
15795            while (i < attrs.length && typeof (item = attrs[i++]) == 'string') {
15796                // while we have strings
15797                if (item.toLowerCase() === cssClassToMatch)
15798                    return true;
15799            }
15800            return false;
15801        }
15802    }
15803    return false;
15804}
15805/**
15806 * Checks whether the `tNode` represents an inline template (e.g. `*ngFor`).
15807 *
15808 * @param tNode current TNode
15809 */
15810function isInlineTemplate(tNode) {
15811    return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;
15812}
15813/**
15814 * Function that checks whether a given tNode matches tag-based selector and has a valid type.
15815 *
15816 * Matching can be performed in 2 modes: projection mode (when we project nodes) and regular
15817 * directive matching mode:
15818 * - in the "directive matching" mode we do _not_ take TContainer's tagName into account if it is
15819 * different from NG_TEMPLATE_SELECTOR (value different from NG_TEMPLATE_SELECTOR indicates that a
15820 * tag name was extracted from * syntax so we would match the same directive twice);
15821 * - in the "projection" mode, we use a tag name potentially extracted from the * syntax processing
15822 * (applicable to TNodeType.Container only).
15823 */
15824function hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {
15825    const tagNameToCompare = tNode.type === 4 /* Container */ && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;
15826    return currentSelector === tagNameToCompare;
15827}
15828/**
15829 * A utility function to match an Ivy node static data against a simple CSS selector
15830 *
15831 * @param node static data of the node to match
15832 * @param selector The selector to try matching against the node.
15833 * @param isProjectionMode if `true` we are matching for content projection, otherwise we are doing
15834 * directive matching.
15835 * @returns true if node matches the selector.
15836 */
15837function isNodeMatchingSelector(tNode, selector, isProjectionMode) {
15838    ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');
15839    let mode = 4 /* ELEMENT */;
15840    const nodeAttrs = tNode.attrs || [];
15841    // Find the index of first attribute that has no value, only a name.
15842    const nameOnlyMarkerIdx = getNameOnlyMarkerIndex(nodeAttrs);
15843    // When processing ":not" selectors, we skip to the next ":not" if the
15844    // current one doesn't match
15845    let skipToNextSelector = false;
15846    for (let i = 0; i < selector.length; i++) {
15847        const current = selector[i];
15848        if (typeof current === 'number') {
15849            // If we finish processing a :not selector and it hasn't failed, return false
15850            if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {
15851                return false;
15852            }
15853            // If we are skipping to the next :not() and this mode flag is positive,
15854            // it's a part of the current :not() selector, and we should keep skipping
15855            if (skipToNextSelector && isPositive(current))
15856                continue;
15857            skipToNextSelector = false;
15858            mode = current | (mode & 1 /* NOT */);
15859            continue;
15860        }
15861        if (skipToNextSelector)
15862            continue;
15863        if (mode & 4 /* ELEMENT */) {
15864            mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */;
15865            if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) ||
15866                current === '' && selector.length === 1) {
15867                if (isPositive(mode))
15868                    return false;
15869                skipToNextSelector = true;
15870            }
15871        }
15872        else {
15873            const selectorAttrValue = mode & 8 /* CLASS */ ? current : selector[++i];
15874            // special case for matching against classes when a tNode has been instantiated with
15875            // class and style values as separate attribute values (e.g. ['title', CLASS, 'foo'])
15876            if ((mode & 8 /* CLASS */) && tNode.attrs !== null) {
15877                if (!isCssClassMatching(tNode.attrs, selectorAttrValue, isProjectionMode)) {
15878                    if (isPositive(mode))
15879                        return false;
15880                    skipToNextSelector = true;
15881                }
15882                continue;
15883            }
15884            const attrName = (mode & 8 /* CLASS */) ? 'class' : current;
15885            const attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);
15886            if (attrIndexInNode === -1) {
15887                if (isPositive(mode))
15888                    return false;
vendor: 9,777 bytes, lines 15889-16118
15889                skipToNextSelector = true;
15890                continue;
15891            }
15892            if (selectorAttrValue !== '') {
15893                let nodeAttrValue;
15894                if (attrIndexInNode > nameOnlyMarkerIdx) {
15895                    nodeAttrValue = '';
15896                }
15897                else {
15898                    ngDevMode &&
15899                        assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* NamespaceURI */, 'We do not match directives on namespaced attributes');
15900                    // we lowercase the attribute value to be able to match
15901                    // selectors without case-sensitivity
15902                    // (selectors are already in lowercase when generated)
15903                    nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();
15904                }
15905                const compareAgainstClassName = mode & 8 /* CLASS */ ? nodeAttrValue : null;
15906                if (compareAgainstClassName &&
15907                    classIndexOf(compareAgainstClassName, selectorAttrValue, 0) !== -1 ||
15908                    mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {
15909                    if (isPositive(mode))
15910                        return false;
15911                    skipToNextSelector = true;
15912                }
15913            }
15914        }
15915    }
15916    return isPositive(mode) || skipToNextSelector;
15917}
15918function isPositive(mode) {
15919    return (mode & 1 /* NOT */) === 0;
15920}
15921/**
15922 * Examines the attribute's definition array for a node to find the index of the
15923 * attribute that matches the given `name`.
15924 *
15925 * NOTE: This will not match namespaced attributes.
15926 *
15927 * Attribute matching depends upon `isInlineTemplate` and `isProjectionMode`.
15928 * The following table summarizes which types of attributes we attempt to match:
15929 *
15930 * ===========================================================================================================
15931 * Modes                   | Normal Attributes | Bindings Attributes | Template Attributes | I18n
15932 * Attributes
15933 * ===========================================================================================================
15934 * Inline + Projection     | YES               | YES                 | NO                  | YES
15935 * -----------------------------------------------------------------------------------------------------------
15936 * Inline + Directive      | NO                | NO                  | YES                 | NO
15937 * -----------------------------------------------------------------------------------------------------------
15938 * Non-inline + Projection | YES               | YES                 | NO                  | YES
15939 * -----------------------------------------------------------------------------------------------------------
15940 * Non-inline + Directive  | YES               | YES                 | NO                  | YES
15941 * ===========================================================================================================
15942 *
15943 * @param name the name of the attribute to find
15944 * @param attrs the attribute array to examine
15945 * @param isInlineTemplate true if the node being matched is an inline template (e.g. `*ngFor`)
15946 * rather than a manually expanded template node (e.g `<ng-template>`).
15947 * @param isProjectionMode true if we are matching against content projection otherwise we are
15948 * matching against directives.
15949 */
15950function findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {
15951    if (attrs === null)
15952        return -1;
15953    let i = 0;
15954    if (isProjectionMode || !isInlineTemplate) {
15955        let bindingsMode = false;
15956        while (i < attrs.length) {
15957            const maybeAttrName = attrs[i];
15958            if (maybeAttrName === name) {
15959                return i;
15960            }
15961            else if (maybeAttrName === 3 /* Bindings */ || maybeAttrName === 6 /* I18n */) {
15962                bindingsMode = true;
15963            }
15964            else if (maybeAttrName === 1 /* Classes */ || maybeAttrName === 2 /* Styles */) {
15965                let value = attrs[++i];
15966                // We should skip classes here because we have a separate mechanism for
15967                // matching classes in projection mode.
15968                while (typeof value === 'string') {
15969                    value = attrs[++i];
15970                }
15971                continue;
15972            }
15973            else if (maybeAttrName === 4 /* Template */) {
15974                // We do not care about Template attributes in this scenario.
15975                break;
15976            }
15977            else if (maybeAttrName === 0 /* NamespaceURI */) {
15978                // Skip the whole namespaced attribute and value. This is by design.
15979                i += 4;
15980                continue;
15981            }
15982            // In binding mode there are only names, rather than name-value pairs.
15983            i += bindingsMode ? 1 : 2;
15984        }
15985        // We did not match the attribute
15986        return -1;
15987    }
15988    else {
15989        return matchTemplateAttribute(attrs, name);
15990    }
15991}
15992function isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {
15993    for (let i = 0; i < selector.length; i++) {
15994        if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {
15995            return true;
15996        }
15997    }
15998    return false;
15999}
16000function getProjectAsAttrValue(tNode) {
16001    const nodeAttrs = tNode.attrs;
16002    if (nodeAttrs != null) {
16003        const ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* ProjectAs */);
16004        // only check for ngProjectAs in attribute names, don't accidentally match attribute's value
16005        // (attribute names are stored at even indexes)
16006        if ((ngProjectAsAttrIdx & 1) === 0) {
16007            return nodeAttrs[ngProjectAsAttrIdx + 1];
16008        }
16009    }
16010    return null;
16011}
16012function getNameOnlyMarkerIndex(nodeAttrs) {
16013    for (let i = 0; i < nodeAttrs.length; i++) {
16014        const nodeAttr = nodeAttrs[i];
16015        if (isNameOnlyAttributeMarker(nodeAttr)) {
16016            return i;
16017        }
16018    }
16019    return nodeAttrs.length;
16020}
16021function matchTemplateAttribute(attrs, name) {
16022    let i = attrs.indexOf(4 /* Template */);
16023    if (i > -1) {
16024        i++;
16025        while (i < attrs.length) {
16026            const attr = attrs[i];
16027            // Return in case we checked all template attrs and are switching to the next section in the
16028            // attrs array (that starts with a number that represents an attribute marker).
16029            if (typeof attr === 'number')
16030                return -1;
16031            if (attr === name)
16032                return i;
16033            i++;
16034        }
16035    }
16036    return -1;
16037}
16038/**
16039 * Checks whether a selector is inside a CssSelectorList
16040 * @param selector Selector to be checked.
16041 * @param list List in which to look for the selector.
16042 */
16043function isSelectorInSelectorList(selector, list) {
16044    selectorListLoop: for (let i = 0; i < list.length; i++) {
16045        const currentSelectorInList = list[i];
16046        if (selector.length !== currentSelectorInList.length) {
16047            continue;
16048        }
16049        for (let j = 0; j < selector.length; j++) {
16050            if (selector[j] !== currentSelectorInList[j]) {
16051                continue selectorListLoop;
16052            }
16053        }
16054        return true;
16055    }
16056    return false;
16057}
16058function maybeWrapInNotSelector(isNegativeMode, chunk) {
16059    return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk;
16060}
16061function stringifyCSSSelector(selector) {
16062    let result = selector[0];
16063    let i = 1;
16064    let mode = 2 /* ATTRIBUTE */;
16065    let currentChunk = '';
16066    let isNegativeMode = false;
16067    while (i < selector.length) {
16068        let valueOrMarker = selector[i];
16069        if (typeof valueOrMarker === 'string') {
16070            if (mode & 2 /* ATTRIBUTE */) {
16071                const attrValue = selector[++i];
16072                currentChunk +=
16073                    '[' + valueOrMarker + (attrValue.length > 0 ? '="' + attrValue + '"' : '') + ']';
16074            }
16075            else if (mode & 8 /* CLASS */) {
16076                currentChunk += '.' + valueOrMarker;
16077            }
16078            else if (mode & 4 /* ELEMENT */) {
16079                currentChunk += ' ' + valueOrMarker;
16080            }
16081        }
16082        else {
16083            //
16084            // Append current chunk to the final result in case we come across SelectorFlag, which
16085            // indicates that the previous section of a selector is over. We need to accumulate content
16086            // between flags to make sure we wrap the chunk later in :not() selector if needed, e.g.
16087            // ```
16088            //  ['', Flags.CLASS, '.classA', Flags.CLASS | Flags.NOT, '.classB', '.classC']
16089            // ```
16090            // should be transformed to `.classA :not(.classB .classC)`.
16091            //
16092            // Note: for negative selector part, we accumulate content between flags until we find the
16093            // next negative flag. This is needed to support a case where `:not()` rule contains more than
16094            // one chunk, e.g. the following selector:
16095            // ```
16096            //  ['', Flags.ELEMENT | Flags.NOT, 'p', Flags.CLASS, 'foo', Flags.CLASS | Flags.NOT, 'bar']
16097            // ```
16098            // should be stringified to `:not(p.foo) :not(.bar)`
16099            //
16100            if (currentChunk !== '' && !isPositive(valueOrMarker)) {
16101                result += maybeWrapInNotSelector(isNegativeMode, currentChunk);
16102                currentChunk = '';
16103            }
16104            mode = valueOrMarker;
16105            // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative
16106            // mode is maintained for remaining chunks of a selector.
16107            isNegativeMode = isNegativeMode || !isPositive(mode);
16108        }
16109        i++;
16110    }
16111    if (currentChunk !== '') {
16112        result += maybeWrapInNotSelector(isNegativeMode, currentChunk);
16113    }
16114    return result;
16115}
16116/**
16117 * Generates string representation of CSS selector in parsed form.
16118 *
16119 * ComponentDef and DirectiveDef are generated with the selector in parsed form to avoid doing
16120 * additional parsing at runtime (for example, for directive matching). However in some cases (for
16121 * example, while bootstrapping a component), a string version of the selector is required to query
16122 * for the host element on the page. This function takes the parsed form of a selector and returns
16123 * its string representation.
16124 *
16125 * @param selectorList selector in parsed form
16126 * @returns string representation of a given selector
16127 */
16128function stringifyCSSSelectorList(selectorList) {
16129    return selectorList.map(stringifyCSSSelector).join(',');
16130}
16131/**
16132 * Extracts attributes and classes information from a given CSS selector.
16133 *
16134 * This function is used while creating a component dynamically. In this case, the host element
16135 * (that is created dynamically) should contain attributes and classes specified in component's CSS
16136 * selector.
16137 *
16138 * @param selector CSS selector in parsed form (in a form of array)
16139 * @returns object with `attrs` and `classes` fields that contain extracted information
16140 */
16141function extractAttrsAndClassesFromSelector(selector) {
16142    const attrs = [];
16143    const classes = [];
16144    let i = 1;
16145    let mode = 2 /* ATTRIBUTE */;
16146    while (i < selector.length) {
16147        let valueOrMarker = selector[i];
16148        if (typeof valueOrMarker === 'string') {
16149            if (mode === 2 /* ATTRIBUTE */) {
16150                if (valueOrMarker !== '') {
16151                    attrs.push(valueOrMarker, selector[++i]);
16152                }
16153            }
16154            else if (mode === 8 /* CLASS */) {
16155                classes.push(valueOrMarker);
16156            }
16157        }
16158        else {
16159            // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative
16160            // mode is maintained for remaining chunks of a selector. Since attributes and classes are
16161            // extracted only for "positive" part of the selector, we can stop here.
16162            if (!isPositive(mode))
16163                break;
16164            mode = valueOrMarker;
16165        }
16166        i++;
16167    }
16168    return { attrs, classes };
16169}
16170
16171/**
16172 * @license
16173 * Copyright Google LLC All Rights Reserved.
16174 *
16175 * Use of this source code is governed by an MIT-style license that can be
16176 * found in the LICENSE file at https://angular.io/license
16177 */
16178/** A special value which designates that a value has not changed. */
16179const NO_CHANGE = (typeof ngDevMode === 'undefined' || ngDevMode) ? { __brand__: 'NO_CHANGE' } : {};
16180
16181/**
16182 * @license
16183 * Copyright Google LLC All Rights Reserved.
16184 *
16185 * Use of this source code is governed by an MIT-style license that can be
16186 * found in the LICENSE file at https://angular.io/license
16187 */
16188/**
16189 * Advances to an element for later binding instructions.
16190 *
16191 * Used in conjunction with instructions like {@link property} to act on elements with specified
16192 * indices, for example those created with {@link element} or {@link elementStart}.
16193 *
16194 * ```ts
16195 * (rf: RenderFlags, ctx: any) => {
16196 *   if (rf & 1) {
16197 *     text(0, 'Hello');
16198 *     text(1, 'Goodbye')
16199 *     element(2, 'div');
16200 *   }
16201 *   if (rf & 2) {
16202 *     advance(2); // Advance twice to the <div>.
16203 *     property('title', 'test');
16204 *   }
16205 *  }
16206 * ```
16207 * @param delta Number of elements to advance forwards by.
16208 *
16209 * @codeGenApi
16210 */
16211function ɵɵadvance(delta) {
16212    ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');
16213    selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, isInCheckNoChangesMode());
16214}
16215function selectIndexInternal(tView, lView, index, checkNoChangesMode) {
16216    ngDevMode && assertIndexInDeclRange(lView, index);
16217    // Flush the initial hooks for elements in the view that have been added up to this point.
16218    // PERF WARNING: do NOT extract this to a separate function without running benchmarks
16219    if (!checkNoChangesMode) {
16220        const hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */;
16221        if (hooksInitPhaseCompleted) {
16222            const preOrderCheckHooks = tView.preOrderCheckHooks;
16223            if (preOrderCheckHooks !== null) {
16224                executeCheckHooks(lView, preOrderCheckHooks, index);
16225            }
16226        }
16227        else {
16228            const preOrderHooks = tView.preOrderHooks;
16229            if (preOrderHooks !== null) {
16230                executeInitAndCheckHooks(lView, preOrderHooks, 0 /* OnInitHooksToBeRun */, index);
16231            }
16232        }
16233    }
16234    // We must set the selected index *after* running the hooks, because hooks may have side-effects
16235    // that cause other template functions to run, thus updating the selected index, which is global
16236    // state. If we run `setSelectedIndex` *before* we run the hooks, in some cases the selected index
16237    // will be altered by the time we leave the `ɵɵadvance` instruction.
16238    setSelectedIndex(index);
16239}
16240
16241/**
16242 * @license
16243 * Copyright Google LLC All Rights Reserved.
16244 *
16245 * Use of this source code is governed by an MIT-style license that can be
16246 * found in the LICENSE file at https://angular.io/license
16247 */
16248function toTStylingRange(prev, next) {
16249    ngDevMode && assertNumberInRange(prev, 0, 32767 /* UNSIGNED_MASK */);
16250    ngDevMode && assertNumberInRange(next, 0, 32767 /* UNSIGNED_MASK */);
16251    return (prev << 17 /* PREV_SHIFT */ | next << 2 /* NEXT_SHIFT */);
16252}
16253function getTStylingRangePrev(tStylingRange) {
16254    ngDevMode && assertNumber(tStylingRange, 'expected number');
16255    return (tStylingRange >> 17 /* PREV_SHIFT */) & 32767 /* UNSIGNED_MASK */;
16256}
16257function getTStylingRangePrevDuplicate(tStylingRange) {
16258    ngDevMode && assertNumber(tStylingRange, 'expected number');
16259    return (tStylingRange & 2 /* PREV_DUPLICATE */) ==
16260        2 /* PREV_DUPLICATE */;
16261}
16262function setTStylingRangePrev(tStylingRange, previous) {
16263    ngDevMode && assertNumber(tStylingRange, 'expected number');
16264    ngDevMode && assertNumberInRange(previous, 0, 32767 /* UNSIGNED_MASK */);
16265    return ((tStylingRange & ~4294836224 /* PREV_MASK */) |
16266        (previous << 17 /* PREV_SHIFT */));
16267}
16268function setTStylingRangePrevDuplicate(tStylingRange) {
16269    ngDevMode && assertNumber(tStylingRange, 'expected number');
16270    return (tStylingRange | 2 /* PREV_DUPLICATE */);
16271}
16272function getTStylingRangeNext(tStylingRange) {
16273    ngDevMode && assertNumber(tStylingRange, 'expected number');
16274    return (tStylingRange & 131068 /* NEXT_MASK */) >> 2 /* NEXT_SHIFT */;
16275}
16276function setTStylingRangeNext(tStylingRange, next) {
16277    ngDevMode && assertNumber(tStylingRange, 'expected number');
16278    ngDevMode && assertNumberInRange(next, 0, 32767 /* UNSIGNED_MASK */);
16279    return ((tStylingRange & ~131068 /* NEXT_MASK */) | //
16280        next << 2 /* NEXT_SHIFT */);
16281}
16282function getTStylingRangeNextDuplicate(tStylingRange) {
16283    ngDevMode && assertNumber(tStylingRange, 'expected number');
16284    return (tStylingRange & 1 /* NEXT_DUPLICATE */) ===
16285        1 /* NEXT_DUPLICATE */;
16286}
16287function setTStylingRangeNextDuplicate(tStylingRange) {
16288    ngDevMode && assertNumber(tStylingRange, 'expected number');
16289    return (tStylingRange | 1 /* NEXT_DUPLICATE */);
16290}
16291function getTStylingRangeTail(tStylingRange) {
16292    ngDevMode && assertNumber(tStylingRange, 'expected number');
16293    const next = getTStylingRangeNext(tStylingRange);
16294    return next === 0 ? getTStylingRangePrev(tStylingRange) : next;
16295}
16296
16297/**
16298 * @license
16299 * Copyright Google LLC All Rights Reserved.
16300 *
16301 * Use of this source code is governed by an MIT-style license that can be
16302 * found in the LICENSE file at https://angular.io/license
16303 */
16304/**
16305 * Patch a `debug` property on top of the existing object.
16306 *
16307 * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
16308 *
16309 * @param obj Object to patch
16310 * @param debug Value to patch
16311 */
16312function attachDebugObject(obj, debug) {
16313    if (ngDevMode) {
16314        Object.defineProperty(obj, 'debug', { value: debug, enumerable: false });
16315    }
16316    else {
16317        throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
16318    }
16319}
16320/**
16321 * Patch a `debug` property getter on top of the existing object.
16322 *
16323 * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
16324 *
16325 * @param obj Object to patch
16326 * @param debugGetter Getter returning a value to patch
16327 */
16328function attachDebugGetter(obj, debugGetter) {
16329    if (ngDevMode) {
16330        Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });
16331    }
16332    else {
16333        throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
16334    }
16335}
16336
16337/**
16338 * @license
16339 * Copyright Google LLC All Rights Reserved.
16340 *
16341 * Use of this source code is governed by an MIT-style license that can be
16342 * found in the LICENSE file at https://angular.io/license
16343 */
16344const NG_DEV_MODE = ((typeof ngDevMode === 'undefined' || !!ngDevMode) && initNgDevMode());
16345/*
16346 * This file contains conditionally attached classes which provide human readable (debug) level
16347 * information for `LView`, `LContainer` and other internal data structures. These data structures
16348 * are stored internally as array which makes it very difficult during debugging to reason about the
16349 * current state of the system.
16350 *
16351 * Patching the array with extra property does change the array's hidden class' but it does not
16352 * change the cost of access, therefore this patching should not have significant if any impact in
16353 * `ngDevMode` mode. (see: https://jsperf.com/array-vs-monkey-patch-array)
16354 *
16355 * So instead of seeing:
16356 * ```
16357 * Array(30) [Object, 659, null, …]
16358 * ```
16359 *
16360 * You get to see:
16361 * ```
16362 * LViewDebug {
16363 *   views: [...],
16364 *   flags: {attached: true, ...}
16365 *   nodes: [
16366 *     {html: '<div id="123">', ..., nodes: [
16367 *       {html: '<span>', ..., nodes: null}
16368 *     ]}
16369 *   ]
16370 * }
16371 * ```
16372 */
16373let LVIEW_COMPONENT_CACHE;
16374let LVIEW_EMBEDDED_CACHE;
16375let LVIEW_ROOT;
16376/**
16377 * This function clones a blueprint and creates LView.
16378 *
16379 * Simple slice will keep the same type, and we need it to be LView
16380 */
16381function cloneToLViewFromTViewBlueprint(tView) {
16382    const debugTView = tView;
16383    const lView = getLViewToClone(debugTView.type, tView.template && tView.template.name);
16384    return lView.concat(tView.blueprint);
16385}
16386function getLViewToClone(type, name) {
16387    switch (type) {
16388        case 0 /* Root */:
16389            if (LVIEW_ROOT === undefined)
16390                LVIEW_ROOT = new (createNamedArrayType('LRootView'))();
16391            return LVIEW_ROOT;
16392        case 1 /* Component */:
16393            if (LVIEW_COMPONENT_CACHE === undefined)
16394                LVIEW_COMPONENT_CACHE = new Map();
16395            let componentArray = LVIEW_COMPONENT_CACHE.get(name);
16396            if (componentArray === undefined) {
16397                componentArray = new (createNamedArrayType('LComponentView' + nameSuffix(name)))();
16398                LVIEW_COMPONENT_CACHE.set(name, componentArray);
16399            }
16400            return componentArray;
16401        case 2 /* Embedded */:
16402            if (LVIEW_EMBEDDED_CACHE === undefined)
16403                LVIEW_EMBEDDED_CACHE = new Map();
16404            let embeddedArray = LVIEW_EMBEDDED_CACHE.get(name);
16405            if (embeddedArray === undefined) {
16406                embeddedArray = new (createNamedArrayType('LEmbeddedView' + nameSuffix(name)))();
16407                LVIEW_EMBEDDED_CACHE.set(name, embeddedArray);
16408            }
16409            return embeddedArray;
16410    }
16411}
16412function nameSuffix(text) {
16413    if (text == null)
16414        return '';
16415    const index = text.lastIndexOf('_Template');
16416    return '_' + (index === -1 ? text : text.substr(0, index));
16417}
16418/**
16419 * This class is a debug version of Object literal so that we can have constructor name show up
16420 * in
16421 * debug tools in ngDevMode.
16422 */
16423const TViewConstructor = class TView {
16424    constructor(type, blueprint, template, queries, viewQuery, declTNode, data, bindingStartIndex, expandoStartIndex, hostBindingOpCodes, firstCreatePass, firstUpdatePass, staticViewQueries, staticContentQueries, preOrderHooks, preOrderCheckHooks, contentHooks, c
16424ontentCheckHooks, viewHooks, viewCheckHooks, destroyHooks, cleanup, contentQueries, components, directiveRegistry, pipeRegistry, firstChild, schemas, consts, incompleteFirstPass, _decls, _vars) {
16425        this.type = type;
16426        this.blueprint = blueprint;
16427        this.template = template;
16428        this.queries = queries;
16429        this.viewQuery = viewQuery;
16430        this.declTNode = declTNode;
16431        this.data = data;
16432        this.bindingStartIndex = bindingStartIndex;
16433        this.expandoStartIndex = expandoStartIndex;
16434        this.hostBindingOpCodes = hostBindingOpCodes;
16435        this.firstCreatePass = firstCreatePass;
16436        this.firstUpdatePass = firstUpdatePass;
16437        this.staticViewQueries = staticViewQueries;
16438        this.staticContentQueries = staticContentQueries;
16439        this.preOrderHooks = preOrderHooks;
16440        this.preOrderCheckHooks = preOrderCheckHooks;
16441        this.contentHooks = contentHooks;
16442        this.contentCheckHooks = contentCheckHooks;
16443        this.viewHooks = viewHooks;
16444        this.viewCheckHooks = viewCheckHooks;
16445        this.destroyHooks = destroyHooks;
16446        this.cleanup = cleanup;
16447        this.contentQueries = contentQueries;
16448        this.components = components;
16449        this.directiveRegistry = directiveRegistry;
16450        this.pipeRegistry = pipeRegistry;
16451        this.firstChild = firstChild;
16452        this.schemas = schemas;
16453        this.consts = consts;
16454        this.incompleteFirstPass = incompleteFirstPass;
16455        this._decls = _decls;
16456        this._vars = _vars;
16457    }
16458    get template_() {
16459        const buf = [];
16460        processTNodeChildren(this.firstChild, buf);
16461        return buf.join('');
16462    }
16463    get type_() {
16464        return TViewTypeAsString[this.type] || `TViewType.?${this.type}?`;
16465    }
16466};
16467class TNode {
16468    constructor(tView_, //
16469    type, //
16470    index, //
16471    insertBeforeIndex, //
16472    injectorIndex, //
16473    directiveStart, //
16474    directiveEnd, //
16475    directiveStylingLast, //
16476    propertyBindings, //
16477    flags, //
16478    providerIndexes, //
16479    value, //
16480    attrs, //
16481    mergedAttrs, //
16482    localNames, //
16483    initialInputs, //
16484    inputs, //
16485    outputs, //
16486    tViews, //
16487    next, //
16488    projectionNext, //
16489    child, //
16490    parent, //
16491    projection, //
16492    styles, //
16493    stylesWithoutHost, //
16494    residualStyles, //
16495    classes, //
16496    classesWithoutHost, //
16497    residualClasses, //
16498    classBindings, //
16499    styleBindings) {
16500        this.tView_ = tView_;
16501        this.type = type;
16502        this.index = index;
16503        this.insertBeforeIndex = insertBeforeIndex;
16504        this.injectorIndex = injectorIndex;
16505        this.directiveStart = directiveStart;
16506        this.directiveEnd = directiveEnd;
16507        this.directiveStylingLast = directiveStylingLast;
16508        this.propertyBindings = propertyBindings;
16509        this.flags = flags;
16510        this.providerIndexes = providerIndexes;
16511        this.value = value;
16512        this.attrs = attrs;
16513        this.mergedAttrs = mergedAttrs;
16514        this.localNames = localNames;
16515        this.initialInputs = initialInputs;
16516        this.inputs = inputs;
16517        this.outputs = outputs;
16518        this.tViews = tViews;
16519        this.next = next;
16520        this.projectionNext = projectionNext;
16521        this.child = child;
16522        this.parent = parent;
16523        this.projection = projection;
16524        this.styles = styles;
16525        this.stylesWithoutHost = stylesWithoutHost;
16526        this.residualStyles = residualStyles;
16527        this.classes = classes;
16528        this.classesWithoutHost = classesWithoutHost;
16529        this.residualClasses = residualClasses;
16530        this.classBindings = classBindings;
16531        this.styleBindings = styleBindings;
16532    }
16533    /**
16534     * Return a human debug version of the set of `NodeInjector`s which will be consulted when
16535     * resolving tokens from this `TNode`.
16536     *
16537     * When debugging applications, it is often difficult to determine which `NodeInjector`s will be
16538     * consulted. This method shows a list of `DebugNode`s representing the `TNode`s which will be
16539     * consulted in order when resolving a token starting at this `TNode`.
16540     *
16541     * The original data is stored in `LView` and `TView` with a lot of offset indexes, and so it is
16542     * difficult to reason about.
16543     *
16544     * @param lView The `LView` instance for this `TNode`.
16545     */
16546    debugNodeInjectorPath(lView) {
16547        const path = [];
16548        let injectorIndex = getInjectorIndex(this, lView);
16549        if (injectorIndex === -1) {
16550            // Looks like the current `TNode` does not have `NodeInjector` associated with it => look for
16551            // parent NodeInjector.
16552            const parentLocation = getParentInjectorLocation(this, lView);
16553            if (parentLocation !== NO_PARENT_INJECTOR) {
16554                // We found a parent, so start searching from the parent location.
16555                injectorIndex = getParentInjectorIndex(parentLocation);
16556                lView = getParentInjectorView(parentLocation, lView);
16557            }
16558            else {
16559                // No parents have been found, so there are no `NodeInjector`s to consult.
16560            }
16561        }
16562        while (injectorIndex !== -1) {
16563            ngDevMode && assertNodeInjector(lView, injectorIndex);
16564            const tNode = lView[TVIEW].data[injectorIndex + 8 /* TNODE */];
16565            path.push(buildDebugNode(tNode, lView));
16566            const parentLocation = lView[injectorIndex + 8 /* PARENT */];
16567            if (parentLocation === NO_PARENT_INJECTOR) {
16568                injectorIndex = -1;
16569            }
16570            else {
16571                injectorIndex = getParentInjectorIndex(parentLocation);
16572                lView = getParentInjectorView(parentLocation, lView);
16573            }
16574        }
16575        return path;
16576    }
16577    get type_() {
16578        return toTNodeTypeAsString(this.type) || `TNodeType.?${this.type}?`;
16579    }
16580    get flags_() {
16581        const flags = [];
16582        if (this.flags & 16 /* hasClassInput */)
16583            flags.push('TNodeFlags.hasClassInput');
16584        if (this.flags & 8 /* hasContentQuery */)
16585            flags.push('TNodeFlags.hasContentQuery');
16586        if (this.flags & 32 /* hasStyleInput */)
16587            flags.push('TNodeFlags.hasStyleInput');
16588        if (this.flags & 128 /* hasHostBindings */)
16589            flags.push('TNodeFlags.hasHostBindings');
16590        if (this.flags & 2 /* isComponentHost */)
16591            flags.push('TNodeFlags.isComponentHost');
16592        if (this.flags & 1 /* isDirectiveHost */)
16593            flags.push('TNodeFlags.isDirectiveHost');
16594        if (this.flags & 64 /* isDetached */)
16595            flags.push('TNodeFlags.isDetached');
16596        if (this.flags & 4 /* isProjected */)
16597            flags.push('TNodeFlags.isProjected');
16598        return flags.join('|');
16599    }
16600    get template_() {
16601        if (this.type & 1 /* Text */)
16602            return this.value;
16603        const buf = [];
16604        const tagName = typeof this.value === 'string' && this.value || this.type_;
16605        buf.push('<', tagName);
16606        if (this.flags) {
16607            buf.push(' ', this.flags_);
16608        }
16609        if (this.attrs) {
16610            for (let i = 0; i < this.attrs.length;) {
16611                const attrName = this.attrs[i++];
16612                if (typeof attrName == 'number') {
16613                    break;
16614                }
16615                const attrValue = this.attrs[i++];
16616                buf.push(' ', attrName, '="', attrValue, '"');
16617            }
16618        }
16619        buf.push('>');
16620        processTNodeChildren(this.child, buf);
16621        buf.push('</', tagName, '>');
16622        return buf.join('');
16623    }
16624    get styleBindings_() {
16625        return toDebugStyleBinding(this, false);
16626    }
16627    get classBindings_() {
16628        return toDebugStyleBinding(this, true);
16629    }
16630    get providerIndexStart_() {
16631        return this.providerIndexes & 1048575 /* ProvidersStartIndexMask */;
16632    }
16633    get providerIndexEnd_() {
16634        return this.providerIndexStart_ +
16635            (this.providerIndexes >>> 20 /* CptViewProvidersCountShift */);
16636    }
16637}
16638const TNodeDebug = TNode;
16639function toDebugStyleBinding(tNode, isClassBased) {
16640    const tData = tNode.tView_.data;
16641    const bindings = [];
16642    const range = isClassBased ? tNode.classBindings : tNode.styleBindings;
16643    const prev = getTStylingRangePrev(range);
16644    const next = getTStylingRangeNext(range);
16645    let isTemplate = next !== 0;
16646    let cursor = isTemplate ? next : prev;
16647    while (cursor !== 0) {
16648        const itemKey = tData[cursor];
16649        const itemRange = tData[cursor + 1];
16650        bindings.unshift({
16651            key: itemKey,
16652            index: cursor,
16653            isTemplate: isTemplate,
16654            prevDuplicate: getTStylingRangePrevDuplicate(itemRange),
16655            nextDuplicate: getTStylingRangeNextDuplicate(itemRange),
16656            nextIndex: getTStylingRangeNext(itemRange),
16657            prevIndex: getTStylingRangePrev(itemRange),
16658        });
16659        if (cursor === prev)
16660            isTemplate = false;
16661        cursor = getTStylingRangePrev(itemRange);
16662    }
16663    bindings.push((isClassBased ? tNode.residualClasses : tNode.residualStyles) || null);
16664    return bindings;
16665}
16666function processTNodeChildren(tNode, buf) {
16667    while (tNode) {
16668        buf.push(tNode.template_);
16669        tNode = tNode.next;
16670    }
16671}
16672const TViewData = NG_DEV_MODE && createNamedArrayType('TViewData') || null;
16673let TVIEWDATA_EMPTY; // can't initialize here or it will not be tree shaken, because
16674// `LView` constructor could have side-effects.
16675/**
16676 * This function clones a blueprint and creates TData.
16677 *
16678 * Simple slice will keep the same type, and we need it to be TData
16679 */
16680function cloneToTViewData(list) {
16681    if (TVIEWDATA_EMPTY === undefined)
16682        TVIEWDATA_EMPTY = new TViewData();
16683    return TVIEWDATA_EMPTY.concat(list);
16684}
16685const LViewBlueprint = NG_DEV_MODE && createNamedArrayType('LViewBlueprint') || null;
16686const MatchesArray = NG_DEV_MODE && createNamedArrayType('MatchesArray') || null;
16687const TViewComponents = NG_DEV_MODE && createNamedArrayType('TViewComponents') || null;
16688const TNodeLocalNames = NG_DEV_MODE && createNamedArrayType('TNodeLocalNames') || null;
16689const TNodeInitialInputs = NG_DEV_MODE && createNamedArrayType('TNodeInitialInputs') || null;
16690const TNodeInitialData = NG_DEV_MODE && createNamedArrayType('TNodeInitialData') || null;
16691const LCleanup = NG_DEV_MODE && createNamedArrayType('LCleanup') || null;
16692const TCleanup = NG_DEV_MODE && createNamedArrayType('TCleanup') || null;
16693function attachLViewDebug(lView) {
16694    attachDebugObject(lView, new LViewDebug(lView));
16695}
16696function attachLContainerDebug(lContainer) {
16697    attachDebugObject(lContainer, new LContainerDebug(lContainer));
16698}
16699function toDebug(obj) {
16700    if (obj) {
16701        const debug = obj.debug;
16702        assertDefined(debug, 'Object does not have a debug representation.');
16703        return debug;
16704    }
16705    else {
16706        return obj;
16707    }
16708}
16709/**
16710 * Use this method to unwrap a native element in `LView` and convert it into HTML for easier
16711 * reading.
16712 *
16713 * @param value possibly wrapped native DOM node.
16714 * @param includeChildren If `true` then the serialized HTML form will include child elements
16715 * (same
16716 * as `outerHTML`). If `false` then the serialized HTML form will only contain the element
16717 * itself
16718 * (will not serialize child elements).
16719 */
16720function toHtml(value, includeChildren = false) {
16721    const node = unwrapRNode(value);
16722    if (node) {
16723        switch (node.nodeType) {
16724            case Node.TEXT_NODE:
16725                return node.textContent;
16726            case Node.COMMENT_NODE:
16727                return `<!--${node.textContent}-->`;
16728            case Node.ELEMENT_NODE:
16729                const outerHTML = node.outerHTML;
16730                if (includeChildren) {
16731                    return outerHTML;
16732                }
16733                else {
16734                    const innerHTML = '>' + node.innerHTML + '<';
16735                    return (outerHTML.split(innerHTML)[0]) + '>';
16736                }
16737        }
16738    }
16739    return null;
16740}
16741class LViewDebug {
16742    constructor(_raw_lView) {
16743        this._raw_lView = _raw_lView;
16744    }
16745    /**
16746     * Flags associated with the `LView` unpacked into a more readable state.
16747     */
16748    get flags() {
16749        const flags = this._raw_lView[FLAGS];
16750        return {
16751            __raw__flags__: flags,
16752            initPhaseState: flags & 3 /* InitPhaseStateMask */,
16753            creationMode: !!(flags & 4 /* CreationMode */),
16754            firstViewPass: !!(flags & 8 /* FirstLViewPass */),
16755            checkAlways: !!(flags & 16 /* CheckAlways */),
16756            dirty: !!(flags & 64 /* Dirty */),
16757            attached: !!(flags & 128 /* Attached */),
16758            destroyed: !!(flags & 256 /* Destroyed */),
16759            isRoot: !!(flags & 512 /* IsRoot */),
16760            indexWithinInitPhase: flags >> 11 /* IndexWithinInitPhaseShift */,
16761        };
16762    }
16763    get parent() {
16764        return toDebug(this._raw_lView[PARENT]);
16765    }
16766    get hostHTML() {
16767        return toHtml(this._raw_lView[HOST], true);
16768    }
16769    get html() {
16770        return (this.nodes || []).map(mapToHTML).join('');
16771    }
16772    get context() {
16773        return this._raw_lView[CONTEXT];
16774    }
16775    /**
16776     * The tree of nodes associated with the current `LView`. The nodes have been normalized into
16777     * a tree structure with relevant details pulled out for readability.
16778     */
16779    get nodes() {
16780        const lView = this._raw_lView;
16781        const tNode = lView[TVIEW].firstChild;
16782        return toDebugNodes(tNode, lView);
16783    }
16784    get template() {
16785        return this.tView.template_;
16786    }
16787    get tView() {
16788        return this._raw_lView[TVIEW];
16789    }
16790    get cleanup() {
16791        return this._raw_lView[CLEANUP];
16792    }
16793    get injector() {
16794        return this._raw_lView[INJECTOR];
16795    }
16796    get rendererFactory() {
16797        return this._raw_lView[RENDERER_FACTORY];
16798    }
16799    get renderer() {
16800        return this._raw_lView[RENDERER];
16801    }
16802    get sanitizer() {
16803        return this._raw_lView[SANITIZER];
16804    }
16805    get childHead() {
16806        return toDebug(this._raw_lView[CHILD_HEAD]);
16807    }
16808    get next() {
16809        return toDebug(this._raw_lView[NEXT]);
16810    }
16811    get childTail() {
16812        return toDebug(this._raw_lView[CHILD_TAIL]);
16813    }
16814    get declarationView() {
16815        return toDebug(this._raw_lView[DECLARATION_VIEW]);
16816    }
16817    get queries() {
16818        return this._raw_lView[QUERIES];
16819    }
16820    get tHost() {
16821        return this._raw_lView[T_HOST];
16822    }
16823    get decls() {
16824        return toLViewRange(this.tView, this._raw_lView, HEADER_OFFSET, this.tView.bindingStartIndex);
16825    }
16826    get vars() {
16827        return toLViewRange(this.tView, this._raw_lView, this.tView.bindingStartIndex, this.tView.expandoStartIndex);
16828    }
16829    get expando() {
16830        return toLViewRange(this.tView, this._raw_lView, this.tView.expandoStartIndex, this._raw_lView.length);
16831    }
16832    /**
16833     * Normalized view of child views (and containers) attached at this location.
16834     */
16835    get childViews() {
16836        const childViews = [];
16837        let child = this.childHead;
16838        while (child) {
16839            childViews.push(child);
16840            child = child.next;
16841        }
16842        return childViews;
16843    }
16844}
16845function mapToHTML(node) {
16846    if (node.type === 'ElementContainer') {
16847        return (node.children || []).map(mapToHTML).join('');
16848    }
16849    else if (node.type === 'IcuContainer') {
16850        throw new Error('Not implemented');
16851    }
16852    else {
16853        return toHtml(node.native, true) || '';
16854    }
16855}
16856function toLViewRange(tView, lView, start, end) {
16857    let content = [];
16858    for (let index = start; index < end; index++) {
16859        content.push({ index: index, t: tView.data[index], l: lView[index] });
16860    }
16861    return { start: start, end: end, length: end - start, content: content };
16862}
16863/**
16864 * Turns a flat list of nodes into a tree by walking the associated `TNode` tree.
16865 *
16866 * @param tNode
16867 * @param lView
16868 */
16869function toDebugNodes(tNode, lView) {
16870    if (tNode) {
16871        const debugNodes = [];
16872        let tNodeCursor = tNode;
16873        while (tNodeCursor) {
16874            debugNodes.push(buildDebugNode(tNodeCursor, lView));
16875            tNodeCursor = tNodeCursor.next;
16876        }
16877        return debugNodes;
16878    }
16879    else {
16880        return [];
16881    }
16882}
16883function buildDebugNode(tNode, lView) {
16884    const rawValue = lView[tNode.index];
16885    const native = unwrapRNode(rawValue);
16886    const factories = [];
16887    const instances = [];
16888    const tView = lView[TVIEW];
16889    for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
16890        const def = tView.data[i];
16891        factories.push(def.type);
16892        instances.push(lView[i]);
16893    }
16894    return {
16895        html: toHtml(native),
16896        type: toTNodeTypeAsString(tNode.type),
16897        tNode,
16898        native: native,
16899        children: toDebugNodes(tNode.child, lView),
16900        factories,
16901        instances,
16902        injector: buildNodeInjectorDebug(tNode, tView, lView),
16903        get injectorResolutionPath() {
16904            return tNode.debugNodeInjectorPath(lView);
16905        },
16906    };
16907}
16908function buildNodeInjectorDebug(tNode, tView, lView) {
16909    const viewProviders = [];
16910    for (let i = tNode.providerIndexStart_; i < tNode.providerIndexEnd_; i++) {
16911        viewProviders.push(tView.data[i]);
16912    }
16913    const providers = [];
16914    for (let i = tNode.providerIndexEnd_; i < tNode.directiveEnd; i++) {
16915        providers.push(tView.data[i]);
16916    }
16917    const nodeInjectorDebug = {
16918        bloom: toBloom(lView, tNode.injectorIndex),
16919        cumulativeBloom: toBloom(tView.data, tNode.injectorIndex),
16920        providers,
16921        viewProviders,
16922        parentInjectorIndex: lView[tNode.providerIndexStart_ - 1],
16923    };
16924    return nodeInjectorDebug;
16925}
16926/**
16927 * Convert a number at `idx` location in `array` into binary representation.
16928 *
16929 * @param array
16930 * @param idx
16931 */
16932function binary(array, idx) {
16933    const value = array[idx];
16934    // If not a number we print 8 `?` to retain alignment but let user know that it was called on
16935    // wrong type.
16936    if (typeof value !== 'number')
16937        return '????????';
16938    // We prefix 0s so that we have constant length number
16939    const text = '00000000' + value.toString(2);
16940    return text.substring(text.length - 8);
16941}
16942/**
16943 * Convert a bloom filter at location `idx` in `array` into binary representation.
16944 *
16945 * @param array
16946 * @param idx
16947 */
16948function toBloom(array, idx) {
16949    if (idx < 0) {
16950        return 'NO_NODE_INJECTOR';
16951    }
16952    return `${binary(array, idx + 7)}_${binary(array, idx + 6)}_${binary(array, idx + 5)}_${binary(array, idx + 4)}_${binary(array, idx + 3)}_${binary(array, idx + 2)}_${binary(array, idx + 1)}_${binary(array, idx + 0)}`;
16953}
16954class LContainerDebug {
16955    constructor(_raw_lContainer) {
16956        this._raw_lContainer = _raw_lContainer;
16957    }
16958    get hasTransplantedViews() {
16959        return this._raw_lContainer[HAS_TRANSPLANTED_VIEWS];
16960    }
16961    get views() {
16962        return this._raw_lContainer.slice(CONTAINER_HEADER_OFFSET)
16963            .map(toDebug);
16964    }
16965    get parent() {
16966        return toDebug(this._raw_lContainer[PARENT]);
16967    }
16968    get movedViews() {
16969        return this._raw_lContainer[MOVED_VIEWS];
16970    }
16971    get host() {
16972        return this._raw_lContainer[HOST];
16973    }
16974    get native() {
16975        return this._raw_lContainer[NATIVE];
16976    }
16977    get next() {
16978        return toDebug(this._raw_lContainer[NEXT]);
16979    }
16980}
16981
16982const ɵ0$5 = () => Promise.resolve(null);
16983/**
16984 * A permanent marker promise which signifies that the current CD tree is
16985 * clean.
16986 */
16987const _CLEAN_PROMISE = (ɵ0$5)();
16988/**
16989 * Invoke `HostBindingsFunction`s for view.
16990 *
16991 * This methods executes `TView.hostBindingOpCodes`. It is used to execute the
16992 * `HostBindingsFunction`s associated with the current `LView`.
16993 *
16994 * @param tView Current `TView`.
16995 * @param lView Current `LView`.
16996 */
16997function processHostBindingOpCodes(tView, lView) {
16998    const hostBindingOpCodes = tView.hostBindingOpCodes;
16999    if (hostBindingOpCodes === null)
17000        return;
17001    try {
17002        for (let i = 0; i < hostBindingOpCodes.length; i++) {
17003            const opCode = hostBindingOpCodes[i];
17004            if (opCode < 0) {
17005                // Negative numbers are element indexes.
17006                setSelectedIndex(~opCode);
17007            }
17008            else {
17009                // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.
17010                const directiveIdx = opCode;
17011                const bindingRootIndx = hostBindingOpCodes[++i];
17012                const hostBindingFn = hostBindingOpCodes[++i];
17013                setBindingRootForHostBindings(bindingRootIndx, directiveIdx);
17014                const context = lView[directiveIdx];
vendor: 15,246 bytes, lines 17015-17330
17015                hostBindingFn(2 /* Update */, context);
17016            }
17017        }
17018    }
17019    finally {
17020        setSelectedIndex(-1);
17021    }
17022}
17023/** Refreshes all content queries declared by directives in a given view */
17024function refreshContentQueries(tView, lView) {
17025    const contentQueries = tView.contentQueries;
17026    if (contentQueries !== null) {
17027        for (let i = 0; i < contentQueries.length; i += 2) {
17028            const queryStartIdx = contentQueries[i];
17029            const directiveDefIdx = contentQueries[i + 1];
17030            if (directiveDefIdx !== -1) {
17031                const directiveDef = tView.data[directiveDefIdx];
17032                ngDevMode && assertDefined(directiveDef, 'DirectiveDef not found.');
17033                ngDevMode &&
17034                    assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined');
17035                setCurrentQueryIndex(queryStartIdx);
17036                directiveDef.contentQueries(2 /* Update */, lView[directiveDefIdx], directiveDefIdx);
17037            }
17038        }
17039    }
17040}
17041/** Refreshes child components in the current view (update mode). */
17042function refreshChildComponents(hostLView, components) {
17043    for (let i = 0; i < components.length; i++) {
17044        refreshComponent(hostLView, components[i]);
17045    }
17046}
17047/** Renders child components in the current view (creation mode). */
17048function renderChildComponents(hostLView, components) {
17049    for (let i = 0; i < components.length; i++) {
17050        renderComponent(hostLView, components[i]);
17051    }
17052}
17053function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector) {
17054    const lView = ngDevMode ? cloneToLViewFromTViewBlueprint(tView) : tView.blueprint.slice();
17055    lView[HOST] = host;
17056    lView[FLAGS] = flags | 4 /* CreationMode */ | 128 /* Attached */ | 8 /* FirstLViewPass */;
17057    resetPreOrderHookFlags(lView);
17058    ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);
17059    lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;
17060    lView[CONTEXT] = context;
17061    lView[RENDERER_FACTORY] = (rendererFactory || parentLView && parentLView[RENDERER_FACTORY]);
17062    ngDevMode && assertDefined(lView[RENDERER_FACTORY], 'RendererFactory is required');
17063    lView[RENDERER] = (renderer || parentLView && parentLView[RENDERER]);
17064    ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');
17065    lView[SANITIZER] = sanitizer || parentLView && parentLView[SANITIZER] || null;
17066    lView[INJECTOR] = injector || parentLView && parentLView[INJECTOR] || null;
17067    lView[T_HOST] = tHostNode;
17068    ngDevMode &&
17069        assertEqual(tView.type == 2 /* Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
17070    lView[DECLARATION_COMPONENT_VIEW] =
17071        tView.type == 2 /* Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;
17072    ngDevMode && attachLViewDebug(lView);
17073    return lView;
17074}
17075function getOrCreateTNode(tView, index, type, name, attrs) {
17076    ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in
17077        // `view_engine_compatibility` for additional context.
17078        assertGreaterThanOrEqual(index, HEADER_OFFSET, 'TNodes can\'t be in the LView header.');
17079    // Keep this function short, so that the VM will inline it.
17080    ngDevMode && assertPureTNodeType(type);
17081    let tNode = tView.data[index];
17082    if (tNode === null) {
17083        tNode = createTNodeAtIndex(tView, index, type, name, attrs);
17084        if (isInI18nBlock()) {
17085            // If we are in i18n block then all elements should be pre declared through `Placeholder`
17086            // See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.
17087            // If the `TNode` was not pre-declared than it means it was not mentioned which means it was
17088            // removed, so we mark it as detached.
17089            tNode.flags |= 64 /* isDetached */;
17090        }
17091    }
17092    else if (tNode.type & 64 /* Placeholder */) {
17093        tNode.type = type;
17094        tNode.value = name;
17095        tNode.attrs = attrs;
17096        const parent = getCurrentParentTNode();
17097        tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;
17098        ngDevMode && assertTNodeForTView(tNode, tView);
17099        ngDevMode && assertEqual(index, tNode.index, 'Expecting same index');
17100    }
17101    setCurrentTNode(tNode, true);
17102    return tNode;
17103}
17104function createTNodeAtIndex(tView, index, type, name, attrs) {
17105    const currentTNode = getCurrentTNodePlaceholderOk();
17106    const isParent = isCurrentTNodeParent();
17107    const parent = isParent ? currentTNode : currentTNode && currentTNode.parent;
17108    // Parents cannot cross component boundaries because components will be used in multiple places.
17109    const tNode = tView.data[index] =
17110        createTNode(tView, parent, type, index, name, attrs);
17111    // Assign a pointer to the first child node of a given view. The first node is not always the one
17112    // at index 0, in case of i18n, index 0 can be the instruction `i18nStart` and the first node has
17113    // the index 1 or more, so we can't just check node index.
17114    if (tView.firstChild === null) {
17115        tView.firstChild = tNode;
17116    }
17117    if (currentTNode !== null) {
17118        if (isParent) {
17119            // FIXME(misko): This logic looks unnecessarily complicated. Could we simplify?
17120            if (currentTNode.child == null && tNode.parent !== null) {
17121                // We are in the same view, which means we are adding content node to the parent view.
17122                currentTNode.child = tNode;
17123            }
17124        }
17125        else {
17126            if (currentTNode.next === null) {
17127                // In the case of i18n the `currentTNode` may already be linked, in which case we don't want
17128                // to break the links which i18n created.
17129                currentTNode.next = tNode;
17130            }
17131        }
17132    }
17133    return tNode;
17134}
17135/**
17136 * When elements are created dynamically after a view blueprint is created (e.g. through
17137 * i18nApply()), we need to adjust the blueprint for future
17138 * template passes.
17139 *
17140 * @param tView `TView` associated with `LView`
17141 * @param lView The `LView` containing the blueprint to adjust
17142 * @param numSlotsToAlloc The number of slots to alloc in the LView, should be >0
17143 * @param initialValue Initial value to store in blueprint
17144 */
17145function allocExpando(tView, lView, numSlotsToAlloc, initialValue) {
17146    if (numSlotsToAlloc === 0)
17147        return -1;
17148    if (ngDevMode) {
17149        assertFirstCreatePass(tView);
17150        assertSame(tView, lView[TVIEW], '`LView` must be associated with `TView`!');
17151        assertEqual(tView.data.length, lView.length, 'Expecting LView to be same size as TView');
17152        assertEqual(tView.data.length, tView.blueprint.length, 'Expecting Blueprint to be same size as TView');
17153        assertFirstUpdatePass(tView);
17154    }
17155    const allocIdx = lView.length;
17156    for (let i = 0; i < numSlotsToAlloc; i++) {
17157        lView.push(initialValue);
17158        tView.blueprint.push(initialValue);
17159        tView.data.push(null);
17160    }
17161    return allocIdx;
17162}
17163//////////////////////////
17164//// Render
17165//////////////////////////
17166/**
17167 * Processes a view in the creation mode. This includes a number of steps in a specific order:
17168 * - creating view query functions (if any);
17169 * - executing a template function in the creation mode;
17170 * - updating static queries (if any);
17171 * - creating child components defined in a given view.
17172 */
17173function renderView(tView, lView, context) {
17174    ngDevMode && assertEqual(isCreationMode(lView), true, 'Should be run in creation mode');
17175    enterView(lView);
17176    try {
17177        const viewQuery = tView.viewQuery;
17178        if (viewQuery !== null) {
17179            executeViewQueryFn(1 /* Create */, viewQuery, context);
17180        }
17181        // Execute a template associated with this view, if it exists. A template function might not be
17182        // defined for the root component views.
17183        const templateFn = tView.template;
17184        if (templateFn !== null) {
17185            executeTemplate(tView, lView, templateFn, 1 /* Create */, context);
17186        }
17187        // This needs to be set before children are processed to support recursive components.
17188        // This must be set to false immediately after the first creation run because in an
17189        // ngFor loop, all the views will be created together before update mode runs and turns
17190        // off firstCreatePass. If we don't set it here, instances will perform directive
17191        // matching, etc again and again.
17192        if (tView.firstCreatePass) {
17193            tView.firstCreatePass = false;
17194        }
17195        // We resolve content queries specifically marked as `static` in creation mode. Dynamic
17196        // content queries are resolved during change detection (i.e. update mode), after embedded
17197        // views are refreshed (see block above).
17198        if (tView.staticContentQueries) {
17199            refreshContentQueries(tView, lView);
17200        }
17201        // We must materialize query results before child components are processed
17202        // in case a child component has projected a container. The LContainer needs
17203        // to exist so the embedded views are properly attached by the container.
17204        if (tView.staticViewQueries) {
17205            executeViewQueryFn(2 /* Update */, tView.viewQuery, context);
17206        }
17207        // Render child component views.
17208        const components = tView.components;
17209        if (components !== null) {
17210            renderChildComponents(lView, components);
17211        }
17212    }
17213    catch (error) {
17214        // If we didn't manage to get past the first template pass due to
17215        // an error, mark the view as corrupted so we can try to recover.
17216        if (tView.firstCreatePass) {
17217            tView.incompleteFirstPass = true;
17218        }
17219        throw error;
17220    }
17221    finally {
17222        lView[FLAGS] &= ~4 /* CreationMode */;
17223        leaveView();
17224    }
17225}
17226/**
17227 * Processes a view in update mode. This includes a number of steps in a specific order:
17228 * - executing a template function in update mode;
17229 * - executing hooks;
17230 * - refreshing queries;
17231 * - setting host bindings;
17232 * - refreshing child (embedded and component) views.
17233 */
17234function refreshView(tView, lView, templateFn, context) {
17235    ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');
17236    const flags = lView[FLAGS];
17237    if ((flags & 256 /* Destroyed */) === 256 /* Destroyed */)
17238        return;
17239    enterView(lView);
17240    // Check no changes mode is a dev only mode used to verify that bindings have not changed
17241    // since they were assigned. We do not want to execute lifecycle hooks in that mode.
17242    const isInCheckNoChangesPass = isInCheckNoChangesMode();
17243    try {
17244        resetPreOrderHookFlags(lView);
17245        setBindingIndex(tView.bindingStartIndex);
17246        if (templateFn !== null) {
17247            executeTemplate(tView, lView, templateFn, 2 /* Update */, context);
17248        }
17249        const hooksInitPhaseCompleted = (flags & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */;
17250        // execute pre-order hooks (OnInit, OnChanges, DoCheck)
17251        // PERF WARNING: do NOT extract this to a separate function without running benchmarks
17252        if (!isInCheckNoChangesPass) {
17253            if (hooksInitPhaseCompleted) {
17254                const preOrderCheckHooks = tView.preOrderCheckHooks;
17255                if (preOrderCheckHooks !== null) {
17256                    executeCheckHooks(lView, preOrderCheckHooks, null);
17257                }
17258            }
17259            else {
17260                const preOrderHooks = tView.preOrderHooks;
17261                if (preOrderHooks !== null) {
17262                    executeInitAndCheckHooks(lView, preOrderHooks, 0 /* OnInitHooksToBeRun */, null);
17263                }
17264                incrementInitPhaseFlags(lView, 0 /* OnInitHooksToBeRun */);
17265            }
17266        }
17267        // First mark transplanted views that are declared in this lView as needing a refresh at their
17268        // insertion points. This is needed to avoid the situation where the template is defined in this
17269        // `LView` but its declaration appears after the insertion component.
17270        markTransplantedViewsForRefresh(lView);
17271        refreshEmbeddedViews(lView);
17272        // Content query results must be refreshed before content hooks are called.
17273        if (tView.contentQueries !== null) {
17274            refreshContentQueries(tView, lView);
17275        }
17276        // execute content hooks (AfterContentInit, AfterContentChecked)
17277        // PERF WARNING: do NOT extract this to a separate function without running benchmarks
17278        if (!isInCheckNoChangesPass) {
17279            if (hooksInitPhaseCompleted) {
17280                const contentCheckHooks = tView.contentCheckHooks;
17281                if (contentCheckHooks !== null) {
17282                    executeCheckHooks(lView, contentCheckHooks);
17283                }
17284            }
17285            else {
17286                const contentHooks = tView.contentHooks;
17287                if (contentHooks !== null) {
17288                    executeInitAndCheckHooks(lView, contentHooks, 1 /* AfterContentInitHooksToBeRun */);
17289                }
17290                incrementInitPhaseFlags(lView, 1 /* AfterContentInitHooksToBeRun */);
17291            }
17292        }
17293        processHostBindingOpCodes(tView, lView);
17294        // Refresh child component views.
17295        const components = tView.components;
17296        if (components !== null) {
17297            refreshChildComponents(lView, components);
17298        }
17299        // View queries must execute after refreshing child components because a template in this view
17300        // could be inserted in a child component. If the view query executes before child component
17301        // refresh, the template might not yet be inserted.
17302        const viewQuery = tView.viewQuery;
17303        if (viewQuery !== null) {
17304            executeViewQueryFn(2 /* Update */, viewQuery, context);
17305        }
17306        // execute view hooks (AfterViewInit, AfterViewChecked)
17307        // PERF WARNING: do NOT extract this to a separate function without running benchmarks
17308        if (!isInCheckNoChangesPass) {
17309            if (hooksInitPhaseCompleted) {
17310                const viewCheckHooks = tView.viewCheckHooks;
17311                if (viewCheckHooks !== null) {
17312                    executeCheckHooks(lView, viewCheckHooks);
17313                }
17314            }
17315            else {
17316                const viewHooks = tView.viewHooks;
17317                if (viewHooks !== null) {
17318                    executeInitAndCheckHooks(lView, viewHooks, 2 /* AfterViewInitHooksToBeRun */);
17319                }
17320                incrementInitPhaseFlags(lView, 2 /* AfterViewInitHooksToBeRun */);
17321            }
17322        }
17323        if (tView.firstUpdatePass === true) {
17324            // We need to make sure that we only flip the flag on successful `refreshView` only
17325            // Don't do this in `finally` block.
17326            // If we did this in `finally` block then an exception could block the execution of styling
17327            // instructions which in turn would be unable to insert themselves into the styling linked
17328            // list. The result of this would be that if the exception would not be throw on subsequent CD
17329            // the styling would be unable to process it data and reflect to the DOM.
17330            tView.firstUpdatePass = false;
17331        }
17332        // Do not reset the dirty state when running in check no changes mode. We don't want components
17333        // to behave differently depending on whether check no changes is enabled or not. For example:
17334        // Marking an OnPush component as dirty from within the `ngAfterViewInit` hook in order to
17335        // refresh a `NgClass` binding should work. If we would reset the dirty state in the check
17336        // no changes cycle, the component would be not be dirty for the next update pass. This would
17337        // be different in production mode where the component dirty state is not reset.
17338        if (!isInCheckNoChangesPass) {
17339            lView[FLAGS] &= ~(64 /* Dirty */ | 8 /* FirstLViewPass */);
17340        }
17341        if (lView[FLAGS] & 1024 /* RefreshTransplantedView */) {
17342            lView[FLAGS] &= ~1024 /* RefreshTransplantedView */;
17343            updateTransplantedViewCount(lView[PARENT], -1);
17344        }
17345    }
17346    finally {
17347        leaveView();
17348    }
17349}
17350function renderComponentOrTemplate(tView, lView, templateFn, context) {
17351    const rendererFactory = lView[RENDERER_FACTORY];
17352    const normalExecutionPath = !isInCheckNoChangesMode();
17353    const creationModeIsActive = isCreationMode(lView);
17354    try {
17355        if (normalExecutionPath && !creationModeIsActive && rendererFactory.begin) {
17356            rendererFactory.begin();
17357        }
17358        if (creationModeIsActive) {
17359            renderView(tView, lView, context);
17360        }
17361        refreshView(tView, lView, templateFn, context);
17362    }
17363    finally {
17364        if (normalExecutionPath && !creationModeIsActive && rendererFactory.end) {
17365            rendererFactory.end();
17366        }
17367    }
17368}
17369function executeTemplate(tView, lView, templateFn, rf, context) {
17370    const prevSelectedIndex = getSelectedIndex();
17371    const isUpdatePhase = rf & 2 /* Update */;
17372    try {
17373        setSelectedIndex(-1);
17374        if (isUpdatePhase && lView.length > HEADER_OFFSET) {
17375            // When we're updating, inherently select 0 so we don't
17376            // have to generate that instruction for most update blocks.
17377            selectIndexInternal(tView, lView, HEADER_OFFSET, isInCheckNoChangesMode());
17378        }
17379        const preHookType = isUpdatePhase ? 2 /* TemplateUpdateStart */ : 0 /* TemplateCreateStart */;
17380        profiler(preHookType, context);
17381        templateFn(rf, context);
17382    }
17383    finally {
17384        setSelectedIndex(prevSelectedIndex);
17385        const postHookType = isUpdatePhase ? 3 /* TemplateUpdateEnd */ : 1 /* TemplateCreateEnd */;
17386        profiler(postHookType, context);
17387    }
17388}
17389//////////////////////////
17390//// Element
17391//////////////////////////
17392function executeContentQueries(tView, tNode, lView) {
17393    if (isContentQueryHost(tNode)) {
17394        const start = tNode.directiveStart;
17395        const end = tNode.directiveEnd;
17396        for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {
17397            const def = tView.data[directiveIndex];
17398            if (def.contentQueries) {
17399                def.contentQueries(1 /* Create */, lView[directiveIndex], directiveIndex);
17400            }
17401        }
17402    }
17403}
17404/**
17405 * Creates directive instances.
17406 */
17407function createDirectivesInstances(tView, lView, tNode) {
17408    if (!getBindingsEnabled())
17409        return;
17410    instantiateAllDirectives(tView, lView, tNode, getNativeByTNode(tNode, lView));
17411    if ((tNode.flags & 128 /* hasHostBindings */) === 128 /* hasHostBindings */) {
17412        invokeDirectivesHostBindings(tView, lView, tNode);
17413    }
17414}
17415/**
17416 * Takes a list of local names and indices and pushes the resolved local variable values
17417 * to LView in the same order as they are loaded in the template with load().
17418 */
17419function saveResolvedLocalsInData(viewData, tNode, localRefExtractor = getNativeByTNode) {
17420    const localNames = tNode.localNames;
17421    if (localNames !== null) {
17422        let localIndex = tNode.index + 1;
17423        for (let i = 0; i < localNames.length; i += 2) {
17424            const index = localNames[i + 1];
17425            const value = index === -1 ?
17426                localRefExtractor(tNode, viewData) :
17427                viewData[index];
17428            viewData[localIndex++] = value;
17429        }
17430    }
17431}
17432/**
17433 * Gets TView from a template function or creates a new TView
17434 * if it doesn't already exist.
17435 *
17436 * @param def ComponentDef
17437 * @returns TView
17438 */
17439function getOrCreateTComponentView(def) {
17440    const tView = def.tView;
17441    // Create a TView if there isn't one, or recreate it if the first create pass didn't
17442    // complete successfully since we can't know for sure whether it's in a usable shape.
17443    if (tView === null || tView.incompleteFirstPass) {
17444        // Declaration node here is null since this function is called when we dynamically create a
17445        // component and hence there is no declaration.
17446        const declTNode = null;
17447        return def.tView = createTView(1 /* Component */, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts);
17448    }
17449    return tView;
17450}
17451/**
17452 * Creates a TView instance
17453 *
17454 * @param type Type of `TView`.
17455 * @param declTNode Declaration location of this `TView`.
17456 * @param templateFn Template function
17457 * @param decls The number of nodes, local refs, and pipes in this template
17458 * @param directives Registry of directives for this view
17459 * @param pipes Registry of pipes for this view
17460 * @param viewQuery View queries for this view
17461 * @param schemas Schemas for this view
17462 * @param consts Constants for this view
17463 */
17464function createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory) {
17465    ngDevMode && ngDevMode.tView++;
17466    const bindingStartIndex = HEADER_OFFSET + decls;
17467    // This length does not yet contain host bindings from child directives because at this point,
17468    // we don't know which directives are active on this template. As soon as a directive is matched
17469    // that has a host binding, we will update the blueprint with that def's hostVars count.
17470    const initialViewLength = bindingStartIndex + vars;
17471    const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);
17472    const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;
17473    const tView = blueprint[TVIEW] = ngDevMode ?
17474        new TViewConstructor(type, // type: TViewType,
17475        blueprint, // blueprint: LView,
17476        templateFn, // template: ComponentTemplate<{}>|null,
17477        null, // queries: TQueries|null
17478        viewQuery, // viewQuery: ViewQueriesFunction<{}>|null,
17479        declTNode, // declTNode: TNode|null,
17480        cloneToTViewData(blueprint).fill(null, bindingStartIndex), // data: TData,
17481        bindingStartIndex, // bindingStartIndex: number,
17482        initialViewLength, // expandoStartIndex: number,
17483        null, // hostBindingOpCodes: HostBindingOpCodes,
17484        true, // firstCreatePass: boolean,
17485        true, // firstUpdatePass: boolean,
17486        false, // staticViewQueries: boolean,
17487        false, // staticContentQueries: boolean,
17488        null, // preOrderHooks: HookData|null,
17489        null, // preOrderCheckHooks: HookData|null,
17490        null, // contentHooks: HookData|null,
17491        null, // contentCheckHooks: HookData|null,
17492        null, // viewHooks: HookData|null,
17493        null, // viewCheckHooks: HookData|null,
17494        null, // destroyHooks: DestroyHookData|null,
17495        null, // cleanup: any[]|null,
17496        null, // contentQueries: number[]|null,
17497        null, // components: number[]|null,
17498        typeof directives === 'function' ? //
17499            directives() : //
17500            directives, // directiveRegistry: DirectiveDefList|null,
17501        typeof pipes === 'function' ? pipes() : pipes, // pipeRegistry: PipeDefList|null,
17502        null, // firstChild: TNode|null,
17503        schemas, // schemas: SchemaMetadata[]|null,
17504        consts, // consts: TConstants|null
17505        false, // incompleteFirstPass: boolean
17506        decls, // ngDevMode only: decls
17507        vars) :
17508        {
17509            type: type,
17510            blueprint: blueprint,
17511            template: templateFn,
17512            queries: null,
17513            viewQuery: viewQuery,
17514            declTNode: declTNode,
17515            data: blueprint.slice().fill(null, bindingStartIndex),
17516            bindingStartIndex: bindingStartIndex,
17517            expandoStartIndex: initialViewLength,
17518            hostBindingOpCodes: null,
17519            firstCreatePass: true,
17520            firstUpdatePass: true,
17521            staticViewQueries: false,
17522            staticContentQueries: false,
17523            preOrderHooks: null,
17524            preOrderCheckHooks: null,
17525            contentHooks: null,
17526            contentCheckHooks: null,
17527            viewHooks: null,
17528            viewCheckHooks: null,
17529            destroyHooks: null,
17530            cleanup: null,
17531            contentQueries: null,
17532            components: null,
17533            directiveRegistry: typeof directives === 'function' ? directives() : directives,
17534            pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,
17535            firstChild: null,
17536            schemas: schemas,
17537            consts: consts,
17538            incompleteFirstPass: false
17539        };
17540    if (ngDevMode) {
17541        // For performance reasons it is important that the tView retains the same shape during runtime.
17542        // (To make sure that all of the code is monomorphic.) For this reason we seal the object to
17543        // prevent class transitions.
17544        Object.seal(tView);
17545    }
17546    return tView;
17547}
17548function createViewBlueprint(bindingStartIndex, initialViewLength) {
17549    const blueprint = ngDevMode ? new LViewBlueprint() : [];
17550    for (let i = 0; i < initialViewLength; i++) {
17551        blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);
17552    }
17553    return blueprint;
17554}
17555function createError(text, token) {
17556    return new Error(`Renderer: ${text} [${stringifyForError(token)}]`);
17557}
17558function assertHostNodeExists(rElement, elementOrSelector) {
17559    if (!rElement) {
17560        if (typeof elementOrSelector === 'string') {
17561            throw createError('Host node with selector not found:', elementOrSelector);
17562        }
17563        else {
17564            throw createError('Host node is required:', elementOrSelector);
17565        }
17566    }
17567}
17568/**
17569 * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
17570 *
17571 * @param rendererFactory Factory function to create renderer instance.
17572 * @param elementOrSelector Render element or CSS selector to locate the element.
17573 * @param encapsulation View Encapsulation defined for component that requests host element.
17574 */
17575function locateHostElement(renderer, elementOrSelector, encapsulation) {
17576    if (isProceduralRenderer(renderer)) {
17577        // When using native Shadow DOM, do not clear host element to allow native slot projection
17578        const preserveContent = encapsulation === ViewEncapsulation.ShadowDom;
17579        return renderer.selectRootElement(elementOrSelector, preserveContent);
17580    }
17581    let rElement = typeof elementOrSelector === 'string' ?
17582        renderer.querySelector(elementOrSelector) :
17583        elementOrSelector;
17584    ngDevMode && assertHostNodeExists(rElement, elementOrSelector);
17585    // Always clear host element's content when Renderer3 is in use. For procedural renderer case we
17586    // make it depend on whether ShadowDom encapsulation is used (in which case the content should be
17587    // preserved to allow native slot projection). ShadowDom encapsulation requires procedural
17588    // renderer, and procedural renderer case is handled above.
17589    rElement.textContent = '';
17590    return rElement;
17591}
17592/**
17593 * Saves context for this cleanup function in LView.cleanupInstances.
17594 *
17595 * On the first template pass, saves in TView:
17596 * - Cleanup function
17597 * - Index of context we just saved in LView.cleanupInstances
17598 *
17599 * This function can also be used to store instance specific cleanup fns. In that case the `context`
17600 * is `null` and the function is store in `LView` (rather than it `TView`).
17601 */
17602function storeCleanupWithContext(tView, lView, context, cleanupFn) {
17603    const lCleanup = getOrCreateLViewCleanup(lView);
17604    if (context === null) {
17605        // If context is null that this is instance specific callback. These callbacks can only be
17606        // inserted after template shared instances. For this reason in ngDevMode we freeze the TView.
17607        if (ngDevMode) {
17608            Object.freeze(getOrCreateTViewCleanup(tView));
17609        }
17610        lCleanup.push(cleanupFn);
17611    }
17612    else {
17613        lCleanup.push(context);
17614        if (tView.firstCreatePass) {
17615            getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);
17616        }
17617    }
17618}
17619function createTNode(tView, tParent, type, index, value, attrs) {
17620    ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in
17621        // `view_engine_compatibility` for additional context.
17622        assertGreaterThanOrEqual(index, HEADER_OFFSET, 'TNodes can\'t be in the LView header.');
17623    ngDevMode && assertNotSame(attrs, undefined, '\'undefined\' is not val
17623id value for \'attrs\'');
17624    ngDevMode && ngDevMode.tNode++;
17625    ngDevMode && tParent && assertTNodeForTView(tParent, tView);
17626    let injectorIndex = tParent ? tParent.injectorIndex : -1;
17627    const tNode = ngDevMode ?
17628        new TNodeDebug(tView, // tView_: TView
17629        type, // type: TNodeType
17630        index, // index: number
17631        null, // insertBeforeIndex: null|-1|number|number[]
17632        injectorIndex, // injectorIndex: number
17633        -1, // directiveStart: number
17634        -1, // directiveEnd: number
17635        -1, // directiveStylingLast: number
17636        null, // propertyBindings: number[]|null
17637        0, // flags: TNodeFlags
17638        0, // providerIndexes: TNodeProviderIndexes
17639        value, // value: string|null
17640        attrs, // attrs: (string|AttributeMarker|(string|SelectorFlags)[])[]|null
17641        null, // mergedAttrs
17642        null, // localNames: (string|number)[]|null
17643        undefined, // initialInputs: (string[]|null)[]|null|undefined
17644        null, // inputs: PropertyAliases|null
17645        null, // outputs: PropertyAliases|null
17646        null, // tViews: ITView|ITView[]|null
17647        null, // next: ITNode|null
17648        null, // projectionNext: ITNode|null
17649        null, // child: ITNode|null
17650        tParent, // parent: TElementNode|TContainerNode|null
17651        null, // projection: number|(ITNode|RNode[])[]|null
17652        null, // styles: string|null
17653        null, // stylesWithoutHost: string|null
17654        undefined, // residualStyles: string|null
17655        null, // classes: string|null
17656        null, // classesWithoutHost: string|null
17657        undefined, // residualClasses: string|null
17658        0, // classBindings: TStylingRange;
17659        0) :
17660        {
17661            type,
17662            index,
17663            insertBeforeIndex: null,
17664            injectorIndex,
17665            directiveStart: -1,
17666            directiveEnd: -1,
17667            directiveStylingLast: -1,
17668            propertyBindings: null,
17669            flags: 0,
17670            providerIndexes: 0,
17671            value: value,
17672            attrs: attrs,
17673            mergedAttrs: null,
17674            localNames: null,
17675            initialInputs: undefined,
17676            inputs: null,
17677            outputs: null,
17678            tViews: null,
17679            next: null,
17680            projectionNext: null,
17681            child: null,
17682            parent: tParent,
17683            projection: null,
17684            styles: null,
17685            stylesWithoutHost: null,
17686            residualStyles: undefined,
17687            classes: null,
17688            classesWithoutHost: null,
17689            residualClasses: undefined,
17690            classBindings: 0,
17691            styleBindings: 0,
17692        };
17693    if (ngDevMode) {
17694        // For performance reasons it is important that the tNode retains the same shape during runtime.
17695        // (To make sure that all of the code is monomorphic.) For this reason we seal the object to
17696        // prevent class transitions.
17697        Object.seal(tNode);
17698    }
17699    return tNode;
17700}
17701function generatePropertyAliases(inputAliasMap, directiveDefIdx, propStore) {
17702    for (let publicName in inputAliasMap) {
17703        if (inputAliasMap.hasOwnProperty(publicName)) {
17704            propStore = propStore === null ? {} : propStore;
17705            const internalName = inputAliasMap[publicName];
17706            if (propStore.hasOwnProperty(publicName)) {
17707                propStore[publicName].push(directiveDefIdx, internalName);
17708            }
17709            else {
17710                (propStore[publicName] = [directiveDefIdx, internalName]);
17711            }
17712        }
17713    }
17714    return propStore;
17715}
17716/**
17717 * Initializes data structures required to work with directive inputs and outputs.
17718 * Initialization is done for all directives matched on a given TNode.
17719 */
17720function initializeInputAndOutputAliases(tView, tNode) {
17721    ngDevMode && assertFirstCreatePass(tView);
17722    const start = tNode.directiveStart;
17723    const end = tNode.directiveEnd;
17724    const tViewData = tView.data;
17725    const tNodeAttrs = tNode.attrs;
17726    const inputsFromAttrs = ngDevMode ? new TNodeInitialInputs() : [];
17727    let inputsStore = null;
17728    let outputsStore = null;
17729    for (let i = start; i < end; i++) {
17730        const directiveDef = tViewData[i];
17731        const directiveInputs = directiveDef.inputs;
17732        // Do not use unbound attributes as inputs to structural directives, since structural
17733        // directive inputs can only be set using microsyntax (e.g. `<div *dir="exp">`).
17734        // TODO(FW-1930): microsyntax expressions may also contain unbound/static attributes, which
17735        // should be set for inline templates.
17736        const initialInputs = (tNodeAttrs !== null && !isInlineTemplate(tNode)) ?
17737            generateInitialInputs(directiveInputs, tNodeAttrs) :
17738            null;
17739        inputsFromAttrs.push(initialInputs);
17740        inputsStore = generatePropertyAliases(directiveInputs, i, inputsStore);
17741        outputsStore = generatePropertyAliases(directiveDef.outputs, i, outputsStore);
17742    }
17743    if (inputsStore !== null) {
17744        if (inputsStore.hasOwnProperty('class')) {
17745            tNode.flags |= 16 /* hasClassInput */;
17746        }
17747        if (inputsStore.hasOwnProperty('style')) {
17748            tNode.flags |= 32 /* hasStyleInput */;
17749        }
17750    }
17751    tNode.initialInputs = inputsFromAttrs;
17752    tNode.inputs = inputsStore;
17753    tNode.outputs = outputsStore;
17754}
17755/**
17756 * Mapping between attributes names that don't correspond to their element property names.
17757 *
17758 * Performance note: this function is written as a series of if checks (instead of, say, a property
17759 * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of
17760 * mapping property names. Do NOT change without benchmarking.
17761 *
17762 * Note: this mapping has to be kept in sync with the equally named mapping in the template
17763 * type-checking machinery of ngtsc.
17764 */
17765function mapPropName(name) {
17766    if (name === 'class')
17767        return 'className';
17768    if (name === 'for')
17769        return 'htmlFor';
17770    if (name === 'formaction')
17771        return 'formAction';
17772    if (name === 'innerHtml')
17773        return 'innerHTML';
17774    if (name === 'readonly')
17775        return 'readOnly';
17776    if (name === 'tabindex')
17777        return 'tabIndex';
17778    return name;
17779}
17780function elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, nativeOnly) {
17781    ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
17782    const element = getNativeByTNode(tNode, lView);
17783    let inputData = tNode.inputs;
17784    let dataValue;
17785    if (!nativeOnly && inputData != null && (dataValue = inputData[propName])) {
17786        setInputsForProperty(tView, lView, dataValue, propName, value);
17787        if (isComponentHost(tNode))
17788            markDirtyIfOnPush(lView, tNode.index);
17789        if (ngDevMode) {
17790            setNgReflectProperties(lView, element, tNode.type, dataValue, value);
17791        }
17792    }
17793    else if (tNode.type & 3 /* AnyRNode */) {
17794        propName = mapPropName(propName);
17795        if (ngDevMode) {
17796            validateAgainstEventProperties(propName);
17797            if (!validateProperty(tView, element, propName, tNode)) {
17798                // Return here since we only log warnings for unknown properties.
17799                logUnknownPropertyError(propName, tNode);
17800                return;
17801            }
17802            ngDevMode.rendererSetProperty++;
17803        }
17804        // It is assumed that the sanitizer is only added when the compiler determines that the
17805        // property is risky, so sanitization can be done without further checks.
17806        value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;
17807        if (isProceduralRenderer(renderer)) {
17808            renderer.setProperty(element, propName, value);
17809        }
17810        else if (!isAnimationProp(propName)) {
17811            element.setProperty ? element.setProperty(propName, value) :
17812                element[propName] = value;
17813        }
17814    }
17815    else if (tNode.type & 12 /* AnyContainer */) {
17816        // If the node is a container and the property didn't
17817        // match any of the inputs or schemas we should throw.
17818        if (ngDevMode && !matchingSchemas(tView, tNode.value)) {
17819            logUnknownPropertyError(propName, tNode);
17820        }
17821    }
17822}
17823/** If node is an OnPush component, marks its LView dirty. */
17824function markDirtyIfOnPush(lView, viewIndex) {
17825    ngDevMode && assertLView(lView);
17826    const childComponentLView = getComponentLViewByIndex(viewIndex, lView);
17827    if (!(childComponentLView[FLAGS] & 16 /* CheckAlways */)) {
17828        childComponentLView[FLAGS] |= 64 /* Dirty */;
17829    }
17830}
17831function setNgReflectProperty(lView, element, type, attrName, value) {
17832    const renderer = lView[RENDERER];
17833    attrName = normalizeDebugBindingName(attrName);
17834    const debugValue = normalizeDebugBindingValue(value);
17835    if (type & 3 /* AnyRNode */) {
17836        if (value == null) {
17837            isProceduralRenderer(renderer) ? renderer.removeAttribute(element, attrName) :
17838                element.removeAttribute(attrName);
17839        }
17840        else {
17841            isProceduralRenderer(renderer) ?
17842                renderer.setAttribute(element, attrName, debugValue) :
17843                element.setAttribute(attrName, debugValue);
17844        }
17845    }
17846    else {
17847        const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
17848        if (isProceduralRenderer(renderer)) {
17849            renderer.setValue(element, textContent);
17850        }
17851        else {
17852            element.textContent = textContent;
17853        }
17854    }
17855}
17856function setNgReflectProperties(lView, element, type, dataValue, value) {
17857    if (type & (3 /* AnyRNode */ | 4 /* Container */)) {
17858        /**
17859         * dataValue is an array containing runtime input or output names for the directives:
17860         * i+0: directive instance index
17861         * i+1: privateName
17862         *
17863         * e.g. [0, 'change', 'change-minified']
17864         * we want to set the reflected property with the privateName: dataValue[i+1]
17865         */
17866        for (let i = 0; i < dataValue.length; i += 2) {
17867            setNgReflectProperty(lView, element, type, dataValue[i + 1], value);
17868        }
17869    }
17870}
17871function validateProperty(tView, element, propName, tNode) {
17872    // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
17873    // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
17874    // defined as an array (as an empty array in case `schemas` field is not defined) and we should
17875    // execute the check below.
17876    if (tView.schemas === null)
17877        return true;
17878    // The property is considered valid if the element matches the schema, it exists on the element
17879    // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
17880    if (matchingSchemas(tView, tNode.value) || propName in element || isAnimationProp(propName)) {
17881        return true;
17882    }
17883    // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
17884    // need to account for both here, while being careful for `typeof null` also returning 'object'.
17885    return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
17886}
17887function matchingSchemas(tView, tagName) {
17888    const schemas = tView.schemas;
17889    if (schemas !== null) {
17890        for (let i = 0; i < schemas.length; i++) {
17891            const schema = schemas[i];
17892            if (schema === NO_ERRORS_SCHEMA ||
17893                schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {
17894                return true;
17895            }
17896        }
17897    }
17898    return false;
17899}
17900/**
17901 * Logs an error that a property is not supported on an element.
17902 * @param propName Name of the invalid property.
17903 * @param tNode Node on which we encountered the property.
17904 */
17905function logUnknownPropertyError(propName, tNode) {
17906    let message = `Can't bind to '${propName}' since it isn't a known property of '${tNode.value}'.`;
17907    console.error(formatRuntimeError("303" /* UNKNOWN_BINDING */, message));
17908}
17909/**
17910 * Instantiate a root component.
17911 */
17912function instantiateRootComponent(tView, lView, def) {
17913    const rootTNode = getCurrentTNode();
17914    if (tView.firstCreatePass) {
17915        if (def.providersResolver)
17916            def.providersResolver(def);
17917        const directiveIndex = allocExpando(tView, lView, 1, null);
17918        ngDevMode &&
17919            assertEqual(directiveIndex, rootTNode.directiveStart, 'Because this is a root component the allocated expando should match the TNode component.');
17920        configureViewWithDirective(tView, rootTNode, lView, directiveIndex, def);
17921    }
17922    const directive = getNodeInjectable(lView, tView, rootTNode.directiveStart, rootTNode);
vendor: 3,278 bytes, lines 17923-17979
17923    attachPatchData(directive, lView);
17924    const native = getNativeByTNode(rootTNode, lView);
17925    if (native) {
17926        attachPatchData(native, lView);
17927    }
17928    return directive;
17929}
17930/**
17931 * Resolve the matched directives on a node.
17932 */
17933function resolveDirectives(tView, lView, tNode, localRefs) {
17934    // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in
17935    // tsickle.
17936    ngDevMode && assertFirstCreatePass(tView);
17937    let hasDirectives = false;
17938    if (getBindingsEnabled()) {
17939        const directiveDefs = findDirectiveDefMatches(tView, lView, tNode);
17940        const exportsMap = localRefs === null ? null : { '': -1 };
17941        if (directiveDefs !== null) {
17942            hasDirectives = true;
17943            initTNodeFlags(tNode, tView.data.length, directiveDefs.length);
17944            // When the same token is provided by several directives on the same node, some rules apply in
17945            // the viewEngine:
17946            // - viewProviders have priority over providers
17947            // - the last directive in NgModule.declarations has priority over the previous one
17948            // So to match these rules, the order in which providers are added in the arrays is very
17949            // important.
17950            for (let i = 0; i < directiveDefs.length; i++) {
17951                const def = directiveDefs[i];
17952                if (def.providersResolver)
17953                    def.providersResolver(def);
17954            }
17955            let preOrderHooksFound = false;
17956            let preOrderCheckHooksFound = false;
17957            let directiveIdx = allocExpando(tView, lView, directiveDefs.length, null);
17958            ngDevMode &&
17959                assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');
17960            for (let i = 0; i < directiveDefs.length; i++) {
17961                const def = directiveDefs[i];
17962                // Merge the attrs in the order of matches. This assumes that the first directive is the
17963                // component itself, so that the component has the least priority.
17964                tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);
17965                configureViewWithDirective(tView, tNode, lView, directiveIdx, def);
17966                saveNameToExportMap(directiveIdx, def, exportsMap);
17967                if (def.contentQueries !== null)
17968                    tNode.flags |= 8 /* hasContentQuery */;
17969                if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)
17970                    tNode.flags |= 128 /* hasHostBindings */;
17971                const lifeCycleHooks = def.type.prototype;
17972                // Only push a node index into the preOrderHooks array if this is the first
17973                // pre-order hook found on this node.
17974                if (!preOrderHooksFound &&
17975                    (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {
17976                    // We will push the actual hook function into this array later during dir instantiation.
17977                    // We cannot do it now because we must ensure hooks are registered in the same
17978                    // order that directives are created (i.e. injection order).
17979                    (tView.preOrderHooks || (tView.preOrderHooks 
17979= [])).push(tNode.index);
17980                    preOrderHooksFound = true;
17981                }
17982                if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
17983                    (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(tNode.index);
17984                    preOrderCheckHooksFound = true;
17985                }
17986                directiveIdx++;
17987            }
17988            initializeInputAndOutputAliases(tView, tNode);
17989        }
17990        if (exportsMap)
17991            cacheMatchingLocalNames(tNode, localRefs, exportsMap);
17992    }
17993    // Merge the template attrs last so that they have the highest priority.
17994    tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
17995    return hasDirectives;
17996}
17997/**
17998 * Add `hostBindings` to the `TView.hostBindingOpCodes`.
17999 *
18000 * @param tView `TView` to which the `hostBindings` should be added.
18001 * @param tNode `TNode` the element which contains the directive
18002 * @param lView `LView` current `LView`
18003 * @param directiveIdx Directive index in view.
18004 * @param directiveVarsIdx Where will the directive's vars be stored
18005 * @param def `ComponentDef`/`DirectiveDef`, which contains the `hostVars`/`hostBindings` to add.
18006 */
18007function registerHostBindingOpCodes(tView, tNode, lView, directiveIdx, directiveVarsIdx, def) {
18008    ngDevMode && assertFirstCreatePass(tView);
18009    const hostBindings = def.hostBindings;
18010    if (hostBindings) {
18011        let hostBindingOpCodes = tView.hostBindingOpCodes;
18012        if (hostBindingOpCodes === null) {
18013            hostBindingOpCodes = tView.hostBindingOpCodes = [];
18014        }
18015        const elementIndx = ~tNode.index;
18016        if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {
18017            // Conditionally add select element so that we are more efficient in execution.
18018            // NOTE: this is strictly not necessary and it trades code size for runtime perf.
18019            // (We could just always add it.)
18020            hostBindingOpCodes.push(elementIndx);
18021        }
18022        hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);
18023    }
18024}
18025/**
18026 * Returns the last selected element index in the `HostBindingOpCodes`
18027 *
18028 * For perf reasons we don't need to update the selected element index in `HostBindingOpCodes` only
18029 * if it changes. This method returns the last index (or '0' if not found.)
18030 *
18031 * Selected element index are only the ones which are negative.
18032 */
18033function lastSelectedElementIdx(hostBindingOpCodes) {
18034    let i = hostBindingOpCodes.length;
18035    while (i > 0) {
18036        const value = hostBindingOpCodes[--i];
18037        if (typeof value === 'number' && value < 0) {
18038            return value;
18039        }
18040    }
18041    return 0;
18042}
18043/**
18044 * Instantiate all the directives that were previously resolved on the current node.
18045 */
18046function instantiateAllDirectives(tView, lView, tNode, native) {
18047    const start = tNode.directiveStart;
18048    const end = tNode.directiveEnd;
18049    if (!tView.firstCreatePass) {
18050        getOrCreateNodeInjectorForNode(tNode, lView);
18051    }
18052    attachPatchData(native, lView);
18053    const initialInputs = tNode.initialInputs;
18054    for (let i = start; i < end; i++) {
18055        const def = tView.data[i];
18056        const isComponent = isComponentDef(def);
18057        if (isComponent) {
18058            ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);
18059            addComponentLogic(lView, tNode, def);
18060        }
18061        const directive = getNodeInjectable(lView, tView, i, tNode);
18062        attachPatchData(directive, lView);
18063        if (initialInputs !== null) {
18064            setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);
18065        }
18066        if (isComponent) {
18067            const componentView = getComponentLViewByIndex(tNode.index, lView);
18068            componentView[CONTEXT] = directive;
18069        }
18070    }
18071}
18072function invokeDirectivesHostBindings(tView, lView, tNode) {
18073    const start = tNode.directiveStart;
18074    const end = tNode.directiveEnd;
18075    const firstCreatePass = tView.firstCreatePass;
18076    const elementIndex = tNode.index;
18077    const currentDirectiveIndex = getCurrentDirectiveIndex();
18078    try {
18079        setSelectedIndex(elementIndex);
18080        for (let dirIndex = start; dirIndex < end; dirIndex++) {
18081            const def = tView.data[dirIndex];
18082            const directive = lView[dirIndex];
18083            setCurrentDirectiveIndex(dirIndex);
18084            if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {
18085                invokeHostBindingsInCreationMode(def, directive);
18086            }
18087        }
18088    }
18089    finally {
18090        setSelectedIndex(-1);
18091        setCurrentDirectiveIndex(currentDirectiveIndex);
18092    }
18093}
18094/**
18095 * Invoke the host bindings in creation mode.
18096 *
18097 * @param def `DirectiveDef` which may contain the `hostBindings` function.
18098 * @param directive Instance of directive.
18099 */
18100function invokeHostBindingsInCreationMode(def, directive) {
18101    if (def.hostBindings !== null) {
18102        def.hostBindings(1 /* Create */, directive);
18103    }
18104}
18105/**
18106 * Matches the current node against all available selectors.
18107 * If a component is matched (at most one), it is returned in first position in the array.
18108 */
18109function findDirectiveDefMatches(tView, viewData, tNode) {
18110    ngDevMode && assertFirstCreatePass(tView);
18111    ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);
18112    const registry = tView.directiveRegistry;
18113    let matches = null;
18114    if (registry) {
18115        for (let i = 0; i < registry.length; i++) {
18116            const def = registry[i];
18117            if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {
18118                matches || (matches = ngDevMode ? new MatchesArray() : []);
18119                diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);
18120                if (isComponentDef(def)) {
18121                    if (ngDevMode) {
18122                        assertTNodeType(tNode, 2 /* Element */, `"${tNode.value}" tags cannot be used as component hosts. ` +
18123                            `Please use a different tag to activate the ${stringify(def.type)} component.`);
18124                        if (tNode.flags & 2 /* isComponentHost */)
18125                            throwMultipleComponentError(tNode);
18126                    }
18127                    markAsComponentHost(tView, tNode);
18128                    // The component is always stored first with directives after.
18129                    matches.unshift(def);
18130                }
18131                else {
18132                    matches.push(def);
18133                }
18134            }
18135        }
18136    }
18137    return matches;
18138}
18139/**
18140 * Marks a given TNode as a component's host. This consists of:
18141 * - setting appropriate TNode flags;
18142 * - storing index of component's host element so it will be queued for view refresh during CD.
18143 */
18144function markAsComponentHost(tView, hostTNode) {
18145    ngDevMode && assertFirstCreatePass(tView);
18146    hostTNode.flags |= 2 /* isComponentHost */;
18147    (tView.components || (tView.components = ngDevMode ? new TViewComponents() : []))
18148        .push(hostTNode.index);
18149}
18150/** Caches local names and their matching directive indices for query and template lookups. */
18151function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
18152    if (localRefs) {
18153        const localNames = tNode.localNames = ngDevMode ? new TNodeLocalNames() : [];
18154        // Local names must be stored in tNode in the same order that localRefs are defined
18155        // in the template to ensure the data is loaded in the same slots as their refs
18156        // in the template (for template queries).
18157        for (let i = 0; i < localRefs.length; i += 2) {
18158            const index = exportsMap[localRefs[i + 1]];
18159            if (index == null)
18160                throw new RuntimeError("301" /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);
18161            localNames.push(localRefs[i], index);
18162        }
18163    }
18164}
18165/**
18166 * Builds up an export map as directives are created, so local refs can be quickly mapped
18167 * to their directive instances.
18168 */
18169function saveNameToExportMap(directiveIdx, def, exportsMap) {
18170    if (exportsMap) {
18171        if (def.exportAs) {
18172            for (let i = 0; i < def.exportAs.length; i++) {
18173                exportsMap[def.exportAs[i]] = directiveIdx;
18174            }
18175        }
18176        if (isComponentDef(def))
18177            exportsMap[''] = directiveIdx;
18178    }
18179}
18180/**
18181 * Initializes the flags on the current node, setting all indices to the initial index,
18182 * the directive count to 0, and adding the isComponent flag.
18183 * @param index the initial index
18184 */
18185function initTNodeFlags(tNode, index, numberOfDirectives) {
18186    ngDevMode &&
18187        assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');
18188    tNode.flags |= 1 /* isDirectiveHost */;
18189    // When the first directive is created on a node, save the index
18190    tNode.directiveStart = index;
18191    tNode.directiveEnd = index + numberOfDirectives;
18192    tNode.providerIndexes = index;
18193}
18194/**
18195 * Setup directive for instantiation.
18196 *
18197 * We need to create a `NodeInjectorFactory` which is then inserted in both the `Blueprint` as well
18198 * as `LView`. `TView` gets the `DirectiveDef`.
18199 *
18200 * @param tView `TView`
18201 * @param tNode `TNode`
18202 * @param lView `LView`
18203 * @param directiveIndex Index where the directive will be stored in the Expando.
18204 * @param def `DirectiveDef`
18205 */
18206function configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {
18207    ngDevMode &&
18208        assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');
18209    tView.data[directiveIndex] = def;
18210    const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));
18211    const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), null);
18212    tView.blueprint[directiveIndex] = nodeInjectorFactory;
18213    lView[directiveIndex] = nodeInjectorFactory;
18214    registerHostBindingOpCodes(tView, tNode, lView, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);
18215}
18216function addComponentLogic(lView, hostTNode, def) {
18217    const native = getNativeByTNode(hostTNode, lView);
18218    const tView = getOrCreateTComponentView(def);
18219    // Only component views should be added to the view tree directly. Embedded views are
18220    // accessed through their containers because they may be removed / re-added later.
18221    const rendererFactory = lView[RENDERER_FACTORY];
18222    const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def), null, null));
18223    // Component view will always be created before any injected LContainers,
18224    // so this is a regular element, wrap it with the component view
18225    lView[hostTNode.index] = componentView;
18226}
18227function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {
18228    if (ngDevMode) {
18229        assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
18230        validateAgainstEventAttributes(name);
18231        assertTNodeType(tNode, 2 /* Element */, `Attempted to set attribute \`${name}\` on a container node. ` +
18232            `Host bindings are not valid on ng-container or ng-template.`);
18233    }
18234    const element = getNativeByTNode(tNode, lView);
18235    setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);
18236}
18237function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
18238    if (value == null) {
18239        ngDevMode && ngDevMode.rendererRemoveAttribute++;
18240        isProceduralRenderer(renderer) ? renderer.removeAttribute(element, name, namespace) :
18241            element.removeAttribute(name);
18242    }
18243    else {
18244        ngDevMode && ngDevMode.rendererSetAttribute++;
18245        const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);
18246        if (isProceduralRenderer(renderer)) {
18247            renderer.setAttribute(element, name, strValue, namespace);
18248        }
18249        else {
18250            namespace ? element.setAttributeNS(namespace, name, strValue) :
18251                element.setAttribute(name, strValue);
18252        }
18253    }
18254}
18255/**
18256 * Sets initial input properties on directive instances from attribute data
18257 *
18258 * @param lView Current LView that is being processed.
18259 * @param directiveIndex Index of the directive in directives array
18260 * @param instance Instance of the directive on which to set the initial inputs
18261 * @param def The directive def that contains the list of inputs
18262 * @param tNode The static data for this node
18263 */
18264function setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {
18265    const initialInputs = initialInputData[directiveIndex];
18266    if (initialInputs !== null) {
18267        const setInput = def.setInput;
18268        for (let i = 0; i < initialInputs.length;) {
18269            const publicName = initialInputs[i++];
18270            const privateName = initialInputs[i++];
18271            const value = initialInputs[i++];
18272            if (setInput !== null) {
18273                def.setInput(instance, value, publicName, privateName);
18274            }
18275            else {
18276                instance[privateName] = value;
18277            }
18278            if (ngDevMode) {
18279                const nativeElement = getNativeByTNode(tNode, lView);
18280                setNgReflectProperty(lView, nativeElement, tNode.type, privateName, value);
18281            }
18282        }
18283    }
18284}
18285/**
18286 * Generates initialInputData for a node and stores it in the template's static storage
18287 * so subsequent template invocations don't have to recalculate it.
18288 *
18289 * initialInputData is an array containing values that need to be set as input properties
18290 * for directives on this node, but only once on creation. We need this array to support
18291 * the case where you set an @Input property of a directive using attribute-like syntax.
18292 * e.g. if you have a `name` @Input, you can set it once like this:
18293 *
18294 * <my-component name="Bess"></my-component>
18295 *
18296 * @param inputs The list of inputs from the directive def
18297 * @param attrs The static attrs on this node
18298 */
18299function generateInitialInputs(inputs, attrs) {
18300    let inputsToStore = null;
18301    let i = 0;
18302    while (i < attrs.length) {
18303        const attrName = attrs[i];
18304        if (attrName === 0 /* NamespaceURI */) {
18305            // We do not allow inputs on namespaced attributes.
18306            i += 4;
18307            continue;
18308        }
18309        else if (attrName === 5 /* ProjectAs */) {
18310            // Skip over the `ngProjectAs` value.
18311            i += 2;
18312            continue;
18313        }
18314        // If we hit any other attribute markers, we're done anyway. None of those are valid inputs.
18315        if (typeof attrName === 'number')
18316            break;
18317        if (inputs.hasOwnProperty(attrName)) {
18318            if (inputsToStore === null)
18319                inputsToStore = [];
18320            inputsToStore.push(attrName, inputs[attrName], attrs[i + 1]);
18321        }
18322        i += 2;
18323    }
18324    return inputsToStore;
18325}
18326//////////////////////////
18327//// ViewContainer & View
18328//////////////////////////
18329// Not sure why I need to do `any` here but TS complains later.
18330const LContainerArray = ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) &&
18331    createNamedArrayType('LContainer');
18332/**
18333 * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.
18334 *
18335 * @param hostNative The host element for the LContainer
18336 * @param hostTNode The host TNode for the LContainer
18337 * @param currentView The parent view of the LContainer
18338 * @param native The native comment element
18339 * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case
18340 * @returns LContainer
18341 */
18342function createLContainer(hostNative, currentView, native, tNode) {
18343    ngDevMode && assertLView(currentView);
18344    ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native);
18345    // https://jsperf.com/array-literal-vs-new-array-really
18346    const lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native
18347    true, // Boolean `true` in this position signifies that this is an `LContainer`
18348    false, // has transplanted views
18349    currentView, // parent
18350    null, // next
18351    0, // transplanted views to refresh count
18352    tNode, // t_host
18353    native, // native,
18354    null, // view refs
18355    null);
18356    ngDevMode &&
18357        assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');
18358    ngDevMode && attachLContainerDebug(lContainer);
18359    return lContainer;
18360}
18361/**
18362 * Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes
18363 * them by executing an associated template function.
18364 */
18365function refreshEmbeddedViews(lView) {
18366    for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
18367        for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
18368            const embeddedLView = lContainer[i];
18369            const embeddedTView = embeddedLView[TVIEW];
18370            ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');
18371            if (viewAttachedToChangeDetector(embeddedLView)) {
18372                refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);
18373            }
18374        }
18375    }
18376}
18377/**
18378 * Mark transplanted views as needing to be refreshed at their insertion points.
18379 *
18380 * @param lView The `LView` that may have transplanted views.
18381 */
18382function markTransplantedViewsForRefresh(lView) {
18383    for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
18384        if (!lContainer[HAS_TRANSPLANTED_VIEWS])
18385            continue;
18386        const movedViews = lContainer[MOVED_VIEWS];
18387        ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');
18388        for (let i = 0; i < movedViews.length; i++) {
18389            const movedLView = movedViews[i];
18390            const insertionLContainer = movedLView[PARENT];
18391            ngDevMode && assertLContainer(insertionLContainer);
18392            // We don't want to increment the counter if the moved LView was already marked for
18393            // refresh.
18394            if ((movedLView[FLAGS] & 1024 /* RefreshTransplantedView */) === 0) {
18395                updateTransplantedViewCount(insertionLContainer, 1);
18396            }
18397            // Note, it is possible that the `movedViews` is tracking views that are transplanted *and*
18398            // those that aren't (declaration component === insertion component). In the latter case,
18399            // it's fine to add the flag, as we will clear it immediately in
18400            // `refreshEmbeddedViews` for the view currently being refreshed.
18401            movedLView[FLAGS] |= 1024 /* RefreshTransplantedView */;
18402        }
18403    }
18404}
18405/////////////
18406/**
18407 * Refreshes components by entering the component view and processing its bindings, queries, etc.
18408 *
18409 * @param componentHostIdx  Element index in LView[] (adjusted for HEADER_OFFSET)
18410 */
18411function refreshComponent(hostLView, componentHostIdx) {
18412    ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode');
18413    const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
18414    // Only attached components that are CheckAlways or OnPush and dirty should be refreshed
18415    if (viewAttachedToChangeDetector(componentView)) {
18416        const tView = componentView[TVIEW];
18417        if (componentView[FLAGS] & (16 /* CheckAlways */ | 64 /* Dirty */)) {
18418            refreshView(tView, componentView, tView.template, componentView[CONTEXT]);
18419        }
18420        else if (componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {
18421            // Only attached components that are CheckAlways or OnPush and dirty should be refreshed
18422            refreshContainsDirtyView(componentView);
18423        }
18424    }
18425}
18426/**
18427 * Refreshes all transplanted views marked with `LViewFlags.RefreshTransplantedView` that are
18428 * children or descendants of the given lView.
18429 *
18430 * @param lView The lView which contains descendant transplanted views that need to be refreshed.
18431 */
18432function refreshContainsDirtyView(lView) {
18433    for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
18434        for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
18435            const embeddedLView = lContainer[i];
18436            if (embeddedLView[FLAGS] & 1024 /* RefreshTransplantedView */) {
18437                const embeddedTView = embeddedLView[TVIEW];
18438                ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');
18439                refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);
18440            }
18441            else if (embeddedLView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {
18442                refreshContainsDirtyView(embeddedLView);
18443            }
18444        }
18445    }
18446    const tView = lView[TVIEW];
18447    // Refresh child component views.
18448    const components = tView.components;
18449    if (components !== null) {
18450        for (let i = 0; i < components.length; i++) {
18451            const componentView = getComponentLViewByIndex(components[i], lView);
18452            // Only attached components that are CheckAlways or OnPush and dirty should be refreshed
18453            if (viewAttachedToChangeDetector(componentView) &&
18454                componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {
18455                refreshContainsDirtyView(componentView);
18456            }
18457        }
18458    }
18459}
18460function renderComponent(hostLView, componentHostIdx) {
18461    ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');
18462    const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
18463    const componentTView = componentView[TVIEW];
18464    syncViewWithBlueprint(componentTView, componentView);
18465    renderView(componentTView, componentView, componentView[CONTEXT]);
18466}
18467/**
18468 * Syncs an LView instance with its blueprint if they have gotten out of sync.
18469 *
18470 * Typically, blueprints and their view instances should always be in sync, so the loop here
18471 * will be skipped. However, consider this case of two components side-by-side:
18472 *
18473 * App template:
18474 * ```
18475 * <comp></comp>
18476 * <comp></comp>
18477 * ```
18478 *
18479 * The following will happen:
18480 * 1. App template begins processing.
18481 * 2. First <comp> is matched as a component and its LView is created.
18482 * 3. Second <comp> is matched as a component and its LView is created.
18483 * 4. App template completes processing, so it's time to check child templates.
18484 * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint.
18485 * 6. Second <comp> template is checked. Its blueprint has been updated by the first
18486 * <comp> template, but its LView was created before this update, so it is out of sync.
18487 *
18488 * Note that embedded views inside ngFor loops will never be out of sync because these views
18489 * are processed as soon as they are created.
18490 *
18491 * @param tView The `TView` that contains the blueprint for syncing
18492 * @param lView The view to sync
18493 */
18494function syncViewWithBlueprint(tView, lView) {
18495    for (let i = lView.length; i < tView.blueprint.length; i++) {
18496        lView.push(tView.blueprint[i]);
18497    }
18498}
18499/**
18500 * Adds LView or LContainer to the end of the current view tree.
18501 *
18502 * This structure will be used to traverse through nested views to remove listeners
18503 * and call onDestroy callbacks.
18504 *
18505 * @param lView The view where LView or LContainer should be added
18506 * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header
18507 * @param lViewOrLContainer The LView or LContainer to add to the view tree
18508 * @returns The state passed in
18509 */
18510function addToViewTree(lView, lViewOrLContainer) {
18511    // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer
18512    // to the end of the queue, which means if the developer retrieves the LContainers from RNodes out
18513    // of order, the change detection will run out of order, as the act of retrieving the the
18514    // LContainer from the RNode is what adds it to the queue.
18515    if (lView[CHILD_HEAD]) {
18516        lView[CHILD_TAIL][NEXT] = lViewOrLContainer;
18517    }
18518    else {
18519        lView[CHILD_HEAD] = lViewOrLContainer;
18520    }
18521    lView[CHILD_TAIL] = lViewOrLContainer;
18522    return lViewOrLContainer;
18523}
18524///////////////////////////////
18525//// Change detection
18526///////////////////////////////
18527/**
18528 * Marks current view and all ancestors dirty.
18529 *
18530 * Returns the root view because it is found as a byproduct of marking the view tree
18531 * dirty, and can be used by methods that consume markViewDirty() to easily schedule
18532 * change detection. Otherwise, such methods would need to traverse up the view tree
18533 * an additional time to get the root view and schedule a tick on it.
18534 *
18535 * @param lView The starting LView to mark dirty
18536 * @returns the root LView
18537 */
18538function markViewDirty(lView) {
18539    while (lView) {
18540        lView[FLAGS] |= 64 /* Dirty */;
18541        const parent = getLViewParent(lView);
18542        // Stop traversing up as soon as you find a root view that wasn't attached to any container
18543        if (isRootView(lView) && !parent) {
18544            return lView;
18545        }
18546        // continue otherwise
18547        lView = parent;
18548    }
18549    return null;
18550}
18551/**
18552 * Used to schedule change detection on the whole application.
18553 *
18554 * Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run.
18555 * It is usually called indirectly by calling `markDirty` when the view needs to be
18556 * re-rendered.
18557 *
18558 * Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple
18559 * `scheduleTick` requests. The scheduling function can be overridden in
18560 * `renderComponent`'s `scheduler` option.
18561 */
18562function scheduleTick(rootContext, flags) {
18563    const nothingScheduled = rootContext.flags === 0 /* Empty */;
18564    if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {
18565        // https://github.com/angular/angular/issues/39296
18566        // should only attach the flags when really scheduling a tick
18567        rootContext.flags |= flags;
18568        let res;
18569        rootContext.clean = new Promise((r) => res = r);
18570        rootContext.scheduler(() => {
18571            if (rootContext.flags & 1 /* DetectChanges */) {
18572                rootContext.flags &= ~1 /* DetectChanges */;
18573                tickRootContext(rootContext);
18574            }
18575            if (rootContext.flags & 2 /* FlushPlayers */) {
18576                rootContext.flags &= ~2 /* FlushPlayers */;
18577                const playerHandler = rootContext.playerHandler;
18578                if (playerHandler) {
18579                    playerHandler.flushPlayers();
18580                }
18581            }
18582            rootContext.clean = _CLEAN_PROMISE;
18583            res(null);
18584        });
18585    }
18586}
18587function tickRootContext(rootContext) {
18588    for (let i = 0; i < rootContext.components.length; i++) {
18589        const rootComponent = rootContext.components[i];
18590        const lView = readPatchedLView(rootComponent);
18591        const tView = lView[TVIEW];
18592        renderComponentOrTemplate(tView, lView, tView.template, rootComponent);
18593    }
18594}
18595function detectChangesInternal(tView, lView, context) {
18596    const rendererFactory = lView[RENDERER_FACTORY];
18597    if (rendererFactory.begin)
18598        rendererFactory.begin();
18599    try {
18600        refreshView(tView, lView, tView.template, context);
18601    }
18602    catch (error) {
18603        handleError(lView, error);
18604        throw error;
18605    }
18606    finally {
18607        if (rendererFactory.end)
18608            rendererFactory.end();
18609    }
18610}
18611/**
18612 * Synchronously perform change detection on a root view and its components.
18613 *
18614 * @param lView The view which the change detection should be performed on.
18615 */
18616function detectChangesInRootView(lView) {
18617    tickRootContext(lView[CONTEXT]);
18618}
18619function checkNoChangesInternal(tView, view, context) {
18620    setIsInCheckNoChangesMode(true);
18621    try {
18622        detectChangesInternal(tView, view, context);
18623    }
18624    finally {
18625        setIsInCheckNoChangesMode(false);
18626    }
18627}
18628/**
18629 * Checks the change detector on a root view and its components, and throws if any changes are
18630 * detected.
18631 *
18632 * This is used in development mode to verify that running change detection doesn't
18633 * introduce other changes.
18634 *
18635 * @param lView The view which the change detection should be checked on.
18636 */
18637function checkNoChangesInRootView(lView) {
18638    setIsInCheckNoChangesMode(true);
18639    try {
18640        detectChangesInRootView(lView);
18641    }
18642    finally {
18643        setIsInCheckNoChangesMode(false);
18644    }
18645}
18646function executeViewQueryFn(flags, viewQueryFn, component) {
18647    ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.');
18648    setCurrentQueryIndex(0);
18649    viewQueryFn(flags, component);
18650}
18651///////////////////////////////
18652//// Bindings & interpolations
18653///////////////////////////////
18654/**
18655 * Stores meta-data for a property binding to be used by TestBed's `DebugElement.properties`.
18656 *
18657 * In order to support TestBed's `DebugElement.properties` we need to save, for each binding:
18658 * - a bound property name;
18659 * - a static parts of interpolated strings;
18660 *
18661 * A given property metadata is saved at the binding's index in the `TView.data` (in other words, a
18662 * property binding metadata will be stored in `TView.data` at the same index as a bound value in
18663 * `LView`). Metadata are represented as `INTERPOLATION_DELIMITER`-delimited string with the
18664 * following format:
18665 * - `propertyName` for bound properties;
18666 * - `propertyName�prefix�interpolation_static_part1�..interpolation_static_partN�suffix` for
18667 * interpolated properties.
18668 *
18669 * @param tData `TData` where meta-data will be saved;
18670 * @param tNode `TNode` that is a target of the binding;
18671 * @param propertyName bound property name;
18672 * @param bindingIndex binding index in `LView`
18673 * @param interpolationParts static interpolation parts (for property interpolations)
18674 */
18675function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) {
18676    // Binding meta-data are stored only the first time a given property instruction is processed.
18677    // Since we don't have a concept of the "first update pass" we need to check for presence of the
18678    // binding meta-data to decide if one should be stored (or if was stored already).
18679    if (tData[bindingIndex] === null) {
18680        if (tNode.inputs == null || !tNode.inputs[propertyName]) {
18681            const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);
18682            propBindingIdxs.push(bindingIndex);
18683            let bindingMetadata = propertyName;
18684            if (interpolationParts.length > 0) {
18685                bindingMetadata +=
18686                    INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);
18687            }
18688            tData[bindingIndex] = bindingMetadata;
18689        }
18690    }
18691}
18692const CLEAN_PROMISE = _CLEAN_PROMISE;
18693function getOrCreateLViewCleanup(view) {
18694    // top level variables should not be exported for performance reasons (PERF_NOTES.md)
18695    return view[CLEANUP] || (view[CLEANUP] = ngDevMode ? new LCleanup() : []);
18696}
18697function getOrCreateTViewCleanup(tView) {
18698    return tView.cleanup || (tView.cleanup = ngDevMode ? new TCleanup() : []);
18699}
18700/**
18701 * There are cases where the sub component's renderer needs to be included
18702 * instead of the current renderer (see the componentSyntheticHost* instructions).
18703 */
18704function loadComponentRenderer(currentDef, tNode, lView) {
18705    // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root
18706    // component (see packages/core/src/render3/component.ts). This is not consistent with the process
18707    // of creating inner components, when current directive index is available in the state. In order
18708    // to avoid relying on current def being `null` (thus special-casing root component creation), the
18709    // process of creating root component should be unified with the process of creating inner
18710    // components.
18711    if (currentDef === null || isComponentDef(currentDef)) {
18712        lView = unwrapLView(lView[tNode.index]);
18713    }
18714    return lView[RENDERER];
18715}
18716/** Handles an error thrown in an LView. */
18717function handleError(lView, error) {
18718    const injector = lView[INJECTOR];
18719    const errorHandler = injector ? injector.get(ErrorHandler, null) : null;
18720    errorHandler && errorHandler.handleError(error);
18721}
18722/**
18723 * Set the inputs of directives at the current node to corresponding value.
18724 *
18725 * @param tView The current TView
18726 * @param lView the `LView` which contains the directives.
18727 * @param inputs mapping between the public "input" name and privately-known,
18728 *        possibly minified, property names to write to.
18729 * @param value Value to set.
18730 */
18731function setInputsForProperty(tView, lView, inputs, publicName, value) {
18732    for (let i = 0; i < inputs.length;) {
vendor: 5,027 bytes, lines 18733-18861
18733        const index = inputs[i++];
18734        const privateName = inputs[i++];
18735        const instance = lView[index];
18736        ngDevMode && assertIndexInRange(lView, index);
18737        const def = tView.data[index];
18738        if (def.setInput !== null) {
18739            def.setInput(instance, value, publicName, privateName);
18740        }
18741        else {
18742            instance[privateName] = value;
18743        }
18744    }
18745}
18746/**
18747 * Updates a text binding at a given index in a given LView.
18748 */
18749function textBindingInternal(lView, index, value) {
18750    ngDevMode && assertString(value, 'Value should be a string');
18751    ngDevMode && assertNotSame(value, NO_CHANGE, 'value should not be NO_CHANGE');
18752    ngDevMode && assertIndexInRange(lView, index);
18753    const element = getNativeByIndex(index, lView);
18754    ngDevMode && assertDefined(element, 'native element should exist');
18755    updateTextNode(lView[RENDERER], element, value);
18756}
18757
18758/**
18759 * @license
18760 * Copyright Google LLC All Rights Reserved.
18761 *
18762 * Use of this source code is governed by an MIT-style license that can be
18763 * found in the LICENSE file at https://angular.io/license
18764 */
18765/**
18766 * Compute the static styling (class/style) from `TAttributes`.
18767 *
18768 * This function should be called during `firstCreatePass` only.
18769 *
18770 * @param tNode The `TNode` into which the styling information should be loaded.
18771 * @param attrs `TAttributes` containing the styling information.
18772 * @param writeToHost Where should the resulting static styles be written?
18773 *   - `false` Write to `TNode.stylesWithoutHost` / `TNode.classesWithoutHost`
18774 *   - `true` Write to `TNode.styles` / `TNode.classes`
18775 */
18776function computeStaticStyling(tNode, attrs, writeToHost) {
18777    ngDevMode &&
18778        assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');
18779    let styles = writeToHost ? tNode.styles : null;
18780    let classes = writeToHost ? tNode.classes : null;
18781    let mode = 0;
18782    if (attrs !== null) {
18783        for (let i = 0; i < attrs.length; i++) {
18784            const value = attrs[i];
18785            if (typeof value === 'number') {
18786                mode = value;
18787            }
18788            else if (mode == 1 /* Classes */) {
18789                classes = concatStringsWithSpace(classes, value);
18790            }
18791            else if (mode == 2 /* Styles */) {
18792                const style = value;
18793                const styleValue = attrs[++i];
18794                styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');
18795            }
18796        }
18797    }
18798    writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;
18799    writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;
18800}
18801
18802/**
18803 * @license
18804 * Copyright Google LLC All Rights Reserved.
18805 *
18806 * Use of this source code is governed by an MIT-style license that can be
18807 * found in the LICENSE file at https://angular.io/license
18808 */
18809/**
18810 * Synchronously perform change detection on a component (and possibly its sub-components).
18811 *
18812 * This function triggers change detection in a synchronous way on a component.
18813 *
18814 * @param component The component which the change detection should be performed on.
18815 */
18816function detectChanges(component) {
18817    const view = getComponentViewByInstance(component);
18818    detectChangesInternal(view[TVIEW], view, component);
18819}
18820/**
18821 * Marks the component as dirty (needing change detection). Marking a component dirty will
18822 * schedule a change detection on it at some point in the future.
18823 *
18824 * Marking an already dirty component as dirty won't do anything. Only one outstanding change
18825 * detection can be scheduled per component tree.
18826 *
18827 * @param component Component to mark as dirty.
18828 */
18829function markDirty(component) {
18830    ngDevMode && assertDefined(component, 'component');
18831    const rootView = markViewDirty(getComponentViewByInstance(component));
18832    ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
18833    scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);
18834}
18835/**
18836 * Used to perform change detection on the whole application.
18837 *
18838 * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
18839 * executes lifecycle hooks and conditionally checks components based on their
18840 * `ChangeDetectionStrategy` and dirtiness.
18841 *
18842 * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
18843 * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
18844 * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
18845 * be changed when calling `renderComponent` and providing the `scheduler` option.
18846 */
18847function tick(component) {
18848    const rootView = getRootView(component);
18849    const rootContext = rootView[CONTEXT];
18850    tickRootContext(rootContext);
18851}
18852
18853/**
18854 * @license
18855 * Copyright Google LLC All Rights Reserved.
18856 *
18857 * Use of this source code is governed by an MIT-style license that can be
18858 * found in the LICENSE file at https://angular.io/license
18859 */
18860/**
18861 * An InjectionToken that gets the current `Injector` for `createInjector()`
18861-style injectors.
18862 *
18863 * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a
18864 * project.
18865 *
18866 * @publicApi
18867 */
18868const INJECTOR$1 = new InjectionToken('INJECTOR', 
18869// Dissable tslint because this is const enum which gets inlined not top level prop access.
18870// tslint:disable-next-line: no-toplevel-property-access
18871-1 /* Injector */);
18872
18873/**
18874 * @license
18875 * Copyright Google LLC All Rights Reserved.
18876 *
18877 * Use of this source code is governed by an MIT-style license that can be
18878 * found in the LICENSE file at https://angular.io/license
18879 */
18880class NullInjector {
18881    get(token, notFoundValue = THROW_IF_NOT_FOUND) {
18882        if (notFoundValue === THROW_IF_NOT_FOUND) {
18883            const error = new Error(`NullInjectorError: No provider for ${stringify(token)}!`);
18884            error.name = 'NullInjectorError';
18885            throw error;
18886        }
18887        return notFoundValue;
18888    }
18889}
18890
18891/**
18892 * @license
18893 * Copyright Google LLC All Rights Reserved.
18894 *
18895 * Use of this source code is governed by an MIT-style license that can be
18896 * found in the LICENSE file at https://angular.io/license
18897 */
18898/**
18899 * An internal token whose presence in an injector indicates that the injector should treat itself
18900 * as a root scoped injector when processing requests for unknown tokens which may indicate
18901 * they are provided in the root scope.
18902 */
18903const INJECTOR_SCOPE = new InjectionToken('Set Injector scope.');
18904
18905/**
18906 * @license
18907 * Copyright Google LLC All Rights Reserved.
18908 *
18909 * Use of this source code is governed by an MIT-style license that can be
18910 * found in the LICENSE file at https://angular.io/license
18911 */
18912/**
18913 * Marker which indicates that a value has not yet been created from the factory function.
18914 */
18915const NOT_YET = {};
18916/**
18917 * Marker which indicates that the factory function for a token is in the process of being called.
18918 *
18919 * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates
18920 * injection of a dependency has recursively attempted to inject the original token, and there is
18921 * a circular dependency among the providers.
18922 */
18923const CIRCULAR = {};
18924const EMPTY_ARRAY$2 = [];
18925/**
18926 * A lazily initialized NullInjector.
18927 */
18928let NULL_INJECTOR = undefined;
18929function getNullInjector() {
18930    if (NULL_INJECTOR === undefined) {
18931        NULL_INJECTOR = new NullInjector();
18932    }
18933    return NULL_INJECTOR;
18934}
18935/**
18936 * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.
18937 *
18938 * @publicApi
18939 */
18940function createInjector(defType, parent = null, additionalProviders = null, name) {
18941    const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);
18942    injector._resolveInjectorDefTypes();
18943    return injector;
18944}
18945/**
18946 * Creates a new injector without eagerly resolving its injector types. Can be used in places
18947 * where resolving the injector types immediately can lead to an infinite loop. The injector types
18948 * should be resolved at a later point by calling `_resolveInjectorDefTypes`.
18949 */
18950function createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name) {
18951    return new R3Injector(defType, additionalProviders, parent || getNullInjector(), name);
18952}
18953class R3Injector {
18954    constructor(def, additionalProviders, parent, source = null) {
18955        this.parent = parent;
18956        /**
18957         * Map of tokens to records which contain the instances of those tokens.
18958         * - `null` value implies that we don't have the record. Used by tree-shakable injectors
18959         * to prevent further searches.
18960         */
18961        this.records = new Map();
18962        /**
18963         * The transitive set of `InjectorType`s which define this injector.
18964         */
18965        this.injectorDefTypes = new Set();
18966        /**
18967         * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.
18968         */
18969        this.onDestroy = new Set();
18970        this._destroyed = false;
18971        const dedupStack = [];
18972        // Start off by creating Records for every provider declared in every InjectorType
18973        // included transitively in additional providers then do the same for `def`. This order is
18974        // important because `def` may include providers that override ones in additionalProviders.
18975        additionalProviders &&
18976            deepForEach(additionalProviders, provider => this.processProvider(provider, def, additionalProviders));
18977        deepForEach([def], injectorDef => this.processInjectorType(injectorDef, [], dedupStack));
18978        // Make sure the INJECTOR token provides this injector.
18979        this.records.set(INJECTOR$1, makeRecord(undefined, this));
18980        // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide
18981        // any injectable scoped to APP_ROOT_SCOPE.
18982        const record = this.records.get(INJECTOR_SCOPE);
18983        this.scope = record != null ? record.value : null;
18984        // Source name, used for debugging
18985        this.source = source || (typeof def === 'object' ? null : stringify(def));
18986    }
18987    /**
18988     * Flag indicating that this injector was previously destroyed.
18989     */
18990    get destroyed() {
18991        return this._destroyed;
18992    }
18993    /**
18994     * Destroy the injector and release references to every instance or provider associated with it.
18995     *
18996     * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a
18997     * hook was found.
18998     */
18999    destroy() {
19000        this.assertNotDestroyed();
19001        // Set destroyed = true first, in case lifecycle hooks re-enter destroy().
19002        this._destroyed = true;
19003        try {
19004            // Call all the lifecycle hooks.
19005            this.onDestroy.forEach(service => service.ngOnDestroy());
19006        }
19007        finally {
19008            // Release all references.
19009            this.records.clear();
19010            this.onDestroy.clear();
19011            this.injectorDefTypes.clear();
19012        }
19013    }
19014    get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
19015        this.assertNotDestroyed();
19016        // Set the injection context.
19017        const previousInjector = setCurrentInjector(this);
19018        try {
19019            // Check for the SkipSelf flag.
19020            if (!(flags & InjectFlags.SkipSelf)) {
19021                // SkipSelf isn't set, check if the record belongs to this injector.
19022                let record = this.records.get(token);
19023                if (record === undefined) {
19024                    // No record, but maybe the token is scoped to this injector. Look for an injectable
19025                    // def with a scope matching this injector.
19026                    const def = couldBeInjectableType(token) && getInjectableDef(token);
19027                    if (def && this.injectableDefInScope(def)) {
19028                        // Found an injectable def and it's scoped to this injector. Pretend as if it was here
19029                        // all along.
19030                        record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);
19031                    }
19032                    else {
19033                        record = null;
19034                    }
19035                    this.records.set(token, record);
19036                }
19037                // If a record was found, get the instance for it and return it.
19038                if (record != null /* NOT null || undefined */) {
19039                    return this.hydrate(token, record);
19040                }
19041            }
19042            // Select the next injector based on the Self flag - if self is set, the next injector is
19043            // the NullInjector, otherwise it's the parent.
19044            const nextInjector = !(flags & InjectFlags.Self) ? this.parent : getNullInjector();
19045            // Set the notFoundValue based on the Optional flag - if optional is set and notFoundValue
19046            // is undefined, the value is null, otherwise it's the notFoundValue.
19047            notFoundValue = (flags & InjectFlags.Optional) && notFoundValue === THROW_IF_NOT_FOUND ?
19048                null :
19049                notFoundValue;
19050            return nextInjector.get(token, notFoundValue);
19051        }
19052        catch (e) {
19053            if (e.name === 'NullInjectorError') {
19054                const path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];
19055                path.unshift(stringify(token));
19056                if (previousInjector) {
19057                    // We still have a parent injector, keep throwing
19058                    throw e;
19059                }
19060                else {
19061                    // Format & throw the final error message when we don't have any previous injector
19062                    return catchInjectorError(e, token, 'R3InjectorError', this.source);
19063                }
19064            }
19065            else {
19066                throw e;
19067            }
19068        }
19069        finally {
19070            // Lastly, clean up the state by restoring the previous injector.
19071            setCurrentInjector(previousInjector);
19072        }
19073    }
19074    /** @internal */
19075    _resolveInjectorDefTypes() {
19076        this.injectorDefTypes.forEach(defType => this.get(defType));
19077    }
19078    toString() {
19079        const tokens = [], records = this.records;
19080        records.forEach((v, token) => tokens.push(stringify(token)));
19081        return `R3Injector[${tokens.join(', ')}]`;
19082    }
19083    assertNotDestroyed() {
19084        if (this._destroyed) {
19085            throw new Error('Injector has already been destroyed.');
19086        }
19087    }
19088    /**
19089     * Add an `InjectorType` or `InjectorTypeWithProviders` and all of its transitive providers
19090     * to this injector.
19091     *
19092     * If an `InjectorTypeWithProviders` that declares providers besides the type is specified,
19093     * the function will return "true" to indicate that the providers of the type definition need
19094     * to be processed. This allows us to process providers of injector types after all imports of
19095     * an injector definition are processed. (following View Engine semantics: see FW-1349)
19096     */
19097    processInjectorType(defOrWrappedDef, parents, dedupStack) {
19098        defOrWrappedDef = resolveForwardRef(defOrWrappedDef);
19099        if (!defOrWrappedDef)
19100            return false;
19101        // Either the defOrWrappedDef is an InjectorType (with injector def) or an
19102        // InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic
19103        // read, so care is taken to only do the read once.
19104        // First attempt to read the injector def (`ɵinj`).
19105        let def = getInjectorDef(defOrWrappedDef);
19106        // If that's not present, then attempt to read ngModule from the InjectorDefTypeWithProviders.
19107        const ngModule = (def == null) && defOrWrappedDef.ngModule || undefined;
19108        // Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`,
19109        // then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type
19110        // is the `ngModule`.
19111        const defType = (ngModule === undefined) ? defOrWrappedDef : ngModule;
19112        // Check for circular dependencies.
19113        if (ngDevMode && parents.indexOf(defType) !== -1) {
19114            const defName = stringify(defType);
19115            const path = parents.map(stringify);
19116            throwCyclicDependencyError(defName, path);
19117        }
19118        // Check for multiple imports of the same module
19119        const isDuplicate = dedupStack.indexOf(defType) !== -1;
19120        // Finally, if defOrWrappedType was an `InjectorDefTypeWithProviders`, then the actual
19121        // `InjectorDef` is on its `ngModule`.
19122        if (ngModule !== undefined) {
19123            def = getInjectorDef(ngModule);
19124        }
19125        // If no definition was found, it might be from exports. Remove it.
19126        if (def == null) {
19127            return false;
19128        }
19129        // Add providers in the same way that @NgModule resolution did:
19130        // First, include providers from any imports.
19131        if (def.imports != null && !isDuplicate) {
19132            // Before processing defType's imports, add it to the set of parents. This way, if it ends
19133            // up deeply importing itself, this can be detected.
19134            ngDevMode && parents.push(defType);
19135            // Add it to the set of dedups. This way we can detect multiple imports of the same module
19136            dedupStack.push(defType);
19137            let importTypesWithProviders;
19138            try {
19139                deepForEach(def.imports, imported => {
19140                    if (this.processInjectorType(imported, parents, dedupStack)) {
19141                        if (importTypesWithProviders === undefined)
19142                            importTypesWithProviders = [];
19143                        // If the processed import is an injector type with providers, we store it in the
19144                        // list of import types with providers, so that we can process those afterwards.
19145                        importTypesWithProviders.push(imported);
19146                    }
19147                });
19148            }
19149            finally {
19150                // Remove it from the parents set when finished.
19151                ngDevMode && parents.pop();
19152            }
19153            // Imports which are declared with providers (TypeWithProviders) need to be processed
19154            // after all imported modules are processed. This is similar to how View Engine
19155            // processes/merges module imports in the metadata resolver. See: FW-1349.
19156            if (importTypesWithProviders !== undefined) {
19157                for (let i = 0; i < importTypesWithProviders.length; i++) {
19158                    const { ngModule, providers } = importTypesWithProviders[i];
19159                    deepForEach(providers, provider => this.processProvider(provider, ngModule, providers || EMPTY_ARRAY$2));
19160                }
19161            }
19162        }
19163        // Track the InjectorType and add a provider for it. It's important that this is done after the
19164        // def's imports.
19165        this.injectorDefTypes.add(defType);
19166        const factory = getFactoryDef(defType) || (() => new defType());
19167        this.records.set(defType, makeRecord(factory, NOT_YET));
19168        // Next, include providers listed on the definition itself.
19169        const defProviders = def.providers;
19170        if (defProviders != null && !isDuplicate) {
19171            const injectorType = defOrWrappedDef;
19172            deepForEach(defProviders, provider => this.processProvider(provider, injectorType, defProviders));
19173        }
19174        return (ngModule !== undefined &&
19175            defOrWrappedDef.providers !== undefined);
19176    }
19177    /**
19178     * Process a `SingleProvider` and add it.
19179     */
19180    processProvider(provider, ngModuleType, providers) {
19181        // Determine the token from the provider. Either it's its own token, or has a {provide: ...}
19182        // property.
19183        provider = resolveForwardRef(provider);
19184        let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);
19185        // Construct a `Record` for the provider.
19186        const record = providerToRecord(provider, ngModuleType, providers);
19187        if (!isTypeProvider(provider) && provider.multi === true) {
19188            // If the provider indicates that it's a multi-provider, process it specially.
19189            // First check whether it's been defined already.
19190            let multiRecord = this.records.get(token);
19191            if (multiRecord) {
19192                // It has. Throw a nice error if
19193                if (ngDevMode && multiRecord.multi === undefined) {
19194                    throwMixedMultiProviderError();
19195                }
19196            }
19197            else {
19198                multiRecord = makeRecord(undefined, NOT_YET, true);
19199                multiRecord.factory = () => injectArgs(multiRecord.multi);
19200                this.records.set(token, multiRecord);
19201            }
19202            token = provider;
19203            multiRecord.multi.push(provider);
19204        }
19205        else {
19206            const existing = this.records.get(token);
19207            if (ngDevMode && existing && existing.multi !== undefined) {
19208                throwMixedMultiProviderError();
19209            }
19210        }
19211        this.records.set(token, record);
19212    }
19213    hydrate(token, record) {
19214        if (ngDevMode && record.value === CIRCULAR) {
19215            throwCyclicDependencyError(stringify(token));
19216        }
19217        else if (record.value === NOT_YET) {
19218            record.value = CIRCULAR;
19219            record.value = record.factory();
19220        }
19221        if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {
19222            this.onDestroy.add(record.value);
19223        }
19224        return record.value;
19225    }
19226    injectableDefInScope(def) {
19227        if (!def.providedIn) {
19228            return false;
19229        }
19230        else if (typeof def.providedIn === 'string') {
19231            return def.providedIn === 'any' || (def.providedIn === this.scope);
19232        }
19233        else {
19234            return this.injectorDefTypes.has(def.providedIn);
19235        }
19236    }
19237}
19238function injectableDefOrInjectorDefFactory(token) {
19239    // Most tokens will have an injectable def directly on them, which specifies a factory directly.
19240    const injectableDef = getInjectableDef(token);
19241    const factory = injectableDef !== null ? injectableDef.factory : getFactoryDef(token);
19242    if (factory !== null) {
19243        return factory;
19244    }
19245    // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.
19246    // If it's missing that, it's an error.
19247    if (token instanceof InjectionToken) {
19248        throw new Error(`Token ${stringify(token)} is missing a ɵprov definition.`);
19249    }
19250    // Undecorated types can sometimes be created if they have no constructor arguments.
19251    if (token instanceof Function) {
19252        return getUndecoratedInjectableFactory(token);
19253    }
19254    // There was no way to resolve a factory for this token.
19255    throw new Error('unreachable');
19256}
19257function getUndecoratedInjectableFactory(token) {
19258    // If the token has parameters then it has dependencies that we cannot resolve implicitly.
19259    const paramLength = token.length;
19260    if (paramLength > 0) {
19261        const args = newArray(paramLength, '?');
19262        throw new Error(`Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);
19263    }
19264    // The constructor function appears to have no parameters.
19265    // This might be because it inherits from a super-class. In which case, use an injectable
19266    // def from an ancestor if there is one.
19267    // Otherwise this really is a simple class with no dependencies, so return a factory that
19268    // just instantiates the zero-arg constructor.
19269    const inheritedInjectableDef = getInheritedInjectableDef(token);
19270    if (inheritedInjectableDef !== null) {
19271        return () => inheritedInjectableDef.factory(token);
19272    }
19273    else {
19274        return () => new token();
19275    }
19276}
19277function providerToRecord(provider, ngModuleType, providers) {
19278    if (isValueProvider(provider)) {
19279        return makeRecord(undefined, provider.useValue);
19280    }
19281    else {
19282        const factory = providerToFactory(provider, ngModuleType, providers);
19283        return makeRecord(factory, NOT_YET);
19284    }
19285}
19286/**
19287 * Converts a `SingleProvider` into a factory function.
19288 *
19289 * @param provider provider to convert to factory
19290 */
19291function providerToFactory(provider, ngModuleType, providers) {
19292    let factory = undefined;
19293    if (isTypeProvider(provider)) {
19294        const unwrappedProvider = resolveForwardRef(provider);
19295        return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);
19296    }
19297    else {
19298        if (isValueProvider(provider)) {
19299            factory = () => resolveForwardRef(provider.useValue);
19300        }
19301        else if (isFactoryProvider(provider)) {
19302            factory = () => provider.useFactory(...injectArgs(provider.deps || []));
19303        }
19304        else if (isExistingProvider(provider)) {
19305            factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));
19306        }
19307        else {
19308            const classRef = resolveForwardRef(provider &&
19309                (provider.useClass || provider.provide));
19310            if (ngDevMode && !classRef) {
19311                throwInvalidProviderError(ngModuleType, providers, provider);
19312            }
19313            if (hasDeps(provider)) {
19314                factory = () => new (classRef)(...injectArgs(provider.deps));
19315            }
19316            else {
19317                return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);
19318            }
19319        }
19320    }
19321    return factory;
19322}
19323function makeRecord(factory, value, multi = false) {
19324    return {
19325        factory: factory,
19326        value: value,
19327        multi: multi ? [] : undefined,
19328    };
19329}
19330function isValueProvider(value) {
19331    return value !== null && typeof value == 'object' && USE_VALUE in value;
19332}
19333function isExistingProvider(value) {
19334    return !!(value && value.useExisting);
19335}
19336function isFactoryProvider(value) {
19337    return !!(value && value.useFactory);
19338}
19339function isTypeProvider(value) {
19340    return typeof value === 'function';
19341}
19342function isClassProvider(value) {
19343    return !!value.useClass;
19344}
19345function hasDeps(value) {
19346    return !!value.deps;
19347}
19348function hasOnDestroy(value) {
19349    return value !== null && typeof value === 'object' &&
19350        typeof value.ngOnDestroy === 'function';
19351}
19352function couldBeInjectableType(value) {
19353    return (typeof value === 'function') ||
19354        (typeof value === 'object' && value instanceof InjectionToken);
19355}
19356
19357/**
19358 * @license
19359 * Copyright Google LLC All Rights Reserved.
19360 *
19361 * Use of this source code is governed by an MIT-style license that can be
19362 * found in the LICENSE file at https://angular.io/license
19363 */
19364function INJECTOR_IMPL__PRE_R3__(providers, parent, name) {
19365    return new StaticInjector(providers, parent, name);
19366}
19367function INJECTOR_IMPL__POST_R3__(providers, parent, name) {
19368    return createInjector({ name: name }, parent, providers, name);
19369}
19370const INJECTOR_IMPL = INJECTOR_IMPL__POST_R3__;
19371/**
19372 * Concrete injectors implement this interface. Injectors are configured
19373 * with [providers](guide/glossary#provider) that associate
19374 * dependencies of various types with [injection tokens](guide/glossary#di-token).
19375 *
19376 * @see ["DI Providers"](guide/dependency-injection-providers).
19377 * @see `StaticProvider`
19378 *
19379 * @usageNotes
19380 *
19381 *  The following example creates a service injector instance.
19382 *
19383 * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}
19384 *
19385 * ### Usage example
19386 *
19387 * {@example core/di/ts/injector_spec.ts region='Injector'}
19388 *
19389 * `Injector` returns itself when given `Injector` as a token:
19390 *
19391 * {@example core/di/ts/injector_spec.ts region='injectInjector'}
19392 *
19393 * @publicApi
19394 */
19395class Injector {
19396    static create(options, parent) {
19397        if (Array.isArray(options)) {
19398            return INJECTOR_IMPL(options, parent, '');
19399        }
19400        else {
19401            return INJECTOR_IMPL(options.providers, options.parent, options.name || '');
19402        }
19403    }
19404}
19405Injector.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;
19406Injector.NULL = new NullInjector();
19407/** @nocollapse */
19408Injector.ɵprov = ɵɵdefineInjectable({
19409    token: Injector,
19410    providedIn: 'any',
19411    factory: () => ɵɵinject(INJECTOR$1),
19412});
19413/**
19414 * @internal
19415 * @nocollapse
19416 */
19417Injector.__NG_ELEMENT_ID__ = -1 /* Injector */;
19418const IDENT = function (value) {
19419    return value;
19420};
19421const ɵ0$6 = IDENT;
19422const EMPTY = [];
19423const CIRCULAR$1 = IDENT;
19424const MULTI_PROVIDER_FN = function () {
19425    return Array.prototype.slice.call(arguments);
19426};
19427const ɵ1$1 = MULTI_PROVIDER_FN;
19428const NO_NEW_LINE$1 = 'ɵ';
19429class StaticInjector {
19430    constructor(providers, parent = Injector.NULL, source = null) {
19431        this.parent = parent;
19432        this.source = source;
19433        const records = this._records = new Map();
19434        records.set(Injector, { token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false });
19435        records.set(INJECTOR$1, { token: INJECTOR$1, fn: IDENT, deps: EMPTY, value: this, useNew: false });
19436        this.scope = recursivelyProcessProviders(records, providers);
19437    }
19438    get(token, notFoundValue, flags = InjectFlags.Default) {
19439        const records = this._records;
19440        let record = records.get(token);
19441        if (record === undefined) {
19442            // This means we have never seen this record, see if it is tree shakable provider.
19443            const injectableDef = getInjectableDef(token);
19444            if (injectableDef) {
19445                const providedIn = injectableDef && injectableDef.providedIn;
19446                if (providedIn === 'any' || providedIn != null && providedIn === this.scope) {
19447                    records.set(token, record = resolveProvider({ provide: token, useFactory: injectableDef.factory, deps: EMPTY }));
19448                }
19449            }
19450            if (record === undefined) {
19451                // Set record to null to make sure that we don't go through expensive lookup above again.
19452                records.set(token, null);
19453            }
19454        }
19455        let lastInjector = setCurrentInjector(this);
19456        try {
19457            return tryResolveToken(token, record, records, this.parent, notFoundValue, flags);
19458        }
19459        catch (e) {
19460            return catchInjectorError(e, token, 'StaticInjectorError', this.source);
19461        }
19462        finally {
19463            setCurrentInjector(lastInjector);
19464        }
19465    }
19466    toString() {
19467        const tokens = [], records = this._records;
19468        records.forEach((v, token) => tokens.push(stringify(token)));
19469        return `StaticInjector[${tokens.join(', ')}]`;
19470    }
19471}
19472function resolveProvider(provider) {
19473    const deps = computeDeps(provider);
19474    let fn = IDENT;
19475    let value = EMPTY;
19476    let useNew = false;
19477    let provide = resolveForwardRef(provider.provide);
19478    if (USE_VALUE in provider) {
19479        // We need to use USE_VALUE in provider since provider.useValue could be defined as undefined.
19480        value = provider.useValue;
19481    }
19482    else if (provider.useFactory) {
19483        fn = provider.useFactory;
19484    }
19485    else if (provider.useExisting) {
19486        // Just use IDENT
19487    }
19488    else if (provider.useClass) {
19489        useNew = true;
19490        fn = resolveForwardRef(provider.useClass);
19491    }
19492    else if (typeof provide == 'function') {
19493        useNew = true;
19494        fn = provide;
19495    }
19496    else {
19497        throw staticError('StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable', provider);
19498    }
19499    return { deps, fn, useNew, value };
19500}
19501function multiProviderMixError(token) {
19502    return staticError('Cannot mix multi providers and regular providers', token);
19503}
19504function recursivelyProcessProviders(records, provider) {
19505    let scope = null;
19506    if (provider) {
19507        provider = resolveForwardRef(provider);
19508        if (Array.isArray(provider)) {
19509            // if we have an array recurse into the array
19510            for (let i = 0; i < provider.length; i++) {
19511                scope = recursivelyProcessProviders(records, provider[i]) || scope;
19512            }
19513        }
19514        else if (typeof provider === 'function') {
19515            // Functions were supported in ReflectiveInjector, but are not here. For safety give useful
19516            // error messages
19517            throw staticError('Function/Class not supported', provider);
19518        }
19519        else if (provider && typeof provider === 'object' && provider.provide) {
19520            // At this point we have what looks like a provider: {provide: ?, ....}
19521            let token = resolveForwardRef(provider.provide);
19522            const resolvedProvider = resolveProvider(provider);
19523            if (provider.multi === true) {
19524                // This is a multi provider.
19525                let multiProvider = records.get(token);
19526                if (multiProvider) {
19527                    if (multiProvider.fn !== MULTI_PROVIDER_FN) {
19528                        throw multiProviderMixError(token);
19529                    }
19530                }
19531                else {
19532                    // Create a placeholder factory which will look up the constituents of the multi provider.
19533                    records.set(token, multiProvider = {
19534                        token: provider.provide,
19535                        deps: [],
19536                        useNew: false,
19537                        fn: MULTI_PROVIDER_FN,
19538                        value: EMPTY
19539                    });
19540                }
19541                // Treat the provider as the token.
19542                token = provider;
19543                multiProvider.deps.push({ token, options: 6 /* Default */ });
19544            }
19545            const record = records.get(token);
19546            if (record && record.fn == MULTI_PROVIDER_FN) {
19547                throw multiProviderMixError(token);
19548            }
19549            if (token === INJECTOR_SCOPE) {
19550                scope = resolvedProvider.value;
19551            }
19552            records.set(token, resolvedProvider);
19553        }
19554        else {
19555            throw staticError('Unexpected provider', provider);
19556        }
19557    }
19558    return scope;
19559}
19560function tryResolveToken(token, record, records, parent, notFoundValue, flags) {
19561    try {
19562        return resolveToken(token, record, records, parent, notFoundValue, flags);
19563    }
19564    catch (e) {
19565        // ensure that 'e' is of type Error.
19566        if (!(e instanceof Error)) {
19567            e = new Error(e);
19568        }
19569        const path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];
19570        path.unshift(token);
19571        if (record && record.value == CIRCULAR$1) {
19572            // Reset the Circular flag.
19573            record.value = EMPTY;
19574        }
19575        throw e;
19576    }
19577}
19578function resolveToken(token, record, records, parent, notFoundValue, flags) {
19579    let value;
19580    if (record && !(flags & InjectFlags.SkipSelf)) {
19581        // If we don't have a record, this implies that we don't own the provider hence don't know how
19582        // to resolve it.
19583        value = record.value;
19584        if (value == CIRCULAR$1) {
19585            throw Error(NO_NEW_LINE$1 + 'Circular dependency');
19586        }
19587        else if (value === EMPTY) {
19588            record.value = CIRCULAR$1;
19589            let obj = undefined;
19590            let useNew = record.useNew;
19591            let fn = record.fn;
19592            let depRecords = record.deps;
19593            let deps = EMPTY;
19594            if (depRecords.length) {
19595                deps = [];
19596                for (let i = 0; i < depRecords.length; i++) {
19597                    const depRecord = depRecords[i];
19598                    const options = depRecord.options;
19599                    const childRecord = options & 2 /* CheckSelf */ ? records.get(depRecord.token) : undefined;
19600                    deps.push(tryResolveToken(
19601                    // Current Token to resolve
19602                    depRecord.token, 
19603                    // A record which describes how to resolve the token.
19604                    // If undefined, this means we don't have such a record
19605                    childRecord, 
19606                    // Other records we know about.
19607                    records, 
19608                    // If we don't know how to resolve dependency and we should not check parent for it,
19609                    // than pass in Null injector.
19610                    !childRecord && !(options & 4 /* CheckParent */) ? Injector.NULL : parent, options & 1 /* Optional */ ? null : Injector.THROW_IF_NOT_FOUND, InjectFlags.Default));
19611                }
19612            }
19613            record.value = value = useNew ? new fn(...deps) : fn.apply(obj, deps);
19614        }
19615    }
19616    else if (!(flags & InjectFlags.Self)) {
19617        value = parent.get(token, notFoundValue, InjectFlags.Default);
19618    }
19619    else if (!(flags & InjectFlags.Optional)) {
19620        value = Injector.NULL.get(token, notFoundValue);
19621    }
19622    else {
19623        value = Injector.NULL.get(token, typeof notFoundValue !== 'undefined' ? notFoundValue : null);
19624    }
19625    return value;
19626}
19627function computeDeps(provider) {
19628    let deps = EMPTY;
19629    const providerDeps = provider.deps;
19630    if (providerDeps && providerDeps.length) {
19631        deps = [];
19632        for (let i = 0; i < providerDeps.length; i++) {
19633            let options = 6 /* Default */;
19634            let token = resolveForwardRef(providerDeps[i]);
19635            if (Array.isArray(token)) {
19636                for (let j = 0, annotations = token; j < annotations.length; j++) {
19637                    const annotation = annotations[j];
19638                    if (annotation instanceof Optional || annotation == Optional) {
19639                        options = options | 1 /* Optional */;
19640                    }
19641                    else if (annotation instanceof SkipSelf || annotation == SkipSelf) {
19642                        options = options & ~2 /* CheckSelf */;
19643                    }
19644                    else if (annotation instanceof Self || annotation == Self) {
19645                        options = options & ~4 /* CheckParent */;
19646                    }
19647                    else if (annotation instanceof Inject) {
19648                        token = annotation.token;
19649                    }
19650                    else {
19651                        token = resolveForwardRef(annotation);
19652                    }
19653                }
19654            }
19655            deps.push({ token, options });
19656        }
19657    }
19658    else if (provider.useExisting) {
19659        const token = resolveForwardRef(provider.useExisting);
19660        deps = [{ token, options: 6 /* Default */ }];
19661    }
19662    else if (!providerDeps && !(USE_VALUE in provider)) {
19663        // useValue & useExisting are the only ones which are exempt from deps all others need it.
19664        throw staticError('\'deps\' required', provider);
19665    }
19666    return deps;
19667}
19668function staticError(text, obj) {
19669    return new Error(formatError(text, obj, 'StaticInjectorError'));
19670}
19671
19672/**
19673 * @license
19674 * Copyright Google LLC All Rights Reserved.
19675 *
19676 * Use of this source code is governed by an MIT-style license that can be
19677 * found in the LICENSE file at https://angular.io/license
19678 */
19679/**
19680 * Retrieves the component instance associated with a given DOM element.
19681 *
19682 * @usageNotes
19683 * Given the following DOM structure:
19684 * ```html
19685 * <my-app>
19686 *   <div>
19687 *     <child-comp></child-comp>
19688 *   </div>
19689 * </my-app>
19690 * ```
19691 * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
19692 * associated with this DOM element.
19693 *
19694 * Calling the function on `<my-app>` will return the `MyApp` instance.
19695 *
19696 *
19697 * @param element DOM element from which the component should be retrieved.
19698 * @returns Component instance associated with the element or `null` if there
19699 *    is no component associated with it.
19700 *
19701 * @publicApi
19702 * @globalApi ng
19703 */
19704function getComponent(element) {
19705    assertDomElement(element);
19706    const context = loadLContext(element, false);
19707    if (context === null)
19708        return null;
19709    if (context.component === undefined) {
19710        context.component = getComponentAtNodeIndex(context.nodeIndex, context.lView);
19711    }
19712    return context.component;
19713}
19714/**
19715 * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
19716 * view that the element is part of. Otherwise retrieves the instance of the component whose view
19717 * owns the element (in this case, the result is the same as calling `getOwningComponent`).
19718 *
19719 * @param element Element for which to get the surrounding component instance.
19720 * @returns Instance of the component that is around the element or null if the element isn't
19721 *    inside any component.
19722 *
19723 * @publicApi
19724 * @globalApi ng
19725 */
19726function getContext(element) {
19727    assertDomElement(element);
19728    const context = loadLContext(element, false);
19729    return context === null ? null : context.lView[CONTEXT];
19730}
19731/**
19732 * Retrieves the component instance whose view contains the DOM element.
19733 *
19734 * For example, if `<child-comp>` is used in the template of `<app-comp>`
19735 * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
19736 * would return `<app-comp>`.
19737 *
19738 * @param elementOrDir DOM element, component or directive instance
19739 *    for which to retrieve the root components.
19740 * @returns Component instance whose view owns the DOM element or null if the element is not
19741 *    part of a component view.
19742 *
19743 * @publicApi
19744 * @globalApi ng
19745 */
19746function getOwningComponent(elementOrDir) {
19747    const context = loadLContext(elementOrDir, false);
19748    if (context === null)
19749        return null;
19750    let lView = context.lView;
19751    let parent;
19752    ngDevMode && assertLView(lView);
19753    while (lView[TVIEW].type === 2 /* Embedded */ && (parent = getLViewParent(lView))) {
19754        lView = parent;
19755    }
19756    return lView[FLAGS] & 512 /* IsRoot */ ? null : lView[CONTEXT];
19757}
19758/**
19759 * Retrieves all root components associated with a DOM element, directive or component instance.
19760 * Root components are those which have been bootstrapped by Angular.
19761 *
19762 * @param elementOrDir DOM element, component or directive instance
19763 *    for which to retrieve the root components.
19764 * @returns Root components associated with the target object.
19765 *
19766 * @publicApi
19767 * @globalApi ng
19768 */
19769function getRootComponents(elementOrDir) {
19770    return [...getRootContext(elementOrDir).components];
19771}
19772/**
19773 * Retrieves an `Injector` associated with an element, component or directive instance.
19774 *
19775 * @param elementOrDir DOM element, component or directive instance for which to
19776 *    retrieve the injector.
19777 * @returns Injector associated with the element, component or directive instance.
19778 *
19779 * @publicApi
19780 * @globalApi ng
19781 */
19782function getInjector(elementOrDir) {
19783    const context = loadLContext(elementOrDir, false);
19784    if (context === null)
19785        return Injector.NULL;
19786    const tNode = context.lView[TVIEW].data[context.nodeIndex];
19787    return new NodeInjector(tNode, context.lView);
19788}
19789/**
19790 * Retrieve a set of injection tokens at a given DOM node.
19791 *
19792 * @param element Element for which the injection tokens should be retrieved.
19793 */
19794function getInjectionTokens(element) {
19795    const context = loadLContext(element, false);
19796    if (context === null)
19797        return [];
19798    const lView = context.lView;
19799    const tView = lView[TVIEW];
19800    const tNode = tView.data[context.nodeIndex];
19801    const providerTokens = [];
19802    const startIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */;
19803    const endIndex = tNode.directiveEnd;
19804    for (let i = startIndex; i < endIndex; i++) {
19805        let value = tView.data[i];
19806        if (isDirectiveDefHack(value)) {
19807            // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
19808            // design flaw.  We should always store same type so that we can be monomorphic. The issue
19809            // is that for Components/Directives we store the def instead the type. The correct behavior
19810            // is that we should always be storing injectable type in this location.
19811            value = value.type;
19812        }
19813        providerTokens.push(value);
19814    }
19815    return providerTokens;
19816}
19817/**
19818 * Retrieves directive instances associated with a given DOM element. Does not include
19819 * component instances.
19820 *
19821 * @usageNotes
19822 * Given the following DOM structure:
19823 * ```
19824 * <my-app>
19825 *   <button my-button></button>
19826 *   <my-comp></my-comp>
19827 * </my-app>
19828 * ```
19829 * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
19830 * directive that is associated with the DOM element.
19831 *
19832 * Calling `getDirectives` on `<my-comp>` will return an empty array.
19833 *
19834 * @param element DOM element for which to get the directives.
19835 * @returns Array of directives associated with the element.
19836 *
19837 * @publicApi
19838 * @globalApi ng
19839 */
19840function getDirectives(element) {
19841    const context = loadLContext(element);
19842    if (context.directives === undefined) {
19843        context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);
19844    }
19845    // The `directives` in this case are a named array called `LComponentView`. Clone the
19846    // result so we don't expose an internal data structure in the user's console.
19847    return context.directives === null ? [] : [...context.directives];
19848}
19849function loadLContext(target, throwOnNotFound = true) {
19850    const context = getLContext(target);
19851    if (!context && throwOnNotFound) {
19852        throw new Error(ngDevMode ? `Unable to find context associated with ${stringifyForError(target)}` :
19853            'Invalid ng target');
19854    }
19855    return context;
19856}
19857/**
19858 * Retrieve map of local references.
19859 *
19860 * The references are retrieved as a map of local reference name to element or directive instance.
19861 *
19862 * @param target DOM element, component or directive instance for which to retrieve
19863 *    the local references.
19864 */
19865function getLocalRefs(target) {
19866    const context = loadLContext(target, false);
19867    if (context === null)
19868        return {};
19869    if (context.localRefs === undefined) {
19870        context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);
19871    }
19872    return context.localRefs || {};
19873}
19874/**
19875 * Retrieves the host element of a component or directive instance.
19876 * The host element is the DOM element that matched the selector of the directive.
19877 *
19878 * @param componentOrDirective Component or directive instance for which the host
19879 *     element should be retrieved.
19880 * @returns Host element of the target.
19881 *
19882 * @publicApi
19883 * @globalApi ng
19884 */
19885function getHostElement(componentOrDirective) {
19886    return getLContext(componentOrDirective).native;
19887}
19888/**
19889 * Retrieves the rendered text for a given component.
19890 *
19891 * This function retrieves the host element of a component and
19892 * and then returns the `textContent` for that element. This implies
19893 * that the text returned will include re-projected content of
19894 * the component as well.
19895 *
19896 * @param component The component to return the content text for.
19897 */
19898function getRenderedText(component) {
19899    const hostElement = getHostElement(component);
19900    return hostElement.textContent || '';
19901}
19902function loadLContextFromNode(node) {
19903    if (!(node instanceof Node))
19904        throw new Error('Expecting instance of DOM Element');
19905    return loadLContext(node);
19906}
19907/**
19908 * Retrieves a list of event listeners associated with a DOM element. The list does include host
19909 * listeners, but it does not include event listeners defined outside of the Angular context
19910 * (e.g. through `addEventListener`).
19911 *
19912 * @usageNotes
19913 * Given the following DOM structure:
19914 * ```
19915 * <my-app>
19916 *   <div (click)="doSomething()"></div>
19917 * </my-app>
19918 *
19919 * ```
19920 * Calling `getListeners` on `<div>` will return an object that looks as follows:
19921 * ```
19922 * {
19923 *   name: 'click',
19924 *   element: <div>,
19925 *   callback: () => doSomething(),
19926 *   useCapture: false
19927 * }
19928 * ```
19929 *
19930 * @param element Element for which the DOM listeners should be retrieved.
19931 * @returns Array of event listeners on the DOM element.
19932 *
19933 * @publicApi
19934 * @globalApi ng
19935 */
19936function getListeners(element) {
19937    assertDomElement(element);
19938    const lContext = loadLContext(element, false);
19939    if (lContext === null)
19940        return [];
19941    const lView = lContext.lView;
19942    const tView = lView[TVIEW];
19943    const lCleanup = lView[CLEANUP];
19944    const tCleanup = tView.cleanup;
19945    const listeners = [];
19946    if (tCleanup && lCleanup) {
19947        for (let i = 0; i < tCleanup.length;) {
19948            const firstParam = tCleanup[i++];
19949            const secondParam = tCleanup[i++];
19950            if (typeof firstParam === 'string') {
19951                const name = firstParam;
19952                const listenerElement = unwrapRNode(lView[secondParam]);
19953                const callback = lCleanup[tCleanup[i++]];
19954                const useCaptureOrIndx = tCleanup[i++];
19955                // if useCaptureOrIndx is boolean then report it as is.
19956                // if useCaptureOrIndx is positive number then it in unsubscribe method
19957                // if useCaptureOrIndx is negative number then it is a Subscription
19958                const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
19959                const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
19960                if (element == listenerElement) {
19961                    listeners.push({ element, name, callback, useCapture, type });
19962                }
19963            }
19964        }
19965    }
19966    listeners.sort(sortListeners);
19967    return listeners;
19968}
19969function sortListeners(a, b) {
19970    if (a.name == b.name)
19971        return 0;
19972    return a.name < b.name ? -1 : 1;
19973}
19974/**
19975 * This function should not exist because it is megamorphic and only mostly correct.
19976 *
19977 * See call site for more info.
19978 */
19979function isDirectiveDefHack(obj) {
19980    return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
19981}
19982/**
19983 * Returns the attached `DebugNode` instance for an element in the DOM.
19984 *
19985 * @param element DOM element which is owned by an existing component's view.
19986 */
19987function getDebugNode(element) {
19988    let debugNode = null;
19989    const lContext = loadLContextFromNode(element);
19990    const lView = lContext.lView;
19991    const nodeIndex = lContext.nodeIndex;
19992    if (nodeIndex !== -1) {
19993        const valueInLView = lView[nodeIndex];
19994        // this means that value in the lView is a component with its own
19995        // data. In this situation the TNode is not accessed at the same spot.
19996        const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
19997        ngDevMode &&
19998            assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
19999        debugNode = buildDebugNode(tNode, lView);
20000    }
20001    return debugNode;
20002}
20003/**
20004 * Retrieve the component `LView` from component/element.
20005 *
20006 * NOTE: `LView` is a private and should not be leaked outside.
20007 *       Don't export this method to `ng.*` on window.
20008 *
20009 * @param target DOM element or component instance for which to retrieve the LView.
20010 */
20011function getComponentLView(target) {
20012    const lContext = loadLContext(target);
20013    const nodeIndx = lContext.nodeIndex;
20014    const lView = lContext.lView;
20015    const componentLView = lView[nodeIndx];
20016    ngDevMode && assertLView(componentLView);
20017    return componentLView;
20018}
20019/** Asserts that a value is a DOM Element. */
20020function assertDomElement(value) {
20021    if (typeof Element !== 'undefined' && !(value instanceof Element)) {
20022        throw new Error('Expecting instance of DOM Element');
20023    }
20024}
20025
20026/**
20027 * @license
20028 * Copyright Google LLC All Rights Reserved.
20029 *
20030 * Use of this source code is governed by an MIT-style license that can be
20031 * found in the LICENSE file at https://angular.io/license
20032 */
20033/**
20034 * Marks a component for check (in case of OnPush components) and synchronously
20035 * performs change detection on the application this component belongs to.
20036 *
20037 * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
20038 *
20039 * @publicApi
20040 * @globalApi ng
20041 */
20042function applyChanges(component) {
20043    markDirty(component);
20044    getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
20045}
20046
20047/**
20048 * @license
20049 * Copyright Google LLC All Rights Reserved.
20050 *
20051 * Use of this source code is governed by an MIT-style license that can be
20052 * found in the LICENSE file at https://angular.io/license
20053 */
20054/**
20055 * This file introduces series of globally accessible debug tools
20056 * to allow for the Angular debugging story to function.
20057 *
20058 * To see this in action run the following command:
20059 *
20060 *   bazel run --config=ivy
20061 *   //packages/core/test/bundling/todo:devserver
20062 *
20063 *  Then load `localhost:5432` and start using the console tools.
20064 */
20065/**
20066 * This value reflects the property on the window where the dev
20067 * tools are patched (window.ng).
20068 * */
20069const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
20070let _published = false;
20071/**
20072 * Publishes a collection of default debug tools onto`window.ng`.
20073 *
20074 * These functions are available globally when Angular is in development
20075 * mode and are automatically stripped away from prod mode is on.
20076 */
20077function publishDefaultGlobalUtils() {
20078    if (!_published) {
20079        _published = true;
20080        /**
20081         * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
20082         * The contract of the function might be changed in any release and/or the function can be
20083         * removed completely.
20084         */
20085        publishGlobalUtil('ɵsetProfiler', setProfiler);
20086        publishGlobalUtil('getComponent', getComponent);
20087        publishGlobalUtil('getContext', getContext);
20088        publishGlobalUtil('getListeners', getListeners);
20089        publishGlobalUtil('getOwningComponent', getOwningComponent);
20090        publishGlobalUtil('getHostElement', getHostElement);
20091        publishGlobalUtil('getInjector', getInjector);
20092        publishGlobalUtil('getRootComponents', getRootComponents);
20093        publishGlobalUtil('getDirectives', getDirectives);
20094        publishGlobalUtil('applyChanges', applyChanges);
20095    }
20096}
20097/**
20098 * Publishes the given function to `window.ng` so that it can be
20099 * used from the browser console when an application is not in production.
20100 */
20101function publishGlobalUtil(name, fn) {
20102    if (typeof COMPILED === 'undefined' || !COMPILED) {
20103        // Note: we can't export `ng` when using closure enhanced optimization as:
20104        // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
20105        // - we can't declare a closure extern as the namespace `ng` is already used within Google
20106        //   for typings for AngularJS (via `goog.provide('ng....')`).
20107        const w = _global;
20108        ngDevMode && assertDefined(fn, 'function not defined');
20109        if (w) {
20110            let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
20111            if (!container) {
20112                container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
20113            }
20114            container[name] = fn;
20115        }
20116    }
20117}
20118
20119/**
20120 * @license
20121 * Copyright Google LLC All Rights Reserved.
20122 *
20123 * Use of this source code is governed by an MIT-style license that can be
20124 * found in the LICENSE file at https://angular.io/license
20125 */
20126const ɵ0$7 = (token, notFoundValue) => {
20127    throwProviderNotFoundError(token, 'NullInjector');
20128};
20129// TODO: A hack to not pull in the NullInjector from @angular/core.
20130const NULL_INJECTOR$1 = {
20131    get: ɵ0$7
20132};
20133/**
20134 * Bootstraps a Component into an existing host element and returns an instance
20135 * of the component.
20136 *
20137 * Use this function to bootstrap a component into the DOM tree. Each invocation
20138 * of this function will create a separate tree of components, injectors and
20139 * change detection cycles and lifetimes. To dynamically insert a new component
20140 * into an existing tree such that it shares the same injection, change detection
20141 * and object lifetime, use {@link ViewContainer#createComponent}.
20142 *
20143 * @param componentType Component to bootstrap
20144 * @param options Optional parameters which control bootstrapping
20145 */
20146function renderComponent$1(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts = {}) {
20147    ngDevMode && publishDefaultGlobalUtils();
20148    ngDevMode && assertComponentType(componentType);
20149    const rendererFactory = opts.rendererFactory || domRendererFactory3;
20150    const sanitizer = opts.sanitizer || null;
20151    const componentDef = getComponentDef(componentType);
20152    if (componentDef.type != componentType)
20153        componentDef.type = componentType;
20154    // The first index of the first selector is the tag name.
20155    const componentTag = componentDef.selectors[0][0];
20156    const hostRenderer = rendererFactory.createRenderer(null, null);
20157    const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);
20158    const rootFlags = componentDef.onPush ? 64 /* Dirty */ | 512 /* IsRoot */ :
20159        16 /* CheckAlways */ | 512 /* IsRoot */;
20160    const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
20161    const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
20162    const rootTView = createTView(0 /* Root */, null, null, 1, 0, null, null, null, null, null);
20163    const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null);
20164    enterView(rootView);
20165    let component;
20166    try {
20167        if (rendererFactory.begin)
20168            rendererFactory.begin();
20169        const componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);
20170        component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);
20171        // create mode pass
20172        renderView(rootTView, rootView, null);
20173        // update mode pass
20174        refreshView(rootTView, rootView, null, null);
20175    }
20176    finally {
20177        leaveView();
20178        if (rendererFactory.end)
20179            rendererFactory.end();
20180    }
20181    return component;
20182}
20183/**
20184 * Creates the root component view and the root component node.
20185 *
20186 * @param rNode Render host element.
20187 * @param def ComponentDef
20188 * @param rootView The parent view where the host node is stored
20189 * @param rendererFactory Factory to be used for creating child renderers.
20190 * @param hostRenderer The current renderer
20191 * @param sanitizer The sanitizer, if provided
20192 *
20193 * @returns Component view created
20194 */
20195function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
20196    const tView = rootView[TVIEW];
20197    const index = HEADER_OFFSET;
20198    ngDevMode && assertIndexInRange(rootView, index);
20199    rootView[index] = rNode;
20200    // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
20201    // the same time we want to communicate the debug `TNode` that this is a special `TNode`
20202    // representing a host element.
20203    const tNode = getOrCreateTNode(tView, index, 2 /* Element */, '#host', null);
20204    const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
20205    if (mergedAttrs !== null) {
20206        computeStaticStyling(tNode, mergedAttrs, true);
20207        if (rNode !== null) {
20208            setUpAttributes(hostRenderer, rNode, mergedAttrs);
20209            if (tNode.classes !== null) {
20210                writeDirectClass(hostRenderer, rNode, tNode.classes);
20211            }
20212            if (tNode.styles !== null) {
20213                writeDirectStyle(hostRenderer, rNode, tNode.styles);
20214            }
20215        }
20216    }
20217    const viewRenderer = rendererFactory.createRenderer(rNode, def);
20218    const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null);
20219    if (tView.firstCreatePass) {
20220        diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
20221        markAsComponentHost(tView, tNode);
20222        initTNodeFlags(tNode, rootView.length, 1);
20223    }
20224    addToViewTree(rootView, componentView);
20225    // Store component view at node index, with node as the HOST
20226    return rootView[index] = componentView;
20227}
20228/**
20229 * Creates a root component and sets it up with features and host bindings. Shared by
20230 * renderComponent() and ViewContainerRef.createComponent().
20231 */
20232function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
20233    const tView = rootLView[TVIEW];
20234    // Create directive instance with factory() and store at next index in viewData
20235    const component = instantiateRootComponent(tView, rootLView, componentDef);
20236    rootContext.components.push(component);
20237    componentView[CONTEXT] = component;
20238    hostFeatures && hostFeatures.forEach((feature) => feature(component, componentDef));
20239    // We want to generate an empty QueryList for root content queries for backwards
20240    // compatibility with ViewEngine.
20241    if (componentDef.contentQueries) {
20242        const tNode = getCurrentTNode();
20243        ngDevMode && assertDefined(tNode, 'TNode expected');
20244        componentDef.contentQueries(1 /* Create */, component, tNode.directiveStart);
20245    }
20246    const rootTNode = getCurrentTNode();
20247    ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
20248    if (tView.firstCreatePass &&
20249        (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
20250        setSelectedIndex(rootTNode.index);
20251        const rootTView = rootLView[TVIEW];
20252        registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
20253        invokeHostBindingsInCreationMode(componentDef, component);
20254    }
20255    return component;
20256}
20257function createRootContext(scheduler, playerHandler) {
20258    return {
20259        components: [],
20260        scheduler: scheduler || defaultScheduler,
20261        clean: CLEAN_PROMISE,
20262        playerHandler: playerHandler || null,
20263        flags: 0 /* Empty */
20264    };
20265}
20266/**
20267 * Used to enable lifecycle hooks on the root component.
20268 *
20269 * Include this feature when calling `renderComponent` if the root component
20270 * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
20271 * be called properly.
20272 *
20273 * Example:
20274 *
20275 * ```
20276 * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
20277 * ```
20278 */
20279function LifecycleHooksFeature(component, def) {
20280    const lView = readPatchedLView(component);
20281    ngDevMode && assertDefined(lView, 'LView is required');
20282    const tView = lView[TVIEW];
20283    const tNode = getCurrentTNode();
20284    ngDevMode && assertDefined(tNode, 'TNode is required');
20285    registerPostOrderHooks(tView, tNode);
20286}
20287/**
20288 * Wait on component until it is rendered.
20289 *
20290 * This function returns a `Promise` which is resolved when the component's
20291 * change detection is executed. This is determined by finding the scheduler
20292 * associated with the `component`'s render tree and waiting until the scheduler
20293 * flushes. If nothing is scheduled, the function returns a resolved promise.
20294 *
20295 * Example:
20296 * ```
20297 * await whenRendered(myComponent);
20298 * ```
20299 *
20300 * @param component Component to wait upon
20301 * @returns Promise which resolves when the component is rendered.
20302 */
20303function whenRendered(component) {
20304    return getRootContext(component).clean;
20305}
20306
20307/**
20308 * @license
20309 * Copyright Google LLC All Rights Reserved.
20310 *
20311 * Use of this source code is governed by an MIT-style license that can be
20312 * found in the LICENSE file at https://angular.io/license
20313 */
20314function getSuperType(type) {
20315    return Object.getPrototypeOf(type.prototype).constructor;
20316}
20317/**
20318 * Merges the definition from a super class to a sub class.
20319 * @param definition The definition that is a SubClass of another directive of component
20320 *
20321 * @codeGenApi
20322 */
20323function ɵɵInheritDefinitionFeature(definition) {
20324    let superType = getSuperType(definition.type);
20325    let shouldInheritFields = true;
20326    const inheritanceChain = [definition];
20327    while (superType) {
20328        let superDef = undefined;
20329        if (isComponentDef(definition)) {
20330            // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
20331            superDef = superType.ɵcmp || superType.ɵdir;
20332        }
20333        else {
20334            if (superType.ɵcmp) {
20335                throw new Error('Directives cannot inherit Components');
20336            }
20337            // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
20338            superDef = superType.ɵdir;
20339        }
20340        if (superDef) {
20341            if (shouldInheritFields) {
20342                inheritanceChain.push(superDef);
20343                // Some fields in the definition may be empty, if there were no values to put in them that
20344                // would've justified object creation. Unwrap them if necessary.
20345                const writeableDef = definition;
20346                writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
20347                writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
20348                writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
20349                // Merge hostBindings
20350                const superHostBindings = superDef.hostBindings;
20351                superHostBindings && inheritHostBindings(definition, superHostBindings);
20352                // Merge queries
20353                const superViewQuery = superDef.viewQuery;
20354                const superContentQueries = superDef.contentQueries;
20355                superViewQuery && inheritViewQuery(definition, superViewQuery);
20356                superContentQueries && inheritContentQueries(definition, superContentQueries);
20357                // Merge inputs and outputs
20358                fillProperties(definition.inputs, superDef.inputs);
20359                fillProperties(definition.declaredInputs, superDef.declaredInputs);
20360                fillProperties(definition.outputs, superDef.outputs);
20361                // Merge animations metadata.
20362                // If `superDef` is a Component, the `data` field is present (defaults to an empty object).
20363                if (isComponentDef(superDef) && superDef.data.animation) {
20364                    // If super def is a Component, the `definition` is also a Component, since Directives can
20365                    // not inherit Components (we throw an error above and cannot reach this code).
20366                    const defData = definition.data;
20367                    defData.animation = (defData.animation || []).concat(superDef.data.animation);
20368                }
20369            }
20370            // Run parent features
20371            const features = superDef.features;
20372            if (features) {
20373                for (let i = 0; i < features.length; i++) {
20374                    const feature = features[i];
20375                    if (feature && feature.ngInherit) {
20376                        feature(definition);
20377                    }
20378                    // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
20379                    // def already has all the necessary information inherited from its super class(es), so we
20380                    // can stop merging fields from super classes. However we need to iterate through the
20381                    // prototype chain to look for classes that might contain other "features" (like
20382                    // NgOnChanges), which we should invoke for the original `definition`. We set the
20383                    // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
20384                    // logic and only invoking functions from the "features" list.
20385                    if (feature === ɵɵInheritDefinitionFeature) {
20386                        shouldInheritFields = false;
vendor: 5,762 bytes, lines 20387-20556
20387                    }
20388                }
20389            }
20390        }
20391        superType = Object.getPrototypeOf(superType);
20392    }
20393    mergeHostAttrsAcrossInheritance(inheritanceChain);
20394}
20395/**
20396 * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
20397 *
20398 * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
20399 * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
20400 * type.
20401 */
20402function mergeHostAttrsAcrossInheritance(inheritanceChain) {
20403    let hostVars = 0;
20404    let hostAttrs = null;
20405    // We process the inheritance order from the base to the leaves here.
20406    for (let i = inheritanceChain.length - 1; i >= 0; i--) {
20407        const def = inheritanceChain[i];
20408        // For each `hostVars`, we need to add the superclass amount.
20409        def.hostVars = (hostVars += def.hostVars);
20410        // for each `hostAttrs` we need to merge it with superclass.
20411        def.hostAttrs =
20412            mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
20413    }
20414}
20415function maybeUnwrapEmpty(value) {
20416    if (value === EMPTY_OBJ) {
20417        return {};
20418    }
20419    else if (value === EMPTY_ARRAY$1) {
20420        return [];
20421    }
20422    else {
20423        return value;
20424    }
20425}
20426function inheritViewQuery(definition, superViewQuery) {
20427    const prevViewQuery = definition.viewQuery;
20428    if (prevViewQuery) {
20429        definition.viewQuery = (rf, ctx) => {
20430            superViewQuery(rf, ctx);
20431            prevViewQuery(rf, ctx);
20432        };
20433    }
20434    else {
20435        definition.viewQuery = superViewQuery;
20436    }
20437}
20438function inheritContentQueries(definition, superContentQueries) {
20439    const prevContentQueries = definition.contentQueries;
20440    if (prevContentQueries) {
20441        definition.contentQueries = (rf, ctx, directiveIndex) => {
20442            superContentQueries(rf, ctx, directiveIndex);
20443            prevContentQueries(rf, ctx, directiveIndex);
20444        };
20445    }
20446    else {
20447        definition.contentQueries = superContentQueries;
20448    }
20449}
20450function inheritHostBindings(definition, superHostBindings) {
20451    const prevHostBindings = definition.hostBindings;
20452    if (prevHostBindings) {
20453        definition.hostBindings = (rf, ctx) => {
20454            superHostBindings(rf, ctx);
20455            prevHostBindings(rf, ctx);
20456        };
20457    }
20458    else {
20459        definition.hostBindings = superHostBindings;
20460    }
20461}
20462
20463/**
20464 * @license
20465 * Copyright Google LLC All Rights Reserved.
20466 *
20467 * Use of this source code is governed by an MIT-style license that can be
20468 * found in the LICENSE file at https://angular.io/license
20469 */
20470/**
20471 * Fields which exist on either directive or component definitions, and need to be copied from
20472 * parent to child classes by the `ɵɵCopyDefinitionFeature`.
20473 */
20474const COPY_DIRECTIVE_FIELDS = [
20475    // The child class should use the providers of its parent.
20476    'providersResolver',
20477];
20478/**
20479 * Fields which exist only on component definitions, and need to be copied from parent to child
20480 * classes by the `ɵɵCopyDefinitionFeature`.
20481 *
20482 * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
20483 * since those should go in `COPY_DIRECTIVE_FIELDS` above.
20484 */
20485const COPY_COMPONENT_FIELDS = [
20486    // The child class should use the template function of its parent, including all template
20487    // semantics.
20488    'template',
20489    'decls',
20490    'consts',
20491    'vars',
20492    'onPush',
20493    'ngContentSelectors',
20494    // The child class should use the CSS styles of its parent, including all styling semantics.
20495    'styles',
20496    'encapsulation',
20497    // The child class should be checked by the runtime in the same way as its parent.
20498    'schemas',
20499];
20500/**
20501 * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
20502 * definition.
20503 *
20504 * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
20505 * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
20506 * generates a skeleton definition on the child class, and applies this feature.
20507 *
20508 * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
20509 * including things like the component template function.
20510 *
20511 * @param definition The definition of a child class which inherits from a parent class with its
20512 * own definition.
20513 *
20514 * @codeGenApi
20515 */
20516function ɵɵCopyDefinitionFeature(definition) {
20517    let superType = getSuperType(definition.type);
20518    let superDef = undefined;
20519    if (isComponentDef(definition)) {
20520        // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
20521        superDef = superType.ɵcmp;
20522    }
20523    else {
20524        // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
20525        superDef = superType.ɵdir;
20526    }
20527    // Needed because `definition` fields are readonly.
20528    const defAny = definition;
20529    // Copy over any fields that apply to either directives or components.
20530    for (const field of COPY_DIRECTIVE_FIELDS) {
20531        defAny[field] = superDef[field];
20532    }
20533    if (isComponentDef(superDef)) {
20534        // Copy over any component-specific fields.
20535        for (const field of COPY_COMPONENT_FIELDS) {
20536            defAny[field] = superDef[field];
20537        }
20538    }
20539}
20540
20541/**
20542 * @license
20543 * Copyright Google LLC All Rights Reserved.
20544 *
20545 * Use of this source code is governed by an MIT-style license that can be
20546 * found in the LICENSE file at https://angular.io/license
20547 */
20548let _symbolIterator = null;
20549function getSymbolIterator() {
20550    if (!_symbolIterator) {
20551        const Symbol = _global['Symbol'];
20552        if (Symbol && Symbol.iterator) {
20553            _symbolIterator = Symbol.iterator;
20554        }
20555        else {
20556            // es6-shim specific logic
20557            const keys = Object.getOwnPropertyNames(Map.prototype);
20558            for (let i = 0; i < keys.length; ++i) {
20559                const key = keys[i];
20560                if (key !== 'entries' && key !== 'size' &&
20561                    Map.prototype[key] === Map.prototype['entries']) {
20562                    _symbolIterator = key;
20563                }
20564            }
20565        }
20566    }
20567    return _symbolIterator;
20568}
20569
20570/**
20571 * @license
20572 * Copyright Google LLC All Rights Reserved.
20573 *
20574 * Use of this source code is governed by an MIT-style license that can be
20575 * found in the LICENSE file at https://angular.io/license
20576 */
20577function devModeEqual(a, b) {
20578    const isListLikeIterableA = isListLikeIterable(a);
20579    const isListLikeIterableB = isListLikeIterable(b);
20580    if (isListLikeIterableA && isListLikeIterableB) {
20581        return areIterablesEqual(a, b, devModeEqual);
20582    }
20583    else {
20584        const isAObject = a && (typeof a === 'object' || typeof a === 'function');
20585        const isBObject = b && (typeof b === 'object' || typeof b === 'function');
20586        if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
20587            return true;
20588        }
20589        else {
20590            return Object.is(a, b);
20591        }
20592    }
20593}
20594/**
20595 * Indicates that the result of a {@link Pipe} transformation has changed even though the
20596 * reference has not changed.
20597 *
20598 * Wrapped values are unwrapped automatically during the change detection, and the unwrapped value
20599 * is stored.
20600 *
20601 * Example:
20602 *
20603 * ```
20604 * if (this._latestValue === this._latestReturnedValue) {
20605 *    return this._latestReturnedValue;
20606 *  } else {
20607 *    this._latestReturnedValue = this._latestValue;
20608 *    return WrappedValue.wrap(this._latestValue); // this will force update
20609 *  }
20610 * ```
20611 *
20612 * @publicApi
20613 * @deprecated from v10 stop using. (No replacement, deemed unnecessary.)
20614 */
20615class WrappedValue {
20616    constructor(value) {
20617        this.wrapped = value;
20618    }
20619    /** Creates a wrapped value. */
20620    static wrap(value) {
20621        return new WrappedValue(value);
20622    }
20623    /**
20624     * Returns the underlying value of a wrapped value.
20625     * Returns the given `value` when it is not wrapped.
20626     **/
20627    static unwrap(value) {
20628        return WrappedValue.isWrapped(value) ? value.wrapped : value;
20629    }
20630    /** Returns true if `value` is a wrapped value. */
20631    static isWrapped(value) {
20632        return value instanceof WrappedValue;
20633    }
20634}
20635function isListLikeIterable(obj) {
20636    if (!isJsObject(obj))
20637        return false;
20638    return Array.isArray(obj) ||
20639        (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
20640            getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
20641}
20642function areIterablesEqual(a, b, comparator) {
20643    const iterator1 = a[getSymbolIterator()]();
20644    const iterator2 = b[getSymbolIterator()]();
20645    while (true) {
20646        const item1 = iterator1.next();
20647        const item2 = iterator2.next();
20648        if (item1.done && item2.done)
20649            return true;
20650        if (item1.done || item2.done)
20651            return false;
20652        if (!comparator(item1.value, item2.value))
20653            return false;
20654    }
20655}
20656function iterateListLike(obj, fn) {
20657    if (Array.isArray(obj)) {
20658        for (let i = 0; i < obj.length; i++) {
20659            fn(obj[i]);
20660        }
20661    }
20662    else {
20663        const iterator = obj[getSymbolIterator()]();
20664        let item;
20665        while (!((item = iterator.next()).done)) {
20666            fn(item.value);
20667        }
20668    }
20669}
20670function isJsObject(o) {
20671    return o !== null && (typeof o === 'function' || typeof o === 'object');
20672}
20673
20674/**
20675 * @license
20676 * Copyright Google LLC All Rights Reserved.
20677 *
20678 * Use of this source code is governed by an MIT-style license that can be
20679 * found in the LICENSE file at https://angular.io/license
20680 */
20681// TODO(misko): consider inlining
20682/** Updates binding and returns the value. */
20683function updateBinding(lView, bindingIndex, value) {
20684    return lView[bindingIndex] = value;
20685}
20686/** Gets the current binding value. */
20687function getBinding(lView, bindingIndex) {
20688    ngDevMode && assertIndexInRange(lView, bindingIndex);
20689    ngDevMode &&
20690        assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
20691    return lView[bindingIndex];
20692}
20693/**
20694 * Updates binding if changed, then returns whether it was updated.
20695 *
20696 * This function also checks the `CheckNoChangesMode` and throws if changes are made.
20697 * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
20698 * behavior.
20699 *
20700 * @param lView current `LView`
20701 * @param bindingIndex The binding in the `LView` to check
20702 * @param value New value to check against `lView[bindingIndex]`
20703 * @returns `true` if the bindings has changed. (Throws if binding has changed during
20704 *          `CheckNoChangesMode`)
20705 */
20706function bindingUpdated(lView, bindingIndex, value) {
20707    ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
20708    ngDevMode &&
20709        assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
20710    const oldValue = lView[bindingIndex];
20711    if (Object.is(oldValue, value)) {
20712        return false;
20713    }
20714    else {
20715        if (ngDevMode && isInCheckNoChangesMode()) {
20716            // View engine didn't report undefined values as changed on the first checkNoChanges pass
20717            // (before the change detection was run).
20718            const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
20719            if (!devModeEqual(oldValueToCompare, value)) {
20720                const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
20721                throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
20722            }
20723            // There was a change, but the `devModeEqual` decided that the change is exempt from an error.
20724            // For this reason we exit as if no change. The early exit is needed to prevent the changed
20725            // value to be written into `LView` (If we would write the new value that we would not see it
20726            // as change on next CD.)
20727            return false;
20728        }
20729        lView[bindingIndex] = value;
20730        return true;
20731    }
20732}
20733/** Updates 2 bindings if changed, then returns whether either was updated. */
20734function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
20735    const different = bindingUpdated(lView, bindingIndex, exp1);
20736    return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
20737}
20738/** Updates 3 bindings if changed, then returns whether any was updated. */
20739function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
20740    const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
20741    return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
20742}
20743/** Updates 4 bindings if changed, then returns whether any was updated. */
20744function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
20745    const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
20746    return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
20747}
20748
20749/**
20750 * @license
20751 * Copyright Google LLC All Rights Reserved.
20752 *
20753 * Use of this source code is governed by an MIT-style license that can be
20754 * found in the LICENSE file at https://angular.io/license
20755 */
20756/**
20757 * Updates the value of or removes a bound attribute on an Element.
20758 *
20759 * Used in the case of `[attr.title]="value"`
20760 *
20761 * @param name name The name of the attribute.
20762 * @param value value The attribute is removed when value is `null` or `undefined`.
20763 *                  Otherwise the attribute value is set to the stringified value.
20764 * @param sanitizer An optional function used to sanitize the value.
20765 * @param namespace Optional namespace to use when setting the attribute.
20766 *
20767 * @codeGenApi
20768 */
20769function ɵɵattribute(name, value, sanitizer, namespace) {
20770    const lView = getLView();
20771    const bindingIndex = nextBindingIndex();
20772    if (bindingUpdated(lView, bindingIndex, value)) {
20773        const tView = getTView();
20774        const tNode = getSelectedTNode();
20775        elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
20776        ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
20777    }
20778    return ɵɵattribute;
20779}
20780
20781/**
20782 * @license
20783 * Copyright Google LLC All Rights Reserved.
20784 *
20785 * Use of this source code is governed by an MIT-style license that can be
20786 * found in the LICENSE file at https://angular.io/license
20787 */
20788/**
20789 * Create interpolation bindings with a variable number of expressions.
20790 *
20791 * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
20792 * Those are faster because there is no need to create an array of expressions and iterate over it.
20793 *
20794 * `values`:
20795 * - has static text at even indexes,
20796 * - has evaluated expressions at odd indexes.
20797 *
20798 * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
20799 */
20800function interpolationV(lView, values) {
20801    ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
20802    ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
20803    let isBindingUpdated = false;
vendor: 5,204 bytes, lines 20804-20930
20804    let bindingIndex = getBindingIndex();
20805    for (let i = 1; i < values.length; i += 2) {
20806        // Check if bindings (odd indexes) have changed
20807        isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
20808    }
20809    setBindingIndex(bindingIndex);
20810    if (!isBindingUpdated) {
20811        return NO_CHANGE;
20812    }
20813    // Build the updated content
20814    let content = values[0];
20815    for (let i = 1; i < values.length; i += 2) {
20816        content += renderStringify(values[i]) + values[i + 1];
20817    }
20818    return content;
20819}
20820/**
20821 * Creates an interpolation binding with 1 expression.
20822 *
20823 * @param prefix static value used for concatenation only.
20824 * @param v0 value checked for change.
20825 * @param suffix static value used for concatenation only.
20826 */
20827function interpolation1(lView, prefix, v0, suffix) {
20828    const different = bindingUpdated(lView, nextBindingIndex(), v0);
20829    return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
20830}
20831/**
20832 * Creates an interpolation binding with 2 expressions.
20833 */
20834function interpolation2(lView, prefix, v0, i0, v1, suffix) {
20835    const bindingIndex = getBindingIndex();
20836    const different = bindingUpdated2(lView, bindingIndex, v0, v1);
20837    incrementBindingIndex(2);
20838    return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
20839}
20840/**
20841 * Creates an interpolation binding with 3 expressions.
20842 */
20843function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
20844    const bindingIndex = getBindingIndex();
20845    const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
20846    incrementBindingIndex(3);
20847    return different ?
20848        prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
20849        NO_CHANGE;
20850}
20851/**
20852 * Create an interpolation binding with 4 expressions.
20853 */
20854function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
20855    const bindingIndex = getBindingIndex();
20856    const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
20857    incrementBindingIndex(4);
20858    return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
20859        renderStringify(v2) + i2 + renderStringify(v3) + suffix :
20860        NO_CHANGE;
20861}
20862/**
20863 * Creates an interpolation binding with 5 expressions.
20864 */
20865function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
20866    const bindingIndex = getBindingIndex();
20867    let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
20868    different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
20869    incrementBindingIndex(5);
20870    return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
20871        renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
20872        NO_CHANGE;
20873}
20874/**
20875 * Creates an interpolation binding with 6 expressions.
20876 */
20877function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
20878    const bindingIndex = getBindingIndex();
20879    let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
20880    different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
20881    incrementBindingIndex(6);
20882    return different ?
20883        prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
20884            renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
20885        NO_CHANGE;
20886}
20887/**
20888 * Creates an interpolation binding with 7 expressions.
20889 */
20890function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
20891    const bindingIndex = getBindingIndex();
20892    let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
20893    different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
20894    incrementBindingIndex(7);
20895    return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
20896        renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
20897        renderStringify(v5) + i5 + renderStringify(v6) + suffix :
20898        NO_CHANGE;
20899}
20900/**
20901 * Creates an interpolation binding with 8 expressions.
20902 */
20903function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
20904    const bindingIndex = getBindingIndex();
20905    let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
20906    different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
20907    incrementBindingIndex(8);
20908    return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
20909        renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
20910        renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
20911        NO_CHANGE;
20912}
20913
20914/**
20915 *
20916 * Update an interpolated attribute on an element with single bound value surrounded by text.
20917 *
20918 * Used when the value passed to a property has 1 interpolated value in it:
20919 *
20920 * ```html
20921 * <div attr.title="prefix{{v0}}suffix"></div>
20922 * ```
20923 *
20924 * Its compiled representation is::
20925 *
20926 * ```ts
20927 * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
20928 * ```
20929 *
20930 * @param attrName The name of the attribute to update
20931 * @param prefix Static value used for concatenation only.
20932 * @param v0 Value checked for change.
20933 * @param suffix Static value used for concatenation only.
20934 * @param sanitizer An optional sanitizer function
20935 * @returns itself, so that it may be chained.
20936 * @codeGenApi
20937 */
20938function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
20939    const lView = getLView();
20940    const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
20941    if (interpolatedValue !== NO_CHANGE) {
20942        const tNode = getSelectedTNode();
20943        elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
20944        ngDevMode &&
20945            storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
20946    }
20947    return ɵɵattributeInterpolate1;
20948}
20949/**
20950 *
20951 * Update an interpolated attribute on an element with 2 bound values surrounded by text.
20952 *
20953 * Used when the value passed to a property has 2 interpolated values in it:
20954 *
20955 * ```html
20956 * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
20957 * ```
20958 *
20959 * Its compiled representation is::
20960 *
20961 * ```ts
20962 * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
20963 * ```
20964 *
20965 * @param attrName The name of the attribute to update
20966 * @param prefix Static value used for concatenation only.
20967 * @param v0 Value checked for change.
20968 * @param i0 Static value used for concatenation only.
20969 * @param v1 Value checked for change.
20970 * @param suffix Static value used for concatenation only.
20971 * @param sanitizer An optional sanitizer function
20972 * @returns itself, so that it may be chained.
20973 * @codeGenApi
20974 */
20975function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
20976    const lView = getLView();
20977    const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
20978    if (interpolatedValue !== NO_CHANGE) {
20979        const tNode = getSelectedTNode();
20980        elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
20981        ngDevMode &&
20982            storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
20983    }
20984    return ɵɵattributeInterpolate2;
20985}
20986/**
20987 *
20988 * Update an interpolated attribute on an element with 3 bound values surrounded by text.
20989 *
20990 * Used when the value passed to a property has 3 interpolated values in it:
20991 *
20992 * ```html
20993 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
20994 * ```
20995 *
20996 * Its compiled representation is::
20997 *
20998 * ```ts
20999 * ɵɵattributeInterpolate3(
21000 * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
21001 * ```
21002 *
21003 * @param attrName The name of the attribute to update
21004 * @param prefix Static value used for concatenation only.
21005 * @param v0 Value checked for change.
21006 * @param i0 Static value used for concatenation only.
21007 * @param v1 Value checked for change.
21008 * @param i1 Static value used for concatenation only.
21009 * @param v2 Value checked for change.
21010 * @param suffix Static value used for concatenation only.
21011 * @param sanitizer An optional sanitizer function
21012 * @returns itself, so that it may be chained.
21013 * @codeGenApi
21014 */
21015function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
21016    const lView = getLView();
21017    const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
21018    if (interpolatedValue !== NO_CHANGE) {
21019        const tNode = getSelectedTNode();
21020        elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
21021        ngDevMode &&
21022            storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
21023    }
21024    return ɵɵattributeInterpolate3;
21025}
21026/**
21027 *
21028 * Update an interpolated attribute on an element with 4 bound values surrounded by text.
21029 *
21030 * Used when the value passed to a property has 4 interpolated values in it:
21031 *
21032 * ```html
21033 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
21034 * ```
21035 *
21036 * Its compiled representation is::
21037 *
21038 * ```ts
21039 * ɵɵattributeInterpolate4(
21040 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
21041 * ```
21042 *
21043 * @param attrName The name of the attribute to update
21044 * @param prefix Static value used for concatenation only.
21045 * @param v0 Value checked for change.
21046 * @param i0 Static value used for concatenation only.
21047 * @param v1 Value checked for change.
21048 * @param i1 Static value used for concatenation only.
21049 * @param v2 Value checked for change.
21050 * @param i2 Static value used for concatenation only.
21051 * @param v3 Value checked for change.
21052 * @param suffix Static value used for concatenation only.
21053 * @param sanitizer An optional sanitizer function
21054 * @returns itself, so that it may be chained.
21055 * @codeGenApi
21056 */
21057function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
21058    const lView = getLView();
21059    const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
21060    if (interpolatedValue !== NO_CHANGE) {
21061        const tNode = getSelectedTNode();
21062        elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
21063        ngDevMode &&
21064            storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
21065    }
21066    return ɵɵattributeInterpolate4;
21067}
21068/**
21069 *
21070 * Update an interpolated attribute on an element with 5 bound values surrounded by text.
21071 *
21072 * Used when the value passed to a property has 5 interpolated values in it:
21073 *
21074 * ```html
21075 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
21076 * ```
21077 *
21078 * Its compiled representation is::
21079 *
21080 * ```ts
21081 * ɵɵattributeInterpolate5(
21082 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
21083 * ```
21084 *
21085 * @param attrName The name of the attribute to update
21086 * @param prefix Static value used for concatenation only.
21087 * @param v0 Value checked for change.
21088 * @param i0 Static value used for concatenation only.
21089 * @param v1 Value checked for change.
21090 * @param i1 Static value used for concatenation only.
21091 * @param v2 Value checked for change.
21092 * @param i2 Static value used for concatenation only.
21093 * @param v3 Value checked for change.
21094 * @param i3 Static value used for concatenation only.
21095 * @param v4 Value checked for change.
21096 * @param suffix Static value used for concatenation only.
21097 * @param sanitizer An optional sanitizer function
21098 * @returns itself, so that it may be chained.
21099 * @codeGenApi
21100 */
21101function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
21102    const lView = getLView();
21103    const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
21104    if (interpolatedValue !== NO_CHANGE) {
21105        const tNode = getSelectedTNode();
21106        elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
21107        ngDevMode &&
21108            storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
21109    }
21110    return ɵɵattributeInterpolate5;
21111}
21112/**
21113 *
21114 * Update an interpolated attribute on an element with 6 bound values surrounded by text.
21115 *
21116 * Used when the value passed to a property has 6 interpolated values in it:
21117 *
21118 * ```html
21119 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
21120 * ```
21121 *
21122 * Its compiled representation is::
21123 *
21124 * ```ts
21125 * ɵɵattributeInterpolate6(
21126 *    'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
21127 * ```
21128 *
21129 * @param attrName The name of the attribute to update
21130 * @param prefix Static value used for concatenation only.
21131 * @param v0 Value checked for change.
21132 * @param i0 Static value used for concatenation only.
21133 * @param v1 Value checked for change.
21134 * @param i1 Static value used for concatenation only.
21135 * @param v2 Value checked for change.
21136 * @param i2 Static value used for concatenation only.
21137 * @param v3 Value checked for change.
21138 * @param i3 Static value used for concatenation only.
21139 * @param v4 Value checked for change.
21140 * @param i4 Static value used for concatenation only.
21141 * @param v5 Value checked for change.
21142 * @param suffix Static value used for concatenation only.
21143 * @param sanitizer An optional sanitizer function
21144 * @returns itself, so that it may be chained.
21145 * @codeGenApi
21146 */
21147function ɵɵattributeInterpolate6(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer, namespace) {
21148    const lView = getLView();
21149    const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
21150    if (interpolatedValue !== NO_CHANGE) {
21151        const tNode = getSelectedTNode();
21152        elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
21153        ngDevMode &&
21154            storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix
vendor: 8,458 bytes, lines 21154-21348
21154);
21155    }
21156    return ɵɵattributeInterpolate6;
21157}
21158/**
21159 *
21160 * Update an interpolated attribute on an element with 7 bound values surrounded by text.
21161 *
21162 * Used when the value passed to a property has 7 interpolated values in it:
21163 *
21164 * ```html
21165 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
21166 * ```
21167 *
21168 * Its compiled representation is::
21169 *
21170 * ```ts
21171 * ɵɵattributeInterpolate7(
21172 *    'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
21173 * ```
21174 *
21175 * @param attrName The name of the attribute to update
21176 * @param prefix Static value used for concatenation only.
21177 * @param v0 Value checked for change.
21178 * @param i0 Static value used for concatenation only.
21179 * @param v1 Value checked for change.
21180 * @param i1 Static value used for concatenation only.
21181 * @param v2 Value checked for change.
21182 * @param i2 Static value used for concatenation only.
21183 * @param v3 Value checked for change.
21184 * @param i3 Static value used for concatenation only.
21185 * @param v4 Value checked for change.
21186 * @param i4 Static value used for concatenation only.
21187 * @param v5 Value checked for change.
21188 * @param i5 Static value used for concatenation only.
21189 * @param v6 Value checked for change.
21190 * @param suffix Static value used for concatenation only.
21191 * @param sanitizer An optional sanitizer function
21192 * @returns itself, so that it may be chained.
21193 * @codeGenApi
21194 */
21195function ɵɵattributeInterpolate7(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer, namespace) {
21196    const lView = getLView();
21197    const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
21198    if (interpolatedValue !== NO_CHANGE) {
21199        const tNode = getSelectedTNode();
21200        elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
21201        ngDevMode &&
21202            storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
21203    }
21204    return ɵɵattributeInterpolate7;
21205}
21206/**
21207 *
21208 * Update an interpolated attribute on an element with 8 bound values surrounded by text.
21209 *
21210 * Used when the value passed to a property has 8 interpolated values in it:
21211 *
21212 * ```html
21213 * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
21214 * ```
21215 *
21216 * Its compiled representation is::
21217 *
21218 * ```ts
21219 * ɵɵattributeInterpolate8(
21220 *  'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
21221 * ```
21222 *
21223 * @param attrName The name of the attribute to update
21224 * @param prefix Static value used for concatenation only.
21225 * @param v0 Value checked for change.
21226 * @param i0 Static value used for concatenation only.
21227 * @param v1 Value checked for change.
21228 * @param i1 Static value used for concatenation only.
21229 * @param v2 Value checked for change.
21230 * @param i2 Static value used for concatenation only.
21231 * @param v3 Value checked for change.
21232 * @param i3 Static value used for concatenation only.
21233 * @param v4 Value checked for change.
21234 * @param i4 Static value used for concatenation only.
21235 * @param v5 Value checked for change.
21236 * @param i5 Static value used for concatenation only.
21237 * @param v6 Value checked for change.
21238 * @param i6 Static value used for concatenation only.
21239 * @param v7 Value checked for change.
21240 * @param suffix Static value used for concatenation only.
21241 * @param sanitizer An optional sanitizer function
21242 * @returns itself, so that it may be chained.
21243 * @codeGenApi
21244 */
21245function ɵɵattributeInterpolate8(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer, namespace) {
21246    const lView = getLView();
21247    const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
21248    if (interpolatedValue !== NO_CHANGE) {
21249        const tNode = getSelectedTNode();
21250        elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
21251        ngDevMode &&
21252            storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
21253    }
21254    return ɵɵattributeInterpolate8;
21255}
21256/**
21257 * Update an interpolated attribute on an element with 9 or more bound values surrounded by text.
21258 *
21259 * Used when the number of interpolated values exceeds 8.
21260 *
21261 * ```html
21262 * <div
21263 *  title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div>
21264 * ```
21265 *
21266 * Its compiled representation is::
21267 *
21268 * ```ts
21269 * ɵɵattributeInterpolateV(
21270 *  'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
21271 *  'suffix']);
21272 * ```
21273 *
21274 * @param attrName The name of the attribute to update.
21275 * @param values The collection of values and the strings in-between those values, beginning with
21276 * a string prefix and ending with a string suffix.
21277 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
21278 * @param sanitizer An optional sanitizer function
21279 * @returns itself, so that it may be chained.
21280 * @codeGenApi
21281 */
21282function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {
21283    const lView = getLView();
21284    const interpolated = interpolationV(lView, values);
21285    if (interpolated !== NO_CHANGE) {
21286        const tNode = getSelectedTNode();
21287        elementAttributeInternal(tNode, lView, attrName, interpolated, sanitizer, namespace);
21288        if (ngDevMode) {
21289            const interpolationInBetween = [values[0]]; // prefix
21290            for (let i = 2; i < values.length; i += 2) {
21291                interpolationInBetween.push(values[i]);
21292            }
21293            storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween);
21294        }
21295    }
21296    return ɵɵattributeInterpolateV;
21297}
21298
21299/**
21300 * @license
21301 * Copyright Google LLC All Rights Reserved.
21302 *
21303 * Use of this source code is governed by an MIT-style license that can be
21304 * found in the LICENSE file at https://angular.io/license
21305 */
21306function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) {
21307    ngDevMode && assertFirstCreatePass(tView);
21308    ngDevMode && ngDevMode.firstCreatePass++;
21309    const tViewConsts = tView.consts;
21310    // TODO(pk): refactor getOrCreateTNode to have the "create" only version
21311    const tNode = getOrCreateTNode(tView, index, 4 /* Container */, tagName || null, getConstant(tViewConsts, attrsIndex));
21312    resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
21313    registerPostOrderHooks(tView, tNode);
21314    const embeddedTView = tNode.tViews = createTView(2 /* Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
21315    if (tView.queries !== null) {
21316        tView.queries.template(tView, tNode);
21317        embeddedTView.queries = tView.queries.embeddedTView(tNode);
21318    }
21319    return tNode;
21320}
21321/**
21322 * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.
21323 *
21324 * <ng-template #foo>
21325 *    <div></div>
21326 * </ng-template>
21327 *
21328 * @param index The index of the container in the data array
21329 * @param templateFn Inline template
21330 * @param decls The number of nodes, local refs, and pipes for this template
21331 * @param vars The number of bindings for this template
21332 * @param tagName The name of the container element, if applicable
21333 * @param attrsIndex Index of template attributes in the `consts` array.
21334 * @param localRefs Index of the local references in the `consts` array.
21335 * @param localRefExtractor A function which extracts local-refs values from the template.
21336 *        Defaults to the current element associated with the local-ref.
21337 *
21338 * @codeGenApi
21339 */
21340function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {
21341    const lView = getLView();
21342    const tView = getTView();
21343    const adjustedIndex = index + HEADER_OFFSET;
21344    const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :
21345        tView.data[adjustedIndex];
21346    setCurrentTNode(tNode, false);
21347    const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');
21348    appendChild(tView, lView, comment, tNode);
21349    attachPatchData(comment, lView);
21350    addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));
21351    if (isDirectiveHost(tNode)) {
21352        createDirectivesInstances(tView, lView, tNode);
21353    }
21354    if (localRefsIndex != null) {
21355        saveResolvedLocalsInData(lView, tNode, localRefExtractor);
21356    }
21357}
21358
21359/**
21360 * @license
21361 * Copyright Google LLC All Rights Reserved.
21362 *
21363 * Use of this source code is governed by an MIT-style license that can be
21364 * found in the LICENSE file at https://angular.io/license
21365 */
21366/** Store a value in the `data` at a given `index`. */
21367function store(tView, lView, index, value) {
21368    // We don't store any static data for local variables, so the first time
21369    // we see the template, we should store as null to avoid a sparse array
21370    if (index >= tView.data.length) {
21371        tView.data[index] = null;
21372        tView.blueprint[index] = null;
21373    }
21374    lView[index] = value;
21375}
21376/**
21377 * Retrieves a local reference from the current contextViewData.
21378 *
21379 * If the reference to retrieve is in a parent view, this instruction is used in conjunction
21380 * with a nextContext() call, which walks up the tree and updates the contextViewData instance.
21381 *
21382 * @param index The index of the local ref in contextViewData.
21383 *
21384 * @codeGenApi
21385 */
21386function ɵɵreference(index) {
21387    const contextLView = getContextLView();
21388    return load(contextLView, HEADER_OFFSET + index);
21389}
21390
21391/**
21392 * @license
21393 * Copyright Google LLC All Rights Reserved.
21394 *
21395 * Use of this source code is governed by an MIT-style license that can be
21396 * found in the LICENSE file at https://angular.io/license
21397 */
21398/**
21399 * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.
21400 *
21401 * This should be kept up to date with the public exports of @angular/core.
21402 */
21403const angularCoreDiEnv = {
21404    'ɵɵdefineInjectable': ɵɵdefineInjectable,
21405    'ɵɵdefineInjector': ɵɵdefineInjector,
21406    'ɵɵinject': ɵɵinject,
21407    'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,
21408};
21409
21410/**
21411 * @license
21412 * Copyright Google LLC All Rights Reserved.
21413 *
21414 * Use of this source code is governed by an MIT-style license that can be
21415 * found in the LICENSE file at https://angular.io/license
21416 */
21417/**
21418 * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting
21419 * injectable def (`ɵprov`) onto the injectable type.
21420 */
21421function compileInjectable(type, srcMeta) {
21422    let ngInjectableDef = null;
21423    let ngFactoryDef = null;
21424    // if NG_PROV_DEF is already defined on this class then don't overwrite it
21425    if (!type.hasOwnProperty(NG_PROV_DEF)) {
21426        Object.defineProperty(type, NG_PROV_DEF, {
21427            get: () => {
21428                if (ngInjectableDef === null) {
21429                    ngInjectableDef = getCompilerFacade().compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, srcMeta));
21430                }
21431                return ngInjectableDef;
21432            },
21433        });
21434    }
21435    // if NG_FACTORY_DEF is already defined on this class then don't overwrite it
21436    if (!type.hasOwnProperty(NG_FACTORY_DEF)) {
21437        Object.defineProperty(type, NG_FACTORY_DEF, {
21438            get: () => {
21439                if (ngFactoryDef === null) {
21440                    const metadata = getInjectableMetadata(type, srcMeta);
21441                    const compiler = getCompilerFacade();
21442                    ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {
21443                        name: metadata.name,
21444                        type: metadata.type,
21445                        typeArgumentCount: metadata.typeArgumentCount,
21446                        deps: reflectDependencies(type),
21447                        injectFn: 'inject',
21448                        target: compiler.R3FactoryTarget.Injectable
21449                    });
21450                }
21451                return ngFactoryDef;
21452            },
21453            // Leave this configurable so that the factories from directives or pipes can take precedence.
21454            configurable: true
21455        });
21456    }
21457}
21458const ɵ0$8 = getClosureSafeProperty;
21459const USE_VALUE$1 = getClosureSafeProperty({ provide: String, useValue: ɵ0$8 });
21460function isUseClassProvider(meta) {
21461    return meta.useClass !== undefined;
21462}
21463function isUseValueProvider(meta) {
21464    return USE_VALUE$1 in meta;
21465}
21466function isUseFactoryProvider(meta) {
21467    return meta.useFactory !== undefined;
21468}
21469function isUseExistingProvider(meta) {
21470    return meta.useExisting !== undefined;
21471}
21472function getInjectableMetadata(type, srcMeta) {
21473    // Allow the compilation of a class with a `@Injectable()` decorator without parameters
21474    const meta = srcMeta || { providedIn: null };
21475    const compilerMeta = {
21476        name: type.name,
21477        type: type,
21478        typeArgumentCount: 0,
21479        providedIn: meta.providedIn,
21480        userDeps: undefined,
21481    };
21482    if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {
21483        compilerMeta.userDeps = convertDependencies(meta.deps);
21484    }
21485    if (isUseClassProvider(meta)) {
21486        // The user explicitly specified useClass, and may or may not have provided deps.
21487        compilerMeta.useClass = resolveForwardRef(meta.useClass);
21488    }
21489    else if (isUseValueProvider(meta)) {
21490        // The user explicitly specified useValue.
21491        compilerMeta.useValue = resolveForwardRef(meta.useValue);
21492    }
21493    else if (isUseFactoryProvider(meta)) {
21494        // The user explicitly specified useFactory.
21495        compilerMeta.useFactory = meta.useFactory;
21496    }
21497    else if (isUseExistingProvider(meta)) {
21498        // The user explicitly specified useExisting.
21499        compilerMeta.useExisting = resolveForwardRef(meta.useExisting);
21500    }
21501    return compilerMeta;
21502}
21503
21504/**
21505 * @license
21506 * Copyright Google LLC All Rights Reserved.
21507 *
21508 * Use of this source code is governed by an MIT-style license that can be
21509 * found in the LICENSE file at https://angular.io/license
21510 */
21511const ɵ0$9 = getClosureSafeProperty;
21512const USE_VALUE$2 = getClosureSafeProperty({ provide: String, useValue: ɵ0$9 });
21513const EMPTY_ARRAY$3 = [];
21514function convertInjectableProviderToFactory(type, provider) {
21515    if (!provider) {
21516        const reflectionCapabilities = new ReflectionCapabilities();
21517        const deps = reflectionCapabilities.parameters(type);
21518        // TODO - convert to flags.
21519        return () => new type(...injectArgs(deps));
21520    }
21521    if (USE_VALUE$2 in provider) {
21522        const valueProvider = provider;
21523        return () => valueProvider.useValue;
21524    }
21525    else if (provider.useExisting) {
21526        const existingProvider = provider;
21527        return () => ɵɵinject(resolveForwardRef(existingProvider.useExisting));
21528    }
21529    else if (provider.useFactory) {
21530        const factoryProvider = provider;
21531        return () => factoryProvider.useFactory(...injectArgs(factoryProvider.deps || EMPTY_ARRAY$3));
21532    }
21533    else if (provider.useClass) {
21534        const classProvider = provider;
21535        let deps = provider.deps;
21536        if (!deps) {
21537            const reflectionCapabilities = new ReflectionCapabilities();
21538            deps = reflectionCapabilities.parameters(type);
21539        }
21540        return () => new (resolveForwardRef(classProvider.useClass))(...injectArgs(deps));
21541    }
21542    else {
21543        let deps = provider.deps;
21544        if (!deps) {
21545            const reflectionCapabilities = new ReflectionCapabilities();
21546            deps = reflectionCapabilities.parameters(type);
21547        }
21548        return () => new type(...injectArgs(deps));
21549    }
21550}
21551
21552/**
21553 * @license
21554 * Copyright Google LLC All Rights Reserved.
21555 *
21556 * Use of this source code is governed by an MIT-style license that can be
21557 * found in the LICENSE file at https://angular.io/license
21558 */
21559const ɵ0$a = (type, meta) => SWITCH_COMPILE_INJECTABLE(type, meta);
21560/**
21561 * Injectable decorator and metadata.
21562 *
21563 * @Annotation
21564 * @publicApi
21565 */
21566const Injectable = makeDecorator('Injectable', undefined, undefined, undefined, ɵ0$a);
21567/**
21568 * Supports @Injectable() in JIT mode for Render2.
21569 */
21570function render2CompileInjectable(injectableType, options) {
21571    if (options && options.providedIn !== undefined && !getInjectableDef(injectableType)) {
21572        injectableType.ɵprov = ɵɵdefineInjectable({
21573            token: injectableType,
21574            providedIn: options.providedIn,
21575            factory: convertInjectableProviderToFactory(injectableType, options),
21576        });
21577    }
21578}
21579const SWITCH_COMPILE_INJECTABLE__POST_R3__ = compileInjectable;
21580const SWITCH_COMPILE_INJECTABLE__PRE_R3__ = render2CompileInjectable;
21581const SWITCH_COMPILE_INJECTABLE = SWITCH_COMPILE_INJECTABLE__POST_R3__;
21582
21583/**
21584 * @license
21585 * Copyright Google LLC All Rights Reserved.
21586 *
21587 * Use of this source code is governed by an MIT-style license that can be
21588 * found in the LICENSE file at https://angular.io/license
21589 */
21590function findFirstClosedCycle(keys) {
21591    const res = [];
21592    for (let i = 0; i < keys.length; ++i) {
21593        if (res.indexOf(keys[i]) > -1) {
21594            res.push(keys[i]);
21595            return res;
21596        }
21597        res.push(keys[i]);
21598    }
21599    return res;
21600}
21601function constructResolvingPath(keys) {
21602    if (keys.length > 1) {
21603        const reversed = findFirstClosedCycle(keys.slice().reverse());
21604        const tokenStrs = reversed.map(k => stringify(k.token));
21605        return ' (' + tokenStrs.join(' -> ') + ')';
21606    }
21607    return '';
21608}
21609function injectionError(injector, key, constructResolvingMessage, originalError) {
21610    const keys = [key];
21611    const errMsg = constructResolvingMessage(keys);
21612    const error = (originalError ? wrappedError(errMsg, originalError) : Error(errMsg));
21613    error.addKey = addKey;
21614    error.keys = keys;
21615    error.injectors = [injector];
21616    error.constructResolvingMessage = constructResolvingMessage;
21617    error[ERROR_ORIGINAL_ERROR] = originalError;
21618    return error;
21619}
21620function addKey(injector, key) {
21621    this.injectors.push(injector);
21622    this.keys.push(key);
21623    // Note: This updated message won't be reflected in the `.stack` property
21624    this.message = this.constructResolvingMessage(this.keys);
21625}
21626/**
21627 * Thrown when trying to retrieve a dependency by key from {@link Injector}, but the
21628 * {@link Injector} does not have a {@link Provider} for the given key.
21629 *
21630 * @usageNotes
21631 * ### Example
21632 *
21633 * ```typescript
21634 * class A {
21635 *   constructor(b:B) {}
21636 * }
21637 *
21638 * expect(() => Injector.resolveAndCreate([A])).toThrowError();
21639 * ```
21640 */
21641function noProviderError(injector, key) {
21642    return injectionError(injector, key, function (keys) {
21643        const first = stringify(keys[0].token);
21644        return `No provider for ${first}!${constructResolvingPath(keys)}`;
21645    });
21646}
21647/**
21648 * Thrown when dependencies form a cycle.
21649 *
21650 * @usageNotes
21651 * ### Example
21652 *
21653 * ```typescript
21654 * var injector = Injector.resolveAndCreate([
21655 *   {provide: "one", useFactory: (two) => "two", deps: [[new Inject("two")]]},
21656 *   {provide: "two", useFactory: (one) => "one", deps: [[new Inject("one")]]}
21657 * ]);
21658 *
21659 * expect(() => injector.get("one")).toThrowError();
21660 * ```
21661 *
21662 * Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.
21663 */
21664function cyclicDependencyError(injector, key) {
21665    return injectionError(injector, key, function (keys) {
21666        return `Cannot instantiate cyclic dependency!${constructResolvingPath(keys)}`;
21667    });
21668}
21669/**
21670 * Thrown when a constructing type returns with an Error.
21671 *
21672 * The `InstantiationError` class contains the original error plus the dependency graph which caused
21673 * this object to be instantiated.
21674 *
21675 * @usageNotes
21676 * ### Example
21677 *
21678 * ```typescript
21679 * class A {
21680 *   constructor() {
21681 *     throw new Error('message');
21682 *   }
21683 * }
21684 *
21685 * var injector = Injector.resolveAndCreate([A]);
21686
21687 * try {
21688 *   injector.get(A);
21689 * } catch (e) {
21690 *   expect(e instanceof InstantiationError).toBe(true);
21691 *   expect(e.originalException.message).toEqual("message");
21692 *   expect(e.originalStack).toBeDefined();
21693 * }
21694 * ```
21695 */
21696function instantiationError(injector, originalException, originalStack, key) {
21697    return injectionError(injector, key, function (keys) {
21698        const first = stringify(keys[0].token);
21699        return `${originalException.message}: Error during instantiation of ${first}!${constructResolvingPath(keys)}.`;
21700    }, originalException);
21701}
21702/**
21703 * Thrown when an object other then {@link Provider} (or `Type`) is passed to {@link Injector}
21704 * creation.
21705 *
21706 * @usageNotes
21707 * ### Example
21708 *
21709 * ```typescript
21710 * expect(() => Injector.resolveAndCreate(["not a type"])).toThrowError();
21711 * ```
21712 */
21713function invalidProviderError(provider) {
21714    return Error(`Invalid provider - only instances of Provider and Type are allowed, got: ${provider}`);
21715}
21716/**
21717 * Thrown when the class has no annotation information.
21718 *
21719 * Lack of annotation information prevents the {@link Injector} from determining which dependencies
21720 * need to be injected into the constructor.
21721 *
21722 * @usageNotes
21723 * ### Example
21724 *
21725 * ```typescript
21726 * class A {
21727 *   constructor(b) {}
21728 * }
21729 *
21730 * expect(() => Injector.resolveAndCreate([A])).toThrowError();
21731 * ```
21732 *
21733 * This error is also thrown when the class not marked with {@link Injectable} has parameter types.
21734 *
21735 * ```typescript
21736 * class B {}
21737 *
21738 * class A {
21739 *   constructor(b:B) {} // no information about the parameter types of A is available at runtime.
21740 * }
21741 *
21742 * expect(() => Injector.resolveAndCreate([A,B])).toThrowError();
21743 * ```
21744 *
21745 */
21746function noAnnotationError(typeOrFunc, params) {
21747    const signature = [];
21748    for (let i = 0, ii = params.length; i < ii; i++) {
21749        const parameter = params[i];
21750        if (!parameter || parameter.length == 0) {
21751            signature.push('?');
21752        }
21753        else {
21754            signature.push(parameter.map(stringify).join(' '));
21755        }
21756    }
21757    return Error('Cannot resolve all parameters for \'' + stringify(typeOrFunc) + '\'(' +
21758        signature.join(', ') + '). ' +
21759        'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \'' +
21760        stringify(typeOrFunc) + '\' is decorated with Injectable.');
21761}
21762/**
21763 * Thrown when getting an object by index.
21764 *
21765 * @usageNotes
21766 * ### Example
21767 *
21768 * ```typescript
21769 * class A {}
21770 *
21771 * var injector = Injector.resolveAndCreate([A]);
21772 *
21773 * expect(() => injector.getAt(100)).toThrowError();
21774 * ```
21775 *
21776 */
21777function outOfBoundsError(index) {
21778    return Error(`Index ${index} is out-of-bounds.`);
21779}
21780// TODO: add a working example after alpha38 is released
21781/**
21782 * Thrown when a multi provider and a regular provider are bound to the same token.
21783 *
21784 * @usageNotes
21785 * ### Example
21786 *
21787 * ```typescript
21788 * expect(() => Injector.resolveAndCreate([
21789 *   { provide: "Strings", useValue: "string1", multi: true},
21790 *   { provide: "Strings", useValue: "string2", multi: false}
21791 * ])).toThrowError();
21792 * ```
21793 */
21794function mixingMultiProvidersWithRegularProvidersError(provider1, provider2) {
21795    return Error(`Cannot mix multi providers and regular providers, got: ${provider1} ${provider2}`);
21796}
21797
21798/**
21799 * @license
21800 * Copyright Google LLC All Rights Reserved.
21801 *
21802 * Use of this source code is governed by an MIT-style license that can be
21803 * found in the LICENSE file at https://angular.io/license
21804 */
21805/**
21806 * A unique object used for retrieving items from the {@link ReflectiveInjector}.
21807 *
21808 * Keys have:
21809 * - a system-wide unique `id`.
21810 * - a `token`.
21811 *
21812 * `Key` is used internally by {@link ReflectiveInjector} because its system-wide unique `id` allows
21813 * the
21814 * injector to store created objects in a more efficient way.
21815 *
21816 * `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when
21817 * resolving
21818 * providers.
21819 *
21820 * @deprecated No replacement
21821 * @publicApi
21822 */
21823class ReflectiveKey {
21824    /**
21825     * Private
21826     */
21827    constructor(token, id) {
21828        this.token = token;
21829        this.id = id;
21830        if (!token) {
21831            throw new Error('Token must be defined!');
21832        }
21833        this.displayName = stringify(this.token);
21834    }
21835    /**
21836     * Retrieves a `Key` for a token.
21837     */
21838    static get(token) {
21839        return _globalKeyRegistry.get(resolveForwardRef(token));
21840    }
21841    /**
21842     * @returns the number of keys registered in the system.
21843     */
21844    static get numberOfKeys() {
21845        return _globalKeyRegistry.numberOfKeys;
21846    }
21847}
21848class KeyRegistry {
21849    constructor() {
21850        this._allKeys = new Map();
21851    }
21852    get(token) {
21853        if (token instanceof ReflectiveKey)
21854            return token;
21855        if (this._allKeys.has(token)) {
21856            return this._allKeys.get(token);
21857        }
21858        const newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys);
21859        this._allKeys.set(token, newKey);
21860        return newKey;
21861    }
21862    get numberOfKeys() {
21863        return this._allKeys.size;
21864    }
21865}
21866const _globalKeyRegistry = new KeyRegistry();
21867
21868/**
21869 * @license
21870 * Copyright Google LLC All Rights Reserved.
21871 *
21872 * Use of this source code is governed by an MIT-style license that can be
21873 * found in the LICENSE file at https://angular.io/license
21874 */
21875/**
21876 * Provides access to reflection data about symbols. Used internally by Angular
21877 * to power dependency injection and compilation.
21878 */
21879class Reflector {
21880    constructor(reflectionCapabilities) {
21881        this.reflectionCapabilities = reflectionCapabilities;
21882    }
21883    updateCapabilities(caps) {
21884        this.reflectionCapabilities = caps;
21885    }
21886    factory(type) {
21887        return this.reflectionCapabilities.factory(type);
21888    }
21889    parameters(typeOrFunc) {
21890        return this.reflectionCapabilities.parameters(typeOrFunc);
21891    }
21892    annotations(typeOrFunc) {
21893        return this.reflectionCapabilities.annotations(typeOrFunc);
21894    }
21895    propMetadata(typeOrFunc) {
21896        return this.reflectionCapabilities.propMetadata(typeOrFunc);
21897    }
21898    hasLifecycleHook(type, lcProperty) {
21899        return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);
21900    }
21901    getter(name) {
21902        return this.reflectionCapabilities.getter(name);
21903    }
21904    setter(name) {
21905        return this.reflectionCapabilities.setter(name);
21906    }
21907    method(name) {
21908        return this.reflectionCapabilities.method(name);
21909    }
21910    importUri(type) {
21911        return this.reflectionCapabilities.importUri(type);
21912    }
21913    resourceUri(type) {
21914        return this.reflectionCapabilities.resourceUri(type);
21915    }
21916    resolveIdentifier(name, moduleUrl, members, runtime) {
21917        return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);
21918    }
21919    resolveEnum(identifier, name) {
21920        return this.reflectionCapabilities.resolveEnum(identifier, name);
21921    }
21922}
21923
21924/**
21925 * @license
21926 * Copyright Google LLC All Rights Reserved.
21927 *
21928 * Use of this source code is governed by an MIT-style license that can be
21929 * found in the LICENSE file at https://angular.io/license
21930 */
21931/**
21932 * The {@link Reflector} used internally in Angular to access metadata
21933 * about symbols.
21934 */
21935const reflector = new Reflector(new ReflectionCapabilities());
21936
21937/**
21938 * @license
21939 * Copyright Google LLC All Rights Reserved.
21940 *
21941 * Use of this source code is governed by an MIT-style license that can be
21942 * found in the LICENSE file at https://angular.io/license
21943 */
21944/**
21945 * `Dependency` is used by the framework to extend DI.
21946 * This is internal to Angular and should not be used directly.
21947 */
21948class ReflectiveDependency {
21949    constructor(key, optional, visibility) {
21950        this.key = key;
21951        this.optional = optional;
21952        this.visibility = visibility;
21953    }
21954    static fromKey(key) {
21955        return new ReflectiveDependency(key, false, null);
21956    }
21957}
21958const _EMPTY_LIST = [];
21959class ResolvedReflectiveProvider_ {
21960    constructor(key, resolvedFactories, multiProvider) {
21961        this.key = key;
21962        this.resolvedFactories = resolvedFactories;
21963        this.multiProvider = multiProvider;
21964        this.resolvedFactory = this.resolvedFactories[0];
21965    }
21966}
21967/**
21968 * An internal resolved representation of a factory function created by resolving `Provider`.
21969 * @publicApi
21970 */
21971class ResolvedReflectiveFactory {
21972    constructor(
21973    /**
21974     * Factory function which can return an instance of an object represented by a key.
21975     */
21976    factory, 
21977    /**
21978     * Arguments (dependencies) to the `factory` function.
21979     */
21980    dependencies) {
21981        this.factory = factory;
21982        this.dependencies = dependencies;
21983    }
21984}
21985/**
21986 * Resolve a single provider.
21987 */
21988function resolveReflectiveFactory(provider) {
21989    let factoryFn;
21990    let resolvedDeps;
21991    if (provider.useClass) {
21992        const useClass = resolveForwardRef(provider.useClass);
21993        factoryFn = reflector.factory(useClass);
21994        resolvedDeps = _dependenciesFor(useClass);
21995    }
21996    else if (provider.useExisting) {
21997        factoryFn = (aliasInstance) => aliasInstance;
21998        resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];
21999    }
22000    else if (provider.useFactory) {
22001        factoryFn = provider.useFactory;
22002        resolvedDeps = constructDependencies(provider.useFactory, provider.deps);
22003    }
22004    else {
22005        factoryFn = () => provider.useValue;
22006        resolvedDeps = _EMPTY_LIST;
22007    }
22008    return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);
22009}
22010/**
22011 * Converts the `Provider` into `ResolvedProvider`.
22012 *
22013 * `Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider
22014 * syntax.
22015 */
22016function resolveReflectiveProvider(provider) {
22017    return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);
22018}
22019/**
22020 * Resolve a list of Providers.
22021 */
22022function resolveReflectiveProviders(providers) {
22023    const normalized = _normalizeProviders(providers, []);
22024    const resolved = normalized.map(resolveReflectiveProvider);
22025    const resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());
22026    return Array.from(resolvedProviderMap.values());
22027}
22028/**
22029 * Merges a list of ResolvedProviders into a list where each key is contained exactly once and
22030 * multi providers have been merged.
22031 */
22032function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {
22033    for (let i = 0; i < providers.length; i++) {
22034        const provider = providers[i];
22035        const existing = normalizedProvidersMap.get(provider.key.id);
22036        if (existing) {
22037            if (provider.multiProvider !== existing.multiProvider) {
22038                throw mixingMultiProvidersWithRegularProvidersError(existing, provider);
22039            }
22040            if (provider.multiProvider) {
22041                for (let j = 0; j < provider.resolvedFactories.length; j++) {
22042                    existing.resolvedFactories.push(provider.resolvedFactories[j]);
22043                }
22044            }
22045            else {
22046                normalizedProvidersMap.set(provider.key.id, provider);
22047            }
22048        }
22049        else {
22050            let resolvedProvider;
22051            if (provider.multiProvider) {
22052                resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider);
22053            }
22054            else {
22055                resolvedProvider = provider;
22056            }
22057            normalizedProvidersMap.set(provider.key.id, resolvedProvider);
22058        }
22059    }
22060    return normalizedProvidersMap;
22061}
22062function _normalizeProviders(providers, res) {
22063    providers.forEach(b => {
22064        if (b instanceof Type) {
22065            res.push({ provide: b, useClass: b });
22066        }
22067        else if (b && typeof b == 'object' && b.provide !== undefined) {
22068            res.push(b);
22069        }
22070        else if (Array.isArray(b)) {
22071            _normalizeProviders(b, res);
22072        }
22073        else {
22074            throw invalidProviderError(b);
22075        }
22076    });
22077    return res;
22078}
22079function constructDependencies(typeOrFunc, dependencies) {
22080    if (!dependencies) {
22081        return _dependenciesFor(typeOrFunc);
22082    }
22083    else {
22084        const params = dependencies.map(t => [t]);
22085        return dependencies.map(t => _extractToken(typeOrFunc, t, params));
22086    }
22087}
22088function _dependenciesFor(typeOrFunc) {
22089    const params = reflector.parameters(typeOrFunc);
22090    if (!params)
22091        return [];
22092    if (params.some(p => p == null)) {
22093        throw noAnnotationError(typeOrFunc, params);
22094    }
22095    return params.map(p => _extractToken(typeOrFunc, p, params));
22096}
22097function _extractToken(typeOrFunc, metadata, params) {
22098    let token = null;
22099    let optional = false;
22100    if (!Array.isArray(metadata)) {
22101        if (metadata instanceof Inject) {
22102            return _createDependency(metadata.token, optional, null);
22103        }
22104        else {
22105            return _createDependency(metadata, optional, null);
22106        }
22107    }
22108    let visibility = null;
22109    for (let i = 0; i < metadata.length; ++i) {
22110        const paramMetadata = metadata[i];
22111        if (paramMetadata instanceof Type) {
22112            token = paramMetadata;
22113        }
22114        else if (paramMetadata instanceof Inject) {
22115            token = paramMetadata.token;
22116        }
22117        else if (paramMetadata instanceof Optional) {
22118            optional = true;
22119        }
22120        else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) {
22121            visibility = paramMetadata;
22122        }
22123        else if (paramMetadata instanceof InjectionToken) {
22124            token = paramMetadata;
22125        }
22126    }
22127    token = resolveForwardRef(token);
22128    if (token != null) {
22129        return _createDependency(token, optional, visibility);
22130    }
22131    else {
22132        throw noAnnotationError(typeOrFunc, params);
22133    }
22134}
22135function _createDependency(token, optional, visibility) {
22136    return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility);
22137}
22138
22139/**
22140 * @license
22141 * Copyright Google LLC All Rights Reserved.
22142 *
22143 * Use of this source code is governed by an MIT-style license that can be
22144 * found in the LICENSE file at https://angular.io/license
22145 */
22146// Threshold for the dynamic version
22147const UNDEFINED = {};
22148/**
22149 * A ReflectiveDependency injection container used for instantiating objects and resolving
22150 * dependencies.
22151 *
22152 * An `Injector` is a replacement for a `new` operator, which can automatically resolve the
22153 * constructor dependencies.
22154 *
22155 * In typical use, application code asks for the dependencies in the constructor and they are
22156 * resolved by the `Injector`.
22157 *
22158 * @usageNotes
22159 * ### Example
22160 *
22161 * The following example creates an `Injector` configured to create `Engine` and `Car`.
22162 *
22163 * ```typescript
22164 * @Injectable()
22165 * class Engine {
22166 * }
22167 *
22168 * @Injectable()
22169 * class Car {
22170 *   constructor(public engine:Engine) {}
22171 * }
22172 *
22173 * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
22174 * var car = injector.get(Car);
22175 * expect(car instanceof Car).toBe(true);
22176 * expect(car.engine instanceof Engine).toBe(true);
22177 * ```
22178 *
22179 * Notice, we don't use the `new` operator because we explicitly want to have the `Injector`
22180 * resolve all of the object's dependencies automatically.
22181 *
22182 * @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead.
22183 * @publicApi
22184 */
22185class ReflectiveInjector {
22186    /**
22187     * Turns an array of provider definitions into an array of resolved providers.
22188     *
22189     * A resolution is a process of flattening multiple nested arrays and convert
22189ing individual
22190     * providers into an array of `ResolvedReflectiveProvider`s.
22191     *
22192     * @usageNotes
22193     * ### Example
22194     *
22195     * ```typescript
22196     * @Injectable()
22197     * class Engine {
22198     * }
22199     *
22200     * @Injectable()
22201     * class Car {
22202     *   constructor(public engine:Engine) {}
22203     * }
22204     *
22205     * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);
22206     *
22207     * expect(providers.length).toEqual(2);
22208     *
22209     * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);
22210     * expect(providers[0].key.displayName).toBe("Car");
22211     * expect(providers[0].dependencies.length).toEqual(1);
22212     * expect(providers[0].factory).toBeDefined();
22213     *
22214     * expect(providers[1].key.displayName).toBe("Engine");
22215     * });
22216     * ```
22217     *
22218     */
22219    static resolve(providers) {
22220        return resolveReflectiveProviders(providers);
22221    }
22222    /**
22223     * Resolves an array of providers and creates an injector from those providers.
22224     *
22225     * The passed-in providers can be an array of `Type`, `Provider`,
22226     * or a recursive array of more providers.
22227     *
22228     * @usageNotes
22229     * ### Example
22230     *
22231     * ```typescript
22232     * @Injectable()
22233     * class Engine {
22234     * }
22235     *
22236     * @Injectable()
22237     * class Car {
22238     *   constructor(public engine:Engine) {}
22239     * }
22240     *
22241     * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);
22242     * expect(injector.get(Car) instanceof Car).toBe(true);
22243     * ```
22244     */
22245    static resolveAndCreate(providers, parent) {
22246        const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);
22247        return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);
22248    }
22249    /**
22250     * Creates an injector from previously resolved providers.
22251     *
22252     * This API is the recommended way to construct injectors in performance-sensitive parts.
22253     *
22254     * @usageNotes
22255     * ### Example
22256     *
22257     * ```typescript
22258     * @Injectable()
22259     * class Engine {
22260     * }
22261     *
22262     * @Injectable()
22263     * class Car {
22264     *   constructor(public engine:Engine) {}
22265     * }
22266     *
22267     * var providers = ReflectiveInjector.resolve([Car, Engine]);
22268     * var injector = ReflectiveInjector.fromResolvedProviders(providers);
22269     * expect(injector.get(Car) instanceof Car).toBe(true);
22270     * ```
22271     */
22272    static fromResolvedProviders(providers, parent) {
22273        return new ReflectiveInjector_(providers, parent);
22274    }
22275}
22276class ReflectiveInjector_ {
22277    /**
22278     * Private
22279     */
22280    constructor(_providers, _parent) {
22281        /** @internal */
22282        this._constructionCounter = 0;
22283        this._providers = _providers;
22284        this.parent = _parent || null;
22285        const len = _providers.length;
22286        this.keyIds = [];
22287        this.objs = [];
22288        for (let i = 0; i < len; i++) {
22289            this.keyIds[i] = _providers[i].key.id;
22290            this.objs[i] = UNDEFINED;
22291        }
22292    }
22293    get(token, notFoundValue = THROW_IF_NOT_FOUND) {
22294        return this._getByKey(ReflectiveKey.get(token), null, notFoundValue);
22295    }
22296    resolveAndCreateChild(providers) {
22297        const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);
22298        return this.createChildFromResolved(ResolvedReflectiveProviders);
22299    }
22300    createChildFromResolved(providers) {
22301        const inj = new ReflectiveInjector_(providers);
22302        inj.parent = this;
22303        return inj;
22304    }
22305    resolveAndInstantiate(provider) {
22306        return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]);
22307    }
22308    instantiateResolved(provider) {
22309        return this._instantiateProvider(provider);
22310    }
22311    getProviderAtIndex(index) {
22312        if (index < 0 || index >= this._providers.length) {
22313            throw outOfBoundsError(index);
22314        }
22315        return this._providers[index];
22316    }
22317    /** @internal */
22318    _new(provider) {
22319        if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {
22320            throw cyclicDependencyError(this, provider.key);
22321        }
22322        return this._instantiateProvider(provider);
22323    }
22324    _getMaxNumberOfObjects() {
22325        return this.objs.length;
22326    }
22327    _instantiateProvider(provider) {
22328        if (provider.multiProvider) {
22329            const res = [];
22330            for (let i = 0; i < provider.resolvedFactories.length; ++i) {
22331                res[i] = this._instantiate(provider, provider.resolvedFactories[i]);
22332            }
22333            return res;
22334        }
22335        else {
22336            return this._instantiate(provider, provider.resolvedFactories[0]);
22337        }
22338    }
22339    _instantiate(provider, ResolvedReflectiveFactory) {
22340        const factory = ResolvedReflectiveFactory.factory;
22341        let deps;
22342        try {
22343            deps =
22344                ResolvedReflectiveFactory.dependencies.map(dep => this._getByReflectiveDependency(dep));
22345        }
22346        catch (e) {
22347            if (e.addKey) {
22348                e.addKey(this, provider.key);
22349            }
22350            throw e;
22351        }
22352        let obj;
22353        try {
22354            obj = factory(...deps);
22355        }
22356        catch (e) {
22357            throw instantiationError(this, e, e.stack, provider.key);
22358        }
22359        return obj;
22360    }
22361    _getByReflectiveDependency(dep) {
22362        return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND);
22363    }
22364    _getByKey(key, visibility, notFoundValue) {
22365        if (key === ReflectiveInjector_.INJECTOR_KEY) {
22366            return this;
22367        }
22368        if (visibility instanceof Self) {
22369            return this._getByKeySelf(key, notFoundValue);
22370        }
22371        else {
22372            return this._getByKeyDefault(key, notFoundValue, visibility);
22373        }
22374    }
22375    _getObjByKeyId(keyId) {
22376        for (let i = 0; i < this.keyIds.length; i++) {
22377            if (this.keyIds[i] === keyId) {
22378                if (this.objs[i] === UNDEFINED) {
22379                    this.objs[i] = this._new(this._providers[i]);
22380                }
22381                return this.objs[i];
22382            }
22383        }
22384        return UNDEFINED;
22385    }
22386    /** @internal */
22387    _throwOrNull(key, notFoundValue) {
22388        if (notFoundValue !== THROW_IF_NOT_FOUND) {
22389            return notFoundValue;
22390        }
22391        else {
22392            throw noProviderError(this, key);
22393        }
22394    }
22395    /** @internal */
22396    _getByKeySelf(key, notFoundValue) {
22397        const obj = this._getObjByKeyId(key.id);
22398        return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);
22399    }
22400    /** @internal */
22401    _getByKeyDefault(key, notFoundValue, visibility) {
22402        let inj;
22403        if (visibility instanceof SkipSelf) {
22404            inj = this.parent;
22405        }
22406        else {
22407            inj = this;
22408        }
22409        while (inj instanceof ReflectiveInjector_) {
22410            const inj_ = inj;
22411            const obj = inj_._getObjByKeyId(key.id);
22412            if (obj !== UNDEFINED)
22413                return obj;
22414            inj = inj_.parent;
22415        }
22416        if (inj !== null) {
22417            return inj.get(key.token, notFoundValue);
22418        }
22419        else {
22420            return this._throwOrNull(key, notFoundValue);
22421        }
22422    }
22423    get displayName() {
22424        const providers = _mapProviders(this, (b) => ' "' + b.key.displayName + '" ')
22425            .join(', ');
vendor: 5,573 bytes, lines 22426-22573
22426        return `ReflectiveInjector(providers: [${providers}])`;
22427    }
22428    toString() {
22429        return this.displayName;
22430    }
22431}
22432ReflectiveInjector_.INJECTOR_KEY = ReflectiveKey.get(Injector);
22433function _mapProviders(injector, fn) {
22434    const res = [];
22435    for (let i = 0; i < injector._providers.length; ++i) {
22436        res[i] = fn(injector.getProviderAtIndex(i));
22437    }
22438    return res;
22439}
22440
22441/**
22442 * @license
22443 * Copyright Google LLC All Rights Reserved.
22444 *
22445 * Use of this source code is governed by an MIT-style license that can be
22446 * found in the LICENSE file at https://angular.io/license
22447 */
22448
22449/**
22450 * @license
22451 * Copyright Google LLC All Rights Reserved.
22452 *
22453 * Use of this source code is governed by an MIT-style license that can be
22454 * found in the LICENSE file at https://angular.io/license
22455 */
22456
22457/**
22458 * @license
22459 * Copyright Google LLC All Rights Reserved.
22460 *
22461 * Use of this source code is governed by an MIT-style license that can be
22462 * found in the LICENSE file at https://angular.io/license
22463 */
22464function ɵɵdirectiveInject(token, flags = InjectFlags.Default) {
22465    const lView = getLView();
22466    // Fall back to inject() if view hasn't been created. This situation can happen in tests
22467    // if inject utilities are used before bootstrapping.
22468    if (lView === null) {
22469        // Verify that we will not get into infinite loop.
22470        ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);
22471        return ɵɵinject(token, flags);
22472    }
22473    const tNode = getCurrentTNode();
22474    return getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);
22475}
22476/**
22477 * Throws an error indicating that a factory function could not be generated by the compiler for a
22478 * particular class.
22479 *
22480 * This instruction allows the actual error message to be optimized away when ngDevMode is turned
22481 * off, saving bytes of generated code while still providing a good experience in dev mode.
22482 *
22483 * The name of the class is not mentioned here, but will be in the generated factory function name
22484 * and thus in the stack trace.
22485 *
22486 * @codeGenApi
22487 */
22488function ɵɵinvalidFactory() {
22489    const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';
22490    throw new Error(msg);
22491}
22492
22493/**
22494 * @license
22495 * Copyright Google LLC All Rights Reserved.
22496 *
22497 * Use of this source code is governed by an MIT-style license that can be
22498 * found in the LICENSE file at https://angular.io/license
22499 */
22500/**
22501 * Update a property on a selected element.
22502 *
22503 * Operates on the element selected by index via the {@link select} instruction.
22504 *
22505 * If the property name also exists as an input property on one of the element's directives,
22506 * the component property will be set instead of the element property. This check must
22507 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled
22508 *
22509 * @param propName Name of property. Because it is going to DOM, this is not subject to
22510 *        renaming as part of minification.
22511 * @param value New value to write.
22512 * @param sanitizer An optional function used to sanitize the value.
22513 * @returns This function returns itself so that it may be chained
22514 * (e.g. `property('name', ctx.name)('title', ctx.title)`)
22515 *
22516 * @codeGenApi
22517 */
22518function ɵɵproperty(propName, value, sanitizer) {
22519    const lView = getLView();
22520    const bindingIndex = nextBindingIndex();
22521    if (bindingUpdated(lView, bindingIndex, value)) {
22522        const tView = getTView();
22523        const tNode = getSelectedTNode();
22524        elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);
22525        ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
22526    }
22527    return ɵɵproperty;
22528}
22529/**
22530 * Given `<div style="..." my-dir>` and `MyDir` with `@Input('style')` we need to write to
22531 * directive input.
22532 */
22533function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased) {
22534    const inputs = tNode.inputs;
22535    const property = isClassBased ? 'class' : 'style';
22536    // We support both 'class' and `className` hence the fallback.
22537    setInputsForProperty(tView, lView, inputs[property], property, value);
22538}
22539
22540/**
22541 * @license
22542 * Copyright Google LLC All Rights Reserved.
22543 *
22544 * Use of this source code is governed by an MIT-style license that can be
22545 * found in the LICENSE file at https://angular.io/license
22546 */
22547function elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) {
22548    ngDevMode && assertFirstCreatePass(tView);
22549    ngDevMode && ngDevMode.firstCreatePass++;
22550    const tViewConsts = tView.consts;
22551    const attrs = getConstant(tViewConsts, attrsIndex);
22552    const tNode = getOrCreateTNode(tView, index, 2 /* Element */, name, attrs);
22553    const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
22554    ngDevMode && logUnknownElementError(tView, native, tNode, hasDirectives);
22555    if (tNode.attrs !== null) {
22556        computeStaticStyling(tNode, tNode.attrs, false);
22557    }
22558    if (tNode.mergedAttrs !== null) {
22559        computeStaticStyling(tNode, tNode.mergedAttrs, true);
22560    }
22561    if (tView.queries !== null) {
22562        tView.queries.elementStart(tView, tNode);
22563    }
22564    return tNode;
22565}
22566/**
22567 * Create DOM element. The instruction must later be followed by `elementEnd()` call.
22568 *
22569 * @param index Index of the element in the LView array
22570 * @param name Name of the DOM Node
22571 * @param attrsIndex Index of the element's attributes in the `consts` array.
22572 * @param localRefsIndex Index of the element's local references in the `consts` array.
22573 *
22574 * Attributes and localRefs are passed as an array of strings where elements with an even index
22575 * hold an attribute name and elements with an odd index hold an attribute value, ex.:
22576 * ['id', 'warning5', 'class', 'alert']
22577 *
22578 * @codeGenApi
22579 */
22580function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
22581    const lView = getLView();
22582    const tView = getTView();
22583    const adjustedIndex = HEADER_OFFSET + index;
22584    ngDevMode &&
22585        assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');
22586    ngDevMode && assertIndexInRange(lView, adjustedIndex);
22587    const renderer = lView[RENDERER];
22588    const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace());
22589    const tNode = tView.firstCreatePass ?
22590        elementStartFirstCreatePass(adjustedIndex, tView, lView, native, name, attrsIndex, localRefsIndex) :
22591        tView.data[adjustedIndex];
22592    setCurrentTNode(tNode, true);
22593    const mergedAttrs = tNode.mergedAttrs;
22594    if (mergedAttrs !== null) {
22595        setUpAttributes(renderer, native, mergedAttrs);
22596    }
22597    const classes = tNode.classes;
22598    if (classes !== null) {
22599        writeDirectClass(renderer, native, classes);
22600    }
22601    const styles = tNode.styles;
22602    if (styles !== null) {
22603        writeDirectStyle(renderer, native, styles);
22604    }
22605    if ((tNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {
22606        // In the i18n case, the translation may have removed this element, so only add it if it is not
22607        // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.
22608        appendChild(tView, lView, native, tNode);
22609    }
22610    // any immediate children of a component or template container must be pre-emptively
22611    // monkey-patched with the component view data so that the element can be inspected
22612    // later on using any element discovery utility methods (see `element_discovery.ts`)
22613    if (getElementDepthCount() === 0) {
22614        attachPatchData(native, lView);
22615    }
22616    increaseElementDepthCount();
22617    if (isDirectiveHost(tNode)) {
22618        createDirectivesInstances(tView, lView, tNode);
22619        executeContentQueries(tView, tNode, lView);
22620    }
22621    if (localRefsIndex !== null) {
22622        saveResolvedLocalsInData(lView, tNode);
22623    }
22624}
22625/**
22626 * Mark the end of the element.
22627 *
22628 * @codeGenApi
22629 */
22630function ɵɵelementEnd() {
22631    let currentTNode = getCurrentTNode();
22632    ngDevMode && assertDefined(currentTNode, 'No parent node to close.');
22633    if (isCurrentTNodeParent()) {
22634        setCurrentTNodeAsNotParent();
22635    }
22636    else {
22637        ngDevMode && assertHasParent(getCurrentTNode());
22638        currentTNode = currentTNode.parent;
22639        setCurrentTNode(currentTNode, false);
22640    }
22641    const tNode = currentTNode;
22642    ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);
22643    decreaseElementDepthCount();
22644    const tView = getTView();
22645    if (tView.firstCreatePass) {
22646        registerPostOrderHooks(tView, currentTNode);
22647        if (isContentQueryHost(currentTNode)) {
22648            tView.queries.elementEnd(currentTNode);
22649        }
22650    }
22651    if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {
22652        setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);
22653    }
22654    if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {
22655        setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);
22656    }
22657}
22658/**
22659 * Creates an empty element using {@link elementStart} and {@link elementEnd}
22660 *
22661 * @param index Index of the element in the data array
22662 * @param name Name of the DOM Node
22663 * @param attrsIndex Index of the element's attributes in the `consts` array.
22664 * @param localRefsIndex Index of the element's local references in the `consts` array.
22665 *
22666 * @codeGenApi
22667 */
22668function ɵɵelement(index, name, attrsIndex, localRefsIndex) {
22669    ɵɵelementStart(index, name, attrsIndex, localRefsIndex);
22670    ɵɵelementEnd();
22671}
22672function logUnknownElementError(tView, element, tNode, hasDirectives) {
22673    const schemas = tView.schemas;
22674    // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
22675    // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
22676    // defined as an array (as an empty array in case `schemas` field is not defined) and we should
22677    // execute the check below.
22678    if (schemas === null)
22679        return;
22680    const tagName = tNode.value;
22681    // If the element matches any directive, it's considered as valid.
22682    if (!hasDirectives && tagName !== null) {
22683        // The element is unknown if it's an instance of HTMLUnknownElement or it isn't registered
22684        // as a custom element. Note that unknown elements with a dash in their name won't be instances
22685        // of HTMLUnknownElement in browsers that support web components.
22686        const isUnknown = 
22687        // Note that we can't check for `typeof HTMLUnknownElement === 'function'`,
22688        // because while most browsers return 'function', IE returns 'object'.
22689        (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement &&
22690            element instanceof HTMLUnknownElement) ||
22691            (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
22692                !customElements.get(tagName));
22693        if (isUnknown && !matchingSchemas(tView, tagName)) {
22694            let message = `'${tagName}' is not a known element:\n`;
22695            message += `1. If '${tagName}' is an Angular component, then verify that it is part of this module.\n`;
vendor: 14,059 bytes, lines 22696-22993
22696            if (tagName && tagName.indexOf('-') > -1) {
22697                message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.`;
22698            }
22699            else {
22700                message +=
22701                    `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
22702            }
22703            console.error(formatRuntimeError("304" /* UNKNOWN_ELEMENT */, message));
22704        }
22705    }
22706}
22707
22708/**
22709 * @license
22710 * Copyright Google LLC All Rights Reserved.
22711 *
22712 * Use of this source code is governed by an MIT-style license that can be
22713 * found in the LICENSE file at https://angular.io/license
22714 */
22715function elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, localRefsIndex) {
22716    ngDevMode && ngDevMode.firstCreatePass++;
22717    const tViewConsts = tView.consts;
22718    const attrs = getConstant(tViewConsts, attrsIndex);
22719    const tNode = getOrCreateTNode(tView, index, 8 /* ElementContainer */, 'ng-container', attrs);
22720    // While ng-container doesn't necessarily support styling, we use the style context to identify
22721    // and execute directives on the ng-container.
22722    if (attrs !== null) {
22723        computeStaticStyling(tNode, attrs, true);
22724    }
22725    const localRefs = getConstant(tViewConsts, localRefsIndex);
22726    resolveDirectives(tView, lView, tNode, localRefs);
22727    if (tView.queries !== null) {
22728        tView.queries.elementStart(tView, tNode);
22729    }
22730    return tNode;
22731}
22732/**
22733 * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.
22734 * The instruction must later be followed by `elementContainerEnd()` call.
22735 *
22736 * @param index Index of the element in the LView array
22737 * @param attrsIndex Index of the container attributes in the `consts` array.
22738 * @param localRefsIndex Index of the container's local references in the `consts` array.
22739 *
22740 * Even if this instruction accepts a set of attributes no actual attribute values are propagated to
22741 * the DOM (as a comment node can't have attributes). Attributes are here only for directive
22742 * matching purposes and setting initial inputs of directives.
22743 *
22744 * @codeGenApi
22745 */
22746function ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {
22747    const lView = getLView();
22748    const tView = getTView();
22749    const adjustedIndex = index + HEADER_OFFSET;
22750    ngDevMode && assertIndexInRange(lView, adjustedIndex);
22751    ngDevMode &&
22752        assertEqual(getBindingIndex(), tView.bindingStartIndex, 'element containers should be created before any bindings');
22753    const tNode = tView.firstCreatePass ?
22754        elementContainerStartFirstCreatePass(adjustedIndex, tView, lView, attrsIndex, localRefsIndex) :
22755        tView.data[adjustedIndex];
22756    setCurrentTNode(tNode, true);
22757    ngDevMode && ngDevMode.rendererCreateComment++;
22758    const native = lView[adjustedIndex] =
22759        lView[RENDERER].createComment(ngDevMode ? 'ng-container' : '');
22760    appendChild(tView, lView, native, tNode);
22761    attachPatchData(native, lView);
22762    if (isDirectiveHost(tNode)) {
22763        createDirectivesInstances(tView, lView, tNode);
22764        executeContentQueries(tView, tNode, lView);
22765    }
22766    if (localRefsIndex != null) {
22767        saveResolvedLocalsInData(lView, tNode);
22768    }
22769}
22770/**
22771 * Mark the end of the <ng-container>.
22772 *
22773 * @codeGenApi
22774 */
22775function ɵɵelementContainerEnd() {
22776    let currentTNode = getCurrentTNode();
22777    const tView = getTView();
22778    if (isCurrentTNodeParent()) {
22779        setCurrentTNodeAsNotParent();
22780    }
22781    else {
22782        ngDevMode && assertHasParent(currentTNode);
22783        currentTNode = currentTNode.parent;
22784        setCurrentTNode(currentTNode, false);
22785    }
22786    ngDevMode && assertTNodeType(currentTNode, 8 /* ElementContainer */);
22787    if (tView.firstCreatePass) {
22788        registerPostOrderHooks(tView, currentTNode);
22789        if (isContentQueryHost(currentTNode)) {
22790            tView.queries.elementEnd(currentTNode);
22791        }
22792    }
22793}
22794/**
22795 * Creates an empty logical container using {@link elementContainerStart}
22796 * and {@link elementContainerEnd}
22797 *
22798 * @param index Index of the element in the LView array
22799 * @param attrsIndex Index of the container attributes in the `consts` array.
22800 * @param localRefsIndex Index of the container's local references in the `consts` array.
22801 *
22802 * @codeGenApi
22803 */
22804function ɵɵelementContainer(index, attrsIndex, localRefsIndex) {
22805    ɵɵelementContainerStart(index, attrsIndex, localRefsIndex);
22806    ɵɵelementContainerEnd();
22807}
22808
22809/**
22810 * Returns the current OpaqueViewState instance.
22811 *
22812 * Used in conjunction with the restoreView() instruction to save a snapshot
22813 * of the current view and restore it when listeners are invoked. This allows
22814 * walking the declaration view tree in listeners to get vars from parent views.
22815 *
22816 * @codeGenApi
22817 */
22818function ɵɵgetCurrentView() {
22819    return getLView();
22820}
22821
22822/**
22823 * @license
22824 * Copyright Google LLC All Rights Reserved.
22825 *
22826 * Use of this source code is governed by an MIT-style license that can be
22827 * found in the LICENSE file at https://angular.io/license
22828 */
22829/**
22830 * Determine if the argument is shaped like a Promise
22831 */
22832function isPromise(obj) {
22833    // allow any Promise/A+ compliant thenable.
22834    // It's up to the caller to ensure that obj.then conforms to the spec
22835    return !!obj && typeof obj.then === 'function';
22836}
22837/**
22838 * Determine if the argument is a Subscribable
22839 */
22840function isSubscribable(obj) {
22841    return !!obj && typeof obj.subscribe === 'function';
22842}
22843/**
22844 * Determine if the argument is an Observable
22845 *
22846 * Strictly this tests that the `obj` is `Subscribable`, since `Observable`
22847 * types need additional methods, such as `lift()`. But it is adequate for our
22848 * needs since within the Angular framework code we only ever need to use the
22849 * `subscribe()` method, and RxJS has mechanisms to wrap `Subscribable` objects
22850 * into `Observable` as needed.
22851 */
22852const isObservable = isSubscribable;
22853
22854/**
22855 * @license
22856 * Copyright Google LLC All Rights Reserved.
22857 *
22858 * Use of this source code is governed by an MIT-style license that can be
22859 * found in the LICENSE file at https://angular.io/license
22860 */
22861/**
22862 * Adds an event listener to the current node.
22863 *
22864 * If an output exists on one of the node's directives, it also subscribes to the output
22865 * and saves the subscription for later cleanup.
22866 *
22867 * @param eventName Name of the event
22868 * @param listenerFn The function to be called when event emits
22869 * @param useCapture Whether or not to use capture in event listener
22870 * @param eventTargetResolver Function that returns global target information in case this listener
22871 * should be attached to a global object like window, document or body
22872 *
22873 * @codeGenApi
22874 */
22875function ɵɵlistener(eventName, listenerFn, useCapture = false, eventTargetResolver) {
22876    const lView = getLView();
22877    const tView = getTView();
22878    const tNode = getCurrentTNode();
22879    listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, useCapture, eventTargetResolver);
22880    return ɵɵlistener;
22881}
22882/**
22883 * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.
22884 *
22885 * This instruction is for compatibility purposes and is designed to ensure that a
22886 * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered
22887 * in the component's renderer. Normally all host listeners are evaluated with the
22888 * parent component's renderer, but, in the case of animation @triggers, they need
22889 * to be evaluated with the sub component's renderer (because that's where the
22890 * animation triggers are defined).
22891 *
22892 * Do not use this instruction as a replacement for `listener`. This instruction
22893 * only exists to ensure compatibility with the ViewEngine's host binding behavior.
22894 *
22895 * @param eventName Name of the event
22896 * @param listenerFn The function to be called when event emits
22897 * @param useCapture Whether or not to use capture in event listener
22898 * @param eventTargetResolver Function that returns global target information in case this listener
22899 * should be attached to a global object like window, document or body
22900 *
22901 * @codeGenApi
22902 */
22903function ɵɵsyntheticHostListener(eventName, listenerFn, useCapture = false, eventTargetResolver) {
22904    const tNode = getCurrentTNode();
22905    const lView = getLView();
22906    const tView = getTView();
22907    const currentDef = getCurrentDirectiveDef(tView.data);
22908    const renderer = loadComponentRenderer(currentDef, tNode, lView);
22909    listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, useCapture, eventTargetResolver);
22910    return ɵɵsyntheticHostListener;
22911}
22912/**
22913 * A utility function that checks if a given element has already an event handler registered for an
22914 * event with a specified name. The TView.cleanup data structure is used to find out which events
22915 * are registered for a given element.
22916 */
22917function findExistingListener(tView, lView, eventName, tNodeIdx) {
22918    const tCleanup = tView.cleanup;
22919    if (tCleanup != null) {
22920        for (let i = 0; i < tCleanup.length - 1; i += 2) {
22921            const cleanupEventName = tCleanup[i];
22922            if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIdx) {
22923                // We have found a matching event name on the same node but it might not have been
22924                // registered yet, so we must explicitly verify entries in the LView cleanup data
22925                // structures.
22926                const lCleanup = lView[CLEANUP];
22927                const listenerIdxInLCleanup = tCleanup[i + 2];
22928                return lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;
22929            }
22930            // TView.cleanup can have a mix of 4-elements entries (for event handler cleanups) or
22931            // 2-element entries (for directive and queries destroy hooks). As such we can encounter
22932            // blocks of 4 or 2 items in the tView.cleanup and this is why we iterate over 2 elements
22933            // first and jump another 2 elements if we detect listeners cleanup (4 elements). Also check
22934            // documentation of TView.cleanup for more details of this data structure layout.
22935            if (typeof cleanupEventName === 'string') {
22936                i += 2;
22937            }
22938        }
22939    }
22940    return null;
22941}
22942function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, useCapture = false, eventTargetResolver) {
22943    const isTNodeDirectiveHost = isDirectiveHost(tNode);
22944    const firstCreatePass = tView.firstCreatePass;
22945    const tCleanup = firstCreatePass && getOrCreateTViewCleanup(tView);
22946    const context = lView[CONTEXT];
22947    // When the ɵɵlistener instruction was generated and is executed we know that there is either a
22948    // native listener or a directive output on this element. As such we we know that we will have to
22949    // register a listener and store its cleanup function on LView.
22950    const lCleanup = getOrCreateLViewCleanup(lView);
22951    ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);
22952    let processOutputs = true;
22953    // add native event listener - applicable to elements only
22954    if (tNode.type & 3 /* AnyRNode */) {
22955        const native = getNativeByTNode(tNode, lView);
22956        const resolved = eventTargetResolver ? eventTargetResolver(native) : EMPTY_OBJ;
22957        const target = resolved.target || native;
22958        const lCleanupIndex = lCleanup.length;
22959        const idxOrTargetGetter = eventTargetResolver ?
22960            (_lView) => eventTargetResolver(unwrapRNode(_lView[tNode.index])).target :
22961            tNode.index;
22962        // In order to match current behavior, native DOM event listeners must be added for all
22963        // events (including outputs).
22964        if (isProceduralRenderer(renderer)) {
22965            // There might be cases where multiple directives on the same element try to register an event
22966            // handler function for the same event. In this situation we want to avoid registration of
22967            // several native listeners as each registration would be intercepted by NgZone and
22968            // trigger change detection. This would mean that a single user action would result in several
22969            // change detections being invoked. To avoid this situation we want to have only one call to
22970            // native handler registration (for the same element and same type of event).
22971            //
22972            // In order to have just one native event handler in presence of multiple handler functions,
22973            // we just register a first handler function as a native event listener and then chain
22974            // (coalesce) other handler functions on top of the first native handler function.
22975            let existingListener = null;
22976            // Please note that the coalescing described here doesn't happen for events specifying an
22977            // alternative target (ex. (document:click)) - this is to keep backward compatibility with the
22978            // view engine.
22979            // Also, we don't have to search for existing listeners is there are no directives
22980            // matching on a given node as we can't register multiple event handlers for the same event in
22981            // a template (this would mean having duplicate attributes).
22982            if (!eventTargetResolver && isTNodeDirectiveHost) {
22983                existingListener = findExistingListener(tView, lView, eventName, tNode.index);
22984            }
22985            if (existingListener !== null) {
22986                // Attach a new listener to coalesced listeners list, maintaining the order in which
22987                // listeners are registered. For performance reasons, we keep a reference to the last
22988                // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
22989                // the entire set each time we need to add a new listener.
22990                const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
22991                lastListenerFn.__ngNextListenerFn__ = listenerFn;
22992                existingListener.__ngLastListenerFn__ = listenerFn;
22993                processOutputs = false;
22994            }
22995            else {
22996                // The first argument of `listen` function in Procedural Renderer is:
22997                // - either a target name (as a string) in case of global target (window, document, body)
22998                // - or element reference (in all other cases)
22999                listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
23000                const cleanupFn = renderer.listen(resolved.name || target, eventName, listenerFn);
23001                ngDevMode && ngDevMode.rendererAddEventListener++;
23002                lCleanup.push(listenerFn, cleanupFn);
23003                tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
23004            }
23005        }
23006        else {
23007            listenerFn = wrapListener(tNode, lView, context, listenerFn, true /** preventDefault */);
23008            target.addEventListener(eventName, listenerFn, useCapture);
23009            ngDevMode && ngDevMode.rendererAddEventListener++;
23010            lCleanup.push(listenerFn);
23011            tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, useCapture);
23012        }
23013    }
23014    else {
23015        // Even if there is no native listener to add, we still need to wrap the listener so that OnPush
23016        // ancestors are marked dirty when an event occurs.
23017        listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
23018    }
23019    // subscribe to directive outputs
23020    const outputs = tNode.outputs;
23021    let props;
23022    if (processOutputs && outputs !== null && (props = outputs[eventName])) {
23023        const propsLength = props.length;
23024        if (propsLength) {
23025            for (let i = 0; i < propsLength; i += 2) {
23026                const index = props[i];
23027                ngDevMode && assertIndexInRange(lView, index);
23028                const minifiedName = props[i + 1];
23029                const directiveInstance = lView[index];
23030                const output = directiveInstance[minifiedName];
23031                if (ngDevMode && !isObservable(output)) {
23032                    throw new Error(`@Output ${minifiedName} not initialized in '${directiveInstance.constructor.name}'.`);
23033                }
23034                const subscription = output.subscribe(listenerFn);
23035                const idx = lCleanup.length;
23036                lCleanup.push(listenerFn, subscription);
23037                tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));
23038            }
23039        }
23040    }
23041}
23042function executeListenerWithErrorHandling(lView, context, listenerFn, e) {
23043    try {
23044        profiler(6 /* OutputStart */, context, listenerFn);
23045        // Only explicitly returning false from a listener should preventDefault
23046        return listenerFn(e) !== false;
23047    }
23048    catch (error) {
23049        handleError(lView, error);
23050        return false;
23051    }
23052    finally {
23053        profiler(7 /* OutputEnd */, context, listenerFn);
23054    }
23055}
23056/**
23057 * Wraps an event listener with a function that marks ancestors dirty and prevents default behavior,
23058 * if applicable.
23059 *
23060 * @param tNode The TNode associated with this listener
23061 * @param lView The LView that contains this listener
23062 * @param listenerFn The listener function to call
23063 * @param wrapWithPreventDefault Whether or not to prevent default behavior
23064 * (the procedural renderer does this already, so in those cases, we should skip)
23065 */
23066function wrapListener(tNode, lView, context, listenerFn, wrapWithPreventDefault) {
23067    // Note: we are performing most of the work in the listener function itself
23068    // to optimize listener registration.
23069    return function wrapListenerIn_markDirtyAndPreventDefault(e) {
23070        // Ivy uses `Function` as a special token that allows us to unwrap the function
23071        // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`.
23072        if (e === Function) {
23073            return listenerFn;
23074        }
23075        // In order to be backwards compatible with View Engine, events on component host nodes
23076        // must also mark the component view itself dirty (i.e. the view that it owns).
23077        const startView = tNode.flags & 2 /* isComponentHost */ ?
23078            getComponentLViewByIndex(tNode.index, lView) :
23079            lView;
23080        // See interfaces/view.ts for more on LViewFlags.ManualOnPush
23081        if ((lView[FLAGS] & 32 /* ManualOnPush */) === 0) {
23082            markViewDirty(startView);
23083        }
23084        let result = executeListenerWithErrorHandling(lView, context, listenerFn, e);
23085        // A just-invoked listener function might have coalesced listeners so we need to check for
23086        // their presence and invoke as needed.
23087        let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;
23088        while (nextListenerFn) {
23089            // We should prevent default if any of the listeners explicitly return false
23090            result = executeListenerWithErrorHandling(lView, context, nextListenerFn, e) && result;
23091            nextListenerFn = nextListenerFn.__ngNextListenerFn__;
23092        }
23093        if (wrapWithPreventDefault && result === false) {
23094            e.preventDefault();
23095            // Necessary for legacy browsers that don't support preventDefault (e.g. IE)
23096            e.returnValue = false;
23097        }
23098        return result;
23099    };
23100}
23101
23102/**
23103 * @license
23104 * Copyright Google LLC All Rights Reserved.
23105 *
23106 * Use of this source code is governed by an MIT-style license that can be
23107 * found in the LICENSE file at https://angular.io/license
23108 */
23109
23110/**
23111 * @license
23112 * Copyright Google LLC All Rights Reserved.
23113 *
23114 * Use of this source code is governed by an MIT-style license that can be
23115 * found in the LICENSE file at https://angular.io/license
23116 */
23117/**
23118 * Retrieves a context at the level specified and saves it as the global, contextViewData.
23119 * Will get the next level up if level is not specified.
23120 *
23121 * This is used to save contexts of parent views so they can be bound in embedded views, or
23122 * in conjunction with reference() to bind a ref from a parent view.
23123 *
23124 * @param level The relative level of the view from which to grab context compared to contextVewData
23125 * @returns context
23126 *
23127 * @codeGenApi
23128 */
23129function ɵɵnextContext(level = 1) {
23130    return nextContextImpl(level);
23131}
23132
23133/**
23134 * @license
23135 * Copyright Google LLC All Rights Reserved.
23136 *
23137 * Use of this source code is governed by an MIT-style license that can be
23138 * found in the LICENSE file at https://angular.io/license
23139 */
23140/**
23141 * Checks a given node against matching projection slots and returns the
23142 * determined slot index. Returns "null" if no slot matched the given node.
23143 *
23144 * This function takes into account the parsed ngProjectAs selector from the
23145 * node's attributes. If present, it will check whether the ngProjectAs selector
23146 * matches any of the projection slot selectors.
23147 */
23148function matchingProjectionSlotIndex(tNode, projectionSlots) {
23149    let wildcardNgContentIndex = null;
23150    const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);
23151    for (let i = 0; i < projectionSlots.length; i++) {
23152        const slotValue = projectionSlots[i];
23153        // The last wildcard projection slot should match all nodes which aren't matching
23154        // any selector. This is necessary to be backwards compatible with view engine.
23155        if (slotValue === '*') {
23156            wildcardNgContentIndex = i;
23157            continue;
23158        }
23159        // If we ran into an `ngProjectAs` attribute, we should match its parsed selector
23160        // to the list of selectors, otherwise we fall back to matching against the node.
23161        if (ngProjectAsAttrVal === null ?
23162            isNodeMatchingSelectorList(tNode, slotValue, /* isProjectionMode */ true) :
23163            isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) {
23164            return i; // first matching selector "captures" a given node
23165        }
23166    }
23167    return wildcardNgContentIndex;
23168}
23169/**
23170 * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.
23171 * It takes all the selectors from the entire component's template and decides where
23172 * each projected node belongs (it re-distributes nodes among "buckets" where each "bucket" is
23173 * backed by a selector).
23174 *
23175 * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,
23176 * un-parsed form.
23177 *
23178 * The parsed form is needed for efficient matching of a node against a given CSS selector.
23179 * The un-parsed, textual form is needed for support of the ngProjectAs attribute.
23180 *
23181 * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more
23182 * drawbacks:
23183 * - having only a textual form would require runtime parsing of CSS selectors;
23184 * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a
23185 * template author).
23186 *
23187 * @param projectionSlots? A collection of projection slots. A projection slot can be based
23188 *        on a parsed CSS selectors or set to the wildcard selector ("*") in order to match
23189 *        all nodes which do not match any selector. If not specified, a single wildcard
23190 *        selector projection slot will be defined.
23191 *
23192 * @codeGenApi
23193 */
23194function ɵɵprojectionDef(projectionSlots) {
23195    const componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST];
23196    if (!componentNode.projection) {
23197        // If no explicit projection slots are defined, fall back to a single
23198        // projection slot with the wildcard selector.
23199        const numProjectionSlots = projectionSlots ? projectionSlots.length : 1;
23200        const projectionHeads = componentNode.projection =
23201            newArray(numProjectionSlots, null);
23202        const tails = projectionHeads.slice();
23203        let componentChild = componentNode.child;
23204        while (componentChild !== null) {
23205            const slotIndex = projectionSlots ? matchingProjectionSlotIndex(componentChild, projectionSlots) : 0;
23206            if (slotIndex !== null) {
23207                if (tails[slotIndex]) {
23208                    tails[slotIndex].projectionNext = componentChild;
23209                }
23210                else {
23211                    projectionHeads[slotIndex] = componentChild;
23212                }
23213                tails[slotIndex] = componentChild;
23214            }
23215            componentChild = componentChild.next;
23216        }
23217    }
23218}
23219/**
23220 * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call
23221 * to the projectionDef instruction.
23222 *
23223 * @param nodeIndex
23224 * @param selectorIndex:
23225 *        - 0 when the selector is `*` (or unspecified as this is the default value),
23226 *        - 1 based index of the selector from the {@link projectionDef}
23227 *
23228 * @codeGenApi
23229 */
23230function ɵɵprojection(nodeIndex, selectorIndex = 0, attrs) {
23231    const lView = getLView();
23232    const tView = getTView();
23233    const tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16 /* Projection */, null, attrs || null);
23234    // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.
23235    if (tProjectionNode.projection === null)
23236        tProjectionNode.projection = selectorIndex;
23237    // `<ng-content>` has no content
23238    setCurrentTNodeAsNotParent();
23239    if ((tProjectionNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {
23240        // re-distribution of projectable nodes is stored on a component's view level
23241        applyProjection(tView, lView, tProjectionNode);
23242    }
23243}
23244
23245/**
23246 *
23247 * Update an interpolated property on an element with a lone bound value
23248 *
23249 * Used when the value passed to a property has 1 interpolated value in it, an no additional text
23250 * surrounds that interpolated value:
23251 *
23252 * ```html
23253 * <div title="{{v0}}"></div>
23254 * ```
23255 *
23256 * Its compiled representation is::
23257 *
23258 * ```ts
23259 * ɵɵpropertyInterpolate('title', v0);
23260 * ```
23261 *
23262 * If the property name also exists as an input property on one of the element's directives,
23263 * the component property will be set instead of the element property. This check must
23264 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23265 *
23266 * @param propName The name of the property to update
23267 * @param prefix Static value used for concatenation only.
23268 * @param v0 Value checked for change.
23269 * @param suffix Static value used for concatenation only.
23270 * @param sanitizer An optional sanitizer function
23271 * @returns itself, so that it may be chained.
23272 * @codeGenApi
23273 */
23274function ɵɵpropertyInterpolate(propName, v0, sanitizer) {
23275    ɵɵpropertyInterpolate1(propName, '', v0, '', sanitizer);
23276    return ɵɵpropertyInterpolate;
23277}
23278/**
23279 *
23280 * Update an interpolated property on an element with single bound value surrounded by text.
23281 *
23282 * Used when the value passed to a property has 1 interpolated value in it:
23283 *
23284 * ```html
23285 * <div title="prefix{{v0}}suffix"></div>
23286 * ```
23287 *
23288 * Its compiled representation is::
23289 *
23290 * ```ts
23291 * ɵɵpropertyInterpolate1('title', 'prefix', v0, 'suffix');
23292 * ```
23293 *
23294 * If the property name also exists as an input property on one of the element's directives,
23295 * the component property will be set instead of the element property. This check must
23296 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23297 *
23298 * @param propName The name of the property to update
23299 * @param prefix Static value used for concatenation only.
23300 * @param v0 Value checked for change.
23301 * @param suffix Static value used for concatenation only.
23302 * @param sanitizer An optional sanitizer function
23303 * @returns itself, so that it may be chained.
23304 * @codeGenApi
23305 */
23306function ɵɵpropertyInterpolate1(propName, prefix, v0, suffix, sanitizer) {
23307    const lView = getLView();
23308    const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
23309    if (interpolatedValue !== NO_CHANGE) {
23310        const tView = getTView();
23311        const tNode = getSelectedTNode();
23312        elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
23313        ngDevMode &&
23314            storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 1, prefix, suffix);
23315    }
23316    return ɵɵpropertyInterpolate1;
23317}
23318/**
23319 *
23320 * Update an interpolated property on an element with 2 bound values surrounded by text.
23321 *
23322 * Used when the value passed to a property has 2 interpolated values in it:
23323 *
23324 * ```html
23325 * <div title="prefix{{v0}}-{{v1}}suffix"></div>
23326 * ```
23327 *
23328 * Its compiled representation is::
23329 *
23330 * ```ts
23331 * ɵɵpropertyInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
23332 * ```
23333 *
23334 * If the property name also exists as an input property on one of the element's directives,
23335 * the component property will be set instead of the element property. This check must
23336 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23337 *
23338 * @param propName The name of the property to update
23339 * @param prefix Static value used for concatenation only.
23340 * @param v0 Value checked for change.
23341 * @param i0 Static value used for concatenation only.
23342 * @param v1 Value checked for change.
23343 * @param suffix Static value used for concatenation only.
23344 * @param sanitizer An optional sanitizer function
23345 * @returns itself, so that it may be chained.
23346 * @codeGenApi
23347 */
23348function ɵɵpropertyInterpolate2(propName, prefix, v0, i0, v1, suffix, sanitizer) {
23349    const lView = getLView();
23350    const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
23351    if (interpolatedValue !== NO_CHANGE) {
23352        const tView = getTView();
23353        const tNode = getSelectedTNode();
23354        elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
23355        ngDevMode &&
23356            storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 2, prefix, i0, suffix);
23357    }
23358    return ɵɵpropertyInterpolate2;
23359}
23360/**
23361 *
23362 * Update an interpolated property on an element with 3 bound values surrounded by text.
23363 *
23364 * Used when the value passed to a property has 3 interpolated values in it:
23365 *
23366 * ```html
23367 * <div title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
23368 * ```
23369 *
23370 * Its compiled representation is::
23371 *
23372 * ```ts
23373 * ɵɵpropertyInterpolate3(
23374 * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
23375 * ```
23376 *
23377 * If the property name also exists as an input property on one of the element's directives,
23378 * the component property will be set instead of the element property. This check must
23379 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23380 *
23381 * @param propName The name of the property to update
23382 * @param prefix Static value used for concatenation only.
23383 * @param v0 Value checked for change.
23384 * @param i0 Static value used for concatenation only.
23385 * @param v1 Value checked for change.
23386 * @param i1 Static value used for concatenation only.
23387 * @param v2 Value checked for change.
23388 * @param suffix Static value used for concatenation only.
23389 * @param sanitizer An optional sanitizer function
23390 * @returns itself, so that it may be chained.
23391 * @codeGenApi
23392 */
23393function ɵɵpropertyInterpolate3(propName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer) {
23394    const lView = getLView();
23395    const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
23396    if (interpolatedValue !== NO_CHANGE) {
23397        const tView = getTView();
23398        const tNode = getSelectedTNode();
23399        elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
23400        ngDevMode &&
23401            storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);
23402    }
23403    return ɵɵpropertyInterpolate3;
23404}
23405/**
23406 *
23407 * Update an interpolated property on an element with 4 bound values surrounded by text.
23408 *
23409 * Used when the value passed to a property has 4 interpolated values in it:
23410 *
23411 * ```html
23412 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
23413 * ```
23414 *
23415 * Its compiled representation is::
23416 *
23417 * ```ts
23418 * ɵɵpropertyInterpolate4(
23419 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
23420 * ```
23421 *
23422 * If the property name also exists as an input property on one of the element's directives,
23423 * the component property will be set instead of the element property. This check must
23424 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23425 *
23426 * @param propName The name of the property to update
23427 * @param prefix Static value used for concatenation only.
23428 * @param v0 Value checked for change.
23429 * @param i0 Static value used for concatenation only.
23430 * @param v1 Value checked for change.
23431 * @param i1 Static value used for concatenation only.
23432 * @param v2 Value checked for change.
23433 * @param i2 Static value used for concatenation only.
23434 * @param v3 Value checked for change.
23435 * @param suffix Static value used for concatenation only.
23436 * @param sanitizer An optional sanitizer function
23437 * @returns itself, so that it may be chained.
23438 * @codeGenApi
23439 */
23440function ɵɵpropertyInterpolate4(propName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer) {
23441    const lView = getLView();
23442    const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
23443    if (interpolatedValue !== NO_CHANGE) {
23444        const tView = getTView();
23445        const tNode = getSelectedTNode();
23446        elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
23447        ngDevMode &&
23448            storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
23449    }
23450    return ɵɵpropertyInterpolate4;
23451}
23452/**
23453 *
23454 * Update an interpolated property on an element with 5 bound values surrounded by text.
23455 *
23456 * Used when the value passed to a property has 5 interpolated values in it:
23457 *
23458 * ```html
23459 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
23460 * ```
23461 *
23462 * Its compiled representation is::
23463 *
23464 * ```ts
23465 * ɵɵpropertyInterpolate5(
23466 * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
23467 * ```
23468 *
23469 * If the property name also exists as an input property on one of the element's directives,
23470 * the component property will be set instead of the element property. This check must
23471 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23472 *
23473 * @param propName The name of the property to update
23474 * @param prefix Static value used for concatenation only.
23475 * @param v0 Value checked for change.
23476 * @param i0 Static value used for concatenation only.
23477 * @param v1 Value checked for change.
23478 * @param i1 Static value used for concatenation only.
23479 * @param v2 Value checked for change.
23480 * @param i2 Static value used for concatenation only.
23481 * @param v3 Value checked for change.
23482 * @param i3 Static value used for concatenation only.
23483 * @param v4 Value checked for change.
23484 * @param suffix Static value used for concatenation only.
23485 * @param sanitizer An optional sanitizer function
23486 * @returns itself, so that it may be chained.
23487 * @codeGenApi
23488 */
23489function ɵɵpropertyInterpolate5(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer) {
23490    const lView = getLView();
23491    const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
23492    if (interpolatedValue !== NO_CHANGE) {
23493        const tView = getTView();
23494        const tNode = getSelectedTNode();
23495        elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
23496        ngDevMode &&
23497            storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
23498    }
23499    return ɵɵpropertyInterpolate5;
23500}
23501/**
23502 *
23503 * Update an interpolated property on an element with 6 bound values surrounded by text.
23504 *
23505 * Used when the value passed to a property has 6 interpolated values in it:
23506 *
23507 * ```html
23508 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
23509 * ```
23510 *
23511 * Its compiled representation is::
23512 *
23513 * ```ts
23514 * ɵɵpropertyInterpolate6(
23515 *    'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
23516 * ```
23517 *
23518 * If the property name also exists as an input property on one of the element's directives,
23519 * the component property will be set instead of the element property. This check must
23520 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23521 *
23522 * @param propName The name of the property to update
23523 * @param prefix Static value used for concatenation only.
23524 * @param v0 Value checked for change.
23525 * @param i0 Static value used for concatenation only.
23526 * @param v1 Value checked for change.
23527 * @param i1 Static value used for concatenation only.
23528 * @param v2 Value checked for change.
23529 * @param i2 Static value used for concatenation only.
23530 * @param v3 Value checked for change.
23531 * @param i3 Static value used for concatenation only.
23532 * @param v4 Value checked for change.
23533 * @param i4 Static value used for concatenation only.
23534 * @param v5 Value checked for change.
23535 * @param suffix Static value used for concatenation only.
23536 * @param sanitizer An optional sanitizer function
23537 * @returns itself, so that it may be chained.
23538 * @codeGenApi
23539 */
23540function ɵɵpropertyInterpolate6(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer) {
23541    const lView = getLView();
23542    const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
23543    if (interpolatedValue !== NO_CHANGE) {
23544        const tView = getTView();
23545        const tNode = getSelectedTNode();
23546        elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
23547        ngDevMode &&
23548            storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
23549    }
23550    return ɵɵpropertyInterpolate6;
23551}
23552/**
23553 *
23554 * Update an interpolated property on an element with 7 bound values surrounded by text.
23555 *
23556 * Used when the value passed to a property has 7 interpolated values in it:
23557 *
23558 * ```html
23559 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
23560 * ```
23561 *
23562 * Its compiled representation is::
23563 *
23564 * ```ts
23565 * ɵɵpropertyInterpolate7(
23566 *    'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
23567 * ```
23568 *
23569 * If the property name also exists as an input property on one of the element's directives,
23570 * the component property will be set instead of the element property. This check must
23571 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23572 *
23573 * @param propName The name of the property to update
23574 * @param prefix Static value used for concatenation only.
23575 * @param v0 Value checked for change.
23576 * @param i0 Static value used for concatenation only.
23577 * @param v1 Value checked for change.
23578 * @param i1 Static value used for concatenation only.
23579 * @param v2 Value checked for change.
23580 * @param i2 Static value used for concatenation only.
23581 * @param v3 Value checked for change.
23582 * @param i3 Static value used for concatenation only.
23583 * @param v4 Value checked for change.
23584 * @param i4 Static value used for concatenation only.
23585 * @param v5 Value checked for change.
23586 * @param i5 Static value used for concatenation only.
23587 * @param v6 Value checked for change.
23588 * @param suffix Static value used for concatenation only.
23589 * @param sanitizer An optional sanitizer function
23590 * @returns itself, so that it may be chained.
23591 * @codeGenApi
23592 */
23593function ɵɵpropertyInterpolate7(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer) {
23594    const lView = getLView();
23595    const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
23596    if (interpolatedValue !== NO_CHANGE) {
23597        const tView = getTView();
23598        const tNode = getSelectedTNode();
23599        elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
23600        ngDevMode &&
23601            storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
23602    }
23603    return ɵɵpropertyInterpolate7;
23604}
23605/**
23606 *
23607 * Update an interpolated property on an element with 8 bound values surrounded by text.
23608 *
23609 * Used when the value passed to a property has 8 interpolated values in it:
23610 *
23611 * ```html
23612 * <div title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
23613 * ```
23614 *
23615 * Its compiled representation is::
23616 *
23617 * ```ts
23618 * ɵɵpropertyInterpolate8(
23619 *  'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
23620 * ```
23621 *
23622 * If the property name also exists as an input property on one of the element's directives,
23623 * the component property will be set instead of the element property. This check must
23624 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23625 *
23626 * @param propName The name of the property to update
23627 * @param prefix Static value used for concatenation only.
23628 * @param v0 Value checked for change.
23629 * @param i0 Static value used for concatenation only.
23630 * @param v1 Value checked for change.
23631 * @param i1 Static value used for concatenation only.
23632 * @param v2 Value checked for change.
23633 * @param i2 Static value used for concatenation only.
23634 * @param v3 Value checked for change.
23635 * @param i3 Static value used for concatenation only.
23636 * @param v4 Value checked for change.
23637 * @param i4 Static value used for concatenation only.
23638 * @param v5 Value checked for change.
23639 * @param i5 Static value used for concatenation only.
23640 * @param v6 Value checked for change.
23641 * @param i6 Static value used for concatenation only.
23642 * @param v7 Value checked for change.
23643 * @param suffix Static value used for concatenation only.
23644 * @param sanitizer An optional sanitizer function
23645 * @returns itself, so that it may be chained.
23646 * @codeGenApi
23647 */
23648function ɵɵpropertyInterpolate8(propName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer) {
23649    const lView = getLView();
23650    const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
23651    if (interpolatedValue !== NO_CHANGE) {
23652        const tView = getTView();
23653        const tNode = getSelectedTNode();
23654        elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
23655        ngDevMode &&
23656            storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
23657    }
23658    return ɵɵpropertyInterpolate8;
23659}
23660/**
23661 * Update an interpolated property on an element with 9 or more bound values surrounded by text.
23662 *
23663 * Used when the number of interpolated values exceeds 8.
23664 *
23665 * ```html
23666 * <div
23667 *  title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div>
23668 * ```
23669 *
23670 * Its compiled representation is::
23671 *
23672 * ```ts
23673 * ɵɵpropertyInterpolateV(
23674 *  'title', ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
23675 *  'suffix']);
23676 * ```
23677 *
23678 * If the property name also exists as an input property on one of the element's directives,
23679 * the component property will be set instead of the element property. This check must
23680 * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
23681 *
23682 * @param propName The name of the property to update.
23683 * @param values The collection of values and the strings inbetween those values, beginning with a
23684 * string prefix and ending with a string suffix.
23685 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
23686 * @param sanitizer An optional sanitizer function
23687 * @returns itself, so that it may be chained.
23688 * @codeGenApi
23689 */
23690function ɵɵpropertyInterpolateV(propName, values, sanitizer) {
23691    const lView = getLView();
23692    const interpolatedValue = interpolationV(lView, values);
23693    if (interpolatedValue !== NO_CHANGE) {
23694        const tView = getTView();
23695        const tNode = getSelectedTNode();
23696        elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
23697        if (ngDevMode) {
23698            const interpolationInBetween = [values[0]]; // prefix
23699            for (let i = 2; i < values.length; i += 2) {
23700                interpolationInBetween.push(values[i]);
23701            }
23702            storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween);
23703        }
23704    }
23705    return ɵɵpropertyInterpolateV;
23706}
23707
23708/**
23709 * @license
23710 * Copyright Google LLC All Rights Reserved.
23711 *
23712 * Use of this source code is governed by an MIT-style license that can be
23713 * found in the LICENSE file at https://angular.io/license
23714 */
23715/**
23716 * NOTE: The word `styling` is used interchangeably as style or class styling.
23717 *
23718 * This file contains code to link styling instructions together so that they can be replayed in
23719 * priority order. The file exists because Ivy styling instruction execution order does not match
23720 * that of the priority order. The purpose of this code is to create a linked list so that the
23721 * instructions can be traversed in priority order when computing the styles.
23722 *
23723 * Assume we are dealing with the following code:
23724 * ```
23725 * @Component({
23726 *   template: `
23727 *     <my-cmp [style]=" {color: '#001'} "
23728 *             [style.color]=" #002 "
23729 *             dir-style-color-1
23730 *             dir-style-color-2> `
23731 * })
23732 * class ExampleComponent {
23733 *   static ngComp = ... {
23734 *     ...
23735 *     // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`
23736 *     ɵɵstyleMap({color: '#001'});
23737 *     ɵɵstyleProp('color', '#002');
23738 *     ...
23739 *   }
23740 * }
23741 *
23742 * @Directive({
23743 *   selector: `[dir-style-color-1]',
23744 * })
23745 * class Style1Directive {
23746 *   @HostBinding('style') style = {color: '#005'};
23747 *   @HostBinding('style.color') color = '#006';
23748 *
23749 *   static ngDir = ... {
23750 *     ...
23751 *     // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`
23752 *     ɵɵstyleMap({color: '#005'});
23753 *     ɵɵstyleProp('color', '#006');
23754 *     ...
23755 *   }
23756 * }
23757 *
23758 * @Directive({
23759 *   selector: `[dir-style-color-2]',
23760 * })
23761 * class Style2Directive {
23762 *   @HostBinding('style') style = {color: '#007'};
23763 *   @HostBinding('style.color') color = '#008';
23764 *
23765 *   static ngDir = ... {
23766 *     ...
23767 *     // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`
23768 *     ɵɵstyleMap({color: '#007'});
23769 *     ɵɵstyleProp('color', '#008');
23770 *     ...
23771 *   }
23772 * }
23773 *
23774 * @Directive({
23775 *   selector: `my-cmp',
23776 * })
23777 * class MyComponent {
23778 *   @HostBinding('style') style = {color: '#003'};
23779 *   @HostBinding('style.color') color = '#004';
23780 *
23781 *   static ngComp = ... {
23782 *     ...
23783 *     // Compiler ensures that `ɵɵstyleProp` is after `ɵɵstyleMap`
23784 *     ɵɵstyleMap({color: '#003'});
23785 *     ɵɵstyleProp('color', '#004');
23786 *     ...
23787 *   }
23788 * }
23789 * ```
23790 *
23791 * The Order of instruction execution is:
23792 *
23793 * NOTE: the comment binding location is for illustrative purposes only.
23794 *
23795 * ```
23796 * // Template: (ExampleComponent)
23797 *     ɵɵstyleMap({color: '#001'});   // Binding index: 10
23798 *     ɵɵstyleProp('color', '#002');  // Binding index: 12
23799 * // MyComponent
23800 *     ɵɵstyleMap({color: '#003'});   // Binding index: 20
23801 *     ɵɵstyleProp('color', '#004');  // Binding index: 22
23802 * // Style1Directive
23803 *     ɵɵstyleMap({color: '#005'});   // Binding index: 24
23804 *     ɵɵstyleProp('color', '#006');  // Binding index: 26
23805 * // Style2Directive
23806 *     ɵɵstyleMap({color: '#007'});   // Binding index: 28
23807 *     ɵɵstyleProp('color', '#008');  // Binding index: 30
23808 * ```
23809 *
23810 * The correct priority order of concatenation is:
23811 *
23812 * ```
23813 * // MyComponent
23814 *     ɵɵstyleMap({color: '#003'});   // Binding index: 20
23815 *     ɵɵstyleProp('color', '#004');  // Binding index: 22
23816 * // Style1Directive
23817 *     ɵɵstyleMap({color: '#005'});   // Binding index: 24
23818 *     ɵɵstyleProp('color', '#006');  // Binding index: 26
23819 * // Style2Directive
23820 *     ɵɵstyleMap({color: '#007'});   // Binding index: 28
23821 *     ɵɵstyleProp('color', '#008');  // Binding index: 30
23822 * // Template: (ExampleComponent)
23823 *     ɵɵstyleMap({color: '#001'});   // Binding index: 10
23824 *     ɵɵstyleProp('color', '#002');  // Binding index: 12
23825 * ```
23826 *
23827 * What color should be rendered?
23828 *
23829 * Once the items are correctly sorted in the list, the answer is simply the last item in the
23830 * concatenation list which is `#002`.
23831 *
23832 * To do so we keep a linked list of all of the bindings which pertain to this element.
23833 * Notice that the bindings are inserted in the order of execution, but the `TView.data` allows
23834 * us to traverse them in the order of priority.
23835 *
23836 * |Idx|`TView.data`|`LView`          | Notes
23837 * |---|------------|-----------------|--------------
23838 * |...|            |                 |
23839 * |10 |`null`      |`{color: '#001'}`| `ɵɵstyleMap('color', {color: '#001'})`
23840 * |11 |`30 | 12`   | ...             |
23841 * |12 |`color`     |`'#002'`         | `ɵɵstyleProp('color', '#002')`
23842 * |13 |`10 | 0`    | ...             |
23843 * |...|            |                 |
23844 * |20 |`null`      |`{color: '#003'}`| `ɵɵstyleMap('color', {color: '#003'})`
23845 * |21 |`0 | 22`    | ...             |
23846 * |22 |`color`     |`'#004'`         | `ɵɵstyleProp('color', '#004')`
23847 * |23 |`20 | 24`   | ...             |
23848 * |24 |`null`      |`{color: '#005'}`| `ɵɵstyleMap('color', {color: '#005'})`
23849 * |25 |`22 | 26`   | ...             |
23850 * |26 |`color`     |`'#006'`         | `ɵɵstyleProp('color', '#006')`
23851 * |27 |`24 | 28`   | ...             |
23852 * |28 |`null`      |`{color: '#007'}`| `ɵɵstyleMap('color', {color: '#007'})`
23853 * |29 |`26 | 30`   | ...             |
23854 * |30 |`color`     |`'#008'`         | `ɵɵstyleProp('color', '#008')`
23855 * |31 |`28 | 10`   | ...             |
23856 *
23857 * The above data structure allows us to re-concatenate the styling no matter which data binding
23858 * changes.
23859 *
23860 * NOTE: in addition to keeping track of next/previous index the `TView.data` also stores prev/next
23861 * duplicate bit. The duplicate bit if true says there either is a binding with the same name or
23862 * there is a map (which may contain the name). This information is useful in knowing if other
23863 * styles with higher priority need to be searched for overwrites.
23864 *
23865 * NOTE: See `should support example in 'tnode_linked_list.ts' documentation` in
23866 * `tnode_linked_list_spec.ts` for working example.
23867 */
23868let __unused_const_as_closure_does_not_like_standalone_comment_blocks__;
23869/**
23870 * Insert new `tStyleValue` at `TData` and link existing style bindings such that we maintain linked
23871 * list of styles and compute the duplicate flag.
23872 *
23873 * Note: this function is executed during `firstUpdatePass` only to populate the `TView.data`.
23874 *
23875 * The function works by keeping track of `tStylingRange` which contains two pointers pointing to
23876 * the head/tail of the template portion of the styles.
23877 *  - if `isHost === false` (we are template) then insertion is at tail of `TStylingRange`
23878 *  - if `isHost === true` (we are host binding) then insertion is at head of `TStylingRange`
23879 *
23880 * @param tData The `TData` to insert into.
23881 * @param tNode `TNode` associated with the styling element.
23882 * @param tStylingKey See `TStylingKey`.
23883 * @param index location of where `tStyleValue` should be stored (and linked into list.)
23884 * @param isHostBinding `true` if the insertion is for a `hostBinding`. (insertion is in front of
23885 *               template.)
23886 * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.
23887 *                       `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)
23888 */
23889function insertTStylingBinding(tData, tNode, tStylingKeyWithStatic, index, isHostBinding, isClassBinding) {
23890    ngDevMode && assertFirstUpdatePass(getTView());
23891    let tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings;
23892    let tmplHead = getTStylingRangePrev(tBindings);
23893    let tmplTail = getTStylingRangeNext(tBindings);
23894    tData[index] = tStylingKeyWithStatic;
23895    let isKeyDuplicateOfStatic = false;
vendor: 15,508 bytes, lines 23896-24278
23896    let tStylingKey;
23897    if (Array.isArray(tStylingKeyWithStatic)) {
23898        // We are case when the `TStylingKey` contains static fields as well.
23899        const staticKeyValueArray = tStylingKeyWithStatic;
23900        tStylingKey = staticKeyValueArray[1]; // unwrap.
23901        // We need to check if our key is present in the static so that we can mark it as duplicate.
23902        if (tStylingKey === null ||
23903            keyValueArrayIndexOf(staticKeyValueArray, tStylingKey) > 0) {
23904            // tStylingKey is present in the statics, need to mark it as duplicate.
23905            isKeyDuplicateOfStatic = true;
23906        }
23907    }
23908    else {
23909        tStylingKey = tStylingKeyWithStatic;
23910    }
23911    if (isHostBinding) {
23912        // We are inserting host bindings
23913        // If we don't have template bindings then `tail` is 0.
23914        const hasTemplateBindings = tmplTail !== 0;
23915        // This is important to know because that means that the `head` can't point to the first
23916        // template bindings (there are none.) Instead the head points to the tail of the template.
23917        if (hasTemplateBindings) {
23918            // template head's "prev" will point to last host binding or to 0 if no host bindings yet
23919            const previousNode = getTStylingRangePrev(tData[tmplHead + 1]);
23920            tData[index + 1] = toTStylingRange(previousNode, tmplHead);
23921            // if a host binding has already been registered, we need to update the next of that host
23922            // binding to point to this one
23923            if (previousNode !== 0) {
23924                // We need to update the template-tail value to point to us.
23925                tData[previousNode + 1] =
23926                    setTStylingRangeNext(tData[previousNode + 1], index);
23927            }
23928            // The "previous" of the template binding head should point to this host binding
23929            tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1], index);
23930        }
23931        else {
23932            tData[index + 1] = toTStylingRange(tmplHead, 0);
23933            // if a host binding has already been registered, we need to update the next of that host
23934            // binding to point to this one
23935            if (tmplHead !== 0) {
23936                // We need to update the template-tail value to point to us.
23937                tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1], index);
23938            }
23939            // if we don't have template, the head points to template-tail, and needs to be advanced.
23940            tmplHead = index;
23941        }
23942    }
23943    else {
23944        // We are inserting in template section.
23945        // We need to set this binding's "previous" to the current template tail
23946        tData[index + 1] = toTStylingRange(tmplTail, 0);
23947        ngDevMode &&
23948            assertEqual(tmplHead !== 0 && tmplTail === 0, false, 'Adding template bindings after hostBindings is not allowed.');
23949        if (tmplHead === 0) {
23950            tmplHead = index;
23951        }
23952        else {
23953            // We need to update the previous value "next" to point to this binding
23954            tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1], index);
23955        }
23956        tmplTail = index;
23957    }
23958    // Now we need to update / compute the duplicates.
23959    // Starting with our location search towards head (least priority)
23960    if (isKeyDuplicateOfStatic) {
23961        tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1]);
23962    }
23963    markDuplicates(tData, tStylingKey, index, true, isClassBinding);
23964    markDuplicates(tData, tStylingKey, index, false, isClassBinding);
23965    markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding);
23966    tBindings = toTStylingRange(tmplHead, tmplTail);
23967    if (isClassBinding) {
23968        tNode.classBindings = tBindings;
23969    }
23970    else {
23971        tNode.styleBindings = tBindings;
23972    }
23973}
23974/**
23975 * Look into the residual styling to see if the current `tStylingKey` is duplicate of residual.
23976 *
23977 * @param tNode `TNode` where the residual is stored.
23978 * @param tStylingKey `TStylingKey` to store.
23979 * @param tData `TData` associated with the current `LView`.
23980 * @param index location of where `tStyleValue` should be stored (and linked into list.)
23981 * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.
23982 *                       `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)
23983 */
23984function markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding) {
23985    const residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles;
23986    if (residual != null /* or undefined */ && typeof tStylingKey == 'string' &&
23987        keyValueArrayIndexOf(residual, tStylingKey) >= 0) {
23988        // We have duplicate in the residual so mark ourselves as duplicate.
23989        tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1]);
23990    }
23991}
23992/**
23993 * Marks `TStyleValue`s as duplicates if another style binding in the list has the same
23994 * `TStyleValue`.
23995 *
23996 * NOTE: this function is intended to be called twice once with `isPrevDir` set to `true` and once
23997 * with it set to `false` to search both the previous as well as next items in the list.
23998 *
23999 * No duplicate case
24000 * ```
24001 *   [style.color]
24002 *   [style.width.px] <<- index
24003 *   [style.height.px]
24004 * ```
24005 *
24006 * In the above case adding `[style.width.px]` to the existing `[style.color]` produces no
24007 * duplicates because `width` is not found in any other part of the linked list.
24008 *
24009 * Duplicate case
24010 * ```
24011 *   [style.color]
24012 *   [style.width.em]
24013 *   [style.width.px] <<- index
24014 * ```
24015 * In the above case adding `[style.width.px]` will produce a duplicate with `[style.width.em]`
24016 * because `width` is found in the chain.
24017 *
24018 * Map case 1
24019 * ```
24020 *   [style.width.px]
24021 *   [style.color]
24022 *   [style]  <<- index
24023 * ```
24024 * In the above case adding `[style]` will produce a duplicate with any other bindings because
24025 * `[style]` is a Map and as such is fully dynamic and could produce `color` or `width`.
24026 *
24027 * Map case 2
24028 * ```
24029 *   [style]
24030 *   [style.width.px]
24031 *   [style.color]  <<- index
24032 * ```
24033 * In the above case adding `[style.color]` will produce a duplicate because there is already a
24034 * `[style]` binding which is a Map and as such is fully dynamic and could produce `color` or
24035 * `width`.
24036 *
24037 * NOTE: Once `[style]` (Map) is added into the system all things are mapped as duplicates.
24038 * NOTE: We use `style` as example, but same logic is applied to `class`es as well.
24039 *
24040 * @param tData `TData` where the linked list is stored.
24041 * @param tStylingKey `TStylingKeyPrimitive` which contains the value to compare to other keys in
24042 *        the linked list.
24043 * @param index Starting location in the linked list to search from
24044 * @param isPrevDir Direction.
24045 *        - `true` for previous (lower priority);
24046 *        - `false` for next (higher priority).
24047 */
24048function markDuplicates(tData, tStylingKey, index, isPrevDir, isClassBinding) {
24049    const tStylingAtIndex = tData[index + 1];
24050    const isMap = tStylingKey === null;
24051    let cursor = isPrevDir ? getTStylingRangePrev(tStylingAtIndex) : getTStylingRangeNext(tStylingAtIndex);
24052    let foundDuplicate = false;
24053    // We keep iterating as long as we have a cursor
24054    // AND either:
24055    // - we found what we are looking for, OR
24056    // - we are a map in which case we have to continue searching even after we find what we were
24057    //   looking for since we are a wild card and everything needs to be flipped to duplicate.
24058    while (cursor !== 0 && (foundDuplicate === false || isMap)) {
24059        ngDevMode && assertIndexInRange(tData, cursor);
24060        const tStylingValueAtCursor = tData[cursor];
24061        const tStyleRangeAtCursor = tData[cursor + 1];
24062        if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) {
24063            foundDuplicate = true;
24064            tData[cursor + 1] = isPrevDir ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor) :
24065                setTStylingRangePrevDuplicate(tStyleRangeAtCursor);
24066        }
24067        cursor = isPrevDir ? getTStylingRangePrev(tStyleRangeAtCursor) :
24068            getTStylingRangeNext(tStyleRangeAtCursor);
24069    }
24070    if (foundDuplicate) {
24071        // if we found a duplicate, than mark ourselves.
24072        tData[index + 1] = isPrevDir ? setTStylingRangePrevDuplicate(tStylingAtIndex) :
24073            setTStylingRangeNextDuplicate(tStylingAtIndex);
24074    }
24075}
24076/**
24077 * Determines if two `TStylingKey`s are a match.
24078 *
24079 * When computing whether a binding contains a duplicate, we need to compare if the instruction
24080 * `TStylingKey` has a match.
24081 *
24082 * Here are examples of `TStylingKey`s which match given `tStylingKeyCursor` is:
24083 * - `color`
24084 *    - `color`    // Match another color
24085 *    - `null`     // That means that `tStylingKey` is a `classMap`/`styleMap` instruction
24086 *    - `['', 'color', 'other', true]` // wrapped `color` so match
24087 *    - `['', null, 'other', true]`       // wrapped `null` so match
24088 *    - `['', 'width', 'color', 'value']` // wrapped static value contains a match on `'color'`
24089 * - `null`       // `tStylingKeyCursor` always match as it is `classMap`/`styleMap` instruction
24090 *
24091 * @param tStylingKeyCursor
24092 * @param tStylingKey
24093 */
24094function isStylingMatch(tStylingKeyCursor, tStylingKey) {
24095    ngDevMode &&
24096        assertNotEqual(Array.isArray(tStylingKey), true, 'Expected that \'tStylingKey\' has been unwrapped');
24097    if (tStylingKeyCursor === null || // If the cursor is `null` it means that we have map at that
24098        // location so we must assume that we have a match.
24099        tStylingKey == null || // If `tStylingKey` is `null` then it is a map therefor assume that it
24100        // contains a match.
24101        (Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) ===
24102            tStylingKey // If the keys match explicitly than we are a match.
24103    ) {
24104        return true;
24105    }
24106    else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === 'string') {
24107        // if we did not find a match, but `tStylingKeyCursor` is `KeyValueArray` that means cursor has
24108        // statics and we need to check those as well.
24109        return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >=
24110            0; // see if we are matching the key
24111    }
24112    return false;
24113}
24114
24115/**
24116 * @license
24117 * Copyright Google LLC All Rights Reserved.
24118 *
24119 * Use of this source code is governed by an MIT-style license that can be
24120 * found in the LICENSE file at https://angular.io/license
24121 */
24122// Global state of the parser. (This makes parser non-reentrant, but that is not an issue)
24123const parserState = {
24124    textEnd: 0,
24125    key: 0,
24126    keyEnd: 0,
24127    value: 0,
24128    valueEnd: 0,
24129};
24130/**
24131 * Retrieves the last parsed `key` of style.
24132 * @param text the text to substring the key from.
24133 */
24134function getLastParsedKey(text) {
24135    return text.substring(parserState.key, parserState.keyEnd);
24136}
24137/**
24138 * Retrieves the last parsed `value` of style.
24139 * @param text the text to substring the key from.
24140 */
24141function getLastParsedValue(text) {
24142    return text.substring(parserState.value, parserState.valueEnd);
24143}
24144/**
24145 * Initializes `className` string for parsing and parses the first token.
24146 *
24147 * This function is intended to be used in this format:
24148 * ```
24149 * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {
24150 *   const key = getLastParsedKey();
24151 *   ...
24152 * }
24153 * ```
24154 * @param text `className` to parse
24155 * @returns index where the next invocation of `parseClassNameNext` should resume.
24156 */
24157function parseClassName(text) {
24158    resetParserState(text);
24159    return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));
24160}
24161/**
24162 * Parses next `className` token.
24163 *
24164 * This function is intended to be used in this format:
24165 * ```
24166 * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {
24167 *   const key = getLastParsedKey();
24168 *   ...
24169 * }
24170 * ```
24171 *
24172 * @param text `className` to parse
24173 * @param index where the parsing should resume.
24174 * @returns index where the next invocation of `parseClassNameNext` should resume.
24175 */
24176function parseClassNameNext(text, index) {
24177    const end = parserState.textEnd;
24178    if (end === index) {
24179        return -1;
24180    }
24181    index = parserState.keyEnd = consumeClassToken(text, parserState.key = index, end);
24182    return consumeWhitespace(text, index, end);
24183}
24184/**
24185 * Initializes `cssText` string for parsing and parses the first key/values.
24186 *
24187 * This function is intended to be used in this format:
24188 * ```
24189 * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {
24190 *   const key = getLastParsedKey();
24191 *   const value = getLastParsedValue();
24192 *   ...
24193 * }
24194 * ```
24195 * @param text `cssText` to parse
24196 * @returns index where the next invocation of `parseStyleNext` should resume.
24197 */
24198function parseStyle(text) {
24199    resetParserState(text);
24200    return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));
24201}
24202/**
24203 * Parses the next `cssText` key/values.
24204 *
24205 * This function is intended to be used in this format:
24206 * ```
24207 * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {
24208 *   const key = getLastParsedKey();
24209 *   const value = getLastParsedValue();
24210 *   ...
24211 * }
24212 *
24213 * @param text `cssText` to parse
24214 * @param index where the parsing should resume.
24215 * @returns index where the next invocation of `parseStyleNext` should resume.
24216 */
24217function parseStyleNext(text, startIndex) {
24218    const end = parserState.textEnd;
24219    let index = parserState.key = consumeWhitespace(text, startIndex, end);
24220    if (end === index) {
24221        // we reached an end so just quit
24222        return -1;
24223    }
24224    index = parserState.keyEnd = consumeStyleKey(text, index, end);
24225    index = consumeSeparator(text, index, end, 58 /* COLON */);
24226    index = parserState.value = consumeWhitespace(text, index, end);
24227    index = parserState.valueEnd = consumeStyleValue(text, index, end);
24228    return consumeSeparator(text, index, end, 59 /* SEMI_COLON */);
24229}
24230/**
24231 * Reset the global state of the styling parser.
24232 * @param text The styling text to parse.
24233 */
24234function resetParserState(text) {
24235    parserState.key = 0;
24236    parserState.keyEnd = 0;
24237    parserState.value = 0;
24238    parserState.valueEnd = 0;
24239    parserState.textEnd = text.length;
24240}
24241/**
24242 * Returns index of next non-whitespace character.
24243 *
24244 * @param text Text to scan
24245 * @param startIndex Starting index of character where the scan should start.
24246 * @param endIndex Ending index of character where the scan should end.
24247 * @returns Index of next non-whitespace character (May be the same as `start` if no whitespace at
24248 *          that location.)
24249 */
24250function consumeWhitespace(text, startIndex, endIndex) {
24251    while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32 /* SPACE */) {
24252        startIndex++;
24253    }
24254    return startIndex;
24255}
24256/**
24257 * Returns index of last char in class token.
24258 *
24259 * @param text Text to scan
24260 * @param startIndex Starting index of character where the scan should start.
24261 * @param endIndex Ending index of character where the scan should end.
24262 * @returns Index after last char in class token.
24263 */
24264function consumeClassToken(text, startIndex, endIndex) {
24265    while (startIndex < endIndex && text.charCodeAt(startIndex) > 32 /* SPACE */) {
24266        startIndex++;
24267    }
24268    return startIndex;
24269}
24270/**
24271 * Consumes all of the characters belonging to style key and token.
24272 *
24273 * @param text Text to scan
24274 * @param startIndex Starting index of character where the scan should start.
24275 * @param endIndex Ending index of character where the scan should end.
24276 * @returns Index after last style key character.
24277 */
24278function consumeStyleKey(text, startIndex, endIndex) {
24279    let ch;
24280    while (startIndex < endIndex &&
24281        ((ch = text.charCodeAt(startIndex)) === 45 /* DASH */ || ch === 95 /* UNDERSCORE */ ||
24282            ((ch & -33 /* UPPER_CASE */) >= 65 /* A */ && (ch & -33 /* UPPER_CASE */) <= 90 /* Z */) ||
24283            (ch >= 48 /* ZERO */ && ch <= 57 /* NINE */))) {
24284        startIndex++;
24285    }
24286    return startIndex;
24287}
24288/**
24289 * Consumes all whitespace and the separator `:` after the style key.
24290 *
24291 * @param text Text to scan
24292 * @param startIndex Starting index of character where the scan should start.
24293 * @param endIndex Ending index of character where the scan should end.
24294 * @returns Index after separator and surrounding whitespace.
24295 */
24296function consumeSeparator(text, startIndex, endIndex, separator) {
24297    startIndex = consumeWhitespace(text, startIndex, endIndex);
24298    if (startIndex < endIndex) {
24299        if (ngDevMode && text.charCodeAt(startIndex) !== separator) {
24300            malformedStyleError(text, String.fromCharCode(separator), startIndex);
24301        }
24302        startIndex++;
24303    }
24304    return startIndex;
24305}
24306/**
24307 * Consumes style value honoring `url()` and `""` text.
24308 *
24309 * @param text Text to scan
24310 * @param startIndex Starting index of character where the scan should start.
24311 * @param endIndex Ending index of character where the scan should end.
24312 * @returns Index after last style value character.
24313 */
24314function consumeStyleValue(text, startIndex, endIndex) {
vendor: 18,390 bytes, lines 24315-24685
24315    let ch1 = -1; // 1st previous character
24316    let ch2 = -1; // 2nd previous character
24317    let ch3 = -1; // 3rd previous character
24318    let i = startIndex;
24319    let lastChIndex = i;
24320    while (i < endIndex) {
24321        const ch = text.charCodeAt(i++);
24322        if (ch === 59 /* SEMI_COLON */) {
24323            return lastChIndex;
24324        }
24325        else if (ch === 34 /* DOUBLE_QUOTE */ || ch === 39 /* SINGLE_QUOTE */) {
24326            lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);
24327        }
24328        else if (startIndex ===
24329            i - 4 && // We have seen only 4 characters so far "URL(" (Ignore "foo_URL()")
24330            ch3 === 85 /* U */ &&
24331            ch2 === 82 /* R */ && ch1 === 76 /* L */ && ch === 40 /* OPEN_PAREN */) {
24332            lastChIndex = i = consumeQuotedText(text, 41 /* CLOSE_PAREN */, i, endIndex);
24333        }
24334        else if (ch > 32 /* SPACE */) {
24335            // if we have a non-whitespace character then capture its location
24336            lastChIndex = i;
24337        }
24338        ch3 = ch2;
24339        ch2 = ch1;
24340        ch1 = ch & -33 /* UPPER_CASE */;
24341    }
24342    return lastChIndex;
24343}
24344/**
24345 * Consumes all of the quoted characters.
24346 *
24347 * @param text Text to scan
24348 * @param quoteCharCode CharCode of either `"` or `'` quote or `)` for `url(...)`.
24349 * @param startIndex Starting index of character where the scan should start.
24350 * @param endIndex Ending index of character where the scan should end.
24351 * @returns Index after quoted characters.
24352 */
24353function consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {
24354    let ch1 = -1; // 1st previous character
24355    let index = startIndex;
24356    while (index < endIndex) {
24357        const ch = text.charCodeAt(index++);
24358        if (ch == quoteCharCode && ch1 !== 92 /* BACK_SLASH */) {
24359            return index;
24360        }
24361        if (ch == 92 /* BACK_SLASH */ && ch1 === 92 /* BACK_SLASH */) {
24362            // two back slashes cancel each other out. For example `"\\"` should properly end the
24363            // quotation. (It should not assume that the last `"` is escaped.)
24364            ch1 = 0;
24365        }
24366        else {
24367            ch1 = ch;
24368        }
24369    }
24370    throw ngDevMode ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex) :
24371        new Error();
24372}
24373function malformedStyleError(text, expecting, index) {
24374    ngDevMode && assertEqual(typeof text === 'string', true, 'String expected here');
24375    throw throwError(`Malformed style at location ${index} in string '` + text.substring(0, index) + '[>>' +
24376        text.substring(index, index + 1) + '<<]' + text.substr(index + 1) +
24377        `'. Expecting '${expecting}'.`);
24378}
24379
24380/**
24381 * @license
24382 * Copyright Google LLC All Rights Reserved.
24383 *
24384 * Use of this source code is governed by an MIT-style license that can be
24385 * found in the LICENSE file at https://angular.io/license
24386 */
24387/**
24388 * Update a style binding on an element with the provided value.
24389 *
24390 * If the style value is falsy then it will be removed from the element
24391 * (or assigned a different value depending if there are any styles placed
24392 * on the element with `styleMap` or any static styles that are
24393 * present from when the element was created with `styling`).
24394 *
24395 * Note that the styling element is updated as part of `stylingApply`.
24396 *
24397 * @param prop A valid CSS property.
24398 * @param value New value to write (`null` or an empty string to remove).
24399 * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.
24400 *
24401 * Note that this will apply the provided style value to the host element if this function is called
24402 * within a host binding function.
24403 *
24404 * @codeGenApi
24405 */
24406function ɵɵstyleProp(prop, value, suffix) {
24407    checkStylingProperty(prop, value, suffix, false);
24408    return ɵɵstyleProp;
24409}
24410/**
24411 * Update a class binding on an element with the provided value.
24412 *
24413 * This instruction is meant to handle the `[class.foo]="exp"` case and,
24414 * therefore, the class binding itself must already be allocated using
24415 * `styling` within the creation block.
24416 *
24417 * @param prop A valid CSS class (only one).
24418 * @param value A true/false value which will turn the class on or off.
24419 *
24420 * Note that this will apply the provided class value to the host element if this function
24421 * is called within a host binding function.
24422 *
24423 * @codeGenApi
24424 */
24425function ɵɵclassProp(className, value) {
24426    checkStylingProperty(className, value, null, true);
24427    return ɵɵclassProp;
24428}
24429/**
24430 * Update style bindings using an object literal on an element.
24431 *
24432 * This instruction is meant to apply styling via the `[style]="exp"` template bindings.
24433 * When styles are applied to the element they will then be updated with respect to
24434 * any styles/classes set via `styleProp`. If any styles are set to falsy
24435 * then they will be removed from the element.
24436 *
24437 * Note that the styling instruction will not be applied until `stylingApply` is called.
24438 *
24439 * @param styles A key/value style map of the styles that will be applied to the given element.
24440 *        Any missing styles (that have already been applied to the element beforehand) will be
24441 *        removed (unset) from the element's styling.
24442 *
24443 * Note that this will apply the provided styleMap value to the host element if this function
24444 * is called within a host binding.
24445 *
24446 * @codeGenApi
24447 */
24448function ɵɵstyleMap(styles) {
24449    checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);
24450}
24451/**
24452 * Parse text as style and add values to KeyValueArray.
24453 *
24454 * This code is pulled out to a separate function so that it can be tree shaken away if it is not
24455 * needed. It is only referenced from `ɵɵstyleMap`.
24456 *
24457 * @param keyValueArray KeyValueArray to add parsed values to.
24458 * @param text text to parse.
24459 */
24460function styleStringParser(keyValueArray, text) {
24461    for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) {
24462        styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));
24463    }
24464}
24465/**
24466 * Update class bindings using an object literal or class-string on an element.
24467 *
24468 * This instruction is meant to apply styling via the `[class]="exp"` template bindings.
24469 * When classes are applied to the element they will then be updated with
24470 * respect to any styles/classes set via `classProp`. If any
24471 * classes are set to falsy then they will be removed from the element.
24472 *
24473 * Note that the styling instruction will not be applied until `stylingApply` is called.
24474 * Note that this will the provided classMap value to the host element if this function is called
24475 * within a host binding.
24476 *
24477 * @param classes A key/value map or string of CSS classes that will be added to the
24478 *        given element. Any missing classes (that have already been applied to the element
24479 *        beforehand) will be removed (unset) from the element's list of CSS classes.
24480 *
24481 * @codeGenApi
24482 */
24483function ɵɵclassMap(classes) {
24484    checkStylingMap(keyValueArraySet, classStringParser, classes, true);
24485}
24486/**
24487 * Parse text as class and add values to KeyValueArray.
24488 *
24489 * This code is pulled out to a separate function so that it can be tree shaken away if it is not
24490 * needed. It is only referenced from `ɵɵclassMap`.
24491 *
24492 * @param keyValueArray KeyValueArray to add parsed values to.
24493 * @param text text to parse.
24494 */
24495function classStringParser(keyValueArray, text) {
24496    for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {
24497        keyValueArraySet(keyValueArray, getLastParsedKey(text), true);
24498    }
24499}
24500/**
24501 * Common code between `ɵɵclassProp` and `ɵɵstyleProp`.
24502 *
24503 * @param prop property name.
24504 * @param value binding value.
24505 * @param suffix suffix for the property (e.g. `em` or `px`)
24506 * @param isClassBased `true` if `class` change (`false` if `style`)
24507 */
24508function checkStylingProperty(prop, value, suffix, isClassBased) {
24509    const lView = getLView();
24510    const tView = getTView();
24511    // Styling instructions use 2 slots per binding.
24512    // 1. one for the value / TStylingKey
24513    // 2. one for the intermittent-value / TStylingRange
24514    const bindingIndex = incrementBindingIndex(2);
24515    if (tView.firstUpdatePass) {
24516        stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);
24517    }
24518    if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {
24519        const tNode = tView.data[getSelectedIndex()];
24520        updateStyling(tView, tNode, lView, lView[RENDERER], prop, lView[bindingIndex + 1] = normalizeSuffix(value, suffix), isClassBased, bindingIndex);
24521    }
24522}
24523/**
24524 * Common code between `ɵɵclassMap` and `ɵɵstyleMap`.
24525 *
24526 * @param keyValueArraySet (See `keyValueArraySet` in "util/array_utils") Gets passed in as a
24527 *        function so that `style` can be processed. This is done for tree shaking purposes.
24528 * @param stringParser Parser used to parse `value` if `string`. (Passed in as `style` and `class`
24529 *        have different parsers.)
24530 * @param value bound value from application
24531 * @param isClassBased `true` if `class` change (`false` if `style`)
24532 */
24533function checkStylingMap(keyValueArraySet, stringParser, value, isClassBased) {
24534    const tView = getTView();
24535    const bindingIndex = incrementBindingIndex(2);
24536    if (tView.firstUpdatePass) {
24537        stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased);
24538    }
24539    const lView = getLView();
24540    if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {
24541        // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the
24542        // if so as not to read unnecessarily.
24543        const tNode = tView.data[getSelectedIndex()];
24544        if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) {
24545            if (ngDevMode) {
24546                // verify that if we are shadowing then `TData` is appropriately marked so that we skip
24547                // processing this binding in styling resolution.
24548                const tStylingKey = tView.data[bindingIndex];
24549                assertEqual(Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false, 'Styling linked list shadow input should be marked as \'false\'');
24550            }
24551            // VE does not concatenate the static portion like we are doing here.
24552            // Instead VE just ignores the static completely if dynamic binding is present.
24553            // Because of locality we have already set the static portion because we don't know if there
24554            // is a dynamic portion until later. If we would ignore the static portion it would look like
24555            // the binding has removed it. This would confuse `[ngStyle]`/`[ngClass]` to do the wrong
24556            // thing as it would think that the static portion was removed. For this reason we
24557            // concatenate it so that `[ngStyle]`/`[ngClass]`  can continue to work on changed.
24558            let staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;
24559            ngDevMode && isClassBased === false && staticPrefix !== null &&
24560                assertEqual(staticPrefix.endsWith(';'), true, 'Expecting static portion to end with \';\'');
24561            if (staticPrefix !== null) {
24562                // We want to make sure that falsy values of `value` become empty strings.
24563                value = concatStringsWithSpace(staticPrefix, value ? value : '');
24564            }
24565            // Given `<div [style] my-dir>` such that `my-dir` has `@Input('style')`.
24566            // This takes over the `[style]` binding. (Same for `[class]`)
24567            setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased);
24568        }
24569        else {
24570            updateStylingMap(tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1], lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet, stringParser, value), isClassBased, bindingIndex);
24571        }
24572    }
24573}
24574/**
24575 * Determines when the binding is in `hostBindings` section
24576 *
24577 * @param tView Current `TView`
24578 * @param bindingIndex index of binding which we would like if it is in `hostBindings`
24579 */
24580function isInHostBindings(tView, bindingIndex) {
24581    // All host bindings are placed after the expando section.
24582    return bindingIndex >= tView.expandoStartIndex;
24583}
24584/**
24585 * Collects the necessary information to insert the binding into a linked list of style bindings
24586 * using `insertTStylingBinding`.
24587 *
24588 * @param tView `TView` where the binding linked list will be stored.
24589 * @param tStylingKey Property/key of the binding.
24590 * @param bindingIndex Index of binding associated with the `prop`
24591 * @param isClassBased `true` if `class` change (`false` if `style`)
24592 */
24593function stylingFirstUpdatePass(tView, tStylingKey, bindingIndex, isClassBased) {
24594    ngDevMode && assertFirstUpdatePass(tView);
24595    const tData = tView.data;
24596    if (tData[bindingIndex + 1] === null) {
24597        // The above check is necessary because we don't clear first update pass until first successful
24598        // (no exception) template execution. This prevents the styling instruction from double adding
24599        // itself to the list.
24600        // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the
24601        // if so as not to read unnecessarily.
24602        const tNode = tData[getSelectedIndex()];
24603        ngDevMode && assertDefined(tNode, 'TNode expected');
24604        const isHostBindings = isInHostBindings(tView, bindingIndex);
24605        if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) {
24606            // `tStylingKey === null` implies that we are either `[style]` or `[class]` binding.
24607            // If there is a directive which uses `@Input('style')` or `@Input('class')` than
24608            // we need to neutralize this binding since that directive is shadowing it.
24609            // We turn this into a noop by setting the key to `false`
24610            tStylingKey = false;
24611        }
24612        tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased);
24613        insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased);
24614    }
24615}
24616/**
24617 * Adds static styling information to the binding if applicable.
24618 *
24619 * The linked list of styles not only stores the list and keys, but also stores static styling
24620 * information on some of the keys. This function determines if the key should contain the styling
24621 * information and computes it.
24622 *
24623 * See `TStylingStatic` for more details.
24624 *
24625 * @param tData `TData` where the linked list is stored.
24626 * @param tNode `TNode` for which the styling is being computed.
24627 * @param stylingKey `TStylingKeyPrimitive` which may need to be wrapped into `TStylingKey`
24628 * @param isClassBased `true` if `class` (`false` if `style`)
24629 */
24630function wrapInStaticStylingKey(tData, tNode, stylingKey, isClassBased) {
24631    const hostDirectiveDef = getCurrentDirectiveDef(tData);
24632    let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;
24633    if (hostDirectiveDef === null) {
24634        // We are in template node.
24635        // If template node already had styling instruction then it has already collected the static
24636        // styling and there is no need to collect them again. We know that we are the first styling
24637        // instruction because the `TNode.*Bindings` points to 0 (nothing has been inserted yet).
24638        const isFirstStylingInstructionInTemplate = (isClassBased ? tNode.classBindings : tNode.styleBindings) === 0;
24639        if (isFirstStylingInstructionInTemplate) {
24640            // It would be nice to be able to get the statics from `mergeAttrs`, however, at this point
24641            // they are already merged and it would not be possible to figure which property belongs where
24642            // in the priority.
24643            stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased);
24644            stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased);
24645            // We know that if we have styling binding in template we can't have residual.
24646            residual = null;
24647        }
24648    }
24649    else {
24650        // We are in host binding node and there was no binding instruction in template node.
24651        // This means that we need to compute the residual.
24652        const directiveStylingLast = tNode.directiveStylingLast;
24653        const isFirstStylingInstructionInHostBinding = directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef;
24654        if (isFirstStylingInstructionInHostBinding) {
24655            stylingKey =
24656                collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased);
24657            if (residual === null) {
24658                // - If `null` than either:
24659                //    - Template styling instruction already ran and it has consumed the static
24660                //      styling into its `TStylingKey` and so there is no need to update residual. Instead
24661                //      we need to update the `TStylingKey` associated with the first template node
24662                //      instruction. OR
24663                //    - Some other styling instruction ran and determined that there are no residuals
24664                let templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased);
24665                if (templateStylingKey !== undefined && Array.isArray(templateStylingKey)) {
24666                    // Only recompute if `templateStylingKey` had static values. (If no static value found
24667                    // then there is nothing to do since this operation can only produce less static keys, not
24668                    // more.)
24669                    templateStylingKey = collectStylingFromDirectives(null, tData, tNode, templateStylingKey[1] /* unwrap previous statics */, isClassBased);
24670                    templateStylingKey =
24671                        collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased);
24672                    setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey);
24673                }
24674            }
24675            else {
24676                // We only need to recompute residual if it is not `null`.
24677                // - If existing residual (implies there was no template styling). This means that some of
24678                //   the statics may have moved from the residual to the `stylingKey` and so we have to
24679                //   recompute.
24680                // - If `undefined` this is the first time we are running.
24681                residual = collectResidual(tData, tNode, isClassBased);
24682            }
24683        }
24684    }
24685    if (residual !== undefined) {
24686        isClassBased ? (tNode.residualClasses = residual) : (tNode.residualStyles = residual);
24687    }
24688    return stylingKey;
24689}
24690/**
24691 * Retrieve the `TStylingKey` for the template styling instruction.
24692 *
24693 * This is needed since `hostBinding` styling instructions are inserted after the template
24694 * instruction. While the template instruction needs to update the residual in `TNode` the
24695 * `hostBinding` instructions need to update the `TStylingKey` of the template instruction because
24696 * the template instruction is downstream from the `hostBindings` instructions.
24697 *
24698 * @param tData `TData` where the linked list is stored.
24699 * @param tNode `TNode` for which the styling is being computed.
24700 * @param isClassBased `true` if `class` (`false` if `style`)
24701 * @return `TStylingKey` if found or `undefined` if not found.
24702 */
24703function getTemplateHeadTStylingKey(tData, tNode, isClassBased) {
24704    const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;
24705    if (getTStylingRangeNext(bindings) === 0) {
24706        // There does not seem to be a styling instruction in the `template`.
24707        return undefined;
24708    }
24709    return tData[getTStylingRangePrev(bindings)];
24710}
24711/**
24712 * Update the `TStylingKey` of the first template instruction in `TNode`.
24713 *
24714 * Logically `hostBindings` styling instructions are of lower priority than that of the template.
24715 * However, they execute after the template styling instructions. This means that they get inserted
24716 * in front of the template styling instructions.
24717 *
24718 * If we have a template styling instruction and a new `hostBindings` styling instruction is
24719 * executed it means that it may need to steal static fields from the template instruction. This
24720 * method allows us to update the first template instruction `TStylingKey` with a new value.
24721 *
24722 * Assume:
24723 * ```
24724 * <div my-dir style="color: red" [style.color]="tmplExp"></div>
24725 *
24726 * @Directive({
24727 *   host: {
24728 *     'style': 'width: 100px',
24729 *     '[style.color]': 'dirExp',
24730 *   }
24731 * })
24732 * class MyDir {}
24733 * ```
24734 *
24735 * when `[style.color]="tmplExp"` executes it creates this data structure.
24736 * ```
24737 *  ['', 'color', 'color', 'red', 'width', '100px'],
24738 * ```
24739 *
24740 * The reason for this is that the template instruction does not know if there are styling
24741 * instructions and must assume that there are none and must collect all of the static styling.
24742 * (both
24743 * `color' and 'width`)
24744 *
24745 * When `'[style.color]': 'dirExp',` executes we need to insert a new data into the linked list.
24746 * ```
24747 *  ['', 'color', 'width', '100px'],  // newly inserted
24748 *  ['', 'color', 'color', 'red', 'width', '100px'], // this is wrong
24749 * ```
24750 *
24751 * Notice that the template statics is now wrong as it incorrectly contains `width` so we need to
24752 * update it like so:
24753 * ```
24754 *  ['', 'color', 'width', '100px'],
24755 *  ['', 'color', 'color', 'red'],    // UPDATE
24756 * ```
24757 *
24758 * @param tData `TData` where the linked list is stored.
24759 * @param tNode `TNode` for which the styling is being computed.
24760 * @param isClassBased `true` if `class` (`false` if `style`)
24761 * @param tStylingKey New `TStylingKey` which is replacing the old one.
24762 */
24763function setTemplateHeadTStylingKey(tData, tNode, isClassBased, tStylingKey) {
24764    const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;
24765    ngDevMode &&
24766        assertNotEqual(getTStylingRangeNext(bindings), 0, 'Expecting to have at least one template styling binding.');
24767    tData[getTStylingRangePrev(bindings)] = tStylingKey;
24768}
24769/**
24770 * Collect all static values after the current `TNode.directiveStylingLast` index.
24771 *
24772 * Collect the remaining styling information which has not yet been collected by an existing
24773 * styling instruction.
24774 *
24775 * @param tData `TData` where the `DirectiveDefs` are stored.
24776 * @param tNode `TNode` which contains the directive range.
24777 * @param isClassBased `true` if `class` (`false` if `style`)
24778 */
24779function collectResidual(tData, tNode, isClassBased) {
24780    let residual = undefined;
24781    const directiveEnd = tNode.directiveEnd;
24782    ngDevMode &&
24783        assertNotEqual(tNode.directiveStylingLast, -1, 'By the time this function gets called at least one hostBindings-node styling instruction must have executed.');
24784    // We add `1 + tNode.directiveStart` because we need to skip the current directive (
vendor: 21,364 bytes, lines 24784-25292
24784as we are
24785    // collecting things after the last `hostBindings` directive which had a styling instruction.)
24786    for (let i = 1 + tNode.directiveStylingLast; i < directiveEnd; i++) {
24787        const attrs = tData[i].hostAttrs;
24788        residual = collectStylingFromTAttrs(residual, attrs, isClassBased);
24789    }
24790    return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased);
24791}
24792/**
24793 * Collect the static styling information with lower priority than `hostDirectiveDef`.
24794 *
24795 * (This is opposite of residual styling.)
24796 *
24797 * @param hostDirectiveDef `DirectiveDef` for which we want to collect lower priority static
24798 *        styling. (Or `null` if template styling)
24799 * @param tData `TData` where the linked list is stored.
24800 * @param tNode `TNode` for which the styling is being computed.
24801 * @param stylingKey Existing `TStylingKey` to update or wrap.
24802 * @param isClassBased `true` if `class` (`false` if `style`)
24803 */
24804function collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased) {
24805    // We need to loop because there can be directives which have `hostAttrs` but don't have
24806    // `hostBindings` so this loop catches up to the current directive..
24807    let currentDirective = null;
24808    const directiveEnd = tNode.directiveEnd;
24809    let directiveStylingLast = tNode.directiveStylingLast;
24810    if (directiveStylingLast === -1) {
24811        directiveStylingLast = tNode.directiveStart;
24812    }
24813    else {
24814        directiveStylingLast++;
24815    }
24816    while (directiveStylingLast < directiveEnd) {
24817        currentDirective = tData[directiveStylingLast];
24818        ngDevMode && assertDefined(currentDirective, 'expected to be defined');
24819        stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased);
24820        if (currentDirective === hostDirectiveDef)
24821            break;
24822        directiveStylingLast++;
24823    }
24824    if (hostDirectiveDef !== null) {
24825        // we only advance the styling cursor if we are collecting data from host bindings.
24826        // Template executes before host bindings and so if we would update the index,
24827        // host bindings would not get their statics.
24828        tNode.directiveStylingLast = directiveStylingLast;
24829    }
24830    return stylingKey;
24831}
24832/**
24833 * Convert `TAttrs` into `TStylingStatic`.
24834 *
24835 * @param stylingKey existing `TStylingKey` to update or wrap.
24836 * @param attrs `TAttributes` to process.
24837 * @param isClassBased `true` if `class` (`false` if `style`)
24838 */
24839function collectStylingFromTAttrs(stylingKey, attrs, isClassBased) {
24840    const desiredMarker = isClassBased ? 1 /* Classes */ : 2 /* Styles */;
24841    let currentMarker = -1 /* ImplicitAttributes */;
24842    if (attrs !== null) {
24843        for (let i = 0; i < attrs.length; i++) {
24844            const item = attrs[i];
24845            if (typeof item === 'number') {
24846                currentMarker = item;
24847            }
24848            else {
24849                if (currentMarker === desiredMarker) {
24850                    if (!Array.isArray(stylingKey)) {
24851                        stylingKey = stylingKey === undefined ? [] : ['', stylingKey];
24852                    }
24853                    keyValueArraySet(stylingKey, item, isClassBased ? true : attrs[++i]);
24854                }
24855            }
24856        }
24857    }
24858    return stylingKey === undefined ? null : stylingKey;
24859}
24860/**
24861 * Convert user input to `KeyValueArray`.
24862 *
24863 * This function takes user input which could be `string`, Object literal, or iterable and converts
24864 * it into a consistent representation. The output of this is `KeyValueArray` (which is an array
24865 * where
24866 * even indexes contain keys and odd indexes contain values for those keys).
24867 *
24868 * The advantage of converting to `KeyValueArray` is that we can perform diff in an input
24869 * independent
24870 * way.
24871 * (ie we can compare `foo bar` to `['bar', 'baz'] and determine a set of changes which need to be
24872 * applied)
24873 *
24874 * The fact that `KeyValueArray` is sorted is very important because it allows us to compute the
24875 * difference in linear fashion without the need to allocate any additional data.
24876 *
24877 * For example if we kept this as a `Map` we would have to iterate over previous `Map` to determine
24878 * which values need to be deleted, over the new `Map` to determine additions, and we would have to
24879 * keep additional `Map` to keep track of duplicates or items which have not yet been visited.
24880 *
24881 * @param keyValueArraySet (See `keyValueArraySet` in "util/array_utils") Gets passed in as a
24882 *        function so that `style` can be processed. This is done
24883 *        for tree shaking purposes.
24884 * @param stringParser The parser is passed in so that it will be tree shakable. See
24885 *        `styleStringParser` and `classStringParser`
24886 * @param value The value to parse/convert to `KeyValueArray`
24887 */
24888function toStylingKeyValueArray(keyValueArraySet, stringParser, value) {
24889    if (value == null /*|| value === undefined */ || value === '')
24890        return EMPTY_ARRAY;
24891    const styleKeyValueArray = [];
24892    const unwrappedValue = unwrapSafeValue(value);
24893    if (Array.isArray(unwrappedValue)) {
24894        for (let i = 0; i < unwrappedValue.length; i++) {
24895            keyValueArraySet(styleKeyValueArray, unwrappedValue[i], true);
24896        }
24897    }
24898    else if (typeof unwrappedValue === 'object') {
24899        for (const key in unwrappedValue) {
24900            if (unwrappedValue.hasOwnProperty(key)) {
24901                keyValueArraySet(styleKeyValueArray, key, unwrappedValue[key]);
24902            }
24903        }
24904    }
24905    else if (typeof unwrappedValue === 'string') {
24906        stringParser(styleKeyValueArray, unwrappedValue);
24907    }
24908    else {
24909        ngDevMode &&
24910            throwError('Unsupported styling type ' + typeof unwrappedValue + ': ' + unwrappedValue);
24911    }
24912    return styleKeyValueArray;
24913}
24914/**
24915 * Set a `value` for a `key`.
24916 *
24917 * See: `keyValueArraySet` for details
24918 *
24919 * @param keyValueArray KeyValueArray to add to.
24920 * @param key Style key to add.
24921 * @param value The value to set.
24922 */
24923function styleKeyValueArraySet(keyValueArray, key, value) {
24924    keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));
24925}
24926/**
24927 * Update map based styling.
24928 *
24929 * Map based styling could be anything which contains more than one binding. For example `string`,
24930 * or object literal. Dealing with all of these types would complicate the logic so
24931 * instead this function expects that the complex input is first converted into normalized
24932 * `KeyValueArray`. The advantage of normalization is that we get the values sorted, which makes it
24933 * very cheap to compute deltas between the previous and current value.
24934 *
24935 * @param tView Associated `TView.data` contains the linked list of binding priorities.
24936 * @param tNode `TNode` where the binding is located.
24937 * @param lView `LView` contains the values associated with other styling binding at this `TNode`.
24938 * @param renderer Renderer to use if any updates.
24939 * @param oldKeyValueArray Previous value represented as `KeyValueArray`
24940 * @param newKeyValueArray Current value represented as `KeyValueArray`
24941 * @param isClassBased `true` if `class` (`false` if `style`)
24942 * @param bindingIndex Binding index of the binding.
24943 */
24944function updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) {
24945    if (oldKeyValueArray === NO_CHANGE) {
24946        // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray.
24947        oldKeyValueArray = EMPTY_ARRAY;
24948    }
24949    let oldIndex = 0;
24950    let newIndex = 0;
24951    let oldKey = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null;
24952    let newKey = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null;
24953    while (oldKey !== null || newKey !== null) {
24954        ngDevMode && assertLessThan(oldIndex, 999, 'Are we stuck in infinite loop?');
24955        ngDevMode && assertLessThan(newIndex, 999, 'Are we stuck in infinite loop?');
24956        const oldValue = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : undefined;
24957        const newValue = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : undefined;
24958        let setKey = null;
24959        let setValue = undefined;
24960        if (oldKey === newKey) {
24961            // UPDATE: Keys are equal => new value is overwriting old value.
24962            oldIndex += 2;
24963            newIndex += 2;
24964            if (oldValue !== newValue) {
24965                setKey = newKey;
24966                setValue = newValue;
24967            }
24968        }
24969        else if (newKey === null || oldKey !== null && oldKey < newKey) {
24970            // DELETE: oldKey key is missing or we did not find the oldKey in the newValue
24971            // (because the keyValueArray is sorted and `newKey` is found later alphabetically).
24972            // `"background" < "color"` so we need to delete `"background"` because it is not found in the
24973            // new array.
24974            oldIndex += 2;
24975            setKey = oldKey;
24976        }
24977        else {
24978            // CREATE: newKey's is earlier alphabetically than oldKey's (or no oldKey) => we have new key.
24979            // `"color" > "background"` so we need to add `color` because it is in new array but not in
24980            // old array.
24981            ngDevMode && assertDefined(newKey, 'Expecting to have a valid key');
24982            newIndex += 2;
24983            setKey = newKey;
24984            setValue = newValue;
24985        }
24986        if (setKey !== null) {
24987            updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex);
24988        }
24989        oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null;
24990        newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null;
24991    }
24992}
24993/**
24994 * Update a simple (property name) styling.
24995 *
24996 * This function takes `prop` and updates the DOM to that value. The function takes the binding
24997 * value as well as binding priority into consideration to determine which value should be written
24998 * to DOM. (For example it may be determined that there is a higher priority overwrite which blocks
24999 * the DOM write, or if the value goes to `undefined` a lower priority overwrite may be consulted.)
25000 *
25001 * @param tView Associated `TView.data` contains the linked list of binding priorities.
25002 * @param tNode `TNode` where the binding is located.
25003 * @param lView `LView` contains the values associated with other styling binding at this `TNode`.
25004 * @param renderer Renderer to use if any updates.
25005 * @param prop Either style property name or a class name.
25006 * @param value Either style value for `prop` or `true`/`false` if `prop` is class.
25007 * @param isClassBased `true` if `class` (`false` if `style`)
25008 * @param bindingIndex Binding index of the binding.
25009 */
25010function updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) {
25011    if (!(tNode.type & 3 /* AnyRNode */)) {
25012        // It is possible to have styling on non-elements (such as ng-container).
25013        // This is rare, but it does happen. In such a case, just ignore the binding.
25014        return;
25015    }
25016    const tData = tView.data;
25017    const tRange = tData[bindingIndex + 1];
25018    const higherPriorityValue = getTStylingRangeNextDuplicate(tRange) ?
25019        findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased) :
25020        undefined;
25021    if (!isStylingValuePresent(higherPriorityValue)) {
25022        // We don't have a next duplicate, or we did not find a duplicate value.
25023        if (!isStylingValuePresent(value)) {
25024            // We should delete current value or restore to lower priority value.
25025            if (getTStylingRangePrevDuplicate(tRange)) {
25026                // We have a possible prev duplicate, let's retrieve it.
25027                value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased);
25028            }
25029        }
25030        const rNode = getNativeByIndex(getSelectedIndex(), lView);
25031        applyStyling(renderer, isClassBased, rNode, prop, value);
25032    }
25033}
25034/**
25035 * Search for styling value with higher priority which is overwriting current value, or a
25036 * value of lower priority to which we should fall back if the value is `undefined`.
25037 *
25038 * When value is being applied at a location, related values need to be consulted.
25039 * - If there is a higher priority binding, we should be using that one instead.
25040 *   For example `<div  [style]="{color:exp1}" [style.color]="exp2">` change to `exp1`
25041 *   requires that we check `exp2` to see if it is set to value other than `undefined`.
25042 * - If there is a lower priority binding and we are changing to `undefined`
25043 *   For example `<div  [style]="{color:exp1}" [style.color]="exp2">` change to `exp2` to
25044 *   `undefined` requires that we check `exp1` (and static values) and use that as new value.
25045 *
25046 * NOTE: The styling stores two values.
25047 * 1. The raw value which came from the application is stored at `index + 0` location. (This value
25048 *    is used for dirty checking).
25049 * 2. The normalized value is stored at `index + 1`.
25050 *
25051 * @param tData `TData` used for traversing the priority.
25052 * @param tNode `TNode` to use for resolving static styling. Also controls search direction.
25053 *   - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.
25054 *      If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.
25055 *   - `null` search prev and go all the way to end. Return last value where
25056 *     `isStylingValuePresent(value)` is true.
25057 * @param lView `LView` used for retrieving the actual values.
25058 * @param prop Property which we are interested in.
25059 * @param index Starting index in the linked list of styling bindings where the search should start.
25060 * @param isClassBased `true` if `class` (`false` if `style`)
25061 */
25062function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
25063    // `TNode` to use for resolving static styling. Also controls search direction.
25064    //   - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.
25065    //      If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.
25066    //   - `null` search prev and go all the way to end. Return last value where
25067    //     `isStylingValuePresent(value)` is true.
25068    const isPrevDirection = tNode === null;
25069    let value = undefined;
25070    while (index > 0) {
25071        const rawKey = tData[index];
25072        const containsStatics = Array.isArray(rawKey);
25073        // Unwrap the key if we contain static values.
25074        const key = containsStatics ? rawKey[1] : rawKey;
25075        const isStylingMap = key === null;
25076        let valueAtLViewIndex = lView[index + 1];
25077        if (valueAtLViewIndex === NO_CHANGE) {
25078            // In firstUpdatePass the styling instructions create a linked list of styling.
25079            // On subsequent passes it is possible for a styling instruction to try to read a binding
25080            // which
25081            // has not yet executed. In that case we will find `NO_CHANGE` and we should assume that
25082            // we have `undefined` (or empty array in case of styling-map instruction) instead. This
25083            // allows the resolution to apply the value (which may later be overwritten when the
25084            // binding actually executes.)
25085            valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;
25086        }
25087        let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :
25088            key === prop ? valueAtLViewIndex : undefined;
25089        if (containsStatics && !isStylingValuePresent(currentValue)) {
25090            currentValue = keyValueArrayGet(rawKey, prop);
25091        }
25092        if (isStylingValuePresent(currentValue)) {
25093            value = currentValue;
25094            if (isPrevDirection) {
25095                return value;
25096            }
25097        }
25098        const tRange = tData[index + 1];
25099        index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange);
25100    }
25101    if (tNode !== null) {
25102        // in case where we are going in next direction AND we did not find anything, we need to
25103        // consult residual styling
25104        let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;
25105        if (residual != null /** OR residual !=== undefined */) {
25106            value = keyValueArrayGet(residual, prop);
25107        }
25108    }
25109    return value;
25110}
25111/**
25112 * Determines if the binding value should be used (or if the value is 'undefined' and hence priority
25113 * resolution should be used.)
25114 *
25115 * @param value Binding style value.
25116 */
25117function isStylingValuePresent(value) {
25118    // Currently only `undefined` value is considered non-binding. That is `undefined` says I don't
25119    // have an opinion as to what this binding should be and you should consult other bindings by
25120    // priority to determine the valid value.
25121    // This is extracted into a single function so that we have a single place to control this.
25122    return value !== undefined;
25123}
25124/**
25125 * Normalizes and/or adds a suffix to the value.
25126 *
25127 * If value is `null`/`undefined` no suffix is added
25128 * @param value
25129 * @param suffix
25130 */
25131function normalizeSuffix(value, suffix) {
25132    if (value == null /** || value === undefined */) {
25133        // do nothing
25134    }
25135    else if (typeof suffix === 'string') {
25136        value = value + suffix;
25137    }
25138    else if (typeof value === 'object') {
25139        value = stringify(unwrapSafeValue(value));
25140    }
25141    return value;
25142}
25143/**
25144 * Tests if the `TNode` has input shadow.
25145 *
25146 * An input shadow is when a directive steals (shadows) the input by using `@Input('style')` or
25147 * `@Input('class')` as input.
25148 *
25149 * @param tNode `TNode` which we would like to see if it has shadow.
25150 * @param isClassBased `true` if `class` (`false` if `style`)
25151 */
25152function hasStylingInputShadow(tNode, isClassBased) {
25153    return (tNode.flags & (isClassBased ? 16 /* hasClassInput */ : 32 /* hasStyleInput */)) !== 0;
25154}
25155
25156/**
25157 * @license
25158 * Copyright Google LLC All Rights Reserved.
25159 *
25160 * Use of this source code is governed by an MIT-style license that can be
25161 * found in the LICENSE file at https://angular.io/license
25162 */
25163/**
25164 * Create static text node
25165 *
25166 * @param index Index of the node in the data array
25167 * @param value Static string value to write.
25168 *
25169 * @codeGenApi
25170 */
25171function ɵɵtext(index, value = '') {
25172    const lView = getLView();
25173    const tView = getTView();
25174    const adjustedIndex = index + HEADER_OFFSET;
25175    ngDevMode &&
25176        assertEqual(getBindingIndex(), tView.bindingStartIndex, 'text nodes should be created before any bindings');
25177    ngDevMode && assertIndexInRange(lView, adjustedIndex);
25178    const tNode = tView.firstCreatePass ?
25179        getOrCreateTNode(tView, adjustedIndex, 1 /* Text */, value, null) :
25180        tView.data[adjustedIndex];
25181    const textNative = lView[adjustedIndex] = createTextNode(lView[RENDERER], value);
25182    appendChild(tView, lView, textNative, tNode);
25183    // Text nodes are self closing.
25184    setCurrentTNode(tNode, false);
25185}
25186
25187/**
25188 * @license
25189 * Copyright Google LLC All Rights Reserved.
25190 *
25191 * Use of this source code is governed by an MIT-style license that can be
25192 * found in the LICENSE file at https://angular.io/license
25193 */
25194/**
25195 *
25196 * Update text content with a lone bound value
25197 *
25198 * Used when a text node has 1 interpolated value in it, an no additional text
25199 * surrounds that interpolated value:
25200 *
25201 * ```html
25202 * <div>{{v0}}</div>
25203 * ```
25204 *
25205 * Its compiled representation is:
25206 *
25207 * ```ts
25208 * ɵɵtextInterpolate(v0);
25209 * ```
25210 * @returns itself, so that it may be chained.
25211 * @see textInterpolateV
25212 * @codeGenApi
25213 */
25214function ɵɵtextInterpolate(v0) {
25215    ɵɵtextInterpolate1('', v0, '');
25216    return ɵɵtextInterpolate;
25217}
25218/**
25219 *
25220 * Update text content with single bound value surrounded by other text.
25221 *
25222 * Used when a text node has 1 interpolated value in it:
25223 *
25224 * ```html
25225 * <div>prefix{{v0}}suffix</div>
25226 * ```
25227 *
25228 * Its compiled representation is:
25229 *
25230 * ```ts
25231 * ɵɵtextInterpolate1('prefix', v0, 'suffix');
25232 * ```
25233 * @returns itself, so that it may be chained.
25234 * @see textInterpolateV
25235 * @codeGenApi
25236 */
25237function ɵɵtextInterpolate1(prefix, v0, suffix) {
25238    const lView = getLView();
25239    const interpolated = interpolation1(lView, prefix, v0, suffix);
25240    if (interpolated !== NO_CHANGE) {
25241        textBindingInternal(lView, getSelectedIndex(), interpolated);
25242    }
25243    return ɵɵtextInterpolate1;
25244}
25245/**
25246 *
25247 * Update text content with 2 bound values surrounded by other text.
25248 *
25249 * Used when a text node has 2 interpolated values in it:
25250 *
25251 * ```html
25252 * <div>prefix{{v0}}-{{v1}}suffix</div>
25253 * ```
25254 *
25255 * Its compiled representation is:
25256 *
25257 * ```ts
25258 * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');
25259 * ```
25260 * @returns itself, so that it may be chained.
25261 * @see textInterpolateV
25262 * @codeGenApi
25263 */
25264function ɵɵtextInterpolate2(prefix, v0, i0, v1, suffix) {
25265    const lView = getLView();
25266    const interpolated = interpolation2(lView, prefix, v0, i0, v1, suffix);
25267    if (interpolated !== NO_CHANGE) {
25268        textBindingInternal(lView, getSelectedIndex(), interpolated);
25269    }
25270    return ɵɵtextInterpolate2;
25271}
25272/**
25273 *
25274 * Update text content with 3 bound values surrounded by other text.
25275 *
25276 * Used when a text node has 3 interpolated values in it:
25277 *
25278 * ```html
25279 * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>
25280 * ```
25281 *
25282 * Its compiled representation is:
25283 *
25284 * ```ts
25285 * ɵɵtextInterpolate3(
25286 * 'prefix', v0, '-', v1, '-', v2, 'suffix');
25287 * ```
25288 * @returns itself, so that it may be chained.
25289 * @see textInterpolateV
25290 * @codeGenApi
25291 */
25292function ɵɵtextInterpolate3(prefix, v0, i0, v1, i1, v2, suffix
25292) {
25293    const lView = getLView();
25294    const interpolated = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
25295    if (interpolated !== NO_CHANGE) {
25296        textBindingInternal(lView, getSelectedIndex(), interpolated);
25297    }
25298    return ɵɵtextInterpolate3;
25299}
25300/**
25301 *
25302 * Update text content with 4 bound values surrounded by other text.
25303 *
25304 * Used when a text node has 4 interpolated values in it:
25305 *
25306 * ```html
25307 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>
25308 * ```
25309 *
25310 * Its compiled representation is:
25311 *
25312 * ```ts
25313 * ɵɵtextInterpolate4(
25314 * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
25315 * ```
25316 * @returns itself, so that it may be chained.
25317 * @see ɵɵtextInterpolateV
25318 * @codeGenApi
25319 */
25320function ɵɵtextInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
25321    const lView = getLView();
25322    const interpolated = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
25323    if (interpolated !== NO_CHANGE) {
25324        textBindingInternal(lView, getSelectedIndex(), interpolated);
25325    }
25326    return ɵɵtextInterpolate4;
25327}
25328/**
25329 *
25330 * Update text content with 5 bound values surrounded by other text.
25331 *
25332 * Used when a text node has 5 interpolated values in it:
25333 *
25334 * ```html
25335 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>
25336 * ```
25337 *
25338 * Its compiled representation is:
25339 *
25340 * ```ts
25341 * ɵɵtextInterpolate5(
25342 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
25343 * ```
25344 * @returns itself, so that it may be chained.
25345 * @see textInterpolateV
25346 * @codeGenApi
25347 */
25348function ɵɵtextInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
25349    const lView = getLView();
25350    const interpolated = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
25351    if (interpolated !== NO_CHANGE) {
25352        textBindingInternal(lView, getSelectedIndex(), interpolated);
25353    }
25354    return ɵɵtextInterpolate5;
25355}
25356/**
25357 *
25358 * Update text content with 6 bound values surrounded by other text.
25359 *
25360 * Used when a text node has 6 interpolated values in it:
25361 *
25362 * ```html
25363 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>
25364 * ```
25365 *
25366 * Its compiled representation is:
25367 *
25368 * ```ts
25369 * ɵɵtextInterpolate6(
25370 *    'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
25371 * ```
25372 *
25373 * @param i4 Static value used for concatenation only.
25374 * @param v5 Value checked for change. @returns itself, so that it may be chained.
25375 * @see textInterpolateV
25376 * @codeGenApi
25377 */
25378function ɵɵtextInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
25379    const lView = getLView();
25380    const interpolated = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
25381    if (interpolated !== NO_CHANGE) {
25382        textBindingInternal(lView, getSelectedIndex(), interpolated);
25383    }
25384    return ɵɵtextInterpolate6;
25385}
25386/**
25387 *
25388 * Update text content with 7 bound values surrounded by other text.
25389 *
25390 * Used when a text node has 7 interpolated values in it:
25391 *
25392 * ```html
25393 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>
25394 * ```
25395 *
25396 * Its compiled representation is:
25397 *
25398 * ```ts
25399 * ɵɵtextInterpolate7(
25400 *    'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
25401 * ```
25402 * @returns itself, so that it may be chained.
25403 * @see textInterpolateV
25404 * @codeGenApi
25405 */
25406function ɵɵtextInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
25407    const lView = getLView();
25408    const interpolated = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
25409    if (interpolated !== NO_CHANGE) {
25410        textBindingInternal(lView, getSelectedIndex(), interpolated);
25411    }
25412    return ɵɵtextInterpolate7;
25413}
25414/**
25415 *
25416 * Update text content with 8 bound values surrounded by other text.
25417 *
25418 * Used when a text node has 8 interpolated values in it:
25419 *
25420 * ```html
25421 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>
25422 * ```
25423 *
25424 * Its compiled representation is:
25425 *
25426 * ```ts
25427 * ɵɵtextInterpolate8(
25428 *  'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
25429 * ```
25430 * @returns itself, so that it may be chained.
25431 * @see textInterpolateV
25432 * @codeGenApi
25433 */
25434function ɵɵtextInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
25435    const lView = getLView();
25436    const interpolated = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
25437    if (interpolated !== NO_CHANGE) {
25438        textBindingInternal(lView, getSelectedIndex(), interpolated);
25439    }
25440    return ɵɵtextInterpolate8;
25441}
25442/**
25443 * Update text content with 9 or more bound values other surrounded by text.
25444 *
25445 * Used when the number of interpolated values exceeds 8.
25446 *
25447 * ```html
25448 * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>
25449 * ```
25450 *
25451 * Its compiled representation is:
25452 *
25453 * ```ts
25454 * ɵɵtextInterpolateV(
25455 *  ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
25456 *  'suffix']);
25457 * ```
25458 *.
25459 * @param values The collection of values and the strings in between those values, beginning with
25460 * a string prefix and ending with a string suffix.
25461 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
25462 *
25463 * @returns itself, so that it may be chained.
25464 * @codeGenApi
25465 */
25466function ɵɵtextInterpolateV(values) {
25467    const lView = getLView();
25468    const interpolated = interpolationV(lView, values);
25469    if (interpolated !== NO_CHANGE) {
25470        textBindingInternal(lView, getSelectedIndex(), interpolated);
25471    }
25472    return ɵɵtextInterpolateV;
25473}
25474
25475/**
25476 * @license
25477 * Copyright Google LLC All Rights Reserved.
25478 *
25479 * Use of this source code is governed by an MIT-style license that can be
25480 * found in the LICENSE file at https://angular.io/license
25481 */
25482/**
25483 *
25484 * Update an interpolated class on an element with single bound value surrounded by text.
25485 *
25486 * Used when the value passed to a property has 1 interpolated value in it:
25487 *
25488 * ```html
25489 * <div class="prefix{{v0}}suffix"></div>
25490 * ```
25491 *
25492 * Its compiled representation is:
25493 *
25494 * ```ts
25495 * ɵɵclassMapInterpolate1('prefix', v0, 'suffix');
25496 * ```
25497 *
25498 * @param prefix Static value used for concatenation only.
25499 * @param v0 Value checked for change.
25500 * @param suffix Static value used for concatenation only.
25501 * @codeGenApi
25502 */
25503function ɵɵclassMapInterpolate1(prefix, v0, suffix) {
25504    const lView = getLView();
25505    const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
25506    checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
25507}
25508/**
25509 *
25510 * Update an interpolated class on an element with 2 bound values surrounded by text.
25511 *
25512 * Used when the value passed to a property has 2 interpolated values in it:
25513 *
25514 * ```html
25515 * <div class="prefix{{v0}}-{{v1}}suffix"></div>
25516 * ```
25517 *
25518 * Its compiled representation is:
25519 *
25520 * ```ts
25521 * ɵɵclassMapInterpolate2('prefix', v0, '-', v1, 'suffix');
25522 * ```
25523 *
25524 * @param prefix Static value used for concatenation only.
25525 * @param v0 Value checked for change.
25526 * @param i0 Static value used for concatenation only.
25527 * @param v1 Value checked for change.
25528 * @param suffix Static value used for concatenation only.
25529 * @codeGenApi
25530 */
25531function ɵɵclassMapInterpolate2(prefix, v0, i0, v1, suffix) {
25532    const lView = getLView();
25533    const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
25534    checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
25535}
25536/**
25537 *
25538 * Update an interpolated class on an element with 3 bound values surrounded by text.
25539 *
25540 * Used when the value passed to a property has 3 interpolated values in it:
25541 *
25542 * ```html
25543 * <div class="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
25544 * ```
25545 *
25546 * Its compiled representation is:
25547 *
25548 * ```ts
25549 * ɵɵclassMapInterpolate3(
25550 * 'prefix', v0, '-', v1, '-', v2, 'suffix');
25551 * ```
25552 *
25553 * @param prefix Static value used for concatenation only.
25554 * @param v0 Value checked for change.
25555 * @param i0 Static value used for concatenation only.
25556 * @param v1 Value checked for change.
25557 * @param i1 Static value used for concatenation only.
25558 * @param v2 Value checked for change.
25559 * @param suffix Static value used for concatenation only.
25560 * @codeGenApi
25561 */
25562function ɵɵclassMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {
25563    const lView = getLView();
25564    const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
25565    checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
25566}
25567/**
25568 *
25569 * Update an interpolated class on an element with 4 bound values surrounded by text.
25570 *
25571 * Used when the value passed to a property has 4 interpolated values in it:
25572 *
25573 * ```html
25574 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
25575 * ```
25576 *
25577 * Its compiled representation is:
25578 *
25579 * ```ts
25580 * ɵɵclassMapInterpolate4(
25581 * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
25582 * ```
25583 *
25584 * @param prefix Static value used for concatenation only.
25585 * @param v0 Value checked for change.
25586 * @param i0 Static value used for concatenation only.
25587 * @param v1 Value checked for change.
25588 * @param i1 Static value used for concatenation only.
25589 * @param v2 Value checked for change.
25590 * @param i2 Static value used for concatenation only.
25591 * @param v3 Value checked for change.
25592 * @param suffix Static value used for concatenation only.
25593 * @codeGenApi
25594 */
25595function ɵɵclassMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
25596    const lView = getLView();
25597    const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
25598    checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
25599}
25600/**
25601 *
25602 * Update an interpolated class on an element with 5 bound values surrounded by text.
25603 *
25604 * Used when the value passed to a property has 5 interpolated values in it:
25605 *
25606 * ```html
25607 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
25608 * ```
25609 *
25610 * Its compiled representation is:
25611 *
25612 * ```ts
25613 * ɵɵclassMapInterpolate5(
25614 * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
25615 * ```
25616 *
25617 * @param prefix Static value used for concatenation only.
25618 * @param v0 Value checked for change.
25619 * @param i0 Static value used for concatenation only.
25620 * @param v1 Value checked for change.
25621 * @param i1 Static value used for concatenation only.
25622 * @param v2 Value checked for change.
25623 * @param i2 Static value used for concatenation only.
25624 * @param v3 Value checked for change.
25625 * @param i3 Static value used for concatenation only.
25626 * @param v4 Value checked for change.
25627 * @param suffix Static value used for concatenation only.
25628 * @codeGenApi
25629 */
25630function ɵɵclassMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
25631    const lView = getLView();
25632    const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
25633    checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
25634}
25635/**
25636 *
25637 * Update an interpolated class on an element with 6 bound values surrounded by text.
25638 *
25639 * Used when the value passed to a property has 6 interpolated values in it:
25640 *
25641 * ```html
25642 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
25643 * ```
25644 *
25645 * Its compiled representation is:
25646 *
25647 * ```ts
25648 * ɵɵclassMapInterpolate6(
25649 *    'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
25650 * ```
25651 *
25652 * @param prefix Static value used for concatenation only.
25653 * @param v0 Value checked for change.
25654 * @param i0 Static value used for concatenation only.
25655 * @param v1 Value checked for change.
25656 * @param i1 Static value used for concatenation only.
25657 * @param v2 Value checked for change.
25658 * @param i2 Static value used for concatenation only.
25659 * @param v3 Value checked for change.
25660 * @param i3 Static value used for concatenation only.
25661 * @param v4 Value checked for change.
25662 * @param i4 Static value used for concatenation only.
25663 * @param v5 Value checked for change.
25664 * @param suffix Static value used for concatenation only.
25665 * @codeGenApi
25666 */
25667function ɵɵclassMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
25668    const lView = getLView();
25669    const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
25670    checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
25671}
25672/**
25673 *
25674 * Update an interpolated class on an element with 7 bound values surrounded by text.
25675 *
25676 * Used when the value passed to a property has 7 interpolated values in it:
25677 *
25678 * ```html
25679 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
25680 * ```
25681 *
25682 * Its compiled representation is:
25683 *
25684 * ```ts
25685 * ɵɵclassMapInterpolate7(
25686 *    'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
25687 * ```
25688 *
25689 * @param prefix Static value used for concatenation only.
25690 * @param v0 Value checked for change.
25691 * @param i0 Static value used for concatenation only.
25692 * @param v1 Value checked for change.
25693 * @param i1 Static value used for concatenation only.
25694 * @param v2 Value checked for change.
25695 * @param i2 Static value used for concatenation only.
25696 * @param v3 Value checked for change.
25697 * @param i3 Static value used for concatenation only.
25698 * @param v4 Value checked for change.
25699 * @param i4 Static value used for concatenation only.
25700 * @param v5 Value checked for change.
25701 * @param i5 Static value used for concatenation only.
25702 * @param v6 Value checked for change.
25703 * @param suffix Static value used for concatenation only.
25704 * @codeGenApi
25705 */
25706function ɵɵclassMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
25707    const lView = getLView();
25708    const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
25709    checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
25710}
25711/**
25712 *
25713 * Update an interpolated class on an element with 8 bound values surrounded by text.
25714 *
25715 * Used when the value passed to a property has 8 interpolated values in it:
25716 *
25717 * ```html
25718 * <div class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
25719 * ```
25720 *
25721 * Its compiled representation is:
25722 *
25723 * ```ts
25724 * ɵɵclassMapInterpolate8(
25725 *  'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');
25726 * ```
25727 *
25728 * @param prefix Static value used for concatenation only.
25729 * @param v0 Value checked for change.
25730 * @param i0 Static value used for concatenation only.
25731 * @param v1 Value checked for change.
25732 * @param i1 Static value used for concatenation only.
25733 * @param v2 Value checked for change.
25734 * @param i2 Static value used for concatenation only.
25735 * @param v3 Value checked for change.
25736 * @param i3 Static value used for concatenation only.
25737 * @param v4 Value checked for change.
25738 * @param i4 Static value used for concatenation only.
25739 * @param v5 Value checked for change.
25740 * @param i5 Static value used for concatenation only.
25741 * @param v6 Value checked for change.
25742 * @param i6 Static value used for concatenation only.
25743 * @param v7 Value checked for change.
25744 * @param suffix Static value used for concatenation only.
25745 * @codeGenApi
25746 */
25747function ɵɵclassMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
25748    const lView = getLView();
25749    const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
25750    checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
25751}
25752/**
25753 * Update an interpolated class on an element with 9 or more bound values surrounded by text.
25754 *
25755 * Used when the number of interpolated values exceeds 8.
25756 *
25757 * ```html
25758 * <div
25759 *  class="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix"></div>
25760 * ```
25761 *
25762 * Its compiled representation is:
25763 *
25764 * ```ts
25765 * ɵɵclassMapInterpolateV(
25766 *  ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
25767 *  'suffix']);
25768 * ```
25769 *.
25770 * @param values The collection of values and the strings in-between those values, beginning with
25771 * a string prefix and ending with a string suffix.
25772 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
25773 * @codeGenApi
25774 */
25775function ɵɵclassMapInterpolateV(values) {
25776    const lView = getLView();
25777    const interpolatedValue = interpolationV(lView, values);
25778    checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
25779}
25780
25781/**
25782 * @license
25783 * Copyright Google LLC All Rights Reserved.
25784 *
25785 * Use of this source code is governed by an MIT-style license that can be
25786 * found in the LICENSE file at https://angular.io/license
25787 */
25788/**
25789 *
25790 * Update an interpolated style on an element with single bound value surrounded by text.
25791 *
25792 * Used when the value passed to a property has 1 interpolated value in it:
25793 *
25794 * ```html
25795 * <div style="key: {{v0}}suffix"></div>
25796 * ```
25797 *
25798 * Its compiled representation is:
25799 *
25800 * ```ts
25801 * ɵɵstyleMapInterpolate1('key: ', v0, 'suffix');
25802 * ```
25803 *
25804 * @param prefix Static value used for concatenation only.
25805 * @param v0 Value checked for change.
25806 * @param suffix Static value used for concatenation only.
25807 * @codeGenApi
25808 */
25809function ɵɵstyleMapInterpolate1(prefix, v0, suffix) {
25810    const lView = getLView();
25811    const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
25812    ɵɵstyleMap(interpolatedValue);
25813}
25814/**
25815 *
25816 * Update an interpolated style on an element with 2 bound values surrounded by text.
25817 *
25818 * Used when the value passed to a property has 2 interpolated values in it:
25819 *
25820 * ```html
25821 * <div style="key: {{v0}}; key1: {{v1}}suffix"></div>
25822 * ```
25823 *
25824 * Its compiled representation is:
25825 *
25826 * ```ts
25827 * ɵɵstyleMapInterpolate2('key: ', v0, '; key1: ', v1, 'suffix');
25828 * ```
25829 *
25830 * @param prefix Static value used for concatenation only.
25831 * @param v0 Value checked for change.
25832 * @param i0 Static value used for concatenation only.
25833 * @param v1 Value checked for change.
25834 * @param suffix Static value used for concatenation only.
25835 * @codeGenApi
25836 */
25837function ɵɵstyleMapInterpolate2(prefix, v0, i0, v1, suffix) {
25838    const lView = getLView();
25839    const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
25840    ɵɵstyleMap(interpolatedValue);
25841}
25842/**
25843 *
25844 * Update an interpolated style on an element with 3 bound values surrounded by text.
25845 *
25846 * Used when the value passed to a property has 3 interpolated values in it:
25847 *
25848 * ```html
25849 * <div style="key: {{v0}}; key2: {{v1}}; key2: {{v2}}suffix"></div>
25850 * ```
25851 *
25852 * Its compiled representation is:
25853 *
25854 * ```ts
25855 * ɵɵstyleMapInterpolate3(
25856 *     'key: ', v0, '; key1: ', v1, '; key2: ', v2, 'suffix');
25857 * ```
25858 *
25859 * @param prefix Static value used for concatenation only.
25860 * @param v0 Value checked for change.
25861 * @param i0 Static value used for concatenation only.
25862 * @param v1 Value checked for change.
25863 * @param i1 Static value used for concatenation only.
25864 * @param v2 Value checked for change.
25865 * @param suffix Static value used for concatenation only.
25866 * @codeGenApi
25867 */
25868function ɵɵstyleMapInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {
25869    const lView = getLView();
25870    const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
25871    ɵɵstyleMap(interpolatedValue);
25872}
25873/**
25874 *
25875 * Update an interpolated style on an element with 4 bound values surrounded by text.
25876 *
25877 * Used when the value passed to a property has 4 interpolated values in it:
25878 *
25879 * ```html
25880 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}suffix"></div>
25881 * ```
25882 *
25883 * Its compiled representation is:
25884 *
25885 * ```ts
25886 * ɵɵstyleMapInterpolate4(
25887 *     'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, 'suffix');
25888 * ```
25889 *
25890 * @param prefix Static value used for concatenation only.
25891 * @param v0 Value checked for change.
25892 * @param i0 Static value used for concatenation only.
25893 * @param v1 Value checked for change.
25894 * @param i1 Static value used for concatenation only.
25895 * @param v2 Value checked for change.
25896 * @param i2 Static value used for concatenation only.
25897 * @param v3 Value checked for change.
25898 * @param suffix Static value used for concatenation only.
25899 * @codeGenApi
25900 */
25901function ɵɵstyleMapInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
25902    const lView = getLView();
25903    const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
25904    ɵɵstyleMap(interpolatedValue);
25905}
25906/**
25907 *
25908 * Update an interpolated style on an element with 5 bound values surrounded by text.
25909 *
25910 * Used when the value passed to a property has 5 interpolated values in it:
25911 *
25912 * ```html
25913 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}suffix"></div>
25914 * ```
25915 *
25916 * Its compiled representation is:
25917 *
25918 * ```ts
25919 * ɵɵstyleMapInterpolate5(
25920 *     'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, 'suffix');
25921 * ```
25922 *
25923 * @param prefix Static value used for concatenation only.
25924 * @param v0 Value checked for change.
25925 * @param i0 Static value used for concatenation only.
25926 * @param v1 Value checked for change.
25927 * @param i1 Static value used for concatenation only.
25928 * @param v2 Value checked for change.
25929 * @param i2 Static value used for concatenation only.
25930 * @param v3 Value checked for change.
25931 * @param i3 Static value used for concatenation only.
25932 * @param v4 Value checked for change.
25933 * @param suffix Static value used for concatenation only.
25934 * @codeGenApi
25935 */
25936function ɵɵstyleMapInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
25937    const lView = getLView();
25938    const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
25939    ɵɵstyleMap(interpolatedValue);
25940}
25941/**
25942 *
25943 * Update an interpolated style on an element with 6 bound values surrounded by text.
25944 *
25945 * Used when the value passed to a property has 6 interpolated values in it:
25946 *
25947 * ```html
25948 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}};
25949 *             key5: {{v5}}suffix"></div>
25950 * ```
25951 *
25952 * Its compiled representation is:
25953 *
25954 * ```ts
25955 * ɵɵstyleMapInterpolate6(
25956 *    'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
25957 *    'suffix');
25958 * ```
25959 *
25960 * @param prefix Static value used for concatenation only.
25961 * @param v0 Value checked for change.
25962 * @param i0 Static value used for concatenation only.
25963 * @param v1 Value checked for change.
25964 * @param i1 Static value used for concatenation only.
25965 * @param v2 Value checked for change.
25966 * @param i2 Static value used for concatenation only.
25967 * @param v3 Value checked for change.
25968 * @param i3 Static value used for concatenation only.
25969 * @param v4 Value checked for change.
25970 * @param i4 Static value used for concatenation only.
25971 * @param v5 Value checked for change.
25972 * @param suffix Static value used for concatenation only.
25973 * @codeGenApi
25974 */
25975function ɵɵstyleMapInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
25976    const lView = getLView();
25977    const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
25978    ɵɵstyleMap(interpolatedValue);
25979}
25980/**
25981 *
25982 * Update an interpolated style on an element with 7 bound values surrounded by text.
25983 *
25984 * Used when the value passed to a property has 7 interpolated values in it:
25985 *
25986 * ```html
25987 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};
25988 *             key6: {{v6}}suffix"></div>
25989 * ```
25990 *
25991 * Its compiled representation is:
25992 *
25993 * ```ts
25994 * ɵɵstyleMapInterpolate7(
25995 *    'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
25996 *    '; key6: ', v6, 'suffix');
25997 * ```
25998 *
25999 * @param prefix Static value used for concatenation only.
26000 * @param v0 Value checked for change.
26001 * @param i0 Static value used for concatenation only.
26002 * @param v1 Value checked for change.
26003 * @param i1 Static value used for concatenation only.
26004 * @param v2 Value checked for change.
26005 * @param i2 Static value used for concatenation only.
26006 * @param v3 Value checked for change.
26007 * @param i3 Static value used for concatenation only.
26008 * @param v4 Value checked for change.
26009 * @param i4 Static value used for concatenation only.
26010 * @param v5 Value checked for change.
26011 * @param i5 Static value used for concatenation only.
26012 * @param v6 Value checked for change.
26013 * @param suffix Static value used for concatenation only.
26014 * @codeGenApi
26015 */
26016function ɵɵstyleMapInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
26017    const lView = getLView();
26018    const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
26019    ɵɵstyleMap(interpolatedValue);
26020}
26021/**
26022 *
26023 * Update an interpolated style on an element with 8 bound values surrounded by text.
26024 *
26025 * Used when the value passed to a property has 8 interpolated values in it:
26026 *
26027 * ```html
26028 * <div style="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};
26029 *             key6: {{v6}}; key7: {{v7}}suffix"></div>
26030 * ```
26031 *
26032 * Its compiled representation is:
26033 *
26034 * ```ts
26035 * ɵɵstyleMapInterpolate8(
26036 *    'key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
26037 *    '; key6: ', v6, '; key7: ', v7, 'suffix');
26038 * ```
26039 *
26040 * @param prefix Static value used for concatenation only.
26041 * @param v0 Value checked for change.
26042 * @param i0 Static value used for concatenation only.
26043 * @param v1 Value checked for change.
26044 * @param i1 Static value used for concatenation only.
26045 * @param v2 Value checked for change.
26046 * @param i2 Static value used for concatenation only.
26047 * @param v3 Value checked for change.
26048 * @param i3 Static value used for concatenation only.
26049 * @param v4 Value checked for change.
26050 * @param i4 Static value used for concatenation only.
26051 * @param v5 Value checked for change.
26052 * @param i5 Static value used for concatenation only.
26053 * @param v6 Value checked for change.
26054 * @param i6 Static value used for concatenation only.
26055 * @param v7 Value checked for change.
26056 * @param suffix Static value used for concatenation only.
26057 * @codeGenApi
26058 */
26059function ɵɵstyleMapInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
26060    const lView = getLView();
26061    const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
26062    ɵɵstyleMap(interpolatedValue);
26063}
26064/**
26065 * Update an interpolated style on an element with 9 or more bound values surrounded by text.
26066 *
26067 * Used when the number of interpolated values exceeds 8.
26068 *
26069 * ```html
26070 * <div
26071 *  class="key: {{v0}}; key1: {{v1}}; key2: {{v2}}; key3: {{v3}}; key4: {{v4}}; key5: {{v5}};
26072 *         key6: {{v6}}; key7: {{v7}}; key8: {{v8}}; key9: {{v9}}suffix"></div>
26073 * ```
26074 *
26075 * Its compiled representation is:
26076 *
26077 * ```ts
26078 * ɵɵstyleMapInterpolateV(
26079 *    ['key: ', v0, '; key1: ', v1, '; key2: ', v2, '; key3: ', v3, '; key4: ', v4, '; key5: ', v5,
26080 *     '; key6: ', v6, '; key7: ', v7, '; key8: ', v8, '; key9: ', v9, 'suffix']);
26081 * ```
26082 *.
26083 * @param values The collection of values and the strings in-between those values, beginning with
26084 * a string prefix and ending with a string suffix.
26085 * (e.g. `['prefix', value0, '; key2: ', value1, '; key2: ', value2, ..., value99, 'suffix']`)
26086 * @codeGenApi
26087 */
26088function ɵɵstyleMapInterpolateV(values) {
26089    const lView = getLView();
26090    const interpolatedValue = interpolationV(lView, values);
26091    ɵɵstyleMap(interpolatedValue);
26092}
26093
26094/**
26095 * @license
26096 * Copyright Google LLC All Rights Reserved.
26097 *
26098 * Use of this source code is governed by an MIT-style license that can be
26099 * found in the LICENSE file at https://angular.io/license
26100 */
26101/**
26102 *
26103 * Update an interpolated style property on an element with single bound value surrounded by text.
26104 *
26105 * Used when the value passed to a property has 1 interpolated value in it:
26106 *
26107 * ```html
26108 * <div style.color="prefix{{v0}}suffix"></div>
26109 * ```
26110 *
26111 * Its compiled representation is:
26112 *
26113 * ```ts
26114 * ɵɵstylePropInterpolate1(0, 'prefix', v0, 'suffix');
26115 * ```
26116 *
26117 * @param styleIndex Index of style to update. This index value refers to the
26118 *        index of the style in the style bindings array that was passed into
26119 *        `styling`.
26120 * @param prefix Static value used for concatenation only.
26121 * @param v0 Value checked for change.
26122 * @param suffix Static value used for concatenation only.
26123 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
26124 * @returns itself, so that it may be chained.
26125 * @codeGenApi
26126 */
26127function ɵɵstylePropInterpolate1(prop, prefix, v0, suffix, valueSuffix) {
26128    const lView = getLView();
26129    const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
26130    checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
26131    return ɵɵstylePropInterpolate1;
26132}
26133/**
26134 *
26135 * Update an interpolated style property on an element with 2 bound values surrounded by text.
26136 *
26137 * Used when the value passed to a property has 2 interpolated values in it:
26138 *
26139 * ```html
26140 * <div style.color="prefix{{v0}}-{{v1}}suffix"></div>
26141 * ```
26142 *
26143 * Its compiled representation is:
26144 *
26145 * ```ts
26146 * ɵɵstylePropInterpolate2(0, 'prefix', v0, '-', v1, 'suffix');
26147 * ```
26148 *
26149 * @param styleIndex Index of style to update. This index value refers to the
26150 *        index of the style in the style bindings array that was passed into
26151 *        `styling`.
26152 * @param prefix Static value used for concatenation only.
26153 * @param v0 Value checked for change.
26154 * @param i0 Static value used for concatenation only.
26155 * @param v1 Value checked for change.
26156 * @param suffix Static value used for concatenation only.
26157 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
26158 * @returns itself, so that it may be chained.
26159 * @codeGenApi
26160 */
26161function ɵɵstylePropInterpolate2(prop, prefix, v0, i0, v1, suffix, valueSuffix) {
26162    const lView = getLView();
26163    const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
26164    checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
26165    return ɵɵstylePropInterpolate2;
26166}
26167/**
26168 *
26169 * Update an interpolated style property on an element with 3 bound values surrounded by text.
26170 *
26171 * Used when the value passed to a property has 3 interpolated values in it:
26172 *
26173 * ```html
26174 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
26175 * ```
26176 *
26177 * Its compiled representation is:
26178 *
26179 * ```ts
26180 * ɵɵstylePropInterpolate3(0, 'prefix', v0, '-', v1, '-', v2, 'suffix');
26181 * ```
26182 *
26183 * @param styleIndex Index of style to update. This index value refers to the
26184 *        index of the style in the style bindings array that was passed into
26185 *        `styling`.
26186 * @param prefix Static value used for concatenation only.
26187 * @param v0 Value checked for change.
26188 * @param i0 Static value used for concatenation only.
26189 * @param v1 Value checked for change.
26190 * @param i1 Static value used for concatenation only.
26191 * @param v2 Value checked for change.
26192 * @param suffix Static value used for concatenation only.
26193 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
26194 * @returns itself, so that it may be chained.
26195 * @codeGenApi
26196 */
26197function ɵɵstylePropInterpolate3(prop, prefix, v0, i0, v1, i1, v2, suffix, valueSuffix) {
26198    const lView = getLView();
26199    const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
26200    checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
26201    return ɵɵstylePropInterpolate3;
26202}
26203/**
26204 *
26205 * Update an interpolated style property on an element with 4 bound values surrounded by text.
26206 *
26207 * Used when the value passed to a property has 4 interpolated values in it:
26208 *
26209 * ```html
26210 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
26211 * ```
26212 *
26213 * Its compiled representation is:
26214 *
26215 * ```ts
26216 * ɵɵstylePropInterpolate4(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
26217 * ```
26218 *
26219 * @param styleIndex Index of style to update. This index value refers to the
26220 *        index of the style in the style bindings array that was passed into
26221 *        `styling`.
26222 * @param prefix Static value used for concatenation only.
26223 * @param v0 Value checked for change.
26224 * @param i0 Static value used for concatenation only.
26225 * @param v1 Value checked for change.
26226 * @param i1 Static value used for concatenation only.
26227 * @param v2 Value checked for change.
26228 * @param i2 Static value used for concatenation only.
26229 * @param v3 Value checked for change.
26230 * @param suffix Static value used for concatenation only.
26231 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
26232 * @returns itself, so that it may be chained.
26233 * @codeGenApi
26234 */
26235function ɵɵstylePropInterpolate4(prop, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, valueSuffix) {
26236    const lView = getLView();
26237    const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
26238    checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
26239    return ɵɵstylePropInterpolate4;
26240}
26241/**
26242 *
26243 * Update an interpolated style property on an element with 5 bound values surrounded by text.
26244 *
26245 * Used when the value passed to a property has 5 interpolated values in it:
26246 *
26247 * ```html
26248 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
26249 * ```
26250 *
26251 * Its compiled representation is:
26252 *
26253 * ```ts
26254 * ɵɵstylePropInterpolate5(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
26255 * ```
26256 *
26257 * @param styleIndex Index of style to update. This index value refers to the
26258 *        index of the style in the style bindings array that was passed into
26259 *        `styling`.
26260 * @param prefix Static value used for concatenation only.
26261 * @param v0 Value checked for change.
26262 * @param i0 Static value used for concatenation only.
26263 * @param v1 Value checked for change.
26264 * @param i1 Static value used for concatenation only.
26265 * @param v2 Value checked for change.
26266 * @param i2 Static value used for concatenation only.
26267 * @param v3 Value checked for change.
26268 * @param i3 Static value used for concatenation only.
26269 * @param v4 Value checked for change.
26270 * @param suffix Static value used for concatenation only.
26271 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
26272 * @returns itself, so that it may be chained.
26273 * @codeGenApi
26274 */
26275function ɵɵstylePropInterpolate5(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, valueSuffix) {
26276    const lView = getLView();
26277    const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
26278    checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
26279    return ɵɵstylePropInterpolate5;
26280}
26281/**
26282 *
26283 * Update an interpolated style property on an element with 6 bound values surrounded by text.
26284 *
26285 * Used when the value passed to a property has 6 interpolated values in it:
26286 *
26287 * ```html
26288 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
26289 * ```
26290 *
26291 * Its compiled representation is:
26292 *
26293 * ```ts
26294 * ɵɵstylePropInterpolate6(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
26295 * ```
26296 *
26297 * @param styleIndex Index of style to update. This index value refers to the
26298 *        index of the style in the style bindings array that was passed into
26299 *        `styling`.
26300 * @param prefix Static value used for concatenation only.
26301 * @param v0 Value checked for change.
26302 * @param i0 Static value used for concatenation only.
26303 * @param v1 Value checked for change.
26304 * @param i1 Static value used for concatenation only.
26305 * @param v2 Value checked for change.
26306 * @param i2 Static value used for concatenation only.
26307 * @param v3 Value checked for change.
26308 * @param i3 Static value used for concatenation only.
26309 * @param v4 Value checked for change.
26310 * @param i4 Static value used for concatenation only.
26311 * @param v5 Value checked for change.
26312 * @param suffix Static value used for concatenation only.
26313 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
26314 * @returns itself, so that it may be chained.
26315 * @codeGenApi
26316 */
26317function ɵɵstylePropInterpolate6(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix, valueSuffix) {
26318    const lView = getLView();
26319    const interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
26320    checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
26321    return ɵɵstylePropInterpolate6;
26322}
26323/**
26324 *
26325 * Update an interpolated style property on an element with 7 bound values surrounded by text.
26326 *
26327 * Used when the value passed to a property has 7 interpolated values in it:
26328 *
26329 * ```html
26330 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix"></div>
26331 * ```
26332 *
26333 * Its compiled representation is:
26334 *
26335 * ```ts
26336 * ɵɵstylePropInterpolate7(
26337 *    0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');
26338 * ```
26339 *
26340 * @param styleIndex Index of style to update. This index value refers to the
26341 *        index of the style in the style bindings array that was passed into
26342 *        `styling`.
26343 * @param prefix Static value used for concatenation only.
26344 * @param v0 Value checked for change.
26345 * @param i0 Static value used for concatenation only.
26346 * @param v1 Value checked for change.
26347 * @param i1 Static value used for concatenation only.
26348 * @param v2 Value checked for change.
26349 * @param i2 Static value used for concatenation only.
26350 * @param v3 Value checked for change.
26351 * @param i3 Static value used for concatenation only.
26352 * @param v4 Value checked for change.
26353 * @param i4 Static value used for concatenation only.
26354 * @param v5 Value checked for change.
26355 * @param i5 Static value used for concatenation only.
26356 * @param v6 Value checked for change.
26357 * @param suffix Static value used for concatenation only.
26358 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
26359 * @returns itself, so that it may be chained.
26360 * @codeGenApi
26361 */
26362function ɵɵstylePropInterpolate7(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, valueSuffix) {
26363    const lView = getLView();
26364    const interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
26365    checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
26366    return ɵɵstylePropInterpolate7;
26367}
26368/**
26369 *
26370 * Update an interpolated style property on an element with 8 bound values surrounded by text.
26371 *
26372 * Used when the value passed to a property has 8 interpolated values in it:
26373 *
26374 * ```html
26375 * <div style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix"></div>
26376 * ```
26377 *
26378 * Its compiled representation is:
26379 *
26380 * ```ts
26381 * ɵɵstylePropInterpolate8(0, 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6,
26382 * '-', v7, 'suffix');
26383 * ```
26384 *
26385 * @param styleIndex Index of style to update. This index value refers to the
26386 *        index of the style in the style bindings array that was passed into
26387 *        `styling`.
26388 * @param prefix Static value used for concatenation only.
26389 * @param v0 Value checked for change.
26390 * @param i0 Static value used for concatenation only.
26391 * @param v1 Value checked for change.
26392 * @param i1 Static value used for concatenation only.
26393 * @param v2 Value checked for change.
26394 * @param i2 Static value used for concatenation only.
26395 * @param v3 Value checked for change.
26396 * @param i3 Static value used for concatenation only.
26397 * @param v4 Value checked for change.
26398 * @param i4 Static value used for concatenation only.
26399 * @param v5 Value checked for change.
26400 * @param i5 Static value used for concatenation only.
26401 * @param v6 Value checked for change.
26402 * @param i6 Static value used for concatenation only.
26403 * @param v7 Value checked for change.
26404 * @param suffix Static value used for concatenation only.
26405 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
26406 * @returns itself, so that it may be chained.
26407 * @codeGenApi
26408 */
26409function ɵɵstylePropInterpolate8(prop, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, valueSuffix) {
26410    const lView = getLView();
26411    const interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
26412    checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
26413    return ɵɵstylePropInterpolate8;
26414}
26415/**
26416 * Update an interpolated style property on an element with 9 or more bound values surrounded by
26417 * text.
26418 *
26419 * Used when the number of interpolated values exceeds 8.
26420 *
26421 * ```html
26422 * <div
26423 *  style.color="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix">
26424 * </div>
26425 * ```
26426 *
26427 * Its compiled representation is:
26428 *
26429 * ```ts
26430 * ɵɵstylePropInterpolateV(
26431 *  0, ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,
26432 *  'suffix']);
26433 * ```
26434 *
26435 * @param styleIndex Index of style to update. This index value refers to the
26436 *        index of the style in the style bindings array that was passed into
26437 *        `styling`..
26438 * @param values The collection of values and the strings in-between those values, beginning with
26439 * a string prefix and ending with a string suffix.
26440 * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
26441 * @param valueSuffix Optional suffix. Used with scalar values to add unit such as `px`.
26442 * @returns itself, so that it may be chained.
26443 * @codeGenApi
26444 */
vendor: 5,646 bytes, lines 26445-26583
26445function ɵɵstylePropInterpolateV(prop, values, valueSuffix) {
26446    const lView = getLView();
26447    const interpolatedValue = interpolationV(lView, values);
26448    checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
26449    return ɵɵstylePropInterpolateV;
26450}
26451
26452/**
26453 * @license
26454 * Copyright Google LLC All Rights Reserved.
26455 *
26456 * Use of this source code is governed by an MIT-style license that can be
26457 * found in the LICENSE file at https://angular.io/license
26458 */
26459/**
26460 * Update a property on a host element. Only applies to native node properties, not inputs.
26461 *
26462 * Operates on the element selected by index via the {@link select} instruction.
26463 *
26464 * @param propName Name of property. Because it is going to DOM, this is not subject to
26465 *        renaming as part of minification.
26466 * @param value New value to write.
26467 * @param sanitizer An optional function used to sanitize the value.
26468 * @returns This function returns itself so that it may be chained
26469 * (e.g. `property('name', ctx.name)('title', ctx.title)`)
26470 *
26471 * @codeGenApi
26472 */
26473function ɵɵhostProperty(propName, value, sanitizer) {
26474    const lView = getLView();
26475    const bindingIndex = nextBindingIndex();
26476    if (bindingUpdated(lView, bindingIndex, value)) {
26477        const tView = getTView();
26478        const tNode = getSelectedTNode();
26479        elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, true);
26480        ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
26481    }
26482    return ɵɵhostProperty;
26483}
26484/**
26485 * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive.
26486 *
26487 * This instruction is for compatibility purposes and is designed to ensure that a
26488 * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in
26489 * the component's renderer. Normally all host bindings are evaluated with the parent
26490 * component's renderer, but, in the case of animation @triggers, they need to be
26491 * evaluated with the sub component's renderer (because that's where the animation
26492 * triggers are defined).
26493 *
26494 * Do not use this instruction as a replacement for `elementProperty`. This instruction
26495 * only exists to ensure compatibility with the ViewEngine's host binding behavior.
26496 *
26497 * @param index The index of the element to update in the data array
26498 * @param propName Name of property. Because it is going to DOM, this is not subject to
26499 *        renaming as part of minification.
26500 * @param value New value to write.
26501 * @param sanitizer An optional function used to sanitize the value.
26502 *
26503 * @codeGenApi
26504 */
26505function ɵɵsyntheticHostProperty(propName, value, sanitizer) {
26506    const lView = getLView();
26507    const bindingIndex = nextBindingIndex();
26508    if (bindingUpdated(lView, bindingIndex, value)) {
26509        const tView = getTView();
26510        const tNode = getSelectedTNode();
26511        const currentDef = getCurrentDirectiveDef(tView.data);
26512        const renderer = loadComponentRenderer(currentDef, tNode, lView);
26513        elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, true);
26514        ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
26515    }
26516    return ɵɵsyntheticHostProperty;
26517}
26518
26519/**
26520 * @license
26521 * Copyright Google LLC All Rights Reserved.
26522 *
26523 * Use of this source code is governed by an MIT-style license that can be
26524 * found in the LICENSE file at https://angular.io/license
26525 */
26526/**
26527 * NOTE: changes to the `ngI18nClosureMode` name must be synced with `compiler-cli/src/tooling.ts`.
26528 */
26529if (typeof ngI18nClosureMode === 'undefined') {
26530    // These property accesses can be ignored because ngI18nClosureMode will be set to false
26531    // when optimizing code and the whole if statement will be dropped.
26532    // Make sure to refer to ngI18nClosureMode as ['ngI18nClosureMode'] for closure.
26533    // NOTE: we need to have it in IIFE so that the tree-shaker is happy.
26534    (function () {
26535        // tslint:disable-next-line:no-toplevel-property-access
26536        _global['ngI18nClosureMode'] =
26537            // TODO(FW-1250): validate that this actually, you know, works.
26538            // tslint:disable-next-line:no-toplevel-property-access
26539            typeof goog !== 'undefined' && typeof goog.getMsg === 'function';
26540    })();
26541}
26542
26543/**
26544 * @license
26545 * Copyright Google LLC All Rights Reserved.
26546 *
26547 * Use of this source code is governed by an MIT-style license that can be
26548 * found in the LICENSE file at https://angular.io/license
26549 */
26550// THIS CODE IS GENERATED - DO NOT MODIFY
26551// See angular/tools/gulp-tasks/cldr/extract.js
26552const u = undefined;
26553function plural(n) {
26554    let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
26555    if (i === 1 && v === 0)
26556        return 1;
26557    return 5;
26558}
26559var localeEn = [
26560    'en',
26561    [['a', 'p'], ['AM', 'PM'], u],
26562    [['AM', 'PM'], u, u],
26563    [
26564        ['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
26565        ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
26566        ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
26567    ],
26568    u,
26569    [
26570        ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
26571        ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
26572        [
26573            'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
26574            'October', 'November', 'December'
26575        ]
26576    ],
26577    u,
26578    [['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']],
26579    0,
26580    [6, 0],
26581    ['M/d/yy', 'MMM d, y', 'MMMM d, y', 'EEEE, MMMM d, y'],
26582    ['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'],
26583    ['{1}
26583, {0}', u, '{1} \'at\' {0}', u],
26584    ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],
26585    ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'],
26586    'USD',
26587    '$',
26588    'US Dollar',
26589    {},
26590    'ltr',
26591    plural
26592];
26593
26594/**
26595 * @license
26596 * Copyright Google LLC All Rights Reserved.
26597 *
26598 * Use of this source code is governed by an MIT-style license that can be
26599 * found in the LICENSE file at https://angular.io/license
26600 */
26601/**
26602 * This const is used to store the locale data registered with `registerLocaleData`
26603 */
26604let LOCALE_DATA = {};
26605/**
26606 * Register locale data to be used internally by Angular. See the
26607 * ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale data.
26608 *
26609 * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1
26610 */
26611function registerLocaleData(data, localeId, extraData) {
26612    if (typeof localeId !== 'string') {
26613        extraData = localeId;
26614        localeId = data[LocaleDataIndex.LocaleId];
26615    }
26616    localeId = localeId.toLowerCase().replace(/_/g, '-');
26617    LOCALE_DATA[localeId] = data;
26618    if (extraData) {
26619        LOCALE_DATA[localeId][LocaleDataIndex.ExtraData] = extraData;
26620    }
26621}
26622/**
26623 * Finds the locale data for a given locale.
26624 *
26625 * @param locale The locale code.
26626 * @returns The locale data.
26627 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
26628 */
26629function findLocaleData(locale) {
26630    const normalizedLocale = normalizeLocale(locale);
26631    let match = getLocaleData(normalizedLocale);
26632    if (match) {
26633        return match;
26634    }
26635    // let's try to find a parent locale
26636    const parentLocale = normalizedLocale.split('-')[0];
26637    match = getLocaleData(parentLocale);
26638    if (match) {
26639        return match;
26640    }
26641    if (parentLocale === 'en') {
26642        return localeEn;
26643    }
26644    throw new Error(`Missing locale data for the locale "${locale}".`);
26645}
26646/**
26647 * Retrieves the default currency code for the given locale.
26648 *
26649 * The default is defined as the first currency which is still in use.
26650 *
26651 * @param locale The code of the locale whose currency code we want.
26652 * @returns The code of the default currency for the given locale.
26653 *
26654 */
26655function getLocaleCurrencyCode(locale) {
26656    const data = findLocaleData(locale);
26657    return data[LocaleDataIndex.CurrencyCode] || null;
26658}
26659/**
26660 * Retrieves the plural function used by ICU expressions to determine the plural case to use
26661 * for a given locale.
26662 * @param locale A locale code for the locale format rules to use.
26663 * @returns The plural function for the locale.
26664 * @see `NgPlural`
26665 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
26666 */
26667function getLocalePluralCase(locale) {
26668    const data = findLocaleData(locale);
26669    return data[LocaleDataIndex.PluralCase];
26670}
26671/**
26672 * Helper function to get the given `normalizedLocale` from `LOCALE_DATA`
26673 * or from the global `ng.common.locale`.
26674 */
26675function getLocaleData(normalizedLocale) {
26676    if (!(normalizedLocale in LOCALE_DATA)) {
26677        LOCALE_DATA[normalizedLocale] = _global.ng && _global.ng.common && _global.ng.common.locales &&
26678            _global.ng.common.locales[normalizedLocale];
26679    }
26680    return LOCALE_DATA[normalizedLocale];
26681}
26682/**
26683 * Helper function to remove all the locale data from `LOCALE_DATA`.
26684 */
26685function unregisterAllLocaleData() {
26686    LOCALE_DATA = {};
26687}
26688/**
26689 * Index of each type of locale data from the locale data array
26690 */
26691var LocaleDataIndex;
26692(function (LocaleDataIndex) {
26693    LocaleDataIndex[LocaleDataIndex["LocaleId"] = 0] = "LocaleId";
26694    LocaleDataIndex[LocaleDataIndex["DayPeriodsFormat"] = 1] = "DayPeriodsFormat";
26695    LocaleDataIndex[LocaleDataIndex["DayPeriodsStandalone"] = 2] = "DayPeriodsStandalone";
26696    LocaleDataIndex[LocaleDataIndex["DaysFormat"] = 3] = "DaysFormat";
26697    LocaleDataIndex[LocaleDataIndex["DaysStandalone"] = 4] = "DaysStandalone";
26698    LocaleDataIndex[LocaleDataIndex["MonthsFormat"] = 5] = "MonthsFormat";
26699    LocaleDataIndex[LocaleDataIndex["MonthsStandalone"] = 6] = "MonthsStandalone";
26700    LocaleDataIndex[LocaleDataIndex["Eras"] = 7] = "Eras";
26701    LocaleDataIndex[LocaleDataIndex["FirstDayOfWeek"] = 8] = "FirstDayOfWeek";
26702    LocaleDataIndex[LocaleDataIndex["WeekendRange"] = 9] = "WeekendRange";
26703    LocaleDataIndex[LocaleDataIndex["DateFormat"] = 10] = "DateFormat";
26704    LocaleDataIndex[LocaleDataIndex["TimeFormat"] = 11] = "TimeFormat";
26705    LocaleDataIndex[LocaleDataIndex["DateTimeFormat"] = 12] = "DateTimeFormat";
26706    LocaleDataIndex[LocaleDataIndex["NumberSymbols"] = 13] = "NumberSymbols";
26707    LocaleDataIndex[LocaleDataIndex["NumberFormats"] = 14] = "NumberFormats";
26708    LocaleDataIndex[LocaleDataIndex["CurrencyCode"] = 15] = "CurrencyCode";
26709    LocaleDataIndex[LocaleDataIndex["CurrencySymbol"] = 16] = "CurrencySymbol";
26710    LocaleDataIndex[LocaleDataIndex["CurrencyName"] = 17] = "CurrencyName";
26711    LocaleDataIndex[LocaleDataIndex["Currencies"] = 18] = "Currencies";
26712    LocaleDataIndex[LocaleDataIndex["Directionality"] = 19] = "Directionality";
26713    LocaleDataIndex[LocaleDataIndex["PluralCase"] = 20] = "PluralCase";
26714    LocaleDataIndex[LocaleDataIndex["ExtraData"] = 21] = "ExtraData";
26715})(LocaleDataIndex || (LocaleDataIndex = {}));
26716/**
26717 * Returns the canonical form of a locale name - lowercase with `_` replaced with `-`.
26718 */
26719function normalizeLocale(locale) {
26720    return locale.toLowerCase().replace(/_/g, '-');
26721}
26722
26723/**
26724 * @license
26725 * Copyright Google LLC All Rights Reserved.
26726 *
26727 * Use of this source code is governed by an MIT-style license that can be
26728 * found in the LICENSE file at https://angular.io/license
26729 */
26730const pluralMapping = ['zero', 'one', 'two', 'few', 'many'];
26731/**
26732 * Returns the plural case based on the locale
26733 */
26734function getPluralCase(value, locale) {
26735    const plural = getLocalePluralCase(locale)(parseInt(value, 10));
26736    const result = pluralMapping[plural];
26737    return (result !== undefined) ? result : 'other';
26738}
26739/**
26740 * The locale id that the application is using by default (for translations and ICU expressions).
26741 */
26742const DEFAULT_LOCALE_ID = 'en-US';
26743/**
26744 * USD currency code that the application uses by default for CurrencyPipe when no
26745 * DEFAULT_CURRENCY_CODE is provided.
26746 */
26747const USD_CURRENCY_CODE = 'USD';
26748
26749/**
26750 * @license
26751 * Copyright Google LLC All Rights Reserved.
26752 *
26753 * Use of this source code is governed by an MIT-style license that can be
26754 * found in the LICENSE file at https://angular.io/license
26755 */
26756/**
26757 * Marks that the next string is an element name.
26758 *
26759 * See `I18nMutateOpCodes` documentation.
26760 */
26761const ELEMENT_MARKER = {
26762    marker: 'element'
26763};
26764/**
26765 * Marks that the next string is comment text need for ICU.
26766 *
26767 * See `I18nMutateOpCodes` documentation.
26768 */
26769const ICU_MARKER = {
26770    marker: 'ICU'
26771};
26772/**
26773 * See `I18nCreateOpCodes`
26774 */
26775var I18nCreateOpCode;
26776(function (I18nCreateOpCode) {
26777    /**
26778     * Number of bits to shift index so that it can be combined with the `APPEND_EAGERLY` and
26779     * `COMMENT`.
26780     */
26781    I18nCreateOpCode[I18nCreateOpCode["SHIFT"] = 2] = "SHIFT";
26782    /**
26783     * Should the node be appended to parent imedditatly after creation.
26784     */
26785    I18nCreateOpCode[I18nCreateOpCode["APPEND_EAGERLY"] = 1] = "APPEND_EAGERLY";
26786    /**
26787     * If set the node should be comment (rather than a text) node.
26788     */
26789    I18nCreateOpCode[I18nCreateOpCode["COMMENT"] = 2] = "COMMENT";
26790})(I18nCreateOpCode || (I18nCreateOpCode = {}));
26791// Note: This hack is necessary so we don't erroneously get a circular dependency
26792// failure based on types.
26793const unusedValueExportToPlacateAjd$6 = 1;
26794
26795/**
26796 * @license
26797 * Copyright Google LLC All Rights Reserved.
26798 *
26799 * Use of this source code is governed by an MIT-style license that can be
26800 * found in the LICENSE file at https://angular.io/license
26801 */
26802/**
26803 * The locale id that the application is currently using (for translations and ICU expressions).
26804 * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
26805 * but is now defined as a global value.
26806 */
26807let LOCALE_ID = DEFAULT_LOCALE_ID;
26808/**
26809 * Sets the locale id that will be used for translations and ICU expressions.
26810 * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
26811 * but is now defined as a global value.
26812 *
26813 * @param localeId
26814 */
26815function setLocaleId(localeId) {
26816    assertDefined(localeId, `Expected localeId to be defined`);
26817    if (typeof localeId === 'string') {
26818        LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');
26819    }
26820}
26821/**
26822 * Gets the locale id that will be used for translations and ICU expressions.
26823 * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine
26824 * but is now defined as a global value.
26825 */
26826function getLocaleId() {
26827    return LOCALE_ID;
26828}
26829
26830/**
26831 * @license
26832 * Copyright Google LLC All Rights Reserved.
26833 *
26834 * Use of this source code is governed by an MIT-style license that can be
26835 * found in the LICENSE file at https://angular.io/license
26836 */
26837/**
26838 * Find a node in front of which `currentTNode` should be inserted (takes i18n into account).
26839 *
26840 * This method determines the `RNode` in front of which we should insert the `currentRNode`. This
26841 * takes `TNode.insertBeforeIndex` into account.
26842 *
26843 * @param parentTNode parent `TNode`
26844 * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)
26845 * @param lView current `LView`
26846 */
26847function getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) {
26848    const tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex;
26849    const insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex) ? tNodeInsertBeforeIndex[0] : tN
vendor: 5,896 bytes, lines 26849-26982
26849odeInsertBeforeIndex;
26850    if (insertBeforeIndex === null) {
26851        return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView);
26852    }
26853    else {
26854        ngDevMode && assertIndexInRange(lView, insertBeforeIndex);
26855        return unwrapRNode(lView[insertBeforeIndex]);
26856    }
26857}
26858/**
26859 * Process `TNode.insertBeforeIndex` by adding i18n text nodes.
26860 *
26861 * See `TNode.insertBeforeIndex`
26862 */
26863function processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) {
26864    const tNodeInsertBeforeIndex = childTNode.insertBeforeIndex;
26865    if (Array.isArray(tNodeInsertBeforeIndex)) {
26866        // An array indicates that there are i18n nodes that need to be added as children of this
26867        // `childRNode`. These i18n nodes were created before this `childRNode` was available and so
26868        // only now can be added. The first element of the array is the normal index where we should
26869        // insert the `childRNode`. Additional elements are the extra nodes to be added as children of
26870        // `childRNode`.
26871        ngDevMode && assertDomNode(childRNode);
26872        let i18nParent = childRNode;
26873        let anchorRNode = null;
26874        if (!(childTNode.type & 3 /* AnyRNode */)) {
26875            anchorRNode = i18nParent;
26876            i18nParent = parentRElement;
26877        }
26878        if (i18nParent !== null && (childTNode.flags & 2 /* isComponentHost */) === 0) {
26879            for (let i = 1; i < tNodeInsertBeforeIndex.length; i++) {
26880                // No need to `unwrapRNode` because all of the indexes point to i18n text nodes.
26881                // see `assertDomNode` below.
26882                const i18nChild = lView[tNodeInsertBeforeIndex[i]];
26883                nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false);
26884            }
26885        }
26886    }
26887}
26888
26889/**
26890 * @license
26891 * Copyright Google LLC All Rights Reserved.
26892 *
26893 * Use of this source code is governed by an MIT-style license that can be
26894 * found in the LICENSE file at https://angular.io/license
26895 */
26896/**
26897 * Add `tNode` to `previousTNodes` list and update relevant `TNode`s in `previousTNodes` list
26898 * `tNode.insertBeforeIndex`.
26899 *
26900 * Things to keep in mind:
26901 * 1. All i18n text nodes are encoded as `TNodeType.Element` and are created eagerly by the
26902 *    `ɵɵi18nStart` instruction.
26903 * 2. All `TNodeType.Placeholder` `TNodes` are elements which will be created later by
26904 *    `ɵɵelementStart` instruction.
26905 * 3. `ɵɵelementStart` instruction will create `TNode`s in the ascending `TNode.index` order. (So a
26906 *    smaller index `TNode` is guaranteed to be created before a larger one)
26907 *
26908 * We use the above three invariants to determine `TNode.insertBeforeIndex`.
26909 *
26910 * In an ideal world `TNode.insertBeforeIndex` would always be `TNode.next.index`. However,
26911 * this will not work because `TNode.next.index` may be larger than `TNode.index` which means that
26912 * the next node is not yet created and therefore we can't insert in front of it.
26913 *
26914 * Rule1: `TNode.insertBeforeIndex = null` if `TNode.next === null` (Initial condition, as we don't
26915 *        know if there will be further `TNode`s inserted after.)
26916 * Rule2: If `previousTNode` is created after the `tNode` being inserted, then
26917 *        `previousTNode.insertBeforeNode = tNode.index` (So when a new `tNode` is added we check
26918 *        previous to see if we can update its `insertBeforeTNode`)
26919 *
26920 * See `TNode.insertBeforeIndex` for more context.
26921 *
26922 * @param previousTNodes A list of previous TNodes so that we can easily traverse `TNode`s in
26923 *     reverse order. (If `TNode` would have `previous` this would not be necessary.)
26924 * @param newTNode A TNode to add to the `previousTNodes` list.
26925 */
26926function addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {
26927    // Start with Rule1
26928    ngDevMode &&
26929        assertEqual(newTNode.insertBeforeIndex, null, 'We expect that insertBeforeIndex is not set');
26930    previousTNodes.push(newTNode);
26931    if (previousTNodes.length > 1) {
26932        for (let i = previousTNodes.length - 2; i >= 0; i--) {
26933            const existingTNode = previousTNodes[i];
26934            // Text nodes are created eagerly and so they don't need their `indexBeforeIndex` updated.
26935            // It is safe to ignore them.
26936            if (!isI18nText(existingTNode)) {
26937                if (isNewTNodeCreatedBefore(existingTNode, newTNode) &&
26938                    getInsertBeforeIndex(existingTNode) === null) {
26939                    // If it was created before us in time, (and it does not yet have `insertBeforeIndex`)
26940                    // then add the `insertBeforeIndex`.
26941                    setInsertBeforeIndex(existingTNode, newTNode.index);
26942                }
26943            }
26944        }
26945    }
26946}
26947function isI18nText(tNode) {
26948    return !(tNode.type & 64 /* Placeholder */);
26949}
26950function isNewTNodeCreatedBefore(existingTNode, newTNode) {
26951    return isI18nText(newTNode) || existingTNode.index > newTNode.index;
26952}
26953function getInsertBeforeIndex(tNode) {
26954    const index = tNode.insertBeforeIndex;
26955    return Array.isArray(index) ? index[0] : index;
26956}
26957function setInsertBeforeIndex(tNode, value) {
26958    const index = tNode.insertBeforeIndex;
26959    if (Array.isArray(index)) {
26960        // Array is stored if we have to insert child nodes. See `TNode.insertBeforeIndex`
26961        index[0] = value;
26962    }
26963    else {
26964        setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);
26965        tNode.insertBeforeIndex = value;
26966    }
26967}
26968
26969/**
26970 * @license
26971 * Copyright Google LLC All Rights Reserved.
26972 *
26973 * Use of this source code is governed by an MIT-style license that can be
26974 * found in the LICENSE file at https://angular.io/license
26975 */
26976/**
26977 * Retrieve `TIcu` at a given `index`.
26978 *
26979 * The `TIcu` can be stored either directly (if it is nested ICU) OR
26980 * it is stored inside tho `TIcuContainer` if it is top level ICU.
26981 *
26982 * The reason for this is that the top level ICU need a `TNode` so that they are part of the render
26983 * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is
26984 * expressed (parent ICU may have selected a case which does not contain it.)
26985 *
26986 * @param tView Current `TView`.
26987 * @param index Index where the value should be read from.
26988 */
26989function getTIcu(tView, index) {
26990    const value = tView.data[index];
26991    if (value === null || typeof value === 'string')
26992        return null;
26993    if (ngDevMode &&
26994        !(value.hasOwnProperty('tViews') || value.hasOwnProperty('currentCaseLViewIndex'))) {
26995        throwError('We expect to get \'null\'|\'TIcu\'|\'TIcuContainer\', but got: ' + value);
26996    }
26997    // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be
26998    // either TIcu or TIcuContainerNode. This is not ideal, but we still think it is OK because it
26999    // will be just two cases which fits into the browser inline cache (inline cache can take up to
27000    // 4)
27001    const tIcu = value.hasOwnProperty('currentCaseLViewIndex') ? value :
27002        value.value;
27003    ngDevMode && assertTIcu(tIcu);
27004    return tIcu;
27005}
27006/**
27007 * Store `TIcu` at a give `index`.
27008 *
27009 * The `TIcu` can be stored either directly (if it is nested ICU) OR
27010 * it is stored inside tho `TIcuContainer` if it is top level ICU.
27011 *
27012 * The reason for this is that the top level ICU need a `TNode` so that they are part of the render
27013 * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is
27014 * expressed (parent ICU may have selected a case which does not contain it.)
27015 *
27016 * @param tView Current `TView`.
27017 * @param index Index where the value should be stored at in `Tview.data`
27018 * @param tIcu The TIcu to store.
27019 */
27020function setTIcu(tView, index, tIcu) {
27021    const tNode = tView.data[index];
27022    ngDevMode &&
27023        assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
27024    if (tNode === null) {
27025        tView.data[index] = tIcu;
27026    }
27027    else {
27028        ngDevMode && assertTNodeType(tNode, 32 /* Icu */);
27029        tNode.value = tIcu;
27030    }
27031}
27032/**
27033 * Set `TNode.insertBeforeIndex` taking the `Array` into account.
27034 *
27035 * See `TNode.insertBeforeIndex`
27036 */
27037function setTNodeInsertBeforeIndex(tNode, index) {
27038    ngDevMode && assertTNode(tNode);
27039    let insertBeforeIndex = tNode.insertBeforeIndex;
27040    if (insertBeforeIndex === null) {
27041        setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);
27042        insertBeforeIndex = tNode.insertBeforeIndex =
27043            [null /* may be updated to number later */, index];
27044    }
27045    else {
27046        assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');
27047        insertBeforeIndex.push(index);
27048    }
27049}
27050/**
27051 * Create `TNode.type=TNodeType.Placeholder` node.
27052 *
27053 * See `TNodeType.Placeholder` for more information.
27054 */
27055function createTNodePlaceholder(tView, previousTNodes, index) {
27056    const tNode = createTNodeAtIndex(tView, index, 64 /* Placeholder */, null, null);
27057    addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);
27058    return tNode;
27059}
27060/**
27061 * Returns current ICU case.
27062 *
27063 * ICU cases are stored as index into the `TIcu.cases`.
27064 * At times it is necessary to communicate that the ICU case just switched and that next ICU update
27065 * should update all bindings regardless of the mask. In such a case the we store negative numbers
27066 * for cases which have just been switched. This function removes the negative flag.
27067 */
27068function getCurrentICUCaseIndex(tIcu, lView) {
27069    const currentCase = lView[tIcu.currentCaseLViewIndex];
27070    return currentCase === null ? currentCase : (currentCase < 0 ? ~currentCase : currentCase);
27071}
27072function getParentFromIcuCreateOpCode(mergedCode) {
27073    return mergedCode >>> 17 /* SHIFT_PARENT */;
27074}
27075function getRefFromIcuCreateOpCode(mergedCode) {
27076    return (mergedCode & 131070 /* MASK_REF */) >>> 1 /* SHIFT_REF */;
27077}
27078function getInstructionFromIcuCreateOpCode(mergedCode) {
27079    return mergedCode & 1 /* MASK_INSTRUCTION */;
27080}
27081function icuCreateOpCode(opCode, parentIdx, refIdx) {
27082    ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, 'Missing parent index');
27083    ngDevMode && assertGreaterThan(refIdx, 0, 'Missing ref index');
27084    return opCode | parentIdx << 17 /* SHIFT_PARENT */ | refIdx << 1 /* SHIFT_REF */;
27085}
27086
27087/**
27088 * @license
27089 * Copyright Google LLC All Rights Reserved.
27090 *
27091 * Use of this source code is governed by an MIT-style license that can be
27092 * found in the LICENSE file at https://angular.io/license
27093 */
27094/**
27095 * Keep track of which input bindings in `ɵɵi18nExp` have changed.
27096 *
27097 * This is used to efficiently update expressions in i18n only when the corresponding input has
27098 * changed.
27099 *
27100 * 1) Each bit represents which of the `ɵɵi18nExp` has changed.
27101 * 2) There are 32 bits allowed in JS.
27102 * 3) Bit 32 is special as it is shared for all changes past 32. (In other words if you have more
27103 * than 32 `ɵɵi18nExp` then all changes past 32nd `ɵɵi18nExp` will be mapped to same bit. This means
27104 * that we may end up changing more than we need to. But i18n expressions with 32 bindings is rare
27105 * so in practice it should not be an issue.)
27106 */
27107let changeMask = 0b0;
27108/**
27109 * Keeps track of which bit needs to be updated in `changeMask`
27110 *
27111 * This value gets incremented on every call to `ɵɵi18nExp`
27112 */
27113let changeMaskCounter = 0;
27114/**
27115 * Keep track of which input bindings in `ɵɵi18nExp` have changed.
27116 *
27117 * `setMaskBit` gets invoked by each call to `ɵɵi18nExp`.
27118 *
27119 * @param hasChange did `ɵɵi18nExp` detect a change.
27120 */
27121function setMaskBit(hasChange) {
27122    if (hasChange) {
27123        changeMask = changeMask | (1 << Math.min(changeMaskCounter, 31));
27124    }
27125    changeMaskCounter++;
27126}
27127function applyI18n(tView, lView, index) {
27128    if (changeMaskCounter > 0) {
27129        ngDevMode && assertDefined(tView, `tView should be defined`);
27130        const tI18n = tView.data[index];
27131        // When `index` points to an `ɵɵi18nAttributes` then we have an array otherwise `TI18n`
27132        const updateOpCodes = Array.isArray(tI18n) ? tI18n : tI18n.update;
27133        const bindingsStartIndex = getBindingIndex() - changeMaskCounter - 1;
27134        applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask);
27135    }
27136    // Reset changeMask & maskBit to default for the next update cycle
27137    changeMask = 0b0;
27138    changeMaskCounter = 0;
27139}
27140/**
27141 * Apply `I18nCreateOpCodes` op-codes as stored in `TI18n.create`.
27142 *
27143 * Creates text (and comment) nodes which are internationalized.
27144 *
27145 * @param lView Current lView
27146 * @param createOpCodes Set of op-codes to apply
27147 * @param parentRNode Parent node (so that direct children can be added eagerly) or `null` if it is
27148 *     a root node.
27149 * @param insertInFrontOf DOM node that should be used as an anchor.
27150 */
27151function applyCreateOpCodes(lView, createOpCodes, parentRNode, insertInFrontOf) {
27152    const renderer = lView[RENDERER];
27153    for (let i = 0; i < createOpCodes.length; i++) {
27154        const opCode = createOpCodes[i++];
27155        const text = createOpCodes[i];
27156        const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;
27157        const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;
27158        const index = opCode >>> I18nCreateOpCode.SHIFT;
27159        let rNode = lView[index];
27160        if (rNode === null) {
27161            // We only create new DOM nodes if they don't already exist: If ICU switches case back to a
27162            // case which was already instantiated, no need to create new DOM nodes.
27163            rNode = lView[index] =
27164                isComment ? renderer.createComment(text) : createTextNode(renderer, text);
27165        }
27166        if (appendNow && parentRNode !== null) {
27167            nativeInsertBefore(renderer, parentRNode, rNode, insertInFrontOf, false);
27168        }
27169    }
27170}
27171/**
27172 * Apply `I18nMutateOpCodes` OpCodes.
27173 *
27174 * @param tView Current `TView`
27175 * @param mutableOpCodes Mutable OpCodes to process
27176 * @param lView Current `LView`
27177 * @param anchorRNode place where the i18n node should be inserted.
27178 */
27179function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
27180    ngDevMode && assertDomNode(anchorRNode);
27181    const renderer = lView[RENDERER];
27182    // `rootIdx` represents the node into which all inserts happen.
27183    let rootIdx = null;
27184    // `rootRNode` represents the real node into which we insert. This can be different from
27185    // `lView[rootIdx]` if we have projection.
27186    //  - null we don't have a parent (as can be the case in when we are inserting into a root of
27187    //    LView which has no parent.)
27188    //  - `RElement` The element representing the root after taking projection into account.
27189    let rootRNode;
27190    for (let i = 0; i < mutableOpCodes.length; i++) {
27191        const opCode = mutableOpCodes[i];
27192        if (typeof opCode == 'string') {
27193            const textNodeIndex = mutableOpCodes[++i];
27194            if (lView[textNodeIndex] === null) {
27195                ngDevMode && ngDevMode.rendererCreateTextNode++;
27196                ngDevMode && assertIndexInRange(lView, textNodeIndex);
27197                lView[textNodeIndex] = createTextNode(renderer, opCode);
27198            }
27199        }
27200        else if (typeof opCode == 'number') {
27201            switch (opCode & 1 /* MASK_INSTRUCTION */) {
27202                case 0 /* AppendChild */:
27203                    const parentIdx = getParentFromIcuCreateOpCode(opCode);
27204                    if (rootIdx === null) {
27205                        // The first operation should save the `rootIdx` because the first operation
27206                        // must insert into the root. (Only subsequent operations can insert into a dynamic
27207                        // parent)
27208                        rootIdx = parentIdx;
27209                        rootRNode = nativeParentNode(renderer, anchorRNode);
27210                    }
27211                    let insertInFrontOf;
27212                    let parentRNode;
27213                    if (parentIdx === rootIdx) {
27214                        insertInFrontOf = anchorRNode;
27215                        parentRNode = rootRNode;
27216                    }
27217                    else {
27218                        insertInFrontOf = null;
27219                        parentRNode = unwrapRNode(lView[parentIdx]);
27220                    }
27221                    // FIXME(misko): Refactor with `processI18nText`
27222                    if (parentRNode !== null) {
27223                        // This can happen if the `LView` we are adding to is not attached to a parent `LView`.
27224                        // In such a case there is no "root" we can attach to. This is fine, as we still need to
27225                        // create the elements. When the `LView` gets later added to a parent these "root" nodes
27226                        // get picked up and added.
vendor: 11,200 bytes, lines 27227-27444
27227                        ngDevMode && assertDomNode(parentRNode);
27228                        const refIdx = getRefFromIcuCreateOpCode(opCode);
27229                        ngDevMode && assertGreaterThan(refIdx, HEADER_OFFSET, 'Missing ref');
27230                        // `unwrapRNode` is not needed here as all of these point to RNodes as part of the i18n
27231                        // which can't have components.
27232                        const child = lView[refIdx];
27233                        ngDevMode && assertDomNode(child);
27234                        nativeInsertBefore(renderer, parentRNode, child, insertInFrontOf, false);
27235                        const tIcu = getTIcu(tView, refIdx);
27236                        if (tIcu !== null && typeof tIcu === 'object') {
27237                            // If we just added a comment node which has ICU then that ICU may have already been
27238                            // rendered and therefore we need to re-add it here.
27239                            ngDevMode && assertTIcu(tIcu);
27240                            const caseIndex = getCurrentICUCaseIndex(tIcu, lView);
27241                            if (caseIndex !== null) {
27242                                applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, lView[tIcu.anchorIdx]);
27243                            }
27244                        }
27245                    }
27246                    break;
27247                case 1 /* Attr */:
27248                    const elementNodeIndex = opCode >>> 1 /* SHIFT_REF */;
27249                    const attrName = mutableOpCodes[++i];
27250                    const attrValue = mutableOpCodes[++i];
27251                    // This code is used for ICU expressions only, since we don't support
27252                    // directives/components in ICUs, we don't need to worry about inputs here
27253                    setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);
27254                    break;
27255                default:
27256                    throw new Error(`Unable to determine the type of mutate operation for "${opCode}"`);
27257            }
27258        }
27259        else {
27260            switch (opCode) {
27261                case ICU_MARKER:
27262                    const commentValue = mutableOpCodes[++i];
27263                    const commentNodeIndex = mutableOpCodes[++i];
27264                    if (lView[commentNodeIndex] === null) {
27265                        ngDevMode &&
27266                            assertEqual(typeof commentValue, 'string', `Expected "${commentValue}" to be a comment node value`);
27267                        ngDevMode && ngDevMode.rendererCreateComment++;
27268                        ngDevMode && assertIndexInExpandoRange(lView, commentNodeIndex);
27269                        const commentRNode = lView[commentNodeIndex] =
27270                            createCommentNode(renderer, commentValue);
27271                        // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)
27272                        attachPatchData(commentRNode, lView);
27273                    }
27274                    break;
27275                case ELEMENT_MARKER:
27276                    const tagName = mutableOpCodes[++i];
27277                    const elementNodeIndex = mutableOpCodes[++i];
27278                    if (lView[elementNodeIndex] === null) {
27279                        ngDevMode &&
27280                            assertEqual(typeof tagName, 'string', `Expected "${tagName}" to be an element node tag name`);
27281                        ngDevMode && ngDevMode.rendererCreateElement++;
27282                        ngDevMode && assertIndexInExpandoRange(lView, elementNodeIndex);
27283                        const elementRNode = lView[elementNodeIndex] =
27284                            createElementNode(renderer, tagName, null);
27285                        // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)
27286                        attachPatchData(elementRNode, lView);
27287                    }
27288                    break;
27289                default:
27290                    ngDevMode &&
27291                        throwError(`Unable to determine the type of mutate operation for "${opCode}"`);
27292            }
27293        }
27294    }
27295}
27296/**
27297 * Apply `I18nUpdateOpCodes` OpCodes
27298 *
27299 * @param tView Current `TView`
27300 * @param lView Current `LView`
27301 * @param updateOpCodes OpCodes to process
27302 * @param bindingsStartIndex Location of the first `ɵɵi18nApply`
27303 * @param changeMask Each bit corresponds to a `ɵɵi18nExp` (Counting backwards from
27304 *     `bindingsStartIndex`)
27305 */
27306function applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask) {
27307    for (let i = 0; i < updateOpCodes.length; i++) {
27308        // bit code to check if we should apply the next update
27309        const checkBit = updateOpCodes[i];
27310        // Number of opCodes to skip until next set of update codes
27311        const skipCodes = updateOpCodes[++i];
27312        if (checkBit & changeMask) {
27313            // The value has been updated since last checked
27314            let value = '';
27315            for (let j = i + 1; j <= (i + skipCodes); j++) {
27316                const opCode = updateOpCodes[j];
27317                if (typeof opCode == 'string') {
27318                    value += opCode;
27319                }
27320                else if (typeof opCode == 'number') {
27321                    if (opCode < 0) {
27322                        // Negative opCode represent `i18nExp` values offset.
27323                        value += renderStringify(lView[bindingsStartIndex - opCode]);
27324                    }
27325                    else {
27326                        const nodeIndex = (opCode >>> 2 /* SHIFT_REF */);
27327                        switch (opCode & 3 /* MASK_OPCODE */) {
27328                            case 1 /* Attr */:
27329                                const propName = updateOpCodes[++j];
27330                                const sanitizeFn = updateOpCodes[++j];
27331                                const tNodeOrTagName = tView.data[nodeIndex];
27332                                ngDevMode && assertDefined(tNodeOrTagName, 'Experting TNode or string');
27333                                if (typeof tNodeOrTagName === 'string') {
27334                                    // IF we don't have a `TNode`, then we are an element in ICU (as ICU content does
27335                                    // not have TNode), in which case we know that there are no directives, and hence
27336                                    // we use attribute setting.
27337                                    setElementAttribute(lView[RENDERER], lView[nodeIndex], null, tNodeOrTagName, propName, value, sanitizeFn);
27338                                }
27339                                else {
27340                                    elementPropertyInternal(tView, tNodeOrTagName, lView, propName, value, lView[RENDERER], sanitizeFn, false);
27341                                }
27342                                break;
27343                            case 0 /* Text */:
27344                                const rText = lView[nodeIndex];
27345                                rText !== null && updateTextNode(lView[RENDERER], rText, value);
27346                                break;
27347                            case 2 /* IcuSwitch */:
27348                                applyIcuSwitchCase(tView, getTIcu(tView, nodeIndex), lView, value);
27349                                break;
27350                            case 3 /* IcuUpdate */:
27351                                applyIcuUpdateCase(tView, getTIcu(tView, nodeIndex), bindingsStartIndex, lView);
27352                                break;
27353                        }
27354                    }
27355                }
27356            }
27357        }
27358        else {
27359            const opCode = updateOpCodes[i + 1];
27360            if (opCode > 0 && (opCode & 3 /* MASK_OPCODE */) === 3 /* IcuUpdate */) {
27361                // Special case for the `icuUpdateCase`. It could be that the mask did not match, but
27362                // we still need to execute `icuUpdateCase` because the case has changed recently due to
27363                // previous `icuSwitchCase` instruction. (`icuSwitchCase` and `icuUpdateCase` always come in
27364                // pairs.)
27365                const nodeIndex = (opCode >>> 2 /* SHIFT_REF */);
27366                const tIcu = getTIcu(tView, nodeIndex);
27367                const currentIndex = lView[tIcu.currentCaseLViewIndex];
27368                if (currentIndex < 0) {
27369                    applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView);
27370                }
27371            }
27372        }
27373        i += skipCodes;
27374    }
27375}
27376/**
27377 * Apply OpCodes associated with updating an existing ICU.
27378 *
27379 * @param tView Current `TView`
27380 * @param tIcu Current `TIcu`
27381 * @param bindingsStartIndex Location of the first `ɵɵi18nApply`
27382 * @param lView Current `LView`
27383 */
27384function applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView) {
27385    ngDevMode && assertIndexInRange(lView, tIcu.currentCaseLViewIndex);
27386    let activeCaseIndex = lView[tIcu.currentCaseLViewIndex];
27387    if (activeCaseIndex !== null) {
27388        let mask = changeMask;
27389        if (activeCaseIndex < 0) {
27390            // Clear the flag.
27391            // Negative number means that the ICU was freshly created and we need to force the update.
27392            activeCaseIndex = lView[tIcu.currentCaseLViewIndex] = ~activeCaseIndex;
27393            // -1 is same as all bits on, which simulates creation since it marks all bits dirty
27394            mask = -1;
27395        }
27396        applyUpdateOpCodes(tView, lView, tIcu.update[activeCaseIndex], bindingsStartIndex, mask);
27397    }
27398}
27399/**
27400 * Apply OpCodes associated with switching a case on ICU.
27401 *
27402 * This involves tearing down existing case and than building up a new case.
27403 *
27404 * @param tView Current `TView`
27405 * @param tIcu Current `TIcu`
27406 * @param lView Current `LView`
27407 * @param value Value of the case to update to.
27408 */
27409function applyIcuSwitchCase(tView, tIcu, lView, value) {
27410    // Rebuild a new case for this ICU
27411    const caseIndex = getCaseIndex(tIcu, value);
27412    let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);
27413    if (activeCaseIndex !== caseIndex) {
27414        applyIcuSwitchCaseRemove(tView, tIcu, lView);
27415        lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;
27416        if (caseIndex !== null) {
27417            // Add the nodes for the new case
27418            const anchorRNode = lView[tIcu.anchorIdx];
27419            if (anchorRNode) {
27420                ngDevMode && assertDomNode(anchorRNode);
27421                applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);
27422            }
27423        }
27424    }
27425}
27426/**
27427 * Apply OpCodes associated with tearing ICU case.
27428 *
27429 * This involves tearing down existing case and than building up a new case.
27430 *
27431 * @param tView Current `TView`
27432 * @param tIcu Current `TIcu`
27433 * @param lView Current `LView`
27434 */
27435function applyIcuSwitchCaseRemove(tView, tIcu, lView) {
27436    let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);
27437    if (activeCaseIndex !== null) {
27438        const removeCodes = tIcu.remove[activeCaseIndex];
27439        for (let i = 0; i < removeCodes.length; i++) {
27440            const nodeOrIcuIndex = removeCodes[i];
27441            if (nodeOrIcuIndex > 0) {
27442                // Positive numbers are `RNode`s.
27443                const rNode = getNativeByIndex(nodeOrIcuIndex, lView);
27444                rNode !== null && nativeRemoveNode(lView[RENDERER], rN
27444ode);
27445            }
27446            else {
27447                // Negative numbers are ICUs
27448                applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex), lView);
27449            }
27450        }
27451    }
27452}
27453/**
27454 * Returns the index of the current case of an ICU expression depending on the main binding value
27455 *
27456 * @param icuExpression
27457 * @param bindingValue The value of the main binding used by this ICU expression
27458 */
27459function getCaseIndex(icuExpression, bindingValue) {
27460    let index = icuExpression.cases.indexOf(bindingValue);
27461    if (index === -1) {
27462        switch (icuExpression.type) {
27463            case 1 /* plural */: {
27464                const resolvedCase = getPluralCase(bindingValue, getLocaleId());
27465                index = icuExpression.cases.indexOf(resolvedCase);
27466                if (index === -1 && resolvedCase !== 'other') {
27467                    index = icuExpression.cases.indexOf('other');
27468                }
27469                break;
27470            }
27471            case 0 /* select */: {
27472                index = icuExpression.cases.indexOf('other');
27473                break;
27474            }
27475        }
27476    }
27477    return index === -1 ? null : index;
27478}
27479
27480/**
27481 * @license
27482 * Copyright Google LLC All Rights Reserved.
27483 *
27484 * Use of this source code is governed by an MIT-style license that can be
27485 * found in the LICENSE file at https://angular.io/license
27486 */
27487function loadIcuContainerVisitor() {
27488    const _stack = [];
27489    let _index = -1;
27490    let _lView;
27491    let _removes;
27492    /**
27493     * Retrieves a set of root nodes from `TIcu.remove`. Used by `TNodeType.ICUContainer`
27494     * to determine which root belong to the ICU.
27495     *
27496     * Example of usage.
27497     * ```
27498     * const nextRNode = icuContainerIteratorStart(tIcuContainerNode, lView);
27499     * let rNode: RNode|null;
27500     * while(rNode = nextRNode()) {
27501     *   console.log(rNode);
27502     * }
27503     * ```
27504     *
27505     * @param tIcuContainerNode Current `TIcuContainerNode`
27506     * @param lView `LView` where the `RNode`s should be looked up.
27507     */
27508    function icuContainerIteratorStart(tIcuContainerNode, lView) {
27509        _lView = lView;
27510        while (_stack.length)
27511            _stack.pop();
27512        ngDevMode && assertTNodeForLView(tIcuContainerNode, lView);
27513        enterIcu(tIcuContainerNode.value, lView);
27514        return icuContainerIteratorNext;
27515    }
27516    function enterIcu(tIcu, lView) {
27517        _index = 0;
27518        const currentCase = getCurrentICUCaseIndex(tIcu, lView);
27519        if (currentCase !== null) {
27520            ngDevMode && assertNumberInRange(currentCase, 0, tIcu.cases.length - 1);
27521            _removes = tIcu.remove[currentCase];
27522        }
27523        else {
27524            _removes = EMPTY_ARRAY$1;
27525        }
27526    }
27527    function icuContainerIteratorNext() {
27528        if (_index < _removes.length) {
27529            const removeOpCode = _removes[_index++];
27530            ngDevMode && assertNumber(removeOpCode, 'Expecting OpCode number');
27531            if (removeOpCode > 0) {
27532                const rNode = _lView[removeOpCode];
27533                ngDevMode && assertDomNode(rNode);
27534                return rNode;
27535            }
27536            else {
27537                _stack.push(_index, _removes);
27538                // ICUs are represented by negative indices
27539                const tIcuIndex = ~removeOpCode;
27540                const tIcu = _lView[TVIEW].data[tIcuIndex];
27541                ngDevMode && assertTIcu(tIcu);
27542                enterIcu(tIcu, _lView);
27543                return icuContainerIteratorNext();
27544            }
27545        }
27546        else {
27547            if (_stack.length === 0) {
27548                return null;
27549            }
27550            else {
27551                _removes = _stack.pop();
27552                _index = _stack.pop();
27553                return icuContainerIteratorNext();
27554            }
27555        }
27556    }
27557    return icuContainerIteratorStart;
27558}
27559
27560/**
27561 * @license
27562 * Copyright Google LLC All Rights Reserved.
27563 *
27564 * Use of this source code is governed by an MIT-style license that can be
27565 * found in the LICENSE file at https://angular.io/license
27566 */
27567/**
27568 * Converts `I18nCreateOpCodes` array into a human readable format.
27569 *
27570 * This function is attached to the `I18nCreateOpCodes.debug` property if `ngDevMode` is enabled.
27571 * This function provides a human readable view of the opcodes. This is useful when debugging the
27572 * application as well as writing more readable tests.
27573 *
27574 * @param this `I18nCreateOpCodes` if attached as a method.
27575 * @param opcodes `I18nCreateOpCodes` if invoked as a function.
27576 */
27577function i18nCreateOpCodesToString(opcodes) {
27578    const createOpCodes = opcodes || (Array.isArray(this) ? this : []);
27579    let lines = [];
27580    for (let i = 0; i < createOpCodes.length; i++) {
27581        const opCode = createOpCodes[i++];
27582        const text = createOpCodes[i];
27583        const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;
27584        const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;
27585        const index = opCode >>> I18nCreateOpCode.SHIFT;
27586        lines.push(`lView[${index}] = document.${isComment ? 'createComment' : 'createText'}(${JSON.stringify(text)});`);
27587        if (appendNow) {
27588            lines.push(`parent.appendChild(lView[${index}]);`);
27589        }
27590    }
27591    return lines;
27592}
27593/**
27594 * Converts `I18nUpdateOpCodes` array into a human readable format.
27595 *
27596 * This function is attached to the `I18nUpdateOpCodes.debug` property if `ngDevMode` is enabled.
27597 * This function provides a human readable view of the opcodes. This is useful when debugging the
27598 * application as well as writing more readable tests.
27599 *
27600 * @param this `I18nUpdateOpCodes` if attached as a method.
27601 * @param opcodes `I18nUpdateOpCodes` if invoked as a function.
27602 */
27603function i18nUpdateOpCodesToString(opcodes) {
27604    const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));
27605    let lines = [];
27606    function consumeOpCode(value) {
27607        const ref = value >>>
vendor: 56,327 bytes, lines 27607-28847
27607 2 /* SHIFT_REF */;
27608        const opCode = value & 3 /* MASK_OPCODE */;
27609        switch (opCode) {
27610            case 0 /* Text */:
27611                return `(lView[${ref}] as Text).textContent = $$$`;
27612            case 1 /* Attr */:
27613                const attrName = parser.consumeString();
27614                const sanitizationFn = parser.consumeFunction();
27615                const value = sanitizationFn ? `(${sanitizationFn})($$$)` : '$$$';
27616                return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value})`;
27617            case 2 /* IcuSwitch */:
27618                return `icuSwitchCase(${ref}, $$$)`;
27619            case 3 /* IcuUpdate */:
27620                return `icuUpdateCase(${ref})`;
27621        }
27622        throw new Error('unexpected OpCode');
27623    }
27624    while (parser.hasMore()) {
27625        let mask = parser.consumeNumber();
27626        let size = parser.consumeNumber();
27627        const end = parser.i + size;
27628        const statements = [];
27629        let statement = '';
27630        while (parser.i < end) {
27631            let value = parser.consumeNumberOrString();
27632            if (typeof value === 'string') {
27633                statement += value;
27634            }
27635            else if (value < 0) {
27636                // Negative numbers are ref indexes
27637                // Here `i` refers to current binding index. It is to signify that the value is relative,
27638                // rather than absolute.
27639                statement += '${lView[i' + value + ']}';
27640            }
27641            else {
27642                // Positive numbers are operations.
27643                const opCodeText = consumeOpCode(value);
27644                statements.push(opCodeText.replace('$$$', '`' + statement + '`') + ';');
27645                statement = '';
27646            }
27647        }
27648        lines.push(`if (mask & 0b${mask.toString(2)}) { ${statements.join(' ')} }`);
27649    }
27650    return lines;
27651}
27652/**
27653 * Converts `I18nCreateOpCodes` array into a human readable format.
27654 *
27655 * This function is attached to the `I18nCreateOpCodes.debug` if `ngDevMode` is enabled. This
27656 * function provides a human readable view of the opcodes. This is useful when debugging the
27657 * application as well as writing more readable tests.
27658 *
27659 * @param this `I18nCreateOpCodes` if attached as a method.
27660 * @param opcodes `I18nCreateOpCodes` if invoked as a function.
27661 */
27662function icuCreateOpCodesToString(opcodes) {
27663    const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));
27664    let lines = [];
27665    function consumeOpCode(opCode) {
27666        const parent = getParentFromIcuCreateOpCode(opCode);
27667        const ref = getRefFromIcuCreateOpCode(opCode);
27668        switch (getInstructionFromIcuCreateOpCode(opCode)) {
27669            case 0 /* AppendChild */:
27670                return `(lView[${parent}] as Element).appendChild(lView[${lastRef}])`;
27671            case 1 /* Attr */:
27672                return `(lView[${ref}] as Element).setAttribute("${parser.consumeString()}", "${parser.consumeString()}")`;
27673        }
27674        throw new Error('Unexpected OpCode: ' + getInstructionFromIcuCreateOpCode(opCode));
27675    }
27676    let lastRef = -1;
27677    while (parser.hasMore()) {
27678        let value = parser.consumeNumberStringOrMarker();
27679        if (value === ICU_MARKER) {
27680            const text = parser.consumeString();
27681            lastRef = parser.consumeNumber();
27682            lines.push(`lView[${lastRef}] = document.createComment("${text}")`);
27683        }
27684        else if (value === ELEMENT_MARKER) {
27685            const text = parser.consumeString();
27686            lastRef = parser.consumeNumber();
27687            lines.push(`lView[${lastRef}] = document.createElement("${text}")`);
27688        }
27689        else if (typeof value === 'string') {
27690            lastRef = parser.consumeNumber();
27691            lines.push(`lView[${lastRef}] = document.createTextNode("${value}")`);
27692        }
27693        else if (typeof value === 'number') {
27694            const line = consumeOpCode(value);
27695            line && lines.push(line);
27696        }
27697        else {
27698            throw new Error('Unexpected value');
27699        }
27700    }
27701    return lines;
27702}
27703/**
27704 * Converts `I18nRemoveOpCodes` array into a human readable format.
27705 *
27706 * This function is attached to the `I18nRemoveOpCodes.debug` if `ngDevMode` is enabled. This
27707 * function provides a human readable view of the opcodes. This is useful when debugging the
27708 * application as well as writing more readable tests.
27709 *
27710 * @param this `I18nRemoveOpCodes` if attached as a method.
27711 * @param opcodes `I18nRemoveOpCodes` if invoked as a function.
27712 */
27713function i18nRemoveOpCodesToString(opcodes) {
27714    const removeCodes = opcodes || (Array.isArray(this) ? this : []);
27715    let lines = [];
27716    for (let i = 0; i < removeCodes.length; i++) {
27717        const nodeOrIcuIndex = removeCodes[i];
27718        if (nodeOrIcuIndex > 0) {
27719            // Positive numbers are `RNode`s.
27720            lines.push(`remove(lView[${nodeOrIcuIndex}])`);
27721        }
27722        else {
27723            // Negative numbers are ICUs
27724            lines.push(`removeNestedICU(${~nodeOrIcuIndex})`);
27725        }
27726    }
27727    return lines;
27728}
27729class OpCodeParser {
27730    constructor(codes) {
27731        this.i = 0;
27732        this.codes = codes;
27733    }
27734    hasMore() {
27735        return this.i < this.codes.length;
27736    }
27737    consumeNumber() {
27738        let value = this.codes[this.i++];
27739        assertNumber(value, 'expecting number in OpCode');
27740        return value;
27741    }
27742    consumeString() {
27743        let value = this.codes[this.i++];
27744        assertString(value, 'expecting string in OpCode');
27745        return value;
27746    }
27747    consumeFunction() {
27748        let value = this.codes[this.i++];
27749        if (value === null || typeof value === 'function') {
27750            return value;
27751        }
27752        throw new Error('expecting function in OpCode');
27753    }
27754    consumeNumberOrString() {
27755        let value = this.codes[this.i++];
27756        if (typeof value === 'string') {
27757            return value;
27758        }
27759        assertNumber(value, 'expecting number or string in OpCode');
27760        return value;
27761    }
27762    consumeNumberStringOrMarker() {
27763        let value = this.codes[this.i++];
27764        if (typeof value === 'string' || typeof value === 'number' || value == ICU_MARKER ||
27765            value == ELEMENT_MARKER) {
27766            return value;
27767        }
27768        assertNumber(value, 'expecting number, string, ICU_MARKER or ELEMENT_MARKER in OpCode');
27769        return value;
27770    }
27771}
27772
27773/**
27774 * @license
27775 * Copyright Google LLC All Rights Reserved.
27776 *
27777 * Use of this source code is governed by an MIT-style license that can be
27778 * found in the LICENSE file at https://angular.io/license
27779 */
27780const BINDING_REGEXP = /�(\d+):?\d*�/gi;
27781const ICU_REGEXP = /({\s*�\d+:?\d*�\s*,\s*\S{6}\s*,[\s\S]*})/gi;
27782const NESTED_ICU = /�(\d+)�/;
27783const ICU_BLOCK_REGEXP = /^\s*(�\d+:?\d*�)\s*,\s*(select|plural)\s*,/;
27784const MARKER = `�`;
27785const SUBTEMPLATE_REGEXP = /�\/?\*(\d+:\d+)�/gi;
27786const PH_REGEXP = /�(\/?[#*]\d+):?\d*�/gi;
27787/**
27788 * Angular Dart introduced &ngsp; as a placeholder for non-removable space, see:
27789 * https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart#L25-L32
27790 * In Angular Dart &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character
27791 * and later on replaced by a space. We are re-implementing the same idea here, since translations
27792 * might contain this special character.
27793 */
27794const NGSP_UNICODE_REGEXP = /\uE500/g;
27795function replaceNgsp(value) {
27796    return value.replace(NGSP_UNICODE_REGEXP, ' ');
27797}
27798/**
27799 * Create dynamic nodes from i18n translation block.
27800 *
27801 * - Text nodes are created synchronously
27802 * - TNodes are linked into tree lazily
27803 *
27804 * @param tView Current `TView`
27805 * @parentTNodeIndex index to the parent TNode of this i18n block
27806 * @param lView Current `LView`
27807 * @param index Index of `ɵɵi18nStart` instruction.
27808 * @param message Message to translate.
27809 * @param subTemplateIndex Index into the sub template of message translation. (ie in case of
27810 *     `ngIf`) (-1 otherwise)
27811 */
27812function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message, subTemplateIndex) {
27813    const rootTNode = getCurrentParentTNode();
27814    const createOpCodes = [];
27815    const updateOpCodes = [];
27816    const existingTNodeStack = [[]];
27817    if (ngDevMode) {
27818        attachDebugGetter(createOpCodes, i18nCreateOpCodesToString);
27819        attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);
27820    }
27821    message = getTranslationForTemplate(message, subTemplateIndex);
27822    const msgParts = replaceNgsp(message).split(PH_REGEXP);
27823    for (let i = 0; i < msgParts.length; i++) {
27824        let value = msgParts[i];
27825        if ((i & 1) === 0) {
27826            // Even indexes are text (including bindings & ICU expressions)
27827            const parts = i18nParseTextIntoPartsAndICU(value);
27828            for (let j = 0; j < parts.length; j++) {
27829                let part = parts[j];
27830                if ((j & 1) === 0) {
27831                    // `j` is odd therefore `part` is string
27832                    const text = part;
27833                    ngDevMode && assertString(text, 'Parsed ICU part should be string');
27834                    if (text !== '') {
27835                        i18nStartFirstCreatePassProcessTextNode(tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text);
27836                    }
27837                }
27838                else {
27839                    // `j` is Even therefor `part` is an `ICUExpression`
27840                    const icuExpression = part;
27841                    // Verify that ICU expression has the right shape. Translations might contain invalid
27842                    // constructions (while original messages were correct), so ICU parsing at runtime may
27843                    // not succeed (thus `icuExpression` remains a string).
27844                    // Note: we intentionally retain the error here by not using `ngDevMode`, because
27845                    // the value can change based on the locale and users aren't guaranteed to hit
27846                    // an invalid string while they're developing.
27847                    if (typeof icuExpression !== 'object') {
27848                        throw new Error(`Unable to parse ICU expression in "${message}" message.`);
27849                    }
27850                    const icuContainerTNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodeStack[0], lView, createOpCodes, ngDevMode ? `ICU ${index}:${icuExpression.mainBinding}` : '', true);
27851                    const icuNodeIndex = icuContainerTNode.index;
27852                    ngDevMode &&
27853                        assertGreaterThanOrEqual(icuNodeIndex, HEADER_OFFSET, 'Index must be in absolute LView offset');
27854                    icuStart(tView, lView, updateOpCodes, parentTNodeIndex, icuExpression, icuNodeIndex);
27855                }
27856            }
27857        }
27858        else {
27859            // Odd indexes are placeholders (elements and sub-templates)
27860            // At this point value is something like: '/#1:2' (originally coming from '�/#1:2�')
27861            const isClosing = value.charCodeAt(0) === 47 /* SLASH */;
27862            const type = value.charCodeAt(isClosing ? 1 : 0);
27863            ngDevMode && assertOneOf(type, 42 /* STAR */, 35 /* HASH */);
27864            const index = HEADER_OFFSET + Number.parseInt(value.substring((isClosing ? 2 : 1)));
27865            if (isClosing) {
27866                existingTNodeStack.shift();
27867                setCurrentTNode(getCurrentParentTNode(), false);
27868            }
27869            else {
27870                const tNode = createTNodePlaceholder(tView, existingTNodeStack[0], index);
27871                existingTNodeStack.unshift([]);
27872                setCurrentTNode(tNode, true);
27873            }
27874        }
27875    }
27876    tView.data[index] = {
27877        create: createOpCodes,
27878        update: updateOpCodes,
27879    };
27880}
27881/**
27882 * Allocate space in i18n Range add create OpCode instruction to crete a text or comment node.
27883 *
27884 * @param tView Current `TView` needed to allocate space in i18n range.
27885 * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be
27886 *     added as part of the `i18nStart` instruction or as part of the `TNode.insertBeforeIndex`.
27887 * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.
27888 * @param lView Current `LView` needed to allocate space in i18n range.
27889 * @param createOpCodes Array storing `I18nCreateOpCodes` where new opCodes will be added.
27890 * @param text Text to be added when the `Text` or `Comment` node will be created.
27891 * @param isICU true if a `Comment` node for ICU (instead of `Text`) node should be created.
27892 */
27893function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {
27894    const i18nNodeIdx = allocExpando(tView, lView, 1, null);
27895    let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;
27896    let parentTNode = getCurrentParentTNode();
27897    if (rootTNode === parentTNode) {
27898        // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.
27899        // (there is no parent), but in some circumstances (because we are inconsistent about how we set
27900        // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.
27901        parentTNode = null;
27902    }
27903    if (parentTNode === null) {
27904        // If we don't have a parent that means that we can eagerly add nodes.
27905        // If we have a parent than these nodes can't be added now (as the parent has not been created
27906        // yet) and instead the `parentTNode` is responsible for adding it. See
27907        // `TNode.insertBeforeIndex`
27908        opCode |= I18nCreateOpCode.APPEND_EAGERLY;
27909    }
27910    if (isICU) {
27911        opCode |= I18nCreateOpCode.COMMENT;
27912        ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);
27913    }
27914    createOpCodes.push(opCode, text === null ? '' : text);
27915    // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the
27916    // bindings are.
27917    const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* Icu */ : 1 /* Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);
27918    addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);
27919    const tNodeIdx = tNode.index;
27920    setCurrentTNode(tNode, false /* Text nodes are self closing */);
27921    if (parentTNode !== null && rootTNode !== parentTNode) {
27922        // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)
27923        // We have to make sure to add ourselves to the parent.
27924        setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);
27925    }
27926    return tNode;
27927}
27928/**
27929 * Processes text node in i18n block.
27930 *
27931 * Text nodes can have:
27932 * - Create instruction in `createOpCodes` for creating the text node.
27933 * - Allocate spec for text node in i18n range of `LView`
27934 * - If contains binding:
27935 *    - bindings => allocate space in i18n range of `LView` to store the binding value.
27936 *    - populate `updateOpCodes` with update instructions.
27937 *
27938 * @param tView Current `TView`
27939 * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will
27940 *     be added as part of the `i18nStart` instruction or as part of the
27941 *     `TNode.insertBeforeIndex`.
27942 * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.
27943 * @param createOpCodes Location where the creation OpCodes will be stored.
27944 * @param lView Current `LView`
27945 * @param text The translated text (which may contain binding)
27946 */
27947function i18nStartFirstCreatePassProcessTextNode(tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text) {
27948    const hasBinding = text.match(BINDING_REGEXP);
27949    const tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text, false);
27950    if (hasBinding) {
27951        generateBindingUpdateOpCodes(updateOpCodes, text, tNode.index);
27952    }
27953}
27954/**
27955 * See `i18nAttributes` above.
27956 */
27957function i18nAttributesFirstPass(tView, index, values) {
27958    const previousElement = getCurrentTNode();
27959    const previousElementIndex = previousElement.index;
27960    const updateOpCodes = [];
27961    if (ngDevMode) {
27962        attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);
27963    }
27964    if (tView.firstCreatePass && tView.data[index] === null) {
27965        for (let i = 0; i < values.length; i += 2) {
27966            const attrName = values[i];
27967            const message = values[i + 1];
27968            if (message !== '') {
27969                // Check if attribute value contains an ICU and throw an error if that's the case.
27970                // ICUs in element attributes are not supported.
27971                // Note: we intentionally retain the error here by not using `ngDevMode`, because
27972                // the `value` can change based on the locale and users aren't guaranteed to hit
27973                // an invalid string while they're developing.
27974                if (ICU_REGEXP.test(message)) {
27975                    throw new Error(`ICU expressions are not supported in attributes. Message: "${message}".`);
27976                }
27977                // i18n attributes that hit this code path are guaranteed to have bindings, because
27978                // the compiler treats static i18n attributes as regular attribute bindings.
27979                generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName);
27980            }
27981        }
27982        tView.data[index] = updateOpCodes;
27983    }
27984}
27985/**
27986 * Generate the OpCodes to update the bindings of a string.
27987 *
27988 * @param updateOpCodes Place where the update opcodes will be stored.
27989 * @param str The string containing the bindings.
27990 * @param destinationNode Index of the destination node which will receive the binding.
27991 * @param attrName Name of the attribute, if the string belongs to an attribute.
27992 * @param sanitizeFn Sanitization function used to sanitize the string after update, if necessary.
27993 */
27994function generateBindingUpdateOpCodes(updateOpCodes, str, destinationNode, attrName, sanitizeFn = null) {
27995    ngDevMode &&
27996        assertGreaterThanOrEqual(destinationNode, HEADER_OFFSET, 'Index must be in absolute LView offset');
27997    const maskIndex = updateOpCodes.length; // Location of mask
27998    const sizeIndex = maskIndex + 1; // location of size for skipping
27999    updateOpCodes.push(null, null); // Alloc space for mask and size
28000    const startIndex = maskIndex + 2; // location of first allocation.
28001    if (ngDevMode) {
28002        attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);
28003    }
28004    const textParts = str.split(BINDING_REGEXP);
28005    let mask = 0;
28006    for (let j = 0; j < textParts.length; j++) {
28007        const textValue = textParts[j];
28008        if (j & 1) {
28009            // Odd indexes are bindings
28010            const bindingIndex = parseInt(textValue, 10);
28011            updateOpCodes.push(-1 - bindingIndex);
28012            mask = mask | toMaskBit(bindingIndex);
28013        }
28014        else if (textValue !== '') {
28015            // Even indexes are text
28016            updateOpCodes.push(textValue);
28017        }
28018    }
28019    updateOpCodes.push(destinationNode << 2 /* SHIFT_REF */ |
28020        (attrName ? 1 /* Attr */ : 0 /* Text */));
28021    if (attrName) {
28022        updateOpCodes.push(attrName, sanitizeFn);
28023    }
28024    updateOpCodes[maskIndex] = mask;
28025    updateOpCodes[sizeIndex] = updateOpCodes.length - startIndex;
28026    return mask;
28027}
28028/**
28029 * Convert binding index to mask bit.
28030 *
28031 * Each index represents a single bit on the bit-mask. Because bit-mask only has 32 bits, we make
28032 * the 32nd bit share all masks for all bindings higher than 32. Since it is extremely rare to
28033 * have more than 32 bindings this will be hit very rarely. The downside of hitting this corner
28034 * case is that we will execute binding code more often than necessary. (penalty of performance)
28035 */
28036function toMaskBit(bindingIndex) {
28037    return 1 << Math.min(bindingIndex, 31);
28038}
28039function isRootTemplateMessage(subTemplateIndex) {
28040    return subTemplateIndex === -1;
28041}
28042/**
28043 * Removes everything inside the sub-templates of a message.
28044 */
28045function removeInnerTemplateTranslation(message) {
28046    let match;
28047    let res = '';
28048    let index = 0;
28049    let inTemplate = false;
28050    let tagMatched;
28051    while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {
28052        if (!inTemplate) {
28053            res += message.substring(index, match.index + match[0].length);
28054            tagMatched = match[1];
28055            inTemplate = true;
28056        }
28057        else {
28058            if (match[0] === `${MARKER}/*${tagMatched}${MARKER}`) {
28059                index = match.index;
28060                inTemplate = false;
28061            }
28062        }
28063    }
28064    ngDevMode &&
28065        assertEqual(inTemplate, false, `Tag mismatch: unable to find the end of the sub-template in the translation "${message}"`);
28066    res += message.substr(index);
28067    return res;
28068}
28069/**
28070 * Extracts a part of a message and removes the rest.
28071 *
28072 * This method is used for extracting a part of the message associated with a template. A
28073 * translated message can span multiple templates.
28074 *
28075 * Example:
28076 * ```
28077 * <div i18n>Translate <span *ngIf>me</span>!</div>
28078 * ```
28079 *
28080 * @param message The message to crop
28081 * @param subTemplateIndex Index of the sub-template to extract. If undefined it returns the
28082 * external template and removes all sub-templates.
28083 */
28084function getTranslationForTemplate(message, subTemplateIndex) {
28085    if (isRootTemplateMessage(subTemplateIndex)) {
28086        // We want the root template message, ignore all sub-templates
28087        return removeInnerTemplateTranslation(message);
28088    }
28089    else {
28090        // We want a specific sub-template
28091        const start = message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length;
28092        const end = message.search(new RegExp(`${MARKER}\\/\\*\\d+:${subTemplateIndex}${MARKER}`));
28093        return removeInnerTemplateTranslation(message.substring(start, end));
28094    }
28095}
28096/**
28097 * Generate the OpCodes for ICU expressions.
28098 *
28099 * @param icuExpression
28100 * @param index Index where the anchor is stored and an optional `TIcuContainerNode`
28101 *   - `lView[anchorIdx]` points to a `Comment` node representing the anchor for the ICU.
28102 *   - `tView.data[anchorIdx]` points to the `TIcuContainerNode` if ICU is root (`null` otherwise)
28103 */
28104function icuStart(tView, lView, updateOpCodes, parentIdx, icuExpression, anchorIdx) {
28105    ngDevMode && assertDefined(icuExpression, 'ICU expression must be defined');
28106    let bindingMask = 0;
28107    const tIcu = {
28108        type: icuExpression.type,
28109        currentCaseLViewIndex: allocExpando(tView, lView, 1, null),
28110        anchorIdx,
28111        cases: [],
28112        create: [],
28113        remove: [],
28114        update: []
28115    };
28116    addUpdateIcuSwitch(updateOpCodes, icuExpression, anchorIdx);
28117    setTIcu(tView, anchorIdx, tIcu);
28118    const values = icuExpression.values;
28119    for (let i = 0; i < values.length; i++) {
28120        // Each value is an array of strings & other ICU expressions
28121        const valueArr = values[i];
28122        const nestedIcus = [];
28123        for (let j = 0; j < valueArr.length; j++) {
28124            const value = valueArr[j];
28125            if (typeof value !== 'string') {
28126                // It is an nested ICU expression
28127                const icuIndex = nestedIcus.push(value) - 1;
28128                // Replace nested ICU expression by a comment node
28129                valueArr[j] = `<!--�${icuIndex}�-->`;
28130            }
28131        }
28132        bindingMask = parseIcuCase(tView, tIcu, lView, updateOpCodes, parentIdx, icuExpression.cases[i], valueArr.join(''), nestedIcus) |
28133            bindingMask;
28134    }
28135    if (bindingMask) {
28136        addUpdateIcuUpdate(updateOpCodes, bindingMask, anchorIdx);
28137    }
28138}
28139/**
28140 * Parses text containing an ICU expression and produces a JSON object for it.
28141 * Original code from closure library, modified for Angular.
28142 *
28143 * @param pattern Text containing an ICU expression that needs to be parsed.
28144 *
28145 */
28146function parseICUBlock(pattern) {
28147    const cases = [];
28148    const values = [];
28149    let icuType = 1 /* plural */;
28150    let mainBinding = 0;
28151    pattern = pattern.replace(ICU_BLOCK_REGEXP, function (str, binding, type) {
28152        if (type === 'select') {
28153            icuType = 0 /* select */;
28154        }
28155        else {
28156            icuType = 1 /* plural */;
28157        }
28158        mainBinding = parseInt(binding.substr(1), 10);
28159        return '';
28160    });
28161    const parts = i18nParseTextIntoPartsAndICU(pattern);
28162    // Looking for (key block)+ sequence. One of the keys has to be "other".
28163    for (let pos = 0; pos < parts.length;) {
28164        let key = parts[pos++].trim();
28165        if (icuType === 1 /* plural */) {
28166            // Key can be "=x", we just want "x"
28167            key = key.replace(/\s*(?:=)?(\w+)\s*/, '$1');
28168        }
28169        if (key.length) {
28170            cases.push(key);
28171        }
28172        const blocks = i18nParseTextIntoPartsAndICU(parts[pos++]);
28173        if (cases.length > values.length) {
28174            values.push(blocks);
28175        }
28176    }
28177    // TODO(ocombe): support ICU expressions in attributes, see #21615
28178    return { type: icuType, mainBinding: mainBinding, cases, values };
28179}
28180/**
28181 * Breaks pattern into strings and top level {...} blocks.
28182 * Can be used to break a message into text and ICU expressions, or to break an ICU expression
28183 * into keys and cases. Original code from closure library, modified for Angular.
28184 *
28185 * @param pattern (sub)Pattern to be broken.
28186 * @returns An `Array<string|IcuExpression>` where:
28187 *   - odd positions: `string` => text between ICU expressions
28188 *   - even positions: `ICUExpression` => ICU expression parsed into `ICUExpression` record.
28189 */
28190function i18nParseTextIntoPartsAndICU(pattern) {
28191    if (!pattern) {
28192        return [];
28193    }
28194    let prevPos = 0;
28195    const braceStack = [];
28196    const results = [];
28197    const braces = /[{}]/g;
28198    // lastIndex doesn't get set to 0 so we have to.
28199    braces.lastIndex = 0;
28200    let match;
28201    while (match = braces.exec(pattern)) {
28202        const pos = match.index;
28203        if (match[0] == '}') {
28204            braceStack.pop();
28205            if (braceStack.length == 0) {
28206                // End of the block.
28207                const block = pattern.substring(prevPos, pos);
28208                if (ICU_BLOCK_REGEXP.test(block)) {
28209                    results.push(parseICUBlock(block));
28210                }
28211                else {
28212                    results.push(block);
28213                }
28214                prevPos = pos + 1;
28215            }
28216        }
28217        else {
28218            if (braceStack.length == 0) {
28219                const substring = pattern.substring(prevPos, pos);
28220                results.push(substring);
28221                prevPos = pos + 1;
28222            }
28223            braceStack.push('{');
28224        }
28225    }
28226    const substring = pattern.substring(prevPos);
28227    results.push(substring);
28228    return results;
28229}
28230/**
28231 * Parses a node, its children and its siblings, and generates the mutate & update OpCodes.
28232 *
28233 */
28234function parseIcuCase(tView, tIcu, lView, updateOpCodes, parentIdx, caseName, unsafeCaseHtml, nestedIcus) {
28235    const create = [];
28236    const remove = [];
28237    const update = [];
28238    if (ngDevMode) {
28239        attachDebugGetter(create, icuCreateOpCodesToString);
28240        attachDebugGetter(remove, i18nRemoveOpCodesToString);
28241        attachDebugGetter(update, i18nUpdateOpCodesToString);
28242    }
28243    tIcu.cases.push(caseName);
28244    tIcu.create.push(create);
28245    tIcu.remove.push(remove);
28246    tIcu.update.push(update);
28247    const inertBodyHelper = getInertBodyHelper(getDocument());
28248    const inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeCaseHtml);
28249    ngDevMode && assertDefined(inertBodyElement, 'Unable to generate inert body element');
28250    const inertRootNode = getTemplateContent(inertBodyElement) || inertBodyElement;
28251    if (inertRootNode) {
28252        return walkIcuTree(tView, tIcu, lView, updateOpCodes, create, remove, update, inertRootNode, parentIdx, nestedIcus, 0);
28253    }
28254    else {
28255        return 0;
28256    }
28257}
28258function walkIcuTree(tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, parentNode, parentIdx, nestedIcus, depth) {
28259    let bindingMask = 0;
28260    let currentNode = parentNode.firstChild;
28261    while (currentNode) {
28262        const newIndex = allocExpando(tView, lView, 1, null);
28263        switch (currentNode.nodeType) {
28264            case Node.ELEMENT_NODE:
28265                const element = currentNode;
28266                const tagName = element.tagName.toLowerCase();
28267                if (VALID_ELEMENTS.hasOwnProperty(tagName)) {
28268                    addCreateNodeAndAppend(create, ELEMENT_MARKER, tagName, parentIdx, newIndex);
28269                    tView.data[newIndex] = tagName;
28270                    const elAttrs = element.attributes;
28271                    for (let i = 0; i < elAttrs.length; i++) {
28272                        const attr = elAttrs.item(i);
28273                        const lowerAttrName = attr.name.toLowerCase();
28274                        const hasBinding = !!attr.value.match(BINDING_REGEXP);
28275                        // we assume the input string is safe, unless it's using a binding
28276                        if (hasBinding) {
28277                            if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {
28278                                if (URI_ATTRS[lowerAttrName]) {
28279                                    generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, _sanitizeUrl);
28280                                }
28281                                else if (SRCSET_ATTRS[lowerAttrName]) {
28282                                    generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, sanitizeSrcset);
28283                                }
28284                                else {
28285                                    generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name);
28286                                }
28287                            }
28288                            else {
28289                                ngDevMode &&
28290                                    console.warn(`WARNING: ignoring unsafe attribute value ` +
28291                                        `${lowerAttrName} on element ${tagName} ` +
28292                                        `(see https://g.co/ng/security#xss)`);
28293                            }
28294                        }
28295                        else {
28296                            addCreateAttribute(create, newIndex, attr);
28297                        }
28298                    }
28299                    // Parse the children of this node (if any)
28300                    bindingMask = walkIcuTree(tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, currentNode, newIndex, nestedIcus, depth + 1) |
28301                        bindingMask;
28302                    addRemoveNode(remove, newIndex, depth);
28303                }
28304                break;
28305            case Node.TEXT_NODE:
28306                const value = currentNode.textContent || '';
28307                const hasBinding = value.match(BINDING_REGEXP);
28308                addCreateNodeAndAppend(create, null, hasBinding ? '' : value, parentIdx, newIndex);
28309                addRemoveNode(remove, newIndex, depth);
28310                if (hasBinding) {
28311                    bindingMask = generateBindingUpdateOpCodes(update, value, newIndex) | bindingMask;
28312                }
28313                break;
28314            case Node.COMMENT_NODE:
28315                // Check if the comment node is a placeholder for a nested ICU
28316                const isNestedIcu = NESTED_ICU.exec(currentNode.textContent || '');
28317                if (isNestedIcu) {
28318                    const nestedIcuIndex = parseInt(isNestedIcu[1], 10);
28319                    const icuExpression = nestedIcus[nestedIcuIndex];
28320                    // Create the comment node that will anchor the ICU expression
28321                    addCreateNodeAndAppend(create, ICU_MARKER, ngDevMode ? `nested ICU ${nestedIcuIndex}` : '', parentIdx, newIndex);
28322                    icuStart(tView, lView, sharedUpdateOpCodes, parentIdx, icuExpression, newIndex);
28323                    addRemoveNestedIcu(remove, newIndex, depth);
28324                }
28325                break;
28326        }
28327        currentNode = currentNode.nextSibling;
28328    }
28329    return bindingMask;
28330}
28331function addRemoveNode(remove, index, depth) {
28332    if (depth === 0) {
28333        remove.push(index);
28334    }
28335}
28336function addRemoveNestedIcu(remove, index, depth) {
28337    if (depth === 0) {
28338        remove.push(~index); // remove ICU at `index`
28339        remove.push(index); // remove ICU comment at `index`
28340    }
28341}
28342function addUpdateIcuSwitch(update, icuExpression, index) {
28343    update.push(toMaskBit(icuExpression.mainBinding), 2, -1 - icuExpression.mainBinding, index << 2 /* SHIFT_REF */ | 2 /* IcuSwitch */);
28344}
28345function addUpdateIcuUpdate(update, bindingMask, index) {
28346    update.push(bindingMask, 1, index << 2 /* SHIFT_REF */ | 3 /* IcuUpdate */);
28347}
28348function addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createAtIdx) {
28349    if (marker !== null) {
28350        create.push(marker);
28351    }
28352    create.push(text, createAtIdx, icuCreateOpCode(0 /* AppendChild */, appendToParentIdx, createAtIdx));
28353}
28354function addCreateAttribute(create, newIndex, attr) {
28355    create.push(newIndex << 1 /* SHIFT_REF */ | 1 /* Attr */, attr.name, attr.value);
28356}
28357
28358/**
28359 * @license
28360 * Copyright Google LLC All Rights Reserved.
28361 *
28362 * Use of this source code is governed by an MIT-style license that can be
28363 * found in the LICENSE file at https://angular.io/license
28364 */
28365// i18nPostprocess consts
28366const ROOT_TEMPLATE_ID = 0;
28367const PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\[(�.+?�?)\]/;
28368const PP_PLACEHOLDERS_REGEXP = /\[(�.+?�?)\]|(�\/?\*\d+:\d+�)/g;
28369const PP_ICU_VARS_REGEXP = /({\s*)(VAR_(PLURAL|SELECT)(_\d+)?)(\s*,)/g;
28370const PP_ICU_PLACEHOLDERS_REGEXP = /{([A-Z0-9_]+)}/g;
28371const PP_ICUS_REGEXP = /�I18N_EXP_(ICU(_\d+)?)�/g;
28372const PP_CLOSE_TEMPLATE_REGEXP = /\/\*/;
28373const PP_TEMPLATE_ID_REGEXP = /\d+\:(\d+)/;
28374/**
28375 * Handles message string post-processing for internationalization.
28376 *
28377 * Handles message string post-processing by transforming it from intermediate
28378 * format (that might contain some markers that we need to replace) to the final
28379 * form, consumable by i18nStart instruction. Post processing steps include:
28380 *
28381 * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])
28382 * 2. Replace all ICU vars (like "VAR_PLURAL")
28383 * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}
28384 * 4. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)
28385 *    in case multiple ICUs have the same placeholder name
28386 *
28387 * @param message Raw translation string for post processing
28388 * @param replacements Set of replacements that should be applied
28389 *
28390 * @returns Transformed string that can be consumed by i18nStart instruction
28391 *
28392 * @codeGenApi
28393 */
28394function i18nPostprocess(message, replacements = {}) {
28395    /**
28396     * Step 1: resolve all multi-value placeholders like [�#5�|�*1:1��#2:1�|�#4:1�]
28397     *
28398     * Note: due to the way we process nested templates (BFS), multi-value placeholders are typically
28399     * grouped by templates, for example: [�#5�|�#6�|�#1:1�|�#3:2�] where �#5� and �#6� belong to root
28400     * template, �#1:1� belong to nested template with index 1 and �#1:2� - nested template with index
28401     * 3. However in real templates the order might be different: i.e. �#1:1� and/or �#3:2� may go in
28402     * front of �#6�. The post processing step restores the right order by keeping track of the
28403     * template id stack and looks for placeholders that belong to the currently active template.
28404     */
28405    let result = message;
28406    if (PP_MULTI_VALUE_PLACEHOLDERS_REGEXP.test(message)) {
28407        const matches = {};
28408        const templateIdsStack = [ROOT_TEMPLATE_ID];
28409        result = result.replace(PP_PLACEHOLDERS_REGEXP, (m, phs, tmpl) => {
28410            const content = phs || tmpl;
28411            const placeholders = matches[content] || [];
28412            if (!placeholders.length) {
28413                content.split('|').forEach((placeholder) => {
28414                    const match = placeholder.match(PP_TEMPLATE_ID_REGEXP);
28415                    const templateId = match ? parseInt(match[1], 10) : ROOT_TEMPLATE_ID;
28416                    const isCloseTemplateTag = PP_CLOSE_TEMPLATE_REGEXP.test(placeholder);
28417                    placeholders.push([templateId, isCloseTemplateTag, placeholder]);
28418                });
28419                matches[content] = placeholders;
28420            }
28421            if (!placeholders.length) {
28422                throw new Error(`i18n postprocess: unmatched placeholder - ${content}`);
28423            }
28424            const currentTemplateId = templateIdsStack[templateIdsStack.length - 1];
28425            let idx = 0;
28426            // find placeholder index that matches current template id
28427            for (let i = 0; i < placeholders.length; i++) {
28428                if (placeholders[i][0] === currentTemplateId) {
28429                    idx = i;
28430                    break;
28431                }
28432            }
28433            // update template id stack based on the current tag extracted
28434            const [templateId, isCloseTemplateTag, placeholder] = placeholders[idx];
28435            if (isCloseTemplateTag) {
28436                templateIdsStack.pop();
28437            }
28438            else if (currentTemplateId !== templateId) {
28439                templateIdsStack.push(templateId);
28440            }
28441            // remove processed tag from the list
28442            placeholders.splice(idx, 1);
28443            return placeholder;
28444        });
28445    }
28446    // return current result if no replacements specified
28447    if (!Object.keys(replacements).length) {
28448        return result;
28449    }
28450    /**
28451     * Step 2: replace all ICU vars (like "VAR_PLURAL")
28452     */
28453    result = result.replace(PP_ICU_VARS_REGEXP, (match, start, key, _type, _idx, end) => {
28454        return replacements.hasOwnProperty(key) ? `${start}${replacements[key]}${end}` : match;
28455    });
28456    /**
28457     * Step 3: replace all placeholders used inside ICUs in a form of {PLACEHOLDER}
28458     */
28459    result = result.replace(PP_ICU_PLACEHOLDERS_REGEXP, (match, key) => {
28460        return replacements.hasOwnProperty(key) ? replacements[key] : match;
28461    });
28462    /**
28463     * Step 4: replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�) in case
28464     * multiple ICUs have the same placeholder name
28465     */
28466    result = result.replace(PP_ICUS_REGEXP, (match, key) => {
28467        if (replacements.hasOwnProperty(key)) {
28468            const list = replacements[key];
28469            if (!list.length) {
28470                throw new Error(`i18n postprocess: unmatched ICU - ${match} with key: ${key}`);
28471            }
28472            return list.shift();
28473        }
28474        return match;
28475    });
28476    return result;
28477}
28478
28479/**
28480 * @license
28481 * Copyright Google LLC All Rights Reserved.
28482 *
28483 * Use of this source code is governed by an MIT-style license that can be
28484 * found in the LICENSE file at https://angular.io/license
28485 */
28486/**
28487 * Marks a block of text as translatable.
28488 *
28489 * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.
28490 * The translation `message` is the value which is locale specific. The translation string may
28491 * contain placeholders which associate inner elements and sub-templates within the translation.
28492 *
28493 * The translation `message` placeholders are:
28494 * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be
28495 *   interpolated into. The placeholder `index` points to the expression binding index. An optional
28496 *   `block` that matches the sub-template in which it was declared.
28497 * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*:  Marks the beginning
28498 *   and end of DOM element that were embedded in the original translation block. The placeholder
28499 *   `index` points to the element index in the template instructions set. An optional `block` that
28500 *   matches the sub-template in which it was declared.
28501 * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be
28502 *   split up and translated separately in each angular template function. The `index` points to the
28503 *   `template` instruction index. A `block` that matches the sub-template in which it was declared.
28504 *
28505 * @param index A unique index of the translation in the static block.
28506 * @param messageIndex An index of the translation message from the `def.consts` array.
28507 * @param subTemplateIndex Optional sub-template index in the `message`.
28508 *
28509 * @codeGenApi
28510 */
28511function ɵɵi18nStart(index, messageIndex, subTemplateIndex = -1) {
28512    const tView = getTView();
28513    const lView = getLView();
28514    const adjustedIndex = HEADER_OFFSET + index;
28515    ngDevMode && assertDefined(tView, `tView should be defined`);
28516    const message = getConstant(tView.consts, messageIndex);
28517    const parentTNode = getCurrentParentTNode();
28518    if (tView.firstCreatePass) {
28519        i18nStartFirstCreatePass(tView, parentTNode === null ? 0 : parentTNode.index, lView, adjustedIndex, message, subTemplateIndex);
28520    }
28521    const tI18n = tView.data[adjustedIndex];
28522    const sameViewParentTNode = parentTNode === lView[T_HOST] ? null : parentTNode;
28523    const parentRNode = getClosestRElement(tView, sameViewParentTNode, lView);
28524    // If `parentTNode` is an `ElementContainer` than it has `<!--ng-container--->`.
28525    // When we do inserts we have to make sure to insert in front of `<!--ng-container--->`.
28526    const insertInFrontOf = parentTNode && (parentTNode.type & 8 /* ElementContainer */) ?
28527        lView[parentTNode.index] :
28528        null;
28529    applyCreateOpCodes(lView, tI18n.create, parentRNode, insertInFrontOf);
28530    setInI18nBlock(true);
28531}
28532/**
28533 * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes
28534 * into the render tree, moves the placeholder nodes and removes the deleted nodes.
28535 *
28536 * @codeGenApi
28537 */
28538function ɵɵi18nEnd() {
28539    setInI18nBlock(false);
28540}
28541/**
28542 *
28543 * Use this instruction to create a translation block that doesn't contain any placeholder.
28544 * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.
28545 *
28546 * The translation `message` is the value which is locale specific. The translation string may
28547 * contain placeholders which associate inner elements and sub-templates within the translation.
28548 *
28549 * The translation `message` placeholders are:
28550 * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be
28551 *   interpolated into. The placeholder `index` points to the expression binding index. An optional
28552 *   `block` that matches the sub-template in which it was declared.
28553 * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*:  Marks the beginning
28554 *   and end of DOM element that were embedded in the original translation block. The placeholder
28555 *   `index` points to the element index in the template instructions set. An optional `block` that
28556 *   matches the sub-template in which it was declared.
28557 * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be
28558 *   split up and translated separately in each angular template function. The `index` points to the
28559 *   `template` instruction index. A `block` that matches the sub-template in which it was declared.
28560 *
28561 * @param index A unique index of the translation in the static block.
28562 * @param messageIndex An index of the translation message from the `def.consts` array.
28563 * @param subTemplateIndex Optional sub-template index in the `message`.
28564 *
28565 * @codeGenApi
28566 */
28567function ɵɵi18n(index, messageIndex, subTemplateIndex) {
28568    ɵɵi18nStart(index, messageIndex, subTemplateIndex);
28569    ɵɵi18nEnd();
28570}
28571/**
28572 * Marks a list of attributes as translatable.
28573 *
28574 * @param index A unique index in the static block
28575 * @param values
28576 *
28577 * @codeGenApi
28578 */
28579function ɵɵi18nAttributes(index, attrsIndex) {
28580    const tView = getTView();
28581    ngDevMode && assertDefined(tView, `tView should be defined`);
28582    const attrs = getConstant(tView.consts, attrsIndex);
28583    i18nAttributesFirstPass(tView, index + HEADER_OFFSET, attrs);
28584}
28585/**
28586 * Stores the values of the bindings during each update cycle in order to determine if we need to
28587 * update the translated nodes.
28588 *
28589 * @param value The binding's value
28590 * @returns This function returns itself so that it may be chained
28591 * (e.g. `i18nExp(ctx.name)(ctx.title)`)
28592 *
28593 * @codeGenApi
28594 */
28595function ɵɵi18nExp(value) {
28596    const lView = getLView();
28597    setMaskBit(bindingUpdated(lView, nextBindingIndex(), value));
28598    return ɵɵi18nExp;
28599}
28600/**
28601 * Updates a translation block or an i18n attribute when the bindings have changed.
28602 *
28603 * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}
28604 * (i18n attribute) on which it should update the content.
28605 *
28606 * @codeGenApi
28607 */
28608function ɵɵi18nApply(index) {
28609    applyI18n(getTView(), getLView(), index + HEADER_OFFSET);
28610}
28611/**
28612 * Handles message string post-processing for internationalization.
28613 *
28614 * Handles message string post-processing by transforming it from intermediate
28615 * format (that might contain some markers that we need to replace) to the final
28616 * form, consumable by i18nStart instruction. Post processing steps include:
28617 *
28618 * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])
28619 * 2. Replace all ICU vars (like "VAR_PLURAL")
28620 * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}
28621 * 4. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)
28622 *    in case multiple ICUs have the same placeholder name
28623 *
28624 * @param message Raw translation string for post processing
28625 * @param replacements Set of replacements that should be applied
28626 *
28627 * @returns Transformed string that can be consumed by i18nStart instruction
28628 *
28629 * @codeGenApi
28630 */
28631function ɵɵi18nPostprocess(message, replacements = {}) {
28632    return i18nPostprocess(message, replacements);
28633}
28634
28635/**
28636 * @license
28637 * Copyright Google LLC All Rights Reserved.
28638 *
28639 * Use of this source code is governed by an MIT-style license that can be
28640 * found in the LICENSE file at https://angular.io/license
28641 */
28642
28643/**
28644 * @license
28645 * Copyright Google LLC All Rights Reserved.
28646 *
28647 * Use of this source code is governed by an MIT-style license that can be
28648 * found in the LICENSE file at https://angular.io/license
28649 */
28650/**
28651 * Resolves the providers which are defined in the DirectiveDef.
28652 *
28653 * When inserting the tokens and the factories in their respective arrays, we can assume that
28654 * this method is called first for the component (if any), and then for other directives on the same
28655 * node.
28656 * As a consequence,the providers are always processed in that order:
28657 * 1) The view providers of the component
28658 * 2) The providers of the component
28659 * 3) The providers of the other directives
28660 * This matches the structure of the injectables arrays of a view (for each node).
28661 * So the tokens and the factories can be pushed at the end of the arrays, except
28662 * in one case for multi providers.
28663 *
28664 * @param def the directive definition
28665 * @param providers: Array of `providers`.
28666 * @param viewProviders: Array of `viewProviders`.
28667 */
28668function providersResolver(def, providers, viewProviders) {
28669    const tView = getTView();
28670    if (tView.firstCreatePass) {
28671        const isComponent = isComponentDef(def);
28672        // The list of view providers is processed first, and the flags are updated
28673        resolveProvider$1(viewProviders, tView.data, tView.blueprint, isComponent, true);
28674        // Then, the list of providers is processed, and the flags are updated
28675        resolveProvider$1(providers, tView.data, tView.blueprint, isComponent, false);
28676    }
28677}
28678/**
28679 * Resolves a provider and publishes it to the DI system.
28680 */
28681function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {
28682    provider = resolveForwardRef(provider);
28683    if (Array.isArray(provider)) {
28684        // Recursively call `resolveProvider`
28685        // Recursion is OK in this case because this code will not be in hot-path once we implement
28686        // cloning of the initial state.
28687        for (let i = 0; i < provider.length; i++) {
28688            resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);
28689        }
28690    }
28691    else {
28692        const tView = getTView();
28693        const lView = getLView();
28694        let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);
28695        let providerFactory = providerToFactory(provider);
28696        const tNode = getCurrentTNode();
28697        const beginIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */;
28698        const endIndex = tNode.directiveStart;
28699        const cptViewProvidersCount = tNode.providerIndexes >> 20 /* CptViewProvidersCountShift */;
28700        if (isTypeProvider(provider) || !provider.multi) {
28701            // Single provider case: the factory is created and pushed immediately
28702            const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);
28703            const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);
28704            if (existingFactoryIndex === -1) {
28705                diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);
28706                registerDestroyHooksIfSupported(tView, provider, tInjectables.length);
28707                tInjectables.push(token);
28708                tNode.directiveStart++;
28709                tNode.directiveEnd++;
28710                if (isViewProvider) {
28711                    tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;
28712                }
28713                lInjectablesBlueprint.push(factory);
28714                lView.push(factory);
28715            }
28716            else {
28717                lInjectablesBlueprint[existingFactoryIndex] = factory;
28718                lView[existingFactoryIndex] = factory;
28719            }
28720        }
28721        else {
28722            // Multi provider case:
28723            // We create a multi factory which is going to aggregate all the values.
28724            // Since the output of such a factory depends on content or view injection,
28725            // we create two of them, which are linked together.
28726            //
28727            // The first one (for view providers) is always in the first block of the injectables array,
28728            // and the second one (for providers) is always in the second block.
28729            // This is important because view providers have higher priority. When a multi token
28730            // is being looked up, the view providers should be found first.
28731            // Note that it is not possible to have a multi factory in the third block (directive block).
28732            //
28733            // The algorithm to process multi providers is as follows:
28734            // 1) If the multi provider comes from the `viewProviders` of the component:
28735            //   a) If the special view providers factory doesn't exist, it is created and pushed.
28736            //   b) Else, the multi provider is added to the existing multi factory.
28737            // 2) If the multi provider comes from the `providers` of the component or of another
28738            // directive:
28739            //   a) If the multi factory doesn't exist, it is created and provider pushed into it.
28740            //      It is also linked to the multi factory for view providers, if it exists.
28741            //   b) Else, the multi provider is added to the existing multi factory.
28742            const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);
28743            const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);
28744            const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&
28745                lInjectablesBlueprint[existingProvidersFactoryIndex];
28746            const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&
28747                lInjectablesBlueprint[existingViewProvidersFactoryIndex];
28748            if (isViewProvider && !doesViewProvidersFactoryExist ||
28749                !isViewProvider && !doesProvidersFactoryExist) {
28750                // Cases 1.a and 2.a
28751                diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);
28752                const factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);
28753                if (!isViewProvider && doesViewProvidersFactoryExist) {
28754                    lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;
28755                }
28756                registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);
28757                tInjectables.push(token);
28758                tNode.directiveStart++;
28759                tNode.directiveEnd++;
28760                if (isViewProvider) {
28761                    tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;
28762                }
28763                lInjectablesBlueprint.push(factory);
28764                lView.push(factory);
28765            }
28766            else {
28767                // Cases 1.b and 2.b
28768                const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex :
28769                    existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);
28770                registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex :
28771                    existingViewProvidersFactoryIndex, indexInFactory);
28772            }
28773            if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {
28774                lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;
28775            }
28776        }
28777    }
28778}
28779/**
28780 * Registers the `ngOnDestroy` hook of a provider, if the provider supports destroy hooks.
28781 * @param tView `TView` in which to register the hook.
28782 * @param provider Provider whose hook should be registered.
28783 * @param contextIndex Index under which to find the context for the hook when it's being invoked.
28784 * @param indexInFactory Only required for `multi` providers. Index of the provider in the multi
28785 * provider factory.
28786 */
28787function registerDestroyHooksIfSupported(tView, provider, contextIndex, indexInFactory) {
28788    const providerIsTypeProvider = isTypeProvider(provider);
28789    if (providerIsTypeProvider || isClassProvider(provider)) {
28790        const prototype = (provider.useClass || provider).prototype;
28791        const ngOnDestroy = prototype.ngOnDestroy;
28792        if (ngOnDestroy) {
28793            const hooks = tView.destroyHooks || (tView.destroyHooks = []);
28794            if (!providerIsTypeProvider && provider.multi) {
28795                ngDevMode &&
28796                    assertDefined(indexInFactory, 'indexInFactory when registering multi factory destroy hook');
28797                const existingCallbacksIndex = hooks.indexOf(contextIndex);
28798                if (existingCallbacksIndex === -1) {
28799                    hooks.push(contextIndex, [indexInFactory, ngOnDestroy]);
28800                }
28801                else {
28802                    hooks[existingCallbacksIndex + 1].push(indexInFactory, ngOnDestroy);
28803                }
28804            }
28805            else {
28806                hooks.push(contextIndex, ngOnDestroy);
28807            }
28808        }
28809    }
28810}
28811/**
28812 * Add a factory in a multi factory.
28813 * @returns Index at which the factory was inserted.
28814 */
28815function multiFactoryAdd(multiFactory, factory, isComponentProvider) {
28816    if (isComponentProvider) {
28817        multiFactory.componentProviders++;
28818    }
28819    return multiFactory.multi.push(factory) - 1;
28820}
28821/**
28822 * Returns the index of item in the array, but only in the begin to end range.
28823 */
28824function indexOf(item, arr, begin, end) {
28825    for (let i = begin; i < end; i++) {
28826        if (arr[i] === item)
28827            return i;
28828    }
28829    return -1;
28830}
28831/**
28832 * Use this with `multi` `providers`.
28833 */
28834function multiProvidersFactoryResolver(_, tData, lData, tNode) {
28835    return multiResolve(this.multi, []);
28836}
28837/**
28838 * Use this with `multi` `viewProviders`.
28839 *
28840 * This factory knows how to concatenate itself with the existing `multi` `providers`.
28841 */
28842function multiViewProvidersFactoryResolver(_, tData, lView, tNode) {
28843    const factories = this.multi;
28844    let result;
28845    if (this.providerFactory) {
28846        const componentCount = this.providerFactory.componentProviders;
28847        const multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, t
28847Node);
28848        // Copy the section of the array which contains `multi` `providers` from the component
28849        result = multiProviders.slice(0, componentCount);
28850        // Insert the `viewProvider` instances.
28851        multiResolve(factories, result);
28852        // Copy the section of the array which contains `multi` `providers` from other directives
28853        for (let i = componentCount; i < multiProviders.length; i++) {
28854            result.push(multiProviders[i]);
28855        }
28856    }
28857    else {
28858        result = [];
28859        // Insert the `viewProvider` instances.
28860        multiResolve(factories, result);
28861    }
28862    return result;
28863}
28864/**
28865 * Maps an array of factories into an array of values.
28866 */
28867function multiResolve(factories, result) {
28868    for (let i = 0; i < factories.length; i++) {
28869        const factory = factories[i];
28870        result.push(factory());
28871    }
28872    return result;
28873}
28874/**
28875 * Creates a multi factory.
28876 */
28877function multiFactory(factoryFn, index, isViewProvider, isComponent, f) {
28878    const factory = new NodeInjectorFactory(factoryFn, isViewProvider, ɵɵdirectiveInject);
28879    factory.multi = [];
28880    factory.index = index;
28881    factory.componentProviders = 0;
28882    multiFactoryAdd(factory, f, isComponent && !isViewProvider);
28883    return factory;
28884}
28885
28886/**
28887 * This feature resolves the providers of a directive (or component),
28888 * and publish them into the DI system, making it visible to others for injection.
28889 *
28890 * For example:
28891 * ```ts
28892 * class ComponentWithProviders {
28893 *   constructor(private greeter: GreeterDE) {}
28894 *
28895 *   static ɵcmp = defineComponent({
28896 *     type: ComponentWithProviders,
28897 *     selectors: [['component-with-providers']],
28898 *    factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),
28899 *    decls: 1,
28900 *    vars: 1,
28901 *    template: function(fs: RenderFlags, ctx: ComponentWithProviders) {
28902 *      if (fs & RenderFlags.Create) {
28903 *        ɵɵtext(0);
28904 *      }
28905 *      if (fs & RenderFlags.Update) {
28906 *        ɵɵtextInterpolate(ctx.greeter.greet());
28907 *      }
28908 *    },
28909 *    features: [ɵɵProvidersFeature([GreeterDE])]
28910 *  });
28911 * }
28912 * ```
28913 *
28914 * @param definition
28915 *
28916 * @codeGenApi
28917 */
28918function ɵɵProvidersFeature(providers, viewProviders = []) {
28919    return (definition) => {
28920        definition.providersResolver =
28921            (def, processProvidersFn) => {
28922                return providersResolver(def, //
28923                processProvidersFn ? processProvidersFn(providers) : providers, //
28924                viewProviders);
28925            };
28926    };
28927}
28928
28929/**
28930 * @license
28931 * Copyright Google LLC All Rights Reserved.
28932 *
28933 * Use of this source code is governed by an MIT-style license that can be
28934 * found in the LICENSE file at https://angular.io/license
28935 */
28936/**
28937 * Represents a component created by a `ComponentFactory`.
28938 * Provides access to the component instance and related objects,
28939 * and provides the means of destroying the instance.
28940 *
28941 * @publicApi
28942 */
28943class ComponentRef {
28944}
28945/**
28946 * Base class for a factory that can create a component dynamically.
28947 * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
28948 * Use the resulting `ComponentFactory.create()` method to create a component of that type.
28949 *
28950 * @see [Dynamic Components](guide/dynamic-component-loader)
28951 *
28952 * @publicApi
28953 */
28954class ComponentFactory {
28955}
28956
28957/**
28958 * @license
28959 * Copyright Google LLC All Rights Reserved.
28960 *
28961 * Use of this source code is governed by an MIT-style license that can be
28962 * found in the LICENSE file at https://angular.io/license
28963 */
28964function noComponentFactoryError(component) {
28965    const error = Error(`No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);
28966    error[ERROR_COMPONENT] = component;
28967    return error;
28968}
28969const ERROR_COMPONENT = 'ngComponent';
28970function getComponent$1(error) {
28971    return error[ERROR_COMPONENT];
28972}
28973class _NullComponentFactoryResolver {
28974    resolveComponentFactory(component) {
28975        throw noComponentFactoryError(component);
28976    }
28977}
28978/**
28979 * A simple registry that maps `Components` to generated `ComponentFactory` classes
28980 * that can be used to create instances of components.
28981 * Use to obtain the factory for a given component type,
28982 * then use the factory's `create()` method to create a component of that type.
28983 *
28984 * @see [Dynamic Components](guide/dynamic-component-loader)
28985 * @publicApi
28986 */
28987class ComponentFactoryResolver {
28988}
28989ComponentFactoryResolver.NULL = new _NullComponentFactoryResolver();
28990class CodegenComponentFactoryResolver {
28991    constructor(factories, _parent, _ngModule) {
28992        this._parent = _parent;
28993        this._ngModule = _ngModule;
28994        this._factories = new Map();
28995        for (let i = 0; i < factories.length; i++) {
28996            const factory = factories[i];
28997            this._factories.set(factory.componentType, factory);
28998        }
28999    }
29000    resolveComponentFactory(component) {
29001        let factory = this._factories.get(component);
29002        if (!factory && this._parent) {
29003            factory = this._parent.resolveComponentFactory(component);
29004        }
29005        if (!factory) {
29006            throw noComponentFactoryError(component);
29007        }
29008        return new ComponentFactoryBoundToModule(factory, this._ngModule);
29009    }
29010}
29011class ComponentFactoryBoundToModule extends ComponentFactory {
29012    constructor(factory, ngModule) {
29013        super();
29014        this.factory = factory;
29015        this.ngModule = ngModule;
29016        this.selector = factory.selector;
29017        this.componentType = factory.componentType;
29018        this.ngContentSelectors = factory.ngContentSelectors;
29019        this.inputs = factory.inputs;
29020        this.outputs = factory.outputs;
29021    }
29022    create(injector, projectableNodes, rootSelectorOrNode, ngModule) {
29023        return this.factory.create(injector, projectableNodes, rootSelectorOrNode, ngModule || this.ngModule);
29024    }
29025}
29026
29027/**
29028 * @license
29029 * Copyright Google LLC All Rights Reserved.
29030 *
29031 * Use of this source code is governed by an MIT-style license that can be
29032 * found in the LICENSE file at https://angular.io/license
29033 */
29034function noop(...args) {
29035    // Do nothing.
29036}
29037
29038/**
29039 * @license
29040 * Copyright Google LLC All Rights Reserved.
29041 *
29042 * Use of this source code is governed by an MIT-style license that can be
29043 * found in the LICENSE file at https://angular.io/license
29044 */
29045/**
29046 * Creates an ElementRef from the most recent node.
29047 *
29048 * @returns The ElementRef instance to use
29049 */
29050function injectElementRef() {
29051    return createElementRef(getCurrentTNode(), getLView());
29052}
29053/**
29054 * Creates an ElementRef given a node.
29055 *
29056 * @param tNode The node for which you'd like an ElementRef
29057 * @param lView The view to which the node belongs
29058 * @returns The ElementRef instance to use
29059 */
29060function createElementRef(tNode, lView) {
29061    return new ElementRef(getNativeByTNode(tNode, lView));
29062}
29063const SWITCH_ELEMENT_REF_FACTORY__POST_R3__ = injectElementRef;
29064const SWITCH_ELEMENT_REF_FACTORY__PRE_R3__ = noop;
29065const SWITCH_ELEMENT_REF_FACTORY = SWITCH_ELEMENT_REF_FACTORY__POST_R3__;
29066/**
29067 * A wrapper around a native element inside of a View.
29068 *
29069 * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
29070 * element.
29071 *
29072 * @security Permitting direct access to the DOM can make your application more vulnerable to
29073 * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the
29074 * [Security Guide](https://g.co/ng/security).
29075 *
29076 * @publicApi
29077 */
29078// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,
29079// i.e. users have to ask for what they need. With that, we can build better analysis tools
29080// and could do better codegen in the future.
29081class ElementRef {
29082    constructor(nativeElement) {
29083        this.nativeElement = nativeElement;
29084    }
29085}
29086/**
29087 * @internal
29088 * @nocollapse
29089 */
29090ElementRef.__NG_ELEMENT_ID__ = SWITCH_ELEMENT_REF_FACTORY;
29091/**
29092 * Unwraps `ElementRef` and return the `nativeElement`.
29093 *
29094 * @param value value to unwrap
29095 * @returns `nativeElement` if `ElementRef` otherwise returns value as is.
29096 */
29097function unwrapElementRef(value) {
29098    return value instanceof ElementRef ? value.nativeElement : value;
29099}
29100
29101/**
29102 * @license
29103 * Copyright Google LLC All Rights Reserved.
29104 *
29105 * Use of this source code is governed by an MIT-style license that can be
29106 * found in the LICENSE file at https://angular.io/license
29107 */
29108const Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');
29109/**
29110 * Creates and initializes a custom renderer that implements the `Renderer2` base class.
29111 *
29112 * @publicApi
29113 */
29114class RendererFactory2 {
29115}
29116/**
29117 * Extend this base class to implement custom rendering. By default, Angular
29118 * renders a template into DOM. You can use custom rendering to intercept
29119 * rendering calls, or to render to something other than DOM.
29120 *
29121 * Create your custom renderer using `RendererFactory2`.
29122 *
29123 * Use a custom renderer to bypass Angular's templating and
29124 * make custom UI changes that can't be expressed declaratively.
29125 * For example if you need to set a property or an attribute whose name is
29126 * not statically known, use the `setProperty()` or
29127 * `setAttribute()` method.
29128 *
29129 * @publicApi
29130 */
29131class Renderer2 {
29132}
29133/**
29134 * @internal
29135 * @nocollapse
29136 */
29137Renderer2.__NG_ELEMENT_ID__ = () => SWITCH_RENDERER2_FACTORY();
29138const SWITCH_RENDERER2_FACTORY__POST_R3__ = injectRenderer2;
29139const SWITCH_RENDERER2_FACTORY__PRE_R3__ = noop;
29140const SWITCH_RENDERER2_FACTORY = SWITCH_RENDERER2_FACTORY__POST_R3__;
29141/** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */
29142function getOrCreateRenderer2(lView) {
29143    const renderer = lView[RENDERER];
29144    if (ngDevMode && !isProceduralRenderer(renderer)) {
29145        throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');
29146    }
29147    return renderer;
29148}
29149/** Injects a Renderer2 for the current component. */
29150function injectRenderer2() {
29151    // We need the Renderer to be based on the component that it's being injected into, however since
29152    // DI happens before we've entered its view, `getLView` will return the parent view instead.
29153    const lView = getLView();
29154    const tNode = getCurrentTNode();
29155    const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
29156    return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);
29157}
29158
29159/**
29160 * @license
29161 * Copyright Google LLC All Rights Reserved.
29162 *
29163 * Use of this source code is governed by an MIT-style license that can be
29164 * found in the LICENSE file at https://angular.io/license
29165 */
29166/**
29167 * Sanitizer is used by the views to sanitize potentially dangerous values.
29168 *
29169 * @publicApi
29170 */
29171class Sanitizer {
29172}
29173/** @nocollapse */
29174Sanitizer.ɵprov = ɵɵdefineInjectable({
29175    token: Sanitizer,
29176    providedIn: 'root',
29177    factory: () => null,
29178});
29179
29180/**
29181 * @license
29182 * Copyright Google LLC All Rights Reserved.
29183 *
29184 * Use of this source code is governed by an MIT-style license that can be
29185 * found in the LICENSE file at https://angular.io/license
29186 */
29187/**
29188 * @description Represents the version of Angular
29189 *
29190 * @publicApi
29191 */
29192class Version {
29193    constructor(full) {
29194        this.full = full;
29195        this.major = full.split('.')[0];
29196        this.minor = full.split('.')[1];
29197        this.patch = full.split('.').slice(2).join('.');
29198    }
29199}
29200/**
29201 * @publicApi
29202 */
29203const VERSION = new Version('11.2.11');
29204
29205/**
29206 * @license
29207 * Copyright Google LLC All Rights Reserved.
29208 *
29209 * Use of this source code is governed by an MIT-style license that can be
29210 * found in the LICENSE file at https://angular.io/license
29211 */
29212class DefaultIterableDifferFactory {
29213    constructor() { }
29214    supports(obj) {
29215        return isListLikeIterable(obj);
29216    }
29217    create(trackByFn) {
29218        return new DefaultIterableDiffer(trackByFn);
29219    }
29220}
29221const trackByIdentity = (index, item) => item;
29222const ɵ0$b = trackByIdentity;
29223/**
29224 * @deprecated v4.0.0 - Should not be part of public API.
29225 * @publicApi
29226 */
29227class DefaultIterableDiffer {
29228    constructor(trackByFn) {
29229        this.length = 0;
29230        // Keeps track of the used records at any point in time (during & across `_check()` calls)
29231        this._linkedRecords = null;
29232        // Keeps track of the removed records at any point in time during `_check()` calls.
29233        this._unlinkedRecords = null;
29234        this._previousItHead = null;
29235        this._itHead = null;
29236        this._itTail = null;
29237        this._additionsHead = null;
29238        this._additionsTail = null;
29239        this._movesHead = null;
29240        this._movesTail = null;
29241        this._removalsHead = null;
29242        this._removalsTail = null;
29243        // Keeps track of records where custom track by is the same, but item identity has changed
29244        this._identityChangesHead = null;
29245        this._identityChangesTail = null;
29246        this._trackByFn = trackByFn || trackByIdentity;
29247    }
29248    forEachItem(fn) {
29249        let record;
29250        for (record = this._itHead; record !== null; record = record._next) {
29251            fn(record);
29252        }
29253    }
29254    forEachOperation(fn) {
29255        let nextIt = this._itHead;
29256        let nextRemove = this._removalsHead;
29257        let addRemoveOffset = 0;
29258        let moveOffsets = null;
29259        while (nextIt || nextRemove) {
29260            // Figure out which is the next record to process
29261            // Order: remove, add, move
29262            const record = !nextRemove ||
29263                nextIt &&
29264                    nextIt.currentIndex <
29265                        getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ?
29266                nextIt :
29267                nextRemove;
29268            const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);
29269            const currentIndex = record.currentIndex;
29270            // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary
29271            if (record === nextRemove) {
29272                addRemoveOffset--;
29273                nextRemove = nextRemove._nextRemoved;
29274            }
29275            else {
29276                nextIt = nextIt._next;
29277                if (record.previousIndex == null) {
29278                    addRemoveOffset++;
29279                }
29280                else {
29281                    // INVARIANT:  currentIndex < previousIndex
29282                    if (!moveOffsets)
29283                        moveOffsets = [];
29284                    const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;
29285                    const localCurrentIndex = currentIndex - addRemoveOffset;
29286                    if (localMovePreviousIndex != localCurrentIndex) {
29287                        for (let i = 0; i < localMovePreviousIndex; i++) {
29288                            const offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);
29289                            const index = offset + i;
29290                            if (localCurrentIndex <= index && index < localMovePreviousIndex) {
29291                                moveOffsets[i] = offset + 1;
29292                            }
29293                        }
29294                        const previousIndex = record.previousIndex;
29295                        moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;
29296                    }
29297                }
29298            }
29299            if (adjPreviousIndex !== currentIndex) {
29300                fn(record, adjPreviousIndex, currentIndex);
29301            }
29302        }
29303    }
vendor: 7,385 bytes, lines 29304-29485
29304    forEachPreviousItem(fn) {
29305        let record;
29306        for (record = this._previousItHead; record !== null; record = record._nextPrevious) {
29307            fn(record);
29308        }
29309    }
29310    forEachAddedItem(fn) {
29311        let record;
29312        for (record = this._additionsHead; record !== null; record = record._nextAdded) {
29313            fn(record);
29314        }
29315    }
29316    forEachMovedItem(fn) {
29317        let record;
29318        for (record = this._movesHead; record !== null; record = record._nextMoved) {
29319            fn(record);
29320        }
29321    }
29322    forEachRemovedItem(fn) {
29323        let record;
29324        for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
29325            fn(record);
29326        }
29327    }
29328    forEachIdentityChange(fn) {
29329        let record;
29330        for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {
29331            fn(record);
29332        }
29333    }
29334    diff(collection) {
29335        if (collection == null)
29336            collection = [];
29337        if (!isListLikeIterable(collection)) {
29338            throw new Error(`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
29339        }
29340        if (this.check(collection)) {
29341            return this;
29342        }
29343        else {
29344            return null;
29345        }
29346    }
29347    onDestroy() { }
29348    check(collection) {
29349        this._reset();
29350        let record = this._itHead;
29351        let mayBeDirty = false;
29352        let index;
29353        let item;
29354        let itemTrackBy;
29355        if (Array.isArray(collection)) {
29356            this.length = collection.length;
29357            for (let index = 0; index < this.length; index++) {
29358                item = collection[index];
29359                itemTrackBy = this._trackByFn(index, item);
29360                if (record === null || !Object.is(record.trackById, itemTrackBy)) {
29361                    record = this._mismatch(record, item, itemTrackBy, index);
29362                    mayBeDirty = true;
29363                }
29364                else {
29365                    if (mayBeDirty) {
29366                        // TODO(misko): can we limit this to duplicates only?
29367                        record = this._verifyReinsertion(record, item, itemTrackBy, index);
29368                    }
29369                    if (!Object.is(record.item, item))
29370                        this._addIdentityChange(record, item);
29371                }
29372                record = record._next;
29373            }
29374        }
29375        else {
29376            index = 0;
29377            iterateListLike(collection, (item) => {
29378                itemTrackBy = this._trackByFn(index, item);
29379                if (record === null || !Object.is(record.trackById, itemTrackBy)) {
29380                    record = this._mismatch(record, item, itemTrackBy, index);
29381                    mayBeDirty = true;
29382                }
29383                else {
29384                    if (mayBeDirty) {
29385                        // TODO(misko): can we limit this to duplicates only?
29386                        record = this._verifyReinsertion(record, item, itemTrackBy, index);
29387                    }
29388                    if (!Object.is(record.item, item))
29389                        this._addIdentityChange(record, item);
29390                }
29391                record = record._next;
29392                index++;
29393            });
29394            this.length = index;
29395        }
29396        this._truncate(record);
29397        this.collection = collection;
29398        return this.isDirty;
29399    }
29400    /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity
29401     * changes.
29402     */
29403    get isDirty() {
29404        return this._additionsHead !== null || this._movesHead !== null ||
29405            this._removalsHead !== null || this._identityChangesHead !== null;
29406    }
29407    /**
29408     * Reset the state of the change objects to show no changes. This means set previousKey to
29409     * currentKey, and clear all of the queues (additions, moves, removals).
29410     * Set the previousIndexes of moved and added items to their currentIndexes
29411     * Reset the list of additions, moves and removals
29412     *
29413     * @internal
29414     */
29415    _reset() {
29416        if (this.isDirty) {
29417            let record;
29418            for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {
29419                record._nextPrevious = record._next;
29420            }
29421            for (record = this._additionsHead; record !== null; record = record._nextAdded) {
29422                record.previousIndex = record.currentIndex;
29423            }
29424            this._additionsHead = this._additionsTail = null;
29425            for (record = this._movesHead; record !== null; record = record._nextMoved) {
29426                record.previousIndex = record.currentIndex;
29427            }
29428            this._movesHead = this._movesTail = null;
29429            this._removalsHead = this._removalsTail = null;
29430            this._identityChangesHead = this._identityChangesTail = null;
29431            // TODO(vicb): when assert gets supported
29432            // assert(!this.isDirty);
29433        }
29434    }
29435    /**
29436     * This is the core function which handles differences between collections.
29437     *
29438     * - `record` is the record which we saw at this position last time. If null then it is a new
29439     *   item.
29440     * - `item` is the current item in the collection
29441     * - `index` is the position of the item in the collection
29442     *
29443     * @internal
29444     */
29445    _mismatch(record, item, itemTrackBy, index) {
29446        // The previous record after which we will append the current one.
29447        let previousRecord;
29448        if (record === null) {
29449            previousRecord = this._itTail;
29450        }
29451        else {
29452            previousRecord = record._prev;
29453            // Remove the record from the collection since we know it does not match the item.
29454            this._remove(record);
29455        }
29456        // See if we have evicted the item, which used to be at some anterior position of _itHead list.
29457        record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
29458        if (record !== null) {
29459            // It is an item which we have evicted earlier: reinsert it back into the list.
29460            // But first we need to check if identity changed, so we can update in view if necessary.
29461            if (!Object.is(record.item, item))
29462                this._addIdentityChange(record, item);
29463            this._reinsertAfter(record, previousRecord, index);
29464        }
29465        else {
29466            // Attempt to see if the item is at some posterior position of _itHead list.
29467            record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);
29468            if (record !== null) {
29469                // We have the item in _itHead at/after `index` position. We need to move it forward in the
29470                // collection.
29471                // But first we need to check if identity changed, so we can update in view if necessary.
29472                if (!Object.is(record.item, item))
29473                    this._addIdentityChange(record, item);
29474                this._moveAfter(record, previousRecord, index);
29475            }
29476            else {
29477                // It is a new item: add it.
29478                record =
29479                    this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index);
29480            }
29481        }
29482        return record;
29483    }
29484    /**
29485     * This check is only needed if an array contains duplicates. (Sh
29485ort circuit of nothing dirty)
29486     *
29487     * Use case: `[a, a]` => `[b, a, a]`
29488     *
29489     * If we did not have this check then the insertion of `b` would:
29490     *   1) evict first `a`
29491     *   2) insert `b` at `0` index.
29492     *   3) leave `a` at index `1` as is. <-- this is wrong!
29493     *   3) reinsert `a` at index 2. <-- this is wrong!
29494     *
29495     * The correct behavior is:
29496     *   1) evict first `a`
29497     *   2) insert `b` at `0` index.
29498     *   3) reinsert `a` at index 1.
29499     *   3) move `a` at from `1` to `2`.
29500     *
29501     *
29502     * Double check that we have not evicted a duplicate item. We need to check if the item type may
29503     * have already been removed:
29504     * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted
29505     * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a
29506     * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'
29507     * at the end.
29508     *
29509     * @internal
29510     */
29511    _verifyReinsertion(record, item, itemTrackBy, index) {
29512        let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
29513        if (reinsertRecord !== null) {
29514            record = this._reinsertAfter(reinsertRecord, record._prev, index);
29515        }
29516        else if (record.currentIndex != index) {
29517            record.currentIndex = index;
29518            this._addToMoves(record, index);
29519        }
29520        return record;
29521    }
29522    /**
29523     * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection
29524     *
29525     * - `record` The first excess {@link IterableChangeRecord_}.
29526     *
29527     * @internal
29528     */
29529    _truncate(record) {
29530        // Anything after that needs to be removed;
29531        while (record !== null) {
29532            const nextRecord = record._next;
29533            this._addToRemovals(this._unlink(record));
29534            record = nextRecord;
29535        }
29536        if (this._unlinkedRecords !== null) {
29537            this._unlinkedRecords.clear();
29538        }
29539        if (this._additionsTail !== null) {
29540            this._additionsTail._nextAdded = null;
29541        }
29542        if (this._movesTail !== null) {
29543            this._movesTail._nextMoved = null;
29544        }
29545        if (this._itTail !== null) {
29546            this._itTail._next = null;
29547        }
29548        if (this._removalsTail !== null) {
29549            this._removalsTail._nextRemoved = null;
29550        }
29551        if (this._identityChangesTail !== null) {
29552            this._identityChangesTail._nextIdentityChange = null;
29553        }
29554    }
29555    /** @internal */
29556    _reinsertAfter(record, prevRecord, index) {
29557        if (this._unlinkedRecords !== null) {
29558            this._unlinkedRecords.remove(record);
29559        }
29560        const prev = record._prevRemoved;
29561        const next = record._nextRemoved;
29562        if (prev === null) {
29563            this._removalsHead = next;
29564        }
29565        else {
29566            prev._nextRemoved = next;
29567        }
29568        if (next === null) {
29569            this._removalsTail = prev;
29570        }
29571        else {
29572            next._prevRemoved = prev;
29573        }
29574        this._insertAfter(record, prevRecord, index);
29575        this._addToMoves(record, index);
29576        return record;
29577    }
29578    /** @internal */
29579    _moveAfter(record, prevRecord, index) {
29580        this._unlink(record);
29581        this._insertAfter(record, prevRecord, index);
29582        this._addToMoves(record, index);
29583        return record;
29584    }
29585    /** @internal */
29586    _addAfter(record, prevRecord, index) {
29587        this._insertAfter(record, prevRecord, index);
29588        if (this._additionsTail === null) {
29589            // TODO(vicb):
29590            // assert(this._additionsHead === null);
29591            this._additionsTail = this._additionsHead = record;
29592        }
29593        else {
29594            // TODO(vicb):
29595            // assert(_additionsTail._nextAdded === null);
29596            // assert(record._nextAdded === null);
29597            this._additionsTail = this._additionsTail._nextAdded = record;
29598        }
29599        return record;
29600    }
29601    /** @internal */
29602    _insertAfter(record, prevRecord, index) {
29603        // TODO(vicb):
29604        // assert(record != prevRecord);
29605        // assert(record._next === null);
29606        // assert(record._prev === null);
29607        const next = prevRecord === null ? this._itHead : prevRecord._next;
29608        // TODO(vicb):
29609        // assert(next != record);
29610        // assert(prevRecord != record);
29611        record._next = next;
29612        record._prev = prevRecord;
29613        if (next === null) {
29614            this._itTail = record;
29615        }
29616        else {
29617            next._prev = record;
29618        }
29619        if (prevRecord === null) {
29620            this._itHead = record;
29621        }
29622        else {
29623            prevRecord._next = record;
29624        }
29625        if (this._linkedRecords === null) {
29626            this._linkedRecords = new _DuplicateMap();
29627        }
29628        this._linkedRecords.put(record);
29629        record.currentIndex = index;
29630        return record;
29631    }
29632    /** @internal */
29633    _remove(record) {
29634        return this._addToRemovals(this._unlink(record));
29635    }
29636    /** @internal */
29637    _unlink(record) {
29638        if (this._linkedRecords !== null) {
29639            this._linkedRecords.remove(record);
29640        }
29641        const prev = record._prev;
29642        const next = record._next;
29643        // TODO(vicb):
vendor: 32,109 bytes, lines 29644-30584
29644        // assert((record._prev = null) === null);
29645        // assert((record._next = null) === null);
29646        if (prev === null) {
29647            this._itHead = next;
29648        }
29649        else {
29650            prev._next = next;
29651        }
29652        if (next === null) {
29653            this._itTail = prev;
29654        }
29655        else {
29656            next._prev = prev;
29657        }
29658        return record;
29659    }
29660    /** @internal */
29661    _addToMoves(record, toIndex) {
29662        // TODO(vicb):
29663        // assert(record._nextMoved === null);
29664        if (record.previousIndex === toIndex) {
29665            return record;
29666        }
29667        if (this._movesTail === null) {
29668            // TODO(vicb):
29669            // assert(_movesHead === null);
29670            this._movesTail = this._movesHead = record;
29671        }
29672        else {
29673            // TODO(vicb):
29674            // assert(_movesTail._nextMoved === null);
29675            this._movesTail = this._movesTail._nextMoved = record;
29676        }
29677        return record;
29678    }
29679    _addToRemovals(record) {
29680        if (this._unlinkedRecords === null) {
29681            this._unlinkedRecords = new _DuplicateMap();
29682        }
29683        this._unlinkedRecords.put(record);
29684        record.currentIndex = null;
29685        record._nextRemoved = null;
29686        if (this._removalsTail === null) {
29687            // TODO(vicb):
29688            // assert(_removalsHead === null);
29689            this._removalsTail = this._removalsHead = record;
29690            record._prevRemoved = null;
29691        }
29692        else {
29693            // TODO(vicb):
29694            // assert(_removalsTail._nextRemoved === null);
29695            // assert(record._nextRemoved === null);
29696            record._prevRemoved = this._removalsTail;
29697            this._removalsTail = this._removalsTail._nextRemoved = record;
29698        }
29699        return record;
29700    }
29701    /** @internal */
29702    _addIdentityChange(record, item) {
29703        record.item = item;
29704        if (this._identityChangesTail === null) {
29705            this._identityChangesTail = this._identityChangesHead = record;
29706        }
29707        else {
29708            this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;
29709        }
29710        return record;
29711    }
29712}
29713class IterableChangeRecord_ {
29714    constructor(item, trackById) {
29715        this.item = item;
29716        this.trackById = trackById;
29717        this.currentIndex = null;
29718        this.previousIndex = null;
29719        /** @internal */
29720        this._nextPrevious = null;
29721        /** @internal */
29722        this._prev = null;
29723        /** @internal */
29724        this._next = null;
29725        /** @internal */
29726        this._prevDup = null;
29727        /** @internal */
29728        this._nextDup = null;
29729        /** @internal */
29730        this._prevRemoved = null;
29731        /** @internal */
29732        this._nextRemoved = null;
29733        /** @internal */
29734        this._nextAdded = null;
29735        /** @internal */
29736        this._nextMoved = null;
29737        /** @internal */
29738        this._nextIdentityChange = null;
29739    }
29740}
29741// A linked list of IterableChangeRecords with the same IterableChangeRecord_.item
29742class _DuplicateItemRecordList {
29743    constructor() {
29744        /** @internal */
29745        this._head = null;
29746        /** @internal */
29747        this._tail = null;
29748    }
29749    /**
29750     * Append the record to the list of duplicates.
29751     *
29752     * Note: by design all records in the list of duplicates hold the same value in record.item.
29753     */
29754    add(record) {
29755        if (this._head === null) {
29756            this._head = this._tail = record;
29757            record._nextDup = null;
29758            record._prevDup = null;
29759        }
29760        else {
29761            // TODO(vicb):
29762            // assert(record.item ==  _head.item ||
29763            //       record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);
29764            this._tail._nextDup = record;
29765            record._prevDup = this._tail;
29766            record._nextDup = null;
29767            this._tail = record;
29768        }
29769    }
29770    // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and
29771    // IterableChangeRecord_.currentIndex >= atOrAfterIndex
29772    get(trackById, atOrAfterIndex) {
29773        let record;
29774        for (record = this._head; record !== null; record = record._nextDup) {
29775            if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex) &&
29776                Object.is(record.trackById, trackById)) {
29777                return record;
29778            }
29779        }
29780        return null;
29781    }
29782    /**
29783     * Remove one {@link IterableChangeRecord_} from the list of duplicates.
29784     *
29785     * Returns whether the list of duplicates is empty.
29786     */
29787    remove(record) {
29788        // TODO(vicb):
29789        // assert(() {
29790        //  // verify that the record being removed is in the list.
29791        //  for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {
29792        //    if (identical(cursor, record)) return true;
29793        //  }
29794        //  return false;
29795        //});
29796        const prev = record._prevDup;
29797        const next = record._nextDup;
29798        if (prev === null) {
29799            this._head = next;
29800        }
29801        else {
29802            prev._nextDup = next;
29803        }
29804        if (next === null) {
29805            this._tail = prev;
29806        }
29807        else {
29808            next._prevDup = prev;
29809        }
29810        return this._head === null;
29811    }
29812}
29813class _DuplicateMap {
29814    constructor() {
29815        this.map = new Map();
29816    }
29817    put(record) {
29818        const key = record.trackById;
29819        let duplicates = this.map.get(key);
29820        if (!duplicates) {
29821            duplicates = new _DuplicateItemRecordList();
29822            this.map.set(key, duplicates);
29823        }
29824        duplicates.add(record);
29825    }
29826    /**
29827     * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we
29828     * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.
29829     *
29830     * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
29831     * have any more `a`s needs to return the second `a`.
29832     */
29833    get(trackById, atOrAfterIndex) {
29834        const key = trackById;
29835        const recordList = this.map.get(key);
29836        return recordList ? recordList.get(trackById, atOrAfterIndex) : null;
29837    }
29838    /**
29839     * Removes a {@link IterableChangeRecord_} from the list of duplicates.
29840     *
29841     * The list of duplicates also is removed from the map if it gets empty.
29842     */
29843    remove(record) {
29844        const key = record.trackById;
29845        const recordList = this.map.get(key);
29846        // Remove the list of duplicates when it gets empty
29847        if (recordList.remove(record)) {
29848            this.map.delete(key);
29849        }
29850        return record;
29851    }
29852    get isEmpty() {
29853        return this.map.size === 0;
29854    }
29855    clear() {
29856        this.map.clear();
29857    }
29858}
29859function getPreviousIndex(item, addRemoveOffset, moveOffsets) {
29860    const previousIndex = item.previousIndex;
29861    if (previousIndex === null)
29862        return previousIndex;
29863    let moveOffset = 0;
29864    if (moveOffsets && previousIndex < moveOffsets.length) {
29865        moveOffset = moveOffsets[previousIndex];
29866    }
29867    return previousIndex + addRemoveOffset + moveOffset;
29868}
29869
29870/**
29871 * @license
29872 * Copyright Google LLC All Rights Reserved.
29873 *
29874 * Use of this source code is governed by an MIT-style license that can be
29875 * found in the LICENSE file at https://angular.io/license
29876 */
29877class DefaultKeyValueDifferFactory {
29878    constructor() { }
29879    supports(obj) {
29880        return obj instanceof Map || isJsObject(obj);
29881    }
29882    create() {
29883        return new DefaultKeyValueDiffer();
29884    }
29885}
29886class DefaultKeyValueDiffer {
29887    constructor() {
29888        this._records = new Map();
29889        this._mapHead = null;
29890        // _appendAfter is used in the check loop
29891        this._appendAfter = null;
29892        this._previousMapHead = null;
29893        this._changesHead = null;
29894        this._changesTail = null;
29895        this._additionsHead = null;
29896        this._additionsTail = null;
29897        this._removalsHead = null;
29898        this._removalsTail = null;
29899    }
29900    get isDirty() {
29901        return this._additionsHead !== null || this._changesHead !== null ||
29902            this._removalsHead !== null;
29903    }
29904    forEachItem(fn) {
29905        let record;
29906        for (record = this._mapHead; record !== null; record = record._next) {
29907            fn(record);
29908        }
29909    }
29910    forEachPreviousItem(fn) {
29911        let record;
29912        for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {
29913            fn(record);
29914        }
29915    }
29916    forEachChangedItem(fn) {
29917        let record;
29918        for (record = this._changesHead; record !== null; record = record._nextChanged) {
29919            fn(record);
29920        }
29921    }
29922    forEachAddedItem(fn) {
29923        let record;
29924        for (record = this._additionsHead; record !== null; record = record._nextAdded) {
29925            fn(record);
29926        }
29927    }
29928    forEachRemovedItem(fn) {
29929        let record;
29930        for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
29931            fn(record);
29932        }
29933    }
29934    diff(map) {
29935        if (!map) {
29936            map = new Map();
29937        }
29938        else if (!(map instanceof Map || isJsObject(map))) {
29939            throw new Error(`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);
29940        }
29941        return this.check(map) ? this : null;
29942    }
29943    onDestroy() { }
29944    /**
29945     * Check the current state of the map vs the previous.
29946     * The algorithm is optimised for when the keys do no change.
29947     */
29948    check(map) {
29949        this._reset();
29950        let insertBefore = this._mapHead;
29951        this._appendAfter = null;
29952        this._forEach(map, (value, key) => {
29953            if (insertBefore && insertBefore.key === key) {
29954                this._maybeAddToChanges(insertBefore, value);
29955                this._appendAfter = insertBefore;
29956                insertBefore = insertBefore._next;
29957            }
29958            else {
29959                const record = this._getOrCreateRecordForKey(key, value);
29960                insertBefore = this._insertBeforeOrAppend(insertBefore, record);
29961            }
29962        });
29963        // Items remaining at the end of the list have been deleted
29964        if (insertBefore) {
29965            if (insertBefore._prev) {
29966                insertBefore._prev._next = null;
29967            }
29968            this._removalsHead = insertBefore;
29969            for (let record = insertBefore; record !== null; record = record._nextRemoved) {
29970                if (record === this._mapHead) {
29971                    this._mapHead = null;
29972                }
29973                this._records.delete(record.key);
29974                record._nextRemoved = record._next;
29975                record.previousValue = record.currentValue;
29976                record.currentValue = null;
29977                record._prev = null;
29978                record._next = null;
29979            }
29980        }
29981        // Make sure tails have no next records from previous runs
29982        if (this._changesTail)
29983            this._changesTail._nextChanged = null;
29984        if (this._additionsTail)
29985            this._additionsTail._nextAdded = null;
29986        return this.isDirty;
29987    }
29988    /**
29989     * Inserts a record before `before` or append at the end of the list when `before` is null.
29990     *
29991     * Notes:
29992     * - This method appends at `this._appendAfter`,
29993     * - This method updates `this._appendAfter`,
29994     * - The return value is the new value for the insertion pointer.
29995     */
29996    _insertBeforeOrAppend(before, record) {
29997        if (before) {
29998            const prev = before._prev;
29999            record._next = before;
30000            record._prev = prev;
30001            before._prev = record;
30002            if (prev) {
30003                prev._next = record;
30004            }
30005            if (before === this._mapHead) {
30006                this._mapHead = record;
30007            }
30008            this._appendAfter = before;
30009            return before;
30010        }
30011        if (this._appendAfter) {
30012            this._appendAfter._next = record;
30013            record._prev = this._appendAfter;
30014        }
30015        else {
30016            this._mapHead = record;
30017        }
30018        this._appendAfter = record;
30019        return null;
30020    }
30021    _getOrCreateRecordForKey(key, value) {
30022        if (this._records.has(key)) {
30023            const record = this._records.get(key);
30024            this._maybeAddToChanges(record, value);
30025            const prev = record._prev;
30026            const next = record._next;
30027            if (prev) {
30028                prev._next = next;
30029            }
30030            if (next) {
30031                next._prev = prev;
30032            }
30033            record._next = null;
30034            record._prev = null;
30035            return record;
30036        }
30037        const record = new KeyValueChangeRecord_(key);
30038        this._records.set(key, record);
30039        record.currentValue = value;
30040        this._addToAdditions(record);
30041        return record;
30042    }
30043    /** @internal */
30044    _reset() {
30045        if (this.isDirty) {
30046            let record;
30047            // let `_previousMapHead` contain the state of the map before the changes
30048            this._previousMapHead = this._mapHead;
30049            for (record = this._previousMapHead; record !== null; record = record._next) {
30050                record._nextPrevious = record._next;
30051            }
30052            // Update `record.previousValue` with the value of the item before the changes
30053            // We need to update all changed items (that's those which have been added and changed)
30054            for (record = this._changesHead; record !== null; record = record._nextChanged) {
30055                record.previousValue = record.currentValue;
30056            }
30057            for (record = this._additionsHead; record != null; record = record._nextAdded) {
30058                record.previousValue = record.currentValue;
30059            }
30060            this._changesHead = this._changesTail = null;
30061            this._additionsHead = this._additionsTail = null;
30062            this._removalsHead = null;
30063        }
30064    }
30065    // Add the record or a given key to the list of changes only when the value has actually changed
30066    _maybeAddToChanges(record, newValue) {
30067        if (!Object.is(newValue, record.currentValue)) {
30068            record.previousValue = record.currentValue;
30069            record.currentValue = newValue;
30070            this._addToChanges(record);
30071        }
30072    }
30073    _addToAdditions(record) {
30074        if (this._additionsHead === null) {
30075            this._additionsHead = this._additionsTail = record;
30076        }
30077        else {
30078            this._additionsTail._nextAdded = record;
30079            this._additionsTail = record;
30080        }
30081    }
30082    _addToChanges(record) {
30083        if (this._changesHead === null) {
30084            this._changesHead = this._changesTail = record;
30085        }
30086        else {
30087            this._changesTail._nextChanged = record;
30088            this._changesTail = record;
30089        }
30090    }
30091    /** @internal */
30092    _forEach(obj, fn) {
30093        if (obj instanceof Map) {
30094            obj.forEach(fn);
30095        }
30096        else {
30097            Object.keys(obj).forEach(k => fn(obj[k], k));
30098        }
30099    }
30100}
30101class KeyValueChangeRecord_ {
30102    constructor(key) {
30103        this.key = key;
30104        this.previousValue = null;
30105        this.currentValue = null;
30106        /** @internal */
30107        this._nextPrevious = null;
30108        /** @internal */
30109        this._next = null;
30110        /** @internal */
30111        this._prev = null;
30112        /** @internal */
30113        this._nextAdded = null;
30114        /** @internal */
30115        this._nextRemoved = null;
30116        /** @internal */
30117        this._nextChanged = null;
30118    }
30119}
30120
30121/**
30122 * @license
30123 * Copyright Google LLC All Rights Reserved.
30124 *
30125 * Use of this source code is governed by an MIT-style license that can be
30126 * found in the LICENSE file at https://angular.io/license
30127 */
30128function defaultIterableDiffersFactory() {
30129    return new IterableDiffers([new DefaultIterableDifferFactory()]);
30130}
30131/**
30132 * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
30133 *
30134 * @publicApi
30135 */
30136class IterableDiffers {
30137    constructor(factories) {
30138        this.factories = factories;
30139    }
30140    static create(factories, parent) {
30141        if (parent != null) {
30142            const copied = parent.factories.slice();
30143            factories = factories.concat(copied);
30144        }
30145        return new IterableDiffers(factories);
30146    }
30147    /**
30148     * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
30149     * inherited {@link IterableDiffers} instance with the provided factories and return a new
30150     * {@link IterableDiffers} instance.
30151     *
30152     * @usageNotes
30153     * ### Example
30154     *
30155     * The following example shows how to extend an existing list of factories,
30156     * which will only be applied to the injector for this component and its children.
30157     * This step is all that's required to make a new {@link IterableDiffer} available.
30158     *
30159     * ```
30160     * @Component({
30161     *   viewProviders: [
30162     *     IterableDiffers.extend([new ImmutableListDiffer()])
30163     *   ]
30164     * })
30165     * ```
30166     */
30167    static extend(factories) {
30168        return {
30169            provide: IterableDiffers,
30170            useFactory: (parent) => {
30171                // if parent is null, it means that we are in the root injector and we have just overridden
30172                // the default injection mechanism for IterableDiffers, in such a case just assume
30173                // `defaultIterableDiffersFactory`.
30174                return IterableDiffers.create(factories, parent || defaultIterableDiffersFactory());
30175            },
30176            // Dependency technically isn't optional, but we can provide a better error message this way.
30177            deps: [[IterableDiffers, new SkipSelf(), new Optional()]]
30178        };
30179    }
30180    find(iterable) {
30181        const factory = this.factories.find(f => f.supports(iterable));
30182        if (factory != null) {
30183            return factory;
30184        }
30185        else {
30186            throw new Error(`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
30187        }
30188    }
30189}
30190/** @nocollapse */
30191IterableDiffers.ɵprov = ɵɵdefineInjectable({ token: IterableDiffers, providedIn: 'root', factory: defaultIterableDiffersFactory });
30192function getTypeNameForDebugging(type) {
30193    return type['name'] || typeof type;
30194}
30195
30196/**
30197 * @license
30198 * Copyright Google LLC All Rights Reserved.
30199 *
30200 * Use of this source code is governed by an MIT-style license that can be
30201 * found in the LICENSE file at https://angular.io/license
30202 */
30203function defaultKeyValueDiffersFactory() {
30204    return new KeyValueDiffers([new DefaultKeyValueDifferFactory()]);
30205}
30206/**
30207 * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
30208 *
30209 * @publicApi
30210 */
30211class KeyValueDiffers {
30212    constructor(factories) {
30213        this.factories = factories;
30214    }
30215    static create(factories, parent) {
30216        if (parent) {
30217            const copied = parent.factories.slice();
30218            factories = factories.concat(copied);
30219        }
30220        return new KeyValueDiffers(factories);
30221    }
30222    /**
30223     * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
30224     * inherited {@link KeyValueDiffers} instance with the provided factories and return a new
30225     * {@link KeyValueDiffers} instance.
30226     *
30227     * @usageNotes
30228     * ### Example
30229     *
30230     * The following example shows how to extend an existing list of factories,
30231     * which will only be applied to the injector for this component and its children.
30232     * This step is all that's required to make a new {@link KeyValueDiffer} available.
30233     *
30234     * ```
30235     * @Component({
30236     *   viewProviders: [
30237     *     KeyValueDiffers.extend([new ImmutableMapDiffer()])
30238     *   ]
30239     * })
30240     * ```
30241     */
30242    static extend(factories) {
30243        return {
30244            provide: KeyValueDiffers,
30245            useFactory: (parent) => {
30246                // if parent is null, it means that we are in the root injector and we have just overridden
30247                // the default injection mechanism for KeyValueDiffers, in such a case just assume
30248                // `defaultKeyValueDiffersFactory`.
30249                return KeyValueDiffers.create(factories, parent || defaultKeyValueDiffersFactory());
30250            },
30251            // Dependency technically isn't optional, but we can provide a better error message this way.
30252            deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]
30253        };
30254    }
30255    find(kv) {
30256        const factory = this.factories.find(f => f.supports(kv));
30257        if (factory) {
30258            return factory;
30259        }
30260        throw new Error(`Cannot find a differ supporting object '${kv}'`);
30261    }
30262}
30263/** @nocollapse */
30264KeyValueDiffers.ɵprov = ɵɵdefineInjectable({ token: KeyValueDiffers, providedIn: 'root', factory: defaultKeyValueDiffersFactory });
30265
30266/**
30267 * @license
30268 * Copyright Google LLC All Rights Reserved.
30269 *
30270 * Use of this source code is governed by an MIT-style license that can be
30271 * found in the LICENSE file at https://angular.io/license
30272 */
30273function collectNativeNodes(tView, lView, tNode, result, isProjection = false) {
30274    while (tNode !== null) {
30275        ngDevMode &&
30276            assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */ | 16 /* Projection */ | 32 /* Icu */);
30277        const lNode = lView[tNode.index];
30278        if (lNode !== null) {
30279            result.push(unwrapRNode(lNode));
30280        }
30281        // A given lNode can represent either a native node or a LContainer (when it is a host of a
30282        // ViewContainerRef). When we find a LContainer we need to descend into it to collect root nodes
30283        // from the views in this container.
30284        if (isLContainer(lNode)) {
30285            for (let i = CONTAINER_HEADER_OFFSET; i < lNode.length; i++) {
30286                const lViewInAContainer = lNode[i];
30287                const lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild;
30288                if (lViewFirstChildTNode !== null) {
30289                    collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);
30290                }
30291            }
30292        }
30293        const tNodeType = tNode.type;
30294        if (tNodeType & 8 /* ElementContainer */) {
30295            collectNativeNodes(tView, lView, tNode.child, result);
30296        }
30297        else if (tNodeType & 32 /* Icu */) {
30298            const nextRNode = icuContainerIterate(tNode, lView);
30299            let rNode;
30300            while (rNode = nextRNode()) {
30301                result.push(rNode);
30302            }
30303        }
30304        else if (tNodeType & 16 /* Projection */) {
30305            const nodesInSlot = getProjectionNodes(lView, tNode);
30306            if (Array.isArray(nodesInSlot)) {
30307                result.push(...nodesInSlot);
30308            }
30309            else {
30310                const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);
30311                ngDevMode && assertParentView(parentView);
30312                collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);
30313            }
30314        }
30315        tNode = isProjection ? tNode.projectionNext : tNode.next;
30316    }
30317    return result;
30318}
30319
30320/**
30321 * @license
30322 * Copyright Google LLC All Rights Reserved.
30323 *
30324 * Use of this source code is governed by an MIT-style license that can be
30325 * found in the LICENSE file at https://angular.io/license
30326 */
30327class ViewRef {
30328    constructor(
30329    /**
30330     * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.
30331     *
30332     * When ViewRef is created for a dynamic component, this also represents the `LView` for the
30333     * component.
30334     *
30335     * For a "regular" ViewRef created for an embedded view, this is the `LView` for the embedded
30336     * view.
30337     *
30338     * @internal
30339     */
30340    _lView, 
30341    /**
30342     * This represents the `LView` associated with the point where `ChangeDetectorRef` was
30343     * requested.
30344     *
30345     * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
30346     */
30347    _cdRefInjectingView) {
30348        this._lView = _lView;
30349        this._cdRefInjectingView = _cdRefInjectingView;
30350        this._appRef = null;
30351        this._attachedToViewContainer = false;
30352    }
30353    get rootNodes() {
30354        const lView = this._lView;
30355        const tView = lView[TVIEW];
30356        return collectNativeNodes(tView, lView, tView.firstChild, []);
30357    }
30358    get context() {
30359        return this._lView[CONTEXT];
30360    }
30361    get destroyed() {
30362        return (this._lView[FLAGS] & 256 /* Destroyed */) === 256 /* Destroyed */;
30363    }
30364    destroy() {
30365        if (this._appRef) {
30366            this._appRef.detachView(this);
30367        }
30368        else if (this._attachedToViewContainer) {
30369            const parent = this._lView[PARENT];
30370            if (isLContainer(parent)) {
30371                const viewRefs = parent[VIEW_REFS];
30372                const index = viewRefs ? viewRefs.indexOf(this) : -1;
30373                if (index > -1) {
30374                    ngDevMode &&
30375                        assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.');
30376                    detachView(parent, index);
30377                    removeFromArray(viewRefs, index);
30378                }
30379            }
30380            this._attachedToViewContainer = false;
30381        }
30382        destroyLView(this._lView[TVIEW], this._lView);
30383    }
30384    onDestroy(callback) {
30385        storeCleanupWithContext(this._lView[TVIEW], this._lView, null, callback);
30386    }
30387    /**
30388     * Marks a view and all of its ancestors dirty.
30389     *
30390     * It also triggers change detection by calling `scheduleTick` internally, which coalesces
30391     * multiple `markForCheck` calls to into one change detection run.
30392     *
30393     * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is
30394     * checked when it needs to be re-rendered but the two normal triggers haven't marked it
30395     * dirty (i.e. inputs haven't changed and events haven't fired in the view).
30396     *
30397     * <!-- TODO: Add a link to a chapter on OnPush components -->
30398     *
30399     * @usageNotes
30400     * ### Example
30401     *
30402     * ```typescript
30403     * @Component({
30404     *   selector: 'my-app',
30405     *   template: `Number of ticks: {{numberOfTicks}}`
30406     *   changeDetection: ChangeDetectionStrategy.OnPush,
30407     * })
30408     * class AppComponent {
30409     *   numberOfTicks = 0;
30410     *
30411     *   constructor(private ref: ChangeDetectorRef) {
30412     *     setInterval(() => {
30413     *       this.numberOfTicks++;
30414     *       // the following is required, otherwise the view will not be updated
30415     *       this.ref.markForCheck();
30416     *     }, 1000);
30417     *   }
30418     * }
30419     * ```
30420     */
30421    markForCheck() {
30422        markViewDirty(this._cdRefInjectingView || this._lView);
30423    }
30424    /**
30425     * Detaches the view from the change detection tree.
30426     *
30427     * Detached views will not be checked during change detection runs until they are
30428     * re-attached, even if they are dirty. `detach` can be used in combination with
30429     * {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change
30430     * detection checks.
30431     *
30432     * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
30433     * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
30434     *
30435     * @usageNotes
30436     * ### Example
30437     *
30438     * The following example defines a component with a large list of readonly data.
30439     * Imagine the data changes constantly, many times per second. For performance reasons,
30440     * we want to check and update the list every five seconds. We can do that by detaching
30441     * the component's change detector and doing a local check every five seconds.
30442     *
30443     * ```typescript
30444     * class DataProvider {
30445     *   // in a real application the returned data will be different every time
30446     *   get data() {
30447     *     return [1,2,3,4,5];
30448     *   }
30449     * }
30450     *
30451     * @Component({
30452     *   selector: 'giant-list',
30453     *   template: `
30454     *     <li *ngFor="let d of dataProvider.data">Data {{d}}</li>
30455     *   `,
30456     * })
30457     * class GiantList {
30458     *   constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {
30459     *     ref.detach();
30460     *     setInterval(() => {
30461     *       this.ref.detectChanges();
30462     *     }, 5000);
30463     *   }
30464     * }
30465     *
30466     * @Component({
30467     *   selector: 'app',
30468     *   providers: [DataProvider],
30469     *   template: `
30470     *     <giant-list><giant-list>
30471     *   `,
30472     * })
30473     * class App {
30474     * }
30475     * ```
30476     */
30477    detach() {
30478        this._lView[FLAGS] &= ~128 /* Attached */;
30479    }
30480    /**
30481     * Re-attaches a view to the change detection tree.
30482     *
30483     * This can be used to re-attach views that were previously detached from the tree
30484     * using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default.
30485     *
30486     * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
30487     *
30488     * @usageNotes
30489     * ### Example
30490     *
30491     * The following example creates a component displaying `live` data. The component will detach
30492     * its change detector from the main change detector tree when the component's live property
30493     * is set to false.
30494     *
30495     * ```typescript
30496     * class DataProvider {
30497     *   data = 1;
30498     *
30499     *   constructor() {
30500     *     setInterval(() => {
30501     *       this.data = this.data * 2;
30502     *     }, 500);
30503     *   }
30504     * }
30505     *
30506     * @Component({
30507     *   selector: 'live-data',
30508     *   inputs: ['live'],
30509     *   template: 'Data: {{dataProvider.data}}'
30510     * })
30511     * class LiveData {
30512     *   constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}
30513     *
30514     *   set live(value) {
30515     *     if (value) {
30516     *       this.ref.reattach();
30517     *     } else {
30518     *       this.ref.detach();
30519     *     }
30520     *   }
30521     * }
30522     *
30523     * @Component({
30524     *   selector: 'my-app',
30525     *   providers: [DataProvider],
30526     *   template: `
30527     *     Live Update: <input type="checkbox" [(ngModel)]="live">
30528     *     <live-data [live]="live"><live-data>
30529     *   `,
30530     * })
30531     * class AppComponent {
30532     *   live = true;
30533     * }
30534     * ```
30535     */
30536    reattach() {
30537        this._lView[FLAGS] |= 128 /* Attached */;
30538    }
30539    /**
30540     * Checks the view and its children.
30541     *
30542     * This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement
30543     * local change detection checks.
30544     *
30545     * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
30546     * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
30547     *
30548     * @usageNotes
30549     * ### Example
30550     *
30551     * The following example defines a component with a large list of readonly data.
30552     * Imagine, the data changes constantly, many times per second. For performance reasons,
30553     * we want to check and update the list every five seconds.
30554     *
30555     * We can do that by detaching the component's change detector and doing a local change detection
30556     * check every five seconds.
30557     *
30558     * See {@link ChangeDetectorRef#detach detach} for more information.
30559     */
30560    detectChanges() {
30561        detectChangesInternal(this._lView[TVIEW], this._lView, this.context);
30562    }
30563    /**
30564     * Checks the change detector and its children, and throws if any changes are detected.
30565     *
30566     * This is used in development mode to verify that running change detection doesn't
30567     * introduce other changes.
30568     */
30569    checkNoChanges() {
30570        checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);
30571    }
30572    attachToViewContainerRef() {
30573        if (this._appRef) {
30574            throw new Error('This view is already attached directly to the ApplicationRef!');
30575        }
30576        this._attachedToViewContainer = true;
30577    }
30578    detachFromAppRef() {
30579        this._appRef = null;
30580        renderDetachView(this._lView[TVIEW], this._lView);
30581    }
30582    attachToAppRef(appRef) {
30583        if (this._attachedToViewContainer) {
30584            throw new Error('This view is already attached to a Vie
30584wContainer!');
30585        }
30586        this._appRef = appRef;
30587    }
30588}
30589/** @internal */
30590class RootViewRef extends ViewRef {
30591    constructor(_view) {
30592        super(_view);
30593        this._view = _view;
30594    }
30595    detectChanges() {
30596        detectChangesInRootView(this._view);
30597    }
30598    checkNoChanges() {
30599        checkNoChangesInRootView(this._view);
30600    }
30601    get context() {
30602        return null;
30603    }
30604}
30605
30606/**
30607 * @license
30608 * Copyright Google LLC All Rights Reserved.
30609 *
30610 * Use of this source code is governed by an MIT-style license that can be
30611 * found in the LICENSE file at https://angular.io/license
30612 */
30613const SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ = injectChangeDetectorRef;
30614const SWITCH_CHANGE_DETECTOR_REF_FACTORY__PRE_R3__ = noop;
30615const SWITCH_CHANGE_DETECTOR_REF_FACTORY = SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__;
30616/**
30617 * Base class that provides change detection functionality.
30618 * A change-detection tree collects all views that are to be checked for changes.
30619 * Use the methods to add and remove views from the tree, initiate change-detection,
30620 * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.
30621 *
30622 * @see [Using change detection hooks](guide/lifecycle-hooks#using-change-detection-hooks)
30623 * @see [Defining custom change detection](guide/lifecycle-hooks#defining-custom-change-detection)
30624 *
30625 * @usageNotes
30626 *
30627 * The following examples demonstrate how to modify default change-detection behavior
30628 * to perform explicit detection when needed.
30629 *
30630 * ### Use `markForCheck()` with `CheckOnce` strategy
30631 *
30632 * The following example sets the `OnPush` change-detection strategy for a component
30633 * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check
30634 * after an interval. See [live demo](https://plnkr.co/edit/GC512b?p=preview).
30635 *
30636 * <code-example path="core/ts/change_detect/change-detection.ts"
30637 * region="mark-for-check"></code-example>
30638 *
30639 * ### Detach change detector to limit how often check occurs
30640 *
30641 * The following example defines a component with a large list of read-only data
30642 * that is expected to change constantly, many times per second.
30643 * To improve performance, we want to check and update the list
30644 * less often than the changes actually occur. To do that, we detach
30645 * the component's change detector and perform an explicit local check every five seconds.
30646 *
30647 * <code-example path="core/ts/change_detect/change-detection.ts" region="detach"></code-example>
30648 *
30649 *
30650 * ### Reattaching a detached component
30651 *
30652 * The following example creates a component displaying live data.
30653 * The component detaches its change detector from the main change detector tree
30654 * when the `live` property is set to false, and reattaches it when the property
30655 * becomes true.
30656 *
30657 * <code-example path="core/ts/change_detect/change-detection.ts" region="reattach"></code-example>
30658 *
30659 * @publicApi
30660 */
30661class ChangeDetectorRef {
30662}
30663/**
30664 * @internal
30665 * @nocollapse
30666 */
30667ChangeDetectorRef.__NG_ELEMENT_ID__ = SWITCH_CHANGE_DETECTOR_REF_FACTORY;
30668/**
30669 * This marker is need so that the JIT compiler can correctly identify this class as special.
30670 *
30671 * @internal
30672 * @nocollapse
30673 */
30674ChangeDetectorRef.__ChangeDetectorRef__ = true;
30675/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */
30676function injectChangeDetectorRef(isPipe = false) {
30677    return createViewRef(getCurrentTNode(), getLView(), isPipe);
30678}
30679/**
30680 * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).
30681 *
30682 * @param tNode The node that is requesting a ChangeDetectorRef
30683 * @param lView The view to which the node belongs
30684 * @param isPipe Whether the view is being injected into a pipe.
30685 * @returns The ChangeDetectorRef to use
30686 */
30687function createViewRef(tNode, lView, isPipe) {
30688    // `isComponentView` will be true for Component and Directives (but not for Pipes).
30689    // See https://github.com/angular/angular/pull/33072 for proper fix
30690    const isComponentView = !isPipe && isComponentHost(tNode);
30691    if (isComponentView) {
30692        // The LView represents the location where the component is declared.
30693        // Instead we want the LView for the component View and so we need to look it up.
30694        const componentView = getComponentLViewByIndex(tNode.index, lView); // look down
30695        return new ViewRef(componentView, componentView);
30696    }
30697    else if (tNode.type & (3 /* AnyRNode */ | 12 /* AnyContainer */ | 32 /* Icu */)) {
30698        // The LView represents the location where the injection is requested from.
30699        // We need to locate the containing LView (in case where the `lView` is an embedded view)
30700        const hostComponentView = lView[DECLARATION_COMPONENT_VIEW]; // look up
30701        return new ViewRef(hostComponentView, lView);
30702    }
30703    return null;
30704}
30705
30706/**
30707 * @license
30708 * Copyright Google LLC All Rights Reserved.
30709 *
30710 * Use of this source code is governed by an MIT-style license that can be
30711 * found in the LICENSE file at https://angular.io/license
30712 */
30713/**
30714 * Structural diffing for `Object`s and `Map`s.
30715 */
30716const keyValDiff = [new DefaultKeyValueDifferFactory()];
30717/**
30718 * Structural diffing for `Iterable` types such as `Array`s.
30719 */
30720const iterableDiff = [new DefaultIterableDifferFactory()];
30721const defaultIterableDiffers = new IterableDiffers(iterableDiff);
30722const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
30723
30724/**
30725 * @license
30726 * Copyright Google LLC All Rights Reserved.
30727 *
30728 * Use of this source code is governed by an MIT-style license that can be
30729 * found in the LICENSE file at https://angular.io/license
30730 */
30731const SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ = injectTemplateRef;
30732const SWITCH_TEMPLATE_REF_FACTORY__PRE_R3__ = noop;
30733const SWITCH_TEMPLATE_REF_FACTORY = SWITCH_TEMPLATE_REF_FACTORY__POST_R3__;
30734/**
30735 * Represents an embedded template that can be used to instantiate embedded views.
30736 * To instantiate embedded views based on a template, use the `ViewContainerRef`
30737 * method `createEmbeddedView()`.
30738 *
30739 * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`
30740 * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view
30741 * is injected into the constructor of the directive,
30742 * using the `TemplateRef` token.
30743 *
30744 * You can also use a `Query` to find a `TemplateRef` associated with
30745 * a component or a directive.
30746 *
30747 * @see `ViewContainerRef`
30748 * @see [Navigate the Component Tree with DI](guide/dependency-injection-navtree)
30749 *
30750 * @publicApi
30751 */
30752class TemplateRef {
30753}
30754/**
30755 * @internal
30756 * @nocollapse
30757 */
30758TemplateRef.__NG_ELEMENT_ID__ = SWITCH_TEMPLATE_REF_FACTORY;
30759const ViewEngineTemplateRef = TemplateRef;
30760const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
30761    constructor(_declarationLView, _declarationTContainer, elementRef) {
30762        super();
30763        this._declarationLView = _declarationLView;
30764        this._declarationTContainer = _declarationTContainer;
30765        this.elementRef = elementRef;
30766    }
30767    createEmbeddedView(context) {
30768        const embeddedTView = this._declarationTContainer.tViews;
30769        const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* CheckAlways */, null, embeddedTView.declTNode, null, null, null, null);
30770        const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
30771        ngDevMode && assertLContainer(declarationLContainer);
30772        embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
30773        const declarationViewLQueries = this._declarationLView[QUERIES];
30774        if (declarationViewLQueries !== null) {
30775            embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);
30776        }
30777        renderView(embeddedTView, embeddedLView, context);
30778        return new ViewRef(embeddedLView);
30779    }
30780};
30781/**
30782 * Creates a TemplateRef given a node.
30783 *
30784 * @returns The TemplateRef instance to use
30785 */
30786function injectTemplateRef() {
30787    return createTemplateRef(getCurrentTNode(), getLView());
30788}
30789/**
30790 * Creates a TemplateRef and stores it on the injector.
30791 *
30792 * @param hostTNode The node on which a TemplateRef is requested
30793 * @param hostLView The `LView` to which the node belongs
30794 * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type
30795 */
30796function createTemplateRef(hostTNode, hostLView) {
30797    if (hostTNode.type & 4 /* Container */) {
30798        ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');
30799        return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));
30800    }
30801    return null;
30802}
30803
30804/**
30805 * @license
30806 * Copyright Google LLC All Rights Reserved.
30807 *
30808 * Use of this source code is governed by an MIT-style license that can be
30809 * found in the LICENSE file at https://angular.io/license
30810 */
30811/**
30812 * Represents an instance of an `NgModule` created by an `NgModuleFactory`.
30813 * Provides access to the `NgModule` instance and related objects.
30814 *
30815 * @publicApi
30816 */
30817class NgModuleRef {
30818}
30819/**
30820 * @publicApi
30821 */
30822class NgModuleFactory {
30823}
30824
30825/**
30826 * @license
30827 * Copyright Google LLC All Rights Reserved.
30828 *
30829 * Use of this source code is governed by an MIT-style license that can be
30830 * found in the LICENSE file at https://angular.io/license
30831 */
30832const SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ = injectViewContainerRef;
30833const SWITCH_VIEW_CONTAINER_REF_FACTORY__PRE_R3__ = noop;
30834const SWITCH_VIEW_CONTAINER_REF_FACTORY = SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__;
30835/**
30836 * Represents a container where one or more views can be attached to a component.
30837 *
30838 * Can contain *host views* (created by instantiating a
30839 * component with the `createComponent()` method), and *embedded views*
30840 * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).
30841 *
30842 * A view container instance can contain other view containers,
30843 * creating a [view hierarchy](guide/glossary#view-tree).
30844 *
30845 * @see `ComponentRef`
30846 * @see `EmbeddedViewRef`
30847 *
30848 * @publicApi
30849 */
30850class ViewContainerRef {
30851}
30852/**
30853 * @internal
30854 * @nocollapse
30855 */
30856ViewContainerRef.__NG_ELEMENT_ID__ = SWITCH_VIEW_CONTAINER_REF_FACTORY;
30857/**
30858 * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef
30859 * already exists, retrieves the existing ViewContainerRef.
30860 *
30861 * @returns The ViewContainerRef instance to use
30862 */
30863function injectViewContainerRef() {
30864    const previousTNode = getCurrentTNode();
30865    return createContainerRef(previousTNode, getLView());
30866}
30867const VE_ViewContainerRef = ViewContainerRef;
30868const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
30869    constructor(_lContainer, _hostTNode, _hostLView) {
30870        super();
30871        this._lContainer = _lContainer;
30872        this._hostTNode = _hostTNode;
30873        this._hostLView = _hostLView;
30874    }
30875    get element() {
30876        return createElementRef(this._hostTNode, this._hostLView);
30877    }
30878    get injector() {
30879        return new NodeInjector(this._hostTNode, this._hostLView);
30880    }
30881    /** @deprecated No replacement */
30882    get parentInjector() {
30883        const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView);
30884        if (hasParentInjector(parentLocation)) {
30885            const parentView = getParentInjectorView(parentLocation, this._hostLView);
30886            const injectorIndex = getParentInjectorIndex(parentLocation);
30887            ngDevMode && assertNodeInjector(parentView, injectorIndex);
30888            const parentTNode = parentView[TVIEW].data[injectorIndex + 8 /* TNODE */];
30889            return new NodeInjector(parentTNode, parentView);
30890        }
30891        else {
30892            return new NodeInjector(null, this._hostLView);
30893        }
30894    }
30895    clear() {
30896        while (this.length > 0) {
30897            this.remove(this.length - 1);
30898        }
30899    }
30900    get(index) {
30901        const viewRefs = getViewRefs(this._lContainer);
30902        return viewRefs !== null && viewRefs[index] || null;
30903    }
30904    get length() {
30905        return this._lContainer.length - CONTAINER_HEADER_OFFSET;
30906    }
30907    createEmbeddedView(templateRef, context, index) {
30908        const viewRef = templateRef.createEmbeddedView(context || {});
30909        this.insert(viewRef, index);
30910        return viewRef;
30911    }
30912    createComponent(componentFactory, index, injector, projectableNodes, ngModuleRef) {
30913        const contextInjector = injector || this.parentInjector;
30914        if (!ngModuleRef && componentFactory.ngModule == null && contextInjector) {
30915            // DO NOT REFACTOR. The code here used to have a `value || undefined` expression
30916            // which seems to cause internal google apps to fail. This is documented in the
30917            // following internal bug issue: go/b/142967802
30918            const result = contextInjector.get(NgModuleRef, null);
30919            if (result) {
30920                ngModuleRef = result;
30921            }
30922        }
30923        const componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);
30924        this.insert(componentRef.hostView, index);
30925        return componentRef;
30926    }
30927    insert(viewRef, index) {
30928        const lView = viewRef._lView;
30929        const tView = lView[TVIEW];
30930        if (ngDevMode && viewRef.destroyed) {
30931            throw new Error('Cannot insert a destroyed View in a ViewContainer!');
30932        }
30933        if (viewAttachedToContainer(lView)) {
30934            // If view is already attached, detach it first so we clean up references appropriately.
30935            const prevIdx = this.indexOf(viewRef);
30936            // A view might be attached either to this or a different c
vendor: 4,548 bytes, lines 30936-31035
30936ontainer. The `prevIdx` for
30937            // those cases will be:
30938            // equal to -1 for views attached to this ViewContainerRef
30939            // >= 0 for views attached to a different ViewContainerRef
30940            if (prevIdx !== -1) {
30941                this.detach(prevIdx);
30942            }
30943            else {
30944                const prevLContainer = lView[PARENT];
30945                ngDevMode &&
30946                    assertEqual(isLContainer(prevLContainer), true, 'An attached view should have its PARENT point to a container.');
30947                // We need to re-create a R3ViewContainerRef instance since those are not stored on
30948                // LView (nor anywhere else).
30949                const prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[T_HOST], prevLContainer[PARENT]);
30950                prevVCRef.detach(prevVCRef.indexOf(viewRef));
30951            }
30952        }
30953        // Logical operation of adding `LView` to `LContainer`
30954        const adjustedIdx = this._adjustIndex(index);
30955        const lContainer = this._lContainer;
30956        insertView(tView, lView, lContainer, adjustedIdx);
30957        // Physical operation of adding the DOM nodes.
30958        const beforeNode = getBeforeNodeForView(adjustedIdx, lContainer);
30959        const renderer = lView[RENDERER];
30960        const parentRNode = nativeParentNode(renderer, lContainer[NATIVE]);
30961        if (parentRNode !== null) {
30962            addViewToContainer(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);
30963        }
30964        viewRef.attachToViewContainerRef();
30965        addToArray(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef);
30966        return viewRef;
30967    }
30968    move(viewRef, newIndex) {
30969        if (ngDevMode && viewRef.destroyed) {
30970            throw new Error('Cannot move a destroyed View in a ViewContainer!');
30971        }
30972        return this.insert(viewRef, newIndex);
30973    }
30974    indexOf(viewRef) {
30975        const viewRefsArr = getViewRefs(this._lContainer);
30976        return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1;
30977    }
30978    remove(index) {
30979        const adjustedIdx = this._adjustIndex(index, -1);
30980        const detachedView = detachView(this._lContainer, adjustedIdx);
30981        if (detachedView) {
30982            // Before destroying the view, remove it from the container's array of `ViewRef`s.
30983            // This ensures the view container length is updated before calling
30984            // `destroyLView`, which could recursively call view container methods that
30985            // rely on an accurate container length.
30986            // (e.g. a method on this view container being called by a child directive's OnDestroy
30987            // lifecycle hook)
30988            removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx);
30989            destroyLView(detachedView[TVIEW], detachedView);
30990        }
30991    }
30992    detach(index) {
30993        const adjustedIdx = this._adjustIndex(index, -1);
30994        const view = detachView(this._lContainer, adjustedIdx);
30995        const wasDetached = view && removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null;
30996        return wasDetached ? new ViewRef(view) : null;
30997    }
30998    _adjustIndex(index, shift = 0) {
30999        if (index == null) {
31000            return this.length + shift;
31001        }
31002        if (ngDevMode) {
31003            assertGreaterThan(index, -1, `ViewRef index must be positive, got ${index}`);
31004            // +1 because it's legal to insert at the end.
31005            assertLessThan(index, this.length + 1 + shift, 'index');
31006        }
31007        return index;
31008    }
31009};
31010function getViewRefs(lContainer) {
31011    return lContainer[VIEW_REFS];
31012}
31013function getOrCreateViewRefs(lContainer) {
31014    return (lContainer[VIEW_REFS] || (lContainer[VIEW_REFS] = []));
31015}
31016/**
31017 * Creates a ViewContainerRef and stores it on the injector.
31018 *
31019 * @param ViewContainerRefToken The ViewContainerRef type
31020 * @param ElementRefToken The ElementRef type
31021 * @param hostTNode The node that is requesting a ViewContainerRef
31022 * @param hostLView The view to which the node belongs
31023 * @returns The ViewContainerRef instance to use
31024 */
31025function createContainerRef(hostTNode, hostLView) {
31026    ngDevMode && assertTNodeType(hostTNode, 12 /* AnyContainer */ | 3 /* AnyRNode */);
31027    let lContainer;
31028    const slotValue = hostLView[hostTNode.index];
31029    if (isLContainer(slotValue)) {
31030        // If the host is a container, we don't need to create a new LContainer
31031        lContainer = slotValue;
31032    }
31033    else {
31034        let commentNode;
31035        // If the host is an element container, the native host element is guaranteed to be a
31036        // comment and we can reuse that comment as anchor element for the new LContainer.
31037        // The comment node in question is already part of the DOM structure so we don't need to append
31038        // it again.
31039        if (hostTNode.type & 8 /* ElementContainer */) {
31040            commentNode = unwrapRNode(slotValue);
31041        }
31042        else {
31043            // If the host is a regular element, we have to insert a comment node manually which will
31044            // be used as an anchor when inserting elements. In this specific case we use low-level DOM
31045            // manipulation to insert it.
31046            const renderer = hostLView[RENDERER];
31047            ngDevMode && ngDevMode.rendererCreateComment++;
31048            commentNode = renderer.createComment(ngDevMode ? 'container' : '');
31049            const hostNative = getNativeByTNode(hostTNode, hostLView);
31050            const parentOfHostNative = nativeParentNode(renderer, hostNative);
31051            nativeInsertBefore(renderer, parentOfHostNative, commentNode, nativeNextSibling(renderer, hostNative), false);
31052        }
31053        hostLView[hostTNode.index] = lContainer =
31054            createLContainer(slotValue, hostLView, commentNode, hostTNode);
31055        addToViewTree(hostLView, lContainer);
31056    }
31057    return new R3ViewContainerRef(lContainer, hostTNode, hostLView);
31058}
31059
31060/**
31061 * @license
31062 * Copyright Google LLC All Rights Reserved.
31063 *
31064 * Use of this source code is governed by an MIT-style license that can be
31065 * found in the LICENSE file at https://angular.io/license
31066 */
31067function expressionChangedAfterItHasBeenCheckedError(context, oldValue, currValue, isFirstCheck) {
31068    let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${oldValue}'. Current value: '${currValue}'.`;
31069    if (isFirstCheck) {
31070        msg +=
31071            ` It seems like the view has been created after its parent and its children have been dirty checked.` +
31072                ` Has it been created in a change detection hook ?`;
31073    }
31074    return viewDebugError(msg, context);
31075}
31076function viewWrappedDebugError(err, context) {
31077    if (!(err instanceof Error)) {
31078        // errors that are not Error instances don't have a stack,
31079        // so it is ok to wrap them into a new Error object...
31080        err = new Error(err.toString());
31081    }
31082    _addDebugContext(err, context);
31083    return err;
31084}
31085function viewDebugError(msg, context) {
31086    const err = new Error(msg);
31087    _addDebugContext(err, context);
31088    return err;
31089}
31090function _addDebugContext(err, context) {
31091    err[ERROR_DEBUG_CONTEXT] = context;
31092    err[ERROR_LOGGER] = context.logError.bind(context);
31093}
31094function isViewDebugError(err) {
31095    return !!getDebugContext(err);
31096}
31097function viewDestroyedError(action) {
31098    return new Error(`ViewDestroyedError: Attempt to use a destroyed view: ${action}`);
31099}
31100
31101/**
31102 * @license
31103 * Copyright Google LLC All Rights Reserved.
31104 *
31105 * Use of this source code is governed by an MIT-style license that can be
31106 * found in the LICENSE file at https://angular.io/license
31107 */
31108// Called before each cycle of a view's check to detect whether this is in the
31109// initState for which we need to call ngOnInit, ngAfterContentInit or ngAfterViewInit
31110// lifecycle methods. Returns true if this check cycle should call lifecycle
31111// methods.
31112function shiftInitState(view, priorInitState, newInitState) {
31113    // Only update the InitState if we are currently in the prior state.
31114    // For example, only move into CallingInit if we are in BeforeInit. Only
31115    // move into CallingContentInit if we are in CallingInit. Normally this will
31116    // always be true because of how checkCycle is called in checkAndUpdateView.
31117    // However, if checkAndUpdateView is called recursively or if an exception is
31118    // thrown while checkAndUpdateView is running, checkAndUpdateView starts over
31119    // from the beginning. This ensures the state is monotonically increasing,
31120    // terminating in the AfterInit state, which ensures the Init methods are called
31121    // at least once and only once.
31122    const state = view.state;
31123    const initState = state & 1792 /* InitState_Mask */;
31124    if (initState === priorInitState) {
31125        view.state = (state & ~1792 /* InitState_Mask */) | newInitState;
31126        view.initIndex = -1;
31127        return true;
31128    }
31129    return initState === newInitState;
31130}
31131// Returns true if the lifecycle init method should be called for the node with
31132// the given init index.
31133function shouldCallLifecycleInitHook(view, initState, index) {
31134    if ((view.state & 1792 /* InitState_Mask */) === initState && view.initIndex <= index) {
31135        view.initIndex = index + 1;
31136        return true;
31137    }
31138    return false;
31139}
31140/**
31141 * Node instance data.
31142 *
31143 * We have a separate type per NodeType to save memory
31144 * (TextData | ElementData | ProviderData | PureExpressionData | QueryList<any>)
31145 *
31146 * To keep our code monomorphic,
31147 * we prohibit using `NodeData` directly but enforce the use of accessors (`asElementData`, ...).
31148 * This way, no usage site can get a `NodeData` from view.nodes and then use it for different
31149 * purposes.
31150 */
31151class NodeData {
31152}
31153/**
31154 * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
31155 */
31156function asTextData(view, index) {
31157    return view.nodes[index];
31158}
31159/**
31160 * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
31161 */
31162function asElementData(view, index) {
31163    return view.nodes[index];
31164}
31165/**
31166 * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
31167 */
31168function asProviderData(view, index) {
31169    return view.nodes[index];
31170}
31171/**
31172 * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
31173 */
31174function asPureExpressionData(view, index) {
31175    return view.nodes[index];
31176}
31177/**
31178 * Accessor for view.nodes, enforcing that every usage site stays monomorphic.
31179 */
31180function asQueryList(view, index) {
31181    return view.nodes[index];
31182}
31183class DebugContext {
31184}
31185/**
31186 * This object is used to prevent cycles in the source files and to have a place where
31187 * debug mode can hook it. It is lazily filled when `isDevMode` is known.
31188 */
31189const Services = {
31190    setCurrentNode: undefined,
31191    createRootView: undefined,
31192    createEmbeddedView: undefined,
31193    createComponentView: undefined,
31194    createNgModuleRef: undefined,
31195    overrideProvider: undefined,
31196    overrideComponentView: undefined,
31197    clearOverrides: undefined,
31198    checkAndUpdateView: undefined,
31199    checkNoChangesView: undefined,
31200    destroyView: undefined,
31201    resolveDep: undefined,
31202    createDebugContext: undefined,
31203    handleEvent: undefined,
31204    updateDirectives: undefined,
31205    updateRenderer: undefined,
31206    dirtyParentQueries: undefined,
31207};
31208
31209/**
31210 * @license
31211 * Copyright Google LLC All Rights Reserved.
31212 *
31213 * Use of this source code is governed by an MIT-style license that can be
31214 * found in the LICENSE file at https://angular.io/license
31215 */
31216const NOOP = () => { };
31217const _tokenKeyCache = new Map();
31218function tokenKey(token) {
31219    let key = _tokenKeyCache.get(token);
31220    if (!key) {
31221        key = stringify(token) + '_' + _tokenKeyCache.size;
31222        _tokenKeyCache.set(token, key);
31223    }
31224    return key;
31225}
31226function unwrapValue(view, nodeIdx, bindingIdx, value) {
31227    if (WrappedValue.isWrapped(value)) {
31228        value = WrappedValue.unwrap(value);
31229        const globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;
31230        const oldValue = WrappedValue.unwrap(view.oldValues[globalBindingIdx]);
31231        view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);
31232    }
31233    return value;
31234}
31235const UNDEFINED_RENDERER_TYPE_ID = '$$undefined';
31236const EMPTY_RENDERER_TYPE_ID = '$$empty';
31237// Attention: this function is called as top level function.
31238// Putting any logic in here will destroy closure tree shaking!
31239function createRendererType2(values) {
31240    return {
31241        id: UNDEFINED_RENDERER_TYPE_ID,
31242        styles: values.styles,
31243        encapsulation: values.encapsulation,
31244        data: values.data
31245    };
31246}
31247let _renderCompCount$1 = 0;
31248function resolveRendererType2(type) {
31249    if (type && type.id === UNDEFINED_RENDERER_TYPE_ID) {
31250        // first time we see this RendererType2. Initialize it...
31251        const isFilled = ((type.encapsulation != null && type.encapsulation !== ViewEncapsulation.None) ||
31252            type.styles.length || Object.keys(type.data).length);
31253        if (isFilled) {
31254            type.id = `c${_renderCompCount$1++}`;
31255        }
31256        else {
31257            type.id = EMPTY_RENDERER_TYPE_ID;
31258        }
31259    }
31260    if (type && type.id === EMPTY_RENDERER_TYPE_ID) {
31261        type = null;
31262    }
31263    return type || null;
31264}
31265function checkBinding(view, def, bindingIdx, value) {
31266    const oldValues = view.oldValues;
31267    if ((view.state & 2 /* FirstCheck */) ||
31268        !Object.is(oldValues[def.bindingIndex + bindingIdx], value)) {
31269        return true;
31270    }
31271    return false;
31272}
31273function checkAndUpdateBinding(view, def, bindingIdx, value) {
31274    if (checkBinding(view, def, bindingIdx, value)) {
31275        view.oldValues[def.bindingIndex + bindingIdx] = value;
31276        return true;
31277    }
31278    return false;
31279}
31280function checkBindingNoChanges(view, def, bindingIdx, value) {
31281    const oldValue = view.oldValues[def.bindingIndex + bindingIdx];
31282    if ((view.state & 1 /* BeforeFirstCheck */) || !devModeEqual(oldValue, value)) {
31283        const bindingName = def.bindings[bindingIdx].name;
31284        throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, def.nodeIndex), `${bindingName}: ${oldValue}`, `${bindingName}: ${value}`, (view.state & 1 /* BeforeFirstCheck */) !== 0);
31285    }
31286}
31287function markParentViewsForCheck(view) {
31288    let currView = view;
31289    while (currView) {
31290        if (currView.def.flags & 2 /* OnPush */) {
31291            currView.state |= 8 /* ChecksEnabled */;
31292        }
31293        currView = currView.viewContainerParent || currView.parent;
31294    }
31295}
31296function markParentViewsForCheckProjectedViews(view, endView) {
31297    let currView = view;
31298    while (currView && currView !== endView) {
31299        currView.state |= 64 /* CheckProjectedViews */;
31300        currView = currView.viewContainerParent || currView.parent;
31301    }
31302}
31303function dispatchEvent(view, nodeIndex, eventName, event) {
31304    try {
31305        const nodeDef = view.def.nodes[nodeIndex];
31306        const startView = nodeDef.flags & 33554432 /* ComponentView */ ?
31307            asElementData(view, nodeIndex).componentView :
31308            view;
31309        markParentViewsForCheck(startView);
31310        return Services.handleEvent(view, nodeIndex, eventName, event);
31311    }
31312    catch (e) {
31313        // Attention: Don't rethrow, as it would cancel Observable subscriptions!
31314        view.root.errorHandler.handleError(e);
31315    }
31316}
31317function declaredViewContainer(view) {
31318    if (view.parent) {
31319        const parentView = view.parent;
31320        return asElementData(parentView, view.parentNodeDef.nodeIndex);
31321    }
31322    return null;
31323}
31324/**
31325 * for component views, this is the host element.
31326 * for embedded views, this is the index of the parent node
31327 * that contains the view container.
31328 */
31329function viewParentEl(view) {
31330    const parentView = view.parent;
31331    if (parentView) {
31332        return view.parentNodeDef.parent;
31333    }
31334    else {
31335        return null;
31336    }
31337}
31338function renderNode(view, def) {
31339    switch (def.flags & 201347067 /* Types */) {
31340        case 1 /* TypeElement */:
31341            return asElementData(view, def.nodeIndex).renderElement;
31342        case 2 /* TypeText */:
31343            return asTextData(view, def.nodeIndex).renderText;
31344    }
31345}
31346function elementEventFullName(target, name) {
31347    return target ? `${target}:${name}` : name;
31348}
31349function isComponentView(view) {
31350    return !!view.parent && !!(view.parentNodeDef.flags & 32768 /* Component */);
31351}
31352function isEmbeddedView(view) {
31353    return !!view.parent && !(view.parentNodeDef.flags & 32768 /* Component */);
31354}
31355function filterQueryId(queryId) {
31356    return 1 << (queryId % 32);
31357}
31358function splitMatchedQueriesDsl(matchedQueriesDsl) {
31359    const matchedQueries = {};
31360    let matchedQueryIds = 0;
31361    const references = {};
31362    if (matchedQueriesDsl) {
31363        matchedQueriesDsl.forEach(([queryId, valueType]) => {
31364            if (typeof queryId === 'number') {
31365                matchedQueries[queryId] = valueType;
31366                matchedQueryIds |= filterQueryId(queryId);
31367            }
31368            else {
31369                references[queryId] = valueType;
31370            }
31371        });
31372    }
31373    return { matchedQueries, references, matchedQueryIds };
31374}
31375function splitDepsDsl(deps, sourceName) {
31376    return deps.map(value => {
31377        let token;
31378        let flags;
31379        if (Array.isArray(value)) {
31380            [flags, token] = value;
31381        }
31382        else {
31383            flags = 0 /* None */;
31384            token = value;
31385        }
31386        if (token && (typeof token === 'function' || typeof token === 'object') && sourceName) {
31387            Object.defineProperty(token, SOURCE, { value: sourceName, configurable: true });
31388        }
31389        return { flags, token, tokenKey: tokenKey(token) };
31390    });
31391}
31392function getParentRenderElement(view, renderHost, def) {
31393    let renderParent = def.renderParent;
31394    if (renderParent) {
31395        if ((renderParent.flags & 1 /* TypeElement */) === 0 ||
31396            (renderParent.flags & 33554432 /* ComponentView */) === 0 ||
31397            (renderParent.element.componentRendererType &&
31398                (renderParent.element.componentRendererType.encapsulation ===
31399                    ViewEncapsulation.ShadowDom ||
31400                    // TODO(FW-2290): remove the `encapsulation === 1` fallback logic in v12.
31401                    renderParent.element.componentRendererType.encapsulation === 1))) {
31402            // only children of non components, or children of components with native encapsulation should
31403            // be attached.
31404            return asElementData(view, def.renderParent.nodeIndex).renderElement;
31405        }
31406    }
31407    else {
31408        return renderHost;
31409    }
31410}
31411const DEFINITION_CACHE = new WeakMap();
31412function resolveDefinition(factory) {
31413    let value = DEFINITION_CACHE.get(factory);
31414    if (!value) {
31415        value = factory(() => NOOP);
31416        value.factory = factory;
31417        DEFINITION_CACHE.set(factory, value);
31418    }
31419    return value;
31420}
31421function rootRenderNodes(view) {
31422    const renderNodes = [];
31423    visitRootRenderNodes(view, 0 /* Collect */, undefined, undefined, renderNodes);
31424    return renderNodes;
31425}
31426function visitRootRenderNodes(view, action, parentNode, nextSibling, target) {
31427    // We need to re-compute the parent node in case the nodes have been moved around manually
31428    if (action === 3 /* RemoveChild */) {
31429        parentNode = view.renderer.parentNode(renderNode(view, view.def.lastRenderRootNode));
31430    }
31431    visitSiblingRenderNodes(view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);
31432}
31433function visitSiblingRenderNodes(view, action, startIndex, endIndex, parentNode, nextSibling, target) {
31434    for (let i = startIndex; i <= endIndex; i++) {
31435        const nodeDef = view.def.nodes[i];
31436        if (nodeDef.flags & (1 /* TypeElement */ | 2 /* TypeText */ | 8 /* TypeNgContent */)) {
31437            visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target);
31438        }
31439        // jump to next sibling
31440        i += nodeDef.childCount;
31441    }
31442}
31443function visitProjectedRenderNodes(view, ngContentIndex, action, parentNode, nextSibling, target) {
31444    let compView = view;
31445    while (compView && !isComponentView(compView)) {
31446        compView = compView.parent;
31447    }
31448    const hostView = compView.parent;
31449    const hostElDef = viewParentEl(compView);
31450    const startIndex = hostElDef.nodeIndex + 1;
31451    const endIndex = hostElDef.nodeIndex + hostElDef.childCount;
31452    for (let i = startIndex; i <= endIndex; i++) {
31453        const nodeDef = hostView.def.nodes[i];
31454        if (nodeDef.ngContentIndex === ngContentIndex) {
31455            visitRenderNode(hostView, nodeDef, action, parentNode, nextSibling, target);
31456        }
31457        // jump to next sibling
31458        i += nodeDef.childCount;
31459    }
31460    if (!hostView.parent) {
31461        // a root view
31462        const projectedNodes = view.root.projectableNodes[ngContentIndex];
31463        if (projectedNodes) {
31464            for (let i = 0; i < projectedNodes.length; i++) {
31465                execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target);
31466            }
31467        }
31468    }
31469}
31470function visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target) {
31471    if (nodeDef.flags & 8 /* TypeNgContent */) {
31472        visitProjectedRenderNodes(view, nodeDef.ngContent.index, action, parentNode, nextSibling, target);
31473    }
31474    else {
31475        const rn = renderNode(view, nodeDef);
31476        if (action === 3 /* RemoveChild */ && (nodeDef.flags & 33554432 /* ComponentView */) &&
31477            (nodeDef.bindingFlags & 48 /* CatSyntheticProperty */)) {
31478            // Note: we might need to do both actions.
31479            if (nodeDef.bindingFlags & (16 /* SyntheticProperty */)) {
31480                execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);
31481            }
31482            if (nodeDef.bindingFlags & (32 /* SyntheticHostProperty */)) {
31483                const compView = asElementData(view, nodeDef.nodeIndex).componentView;
31484                execRenderNodeAction(compView, rn, action, parentNode, nextSibling, target);
31485            }
31486        }
31487        else {
31488            execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);
31489        }
31490        if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
31491            const embeddedViews = asElementData(view, nodeDef.nodeIndex).viewContainer._embeddedViews;
31492            for (let k = 0; k < embeddedViews.length; k++) {
31493                visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target);
31494            }
31495        }
31496        if (nodeDef.flags & 1 /* TypeElement */ && !nodeDef.element.name) {
31497            visitSiblingRenderNodes(view, action, nodeDef.nodeIndex + 1, nodeDef.nodeIndex + nodeDef.childCount, parentNode, nextSibling, target);
31498        }
31499    }
31500}
31501function execRenderNodeAction(view, renderNode, action, parentNode, nextSibling, target) {
31502    const renderer = view.renderer;
31503    switch (action) {
31504        case 1 /* AppendChild */:
31505            renderer.appendChild(parentNode, renderNode);
31506            break;
31507        case 2 /* InsertBefore */:
31508            renderer.insertBefore(parentNode, renderNode, nextSibling);
31509            break;
31510        case 3 /* RemoveChild */:
31511            renderer.removeChild(parentNode, renderNode);
31512            break;
31513        case 0 /* Collect */:
31514            target.push(renderNode);
31515            break;
31516    }
31517}
31518const NS_PREFIX_RE = /^:([^:]+):(.+)$/;
31519function splitNamespace(name) {
31520    if (name[0] === ':') {
31521        const match = name.match(NS_PREFIX_RE);
31522        return [match[1], match[2]];
31523    }
31524    return ['', name];
31525}
31526function calcBindingFlags(bindings) {
31527    let flags = 0;
31528    for (let i = 0; i < bindings.length; i++) {
31529        flags |= bindings[i].flags;
31530    }
31531    return flags;
31532}
31533function interpolate(valueCount, constAndInterp) {
31534    let result = '';
31535    for (let i = 0; i < valueCount * 2; i = i + 2) {
31536        result = result + constAndInterp[i] + _toStringWithNull(constAndInterp[i + 1]);
31537    }
31538    return result + constAndInterp[valueCount * 2];
31539}
31540function inlineInterpolate(valueCount, c0, a1, c1, a2, c2, a3, c3, a4, c4, a5, c5, a6, c6, a7, c7, a8, c8, a9, c9) {
31541    switch (valueCount) {
31542        case 1:
31543            return c0 + _toStringWithNull(a1) + c1;
31544        case 2:
31545            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2;
31546        case 3:
31547            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
31548                c3;
31549        case 4:
31550            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
31551                c3 + _toStringWithNull(a4) + c4;
31552        case 5:
31553            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
31554                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5;
31555        case 6:
31556            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
31557                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + c6;
31558        case 7:
31559            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
31560                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +
31561                c6 + _toStringWithNull(a7) + c7;
31562        case 8:
31563            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
31564                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +
31565                c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8;
31566        case 9:
31567            return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +
31568                c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +
31569                c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8 + _toStringWithNull(a9) + c9;
31570        default:
31571            throw new Error(`Does not support more than 9 expressions`);
31572    }
31573}
31574function _toStringWithNull(v) {
31575    return v != null ? v.toString() : '';
31576}
31577const EMPTY_ARRAY$4 = [];
31578const EMPTY_MAP = {};
31579
31580/**
31581 * @license
31582 * Copyright Google LLC All Rights Reserved.
31583 *
31584 * Use of this source code is governed by an MIT-style license that can be
31585 * found in the LICENSE file at https://angular.io/license
31586 */
31587const UNDEFINED_VALUE = {};
31588const InjectorRefTokenKey = tokenKey(Injector);
31589const INJECTORRefTokenKey = tokenKey(INJECTOR$1);
31590const NgModuleRefTokenKey = tokenKey(NgModuleRef);
31591function moduleProvideDef(flags, token, value, deps) {
31592    // Need to resolve forwardRefs as e.g. for `useValue` we
31593    // lowered the expression and then stopped evaluating it,
31594    // i.e. also didn't unwrap it.
31595    value = resolveForwardRef(value);
31596    const depDefs = splitDepsDsl(deps, stringify(token));
31597    return {
31598        // will bet set by the module definition
31599        index: -1,
31600        deps: depDefs,
31601        flags,
31602        token,
31603        value
31604    };
31605}
31606function moduleDef(providers) {
31607    const providersByKey = {};
31608    const modules = [];
31609    let scope = null;
31610    for (let i = 0; i < providers.length; i++) {
31611        const provider = providers[i];
31612        if (provider.token === INJECTOR_SCOPE) {
31613            scope = provider.value;
31614        }
31615        if (provider.flags & 1073741824 /* TypeNgModule */) {
31616            modules.push(provider.token);
31617        }
31618        provider.index = i;
31619        providersByKey[tokenKey(provider.token)] = provider;
31620    }
31621    return {
31622        // Will be filled later...
31623        factory: null,
31624        providersByKey,
31625        providers,
31626        modules,
31627        scope: scope,
31628    };
31629}
31630function initNgModule(data) {
31631    const def = data._def;
31632    const providers = data._providers = newArray(def.providers.length);
31633    for (let i = 0; i < def.providers.length; i++) {
31634        const provDef = def.providers[i];
31635        if (!(provDef.flags & 4096 /* LazyProvider */)) {
31636            // Make sure the provider has not been already initialized outside this loop.
31637            if (providers[i] === undefined) {
31638                providers[i] = _createProviderInstance(data, provDef);
31639            }
31640        }
31641    }
31642}
31643function resolveNgModuleDep(data, depDef, notFoundValue = Injector.THROW_IF_NOT_FOUND) {
31644    const former = setCurrentInjector(data);
31645    try {
31646        if (depDef.flags & 8 /* Value */) {
31647            return depDef.token;
31648        }
31649        if (depDef.flags & 2 /* Optional */) {
31650            notFoundValue = null;
31651        }
31652        if (depDef.flags & 1 /* SkipSelf */) {
31653            return data._parent.get(depDef.token, notFoundValue);
31654        }
31655        const tokenKey = depDef.tokenKey;
31656        switch (tokenKey) {
31657            case InjectorRefTokenKey:
31658            case INJECTORRefTokenKey:
31659            case NgModuleRefTokenKey:
31660                return data;
31661        }
31662        const providerDef = data._def.providersByKey[tokenKey];
31663        let injectableDef;
31664        if (providerDef) {
31665            let providerInstance = data._providers[providerDef.index];
31666            if (providerInstance === undefined) {
31667                providerInstance = data._providers[providerDef.index] =
31668                    _createProviderInstance(data, providerDef);
31669            }
31670            return providerInstance === UNDEFINED_VALUE ? undefined : providerInstance;
31671        }
31672        else if ((injectableDef = getInjectableDef(depDef.token)) && targetsModule(data, injectableDef)) {
31673            const index = data._providers.length;
31674            data._def.providers[index] = data._def.providersByKey[depDef.tokenKey] = {
31675                flags: 1024 /* TypeFactoryProvider */ | 4096 /* LazyProvider */,
31676                value: injectableDef.factory,
31677                deps: [],
31678                index,
31679                token: depDef.token,
31680            };
31681            data._providers[index] = UNDEFINED_VALUE;
31682            return (data._providers[index] =
31683                _createProviderInstance(data, data._def.providersByKey[depDef.tokenKey]));
31684        }
31685        else if (depDef.flags & 4 /* Self */) {
31686            return notFoundValue;
31687        }
31688        return data._parent.get(depDef.token, notFoundValue);
31689    }
31690    finally {
31691        setCurrentInjector(former);
31692    }
31693}
31694function moduleTransitivelyPresent(ngModule, scope) {
31695    return ngModule._def.modules.indexOf(scope) > -1;
31696}
31697function targetsModule(ngModule, def) {
31698    const providedIn = def.providedIn;
31699    return providedIn != null &&
31700        (providedIn === 'any' || providedIn === ngModule._def.scope ||
31701            moduleTransitivelyPresent(ngModule, providedIn));
31702}
31703function _createProviderInstance(ngModule, providerDef) {
31704    let injectable;
31705    switch (providerDef.flags & 201347067 /* Types */) {
31706        case 512 /* TypeClassProvider */:
31707            injectable = _createClass(ngModule, providerDef.value, providerDef.deps);
31708            break;
31709        case 1024 /* TypeFactoryProvider */:
31710            injectable = _callFactory(ngModule, providerDef.value, providerDef.deps);
31711            break;
31712        case 2048 /* TypeUseExistingProvider */:
31713            injectable = resolveNgModuleDep(ngModule, providerDef.deps[0]);
31714            break;
31715        case 256 /* TypeValueProvider */:
31716            injectable = providerDef.value;
31717            break;
31718    }
31719    // The read of `ngOnDestroy` here is slightly expensive as it's megamorphic, so it should be
31720    // avoided if possible. The sequence of checks here determines whether ngOnDestroy needs to be
31721    // checked. It might not if the `injectable` isn't an object or if NodeFlags.OnDestroy is already
31722    // set (ngOnDestroy was detected statically).
31723    if (injectable !== UNDEFINED_VALUE && injectable !== null && typeof injectable === 'object' &&
31724        !(providerDef.flags & 131072 /* OnDestroy */) && typeof injectable.ngOnDestroy === 'function') {
31725        providerDef.flags |= 131072 /* OnDestroy */;
31726    }
31727    return injectable === undefined ? UNDEFINED_VALUE : injectable;
31728}
31729function _createClass(ngModule, ctor, deps) {
31730    const len = deps.length;
31731    switch (len) {
31732        case 0:
31733            return new ctor();
31734        case 1:
31735            return new ctor(resolveNgModuleDep(ngModule, deps[0]));
31736        case 2:
31737            return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));
31738        case 3:
31739            return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));
31740        default:
31741            const depValues = [];
31742            for (let i = 0; i < len; i++) {
31743                depValues[i] = resolveNgModuleDep(ngModule, deps[i]);
31744            }
31745            return new ctor(...depValues);
31746    }
31747}
31748function _callFactory(ngModule, factory, deps) {
31749    const len = deps.length;
31750    switch (len) {
31751        case 0:
31752            return factory();
31753        case 1:
31754            return factory(resolveNgModuleDep(ngModule, deps[0]));
31755        case 2:
31756            return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));
31757        case 3:
31758            return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]), resolveNgModuleDep(ngModule, deps[2]));
31759        default:
31760            const depValues = [];
31761            for (let i = 0; i < len; i++) {
31762                depValues[i] = resolveNgModuleDep(ngModule, deps[i]);
31763            }
31764            return factory(...depValues);
31765    }
31766}
31767function callNgModuleLifecycle(ngModule, lifecycles) {
31768    const def = ngModule._def;
31769    const destroyed = new Set();
31770    for (let i = 0; i < def.providers.length; i++) {
31771        const provDef = def.providers[i];
31772        if (provDef.flags & 131072 /* OnDestroy */) {
31773            const instance = ngModule._providers[i];
31774            if (instance && instance !== UNDEFINED_VALUE) {
31775                const onDestroy = instance.ngOnDestroy;
31776                if (typeof onDestroy === 'function' && !destroyed.has(instance)) {
31777                    onDestroy.apply(instance);
31778                    destroyed.add(instance);
31779                }
31780            }
31781        }
31782    }
31783}
31784
31785/**
31786 * @license
31787 * Copyright Google LLC All Rights Reserved.
31788 *
31789 * Use of this source code is governed by an MIT-style license that can be
31790 * found in the LICENSE file at https://angular.io/license
31791 */
31792function attachEmbeddedView(parentView, elementData, viewIndex, view) {
31793    let embeddedViews = elementData.viewContainer._embeddedViews;
31794    if (viewIndex === null || viewIndex === undefined) {
31795        viewIndex = embeddedViews.length;
31796    }
31797    view.viewContainerParent = parentView;
31798    addToArray(embeddedViews, viewIndex, view);
31799    attachProjectedView(elementData, view);
31800    Services.dirtyParentQueries(view);
31801    const prevView = viewIndex > 0 ? embeddedViews[viewIndex - 1] : null;
31802    renderAttachEmbeddedView(elementData, prevView, view);
31803}
31804function attachProjectedView(vcElementData, view) {
31805    const dvcElementData = declaredViewContainer(view);
31806    if (!dvcElementData || dvcElementData === vcElementData ||
31807        view.state & 16 /* IsProjectedView */) {
31808        return;
31809    }
31810    // Note: For performance reasons, we
31811    // - add a view to template._projectedViews only 1x throughout its lifetime,
31812    //   and remove it not until the view is destroyed.
31813    //   (hard, as when a parent view is attached/detached we would need to attach/detach all
31814    //    nested projected views as well, even across component boundaries).
31815    // - don't track the insertion order of views in the projected views array
31816    //   (hard, as when the views of the same template are inserted different view containers
31816)
31817    view.state |= 16 /* IsProjectedView */;
31818    let projectedViews = dvcElementData.template._projectedViews;
31819    if (!projectedViews) {
31820        projectedViews = dvcElementData.template._projectedViews = [];
31821    }
31822    projectedViews.push(view);
31823    // Note: we are changing the NodeDef here as we cannot calculate
31824    // the fact whether a template is used for projection during compilation.
31825    markNodeAsProjectedTemplate(view.parent.def, view.parentNodeDef);
31826}
31827function markNodeAsProjectedTemplate(viewDef, nodeDef) {
31828    if (nodeDef.flags & 4 /* ProjectedTemplate */) {
31829        return;
31830    }
31831    viewDef.nodeFlags |= 4 /* ProjectedTemplate */;
31832    nodeDef.flags |= 4 /* ProjectedTemplate */;
31833    let parentNodeDef = nodeDef.parent;
31834    while (parentNodeDef) {
31835        parentNodeDef.childFlags |= 4 /* ProjectedTemplate */;
31836        parentNodeDef = parentNodeDef.parent;
31837    }
31838}
31839function detachEmbeddedView(elementData, viewIndex) {
31840    const embeddedViews = elementData.viewContainer._embeddedViews;
31841    if (viewIndex == null || viewIndex >= embeddedViews.length) {
31842        viewIndex = embeddedViews.length - 1;
31843    }
31844    if (viewIndex < 0) {
31845        return null;
31846    }
31847    const view = embeddedViews[viewIndex];
31848    view.viewContainerParent = null;
31849    removeFromArray(embeddedViews, viewIndex);
31850    // See attachProjectedView for why we don't update projectedViews here.
31851    Services.dirtyParentQueries(view);
31852    renderDetachView$1(view);
31853    return view;
31854}
31855function detachProjectedView(view) {
31856    if (!(view.state & 16 /* IsProjectedView */)) {
31857        return;
31858    }
31859    const dvcElementData = declaredViewContainer(view);
31860    if (dvcElementData) {
31861        const projectedViews = dvcElementData.template._projectedViews;
31862        if (projectedViews) {
31863            removeFromArray(projectedViews, projectedViews.indexOf(view));
31864            Services.dirtyParentQueries(view);
31865        }
31866    }
31867}
31868function moveEmbeddedView(elementData, oldViewIndex, newViewIndex) {
31869    const embeddedViews = elementData.viewContainer._embeddedViews;
31870    const view = embeddedViews[oldViewIndex];
31871    removeFromArray(embeddedViews, oldViewIndex);
31872    if (newViewIndex == null) {
31873        newViewIndex = embeddedViews.length;
31874    }
31875    addToArray(embeddedViews, newViewIndex, view);
31876    // Note: Don't need to change projectedViews as the order in there
31877    // as always invalid...
31878    Services.dirtyParentQueries(view);
31879    renderDetachView$1(view);
31880    const prevView = newViewIndex > 0 ? embeddedViews[newViewIndex - 1] : null;
31881    renderAttachEmbeddedView(elementData, prevView, view);
31882    return view;
31883}
31884function renderAttachEmbeddedView(elementData, prevView, view) {
31885    const prevRenderNode = prevView ? renderNode(prevView, prevView.def.lastRenderRootNode) : elementData.renderElement;
31886    const parentNode = view.renderer.parentNode(prevRenderNode);
31887    const nextSibling = view.renderer.nextSibling(prevRenderNode);
31888    // Note: We can't check if `nextSibling` is present, as on WebWorkers it will always be!
31889    // However, browsers automatically do `appendChild` when there is no `nextSibling`.
31890    visitRootRenderNodes(view, 2 /* InsertBefore */, parentNode, nextSibling, undefined);
31891}
31892function renderDetachView$1(view) {
31893    visitRootRenderNodes(view, 3 /* RemoveChild */, null, null, undefined);
31894}
31895
31896/**
31897 * @license
31898 * Copyright Google LLC All Rights Reserved.
31899 *
31900 * Use of this source code is governed by an MIT-style license that can be
31901 * found in the LICENSE file at https://angular.io/license
31902 */
31903const EMPTY_CONTEXT = {};
31904// Attention: this function is called as top level function.
31905// Putting any logic in here will destroy closure tree shaking!
31906function createComponentFactory(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors) {
31907    return new ComponentFactory_(selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);
31908}
31909function getComponentViewDefinitionFactory(componentFactory) {
31910    return componentFactory.viewDefFactory;
31911}
31912class ComponentFactory_ extends ComponentFactory {
31913    constructor(selector, componentType, viewDefFactory, _inputs, _outputs, ngContentSelectors) {
31914        // Attention: this ctor is called as top level function.
31915        // Putting any logic in here will destroy closure tree shaking!
31916        super();
31917        this.selector = selector;
31918        this.componentType = componentType;
31919        this._inputs = _inputs;
31920        this._outputs = _outputs;
31921        this.ngContentSelectors = ngContentSelectors;
31922        this.viewDefFactory = viewDefFactory;
31923    }
31924    get inputs() {
31925        const inputsArr = [];
31926        const inputs = this._inputs;
31927        for (let propName in inputs) {
31928            const templateName = inputs[propName];
31929            inputsArr.push({ propName, templateName });
31930        }
31931        return inputsArr;
31932    }
31933    get outputs() {
31934        const outputsArr = [];
31935        for (let propName in this._outputs) {
31936            const templateName = this._outputs[propName];
31937            outputsArr.push({ propName, templateName });
31938        }
31939        return outputsArr;
31940    }
31941    /**
31942     * Creates a new component.
31943     */
31944    create(injector, projectableNodes, rootSelectorOrNode, ngModule) {
31945        if (!ngModule) {
31946            throw new Error('ngModule should be provided');
31947        }
31948        const viewDef = resolveDefinition(this.viewDefFactory);
31949        const componentNodeIndex = viewDef.nodes[0].element.componentProvider.nodeIndex;
31950        const view = Services.createRootView(injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);
31951        const component = asProviderData(view, componentNodeIndex).instance;
31952        if (rootSelectorOrNode) {
31953            view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full);
31954        }
31955        return new ComponentRef_(view, new ViewRef_(view), component);
31956    }
31957}
31958class ComponentRef_ extends ComponentRef {
31959    constructor(_view, _viewRef, _component) {
31960        super();
31961        this._view = _view;
31962        this._viewRef = _viewRef;
31963        this._component = _component;
31964        this._elDef = this._view.def.nodes[0];
31965        this.hostView = _viewRef;
31966        this.changeDetectorRef = _viewRef;
31967        this.instance = _component;
31968    }
31969    get location() {
31970        return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement);
31971    }
31972    get injector() {
31973        return new Injector_(this._view, this._elDef);
31974    }
31975    get componentType() {
31976        return this._component.constructor;
31977    }
31978    destroy() {
31979        this._viewRef.destroy();
31980    }
31981    onDestroy(callback) {
31982        this._viewRef.onDestroy(callback);
31983    }
31984}
31985function createViewContainerData(view, elDef, elData) {
31986    return new ViewContainerRef_(view, elDef, elData);
31987}
31988class ViewContainerRef_ {
31989    constructor(_view, _elDef, _data) {
31990        this._view = _view;
31991        this._elDef = _elDef;
31992        this._data = _data;
31993        /**
31994         * @internal
31995         */
31996        this._embeddedViews = [];
31997    }
31998    get element() {
31999        return new ElementRef(this._data.renderElement);
32000    }
32001    get injector() {
32002        return new Injector_(this._view, this._elDef);
32003    }
32004    /** @deprecated No replacement */
32005    get parentInjector() {
32006        let view = this._view;
32007        let elDef = this._elDef.parent;
32008        while (!elDef && view) {
32009            elDef = viewParentEl(view);
32010            view = view.parent;
32011        }
32012        return view ? new Injector_(view, elDef) : new Injector_(this._view, null);
32013    }
32014    clear() {
32015        const len = this._embeddedViews.length;
32016        for (let i = len - 1; i >= 0; i--) {
32017            const view = detachEmbeddedView(this._data, i);
32018            Services.destroyView(view);
32019        }
32020    }
32021    get(index) {
32022        const view = this._embeddedViews[index];
32023        if (view) {
32024            const ref = new ViewRef_(view);
32025            ref.attachToViewContainerRef(this);
32026            return ref;
32027        }
32028        return null;
32029    }
32030    get length() {
32031        return this._embeddedViews.length;
32032    }
32033    createEmbeddedView(templateRef, context, index) {
32034        const viewRef = templateRef.createEmbeddedView(context || {});
32035        this.insert(viewRef, index);
32036        return viewRef;
32037    }
32038    createComponent(componentFactory, index, injector, projectableNodes, ngModuleRef) {
32039        const contextInjector = injector || this.parentInjector;
32040        if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {
32041            ngModuleRef = contextInjector.get(NgModuleRef);
32042        }
32043        const componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);
32044        this.insert(componentRef.hostView, index);
32045        return componentRef;
32046    }
32047    insert(viewRef, index) {
32048        if (viewRef.destroyed) {
32049            throw new Error('Cannot insert a destroyed View in a ViewContainer!');
32050        }
32051        const viewRef_ = viewRef;
32052        const viewData = viewRef_._view;
32053        attachEmbeddedView(this._view, this._data, index, viewData);
32054        viewRef_.attachToViewContainerRef(this);
32055        return viewRef;
32056    }
32057    move(viewRef, currentIndex) {
32058        if (viewRef.destroyed) {
32059            throw new Error('Cannot move a destroyed View in a ViewContainer!');
32060        }
32061        const previousIndex = this._embeddedViews.indexOf(viewRef._view);
32062        moveEmbeddedView(this._data, previousIndex, currentIndex);
32063        return viewRef;
32064    }
32065    indexOf(viewRef) {
32066        return this._embeddedViews.indexOf(viewRef._view);
32067    }
32068    remove(index) {
32069        const viewData = detachEmbeddedView(this._data, index);
32070        if (viewData) {
32071            Services.destroyView(viewData);
32072        }
32073    }
32074    detach(index) {
32075        const view = detachEmbeddedView(this._data, index);
32076        return view ? new ViewRef_(view) : null;
32077    }
32078}
32079function createChangeDetectorRef(view) {
32080    return new ViewRef_(view);
32081}
32082class ViewRef_ {
32083    constructor(_view) {
32084        this._view = _view;
32085        this._viewContainerRef = null;
32086        this._appRef = null;
32087    }
32088    get rootNodes() {
32089        return rootRenderNodes(this._view);
32090    }
32091    get context() {
32092        return this._view.context;
32093    }
32094    get destroyed() {
32095        return (this._view.state & 128 /* Destroyed */) !== 0;
32096    }
32097    markForCheck() {
32098        markParentViewsForCheck(this._view);
32099    }
32100    detach() {
32101        this._view.state &= ~4 /* Attached */;
32102    }
32103    detectChanges() {
32104        const fs = this._view.root.rendererFactory;
32105        if (fs.begin) {
32106            fs.begin();
32107        }
32108        try {
32109            Services.checkAndUpdateView(this._view);
32110        }
32111        finally {
32112            if (fs.end) {
32113                fs.end();
32114            }
32115        }
32116    }
32117    checkNoChanges() {
32118        Services.checkNoChangesView(this._view);
32119    }
32120    reattach() {
32121        this._view.state |= 4 /* Attached */;
32122    }
32123    onDestroy(callback) {
32124        if (!this._view.disposables) {
32125            this._view.disposables = [];
32126        }
32127        this._view.disposables.push(callback);
32128    }
32129    destroy() {
32130        if (this._appRef) {
32131            this._appRef.detachView(this);
32132        }
32133        else if (this._viewContainerRef) {
32134            this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));
32135        }
32136        Services.destroyView(this._view);
32137    }
32138    detachFromAppRef() {
32139        this._appRef = null;
32140        renderDetachView$1(this._view);
32141        Services.dirtyParentQueries(this._view);
32142    }
32143    attachToAppRef(appRef) {
32144        if (this._viewContainerRef) {
32145            throw new Error('This view is already attached to a Vie
32145wContainer!');
32146        }
32147        this._appRef = appRef;
32148    }
32149    attachToViewContainerRef(vcRef) {
32150        if (this._appRef) {
32151            throw new Error('This view is already attached directly to the ApplicationRef!');
32152        }
32153        this._viewContainerRef = vcRef;
32154    }
32155}
32156function createTemplateData(view, def) {
32157    return new TemplateRef_(view, def);
32158}
32159class TemplateRef_ extends TemplateRef {
32160    constructor(_parentView, _def) {
32161        super();
32162        this._parentView = _parentView;
32163        this._def = _def;
32164    }
32165    createEmbeddedView(context) {
32166        return new ViewRef_(Services.createEmbeddedView(this._parentView, this._def, this._def.element.template, context));
32167    }
32168    get elementRef() {
32169        return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement);
32170    }
32171}
32172function createInjector$1(view, elDef) {
32173    return new Injector_(view, elDef);
32174}
32175class Injector_ {
32176    constructor(view, elDef) {
32177        this.view = view;
32178        this.elDef = elDef;
32179    }
32180    get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND) {
32181        const allowPrivateServices = this.elDef ? (this.elDef.flags & 33554432 /* ComponentView */) !== 0 : false;
32182        return Services.resolveDep(this.view, this.elDef, allowPrivateServices, { flags: 0 /* None */, token, tokenKey: tokenKey(token) }, notFoundValue);
32183    }
32184}
32185function nodeValue(view, index) {
32186    const def = view.def.nodes[index];
32187    if (def.flags & 1 /* TypeElement */) {
32188        const elData = asElementData(view, def.nodeIndex);
32189        return def.element.template ? elData.template : elData.renderElement;
32190    }
32191    else if (def.flags & 2 /* TypeText */) {
32192        return asTextData(view, def.nodeIndex).renderText;
32193    }
32194    else if (def.flags & (20224 /* CatProvider */ | 16 /* TypePipe */)) {
32195        return asProviderData(view, def.nodeIndex).instance;
32196    }
32197    throw new Error(`Illegal state: read nodeValue for node index ${index}`);
32198}
32199function createNgModuleRef(moduleType, parent, bootstrapComponents, def) {
32200    return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);
32201}
32202class NgModuleRef_ {
32203    constructor(_moduleType, _parent, _bootstrapComponents, _def) {
32204        this._moduleType = _moduleType;
32205        this._parent = _parent;
32206        this._bootstrapComponents = _bootstrapComponents;
32207        this._def = _def;
32208        this._destroyListeners = [];
32209        this._destroyed = false;
32210        this.injector = this;
32211        initNgModule(this);
32212    }
32213    get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
32214        let flags = 0 /* None */;
32215        if (injectFlags & InjectFlags.SkipSelf) {
32216            flags |= 1 /* SkipSelf */;
32217        }
32218        else if (injectFlags & InjectFlags.Self) {
32219            flags |= 4 /* Self */;
32220        }
32221        return resolveNgModuleDep(this, { token: token, tokenKey: tokenKey(token), flags: flags }, notFoundValue);
32222    }
32223    get instance() {
32224        return this.get(this._moduleType);
32225    }
32226    get componentFactoryResolver() {
32227        return this.get(ComponentFactoryResolver);
32228    }
32229    destroy() {
32230        if (this._destroyed) {
32231            throw new Error(`The ng module ${stringify(this.instance.constructor)} has already been destroyed.`);
32232        }
32233        this._destroyed = true;
32234        callNgModuleLifecycle(this, 131072 /* OnDestroy */);
32235        this._destroyListeners.forEach((listener) => listener());
32236    }
32237    onDestroy(callback) {
32238        this._destroyListeners.push(callback);
32239    }
32240}
32241
32242/**
32243 * @license
32244 * Copyright Google LLC All Rights Reserved.
32245 *
32246 * Use of this source code is governed by an MIT-style license that can be
32247 * found in the LICENSE file at https://angular.io/license
32248 */
32249const Renderer2TokenKey = tokenKey(Renderer2);
32250const ElementRefTokenKey = tokenKey(ElementRef);
32251const ViewContainerRefTokenKey = tokenKey(ViewContainerRef);
32252const TemplateRefTokenKey = tokenKey(TemplateRef);
32253const ChangeDetectorRefTokenKey = tokenKey(ChangeDetectorRef);
32254const InjectorRefTokenKey$1 = tokenKey(Injector);
32255const INJECTORRefTokenKey$1 = tokenKey(INJECTOR$1);
32256function directiveDef(checkIndex, flags, matchedQueries, childCount, ctor, deps, props, outputs) {
32257    const bindings = [];
32258    if (props) {
32259        for (let prop in props) {
32260            const [bindingIndex, nonMinifiedName] = props[prop];
32261            bindings[bindingIndex] = {
32262                flags: 8 /* TypeProperty */,
32263                name: prop,
32264                nonMinifiedName,
32265                ns: null,
32266                securityContext: null,
32267                suffix: null
32268            };
32269        }
32270    }
32271    const outputDefs = [];
32272    if (outputs) {
32273        for (let propName in outputs) {
32274            outputDefs.push({ type: 1 /* DirectiveOutput */, propName, target: null, eventName: outputs[propName] });
32275        }
32276    }
32277    flags |= 16384 /* TypeDirective */;
32278    return _def(checkIndex, flags, matchedQueries, childCount, ctor, ctor, deps, bindings, outputDefs);
32279}
32280function pipeDef(flags, ctor, deps) {
32281    flags |= 16 /* TypePipe */;
32282    return _def(-1, flags, null, 0, ctor, ctor, deps);
32283}
32284function providerDef(flags, matchedQueries, token, value, deps) {
32285    return _def(-1, flags, matchedQueries, 0, token, value, deps);
32286}
32287function _def(checkIndex, flags, matchedQueriesDsl, childCount, token, value, deps, bindings, outputs) {
32288    const { matchedQueries, references, matchedQueryIds } = splitMatchedQueriesDsl(matchedQueriesDsl);
32289    if (!outputs) {
32290        outputs = [];
32291    }
32292    if (!bindings) {
32293        bindings = [];
32294    }
32295    // Need to resolve forwardRefs as e.g. for `useValue` we
32296    // lowered the expression and then stopped evaluating it,
32297    // i.e. also didn't unwrap it.
32298    value = resolveForwardRef(value);
32299    const depDefs = splitDepsDsl(deps, stringify(token));
32300    return {
32301        // will bet set by the view definition
32302        nodeIndex: -1,
32303        parent: null,
32304        renderParent: null,
32305        bindingIndex: -1,
32306        outputIndex: -1,
32307        // regular values
32308        checkIndex,
32309        flags,
32310        childFlags: 0,
32311        directChildFlags: 0,
32312        childMatchedQueries: 0,
32313        matchedQueries,
32314        matchedQueryIds,
32315        references,
32316        ngContentIndex: -1,
32317        childCount,
32318        bindings,
32319        bindingFlags: calcBindingFlags(bindings),
32320        outputs,
32321        element: null,
32322        provider: { token, value, deps: depDefs },
32323        text: null,
32324        query: null,
32325        ngContent: null
32326    };
32327}
32328function createProviderInstance(view, def) {
32329    return _createProviderInstance$1(view, def);
32330}
32331function createPipeInstance(view, def) {
32332    // deps are looked up from component.
32333    let compView = view;
32334    while (compView.parent && !isComponentView(compView)) {
32335        compView = compView.parent;
32336    }
32337    // pipes can see the private services of the component
32338    const allowPrivateServices = true;
32339    // pipes are always eager and classes!
32340    return createClass(compView.parent, viewParentEl(compView), allowPrivateServices, def.provider.value, def.provider.deps);
32341}
32342function createDirectiveInstance(view, def) {
32343    // components can see other private services, other directives can't.
32344    const allowPrivateServices = (def.flags & 32768 /* Component */) > 0;
32345    // directives are always eager and classes!
32346    const instance = createClass(view, def.parent, allowPrivateServices, def.provider.value, def.provider.deps);
32347    if (def.outputs.length) {
32348        for (let i = 0; i < def.outputs.length; i++) {
32349            const output = def.outputs[i];
32350            const outputObservable = instance[output.propName];
32351            if (isObservable(outputObservable)) {
32352                const subscription = outputObservable.subscribe(eventHandlerClosure(view, def.parent.nodeIndex, output.eventName));
32353                view.disposables[def.outputIndex + i] = subscription.unsubscribe.bind(subscription);
32354            }
32355            else {
32356                throw new Error(`@Output ${output.propName} not initialized in '${instance.constructor.name}'.`);
32357            }
32358        }
32359    }
32360    return instance;
32361}
32362function eventHandlerClosure(view, index, eventName) {
32363    return (event) => dispatchEvent(view, index, eventName, event);
32364}
32365function checkAndUpdateDirectiveInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
32366    const providerData = asProviderData(view, def.nodeIndex);
32367    const directive = providerData.instance;
32368    let changed = false;
32369    let changes = undefined;
32370    const bindLen = def.bindings.length;
32371    if (bindLen > 0 && checkBinding(view, def, 0, v0)) {
32372        changed = true;
32373        changes = updateProp(view, providerData, def, 0, v0, changes);
32374    }
32375    if (bindLen > 1 && checkBinding(view, def, 1, v1)) {
32376        changed = true;
32377        changes = updateProp(view, providerData, def, 1, v1, changes);
32378    }
32379    if (bindLen > 2 && checkBinding(view, def, 2, v2)) {
32380        changed = true;
32381        changes = updateProp(view, providerData, def, 2, v2, changes);
32382    }
32383    if (bindLen > 3 && checkBinding(view, def, 3, v3)) {
32384        changed = true;
32385        changes = updateProp(view, providerData, def, 3, v3, changes);
32386    }
32387    if (bindLen > 4 && checkBinding(view, def, 4, v4)) {
32388        changed = true;
32389        changes = updateProp(view, providerData, def, 4, v4, changes);
32390    }
32391    if (bindLen > 5 && checkBinding(view, def, 5, v5)) {
32392        changed = true;
32393        changes = updateProp(view, providerData, def, 5, v5, changes);
32394    }
32395    if (bindLen > 6 && checkBinding(view, def, 6, v6)) {
32396        changed = true;
32397        changes = updateProp(view, providerData, def, 6, v6, changes);
32398    }
32399    if (bindLen > 7 && checkBinding(view, def, 7, v7)) {
32400        changed = true;
32401        changes = updateProp(view, providerData, def, 7, v7, changes);
32402    }
32403    if (bindLen > 8 && checkBinding(view, def, 8, v8)) {
32404        changed = true;
32405        changes = updateProp(view, providerData, def, 8, v8, changes);
32406    }
32407    if (bindLen > 9 && checkBinding(view, def, 9, v9)) {
32408        changed = true;
32409        changes = updateProp(view, providerData, def, 9, v9, changes);
32410    }
32411    if (changes) {
32412        directive.ngOnChanges(changes);
32413    }
32414    if ((def.flags & 65536 /* OnInit */) &&
32415        shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) {
32416        directive.ngOnInit();
32417    }
32418    if (def.flags & 262144 /* DoCheck */) {
32419        directive.ngDoCheck();
32420    }
32421    return changed;
32422}
32423function checkAndUpdateDirectiveDynamic(view, def, values) {
32424    const providerData = asProviderData(view, def.nodeIndex);
32425    const directive = providerData.instance;
32426    let changed = false;
32427    let changes = undefined;
32428    for (let i = 0; i < values.length; i++) {
32429        if (checkBinding(view, def, i, values[i])) {
32430            changed = true;
32431            changes = updateProp(view, providerData, def, i, values[i], changes);
32432        }
32433    }
32434    if (changes) {
32435        directive.ngOnChanges(changes);
32436    }
32437    if ((def.flags & 65536 /* OnInit */) &&
32438        shouldCallLifecycleInitHook(view, 256 /* InitState_CallingOnInit */, def.nodeIndex)) {
32439        directive.ngOnInit();
32440    }
32441    if (def.flags & 262144 /* DoCheck */) {
32442        directive.ngDoCheck();
32443    }
32444    return changed;
32445}
32446function _createProviderInstance$1(view, def) {
32447    // private services can see other private services
32448    const allowPrivateServices = (def.flags & 8192 /* PrivateProvider */) > 0;
32449    const providerDef = def.provider;
32450    switch (def.flags & 201347067 /* Types */) {
32451        case 512 /* TypeClassProvider */:
32452            return createClass(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps);
32453        case 1024 /* TypeFactoryProvider */:
32454            return callFactory(view, def.parent, allowPrivateServices, providerDef.value, providerDef.deps);
32455        case 2048 /* TypeUseExistingProvider */:
32456            return resolveDep(view, def.parent, allowPrivateServices, providerDef.deps[0]);
32457        case 256 /* TypeValueProvider */:
32458            return providerDef.value;
32459    }
32460}
32461function createClass(view, elDef, allowPrivateServices, ctor, deps) {
32462    const len = deps.length;
32463    switch (len) {
32464        case 0:
32465            return new ctor();
32466        case 1:
32467            return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]));
32468        case 2:
32469            return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));
32470        case 3:
32471            return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));
32472        default:
32473            const depValues = [];
32474            for (let i = 0; i < len; i++) {
32475                depValues.push(resolveDep(view, elDef, allowPrivateServices, deps[i]));
32476            }
32477            return new ctor(...depValues);
32478    }
32479}
32480function callFactory(view, elDef, allowPrivateServices, factory, deps) {
32481    const len = deps.length;
32482    switch (len) {
32483        case 0:
32484            return factory();
32485        case 1:
32486            return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]));
32487        case 2:
32488            return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]));
32489        case 3:
32490            return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]), resolveDep(view, elDef, allowPrivateServices, deps[1]), resolveDep(view, elDef, allowPrivateServices, deps[2]));
32491        default:
32492            const depValues = [];
32493            for (let i = 0; i < len; i++) {
32494                depValues.push(resolveDep(view, elDef, allowPrivateServices, deps[i]));
32495            }
32496            return factory(...depValues);
32497    }
32498}
32499// This default value is when checking the hierarchy for a token.
32500//
32501// It means both:
32502// - the token is not provided by the current injector,
32503// - only the element injectors should be checked (ie do not check module injectors
32504//
32505//          mod1
32506//         /
32507//       el1   mod2
32508//         \  /
32509//         el2
32510//
32511// When requesting el2.injector.get(token), we should check in the following order and return the
32512// first found value:
32513// - el2.injector.get(token, default)
32514// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module
32515// - mod2.injector.get(token, default)
32516const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
32517function resolveDep(view, elDef, allowPrivateServices, depDef, notFoundValue = Injector.THROW_IF_NOT_FOUND) {
32518    if (depDef.flags & 8 /* Value */) {
32519        return depDef.token;
32520    }
32521    const startView = view;
32522    if (depDef.flags & 2 /* Optional */) {
32523        notFoundValue = null;
32524    }
32525    const tokenKey = depDef.tokenKey;
32526    if (tokenKey === ChangeDetectorRefTokenKey) {
32527        // directives on the same element as a component should be able to control the change detector
32528        // of that component as well.
32529        allowPrivateServices = !!(elDef && elDef.element.componentView);
32530    }
32531    if (elDef && (depDef.flags & 1 /* SkipSelf */)) {
32532        allowPrivateServices = false;
32533        elDef = elDef.parent;
32534    }
32535    let searchView = view;
32536    while (searchView) {
32537        if (elDef) {
32538            switch (tokenKey) {
32539                case Renderer2TokenKey: {
32540                    const compView = findCompView(searchView, elDef, allowPrivateServices);
32541                    return compView.renderer;
32542                }
32543                case ElementRefTokenKey:
32544                    return new ElementRef(asElementData(searchView, elDef.nodeIndex).renderElement);
32545                case ViewContainerRefTokenKey:
32546                    return asElementData(searchView, elDef.nodeIndex).viewContainer;
32547                case TemplateRefTokenKey: {
32548                    if (elDef.element.template) {
32549                        return asElementData(searchView, elDef.nodeIndex).template;
32550                    }
32551                    break;
32552                }
32553                case ChangeDetectorRefTokenKey: {
32554                    let cdView = findCompView(searchView, elDef, allowPrivateServices);
32555                    return createChangeDetectorRef(cdView);
32556                }
32557                case InjectorRefTokenKey$1:
32558                case INJECTORRefTokenKey$1:
32559                    return createInjector$1(searchView, elDef);
32560                default:
32561                    const providerDef = (allowPrivateServices ? elDef.element.allProviders :
32562                        elDef.element.publicProviders)[tokenKey];
32563                    if (providerDef) {
32564                        let providerData = asProviderData(searchView, providerDef.nodeIndex);
32565                        if (!providerData) {
32566                            providerData = { instance: _createProviderInstance$1(searchView, providerDef) };
32567                            searchView.nodes[providerDef.nodeIndex] = providerData;
32568                        }
32569                        return providerData.instance;
32570                    }
32571            }
32572        }
32573        allowPrivateServices = isComponentView(searchView);
32574        elDef = viewParentEl(searchView);
32575        searchView = searchView.parent;
32576        if (depDef.flags & 4 /* Self */) {
32577            searchView = null;
32578        }
32579    }
32580    const value = startView.root.injector.get(depDef.token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);
32581    if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
32582        notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
32583        // Return the value from the root element injector when
32584        // - it provides it
32585        //   (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
32586        // - the module injector should not be checked
32587        //   (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
32588        return value;
32589    }
32590    return startView.root.ngModule.injector.get(depDef.token, notFoundValue);
32591}
32592function findCompView(view, elDef, allowPrivateServices) {
32593    let compView;
32594    if (allowPrivateServices) {
32595        compView = asElementData(view, elDef.nodeIndex).componentView;
32596    }
32597    else {
32598        compView = view;
32599        while (compView.parent && !isComponentView(compView)) {
32600            compView = compView.parent;
32601        }
32602    }
32603    return compView;
32604}
32605function updateProp(view, providerData, def, bindingIdx, value, changes) {
32606    if (def.flags & 32768 /* Component */) {
32607        const compView = asElementData(view, def.parent.nodeIndex).componentView;
32608        if (compView.def.flags & 2 /* OnPush */) {
32609            compView.state |= 8 /* ChecksEnabled */;
32610        }
32611    }
32612    const binding = def.bindings[bindingIdx];
32613    const propName = binding.name;
32614    // Note: This is still safe with Closure Compiler as
32615    // the user passed in the property name as an object has to `providerDef`,
32616    // so Closure Compiler will have renamed the property correctly already.
32617    providerData.instance[propName] = value;
32618    if (def.flags & 524288 /* OnChanges */) {
32619        changes = changes || {};
32620        const oldValue = WrappedValue.unwrap(view.oldValues[def.bindingIndex + bindingIdx]);
32621        const binding = def.bindings[bindingIdx];
32622        changes[binding.nonMinifiedName] =
32623            new SimpleChange(oldValue, value, (view.state & 2 /* FirstCheck */) !== 0);
32624    }
32625    view.oldValues[def.bindingIndex + bindingIdx] = value;
32626    return changes;
32627}
32628// This function calls the ngAfterContentCheck, ngAfterContentInit,
32629// ngAfterViewCheck, and ngAfterViewInit lifecycle hooks (depending on the node
32630// flags in lifecycle). Unlike ngDoCheck, ngOnChanges and ngOnInit, which are
32631// called during a pre-order traversal of the view tree (that is calling the
32632// parent hooks before the child hooks) these events are sent in using a
32633// post-order traversal of the tree (children before parents). This changes the
32634// meaning of initIndex in the view state. For ngOnInit, initIndex tracks the
32635// expected nodeIndex which a ngOnInit should be called. When sending
32636// ngAfterContentInit and ngAfterViewInit it is the expected count of
32637// ngAfterContentInit or ngAfterViewInit methods that have been called. This
32638// ensure that despite being called recursively or after picking up after an
32639// exception, the ngAfterContentInit or ngAfterViewInit will be called on the
32640// correct nodes. Consider for example, the following (where E is an element
32641// and D is a directive)
32642//  Tree:       pre-order index  post-order index
32643//    E1        0                6
32644//      E2      1                1
32645//       D3     2                0
32646//      E4      3                5
32647//       E5     4                4
32648//        E6    5                2
32649//        E7    6                3
32650// As can be seen, the post-order index has an unclear relationship to the
32651// pre-order index (postOrderIndex === preOrderIndex - parentCount +
32652// childCount). Since number of calls to ngAfterContentInit and ngAfterViewInit
32653// are stable (will be the same for the same view regardless of exceptions or
32654// recursion) we just need to count them which will roughly correspond to the
32655// post-order index (it skips elements and directives that do not have
32656// lifecycle hooks).
32657//
32658// For example, if an exception is raised in the E6.onAfterViewInit() the
32659// initIndex is left at 3 (by shouldCallLifecycleInitHook() which set it to
32660// initIndex + 1). When checkAndUpdateView() is called again D3, E2 and E6 will
32661// not have their ngAfterViewInit() called but, starting with E7, the rest of
32662// the view will begin getting ngAfterViewInit() called until a check and
32663// pass is complete.
32664//
32665// This algorthim also handles recursion. Consider if E4's ngAfterViewInit()
32666// indirectly calls E1's ChangeDetectorRef.detectChanges(). The expected
32667// initIndex is set to 6, the recusive checkAndUpdateView() starts walk again.
32668// D3, E2, E6, E7, E5 and E4 are skipped, ngAfterViewInit() is called on E1.
32669// When the recursion returns the initIndex will be 7 so E1 is skipped as it
32670// has already been called in the recursively called checkAnUpdateView().
32671function callLifecycleHooksChildrenFirst(view, lifecycles) {
32672    if (!(view.def.nodeFlags & lifecycles)) {
32673        return;
32674    }
32675    const nodes = view.def.nodes;
32676    let initIndex = 0;
32677    for (let i = 0; i < nodes.length; i++) {
32678        const nodeDef = nodes[i];
32679        let parent = nodeDef.parent;
32680        if (!parent && nodeDef.flags & lifecycles) {
32681            // matching root node (e.g. a pipe)
32682            callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);
32683        }
32684        if ((nodeDef.childFlags & lifecycles) === 0) {
32685            // no child matches one of the lifecycles
32686            i += nodeDef.childCount;
32687        }
32688        while (parent && (parent.flags & 1 /* TypeElement */) &&
32689            i === parent.nodeIndex + parent.childCount) {
32690            // last child of an element
32691            if (parent.directChildFlags & lifecycles) {
32692                initIndex = callElementProvidersLifecycles(view, parent, lifecycles, initIndex);
32693            }
32694            parent = parent.parent;
32695        }
32696    }
32697}
32698function callElementProvidersLifecycles(view, elDef, lifecycles, initIndex) {
32699    for (let i = elDef.nodeIndex + 1; i <= elDef.nodeIndex + elDef.childCount; i++) {
32700        const nodeDef = view.def.nodes[i];
32701        if (nodeDef.flags & lifecycles) {
32702            callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);
32703        }
32704        // only visit direct children
32705        i += nodeDef.childCount;
32706    }
32707    return initIndex;
32708}
32709function callProviderLifecycles(view, index, lifecycles, initIndex) {
32710    const providerData = asProviderData(view, index);
32711    if (!providerData) {
32712        return;
32713    }
32714    const provider = providerData.instance;
32715    if (!provider) {
32716        return;
32717    }
32718    Services.setCurrentNode(view, index);
32719    if (lifecycles & 1048576 /* AfterContentInit */ &&
32720        shouldCallLifecycleInitHook(view, 512 /* InitState_CallingAfterContentInit */, initIndex)) {
32721        provider.ngAfterContentInit();
32722    }
32723    if (lifecycles & 2097152 /* AfterContentChecked */) {
32724        provider.ngAfterContentChecked();
32725    }
32726    if (lifecycles & 4194304 /* AfterViewInit */ &&
32727        shouldCallLifecycleInitHook(view, 768 /* InitState_CallingAfterViewInit */, initIndex)) {
32728        provider.ngAfterViewInit();
32729    }
32730    if (lifecycles & 8388608 /* AfterViewChecked */) {
32731        provider.ngAfterViewChecked();
32732    }
32733    if (lifecycles & 131072 /* OnDestroy */) {
32734        provider.ngOnDestroy();
32735    }
32736}
32737
32738/**
32739 * @license
32740 * Copyright Google LLC All Rights Reserved.
32741 *
32742 * Use of this source code is governed by an MIT-style license that can be
32743 * found in the LICENSE file at https://angular.io/license
32744 */
32745class ComponentFactoryResolver$1 extends ComponentFactoryResolver {
32746    /**
32747     * @param ngModule The NgModuleRef to which all resolved factories are bound.
32748     */
32749    constructor(ngModule) {
32750        super();
32751        this.ngModule = ngModule;
32752    }
32753    resolveComponentFactory(component) {
32754        ngDevMode && assertComponentType(component);
32755        const componentDef = getComponentDef(component);
32756        return new ComponentFactory$1(componentDef, this.ngModule);
32757    }
32758}
32759function toRefArray(map) {
32760    const array = [];
32761    for (let nonMinified in map) {
32762        if (map.hasOwnProperty(nonMinified)) {
32763            const minified = map[nonMinified];
32764            array.push({ propName: minified, templateName: nonMinified });
32765        }
32766    }
32767    return array;
32768}
32769function getNamespace$1(elementName) {
32770    const name = elementName.toLowerCase();
32771    return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
32772}
32773/**
32774 * A change detection scheduler token for {@link RootContext}. This token is the default value used
32775 * for the default `RootContext` found in the {@link ROOT_CONTEXT} token.
32776 */
32777const SCHEDULER = new InjectionToken('SCHEDULER_TOKEN', {
32778    providedIn: 'root',
32779    factory: () => defaultScheduler,
32780});
32781function createChainedInjector(rootViewInjector, moduleInjector) {
32782    return {
32783        get: (token, notFoundValue, flags) => {
32784            const value = rootViewInjector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
32785            if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
32786                notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
32787                // Return the value from the root element injector when
32788                // - it provides it
32789                //   (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
32790                // - the module injector should not be checked
32791                //   (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
32792                return value;
32793            }
32794            return moduleInjector.get(token, notFoundValue, flags);
32795        }
32796    };
32797}
32798/**
32799 * Render3 implementation of {@link viewEngine_ComponentFactory}.
32800 */
32801class ComponentFactory$1 extends ComponentFactory {
32802    /**
32803     * @param componentDef The component definition.
32804     * @param ngModule The NgModuleRef to which the factory is bound.
32805     */
32806    constructor(componentDef, ngModule) {
32807        super();
32808        this.componentDef = componentDef;
32809        this.ngModule = ngModule;
32810        this.componentType = componentDef.type;
32811        this.selector = stringifyCSSSelectorList(componentDef.selectors);
32812        this.ngContentSelectors =
32813            componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
32814        this.isBoundToModule = !!ngModule;
32815    }
32816    get inputs() {
32817        return toRefArray(this.componentDef.inputs);
32818    }
32819    get outputs() {
32820        return toRefArray(this.componentDef.outputs);
32821    }
32822    create(injector, projectableNodes, rootSelectorOrNode, ngModule) {
32823        ngModule = ngModule || this.ngModule;
32824        const rootViewInjector = ngModule ? createChainedInjector(injector, ngModule.injector) : injector;
32825        const rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3);
32826        const sanitizer = rootViewInjector.get(Sanitizer, null);
32827        const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
32828        // Determine a tag name used for creating host elements when this component is created
32829        // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
32830        const elementName = this.componentDef.selectors[0][0] || 'div';
32831        const hostRNode = rootSelectorOrNode ?
32832            locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
32833            createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace$1(elementName));
32834        const rootFlags = this.componentDef.onPush ? 64 /* Dirty */ | 512 /* IsRoot */ :
32835            16 /* CheckAlways */ | 512 /* IsRoot */;
32836        const rootContext = createRootContext();
32837        // Create the root view. Uses empty TView and ContentTemplate.
32838        const rootTView = createTView(0 /* Root */, null, null, 1, 0, null, null, null, null, null);
32839        const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector);
32840        // rootView is the parent when bootstrapping
32841        // TODO(misko): it looks like we are entering view here but we don't really need to as
32842        // `renderView` does that. However as the code is written it is needed because
32843        // `createRootComponentView` and `createRootComponent` both read global state. Fixing those
32844        // issues would allow us to drop this.
32845        enterView(rootLView);
32846        let component;
32847        let tElementNode;
32848        try {
32849            const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
32850            if (hostRNode) {
32851                if (rootSelectorOrNode) {
32852                    setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
32853                }
32854                else {
32855                    // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
32856                    // is not defined), also apply attributes and classes extracted from component selector.
32857                    // Extract attributes and classes from the first selector only to match VE behavior.
32858                    const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
32859                    if (attrs) {
32860                        setUpAttributes(hostRenderer, hostRNode, attrs);
32861                    }
32862                    if (classes && classes.length > 0) {
32863                        writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
32864                    }
32865                }
32866            }
32867            tElementNode = getTNode(rootTView, HEADER_OFFSET);
32868            if (projectableNodes !== undefined) {
32869                const projection = tElementNode.projection = [];
32870                for (let i = 0; i < this.ngContentSelectors.length; i++) {
32871                    const nodesforSlot = projectableNodes[i];
32872                    // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
32873                    // case). Here we do normalize passed data structure to be an array of arrays to avoid
32874                    // complex checks down the line.
32875                    // We also normalize the length of the passed in projectable nodes (to match the number of
32876                    // <ng-container> slots defined by a component).
32877                    projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
32878                }
32879            }
32880            // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
32881            // executed here?
32882            // Angular 5 reference: https://stackblitz.com/edit/l
32882ifecycle-hooks-vcref
32883            component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
32884            renderView(rootTView, rootLView, null);
32885        }
32886        finally {
32887            leaveView();
32888        }
32889        return new ComponentRef$1(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
32890    }
32891}
32892const componentFactoryResolver = new ComponentFactoryResolver$1();
32893/**
32894 * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
32895 * ComponentFactoryResolver
32896 * already exists, retrieves the existing ComponentFactoryResolver.
32897 *
32898 * @returns The ComponentFactoryResolver instance to use
32899 */
32900function injectComponentFactoryResolver() {
32901    return componentFactoryResolver;
32902}
32903/**
32904 * Represents an instance of a Component created via a {@link ComponentFactory}.
32905 *
32906 * `ComponentRef` provides access to the Component Instance as well other objects related to this
32907 * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
32908 * method.
32909 *
32910 */
32911class ComponentRef$1 extends ComponentRef {
32912    constructor(componentType, instance, location, _rootLView, _tNode) {
32913        super();
32914        this.location = location;
32915        this._rootLView = _rootLView;
32916        this._tNode = _tNode;
32917        this.instance = instance;
32918        this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
32919        this.componentType = componentType;
32920    }
32921    get injector() {
32922        return new NodeInjector(this._tNode, this._rootLView);
32923    }
32924    destroy() {
32925        this.hostView.destroy();
32926    }
32927    onDestroy(callback) {
32928        this.hostView.onDestroy(callback);
32929    }
32930}
32931
32932/**
32933 * @license
32934 * Copyright Google LLC All Rights Reserved.
32935 *
32936 * Use of this source code is governed by an MIT-style license that can be
32937 * found in the LICENSE file at https://angular.io/license
32938 */
32939/**
32940 * Adds decorator, constructor, and property metadata to a given type via static metadata fields
32941 * on the type.
32942 *
32943 * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.
32944 *
32945 * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments
32946 * being tree-shaken away during production builds.
32947 */
32948function setClassMetadata(type, decorators, ctorParameters, propDecorators) {
32949    return noSideEffects(() => {
32950        const clazz = type;
32951        if (decorators !== null) {
32952            if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {
32953                clazz.decorators.push(...decorators);
32954            }
32955            else {
32956                clazz.decorators = decorators;
32957            }
32958        }
32959        if (ctorParameters !== null) {
32960            // Rather than merging, clobber the existing parameters. If other projects exist which
32961            // use tsickle-style annotations and reflect over them in the same way, this could
32962            // cause issues, but that is vanishingly unlikely.
32963            clazz.ctorParameters = ctorParameters;
32964        }
32965        if (propDecorators !== null) {
32966            // The property decorator objects are merged as it is possible different fields have
32967            // different decorator types. Decorators on individual fields are not merged, as it's
32968            // also incredibly unlikely that a field will be decorated both with an Angular
32969            // decorator and a non-Angular decorator that's also been downleveled.
32970            if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {
32971                clazz.propDecorators = Object.assign(Object.assign({}, clazz.propDecorators), propDecorators);
32972            }
32973            else {
32974                clazz.propDecorators = propDecorators;
32975            }
32976        }
32977    });
32978}
32979
32980/**
32981 * @license
32982 * Copyright Google LLC All Rights Reserved.
32983 *
32984 * Use of this source code is governed by an MIT-style license that can be
32985 * found in the LICENSE file at https://angular.io/license
32986 */
32987/**
32988 * Map of module-id to the corresponding NgModule.
32989 * - In pre Ivy we track NgModuleFactory,
32990 * - In post Ivy we track the NgModuleType
32991 */
32992const modules = new Map();
32993/**
32994 * Registers a loaded module. Should only be called from generated NgModuleFactory code.
32995 * @publicApi
32996 */
32997function registerModuleFactory(id, factory) {
32998    const existing = modules.get(id);
32999    assertSameOrNotExisting(id, existing && existing.moduleType, factory.moduleType);
33000    modules.set(id, factory);
33001}
33002function assertSameOrNotExisting(id, type, incoming) {
33003    if (type && type !== incoming) {
33004        throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);
33005    }
33006}
33007function registerNgModuleType(ngModuleType) {
33008    const visited = new Set();
33009    recurse(ngModuleType);
33010    function recurse(ngModuleType) {
33011        // The imports array of an NgModule must refer to other NgModules,
33012        // so an error is thrown if no module definition is available.
33013        const def = getNgModuleDef(ngModuleType, /* throwNotFound */ true);
33014        const id = def.id;
33015        if (id !== null) {
33016            const existing = modules.get(id);
33017            assertSameOrNotExisting(id, existing, ngModuleType);
33018            modules.set(id, ngModuleType);
33019        }
33020        const imports = maybeUnwrapFn(def.imports);
33021        for (const i of imports) {
33022            if (!visited.has(i)) {
33023                visited.add(i);
33024                recurse(i);
33025            }
33026        }
33027    }
33028}
33029function clearModulesForTest() {
33030    modules.clear();
33031}
33032function getRegisteredNgModuleType(id) {
33033    return modules.get(id) || autoRegisterModuleById[id];
33034}
33035
33036/**
33037 * @license
33038 * Copyright Google LLC All Rights Reserved.
33039 *
33040 * Use of this source code is governed by an MIT-style license that can be
33041 * found in the LICENSE file at https://angular.io/license
33042 */
33043class NgModuleRef$1 extends NgModuleRef {
33044    constructor(ngModuleType, _parent) {
33045        super();
33046        this._parent = _parent;
33047        // tslint:disable-next-line:require-internal-with-underscore
33048        this._bootstrapComponents = [];
33049        this.injector = this;
33050        this.destroyCbs = [];
33051        // When bootstrapping a module we have a dependency graph that looks like this:
33052        // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
33053        // module being resolved tries to inject the ComponentFactoryResolver, it'll create a
33054        // circular dependency which will result in a runtime error, because the injector doesn't
33055        // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
33056        // and providing it, rather than letting the injector resolve it.
33057        this.componentFactoryResolver = new ComponentFactoryResolver$1(this);
33058        const ngModuleDef = getNgModuleDef(ngModuleType);
33059        ngDevMode &&
33060            assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
33061        const ngLocaleIdDef = getNgLocaleIdDef(ngModuleType);
33062        ngLocaleIdDef && setLocaleId(ngLocaleIdDef);
33063        this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
33064        this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
33065            { provide: NgModuleRef, useValue: this }, {
33066                provide: ComponentFactoryResolver,
33067                useValue: this.componentFactoryResolver
33068            }
33069        ], stringify(ngModuleType));
33070        // We need to resolve the injector types separately from the injector creation, because
33071        // the module might be trying to use this ref in its contructor for DI which will cause a
33072        // circular error that will eventually error out, because the injector isn't created yet.
33073        this._r3Injector._resolveInjectorDefTypes();
33074        this.instance = this.get(ngModuleType);
33075    }
33076    get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
33077        if (token === Injector || token === NgModuleRef || token === INJECTOR$1) {
33078            return this;
33079        }
33080        return this._r3Injector.get(token, notFoundValue, injectFlags);
33081    }
33082    destroy() {
33083        ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
33084        const injector = this._r3Injector;
33085        !injector.destroyed && injector.destroy();
33086        this.destroyCbs.forEach(fn => fn());
33087        this.destroyCbs = null;
33088    }
33089    onDestroy(callback) {
33090        ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
33091        this.destroyCbs.push(callback);
33092    }
33093}
33094class NgModuleFactory$1 extends NgModuleFactory {
33095    constructor(moduleType) {
33096        super();
33097        this.moduleType = moduleType;
33098        const ngModuleDef = getNgModuleDef(moduleType);
33099        if (ngModuleDef !== null) {
33100            // Register the NgModule with Angular's module registry. The location (and hence timing) of
33101            // this call is critical to ensure this works correctly (modules get registered when expected)
33102            // without bloating bundles (modules are registered when otherwise not referenced).
33103            //
33104            // In View Engine, registration occurs in the .ngfactory.js file as a side effect. This has
33105            // several practical consequences:
33106            //
33107            // - If an .ngfactory file is not imported from, the module won't be registered (and can be
33108            //   tree shaken).
33109            // - If an .ngfactory file is imported from, the module will be registered even if an instance
33110            //   is not actually created (via `create` below).
33111            // - Since an .ngfactory file in View Engine references the .ngfactory files of the NgModule's
33112            //   imports,
33113            //
33114            // In Ivy, things are a bit different. .ngfactory files still exist for compatibility, but are
33115            // not a required API to use - there are other ways to obtain an NgModuleFactory for a given
33116            // NgModule. Thus, relying on a side effect in the .ngfactory file is not sufficient. Instead,
33117            // the side effect of registration is added here, in the constructor of NgModuleFactory,
33118            // ensuring no matter how a factory is created, the module is registered correctly.
33119            //
33120            // An alternative would be to include the registration side effect inline following the actual
33121            // NgModule definition. This also has the correct timing, but breaks tree-shaking - modules
33122            // will be registered and retained even if they're otherwise never referenced.
33123            registerNgModuleType(moduleType);
33124        }
33125    }
33126    create(parentInjector) {
33127        return new NgModuleRef$1(this.moduleType, parentInjector);
33128    }
33129}
33130
33131/**
33132 * @license
33133 * Copyright Google LLC All Rights Reserved.
33134 *
33135 * Use of this source code is governed by an MIT-style license that can be
33136 * found in the LICENSE file at https://angular.io/license
33137 */
33138/**
33139 * Bindings for pure functions are stored after regular bindings.
33140 *
33141 * |-------decls------|---------vars---------|                 |----- hostVars (dir1) ------|
33142 * ------------------------------------------------------------------------------------------
33143 * | nodes/refs/pipes | bindings | fn slots  | injector | dir1 | host bindings | host slots |
33144 * ------------------------------------------------------------------------------------------
33145 *                    ^                      ^
33146 *      TView.bindingStartIndex      TView.expandoStartIndex
33147 *
33148 * Pure function instructions are given an offset from the binding root. Adding the offset to the
33149 * binding root gives the first index where the bindings are stored. In component views, the binding
33150 * root is the bindingStartIndex. In host bindings, the binding root is the exp
vendor: 16,413 bytes, lines 33150-33559
33150andoStartIndex +
33151 * any directive instances + any hostVars in directives evaluated before it.
33152 *
33153 * See VIEW_DATA.md for more information about host binding resolution.
33154 */
33155/**
33156 * If the value hasn't been saved, calls the pure function to store and return the
33157 * value. If it has been saved, returns the saved value.
33158 *
33159 * @param slotOffset the offset from binding root to the reserved slot
33160 * @param pureFn Function that returns a value
33161 * @param thisArg Optional calling context of pureFn
33162 * @returns value
33163 *
33164 * @codeGenApi
33165 */
33166function ɵɵpureFunction0(slotOffset, pureFn, thisArg) {
33167    const bindingIndex = getBindingRoot() + slotOffset;
33168    const lView = getLView();
33169    return lView[bindingIndex] === NO_CHANGE ?
33170        updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) :
33171        getBinding(lView, bindingIndex);
33172}
33173/**
33174 * If the value of the provided exp has changed, calls the pure function to return
33175 * an updated value. Or if the value has not changed, returns cached value.
33176 *
33177 * @param slotOffset the offset from binding root to the reserved slot
33178 * @param pureFn Function that returns an updated value
33179 * @param exp Updated expression value
33180 * @param thisArg Optional calling context of pureFn
33181 * @returns Updated or cached value
33182 *
33183 * @codeGenApi
33184 */
33185function ɵɵpureFunction1(slotOffset, pureFn, exp, thisArg) {
33186    return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg);
33187}
33188/**
33189 * If the value of any provided exp has changed, calls the pure function to return
33190 * an updated value. Or if no values have changed, returns cached value.
33191 *
33192 * @param slotOffset the offset from binding root to the reserved slot
33193 * @param pureFn
33194 * @param exp1
33195 * @param exp2
33196 * @param thisArg Optional calling context of pureFn
33197 * @returns Updated or cached value
33198 *
33199 * @codeGenApi
33200 */
33201function ɵɵpureFunction2(slotOffset, pureFn, exp1, exp2, thisArg) {
33202    return pureFunction2Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg);
33203}
33204/**
33205 * If the value of any provided exp has changed, calls the pure function to return
33206 * an updated value. Or if no values have changed, returns cached value.
33207 *
33208 * @param slotOffset the offset from binding root to the reserved slot
33209 * @param pureFn
33210 * @param exp1
33211 * @param exp2
33212 * @param exp3
33213 * @param thisArg Optional calling context of pureFn
33214 * @returns Updated or cached value
33215 *
33216 * @codeGenApi
33217 */
33218function ɵɵpureFunction3(slotOffset, pureFn, exp1, exp2, exp3, thisArg) {
33219    return pureFunction3Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg);
33220}
33221/**
33222 * If the value of any provided exp has changed, calls the pure function to return
33223 * an updated value. Or if no values have changed, returns cached value.
33224 *
33225 * @param slotOffset the offset from binding root to the reserved slot
33226 * @param pureFn
33227 * @param exp1
33228 * @param exp2
33229 * @param exp3
33230 * @param exp4
33231 * @param thisArg Optional calling context of pureFn
33232 * @returns Updated or cached value
33233 *
33234 * @codeGenApi
33235 */
33236function ɵɵpureFunction4(slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {
33237    return pureFunction4Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg);
33238}
33239/**
33240 * If the value of any provided exp has changed, calls the pure function to return
33241 * an updated value. Or if no values have changed, returns cached value.
33242 *
33243 * @param slotOffset the offset from binding root to the reserved slot
33244 * @param pureFn
33245 * @param exp1
33246 * @param exp2
33247 * @param exp3
33248 * @param exp4
33249 * @param exp5
33250 * @param thisArg Optional calling context of pureFn
33251 * @returns Updated or cached value
33252 *
33253 * @codeGenApi
33254 */
33255function ɵɵpureFunction5(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) {
33256    const bindingIndex = getBindingRoot() + slotOffset;
33257    const lView = getLView();
33258    const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
33259    return bindingUpdated(lView, bindingIndex + 4, exp5) || different ?
33260        updateBinding(lView, bindingIndex + 5, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) :
33261            pureFn(exp1, exp2, exp3, exp4, exp5)) :
33262        getBinding(lView, bindingIndex + 5);
33263}
33264/**
33265 * If the value of any provided exp has changed, calls the pure function to return
33266 * an updated value. Or if no values have changed, returns cached value.
33267 *
33268 * @param slotOffset the offset from binding root to the reserved slot
33269 * @param pureFn
33270 * @param exp1
33271 * @param exp2
33272 * @param exp3
33273 * @param exp4
33274 * @param exp5
33275 * @param exp6
33276 * @param thisArg Optional calling context of pureFn
33277 * @returns Updated or cached value
33278 *
33279 * @codeGenApi
33280 */
33281function ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {
33282    const bindingIndex = getBindingRoot() + slotOffset;
33283    const lView = getLView();
33284    const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
33285    return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ?
33286        updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :
33287            pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :
33288        getBinding(lView, bindingIndex + 6);
33289}
33290/**
33291 * If the value of any provided exp has changed, calls the pure function to return
33292 * an updated value. Or if no values have changed, returns cached value.
33293 *
33294 * @param slotOffset the offset from binding root to the reserved slot
33295 * @param pureFn
33296 * @param exp1
33297 * @param exp2
33298 * @param exp3
33299 * @param exp4
33300 * @param exp5
33301 * @param exp6
33302 * @param exp7
33303 * @param thisArg Optional calling context of pureFn
33304 * @returns Updated or cached value
33305 *
33306 * @codeGenApi
33307 */
33308function ɵɵpureFunction7(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) {
33309    const bindingIndex = getBindingRoot() + slotOffset;
33310    const lView = getLView();
33311    let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
33312    return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ?
33313        updateBinding(lView, bindingIndex + 7, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) :
33314            pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) :
33315        getBinding(lView, bindingIndex + 7);
33316}
33317/**
33318 * If the value of any provided exp has changed, calls the pure function to return
33319 * an updated value. Or if no values have changed, returns cached value.
33320 *
33321 * @param slotOffset the offset from binding root to the reserved slot
33322 * @param pureFn
33323 * @param exp1
33324 * @param exp2
33325 * @param exp3
33326 * @param exp4
33327 * @param exp5
33328 * @param exp6
33329 * @param exp7
33330 * @param exp8
33331 * @param thisArg Optional calling context of pureFn
33332 * @returns Updated or cached value
33333 *
33334 * @codeGenApi
33335 */
33336function ɵɵpureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) {
33337    const bindingIndex = getBindingRoot() + slotOffset;
33338    const lView = getLView();
33339    const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
33340    return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ?
33341        updateBinding(lView, bindingIndex + 8, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) :
33342            pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) :
33343        getBinding(lView, bindingIndex + 8);
33344}
33345/**
33346 * pureFunction instruction that can support any number of bindings.
33347 *
33348 * If the value of any provided exp has changed, calls the pure function to return
33349 * an updated value. Or if no values have changed, returns cached value.
33350 *
33351 * @param slotOffset the offset from binding root to the reserved slot
33352 * @param pureFn A pure function that takes binding values and builds an object or array
33353 * containing those values.
33354 * @param exps An array of binding values
33355 * @param thisArg Optional calling context of pureFn
33356 * @returns Updated or cached value
33357 *
33358 * @codeGenApi
33359 */
33360function ɵɵpureFunctionV(slotOffset, pureFn, exps, thisArg) {
33361    return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);
33362}
33363/**
33364 * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized
33365 * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first
33366 * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE
33367 * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert
33368 * it to `undefined`.
33369 */
33370function getPureFunctionReturnValue(lView, returnValueIndex) {
33371    ngDevMode && assertIndexInRange(lView, returnValueIndex);
33372    const lastReturnValue = lView[returnValueIndex];
33373    return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue;
33374}
33375/**
33376 * If the value of the provided exp has changed, calls the pure function to return
33377 * an updated value. Or if the value has not changed, returns cached value.
33378 *
33379 * @param lView LView in which the function is being executed.
33380 * @param bindingRoot Binding root index.
33381 * @param slotOffset the offset from binding root to the reserved slot
33382 * @param pureFn Function that returns an updated value
33383 * @param exp Updated expression value
33384 * @param thisArg Optional calling context of pureFn
33385 * @returns Updated or cached value
33386 */
33387function pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, thisArg) {
33388    const bindingIndex = bindingRoot + slotOffset;
33389    return bindingUpdated(lView, bindingIndex, exp) ?
33390        updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) :
33391        getPureFunctionReturnValue(lView, bindingIndex + 1);
33392}
33393/**
33394 * If the value of any provided exp has changed, calls the pure function to return
33395 * an updated value. Or if no values have changed, returns cached value.
33396 *
33397 * @param lView LView in which the function is being executed.
33398 * @param bindingRoot Binding root index.
33399 * @param slotOffset the offset from binding root to the reserved slot
33400 * @param pureFn
33401 * @param exp1
33402 * @param exp2
33403 * @param thisArg Optional calling context of pureFn
33404 * @returns Updated or cached value
33405 */
33406function pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, thisArg) {
33407    const bindingIndex = bindingRoot + slotOffset;
33408    return bindingUpdated2(lView, bindingIndex, exp1, exp2) ?
33409        updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) :
33410        getPureFunctionReturnValue(lView, bindingIndex + 2);
33411}
33412/**
33413 * If the value of any provided exp has changed, calls the pure function to return
33414 * an updated value. Or if no values have changed, returns cached value.
33415 *
33416 * @param lView LView in which the function is being executed.
33417 * @param bindingRoot Binding root index.
33418 * @param slotOffset the offset from binding root to the reserved slot
33419 * @param pureFn
33420 * @param exp1
33421 * @param exp2
33422 * @param exp3
33423 * @param thisArg Optional calling context of pureFn
33424 * @returns Updated or cached value
33425 */
33426function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {
33427    const bindingIndex = bindingRoot + slotOffset;
33428    return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?
33429        updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :
33430        getPureFunctionReturnValue(lView, bindingIndex + 3);
33431}
33432/**
33433 * If the value of any provided exp has changed, calls the pure function to return
33434 * an updated value. Or if no values have changed, returns cached value.
33435 *
33436 * @param lView LView in which the function is being executed.
33437 * @param bindingRoot Binding root index.
33438 * @param slotOffset the offset from binding root to the reserved slot
33439 * @param pureFn
33440 * @param exp1
33441 * @param exp2
33442 * @param exp3
33443 * @param exp4
33444 * @param thisArg Optional calling context of pureFn
33445 * @returns Updated or cached value
33446 *
33447 */
33448function pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {
33449    const bindingIndex = bindingRoot + slotOffset;
33450    return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ?
33451        updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) :
33452        getPureFunctionReturnValue(lView, bindingIndex + 4);
33453}
33454/**
33455 * pureFunction instruction that can support any number of bindings.
33456 *
33457 * If the value of any provided exp has changed, calls the pure function to return
33458 * an updated value. Or if no values have changed, returns cached value.
33459 *
33460 * @param lView LView in which the function is being executed.
33461 * @param bindingRoot Binding root index.
33462 * @param slotOffset the offset from binding root to the reserved slot
33463 * @param pureFn A pure function that takes binding values and builds an object or array
33464 * containing those values.
33465 * @param exps An array of binding values
33466 * @param thisArg Optional calling context of pureFn
33467 * @returns Updated or cached value
33468 */
33469function pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thisArg) {
33470    let bindingIndex = bindingRoot + slotOffset;
33471    let different = false;
33472    for (let i = 0; i < exps.length; i++) {
33473        bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);
33474    }
33475    return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) :
33476        getPureFunctionReturnValue(lView, bindingIndex);
33477}
33478
33479/**
33480 * @license
33481 * Copyright Google LLC All Rights Reserved.
33482 *
33483 * Use of this source code is governed by an MIT-style license that can be
33484 * found in the LICENSE file at https://angular.io/license
33485 */
33486/**
33487 * Create a pipe.
33488 *
33489 * @param index Pipe index where the pipe will be stored.
33490 * @param pipeName The name of the pipe
33491 * @returns T the instance of the pipe.
33492 *
33493 * @codeGenApi
33494 */
33495function ɵɵpipe(index, pipeName) {
33496    const tView = getTView();
33497    let pipeDef;
33498    const adjustedIndex = index + HEADER_OFFSET;
33499    if (tView.firstCreatePass) {
33500        pipeDef = getPipeDef$1(pipeName, tView.pipeRegistry);
33501        tView.data[adjustedIndex] = pipeDef;
33502        if (pipeDef.onDestroy) {
33503            (tView.destroyHooks || (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy);
33504        }
33505    }
33506    else {
33507        pipeDef = tView.data[adjustedIndex];
33508    }
33509    const pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true));
33510    const previousInjectImplementation = setInjectImplementation(ɵɵdirectiveInject);
33511    try {
33512        // DI for pipes is supposed to behave like directives when placed on a component
33513        // host node, which means that we have to disable access to `viewProviders`.
33514        const previousIncludeViewProviders = setIncludeViewProviders(false);
33515        const pipeInstance = pipeFactory();
33516        setIncludeViewProviders(previousIncludeViewProviders);
33517        store(tView, getLView(), adjustedIndex, pipeInstance);
33518        return pipeInstance;
33519    }
33520    finally {
33521        // we have to restore the injector implementation in finally, just in case the creation of the
33522        // pipe throws an error.
33523        setInjectImplementation(previousInjectImplementation);
33524    }
33525}
33526/**
33527 * Searches the pipe registry for a pipe with the given name. If one is found,
33528 * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.
33529 *
33530 * @param name Name of pipe to resolve
33531 * @param registry Full list of available pipes
33532 * @returns Matching PipeDef
33533 */
33534function getPipeDef$1(name, registry) {
33535    if (registry) {
33536        for (let i = registry.length - 1; i >= 0; i--) {
33537            const pipeDef = registry[i];
33538            if (name === pipeDef.name) {
33539                return pipeDef;
33540            }
33541        }
33542    }
33543    throw new RuntimeError("302" /* PIPE_NOT_FOUND */, `The pipe '${name}' could not be found!`);
33544}
33545/**
33546 * Invokes a pipe with 1 arguments.
33547 *
33548 * This instruction acts as a guard to {@link PipeTransform#transform} invoking
33549 * the pipe only when an input to the pipe changes.
33550 *
33551 * @param index Pipe index where the pipe was stored on creation.
33552 * @param slotOffset the offset in the reserved slot space
33553 * @param v1 1st argument to {@link PipeTransform#transform}.
33554 *
33555 * @codeGenApi
33556 */
33557function ɵɵpipeBind1(index, slotOffset, v1) {
33558    const adjustedIndex = index + HEADER_OFFSET;
33559    const lView = getLView();
33560    const pipeInstance = load(lView, adjustedIndex);
33561    return unwrapValue$1(lView, isPure(lView, adjustedIndex) ?
33562        pureFunction1Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, pipeInstance) :
33563        pipeInstance.transform(v1));
33564}
33565/**
33566 * Invokes a pipe with 2 arguments.
33567 *
33568 * This instruction acts as a guard to {@link PipeTransform#transform} invoking
33569 * the pipe only when an input to the pipe changes.
33570 *
33571 * @param index Pipe index where the pipe was stored on creation.
33572 * @param slotOffset the offset in the reserved slot space
33573 * @param v1 1st argument to {@link PipeTransform#transform}.
33574 * @param v2 2nd argument to {@link PipeTransform#transform}.
33575 *
33576 * @codeGenApi
33577 */
33578function ɵɵpipeBind2(index, slotOffset, v1, v2) {
33579    const adjustedIndex = index + HEADER_OFFSET;
33580    const lView = getLView();
33581    const pipeInstance = load(lView, adjustedIndex);
33582    return unwrapValue$1(lView, isPure(lView, adjustedIndex) ?
33583        pureFunction2Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, pipeInstance) :
33584        pipeInstance.transform(v1, v2));
33585}
33586/**
33587 * Invokes a pipe with 3 arguments.
33588 *
33589 * This instruction acts as a guard to {@link PipeTransform#transform} invoking
33590 * the pipe only when an input to the pipe changes.
33591 *
33592 * @param index Pipe index where the pipe was stored on creation.
33593 * @param slotOffset the offset in the reserved slot space
33594 * @param v1 1st argument to {@link PipeTransform#transform}.
33595 * @param v2 2nd argument to {@link PipeTransform#transform}.
33596 * @param v3 4rd argument to {@link PipeTransform#transform}.
33597 *
33598 * @codeGenApi
33599 */
33600function ɵɵpipeBind3(index, slotOffset, v1, v2, v3) {
33601    const adjustedIndex = index + HEADER_OFFSET;
33602    const lView = getLView();
33603    const pipeInstance = load(lView, adjustedIndex);
33604    return unwrapValue$1(lView, isPure(lView, adjustedIndex) ? pureFunction3Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) :
33605        pipeInstance.transform(v1, v2, v3));
33606}
33607/**
33608 * Invokes a pipe with 4 arguments.
33609 *
33610 * This instruction acts as a guard to {@link PipeTransform#transform} invoking
33611 * the pipe only when an input to the pipe changes.
33612 *
33613 * @param index Pipe index where the pipe was stored on creation.
33614 * @param slotOffset the offset in the reserved slot space
33615 * @param v1 1st argument to {@link PipeTransform#transform}.
33616 * @param v2 2nd argument to {@link PipeTransform#transform}.
33617 * @param v3 3rd argument to {@link PipeTransform#transform}.
33618 * @param v4 4th argument to {@link PipeTransform#transform}.
33619 *
33620 * @codeGenApi
33621 */
33622function ɵɵpipeBind4(index, slotOffset, v1, v2, v3, v4) {
33623    const adjustedIndex = index + HEADER_OFFSET;
33624    const lView = getLView();
33625    const pipeInstance = load(lView, adjustedIndex);
33626    return unwrapValue$1(lView, isPure(lView, adjustedIndex) ? pureFunction4Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) :
33627        pipeInstance.transform(v1, v2, v3, v4));
33628}
33629/**
33630 * Invokes a pipe with variable number of arguments.
33631 *
33632 * This instruction acts as a guard to {@link PipeTransform#transform} invoking
33633 * the pipe only when an input to the pipe changes.
33634 *
33635 * @param index Pipe index where the pipe was stored on creation.
33636 * @param slotOffset the offset in the reserved slot space
33637 * @param values Array of arguments to pass to {@link PipeTransform#transform} method.
33638 *
33639 * @codeGenApi
33640 */
33641function ɵɵpipeBindV(index, slotOffset, values) {
33642    const adjustedIndex = index + HEADER_OFFSET;
33643    const lView = getLView();
33644    const pipeInstance = load(lView, adjustedIndex);
33645    return unwrapValue$1(lView, isPure(lView, adjustedIndex) ?
33646        pureFunctionVInternal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance) :
33647        pipeInstance.transform.apply(pipeInstance, values));
33648}
33649function isPure(lView, index) {
33650    return lView[TVIEW].data[index].pure;
33651}
33652/**
33653 * Unwrap the output of a pipe transformation.
33654 * In order to trick change detection into considering that the new value is always different from
33655 * the old one, the old value is overwritten by NO_CHANGE.
33656 *
33657 * @param newValue the pipe transformation output.
33658 */
33659function unwrapValue$1(lView, newValue) {
33660    if (WrappedValue.isWrapped(newValue)) {
33661        newValue = WrappedValue.unwrap(newValue);
33662        // The NO_CHANGE value needs to be written at the index where the impacted binding value is
33663        // stored
33664        const bindingToInvalidateIdx = getBindingIndex();
33665        lView[bindingToInvalidateIdx] = NO_CHANGE;
33666    }
33667    return newValue;
33668}
33669
33670/**
33671 * @license
33672 * Copyright Google LLC All Rights Reserved.
33673 *
33674 * Use of this source code is governed by an MIT-style license that can be
33675 * found in the LICENSE file at https://angular.io/license
33676 */
33677class EventEmitter_ extends rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"] {
33678    constructor(isAsync = false) {
33679        super();
33680        this.__isAsync = isAsync;
33681    }
33682    emit(value) {
33683        super.next(value);
33684    }
33685    subscribe(observerOrNext, error, complete) {
33686        var _a, _b, _c;
33687        let nextFn = observerOrNext;
33688        let errorFn = error || (() => null);
33689        let completeFn = complete;
33690        if (observerOrNext && typeof observerOrNext === 'object') {
33691            const observer = observerOrNext;
33692            nextFn = (_a = observer.next) === null || _a === void 0 ? void 0 : _a.bind(observer);
33693            errorFn = (_b = observer.error) === null || _b === void 0 ? void 0 : _b.bind(observer);
33694            completeFn = (_c = observer.complete) === null || _c === void 0 ? void 0 : _c.bind(observer);
33695        }
33696        if (this.__isAsync) {
33697            errorFn = _wrapInTimeout(errorFn);
33698            if (nextFn) {
33699                nextFn = _wrapInTimeout(nextFn);
33700            }
33701            if (completeFn) {
33702                completeFn = _wrapInTimeout(completeFn);
33703            }
33704        }
33705        const sink = super.subscribe({ next: nextFn, error: errorFn, complete: completeFn });
33706        if (observerOrNext instanceof rxjs__WEBPACK_IMPORTED_MODULE_0__["Subscription"]) {
33707            observerOrNext.add(sink);
33708        }
33709        return sink;
33710    }
33711}
33712function _wrapInTimeout(fn) {
33713    return (value) => {
33714        setTimeout(fn, undefined, value);
33715    };
33716}
33717/**
33718 * @publicApi
33719 */
33720const EventEmitter = EventEmitter_;
33721
33722/**
33723 * @license
33724 * Copyright Google LLC All Rights Reserved.
33725 *
33726 * Use of this source code is governed by an MIT-style license that can be
33727 * found in the LICENSE file at https://angular.io/license
33728 */
33729function symbolIterator() {
33730    return this._results[getSymbolIterator()]();
33731}
33732/**
33733 * An unmodifiable list of items that Angular keeps up to date when the state
33734 * of the application changes.
33735 *
33736 * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}
33737 * provide.
33738 *
33739 * Implements an iterable interface, therefore it can be used in both ES6
33740 * javascript `for (var i of items)` loops as well as in Angular templates with
33741 * `*ngFor="let i of myList"`.
33742 *
33743 * Changes can be observed by subscribing to the changes `Observable`.
33744 *
33745 * NOTE: In the future this class will implement an `Observable` interface.
33746 *
33747 * @usageNotes
33748 * ### Example
33749 * ```typescript
33750 * @Component({...})
33751 * class Container {
33752 *   @ViewChildren(Item) items:QueryList<Item>;
33753 * }
33754 * ```
33755 *
33756 * @publicApi
33757 */
33758class QueryList {
33759    /**
33760     * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
33761     *     has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in
33762     *     the same result) This is set to `false` for backwards compatibility but will be changed to
33763     *     true in v12.
33764     */
33765    constructor(_emitDistinctChangesOnly = false) {
33766        this._emitDistinctChangesOnly = _emitDistinctChangesOnly;
33767        this.dirty = true;
33768        this._results = [];
33769        this._changesDetected = false;
33770        this._changes = null;
33771        this.length = 0;
33772        this.first = undefined;
33773        this.last = undefined;
33774        // This function should be declared on the prototype, but doing so there will cause the class
33775        // declaration to have side-effects and become not tree-shakable. For this reason we do it in
33776        // the constructor.
33777        // [getSymbolIterator()](): Iterator<T> { ... }
33778        const symbol = getSymbolIterator();
33779        const proto = QueryList.prototype;
33780        if (!proto[symbol])
33781            proto[symbol] = symbolIterator;
33782    }
33783    /**
33784     * Returns `Observable` of `QueryList` notifying the subscriber of changes.
33785     */
33786    get changes() {
33787        return this._changes || (this._changes = new EventEmitter());
33788    }
33789    /**
33790     * Returns the QueryList entry at `index`.
33791     */
33792    get(index) {
33793        return this._results[index];
33794    }
33795    /**
33796     * See
33797     * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
33798     */
33799    map(fn) {
33800        return this._results.map(fn);
33801    }
33802    /**
33803     * See
33804     * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
33805     */
33806    filter(fn) {
33807        return this._results.filter(fn);
33808    }
33809    /**
33810     * See
33811     * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
33812     */
33813    find(fn) {
33814        return this._results.find(fn);
33815    }
33816    /**
33817     * See
33818     * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
33819     */
33820    reduce(fn, init) {
33821        return this._results.reduce(fn, init);
33822    }
33823    /**
33824     * See
33825     * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
33826     */
33827    forEach(fn) {
33828        this._results.forEach(fn);
33829    }
33830    /**
33831     * See
33832     * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
33833     */
33834    some(fn) {
33835        return this._results.some(fn);
33836    }
33837    /**
33838     * Returns a copy of the internal results list as an Array.
33839     */
33840    toArray() {
33841        return this._results.slice();
33842    }
33843    toString() {
33844        return this._results.toString();
33845    }
33846    /**
33847     * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that
33848     * on change detection, it will not notify of changes to the queries, unless a new change
33849     * occurs.
33850     *
33851     * @param resultsTree The query results to store
33852     * @param identityAccessor Optional function for extracting stable object identity from a value
33853     *    in the array. This function is executed for each element of the query result list while
33854     *    comparing current query list with the new one (provided as a first argument of the `reset`
33855     *    function) to detect if the lists are different. If the function is not provided, elements
33856     *    are compared as is (without any pre-processing).
33857     */
33858    reset(resultsTree, identityAccessor) {
33859        // Cast to `QueryListInternal` so that we can mutate fields which are readonly for the usage of
33860        // QueryList (but not for QueryList itself.)
33861        const self = this;
33862        self.dirty = false;
33863        const newResultFlat = flatten(resultsTree);
33864        if (this._changesDetected = !arrayEquals(self._results, newResultFlat, identityAccessor)) {
33865            self._results = newResultFlat;
33866            self.length = newResultFlat.length;
33867            self.last = newResultFlat[this.length - 1];
33868            self.first = newResultFlat[0];
33869        }
33870    }
33871    /**
33872     * Triggers a change event by emitting on the `changes` {@link EventEmitter}.
33873     */
33874    notifyOnChanges() {
33875        if (this._changes && (this._changesDetected || !this._emitDistinctChangesOnly))
33876            this._changes.emit(this);
33877    }
33878    /** internal */
33879    setDirty() {
33880        this.dirty = true;
33881    }
33882    /** internal */
33883    destroy() {
33884        this.changes.complete();
33885        this.changes.unsubscribe();
33886    }
33887}
33888
33889/**
33890 * @license
33891 * Copyright Google LLC All Rights Reserved.
33892 *
33893 * Use of this source code is governed by an MIT-style license that can be
33894 * found in the LICENSE file at https://angular.io/license
33895 */
33896// Note: This hack is necessary so we don't erroneously get a circular dependency
33897// failure based on types.
33898const unusedValueExportToPlacateAjd$7 = 1;
33899
33900/**
33901 * @license
33902 * Copyright Google LLC All Rights Reserved.
33903 *
33904 * Use of this source code is governed by an MIT-style license that can be
33905 * found in the LICENSE file at https://angular.io/license
33906 */
33907// Note: This hack is necessary so we don't erroneously get a circular dependency
33908// failure based on types.
33909const unusedValueExportToPlacateAjd$8 = 1;
33910
33911/**
33912 * @license
33913 * Copyright Google LLC All Rights Reserved.
33914 *
33915 * Use of this source code is governed by an MIT-style license that can be
33916 * found in the LICENSE file at https://angular.io/license
33917 */
33918const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$8;
33919class LQuery_ {
33920    constructor(queryList) {
33921        this.queryList = queryList;
33922        this.matches = null;
33923    }
33924    clone() {
33925        return new LQuery_(this.queryList);
33926    }
33927    setDirty() {
33928        this.queryList.setDirty();
33929    }
33930}
33931class LQueries_ {
33932    constructor(queries = []) {
33933        this.queries = queries;
33934    }
33935    createEmbeddedView(tView) {
33936        const tQueries = tView.queries;
33937        if (tQueries !== null) {
33938            const noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;
33939            const viewLQueries = [];
33940            // An embedded view has queries propagated from a declaration view at the beginning of the
33941            // TQueries collection and up until a first content query declared in the embedded view. Only
33942            // propagated LQueries are created at this point (LQuery corresponding to declared content
33943            // queries will be instantiated from the content query instructions for each directive).
33944            for (let i = 0; i < noOfInheritedQueries; i++) {
33945                const tQuery = tQueries.getByIndex(i);
33946                const parentLQuery = this.queries[tQuery.indexInDeclarationView];
33947                viewLQueries.push(parentLQuery.clone());
33948            }
33949            return new LQueries_(viewLQueries);
33950        }
33951        return null;
33952    }
33953    insertView(tView) {
33954        this.dirtyQueriesWithMatches(tView);
33955    }
33956    detachView(tView) {
33957        this.dirtyQueriesWithMatches(tView);
33958    }
33959    dirtyQueriesWithMatches(tView) {
33960        for (let i = 0; i < this.queries.length; i++) {
33961            if (getTQuery(tView, i).matches !== null) {
33962                this.queries[i].setDirty();
33963            }
33964        }
33965    }
33966}
33967class TQueryMetadata_ {
33968    constructor(predicate, flags, read = null) {
33969        this.predicate = predicate;
33970        this.flags = flags;
33971        this.read = read;
33972    }
33973}
33974class TQueries_ {
33975    constructor(queries = []) {
33976        this.queries = queries;
33977    }
33978    elementStart(tView, tNode) {
33979        ngDevMode &&
33980            assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');
33981        for (let i = 0; i < this.queries.length; i++) {
33982            this.queries[i].elementStart(tView, tNode);
33983        }
33984    }
33985    elementEnd(tNode) {
33986        for (let i = 0; i < this.queries.length; i++) {
33987            this.queries[i].elementEnd(tNode);
33988        }
33989    }
33990    embeddedTView(tNode) {
33991        let queriesForTemplateRef = null;
33992        for (let i = 0; i < this.length; i++) {
33993            const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0;
33994            const tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex);
33995            if (tqueryClone) {
33996                tqueryClone.indexInDeclarationView = i;
33997                if (queriesForTemplateRef !== null) {
33998                    queriesForTemplateRef.push(tqueryClone);
33999                }
34000                else {
34001                    queriesForTemplateRef = [tqueryClone];
34002                }
34003            }
34004        }
34005        return queriesForTemplateRef !== null ? new TQueries_(queriesForTemplateRef) 
vendor: 14,610 bytes, lines 34005-34366
34005: null;
34006    }
34007    template(tView, tNode) {
34008        ngDevMode &&
34009            assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');
34010        for (let i = 0; i < this.queries.length; i++) {
34011            this.queries[i].template(tView, tNode);
34012        }
34013    }
34014    getByIndex(index) {
34015        ngDevMode && assertIndexInRange(this.queries, index);
34016        return this.queries[index];
34017    }
34018    get length() {
34019        return this.queries.length;
34020    }
34021    track(tquery) {
34022        this.queries.push(tquery);
34023    }
34024}
34025class TQuery_ {
34026    constructor(metadata, nodeIndex = -1) {
34027        this.metadata = metadata;
34028        this.matches = null;
34029        this.indexInDeclarationView = -1;
34030        this.crossesNgTemplate = false;
34031        /**
34032         * A flag indicating if a given query still applies to nodes it is crossing. We use this flag
34033         * (alongside with _declarationNodeIndex) to know when to stop applying content queries to
34034         * elements in a template.
34035         */
34036        this._appliesToNextNode = true;
34037        this._declarationNodeIndex = nodeIndex;
34038    }
34039    elementStart(tView, tNode) {
34040        if (this.isApplyingToNode(tNode)) {
34041            this.matchTNode(tView, tNode);
34042        }
34043    }
34044    elementEnd(tNode) {
34045        if (this._declarationNodeIndex === tNode.index) {
34046            this._appliesToNextNode = false;
34047        }
34048    }
34049    template(tView, tNode) {
34050        this.elementStart(tView, tNode);
34051    }
34052    embeddedTView(tNode, childQueryIndex) {
34053        if (this.isApplyingToNode(tNode)) {
34054            this.crossesNgTemplate = true;
34055            // A marker indicating a `<ng-template>` element (a placeholder for query results from
34056            // embedded views created based on this `<ng-template>`).
34057            this.addMatch(-tNode.index, childQueryIndex);
34058            return new TQuery_(this.metadata);
34059        }
34060        return null;
34061    }
34062    isApplyingToNode(tNode) {
34063        if (this._appliesToNextNode &&
34064            (this.metadata.flags & 1 /* descendants */) !== 1 /* descendants */) {
34065            const declarationNodeIdx = this._declarationNodeIndex;
34066            let parent = tNode.parent;
34067            // Determine if a given TNode is a "direct" child of a node on which a content query was
34068            // declared (only direct children of query's host node can match with the descendants: false
34069            // option). There are 3 main use-case / conditions to consider here:
34070            // - <needs-target><i #target></i></needs-target>: here <i #target> parent node is a query
34071            // host node;
34072            // - <needs-target><ng-template [ngIf]="true"><i #target></i></ng-template></needs-target>:
34073            // here <i #target> parent node is null;
34074            // - <needs-target><ng-container><i #target></i></ng-container></needs-target>: here we need
34075            // to go past `<ng-container>` to determine <i #target> parent node (but we shouldn't traverse
34076            // up past the query's host node!).
34077            while (parent !== null && (parent.type & 8 /* ElementContainer */) &&
34078                parent.index !== declarationNodeIdx) {
34079                parent = parent.parent;
34080            }
34081            return declarationNodeIdx === (parent !== null ? parent.index : -1);
34082        }
34083        return this._appliesToNextNode;
34084    }
34085    matchTNode(tView, tNode) {
34086        const predicate = this.metadata.predicate;
34087        if (Array.isArray(predicate)) {
34088            for (let i = 0; i < predicate.length; i++) {
34089                const name = predicate[i];
34090                this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name));
34091                // Also try matching the name to a provider since strings can be used as DI tokens too.
34092                this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false));
34093            }
34094        }
34095        else {
34096            if (predicate === TemplateRef) {
34097                if (tNode.type & 4 /* Container */) {
34098                    this.matchTNodeWithReadOption(tView, tNode, -1);
34099                }
34100            }
34101            else {
34102                this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false));
34103            }
34104        }
34105    }
34106    matchTNodeWithReadOption(tView, tNode, nodeMatchIdx) {
34107        if (nodeMatchIdx !== null) {
34108            const read = this.metadata.read;
34109            if (read !== null) {
34110                if (read === ElementRef || read === ViewContainerRef ||
34111                    read === TemplateRef && (tNode.type & 4 /* Container */)) {
34112                    this.addMatch(tNode.index, -2);
34113                }
34114                else {
34115                    const directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false);
34116                    if (directiveOrProviderIdx !== null) {
34117                        this.addMatch(tNode.index, directiveOrProviderIdx);
34118                    }
34119                }
34120            }
34121            else {
34122                this.addMatch(tNode.index, nodeMatchIdx);
34123            }
34124        }
34125    }
34126    addMatch(tNodeIdx, matchIdx) {
34127        if (this.matches === null) {
34128            this.matches = [tNodeIdx, matchIdx];
34129        }
34130        else {
34131            this.matches.push(tNodeIdx, matchIdx);
34132        }
34133    }
34134}
34135/**
34136 * Iterates over local names for a given node and returns directive index
34137 * (or -1 if a local name points to an element).
34138 *
34139 * @param tNode static data of a node to check
34140 * @param selector selector to match
34141 * @returns directive index, -1 or null if a selector didn't match any of the local names
34142 */
34143function getIdxOfMatchingSelector(tNode, selector) {
34144    const localNames = tNode.localNames;
34145    if (localNames !== null) {
34146        for (let i = 0; i < localNames.length; i += 2) {
34147            if (localNames[i] === selector) {
34148                return localNames[i + 1];
34149            }
34150        }
34151    }
34152    return null;
34153}
34154function createResultByTNodeType(tNode, currentView) {
34155    if (tNode.type & (3 /* AnyRNode */ | 8 /* ElementContainer */)) {
34156        return createElementRef(tNode, currentView);
34157    }
34158    else if (tNode.type & 4 /* Container */) {
34159        return createTemplateRef(tNode, currentView);
34160    }
34161    return null;
34162}
34163function createResultForNode(lView, tNode, matchingIdx, read) {
34164    if (matchingIdx === -1) {
34165        // if read token and / or strategy is not specified, detect it using appropriate tNode type
34166        return createResultByTNodeType(tNode, lView);
34167    }
34168    else if (matchingIdx === -2) {
34169        // read a special token from a node injector
34170        return createSpecialToken(lView, tNode, read);
34171    }
34172    else {
34173        // read a token
34174        return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode);
34175    }
34176}
34177function createSpecialToken(lView, tNode, read) {
34178    if (read === ElementRef) {
34179        return createElementRef(tNode, lView);
34180    }
34181    else if (read === TemplateRef) {
34182        return createTemplateRef(tNode, lView);
34183    }
34184    else if (read === ViewContainerRef) {
34185        ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);
34186        return createContainerRef(tNode, lView);
34187    }
34188    else {
34189        ngDevMode &&
34190            throwError(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`);
34191    }
34192}
34193/**
34194 * A helper function that creates query results for a given view. This function is meant to do the
34195 * processing once and only once for a given view instance (a set of results for a given view
34196 * doesn't change).
34197 */
34198function materializeViewResults(tView, lView, tQuery, queryIndex) {
34199    const lQuery = lView[QUERIES].queries[queryIndex];
34200    if (lQuery.matches === null) {
34201        const tViewData = tView.data;
34202        const tQueryMatches = tQuery.matches;
34203        const result = [];
34204        for (let i = 0; i < tQueryMatches.length; i += 2) {
34205            const matchedNodeIdx = tQueryMatches[i];
34206            if (matchedNodeIdx < 0) {
34207                // we at the <ng-template> marker which might have results in views created based on this
34208                // <ng-template> - those results will be in separate views though, so here we just leave
34209                // null as a placeholder
34210                result.push(null);
34211            }
34212            else {
34213                ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx);
34214                const tNode = tViewData[matchedNodeIdx];
34215                result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read));
34216            }
34217        }
34218        lQuery.matches = result;
34219    }
34220    return lQuery.matches;
34221}
34222/**
34223 * A helper function that collects (already materialized) query results from a tree of views,
34224 * starting with a provided LView.
34225 */
34226function collectQueryResults(tView, lView, queryIndex, result) {
34227    const tQuery = tView.queries.getByIndex(queryIndex);
34228    const tQueryMatches = tQuery.matches;
34229    if (tQueryMatches !== null) {
34230        const lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex);
34231        for (let i = 0; i < tQueryMatches.length; i += 2) {
34232            const tNodeIdx = tQueryMatches[i];
34233            if (tNodeIdx > 0) {
34234                result.push(lViewResults[i / 2]);
34235            }
34236            else {
34237                const childQueryIndex = tQueryMatches[i + 1];
34238                const declarationLContainer = lView[-tNodeIdx];
34239                ngDevMode && assertLContainer(declarationLContainer);
34240                // collect matches for views inserted in this container
34241                for (let i = CONTAINER_HEADER_OFFSET; i < declarationLContainer.length; i++) {
34242                    const embeddedLView = declarationLContainer[i];
34243                    if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) {
34244                        collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);
34245                    }
34246                }
34247                // collect matches for views created from this declaration container and inserted into
34248                // different containers
34249                if (declarationLContainer[MOVED_VIEWS] !== null) {
34250                    const embeddedLViews = declarationLContainer[MOVED_VIEWS];
34251                    for (let i = 0; i < embeddedLViews.length; i++) {
34252                        const embeddedLView = embeddedLViews[i];
34253                        collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);
34254                    }
34255                }
34256            }
34257        }
34258    }
34259    return result;
34260}
34261/**
34262 * Refreshes a query by combining matches from all active views and removing matches from deleted
34263 * views.
34264 *
34265 * @returns `true` if a query got dirty during change detection or if this is a static query
34266 * resolving in creation mode, `false` otherwise.
34267 *
34268 * @codeGenApi
34269 */
34270function ɵɵqueryRefresh(queryList) {
34271    const lView = getLView();
34272    const tView = getTView();
34273    const queryIndex = getCurrentQueryIndex();
34274    setCurrentQueryIndex(queryIndex + 1);
34275    const tQuery = getTQuery(tView, queryIndex);
34276    if (queryList.dirty &&
34277        (isCreationMode(lView) ===
34278            ((tQuery.metadata.flags & 2 /* isStatic */) === 2 /* isStatic */))) {
34279        if (tQuery.matches === null) {
34280            queryList.reset([]);
34281        }
34282        else {
34283            const result = tQuery.crossesNgTemplate ?
34284                collectQueryResults(tView, lView, queryIndex, []) :
34285                materializeViewResults(tView, lView, tQuery, queryIndex);
34286            queryList.reset(result, unwrapElementRef);
34287            queryList.notifyOnChanges();
34288        }
34289        return true;
34290    }
34291    return false;
34292}
34293/**
34294 * Creates new QueryList, stores the reference in LView and returns QueryList.
34295 *
34296 * @param predicate The type for which the query will search
34297 * @param flags Flags associated with the query
34298 * @param read What to save in the query
34299 *
34300 * @codeGenApi
34301 */
34302function ɵɵviewQuery(predicate, flags, read) {
34303    ngDevMode && assertNumber(flags, 'Expecting flags');
34304    const tView = getTView();
34305    if (tView.firstCreatePass) {
34306        createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);
34307        if ((flags & 2 /* isStatic */) === 2 /* isStatic */) {
34308            tView.staticViewQueries = true;
34309        }
34310    }
34311    createLQuery(tView, getLView(), flags);
34312}
34313/**
34314 * Registers a QueryList, associated with a content query, for later refresh (part of a view
34315 * refresh).
34316 *
34317 * @param directiveIndex Current directive index
34318 * @param predicate The type for which the query will search
34319 * @param flags Flags associated with the query
34320 * @param read What to save in the query
34321 * @returns QueryList<T>
34322 *
34323 * @codeGenApi
34324 */
34325function ɵɵcontentQuery(directiveIndex, predicate, flags, read) {
34326    ngDevMode && assertNumber(flags, 'Expecting flags');
34327    const tView = getTView();
34328    if (tView.firstCreatePass) {
34329        const tNode = getCurrentTNode();
34330        createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);
34331        saveContentQueryAndDirectiveIndex(tView, directiveIndex);
34332        if ((flags & 2 /* isStatic */) === 2 /* isStatic */) {
34333            tView.staticContentQueries = true;
34334        }
34335    }
34336    createLQuery(tView, getLView(), flags);
34337}
34338/**
34339 * Loads a QueryList corresponding to the current view or content query.
34340 *
34341 * @codeGenApi
34342 */
34343function ɵɵloadQuery() {
34344    return loadQueryInternal(getLView(), getCurrentQueryIndex());
34345}
34346function loadQueryInternal(lView, queryIndex) {
34347    ngDevMode &&
34348        assertDefined(lView[QUERIES], 'LQueries should be defined when trying to load a query');
34349    ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex);
34350    return lView[QUERIES].queries[queryIndex].queryList;
34351}
34352function createLQuery(tView, lView, flags) {
34353    const queryList = new QueryList((flags & 4 /* emitDistinctChangesOnly */) === 4 /* emitDistinctChangesOnly */);
34354    storeCleanupWithContext(tView, lView, queryList, queryList.destroy);
34355    if (lView[QUERIES] === null)
34356        lView[QUERIES] = new LQueries_();
34357    lView[QUERIES].queries.push(new LQuery_(queryList));
34358}
34359function createTQuery(tView, metadata, nodeIndex) {
34360    if (tView.queries === null)
34361        tView.queries = new TQueries_();
34362    tView.queries.track(new TQuery_(metadata, nodeIndex));
34363}
34364function saveContentQueryAndDirectiveIndex(tView, directiveIndex) {
34365    const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);
34366    const lastSavedDirectiveIndex = tViewContentQueries.length ? tViewContentQueries[tViewContentQueries.length - 1] : 
34366-1;
34367    if (directiveIndex !== lastSavedDirectiveIndex) {
34368        tViewContentQueries.push(tView.queries.length - 1, directiveIndex);
34369    }
34370}
34371function getTQuery(tView, index) {
34372    ngDevMode && assertDefined(tView.queries, 'TQueries must be defined to retrieve a TQuery');
34373    return tView.queries.getByIndex(index);
34374}
34375
34376/**
34377 * @license
34378 * Copyright Google LLC All Rights Reserved.
34379 *
34380 * Use of this source code is governed by an MIT-style license that can be
34381 * found in the LICENSE file at https://angular.io/license
34382 */
34383/**
34384 * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the
34385 * `<ng-template>` element.
34386 *
34387 * @codeGenApi
34388 */
34389function ɵɵtemplateRefExtractor(tNode, lView) {
34390    return createTemplateRef(tNode, lView);
34391}
34392/**
34393 * Returns the appropriate `ChangeDetectorRef` for a pipe.
34394 *
34395 * @codeGenApi
34396 */
34397function ɵɵinjectPipeChangeDetectorRef(flags = InjectFlags.Default) {
34398    const value = injectChangeDetectorRef(true);
34399    if (value == null && !(flags & InjectFlags.Optional)) {
34400        throwProviderNotFoundError('ChangeDetectorRef');
34401    }
34402    else {
34403        return value;
34404    }
34405}
34406
34407/**
34408 * @license
34409 * Copyright Google LLC All Rights Reserved.
34410 *
34411 * Use of this source code is governed by an MIT-style license that can be
34412 * found in the LICENSE file at https://angular.io/license
34413 */
34414
34415/**
34416 * @license
34417 * Copyright Google LLC All Rights Reserved.
34418 *
34419 * Use of this source code is governed by an MIT-style license that can be
34420 * found in the LICENSE file at https://angular.io/license
34421 */
34422const ɵ0$c = () => ({
34423    'ɵɵattribute': ɵɵattribute,
34424    'ɵɵattributeInterpolate1': ɵɵattributeInterpolate1,
34425    'ɵɵattributeInterpolate2': ɵɵattributeInterpolate2,
34426    'ɵɵattributeInterpolate3': ɵɵattributeInterpolate3,
34427    'ɵɵattributeInterpolate4': ɵɵattributeInterpolate4,
34428    'ɵɵattributeInterpolate5': ɵɵattributeInterpolate5,
34429    'ɵɵattributeInterpolate6': ɵɵattributeInterpolate6,
34430    'ɵɵattributeInterpolate7': ɵɵattributeInterpolate7,
34431    'ɵɵattributeInterpolate8': ɵɵattributeInterpolate8,
34432    'ɵɵattributeInterpolateV': ɵɵattributeInterpolateV,
34433    'ɵɵdefineComponent': ɵɵdefineComponent,
34434    'ɵɵdefineDirective': ɵɵdefineDirective,
34435    'ɵɵdefineInjectable': ɵɵdefineInjectable,
34436    'ɵɵdefineInjector': ɵɵdefineInjector,
34437    'ɵɵdefineNgModule': ɵɵdefineNgModule,
34438    'ɵɵdefinePipe': ɵɵdefinePipe,
34439    'ɵɵdirectiveInject': ɵɵdirectiveInject,
34440    'ɵɵgetInheritedFactory': ɵɵgetInheritedFactory,
34441    'ɵɵinject': ɵɵinject,
34442    'ɵɵinjectAttribute': ɵɵinjectAttribute,
34443    'ɵɵinvalidFactory': ɵɵinvalidFactory,
34444    'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,
34445    'ɵɵinjectPipeChangeDetectorRef': ɵɵinjectPipeChangeDetectorRef,
34446    'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,
34447    'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,
34448    'ɵɵProvidersFeature': ɵɵProvidersFeature,
34449    'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,
34450    'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature,
34451    'ɵɵnextContext': ɵɵnextContext,
34452    'ɵɵnamespaceHTML': ɵɵnamespaceHTML,
34453    'ɵɵnamespaceMathML': ɵɵnamespaceMathML,
34454    'ɵɵnamespaceSVG': ɵɵnamespaceSVG,
34455    'ɵɵenableBindings': ɵɵenableBindings,
34456    'ɵɵdisableBindings': ɵɵdisableBindings,
34457    'ɵɵelementStart': ɵɵelementStart,
34458    'ɵɵelementEnd': ɵɵelementEnd,
34459    'ɵɵelement': ɵɵelement,
34460    'ɵɵelementContainerStart': ɵɵelementContainerStart,
34461    'ɵɵelementContainerEnd': ɵɵelementContainerEnd,
34462    'ɵɵelementContainer': ɵɵelementContainer,
34463    'ɵɵpureFunction0': ɵɵpureFunction0,
34464    'ɵɵpureFunction1': ɵɵpureFunction1,
34465    'ɵɵpureFunction2': ɵɵpureFunction2,
34466    'ɵɵpureFunction3': ɵɵpureFunction3,
34467    'ɵɵpureFunction4': ɵɵpureFunction4,
34468    'ɵɵpureFunction5': ɵɵpureFunction5,
34469    'ɵɵpureFunction6': ɵɵpureFunction6,
34470    'ɵɵpureFunction7': ɵɵpureFunction7,
34471    'ɵɵpureFunction8': ɵɵpureFunction8,
34472    'ɵɵpureFunctionV': ɵɵpureFunctionV,
34473    'ɵɵgetCurrentView': ɵɵgetCurrentView,
34474    'ɵɵrestoreView': ɵɵrestoreView,
34475    'ɵɵlistener': ɵɵlistener,
34476    'ɵɵprojection': ɵɵprojection,
34477    'ɵɵsyntheticHostProperty': ɵɵsyntheticHostProperty,
34478    'ɵɵsyntheticHostListener': ɵɵsyntheticHostListener,
34479    'ɵɵpipeBind1': ɵɵpipeBind1,
34480    'ɵɵpipeBind2': ɵɵpipeBind2,
34481    'ɵɵpipeBind3': ɵɵpipeBind3,
34482    'ɵɵpipeBind4': ɵɵpipeBind4,
34483    'ɵɵpipeBindV': ɵɵpipeBindV,
34484    'ɵɵprojectionDef': ɵɵprojectionDef,
34485    'ɵɵhostProperty': ɵɵhostProperty,
34486    'ɵɵproperty': ɵɵproperty,
34487    'ɵɵpropertyInterpolate': ɵɵpropertyInterpolate,
34488    'ɵɵpropertyInterpolate1': ɵɵpropertyInterpolate1,
34489    'ɵɵpropertyInterpolate2': ɵɵpropertyInterpolate2,
34490    'ɵɵpropertyInterpolate3': ɵɵpropertyInterpolate3,
34491    'ɵɵpropertyInterpolate4': ɵɵpropertyInterpolate4,
34492    'ɵɵpropertyInterpolate5': ɵɵpropertyInterpolate5,
34493    'ɵɵpropertyInterpolate6': ɵɵpropertyInterpolate6,
34494    'ɵɵpropertyInterpolate7': ɵɵpropertyInterpolate7,
34495    'ɵɵpropertyInterpolate8': ɵɵpropertyInterpolate8,
34496    'ɵɵpropertyInterpolateV': ɵɵpropertyInterpolateV,
34497    'ɵɵpipe': ɵɵpipe,
34498    'ɵɵqueryRefresh': ɵɵqueryRefresh,
34499    'ɵɵviewQuery': ɵɵviewQuery,
34500    'ɵɵloadQuery': ɵɵloadQuery,
34501    'ɵɵcontentQuery': ɵɵcontentQuery,
34502    'ɵɵreference': ɵɵreference,
34503    'ɵɵclassMap': ɵɵclassMap,
34504    'ɵɵclassMapInterpolate1': ɵɵclassMapInterpolate1,
34505    'ɵɵclassMapInterpolate2': ɵɵclassMapInterpolate2,
34506    'ɵɵclassMapInterpolate3': ɵɵclassMapInterpolate3,
34507    'ɵɵclassMapInterpolate4': ɵɵclassMapInterpolate4,
34508    'ɵɵclassMapInterpolate5': ɵɵclassMapInterpolate5,
34509    'ɵɵclassMapInterpolate6': ɵɵclassMapInterpolate6,
34510    'ɵɵclassMapInterpolate7': ɵɵclassMapInterpolate7,
34511    'ɵɵclassMapInterpolate8': ɵɵclassMapInterpolate8,
34512    'ɵɵclassMapInterpolateV': ɵɵclassMapInterpolateV,
34513    'ɵɵstyleMap': ɵɵstyleMap,
34514    'ɵɵstyleMapInterpolate1': ɵɵstyleMapInterpolate1,
34515    'ɵɵstyleMapInterpolate2': ɵɵstyleMapInterpolate2,
34516    'ɵɵstyleMapInterpolate3': ɵɵstyleMapInterpolate3,
34517    'ɵɵstyleMapInterpolate4': ɵɵstyleMapInterpolate4,
34518    'ɵɵstyleMapInterpolate5': ɵɵstyleMapInterpolate5,
34519    'ɵɵstyleMapInterpolate6': ɵɵstyleMapInterpolate6,
34520    'ɵɵstyleMapInterpolate7': ɵɵstyleMapInterpolate7,
34521    'ɵɵstyleMapInterpolate8': ɵɵstyleMapInterpolate8,
34522    'ɵɵstyleMapInterpolateV': ɵɵstyleMapInterpolateV,
34523    'ɵɵstyleProp': ɵɵstyleProp,
34524    'ɵɵstylePropInterpolate1': ɵɵstylePropInterpolate1,
34525    'ɵɵstylePropInterpolate2': ɵɵstylePropInterpolate2,
34526    'ɵɵstylePropInterpolate3': ɵɵstylePropInterpolate3,
34527    'ɵɵstylePropInterpolate4': ɵɵstylePropInterpolate4,
34528    'ɵɵstylePropInterpolate5': ɵɵstylePropInterpolate5,
34529    'ɵɵstylePropInterpolate6': ɵɵstylePropInterpolate6,
34530    'ɵɵstylePropInterpolate7': ɵɵstylePropInterpolate7,
34531    'ɵɵstylePropInterpolate8': ɵɵstylePropInterpolate8,
34532    'ɵɵstylePropInterpolateV': ɵɵstylePropInterpolateV,
34533    'ɵɵclassProp': ɵɵclassProp,
34534    'ɵɵadvance': ɵɵadvance,
34535    'ɵɵtemplate': ɵɵtemplate,
34536    'ɵɵtext': ɵɵtext,
34537    'ɵɵtextInterpolate': ɵɵtextInterpolate,
34538    'ɵɵtextInterpolate1': ɵɵtextInterpolate1,
34539    'ɵɵtextInterpolate2': ɵɵtextInterpolate2,
34540    'ɵɵtextInterpolate3': ɵɵtextInterpolate3,
34541    'ɵɵtextInterpolate4': ɵɵtextInterpolate4,
34542    'ɵɵtextInterpolate5': ɵɵtextInterpolate5,
34543    'ɵɵtextInterpolate6': ɵɵtextInterpolate6,
34544    'ɵɵtextInterpolate7': ɵɵtextInterpolate7,
34545    'ɵɵtextInterpolate8': ɵɵtextInterpolate8,
34546    'ɵɵtextInterpolateV': ɵɵtextInterpolateV,
34547    'ɵɵi18n': ɵɵi18n,
34548    'ɵɵi18nAttributes': ɵɵi18nAttributes,
34549    'ɵɵi18nExp': ɵɵi18nExp,
34550    'ɵɵi18nStart': ɵɵi18nStart,
34551    'ɵɵi18nEnd': ɵɵi18nEnd,
34552    'ɵɵi18nApply': ɵɵi18nApply,
34553    'ɵɵi18nPostprocess': ɵɵi18nPostprocess,
34554    'ɵɵresolveWindow': ɵɵresolveWindow,
34555    'ɵɵresolveDocument': ɵɵresolveDocument,
34556    'ɵɵresolveBody': ɵɵresolveBody,
34557    'ɵɵsetComponentScope': ɵɵsetComponentScope,
34558    'ɵɵsetNgModuleScope': ɵɵsetNgModuleScope,
34559    'ɵɵsanitizeHtml': ɵɵsanitizeHtml,
34560    'ɵɵsanitizeStyle': ɵɵsanitizeStyle,
34561    'ɵɵsanitizeResourceUrl': ɵɵsanitizeResourceUrl,
34562    'ɵɵsanitizeScript': ɵɵsanitizeScript,
34563    'ɵɵsanitizeUrl': ɵɵsanitizeUrl,
34564    'ɵɵsanitizeUrlOrResourceUrl': ɵɵsanitizeUrlOrResourceUrl,
vendor: 8,663 bytes, lines 34565-34768
34565    'ɵɵtrustConstantHtml': ɵɵtrustConstantHtml,
34566    'ɵɵtrustConstantResourceUrl': ɵɵtrustConstantResourceUrl,
34567    'forwardRef': forwardRef,
34568    'resolveForwardRef': resolveForwardRef,
34569});
34570/**
34571 * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.
34572 *
34573 * This should be kept up to date with the public exports of @angular/core.
34574 */
34575const angularCoreEnv = (ɵ0$c)();
34576
34577let jitOptions = null;
34578function setJitOptions(options) {
34579    if (jitOptions !== null) {
34580        if (options.defaultEncapsulation !== jitOptions.defaultEncapsulation) {
34581            ngDevMode &&
34582                console.error('Provided value for `defaultEncapsulation` can not be changed once it has been set.');
34583            return;
34584        }
34585        if (options.preserveWhitespaces !== jitOptions.preserveWhitespaces) {
34586            ngDevMode &&
34587                console.error('Provided value for `preserveWhitespaces` can not be changed once it has been set.');
34588            return;
34589        }
34590    }
34591    jitOptions = options;
34592}
34593function getJitOptions() {
34594    return jitOptions;
34595}
34596function resetJitOptions() {
34597    jitOptions = null;
34598}
34599
34600/**
34601 * @license
34602 * Copyright Google LLC All Rights Reserved.
34603 *
34604 * Use of this source code is governed by an MIT-style license that can be
34605 * found in the LICENSE file at https://angular.io/license
34606 */
34607const EMPTY_ARRAY$5 = [];
34608const moduleQueue = [];
34609/**
34610 * Enqueues moduleDef to be checked later to see if scope can be set on its
34611 * component declarations.
34612 */
34613function enqueueModuleForDelayedScoping(moduleType, ngModule) {
34614    moduleQueue.push({ moduleType, ngModule });
34615}
34616let flushingModuleQueue = false;
34617/**
34618 * Loops over queued module definitions, if a given module definition has all of its
34619 * declarations resolved, it dequeues that module definition and sets the scope on
34620 * its declarations.
34621 */
34622function flushModuleScopingQueueAsMuchAsPossible() {
34623    if (!flushingModuleQueue) {
34624        flushingModuleQueue = true;
34625        try {
34626            for (let i = moduleQueue.length - 1; i >= 0; i--) {
34627                const { moduleType, ngModule } = moduleQueue[i];
34628                if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {
34629                    // dequeue
34630                    moduleQueue.splice(i, 1);
34631                    setScopeOnDeclaredComponents(moduleType, ngModule);
34632                }
34633            }
34634        }
34635        finally {
34636            flushingModuleQueue = false;
34637        }
34638    }
34639}
34640/**
34641 * Returns truthy if a declaration has resolved. If the declaration happens to be
34642 * an array of declarations, it will recurse to check each declaration in that array
34643 * (which may also be arrays).
34644 */
34645function isResolvedDeclaration(declaration) {
34646    if (Array.isArray(declaration)) {
34647        return declaration.every(isResolvedDeclaration);
34648    }
34649    return !!resolveForwardRef(declaration);
34650}
34651/**
34652 * Compiles a module in JIT mode.
34653 *
34654 * This function automatically gets called when a class has a `@NgModule` decorator.
34655 */
34656function compileNgModule(moduleType, ngModule = {}) {
34657    compileNgModuleDefs(moduleType, ngModule);
34658    // Because we don't know if all declarations have resolved yet at the moment the
34659    // NgModule decorator is executing, we're enqueueing the setting of module scope
34660    // on its declarations to be run at a later time when all declarations for the module,
34661    // including forward refs, have resolved.
34662    enqueueModuleForDelayedScoping(moduleType, ngModule);
34663}
34664/**
34665 * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.
34666 *
34667 * It's possible to compile a module via this API which will allow duplicate declarations in its
34668 * root.
34669 */
34670function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInRoot = false) {
34671    ngDevMode && assertDefined(moduleType, 'Required value moduleType');
34672    ngDevMode && assertDefined(ngModule, 'Required value ngModule');
34673    const declarations = flatten(ngModule.declarations || EMPTY_ARRAY$5);
34674    let ngModuleDef = null;
34675    Object.defineProperty(moduleType, NG_MOD_DEF, {
34676        configurable: true,
34677        get: () => {
34678            if (ngModuleDef === null) {
34679                if (ngDevMode && ngModule.imports && ngModule.imports.indexOf(moduleType) > -1) {
34680                    // We need to assert this immediately, because allowing it to continue will cause it to
34681                    // go into an infinite loop before we've reached the point where we throw all the errors.
34682                    throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);
34683                }
34684                ngModuleDef = getCompilerFacade().compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, {
34685                    type: moduleType,
34686                    bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY$5).map(resolveForwardRef),
34687                    declarations: declarations.map(resolveForwardRef),
34688                    imports: flatten(ngModule.imports || EMPTY_ARRAY$5)
34689                        .map(resolveForwardRef)
34690                        .map(expandModuleWithProviders),
34691                    exports: flatten(ngModule.exports || EMPTY_ARRAY$5)
34692                        .map(resolveForwardRef)
34693                        .map(expandModuleWithProviders),
34694                    schemas: ngModule.schemas ? flatten(ngModule.schemas) : null,
34695                    id: ngModule.id || null,
34696                });
34697                // Set `schemas` on ngModuleDef to an empty array in JIT mode to indicate that runtime
34698                // should verify that there are no unknown elements in a template. In AOT mode, that check
34699                // happens at compile time and `schemas` information is not present on Component and Module
34700                // defs after compilation (so the check doesn't happen the second time at runtime).
34701                if (!ngModuleDef.schemas) {
34702                    ngModuleDef.schemas = [];
34703                }
34704            }
34705            return ngModuleDef;
34706        }
34707    });
34708    let ngFactoryDef = null;
34709    Object.defineProperty(moduleType, NG_FACTORY_DEF, {
34710        get: () => {
34711            if (ngFactoryDef === null) {
34712                const compiler = getCompilerFacade();
34713                ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/ɵfac.js`, {
34714                    name: moduleType.name,
34715                    type: moduleType,
34716                    deps: reflectDependencies(moduleType),
34717                    injectFn: 'inject',
34718                    target: compiler.R3FactoryTarget.NgModule,
34719                    typeArgumentCount: 0,
34720                });
34721            }
34722            return ngFactoryDef;
34723        },
34724        // Make the property configurable in dev mode to allow overriding in tests
34725        configurable: !!ngDevMode,
34726    });
34727    let ngInjectorDef = null;
34728    Object.defineProperty(moduleType, NG_INJ_DEF, {
34729        get: () => {
34730            if (ngInjectorDef === null) {
34731                ngDevMode &&
34732                    verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot);
34733                const meta = {
34734                    name: moduleType.name,
34735                    type: moduleType,
34736                    providers: ngModule.providers || EMPTY_ARRAY$5,
34737                    imports: [
34738                        (ngModule.imports || EMPTY_ARRAY$5).map(resolveForwardRef),
34739                        (ngModule.exports || EMPTY_ARRAY$5).map(resolveForwardRef),
34740                    ],
34741                };
34742                ngInjectorDef = getCompilerFacade().compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta);
34743            }
34744            return ngInjectorDef;
34745        },
34746        // Make the property configurable in dev mode to allow overriding in tests
34747        configurable: !!ngDevMode,
34748    });
34749}
34750function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {
34751    if (verifiedNgModule.get(moduleType))
34752        return;
34753    verifiedNgModule.set(moduleType, true);
34754    moduleType = resolveForwardRef(moduleType);
34755    let ngModuleDef;
34756    if (importingModule) {
34757        ngModuleDef = getNgModuleDef(moduleType);
34758        if (!ngModuleDef) {
34759            throw new Error(`Unexpected value '${moduleType.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);
34760        }
34761    }
34762    else {
34763        ngModuleDef = getNgModuleDef(moduleType, true);
34764    }
34765    const errors = [];
34766    const declarations = maybeUnwrapFn(ngModuleDef.declarations);
34767    const imports = maybeUnwrapFn(ngModuleDef.imports);
34768    flatten(imports).map(unwrapModuleWithProvidersImports).forEac
34768h(mod => {
34769        verifySemanticsOfNgModuleImport(mod, moduleType);
34770        verifySemanticsOfNgModuleDef(mod, false, moduleType);
34771    });
34772    const exports = maybeUnwrapFn(ngModuleDef.exports);
34773    declarations.forEach(verifyDeclarationsHaveDefinitions);
34774    declarations.forEach(verifyDirectivesHaveSelector);
34775    const combinedDeclarations = [
34776        ...declarations.map(resolveForwardRef),
34777        ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef),
34778    ];
34779    exports.forEach(verifyExportsAreDeclaredOrReExported);
34780    declarations.forEach(decl => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
34781    declarations.forEach(verifyComponentEntryComponentsIsPartOfNgModule);
34782    const ngModule = getAnnotation(moduleType, 'NgModule');
34783    if (ngModule) {
34784        ngModule.imports &&
34785            flatten(ngModule.imports).map(unwrapModuleWithProvidersImports).forEach(mod => {
34786                verifySemanticsOfNgModuleImport(mod, moduleType);
34787                verifySemanticsOfNgModuleDef(mod, false, moduleType);
34788            });
34789        ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);
34790        ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);
34791        ngModule.entryComponents &&
34792            deepForEach(ngModule.entryComponents, verifyComponentIsPartOfNgModule);
34793    }
34794    // Throw Error if any errors were detected.
34795    if (errors.length) {
34796        throw new Error(errors.join('\n'));
34797    }
34798    ////////////////////////////////////////////////////////////////////////////////////////////////
34799    function verifyDeclarationsHaveDefinitions(type) {
34800        type = resolveForwardRef(type);
34801        const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);
34802        if (!def) {
34803            errors.push(`Unexpected value '${stringifyForError(type)}' declared by the module '${stringifyForError(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`);
34804        }
34805    }
34806    function verifyDirectivesHaveSelector(type) {
34807        type = resolveForwardRef(type);
34808        const def = getDirectiveDef(type);
34809        if (!getComponentDef(type) && def && def.selectors.length == 0) {
34810            errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`);
34811        }
34812    }
34813    function verifyExportsAreDeclaredOrReExported(type) {
34814        type = resolveForwardRef(type);
34815        const kind = getComponentDef(type) && 'component' || getDirectiveDef(type) && 'directive' ||
34816            getPipeDef(type) && 'pipe';
34817        if (kind) {
34818            // only checked if we are declared as Component, Directive, or Pipe
34819            // Modules don't need to be declared or imported.
34820            if (combinedDeclarations.lastIndexOf(type) === -1) {
34821                // We are exporting something which we don't explicitly declare or import.
34822                errors.push(`Can't export ${kind} ${stringifyForError(type)} from ${stringifyForError(moduleType)} as it was neither declared nor imported!`);
34823            }
34824        }
34825    }
34826    function verifyDeclarationIsUnique(type, suppressErrors) {
34827        type = resolveForwardRef(type);
34828        const existingModule = ownerNgModule.get(type);
34829        if (existingModule && existingModule !== moduleType) {
34830            if (!suppressErrors) {
34831                const modules = [existingModule, moduleType].map(stringifyForError).sort();
34832                errors.push(`Type ${stringifyForError(type)} is part of the declarations of 2 modules: ${modules[0]} and ${modules[1]}! ` +
34833                    `Please consider moving ${stringifyForError(type)} to a higher module that imports ${modules[0]} and ${modules[1]}. ` +
34834                    `You can also create a new NgModule that exports and includes ${stringifyForError(type)} then import that NgModule in ${modules[0]} and ${modules[1]}.`);
34835            }
34836        }
34837        else {
34838            // Mark type as having owner.
34839            ownerNgModule.set(type, moduleType);
34840        }
34841    }
34842    function verifyComponentIsPartOfNgModule(type) {
34843        type = resolveForwardRef(type);
34844        const existingModule = ownerNgModule.get(type);
34845        if (!existingModule) {
34846            errors.push(`Component ${stringifyForError(type)} is not part of any NgModule or the module has not been imported into your module.`);
34847        }
34848    }
34849    function verifyCorrectBootstrapType(type) {
34850        type = resolveForwardRef(type);
34851        if (!getComponentDef(type)) {
34852            errors.push(`${stringifyForError(type)} cannot be used as an entry component.`);
34853        }
34854    }
34855    function verifyComponentEntryComponentsIsPartOfNgModule(type) {
34856        type = resolveForwardRef(type);
34857        if (getComponentDef(type)) {
34858            // We know we are component
34859            const component = getAnnotation(type, 'Component');
34860            if (component && component.entryComponents) {
34861                deepForEach(component.entryComponents, verifyComponentIsPartOfNgModule);
34862            }
34863        }
34864    }
34865    function verifySemanticsOfNgModuleImport(type, importingModule) {
34866        type = resolveForwardRef(type);
34867        if (getComponentDef(type) || getDirectiveDef(type)) {
34868            throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);
34869        }
34870        if (getPipeDef(type)) {
34871            throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);
34872        }
34873    }
34874}
34875function unwrapModuleWithProvidersImports(typeOrWithProviders) {
34876    typeOrWithProviders = resolveForwardRef(typeOrWithProviders);
34877    return typeOrWithProviders.ngModule || typeOrWithProviders;
34878}
34879function getAnnotation(type, name) {
34880    let annotation = null;
34881    collect(type.__annotations__);
34882    collect(type.decorators);
34883    return annotation;
34884    function collect(annotations) {
34885        if (annotations) {
34886            annotations.forEach(readAnnotation);
34887        }
34888    }
34889    function readAnnotation(decorator) {
34890        if (!annotation) {
34891            const proto = Object.getPrototypeOf(decorator);
34892            if (proto.ngMetadataName == name) {
34893                annotation = decorator;
34894            }
34895            else if (decorator.type) {
34896                const proto = Object.getPrototypeOf(decorator.type);
34897                if (proto.ngMetadataName == name) {
34898                    annotation = decorator.args[0];
34899                }
34900            }
34901        }
34902    }
34903}
34904/**
34905 * Keep track of compiled components. This is needed because in tests we often want to compile the
34906 * same component with more than one NgModule. This would cause an error unless we reset which
34907 * NgModule the component belongs to. We keep the list of compiled components here so that the
34908 * TestBed can reset it later.
34909 */
34910let ownerNgModule = new Map();
34911let verifiedNgModule = new Map();
34912function resetCompiledComponents() {
34913    ownerNgModule = new Map();
34914    verifiedNgModule = new Map();
34915    moduleQueue.length = 0;
34916}
34917/**
34918 * Computes the combined declarations of explicit declarations, as well as declarations inherited by
34919 * traversing the exports of imported modules.
34920 * @param type
34921 */
34922function computeCombinedExports(type) {
34923    type = resolveForwardRef(type);
34924    const ngModuleDef = getNgModuleDef(type, true);
34925    return [...flatten(maybeUnwrapFn(ngModuleDef.exports).map((type) => {
34926            const ngModuleDef = getNgModuleDef(type);
34927            if (ngModuleDef) {
34928                verifySemanticsOfNgModuleDef(type, false);
34929                return computeCombinedExports(type);
34930            }
34931            else {
34932                return type;
34933            }
34934        }))];
34935}
34936/**
34937 * Some declared components may be compiled asynchronously, and thus may not have their
34938 * ɵcmp set yet. If this is the case, then a reference to the module is written into
34939 * the `ngSelectorScope` property of the declared type.
34940 */
34941function setScopeOnDeclaredComponents(moduleType, ngModule) {
34942    const declarations = flatten(ngModule.declarations || EMPTY_ARRAY$5);
34943    const transitiveScopes = transitiveScopesFor(moduleType);
34944    declarations.forEach(declaration => {
34945        if (declaration.hasOwnProperty(NG_COMP_DEF)) {
34946            // A `ɵcmp` field exists - go ahead and patch the component directly.
34947            const component = declaration;
34948            const componentDef = getComponentDef(component);
34949            patchComponentDefWithScope(componentDef, transitiveScopes);
34950        }
34951        else if (!declaration.hasOwnProperty(NG_DIR_DEF) && !declaration.hasOwnProperty(NG_PIPE_DEF)) {
34952            // Set `ngSelectorScope` for future reference when the component compilation finishes.
34953            declaration.ngSelectorScope = moduleType;
34954        }
34955    });
34956}
34957/**
34958 * Patch the definition of a component with directives and pipes from the compilation scope of
34959 * a given module.
34960 */
34961function patchComponentDefWithScope(componentDef, transitiveScopes) {
34962    componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives)
34963        .map(dir => dir.hasOwnProperty(NG_COMP_DEF) ? getComponentDef(dir) : getDirectiveDef(dir))
34964        .filter(def => !!def);
34965    componentDef.pipeDefs = () => Array.from(transitiveScopes.compilation.pipes).map(pipe => getPipeDef(pipe));
34966    componentDef.schemas = transitiveScopes.schemas;
34967    // Since we avoid Components/Directives/Pipes recompiling in case there are no overrides, we
34968    // may face a problem where previously compiled defs available to a given Component/Directive
34969    // are cached in TView and may become stale (in case any of these defs gets recompiled). In
34970    // order to avoid this problem, we force fresh TView to be created.
34971    componentDef.tView = null;
34972}
34973/**
34974 * Compute the pair of transitive scopes (compilation scope and exported scope) for a given module.
34975 *
34976 * This operation is memoized and the result is cached on the module's definition. This function can
34977 * be called on modules with components that have not fully compiled yet, but the result should not
34978 * be used until they have.
34979 *
34980 * @param moduleType module that transitive scope should be calculated for.
34981 */
34982function transitiveScopesFor(moduleType) {
34983    if (!isNgModule(moduleType)) {
34984        throw new Error(`${moduleType.name} does not have a module def (ɵmod property)`);
34985    }
34986    const def = getNgModuleDef(moduleType);
34987    if (def.transitiveCompileScopes !== null) {
34988        return def.transitiveCompileScopes;
34989    }
34990    const scopes = {
34991        schemas: def.schemas || null,
34992        compilation: {
34993            directives: new Set(),
34994            pipes: new Set(),
34995        },
34996        exported: {
34997            directives: new Set(),
34998            pipes: new Set(),
34999        },
35000    };
35001    maybeUnwrapFn(def.imports).forEach((imported) => {
35002        const importedType = imported;
35003        if (!isNgModule(importedType)) {
35004            throw new Error(`Importing ${importedType.name} which does not have a ɵmod property`);
35005        }
35006        // When this module imports another, the imported module's exported directives and pipes are
35007        // added to the compilation scope of this module.
35008        const importedScope = transitiveScopesFor(importedType);
35009        importedScope.exported.directives.forEach(entry => scopes.compilation.directives.add(entry));
35010        importedScope.exported.pipes.forEach(entry => scopes.compilation.pipes.add(entry));
35011    });
35012    maybeUnwrapFn(def.declarations).forEach(declared => {
35013        const declaredWithDefs = declared;
35014        if (getPipeDef(declaredWithDefs)) {
35015            scopes.compilation.pipes.add(declared);
35016        }
35017        else {
35018            // Either declared has a ɵcmp or ɵdir, or it's a component which hasn't
35019            // had its template compiled yet. In either case, it gets added to the compilation's
35020            // directives.
35021            scopes.compilation.directives.add(declared);
35022        }
35023    });
35024    maybeUnwrapFn(def.exports).forEach((exported) => {
35025        const exportedType = exported;
35026        // Either the type is a module, a pipe, or a component/directive (which may not have a
35027        // ɵcmp as it might be compiled asynchronously).
35028        if (isNgModule(exportedType)) {
35029            // When this module exports another, the exported module's exported directives and pipes are
35030            // added to both the compilation and exported scopes of this module.
35031            const exportedScope = transitiveScopesFor(exportedType);
35032            exportedScope.exported.directives.forEach(entry => {
35033                scopes.compilation.directives.add(entry);
35034                scopes.exported.directives.add(entry);
35035            });
35036            exportedScope.exported.pipes.forEach(entry => {
35037                scopes.compilation.pipes.add(entry);
35038                scopes.exported.pipes.add(entry);
35039            });
35040        }
35041        else if (getPipeDef(exportedType)) {
35042            scopes.exported.pipes.add(exportedType);
35043        }
35044        else {
35045            scopes.exported.directives.add(exportedType);
35046        }
35047    });
35048    def.transitiveCompileScopes = scopes;
35049    return scopes;
35050}
35051function expandModuleWithProviders(value) {
35052    if (isModuleWithProviders(value)) {
35053        return value.ngModule;
35054    }
35055    return value;
35056}
35057function isModuleWithProviders(value) {
35058    return value.ngModule !== undefined;
35059}
35060function isNgModule(value) {
35061    return !!getNgModuleDef(value);
35062}
35063
35064/**
35065 * @license
35066 * Copyright Google LLC All Rights Reserved.
35067 *
35068 * Use of this source code is governed by an MIT-style license that can be
35069 * found in the LICENSE file at https://angular.io/license
35070 */
35071/**
35072 * Keep track of the compilation depth to avoid reentrancy issues during JIT compilation. This
35073 * matters in the following scenario:
35074 *
35075 * Consider a component 'A' that extends component 'B', both declared in module 'M'. During
35076 * the compilation of 'A' the definition of 'B' is requested to capture the inheritance chain,
35077 * potentially triggering compilation of 'B'. If this nested compilation were to trigger
35078 * `flushModuleScopingQueueAsMuchAsPossible` it may happen that module 'M' is still pending in the
35079 * queue, resulting in 'A' and 'B' to be patched with the NgModule scope. As the compilation of
35080 * 'A' is still in progress, this would introduce a circular dependency on its compilation. To avoid
35081 * this issue, the module scope queue is only flushed for compilations at the depth 0, to ensure
35082 * all compilations have finished.
35083 */
35084let compilationDepth = 0;
35085/**
35086 * Compile an Angular component according to its decorator metadata, and patch the resulting
35087 * component def (ɵcmp) onto the component type.
35088 *
35089 * Compilation may be asynchronous (due to the need to resolve URLs for the component template or
35090 * other resources, for example). In the event that compilation is not immediate, `compileComponent`
35091 * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp`
35092 * until the global queue has been resolved with a call to `resolveComponentResources`.
35093 */
35094function compileComponent(type, metadata) {
35095    // Initialize ngDevMode. This must be the first statement in compileComponent.
35096    // See the `initNgDevMode` docstring for more information.
35097    (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();
35098    let ngComponentDef = null;
35099    // Metadata may have resources which need to be resolved.
35100    maybeQueueResolutionOfComponentResources(type, metadata);
35101    // Note that we're using the same function as `Directive`, because that's only subset of metadata
35102    // that we need to create the ngFactoryDef. We're avoiding using the component metadata
35103    // because we'd have to resolve the asynchronous templates.
35104    addDirectiveFactoryDef(type, metadata);
35105    Object.defineProperty(type, NG_COMP_DEF, {
35106        get: () => {
35107            if (ngComponentDef === null) {
35108                const compiler = getCompilerFacade();
35109                if (componentNeedsResolution(metadata)) {
35110                    const error = [`Component '${type.name}' is not resolved:`];
35111                    if (metadata.templateUrl) {
35112                        error.push(` - templateUrl: ${metadata.templateUrl}`);
35113                    }
35114                    if (metadata.styleUrls && metadata.styleUrls.length) {
35115                        error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);
35116                    }
35117                    error.push(`Did you run and wait for 'resolveComponentResources()'?`);
35118                    throw new Error(error.join('\n'));
35119                }
35120                // This const was called `jitOptions` previously but had to be renamed to `options` because
35121                // of a bug with Terser that caused optimized JIT builds to throw a `ReferenceError`.
35122                // This bug was investigated in https://github.com/angular/angular-cli/issues/17264.
35123                // We should not rename it back until https://github.com/terser/terser/issues/615 is fixed.
35124                const options = getJitOptions();
35125                let preserveWhitespaces = metadata.preserveWhitespaces;
35126                if (preserveWhitespaces === undefined) {
35127                    if (options !== null && options.preserveWhitespaces !== undefined) {
35128                        preserveWhitespaces = options.preserveWhitespaces;
35129                    }
35130                    else {
35131                        preserveWhitespaces = false;
35132                    }
35133                }
35134                let encapsulation = metadata.encapsulation;
35135                if (encapsulation === undefined) {
35136                    if (options !== null && options.defaultEncapsulation !== undefined) {
35137                        encapsulation = options.defaultEncapsulation;
35138                    }
35139                    else {
35140                        encapsulation = ViewEncapsulation.Emulated;
35141                    }
35142                }
35143                const templateUrl = metadata.templateUrl || `ng:///${type.name}/template.html`;
35144                const meta = Object.assign(Object.assign({}, directiveMetadata(type, metadata)), { typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl), template: metadata.template || '', preserveWhitespaces, styles: metadata.styles || EMPTY_ARRAY$1, animations: metadata.animations, directives: [], changeDetection: metadata.changeDetection, pipes: new Map(), encapsulation, interpolation: metadata.interpolation, viewProviders: metadata.viewProviders || null });
35145                compilationDepth++;
35146                try {
35147                    if (meta.usesInheritance) {
35148                        addDirectiveDefToUndecoratedParents(type);
35149                    }
35150                    ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta);
35151                }
35152                finally {
35153                    // Ensure that the compilation depth is decremented even when the compilation failed.
35154                    compilationDepth--;
35155                }
35156                if (compilationDepth === 0) {
35157                    // When NgModule decorator executed, we enqueued the module definition such that
35158                    // it would only dequeue and add itself as module scope to all of its declarations,
35159                    // but only if  if all of its declarations had resolved. This call runs the check
35160                    // to see if any modules that are in the queue can be dequeued and add scope to
35161                    // their declarations.
35162                    flushModuleScopingQueueAsMuchAsPossible();
35163                }
35164                // If component compilation is async, then the @NgModule annotation which declares the
35165                // component may execute and set an ngSelectorScope property on the component type. This
35166                // allows the component to patch itself with directiveDefs from the module after it
35167                // finishes compiling.
35168                if (hasSelectorScope(type)) {
35169                    const scopes = transitiveScopesFor(type.ngSelectorScope);
35170                    patchComponentDefWithScope(ngComponentDef, scopes);
35171                }
35172            }
35173            return ngComponentDef;
35174        },
35175        // Make the property configurable in dev mode to allow overriding in tests
35176        configurable: !!ngDevMode,
35177    });
35178}
35179function hasSelectorScope(component) {
35180    return component.ngSelectorScope !== undefined;
35181}
35182/**
35183 * Compile an Angular directive according to its decorator metadata, and patch the resulting
35184 * directive def onto the component type.
35185 *
35186 * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which
35187 * will resolve when compilation completes and the directive becomes usable.
35188 */
35189function compileDirective(type, directive) {
35190    let ngDirectiveDef = null;
35191    addDirectiveFactoryDef(type, directive || {});
35192    Object.defineProperty(type, NG_DIR_DEF, {
35193        get: () => {
35194            if (ngDirectiveDef === null) {
35195                // `directive` can be null in the case of abstract directives as a base class
35196                // that use `@Directive()` with no selector. In that case, pass empty object to the
35197                // `directiveMetadata` function instead of null.
35198                const meta = getDirectiveMetadata(type, directive || {});
35199                ngDirectiveDef =
35200                    getCompilerFacade().compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);
35201            }
35202            return ngDirectiveDef;
35203        },
35204        // Make the property configurable in dev mode to allow overriding in tests
35205        configurable: !!ngDevMode,
35206    });
35207}
35208function getDirectiveMetadata(type, metadata) {
35209    const name = type && type.name;
35210    const sourceMapUrl = `ng:///${name}/ɵdir.js`;
35211    const compiler = getCompilerFacade();
35212    const facade = directiveMetadata(type, metadata);
35213    facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);
35214    if (facade.usesInheritance) {
35215        addDirectiveDefToUndecoratedParents(type);
35216    }
35217    return { metadata: facade, sourceMapUrl };
35218}
35219function addDirectiveFactoryDef(type, metadata) {
35220    let ngFactoryDef = null;
35221    Object.defineProperty(type, NG_FACTORY_DEF, {
35222        get: () => {
35223            if (ngFactoryDef === null) {
35224                const meta = getDirectiveMetadata(type, metadata);
35225                const compiler = getCompilerFacade();
35226                ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/ɵfac.js`, Object.assign(Object.assign({}, meta.metadata), { injectFn: 'directiveInject', target: compiler.R3FactoryTarget.Directive }));
35227            }
35228            return ngFactoryDef;
35229        },
35230        // Make the property configurable in dev mode to allow overriding in tests
35231        configurable: !!ngDevMode,
35232    });
35233}
35234function extendsDirectlyFromObject(type) {
35235    return Object.getPrototypeOf(type.prototype) === Object.prototype;
35236}
35237/**
35238 * Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a
35239 * `Component`).
35240 */
35241function directiveMetadata(type, metadata) {
35242    // Reflect inputs and outputs.
35243    const reflect = getReflect();
35244    const propMetadata = reflect.ownPropMetadata(type);
35245    return {
35246        name: type.name,
35247        type: type,
35248        typeArgumentCount: 0,
35249        selector: metadata.selector !== undefined ? metadata.selector : null,
35250        deps: reflectDependencies(type),
35251        host: metadata.host || EMPTY_OBJ,
35252        propMetadata: propMetadata,
35253        inputs: metadata.inputs || EMPTY_ARRAY$1,
35254        outputs: metadata.outputs || EMPTY_ARRAY$1,
35255        queries: extractQueriesMetadata(type, propMetadata, isContentQuery),
35256        lifecycle: { usesOnChanges: reflect.hasLifecycleHook(type, 'ngOnChanges') },
35257        typeSourceSpan: null,
35258        usesInheritance: !extendsDirectlyFromObject(type),
35259        exportAs: extractExportAs(metadata.exportAs),
35260        providers: metadata.providers || null,
35261        viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery)
35262    };
35263}
35264/**
35265 * Adds a directive definition to all parent classes of a type that don't have an Angular decorator.
35266 */
35267function addDirectiveDefToUndecoratedParents(type) {
35268    const objPrototype = Object.prototype;
35269    let parent = Object.getPrototypeOf(type.prototype).constructor;
35270    // Go up the prototype until we hit `Object`.
35271    while (parent && parent !== objPrototype) {
35272        // Since inheritance works if the class was annotated already, we only need to add
35273        // the def if there are no annotations and the def hasn't been created already.
35274        if (!getDirectiveDef(parent) && !getComponentDef(parent) &&
35275            shouldAddAbstractDirective(parent)) {
35276            compileDirective(parent, null);
35277        }
35278        parent = Object.getPrototypeOf(parent);
35279    }
35280}
35281function convertToR3QueryPredicate(selector) {
35282    return typeof selector === 'string' ? splitByComma(selector) : resolveForwardRef(selector);
35283}
35284function convertToR3QueryMetadata(propertyName, ann) {
35285    return {
35286        propertyName: propertyName,
35287        predicate: convertToR3QueryPredicate(ann.selector),
35288        descendants: ann.descendants,
35289        first: ann.first,
35290        read: ann.read ? ann.read : null,
35291        static: !!ann.static,
35292        emitDistinctChangesOnly: !!ann.emitDistinctChangesOnly,
35293    };
35294}
35295function extractQueriesMetadata(type, propMetadata, isQueryAnn) {
35296    const queriesMeta = [];
35297    for (const field in propMetadata) {
35298        if (propMetadata.hasOwnProperty(field)) {
35299            const annotations = propMetadata[field];
35300            annotations.forEach(ann => {
35301                if (isQueryAnn(ann)) {
35302                    if (!ann.selector) {
35303                        throw new Error(`Can't construct a query for the property "${field}" of ` +
35304                            `"${stringifyForError(type)}" since the query selector wasn't defined.`);
35305                    }
35306                    if (annotations.some(isInputAnnotation)) {
35307                        throw new Error(`Cannot combine @Input decorators with query decorators`);
35308                    }
35309                    queriesMeta.push(convertToR3QueryMetadata(field, ann));
35310                }
35311            });
35312        }
35313    }
35314    return queriesMeta;
35315}
35316function extractExportAs(exportAs) {
35317    return exportAs === undefined ? null : splitByComma(exportAs);
35318}
35319function isContentQuery(value) {
35320    const name = value.ngMetadataName;
35321    return name === 'ContentChild' || name === 'ContentChildren';
35322}
35323function isViewQuery(value) {
35324    const name = value.ngMetadataName;
35325    return name === 'ViewChild' || name === 'ViewChildren';
35326}
35327function isInputAnnotation(value) {
35328    return value.ngMetadataName === 'Input';
35329}
35330function splitByComma(value) {
35331    return value.split(',').map(piece => piece.trim());
35332}
35333const LIFECYCLE_HOOKS = [
35334    'ngOnChanges', 'ngOnInit', 'ngOnDestroy', 'ngDoCheck', 'ngAfterViewInit', 'ngAfterViewChecked',
35335    'ngAfterContentInit', 'ngAfterContentChecked'
35336];
35337function shouldAddAbstractDirective(type) {
35338    const reflect = getReflect();
35339    if (LIFECYCLE_HOOKS.some(hookName => reflect.hasLifecycleHook(type, hookName))) {
35340        return true;
35341    }
35342    const propMetadata = reflect.propMetadata(type);
35343    for (const field in propMetadata) {
35344        const annotations = propMetadata[field];
35345        for (let i = 0; i < annotations.length; i++) {
35346            const current = annotations[i];
35347            const metadataName = current.ngMetadataName;
35348            if (isInputAnnotation(current) || isContentQuery(current) || isViewQuery(current) ||
35349                metadataName === 'Output' || metadataName === 'HostBinding' ||
35350                metadataName === 'HostListener') {
35351                return true;
35352            }
35353        }
35354    }
35355    return false;
35356}
35357
35358/**
35359 * @license
35360 * Copyright Google LLC All Rights Reserved.
35361 *
35362 * Use of this source code is governed by an MIT-style license that can be
35363 * found in the LICENSE file at https://angular.io/license
35364 */
35365function compilePipe(type, meta) {
35366    let ngPipeDef = null;
35367    let ngFactoryDef = null;
35368    Object.defineProperty(type, NG_FACTORY_DEF, {
35369        get: () => {
35370            if (ngFactoryDef === null) {
35371                const metadata = getPipeMetadata(type, meta);
35372                const compiler = getCompilerFacade();
35373                ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`, Object.assign(Object.assign({}, metadata), { injectFn: 'directiveInject', target: compiler.R3FactoryTarget.Pipe }));
35374            }
35375            return ngFactoryDef;
35376        },
35377        // Make the property configurable in dev mode to allow overriding in tests
35378        configurable: !!ngDevMode,
35379    });
35380    Object.defineProperty(type, NG_PIPE_DEF, {
35381        get: () => {
35382            if (ngPipeDef === null) {
35383                const metadata = getPipeMetadata(type, meta);
35384                ngPipeDef = getCompilerFacade().compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata);
35385            }
35386            return ngPipeDef;
35387        },
35388        // Make the property configurable in dev mode to allow overriding in tests
35389        configurable: !!ngDevMode,
35390    });
35391}
35392function getPipeMetadata(type, meta) {
35393    return {
35394        type: type,
35395        typeArgumentCount: 0,
35396        name: type.name,
35397        deps: reflectDependencies(type),
35398        pipeName: meta.name,
35399        pure: meta.pure !== undefined ? meta.pure : true
35400    };
35401}
35402
35403/**
35404 * @license
35405 * Copyright Google LLC All Rights Reserved.
35406 *
35407 * Use of this source code is governed by an MIT-style license that can be
35408 * found in the LICENSE file at https://angular.io/license
35409 */
35410const ɵ0$d = (dir = {}) => dir, ɵ1$2 = (type, meta) => SWITCH_COMPILE_DIRECTIVE(type, meta);
35411/**
35412 * Type of the Directive metadata.
35413 *
35414 * @publicApi
35415 */
35416const Directive = makeDecorator('Directive', ɵ0$d, undefined, undefined, ɵ1$2);
35417const ɵ2$1 = (c = {}) => (Object.assign({ changeDetection: ChangeDetectionStrategy.Default }, c)), ɵ3$1 = (type, meta) => SWITCH_COMPILE_COMPONENT(type, meta);
35418/**
35419 * Component decorator and metadata.
35420 *
35421 * @Annotation
35422 * @publicApi
35423 */
35424const Component = makeDecorator('Component', ɵ2$1, Directive, undefined, ɵ3$1);
35425const ɵ4 = (p) => (Object.assign({ pure: true }, p)), ɵ5 = (type, meta) => SWITCH_COMPILE_PIPE(type, meta);
35426/**
35427 * @Annotation
35428 * @publicApi
35429 */
35430const Pipe = makeDecorator('Pipe', ɵ4, undefined, undefined, ɵ5);
35431const ɵ6 = (bindingPropertyName) => ({ bindingPropertyName });
35432/**
35433 * @Annotation
35434 * @publicApi
35435 */
35436const Input = makePropDecorator('Input', ɵ6);
35437const ɵ7 = (bindingPropertyName) => ({ bindingPropertyName });
35438/**
35439 * @Annotation
35440 * @publicApi
35441 */
35442const Output = makePropDecorator('Output', ɵ7);
35443const ɵ8 = (hostPropertyName) => ({ hostPropertyName });
35444/**
35445 * @Annotation
35446 * @publicApi
35447 */
35448const HostBinding = makePropDecorator('HostBinding', ɵ8);
35449const ɵ9 = (eventName, args) => ({ eventName, args });
35450/**
35451 * Decorator that binds a DOM event to a host listener and supplies configuration metadata.
35452 * Angular invokes the supplied handler method when the host element emits the specified event,
35453 * and updates the bound element with the result.
35454 *
35455 * If the handler method returns false, applies `preventDefault` on the bound element.
35456 *
35457 * @usageNotes
35458 *
35459 * The following example declares a directive
35460 * that attaches a click listener to a button and counts clicks.
35461 *
35462 * ```ts
35463 * @Directive({selector: 'button[counting]'})
35464 * class CountClicks {
35465 *   numberOfClicks = 0;
35466 *
35467 *   @HostListener('click', ['$event.target'])
35468 *   onClick(btn) {
35469 *     console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
35470 *  }
35471 * }
35472 *
35473 * @Component({
35474 *   selector: 'app',
35475 *   template: '<button counting>Increment</button>',
35476 * })
35477 * class App {}
35478 *
35479 * ```
35480 *
35481 * The following example registers another DOM event handler that listens for key-press events.
35482 * ``` ts
35483 * import { HostListener, Component } from "@angular/core";
35484 *
35485 * @Component({
35486 *   selector: 'app',
35487 *   template: `<h1>Hello, you have pressed keys {{counter}} number of times!</h1> Press any key to
35488 * increment the counter.
35489 *   <button (click)="resetCounter()">Reset Counter</button>`
35490 * })
35491 * class AppComponent {
35492 *   counter = 0;
35493 *   @HostListener('window:keydown', ['$event'])
35494 *   handleKeyDown(event: KeyboardEvent) {
35495 *     this.counter++;
35496 *   }
35497 *   resetCounter() {
35498 *     this.counter = 0;
35499 *   }
35500 * }
35501 * ```
35502 *
35503 * @Annotation
35504 * @publicApi
35505 */
35506const HostListener = makePropDecorator('HostListener', ɵ9);
35507const SWITCH_COMPILE_COMPONENT__POST_R3__ = compileComponent;
35508const SWITCH_COMPILE_DIRECTIVE__POST_R3__ = compileDirective;
35509const SWITCH_COMPILE_PIPE__POST_R3__ = compilePipe;
35510const SWITCH_COMPILE_COMPONENT__PRE_R3__ = noop;
35511const SWITCH_COMPILE_DIRECTIVE__PRE_R3__ = noop;
35512const SWITCH_COMPILE_PIPE__PRE_R3__ = noop;
35513const SWITCH_COMPILE_COMPONENT = SWITCH_COMPILE_COMPONENT__POST_R3__;
35514const SWITCH_COMPILE_DIRECTIVE = SWITCH_COMPILE_DIRECTIVE__POST_R3__;
35515const SWITCH_COMPILE_PIPE = SWITCH_COMPILE_PIPE__POST_R3__;
35516
35517/**
35518 * @license
35519 * Copyright Google LLC All Rights Reserved.
35520 *
35521 * Use of this source code is governed by an MIT-style license that can be
35522 * found in the LICENSE file at https://angular.io/license
35523 */
35524const ɵ0$e = (ngModule) => ngModule, ɵ1$3 = 
35525/**
35526 * Decorator that marks the following class as an NgModule, and supplies
35527 * configuration metadata for it.
35528 *
35529 * * The `declarations` and `entryComponents` options configure the compiler
35530 * with information about what belongs to the NgModule.
35531 * * The `providers` options configures the NgModule's injector to provide
35532 * dependencies the NgModule members.
35533 * * The `imports` and `exports` options bring in members from other modules, and make
35534 * this module's members available to others.
35535 */
35536(type, meta) => SWITCH_COMPILE_NGMODULE(type, meta);
35537/**
35538 * @Annotation
35539 * @publicApi
35540 */
35541const NgModule = makeDecorator('NgModule', ɵ0$e, undefined, undefined, ɵ1$3);
35542function preR3NgModuleCompile(moduleType, metadata) {
35543    let imports = (metadata && metadata.imports) || [];
35544    if (metadata && metadata.exports) {
35545        imports = [...imports, metadata.exports];
35546    }
35547    const moduleInjectorType = moduleType;
35548    moduleInjectorType.ɵfac = convertInjectableProviderToFactory(moduleType, { useClass: moduleType });
35549    moduleInjectorType.ɵinj =
35550        ɵɵdefineInjector({ providers: metadata && metadata.providers, imports: imports });
35551}
35552const SWITCH_COMPILE_NGMODULE__POST_R3__ = compileNgModule;
35553const SWITCH_COMPILE_NGMODULE__PRE_R3__ = preR3NgModuleCompile;
35554const SWITCH_COMPILE_NGMODULE = SWITCH_COMPILE_NGMODULE__POST_R3__;
35555
35556/**
35557 * @license
35558 * Copyright Google LLC All Rights Reserved.
35559 *
35560 * Use of this source code is governed by an MIT-style license that can be
35561 * found in the LICENSE file at https://angular.io/license
35562 */
35563
35564/**
35565 * @license
35566 * Copyright Google LLC All Rights Reserved.
35567 *
35568 * Use of this source code is governed by an MIT-style license that can be
35569 * found in the LICENSE file at https://angular.io/license
35570 */
35571
35572/**
35573 * @license
35574 * Copyright Google LLC All Rights Reserved.
35575 *
35576 * Use of this source code is governed by an MIT-style license that can be
35577 * found in the LICENSE file at https://angular.io/license
35578 */
35579/**
35580 * A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
35581 * one or more initialization functions.
35582 *
35583 * The provided functions are injected at application startup and executed during
35584 * app initialization. If any of these functions returns a Promise, initialization
35585 * does not complete until the Promise is resolved.
35586 *
35587 * You can, for example, create a factory function that loads language data
35588 * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
35589 * The function is executed during the application bootstrap process,
35590 * and the needed data is available on startup.
35591 *
35592 * @see `ApplicationInitStatus`
35593 *
35594 * @publicApi
35595 */
35596const APP_INITIALIZER = new InjectionToken('Application Initializer');
35597/**
35598 * A class that reflects the state of running {@link APP_INITIALIZER} functions.
35599 *
35600 * @publicApi
35601 */
35602class ApplicationInitStatus {
35603    constructor(appInits) {
35604        this.appInits = appInits;
35605        this.resolve = noop;
35606        this.reject = noop;
35607        this.initialized = false;
35608        this.done = false;
35609        this.donePromise = new Promise((res, rej) => {
35610            this.resolve = res;
35611            this.reject = rej;
35612        });
35613    }
35614    /** @internal */
35615    runInitializers() {
35616        if (this.initialized) {
35617            return;
35618        }
35619        const asyncInitPromises = [];
35620        const complete = () => {
35621            this.done = true;
35622            this.resolve();
35623        };
35624        if (this.appInits) {
35625            for (let i = 0; i < this.appInits.length; i++) {
35626                const initResult = this.appInits[i]();
35627                if (isPromise(initResult)) {
35628                    asyncInitPromises.push(initResult);
35629                }
35630            }
35631        }
35632        Promise.all(asyncInitPromises)
35633            .then(() => {
35634            complete();
35635        })
35636            .catch(e => {
35637            this.reject(e);
35638        });
35639        if (asyncInitPromises.length === 0) {
35640            complete();
35641        }
35642        this.initialized = true;
35643    }
35644}
35645ApplicationInitStatus.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(ɵɵinject(APP_INITIALIZER, 8)); };
35646ApplicationInitStatus.ɵprov = ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac });
35647ApplicationInitStatus.ctorParameters = () => [
35648    { type: Array, decorators: [{ type: Inject, args: [APP_INITIALIZER,] }, { type: Optional }] }
35649];
35650(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
35651        type: Injectable
35652    }], function () { return [{ type: Array, decorators: [{
35653                type: Inject,
35654                args: [APP_INITIALIZER]
35655            }, {
35656                type: Optional
35657            }] }]; }, null); })();
35658
35659/**
35660 * @license
35661 * Copyright Google LLC All Rights Reserved.
35662 *
35663 * Use of this source code is governed by an MIT-style license that can be
35664 * found in the LICENSE file at https://angular.io/license
35665 */
35666/**
35667 * A [DI token](guide/glossary#di-token "DI token definition") representing a unique string ID, used
35668 * primarily for prefixing application attributes and CSS styles when
35669 * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
35670 *
35671 * BY default, the value is randomly generated and assigned to the application by Angular.
35672 * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure
35673 * the root {@link Injector} that uses this token.
35674 *
35675 * @publicApi
35676 */
35677const APP_ID = new InjectionToken('AppId');
35678function _appIdRandomProviderFactory() {
35679    return `${_randomChar()}${_randomChar()}${_randomChar()}`;
35680}
35681/**
35682 * Providers that generate a random `APP_ID_TOKEN`.
35683 * @publicApi
35684 */
35685const APP_ID_RANDOM_PROVIDER = {
35686    provide: APP_ID,
35687    useFactory: _appIdRandomProviderFactory,
35688    deps: [],
35689};
35690function _randomChar() {
35691    return String.fromCharCode(97 + Math.floor(Math.random() * 25));
35692}
35693/**
35694 * A function that is executed when a platform is initialized.
35695 * @publicApi
35696 */
35697const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
35698/**
35699 * A token that indicates an opaque platform ID.
35700 * @publicApi
35701 */
35702const PLATFORM_ID = new InjectionToken('Platform ID');
35703/**
35704 * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
35705 * be called for every component that is bootstrapped.
35706 *
35707 * Each callback must take a `ComponentRef` instance and return nothing.
35708 *
35709 * `(componentRef: ComponentRef) => void`
35710 *
35711 * @publicApi
35712 */
35713const APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');
35714/**
35715 * A [DI token](guide/glossary#di-token "DI token definition") that indicates the root directory of
35716 * the application
35717 * @publicApi
35718 */
35719const PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
35720
35721/**
35722 * @license
35723 * Copyright Google LLC All Rights Reserved.
35724 *
35725 * Use of this source code is governed by an MIT-style license that can be
35726 * found in the LICENSE file at https://angular.io/license
35727 */
35728class Console {
35729    log(message) {
35730        // tslint:disable-next-line:no-console
35731        console.log(message);
35732    }
35733    // Note: for reporting errors use `DOM.logError()` as it is platform specific
35734    warn(message) {
35735        // tslint:disable-next-line:no-console
35736        console.warn(message);
35737    }
35738}
35739Console.ɵfac = function Console_Factory(t) { return new (t || Console)(); };
35740Console.ɵprov = ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac });
35741(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Console, [{
35742        type: Injectable
35743    }], null, null); })();
35744
35745/**
35746 * @license
35747 * Copyright Google LLC All Rights Reserved.
35748 *
35749 * Use of this source code is governed by an MIT-style license that can be
35750 * found in the LICENSE file at https://angular.io/license
35751 */
35752/**
35753 * Provide this token to set the locale of your application.
35754 * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
35755 * DecimalPipe and PercentPipe) and by ICU expressions.
35756 *
35757 * See the [i18n guide](guide/i18n#setting-up-locale) for more information.
35758 *
35759 * @usageNotes
35760 * ### Example
35761 *
35762 * ```typescript
35763 * import { LOCALE_ID } from '@angular/core';
35764 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
35765 * import { AppModule } from './app/app.module';
35766 *
35767 * platformBrowserDynamic().bootstrapModule(AppModule, {
35768 *   providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
35769 * });
35770 * ```
35771 *
35772 * @publicApi
35773 */
35774const LOCALE_ID$1 = new InjectionToken('LocaleId');
35775/**
35776 * Provide this token to set the default currency code your application uses for
35777 * CurrencyPipe when there is no currency code passed into it. This is only used by
35778 * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
35779 *
35780 * See the [i18n guide](guide/i18n#setting-up-locale) for more information.
35781 *
35782 * <div class="alert is-helpful">
35783 *
35784 * **Deprecation notice:**
35785 *
35786 * The default currency code is currently always `USD` but this is deprecated from v9.
35787 *
35788 * **In v10 the default currency code will be taken from the current locale.**
35789 *
35790 * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
35791 * your application `NgModule`:
35792 *
35793 * ```ts
35794 * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
35795 * ```
35796 *
35797 * </div>
35798 *
35799 * @usageNotes
35800 * ### Example
35801 *
35802 * ```typescript
35803 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
35804 * import { AppModule } from './app/app.module';
35805 *
35806 * platformBrowserDynamic().bootstrapModule(AppModule, {
35807 *   providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
35808 * });
35809 * ```
35810 *
35811 * @publicApi
35812 */
35813const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode');
35814/**
35815 * Use this token at bootstrap to provide the content of your translation file (`xtb`,
35816 * `xlf` or `xlf2`) when you want to translate your application in another language.
35817 *
35818 * See the [i18n guide](guide/i18n#merge) for more information.
35819 *
35820 * @usageNotes
35821 * ### Example
35822 *
35823 * ```typescript
35824 * import { TRANSLATIONS } from '@angular/core';
35825 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
35826 * import { AppModule } from './app/app.module';
35827 *
35828 * // content of your translation file
35829 * const translations = '....';
35830 *
35831 * platformBrowserDynamic().bootstrapModule(AppModule, {
35832 *   providers: [{provide: TRANSLATIONS, useValue: translations }]
35833 * });
35834 * ```
35835 *
35836 * @publicApi
35837 */
35838const TRANSLATIONS = new InjectionToken('Translations');
35839/**
35840 * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
35841 * `xlf` or `xlf2`.
35842 *
35843 * See the [i18n guide](guide/i18n#merge) for more information.
35844 *
35845 * @usageNotes
35846 * ### Example
35847 *
35848 * ```typescript
35849 * import { TRANSLATIONS_FORMAT } from '@angular/core';
35850 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
35851 * import { AppModule } from './app/app.module';
35852 *
35853 * platformBrowserDynamic().bootstrapModule(AppModule, {
35854 *   providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
35855 * });
35856 * ```
35857 *
35858 * @publicApi
35859 */
35860const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
35861/**
35862 * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
35863 * that the compiler should use in case of missing translations:
35864 * - Error: throw if you have missing translations.
35865 * - Warning (default): show a warning in the console and/or shell.
35866 * - Ignore: do nothing.
35867 *
35868 * See the [i18n guide](guide/i18n#missing-translation) for more information.
35869 *
35870 * @usageNotes
35871 * ### Example
35872 * ```typescript
35873 * import { MissingTranslationStrategy } from '@angular/core';
35874 * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
35875 * import { AppModule } from './app/app.module';
35876 *
35877 * platformBrowserDynamic().bootstrapModule(AppModule, {
35878 *   missingTranslation: MissingTranslationStrategy.Error
35879 * });
35880 * ```
35881 *
35882 * @publicApi
35883 */
35884var MissingTranslationStrategy;
35885(function (MissingTranslationStrategy) {
35886    MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
35887    MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
35888    MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
35889})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
35890
35891/**
35892 * @license
35893 * Copyright Google LLC All Rights Reserved.
35894 *
35895 * Use of this source code is governed by an MIT-style license that can be
35896 * found in the LICENSE file at https://angular.io/license
35897 */
35898const SWITCH_IVY_ENABLED__POST_R3__ = true;
35899const SWITCH_IVY_ENABLED__PRE_R3__ = false;
35900const ivyEnabled = SWITCH_IVY_ENABLED__POST_R3__;
35901
35902/**
35903 * @license
35904 * Copyright Google LLC All Rights Reserved.
35905 *
35906 * Use of this source code is governed by an MIT-style license that can be
35907 * found in the LICENSE file at https://angular.io/license
35908 */
35909/**
35910 * Combination of NgModuleFactory and ComponentFactories.
35911 *
35912 * @publicApi
35913 */
35914class ModuleWithComponentFactories {
35915    constructor(ngModuleFactory, componentFactories) {
35916        this.ngModuleFactory = ngModuleFactory;
35917        this.componentFactories = componentFactories;
35918    }
35919}
35920function _throwError() {
35921    throw new Error(`Runtime compiler is not loaded`);
35922}
35923const Compiler_compileModuleSync__PRE_R3__ = _throwError;
35924const Compiler_compileModuleSync__POST_R3__ = function (moduleType) {
35925    return new NgModuleFactory$1(moduleType);
35926};
35927const Compiler_compileModuleSync = Compiler_compileModuleSync__POST_R3__;
35928const Compiler_compileModuleAsync__PRE_R3__ = _throwError;
35929const Compiler_compileModuleAsync__POST_R3__ = function (moduleType) {
35930    return Promise.resolve(Compiler_compileModuleSync__POST_R3__(moduleType));
35931};
35932const Compiler_compileModuleAsync = Compiler_compileModuleAsync__POST_R3__;
35933const Compiler_compileModuleAndAllComponentsSync__PRE_R3__ = _throwError;
35934const Compiler_compileModuleAndAllComponentsSync__POST_R3__ = function (moduleType) {
35935    const ngModuleFactory = Compiler_compileModuleSync__POST_R3__(moduleType);
35936    const moduleDef = getNgModuleDef(moduleType);
35937    const componentFactories = maybeUnwrapFn(moduleDef.declarations)
35938        .reduce((factories, declaration) => {
35939        const componentDef = getComponentDef(declaration);
35940        componentDef && factories.push(new ComponentFactory$1(componentDef));
35941        return factories;
35942    }, []);
35943    return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
35944};
35945const Compiler_compileModuleAndAllComponentsSync = Compiler_compileModuleAndAllComponentsSync__POST_R3__;
35946const Compiler_compileModuleAndAllComponentsAsync__PRE_R3__ = _throwError;
35947const Compiler_compileModuleAndAllComponentsAsync__POST_R3__ = function (moduleType) {
35948    return Promise.resolve(Compiler_compileModuleAndAllComponentsSync__POST_R3__(moduleType));
35949};
35950const Compiler_compileModuleAndAllComponentsAsync = Compiler_compileModuleAndAllComponentsAsync__POST_R3__;
35951/**
35952 * Low-level service for running the angular compiler during runtime
35953 * to create {@link ComponentFactory}s, which
35954 * can later be used to create and render a Component instance.
35955 *
35956 * Each `@NgModule` provides an own `Compiler` to its injector,
35957 * that will use the directives/pipes of the ng module for compilation
35958 * of components.
35959 *
35960 * @publicApi
35961 */
35962class Compiler {
35963    constructor() {
35964        /**
35965         * Compiles the given NgModule and all of its components. All templates of the components listed
35966         * in `entryComponents` have to be inlined.
35967         */
35968        this.compileModuleSync = Compiler_compileModuleSync;
35969        /**
35970         * Compiles the given NgModule and all of its components
35971         */
35972        this.compileModuleAsync = Compiler_compileModuleAsync;
35973        /**
35974         * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
35975         */
35976        this.compileModuleAndAllComponentsSync = Compiler_compileModuleAndAllComponentsSync;
35977        /**
35978         * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
35979         */
35980        this.compileModuleAndAllComponentsAsync = Compiler_compileModuleAndAllComponentsAsync;
35981    }
35982    /**
35983     * Clears all caches.
35984     */
35985    clearCache() { }
35986    /**
35987     * Clears the cache for the given component/ngModule.
35988     */
35989    clearCacheFor(type) { }
35990    /**
35991     * Returns the id for a given NgModule, if one is defined and known to the compiler.
35992     */
35993    getModuleId(moduleType) {
35994        return undefined;
35995    }
35996}
35997Compiler.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); };
35998Compiler.ɵprov = ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac });
35999(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
36000        type: Injectable
36001    }], function () { return []; }, null); })();
36002/**
36003 * Token to provide CompilerOptions in the platform injector.
36004 *
36005 * @publicApi
36006 */
36007const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
36008/**
36009 * A factory for creating a Compiler
36010 *
36011 * @publicApi
36012 */
36013class CompilerFactory {
36014}
36015
36016/**
36017 * @license
36018 * Copyright Google LLC All Rights Reserved.
36019 *
36020 * Use of this source code is governed by an MIT-style license that can be
36021 * found in the LICENSE file at https://angular.io/license
36022 */
36023const promise = (() => Promise.resolve(0))();
36024function scheduleMicroTask(fn) {
36025    if (typeof Zone === 'undefined') {
36026        // use promise to schedule microTask instead of use Zone
36027        promise.then(() => {
36028            fn && fn.apply(null, null);
36029        });
36030    }
36031    else {
36032        Zone.current.scheduleMicroTask('scheduleMicrotask', fn);
36033    }
36034}
36035
36036/**
36037 * @license
36038 * Copyright Google LLC All Rights Reserved.
36039 *
36040 * Use of this source code is governed by an MIT-style license that can be
36041 * found in the LICENSE file at https://angular.io/license
36042 */
36043function getNativeRequestAnimationFrame() {
36044    let nativeRequestAnimationFrame = _global['requestAnimationFrame'];
36045    let nativeCancelAnimationFrame = _global['cancelAnimationFrame'];
36046    if (typeof Zone !== 'undefined' && nativeRequestAnimationFrame && nativeCancelAnimationFrame) {
36047        // use unpatched version of requestAnimationFrame(native delegate) if possible
36048        // to avoid another Change detection
36049        const unpatchedRequestAnimationFrame = nativeRequestAnimationFrame[Zone.__symbol__('OriginalDelegate')];
36050        if (unpatchedRequestAnimationFrame) {
36051            nativeRequestAnimationFrame = unpatchedRequestAnimationFrame;
36052        }
36053        const unpatchedCancelAnimationFrame = nativeCancelAnimationFrame[Zone.__symbol__('OriginalDelegate')];
36054        if (unpatchedCancelAnimationFrame) {
36055            nativeCancelAnimationFrame = unpatchedCancelAnimationFrame;
36056        }
36057    }
36058    return { nativeRequestAnimationFrame, nativeCancelAnimationFrame };
36059}
36060
36061/**
36062 * @license
36063 * Copyright Google LLC All Rights Reserved.
36064 *
36065 * Use of this source code is governed by an MIT-style license that can be
36066 * found in the LICENSE file at https://angular.io/license
36067 */
36068/**
36069 * An injectable service for executing work inside or outside of the Angular zone.
36070 *
36071 * The most common use of this service is to optimize performance when starting a work consisting of
36072 * one or more asynchronous tasks that don't require UI updates or error handling to be handled by
36073 * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks
36074 * can reenter the Angular zone via {@link #run}.
36075 *
36076 * <!-- TODO: add/fix links to:
36077 *   - docs explaining zones and the use of zones in Angular and change-detection
36078 *   - link to runOutsideAngular/run (throughout this file!)
36079 *   -->
36080 *
36081 * @usageNotes
36082 * ### Example
36083 *
36084 * ```
36085 * import {Component, NgZone} from '@angular/core';
36086 * import {NgIf} from '@angular/common';
36087 *
36088 * @Component({
36089 *   selector: 'ng-zone-demo',
36090 *   template: `
36091 *     <h2>Demo: NgZone</h2>
36092 *
36093 *     <p>Progress: {{progress}}%</p>
36094 *     <p *ngIf="progress >= 100">Done processing {{label}} of Angular zone!</p>
36095 *
36096 *     <button (click)="processWithinAngularZone()">Process within Angular zone</button>
36097 *     <button (click)="processOutsideOfAngularZone()">Process outside of Angular zone</button>
36098 *   `,
36099 * })
36100 * export class NgZoneDemo {
36101 *   progress: number = 0;
36102 *   label: string;
36103 *
36104 *   constructor(private _ngZone: NgZone) {}
36105 *
36106 *   // Loop inside the Angular zone
36107 *   // so the UI DOES refresh after each setTimeout cycle
36108 *   processWithinAngularZone() {
36109 *     this.label = 'inside';
36110 *     this.progress = 0;
36111 *     this._increaseProgress(() => console.log('Inside Done!'));
36112 *   }
36113 *
36114 *   // Loop outside of the Angular zone
36115 *   // so the UI DOES NOT refresh after each setTimeout cycle
36116 *   processOutsideOfAngularZone() {
36117 *     this.label = 'outside';
36118 *     this.progress = 0;
36119 *     this._ngZone.runOutsideAngular(() => {
36120 *       this._increaseProgress(() => {
36121 *         // reenter the Angular zone and display done
36122 *         this._ngZone.run(() => { console.log('Outside Done!'); });
36123 *       });
36124 *     });
36125 *   }
36126 *
36127 *   _increaseProgress(doneCallback: () => void) {
36128 *     this.progress += 1;
36129 *     console.log(`Current progress: ${this.progress}%`);
36130 *
36131 *     if (this.progress < 100) {
36132 *       window.setTimeout(() => this._increaseProgress(doneCallback), 10);
36133 *     } else {
36134 *       doneCallback();
36135 *     }
36136 *   }
36137 * }
36138 * ```
36139 *
36140 * @publicApi
36141 */
36142class NgZone {
36143    constructor({ enableLongStackTrace = false, shouldCoalesceEventChangeDetection = false, shouldCoalesceRunChangeDetection = false }) {
36144        this.hasPendingMacrotasks = false;
36145        this.hasPendingMicrotasks = false;
36146        /**
36147         * Whether there are no outstanding microtasks or macrotasks.
36148         */
36149        this.isStable = true;
36150        /**
36151         * Notifies when code enters Angular Zone. This gets fired first on VM Turn.
36152         */
36153        this.onUnstable = new EventEmitter(false);
36154        /**
36155         * Notifies when there is no more microtasks enqueued in the current VM Turn.
36156         * This is a hint for Angular to do change detection, which may enqueue more microtasks.
36157         * For this reason this event can fire multiple times per VM Turn.
36158         */
36159        this.onMicrotaskEmpty = new EventEmitter(false);
36160        /**
36161         * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which
36162         * implies we are about to relinquish VM turn.
36163         * This event gets called just once.
36164         */
36165        this.onStable = new EventEmitter(false);
36166        /**
36167         * Notifies that an error has been delivered.
36168         */
36169        this.onError = new EventEmitter(false);
36170        if (typeof Zone == 'undefined') {
36171            throw new Error(`In this configuration Angular requires Zone.js`);
36172        }
36173        Zone.assertZonePatched();
36174        const self = this;
36175        self._nesting = 0;
36176        self._outer = self._inner = Zone.current;
36177        if (Zone['TaskTrackingZoneSpec']) {
36178            self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']);
36179        }
36180        if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {
36181            self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']);
36182        }
36183        // if shouldCoalesceRunChangeDetection is true, all tasks including event tasks will be
36184        // coalesced, so shouldCoalesceEventChangeDetection option is not necessary and can be skipped.
36185        self.shouldCoalesceEventChangeDetection =
36186            !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;
36187        self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;
36188        self.lastRequestAnimationFrameId = -1;
36189        self.nativeRequestAnimationFrame = getNativeRequestAnimationFrame().nativeRequestAnimationFrame;
36190        forkInnerZoneWithAngularBehavior(self);
36191    }
36192    static isInAngularZone() {
36193        return Zone.current.get('isAngularZone') === true;
36194    }
36195    static assertInAngularZone() {
36196        if (!NgZone.isInAngularZone()) {
36197            throw new Error('Expected to be in Angular Zone, but it is not!');
36198        }
36199    }
36200    static assertNotInAngularZone() {
36201        if (NgZone.isInAngularZone()) {
36202            throw new Error('Expected to not be in Angular Zone, but it is!');
36203        }
36204    }
36205    /**
36206     * Executes the `fn` function synchronously within the Angular zone and returns value returned by
36207     * the function.
36208     *
36209     * Running functions via `run` allows you to reenter Angular zone from a task that was executed
36210     * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
36211     *
36212     * Any future tasks or microtasks scheduled from within this function will continue executing from
36213     * within the Angular zone.
36214     *
36215     * If a synchronous error happens it will be rethrown and not reported via `onError`.
36216     */
36217    run(fn, applyThis, applyArgs) {
36218        return this._inner.run(fn, applyThis, applyArgs);
36219    }
36220    /**
36221     * Executes the `fn` function synchronously within the Angular zone as a task and returns value
36222     * returned by the function.
36223     *
36224     * Running functions via `run` allows you to reenter Angular zone from a task that was executed
36225     * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
36226     *
36227     * Any future tasks or microtasks scheduled from within this function will continue executing from
36228     * within the Angular zone.
36229     *
36230     * If a synchronous error happens it will be rethrown and not reported via `onError`.
36231     */
36232    runTask(fn, applyThis, applyArgs, name) {
36233        const zone = this._inner;
36234        const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);
36235        try {
36236            return zone.runTask(task, applyThis, applyArgs);
36237        }
36238        finally {
36239            zone.cancelTask(task);
36240        }
36241    }
36242    /**
36243     * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
36244     * rethrown.
36245     */
36246    runGuarded(fn, applyThis, applyArgs) {
36247        return this._inner.runGuarded(fn, applyThis, applyArgs);
36248    }
36249    /**
36250     * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
36251     * the function.
36252     *
36253     * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do
36254     * work that
36255     * doesn't trigger Angular change-detection or is subject to Angular's error handling.
36256     *
36257     * Any future tasks or microtasks scheduled from within this function will continue executing from
36258     * outside of the Angular zone.
36259     *
36260     * Use {@link #run} to reenter the Angular zone and do work that updates the application model.
36261     */
36262    runOutsideAngular(fn) {
36263        return this._outer.run(fn);
36264    }
36265}
36266const EMPTY_PAYLOAD = {};
36267function checkStable(zone) {
36268    if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {
36269        try {
36270            zone._nesting++;
36271            zone.onMicrotaskEmpty.emit(null);
36272        }
36273        finally {
36274            zone._nesting--;
36275            if (!zone.hasPendingMicrotasks) {
36276                try {
36277                    zone.runOutsideAngular(() => zone.onStable.emit(null));
36278                }
36279                finally {
36280                    zone.isStable = true;
36281                }
36282            }
36283        }
36284    }
36285}
36286function delayChangeDetectionForEvents(zone) {
36287    if (zone.lastRequestAnimationFrameId !== -1) {
36288        return;
36289    }
36290    zone.lastRequestAnimationFrameId = zone.nativeRequestAnimationFrame.call(_global, () => {
36291        // This is a work around for https://github.com/angular/angular/issues/36839.
36292        // The core issue is that when event coalescing is enabled it is possible for microtasks
36293        // to get flushed too early (As is the case with `Promise.then`) between the
36294        // coalescing eventTasks.
36295        //
36296        // To workaround this we schedule a "fake" eventTask before we process the
36297        // coalescing eventTasks. The benefit of this is that the "fake" container eventTask
36298        //  will prevent the microtasks queue from getting drained in between the coalescing
36299        // eventTask execution.
36300        if (!zone.fakeTopEventTask) {
36301            zone.fakeTopEventTask = Zone.root.scheduleEventTask('fakeTopEventTask', () => {
36302                zone.lastRequestAnimationFrameId = -1;
36303                updateMicroTaskStatus(zone);
36304                checkStable(zone);
36305            }, undefined, () => { }, () => { });
36306        }
36307        zone.fakeTopEventTask.invoke();
36308    });
36309    updateMicroTaskStatus(zone);
36310}
36311function forkInnerZoneWithAngularBehavior(zone) {
36312    const delayChangeDetectionForEventsDelegate = () => {
36313        delayChangeDetectionForEvents(zone);
36314    };
36315    zone._inner = zone._inner.fork({
36316        name: 'angular',
36317        properties: { 'isAngularZone': true },
36318        onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => {
36319            try {
36320                onEnter(zone);
36321                return delegate.invokeTask(target, task, applyThis, applyArgs);
36322            }
36323            finally {
36324                if ((zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask') ||
36325                    zone.shouldCoalesceRunChangeDetection) {
36326                    delayChangeDetectionForEventsDelegate();
36327                }
36328                onLeave(zone);
36329            }
36330        },
36331        onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => {
36332            try {
36333                onEnter(zone);
36334                return delegate.invoke(target, callback, applyThis, applyArgs, source);
36335            }
36336            finally {
36337                if (zone.shouldCoalesceRunChangeDetection) {
36338                    delayChangeDetectionForEventsDelegate();
36339                }
36340                onLeave(zone);
36341            }
36342        },
36343        onHasTask: (delegate, current, target, hasTaskState) => {
36344            delegate.hasTask(target, hasTaskState);
36345            if (current === target) {
36346                // We are only interested in hasTask events which originate from our zone
36347                // (A child hasTask event is not interesting to us)
36348                if (hasTaskState.change == 'microTask') {
36349                    zone._hasPendingMicrotasks = hasTaskState.microTask;
36350                    updateMicroTaskStatus(zone);
36351                    checkStable(zone);
36352                }
36353                else if (hasTaskState.change == 'macroTask') {
36354                    zone.hasPendingMacrotasks = hasTaskState.macroTask;
36355                }
36356            }
36357        },
36358        onHandleError: (delegate, current, target, error) => {
36359            delegate.handleError(target, error);
36360            zone.runOutsideAngular(() => zone.onError.emit(error));
36361            return false;
36362        }
36363    });
36364}
36365function updateMicroTaskStatus(zone) {
36366    if (zone._hasPendingMicrotasks ||
36367        ((zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) &&
36368            zone.lastRequestAnimationFrameId !== -1)) {
36369        zone.hasPendingMicrotasks = true;
36370    }
36371    else {
36372        zone.hasPendingMicrotasks = false;
36373    }
36374}
36375function onEnter(zone) {
36376    zone._nesting++;
36377    if (zone.isStable) {
36378        zone.isStable = false;
36379        zone.onUnstable.emit(null);
36380    }
36381}
36382function onLeave(zone) {
36383    zone._nesting--;
36384    checkStable(zone);
36385}
36386/**
36387 * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls
36388 * to framework to perform rendering.
36389 */
36390class NoopNgZone {
36391    constructor() {
36392        this.hasPendingMicrotasks = false;
36393        this.hasPendingMacrotasks = false;
36394        this.isStable = true;
36395        this.onUnstable = new EventEmitter();
36396        this.onMicrotaskEmpty = new EventEmitter();
36397        this.onStable = new EventEmitter();
36398        this.onError = new EventEmitter();
36399    }
36400    run(fn, applyThis, applyArgs) {
36401        return fn.apply(applyThis, applyArgs);
36402    }
36403    runGuarded(fn, applyThis, applyArgs) {
36404        return fn.apply(applyThis, applyArgs);
36405    }
36406    runOutsideAngular(fn) {
36407        return fn();
36408    }
36409    runTask(fn, applyThis, applyArgs, name) {
36410        return fn.apply(applyThis, applyArgs);
36411    }
36412}
36413
36414/**
36415 * @license
36416 * Copyright Google LLC All Rights Reserved.
36417 *
36418 * Use of this source code is governed by an MIT-style license that can be
36419 * found in the LICENSE file at https://angular.io/license
36420 */
36421/**
36422 * The Testability service provides testing hooks that can be accessed from
36423 * the browser and by services such as Protractor. Each bootstrapped Angular
36424 * application on the page will have an instance of Testability.
36425 * @publicApi
36426 */
36427class Testability {
36428    constructor(_ngZone) {
36429        this._ngZone = _ngZone;
36430        this._pendingCount = 0;
36431        this._isZoneStable = true;
36432        /**
36433         * Whether any work was done since the last 'whenStable' callback. This is
36434         * useful to detect if this could have potentially destabilized another
36435         * component while it is stabilizing.
36436         * @internal
36437         */
36438        this._didWork = false;
36439        this._callbacks = [];
36440        this.taskTrackingZone = null;
36441        this._watchAngularEvents();
36442        _ngZone.run(() => {
36443            this.taskTrackingZone =
36444                typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone');
36445        });
36446    }
36447    _watchAngularEvents() {
36448        this._ngZone.onUnstable.subscribe({
36449            next: () => {
36450                this._didWork = true;
36451                this._isZoneStable = false;
36452            }
36453        });
36454        this._ngZone.runOutsideAngular(() => {
36455            this._ngZone.onStable.subscribe({
36456                next: () => {
36457                    NgZone.assertNotInAngularZone();
36458                    scheduleMicroTask(() => {
36459                        this._isZoneStable = true;
36460                        this._runCallbacksIfReady();
36461                    });
36462                }
36463            });
36464        });
36465    }
36466    /**
36467     * Increases the number of pending request
36468     * @deprecated pending requests are now tracked with zones.
36469     */
36470    increasePendingRequestCount() {
36471        this._pendingCount += 1;
36472        this._didWork = true;
36473        return this._pendingCount;
36474    }
36475    /**
36476     * Decreases the number of pending request
36477     * @deprecated pending requests are now tracked with zones
36478     */
36479    decreasePendingRequestCount() {
36480        this._pendingCount -= 1;
36481        if (this._pendingCount < 0) {
36482            throw new Error('pending async requests below zero');
36483        }
36484        this._runCallbacksIfReady();
36485        return this._pendingCount;
36486    }
36487    /**
36488     * Whether an associated application is stable
36489     */
36490    isStable() {
36491        return this._isZoneStable && this._pendingCount === 0 && !this._ngZone.hasPendingMacrotasks;
36492    }
36493    _runCallbacksIfReady() {
36494        if (this.isStable()) {
36495            // Schedules the call backs in a new frame so that it is always async.
36496            scheduleMicroTask(() => {
36497                while (this._callbacks.length !== 0) {
36498                    let cb = this._callbacks.pop();
36499                    clearTimeout(cb.timeoutId);
36500                    cb.doneCb(this._didWork);
36501                }
36502                this._didWork = false;
36503            });
36504        }
36505        else {
36506            // Still not stable, send updates.
36507            let pending = this.getPendingTasks();
36508            this._callbacks = this._callbacks.filter((cb) => {
36509                if (cb.updateCb && cb.updateCb(pending)) {
36510                    clearTimeout(cb.timeoutId);
36511                    return false;
36512                }
36513                return true;
36514            });
36515            this._didWork = true;
36516        }
36517    }
36518    getPendingTasks() {
36519        if (!this.taskTrackingZone) {
36520            return [];
36521        }
36522        // Copy the tasks data so that we don't leak tasks.
36523        return this.taskTrackingZone.macroTasks.map((t) => {
36524            return {
36525                source: t.source,
36526                // From TaskTrackingZone:
36527                // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40
36528                creationLocation: t.creationLocation,
36529                data: t.data
36530            };
36531        });
36532    }
36533    addCallback(cb, timeout, updateCb) {
36534        let timeoutId = -1;
36535        if (timeout && timeout > 0) {
36536            timeoutId = setTimeout(() => {
36537                this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId);
36538                cb(this._didWork, this.getPendingTasks());
36539            }, timeout);
36540        }
36541        this._callbacks.push({ doneCb: cb, timeoutId: timeoutId, updateCb: updateCb });
36542    }
36543    /**
36544     * Wait for the application to be stable with a timeout. If the timeout is reached before that
36545     * happens, the callback receives a list of the macro tasks that were pending, otherwise null.
36546     *
36547     * @param doneCb The callback to invoke when Angular is stable or the timeout expires
36548     *    whichever comes first.
36549     * @param timeout Optional. The maximum time to wait for Angular to become stable. If not
36550     *    specified, whenStable() will wait forever.
36551     * @param updateCb Optional. If specified, this callback will be invoked whenever the set of
36552     *    pending macrotasks changes. If this callback returns true doneCb will not be invoked
36553     *    and no further updates will be issued.
36554     */
36555    whenStable(doneCb, timeout, updateCb) {
36556        if (updateCb && !this.taskTrackingZone) {
36557            throw new Error('Task tracking zone is required when passing an update callback to ' +
36558                'whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');
36559        }
36560        // These arguments are 'Function' above to keep the public API simple.
36561        this.addCallback(doneCb, timeout, updateCb);
36562        this._runCallbacksIfReady();
36563    }
36564    /**
36565     * Get the number of pending requests
36566     * @deprecated pending requests are now tracked with zones
36567     */
36568    getPendingRequestCount() {
36569        return this._pendingCount;
36570    }
36571    /**
36572     * Find providers by name
36573     * @param using The root element to search from
36574     * @param provider The name of binding variable
36575     * @param exactMatch Whether using exactMatch
36576     */
36577    findProviders(using, provider, exactMatch) {
36578        // TODO(juliemr): implement.
36579        return [];
36580    }
36581}
36582Testability.ɵfac = function Testability_Factory(t) { return new (t || Testability)(ɵɵinject(NgZone)); };
36583Testability.ɵprov = ɵɵdefineInjectable({ token: Testability, factory: Testability.ɵfac });
36584Testability.ctorParameters = () => [
36585    { type: NgZone }
36586];
36587(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Testability, [{
36588        type: Injectable
36589    }], function () { return [{ type: NgZone }]; }, null); })();
36590/**
36591 * A global registry of {@link Testability} instances for specific elements.
36592 * @publicApi
36593 */
36594class TestabilityRegistry {
36595    constructor() {
36596        /** @internal */
36597        this._applications = new Map();
36598        _testabilityGetter.addToWindow(this);
36599    }
36600    /**
36601     * Registers an application with a testability hook so that it can be tracked
36602     * @param token token of application, root element
36603     * @param testability Testability hook
36604     */
36605    registerApplication(token, testability) {
36606        this._applications.set(token, testability);
36607    }
36608    /**
36609     * Unregisters an application.
36610     * @param token token of application, root element
36611     */
36612    unregisterApplication(token) {
36613        this._applications.delete(token);
36614    }
36615    /**
36616     * Unregisters all applications
36617     */
36618    unregisterAllApplications() {
36619        this._applications.clear();
36620    }
36621    /**
36622     * Get a testability hook associated with the application
36623     * @param elem root element
36624     */
36625    getTestability(elem) {
36626        return this._applications.get(elem) || null;
36627    }
36628    /**
36629     * Get all registered testabilities
36630     */
36631    getAllTestabilities() {
36632        return Array.from(this._applications.values());
36633    }
36634    /**
36635     * Get all registered applications(root elements)
36636     */
36637    getAllRootElements() {
36638        return Array.from(this._applications.keys());
36639    }
36640    /**
36641     * Find testability of a node in the Tree
36642     * @param elem node
36643     * @param findInAncestors whether finding testability in ancestors if testability was not found in
36644     * current node
36645     */
36646    findTestabilityInTree(elem, findInAncestors = true) {
36647        return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);
36648    }
36649}
36650TestabilityRegistry.ɵfac = function TestabilityRegistry_Factory(t) { return new (t || TestabilityRegistry)(); };
36651TestabilityRegistry.ɵprov = ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac });
36652TestabilityRegistry.ctorParameters = () => [];
36653(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{
36654        type: Injectable
36655    }], function () { return []; }, null); })();
36656class _NoopGetTestability {
36657    addToWindow(registry) { }
36658    findTestabilityInTree(registry, elem, findInAncestors) {
36659        return null;
36660    }
36661}
36662/**
36663 * Set the {@link GetTestability} implementation used by the Angular testing framework.
36664 * @publicApi
36665 */
36666function setTestabilityGetter(getter) {
36667    _testabilityGetter = getter;
36668}
36669let _testabilityGetter = new _NoopGetTestability();
36670
36671/**
36672 * @license
36673 * Copyright Google LLC All Rights Reserved.
36674 *
36675 * Use of this source code is governed by an MIT-style license that can be
36676 * found in the LICENSE file at https://angular.io/license
36677 */
36678/**
36679 * This file is used to control if the default rendering pipeline should be `ViewEngine` or `Ivy`.
36680 *
36681 * For more information on how to run and debug tests with either Ivy or View Engine (legacy),
36682 * please see [BAZEL.md](./docs/BAZEL.md).
36683 */
36684let _devMode = true;
36685let _runModeLocked = false;
36686/**
36687 * Returns whether Angular is in development mode. After called once,
36688 * the value is locked and won't change any more.
36689 *
36690 * By default, this is true, unless a user calls `enableProdMode` before calling this.
36691 *
36692 * @publicApi
36693 */
36694function isDevMode() {
36695    _runModeLocked = true;
36696    return _devMode;
36697}
36698/**
36699 * Disable Angular's development mode, which turns off assertions and other
36700 * checks within the framework.
36701 *
36702 * One important assertion this disables verifies that a change detection pass
36703 * does not result in additional changes to any bindings (also known as
36704 * unidirectional data flow).
36705 *
36706 * @publicApi
36707 */
36708function enableProdMode() {
36709    if (_runModeLocked) {
36710        throw new Error('Cannot enable prod mode after platform setup.');
36711    }
36712    // The below check is there so when ngDevMode is set via terser
36713    // `global['ngDevMode'] = false;` is also dropped.
36714    if (typeof ngDevMode === undefined || !!ngDevMode) {
36715        _global['ngDevMode'] = false;
36716    }
36717    _devMode = false;
36718}
36719
36720/**
36721 * @license
36722 * Copyright Google LLC All Rights Reserved.
36723 *
36724 * Use of this source code is governed by an MIT-style license that can be
36725 * found in the LICENSE file at https://angular.io/license
36726 */
36727let _platform;
36728let compileNgModuleFactory = compileNgModuleFactory__POST_R3__;
36729function compileNgModuleFactory__PRE_R3__(injector, options, moduleType) {
36730    const compilerFactory = injector.get(CompilerFactory);
36731    const compiler = compilerFactory.createCompiler([options]);
36732    return compiler.compileModuleAsync(moduleType);
36733}
36734function compileNgModuleFactory__POST_R3__(injector, options, moduleType) {
36735    ngDevMode && assertNgModuleType(moduleType);
36736    const moduleFactory = new NgModuleFactory$1(moduleType);
36737    // All of the logic below is irrelevant for AOT-compiled code.
36738    if (typeof ngJitMode !== 'undefined' && !ngJitMode) {
36739        return Promise.resolve(moduleFactory);
36740    }
36741    const compilerOptions = injector.get(COMPILER_OPTIONS, []).concat(options);
36742    // Configure the compiler to use the provided options. This call may fail when multiple modules
36743    // are bootstrapped with incompatible options, as a component can only be compiled according to
36744    // a single set of options.
36745    setJitOptions({
36746        defaultEncapsulation: _lastDefined(compilerOptions.map(opts => opts.defaultEncapsulation)),
36747        preserveWhitespaces: _lastDefined(compilerOptions.map(opts => opts.preserveWhitespaces)),
36748    });
36749    if (isComponentResourceResolutionQueueEmpty()) {
36750        return Promise.resolve(moduleFactory);
36751    }
36752    const compilerProviders = _mergeArrays(compilerOptions.map(o => o.providers));
36753    // In case there are no compiler providers, we just return the module factory as
36754    // there won't be any resource loader. This can happen with Ivy, because AOT compiled
36755    // modules can be still passed through "bootstrapModule". In that case we shouldn't
36756    // unnecessarily require the JIT compiler.
36757    if (compilerProviders.length === 0) {
36758        return Promise.resolve(moduleFactory);
36759    }
36760    const compiler = getCompilerFacade();
36761    const compilerInjector = Injector.create({ providers: compilerProviders });
36762    const resourceLoader = compilerInjector.get(compiler.ResourceLoader);
36763    // The resource loader can also return a string while the "resolveComponentResources"
36764    // always expects a promise. Therefore we need to wrap the returned value in a promise.
36765    return resolveComponentResources(url => Promise.resolve(resourceLoader.get(url)))
36766        .then(() => moduleFactory);
36767}
36768// the `window.ng` global utilities are only available in non-VE versions of
36769// Angular. The function switch below will make sure that the code is not
36770// included into Angular when PRE mode is active.
36771function publishDefaultGlobalUtils__PRE_R3__() { }
36772function publishDefaultGlobalUtils__POST_R3__() {
36773    ngDevMode && publishDefaultGlobalUtils();
36774}
36775let publishDefaultGlobalUtils$1 = publishDefaultGlobalUtils__POST_R3__;
36776let isBoundToModule = isBoundToModule__POST_R3__;
36777function isBoundToModule__PRE_R3__(cf) {
36778    return cf instanceof ComponentFactoryBoundToModule;
36779}
36780function isBoundToModule__POST_R3__(cf) {
36781    return cf.isBoundToModule;
36782}
36783const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
36784/**
36785 * A token for third-party components that can register themselves with NgProbe.
36786 *
36787 * @publicApi
36788 */
36789class NgProbeToken {
36790    constructor(name, token) {
36791        this.name = name;
36792        this.token = token;
36793    }
36794}
36795/**
36796 * Creates a platform.
36797 * Platforms must be created on launch using this function.
36798 *
36799 * @publicApi
36800 */
36801function createPlatform(injector) {
36802    if (_platform && !_platform.destroyed &&
36803        !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
36804        throw new Error('There can be only one platform. Destroy the previous one to create a new one.');
36805    }
36806    publishDefaultGlobalUtils$1();
36807    _platform = injector.get(PlatformRef);
36808    const inits = injector.get(PLATFORM_INITIALIZER, null);
36809    if (inits)
36810        inits.forEach((init) => init());
36811    return _platform;
36812}
36813/**
36814 * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
36815 * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
36816 * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
36817 * to build up configurations that might be required by different libraries or parts of the
36818 * application.
36819 * @param name Identifies the new platform factory.
36820 * @param providers A set of dependency providers for platforms created with the new factory.
36821 *
36822 * @publicApi
36823 */
36824function createPlatformFactory(parentPlatformFactory, name, providers = []) {
36825    const desc = `Platform: ${name}`;
36826    const marker = new InjectionToken(desc);
36827    return (extraProviders = []) => {
36828        let platform = getPlatform();
36829        if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
36830            if (parentPlatformFactory) {
36831                parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
36832            }
36833            else {
36834                const injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true }, {
36835                    provide: INJECTOR_SCOPE,
36836                    useValue: 'platform'
36837                });
36838                createPlatform(Injector.create({ providers: injectedProviders, name: desc }));
36839            }
36840        }
36841        return assertPlatform(marker);
36842    };
36843}
36844/**
36845 * Checks that there is currently a platform that contains the given token as a provider.
36846 *
36847 * @publicApi
36848 */
36849function assertPlatform(requiredToken) {
36850    const platform = getPlatform();
36851    if (!platform) {
36852        throw new Error('No platform exists!');
36853    }
36854    if (!platform.injector.get(requiredToken, null)) {
36855        throw new Error('A platform with a different configuration has been created. Please destroy it first.');
36856    }
36857    return platform;
36858}
36859/**
36860 * Destroys the current Angular platform and all Angular applications on the page.
36861 * Destroys all modules and listeners registered with the platform.
36862 *
36863 * @publicApi
36864 */
36865function destroyPlatform() {
36866    if (_platform && !_platform.destroyed) {
36867        _platform.destroy();
36868    }
36869}
36870/**
36871 * Returns the current platform.
36872 *
36873 * @publicApi
36874 */
36875function getPlatform() {
36876    return _platform && !_platform.destroyed ? _platform : null;
36877}
36878/**
36879 * The Angular platform is the entry point for Angular on a web page.
36880 * Each page has exactly one platform. Services (such as reflection) which are common
36881 * to every Angular application running on the page are bound in its scope.
36882 * A page's platform is initialized implicitly when a platform is created using a platform
36883 * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
36884 *
36885 * @publicApi
36886 */
36887class PlatformRef {
36888    /** @internal */
36889    constructor(_injector) {
36890        this._injector = _injector;
36891        this._modules = [];
36892        this._destroyListeners = [];
36893        this._destroyed = false;
36894    }
36895    /**
36896     * Creates an instance of an `@NgModule` for the given platform for offline compilation.
36897     *
36898     * @usageNotes
36899     *
36900     * The following example creates the NgModule for a browser platform.
36901     *
36902     * ```typescript
36903     * my_module.ts:
36904     *
36905     * @NgModule({
36906     *   imports: [BrowserModule]
36907     * })
36908     * class MyModule {}
36909     *
36910     * main.ts:
36911     * import {MyModuleNgFactory} from './my_module.ngfactory';
36912     * import {platformBrowser} from '@angular/platform-browser';
36913     *
36914     * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);
36915     * ```
36916     */
36917    bootstrapModuleFactory(moduleFactory, options) {
36918        // Note: We need to create the NgZone _before_ we instantiate the module,
36919        // as instantiating the module creates some providers eagerly.
36920        // So we create a mini parent injector that just contains the new NgZone and
36921        // pass that as parent to the NgModuleFactory.
36922        const ngZoneOption = options ? options.ngZone : undefined;
36923        const ngZoneEventCoalescing = (options && options.ngZoneEventCoalescing) || false;
36924        const ngZoneRunCoalescing = (options && options.ngZoneRunCoalescing) || false;
36925        const ngZone = getNgZone(ngZoneOption, { ngZoneEventCoalescing, ngZoneRunCoalescing });
36926        const providers = [{ provide: NgZone, useValue: ngZone }];
36927        // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
36928        // created within the Angular zone
36929        // Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be
36930        // created outside of the Angular zone.
36931        return ngZone.run(() => {
36932            const ngZoneInjector = Injector.create({ providers: providers, parent: this.injector, name: moduleFactory.moduleType.name });
36933            const moduleRef = moduleFactory.create(ngZoneInjector);
36934            const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
36935            if (!exceptionHandler) {
36936                throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');
36937            }
36938            ngZone.runOutsideAngular(() => {
36939                const subscription = ngZone.onError.subscribe({
36940                    next: (error) => {
36941                        exceptionHandler.handleError(error);
36942                    }
36943                });
36944                moduleRef.onDestroy(() => {
36945                    remove(this._modules, moduleRef);
36946                    subscription.unsubscribe();
36947                });
36948            });
36949            return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
36950                const initStatus = moduleRef.injector.get(ApplicationInitStatus);
36951                initStatus.runInitializers();
36952                return initStatus.donePromise.then(() => {
36953                    if (ivyEnabled) {
36954                        // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy
36955                        const localeId = moduleRef.injector.get(LOCALE_ID$1, DEFAULT_LOCALE_ID);
36956                        setLocaleId(localeId || DEFAULT_LOCALE_ID);
36957                    }
36958                    this._moduleDoBootstrap(moduleRef);
36959                    return moduleRef;
36960                });
36961            });
36962        });
36963    }
36964    /**
36965     * Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.
36966     *
36967     * @usageNotes
36968     * ### Simple Example
36969     *
36970     * ```typescript
36971     * @NgModule({
36972     *   imports: [BrowserModule]
36973     * })
36974     * class MyModule {}
36975     *
36976     * let moduleRef = platformBrowser().bootstrapModule(MyModule);
36977     * ```
36978     *
36979     */
36980    bootstrapModule(moduleType, compilerOptions = []) {
36981        const options = optionsReducer({}, compilerOptions);
36982        return compileNgModuleFactory(this.injector, options, moduleType)
36983            .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));
36984    }
36985    _moduleDoBootstrap(moduleRef) {
36986        const appRef = moduleRef.injector.get(ApplicationRef);
36987        if (moduleRef._bootstrapComponents.length > 0) {
36988            moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));
36989        }
36990        else if (moduleRef.instance.ngDoBootstrap) {
36991            moduleRef.instance.ngDoBootstrap(appRef);
36992        }
36993        else {
36994            throw new Error(`The module ${stringify(moduleRef.instance
36995                .constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
36996                `Please define one of these.`);
36997        }
36998        this._modules.push(moduleRef);
36999    }
37000    /**
37001     * Registers a listener to be called when the platform is destroyed.
37002     */
37003    onDestroy(callback) {
37004        this._destroyListeners.push(callback);
37005    }
37006    /**
37007     * Retrieves the platform {@link Injector}, which is the parent injector for
37008     * every Angular application on the page and provides singleton providers.
37009     */
37010    get injector() {
37011        return this._injector;
37012    }
37013    /**
37014     * Destroys the current Angular platform and all Angular applications on the page.
37015     * Destroys all modules and listeners registered with the platform.
37016     */
37017    destroy() {
37018        if (this._destroyed) {
37019            throw new Error('The platform has already been destroyed!');
37020        }
37021        this._modules.slice().forEach(module => module.destroy());
37022        this._destroyListeners.forEach(listener => listener());
37023        this._destroyed = true;
37024    }
37025    get destroyed() {
37026        return this._destroyed;
37027    }
37028}
37029PlatformRef.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); };
37030PlatformRef.ɵprov = ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac });
37031PlatformRef.ctorParameters = () => [
37032    { type: Injector }
37033];
37034(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
37035        type: Injectable
37036    }], function () { return [{ type: Injector }]; }, null); })();
37037function getNgZone(ngZoneOption, extra) {
37038    let ngZone;
37039    if (ngZoneOption === 'noop') {
37040        ngZone = new NoopNgZone();
37041    }
37042    else {
37043        ngZone = (ngZoneOption === 'zone.js' ? undefined : ngZoneOption) || new NgZone({
37044            enableLongStackTrace: isDevMode(),
37045            shouldCoalesceEventChangeDetection: !!(extra === null || extra === void 0 ? void 0 : extra.ngZoneEventCoalescing),
37046            shouldCoalesceRunChangeDetection: !!(extra === null || extra === void 0 ? void 0 : extra.ngZoneRunCoalescing)
37047        });
37048    }
37049    return ngZone;
37050}
37051function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
37052    try {
37053        const result = callback();
37054        if (isPromise(result)) {
37055            return result.catch((e) => {
37056                ngZone.runOutsideAngular(() => errorHandler.handleError(e));
37057                // rethrow as the exception handler might not do it
37058                throw e;
37059            });
37060        }
37061        return result;
37062    }
37063    catch (e) {
37064        ngZone.runOutsideAngular(() => errorHandler.handleError(e));
37065        // rethrow as the exception handler might not do it
37066        throw e;
37067    }
37068}
37069function optionsReducer(dst, objs) {
37070    if (Array.isArray(objs)) {
37071        dst = objs.reduce(optionsReducer, dst);
37072    }
37073    else {
37074        dst = Object.assign(Object.assign({}, dst), objs);
37075    }
37076    return dst;
37077}
37078/**
37079 * A reference to an Angular application running on a page.
37080 *
37081 * @usageNotes
37082 *
37083 * {@a is-stable-examples}
37084 * ### isStable examples and caveats
37085 *
37086 * Note two important points about `isStable`, demonstrated in the examples below:
37087 * - the application will never be stable if you start any kind
37088 * of recurrent asynchronous task when the application starts
37089 * (for example for a polling process, started with a `setInterval`, a `setTimeout`
37090 * or using RxJS operators like `interval`);
37091 * - the `isStable` Observable runs outside of the Angular zone.
37092 *
37093 * Let's imagine that you start a recurrent task
37094 * (here incrementing a counter, using RxJS `interval`),
37095 * and at the same time subscribe to `isStable`.
37096 *
37097 * ```
37098 * constructor(appRef: ApplicationRef) {
37099 *   appRef.isStable.pipe(
37100 *      filter(stable => stable)
37101 *   ).subscribe(() => console.log('App is stable now');
37102 *   interval(1000).subscribe(counter => console.log(counter));
37103 * }
37104 * ```
37105 * In this example, `isStable` will never emit `true`,
37106 * and the trace "App is stable now" will never get logged.
37107 *
37108 * If you want to execute something when the app is stable,
37109 * you have to wait for the application to be stable
37110 * before starting your polling process.
37111 *
37112 * ```
37113 * constructor(appRef: ApplicationRef) {
37114 *   appRef.isStable.pipe(
37115 *     first(stable => stable),
37116 *     tap(stable => console.log('App is stable now')),
37117 *     switchMap(() => interval(1000))
37118 *   ).subscribe(counter => console.log(counter));
37119 * }
37120 * ```
37121 * In this example, the trace "App is stable now" will be logged
37122 * and then the counter starts incrementing every second.
37123 *
37124 * Note also that this Observable runs outside of the Angular zone,
37125 * which means that the code in the subscription
37126 * to this Observable will not trigger the change detection.
37127 *
37128 * Let's imagine that instead of logging the counter value,
37129 * you update a field of your component
37130 * and display it in its template.
37131 *
37132 * ```
37133 * constructor(appRef: ApplicationRef) {
37134 *   appRef.isStable.pipe(
37135 *     first(stable => stable),
37136 *     switchMap(() => interval(1000))
37137 *   ).subscribe(counter => this.value = counter);
37138 * }
37139 * ```
37140 * As the `isStable` Observable runs outside the zone,
37141 * the `value` field will be updated properly,
37142 * but the template will not be refreshed!
37143 *
37144 * You'll have to manually trigger the change detection to update the template.
37145 *
37146 * ```
37147 * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {
37148 *   appRef.isStable.pipe(
37149 *     first(stable => stable),
37150 *     switchMap(() => interval(1000))
37151 *   ).subscribe(counter => {
37152 *     this.value = counter;
37153 *     cd.detectChanges();
37154 *   });
37155 * }
37156 * ```
37157 *
37158 * Or make the subscription callback run inside the zone.
37159 *
37160 * ```
37161 * constructor(appRef: ApplicationRef, zone: NgZone) {
37162 *   appRef.isStable.pipe(
37163 *     first(stable => stable),
37164 *     switchMap(() => interval(1000))
37165 *   ).subscribe(counter => zone.run(() => this.value = counter));
37166 * }
37167 * ```
37168 *
37169 * @publicApi
37170 */
37171class ApplicationRef {
37172    /** @internal */
37173    constructor(_zone, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus) {
37174        this._zone = _zone;
37175        this._injector = _injector;
37176        this._exceptionHandler = _exceptionHandler;
37177        this._componentFactoryResolver = _componentFactoryResolver;
37178        this._initStatus = _initStatus;
37179        /** @internal */
37180        this._bootstrapListeners = [];
37181        this._views = [];
37182        this._runningTick = false;
37183        this._stable = true;
37184        /**
37185         * Get a list of component types registered to this application.
37186         * This list is populated even before the component is created.
37187         */
37188        this.componentTypes = [];
37189        /**
37190         * Get a list of components registered to this application.
37191         */
37192        this.components = [];
37193        this._onMicrotaskEmptySubscription = this._zone.onMicrotaskEmpty.subscribe({
37194            next: () => {
37195                this._zone.run(() => {
37196                    this.tick();
37197                });
37198            }
37199        });
37200        const isCurrentlyStable = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Observable"]((observer) => {
37201            this._stable = this._zone.isStable && !this._zone.hasPendingMacrotasks &&
37202                !this._zone.hasPendingMicrotasks;
37203            this._zone.runOutsideAngular(() => {
37204                observer.next(this._stable);
37205                observer.complete();
37206            });
37207        });
37208        const isStable = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Observable"]((observer) => {
37209            // Create the subscription to onStable outside the Angular Zone so that
37210            // the callback is run outside the Angular Zone.
37211            let stableSub;
37212            this._zone.runOutsideAngular(() => {
37213                stableSub = this._zone.onStable.subscribe(() => {
37214                    NgZone.assertNotInAngularZone();
37215                    // Check whether there are no pending macro/micro tasks in the next tick
37216                    // to allow for NgZone to update the state.
37217                    scheduleMicroTask(() => {
37218                        if (!this._stable && !this._zone.hasPendingMacrotasks &&
37219                            !this._zone.hasPendingMicrotasks) {
37220                            this._stable = true;
37221                            observer.next(true);
37222                        }
37223                    });
37224                });
37225            });
37226            const unstableSub = this._zone.onUnstable.subscribe(() => {
37227                NgZone.assertInAngularZone();
37228                if (this._stable) {
37229                    this._stable = false;
37230                    this._zone.runOutsideAngular(() => {
37231                        observer.next(false);
37232                    });
37233                }
37234            });
37235            return () => {
37236                stableSub.unsubscribe();
37237                unstableSub.unsubscribe();
37238            };
37239        });
37240        this.isStable =
37241            Object(rxjs__WEBPACK_IMPORTED_MODULE_0__["merge"])(isCurrentlyStable, isStable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["share"])()));
37242    }
37243    /**
37244     * Bootstrap a new component at the root level of the application.
37245     *
37246     * @usageNotes
37247     * ### Bootstrap process
37248     *
37249     * When bootstrapping a new root component into an application, Angular mounts the
37250     * specified application component onto DOM elements identified by the componentType's
37251     * selector and kicks off automatic change detection to finish initializing the component.
37252     *
37253     * Optionally, a component can be mounted onto a DOM element that does not match the
37254     * componentType's selector.
37255     *
37256     * ### Example
37257     * {@example core/ts/platform/platform.ts region='longform'}
37258     */
37259    bootstrap(componentOrFactory, rootSelectorOrNode) {
37260        if (!this._initStatus.done) {
37261            throw new Error('Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');
37262        }
37263        let componentFactory;
37264        if (componentOrFactory instanceof ComponentFactory) {
37265            componentFactory = componentOrFactory;
37266        }
37267        else {
37268            componentFactory =
37269                this._componentFactoryResolver.resolveComponentFactory(componentOrFactory);
37270        }
37271        this.componentTypes.push(componentFactory.componentType);
37272        // Create a factory associated with the current module if it's not bound to some other
37273        const ngModule = isBoundToModule(componentFactory) ? undefined : this._injector.get(NgModuleRef);
37274        const selectorOrNode = rootSelectorOrNode || componentFactory.selector;
37275        const compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);
37276        const nativeElement = compRef.location.nativeElement;
37277        const testability = compRef.injector.get(Testability, null);
37278        const testabilityRegistry = testability && compRef.injector.get(TestabilityRegistry);
37279        if (testability && testabilityRegistry) {
37280            testabilityRegistry.registerApplication(nativeElement, testability);
37281        }
37282        compRef.onDestroy(() => {
37283            this.detachView(compRef.hostView);
37284            remove(this.components, compRef);
37285            if (testabilityRegistry) {
37286                testabilityRegistry.unregisterApplication(nativeElement);
37287            }
37288        });
37289        this._loadComponent(compRef);
37290        // Note that we have still left the `isDevMode()` condition in order to avoid
37291        // creating a breaking change for projects that still use the View Engine.
37292        if ((typeof ngDevMode === 'undefined' || ngDevMode) && isDevMode()) {
37293            const _console = this._injector.get(Console);
37294            _console.log(`Angular is running in development mode. Call enableProdMode() to enable production mode.`);
37295        }
37296        return compRef;
37297    }
37298    /**
37299     * Invoke this method to explicitly process change detection and its side-effects.
37300     *
37301     * In development mode, `tick()` also performs a second change detection cycle to ensure that no
37302     * further changes are detected. If additional changes are picked up during this second cycle,
37303     * bindings in the app have side-effects that cannot be resolved in a single change detection
37304     * pass.
37305     * In this case, Angular throws an error, since an Angular application can only have one change
37306     * detection pass during which all change detection must complete.
37307     */
37308    tick() {
37309        if (this._runningTick) {
37310            throw new Error('ApplicationRef.tick is called recursively');
37311        }
37312        try {
37313            this._runningTick = true;
37314            for (let view of this._views) {
37315                view.detectChanges();
37316            }
37317            // Note that we have still left the `isDevMode()` condition in order to avoid
37318            // creating a breaking change for projects that still use the View Engine.
37319            if ((typeof ngDevMode === 'undefined' || ngDevMode) && isDevMode()) {
37320                for (let view of this._views) {
37321                    view.checkNoChanges();
37322                }
37323            }
37324        }
37325        catch (e) {
37326            // Attention: Don't rethrow as it could cancel subscriptions to Observables!
37327            this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e));
37328        }
37329        finally {
37330            this._runningTick = false;
37331        }
37332    }
37333    /**
37334     * Attaches a view so that it will be dirty checked.
37335     * The view will be automatically detached when it is destroyed.
37336     * This will throw if the view is already attached to a ViewContainer.
37337     */
37338    attachView(viewRef) {
37339        const view = viewRef;
37340        this._views.push(view);
37341        view.attachToAppRef(this);
37342    }
37343    /**
37344     * Detaches a view from dirty checking again.
37345     */
37346    detachView(viewRef) {
37347        const view = viewRef;
37348        remove(this._views, view);
37349        view.detachFromAppRef();
37350    }
37351    _loadComponent(componentRef) {
37352        this.attachView(componentRef.hostView);
37353        this.tick();
37354        this.components.push(componentRef);
37355        // Get the listeners lazily to prevent DI cycles.
37356        const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []).concat(this._bootstrapListeners);
37357        listeners.forEach((listener) => listener(componentRef));
37358    }
37359    /** @internal */
37360    ngOnDestroy() {
37361        this._views.slice().forEach((view) => view.destroy());
37362        this._onMicrotaskEmptySubscription.unsubscribe();
37363    }
37364    /**
37365     * Returns the number of attached views.
37366     */
37367    get viewCount() {
37368        return this._views.length;
37369    }
37370}
37371ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ComponentFactoryResolver), ɵɵinject(ApplicationInitStatus)); };
37372ApplicationRef.ɵprov = ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac });
37373ApplicationRef.ctorParameters = () => [
37374    { type: NgZone },
37375    { type: Injector },
37376    { type: ErrorHandler },
37377    { type: ComponentFactoryResolver },
37378    { type: ApplicationInitStatus }
37379];
37380(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
37381        type: Injectable
37382    }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ComponentFactoryResolver }, { type: ApplicationInitStatus }]; }, null); })();
37383function remove(list, el) {
37384    const index = list.indexOf(el);
37385    if (index > -1) {
37386        list.splice(index, 1);
37387    }
37388}
37389function _lastDefined(args) {
37390    for (let i = args.length - 1; i >= 0; i--) {
37391        if (args[i] !== undefined) {
37392            return args[i];
37393        }
37394    }
37395    return undefined;
37396}
37397function _mergeArrays(parts) {
37398    const result = [];
37399    parts.forEach((part) => part && result.push(...part));
37400    return result;
37401}
37402
37403/**
37404 * @license
37405 * Copyright Google LLC All Rights Reserved.
37406 *
37407 * Use of this source code is governed by an MIT-style license that can be
37408 * found in the LICENSE file at https://angular.io/license
37409 */
37410
37411/**
37412 * @license
37413 * Copyright Google LLC All Rights Reserved.
37414 *
37415 * Use of this source code is governed by an MIT-style license that can be
37416 * found in the LICENSE file at https://angular.io/license
37417 */
37418
37419/**
37420 * @license
37421 * Copyright Google LLC All Rights Reserved.
37422 *
37423 * Use of this source code is governed by an MIT-style license that can be
37424 * found in the LICENSE file at https://angular.io/license
37425 */
37426/**
37427 * Used to load ng module factories.
37428 *
37429 * @publicApi
37430 * @deprecated the `string` form of `loadChildren` is deprecated, and `NgModuleFactoryLoader` is
37431 * part of its implementation. See `LoadChildren` for more details.
37432 */
37433class NgModuleFactoryLoader {
37434}
37435function getModuleFactory__PRE_R3__(id) {
37436    const factory = getRegisteredNgModuleType(id);
37437    if (!factory)
37438        throw noModuleError(id);
37439    return factory;
37440}
37441function getModuleFactory__POST_R3__(id) {
37442    const type = getRegisteredNgModuleType(id);
37443    if (!type)
37444        throw noModuleError(id);
37445    return new NgModuleFactory$1(type);
37446}
37447/**
37448 * Returns the NgModuleFactory with the given id, if it exists and has been loaded.
37449 * Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module
37450 * cannot be found.
37451 * @publicApi
37452 */
37453const getModuleFactory = getModuleFactory__POST_R3__;
37454function noModuleError(id) {
37455    return new Error(`No module with ID ${id} loaded`);
37456}
37457
37458/**
37459 * @license
37460 * Copyright Google LLC All Rights Reserved.
37461 *
37462 * Use of this source code is governed by an MIT-style license that can be
37463 * found in the LICENSE file at https://angular.io/license
37464 */
37465const _SEPARATOR = '#';
37466const FACTORY_CLASS_SUFFIX = 'NgFactory';
37467/**
37468 * Configuration for SystemJsNgModuleLoader.
37469 * token.
37470 *
37471 * @publicApi
37472 * @deprecated the `string` form of `loadChildren` is deprecated, and `SystemJsNgModuleLoaderConfig`
37473 * is part of its implementation. See `LoadChildren` for more details.
37474 */
37475class SystemJsNgModuleLoaderConfig {
37476}
37477const DEFAULT_CONFIG = {
37478    factoryPathPrefix: '',
37479    factoryPathSuffix: '.ngfactory',
37480};
37481/**
37482 * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory
37483 * @publicApi
37484 * @deprecated the `string` form of `loadChildren` is deprecated, and `SystemJsNgModuleLoader` is
37485 * part of its implementation. See `LoadChildren` for more details.
37486 */
37487class SystemJsNgModuleLoader {
37488    constructor(_compiler, config) {
37489        this._compiler = _compiler;
37490        this._config = config || DEFAULT_CONFIG;
37491    }
37492    load(path) {
37493        const legacyOfflineMode = !ivyEnabled && this._compiler instanceof Compiler;
37494        return legacyOfflineMode ? this.loadFactory(path) : this.loadAndCompile(path);
37495    }
37496    loadAndCompile(path) {
37497        let [module, exportName] = path.split(_SEPARATOR);
37498        if (exportName === undefined) {
37499            exportName = 'default';
37500        }
37501        return __webpack_require__("zn8P")(module)
37502            .then((module) => module[exportName])
37503            .then((type) => checkNotEmpty(type, module, exportName))
37504            .then((type) => this._compiler.compileModuleAsync(type));
37505    }
37506    loadFactory(path) {
37507        let [module, exportName] = path.split(_SEPARATOR);
37508        let factoryClassSuffix = FACTORY_CLASS_SUFFIX;
37509        if (exportName === undefined) {
37510            exportName = 'default';
37511            factoryClassSuffix = '';
37512        }
37513        return __webpack_require__("zn8P")(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix)
37514            .then((module) => module[exportName + factoryClassSuffix])
37515            .then((factory) => checkNotEmpty(factory, module, exportName));
37516    }
37517}
37518SystemJsNgModuleLoader.ɵfac = function SystemJsNgModuleLoader_Factory(t) { return new (t || SystemJsNgModuleLoader)(ɵɵinject(Compiler), ɵɵinject(SystemJsNgModuleLoaderConfig, 8)); };
37519SystemJsNgModuleLoader.ɵprov = ɵɵdefineInjectable({ token: SystemJsNgModuleLoader, factory: SystemJsNgModuleLoader.ɵfac });
37520SystemJsNgModuleLoader.ctorParameters = () => [
37521    { type: Compiler },
37522    { type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional }] }
37523];
37524(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SystemJsNgModuleLoader, [{
37525        type: Injectable
37526    }], function () { return [{ type: Compiler }, { type: SystemJsNgModuleLoaderConfig, decorators: [{
37527                type: Optional
37528            }] }]; }, null); })();
37529function checkNotEmpty(value, modulePath, exportName) {
37530    if (!value) {
37531        throw new Error(`Cannot find '${exportName}' in '${modulePath}'`);
37532    }
37533    return value;
37534}
37535
37536/**
37537 * @license
37538 * Copyright Google LLC All Rights Reserved.
37539 *
37540 * Use of this source code is governed by an MIT-style license that can be
37541 * found in the LICENSE file at https://angular.io/license
37542 */
37543/**
37544 * Represents an Angular [view](guide/glossary#view "Definition").
37545 *
37546 * @see {@link ChangeDetectorRef#usage-notes Change detection usage}
37547 *
37548 * @publicApi
37549 */
37550class ViewRef$1 extends ChangeDetectorRef {
37551}
37552/**
37553 * Represents an Angular [view](guide/glossary#view) in a view container.
37554 * An [embedded view](guide/glossary#view-tree) can be referenced from a component
37555 * other than the hosting component whose template defines it, or it can be defined
37556 * independently by a `TemplateRef`.
37557 *
37558 * Properties of elements in a view can change, but the structure (number and order) of elements in
37559 * a view cannot. Change the structure of elements by inserting, moving, or
37560 * removing nested views in a view container.
37561 *
37562 * @see `ViewContainerRef`
37563 *
37564 * @usageNotes
37565 *
37566 * The following template breaks down into two separate `TemplateRef` instances,
37567 * an outer one and an inner one.
37568 *
37569 * ```
37570 * Count: {{items.length}}
37571 * <ul>
37572 *   <li *ngFor="let  item of items">{{item}}</li>
37573 * </ul>
37574 * ```
37575 *
37576 * This is the outer `TemplateRef`:
37577 *
37578 * ```
37579 * Count: {{items.length}}
37580 * <ul>
37581 *   <ng-template ngFor let-item [ngForOf]="items"></ng-template>
37582 * </ul>
37583 * ```
37584 *
37585 * This is the inner `TemplateRef`:
37586 *
37587 * ```
37588 *   <li>{{item}}</li>
37589 * ```
37590 *
37591 * The outer and inner `TemplateRef` instances are assembled into views as follows:
37592 *
37593 * ```
37594 * <!-- ViewRef: outer-0 -->
37595 * Count: 2
37596 * <ul>
37597 *   <ng-template view-container-ref></ng-template>
37598 *   <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->
37599 *   <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->
37600 * </ul>
37601 * <!-- /ViewRef: outer-0 -->
37602 * ```
37603 * @publicApi
37604 */
37605class EmbeddedViewRef extends ViewRef$1 {
37606}
37607
37608/**
37609 * @license
37610 * Copyright Google LLC All Rights Reserved.
37611 *
37612 * Use of this source code is governed by an MIT-style license that can be
37613 * found in the LICENSE file at https://angular.io/license
37614 */
37615
37616/**
37617 * @license
37618 * Copyright Google LLC All Rights Reserved.
37619 *
37620 * Use of this source code is governed by an MIT-style license that can be
37621 * found in the LICENSE file at https://angular.io/license
37622 */
37623/**
37624 * @publicApi
37625 */
37626class DebugEventListener {
37627    constructor(name, callback) {
37628        this.name = name;
37629        this.callback = callback;
37630    }
37631}
37632class DebugNode__PRE_R3__ {
37633    constructor(nativeNode, parent, _debugContext) {
37634        this.listeners = [];
37635        this.parent = null;
37636        this._debugContext = _debugContext;
37637        this.nativeNode = nativeNode;
37638        if (parent && parent instanceof DebugElement__PRE_R3__) {
37639            parent.addChild(this);
37640        }
37641    }
37642    get injector() {
37643        return this._debugContext.injector;
37644    }
37645    get componentInstance() {
37646        return this._debugContext.component;
37647    }
37648    get context() {
37649        return this._debugContext.context;
37650    }
37651    get references() {
37652        return this._debugContext.references;
37653    }
37654    get providerTokens() {
37655        return this._debugContext.providerTokens;
37656    }
37657}
37658class DebugElement__PRE_R3__ extends DebugNode__PRE_R3__ {
37659    constructor(nativeNode, parent, _debugContext) {
37660        super(nativeNode, parent, _debugContext);
37661        this.properties = {};
37662        this.attributes = {};
37663        this.classes = {};
37664        this.styles = {};
37665        this.childNodes = [];
37666        this.nativeElement = nativeNode;
37667    }
37668    addChild(child) {
37669        if (child) {
37670            this.childNodes.push(child);
37671            child.parent = this;
37672        }
37673    }
37674    removeChild(child) {
37675        const childIndex = this.childNodes.indexOf(child);
37676        if (childIndex !== -1) {
37677            child.parent = null;
37678            this.childNodes.splice(childIndex, 1);
37679        }
37680    }
37681    insertChildrenAfter(child, newChildren) {
37682        const siblingIndex = this.childNodes.indexOf(child);
37683        if (siblingIndex !== -1) {
37684            this.childNodes.splice(siblingIndex + 1, 0, ...newChildren);
37685            newChildren.forEach(c => {
37686                if (c.parent) {
37687                    c.parent.removeChild(c);
37688                }
37689                child.parent = this;
37690            });
37691        }
37692    }
37693    insertBefore(refChild, newChild) {
37694        const refIndex = this.childNodes.indexOf(refChild);
37695        if (refIndex === -1) {
37696            this.addChild(newChild);
37697        }
37698        else {
37699            if (newChild.parent) {
37700                newChild.parent.removeChild(newChild);
37701            }
37702            newChild.parent = this;
37703            this.childNodes.splice(refIndex, 0, newChild);
37704        }
37705    }
37706    query(predicate) {
37707        const results = this.queryAll(predicate);
37708        return results[0] || null;
37709    }
37710    queryAll(predicate) {
37711        const matches = [];
37712        _queryElementChildren(this, predicate, matches);
37713        return matches;
37714    }
37715    queryAllNodes(predicate) {
37716        const matches = [];
37717        _queryNodeChildren(this, predicate, matches);
37718        return matches;
37719    }
37720    get children() {
37721        return this.childNodes //
37722            .filter((node) => node instanceof DebugElement__PRE_R3__);
37723    }
37724    triggerEventHandler(eventName, eventObj) {
37725        this.listeners.forEach((listener) => {
37726            if (listener.name == eventName) {
37727                listener.callback(eventObj);
37728            }
37729        });
37730    }
37731}
37732/**
37733 * @publicApi
37734 */
37735function asNativeElements(debugEls) {
37736    return debugEls.map((el) => el.nativeElement);
37737}
37738function _queryElementChildren(element, predicate, matches) {
37739    element.childNodes.forEach(node => {
37740        if (node instanceof DebugElement__PRE_R3__) {
37741            if (predicate(node)) {
37742                matches.push(node);
37743            }
37744            _queryElementChildren(node, predicate, matches);
37745        }
37746    });
37747}
37748function _queryNodeChildren(parentNode, predicate, matches) {
37749    if (parentNode instanceof DebugElement__PRE_R3__) {
37750        parentNode.childNodes.forEach(node => {
37751            if (predicate(node)) {
37752                matches.push(node);
37753            }
37754            if (node instanceof DebugElement__PRE_R3__) {
37755                _queryNodeChildren(node, predicate, matches);
37756            }
37757        });
37758    }
37759}
37760class DebugNode__POST_R3__ {
37761    constructor(nativeNode) {
37762        this.nativeNode = nativeNode;
37763    }
37764    get parent() {
37765        const parent = this.nativeNode.parentNode;
37766        return parent ? new DebugElement__POST_R3__(parent) : null;
37767    }
37768    get injector() {
37769        return getInjector(this.nativeNode);
37770    }
37771    get componentInstance() {
37772        const nativeElement = this.nativeNode;
37773        return nativeElement &&
37774            (getComponent(nativeElement) || getOwningComponent(nativeElement));
37775    }
37776    get context() {
37777        return getComponent(this.nativeNode) || getContext(this.nativeNode);
37778    }
37779    get listeners() {
37780        return getListeners(this.nativeNode).filter(listener => listener.type === 'dom');
37781    }
37782    get references() {
37783        return getLocalRefs(this.nativeNode);
37784    }
37785    get providerTokens() {
37786        return getInjectionTokens(this.nativeNode);
37787    }
37788}
37789class DebugElement__POST_R3__ extends DebugNode__POST_R3__ {
37790    constructor(nativeNode) {
37791        ngDevMode && assertDomNode(nativeNode);
37792        super(nativeNode);
37793    }
37794    get nativeElement() {
37795        return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode : null;
37796    }
37797    get name() {
37798        try {
37799            const context = loadLContext(this.nativeNode);
37800            const lView = context.lView;
37801            const tData = lView[TVIEW].data;
37802            const tNode = tData[context.nodeIndex];
37803            return tNode.value;
37804        }
37805        catch (e) {
37806            return this.nativeNode.nodeName;
37807        }
37808    }
37809    /**
37810     *  Gets a map of property names to property values for an element.
37811     *
37812     *  This map includes:
37813     *  - Regular property bindings (e.g. `[id]="id"`)
37814     *  - Host property bindings (e.g. `host: { '[id]': "id" }`)
37815     *  - Interpolated property bindings (e.g. `id="{{ value }}")
37816     *
37817     *  It does not include:
37818     *  - input property bindings (e.g. `[myCustomInput]="value"`)
37819     *  - attribute bindings (e.g. `[attr.role]="menu"`)
37820     */
37821    get properties() {
37822        const context = loadLContext(this.nativeNode, false);
37823        if (context == null) {
37824            return {};
37825        }
37826        const lView = context.lView;
37827        const tData = lView[TVIEW].data;
37828        const tNode = tData[context.nodeIndex];
37829        const properties = {};
37830        // Collect properties from the DOM.
37831        copyDomProperties(this.nativeElement, properties);
37832        // Collect properties from the bindings. This is needed for animation renderer which has
37833        // synthetic properties which don't get reflected into the DOM.
37834        collectPropertyBindings(properties, tNode, lView, tData);
37835        return properties;
37836    }
37837    get attributes() {
37838        const attributes = {};
37839        const element = this.nativeElement;
37840        if (!element) {
37841            return attributes;
37842        }
37843        const context = loadLContext(element, false);
37844        if (context == null) {
37845            return {};
37846        }
37847        const lView = context.lView;
37848        const tNodeAttrs = lView[TVIEW].data[context.nodeIndex].attrs;
37849        const lowercaseTNodeAttrs = [];
37850        // For debug nodes we take the element's attribute directly from the DOM since it allows us
37851        // to account for ones that weren't set via bindings (e.g. ViewEngine keeps track of the ones
37852        // that are set through `Renderer2`). The problem is that the browser will lowercase all names,
37853        // however since we have the attributes already on the TNode, we can preserve the case by going
37854        // through them once, adding them to the `attributes` map and putting their lower-cased name
37855        // into an array. Afterwards when we're going through the native DOM attributes, we can check
37856        // whether we haven't run into an attribute already through the TNode.
37857        if (tNodeAttrs) {
37858            let i = 0;
37859            while (i < tNodeAttrs.length) {
37860                const attrName = tNodeAttrs[i];
37861                // Stop as soon as we hit a marker. We only care about the regular attributes. Everything
37862                // else will be handled below when we read the final attributes off the DOM.
37863                if (typeof attrName !== 'string')
37864                    break;
37865                const attrValue = tNodeAttrs[i + 1];
37866                attributes[attrName] = attrValue;
37867                lowercaseTNodeAttrs.push(attrName.toLowerCase());
37868                i += 2;
37869            }
37870        }
37871        const eAttrs = element.attributes;
37872        for (let i = 0; i < eAttrs.length; i++) {
37873            const attr = eAttrs[i];
37874            const lowercaseName = attr.name.toLowerCase();
37875            // Make sure that we don't assign the same attribute both in its
37876            // case-sensitive form and the lower-cased one from the browser.
37877            if (lowercaseTNodeAttrs.indexOf(lowercaseName) === -1) {
37878                // Save the lowercase name to align the behavior between browsers.
37879                // IE preserves the case, while all other browser convert it to lower case.
37880                attributes[lowercaseName] = attr.value;
37881            }
37882        }
37883        return attributes;
37884    }
37885    get styles() {
37886        if (this.nativeElement && this.nativeElement.style) {
37887            return this.nativeElement.style;
37888        }
37889        return {};
37890    }
37891    get classes() {
37892        const result = {};
37893        const element = this.nativeElement;
37894        // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`.
37895        const className = element.className;
37896        const classes = className && typeof className !== 'string' ? className.baseVal.split(' ') :
37897            className.split(' ');
37898        classes.forEach((value) => result[value] = true);
37899        return result;
37900    }
37901    get childNodes() {
37902        const childNodes = this.nativeNode.childNodes;
37903        const children = [];
37904        for (let i = 0; i < childNodes.length; i++) {
37905            const element = childNodes[i];
37906            children.push(getDebugNode__POST_R3__(element));
37907        }
37908        return children;
37909    }
37910    get children() {
37911        const nativeElement = this.nativeElement;
37912        if (!nativeElement)
37913            return [];
37914        const childNodes = nativeElement.children;
37915        const children = [];
37916        for (let i = 0; i < childNodes.length; i++) {
37917            const element = childNodes[i];
37918            children.push(getDebugNode__POST_R3__(element));
37919        }
37920        return children;
37921    }
37922    query(predicate) {
37923        const results = this.queryAll(predicate);
37924        return results[0] || null;
37925    }
37926    queryAll(predicate) {
37927        const matches = [];
37928        _queryAllR3(this, predicate, matches, true);
37929        return matches;
37930    }
37931    queryAllNodes(predicate) {
37932        const matches = [];
37933        _queryAllR3(this, predicate, matches, false);
37934        return matches;
37935    }
37936    triggerEventHandler(eventName, eventObj) {
37937        const node = this.nativeNode;
37938        const invokedListeners = [];
37939        this.listeners.forEach(listener => {
37940            if (listener.name === eventName) {
37941                const callback = listener.callback;
37942                callback.call(node, eventObj);
37943                invokedListeners.push(callback);
37944            }
37945        });
37946        // We need to check whether `eventListeners` exists, because it's something
37947        // that Zone.js only adds to `EventTarget` in browser environments.
37948        if (typeof node.eventListeners === 'function') {
37949            // Note that in Ivy we wrap event listeners with a call to `event.preventDefault` in some
37950            // cases. We use '__ngUnwrap__' as a special token that gives us access to the actual event
37951            // listener.
37952            node.eventListeners(eventName).forEach((listener) => {
37953                // In order to ensure that we can detect the special __ngUnwrap__ token described above, we
37954                // use `toString` on the listener and see if it contains the token. We use this approach to
37955                // ensure that it still worked with compiled code since it cannot remove or rename string
37956                // literals. We also considered using a special function name (i.e. if(listener.name ===
37957                // special)) but that was more cumbersome and we were also concerned the compiled code could
37958                // strip the name, turning the condition in to ("" === "") and always returning true.
37959                if (listener.toString().indexOf('__ngUnwrap__') !== -1) {
37960                    const unwrappedListener = listener('__ngUnwrap__');
37961                    return invokedListeners.indexOf(unwrappedListener) === -1 &&
37962                        unwrappedListener.call(node, eventObj);
37963                }
37964            });
37965        }
37966    }
37967}
37968function copyDomProperties(element, properties) {
37969    if (element) {
37970        // Skip own properties (as those are patched)
37971        let obj = Object.getPrototypeOf(element);
37972        const NodePrototype = Node.prototype;
37973        while (obj !== null && obj !== NodePrototype) {
37974            const descriptors = Object.getOwnPropertyDescriptors(obj);
37975            for (let key in descriptors) {
37976                if (!key.startsWith('__') && !key.startsWith('on')) {
37977                    // don't include properties starting with `__` and `on`.
37978                    // `__` are patched values which should not be included.
37979                    // `on` are listeners which also should not be included.
37980                    const value = element[key];
37981                    if (isPrimitiveValue(value)) {
37982                        properties[key] = value;
37983                    }
37984                }
37985            }
37986            obj = Object.getPrototypeOf(obj);
37987        }
37988    }
37989}
37990function isPrimitiveValue(value) {
37991    return typeof value === 'string' || typeof value === 'boolean' || typeof value === 'number' ||
37992        value === null;
37993}
37994function _queryAllR3(parentElement, predicate, matches, elementsOnly) {
37995    const context = loadLContext(parentElement.nativeNode, false);
37996    if (context !== null) {
37997        const parentTNode = context.lView[TVIEW].data[context.nodeIndex];
37998        _queryNodeChildrenR3(parentTNode, context.lView, predicate, matches, elementsOnly, parentElement.nativeNode);
37999    }
38000    else {
38001        // If the context is null, then `parentElement` was either created with Renderer2 or native DOM
38002        // APIs.
38003        _queryNativeNodeDescendants(parentElement.nativeNode, predicate, matches, elementsOnly);
38004    }
38005}
38006/**
38007 * Recursively match the current TNode against the predicate, and goe
38007s on with the next ones.
38008 *
38009 * @param tNode the current TNode
38010 * @param lView the LView of this TNode
38011 * @param predicate the predicate to match
38012 * @param matches the list of positive matches
38013 * @param elementsOnly whether only elements should be searched
38014 * @param rootNativeNode the root native node on which predicate should not be matched
38015 */
38016function _queryNodeChildrenR3(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) {
38017    ngDevMode && assertTNodeForLView(tNode, lView);
38018    const nativeNode = getNativeByTNodeOrNull(tNode, lView);
38019    // For each type of TNode, specific logic is executed.
38020    if (tNode.type & (3 /* AnyRNode */ | 8 /* ElementContainer */)) {
38021        // Case 1: the TNode is an element
38022        // The native node has to be checked.
38023        _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode);
38024        if (isComponentHost(tNode)) {
38025            // If the element is the host of a component, then all nodes in its view have to be processed.
38026            // Note: the component's content (tNode.child) will be processed from the insertion points.
38027            const componentView = getComponentLViewByIndex(tNode.index, lView);
38028            if (componentView && componentView[TVIEW].firstChild) {
38029                _queryNodeChildrenR3(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode);
38030            }
38031        }
38032        else {
38033            if (tNode.child) {
38034                // Otherwise, its children have to be processed.
38035                _queryNodeChildrenR3(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);
38036            }
38037            // We also have to query the DOM directly in order to catch elements inserted through
38038            // Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple
38039            // times. ViewEngine could do it more efficiently, because all the insertions go through
38040            // Renderer2, however that's not the case in Ivy. This approach is being used because:
38041            // 1. Matching the ViewEngine behavior would mean potentially introducing a depedency
38042            //    from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.
38043            // 2. We would have to make `Renderer3` "know" about debug nodes.
38044            // 3. It allows us to capture nodes that were inserted directly via the DOM.
38045            nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);
38046        }
38047        // In all cases, if a dynamic container exists for this node, each view inside it has to be
38048        // processed.
38049        const nodeOrContainer = lView[tNode.index];
38050        if (isLContainer(nodeOrContainer)) {
38051            _queryNodeChildrenInContainerR3(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);
38052        }
38053    }
38054    else if (tNode.type & 4 /* Container */) {
38055        // Case 2: the TNode is a container
38056        // The native node has to be checked.
38057        const lContainer = lView[tNode.index];
38058        _addQueryMatchR3(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode);
38059        // Each view inside the container has to be processed.
38060        _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode);
38061    }
38062    else if (tNode.type & 16 /* Projection */) {
38063        // Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).
38064        // The nodes projected at this location all need to be processed.
38065        const componentView = lView[DECLARATION_COMPONENT_VIEW];
38066        const componentHost = componentView[T_HOST];
38067        const head = componentHost.projection[tNode.projection];
38068        if (Array.isArray(head)) {
38069            for (let nativeNode of head) {
38070                _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode);
38071            }
38072        }
38073        else if (head) {
38074            const nextLView = componentView[PARENT];
38075            const nextTNode = nextLView[TVIEW].data[head.index];
38076            _queryNodeChildrenR3(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode);
38077        }
38078    }
38079    else if (tNode.child) {
38080        // Case 4: the TNode is a view.
38081        _queryNodeChildrenR3(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);
38082    }
38083    // We don't want to go to the next sibling of the root node.
38084    if (rootNativeNode !== nativeNode) {
38085        // To determine the next node to be processed, we need to use the next or the projectionNext
38086        // link, depending on whether the current node has been projected.
38087        const nextTNode = (tNode.flags & 4 /* isProjected */) ? tNode.projectionNext : tNode.next;
38088        if (nextTNode) {
38089            _queryNodeChildrenR3(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);
38090        }
38091    }
38092}
38093/**
38094 * Process all TNodes in a given container.
38095 *
38096 * @param lContainer the container to be processed
38097 * @param predicate the predicate to match
38098 * @param matches the list of positive matches
38099 * @param elementsOnly whether only elements should be searched
38100 * @param rootNativeNode the root native node on which predicate should not be matched
38101 */
38102function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {
38103    for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
38104        const childView = lContainer[i];
38105        const firstChild = childView[TVIEW].firstChild;
38106        if (firstChild) {
38107            _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);
38108        }
38109    }
38110}
38111/**
38112 * Match the current native node against the predicate.
38113 *
38114 * @param nativeNode the current native node
38115 * @param predicate the predicate to match
38116 * @param matches the list of positive matches
38117 * @param elementsOnly whether only elements should be searched
38118 * @param rootNativeNode the root native node on which predicate should not be matched
38119 */
38120function _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {
38121    if (rootNativeNode !== nativeNode) {
38122        const debugNode = getDebugNode$1(nativeNode);
38123        if (!debugNode) {
38124            return;
38125        }
38126        // Type of the "predicate and "matches" array are set based on the value of
38127        // the "elementsOnly" parameter. TypeScript is not able to properly infer these
38128        // types with generics, so we manually cast the parameters accordingly.
38129        if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&
38130            matches.indexOf(debugNode) === -1) {
38131            matches.push(debugNode);
38132        }
38133        else if (!elementsOnly && predicate(debugNode) &&
38134            matches.indexOf(debugNode) === -1) {
38135            matches.push(debugNode);
38136        }
38137    }
38138}
38139/**
38140 * Match all the descendants of a DOM node against a predicate.
38141 *
38142 * @param nativeNode the current native node
38143 * @param predicate the predicate to match
38144 * @param matches the list where matches are stored
38145 * @param elementsOnly whether only elements should be searched
38146 */
38147function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {
38148    const nodes = parentNode.childNodes;
38149    const length = nodes.length;
38150    for (let i = 0; i < length; i++) {
38151        const node = nodes[i];
38152        const debugNode = getDebugNode$1(node);
38153        if (debugNode) {
38154            if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&
38155                matches.indexOf(debugNode) === -1) {
38156                matches.push(debugNode);
38157            }
38158            else if (!elementsOnly && predicate(debugNode) &&
38159                matches.indexOf(debugNode) === -1) {
38160                matches.push(debugNode);
38161            }
38162            _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);
38163        }
38164    }
38165}
38166/**
38167 * Iterates through the property bindings for a given node and generates
38168 * a map of property names to values. This map only contains property bindings
38169 * defined in templates, not in host bindings.
38170 */
38171function collectPropertyBindings(properties, tNode, lView, tData) {
38172    let bindingIndexes = tNode.propertyBindings;
38173    if (bindingIndexes !== null) {
38174        for (let i = 0; i < bindingIndexes.length; i++) {
38175            const bindingIndex = bindingIndexes[i];
38176            const propMetadata = tData[bindingIndex];
38177            const metadataParts = propMetadata.split(INTERPOLATION_DELIMITER);
38178            const propertyName = metadataParts[0];
38179            if (metadataParts.length > 1) {
38180                let value = metadataParts[1];
38181                for (let j = 1; j < metadataParts.length - 1; j++) {
38182                    value += renderStringify(lView[bindingIndex + j - 1]) + metadataParts[j + 1];
38183                }
38184                properties[propertyName] = value;
38185            }
38186            else {
38187                properties[propertyName] = lView[bindingIndex];
38188            }
38189        }
38190    }
38191}
38192// Need to keep the nodes in a global Map so that multiple angular apps are supported.
38193const _nativeNodeToDebugNode = new Map();
38194function getDebugNode__PRE_R3__(nativeNode) {
38195    return _nativeNodeToDebugNode.get(nativeNode) || null;
38196}
38197const NG_DEBUG_PROPERTY = '__ng_debug__';
38198function getDebugNode__POST_R3__(nativeNode) {
38199    if (nativeNode instanceof Node) {
38200        if (!(nativeNode.hasOwnProperty(NG_DEBUG_PROPERTY))) {
38201            nativeNode[NG_DEBUG_PROPERTY] = nativeNode.nodeType == Node.ELEMENT_NODE ?
38202                new DebugElement__POST_R3__(nativeNode) :
38203                new DebugNode__POST_R3__(nativeNode);
38204        }
38205        return nativeNode[NG_DEBUG_PROPERTY];
38206    }
38207    return null;
38208}
38209/**
38210 * @publicApi
38211 */
38212const getDebugNode$1 = getDebugNode__POST_R3__;
38213function getDebugNodeR2__PRE_R3__(nativeNode) {
38214    return getDebugNode__PRE_R3__(nativeNode);
38215}
38216function getDebugNodeR2__POST_R3__(_nativeNode) {
38217    return null;
38218}
38219const getDebugNodeR2 = getDebugNodeR2__POST_R3__;
38220function getAllDebugNodes() {
38221    return Array.from(_nativeNodeToDebugNode.values());
38222}
38223function indexDebugNode(node) {
38224    _nativeNodeToDebugNode.set(node.nativeNode, node);
38225}
38226function removeDebugNodeFromIndex(node) {
38227    _nativeNodeToDebugNode.delete(node.nativeNode);
38228}
38229/**
38230 * @publicApi
38231 */
38232const DebugNode = DebugNode__POST_R3__;
38233/**
38234 * @publicApi
38235 */
38236const DebugElement = DebugElement__POST_R3__;
38237
38238/**
38239 * @license
38240 * Copyright Google LLC All Rights Reserved.
38241 *
38242 * Use of this source code is governed by an MIT-style license that can be
38243 * found in the LICENSE file at https://angular.io/license
38244 */
38245
38246/**
38247 * @license
38248 * Copyright Google LLC All Rights Reserved.
38249 *
38250 * Use of this source code is governed by an MIT-style license that can be
38251 * found in the LICENSE file at https://angular.io/license
38252 */
38253const _CORE_PLATFORM_PROVIDERS = [
38254    // Set a default platform name for platforms that don't set it explicitly.
38255    { provide: PLATFORM_ID, useValue: 'unknown' },
38256    { provide: PlatformRef, deps: [Injector] },
38257    { provide: TestabilityRegistry, deps: [] },
38258    { provide: Console, deps: [] },
38259];
38260/**
38261 * This platform has to be included in any other platform
38262 *
38263 * @publicApi
38264 */
38265const platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);
38266
38267/**
38268 * @license
38269 * Copyright Google LLC All Rights Reserved.
38270 *
38271 * Use of this source code is governed by an MIT-style license that can be
38272 * found in the LICENSE file at https://angular.io/license
38273 */
38274function _iterableDiffersFactory() {
38275    return defaultIterableDiffers;
38276}
38277function _keyValueDiffersFactory() {
38278    return defaultKeyValueDiffers;
38279}
38280function _localeFactory(locale) {
38281    locale = locale || getGlobalLocale();
38282    if (ivyEnabled) {
38283        setLocaleId(locale);
38284    }
38285    return locale;
38286}
38287/**
38288 * Work out the locale from the potential global properties.
38289 *
38290 * * Closure Compiler: use `goog.LOCALE`.
38291 * * Ivy enabled: use `$localize.locale`
38292 */
38293function getGlobalLocale() {
38294    if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
38295        typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
38296        // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
38297        // * In order to preserve backwards compatibility, we use Angular default value over
38298        //   Closure Compiler's one.
38299        return goog.LOCALE;
38300    }
38301    else {
38302        // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
38303        // COMPILE-TIME INLINER.
38304        //
38305        // * During compile time inlining of translations the expression will be replaced
38306        //   with a string literal that is the current locale. Other forms of this expression are not
38307        //   guaranteed to be replaced.
38308        //
38309        // * During runtime translation evaluation, the developer is required to set `$localize.locale`
38310        //   if required, or just to provide their own `LOCALE_ID` provider.
38311        return (ivyEnabled && typeof $localize !== 'undefined' && $localize.locale) ||
38312            DEFAULT_LOCALE_ID;
38313    }
38314}
38315const ɵ0$f = USD_CURRENCY_CODE;
38316/**
38317 * A built-in [dependency injection token](guide/glossary#di-token)
38318 * that is used to configure the root injector for bootstrapping.
38319 */
38320const APPLICATION_MODULE_PROVIDERS = [
38321    {
38322        provide: ApplicationRef,
38323        useClass: ApplicationRef,
38324        deps: [NgZone, Injector, ErrorHandler, ComponentFactoryResolver, ApplicationInitStatus]
38325    },
38326    { provide: SCHEDULER, deps: [NgZone], useFactory: zoneSchedulerFactory },
38327    {
38328        provide: ApplicationInitStatus,
38329        useClass: ApplicationInitStatus,
38330        deps: [[new Optional(), APP_INITIALIZER]]
38331    },
38332    { provide: Compiler, useClass: Compiler, deps: [] },
38333    APP_ID_RANDOM_PROVIDER,
38334    { provide: IterableDiffers, useFactory: _iterableDiffersFactory, deps: [] },
38335    { provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory, deps: [] },
38336    {
38337        provide: LOCALE_ID$1,
38338        useFactory: _localeFactory,
38339        deps: [[new Inject(LOCALE_ID$1), new Optional(), new SkipSelf()]]
38340    },
38341    { provide: DEFAULT_CURRENCY_CODE, useValue: ɵ0$f },
38342];
38343/**
38344 * Schedule work at next available slot.
38345 *
38346 * In Ivy this is just `requestAnimationFrame`. For compatibility reasons when bootstrapped
38347 * using `platformRef.bootstrap` we need to use `NgZone.onStable` as the scheduling mechanism.
38348 * This overrides the scheduling mechanism in Ivy to `NgZone.onStable`.
38349 *
38350 * @param ngZone NgZone to use for scheduling.
38351 */
38352function zoneSchedulerFactory(ngZone) {
38353    let queue = [];
38354    ngZone.onStable.subscribe(() => {
38355        while (queue.length) {
38356            queue.pop()();
38357        }
38358    });
38359    return function (fn) {
38360        queue.push(fn);
38361    };
38362}
38363/**
38364 * Configures the root injector for an app with
38365 * providers of `@angular/core` dependencies that `ApplicationRef` needs
38366 * to bootstrap components.
38367 *
38368 * Re-exported by `BrowserModule`, which is included automatically in the root
38369 * `AppModule` when you create a new app with the CLI `new` command.
38370 *
38371 * @publicApi
38372 */
38373class ApplicationModule {
38374    // Inject ApplicationRef to make it eager...
38375    constructor(appRef) { }
38376}
38377ApplicationModule.ɵfac = function ApplicationModule_Factory(t) { return new (t || ApplicationModule)(ɵɵinject(ApplicationRef)); };
38378ApplicationModule.ɵmod = ɵɵdefineNgModule({ type: ApplicationModule });
38379ApplicationModule.ɵinj = ɵɵdefineInjector({ providers: APPLICATION_MODULE_PROVIDERS });
38380ApplicationModule.ctorParameters = () => [
38381    { type: ApplicationRef }
38382];
38383(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationModule, [{
38384        type: NgModule,
38385        args: [{ providers: APPLICATION_MODULE_PROVIDERS }]
38386    }], function () { return [{ type: ApplicationRef }]; }, null); })();
38387
38388/**
38389 * @license
38390 * Copyright Google LLC All Rights Reserved.
38391 *
38392 * Use of this source code is governed by an MIT-style license that can be
38393 * found in the LICENSE file at https://angular.io/license
38394 */
38395function anchorDef(flags, matchedQueriesDsl, ngContentIndex, childCount, handleEvent, templateFactory) {
38396    flags |= 1 /* TypeElement */;
38397    const { matchedQueries, references, matchedQueryIds } = splitMatchedQueriesDsl(matchedQueriesDsl);
38398    const template = templateFactory ? resolveDefinition(templateFactory) : null;
38399    return {
38400        // will bet set by the view definition
38401        nodeIndex: -1,
38402        parent: null,
38403        renderParent: null,
38404        bindingIndex: -1,
38405        outputIndex: -1,
38406        // regular values
38407        flags,
38408        checkIndex: -1,
38409        childFlags: 0,
38410        directChildFlags: 0,
38411        childMatchedQueries: 0,
38412        matchedQueries,
38413        matchedQueryIds,
38414        references,
38415        ngContentIndex,
38416        childCount,
38417        bindings: [],
38418        bindingFlags: 0,
38419        outputs: [],
38420        element: {
38421            ns: null,
38422            name: null,
38423            attrs: null,
38424            template,
38425            componentProvider: null,
38426            componentView: null,
38427            componentRendererType: null,
38428            publicProviders: null,
38429            allProviders: null,
38430            handleEvent: handleEvent || NOOP
38431        },
38432        provider: null,
38433        text: null,
38434        query: null,
38435        ngContent: null
38436    };
38437}
38438function elementDef(checkIndex, flags, matchedQueriesDsl, ngContentIndex, childCount, namespaceAndName, fixedAttrs = [], bindings, outputs, handleEvent, componentView, componentRendererType) {
38439    if (!handleEvent) {
38440        handleEvent = NOOP;
38441    }
38442    const { matchedQueries, references, matchedQueryIds } = splitMatchedQueriesDsl(matchedQueriesDsl);
38443    let ns = null;
38444    let name = null;
38445    if (namespaceAndName) {
38446        [ns, name] = splitNamespace(namespaceAndName);
38447    }
38448    bindings = bindings || [];
38449    const bindingDefs = [];
38450    for (let i = 0; i < bindings.length; i++) {
38451        const [bindingFlags, namespaceAndName, suffixOrSecurityContext] = bindings[i];
38452        const [ns, name] = splitNamespace(namespaceAndName);
38453        let securityContext = undefined;
38454        let suffix = undefined;
38455        switch (bindingFlags & 15 /* Types */) {
38456            case 4 /* TypeElementStyle */:
38457                suffix = suffixOrSecurityContext;
38458                break;
38459            case 1 /* TypeElementAttribute */:
38460            case 8 /* TypeProperty */:
38461                securityContext = suffixOrSecurityContext;
38462                break;
38463        }
38464        bindingDefs[i] =
38465            { flags: bindingFlags, ns, name, nonMinifiedName: name, securityContext, suffix };
38466    }
38467    outputs = outputs || [];
38468    const outputDefs = [];
38469    for (let i = 0; i < outputs.length; i++) {
38470        const [target, eventName] = outputs[i];
38471        outputDefs[i] =
38472            { type: 0 /* ElementOutput */, target: target, eventName, propName: null };
38473    }
38474    fixedAttrs = fixedAttrs || [];
38475    const attrs = fixedAttrs.map(([namespaceAndName, value]) => {
38476        const [ns, name] = splitNamespace(namespaceAndName);
38477        return [ns, name, value];
38478    });
38479    componentRendererType = resolveRendererType2(componentRendererType);
38480    if (componentView) {
38481        flags |= 33554432 /* ComponentView */;
38482    }
38483    flags |= 1 /* TypeElement */;
38484    return {
38485        // will bet set by the view definition
38486        nodeIndex: -1,
38487        parent: null,
38488        renderParent: null,
38489        bindingIndex: -1,
38490        outputIndex: -1,
38491        // regular values
38492        checkIndex,
38493        flags,
38494        childFlags: 0,
38495        directChildFlags: 0,
38496        childMatchedQueries: 0,
38497        matchedQueries,
38498        matchedQueryIds,
38499        references,
38500        ngContentIndex,
38501        childCount,
38502        bindings: bindingDefs,
38503        bindingFlags: calcBindingFlags(bindingDefs),
38504        outputs: outputDefs,
38505        element: {
38506            ns,
38507            name,
38508            attrs,
38509            template: null,
38510            // will bet set by the view definition
38511            componentProvider: null,
38512            componentView: componentView || null,
38513            componentRendererType: componentRendererType,
38514            publicProviders: null,
38515            allProviders: null,
38516            handleEvent: handleEvent || NOOP,
38517        },
38518        provider: null,
38519        text: null,
38520        query: null,
38521        ngContent: null
38522    };
38523}
38524function createElement(view, renderHost, def) {
38525    const elDef = def.element;
38526    const rootSelectorOrNode = view.root.selectorOrNode;
38527    const renderer = view.renderer;
38528    let el;
38529    if (view.parent || !rootSelectorOrNode) {
38530        if (elDef.name) {
38531            el = renderer.createElement(elDef.name, elDef.ns);
38532        }
38533        else {
38534            el = renderer.createComment('');
38535        }
38536        const parentEl = getParentRenderElement(view, renderHost, def);
38537        if (parentEl) {
38538            renderer.appendChild(parentEl, el);
38539        }
38540    }
38541    else {
38542        // when using native Shadow DOM, do not clear the root element contents to allow slot projection
38543        const preserveContent = (!!elDef.componentRendererType &&
38544            elDef.componentRendererType.encapsulation === ViewEncapsulation.ShadowDom);
38545        el = renderer.selectRootElement(rootSelectorOrNode, preserveContent);
38546    }
38547    if (elDef.attrs) {
38548        for (let i = 0; i < elDef.attrs.length; i++) {
38549            const [ns, name, value] = elDef.attrs[i];
38550            renderer.setAttribute(el, name, value, ns);
38551        }
38552    }
38553    return el;
38554}
38555function listenToElementOutputs(view, compView, def, el) {
38556    for (let i = 0; i < def.outputs.length; i++) {
38557        const output = def.outputs[i];
38558        const handleEventClosure = renderEventHandlerClosure(view, def.nodeIndex, elementEventFullName(output.target, output.eventName));
38559        let listenTarget = output.target;
38560        let listenerView = view;
38561        if (output.target === 'component') {
38562            listenTarget = null;
38563            listenerView = compView;
38564        }
38565        const disposable = listenerView.renderer.listen(listenTarget || el, output.eventName, handleEventClosure);
38566        view.disposables[def.outputIndex + i] = disposable;
38567    }
38568}
38569function renderEventHandlerClosure(view, index, eventName) {
38570    return (event) => dispatchEvent(view, index, eventName, event);
38571}
38572function checkAndUpdateElementInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
38573    const bindLen = def.bindings.length;
38574    let changed = false;
38575    if (bindLen > 0 && checkAndUpdateElementValue(view, def, 0, v0))
38576        changed = true;
38577    if (bindLen > 1 && checkAndUpdateElementValue(view, def, 1, v1))
38578        changed = true;
38579    if (bindLen > 2 && checkAndUpdateElementValue(view, def, 2, v2))
38580        changed = true;
38581    if (bindLen > 3 && checkAndUpdateElementValue(view, def, 3, v3))
38582        changed = true;
38583    if (bindLen > 4 && checkAndUpdateElementValue(view, def, 4, v4))
38584        changed = true;
38585    if (bindLen > 5 && checkAndUpdateElementValue(view, def, 5, v5))
38586        changed = true;
38587    if (bindLen > 6 && checkAndUpdateElementValue(view, def, 6, v6))
38588        changed = true;
38589    if (bindLen > 7 && checkAndUpdateElementValue(view, def, 7, v7))
38590        changed = true;
38591    if (bindLen > 8 && checkAndUpdateElementValue(view, def, 8, v8))
38592        changed = true;
38593    if (bindLen > 9 && checkAndUpdateElementValue(view, def, 9, v9))
38594        changed = true;
38595    return changed;
38596}
38597function checkAndUpdateElementDynamic(view, def, values) {
38598    let changed = false;
38599    for (let i = 0; i < values.length; i++) {
38600        if (checkAndUpdateElementValue(view, def, i, values[i]))
38601            changed = true;
38602    }
38603    return changed;
38604}
38605function checkAndUpdateElementValue(view, def, bindingIdx, value) {
38606    if (!checkAndUpdateBinding(view, def, bindingIdx, value)) {
38607        return false;
38608    }
38609    const binding = def.bindings[bindingIdx];
38610    const elData = asElementData(view, def.nodeIndex);
38611    const renderNode = elData.renderElement;
38612    const name = binding.name;
38613    switch (binding.flags & 15 /* Types */) {
38614        case 1 /* TypeElementAttribute */:
38615            setElementAttribute$1(view, binding, renderNode, binding.ns, name, value);
38616            break;
38617        case 2 /* TypeElementClass */:
38618            setElementClass(view, renderNode, name, value);
38619            break;
38620        case 4 /* TypeElementStyle */:
38621            setElementStyle(view, binding, renderNode, name, value);
38622            break;
38623        case 8 /* TypeProperty */:
38624            const bindView = (def.flags & 33554432 /* ComponentView */ &&
38625                binding.flags & 32 /* SyntheticHostProperty */) ?
38626                elData.componentView :
38627                view;
38628            setElementProperty(bindView, binding, renderNode, name, value);
38629            break;
38630    }
38631    return true;
38632}
38633function setElementAttribute$1(view, binding, renderNode, ns, name, value) {
38634    const securityContext = binding.securityContext;
38635    let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;
38636    renderValue = renderValue != null ? renderValue.toString() : null;
38637    const renderer = view.renderer;
38638    if (value != null) {
38639        renderer.setAttribute(renderNode, name, renderValue, ns);
38640    }
38641    else {
38642        renderer.removeAttribute(renderNode, name, ns);
38643    }
38644}
38645function setElementClass(view, renderNode, name, value) {
38646    const renderer = view.renderer;
38647    if (value) {
38648        renderer.addClass(renderNode, name);
38649    }
38650    else {
38651        renderer.removeClass(renderNode, name);
38652    }
38653}
38654function setElementStyle(view, binding, renderNode, name, value) {
38655    let renderValue = view.root.sanitizer.sanitize(SecurityContext.STYLE, value);
38656    if (renderValue != null) {
38657        renderValue = renderValue.toString();
38658        const unit = binding.suffix;
38659        if (unit != null) {
38660            renderValue = renderValue + unit;
38661        }
38662    }
38663    else {
38664        renderValue = null;
38665    }
38666    const renderer = view.renderer;
38667    if (renderValue != null) {
38668        renderer.setStyle(renderNode, name, renderValue);
38669    }
38670    else {
38671        renderer.removeStyle(renderNode, name);
38672    }
38673}
38674function setElementProperty(view, binding, renderNode, name, value) {
38675    const securityContext = binding.securityContext;
38676    let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;
38677    view.renderer.setProperty(renderNode, name, renderValue);
38678}
38679
38680/**
38681 * @license
38682 * Copyright Google LLC All Rights Reserved.
38683 *
38684 * Use of this source code is governed by an MIT-style license that can be
38685 * found in the LICENSE file at https://angular.io/license
38686 */
38687function queryDef(flags, id, bindings) {
38688    let bindingDefs = [];
38689    for (let propName in bindings) {
38690        const bindingType = bindings[propName];
38691        bindingDefs.push({ propName, bindingType });
38692    }
38693    return {
38694        // will bet set by the view definition
38695        nodeIndex: -1,
38696        parent: null,
38697        renderParent: null,
38698        bindingIndex: -1,
38699        outputIndex: -1,
38700        // regular values
38701        // TODO(vicb): check
38702        checkIndex: -1,
38703        flags,
38704        childFlags: 0,
38705        directChildFlags: 0,
38706        childMatchedQueries: 0,
38707        ngContentIndex: -1,
38708        matchedQueries: {},
38709        matchedQueryIds: 0,
38710        references: {},
38711        childCount: 0,
38712        bindings: [],
38713        bindingFlags: 0,
38714        outputs: [],
38715        element: null,
38716        provider: null,
38717        text: null,
38718        query: { id, filterId: filterQueryId(id), bindings: bindingDefs },
38719        ngContent: null
38720    };
38721}
38722function createQuery(emitDistinctChangesOnly) {
38723    return new QueryList(emitDistinctChangesOnly);
38724}
38725function dirtyParentQueries(view) {
38726    const queryIds = view.def.nodeMatchedQueries;
38727    while (view.parent && isEmbeddedView(view)) {
38728        let tplDef = view.parentNodeDef;
38729        view = view.parent;
38730        // content queries
38731        const end = tplDef.nodeIndex + tplDef.childCount;
38732        for (let i = 0; i <= end; i++) {
38733            const nodeDef = view.def.nodes[i];
38734            if ((nodeDef.flags & 67108864 /* TypeContentQuery */) &&
38735                (nodeDef.flags & 536870912 /* DynamicQuery */) &&
38736                (nodeDef.query.filterId & queryIds) === nodeDef.query.filterId) {
38737                asQueryList(view, i).setDirty();
38738            }
38739            if ((nodeDef.flags & 1 /* TypeElement */ && i + nodeDef.childCount < tplDef.nodeIndex) ||
38740                !(nodeDef.childFlags & 67108864 /* TypeContentQuery */) ||
38741                !(nodeDef.childFlags & 536870912 /* DynamicQuery */)) {
38742                // skip elements that don't contain the template element or no query.
38743                i += nodeDef.childCount;
38744            }
38745        }
38746    }
38747    // view queries
38748    if (view.def.nodeFlags & 134217728 /* TypeViewQuery */) {
38749        for (let i = 0; i < view.def.nodes.length; i++) {
38750            const nodeDef = view.def.nodes[i];
38751            if ((nodeDef.flags & 134217728 /* TypeViewQuery */) && (nodeDef.flags & 536870912 /* DynamicQuery */)) {
38752                asQueryList(view, i).setDirty();
38753            }
38754            // only visit the root nodes
38755            i += nodeDef.childCount;
38756        }
38757    }
38758}
38759function checkAndUpdateQuery(view, nodeDef) {
38760    const queryList = asQueryList(view, nodeDef.nodeIndex);
38761    if (!queryList.dirty) {
38762        return;
38763    }
38764    let directiveInstance;
38765    let newValues = undefined;
38766    if (nodeDef.flags & 67108864 /* TypeContentQuery */) {
38767        const elementDef = nodeDef.parent.parent;
38768        newValues = calcQueryValues(view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount, nodeDef.query, []);
38769        directiveInstance = asProviderData(view, nodeDef.parent.nodeIndex).instance;
38770    }
38771    else if (nodeDef.flags & 134217728 /* TypeViewQuery */) {
38772        newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, nodeDef.query, []);
38773        directiveInstance = view.component;
38774    }
38775    queryList.reset(newValues, unwrapElementRef);
38776    const bindings = nodeDef.query.bindings;
38777    let notify = false;
38778    for (let i = 0; i < bindings.length; i++) {
38779        const binding = bindings[i];
38780        let boundValue;
38781        switch (binding.bindingType) {
38782            case 0 /* First */:
38783                boundValue = queryList.first;
38784                break;
38785            case 1 /* All */:
38786                boundValue = queryList;
38787                notify = true;
38788                break;
38789        }
38790        directiveInstance[binding.propName] = boundValue;
38791    }
38792    if (notify) {
38793        queryList.notifyOnChanges();
38794    }
38795}
38796function calcQueryValues(view, startIndex, endIndex, queryDef, values) {
38797    for (let i = startIndex; i <= endIndex; i++) {
38798        const nodeDef = view.def.nodes[i];
38799        const valueType = nodeDef.matchedQueries[queryDef.id];
38800        if (valueType != null) {
38801            values.push(getQueryValue(view, nodeDef, valueType));
38802        }
38803        if (nodeDef.flags & 1 /* TypeElement */ && nodeDef.element.template &&
38804            (nodeDef.element.template.nodeMatchedQueries & queryDef.filterId) ===
38805                queryDef.filterId) {
38806            const elementData = asElementData(view, i);
38807            // check embedded views that were attached at the place of their template,
38808            // but process child nodes first if some match the query (see issue #16568)
38809            if ((nodeDef.childMatchedQueries & queryDef.filterId) === queryDef.filterId) {
38810                calcQueryValues(view, i + 1, i + nodeDef.childCount, queryDef, values);
38811                i += nodeDef.childCount;
38812            }
38813            if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
38814                const embeddedViews = elementData.viewContainer._embeddedViews;
38815                for (let k = 0; k < embeddedViews.length; k++) {
38816                    const embeddedView = embeddedViews[k];
38817                    const dvc = declaredViewContainer(embeddedView);
38818                    if (dvc && dvc === elementData) {
38819                        calcQueryValues(embeddedView, 0, embeddedView.def.nodes.length - 1, queryDef, values);
38820                    }
38821                }
38822            }
38823            const projectedViews = elementData.template._projectedViews;
38824            if (projectedViews) {
38825                for (let k = 0; k < projectedViews.length; k++) {
38826                    const projectedView = projectedViews[k];
38827                    calcQueryValues(projectedView, 0, projectedView.def.nodes.length - 1, queryDef, values);
38828                }
38829            }
38830        }
38831        if ((nodeDef.childMatchedQueries & queryDef.filterId) !== queryDef.filterId) {
38832            // if no child matches the query, skip the children.
38833            i += nodeDef.childCount;
38834        }
38835    }
38836    return values;
38837}
38838function getQueryValue(view, nodeDef, queryValueType) {
38839    if (queryValueType != null) {
38840        // a match
38841        switch (queryValueType) {
38842            case 1 /* RenderElement */:
38843                return asElementData(view, nodeDef.nodeIndex).renderElement;
38844            case 0 /* ElementRef */:
38845                return new ElementRef(asElementData(view, nodeDef.nodeIndex).renderElement);
38846            case 2 /* TemplateRef */:
38847                return asElementData(view, nodeDef.nodeIndex).template;
38848            case 3 /* ViewContainerRef */:
38849                return asElementData(view, nodeDef.nodeIndex).viewContainer;
38850            case 4 /* Provider */:
38851                return asProviderData(view, nodeDef.nodeIndex).instance;
38852        }
38853    }
38854}
38855
38856/**
38857 * @license
38858 * Copyright Google LLC All Rights Reserved.
38859 *
38860 * Use of this source code is governed by an MIT-style license that can be
38861 * found in the LICENSE file at https://angular.io/license
38862 */
38863function ngContentDef(ngContentIndex, index) {
38864    return {
38865        // will bet set by the view definition
38866        nodeIndex: -1,
38867        parent: null,
38868        renderParent: null,
38869        bindingIndex: -1,
38870        outputIndex: -1,
38871        // regular values
38872        checkIndex: -1,
38873        flags: 8 /* TypeNgContent */,
38874        childFlags: 0,
38875        directChildFlags: 0,
38876        childMatchedQueries: 0,
38877        matchedQueries: {},
38878        matchedQueryIds: 0,
38879        references: {},
38880        ngContentIndex,
38881        childCount: 0,
38882        bindings: [],
38883        bindingFlags: 0,
38884        outputs: [],
38885        element: null,
38886        provider: null,
38887        text: null,
38888        query: null,
38889        ngContent: { index }
38890    };
38891}
38892function appendNgContent(view, renderHost, def) {
38893    const parentEl = getParentRenderElement(view, renderHost, def);
38894    if (!parentEl) {
38895        // Nothing to do if there is no parent element.
38896        return;
38897    }
38898    const ngContentIndex = def.ngContent.index;
38899    visitProjectedRenderNodes(view, ngContentIndex, 1 /* AppendChild */, parentEl, null, undefined);
38900}
38901
38902/**
38903 * @license
38904 * Copyright Google LLC All Rights Reserved.
38905 *
38906 * Use of this source code is governed by an MIT-style license that can be
38907 * found in the LICENSE file at https://angular.io/license
38908 */
38909function purePipeDef(checkIndex, argCount) {
38910    // argCount + 1 to include the pipe as first arg
38911    return _pureExpressionDef(128 /* TypePurePipe */, checkIndex, newArray(argCount + 1));
38912}
38913function pureArrayDef(checkIndex, argCount) {
38914    return _pureExpressionDef(32 /* TypePureArray */, checkIndex, newArray(argCount));
38915}
38916function pureObjectDef(checkIndex, propToIndex) {
38917    const keys = Object.keys(propToIndex);
38918    const nbKeys = keys.length;
38919    const propertyNames = [];
38920    for (let i = 0; i < nbKeys; i++) {
38921        const key = keys[i];
38922        const index = propToIndex[key];
38923        propertyNames.push(key);
38924    }
38925    return _pureExpressionDef(64 /* TypePureObject */, checkIndex, propertyNames);
38926}
38927function _pureExpressionDef(flags, checkIndex, propertyNames) {
38928    const bindings = [];
38929    for (let i = 0; i < propertyNames.length; i++) {
38930        const prop = propertyNames[i];
38931        bindings.push({
38932            flags: 8 /* TypeProperty */,
38933            name: prop,
38934            ns: null,
38935            nonMinifiedName: prop,
38936            securityContext: null,
38937            suffix: null
38938        });
38939    }
38940    return {
38941        // will bet set by the view definition
38942        nodeIndex: -1,
38943        parent: null,
38944        renderParent: null,
38945        bindingIndex: -1,
38946        outputIndex: -1,
38947        // regular values
38948        checkIndex,
38949        flags,
38950        childFlags: 0,
38951        directChildFlags: 0,
38952        childMatchedQueries: 0,
38953        matchedQueries: {},
38954        matchedQueryIds: 0,
38955        references: {},
38956        ngContentIndex: -1,
38957        childCount: 0,
38958        bindings,
38959        bindingFlags: calcBindingFlags(bindings),
38960        outputs: [],
38961        element: null,
38962        provider: null,
38963        text: null,
38964        query: null,
38965        ngContent: null
38966    };
38967}
38968function createPureExpression(view, def) {
38969    return { value: undefined };
38970}
38971function checkAndUpdatePureExpressionInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
38972    const bindings = def.bindings;
38973    let changed = false;
38974    const bindLen = bindings.length;
38975    if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))
38976        changed = true;
38977    if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))
38978        changed = true;
38979    if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))
38980        changed = true;
38981    if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))
38982        changed = true;
38983    if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))
38984        changed = true;
38985    if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))
38986        changed = true;
38987    if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))
38988        changed = true;
38989    if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))
38990        changed = true;
38991    if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))
38992        changed = true;
38993    if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))
38994        changed = true;
38995    if (changed) {
38996        const data = asPureExpressionData(view, def.nodeIndex);
38997        let value;
38998        switch (def.flags & 201347067 /* Types */) {
38999            case 32 /* TypePureArray */:
39000                value = [];
39001                if (bindLen > 0)
39002                    value.push(v0);
39003                if (bindLen > 1)
39004                    value.push(v1);
39005                if (bindLen > 2)
39006                    value.push(v2);
39007                if (bindLen > 3)
39008                    value.push(v3);
39009                if (bindLen > 4)
39010                    value.push(v4);
39011                if (bindLen > 5)
39012                    value.push(v5);
39013                if (bindLen > 6)
39014                    value.push(v6);
39015                if (bindLen > 7)
39016                    value.push(v7);
39017                if (bindLen > 8)
39018                    value.push(v8);
39019                if (bindLen > 9)
39020                    value.push(v9);
39021                break;
39022            case 64 /* TypePureObject */:
39023                value = {};
39024                if (bindLen > 0)
39025                    value[bindings[0].name] = v0;
39026                if (bindLen > 1)
39027                    value[bindings[1].name] = v1;
39028                if (bindLen > 2)
39029                    value[bindings[2].name] = v2;
39030                if (bindLen > 3)
39031                    value[bindings[3].name] = v3;
39032                if (bindLen > 4)
39033                    value[bindings[4].name] = v4;
39034                if (bindLen > 5)
39035                    value[bindings[5].name] = v5;
39036                if (bindLen > 6)
39037                    value[bindings[6].name] = v6;
39038                if (bindLen > 7)
39039                    value[bindings[7].name] = v7;
39040                if (bindLen > 8)
39041                    value[bindings[8].name] = v8;
39042                if (bindLen > 9)
39043                    value[bindings[9].name] = v9;
39044                break;
39045            case 128 /* TypePurePipe */:
39046                const pipe = v0;
39047                switch (bindLen) {
39048                    case 1:
39049                        value = pipe.transform(v0);
39050                        break;
39051                    case 2:
39052                        value = pipe.transform(v1);
39053                        break;
39054                    case 3:
39055                        value = pipe.transform(v1, v2);
39056                        break;
39057                    case 4:
39058                        value = pipe.transform(v1, v2, v3);
39059                        break;
39060                    case 5:
39061                        value = pipe.transform(v1, v2, v3, v4);
39062                        break;
39063                    case 6:
39064                        value = pipe.transform(v1, v2, v3, v4, v5);
39065                        break;
39066                    case 7:
39067                        value = pipe.transform(v1, v2, v3, v4, v5, v6);
39068                        break;
39069                    case 8:
39070                        value = pipe.transform(v1, v2, v3, v4, v5, v6, v7);
39071                        break;
39072                    case 9:
39073                        value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8);
39074                        break;
39075                    case 10:
39076                        value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8, v9);
39077                        break;
39078                }
39079                break;
39080        }
39081        data.value = value;
39082    }
39083    return changed;
39084}
39085function checkAndUpdatePureExpressionDynamic(view, def, values) {
39086    const bindings = def.bindings;
39087    let changed = false;
39088    for (let i = 0; i < values.length; i++) {
39089        // Note: We need to loop over all values, so that
39090        // the old values are updates as well!
39091        if (checkAndUpdateBinding(view, def, i, values[i])) {
39092            changed = true;
39093        }
39094    }
39095    if (changed) {
39096        const data = asPureExpressionData(view, def.nodeIndex);
39097        let value;
39098        switch (def.flags & 201347067 /* Types */) {
39099            case 32 /* TypePureArray */:
39100                value = values;
39101                break;
39102            case 64 /* TypePureObject */:
39103                value = {};
39104                for (let i = 0; i < values.length; i++) {
39105                    value[bindings[i].name] = values[i];
39106                }
39107                break;
39108            case 128 /* TypePurePipe */:
39109                const pipe = values[0];
39110                const params = values.slice(1);
39111                value = pipe.transform(...params);
39112                break;
39113        }
39114        data.value = value;
39115    }
39116    return changed;
39117}
39118
39119/**
39120 * @license
39121 * Copyright Google LLC All Rights Reserved.
39122 *
39123 * Use of this source code is governed by an MIT-style license that can be
39124 * found in the LICENSE file at https://angular.io/license
39125 */
39126function textDef(checkIndex, ngContentIndex, staticText) {
39127    const bindings = [];
39128    for (let i = 1; i < staticText.length; i++) {
39129        bindings[i - 1] = {
39130            flags: 8 /* TypeProperty */,
39131            name: null,
39132            ns: null,
39133            nonMinifiedName: null,
39134            securityContext: null,
39135            suffix: staticText[i],
39136        };
39137    }
39138    return {
39139        // will bet set by the view definition
39140        nodeIndex: -1,
39141        parent: null,
39142        renderParent: null,
39143        bindingIndex: -1,
39144        outputIndex: -1,
39145        // regular values
39146        checkIndex,
39147        flags: 2 /* TypeText */,
39148        childFlags: 0,
39149        directChildFlags: 0,
39150        childMatchedQueries: 0,
39151        matchedQueries: {},
39152        matchedQueryIds: 0,
39153        references: {},
39154        ngContentIndex,
39155        childCount: 0,
39156        bindings,
39157        bindingFlags: 8 /* TypeProperty */,
39158        outputs: [],
39159        element: null,
39160        provider: null,
39161        text: { prefix: staticText[0] },
39162        query: null,
39163        ngContent: null,
39164    };
39165}
39166function createText(view, renderHost, def) {
39167    let renderNode;
39168    const renderer = view.renderer;
39169    renderNode = renderer.createText(def.text.prefix);
39170    const parentEl = getParentRenderElement(view, renderHost, def);
39171    if (parentEl) {
39172        renderer.appendChild(parentEl, renderNode);
39173    }
39174    return { renderText: renderNode };
39175}
39176function checkAndUpdateTextInline(view, def, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
39177    let changed = false;
39178    const bindings = def.bindings;
39179    const bindLen = bindings.length;
39180    if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0))
39181        changed = true;
39182    if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1))
39183        changed = true;
39184    if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2))
39185        changed = true;
39186    if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3))
39187        changed = true;
39188    if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4))
39189        changed = true;
39190    if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5))
39191        changed = true;
39192    if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6))
39193        changed = true;
39194    if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7))
39195        changed = true;
39196    if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8))
39197        changed = true;
39198    if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9))
39199        changed = true;
39200    if (changed) {
39201        let value = def.text.prefix;
39202        if (bindLen > 0)
39203            value += _addInterpolationPart(v0, bindings[0]);
39204        if (bindLen > 1)
39205            value += _addInterpolationPart(v1, bindings[1]);
39206        if (bindLen > 2)
39207            value += _addInterpolationPart(v2, bindings[2]);
39208        if (bindLen > 3)
39209            value += _addInterpolationPart(v3, bindings[3]);
39210        if (bindLen > 4)
39211            value += _addInterpolationPart(v4, bindings[4]);
39212        if (bindLen > 5)
39213            value += _addInterpolationPart(v5, bindings[5]);
39214        if (bindLen > 6)
39215            value += _addInterpolationPart(v6, bindings[6]);
39216        if (bindLen > 7)
39217            value += _addInterpolationPart(v7, bindings[7]);
39218        if (bindLen > 8)
39219            value += _addInterpolationPart(v8, bindings[8]);
39220        if (bindLen > 9)
39221            value += _addInterpolationPart(v9, bindings[9]);
39222        const renderNode = asTextData(view, def.nodeIndex).renderText;
39223        view.renderer.setValue(renderNode, value);
39224    }
39225    return changed;
39226}
39227function checkAndUpdateTextDynamic(view, def, values) {
39228    const bindings = def.bindings;
39229    let changed = false;
39230    for (let i = 0; i < values.length; i++) {
39231        // Note: We need to loop over all values, so that
39232        // the old values are updates as well!
39233        if (checkAndUpdateBinding(view, def, i, values[i])) {
39234            changed = true;
39235        }
39236    }
39237    if (changed) {
39238        let value = '';
39239        for (let i = 0; i < values.length; i++) {
39240            value = value + _addInterpolationPart(values[i], bindings[i]);
39241        }
39242        value = def.text.prefix + value;
39243        const renderNode = asTextData(view, def.nodeIndex).renderText;
39244        view.renderer.setValue(renderNode, value);
39245    }
39246    return changed;
39247}
39248function _addInterpolationPart(value, binding) {
39249    const valueStr = value != null ? value.toString() : '';
39250    return valueStr + binding.suffix;
39251}
39252
39253/**
39254 * @license
39255 * Copyright Google LLC All Rights Reserved.
39256 *
39257 * Use of this source code is governed by an MIT-style license that can be
39258 * found in the LICENSE file at https://angular.io/license
39259 */
39260function viewDef(flags, nodes, updateDirectives, updateRenderer) {
39261    // clone nodes and set auto calculated values
39262    let viewBindingCount = 0;
39263    let viewDisposableCount = 0;
39264    let viewNodeFlags = 0;
39265    let viewRootNodeFlags = 0;
39266    let viewMatchedQueries = 0;
39267    let currentParent = null;
39268    let currentRenderParent = null;
39269    let currentElementHasPublicProviders = false;
39270    let currentElementHasPrivateProviders = false;
39271    let lastRenderRootNode = null;
39272    for (let i = 0; i < nodes.length; i++) {
39273        const node = nodes[i];
39274        node.nodeIndex = i;
39275        node.parent = currentParent;
39276        node.bindingIndex = viewBindingCount;
39277        node.outputIndex = viewDisposableCount;
39278        node.renderParent = currentRenderParent;
39279        viewNodeFlags |= node.flags;
39280        viewMatchedQueries |= node.matchedQueryIds;
39281        if (node.element) {
39282            const elDef = node.element;
39283            elDef.publicProviders =
39284                currentParent ? currentParent.element.publicProviders : Object.create(null);
39285            elDef.allProviders = elDef.publicProviders;
39286            // Note: We assume that all providers of an element are before any child element!
39287            currentElementHasPublicProviders = false;
39288            currentElementHasPrivateProviders = false;
39289            if (node.element.template) {
39290                viewMatchedQueries |= node.element.template.nodeMatchedQueries;
39291            }
39292        }
39293        validateNode(currentParent, node, nodes.length);
39294        viewBindingCount += node.bindings.length;
39295        viewDisposableCount += node.outputs.length;
39296        if (!currentRenderParent && (node.flags & 3 /* CatRenderNode */)) {
39297            lastRenderRootNode = node;
39298        }
39299        if (node.flags & 20224 /* CatProvider */) {
39300            if (!currentElementHasPublicProviders) {
39301                currentElementHasPublicProviders = true;
39302                // Use prototypical inheritance to not get O(n^2) complexity...
39303                currentParent.element.publicProviders =
39304                    Object.create(currentParent.element.publicProviders);
39305                currentParent.element.allProviders = currentParent.element.publicProviders;
39306            }
39307            const isPrivateService = (node.flags & 8192 /* PrivateProvider */) !== 0;
39308            const isComponent = (node.flags & 32768 /* Component */) !== 0;
39309            if (!isPrivateService || isComponent) {
39310                currentParent.element.publicProviders[tokenKey(node.provider.token)] = node;
39311            }
39312            else {
39313                if (!currentElementHasPrivateProviders) {
39314                    currentElementHasPrivateProviders = true;
39315                    // Use prototypical inheritance to not get O(n^2) complexity...
39316                    currentParent.element.allProviders =
39317                        Object.create(currentParent.element.publicProviders);
39318                }
39319                currentParent.element.allProviders[tokenKey(node.provider.token)] = node;
39320            }
39321            if (isComponent) {
39322                currentParent.element.componentProvider = node;
39323            }
39324        }
39325        if (currentParent) {
39326            currentParent.childFlags |= node.flags;
39327            currentParent.directChildFlags |= node.flags;
39328            currentParent.childMatchedQueries |= node.matchedQueryIds;
39329            if (node.element && node.element.template) {
39330                currentParent.childMatchedQueries |= node.element.template.nodeMatchedQueries;
39331            }
39332        }
39333        else {
39334            viewRootNodeFlags |= node.flags;
39335        }
39336        if (node.childCount > 0) {
39337            currentParent = node;
39338            if (!isNgContainer(node)) {
39339                currentRenderParent = node;
39340            }
39341        }
39342        else {
39343            // When the current node has no children, check if it is the last children of its parent.
39344            // When it is, propagate the flags up.
39345            // The loop is required because an element could be the last transitive children of several
39346            // elements. We loop to either the root or the highest opened element (= with remaining
39347            // children)
39348            while (currentParent && i === currentParent.nodeIndex + currentParent.childCount) {
39349                const newParent = currentParent.parent;
39350                if (newParent) {
39351                    newParent.childFlags |= currentParent.childFlags;
39352                    newParent.childMatchedQueries |= currentParent.childMatchedQueries;
39353                }
39354                currentParent = newParent;
39355                // We also need to update the render parent & account for ng-container
39356                if (currentParent && isNgContainer(currentParent)) {
39357                    currentRenderParent = currentParent.renderParent;
39358                }
39359                else {
39360                    currentRenderParent = currentParent;
39361                }
39362            }
39363        }
39364    }
39365    const handleEvent = (view, nodeIndex, eventName, event) => nodes[nodeIndex].element.handleEvent(view, eventName, event);
39366    return {
39367        // Will be filled later...
39368        factory: null,
39369        nodeFlags: viewNodeFlags,
39370        rootNodeFlags: viewRootNodeFlags,
39371        nodeMatchedQueries: viewMatchedQueries,
39372        flags,
39373        nodes: nodes,
39374        updateDirectives: updateDirectives || NOOP,
39375        updateRenderer: updateRenderer || NOOP,
39376        handleEvent,
39377        bindingCount: viewBindingCount,
39378        outputCount: viewDisposableCount,
39379        lastRenderRootNode
39380    };
39381}
39382function isNgContainer(node) {
39383    return (node.flags & 1 /* TypeElement */) !== 0 && node.element.name === null;
39384}
39385function validateNode(parent, node, nodeCount) {
39386    const template = node.element && node.element.template;
39387    if (template) {
39388        if (!template.lastRenderRootNode) {
39389            throw new Error(`Illegal State: Embedded templates without nodes are not allowed!`);
39390        }
39391        if (template.lastRenderRootNode &&
39392            template.lastRenderRootNode.flags & 16777216 /* EmbeddedViews */) {
39393            throw new Error(`Illegal State: Last root node of a template can't have embedded views, at index ${node.nodeIndex}!`);
39394        }
39395    }
39396    if (node.flags & 20224 /* CatProvider */) {
39397        const parentFlags = parent ? parent.flags : 0;
39398        if ((parentFlags & 1 /* TypeElement */) === 0) {
39399            throw new Error(`Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index ${node.nodeIndex}!`);
39400        }
39401    }
39402    if (node.query) {
39403        if (node.flags & 67108864 /* TypeContentQuery */ &&
39404            (!parent || (parent.flags & 16384 /* TypeDirective */) === 0)) {
39405            throw new Error(`Illegal State: Content Query nodes need to be children of directives, at index ${node.nodeIndex}!`);
39406        }
39407        if (node.flags & 134217728 /* TypeViewQuery */ && parent) {
39408            throw new Error(`Illegal State: View Query nodes have to be top level nodes, at index ${node.nodeIndex}!`);
39409        }
39410    }
39411    if (node.childCount) {
39412        const parentEnd = parent ? parent.nodeIndex + parent.childCount : nodeCount - 1;
39413        if (node.nodeIndex <= parentEnd && node.nodeIndex + node.childCount > parentEnd) {
39414            throw new Error(`Illegal State: childCount of node leads outside of parent, at index ${node.nodeIndex}!`);
39415        }
39416    }
39417}
39418function createEmbeddedView(parent, anchorDef, viewDef, context) {
39419    // embedded views are seen as siblings to the anchor, so we need
39420    // to get the parent of the anchor and use it as parentIndex.
39421    const view = createView(parent.root, parent.renderer, parent, anchorDef, viewDef);
39422    initView(view, parent.component, context);
39423    createViewNodes(view);
39424    return view;
39425}
39426function createRootView(root, def, context) {
39427    const view = createView(root, root.renderer, null, null, def);
39428    initView(view, context, context);
39429    createViewNodes(view);
39430    return view;
39431}
39432function createComponentView(parentView, nodeDef, viewDef, hostElement) {
39433    const rendererType = nodeDef.element.componentRendererType;
39434    let compRenderer;
39435    if (!rendererType) {
39436        compRenderer = parentView.root.renderer;
39437    }
39438    else {
39439        compRenderer = parentView.root.rendererFactory.createRenderer(hostElement, rendererType);
39440    }
39441    return createView(parentView.root, compRenderer, parentView, nodeDef.element.componentProvider, viewDef);
39442}
39443function createView(root, renderer, parent, parentNodeDef, def) {
39444    const nodes = new Array(def.nodes.length);
39445    const disposables = def.outputCount ? new Array(def.outputCount) : null;
39446    const view = {
39447        def,
39448        parent,
39449        viewContainerParent: null,
39450        parentNodeDef,
39451        context: null,
39452        component: null,
39453        nodes,
39454        state: 13 /* CatInit */,
39455        root,
39456        renderer,
39457        oldValues: new Array(def.bindingCount),
39458        disposables,
39459        initIndex: -1
39460    };
39461    return view;
39462}
39463function initView(view, component, context) {
39464    view.component = component;
39465    view.context = context;
39466}
39467function createViewNodes(view) {
39468    let renderHost;
39469    if (isComponentView(view)) {
39470        const hostDef = view.parentNodeDef;
39471        renderHost = asElementData(view.parent, hostDef.parent.nodeIndex).renderElement;
39472    }
39473    const def = view.def;
39474    const nodes = view.nodes;
39475    for (let i = 0; i < def.nodes.length; i++) {
39476        const nodeDef = def.nodes[i];
39477        Services.setCurrentNode(view, i);
39478        let nodeData;
39479        switch (nodeDef.flags & 201347067 /* Types */) {
39480            case 1 /* TypeElement */:
39481                const el = createElement(view, renderHost, nodeDef);
39482                let componentView = undefined;
39483                if (nodeDef.flags & 33554432 /* ComponentView */) {
39484                    const compViewDef = resolveDefinition(nodeDef.element.componentView);
39485                    componentView = Services.createComponentView(view, nodeDef, compViewDef, el);
39486                }
39487                listenToElementOutputs(view, componentView, nodeDef, el);
39488                nodeData = {
39489                    renderElement: el,
39490                    componentView,
39491                    viewContainer: null,
39492                    template: nodeDef.element.template ? createTemplateData(view, nodeDef) : undefined
39493                };
39494                if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
39495                    nodeData.viewContainer = createViewContainerData(view, nodeDef, nodeData);
39496                }
39497                break;
39498            case 2 /* TypeText */:
39499                nodeData = createText(view, renderHost, nodeDef);
39500                break;
39501            case 512 /* TypeClassProvider */:
39502            case 1024 /* TypeFactoryProvider */:
39503            case 2048 /* TypeUseExistingProvider */:
39504            case 256 /* TypeValueProvider */: {
39505                nodeData = nodes[i];
39506                if (!nodeData && !(nodeDef.flags & 4096 /* LazyProvider */)) {
39507                    const instance = createProviderInstance(view, nodeDef);
39508                    nodeData = { instance };
39509                }
39510                break;
39511            }
39512            case 16 /* TypePipe */: {
39513                const instance = createPipeInstance(view, nodeDef);
39514                nodeData = { instance };
39515                break;
39516            }
39517            case 16384 /* TypeDirective */: {
39518                nodeData = nodes[i];
39519                if (!nodeData) {
39520                    const instance = createDirectiveInstance(view, nodeDef);
39521                    nodeData = { instance };
39522                }
39523                if (nodeDef.flags & 32768 /* Component */) {
39524                    const compView = asElementData(view, nodeDef.parent.nodeIndex).componentView;
39525                    initView(compView, nodeData.instance, nodeData.instance);
39526                }
39527                break;
39528            }
39529            case 32 /* TypePureArray */:
39530            case 64 /* TypePureObject */:
39531            case 128 /* TypePurePipe */:
39532                nodeData = createPureExpression(view, nodeDef);
39533                break;
39534            case 67108864 /* TypeContentQuery */:
39535            case 134217728 /* TypeViewQuery */:
39536                nodeData = createQuery((nodeDef.flags & -2147483648 /* EmitDistinctChangesOnly */) ===
39537                    -2147483648 /* EmitDistinctChangesOnly */);
39538                break;
39539            case 8 /* TypeNgContent */:
39540                appendNgContent(view, renderHost, nodeDef);
39541                // no runtime data needed for NgContent...
39542                nodeData = undefined;
39543                break;
39544        }
39545        nodes[i] = nodeData;
39546    }
39547    // Create the ViewData.nodes of component views after we created everything else,
39548    // so that e.g. ng-content works
39549    execComponentViewsAction(view, ViewAction.CreateViewNodes);
39550    // fill static content and view queries
39551    execQueriesAction(view, 67108864 /* TypeContentQuery */ | 134217728 /* TypeViewQuery */, 268435456 /* StaticQuery */, 0 /* CheckAndUpdate */);
39552}
39553function checkNoChangesView(view) {
39554    markProjectedViewsForCheck(view);
39555    Services.updateDirectives(view, 1 /* CheckNoChanges */);
39556    execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);
39557    Services.updateRenderer(view, 1 /* CheckNoChanges */);
39558    execComponentViewsAction(view, ViewAction.CheckNoChanges);
39559    // Note: We don't check queries for changes as we didn't do this in v2.x.
39560    // TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.
39561    view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);
39562}
39563function checkAndUpdateView(view) {
39564    if (view.state & 1 /* BeforeFirstCheck */) {
39565        view.state &= ~1 /* BeforeFirstCheck */;
39566        view.state |= 2 /* FirstCheck */;
39567    }
39568    else {
39569        view.state &= ~2 /* FirstCheck */;
39570    }
39571    shiftInitState(view, 0 /* InitState_BeforeInit */, 256 /* InitState_CallingOnInit */);
39572    markProjectedViewsForCheck(view);
39573    Services.updateDirectives(view, 0 /* CheckAndUpdate */);
39574    execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);
39575    execQueriesAction(view, 67108864 /* TypeContentQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);
39576    let callInit = shiftInitState(view, 256 /* InitState_CallingOnInit */, 512 /* InitState_CallingAfterContentInit */);
39577    callLifecycleHooksChildrenFirst(view, 2097152 /* AfterContentChecked */ | (callInit ? 1048576 /* AfterContentInit */ : 0));
39578    Services.updateRenderer(view, 0 /* CheckAndUpdate */);
39579    execComponentViewsAction(view, ViewAction.CheckAndUpdate);
39580    execQueriesAction(view, 134217728 /* TypeViewQuery */, 536870912 /* DynamicQuery */, 0 /* CheckAndUpdate */);
39581    callInit = shiftInitState(view, 512 /* InitState_CallingAfterContentInit */, 768 /* InitState_CallingAfterViewInit */);
39582    callLifecycleHooksChildrenFirst(view, 8388608 /* AfterViewChecked */ | (callInit ? 4194304 /* AfterViewInit */ : 0));
39583    if (view.def.flags & 2 /* OnPush */) {
39584        view.state &= ~8 /* ChecksEnabled */;
39585    }
39586    view.state &= ~(64 /* CheckProjectedViews */ | 32 /* CheckProjectedView */);
39587    shiftInitState(view, 768 /* InitState_CallingAfterViewInit */, 1024 /* InitState_AfterInit */);
39588}
39589function checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
39590    if (argStyle === 0 /* Inline */) {
39591        return checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
39592    }
39593    else {
39594        return checkAndUpdateNodeDynamic(view, nodeDef, v0);
39595    }
39596}
39597function markProjectedViewsForCheck(view) {
39598    const def = view.def;
39599    if (!(def.nodeFlags & 4 /* ProjectedTemplate */)) {
39600        return;
39601    }
39602    for (let i = 0; i < def.nodes.length; i++) {
39603        const nodeDef = def.nodes[i];
39604        if (nodeDef.flags & 4 /* ProjectedTemplate */) {
39605            const projectedViews = asElementData(view, i).template._projectedViews;
39606            if (projectedViews) {
39607                for (let i = 0; i < projectedViews.length; i++) {
39608                    const projectedView = projectedViews[i];
39609                    projectedView.state |= 32 /* CheckProjectedView */;
39610                    markParentViewsForCheckProjectedViews(projectedView, view);
39611                }
39612            }
39613        }
39614        else if ((nodeDef.childFlags & 4 /* ProjectedTemplate */) === 0) {
39615            // a parent with leafs
39616            // no child is a component,
39617            // then skip the children
39618            i += nodeDef.childCount;
39619        }
39620    }
39621}
39622function checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
39623    switch (nodeDef.flags & 201347067 /* Types */) {
39624        case 1 /* TypeElement */:
39625            return checkAndUpdateElementInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
39626        case 2 /* TypeText */:
39627            return checkAndUpdateTextInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
39628        case 16384 /* TypeDirective */:
39629            return checkAndUpdateDirectiveInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
39630        case 32 /* TypePureArray */:
39631        case 64 /* TypePureObject */:
39632        case 128 /* TypePurePipe */:
39633            return checkAndUpdatePureExpressionInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
39634        default:
39635            throw 'unreachable';
39636    }
39637}
39638function checkAndUpdateNodeDynamic(view, nodeDef, values) {
39639    switch (nodeDef.flags & 201347067 /* Types */) {
39640        case 1 /* TypeElement */:
39641            return checkAndUpdateElementDynamic(view, nodeDef, values);
39642        case 2 /* TypeText */:
39643            return checkAndUpdateTextDynamic(view, nodeDef, values);
39644        case 16384 /* TypeDirective */:
39645            return checkAndUpdateDirectiveDynamic(view, nodeDef, values);
39646        case 32 /* TypePureArray */:
39647        case 64 /* TypePureObject */:
39648        case 128 /* TypePurePipe */:
39649            return checkAndUpdatePureExpressionDynamic(view, nodeDef, values);
39650        default:
39651            throw 'unreachable';
39652    }
39653}
39654function checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
39655    if (argStyle === 0 /* Inline */) {
39656        checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
39657    }
39658    else {
39659        checkNoChangesNodeDynamic(view, nodeDef, v0);
39660    }
39661    // Returning false is ok here as we would have thrown in case of a change.
39662    return false;
39663}
39664function checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
39665    const bindLen = nodeDef.bindings.length;
39666    if (bindLen > 0)
39667        checkBindingNoChanges(view, nodeDef, 0, v0);
39668    if (bindLen > 1)
39669        checkBindingNoChanges(view, nodeDef, 1, v1);
39670    if (bindLen > 2)
39671        checkBindingNoChanges(view, nodeDef, 2, v2);
39672    if (bindLen > 3)
39673        checkBindingNoChanges(view, nodeDef, 3, v3);
39674    if (bindLen > 4)
39675        checkBindingNoChanges(view, nodeDef, 4, v4);
39676    if (bindLen > 5)
39677        checkBindingNoChanges(view, nodeDef, 5, v5);
39678    if (bindLen > 6)
39679        checkBindingNoChanges(view, nodeDef, 6, v6);
39680    if (bindLen > 7)
39681        checkBindingNoChanges(view, nodeDef, 7, v7);
39682    if (bindLen > 8)
39683        checkBindingNoChanges(view, nodeDef, 8, v8);
39684    if (bindLen > 9)
39685        checkBindingNoChanges(view, nodeDef, 9, v9);
39686}
39687function checkNoChangesNodeDynamic(view, nodeDef, values) {
39688    for (let i = 0; i < values.length; i++) {
39689        checkBindingNoChanges(view, nodeDef, i, values[i]);
39690    }
39691}
39692/**
39693 * Workaround https://github.com/angular/tsickle/issues/497
39694 * @suppress {misplacedTypeAnnotation}
39695 */
39696function checkNoChangesQuery(view, nodeDef) {
39697    const queryList = asQueryList(view, nodeDef.nodeIndex);
39698    if (queryList.dirty) {
39699        throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, nodeDef.nodeIndex), `Query ${nodeDef.query.id} not dirty`, `Query ${nodeDef.query.id} dirty`, (view.state & 1 /* BeforeFirstCheck */) !== 0);
39700    }
39701}
39702function destroyView(view) {
39703    if (view.state & 128 /* Destroyed */) {
39704        return;
39705    }
39706    execEmbeddedViewsAction(view, ViewAction.Destroy);
39707    execComponentViewsAction(view, ViewAction.Destroy);
39708    callLifecycleHooksChildrenFirst(view, 131072 /* OnDestroy */);
39709    if (view.disposables) {
39710        for (let i = 0; i < view.disposables.length; i++) {
39711            view.disposables[i]();
39712        }
39713    }
39714    detachProjectedView(view);
39715    if (view.renderer.destroyNode) {
39716        destroyViewNodes(view);
39717    }
39718    if (isComponentView(view)) {
39719        view.renderer.destroy();
39720    }
39721    view.state |= 128 /* Destroyed */;
39722}
39723function destroyViewNodes(view) {
39724    const len = view.def.nodes.length;
39725    for (let i = 0; i < len; i++) {
39726        const def = view.def.nodes[i];
39727        if (def.flags & 1 /* TypeElement */) {
39728            view.renderer.destroyNode(asElementData(view, i).renderElement);
39729        }
39730        else if (def.flags & 2 /* TypeText */) {
39731            view.renderer.destroyNode(asTextData(view, i).renderText);
39732        }
39733        else if (def.flags & 67108864 /* TypeContentQuery */ || def.flags & 134217728 /* TypeViewQuery */) {
39734            asQueryList(view, i).destroy();
39735        }
39736    }
39737}
39738var ViewAction;
39739(function (ViewAction) {
39740    ViewAction[ViewAction["CreateViewNodes"] = 0] = "CreateViewNodes";
39741    ViewAction[ViewAction["CheckNoChanges"] = 1] = "CheckNoChanges";
39742    ViewAction[ViewAction["CheckNoChangesProjectedViews"] = 2] = "CheckNoChangesProjectedViews";
39743    ViewAction[ViewAction["CheckAndUpdate"] = 3] = "CheckAndUpdate";
39744    ViewAction[ViewAction["CheckAndUpdateProjectedViews"] = 4] = "CheckAndUpdateProjectedViews";
39745    ViewAction[ViewAction["Destroy"] = 5] = "Destroy";
39746})(ViewAction || (ViewAction = {}));
39747function execComponentViewsAction(view, action) {
39748    const def = view.def;
39749    if (!(def.nodeFlags & 33554432 /* ComponentView */)) {
39750        return;
39751    }
39752    for (let i = 0; i < def.nodes.length; i++) {
39753        const nodeDef = def.nodes[i];
39754        if (nodeDef.flags & 33554432 /* ComponentView */) {
39755            // a leaf
39756            callViewAction(asElementData(view, i).componentView, action);
39757        }
39758        else if ((nodeDef.childFlags & 33554432 /* ComponentView */) === 0) {
39759            // a parent with leafs
39760            // no child is a component,
39761            // then skip the children
39762            i += nodeDef.childCount;
39763        }
39764    }
39765}
39766function execEmbeddedViewsAction(view, action) {
39767    const def = view.def;
39768    if (!(def.nodeFlags & 16777216 /* EmbeddedViews */)) {
39769        return;
39770    }
39771    for (let i = 0; i < def.nodes.length; i++) {
39772        const nodeDef = def.nodes[i];
39773        if (nodeDef.flags & 16777216 /* EmbeddedViews */) {
39774            // a leaf
39775            const embeddedViews = asElementData(view, i).viewContainer._embeddedViews;
39776            for (let k = 0; k < embeddedViews.length; k++) {
39777                callViewAction(embeddedViews[k], action);
39778            }
39779        }
39780        else if ((nodeDef.childFlags & 16777216 /* EmbeddedViews */) === 0) {
39781            // a parent with leafs
39782            // no child is a component,
39783            // then skip the children
39784            i += nodeDef.childCount;
39785        }
39786    }
39787}
39788function callViewAction(view, action) {
39789    const viewState = view.state;
39790    switch (action) {
39791        case ViewAction.CheckNoChanges:
39792            if ((viewState & 128 /* Destroyed */) === 0) {
39793                if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {
39794                    checkNoChangesView(view);
39795                }
39796                else if (viewState & 64 /* CheckProjectedViews */) {
39797                    execProjectedViewsAction(view, ViewAction.CheckNoChangesProjectedViews);
39798                }
39799            }
39800            break;
39801        case ViewAction.CheckNoChangesProjectedViews:
39802            if ((viewState & 128 /* Destroyed */) === 0) {
39803                if (viewState & 32 /* CheckProjectedView */) {
39804                    checkNoChangesView(view);
39805                }
39806                else if (viewState & 64 /* CheckProjectedViews */) {
39807                    execProjectedViewsAction(view, action);
39808                }
39809            }
39810            break;
39811        case ViewAction.CheckAndUpdate:
39812            if ((viewState & 128 /* Destroyed */) === 0) {
39813                if ((viewState & 12 /* CatDetectChanges */) === 12 /* CatDetectChanges */) {
39814                    checkAndUpdateView(view);
39815                }
39816                else if (viewState & 64 /* CheckProjectedViews */) {
39817                    execProjectedViewsAction(view, ViewAction.CheckAndUpdateProjectedViews);
39818                }
39819            }
39820            break;
39821        case ViewAction.CheckAndUpdateProjectedViews:
39822            if ((viewState & 128 /* Destroyed */) === 0) {
39823                if (viewState & 32 /* CheckProjectedView */) {
39824                    checkAndUpdateView(view);
39825                }
39826                else if (viewState & 64 /* CheckProjectedViews */) {
39827                    execProjectedViewsAction(view, action);
39828                }
39829            }
39830            break;
39831        case ViewAction.Destroy:
39832            // Note: destroyView recurses over all views,
39833            // so we don't need to special case projected views here.
39834            destroyView(view);
39835            break;
39836        case ViewAction.CreateViewNodes:
39837            createViewNodes(view);
39838            break;
39839    }
39840}
39841function execProjectedViewsAction(view, action) {
39842    execEmbeddedViewsAction(view, action);
39843    execComponentViewsAction(view, action);
39844}
39845function execQueriesAction(view, queryFlags, staticDynamicQueryFlag, checkType) {
39846    if (!(view.def.nodeFlags & queryFlags) || !(view.def.nodeFlags & staticDynamicQueryFlag)) {
39847        return;
39848    }
39849    const nodeCount = view.def.nodes.length;
39850    for (let i = 0; i < nodeCount; i++) {
39851        const nodeDef = view.def.nodes[i];
39852        if ((nodeDef.flags & queryFlags) && (nodeDef.flags & staticDynamicQueryFlag)) {
39853            Services.setCurrentNode(view, nodeDef.nodeIndex);
39854            switch (checkType) {
39855                case 0 /* CheckAndUpdate */:
39856                    checkAndUpdateQuery(view, nodeDef);
39857                    break;
39858                case 1 /* CheckNoChanges */:
39859                    checkNoChangesQuery(view, nodeDef);
39860                    break;
39861            }
39862        }
39863        if (!(nodeDef.childFlags & queryFlags) || !(nodeDef.childFlags & staticDynamicQueryFlag)) {
39864            // no child has a matching query
39865            // then skip the children
39866            i += nodeDef.childCount;
39867        }
39868    }
39869}
39870
39871/**
39872 * @license
39873 * Copyright Google LLC All Rights Reserved.
39874 *
39875 * Use of this source code is governed by an MIT-style license that can be
39876 * found in the LICENSE file at https://angular.io/license
39877 */
39878let initialized = false;
39879function initServicesIfNeeded() {
39880    if (initialized) {
39881        return;
39882    }
39883    initialized = true;
39884    const services = isDevMode() ? createDebugServices() : createProdServices();
39885    Services.setCurrentNode = services.setCurrentNode;
39886    Services.createRootView = services.createRootView;
39887    Services.createEmbeddedView = services.createEmbeddedView;
39888    Services.createComponentView = services.createComponentView;
39889    Services.createNgModuleRef = services.createNgModuleRef;
39890    Services.overrideProvider = services.overrideProvider;
39891    Services.overrideComponentView = services.overrideComponentView;
39892    Services.clearOverrides = services.clearOverrides;
39893    Services.checkAndUpdateView = services.checkAndUpdateView;
39894    Services.checkNoChangesView = services.checkNoChangesView;
39895    Services.destroyView = services.destroyView;
39896    Services.resolveDep = resolveDep;
39897    Services.createDebugContext = services.createDebugContext;
39898    Services.handleEvent = services.handleEvent;
39899    Services.updateDirectives = services.updateDirectives;
39900    Services.updateRenderer = services.updateRenderer;
39901    Services.dirtyParentQueries = dirtyParentQueries;
39902}
39903function createProdServices() {
39904    return {
39905        setCurrentNode: () => { },
39906        createRootView: createProdRootView,
39907        createEmbeddedView: createEmbeddedView,
39908        createComponentView: createComponentView,
39909        createNgModuleRef: createNgModuleRef,
39910        overrideProvider: NOOP,
39911        overrideComponentView: NOOP,
39912        clearOverrides: NOOP,
39913        checkAndUpdateView: checkAndUpdateView,
39914        checkNoChangesView: checkNoChangesView,
39915        destroyView: destroyView,
39916        createDebugContext: (view, nodeIndex) => new DebugContext_(view, nodeIndex),
39917        handleEvent: (view, nodeIndex, eventName, event) => view.def.handleEvent(view, nodeIndex, eventName, event),
39918        updateDirectives: (view, checkType) => view.def.updateDirectives(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode : prodCheckNoChangesNode, view),
39919        updateRenderer: (view, checkType) => view.def.updateRenderer(checkType === 0 /* CheckAndUpdate */ ? prodCheckAndUpdateNode : prodCheckNoChangesNode, view),
39920    };
39921}
39922function createDebugServices() {
39923    return {
39924        setCurrentNode: debugSetCurrentNode,
39925        createRootView: debugCreateRootView,
39926        createEmbeddedView: debugCreateEmbeddedView,
39927        createComponentView: debugCreateComponentView,
39928        createNgModuleRef: debugCreateNgModuleRef,
39929        overrideProvider: debugOverrideProvider,
39930        overrideComponentView: debugOverrideComponentView,
39931        clearOverrides: debugClearOverrides,
39932        checkAndUpdateView: debugCheckAndUpdateView,
39933        checkNoChangesView: debugCheckNoChangesView,
39934        destroyView: debugDestroyView,
39935        createDebugContext: (view, nodeIndex) => new DebugContext_(view, nodeIndex),
39936        handleEvent: debugHandleEvent,
39937        updateDirectives: debugUpdateDirectives,
39938        updateRenderer: debugUpdateRenderer,
39939    };
39940}
39941function createProdRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {
39942    const rendererFactory = ngModule.injector.get(RendererFactory2);
39943    return createRootView(createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode), def, context);
39944}
39945function debugCreateRootView(elInjector, projectableNodes, rootSelectorOrNode, def, ngModule, context) {
39946    const rendererFactory = ngModule.injector.get(RendererFactory2);
39947    const root = createRootData(elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes, rootSelectorOrNode);
39948    const defWithOverride = applyProviderOverridesToView(def);
39949    return callWithDebugContext(DebugAction.create, createRootView, null, [root, defWithOverride, context]);
39950}
39951function createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode) {
39952    const sanitizer = ngModule.injector.get(Sanitizer);
39953    const errorHandler = ngModule.injector.get(ErrorHandler);
39954    const renderer = rendererFactory.createRenderer(null, null);
39955    return {
39956        ngModule,
39957        injector: elInjector,
39958        projectableNodes,
39959        selectorOrNode: rootSelectorOrNode,
39960        sanitizer,
39961        rendererFactory,
39962        renderer,
39963        errorHandler
39964    };
39965}
39966function debugCreateEmbeddedView(parentView, anchorDef, viewDef, context) {
39967    const defWithOverride = applyProviderOverridesToView(viewDef);
39968    return callWithDebugContext(DebugAction.create, createEmbeddedView, null, [parentView, anchorDef, defWithOverride, context]);
39969}
39970function debugCreateComponentView(parentView, nodeDef, viewDef, hostElement) {
39971    const overrideComponentView = viewDefOverrides.get(nodeDef.element.componentProvider.provider.token);
39972    if (overrideComponentView) {
39973        viewDef = overrideComponentView;
39974    }
39975    else {
39976        viewDef = applyProviderOverridesToView(viewDef);
39977    }
39978    return callWithDebugContext(DebugAction.create, createComponentView, null, [parentView, nodeDef, viewDef, hostElement]);
39979}
39980function debugCreateNgModuleRef(moduleType, parentInjector, bootstrapComponents, def) {
39981    const defWithOverride = applyProviderOverridesToNgModule(def);
39982    return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);
39983}
39984const providerOverrides = new Map();
39985const providerOverridesWithScope = new Map();
39986const viewDefOverrides = new Map();
39987function debugOverrideProvider(override) {
39988    providerOverrides.set(override.token, override);
39989    let injectableDef;
39990    if (typeof override.token === 'function' && (injectableDef = getInjectableDef(override.token)) &&
39991        typeof injectableDef.providedIn === 'function') {
39992        providerOverridesWithScope.set(override.token, override);
39993    }
39994}
39995function debugOverrideComponentView(comp, compFactory) {
39996    const hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory));
39997    const compViewDef = resolveDefinition(hostViewDef.nodes[0].element.componentView);
39998    viewDefOverrides.set(comp, compViewDef);
39999}
40000function debugClearOverrides() {
40001    providerOverrides.clear();
40002    providerOverridesWithScope.clear();
40003    viewDefOverrides.clear();
40004}
40005// Notes about the algorithm:
40006// 1) Locate the providers of an element and check if one of them was overwritten
40007// 2) Change the providers of that element
40008//
40009// We only create new datastructures if we need to, to keep perf impact
40010// reasonable.
40011function applyProviderOverridesToView(def) {
40012    if (providerOverrides.size === 0) {
40013        return def;
40014    }
40015    const elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def);
40016    if (elementIndicesWithOverwrittenProviders.length === 0) {
40017        return def;
40018    }
40019    // clone the whole view definition,
40020    // as it maintains references between the nodes that are hard to update.
40021    def = def.factory(() => NOOP);
40022    for (let i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {
40023        applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);
40024    }
40025    return def;
40026    function findElementIndicesWithOverwrittenProviders(def) {
40027        const elIndicesWithOverwrittenProviders = [];
40028        let lastElementDef = null;
40029        for (let i = 0; i < def.nodes.length; i++) {
40030            const nodeDef = def.nodes[i];
40031            if (nodeDef.flags & 1 /* TypeElement */) {
40032                lastElementDef = nodeDef;
40033            }
40034            if (lastElementDef && nodeDef.flags & 3840 /* CatProviderNoDirective */ &&
40035                providerOverrides.has(nodeDef.provider.token)) {
40036                elIndicesWithOverwrittenProviders.push(lastElementDef.nodeIndex);
40037                lastElementDef = null;
40038            }
40039        }
40040        return elIndicesWithOverwrittenProviders;
40041    }
40042    function applyProviderOverridesToElement(viewDef, elIndex) {
40043        for (let i = elIndex + 1; i < viewDef.nodes.length; i++) {
40044            const nodeDef = viewDef.nodes[i];
40045            if (nodeDef.flags & 1 /* TypeElement */) {
40046                // stop at the next element
40047                return;
40048            }
40049            if (nodeDef.flags & 3840 /* CatProviderNoDirective */) {
40050                const provider = nodeDef.provider;
40051                const override = providerOverrides.get(provider.token);
40052                if (override) {
40053                    nodeDef.flags = (nodeDef.flags & ~3840 /* CatProviderNoDirective */) | override.flags;
40054                    provider.deps = splitDepsDsl(override.deps);
40055                    provider.value = override.value;
40056                }
40057            }
40058        }
40059    }
40060}
40061// Notes about the algorithm:
40062// We only create new datastructures if we need to, to keep perf impact
40063// reasonable.
40064function applyProviderOverridesToNgModule(def) {
40065    const { hasOverrides, hasDeprecatedOverrides } = calcHasOverrides(def);
40066    if (!hasOverrides) {
40067        return def;
40068    }
40069    // clone the whole view definition,
40070    // as it maintains references between the nodes that are hard to update.
40071    def = def.factory(() => NOOP);
40072    applyProviderOverrides(def);
40073    return def;
40074    function calcHasOverrides(def) {
40075        let hasOverrides = false;
40076        let hasDeprecatedOverrides = false;
40077        if (providerOverrides.size === 0) {
40078            return { hasOverrides, hasDeprecatedOverrides };
40079        }
40080        def.providers.forEach(node => {
40081            const override = providerOverrides.get(node.token);
40082            if ((node.flags & 3840 /* CatProviderNoDirective */) && override) {
40083                hasOverrides = true;
40084                hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;
40085            }
40086        });
40087        def.modules.forEach(module => {
40088            providerOverridesWithScope.forEach((override, token) => {
40089                if (getInjectableDef(token).providedIn === module) {
40090                    hasOverrides = true;
40091                    hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;
40092                }
40093            });
40094        });
40095        return { hasOverrides, hasDeprecatedOverrides };
40096    }
40097    function applyProviderOverrides(def) {
40098        for (let i = 0; i < def.providers.length; i++) {
40099            const provider = def.providers[i];
40100            if (hasDeprecatedOverrides) {
40101                // We had a bug where me made
40102                // all providers lazy. Keep this logic behind a flag
40103                // for migrating existing users.
40104                provider.flags |= 4096 /* LazyProvider */;
40105            }
40106            const override = providerOverrides.get(provider.token);
40107            if (override) {
40108                provider.flags = (provider.flags & ~3840 /* CatProviderNoDirective */) | override.flags;
40109                provider.deps = splitDepsDsl(override.deps);
40110                provider.value = override.value;
40111            }
40112        }
40113        if (providerOverridesWithScope.size > 0) {
40114            let moduleSet = new Set(def.modules);
40115            providerOverridesWithScope.forEach((override, token) => {
40116                if (moduleSet.has(getInjectableDef(token).providedIn)) {
40117                    let provider = {
40118                        token: token,
40119                        flags: override.flags | (hasDeprecatedOverrides ? 4096 /* LazyProvider */ : 0 /* None */),
40120                        deps: splitDepsDsl(override.deps),
40121                        value: override.value,
40122                        index: def.providers.length,
40123                    };
40124                    def.providers.push(provider);
40125                    def.providersByKey[tokenKey(token)] = provider;
40126                }
40127            });
40128        }
40129    }
40130}
40131function prodCheckAndUpdateNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
40132    const nodeDef = view.def.nodes[checkIndex];
40133    checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
40134    return (nodeDef.flags & 224 /* CatPureExpression */) ?
40135        asPureExpressionData(view, checkIndex).value :
40136        undefined;
40137}
40138function prodCheckNoChangesNode(view, checkIndex, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {
40139    const nodeDef = view.def.nodes[checkIndex];
40140    checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
40141    return (nodeDef.flags & 224 /* CatPureExpression */) ?
40142        asPureExpressionData(view, checkIndex).value :
40143        undefined;
40144}
40145function debugCheckAndUpdateView(view) {
40146    return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);
40147}
40148function debugCheckNoChangesView(view) {
40149    return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);
40150}
40151function debugDestroyView(view) {
40152    return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);
40153}
40154var DebugAction;
40155(function (DebugAction) {
40156    DebugAction[DebugAction["create"] = 0] = "create";
40157    DebugAction[DebugAction["detectChanges"] = 1] = "detectChanges";
40158    DebugAction[DebugAction["checkNoChanges"] = 2] = "checkNoChanges";
40159    DebugAction[DebugAction["destroy"] = 3] = "destroy";
40160    DebugAction[DebugAction["handleEvent"] = 4] = "handleEvent";
40161})(DebugAction || (DebugAction = {}));
40162let _currentAction;
40163let _currentView;
40164let _currentNodeIndex;
40165function debugSetCurrentNode(view, nodeIndex) {
40166    _currentView = view;
40167    _currentNodeIndex = nodeIndex;
40168}
40169function debugHandleEvent(view, nodeIndex, eventName, event) {
40170    debugSetCurrentNode(view, nodeIndex);
40171    return callWithDebugContext(DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]);
40172}
40173function debugUpdateDirectives(view, checkType) {
40174    if (view.state & 128 /* Destroyed */) {
40175        throw viewDestroyedError(DebugAction[_currentAction]);
40176    }
40177    debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0));
40178    return view.def.updateDirectives(debugCheckDirectivesFn, view);
40179    function debugCheckDirectivesFn(view, nodeIndex, argStyle, ...values) {
40180        const nodeDef = view.def.nodes[nodeIndex];
40181        if (checkType === 0 /* CheckAndUpdate */) {
40182            debugCheckAndUpdateNode(view, nodeDef, argStyle, values);
40183        }
40184        else {
40185            debugCheckNoChangesNode(view, nodeDef, argStyle, values);
40186        }
40187        if (nodeDef.flags & 16384 /* TypeDirective */) {
40188            debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex));
40189        }
40190        return (nodeDef.flags & 224 /* CatPureExpression */) ?
40191            asPureExpressionData(view, nodeDef.nodeIndex).value :
40192            undefined;
40193    }
40194}
40195function debugUpdateRenderer(view, checkType) {
40196    if (view.state & 128 /* Destroyed */) {
40197        throw viewDestroyedError(DebugAction[_currentAction]);
40198    }
40199    debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0));
40200    return view.def.updateRenderer(debugCheckRenderNodeFn, view);
40201    function debugCheckRenderNodeFn(view, nodeIndex, argStyle, ...values) {
40202        const nodeDef = view.def.nodes[nodeIndex];
40203        if (checkType === 0 /* CheckAndUpdate */) {
40204            debugCheckAndUpdateNode(view, nodeDef, argStyle, values);
40205        }
40206        else {
40207            debugCheckNoChangesNode(view, nodeDef, argStyle, values);
40208        }
40209        if (nodeDef.flags & 3 /* CatRenderNode */) {
40210            debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex));
40211        }
40212        return (nodeDef.flags & 224 /* CatPureExpression */) ?
40213            asPureExpressionData(view, nodeDef.nodeIndex).value :
40214            undefined;
40215    }
40216}
40217function debugCheckAndUpdateNode(view, nodeDef, argStyle, givenValues) {
40218    const changed = checkAndUpdateNode(view, nodeDef, argStyle, ...givenValues);
40219    if (changed) {
40220        const values = argStyle === 1 /* Dynamic */ ? givenValues[0] : givenValues;
40221        if (nodeDef.flags & 16384 /* TypeDirective */) {
40222            const bindingValues = {};
40223            for (let i = 0; i < nodeDef.bindings.length; i++) {
40224                const binding = nodeDef.bindings[i];
40225                const value = values[i];
40226                if (binding.flags & 8 /* TypeProperty */) {
40227                    bindingValues[normalizeDebugBindingName(binding.nonMinifiedName)] =
40228                        normalizeDebugBindingValue(value);
40229                }
40230            }
40231            const elDef = nodeDef.parent;
40232            const el = asElementData(view, elDef.nodeIndex).renderElement;
40233            if (!elDef.element.name) {
40234                // a comment.
40235                view.renderer.setValue(el, escapeCommentText(`bindings=${JSON.stringify(bindingValues, null, 2)}`));
40236            }
40237            else {
40238                // a regular element.
40239                for (let attr in bindingValues) {
40240                    const value = bindingValues[attr];
40241                    if (value != null) {
40242                        view.renderer.setAttribute(el, attr, value);
40243                    }
40244                    else {
40245                        view.renderer.removeAttribute(el, attr);
40246                    }
40247                }
40248            }
40249        }
40250    }
40251}
40252function debugCheckNoChangesNode(view, nodeDef, argStyle, values) {
40253    checkNoChangesNode(view, nodeDef, argStyle, ...values);
40254}
40255function nextDirectiveWithBinding(view, nodeIndex) {
40256    for (let i = nodeIndex; i < view.def.nodes.length; i++) {
40257        const nodeDef = view.def.nodes[i];
40258        if (nodeDef.flags & 16384 /* TypeDirective */ && nodeDef.bindings && nodeDef.bindings.length) {
40259            return i;
40260        }
40261    }
40262    return null;
40263}
40264function nextRenderNodeWithBinding(view, nodeIndex) {
40265    for (let i = nodeIndex; i < view.def.nodes.length; i++) {
40266        const nodeDef = view.def.nodes[i];
40267        if ((nodeDef.flags & 3 /* CatRenderNode */) && nodeDef.bindings && nodeDef.bindings.length) {
40268            return i;
40269        }
40270    }
40271    return null;
40272}
40273class DebugContext_ {
40274    constructor(view, nodeIndex) {
40275        this.view = view;
40276        this.nodeIndex = nodeIndex;
40277        if (nodeIndex == null) {
40278            this.nodeIndex = nodeIndex = 0;
40279        }
40280        this.nodeDef = view.def.nodes[nodeIndex];
40281        let elDef = this.nodeDef;
40282        let elView = view;
40283        while (elDef && (elDef.flags & 1 /* TypeElement */) === 0) {
40284            elDef = elDef.parent;
40285        }
40286        if (!elDef) {
40287            while (!elDef && elView) {
40288                elDef = viewParentEl(elView);
40289                elView = elView.parent;
40290            }
40291        }
40292        this.elDef = elDef;
40293        this.elView = elView;
40294    }
40295    get elOrCompView() {
40296        // Has to be done lazily as we use the DebugContext also during creation of elements...
40297        return asElementData(this.elView, this.elDef.nodeIndex).componentView || this.view;
40298    }
40299    get injector() {
40300        return createInjector$1(this.elView, this.elDef);
40301    }
40302    get component() {
40303        return this.elOrCompView.component;
40304    }
40305    get context() {
40306        return this.elOrCompView.context;
40307    }
40308    get providerTokens() {
40309        const tokens = [];
40310        if (this.elDef) {
40311            for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {
40312                const childDef = this.elView.def.nodes[i];
40313                if (childDef.flags & 20224 /* CatProvider */) {
40314                    tokens.push(childDef.provider.token);
40315                }
40316                i += childDef.childCount;
40317            }
40318        }
40319        return tokens;
40320    }
40321    get references() {
40322        const references = {};
40323        if (this.elDef) {
40324            collectReferences(this.elView, this.elDef, references);
40325            for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount; i++) {
40326                const childDef = this.elView.def.nodes[i];
40327                if (childDef.flags & 20224 /* CatProvider */) {
40328                    collectReferences(this.elView, childDef, references);
40329                }
40330                i += childDef.childCount;
40331            }
40332        }
40333        return references;
40334    }
40335    get componentRenderElement() {
40336        const elData = findHostElement(this.elOrCompView);
40337        return elData ? elData.renderElement : undefined;
40338    }
40339    get renderNode() {
40340        return this.nodeDef.flags & 2 /* TypeText */ ? renderNode(this.view, this.nodeDef) :
40341            renderNode(this.elView, this.elDef);
40342    }
40343    logError(console, ...values) {
40344        let logViewDef;
40345        let logNodeIndex;
40346        if (this.nodeDef.flags & 2 /* TypeText */) {
40347            logViewDef = this.view.def;
40348            logNodeIndex = this.nodeDef.nodeIndex;
40349        }
40350        else {
40351            logViewDef = this.elView.def;
40352            logNodeIndex = this.elDef.nodeIndex;
40353        }
40354        // Note: we only generate a log function for text and element nodes
40355        // to make the generated code as small as possible.
40356        const renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);
40357        let currRenderNodeIndex = -1;
40358        let nodeLogger = () => {
40359            currRenderNodeIndex++;
40360            if (currRenderNodeIndex === renderNodeIndex) {
40361                return console.error.bind(console, ...values);
40362            }
40363            else {
40364                return NOOP;
40365            }
40366        };
40367        logViewDef.factory(nodeLogger);
40368        if (currRenderNodeIndex < renderNodeIndex) {
40369            console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');
40370            console.error(...values);
40371        }
40372    }
40373}
40374function getRenderNodeIndex(viewDef, nodeIndex) {
40375    let renderNodeIndex = -1;
40376    for (let i = 0; i <= nodeIndex; i++) {
40377        const nodeDef = viewDef.nodes[i];
40378        if (nodeDef.flags & 3 /* CatRenderNode */) {
40379            renderNodeIndex++;
40380        }
40381    }
40382    return renderNodeIndex;
40383}
40384function findHostElement(view) {
40385    while (view && !isComponentView(view)) {
40386        view = view.parent;
40387    }
40388    if (view.parent) {
40389        return asElementData(view.parent, viewParentEl(view).nodeIndex);
40390    }
40391    return null;
40392}
40393function collectReferences(view, nodeDef, references) {
40394    for (let refName in nodeDef.references) {
40395        references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);
40396    }
40397}
40398function callWithDebugContext(action, fn, self, args) {
40399    const oldAction = _currentAction;
40400    const oldView = _currentView;
40401    const oldNodeIndex = _currentNodeIndex;
40402    try {
40403        _currentAction = action;
40404        const result = fn.apply(self, args);
40405        _currentView = oldView;
40406        _currentNodeIndex = oldNodeIndex;
40407        _currentAction = oldAction;
40408        return result;
40409    }
40410    catch (e) {
40411        if (isViewDebugError(e) || !_currentView) {
40412            throw e;
40413        }
40414        throw viewWrappedDebugError(e, getCurrentDebugContext());
40415    }
40416}
40417function getCurrentDebugContext() {
40418    return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;
40419}
40420class DebugRendererFactory2 {
40421    constructor(delegate) {
40422        this.delegate = delegate;
40423    }
40424    createRenderer(element, renderData) {
40425        return new DebugRenderer2(this.delegate.createRenderer(element, renderData));
40426    }
40427    begin() {
40428        if (this.delegate.begin) {
40429            this.delegate.begin();
40430        }
40431    }
40432    end() {
40433        if (this.delegate.end) {
40434            this.delegate.end();
40435        }
40436    }
40437    whenRenderingDone() {
40438        if (this.delegate.whenRenderingDone) {
40439            return this.delegate.whenRenderingDone();
40440        }
40441        return Promise.resolve(null);
40442    }
40443}
40444class DebugRenderer2 {
40445    constructor(delegate) {
40446        this.delegate = delegate;
40447        /**
40448         * Factory function used to create a `DebugContext` when a node is created.
40449         *
40450         * The `DebugContext` allows to retrieve information about the nodes that are useful in tests.
40451         *
40452         * The factory is configurable so that the `DebugRenderer2` could instantiate either a View Engine
40453         * or a Render context.
40454         */
40455        this.debugContextFactory = getCurrentDebugContext;
40456        this.data = this.delegate.data;
40457    }
40458    createDebugContext(nativeElement) {
40459        return this.debugContextFactory(nativeElement);
40460    }
40461    destroyNode(node) {
40462        const debugNode = getDebugNode$1(node);
40463        if (debugNode) {
40464            removeDebugNodeFromIndex(debugNode);
40465            if (debugNode instanceof DebugNode__PRE_R3__) {
40466                debugNode.listeners.length = 0;
40467            }
40468        }
40469        if (this.delegate.destroyNode) {
40470            this.delegate.destroyNode(node);
40471        }
40472    }
40473    destroy() {
40474        this.delegate.destroy();
40475    }
40476    createElement(name, namespace) {
40477        const el = this.delegate.createElement(name, namespace);
40478        const debugCtx = this.createDebugContext(el);
40479        if (debugCtx) {
40480            const debugEl = new DebugElement__PRE_R3__(el, null, debugCtx);
40481            debugEl.name = name;
40482            indexDebugNode(debugEl);
40483        }
40484        return el;
40485    }
40486    createComment(value) {
40487        const comment = this.delegate.createComment(escapeCommentText(value));
40488        const debugCtx = this.createDebugContext(comment);
40489        if (debugCtx) {
40490            indexDebugNode(new DebugNode__PRE_R3__(comment, null, debugCtx));
40491        }
40492        return comment;
40493    }
40494    createText(value) {
40495        const text = this.delegate.createText(value);
40496        const debugCtx = this.createDebugContext(text);
40497        if (debugCtx) {
40498            indexDebugNode(new DebugNode__PRE_R3__(text, null, debugCtx));
40499        }
40500        return text;
40501    }
40502    appendChild(parent, newChild) {
40503        const debugEl = getDebugNode
40503$1(parent);
40504        const debugChildEl = getDebugNode$1(newChild);
40505        if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {
40506            debugEl.addChild(debugChildEl);
40507        }
40508        this.delegate.appendChild(parent, newChild);
40509    }
40510    insertBefore(parent, newChild, refChild, isMove) {
40511        const debugEl = getDebugNode$1(parent);
40512        const debugChildEl = getDebugNode$1(newChild);
40513        const debugRefEl = getDebugNode$1(refChild);
40514        if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {
40515            debugEl.insertBefore(debugRefEl, debugChildEl);
40516        }
40517        this.delegate.insertBefore(parent, newChild, refChild, isMove);
40518    }
40519    removeChild(parent, oldChild) {
40520        const debugEl = getDebugNode$1(parent);
40521        const debugChildEl = getDebugNode$1(oldChild);
40522        if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {
40523            debugEl.removeChild(debugChildEl);
40524        }
40525        this.delegate.removeChild(parent, oldChild);
40526    }
40527    selectRootElement(selectorOrNode, preserveContent) {
40528        const el = this.delegate.selectRootElement(selectorOrNode, preserveContent);
40529        const debugCtx = getCurrentDebugContext();
40530        if (debugCtx) {
40531            indexDebugNode(new DebugElement__PRE_R3__(el, null, debugCtx));
40532        }
40533        return el;
40534    }
40535    setAttribute(el, name, value, namespace) {
40536        const debugEl = getDebugNode$1(el);
40537        if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
40538            const fullName = namespace ? namespace + ':' + name : name;
40539            debugEl.attributes[fullName] = value;
40540        }
40541        this.delegate.setAttribute(el, name, value, namespace);
40542    }
40543    removeAttribute(el, name, namespace) {
40544        const debugEl = getDebugNode$1(el);
40545        if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
40546            const fullName = namespace ? namespace + ':' + name : name;
40547            debugEl.attributes[fullName] = null;
40548        }
40549        this.delegate.removeAttribute(el, name, namespace);
40550    }
40551    addClass(el, name) {
40552        const debugEl = getDebugNode$1(el);
40553        if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
40554            debugEl.classes[name] = true;
40555        }
40556        this.delegate.addClass(el, name);
40557    }
40558    removeClass(el, name) {
40559        const debugEl = getDebugNode$1(el);
40560        if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
40561            debugEl.classes[name] = false;
40562        }
40563        this.delegate.removeClass(el, name);
40564    }
40565    setStyle(el, style, value, flags) {
40566        const debugEl = getDebugNode$1(el);
40567        if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
40568            debugEl.styles[style] = value;
40569        }
40570        this.delegate.setStyle(el, style, value, flags);
40571    }
40572    removeStyle(el, style, flags) {
40573        const debugEl = getDebugNode$1(el);
40574        if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
40575            debugEl.styles[style] = null;
40576        }
40577        this.delegate.removeStyle(el, style, flags);
40578    }
40579    setProperty(el, name, value) {
40580        const debugEl = getDebugNode$1(el);
40581        if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {
40582            debugEl.properties[name] = value;
40583        }
40584        this.delegate.setProperty(el, name, value);
40585    }
40586    listen(target, eventName, callback) {
40587        if (typeof target !== 'string') {
40588            const debugEl = getDebugNode$1(target);
40589            if (debugEl) {
40590                debugEl.listeners.push(new DebugEventListener(eventName, callback));
40591            }
40592        }
40593        return this.delegate.listen(target, eventName, callback);
40594    }
40595    parentNode(node) {
40596        return this.delegate.parentNode(node);
40597    }
40598    nextSibling(node) {
40599        return this.delegate.nextSibling(node);
40600    }
40601    setValue(node, value) {
40602        return this.delegate.setValue(node, value);
40603    }
40604}
40605
40606/**
40607 * @license
40608 * Copyright Google LLC All Rights Reserved.
40609 *
40610 * Use of this source code is governed by an MIT-style license that can be
40611 * found in the LICENSE file at https://angular.io/license
40612 */
40613function overrideProvider(override) {
40614    initServicesIfNeeded();
40615    return Services.overrideProvider(override);
40616}
40617function overrideComponentView(comp, componentFactory) {
40618    initServicesIfNeeded();
40619    return Services.overrideComponentView(comp, componentFactory);
40620}
40621function clearOverrides() {
40622    initServicesIfNeeded();
40623    return Services.clearOverrides();
40624}
40625// Attention: this function is called as top level function.
40626// Putting any logic in here will destroy closure tree shaking!
40627function createNgModuleFactory(ngModuleType, bootstrapComponents, defFactory) {
40628    return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory);
40629}
40630function cloneNgModuleDefinition(def) {
40631    const providers = Array.from(def.providers);
40632    const modules = Array.from(def.modules);
40633    const providersByKey = {};
40634    for (const key in def.providersByKey) {
40635        providersByKey[key] = def.providersByKey[key];
40636    }
40637    return {
40638        factory: def.factory,
40639        scope: def.scope,
40640        providers,
40641        modules,
40642        providersByKey,
40643    };
40644}
40645class NgModuleFactory_ extends NgModuleFactory {
40646    constructor(moduleType, _bootstrapComponents, _ngModuleDefFactory) {
40647        // Attention: this ctor is called as top level function.
40648        // Putting any logic in here will destroy closure tree shaking!
40649        super();
40650        this.moduleType = moduleType;
40651        this._bootstrapComponents = _bootstrapComponents;
40652        this._ngModuleDefFactory = _ngModuleDefFactory;
40653    }
40654    create(parentInjector) {
40655        initServicesIfNeeded();
40656        // Clone the NgModuleDefinition so that any tree shakeable provider definition
40657        // added to this instance of the NgModuleRef doesn't affect the cached copy.
40658        // See https://github.com/angular/angular/issues/25018.
40659        const def = cloneNgModuleDefinition(resolveDefinition(this._ngModuleDefFactory)
40659);
40660        return Services.createNgModuleRef(this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def);
40661    }
40662}
40663
40664/**
40665 * @license
40666 * Copyright Google LLC All Rights Reserved.
40667 *
40668 * Use of this source code is governed by an MIT-style license that can be
40669 * found in the LICENSE file at https://angular.io/license
40670 */
40671
40672/**
40673 * @license
40674 * Copyright Google LLC All Rights Reserved.
40675 *
40676 * Use of this source code is governed by an MIT-style license that can be
40677 * found in the LICENSE file at https://angular.io/license
40678 */
40679
40680/**
40681 * @license
40682 * Copyright Google LLC All Rights Reserved.
40683 *
40684 * Use of this source code is governed by an MIT-style license that can be
40685 * found in the LICENSE file at https://angular.io/license
40686 */
40687/**
40688 * Compiles a partial directive declaration object into a full directive definition object.
40689 *
40690 * @codeGenApi
40691 */
40692function ɵɵngDeclareDirective(decl) {
40693    const compiler = getCompilerFacade();
40694    return compiler.compileDirectiveDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
40695}
40696/**
40697 * Compiles a partial component declaration object into a full component definition object.
40698 *
40699 * @codeGenApi
40700 */
40701function ɵɵngDeclareComponent(decl) {
40702    const compiler = getCompilerFacade();
40703    return compiler.compileComponentDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵcmp.js`, decl);
40704}
40705/**
40706 * Compiles a partial pipe declaration object into a full pipe definition object.
40707 *
40708 * @codeGenApi
40709 */
40710function ɵɵngDeclarePipe(decl) {
40711    const compiler = getCompilerFacade();
40712    return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);
40713}
40714
40715/**
40716 * @license
40717 * Copyright Google LLC All Rights Reserved.
40718 *
40719 * Use of this source code is governed by an MIT-style license that can be
40720 * found in the LICENSE file at https://angular.io/license
40721 */
40722// clang-format on
40723
40724/**
40725 * @license
40726 * Copyright Google LLC All Rights Reserved.
40727 *
40728 * Use of this source code is governed by an MIT-style license that can be
40729 * found in the LICENSE file at https://angular.io/license
40730 */
40731
40732/**
40733 * @license
40734 * Copyright Google LLC All Rights Reserved.
40735 *
40736 * Use of this source code is governed by an MIT-style license that can be
40737 * found in the LICENSE file at https://angular.io/license
40738 */
40739if (typeof ngDevMode !== 'undefined' && ngDevMode) {
40740    // This helper is to give a reasonable error message to people upgrading to v9 that have not yet
40741    // installed `@angular/localize` in their app.
40742    // tslint:disable-next-line: no-toplevel-property-access
40743    _global.$localize = _global.$localize || function () {
40744        throw new Error('It looks like your application or one of its dependencies is using i18n.\n' +
40745            'Angular 9 introduced a global `$localize()` function that needs to be loaded.\n' +
40746            'Please run `ng add @angular/localize` from the Angular CLI.\n' +
40747            '(For non-CLI projects, add `import \'@angular/localize/init\';` to your `polyfills.ts` file.\n' +
40748            'For server-side rendering applications add the import to your `main.server.ts` file.)');
40749    };
40750}
40751
40752/**
40753 * @license
40754 * Copyright Google LLC All Rights Reserved.
40755 *
40756 * Use of this source code is governed by an MIT-style license that can be
40757 * found in the LICENSE file at https://angular.io/license
40758 */
40759// This file only reexports content of the `src` folder. Keep it that way.
40760
40761/**
40762 * @license
40763 * Copyright Google LLC All Rights Reserved.
40764 *
40765 * Use of this source code is governed by an MIT-style license that can be
40766 * found in the LICENSE file at https://angular.io/license
40767 */
40768
40769/**
40770 * Generated bundle index. Do not edit.
40771 */
40772
40773
40774
40775//# sourceMappingURL=core.js.map
40776
40777/***/ }),
40778
40779/***/ "gRHU":
40780/*!*********************************************************!*\
40781  !*** ./node_modules/rxjs/_esm2015/internal/Observer.js ***!
40782  \*********************************************************/
40783/*! exports provided: empty */
40784/***/ (function(module, __webpack_exports__, __webpack_require__) {
40785
40786"use strict";
40787__webpack_require__.r(__webpack_exports__);
40788/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; });
40789/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ "2fFW");
40790/* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/hostReportError */ "NJ4a");
40791
40792
40793const empty = {
40794    closed: true,
40795    next(value) { },
40796    error(err) {
40797        if (_config__WEBPACK_IMPORTED_MODULE_0__["config"].useDeprecatedSynchronousErrorHandling) {
40798            throw err;
40799        }
40800        else {
40801            Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_1__["hostReportError"])(err);
40802        }
40803    },
40804    complete() { }
40805};
40806//# sourceMappingURL=Observer.js.map
40807
40808/***/ }),
40809
40810/***/ "gcYM":
40811/*!***********************************************************************!*\
40812  !*** ./node_modules/rxjs/_esm2015/internal/operators/throttleTime.js ***!
40813  \***********************************************************************/
40814/*! exports provided: throttleTime */
40815/***/ (function(module, __webpack_exports__, __webpack_require__) {
40816
40817"use strict";
40818__webpack_require__.r(__webpack_exports__);
40819/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return throttleTime; });
40820/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
40821/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
40822/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./throttle */ "yuhW");
40823
40824
40825
40826function throttleTime(duration, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"], config = _throttle__WEBPACK_IMPORTED_MODULE_2__["defaultThrottleConfig"]) {
40827    return (source) =>
40827 source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing));
40828}
40829class ThrottleTimeOperator {
40830    constructor(duration, scheduler, leading, trailing) {
40831        this.duration = duration;
40832        this.scheduler = scheduler;
40833        this.leading = leading;
40834        this.trailing = trailing;
40835    }
40836    call(subscriber, source) {
40837        return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));
40838    }
40839}
40840class ThrottleTimeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
40841    constructor(destination, duration, scheduler, leading, trailing) {
40842        super(destination);
40843        this.duration = duration;
40844        this.scheduler = scheduler;
40845        this.leading = leading;
40846        this.trailing = trailing;
40847        this._hasTrailingValue = false;
40848        this._trailingValue = null;
40849    }
40850    _next(value) {
40851        if (this.throttled) {
40852            if (this.trailing) {
40853                this._trailingValue = value;
40854                this._hasTrailingValue = true;
40855            }
40856        }
40857        else {
40858            this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));
40859            if (this.leading) {
40860                this.destination.next(value);
40861            }
40862            else if (this.trailing) {
40863                this._trailingValue = value;
40864                this._hasTrailingValue = true;
40865            }
40866        }
40867    }
40868    _complete() {
40869        if (this._hasTrailingValue) {
40870            this.destination.next(this._trailingValue);
40871            this.destination.complete();
40872        }
40873        else {
40874            this.destination.complete();
40875        }
40876    }
40877    clearThrottle() {
40878        const throttled = this.throttled;
40879        if (throttled) {
40880            if (this.trailing && this._hasTrailingValue) {
40881                this.destination.next(this._trailingValue);
40882                this._trailingValue = null;
40883                this._hasTrailingValue = false;
40884            }
40885            throttled.unsubscribe();
40886            this.remove(throttled);
40887            this.throttled = null;
40888        }
40889    }
40890}
40891function dispatchNext(arg) {
40892    const { subscriber } = arg;
40893    subscriber.clearThrottle();
40894}
40895//# sourceMappingURL=throttleTime.js.map
40896
40897/***/ }),
40898
40899/***/ "hKy8":
40900/*!*****************************************************************!*\
40901  !*** ./node_modules/rxjs/_esm2015/internal/observable/pairs.js ***!
40902  \*****************************************************************/
40903/*! exports provided: pairs, dispatch */
40904/***/ (function(module, __webpack_exports__, __webpack_require__) {
40905
40906"use strict";
40907__webpack_require__.r(__webpack_exports__);
40908/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return pairs; });
40909/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; });
40910/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
40911/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "quSY");
40912
40913
40914function pairs(obj, scheduler) {
40915    if (!scheduler) {
40916        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
40917            const keys = Object.keys(obj);
40918            for (let i = 0; i < keys.length && !subscriber.closed; i++) {
40919                const key = keys[i];
40920                if (obj.hasOwnProperty(key)) {
40921                    subscriber.next([key, obj[key]]);
40922                }
40923            }
40924            subscriber.complete();
40925        });
40926    }
40927    else {
40928        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
40929            const keys = Object.keys(obj);
40930            const subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
40931            subscription.add(scheduler.schedule(dispatch, 0, { keys, index: 0, subscriber, subscription, obj }));
40932            return subscription;
40933        });
40934    }
40935}
40936function dispatch(state) {
40937    const { keys, index, subscriber, subscription, obj } = state;
40938    if (!subscriber.closed) {
40939        if (index < keys.length) {
40940            const key = keys[index];
40941            subscriber.next([key, obj[key]]);
40942            subscription.add(this.schedule({ keys, index: index + 1, subscriber, subscription, obj }));
40943        }
40944        else {
40945            subscriber.complete();
40946        }
40947    }
40948}
40949//# sourceMappingURL=pairs.js.map
40950
40951/***/ }),
40952
40953/***/ "iKkX":
40954/*!*******************************************************************************!*\
40955  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/VirtualTimeScheduler.js ***!
40956  \*******************************************************************************/
40957/*! exports provided: VirtualTimeScheduler, VirtualAction */
40958/***/ (function(module, __webpack_exports__, __webpack_require__) {
40959
40960"use strict";
40961__webpack_require__.r(__webpack_exports__);
40962/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return VirtualTimeScheduler; });
40963/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return VirtualAction; });
40964/* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ "3N8a");
40965/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncScheduler */ "IjjT");
40966
40967
40968class VirtualTimeScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"] {
vendor: 6,455 bytes, lines 40969-41143
40969    constructor(SchedulerAction = VirtualAction, maxFrames = Number.POSITIVE_INFINITY) {
40970        super(SchedulerAction, () => this.frame);
40971        this.maxFrames = maxFrames;
40972        this.frame = 0;
40973        this.index = -1;
40974    }
40975    flush() {
40976        const { actions, maxFrames } = this;
40977        let error, action;
40978        while ((action = actions[0]) && action.delay <= maxFrames) {
40979            actions.shift();
40980            this.frame = action.delay;
40981            if (error = action.execute(action.state, action.delay)) {
40982                break;
40983            }
40984        }
40985        if (error) {
40986            while (action = actions.shift()) {
40987                action.unsubscribe();
40988            }
40989            throw error;
40990        }
40991    }
40992}
40993VirtualTimeScheduler.frameTimeFactor = 10;
40994class VirtualAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"] {
40995    constructor(scheduler, work, index = scheduler.index += 1) {
40996        super(scheduler, work);
40997        this.scheduler = scheduler;
40998        this.work = work;
40999        this.index = index;
41000        this.active = true;
41001        this.index = scheduler.index = index;
41002    }
41003    schedule(state, delay = 0) {
41004        if (!this.id) {
41005            return super.schedule(state, delay);
41006        }
41007        this.active = false;
41008        const action = new VirtualAction(this.scheduler, this.work);
41009        this.add(action);
41010        return action.schedule(state, delay);
41011    }
41012    requestAsyncId(scheduler, id, delay = 0) {
41013        this.delay = scheduler.frame + delay;
41014        const { actions } = scheduler;
41015        actions.push(this);
41016        actions.sort(VirtualAction.sortActions);
41017        return true;
41018    }
41019    recycleAsyncId(scheduler, id, delay = 0) {
41020        return undefined;
41021    }
41022    _execute(state, delay) {
41023        if (this.active === true) {
41024            return super._execute(state, delay);
41025        }
41026    }
41027    static sortActions(a, b) {
41028        if (a.delay === b.delay) {
41029            if (a.index === b.index) {
41030                return 0;
41031            }
41032            else if (a.index > b.index) {
41033                return 1;
41034            }
41035            else {
41036                return -1;
41037            }
41038        }
41039        else if (a.delay > b.delay) {
41040            return 1;
41041        }
41042        else {
41043            return -1;
41044        }
41045    }
41046}
41047//# sourceMappingURL=VirtualTimeScheduler.js.map
41048
41049/***/ }),
41050
41051/***/ "itXk":
41052/*!*************************************************************************!*\
41053  !*** ./node_modules/rxjs/_esm2015/internal/observable/combineLatest.js ***!
41054  \*************************************************************************/
41055/*! exports provided: combineLatest, CombineLatestOperator, CombineLatestSubscriber */
41056/***/ (function(module, __webpack_exports__, __webpack_require__) {
41057
41058"use strict";
41059__webpack_require__.r(__webpack_exports__);
41060/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; });
41061/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestOperator", function() { return CombineLatestOperator; });
41062/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestSubscriber", function() { return CombineLatestSubscriber; });
41063/* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isScheduler */ "z+Ro");
41064/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
41065/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "l7GE");
41066/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "ZUHj");
41067/* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fromArray */ "yCtX");
41068
41069
41070
41071
41072
41073const NONE = {};
41074function combineLatest(...observables) {
41075    let resultSelector = undefined;
41076    let scheduler = undefined;
41077    if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(observables[observables.length - 1])) {
41078        scheduler = observables.pop();
41079    }
41080    if (typeof observables[observables.length - 1] === 'function') {
41081        resultSelector = observables.pop();
41082    }
41083    if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(observables[0])) {
41084        observables = observables[0];
41085    }
41086    return Object(_fromArray__WEBPACK_IMPORTED_MODULE_4__["fromArray"])(observables, scheduler).lift(new CombineLatestOperator(resultSelector));
41087}
41088class CombineLatestOperator {
41089    constructor(resultSelector) {
41090        this.resultSelector = resultSelector;
41091    }
41092    call(subscriber, source) {
41093        return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));
41094    }
41095}
41096class CombineLatestSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] {
41097    constructor(destination, resultSelector) {
41098        super(destination);
41099        this.resultSelector = resultSelector;
41100        this.active = 0;
41101        this.values = [];
41102        this.observables = [];
41103    }
41104    _next(observable) {
41105        this.values.push(NONE);
41106        this.observables.push(observable);
41107    }
41108    _complete() {
41109        const observables = this.observables;
41110        const len = observables.length;
41111        if (len === 0) {
41112            this.destination.complete();
41113        }
41114        else {
41115            this.active = len;
41116            this.toRespond = len;
41117            for (let i = 0; i < len; i++) {
41118                const observable = observables[i];
41119                this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, observable, undefined, i));
41120            }
41121        }
41122    }
41123    notifyComplete(unused) {
41124        if ((this.active -= 1) === 0) {
41125            this.destination.complete();
41126        }
41127    }
41128    notifyNext(_outerValue, innerValue, outerIndex) {
41129        const values = this.values;
41130        const oldVal = values[outerIndex];
41131        const toRespond = !this.toRespond
41132            ? 0
41133            : oldVal === NONE ? --this.toRespond : this.toRespond;
41134        values[outerIndex] = innerValue;
41135        if (toRespond === 0) {
41136            if (this.resultSelector) {
41137                this._tryResultSelector(values);
41138            }
41139            else {
41140                this.destination.next(values.slice());
41141            }
41142        }
41143    }
41144    _tryResultSelector(values) {
41145        let result;
41146        try {
41147            result = this.resultSelector.apply(this, values);
41148        }
41149        catch (err) {
41150            this.destination.error(err);
41151            return;
41152        }
41153        this.destination.next(result);
41154    }
41155}
41156//# sourceMappingURL=combineLatest.js.map
41157
41158/***/ }),
41159
41160/***/ "jZKg":
41161/*!************************************************************************!*\
41162  !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduleArray.js ***!
41163  \************************************************************************/
41164/*! exports provided: scheduleArray */
41165/***/ (function(module, __webpack_exports__, __webpack_require__) {
41166
41167"use strict";
41168__webpack_require__.r(__webpack_exports__);
41169/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleArray", function() { return scheduleArray; });
41170/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
41171/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "quSY");
41172
41173
41174function scheduleArray(input, scheduler) {
41175    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
41176        const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
41177        let i = 0;
41178        sub.add(scheduler.schedule(function () {
41179            if (i === input.length) {
41180                subscriber.complete();
41181                return;
41182            }
41183            subscriber.next(input[i++]);
41184            if (!subscriber.closed) {
41185                sub.add(this.schedule());
41186            }
41187        }));
41188        return sub;
41189    });
41190}
41191//# sourceMappingURL=scheduleArray.js.map
41192
41193/***/ }),
41194
41195/***/ "jhN1":
41196/*!******************************************************************************************!*\
41197  !*** ./node_modules/@angular/platform-browser/__ivy_ngcc__/fesm2015/platform-browser.js ***!
41198  \******************************************************************************************/
41199/*! exports provided: ɵgetDOM, BrowserModule, BrowserTransferStateModule, By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, Meta, Title, TransferState, VERSION, disableDebugTools, enableDebugTools, makeStateKey, platformBrowser, ɵBROWSER_SANITIZATION_PROVIDERS, ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__, ɵBrowserDomAdapter, ɵBrowserGetTestability, ɵDomEventsPlugin, ɵDomRendererFactory2, ɵDomSanitizerImpl, ɵDomSharedStylesHost, ɵELEMENT_PROBE_PROVIDERS, ɵELEMENT_PROBE_PROVIDERS__POST_R3__, ɵHAMMER_PROVIDERS__POST_R3__, ɵHammerGesturesPlugin, ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, ɵKeyEventsPlugin, ɵNAMESPACE_URIS, ɵSharedStylesHost, ɵTRANSITION_ID, ɵangular_packages_platform_browser_platform_browser_a, ɵangular_packages_platform_browser_platform_browser_b, ɵangular_packages_platform_browser_platform_browser_c, ɵangular_packages_platform_browser_platform_browser_d, ɵangular_packages_platform_browser_platform_browser_e, ɵangular_packages_platform_browser_platform_browser_f, ɵangular_packages_platform_browser_platform_browser_g, ɵangular_packages_platform_browser_platform_browser_h, ɵangular_packages_platform_browser_platform_browser_i, ɵangular_packages_platform_browser_platform_browser_j, ɵangular_packages_platform_browser_platform_browser_k, ɵangular_packages_platform_browser_platform_browser_l, ɵangular_packages_platform_browser_platform_browser_m, ɵangular_packages_platform_browser_platform_browser_n, ɵangular_packages_platform_browser_platform_browser_o, ɵescapeHtml, ɵflattenStyles, ɵinitDomAdapter, ɵshimContentAttribute, ɵshimHostAttribute */
41200/***/ (function(module, __webpack_exports__, __webpack_require__) {
41201
41202"use strict";
41203__webpack_require__.r(__webpack_exports__);
41204/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserModule", function() { return BrowserModule; });
41205/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserTransferStateModule", function() { return BrowserTransferStateModule; });
41206/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "By", function() { return By; });
41207/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomSanitizer", function() { return DomSanitizer; });
41208/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_MANAGER_PLUGINS", function() { return EVENT_MANAGER_PLUGINS; });
41209/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventManager", function() { return EventManager; });
41210/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HAMMER_GESTURE_CONFIG", function() { return HAMMER_GESTURE_CONFIG; });
41211/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HAMMER_LOADER", function() { return HAMMER_LOADER; });
41212/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HammerGestureConfig", function() { return HammerGestureConfig; });
41213/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HammerModule", function() { return HammerModule; });
41214/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Meta", function() { return Meta; });
41215/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Title", function() { return Title; });
41216/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransferState", function() { return TransferState; });
41217/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
41218/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disableDebugTools", function() { return disableDebugTools; });
41219/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableDebugTools", function() { return enableDebugTools; });
41220/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeStateKey", function() { return makeStateKey; });
41221/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platformBrowser", function() { return platformBrowser; });
41222/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBROWSER_SANITIZATION_PROVIDERS", function() { return BROWSER_SANITIZATION_PROVIDERS; });
41223/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBROWSER_SANITIZATION_PROVIDERS__POST_R3__", function() { return BROWSER_SANITIZATION_PROVIDERS__POST_R3__; });
41224/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserDomAdapter", function() { return BrowserDomAdapter; });
41225/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserGetTestability", function() { return BrowserGetTestability; });
41226/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomEventsPlugin", function() { return DomEventsPlugin; });
41227/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomRendererFactory2", function() { return DomRendererFactory2; });
41228/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomSanitizerImpl", function() { return DomSanitizerImpl; });
41229/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomSharedStylesHost", function() { return DomSharedStylesHost; });
41230/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵELEMENT_PROBE_PROVIDERS", function() { return ELEMENT_PROBE_PROVIDERS; });
41231/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵELEMENT_PROBE_PROVIDERS__POST_R3__", function() { return ELEMENT_PROBE_PROVIDERS__POST_R3__; });
41232/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵHAMMER_PROVIDERS__POST_R3__", function() { return HAMMER_PROVIDERS__POST_R3__; });
41233/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵHammerGesturesPlugin", function() { return HammerGesturesPlugin; });
41234/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS", function() { return INTERNAL_BROWSER_PLATFORM_PROVIDERS; });
41235/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵKeyEventsPlugin", function() { return KeyEventsPlugin; });
41236/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNAMESPACE_URIS", function() { return NAMESPACE_URIS; });
41237/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵSharedStylesHost", function() { return SharedStylesHost; });
41238/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵTRANSITION_ID", function() { return TRANSITION_ID; });
41239/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_a", function() { return errorHandler; });
41240/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_b", function() { return _document; });
41241/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_c", function() { return BROWSER_MODULE_PROVIDERS; });
41242/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_d", function() { return createMeta; });
41243/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_e", function() { return createTitle; });
41244/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_f", function() { return initTransferState; });
41245/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_g", function() { return EventManagerPlugin; });
41246/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_h", function() { return HAMMER_PROVIDERS__PRE_R3__; });
41247/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_i", function() { return HAMMER_PROVIDERS; });
41248/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_j", function() { return domSanitizerImplFactory; });
41249/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_k", function() { return appInitializerFactory; });
41250/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_l", function() { return SERVER_TRANSITION_PROVIDERS; });
41251/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_m", function() { return _createNgProbeR2; });
41252/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_n", function() { return ELEMENT_PROBE_PROVIDERS__PRE_R3__; });
41253/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_platform_browser_platform_browser_o", function() { return GenericBrowserDomAdapter; });
41254/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵescapeHtml", function() { return escapeHtml; });
41255/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵflattenStyles", function() { return flattenStyles; });
41256/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵinitDomAdapter", function() { return initDomAdapter; });
41257/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵshimContentAttribute", function() { return shimContentAttribute; });
41258/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵshimHostAttribute", function() { return shimHostAttribute; });
41259/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common */ "ofXK");
41260/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "fXoL");
41261/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ɵgetDOM", function() { return _angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"]; });
41262
41263/**
41264 * @license Angular v11.2.11
41265 * (c) 2010-2021 Google LLC. https://angular.io/
41266 * License: MIT
41267 */
41268
41269
41270
41271
41272
41273
41274/**
41275 * @license
41276 * Copyright Google LLC All Rights Reserved.
41277 *
41278 * Use of this source code is governed by an MIT-style license that can be
41279 * found in the LICENSE file at https://angular.io/license
41280 */
41281/**
41282 * Provides DOM operations in any browser environment.
41283 *
41284 * @security Tread carefully! Interacting with the DOM directly is dangerous and
41285 * can introduce XSS risks.
41286 */
41287class GenericBrowserDomAdapter extends _angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵDomAdapter"] {
41288    constructor() {
41289        super();
41290    }
41291    supportsDOMEvents() {
41292        return true;
41293    }
41294}
41295
41296/**
41297 * @license
41298 * Copyright Google LLC All Rights Reserved.
41299 *
41300 * Use of this source code is governed by an MIT-style license that can be
41301 * found in the LICENSE file at https://angular.io/license
41302 */
41303const ɵ0 = () => {
41304    if (_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['Node']) {
41305        return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['Node'].prototype.contains || function (node) {
41306            return !!(this.compareDocumentPosition(node) & 16);
41307        };
41308    }
41309    return undefined;
41310};
41311const nodeContains = (ɵ0)();
41312/**
41313 * A `DomAdapter` powered by full browser DOM APIs.
41314 *
41315 * @security Tread carefully! Interacting with the DOM directly is dangerous and
41316 * can introduce XSS risks.
41317 */
41318/* tslint:disable:requireParameterType no-console */
41319class BrowserDomAdapter extends GenericBrowserDomAdapter {
41320    static makeCurrent() {
41321        Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵsetRootDomAdapter"])(new BrowserDomAdapter());
41322    }
41323    getProperty(el, name) {
41324        return el[name];
41325    }
41326    log(error) {
41327        if (window.console) {
41328            window.console.log && window.console.log(error);
41329        }
41330    }
41331    logGroup(error) {
41332        if (window.console) {
41333            window.console.group && window.console.group(error);
41334        }
41335    }
41336    logGroupEnd() {
41337        if (window.console) {
41338            window.console.groupEnd && window.console.groupEnd();
41339        }
41340    }
41341    onAndCancel(el, evt, listener) {
41342        el.addEventListener(evt, listener, false);
41343        // Needed to follow Dart's subscription semantic, until fix of
41344        // https://code.google.com/p/dart/issues/detail?id=17406
41345        return () => {
41346            el.removeEventListener(evt, listener, false);
41347        };
41348    }
41349    dispatchEvent(el, evt) {
41350        el.dispatchEvent(evt);
41351    }
41352    remove(node) {
41353        if (node.parentNode) {
41354            node.parentNode.removeChild(node);
41355        }
41356        return node;
41357    }
41358    getValue(el) {
41359        return el.value;
41360    }
41361    createElement(tagName, doc) {
41362        doc = doc || this.getDefaultDocument();
41363        return doc.createElement(tagName);
41364    }
41365    createHtmlDocument() {
41366        return document.implementation.createHTMLDocument('fakeTitle');
41367    }
41368    getDefaultDocument() {
41369        return document;
41370    }
41371    isElementNode(node) {
41372        return node.nodeType === Node.ELEMENT_NODE;
41373    }
41374    isShadowRoot(node) {
41375        return node instanceof DocumentFragment;
41376    }
41377    getGlobalEventTarget(doc, target) {
41378        if (target === 'window') {
41379            return window;
41380        }
41381        if (target === 'document') {
41382            return doc;
41383        }
41384        if (target === 'body') {
41385            return doc.body;
41386        }
41387        return null;
41388    }
41389    getHistory() {
41390        return window.history;
41391    }
41392    getLocation() {
41393        return window.location;
41394    }
41395    getBaseHref(doc) {
41396        const href = getBaseElementHref();
41397        return href == null ? null : relativePath(href);
41398    }
41399    resetBaseElement() {
41400        baseElement = null;
41401    }
41402    getUserAgent() {
41403        return window.navigator.userAgent;
41404    }
41405    performanceNow() {
41406        // performance.now() is not available in all
41406 browsers, see
41407        // https://caniuse.com/high-resolution-time
41408        return window.performance && window.performance.now ? window.performance.now() :
41409            new Date().getTime();
41410    }
41411    supportsCookies() {
41412        return true;
41413    }
41414    getCookie(name) {
41415        return Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵparseCookieValue"])(document.cookie, name);
41416    }
41417}
41418let baseElement = null;
41419function getBaseElementHref() {
41420    if (!baseElement) {
41421        baseElement = document.querySelector('base');
41422        if (!baseElement) {
41423            return null;
41424        }
41425    }
41426    return baseElement.getAttribute('href');
41427}
41428// based on urlUtils.js in AngularJS 1
41429let urlParsingNode;
41430function relativePath(url) {
41431    if (!urlParsingNode) {
41432        urlParsingNode = document.createElement('a');
41433    }
41434    urlParsingNode.setAttribute('href', url);
41435    return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :
41436        '/' + urlParsingNode.pathname;
41437}
41438
41439/**
41440 * @license
41441 * Copyright Google LLC All Rights Reserved.
41442 *
41443 * Use of this source code is governed by an MIT-style license that can be
41444 * found in the LICENSE file at https://angular.io/license
41445 */
41446/**
41447 * An id that identifies a particular application being bootstrapped, that should
41448 * match across the client/server boundary.
41449 */
41450const TRANSITION_ID = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('TRANSITION_ID');
41451function appInitializerFactory(transitionId, document, injector) {
41452    return () => {
41453        // Wait for all application initializers to be completed before removing the styles set by
41454        // the server.
41455        injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationInitStatus"]).donePromise.then(() => {
41456            const dom = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])();
41457            const styles = Array.prototype.slice.apply(document.querySelectorAll(`style[ng-transition]`));
41458            styles.filter(el => el.getAttribute('ng-transition') === transitionId)
41459                .forEach(el => dom.remove(el));
41460        });
41461    };
41462}
41463const SERVER_TRANSITION_PROVIDERS = [
41464    {
41465        provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_INITIALIZER"],
41466        useFactory: appInitializerFactory,
41467        deps: [TRANSITION_ID, _angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"]],
41468        multi: true
41469    },
41470];
41471
41472/**
41473 * @license
41474 * Copyright Google LLC All Rights Reserved.
41475 *
41476 * Use of this source code is governed by an MIT-style license that can be
41477 * found in the LICENSE file at https://angular.io/license
41478 */
41479class BrowserGetTestability {
41480    static init() {
41481        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["setTestabilityGetter"])(new BrowserGetTestability());
41482    }
41483    addToWindow(registry) {
41484        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['getAngularTestability'] = (elem, findInAncestors = true) => {
41485            const testability = registry.findTestabilityInTree(elem, findInAncestors);
41486            if (testability == null) {
41487                throw new Error('Could not find testability for element.');
41488            }
41489            return testability;
41490        };
41491        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['getAllAngularTestabilities'] = () => registry.getAllTestabilities();
41492        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['getAllAngularRootElements'] = () => registry.getAllRootElements();
41493        const whenAllStable = (callback /** TODO #9100 */) => {
41494            const testabilities = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['getAllAngularTestabilities']();
41495            let count = testabilities.length;
41496            let didWork = false;
41497            const decrement = function (didWork_ /** TODO #9100 */) {
41498                didWork = didWork || didWork_;
41499                count--;
41500                if (count == 0) {
41501                    callback(didWork);
41502                }
41503            };
41504            testabilities.forEach(function (testability /** TODO #9100 */) {
41505                testability.whenStable(decrement);
41506            });
41507        };
41508        if (!_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['frameworkStabilizers']) {
41509            _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['frameworkStabilizers'] = [];
41510        }
41511        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['frameworkStabilizers'].push(whenAllStable);
41512    }
41513    findTestabilityInTree(registry, elem, findInAncestors) {
41514        if (elem == null) {
41515            return null;
41516        }
41517        const t = registry.getTestability(elem);
41518        if (t != null) {
41519            return t;
41520        }
41521        else if (!findInAncestors) {
41522            return null;
41523        }
41524        if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().isShadowRoot(elem)) {
41525            return this.findTestabilityInTree(registry, elem.host, true);
41526        }
41527        return this.findTestabilityInTree(registry, elem.parentElement, true);
41528    }
41529}
41530
41531/**
41532 * @license
41533 * Copyright Google LLC All Rights Reserved.
41534 *
41535 * Use of this source code is governed by an MIT-style license that can be
41536 * found in the LICENSE file at https://angular.io/license
41537 */
41538const CAMEL_CASE_REGEXP = /([A-Z])/g;
41539const DASH_CASE_REGEXP = /-([a-z])/g;
41540function camelCaseToDashCase(input) {
41541    return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
41542}
41543function dashCaseToCamelCase(input) {
41544    return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
41545}
41546/**
41547 * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
41548 * `name` is `'probe'`.
41549 * @param name Name under which it will be exported. Keep in mind this will be a property of the
41550 * global `ng` object.
41551 * @param value The value to export.
41552 */
41553function exportNgVar(name, value) {
41554    if (typeof COMPILED === 'undefined' || !COMPILED) {
41555        // Note: we can't export `ng` when using closure enhanced optimization as:
41556        // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
41557        // - we can't declare a closure extern as the namespace `ng` is already used within Google
41558        //   for typings for angularJS (via `goog.provide('ng....')`).
41559        const ng = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['ng'] = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"]['ng'] || {};
41560        ng[name] = value;
41561    }
41562}
41563
41564/**
41565 * @license
41566 * Copyright Google LLC All Rights Reserved.
41567 *
41568 * Use of this source code is governed by an MIT-style license that can be
41569 * found in the LICENSE file at https://angular.io/license
41570 */
41571const ɵ0$1 = () => ({
41572    'ApplicationRef': _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"],
41573    'NgZone': _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"],
41574});
41575const CORE_TOKENS = (ɵ0$1)();
41576const INSPECT_GLOBAL_NAME = 'probe';
41577const CORE_TOKENS_GLOBAL_NAME = 'coreTokens';
41578/**
41579 * Returns a {@link DebugElement} for the given native DOM element, or
41580 * null if the given native element does not have an Angular view associated
41581 * with it.
41582 */
41583function inspectNativeElementR2(element) {
41584    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵgetDebugNodeR2"])(element);
41585}
41586function _createNgProbeR2(coreTokens) {
41587    exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElementR2);
41588    exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object.assign(Object.assign({}, CORE_TOKENS), _ngProbeTokensToMap(coreTokens || [])));
41589    return () => inspectNativeElementR2;
41590}
41591function _ngProbeTokensToMap(tokens) {
41592    return tokens.reduce((prev, t) => (prev[t.name] = t.token, prev), {});
41593}
41594/**
41595 * In Ivy, we don't support NgProbe because we have our own set of testing utilities
41596 * with more robust functionality.
41597 *
41598 * We shouldn't bring in NgProbe because it prevents DebugNode and friends from
41599 * tree-shaking properly.
41600 */
41601const ELEMENT_PROBE_PROVIDERS__POST_R3__ = [];
41602/**
41603 * Providers which support debugging Angular applications (e.g. via `ng.probe`).
41604 */
41605const ELEMENT_PROBE_PROVIDERS__PRE_R3__ = [
41606    {
41607        provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_INITIALIZER"],
41608        useFactory: _createNgProbeR2,
41609        deps: [
41610            [_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgProbeToken"], new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]()],
41611        ],
41612        multi: true,
41613    },
41614];
41615const ELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS__POST_R3__;
41616
41617/**
41618 * @license
41619 * Copyright Google LLC All Rights Reserved.
41620 *
41621 * Use of this source code is governed by an MIT-style license that can be
41622 * found in the LICENSE file at https://angular.io/license
41623 */
41624/**
41625 * The injection token for the event-manager plug-in service.
41626 *
41627 * @publicApi
41628 */
41629const EVENT_MANAGER_PLUGINS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('EventManagerPlugins');
41630/**
41631 * An injectable service that provides event management for Angular
41632 * through a browser plug-in.
41633 *
41634 * @publicApi
41635 */
41636class EventManager {
41637    /**
41638     * Initializes an instance of the event-manager service.
41639     */
41640    constructor(plugins, _zone) {
41641        this._zone = _zone;
41642        this._eventNameToPlugin = new Map();
41643        plugins.forEach(p => p.manager = this);
41644        this._plugins = plugins.slice().reverse();
41645    }
41646    /**
41647     * Registers a handler for a specific element and event.
41648     *
41649     * @param element The HTML element to receive event notifications.
41650     * @param eventName The name of the event to listen for.
41651     * @param handler A function to call when the notification occurs. Receives the
41652     * event object as an argument.
41653     * @returns  A callback function that can be used to remove the handler.
41654     */
41655    addEventListener(element, eventName, handler) {
41656        const plugin = this._findPluginFor(eventName);
41657        return plugin.addEventListener(element, eventName, handler);
41658    }
41659    /**
41660     * Registers a global handler for an event in a target view.
41661     *
41662     * @param target A target for global event notifications. One of "window", "document", or "body".
41663     * @param eventName The name of the event to listen for.
41664     * @param handler A function to call when the notification occurs. Receives the
41665     * event object as an argument.
41666     * @returns A callback function that can be used to remove the handler.
41667     */
41668    addGlobalEventListener(target, eventName, handler) {
41669        const plugin = this._findPluginFor(eventName);
41670        return plugin.addGlobalEventListener(target, eventName, handler);
41671    }
41672    /**
41673     * Retrieves the compilation zone in which event listeners are registered.
41674     */
41675    getZone() {
41676        return this._zone;
41677    }
41678    /** @internal */
41679    _findPluginFor(eventName) {
41680        const plugin = this._eventNameToPlugin.get(eventName);
41681        if (plugin) {
41682            return plugin;
41683        }
41684        const plugins = this._plugins;
41685        for (let i = 0; i < plugins.length; i++) {
41686            const plugin = plugins[i];
41687            if (plugin.supports(eventName)) {
41688                this._eventNameToPlugin.set(eventName, plugin);
41689                return plugin;
41690            }
41691        }
41692        throw new Error(`No event manager plugin found for event ${eventName}`);
41693    }
41694}
41695EventManager.ɵfac = function EventManager_Factory(t) { return new (t || EventManager)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](EVENT_MANAGER_PLUGINS), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"])); };
41696EventManager.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: EventManager, factory: EventManager.ɵfac });
41697EventManager.ctorParameters = () => [
41698    { type: Array, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [EVENT_MANAGER_PLUGINS,] }] },
41699    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"] }
41700];
41701(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](EventManager, [{
41702        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
41703    }], function () { return [{ type: Array, decorators: [{
41704                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
41705                args: [EVENT_MANAGER_PLUGINS]
41706            }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"] }]; }, null); })();
41707class EventManagerPlugin {
41708    constructor(_doc) {
41709        this._doc = _doc;
41710    }
41711    addGlobalEventListener(element, eventName, handler) {
41712        const target = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().getGlobalEventTarget(this._doc, element);
41713        if (!target) {
41714            throw new Error(`Unsupported event target ${target} for event ${eventName}`);
41715        }
41716        return this.addEventListener(target, eventName, handler);
41717    }
41718}
41719
41720/**
41721 * @license
41722 * Copyright Google LLC All Rights Reserved.
41723 *
41724 * Use of this source code is governed by an MIT-style license that can be
41725 * found in the LICENSE file at https://angular.io/license
41726 */
41727class SharedStylesHost {
41728    constructor() {
41729        /** @internal */
41730        this._stylesSet = new Set();
41731    }
41732    addStyles(styles) {
41733        const additions = new Set();
41734        styles.forEach(style => {
41735            if (!this._stylesSet.has(style)) {
41736                this._stylesSet.add(style);
41737                additions.add(style);
41738            }
41739        });
41740        this.onStylesAdded(additions);
41741    }
41742    onStylesAdded(additions) { }
41743    getAllStyles() {
41744        return Array.from(this._stylesSet);
41745    }
41746}
41747SharedStylesHost.ɵfac = function SharedStylesHost_Factory(t) { return new (t || SharedStylesHost)(); };
41748SharedStylesHost.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: SharedStylesHost, factory: SharedStylesHost.ɵfac });
41749(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SharedStylesHost, [{
41750        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
41751    }], function () { return []; }, null); })();
41752class DomSharedStylesHost extends SharedStylesHost {
41753    constructor(_doc) {
41754        super();
41755        this._doc = _doc;
41756        this._hostNodes = new Set();
41757        this._styleNodes = new Set();
41758        this._hostNodes.add(_doc.head);
41759    }
41760    _addStylesToHost(styles, host) {
41761        styles.forEach((style) => {
41762            const styleEl = this._doc.createElement('style');
41763            styleEl.textContent = style;
41764            this._styleNodes.add(host.appendChild(styleEl));
41765        });
41766    }
41767    addHost(hostNode) {
41768        this._addStylesToHost(this._stylesSet, hostNode);
41769        this._hostNodes.add(hostNode);
41770    }
41771    removeHost(hostNode) {
41772        this._hostNodes.delete(hostNode);
41773    }
41774    onStylesAdded(additions) {
41775        this._hostNodes.forEach(hostNode => this._addStylesToHost(additions, hostNode));
41776    }
41777    ngOnDestroy() {
41778        this._styleNodes.forEach(styleNode => Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().remove(styleNode));
41779    }
41780}
41781DomSharedStylesHost.ɵfac = function DomSharedStylesHost_Factory(t) { return new (t || DomSharedStylesHost)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); };
41782DomSharedStylesHost.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomSharedStylesHost, factory: DomSharedStylesHost.ɵfac });
41783DomSharedStylesHost.ctorParameters = () => [
41784    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] }
41785];
41786(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomSharedStylesHost, [{
41787        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
41788    }], function () { return [{ type: undefined, decorators: [{
41789                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
41790                args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]]
41791            }] }]; }, null); })();
41792
41793/**
41794 * @license
41795 * Copyright Google LLC All Rights Reserved.
41796 *
41797 * Use of this source code is governed by an MIT-style license that can be
41798 * found in the LICENSE file at https://angular.io/license
41799 */
41800const NAMESPACE_URIS = {
41801    'svg': 'http://www.w3.org/2000/svg',
41802    'xhtml': 'http://www.w3.org/1999/xhtml',
41803    'xlink': 'http://www.w3.org/1999/xlink',
41804    'xml': 'http://www.w3.org/XML/1998/namespace',
41805    'xmlns': 'http://www.w3.org/2000/xmlns/',
41806};
41807const COMPONENT_REGEX = /%COMP%/g;
41808const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
41809const COMPONENT_VARIABLE = '%COMP%';
41810const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
41811const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
41812function shimContentAttribute(componentShortId) {
41813    return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
41814}
41815function shimHostAttribute(componentShortId) {
41816    return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
41817}
41818function flattenStyles(compId, styles, target) {
41819    for (let i = 0; i < styles.length; i++) {
41820        let style = styles[i];
41821        if (Array.isArray(style)) {
41822            flattenStyles(compId, style, target);
41823        }
41824        else {
41825            style = style.replace(COMPONENT_REGEX, compId);
41826            target.push(style);
41827        }
41828    }
41829    return target;
41830}
41831function decoratePreventDefault(eventHandler) {
41832    // `DebugNode.triggerEventHandler` needs to know if the listener was created with
41833    // decoratePreventDefault or is a listener added outside the Angular context so it can handle the
41834    // two differently. In the first case, the special '__ngUnwrap__' token is passed to the unwrap
41835    // the listener (see below).
41836    return (event) => {
41837        // Ivy uses '__ngUnwrap__' as a special token that allows us to unwrap the function
41838        // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`. The debug_node
41839        // can inspect the listener toString contents for the existence of this special token. Because
41840        // the token is a string literal, it is ensured to not be modified by compiled code.
41841        if (event === '__ngUnwrap__') {
41842            return eventHandler;
41843        }
41844        const allowDefaultBehavior = eventHandler(event);
41845        if (allowDefaultBehavior === false) {
41846            // TODO(tbosch): move preventDefault into event plugins...
41847            event.preventDefault();
41848            event.returnValue = false;
41849        }
41850        return undefined;
41851    };
41852}
41853let hasLoggedNativeEncapsulationWarning = false;
41854class DomRendererFactory2 {
41855    constructor(eventManager, sharedStylesHost, appId) {
41856        this.eventManager = eventManager;
41857        this.sharedStylesHost = sharedStylesHost;
41858        this.appId = appId;
41859        this.rendererByCompId = new Map();
41860        this.defaultRenderer = new DefaultDomRenderer2(eventManager);
41861    }
41862    createRenderer(element, type) {
41863        if (!element || !type) {
41864            return this.defaultRenderer;
41865        }
41866        switch (type.encapsulation) {
41867            case _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].Emulated: {
41868                let renderer = this.rendererByCompId.get(type.id);
41869                if (!renderer) {
41870                    renderer = new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type, this.appId);
41871                    this.rendererByCompId.set(type.id, renderer);
41872                }
41873                renderer.applyToHost(element);
41874                return renderer;
41875            }
41876            case 1:
41877            case _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].ShadowDom:
41878                // TODO(FW-2290): remove the `case 1:` fallback logic and the warning in v12.
41879                if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
41880                    !hasLoggedNativeEncapsulationWarning && type.encapsulation === 1) {
41881                    hasLoggedNativeEncapsulationWarning = true;
41882                    console.warn('ViewEncapsulation.Native is no longer supported. Falling back to ViewEncapsulation.ShadowDom. The fallback will be removed in v12.');
41883                }
41884                return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);
41885            default: {
41886                if (!this.rendererByCompId.has(type.id)) {
41887                    const styles = flattenStyles(type.id, type.styles, []);
41888                    this.sharedStylesHost.addStyles(styles);
41889                    this.rendererByCompId.set(type.id, this.defaultRenderer);
41890                }
41891                return this.defaultRenderer;
41892            }
41893        }
41894    }
41895    begin() { }
41896    end() { }
41897}
41898DomRendererFactory2.ɵfac = function DomRendererFactory2_Factory(t) { return new (t || DomRendererFactory2)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](EventManager), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](DomSharedStylesHost), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"])); };
41899DomRendererFactory2.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomRendererFactory2, factory: DomRendererFactory2.ɵfac });
41900DomRendererFactory2.ctorParameters = () => [
41901    { type: EventManager },
41902    { type: DomSharedStylesHost },
41903    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"],] }] }
41904];
41905(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomRendererFactory2, [{
41906        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
41907    }], function () { return [{ type: EventManager }, { type: DomSharedStylesHost }, { type: String, decorators: [{
41908                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
41909                args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"]]
41910            }] }]; }, null); })();
41911class DefaultDomRenderer2 {
41912    constructor(eventManager) {
41913        this.eventManager = eventManager;
41914        this.data = Object.create(null);
41915    }
41916    destroy() { }
41917    createElement(name, namespace) {
41918        if (namespace) {
41919            // In cases where Ivy (not ViewEngine) is giving us the actual namespace, the look up by key
41920            // will result in undefined, so we just return the namespace here.
41921            return document.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
41922        }
41923        return document.createElement(name);
41924    }
41925    createComment(value) {
41926        return document.createComment(value);
41927    }
41928    createText(value) {
41929        return document.createTextNode(value);
41930    }
41931    appendChild(parent, newChild) {
41932        parent.appendChild(newChild);
41933    }
41934    insertBefore(parent, newChild, refChild) {
41935        if (parent) {
41936            parent.insertBefore(newChild, refChild);
41937        }
41938    }
41939    removeChild(parent, oldChild) {
41940        if (parent) {
41941            parent.removeChild(oldChild);
41942        }
41943    }
41944    selectRootElement(selectorOrNode, preserveContent) {
41945        let el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :
41946            selectorOrNode;
41947        if (!el) {
41948            throw new Error(`The selector "${selectorOrNode}
41948" did not match any elements`);
41949        }
41950        if (!preserveContent) {
41951            el.textContent = '';
41952        }
41953        return el;
41954    }
41955    parentNode(node) {
41956        return node.parentNode;
41957    }
41958    nextSibling(node) {
41959        return node.nextSibling;
41960    }
41961    setAttribute(el, name, value, namespace) {
41962        if (namespace) {
41963            name = namespace + ':' + name;
41964            // TODO(FW-811): Ivy may cause issues here because it's passing around
41965            // full URIs for namespaces, therefore this lookup will fail.
41966            const namespaceUri = NAMESPACE_URIS[namespace];
41967            if (namespaceUri) {
41968                el.setAttributeNS(namespaceUri, name, value);
41969            }
41970            else {
41971                el.setAttribute(name, value);
41972            }
41973        }
41974        else {
41975            el.setAttribute(name, value);
41976        }
41977    }
41978    removeAttribute(el, name, namespace) {
41979        if (namespace) {
41980            // TODO(FW-811): Ivy may cause issues here because it's passing around
41981            // full URIs for namespaces, therefore this lookup will fail.
41982            const namespaceUri = NAMESPACE_URIS[namespace];
41983            if (namespaceUri) {
41984                el.removeAttributeNS(namespaceUri, name);
41985            }
41986            else {
41987                // TODO(FW-811): Since ivy is passing around full URIs for namespaces
41988                // this could result in properties like `http://www.w3.org/2000/svg:cx="123"`,
41989                // which is wrong.
41990                el.removeAttribute(`${namespace}:${name}`);
41991            }
41992        }
41993        else {
41994            el.removeAttribute(name);
41995        }
41996    }
41997    addClass(el, name) {
41998        el.classList.add(name);
41999    }
42000    removeClass(el, name) {
42001        el.classList.remove(name);
42002    }
42003    setStyle(el, style, value, flags) {
42004        if (flags & (_angular_core__WEBPACK_IMPORTED_MODULE_1__["RendererStyleFlags2"].DashCase | _angular_core__WEBPACK_IMPORTED_MODULE_1__["RendererStyleFlags2"].Important)) {
42005            el.style.setProperty(style, value, flags & _angular_core__WEBPACK_IMPORTED_MODULE_1__["RendererStyleFlags2"].Important ? 'important' : '');
42006        }
42007        else {
42008            el.style[style] = value;
42009        }
42010    }
42011    removeStyle(el, style, flags) {
42012        if (flags & _angular_core__WEBPACK_IMPORTED_MODULE_1__["RendererStyleFlags2"].DashCase) {
42013            el.style.removeProperty(style);
42014        }
42015        else {
42016            // IE requires '' instead of null
42017            // see https://github.com/angular/angular/issues/7916
42018            el.style[style] = '';
42019        }
42020    }
42021    setProperty(el, name, value) {
42022        NG_DEV_MODE && checkNoSyntheticProp(name, 'property');
42023        el[name] = value;
42024    }
42025    setValue(node, value) {
42026        node.nodeValue = value;
42027    }
42028    listen(target, event, callback) {
42029        NG_DEV_MODE && checkNoSyntheticProp(event, 'listener');
42030        if (typeof target === 'string') {
42031            return this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback));
42032        }
42033        return this.eventManager.addEventListener(target, event, decoratePreventDefault(callback));
42034    }
42035}
42036const ɵ0$2 = () => '@'.charCodeAt(0);
42037const AT_CHARCODE = (ɵ0$2)();
42038function checkNoSyntheticProp(name, nameKind) {
42039    if (name.charCodeAt(0) === AT_CHARCODE) {
42040        throw new Error(`Found the synthetic ${nameKind} ${name}. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.`);
42041    }
42042}
42043class EmulatedEncapsulationDomRenderer2 extends DefaultDomRenderer2 {
42044    constructor(eventManager, sharedStylesHost, component, appId) {
42045        super(eventManager);
42046        this.component = component;
42047        const styles = flattenStyles(appId + '-' + component.id, component.styles, []);
42048        sharedStylesHost.addStyles(styles);
42049        this.contentAttr = shimContentAttribute(appId + '-' + component.id);
42050        this.hostAttr = shimHostAttribute(appId + '-' + component.id);
42051    }
42052    applyToHost(element) {
42053        super.setAttribute(element, this.hostAttr, '');
42054    }
42055    createElement(parent, name) {
42056        const el = super.createElement(parent, name);
42057        super.setAttribute(el, this.contentAttr, '');
42058        return el;
42059    }
42060}
42061class ShadowDomRenderer extends DefaultDomRenderer2 {
42062    constructor(eventManager, sharedStylesHost, hostEl, component) {
42063        super(eventManager);
42064        this.sharedStylesHost = sharedStylesHost;
42065        this.hostEl = hostEl;
42066        this.shadowRoot = hostEl.attachShadow({ mode: 'open' });
42067        this.sharedStylesHost.addHost(this.shadowRoot);
42068        const styles = flattenStyles(component.id, component.styles, []);
42069        for (let i = 0; i < styles.length; i++) {
42070            const styleEl = document.createElement('style');
42071            styleEl.textContent = styles[i];
42072            this.shadowRoot.appendChild(styleEl);
42073        }
42074    }
42075    nodeOrShadowRoot(node) {
42076        return node === this.hostEl ? this.shadowRoot : node;
42077    }
42078    destroy() {
42079        this.sharedStylesHost.removeHost(this.shadowRoot);
42080    }
42081    appendChild(parent, newChild) {
42082        return super.appendChild(this.nodeOrShadowRoot(parent), newChild);
42083    }
42084    insertBefore(parent, newChild, refChild) {
42085        return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild);
42086    }
42087    removeChild(parent, oldChild) {
42088        return super.removeChild(this.nodeOrShadowRoot(parent), oldChild);
42089    }
42090    parentNode(node) {
42091        return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));
42092    }
42093}
42094
42095/**
42096 * @license
42097 * Copyright Google LLC All Rights Reserved.
42098 *
42099 * Use of this source code is governed by an MIT-style license that can be
42100 * found in the LICENSE file at https://angular.io/license
42101 */
42102class DomEventsPlugin extends EventManagerPlugin {
42103    constructor(doc) {
42104        super(doc);
42105    }
42106    // This plugin should come last in the list of plugins, because it accepts all
42107    // events.
42108    supports(eventName) {
42109        return true;
42110    }
42111    addEventListener(element, eventName, handler) {
42112        element.addEventListener(eventName, handler, false);
42113        return () => this.removeEventListener(element, eventName, handler);
42114    }
42115    removeEventListener(target, eventName, callback) {
42116        return target.removeEventListener(eventName, callback);
42117    }
42118}
42119DomEventsPlugin.ɵfac = function DomEventsPlugin_Factory(t) { return new (t || DomEventsPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); };
42120DomEventsPlugin.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomEventsPlugin, factory: DomEventsPlugin.ɵfac });
42121DomEventsPlugin.ctorParameters = () => [
42122    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] }
42123];
42124(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomEventsPlugin, [{
42125        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
42126    }], function () { return [{ type: undefined, decorators: [{
42127                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
42128                args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]]
42129            }] }]; }, null); })();
42130
42131/**
42132 * @license
42133 * Copyright Google LLC All Rights Reserved.
42134 *
42135 * Use of this source code is governed by an MIT-style license that can be
42136 * found in the LICENSE file at https://angular.io/license
42137 */
42138/**
42139 * Supported HammerJS recognizer event names.
42140 */
42141const EVENT_NAMES = {
42142    // pan
42143    'pan': true,
42144    'panstart': true,
42145    'panmove': true,
42146    'panend': true,
42147    'pancancel': true,
42148    'panleft': true,
42149    'panright': true,
42150    'panup': true,
42151    'pandown': true,
42152    // pinch
42153    'pinch': true,
42154    'pinchstart': true,
42155    'pinchmove': true,
42156    'pinchend': true,
42157    'pinchcancel': true,
42158    'pinchin': true,
42159    'pinchout': true,
42160    // press
42161    'press': true,
42162    'pressup': true,
42163    // rotate
42164    'rotate': true,
42165    'rotatestart': true,
42166    'rotatemove': true,
42167    'rotateend': true,
42168    'rotatecancel': true,
42169    // swipe
42170    'swipe': true,
42171    'swipeleft': true,
42172    'swiperight': true,
42173    'swipeup': true,
42174    'swipedown': true,
42175    // tap
42176    'tap': true,
42177    'doubletap': true
42178};
42179/**
42180 * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular.
42181 * @see `HammerGestureConfig`
42182 *
42183 * @ngModule HammerModule
42184 * @publicApi
42185 */
42186const HAMMER_GESTURE_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('HammerGestureConfig');
42187/**
42188 * Injection token used to provide a {@link HammerLoader} to Angular.
42189 *
42190 * @publicApi
42191 */
42192const HAMMER_LOADER = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('HammerLoader');
42193/**
42194 * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
42195 * for gesture recognition. Configures specific event recognition.
42196 * @publicApi
42197 */
42198class HammerGestureConfig {
42199    constructor() {
42200        /**
42201         * A set of supported event names for gestures to be used in Angular.
42202         * Angular supports all built-in recognizers, as listed in
42203         * [HammerJS documentation](https://hammerjs.github.io/).
42204         */
42205        this.events = [];
42206        /**
42207         * Maps gesture event names to a set of configuration options
42208         * that specify overrides to the default values for specific properties.
42209         *
42210         * The key is a supported event name to be configured,
42211         * and the options object contains a set of properties, with override values
42212         * to be applied to the named recognizer event.
42213         * For example, to disable recognition of the rotate event, specify
42214         *  `{"rotate": {"enable": false}}`.
42215         *
42216         * Properties that are not present take the HammerJS default values.
42217         * For information about which properties are supported for which events,
42218         * and their allowed and default values, see
42219         * [HammerJS documentation](https://hammerjs.github.io/).
42220         *
42221         */
42222        this.overrides = {};
42223    }
42224    /**
42225     * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
42226     * and attaches it to a given HTML element.
42227     * @param element The element that will recognize gestures.
42228     * @returns A HammerJS event-manager object.
42229     */
42230    buildHammer(element) {
42231        const mc = new Hammer(element, this.options);
42232        mc.get('pinch').set({ enable: true });
42233        mc.get('rotate').set({ enable: true });
42234        for (const eventName in this.overrides) {
42235            mc.get(eventName).set(this.overrides[eventName]);
42236        }
42237        return mc;
42238    }
42239}
42240HammerGestureConfig.ɵfac = function HammerGestureConfig_Factory(t) { return new (t || HammerGestureConfig)(); };
42241HammerGestureConfig.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HammerGestureConfig, factory: HammerGestureConfig.ɵfac });
42242(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](HammerGestureConfig, [{
42243        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
42244    }], function () { return []; }, null); })();
42245/**
42246 * Event plugin that adds Hammer support to an application.
42247 *
42248 * @ngModule HammerModule
42249 */
42250class HammerGesturesPlugin extends EventManagerPlugin {
42251    constructor(doc, _config, console, loader) {
42252        super(doc);
42253        this._config = _config;
42254        this.console = console;
42255        this.loader = loader;
42256        this._loaderPromise = null;
42257    }
42258    supports(eventName) {
42259        if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
42260            return false;
42261        }
42262        if (!window.Hammer && !this.loader) {
42263            if (typeof ngDevMode === 'undefined' || ngDevMode) {
42264                this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` +
42265                    `loaded and no custom loader has been specified.`);
42266            }
42267            return false;
42268        }
42269        return true;
42270    }
42271    addEventListener(element, eventName, handler) {
42272        const zone = this.manager.getZone();
42273        eventName = eventName.toLowerCase();
42274        // If Hammer is not present but a loader is specified, we defer adding the event listener
42275        // until Hammer is loaded.
42276        if (!window.Hammer && this.loader) {
42277            this._loaderPromise = this._loaderPromise || this.loader();
42278            // This `addEventListener` method returns a function to remove the added listener.
42279            // Until Hammer is loaded, the returned function needs to *cancel* the registration rather
42280            // than remove anything.
42281            let cancelRegistration = false;
42282            let deregister = () => {
42283                cancelRegistration = true;
42284            };
42285            this._loaderPromise
42286                .then(() => {
42287                // If Hammer isn't actually loaded when the custom loader resolves, give up.
42288                if (!window.Hammer) {
42289                    if (typeof ngDevMode === 'undefined' || ngDevMode) {
42290                        this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
42291                    }
42292                    deregister = () => { };
42293                    return;
42294                }
42295                if (!cancelRegistration) {
42296                    // Now that Hammer is loaded and the listener is being loaded for real,
42297                    // the deregistration function changes from canceling registration to removal.
42298                    deregister = this.addEventListener(element, eventName, handler);
42299                }
42300            })
42301                .catch(() => {
42302                if (typeof ngDevMode === 'undefined' || ngDevMode) {
42303                    this.console.warn(`The "${eventName}" event cannot be bound because the custom ` +
42304                        `Hammer.JS loader failed.`);
42305                }
42306                deregister = () => { };
42307            });
42308            // Return a function that *executes* `deregister` (and not `deregister` itself) so that we
42309            // can change the behavior of `deregister` once the listener is added. Using a closure in
42310            // this way allows us to avoid any additional data structures to track listener removal.
42311            return () => {
42312                deregister();
42313            };
42314        }
42315        return zone.runOutsideAngular(() => {
42316            // Creating the manager bind events, must be done outside of angular
42317            const mc = this._config.buildHammer(element);
42318            const callback = function (eventObj) {
42319                zone.runGuarded(function () {
42320                    handler(eventObj);
42321                });
42322            };
42323            mc.on(eventName, callback);
42324            return () => {
42325                mc.off(eventName, callback);
42326                // destroy mc to prevent memory leak
42327                if (typeof mc.destroy === 'function') {
42328                    mc.destroy();
42329                }
42330            };
42331        });
42332    }
42333    isCustomEvent(eventName) {
42334        return this._config.events.indexOf(eventName) > -1;
42335    }
42336}
42337HammerGesturesPlugin.ɵfac = function HammerGesturesPlugin_Factory(t) { return new (t || HammerGesturesPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](HAMMER_GESTURE_CONFIG), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](HAMMER_LOADER, 8)); };
42338HammerGesturesPlugin.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HammerGesturesPlugin, factory: HammerGesturesPlugin.ɵfac });
42339HammerGesturesPlugin.ctorParameters = () => [
42340    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] },
42341    { type: HammerGestureConfig, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [HAMMER_GESTURE_CONFIG,] }] },
42342    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"] },
42343    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [HAMMER_LOADER,] }] }
42344];
42345(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](HammerGesturesPlugin, [{
42346        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
42347    }], function () { return [{ type: undefined, decorators: [{
42348                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
42349                args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]]
42350            }] }, { type: HammerGestureConfig, decorators: [{
42351                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
42352                args: [HAMMER_GESTURE_CONFIG]
42353            }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"] }, { type: undefined, decorators: [{
42354                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]
42355            }, {
42356                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
42357                args: [HAMMER_LOADER]
42358            }] }]; }, null); })();
42359/**
42360 * In Ivy, support for Hammer gestures is optional, so applications must
42361 * import the `HammerModule` at root to turn on support. This means that
42362 * Hammer-specific code can be tree-shaken away if not needed.
42363 */
42364const HAMMER_PROVIDERS__POST_R3__ = [];
42365/**
42366 * In View Engine, support for Hammer gestures is built-in by default.
42367 */
42368const HAMMER_PROVIDERS__PRE_R3__ = [
42369    {
42370        provide: EVENT_MANAGER_PLUGINS,
42371        useClass: HammerGesturesPlugin,
42372        multi: true,
42373        deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], HAMMER_GESTURE_CONFIG, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"], [new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), HAMMER_LOADER]]
42374    },
42375    { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
42376];
42377const HAMMER_PROVIDERS = HAMMER_PROVIDERS__POST_R3__;
42378/**
42379 * Adds support for HammerJS.
42380 *
42381 * Import this module at the root of your application so that Angular can work with
42382 * HammerJS to detect gesture events.
42383 *
42384 * Note that applications still need to include the HammerJS script itself. This module
42385 * simply sets up the coordination layer between HammerJS and Angular's EventManager.
42386 *
42387 * @publicApi
42388 */
42389class HammerModule {
42390}
42391HammerModule.ɵfac = function HammerModule_Factory(t) { return new (t || HammerModule)(); };
42392HammerModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: HammerModule });
42393HammerModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ providers: HAMMER_PROVIDERS__PRE_R3__ });
42394(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](HammerModule, [{
42395        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"],
42396        args: [{ providers: HAMMER_PROVIDERS__PRE_R3__ }]
42397    }], null, null); })();
42398
42399/**
42400 * @license
42401 * Copyright Google LLC All Rights Reserved.
42402 *
42403 * Use of this source code is governed by an MIT-style license that can be
42404 * found in the LICENSE file at https://angular.io/license
42405 */
42406/**
42407 * Defines supported modifiers for key events.
42408 */
42409const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
42410const DOM_KEY_LOCATION_NUMPAD = 3;
42411// Map to convert some key or keyIdentifier values to what will be returned by getEventKey
42412const _keyMap = {
42413    // The following values are here for cross-browser compatibility and to match the W3C standard
42414    // cf https://www.w3.org/TR/DOM-Level-3-Events-key/
42415    '\b': 'Backspace',
42416    '\t': 'Tab',
42417    '\x7F': 'Delete',
42418    '\x1B': 'Escape',
42419    'Del': 'Delete',
42420    'Esc': 'Escape',
42421    'Left': 'ArrowLeft',
42422    'Right': 'ArrowRight',
42423    'Up': 'ArrowUp',
42424    'Down': 'ArrowDown',
42425    'Menu': 'ContextMenu',
42426    'Scroll': 'ScrollLock',
42427    'Win': 'OS'
42428};
42429// There is a bug in Chrome for numeric keypad keys:
42430// https://code.google.com/p/chromium/issues/detail?id=155654
42431// 1, 2, 3 ... are reported as A, B, C ...
42432const _chromeNumKeyPadMap = {
42433    'A': '1',
42434    'B': '2',
42435    'C': '3',
42436    'D': '4',
42437    'E': '5',
42438    'F': '6',
42439    'G': '7',
42440    'H': '8',
42441    'I': '9',
42442    'J': '*',
42443    'K': '+',
42444    'M': '-',
42445    'N': '.',
42446    'O': '/',
42447    '\x60': '0',
42448    '\x90': 'NumLock'
42449};
42450const ɵ0$3 = (event) => event.altKey, ɵ1 = (event) => event.ctrlKey, ɵ2 = (event) => event.metaKey, ɵ3 = (event) => event.shiftKey;
42451/**
42452 * Retrieves modifiers from key-event objects.
42453 */
42454const MODIFIER_KEY_GETTERS = {
42455    'alt': ɵ0$3,
42456    'control': ɵ1,
42457    'meta': ɵ2,
42458    'shift': ɵ3
42459};
42460/**
42461 * @publicApi
42462 * A browser plug-in that provides support for handling of key events in Angular.
42463 */
42464class KeyEventsPlugin extends EventManagerPlugin {
42465    /**
42466     * Initializes an instance of the browser plug-in.
42467     * @param doc The document in which key events will be detected.
42468     */
42469    constructor(doc) {
42470        super(doc);
42471    }
42472    /**
42473     * Reports whether a named key event is supported.
42474     * @param eventName The event name to query.
42475     * @return True if the named key event is supported.
42476     */
42477    supports(eventName) {
42478        return KeyEventsPlugin.parseEventName(eventName) != null;
42479    }
42480    /**
42481     * Registers a handler for a specific element and key event.
42482     * @param element The HTML element to receive event notifications.
42483     * @param eventName The name of the key event to listen for.
42484     * @param handler A function to call when the notification occurs. Receives the
42485     * event object as an argument.
42486     * @returns The key event that was registered.
42487     */
42488    addEventListener(element, eventName, handler) {
42489        const parsedEvent = KeyEventsPlugin.parseEventName(eventName);
42490        const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
42491        return this.manager.getZone().runOutsideAngular(() => {
42492            return Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);
42493        });
42494    }
42495    static parseEventName(eventName) {
42496        const parts = eventName.toLowerCase().split('.');
42497        const domEventName = parts.shift();
42498        if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {
42499            return null;
42500        }
42501        const key = KeyEventsPlugin._normalizeKey(parts.pop());
42502        let fullKey = '';
42503        MODIFIER_KEYS.forEach(modifierName => {
42504            const index = parts.indexOf(modifierName);
42505            if (index > -1) {
42506                parts.splice(index, 1);
42507                fullKey += modifierName + '.';
42508            }
42509        });
42510        fullKey += key;
42511        if (parts.length != 0 || key.length === 0) {
42512            // returning null instead of throwing to let another plugin process the event
42513            return null;
42514        }
42515        // NOTE: Please don't rewrite this as so, as it will break JSCompiler property renaming.
42516        //       The code must remain in the `result['domEventName']` form.
42517        // return {domEventName, fullKey};
42518        const result = {};
42519        result['domEventName'] = domEventName;
42520        result['fullKey'] = fullKey;
42521        return result;
42522    }
42523    static getEventFullKey(event) {
42524        let fullKey = '';
42525        let key = getEventKey(event);
42526        key = key.toLowerCase();
42527        if (key === ' ') {
42528            key = 'space'; // for readability
42529        }
42530        else if (key === '.') {
42531            key = 'dot'; // because '.' is used as a separator in event names
42532        }
42533        MODIFIER_KEYS.forEach(modifierName => {
42534            if (modifierName != key) {
42535                const modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
42536                if (modifierGetter(event)) {
42537                    fullKey += modifierName + '.';
42538                }
42539            }
42540        });
42541        fullKey += key;
42542        return fullKey;
42543    }
42544    /**
42545     * Configures a handler callback for a key event.
42546     * @param fullKey The event name that combines all simultaneous keystrokes.
42547     * @param handler The function that responds to the key event.
42548     * @param zone The zone in which the event occurred.
42549     * @returns A callback function.
42550     */
42551    static eventCallback(fullKey, handler, zone) {
42552        return (event /** TODO #9100 */) => {
42553            if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {
42554                zone.runGuarded(() => handler(event));
42555            }
42556        };
42557    }
42558    /** @internal */
42559    static _normalizeKey(keyName) {
42560        // TODO: switch to a Map if the mapping grows too much
42561        switch (keyName) {
42562            case 'esc':
42563                return 'escape';
42564            default:
42565                return keyName;
42566        }
42567    }
42568}
42569KeyEventsPlugin.ɵfac = function KeyEventsPlugin_Factory(t) { return new (t || KeyEventsPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); };
42570KeyEventsPlugin.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: KeyEventsPlugin, factory: KeyEventsPlugin.ɵfac });
42571KeyEventsPlugin.ctorParameters = () => [
42572    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] }
42573];
42574(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](KeyEventsPlugin, [{
42575        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
42576    }], function () { return [{ type: undefined, decorators: [{
42577                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
42578                args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]]
42579            }] }]; }, null); })();
42580function getEventKey(event) {
42581    let key = event.key;
42582    if (key == null) {
42583        key = event.keyIdentifier;
42584        // keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and
42585        // Safari cf
42586        // https://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces
42587        if (key == null) {
42588            return 'Unidentified';
42589        }
42590        if (key.startsWith('U+')) {
42591            key = String.fromCharCode(parseInt(key.substring(2), 16));
42592            if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {
42593                // There is a bug in Chrome for numeric keypad keys:
42594                // https://code.google.com/p/chromium/issues/detail?id=155654
42595                // 1, 2, 3 ... are reported as A, B, C ...
42596                key = _chromeNumKeyPadMap[key];
42597            }
42598        }
42599    }
42600    return _keyMap[key] || key;
42601}
42602
42603/**
42604 * @license
42605 * Copyright Google LLC All Rights Reserved.
42606 *
42607 * Use of this source code is governed by an MIT-style license that can be
42608 * found in the LICENSE file at https://angular.io/license
42609 */
42610/**
42611 * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by s
42611anitizing
42612 * values to be safe to use in the different DOM contexts.
42613 *
42614 * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
42615 * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
42616 * the website.
42617 *
42618 * In specific situations, it might be necessary to disable sanitization, for example if the
42619 * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
42620 * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
42621 * methods, and then binding to that value from the template.
42622 *
42623 * These situations should be very rare, and extraordinary care must be taken to avoid creating a
42624 * Cross Site Scripting (XSS) security bug!
42625 *
42626 * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
42627 * close as possible to the source of the value, to make it easy to verify no security bug is
42628 * created by its use.
42629 *
42630 * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
42631 * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
42632 * code. The sanitizer leaves safe values intact.
42633 *
42634 * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
42635 * sanitization for the value passed in. Carefully check and audit all values and code paths going
42636 * into this call. Make sure any user data is appropriately escaped for this security context.
42637 * For more detail, see the [Security Guide](https://g.co/ng/security).
42638 *
42639 * @publicApi
42640 */
42641class DomSanitizer {
42642}
42643DomSanitizer.ɵfac = function DomSanitizer_Factory(t) { return new (t || DomSanitizer)(); };
42644DomSanitizer.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: function DomSanitizer_Factory() { return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(DomSanitizerImpl); }, token: DomSanitizer, providedIn: "root" });
42645(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomSanitizer, [{
42646        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"],
42647        args: [{ providedIn: 'root', useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(() => DomSanitizerImpl) }]
42648    }], null, null); })();
42649function domSanitizerImplFactory(injector) {
42650    return new DomSanitizerImpl(injector.get(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]));
42651}
42652class DomSanitizerImpl extends DomSanitizer {
42653    constructor(_doc) {
42654        super();
42655        this._doc = _doc;
42656    }
42657    sanitize(ctx, value) {
42658        if (value == null)
42659            return null;
42660        switch (ctx) {
42661            case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].NONE:
42662                return value;
42663            case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].HTML:
42664                if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "HTML" /* Html */)) {
42665                    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value);
42666                }
42667                return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵ_sanitizeHtml"])(this._doc, String(value)).toString();
42668            case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].STYLE:
42669                if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "Style" /* Style */)) {
42670                    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value);
42671                }
42672                return value;
42673            case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].SCRIPT:
42674                if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "Script" /* Script */)) {
42675                    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value);
42676                }
42677                throw new Error('unsafe value used in a script context');
42678            case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].URL:
42679                const type = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵgetSanitizationBypassType"])(value);
42680                if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "URL" /* Url */)) {
42681                    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value);
42682                }
42683                return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵ_sanitizeUrl"])(String(value));
42684            case _angular_core__WEBPACK_IMPORTED_MODULE_1__["SecurityContext"].RESOURCE_URL:
42685                if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "ResourceURL" /* ResourceUrl */)) {
42686                    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value);
42687                }
42688                throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
42689            default:
42690                throw new Error(`Unexpected SecurityContext ${ctx} (see https://g.co/ng/security#xss)`);
42691        }
42692    }
42693    bypassSecurityTrustHtml(value) {
42694        return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustHtml"])(value);
42695    }
42696    bypassSecurityTrustStyle(value) {
42697        return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustStyle"])(value);
42698    }
42699    bypassSecurityTrustScript(value) {
42700        return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustScript"])(value);
42701    }
42702    bypassSecurityTrustUrl(value) {
42703        return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustUrl"])(value);
42704    }
42705    bypassSecurityTrustResourceUrl(value) {
42706        return Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustResourceUrl"])(value);
42707    }
42708}
42709DomSanitizerImpl.ɵfac = function DomSanitizerImpl_Factory(t) { return new (t || DomSanitizerImpl)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); };
42710DomSanitizerImpl.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: function DomSanitizerImpl_Factory() { return domSanitizerImplFactory(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["INJECTOR"])); }, token: DomSanitizerImpl, providedIn: "root" });
42711DomSanitizerImpl.ctorParameters = () => [
42712    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] }
42713];
42714(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomSanitizerImpl, [{
42715        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"],
42716        args: [{ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"]] }]
42717    }], function () { return [{ type: undefined, decorators: [{
42718                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
42719                args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]]
42720            }] }]; }, null); })();
42721
42722/**
42723 * @license
42724 * Copyright Google LLC All Rights Reserved.
42725 *
42726 * Use of this source code is governed by an MIT-style license that can be
42727 * found in the LICENSE file at https://angular.io/license
42728 */
42729function initDomAdapter() {
42730    BrowserDomAdapter.makeCurrent();
42731    BrowserGetTestability.init();
42732}
42733function errorHandler() {
42734    return new _angular_core__WEBPACK_IMPORTED_MODULE_1__["ErrorHandler"]();
42735}
42736function _document() {
42737    // Tell ivy about the global document
42738    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetDocument"])(document);
42739    return document;
42740}
42741const ɵ0$4 = _angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵPLATFORM_BROWSER_ID"];
42742const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
42743    { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"], useValue: ɵ0$4 },
42744    { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_INITIALIZER"], useValue: initDomAdapter, multi: true },
42745    { provide: _angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], useFactory: _document, deps: [] },
42746];
42747const BROWSER_SANITIZATION_PROVIDERS__PRE_R3__ = [
42748    { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Sanitizer"], useExisting: DomSanitizer },
42749    { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] },
42750];
42751const BROWSER_SANITIZATION_PROVIDERS__POST_R3__ = [];
42752/**
42753 * @security Replacing built-in sanitization providers exposes the application to XSS risks.
42754 * Attacker-controlled data introduced by an unsanitized provider could expose your
42755 * application to XSS risks. For more detail, see the [Security Guide](https://g.co/ng/security).
42756 * @publicApi
42757 */
42758const BROWSER_SANITIZATION_PROVIDERS = BROWSER_SANITIZATION_PROVIDERS__POST_R3__;
42759/**
42760 * A factory function that returns a `PlatformRef` instance associated with browser service
42761 * providers.
42762 *
42763 * @publicApi
42764 */
42765const platformBrowser = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["createPlatformFactory"])(_angular_core__WEBPACK_IMPORTED_MODULE_1__["platformCore"], 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
42766const BROWSER_MODULE_PROVIDERS = [
42767    BROWSER_SANITIZATION_PROVIDERS,
42768    { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵINJECTOR_SCOPE"], useValue: 'root' },
42769    { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ErrorHandler"], useFactory: errorHandler, deps: [] },
42770    {
42771        provide: EVENT_MANAGER_PLUGINS,
42772        useClass: DomEventsPlugin,
42773        multi: true,
42774        deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["PLATFORM_ID"]]
42775    },
42776    { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] },
42777    HAMMER_PROVIDERS,
42778    {
42779        provide: DomRendererFactory2,
42780        useClass: DomRendererFactory2,
42781        deps: [EventManager, DomSharedStylesHost, _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"]]
42782    },
42783    { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["RendererFactory2"], useExisting: DomRendererFactory2 },
42784    { provide: SharedStylesHost, useExisting: DomSharedStylesHost },
42785    { provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]] },
42786    { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Testability"], useClass: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Testability"], deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]] },
42787    { provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]] },
42788    ELEMENT_PROBE_PROVIDERS,
42789];
42790/**
42791 * Exports required infrastructure for all Angular apps.
42792 * Included by default in all Angular apps created with the CLI
42793 * `new` command.
42794 * Re-exports `CommonModule` and `ApplicationModule`, making their
42795 * exports and providers available to all apps.
42796 *
42797 * @publicApi
42798 */
42799class BrowserModule {
42800    constructor(parentModule) {
42801        if (parentModule) {
42802            throw new Error(`BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.`);
42803        }
42804    }
42805    /**
42806     * Configures a browser-based app to transition from a server-rendered app, if
42807     * one is present on the page.
42808     *
42809     * @param params An object containing an identifier for the app to transition.
42810     * The ID must match between the client and server versions of the app.
42811     * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`.
42812     */
42813    static withServerTransition(params) {
42814        return {
42815            ngModule: BrowserModule,
42816            providers: [
42817                { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"], useValue: params.appId },
42818                { provide: TRANSITION_ID, useExisting: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"] },
42819                SERVER_TRANSITION_PROVIDERS,
42820            ],
42821        };
42822    }
42823}
42824BrowserModule.ɵfac = function BrowserModule_Factory(t) { return new (t || BrowserModule)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](BrowserModule, 12)); };
42825BrowserModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: BrowserModule });
42826BrowserModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ providers: BROWSER_MODULE_PROVIDERS, imports: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["CommonModule"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationModule"]] });
42827BrowserModule.ctorParameters = () => [
42828    { type: BrowserModule, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [BrowserModule,] }] }
42829];
42830(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](BrowserModule, { exports: function () { return [_angular_common__WEBPACK_IMPORTED_MODULE_0__["CommonModule"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationModule"]]; } }); })();
42831(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](BrowserModule, [{
42832        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"],
42833        args: [{ providers: BROWSER_MODULE_PROVIDERS, exports: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["CommonModule"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationModule"]] }]
42834    }], function () { return [{ type: BrowserModule, decorators: [{
42835                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]
42836            }, {
42837                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"]
42838            }, {
42839                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
42840                args: [BrowserModule]
42841            }] }]; }, null); })();
42842
42843/**
42844 * @license
42845 * Copyright Google LLC All Rights Reserved.
42846 *
42847 * Use of this source code is governed by an MIT-style license that can be
42848 * found in the LICENSE file at https://angular.io/license
42849 */
42850/**
42851 * Factory to create a `Meta` service instance for the current DOM document.
42852 */
42853function createMeta() {
42854    return new Meta(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]));
42855}
42856/**
42857 * A service for managing HTML `<meta>` tags.
42858 *
42859 * Properties of the `MetaDefinition` object match the attributes of the
42860 * HTML `<meta>` tag. These tags define document metadata that is important for
42861 * things like configuring a Content Security Policy, defining browser compatibility
42862 * and security settings, setting HTTP Headers, defining rich content for social sharing,
42863 * and Search Engine Optimization (SEO).
42864 *
42865 * To identify specific `<meta>` tags in a document, use an attribute selection
42866 * string in the format `"tag_attribute='value string'"`.
42867 * For example, an `attrSelector` value of `"name='description'"` matches a tag
42868 * whose `name` attribute has the value `"description"`.
42869 * Selectors are used with the `querySelector()` Document method,
42870 * in the format `meta[{attrSelector}]`.
42871 *
42872 * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta)
42873 * @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
42874 *
42875 *
42876 * @publicApi
42877 */
42878class Meta {
42879    constructor(_doc) {
42880        this._doc = _doc;
42881        this._dom = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])();
42882    }
42883    /**
42884     * Retrieves or creates a specific `<meta>` tag element in the current HTML document.
42885     * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
42886     * values in the provided tag definition, and verifies that all other attribute values are equal.
42887     * If an existing element is found, it is returned and is not modified in any way.
42888     * @param tag The definition of a `<meta>` element to match or create.
42889     * @param forceCreation True to create a new element without checking whether one already exists.
42890     * @returns The existing element with the same attributes and values if found,
42891     * the new element if no match is found, or `null` if the tag parameter is not defined.
42892     */
42893    addTag(tag, forceCreation = false) {
42894        if (!tag)
42895            return null;
42896        return this._getOrCreateElement(tag, forceCreation);
42897    }
42898    /**
42899     * Retrieves or creates a set of `<meta>` tag elements in the current HTML document.
42900     * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
42901     * values in the provided tag definition, and verifies that all other attribute values are equal.
42902     * @param tags An array of tag definitions to match or create.
42903     * @param forceCreation True to create new elements without checking whether they already exist.
42904     * @returns The matching elements if found, or the new elements.
42905     */
42906    addTags(tags, forceCreation = false) {
42907        if (!tags)
42908            return [];
42909        return tags.reduce((result, tag) => {
42910            if (tag) {
42911                result.push(this._getOrCreateElement(tag, forceCreation));
42912            }
42913            return result;
42914        }, []);
42915    }
42916    /**
42917     * Retrieves a `<meta>` tag element in the current HTML document.
42918     * @param attrSelector The tag attribute and value to match against, in the format
42919     * `"tag_attribute='value string'"`.
42920     * @returns The matching element, if any.
42921     */
42922    getTag(attrSelector) {
42923        if (!attrSelector)
42924            return null;
42925        return this._doc.querySelector(`meta[${attrSelector}]`) || null;
42926    }
42927    /**
42928     * Retrieves a set of `<meta>` tag elements in the current HTML document.
42929     * @param attrSelector The tag attribute and value to match against, in the format
42930     * `"tag_attribute='value string'"`.
42931     * @returns The matching elements, if any.
42932     */
42933    getTags(attrSelector) {
42934        if (!attrSelector)
42935            return [];
42936        const list /*NodeList*/ = this._doc.querySelectorAll(`meta[${attrSelector}]`);
42937        return list ? [].slice.call(list) : [];
42938    }
42939    /**
42940     * Modifies an existing `<meta>` tag element in the current HTML document.
42941     * @param tag The tag description with which to replace the existing tag content.
42942     * @param selector A tag attribute and value to match against, to identify
42943     * an existing tag. A string in the format `"tag_attribute=`value string`"`.
42944     * If not supplied, matches a tag with the same `name` or `property` attribute value as the
42945     * replacement tag.
42946     * @return The modified element.
42947     */
42948    updateTag(tag, selector) {
42949        if (!tag)
42950            return null;
42951        selector = selector || this._parseSelector(tag);
42952        const meta = this.getTag(selector);
42953        if (meta) {
42954            return this._setMetaElementAttributes(tag, meta);
42955        }
42956        return this._getOrCreateElement(tag, true);
42957    }
42958    /**
42959     * Removes an existing `<meta>` tag element from the current HTML document.
42960     * @param attrSelector A tag attribute and value to match against, to identify
42961     * an existing tag. A string in the format `"tag_attribute=`value string`"`.
42962     */
42963    removeTag(attrSelector) {
42964        this.removeTagElement(this.getTag(attrSelector));
42965    }
42966    /**
42967     * Removes an existing `<meta>` tag element from the current HTML document.
42968     * @param meta The tag definition to match against to identify an existing tag.
42969     */
42970    removeTagElement(meta) {
42971        if (meta) {
42972            this._dom.remove(meta);
42973        }
42974    }
42975    _getOrCreateElement(meta, forceCreation = false) {
42976        if (!forceCreation) {
42977            const selector = this._parseSelector(meta);
42978            const elem = this.getTag(selector);
42979            // It's allowed to have multiple elements with the same name so it's not enough to
42980            // just check that element with the same name already present on the page. We also need to
42981            // check if element has tag attributes
42982            if (elem && this._containsAttributes(meta, elem))
42983                return elem;
42984        }
42985        const element = this._dom.createElement('meta');
42986        this._setMetaElementAttributes(meta, element);
42987        const head = this._doc.getElementsByTagName('head')[0];
42988        head.appendChild(element);
42989        return element;
42990    }
42991    _setMetaElementAttributes(tag, el) {
42992        Object.keys(tag).forEach((prop) => el.setAttribute(this._getMetaKeyMap(prop), tag[prop]));
42993        return el;
42994    }
42995    _parseSelector(tag) {
42996        const attr = tag.name ? 'name' : 'property';
42997        return `${attr}="${tag[attr]}"`;
42998    }
42999    _containsAttributes(tag, elem) {
43000        return Object.keys(tag).every((key) => elem.getAttribute(this._getMetaKeyMap(key)) === tag[key]);
43001    }
43002    _getMetaKeyMap(prop) {
43003        return META_KEYS_MAP[prop] || prop;
43004    }
43005}
43006Meta.ɵfac = function Meta_Factory(t) { return new (t || Meta)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); };
43007Meta.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: createMeta, token: Meta, providedIn: "root" });
43008Meta.ctorParameters = () => [
43009    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] }
43010];
43011(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](Meta, [{
43012        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"],
43013        args: [{ providedIn: 'root', useFactory: createMeta, deps: [] }]
43014    }], function () { return [{ type: undefined, decorators: [{
43015                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
43016                args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]]
43017            }] }]; }, null); })();
43018/**
43019 * Mapping for MetaDefinition properties with their correct meta attribute names
43020 */
43021const META_KEYS_MAP = {
43022    httpEquiv: 'http-equiv'
43023};
43024
43025/**
43026 * @license
43027 * Copyright Google LLC All Rights Reserved.
43028 *
43029 * Use of this source code is governed by an MIT-style license that can be
43030 * found in the LICENSE file at https://angular.io/license
43031 */
43032/**
43033 * Factory to create Title service.
43034 */
43035function createTitle() {
43036    return new Title(Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]));
43037}
43038/**
43039 * A service that can be used to get and set the title of a current HTML document.
43040 *
43041 * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
43042 * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
43043 * (representing the `<title>` tag). Instead, this service can be used to set and get the current
43044 * title value.
43045 *
43046 * @publicApi
43047 */
43048class Title {
43049    constructor(_doc) {
43050        this._doc = _doc;
43051    }
43052    /**
43053     * Get the title of the current HTML document.
43054     */
43055    getTitle() {
43056        return this._doc.title;
43057    }
43058    /**
43059     * Set the title of the current HTML document.
43060     * @param newTitle
43061     */
43062    setTitle(newTitle) {
43063        this._doc.title = newTitle || '';
43064    }
43065}
43066Title.ɵfac = function Title_Factory(t) { return new (t || Title)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"])); };
43067Title.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ factory: createTitle, token: Title, providedIn: "root" });
43068Title.ctorParameters = () => [
43069    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"],] }] }
43070];
43071(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](Title, [{
43072        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"],
43073        args: [{ providedIn: 'root', useFactory: createTitle, deps: [] }]
43074    }], function () { return [{ type: undefined, decorators: [{
43075                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
43076                args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"]]
43077            }] }]; }, null); })();
43078
43079/**
43080 * @license
43081 * Copyright Google LLC All Rights Reserved.
43082 *
43083 * Use of this source code is governed by an MIT-style license that can be
43084 * found in the LICENSE file at https://angular.io/license
43085 */
43086const win = typeof window !== 'undefined' && window || {};
43087
43088/**
43089 * @license
43090 * Copyright Google LLC All Rights Reserved.
43091 *
43092 * Use of this source code is governed by an MIT-style license that can be
43093 * found in the LICENSE file at https://angular.io/license
43094 */
43095class ChangeDetectionPerfRecord {
43096    constructor(msPerTick, numTicks) {
43097        this.msPerTick = msPerTick;
43098        this.numTicks = numTicks;
43099    }
43100}
43101/**
43102 * Entry point for all Angular profiling-related debug tools. This object
43103 * corresponds to the `ng.profiler` in the dev console.
43104 */
43105class AngularProfiler {
43106    constructor(ref) {
43107        this.appRef = ref.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"]);
43108    }
43109    // tslint:disable:no-console
43110    /**
43111     * Exercises change detection in a loop and then prints the average amount of
43112     * time in milliseconds how long a single round of change detection takes for
43113     * the current state of the UI. It runs a minimum of 5 rounds for a minimum
43114     * of 500 milliseconds.
43115     *
43116     * Optionally, a user may pass a `config` parameter containing a map of
43117     * options. Supported options are:
43118     *
43119     * `record` (boolean) - causes the profiler to record a CPU profile while
43120     * it exercises the change detector. Example:
43121     *
43122     * ```
43123     * ng.profiler.timeChangeDetection({record: true})
43124     * ```
43125     */
43126    timeChangeDetection(config) {
43127        const record = config && config['record'];
43128        const profileName = 'Change Detection';
43129        // Profiler is not available in Android browsers without dev tools opened
43130        const isProfilerAvailable = win.console.profile != null;
43131        if (record && isProfilerAvailable) {
43132            win.console.profile(profileName);
43133        }
43134        const start = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().performanceNow();
43135        let numTicks = 0;
43136        while (numTicks < 5 || (Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().performanceNow() - start) < 500) {
43137            this.appRef.tick();
43138            numTicks++;
43139        }
43140        const end = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().performanceNow();
43141        if (record && isProfilerAvailable) {
43142            win.console.profileEnd(profileName);
43143        }
43144        const msPerTick = (end - start) / numTicks;
43145        win.console.log(`ran ${numTicks} change detection cycles`);
43146        win.console.log(`${msPerTick.toFixed(2)} ms per check`);
43147        return new ChangeDetectionPerfRecord(msPerTick, numTicks);
43148    }
43149}
43150
43151/**
43152 * @license
43153 * Copyright Google LLC All Rights Reserved.
43154 *
43155 * Use of this source code is governed by an MIT-style license that can be
43156 * found in the LICENSE file at https://angular.io/license
43157 */
43158const PROFILER_GLOBAL_NAME = 'profiler';
43159/**
43160 * Enabled Angular debug tools that are accessible via your browser's
43161 * developer console.
43162 *
43163 * Usage:
43164 *
43165 * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
43166 * 1. Type `ng.` (usually the console will show auto-complete suggestion)
43167 * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
43168 *    then hit Enter.
43169 *
43170 * @publicApi
43171 */
43172function enableDebugTools(ref) {
43173    exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));
43174    return ref;
43175}
43176/**
43177 * Disables Angular tools.
43178 *
43179 * @publicApi
43180 */
43181function disableDebugTools() {
43182    exportNgVar(PROFILER_GLOBAL_NAME, null);
43183}
43184
43185/**
43186 * @license
43187 * Copyright Google LLC All Rights Reserved.
43188 *
43189 * Use of this source code is governed by an MIT-style license that can be
43190 * found in the LICENSE file at https://angular.io/license
43191 */
43192function escapeHtml(text) {
43193    const escapedText = {
43194        '&': '&a;',
43195        '"': '&q;',
43196        '\'': '&s;',
43197        '<': '&l;',
43198        '>': '&g;',
43199    };
43200    return text.replace(/[&"'<>]/g, s => escapedText[s]);
43201}
43202function unescapeHtml(text) {
43203    const unescapedText = {
43204        '&a;': '&',
43205        '&q;': '"',
43206        '&s;': '\'',
43207        '&l;': '<',
43208        '&g;': '>',
43209    };
43210    return text.replace(/&[^;]+;/g, s => unescapedText[s]);
43211}
43212/**
43213 * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
43214 *
43215 * Example:
43216 *
43217 * ```
43218 * const COUNTER_KEY = makeStateKey<number>('counter');
43219 * let value = 10;
43220 *
43221 * transferState.set(COUNTER_KEY, value);
43222 * ```
43223 *
43224 * @publicApi
43225 */
43226function makeStateKey(key) {
43227    return key;
43228}
43229/**
43230 * A key value store that is transferred from the application on the server side to the application
43231 * on the client side.
43232 *
43233 * `TransferState` will be available as an injectable token. To use it import
43234 * `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client.
43235 *
43236 * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
43237 * boolean, number, string, null and non-class objects will be serialized and deserialized in a
43238 * non-lossy manner.
43239 *
43240 * @publicApi
43241 */
43242class TransferState {
43243    constructor() {
43244        this.store = {};
43245        this.onSerializeCallbacks = {};
43246    }
43247    /** @internal */
43248    static init(initState) {
43249        const transferState = new TransferState();
43250        transferState.store = initState;
43251        return transferState;
43252    }
43253    /**
43254     * Get the value corresponding to a key. Return `defaultValue` if key is not found.
43255     */
43256    get(key, defaultValue) {
43257        return this.store[key] !== undefined ? this.store[key] : defaultValue;
43258    }
43259    /**
43260     * Set the value corresponding to a key.
43261     */
43262    set(key, value) {
43263        this.store[key] = value;
43264    }
43265    /**
43266     * Remove a key from the store.
43267     */
43268    remove(key) {
43269        delete this.store[key];
43270    }
43271    /**
43272     * Test whether a key exists in the store.
43273     */
43274    hasKey(key) {
43275        return this.store.hasOwnProperty(key);
43276    }
43277    /**
43278     * Register a callback to provide the value for a key when `toJson` is called.
43279     */
43280    onSerialize(key, callback) {
43281        this.onSerializeCallbacks[key] = callback;
43282    }
43283    /**
43284     * Serialize the current state of the store to JSON.
43285     */
43286    toJson() {
43287        // Call the onSerialize callbacks and put those values into the store.
43288        for (const key in this.onSerializeCallbacks) {
43289            if (this.onSerializeCallbacks.hasOwnProperty(key)) {
43290                try {
43291                    this.store[key] = this.onSerializeCallbacks[key]();
43292                }
43293                catch (e) {
43294                    console.warn('Exception in onSerialize callback: ', e);
43295                }
43296            }
43297        }
43298        return JSON.stringify(this.store);
43299    }
43300}
43301TransferState.ɵfac = function TransferState_Factory(t) { return new (t || TransferState)(); };
43302TransferState.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: TransferState, factory: TransferState.ɵfac });
43303(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TransferState, [{
43304        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
43305    }], function () { return []; }, null); })();
43306function initTransferState(doc, appId) {
43307    // Locate the script tag with the JSON data transferred from the server.
43308    // The id of the script tag is set to the Angular appId + 'state'.
43309    const script = doc.getElementById(appId + '-state');
43310    let initialState = {};
43311    if (script && script.textCont
43311ent) {
43312        try {
43313            // Avoid using any here as it triggers lint errors in google3 (any is not allowed).
43314            initialState = JSON.parse(unescapeHtml(script.textContent));
43315        }
43316        catch (e) {
43317            console.warn('Exception while restoring TransferState for app ' + appId, e);
43318        }
43319    }
43320    return TransferState.init(initialState);
43321}
43322/**
43323 * NgModule to install on the client side while using the `TransferState` to transfer state from
43324 * server to client.
43325 *
43326 * @publicApi
43327 */
43328class BrowserTransferStateModule {
43329}
43330BrowserTransferStateModule.ɵfac = function BrowserTransferStateModule_Factory(t) { return new (t || BrowserTransferStateModule)(); };
43331BrowserTransferStateModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: BrowserTransferStateModule });
43332BrowserTransferStateModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ providers: [{ provide: TransferState, useFactory: initTransferState, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"]] }] });
43333(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](BrowserTransferStateModule, [{
43334        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"],
43335        args: [{
43336                providers: [{ provide: TransferState, useFactory: initTransferState, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["DOCUMENT"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_ID"]] }]
43337            }]
43338    }], null, null); })();
43339
43340/**
43341 * @license
43342 * Copyright Google LLC All Rights Reserved.
43343 *
43344 * Use of this source code is governed by an MIT-style license that can be
43345 * found in the LICENSE file at https://angular.io/license
43346 */
43347/**
43348 * Predicates for use with {@link DebugElement}'s query functions.
43349 *
43350 * @publicApi
43351 */
43352class By {
43353    /**
43354     * Match all nodes.
43355     *
43356     * @usageNotes
43357     * ### Example
43358     *
43359     * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
43360     */
43361    static all() {
43362        return () => true;
43363    }
43364    /**
43365     * Match elements by the given CSS selector.
43366     *
43367     * @usageNotes
43368     * ### Example
43369     *
43370     * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
43371     */
43372    static css(selector) {
43373        return (debugElement) => {
43374            return debugElement.nativeElement != null ?
43375                elementMatches(debugElement.nativeElement, selector) :
43376                false;
43377        };
43378    }
43379    /**
43380     * Match nodes that have the given directive present.
43381     *
43382     * @usageNotes
43383     * ### Example
43384     *
43385     * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
43386     */
43387    static directive(type) {
43388        return (debugNode) => debugNode.providerTokens.indexOf(type) !== -1;
43389    }
43390}
43391function elementMatches(n, selector) {
43392    if (Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().isElementNode(n)) {
43393        return n.matches && n.matches(selector) ||
43394            n.msMatchesSelector && n.msMatchesSelector(selector) ||
43395            n.webkitMatchesSelector && n.webkitMatchesSelector(selector);
43396    }
43397    return false;
43398}
43399
43400/**
43401 * @license
43402 * Copyright Google LLC All Rights Reserved.
43403 *
43404 * Use of this source code is governed by an MIT-style license that can be
43405 * found in the LICENSE file at https://angular.io/license
43406 */
43407
43408/**
43409 * @license
43410 * Copyright Google LLC All Rights Reserved.
43411 *
43412 * Use of this source code is governed by an MIT-style license that can be
43413 * found in the LICENSE file at https://angular.io/license
43414 */
43415/**
43416 * @publicApi
43417 */
43418const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Version"]('11.2.11');
43419
43420/**
43421 * @license
43422 * Copyright Google LLC All Rights Reserved.
43423 *
43424 * Use of this source code is governed by an MIT-style license that can be
43425 * found in the LICENSE file at https://angular.io/license
43426 */
43427
43428/**
43429 * @license
43430 * Copyright Google LLC All Rights Reserved.
43431 *
43432 * Use of this source code is governed by an MIT-style license that can be
43433 * found in the LICENSE file at https://angular.io/license
43434 */
43435// This file only reexports content of the `src` folder. Keep it that way.
43436
43437/**
43438 * @license
43439 * Copyright Google LLC All Rights Reserved.
43440 *
43441 * Use of this source code is governed by an MIT-style license that can be
43442 * found in the LICENSE file at https://angular.io/license
43443 */
43444
43445/**
43446 * Generated bundle index. Do not edit.
43447 */
43448
43449
43450
43451//# sourceMappingURL=platform-browser.js.map
43452
43453/***/ }),
43454
43455/***/ "jtHE":
43456/*!**************************************************************!*\
43457  !*** ./node_modules/rxjs/_esm2015/internal/ReplaySubject.js ***!
43458  \**************************************************************/
43459/*! exports provided: ReplaySubject */
43460/***/ (function(module, __webpack_exports__, __webpack_require__) {
43461
43462"use strict";
43463__webpack_require__.r(__webpack_exports__);
43464/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return ReplaySubject; });
43465/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ "XNiG");
43466/* harmony import */ var _scheduler_queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scheduler/queue */ "qgXg");
43467/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Subscription */ "quSY");
43468/* harmony import */ var _operators_observeOn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./operators/observeOn */ "pxpQ");
43469/* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ "9ppp");
43470/* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SubjectSubscription */ "Ylt2");
43471
43472
43473
43474
43475
43476
43477class ReplaySubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"] {
43478    constructor(bufferSize = Number.POSITIVE_INFINITY, windowTime = Number.POSITIVE_INFINITY, scheduler) {
43479        super();
43480        this.scheduler = scheduler;
43481        this._events = [];
43482        this._infiniteTimeWindow = false;
vendor: 8,164 bytes, lines 43483-43629
43483        this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
43484        this._windowTime = windowTime < 1 ? 1 : windowTime;
43485        if (windowTime === Number.POSITIVE_INFINITY) {
43486            this._infiniteTimeWindow = true;
43487            this.next = this.nextInfiniteTimeWindow;
43488        }
43489        else {
43490            this.next = this.nextTimeWindow;
43491        }
43492    }
43493    nextInfiniteTimeWindow(value) {
43494        if (!this.isStopped) {
43495            const _events = this._events;
43496            _events.push(value);
43497            if (_events.length > this._bufferSize) {
43498                _events.shift();
43499            }
43500        }
43501        super.next(value);
43502    }
43503    nextTimeWindow(value) {
43504        if (!this.isStopped) {
43505            this._events.push(new ReplayEvent(this._getNow(), value));
43506            this._trimBufferThenGetEvents();
43507        }
43508        super.next(value);
43509    }
43510    _subscribe(subscriber) {
43511        const _infiniteTimeWindow = this._infiniteTimeWindow;
43512        const _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();
43513        const scheduler = this.scheduler;
43514        const len = _events.length;
43515        let subscription;
43516        if (this.closed) {
43517            throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"]();
43518        }
43519        else if (this.isStopped || this.hasError) {
43520            subscription = _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY;
43521        }
43522        else {
43523            this.observers.push(subscriber);
43524            subscription = new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__["SubjectSubscription"](this, subscriber);
43525        }
43526        if (scheduler) {
43527            subscriber.add(subscriber = new _operators_observeOn__WEBPACK_IMPORTED_MODULE_3__["ObserveOnSubscriber"](subscriber, scheduler));
43528        }
43529        if (_infiniteTimeWindow) {
43530            for (let i = 0; i < len && !subscriber.closed; i++) {
43531                subscriber.next(_events[i]);
43532            }
43533        }
43534        else {
43535            for (let i = 0; i < len && !subscriber.closed; i++) {
43536                subscriber.next(_events[i].value);
43537            }
43538        }
43539        if (this.hasError) {
43540            subscriber.error(this.thrownError);
43541        }
43542        else if (this.isStopped) {
43543            subscriber.complete();
43544        }
43545        return subscription;
43546    }
43547    _getNow() {
43548        return (this.scheduler || _scheduler_queue__WEBPACK_IMPORTED_MODULE_1__["queue"]).now();
43549    }
43550    _trimBufferThenGetEvents() {
43551        const now = this._getNow();
43552        const _bufferSize = this._bufferSize;
43553        const _windowTime = this._windowTime;
43554        const _events = this._events;
43555        const eventsCount = _events.length;
43556        let spliceCount = 0;
43557        while (spliceCount < eventsCount) {
43558            if ((now - _events[spliceCount].time) < _windowTime) {
43559                break;
43560            }
43561            spliceCount++;
43562        }
43563        if (eventsCount > _bufferSize) {
43564            spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
43565        }
43566        if (spliceCount > 0) {
43567            _events.splice(0, spliceCount);
43568        }
43569        return _events;
43570    }
43571}
43572class ReplayEvent {
43573    constructor(time, value) {
43574        this.time = time;
43575        this.value = value;
43576    }
43577}
43578//# sourceMappingURL=ReplaySubject.js.map
43579
43580/***/ }),
43581
43582/***/ "kJWO":
43583/*!******************************************************************!*\
43584  !*** ./node_modules/rxjs/_esm2015/internal/symbol/observable.js ***!
43585  \******************************************************************/
43586/*! exports provided: observable */
43587/***/ (function(module, __webpack_exports__, __webpack_require__) {
43588
43589"use strict";
43590__webpack_require__.r(__webpack_exports__);
43591/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return observable; });
43592const observable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();
43593//# sourceMappingURL=observable.js.map
43594
43595/***/ }),
43596
43597/***/ "kU1M":
43598/*!*******************************************************!*\
43599  !*** ./node_modules/rxjs/_esm2015/operators/index.js ***!
43600  \*******************************************************/
43601/*! exports provided: audit, auditTime, buffer, bufferCount, bufferTime, bufferToggle, bufferWhen, catchError, combineAll, combineLatest, concat, concatAll, concatMap, concatMapTo, count, debounce, debounceTime, defaultIfEmpty, delay, delayWhen, dematerialize, distinct, distinctUntilChanged, distinctUntilKeyChanged, elementAt, endWith, every, exhaust, exhaustMap, expand, filter, finalize, find, findIndex, first, groupBy, ignoreElements, isEmpty, last, map, mapTo, materialize, max, merge, mergeAll, mergeMap, flatMap, mergeMapTo, mergeScan, min, multicast, observeOn, onErrorResumeNext, pairwise, partition, pluck, publish, publishBehavior, publishLast, publishReplay, race, reduce, repeat, repeatWhen, retry, retryWhen, refCount, sample, sampleTime, scan, sequenceEqual, share, shareReplay, single, skip, skipLast, skipUntil, skipWhile, startWith, subscribeOn, switchAll, switchMap, switchMapTo, take, takeLast, takeUntil, takeWhile, tap, throttle, throttleTime, throwIfEmpty, timeInterval, timeout, timeoutWith, timestamp, toArray, window, windowCount, windowTime, windowToggle, windowWhen, withLatestFrom, zip, zipAll */
43602/***/ (function(module, __webpack_exports__, __webpack_require__) {
43603
43604"use strict";
43605__webpack_require__.r(__webpack_exports__);
43606/* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../internal/operators/audit */ "tnsW");
43607/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__["audit"]; });
43608
43609/* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internal/operators/auditTime */ "3UWI");
43610/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__["auditTime"]; });
43611
43612/* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal/operators/buffer */ "p9/F");
43613/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__["buffer"]; });
43614
43615/* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../internal/operators/bufferCount */ "9M8c");
43616/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__["bufferCount"]; });
43617
43618/* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../internal/operators/bufferTime */ "OsX3");
43619/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__["bufferTime"]; });
43620
43621/* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../internal/operators/bufferToggle */ "FD9M");
43622/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__["bufferToggle"]; });
43623
43624/* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../internal/operators/bufferWhen */ "PfrF");
43625/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__["bufferWhen"]; });
43626
43627/* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../internal/operators/catchError */ "JIr8");
43628/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__["catchError"]; });
43629
43630/* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../internal/operators/combineAll */ "7wxJ");
43631/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__["combineAll"]; });
43632
43633/* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../internal/operators/combineLatest */ "fFD9");
43634/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__["combineLatest"]; });
43635
43636/* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../internal/operators/concat */ "f29J");
43637/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__["concat"]; });
43638
43639/* harmony import */ var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../internal/operators/concatAll */ "0EUg");
43640/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__["concatAll"]; });
43641
43642/* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../internal/operators/concatMap */ "bOdf");
43643/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__["concatMap"]; });
43644
43645/* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../internal/operators/concatMapTo */ "q7zd");
43646/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__["concatMapTo"]; });
43647
43648/* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../internal/operators/count */ "HrJb");
43649/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "count", function() { return _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__["count"]; });
43650
43651/* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../internal/operators/debounce */ "6eBy");
43652/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__["debounce"]; });
43653
43654/* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../internal/operators/debounceTime */ "Kj3r");
43655/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__["debounceTime"]; });
43656
43657/* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../internal/operators/defaultIfEmpty */ "xbPD");
43658/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__["defaultIfEmpty"]; });
43659
43660/* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../internal/operators/delay */ "3E0/");
43661/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__["delay"]; });
43662
43663/* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../internal/operators/delayWhen */ "coGc");
43664/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__["delayWhen"]; });
43665
43666/* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../internal/operators/dematerialize */ "kgNN");
43667/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__["dematerialize"]; });
43668
43669/* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../internal/operators/distinct */ "02Lk");
43670/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__["distinct"]; });
43671
43672/* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../internal/operators/distinctUntilChanged */ "/uUt");
43673/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__["distinctUntilChanged"]; });
43674
43675/* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../internal/operators/distinctUntilKeyChanged */ "PZkE");
43676/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__["distinctUntilKeyChanged"]; });
43677
43678/* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../internal/operators/elementAt */ "9ihq");
43679/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__["elementAt"]; });
43680
43681/* harmony import */ var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../internal/operators/endWith */ "0Pi8");
43682/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__["endWith"]; });
43683
43684/* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../internal/operators/every */ "Gi4w");
43685/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__["every"]; });
43686
43687/* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../internal/operators/exhaust */ "zt7V");
43688/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__["exhaust"]; });
43689
43690/* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../internal/operators/exhaustMap */ "XqQ8");
43691/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__["exhaustMap"]; });
43692
43693/* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../internal/operators/expand */ "FQpF");
43694/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__["expand"]; });
43695
43696/* harmony import */ var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../internal/operators/filter */ "pLZG");
43697/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__["filter"]; });
43698
43699/* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../internal/operators/finalize */ "nYR2");
43700/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__["finalize"]; });
43701
43702/* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../internal/operators/find */ "cBqT");
43703/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__["find"]; });
43704
43705/* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../internal/operators/findIndex */ "K7De");
43706/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__["findIndex"]; });
43707
43708/* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../internal/operators/first */ "SxV6");
43709/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__["first"]; });
43710
43711/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../internal/operators/groupBy */ "OQgR");
43712/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__["groupBy"]; });
43713
43714/* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../internal/operators/ignoreElements */ "4A3s");
43715/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__["ignoreElements"]; });
43716
43717/* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../internal/operators/isEmpty */ "m2j4");
43718/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__["isEmpty"]; });
43719
43720/* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../internal/operators/last */ "NJ9Y");
43721/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__["last"]; });
43722
43723/* harmony import */ var _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../internal/operators/map */ "lJxs");
43724/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__["map"]; });
43725
43726/* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../internal/operators/mapTo */ "CqXF");
43727/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__["mapTo"]; });
43728
43729/* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../internal/operators/materialize */ "dkDA");
43730/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__["materialize"]; });
43731
43732/* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../internal/operators/max */ "yI9Y");
43733/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__["max"]; });
43734
43735/* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../internal/operators/merge */ "q92s");
43736/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__["merge"]; });
43737
43738/* harmony import */ var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../internal/operators/mergeAll */ "bHdf");
43739/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__["mergeAll"]; });
43740
43741/* harmony import */ var _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../internal/operators/mergeMap */ "5+tZ");
43742/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; });
43743
43744/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["flatMap"]; });
43745
43746/* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ../internal/operators/mergeMapTo */ "UXbc");
43747/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__["mergeMapTo"]; });
43748
43749/* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../internal/operators/mergeScan */ "51Bx");
43750/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__["mergeScan"]; });
43751
43752/* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../internal/operators/min */ "FZB8");
43753/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__["min"]; });
43754
43755/* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ../internal/operators/multicast */ "oB13");
43756/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__["multicast"]; });
43757
43758/* harmony import */ var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ../internal/operators/observeOn */ "pxpQ");
43759/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__["observeOn"]; });
43760
43761/* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ../internal/operators/onErrorResumeNext */ "uTdr");
43762/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__["onErrorResumeNext"]; });
43763
43764/* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ../internal/operators/pairwise */ "Zy1z");
43765/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__["pairwise"]; });
43766
43767/* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ../internal/operators/partition */ "A3iJ");
43768/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__["partition"]; });
43769
43770/* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ../internal/operators/pluck */ "wO+i");
43771/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__["pluck"]; });
43772
43773/* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ../internal/operators/publish */ "NfdI");
43774/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__["publ
43774ish"]; });
43775
43776/* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ../internal/operators/publishBehavior */ "UGaM");
43777/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__["publishBehavior"]; });
43778
43779/* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ../internal/operators/publishLast */ "qZ0a");
43780/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__["publishLast"]; });
43781
43782/* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ../internal/operators/publishReplay */ "05l1");
43783/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__["publishReplay"]; });
43784
43785/* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ../internal/operators/race */ "4f8F");
43786/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__["race"]; });
43787
43788/* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ../internal/operators/reduce */ "128B");
43789/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__["reduce"]; });
43790
43791/* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ../internal/operators/repeat */ "/d8p");
43792/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__["repeat"]; });
43793
43794/* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ../internal/operators/repeatWhen */ "Gqsl");
43795/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__["repeatWhen"]; });
43796
43797/* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ../internal/operators/retry */ "un/a");
43798/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__["retry"]; });
43799
43800/* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ../internal/operators/retryWhen */ "MtjB");
43801/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__["retryWhen"]; });
43802
43803/* harmony import */ var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ../internal/operators/refCount */ "x+ZX");
43804/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__["refCount"]; });
43805
43806/* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ../internal/operators/sample */ "c6ID");
43807/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__["sample"]; });
43808
43809/* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ../internal/operators/sampleTime */ "1Ykd");
43810/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__["sampleTime"]; });
43811
43812/* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ../internal/operators/scan */ "Kqap");
43813/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__["scan"]; });
43814
43815/* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ../internal/operators/sequenceEqual */ "Zyez");
43816/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__["sequenceEqual"]; });
43817
43818/* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ../internal/operators/share */ "w1tV");
43819/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "share", function() { return _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__["share"]; });
43820
43821/* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ../internal/operators/shareReplay */ "UXun");
43822/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__["shareReplay"]; });
43823
43824/* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ../internal/operators/single */ "cx9U");
43825/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "single", function() { return _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__["single"]; });
43826
43827/* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ../internal/operators/skip */ "zP0r");
43828/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__["skip"]; });
43829
43830/* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ../internal/operators/skipLast */ "kagm");
43831/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__["skipLast"]; });
43832
43833/* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ../internal/operators/skipUntil */ "vqkR");
43834/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__["skipUntil"]; });
43835
43836/* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ../internal/operators/skipWhile */ "32Ea");
43837/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__["skipWhile"]; });
43838
43839/* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ../internal/operators/startWith */ "JX91");
43840/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__["startWith"]; });
43841
43842/* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ../internal/operators/subscribeOn */ "tf+s");
43843/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__["subscribeOn"]; });
43844
43845/* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ../internal/operators/switchAll */ "Y6wi");
43846/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__["switchAll"]; });
43847
43848/* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ../internal/operators/switchMap */ "eIep");
43849/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__["switchMap"]; });
43850
43851/* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ../internal/operators/switchMapTo */ "aGrj");
43852/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__["switchMapTo"]; });
43853
43854/* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ../internal/operators/take */ "IzEk");
43855/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__["take"]; });
43856
43857/* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ../internal/operators/takeLast */ "BFxc");
43858/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__["takeLast"]; });
43859
43860/* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ../internal/operators/takeUntil */ "1G5W");
43861/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__["takeUntil"]; });
43862
43863/* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ../internal/operators/takeWhile */ "GJmQ");
43864/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__["takeWhile"]; });
43865
43866/* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ../internal/operators/tap */ "vkgz");
43867/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__["tap"]; });
43868
43869/* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ../internal/operators/throttle */ "yuhW");
43870/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__["throttle"]; });
43871
43872/* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ../internal/operators/throttleTime */ "gcYM");
43873/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__["throttleTime"]; });
43874
43875/* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ../internal/operators/throwIfEmpty */ "XDbj");
43876/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__["throwIfEmpty"]; });
43877
43878/* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ../internal/operators/timeInterval */ "4hIw");
43879/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__["timeInterval"]; });
43880
43881/* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ../internal/operators/timeout */ "tS1D");
43882/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__["timeout"]; });
43883
43884/* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ../internal/operators/timeoutWith */ "syX2");
43885/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__["timeoutWith"]; });
43886
43887/* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ../internal/operators/timestamp */ "r0WS");
43888/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__["timestamp"]; });
43889
43890/* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ../internal/operators/toArray */ "IAdc");
43891/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__["toArray"]; });
43892
43893/* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ../internal/operators/window */ "mk5/");
43894/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__["window"]; });
43895
43896/* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ../internal/operators/windowCount */ "lpKW");
43897/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__["windowCount"]; });
43898
43899/* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ../internal/operators/windowTime */ "UHp3");
43900/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__["windowTime"]; });
43901
43902/* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ../internal/operators/windowToggle */ "sTY7");
43903/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__["windowToggle"]; });
43904
43905/* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ../internal/operators/windowWhen */ "pXlZ");
43906/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__["windowWhen"]; });
43907
43908/* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ../internal/operators/withLatestFrom */ "zp1y");
43909/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__["withLatestFrom"]; });
43910
43911/* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ../internal/operators/zip */ "GjHo");
43912/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__["zip"]; });
43913
43914/* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ../internal/operators/zipAll */ "JmF6");
43915/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__["zipAll"]; });
43916
43917
43918
43919
43920
43921
43922
43923
43924
43925
43926
43927
43928
43929
43930
43931
43932
43933
43934
43935
43936
43937
43938
43939
43940
43941
43942
43943
43944
43945
43946
43947
43948
43949
43950
43951
43952
43953
43954
43955
43956
43957
43958
43959
43960
43961
43962
43963
43964
43965
43966
43967
43968
43969
43970
43971
43972
43973
43974
43975
43976
43977
43978
43979
43980
43981
43982
43983
43984
43985
43986
43987
43988
43989
43990
43991
43992
43993
43994
43995
43996
43997
43998
43999
44000
44001
44002
44003
44004
44005
44006
44007
44008
44009
44010
44011
44012
44013
44014
44015
44016
44017
44018
44019
44020//# sourceMappingURL=index.js.map
44021
44022/***/ }),
44023
44024/***/ "kagm":
44025/*!*******************************************************************!*\
44026  !*** ./node_modules/rxjs/_esm2015/internal/operators/skipLast.js ***!
44027  \*******************************************************************/
44028/*! exports provided: skipLast */
44029/***/ (function(module, __webpack_exports__, __webpack_require__) {
44030
44031"use strict";
44032__webpack_require__.r(__webpack_exports__);
44033/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return skipLast; });
44034/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
44035/* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ "4I5i");
44036
44037
44038function skipLast(count) {
44039    return (source) => source.lift(new SkipLastOperator(count));
44040}
44041class SkipLastOperator {
44042    constructor(_skipCount) {
44043        this._skipCount = _skipCount;
44044        if (this._skipCount < 0) {
44045            throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__["ArgumentOutOfRangeError"];
44046        }
44047    }
44048    call(subscriber, source) {
44049        if (this._skipCount === 0) {
44050            return source.subscribe(new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](subscriber));
44051        }
44052        else {
44053            return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));
44054        }
44055    }
44056}
44057class SkipLastSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
44058    constructor(destination, _skipCount) {
44059        super(destination);
44060        this._skipCount = _skipCount;
44061        this._count = 0;
44062        this._ring = new Array(_skipCount);
44063    }
44064    _next(value) {
44065        const skipCount = this._skipCount;
44066        const count = this._count++;
44067        if (count < skipCount) {
44068            this._ring[count] = value;
44069        }
44070        else {
44071            const currentIndex = count % skipCount;
44072            const ring = this._ring;
44073            const oldValue = ring[currentIndex];
44074            ring[currentIndex] = value;
44075            this.destination.next(oldValue);
44076        }
44077    }
44078}
44079//# sourceMappingURL=skipLast.js.map
44080
44081/***/ }),
44082
44083/***/ "kgNN":
44084/*!************************************************************************!*\
44085  !*** ./node_modules/rxjs/_esm2015/internal/operators/dematerialize.js ***!
44086  \************************************************************************/
44087/*! exports provided: dematerialize */
44088/***/ (function(module, __webpack_exports__, __webpack_require__) {
44089
44090"use strict";
44091__webpack_require__.r(__webpack_exports__);
44092/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return dematerialize; });
44093/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
44094
44095function dematerialize() {
44096    return function dematerializeOperatorFunction(source) {
44097        return source.lift(new DeMaterializeOperator());
44098    };
44099}
44100class DeMaterializeOperator {
44101    call(subscriber, source) {
44102        return source.subscribe(new DeMaterializeSubscriber(subscriber));
44103    }
44104}
44105class DeMaterializeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
44106    constructor(destination) {
44107        super(destination);
44108    }
44109    _next(value) {
44110        value.observe(this.destination);
44111    }
44112}
44113//# sourceMappingURL=dematerialize.js.map
44114
44115/***/ }),
44116
44117/***/ "l5mm":
44118/*!********************************************************************!*\
44119  !*** ./node_modules/rxjs/_esm2015/internal/observable/interval.js ***!
44120  \********************************************************************/
44121/*! exports provided: interval */
44122/***/ (function(module, __webpack_exports__, __webpack_require__) {
44123
44124"use strict";
44125__webpack_require__.r(__webpack_exports__);
44126/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return interval; });
44127/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
44128/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
44129/* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isNumeric */ "Y7HM");
44130
44131
44132
44133function interval(period = 0, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]) {
44134    if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(period) || period < 0) {
44135        period = 0;
44136    }
44137    if (!scheduler || typeof scheduler.schedule !== 'function') {
44138        scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
44139    }
44140    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
44141        subscriber.add(scheduler.schedule(dispatch, period, { subscriber, counter: 0, period }));
44142        return subscriber;
44143    });
44144}
44145function dispatch(state) {
44146    const { subscriber, counter, period } = state;
44147    subscriber.next(counter);
44148    this.schedule({ subscriber, counter: counter + 1, period }, period);
44149}
44150//# sourceMappingURL=interval.js.map
44151
44152/***/ }),
44153
44154/***/ "l7GE":
44155/*!****************************************************************!*\
44156  !*** ./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js ***!
44157  \****************************************************************/
44158/*! exports provided: OuterSubscriber */
44159/***/ (function(module, __webpack_exports__, __webpack_require__) {
44160
44161"use strict";
44162__webpack_require__.r(__webpack_exports__);
44163/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OuterSubscriber", function() { return OuterSubscriber; });
44164/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ "7o/Q");
44165
44166class OuterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
44167    notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {
44168        this.destination.next(innerValue);
44169    }
44170    notifyError(error, innerSub) {
44171        this.destination.error(error);
44172    }
44173    notifyComplete(innerSub) {
44174        this.destination.complete();
44175    }
44176}
44177//# sourceMappingURL=OuterSubscriber.js.map
44178
44179/***/ }),
44180
44181/***/ "lJxs":
44182/*!**************************************************************!*\
44183  !*** ./node_modules/rxjs/_esm2015/internal/operators/map.js ***!
44184  \**************************************************************/
44185/*! exports provided: map, MapOperator */
44186/***/ (function(module, __webpack_exports__, __webpack_require__) {
44187
44188"use strict";
44189__webpack_require__.r(__webpack_exports__);
44190/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; });
44191/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MapOperator", function() { return MapOperator; });
44192/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
44193
44194function map(project, thisArg) {
44195    return function mapOperation(source) {
44196        if (typeof project !== 'function') {
44197            throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
44198        }
44199        return source.lift(new MapOperator(project, thisArg));
44200    };
44201}
44202class MapOperator {
44203    constructor(project, thisArg) {
44204        this.project = project;
44205        this.thisArg = thisArg;
44206    }
44207    call(subscriber, source) {
44208        return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
44209    }
44210}
44211class MapSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
44212    constructor(destination, project, thisArg) {
44213        super(destination);
44214        this.project = project;
44215        this.count = 0;
44216        this.thisArg = thisArg || this;
44217    }
44218    _next(value) {
44219        let result;
44220        try {
44221            result = this.project.call(this.thisArg, value, this.count++);
44222        }
44223        catch (err) {
44224            this.destination.error(err);
44225            return;
44226        }
44227        this.destination.next(result);
44228    }
44229}
44230//# sourceMappingURL=map.js.map
44231
44232/***/ }),
44233
44234/***/ "lpKW":
44235/*!**********************************************************************!*\
44236  !*** ./node_modules/rxjs/_esm2015/internal/operators/windowCount.js ***!
44237  \**********************************************************************/
44238/*! exports provided: windowCount */
44239/***/ (function(module, __webpack_exports__, __webpack_require__) {
44240
44241"use strict";
44242__webpack_require__.r(__webpack_exports__);
44243/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return windowCount; });
44244/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
44245/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ "XNiG");
44246
44247
44248function windowCount(windowSize, startWindowEvery = 0) {
44249    return function windowCountOperatorFunction(source) {
44250        return source.lift(new WindowCountOperator(windowSize, startWindowEvery));
44251    };
44252}
44253class WindowCountOperator {
44254    constructor(windowSize, startWindowEvery) {
44255        this.windowSize = windowSize;
44256        this.startWindowEvery = startWindowEvery;
44257    }
44258    call(subscriber, source) {
44259        return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));
44260    }
44261}
44262class WindowCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
44263    constructor(destination, windowSize, startWindowEvery) {
44264        super(destination);
44265        this.destination = destination;
44266        this.windowSize = windowSize;
44267        this.startWindowEvery = startWindowEvery;
44268        this.windows = [new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]()];
44269        this.count = 0;
44270        destination.next(this.windows[0]);
44271    }
44272    _next(value) {
44273        const startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;
44274        const destination = this.destination;
44275        const windowSize = this.windowSize;
44276        const windows = this.windows;
44277        const len = windows.length;
44278        for (let i = 0; i < len && !this.closed; i++) {
44279            windows[i].next(value);
44280        }
44281        const c = this.count - windowSize + 1;
44282        if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {
44283            windows.shift().complete();
44284        }
44285        if (++this.count % startWindowEvery === 0 && !this.closed) {
44286            const window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"]();
44287            windows.push(window);
44288            destination.next(window);
44289        }
44290    }
44291    _error(err) {
44292        const windows = this.windows;
44293        if (windows) {
44294            while (windows.length > 0 && !this.closed) {
44295                windows.shift().error(err);
44296            }
44297        }
44298        this.destination.error(err);
44299    }
44300    _complete() {
44301        const windows = this.windows;
44302        if (windows) {
44303            while (windows.length > 0 && !this.closed) {
44304                windows.shift().complete();
44305            }
44306        }
44307        this.destination.complete();
44308    }
44309    _unsubscribe() {
44310        this.count = 0;
44311        this.windows = null;
44312    }
44313}
44314//# sourceMappingURL=windowCount.js.map
44315
44316/***/ }),
44317
44318/***/ "m2j4":
44319/*!******************************************************************!*\
44320  !*** ./node_modules/rxjs/_esm2015/internal/operators/isEmpty.js ***!
44321  \******************************************************************/
44322/*! exports provided: isEmpty */
44323/***/ (function(module, __webpack_exports__, __webpack_require__) {
44324
44325"use strict";
44326__webpack_require__.r(__webpack_exports__);
44327/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return isEmpty; });
44328/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
44329
44330function isEmpty() {
44331    return (source) => source.lift(new IsEmptyOperator());
44332}
44333class IsEmptyOperator {
44334    call(observer, source) {
44335        return source.subscribe(new IsEmptySubscriber(observer));
44336    }
44337}
44338class IsEmptySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
44339    constructor(destination) {
44340        super(destination);
44341    }
44342    notifyComplete(isEmpty) {
44343        const destination = this.destination;
44344        destination.next(isEmpty);
44345        destination.complete();
44346    }
44347    _next(value) {
44348        this.notifyComplete(false);
44349    }
44350    _complete() {
44351        this.notifyComplete(true);
44352    }
44353}
44354//# sourceMappingURL=isEmpty.js.map
44355
44356/***/ }),
44357
44358/***/ "mCNh":
44359/*!**********************************************************!*\
44360  !*** ./node_modules/rxjs/_esm2015/internal/util/pipe.js ***!
44361  \**********************************************************/
44362/*! exports provided: pipe, pipeFromArray */
44363/***/ (function(module, __webpack_exports__, __webpack_require__) {
44364
44365"use strict";
44366__webpack_require__.r(__webpack_exports__);
44367/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return pipe; });
44368/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipeFromArray", function() { return pipeFromArray; });
44369/* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity */ "SpAZ");
44370
44371function pipe(...fns) {
44372    return pipeFromArray(fns);
44373}
44374function pipeFromArray(fns) {
44375    if (fns.length === 0) {
44376        return _identity__WEBPACK_IMPORTED_MODULE_0__["identity"];
44377    }
44378    if (fns.length === 1) {
44379        return fns[0];
44380    }
44381    return function piped(input) {
44382        return fns.reduce((prev, fn) => fn(prev), input);
44383    };
44384}
44385//# sourceMappingURL=pipe.js.map
44386
44387/***/ }),
44388
44389/***/ "mk5/":
44390/*!*****************************************************************!*\
44391  !*** ./node_modules/rxjs/_esm2015/internal/operators/window.js ***!
44392  \*****************************************************************/
44393/*! exports provided: window */
44394/***/ (function(module, __webpack_exports__, __webpack_require__) {
44395
44396"use strict";
44397__webpack_require__.r(__webpack_exports__);
44398/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return window; });
44399/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "XNiG");
44400/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
44401
44402
44403function window(windowBoundaries) {
44404    return function windowOperatorFunction(source) {
44405        return source.lift(new WindowOperator(windowBoundaries));
44406    };
44407}
44408class WindowOperator {
44409    constructor(windowBoundaries) {
44410        this.windowBoundaries = windowBoundaries;
44411    }
44412    call(subscriber, source) {
44413        const windowSubscriber = new WindowSubscriber(subscriber);
44414        const sourceSubscription = source.subscribe(windowSubscriber);
44415        if (!sourceSubscription.closed) {
44416            windowSubscriber.add(Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["innerSubscribe"])(this.windowBoundaries, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["SimpleInnerSubscriber"](windowSubscriber)));
44417        }
44418        return sourceSubscription;
44419    }
44420}
44421class WindowSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_1__["SimpleOuterSubscriber"] {
44422    constructor(destination) {
44423        super(destination);
44424        this.window = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
44425        destination.next(this.window);
44426    }
44427    notifyNext() {
44428        this.openWindow();
44429    }
44430    notifyError(error) {
44431        this._error(error);
44432    }
44433    notifyComplete() {
44434        this._complete();
44435    }
44436    _next(value) {
44437        this.window.next(value);
44438    }
44439    _error(err) {
44440        this.window.error(err);
44441        this.destination.error(err);
44442    }
44443    _complete() {
44444        this.window.complete();
44445        this.destination.complete();
44446    }
44447    _unsubscribe() {
44448        this.window = null;
44449    }
44450    openWindow() {
44451        const prevWindow = this.window;
44452        if (prevWindow) {
44453            prevWindow.complete();
44454        }
44455        const destination = this.destination;
44456        const newWindow = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
44457        destination.next(newWindow);
44458    }
44459}
44460//# sourceMappingURL=window.js.map
44461
44462/***/ }),
44463
44464/***/ "mlxB":
44465/*!************************************************************!*\
44466  !*** ./node_modules/rxjs/_esm2015/internal/util/isDate.js ***!
44467  \************************************************************/
44468/*! exports provided: isDate */
44469/***/ (function(module, __webpack_exports__, __webpack_require__) {
44470
44471"use strict";
44472__webpack_require__.r(__webpack_exports__);
44473/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return isDate; });
44474function isDate(value) {
44475    return value instanceof Date && !isNaN(+value);
44476}
44477//# sourceMappingURL=isDate.js.map
44478
44479/***/ }),
44480
44481/***/ "n6bG":
44482/*!****************************************************************!*\
44483  !*** ./node_modules/rxjs/_esm2015/internal/util/isFunction.js ***!
44484  \****************************************************************/
44485/*! exports provided: isFunction */
44486/***/ (function(module, __webpack_exports__, __webpack_require__) {
44487
44488"use strict";
44489__webpack_require__.r(__webpack_exports__);
44490/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; });
44491function isFunction(x) {
44492    return typeof x === 'function';
44493}
44494//# sourceMappingURL=isFunction.js.map
44495
44496/***/ }),
44497
44498/***/ "nYR2":
44499/*!*******************************************************************!*\
44500  !*** ./node_modules/rxjs/_esm2015/internal/operators/finalize.js ***!
44501  \*******************************************************************/
44502/*! exports provided: finalize */
44503/***/ (function(module, __webpack_exports__, __webpack_require__) {
44504
44505"use strict";
44506__webpack_require__.r(__webpack_exports__);
44507/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return finalize; });
44508/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
44509/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "quSY");
44510
44511
44512function finalize(callback) {
44513    return (source) => source.lift(new FinallyOperator(callback));
44514}
44515class FinallyOperator {
44516    constructor(callback) {
44517        this.callback = callback;
44518    }
44519    call(subscriber, source) {
44520        return source.subscribe(new FinallySubscriber(subscriber, this.callback));
44521    }
44522}
44523class FinallySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
44524    constructor(destination, callback) {
44525        super(destination);
44526        this.add(new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](callback));
44527    }
44528}
44529//# sourceMappingURL=finalize.js.map
44530
44531/***/ }),
44532
44533/***/ "ngJS":
44534/*!**********************************************************************!*\
44535  !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToArray.js ***!
44536  \**********************************************************************/
44537/*! exports provided: subscribeToArray */
44538/***/ (function(module, __webpack_exports__, __webpack_require__) {
44539
44540"use strict";
44541__webpack_require__.r(__webpack_exports__);
44542/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToArray", function() { return subscribeToArray; });
44543const subscribeToArray = (array) => (subscriber) => {
44544    for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) {
44545        subscriber.next(array[i]);
44546    }
44547    subscriber.complete();
44548};
44549//# sourceMappingURL=subscribeToArray.js.map
44550
44551/***/ }),
44552
44553/***/ "oB13":
44554/*!********************************************************************!*\
44555  !*** ./node_modules/rxjs/_esm2015/internal/operators/multicast.js ***!
44556  \********************************************************************/
44557/*! exports provided: multicast, MulticastOperator */
44558/***/ (function(module, __webpack_exports__, __webpack_require__) {
44559
44560"use strict";
44561__webpack_require__.r(__webpack_exports__);
44562/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return multicast; });
44563/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MulticastOperator", function() { return MulticastOperator; });
44564/* harmony import */ var _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/ConnectableObservable */ "EQ5u");
44565
44566function multicast(subjectOrSubjectFactory, selector) {
44567    return function multicastOperatorFunction(source) {
44568        let subjectFactory;
44569        if (typeof subjectOrSubjectFactory === 'function') {
44570            subjectFactory = subjectOrSubjectFactory;
44571        }
44572        else {
44573            subjectFactory = function subjectFactory() {
44574                return subjectOrSubjectFactory;
44575            };
44576        }
44577        if (typeof selector === 'function') {
44578            return source.lift(new MulticastOperator(subjectFactory, selector));
44579        }
44580        const connectable = Object.c
44580reate(source, _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__["connectableObservableDescriptor"]);
44581        connectable.source = source;
44582        connectable.subjectFactory = subjectFactory;
44583        return connectable;
44584    };
44585}
44586class MulticastOperator {
44587    constructor(subjectFactory, selector) {
44588        this.subjectFactory = subjectFactory;
44589        this.selector = selector;
44590    }
44591    call(subscriber, source) {
44592        const { selector } = this;
44593        const subject = this.subjectFactory();
44594        const subscription = selector(subject).subscribe(subscriber);
44595        subscription.add(source.subscribe(subject));
44596        return subscription;
44597    }
44598}
44599//# sourceMappingURL=multicast.js.map
44600
44601/***/ }),
44602
44603/***/ "ofXK":
44604/*!**********************************************************************!*\
44605  !*** ./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js ***!
44606  \**********************************************************************/
44607/*! exports provided: APP_BASE_HREF, AsyncPipe, CommonModule, CurrencyPipe, DOCUMENT, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, LOCATION_INITIALIZED, Location, LocationStrategy, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PathLocationStrategy, PercentPipe, PlatformLocation, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, VERSION, ViewportScroller, WeekDay, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getL
44607ocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits, isPlatformBrowser, isPlatformServer, isPlatformWorkerApp, isPlatformWorkerUi, registerLocaleData, ɵBrowserPlatformLocation, ɵDomAdapter, ɵNullViewportScroller, ɵPLATFORM_BROWSER_ID, ɵPLATFORM_SERVER_ID, ɵPLATFORM_WORKER_APP_ID, ɵPLATFORM_WORKER_UI_ID, ɵangular_packages_common_common_a, ɵangular_packages_common_common_b, ɵangular_packages_common_common_c, ɵangular_packages_common_common_d, ɵangular_packages_common_common_e, ɵangular_packages_common_common_f, ɵgetDOM, ɵparseCookieValue, ɵsetRootDomAdapter */
44608/***/ (function(module, __webpack_exports__, __webpack_require__) {
44609
44610"use strict";
44611__webpack_require__.r(__webpack_exports__);
44612/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APP_BASE_HREF", function() { return APP_BASE_HREF; });
44613/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncPipe", function() { return AsyncPipe; });
44614/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommonModule", function() { return CommonModule; });
44615/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CurrencyPipe", function() { return CurrencyPipe; });
44616/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOCUMENT", function() { return DOCUMENT; });
44617/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DatePipe", function() { return DatePipe; });
44618/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecimalPipe", function() { return DecimalPipe; });
44619/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormStyle", function() { return FormStyle; });
44620/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormatWidth", function() { return FormatWidth; });
44621/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HashLocationStrategy", function() { return HashLocationStrategy; });
44622/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I18nPluralPipe", function() { return I18nPluralPipe; });
44623/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I18nSelectPipe", function() { return I18nSelectPipe; });
44624/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonPipe", function() { return JsonPipe; });
44625/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyValuePipe", function() { return KeyValuePipe; });
44626/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOCATION_INITIALIZED", function() { return LOCATION_INITIALIZED; });
44627/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; });
44628/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationStrategy", function() { return LocationStrategy; });
44629/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LowerCasePipe", function() { return LowerCasePipe; });
44630/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgClass", function() { return NgClass; });
44631/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgComponentOutlet", function() { return NgComponentOutlet; });
44632/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgForOf", function() { return NgForOf; });
44633/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgForOfContext", function() { return NgForOfContext; });
44634/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgIf", function() { return NgIf; });
44635/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgIfContext", function() { return NgIfContext; });
44636/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgLocaleLocalization", function() { return NgLocaleLocalization; });
44637/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgLocalization", function() { return NgLocalization; });
44638/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgPlural", function() { return NgPlural; });
44639/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgPluralCase", function() { return NgPluralCase; });
44640/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgStyle", function() { return NgStyle; });
44641/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitch", function() { return NgSwitch; });
44642/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitchCase", function() { return NgSwitchCase; });
44643/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSwitchDefault", function() { return NgSwitchDefault; });
44644/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgTemplateOutlet", function() { return NgTemplateOutlet; });
44645/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberFormatStyle", function() { return NumberFormatStyle; });
44646/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberSymbol", function() { return NumberSymbol; });
44647/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathLocationStrategy", function() { return PathLocationStrategy; });
44648/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PercentPipe", function() { return PercentPipe; });
44649/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlatformLocation", function() { return PlatformLocation; });
44650/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plural", function() { return Plural; });
44651/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SlicePipe", function() { return SlicePipe; });
44652/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TitleCasePipe", function() { return TitleCasePipe; });
44653/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TranslationWidth", function() { return TranslationWidth; });
44654/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
44654UpperCasePipe", function() { return UpperCasePipe; });
44655/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
44656/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewportScroller", function() { return ViewportScroller; });
44657/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WeekDay", function() { return WeekDay; });
44658/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatCurrency", function() { return formatCurrency; });
44659/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDate", function() { return formatDate; });
44660/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatNumber", function() { return formatNumber; });
44661/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatPercent", function() { return formatPercent; });
44662/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrencySymbol", function() { return getCurrencySymbol; });
44663/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleCurrencyCode", function() { return getLocaleCurrencyCode; });
44664/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleCurrencyName", function() { return getLocaleCurrencyName; });
44665/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleCurrencySymbol", function() { return getLocaleCurrencySymbol; });
44666/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDateFormat", function() { return getLocaleDateFormat; });
44667/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDateTimeFormat", function() { return getLocaleDateTimeFormat; });
44668/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDayNames", function() { return getLocaleDayNames; });
44669/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDayPeriods", function() { return getLocaleDayPeriods; });
44670/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleDirection", function() { return getLocaleDirection; });
44671/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleEraNames", function() { return getLocaleEraNames; });
44672/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleExtraDayPeriodRules", function() { return getLocaleExtraDayPeriodRules; });
44673/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleExtraDayPeriods", function() { return getLocaleExtraDayPeriods; });
44674/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleFirstDayOfWeek", function() { return getLocaleFirstDayOfWeek; });
44675/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleId", function() { return getLocaleId; });
44676/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleMonthNames", function() { return getLocaleMonthNames; });
44677/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleNumberFormat", function() { return getLocaleNumberFormat; });
44678/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleNumberSymbol", function() { return getLocaleNumberSymbol; });
44679/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalePluralCase", function() { return getLocalePluralCase; });
44680/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleTimeFormat", function() { return getLocaleTimeFormat; });
44681/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocaleWeekEndRange", function() { return getLocaleWeekEndRange; });
44682/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNumberOfCurrencyDigits", function() { return getNumberOfCurrencyDigits; });
44683/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformBrowser", function() { return isPlatformBrowser; });
44684/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformServer", function() { return isPlatformServer; });
44685/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformWorkerApp", function() { return isPlatformWorkerApp; });
44686/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPlatformWorkerUi", function() { return isPlatformWorkerUi; });
44687/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerLocaleData", function() { return registerLocaleData; });
44688/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵBrowserPlatformLocation", function() { return BrowserPlatformLocation; });
44689/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵDomAdapter", function() { return DomAdapter; });
44690/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵNullViewportScroller", function() { return NullViewportScroller; });
44691/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_BROWSER_ID", function() { return PLATFORM_BROWSER_ID; });
44692/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_SERVER_ID", function() { return PLATFORM_SERVER_ID; });
44693/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_WORKER_APP_ID", function() { return PLATFORM_WORKER_APP_ID; });
44694/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵPLATFORM_WORKER_UI_ID", function() { return PLATFORM_WORKER_UI_ID; });
44695/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_a", function() { return useBrowserPlatformLocation; });
44696/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_b", function() { return createBrowserPlatformLocation; });
44697/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_c", function() { return createLocation; });
44698/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_d", function() { return provideLocationStrategy; });
44699/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_e", function() { return COMMON_DIRECTIVES; });
44700/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_common_common_f", function() { return COMMON_PIPES; });
44701/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵgetDOM", function() { return getDOM; });
44702/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵparseCookieValue", function() { return parseCookieValue; });
44703/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵsetRootDomAdapter", function() { return setRootDomAdapter; });
44704/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "fXoL");
44705/**
44706 * @license Angular v11.2.11
44707 * (c) 2010-2021 Google LLC. https://angular.io/
44708 * License: MIT
44709 */
44710
44711
44712
44713/**
44714 * @license
44715 * Copyright Google LLC All Rights Reserved.
44716 *
44717 * Use of this source code is governed by an MIT-style license that can be
44718 * found in the LICENSE file at https://angular.io/license
44719 */
44720
44721let _DOM = null;
44722function getDOM() {
44723    return _DOM;
44724}
44725function setDOM(adapter) {
44726    _DOM = adapter;
44727}
44728function setRootDomAdapter(adapter) {
44729    if (!_DOM) {
44730        _DOM = adapter;
44731    }
44732}
44733/* tslint:disable:requireParameterType */
44734/**
44735 * Provides DOM operations in an environment-agnostic way.
44736 *
44737 * @security Tread carefully! Interacting with the DOM directly is dangerous and
44738 * can introduce XSS risks.
44739 */
44740class DomAdapter {
44741}
44742
44743/**
44744 * @license
44745 * Copyright Google LLC All Rights Reserved.
44746 *
44747 * Use of this source code is governed by an MIT-style license that can be
44748 * found in the LICENSE file at https://angular.io/license
44749 */
44750/**
44751 * A DI Token representing the main rendering context. In a browser this is the DOM Document.
44752 *
44753 * Note: Document might not be available in the Application Context when Application and Rendering
44754 * Contexts are not the same (e.g. when running the application in a Web Worker).
44755 *
44756 * @publicApi
44757 */
44758const DOCUMENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('DocumentToken');
44759
44760/**
44761 * @license
44762 * Copyright Google LLC All Rights Reserved.
44763 *
44764 * Use of this source code is governed by an MIT-style license that can be
44765 * found in the LICENSE file at https://angular.io/license
44766 */
44767/**
44768 * This class should not be used directly by an application developer. Instead, use
44769 * {@link Location}.
44770 *
44771 * `PlatformLocation` encapsulates all calls to DOM APIs, which allows the Router to be
44772 * platform-agnostic.
44773 * This means that we can have different implementation of `PlatformLocation` for the different
44774 * platforms that Angular supports. For example, `@angular/platform-browser` provides an
44775 * implementation specific to the browser environment, while `@angular/platform-server` provides
44776 * one suitable for use with server-side rendering.
44777 *
44778 * The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy}
44779 * when they need to interact with the DOM APIs like pushState, popState, etc.
44780 *
44781 * {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly
44782 * by the {@link Router} in order to navigate between routes. Since all interactions between {@link
44783 * Router} /
44784 * {@link Location} / {@link LocationStrategy} and DOM APIs flow through the `PlatformLocation`
44785 * class, they are all platform-agnostic.
44786 *
44787 * @publicApi
44788 */
44789class PlatformLocation {
44790}
44791PlatformLocation.ɵfac = function PlatformLocation_Factory(t) { return new (t || PlatformLocation)(); };
44792PlatformLocation.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ factory: useBrowserPlatformLocation, token: PlatformLocation, providedIn: "platform" });
44793(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PlatformLocation, [{
44794        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
44795        args: [{
44796                providedIn: 'platform',
44797                // See #23917
44798                useFactory: useBrowserPlatformLocation
44799            }]
44800    }], null, null); })();
44801function useBrowserPlatformLocation() {
44802    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(BrowserPlatformLocation);
44803}
44804/**
44805 * @description
44806 * Indicates when a location is initialized.
44807 *
44808 * @publicApi
44809 */
44810const LOCATION_INITIALIZED = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('Location Initialized');
44811/**
44812 * `PlatformLocation` encapsulates all of the direct calls to platform APIs.
44813 * This class should not be used directly by an application developer. Instead, use
44814 * {@link Location}.
44815 */
44816class BrowserPlatformLocation extends PlatformLocation {
44817    constructor(_doc) {
44818        super();
44819        this._doc = _doc;
44820        this._init();
44821    }
44822    // This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it
44823    /** @internal */
44824    _init() {
44825        this.location = getDOM().getLocation();
44826        this._history = getDOM().getHistory();
44827    }
44828    getBaseHrefFromDOM() {
44829        return getDOM().getBaseHref(this._doc);
44830    }
44831    onPopState(fn) {
44832        getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('popstate', fn, false);
44833    }
44834    onHashChange(fn) {
44835        getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false);
44836    }
44837    get href() {
44838        return this.location.href;
44839    }
44840    get protocol() {
44841        return this.location.protocol;
44842    }
44843    get hostname() {
44844        return this.location.hostname;
44845    }
44846    get port() {
44847        return this.location.port;
44848    }
44849    get pathname() {
44850        return this.location.pathname;
44851    }
44852    get search() {
44853        return this.location.search;
44854    }
44855    get hash() {
44856        return this.location.hash;
44857    }
44858    set pathname(newPath) {
44859        this.location.pathname = newPath;
44860    }
44861    pushState(state, title, url) {
44862        if (supportsState()) {
44863            this._history.pushState(state, title, url);
44864        }
44865        else {
44866            this.location.hash = url;
44867        }
44868    }
44869    replaceState(state, title, url) {
44870        if (supportsState()) {
44871            this._history.replaceState(state, title, url);
44872        }
44873        else {
44874            this.location.hash = url;
44875        }
44876    }
44877    forward() {
44878        this._history.forward();
44879    }
44880    back() {
44881        this._history.back();
44882    }
44883    getState() {
44884        return this._history.state;
44885    }
44886}
44887BrowserPlatformLocation.ɵfac = function BrowserPlatformLocation_Factory(t) { return new (t || BrowserPlatformLocation)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](DOCUMENT)); };
44888BrowserPlatformLocation.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ factory: createBrowserPlatformLocation, token: BrowserPlatformLocation, providedIn: "platform" });
44889BrowserPlatformLocation.ctorParameters = () => [
44890    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [DOCUMENT,] }] }
44891];
44892(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](BrowserPlatformLocation, [{
44893        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
44894        args: [{
44895                providedIn: 'platform',
44896                // See #23917
44897                useFactory: createBrowserPlatformLocation
44898            }]
44899    }], function () { return [{ type: undefined, decorators: [{
44900                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
44901                args: [DOCUMENT]
44902            }] }]; }, null); })();
44903function supportsState() {
44904    return !!window.history.pushState;
44905}
44906function createBrowserPlatformLocation() {
44907    return new BrowserPlatformLocation(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(DOCUMENT));
44908}
44909
44910/**
44911 * @license
44912 * Copyright Google LLC All Rights Reserved.
44913 *
44914 * Use of this source code is governed by an MIT-style license that can be
44915 * found in the LICENSE file at https://angular.io/license
44916 */
44917
44918/**
44919 * @license
44920 * Copyright Google LLC All Rights Reserved.
44921 *
44922 * Use of this source code is governed by an MIT-style license that can be
44923 * found in the LICENSE file at https://angular.io/license
44924 */
44925/**
44926 * Joins two parts of a URL with a slash if needed.
44927 *
44928 * @param start  URL string
44929 * @param end    URL string
44930 *
44931 *
44932 * @returns The joined URL string.
44933 */
44934function joinWithSlash(start, end) {
44935    if (start.length == 0) {
44936        return end;
44937    }
44938    if (end.length == 0) {
44939        return start;
44940    }
44941    let slashes = 0;
44942    if (start.endsWith('/')) {
44943        slashes++;
44944    }
44945    if (end.startsWith('/')) {
44946        slashes++;
44947    }
44948    if (slashes == 2) {
44949        return start + end.substring(1);
44950    }
44951    if (slashes == 1) {
44952        return start + end;
44953    }
44954    return start + '/' + end;
44955}
44956/**
44957 * Removes a trailing slash from a URL string if needed.
44958 * Looks for the first occurrence of either `#`, `?`, or the end of the
44959 * line as `/` characters and removes the trailing slash if one exists.
44960 *
44961 * @param url URL string.
44962 *
44963 * @returns The URL string, modified if needed.
44964 */
44965function stripTrailingSlash(url) {
44966    const match = url.match(/#|\?|$/);
44967    const pathEndIdx = match && match.index || url.length;
44968    const droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);
44969    return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);
44970}
44971/**
44972 * Normalizes URL parameters by prepending with `?` if needed.
44973 *
44974 * @param  params String of URL parameters.
44975 *
44976 * @returns The normalized URL parameters string.
44977 */
44978function normalizeQueryParams(params) {
44979    return params && params[0] !== '?' ? '?' + params : params;
44980}
44981
44982/**
44983 * @license
44984 * Copyright Google LLC All Rights Reserved.
44985 *
44986 * Use of this source code is governed by an MIT-style license that can be
44987 * found in the LICENSE file at https://angular.io/license
44988 */
44989/**
44990 * Enables the `Location` service to read route state from the browser's URL.
44991 * Angular provides two strategies:
44992 * `HashLocationStrategy` and `PathLocationStrategy`.
44993 *
44994 * Applications should use the `Router` or `Location` services to
44995 * interact with application route state.
44996 *
44997 * For instance, `HashLocationStrategy` produces URLs like
44998 * <code class="no-auto-link">http://example.com#/foo</code>,
44999 * and `PathLocationStrategy` produces
45000 * <code class="no-auto-link">http://example.com/foo</code> as an equivalent URL.
45001 *
45002 * See these two classes for more.
45003 *
45004 * @publicApi
45005 */
45006class LocationStrategy {
45007}
45008LocationStrategy.ɵfac = function LocationStrategy_Factory(t) { return new (t || LocationStrategy)(); };
45009LocationStrategy.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ factory: provideLocationStrategy, token: LocationStrategy, providedIn: "root" });
45010(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LocationStrategy, [{
45011        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
45012        args: [{ providedIn: 'root', useFactory: provideLocationStrategy }]
45013    }], null, null); })();
45014function provideLocationStrategy(platformLocation) {
45015    // See #23917
45016    const location = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(DOCUMENT).location;
45017    return new PathLocationStrategy(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(PlatformLocation), location && location.origin || '');
45018}
45019/**
45020 * A predefined [DI token](guide/glossary#di-token) for the base href
45021 * to be used with the `PathLocationStrategy`.
45022 * The base href is the URL prefix that should be preserved when generating
45023 * and recognizing URLs.
45024 *
45025 * @usageNotes
45026 *
45027 * The following example shows how to use this token to configure the root app injector
45028 * with a base href value, so that the DI framework can supply the dependency anywhere in the app.
45029 *
45030 * ```typescript
45031 * import {Component, NgModule} from '@angular/core';
45032 * import {APP_BASE_HREF} from '@angular/common';
45033 *
45034 * @NgModule({
45035 *   providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]
45036 * })
45037 * class AppModule {}
45038 * ```
45039 *
45040 * @publicApi
45041 */
45042const APP_BASE_HREF = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["InjectionToken"]('appBaseHref');
45043/**
45044 * @description
45045 * A {@link LocationStrategy} used to configure the {@link Location} service to
45046 * represent its state in the
45047 * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the
45048 * browser's URL.
45049 *
45050 * If you're using `PathLocationStrategy`, you must provide a {@link APP_BASE_HREF}
45051 * or add a `<base href>` element to the document.
45052 *
45053 * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call
45054 * `location.go('/foo')`, the browser's URL will become
45055 * `example.com/my/app/foo`. To ensure all relative URIs resolve correctly,
45056 * the `<base href>` and/or `APP_BASE_HREF` should end with a `/`.
45057 *
45058 * Similarly, if you add `<base href='/my/app/'/>` to the document and call
45059 * `location.go('/foo')`, the browser's URL will become
45060 * `example.com/my/app/foo`.
45061 *
45062 * Note that when using `PathLocationStrategy`, neither the query nor
45063 * the fragment in the `<base href>` will be preserved, as outlined
45064 * by the [RFC](https://tools.ietf.org/html/rfc3986#section-5.2.2).
45065 *
45066 * @usageNotes
45067 *
45068 * ### Example
45069 *
45070 * {@example common/location/ts/path_location_component.ts region='LocationComponent'}
45071 *
45072 * @publicApi
45073 */
45074class PathLocationStrategy extends LocationStrategy {
45075    constructor(_platformLocation, href) {
45076        super();
45077        this._platformLocation = _platformLocation;
45078        if (href == null) {
45079            href = this._platformLocation.getBaseHrefFromDOM();
45080        }
45081        if (href == null) {
45082            throw new Error(`No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.`);
45083        }
45084        this._baseHref = href;
45085    }
45086    onPopState(fn) {
45087        this._platformLocation.onPopState(fn);
45088        this._platformLocation.onHashChange(fn);
45089    }
45090    getBaseHref() {
45091        return this._baseHref;
45092    }
45093    prepareExternalUrl(internal) {
45094        return joinWithSlash(this._baseHref, internal);
45095    }
45096    path(includeHash = false) {
45097        const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);
45098        const hash = this._platformLocation.hash;
45099        return hash && includeHash ? `${pathname}${hash}` : pathname;
45100    }
45101    pushState(state, title, url, queryParams) {
45102        const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
45103        this._platformLocation.pushState(state, title, externalUrl);
45104    }
45105    replaceState(state, title, url, queryParams) {
45106        const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
45107        this._platformLocation.replaceState(state, title, externalUrl);
45108    }
45109    forward() {
45110        this._platformLocation.forward();
45111    }
45112    back() {
45113        this._platformLocation.back();
45114    }
45115}
45116PathLocationStrategy.ɵfac = function PathLocationStrategy_Factory(t) { return new (t || PathLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](APP_BASE_HREF, 8)); };
45117PathLocationStrategy.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: PathLocationStrategy, factory: PathLocationStrategy.ɵfac });
45118PathLocationStrategy.ctorParameters = () => [
45119    { type: PlatformLocation },
45120    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [APP_BASE_HREF,] }] }
45121];
45122(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PathLocationStrategy, [{
45123        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"]
45124    }], function () { return [{ type: PlatformLocation }, { type: String, decorators: [{
45125                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"]
45126            }, {
45127                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
45128                args: [APP_BASE_HREF]
45129            }] }]; }, null); })();
45130
45131/**
45132 * @license
45133 * Copyright Google LLC All Rights Reserved.
45134 *
45135 * Use of this source code is governed by an MIT-style license that can be
45136 * found in the LICENSE file at https://angular.io/license
45137 */
45138/**
45139 * @description
45140 * A {@link LocationStrategy} used to configure the {@link Location} service to
45141 * represent its state in the
45142 * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)
45143 * of the browser's URL.
45144 *
45145 * For instance, if you call `location.go('/foo')`, the browser's URL will become
45146 * `example.com#/foo`.
45147 *
45148 * @usageNotes
45149 *
45150 * ### Example
45151 *
45152 * {@example common/location/ts/hash_location_component.ts region='LocationComponent'}
45153 *
45154 * @publicApi
45155 */
45156class HashLocationStrategy extends LocationStrategy {
45157    constructor(_platformLocation, _baseHref) {
45158        super();
45159        this._platformLocation = _platformLocation;
45160        this._baseHref = '';
45161        if (_baseHref != null) {
45162            this._baseHref = _baseHref;
45163        }
45164    }
45165    onPopState(fn) {
45166        this._platformLocation.onPopState(fn);
45167        this._platformLocation.onHashChange(fn);
45168    }
45169    getBaseHref() {
45170        return this._baseHref;
45171    }
45172    path(includeHash = false) {
45173        // the hash value is always prefixed with a `#`
45174        // and if it is empty then it will stay empty
45175        let path = this._platformLocation.hash;
45176        if (path == null)
45177            path = '#';
45178        return path.length > 0 ? path.substring(1) : path;
45179    }
45180    prepareExternalUrl(internal) {
45181        const url = joinWithSlash(this._baseHref, internal);
45182        return url.length > 0 ? ('#' + url) : url;
45183    }
45184    pushState(state, title, path, queryParams) {
45185        let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));
45186        if (url.length == 0) {
45187            url = this._platformLocation.pathname;
45188        }
45189        this._platformLocation.pushState(state, title, url);
45190    }
45191    replaceState(state, title, path, queryParams) {
45192        let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));
45193        if (url.length == 0) {
45194            url = this._platformLocation.pathname;
45195        }
45196        this._platformLocation.replaceState(state, title, url);
45197    }
45198    forward() {
45199        this._platformLocation.forward();
45200    }
45201    back() {
45202        this._platformLocation.back();
45203    }
45204}
45205HashLocationStrategy.ɵfac = function HashLocationStrategy_Factory(t) { return new (t || HashLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](APP_BASE_HREF, 8)); };
45206HashLocationStrategy.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: HashLocationStrategy, factory: HashLocationStrategy.ɵfac });
45207HashLocationStrategy.ctorParameters = () => [
45208    { type: PlatformLocation },
45209    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [APP_BASE_HREF,] }] }
45210];
45211(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HashLocationStrategy, [{
45212        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"]
45213    }], function () { return [{ type: PlatformLocation }, { type: String, decorators: [{
45214                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Optional"]
45215            }, {
45216                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
45217                args: [APP_BASE_HREF]
45218            }] }]; }, null); })();
45219
45220/**
45221 * @license
45222 * Copyright Google LLC All Rights Reserved.
45223 *
45224 * Use of this source code is governed by an MIT-style license that can be
45225 * found in the LICENSE file at https://angular.io/license
45226 */
45227/**
45228 * @description
45229 *
45230 * A service that applications can use to interact with a browser's URL.
45231 *
45232 * Depending on the `LocationStrategy` used, `Location` persists
45233 * to the URL's path or the URL's hash segment.
45234 *
45235 * @usageNotes
45236 *
45237 * It's better to use the `Router#navigate` service to trigger route changes. Use
45238 * `Location` only if you need to interact with or create normalized URLs outside of
45239 * routing.
45240 *
45241 * `Location` is responsible for normalizing the URL against the application's base href.
45242 * A normalized URL is absolute from the URL host, includes the application's base href, and has no
45243 * trailing slash:
45244 * - `/my/app/user/123` is normalized
45245 * - `my/app/user/123` **is not** normalized
45246 * - `/my/app/user/123/` **is not** normalized
45247 *
45248 * ### Example
45249 *
45250 * <code-example path='common/location/ts/path_location_component.ts'
45251 * region='LocationComponent'></code-example>
45252 *
45253 * @publicApi
45254 */
45255class Location {
45256    constructor(platformStrategy, platformLocation) {
45257        /** @internal */
45258        this._subject = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
45259        /** @internal */
45260        this._urlChangeListeners = [];
45261        this._platformStrategy = platformStrategy;
45262        const browserBaseHref = this._platformStrategy.getBaseHref();
45263        this._platformLocation = platformLocation;
45264        this._baseHref = stripTrailingSlash(_stripIndexHtml(browserBaseHref));
45265        this._platformStrategy.onPopState((ev) => {
45266            this._subject.emit({
45267                'url': this.path(true),
45268                'pop': true,
45269                'state': ev.state,
45270                'type': ev.type,
45271            });
45272        });
45273    }
45274    /**
45275     * Normalizes the URL path for this location.
45276     *
45277     * @param includeHash True to include an anchor fragment in the path.
45278     *
45279     * @returns The normalized URL path.
45280     */
45281    // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is
45282    // removed.
45283    path(includeHash = false) {
45284        return this.normalize(this._platformStrategy.path(includeHash));
45285    }
45286    /**
45287     * Reports the current state of the location history.
45288     * @returns The current value of the `history.state` object.
45289     */
45290    getState() {
45291        return this._platformLocation.getState();
45292    }
45293    /**
45294     * Normalizes the given path and compares to the current normalized path.
45295     *
45296     * @param path The given URL path.
45297     * @param query Query parameters.
45298     *
45299     * @returns True if the given URL path is equal to the current normalized path, false
45300     * otherwise.
45301     */
45302    isCurrentPathEqualTo(path, query = '') {
45303        return this.path() == this.normalize(path + normalizeQueryParams(query));
45304    }
45305    /**
45306     * Normalizes a URL path by stripping any trailing slashes.
45307     *
45308     * @param url String representing a URL.
45309     *
45310     * @returns The normalized URL string.
45311     */
45312    normalize(url) {
45313        return Location.stripTrailingSlash(_stripBaseHref(this._baseHref, _stripIndexHtml(url)));
45314    }
45315    /**
45316     * Normalizes an external URL path.
45317     * If the given URL doesn't begin with a leading slash (`'/'`), adds one
45318     * before normalizing. Adds a hash if `HashLocationStrategy` is
45319     * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
45320     *
45321     * @param url String representing a URL.
45322     *
45323     * @returns  A normalized platform-specific URL.
45324     */
45325    prepareExternalUrl(url) {
45326        if (url && url[0] !== '/') {
45327            url = '/' + url;
45328        }
45329        return this._platformStrategy.prepareExternalUrl(url);
45330    }
45331    // TODO: rename this method to pushState
45332    /**
45333     * Changes the browser's URL to a normalized version of a given URL, and pushes a
45334     * new item onto the platform's history.
45335     *
45336     * @param path  URL path to normalize.
45337     * @param query Query parameters.
45338     * @param state Location history state.
45339     *
45340     */
45341    go(path, query = '', state = null) {
45342        this._platformStrategy.pushState(state, '', path, query);
45343        this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
45344    }
45345    /**
45346     * Changes the browser's URL to a normalized version of the given URL, and replaces
45347     * the top item on the platform's history stack.
45348     *
45349     * @param path  URL path to normalize.
45350     * @param query Query parameters.
45351     * @param state Location history state.
45352     */
45353    replaceState(path, query = '', state = null) {
45354        this._platformStrategy.replaceState(state, '', path, query);
45355        this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
45356    }
45357    /**
45358     * Navigates forward in the platform's history.
45359     */
45360    forward() {
45361        this._platformStrategy.forward();
45362    }
45363    /**
45364     * Navigates back in the platform's history.
45365     */
45366    back() {
45367        this._platformStrategy.back();
45368    }
45369    /**
45370     * Registers a URL change listener. Use to catch updates performed by the Angular
45371     * framework that are not detectible through "popstate" or "hashchange" events.
45372     *
45373     * @param fn The change handler function, which take a URL and a location history state.
45374     */
45375    onUrlChange(fn) {
45376        this._urlChangeListeners.push(fn);
45377        if (!this._urlChangeSubscription) {
45378            this._urlChangeSubscription = this.subscribe(v => {
45379                this._notifyUrlChangeListeners(v.url, v.state);
45380            });
45381        }
45382    }
45383    /** @internal */
45384    _notifyUrlChangeListeners(url = '', state) {
45385        this._urlChangeListeners.forEach(fn => fn(url, state));
45386    }
45387    /**
45388     * Subscribes to the platform's `popState` events.
45389     *
45390     * @param value Event that is triggered when the state history changes.
45391     * @param exception The exception to throw.
45392     *
45393     * @returns Subscribed events.
45394     */
45395    subscribe(onNext, onThrow, onReturn) {
45396        return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });
45397    }
45398}
45399Location.ɵfac = function Location_Factory(t) { return new (t || Location)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](LocationStrategy), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation)); };
45400/**
45401 * Normalizes URL parameters by prepending with `?` if needed.
45402 *
45403 * @param  params String of URL parameters.
45404 *
45405 * @returns The normalized URL parameters string.
45406 */
45407Location.normalizeQueryParams = normalizeQueryParams;
45408/**
45409 * Joins two parts of a URL with a slash if needed.
45410 *
45411 * @param start  URL string
45412 * @param end    URL string
45413 *
45414 *
45415 * @returns The joined URL string.
45416 */
45417Location.joinWithSlash = joinWithSlash;
45418/**
45419 * Removes a trailing slash from a URL string if needed.
45420 * Looks for the first occurrence of either `#`, `?`, or the end of the
45421 * line as `/` characters and removes the trailing slash if one exists.
45422 *
45423 * @param url URL string.
45424 *
45425 * @returns The URL string, modified if needed.
45426 */
45427Location.stripTrailingSlash = stripTrailingSlash;
45428Location.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({ factory: createLocation, token: Location, providedIn: "root" });
45429Location.ctorParameters = () => [
45430    { type: LocationStrategy },
45431    { type: PlatformLocation }
45432];
45433(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](Location, [{
45434        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"],
45435        args: [{
45436                providedIn: 'root',
45437                // See #23917
45438                useFactory: createLocation
45439            }]
45440    }], function () { return [{ type: LocationStrategy }, { type: PlatformLocation }]; }, null); })();
45441function createLocation() {
45442    return new Location(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(LocationStrategy), Ob
45442ject(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(PlatformLocation));
45443}
45444function _stripBaseHref(baseHref, url) {
45445    return baseHref && url.startsWith(baseHref) ? url.substring(baseHref.length) : url;
45446}
45447function _stripIndexHtml(url) {
45448    return url.replace(/\/index.html$/, '');
45449}
45450
45451/**
45452 * @license
45453 * Copyright Google LLC All Rights Reserved.
45454 *
45455 * Use of this source code is governed by an MIT-style license that can be
45456 * found in the LICENSE file at https://angular.io/license
45457 */
45458
45459/**
45460 * @license
45461 * Copyright Google LLC All Rights Reserved.
45462 *
45463 * Use of this source code is governed by an MIT-style license that can be
45464 * found in the LICENSE file at https://angular.io/license
45465 */
45466/** @internal */
45467const CURRENCIES_EN = {
45468    'ADP': [undefined, undefined, 0],
45469    'AFN': [undefined, undefined, 0],
45470    'ALL': [undefined, undefined, 0],
45471    'AMD': [undefined, undefined, 2],
45472    'AOA': [undefined, 'Kz'],
45473    'ARS': [undefined, '$'],
45474    'AUD': ['A$', '$'],
45475    'BAM': [undefined, 'KM'],
45476    'BBD': [undefined, '$'],
45477    'BDT': [undefined, 'à§³'],
45478    'BHD': [undefined, undefined, 3],
45479    'BIF': [undefined, undefined, 0],
45480    'BMD': [undefined, '$'],
45481    'BND': [undefined, '$'],
45482    'BOB': [undefined, 'Bs'],
45483    'BRL': ['R$'],
45484    'BSD': [undefined, '$'],
45485    'BWP': [undefined, 'P'],
45486    'BYN': [undefined, 'р.', 2],
45487    'BYR': [undefined, undefined, 0],
45488    'BZD': [undefined, '$'],
45489    'CAD': ['CA$', '$', 2],
45490    'CHF': [undefined, undefined, 2],
45491    'CLF': [undefined, undefined, 4],
45492    'CLP': [undefined, '$', 0],
45493    'CNY': ['CNÂ¥', 'Â¥'],
45494    'COP': [undefined, '$', 2],
45495    'CRC': [undefined, '₡', 2],
45496    'CUC': [undefined, '$'],
45497    'CUP': [undefined, '$'],
45498    'CZK': [undefined, 'Kč', 2],
45499    'DJF': [undefined, undefined, 0],
45500    'DKK': [undefined, 'kr', 2],
45501    'DOP': [undefined, '$'],
45502    'EGP': [undefined, 'E£'],
45503    'ESP': [undefined, '₧', 0],
45504    'EUR': ['€'],
45505    'FJD': [undefined, '$'],
45506    'FKP': [undefined, '£'],
45507    'GBP': ['£'],
45508    'GEL': [undefined, '₾'],
45509    'GIP': [undefined, '£'],
45510    'GNF': [undefined, 'FG', 0],
45511    'GTQ': [undefined, 'Q'],
45512    'GYD': [undefined, '$', 2],
45513    'HKD': ['HK$', '$'],
45514    'HNL': [undefined, 'L'],
45515    'HRK': [undefined, 'kn'],
45516    'HUF': [undefined, 'Ft', 2],
45517    'IDR': [undefined, 'Rp', 2],
45518    'ILS': ['₪'],
45519    'INR': ['₹'],
45520    'IQD': [undefined, undefined, 0],
45521    'IRR': [undefined, undefined, 0],
45522    'ISK': [undefined, 'kr', 0],
45523    'ITL': [undefined, undefined, 0],
45524    'JMD': [undefined, '$'],
45525    'JOD': [undefined, undefined, 3],
45526    'JPY': ['Â¥', undefined, 0],
45527    'KHR': [undefined, '៛'],
45528    'KMF': [undefined, 'CF', 0],
45529    'KPW': [undefined, '₩', 0],
45530    'KRW': ['₩', undefined, 0],
45531    'KWD': [undefined, undefined, 3],
45532    'KYD': [undefined, '$'],
45533    'KZT': [undefined, '₸'],
45534    'LAK': [undefined, '₭', 0],
45535    'LBP': [undefined, 'L£', 0],
45536    'LKR': [undefined, 'Rs'],
45537    'LRD': [undefined, '$'],
45538    'LTL': [undefined, 'Lt'],
45539    'LUF': [undefined, undefined, 0],
45540    'LVL': [undefined, 'Ls'],
45541    'LYD': [undefined, undefined, 3],
45542    'MGA': [undefined, 'Ar', 0],
45543    'MGF': [undefined, undefined, 0],
45544    'MMK': [undefined, 'K', 0],
45545    'MNT': [undefined, '₮', 2],
45546    'MRO': [undefined, undefined, 0],
45547    'MUR': [undefined, 'Rs', 2],
45548    'MXN': ['MX$', '$'],
45549    'MYR': [undefined, 'RM'],
45550    'NAD': [undefined, '$'],
45551    'NGN': [undefined, '₦'],
45552    'NIO': [undefined, 'C$'],
45553    'NOK': [undefined, 'kr', 2],
45554    'NPR': [undefined, 'Rs'],
45555    'NZD': ['NZ$', '$'],
45556    'OMR': [undefined, undefined, 3],
45557    'PHP': [undefined, '₱'],
45558    'PKR': [undefined, 'Rs', 2],
45559    'PLN': [undefined, 'zł'],
45560    'PYG': [undefined, '₲', 0],
45561    'RON': [undefined, 'lei'],
45562    'RSD': [undefined, undefined, 0],
45563    'RUB': [undefined, '₽'],
45564    'RUR': [undefined, 'р.'],
45565    'RWF': [undefined, 'RF', 0],
45566    'SBD': [undefined, '$'],
45567    'SEK': [undefined, 'kr', 2],
45568    'SGD': [undefined, '$'],
45569    'SHP': [undefined, '£'],
45570    'SLL': [undefined, undefined, 0],
45571    'SOS': [undefined, undefined, 0],
45572    'SRD': [undefined, '$'],
45573    'SSP': [undefined, '£'],
45574    'STD': [undefined, undefined, 0],
45575    'STN': [undefined, 'Db'],
45576    'SYP': [undefined, '£', 0],
45577    'THB': [undefined, '฿'],
45578    'TMM': [undefined, undefined, 0],
45579    'TND': [undefined, undefined, 3],
45580    'TOP': [undefined, 'T$'],
45581    'TRL': [undefined, undefined, 0],
45582    'TRY': [undefined, '₺'],
45583    'TTD': [undefined, '$'],
45584    'TWD': ['NT$', '$', 2],
45585    'TZS': [undefined, undefined, 2],
45586    'UAH': [undefined, '₴'],
45587    'UGX': [undefined, undefined, 0],
45588    'USD': ['$'],
45589    'UYI': [undefined, undefined, 0],
45590    'UYU': [undefined, '$'],
45591    'UYW': [undefined, undefined, 4],
45592    'UZS': [undefined, undefined, 2],
45593    'VEF': [undefined, 'Bs', 2],
45594    'VND': ['₫', undefined, 0],
45595    'VUV': [undefined, undefined, 0],
45596    'XAF': ['FCFA', undefined, 0],
45597    'XCD': ['EC$', '$'],
45598    'XOF': ['CFA', undefined, 0],
45599    'XPF': ['CFPF', undefined, 0],
45600    'XXX': ['¤'],
45601    'YER': [undefined, undefined, 0],
45602    'ZAR': [undefined, 'R'],
45603    'ZMK': [undefined, undefined, 0],
45604    'ZMW': [undefined, 'ZK'],
45605    'ZWD': [undefined, undefined, 0]
45606};
45607
45608/**
45609 * @license
45610 * Copyright Google LLC All Rights Reserved.
45611 *
45612 * Use of this source code is governed by an MIT-style license that can be
45613 * found in the LICENSE file at https://angular.io/license
45614 */
45615/**
45616 * Format styles that can be used to represent numbers.
45617 * @see `getLocaleNumberFormat()`.
45618 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45619 *
45620 * @publicApi
45621 */
45622var NumberFormatStyle;
45623(function (NumberFormatStyle) {
45624    NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal";
45625    NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent";
45626    NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency";
45627    NumberFormatStyle[NumberFormatStyle["Scientific"] = 3] = "Scientific";
45628})(NumberFormatStyle || (NumberFormatStyle = {}));
45629/**
45630 * Plurality cases used for translating plurals to different languages.
45631 *
45632 * @see `NgPlural`
45633 * @see `NgPluralCase`
45634 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45635 *
45636 * @publicApi
45637 */
45638var Plural;
45639(function (Plural) {
45640    Plural[Plural["Zero"] = 0] = "Zero";
45641    Plural[Plural["One"] = 1] = "One";
45642    Plural[Plural["Two"] = 2] = "Two";
45643    Plural[Plural["Few"] = 3] = "Few";
45644    Plural[Plural["Many"] = 4] = "Many";
45645    Plural[Plural["Other"] = 5] = "Other";
45646})(Plural || (Plural = {}));
45647/**
45648 * Context-dependant translation forms for strings.
45649 * Typically the standalone version is for the nominative form of the word,
45650 * and the format version is used for the genitive case.
45651 * @see [CLDR website](http://cldr.unicode.org/translation/date-time-1/date-time#TOC-Standalone-vs.-Format-Styles)
45652 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45653 *
45654 * @publicApi
45655 */
45656var FormStyle;
45657(function (FormStyle) {
45658    FormStyle[FormStyle["Format"] = 0] = "Format";
45659    FormStyle[FormStyle["Standalone"] = 1] = "Standalone";
45660})(FormStyle || (FormStyle = {}));
45661/**
45662 * String widths available for translations.
45663 * The specific character widths are locale-specific.
45664 * Examples are given for the word "Sunday" in English.
45665 *
45666 * @publicApi
45667 */
45668var TranslationWidth;
45669(function (TranslationWidth) {
45670    /** 1 character for `en-US`. For example: 'S' */
45671    TranslationWidth[TranslationWidth["Narrow"] = 0] = "Narrow";
45672    /** 3 characters for `en-US`. For example: 'Sun' */
45673    TranslationWidth[TranslationWidth["Abbreviated"] = 1] = "Abbreviated";
45674    /** Full length for `en-US`. For example: "Sunday" */
45675    TranslationWidth[TranslationWidth["Wide"] = 2] = "Wide";
45676    /** 2 characters for `en-US`, For example: "Su" */
45677    TranslationWidth[TranslationWidth["Short"] = 3] = "Short";
45678})(TranslationWidth || (TranslationWidth = {}));
45679/**
45680 * String widths available for date-time formats.
45681 * The specific character widths are locale-specific.
45682 * Examples are given for `en-US`.
45683 *
45684 * @see `getLocaleDateFormat()`
45685 * @see `getLocaleTimeFormat()``
45686 * @see `getLocaleDateTimeFormat()`
45687 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45688 * @publicApi
45689 */
45690var FormatWidth;
45691(function (FormatWidth) {
45692    /**
45693     * For `en-US`, 'M/d/yy, h:mm a'`
45694     * (Example: `6/15/15, 9:03 AM`)
45695     */
45696    FormatWidth[FormatWidth["Short"] = 0] = "Short";
45697    /**
45698     * For `en-US`, `'MMM d, y, h:mm:ss a'`
45699     * (Example: `Jun 15, 2015, 9:03:01 AM`)
45700     */
45701    FormatWidth[FormatWidth["Medium"] = 1] = "Medium";
45702    /**
45703     * For `en-US`, `'MMMM d, y, h:mm:ss a z'`
45704     * (Example: `June 15, 2015 at 9:03:01 AM GMT+1`)
45705     */
45706    FormatWidth[FormatWidth["Long"] = 2] = "Long";
45707    /**
45708     * For `en-US`, `'EEEE, MMMM d, y, h:mm:ss a zzzz'`
45709     * (Example: `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00`)
45710     */
45711    FormatWidth[FormatWidth["Full"] = 3] = "Full";
45712})(FormatWidth || (FormatWidth = {}));
45713/**
45714 * Symbols that can be used to replace placeholders in number patterns.
45715 * Examples are based on `en-US` values.
45716 *
45717 * @see `getLocaleNumberSymbol()`
45718 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45719 *
45720 * @publicApi
45721 */
45722var NumberSymbol;
45723(function (NumberSymbol) {
45724    /**
45725     * Decimal separator.
45726     * For `en-US`, the dot character.
45727     * Example: 2,345`.`67
45728     */
45729    NumberSymbol[NumberSymbol["Decimal"] = 0] = "Decimal";
45730    /**
45731     * Grouping separator, typically for thousands.
45732     * For `en-US`, the comma character.
45733     * Example: 2`,`345.67
45734     */
45735    NumberSymbol[NumberSymbol["Group"] = 1] = "Group";
45736    /**
45737     * List-item separator.
45738     * Example: "one, two, and three"
45739     */
45740    NumberSymbol[NumberSymbol["List"] = 2] = "List";
45741    /**
45742     * Sign for percentage (out of 100).
45743     * Example: 23.4%
45744     */
45745    NumberSymbol[NumberSymbol["PercentSign"] = 3] = "PercentSign";
45746    /**
45747     * Sign for positive numbers.
45748     * Example: +23
45749     */
45750    NumberSymbol[NumberSymbol["PlusSign"] = 4] = "PlusSign";
45751    /**
45752     * Sign for negative numbers.
45753     * Example: -23
45754     */
45755    NumberSymbol[NumberSymbol["MinusSign"] = 5] = "MinusSign";
45756    /**
45757     * Computer notation for exponential value (n times a power of 10).
45758     * Example: 1.2E3
45759     */
45760    NumberSymbol[NumberSymbol["Exponential"] = 6] = "Exponential";
45761    /**
45762     * Human-readable format of exponential.
45763     * Example: 1.2x103
45764     */
45765    NumberSymbol[NumberSymbol["SuperscriptingExponent"] = 7] = "SuperscriptingExponent";
45766    /**
45767     * Sign for permille (out of 1000).
45768     * Example: 23.4‰
45769     */
45770    NumberSymbol[NumberSymbol["PerMille"] = 8] = "PerMille";
45771    /**
45772     * Infinity, can be used with plus and minus.
45773     * Example: ∞, +∞, -∞
45774     */
45775    NumberSymbol[NumberSymbol["Infinity"] = 9] = "Infinity";
45776    /**
45777     * Not a number.
45778     * Example: NaN
45779     */
45780    NumberSymbol[NumberSymbol["NaN"] = 10] = "NaN";
45781    /**
45782     * Symbol used between time units.
45783     * Example: 10:52
45784     */
45785    NumberSymbol[NumberSymbol["TimeSeparator"] = 11] = "TimeSeparator";
45786    /**
45787     * Decimal separator for currency values (fallback to `Decimal`).
45788     * Example: $2,345.67
45789     */
45790    NumberSymbol[NumberSymbol["CurrencyDecimal"] = 12] = "CurrencyDecimal";
45791    /**
45792     * Group separator for currency values (fallback to `Group`).
45793     * Example: $2,345.67
45794     */
45795    NumberSymbol[NumberSymbol["CurrencyGroup"] = 13] = "CurrencyGroup";
45796})(NumberSymbol || (NumberSymbol = {}));
45797/**
45798 * The value for each day of the week, based on the `en-US` locale
45799 *
45800 * @publicApi
45801 */
45802var WeekDay;
45803(function (WeekDay) {
45804    WeekDay[WeekDay["Sunday"] = 0] = "Sunday";
45805    WeekDay[WeekDay["Monday"] = 1] = "Monday";
45806    WeekDay[WeekDay["Tuesday"] = 2] = "Tuesday";
45807    WeekDay[WeekDay["Wednesday"] = 3] = "Wednesday";
45808    WeekDay[WeekDay["Thursday"] = 4] = "Thursday";
45809    WeekDay[WeekDay["Friday"] = 5] = "Friday";
45810    WeekDay[WeekDay["Saturday"] = 6] = "Saturday";
45811})(WeekDay || (WeekDay = {}));
45812/**
45813 * Retrieves the locale ID from the currently loaded locale.
45814 * The loaded locale could be, for example, a global one rather than a regional one.
45815 * @param locale A locale code, such as `fr-FR`.
45816 * @returns The locale code. For example, `fr`.
45817 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45818 *
45819 * @publicApi
45820 */
45821function getLocaleId(locale) {
45822    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].LocaleId];
45823}
45824/**
45825 * Retrieves day period strings for the given locale.
45826 *
45827 * @param locale A locale code for the locale format rules to use.
45828 * @param formStyle The required grammatical form.
45829 * @param width The required character width.
45830 * @returns An array of localized period strings. For example, `[AM, PM]` for `en-US`.
45831 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45832 *
45833 * @publicApi
45834 */
45835function getLocaleDayPeriods(locale, formStyle, width) {
45836    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45837    const amPmData = [
45838        data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DayPeriodsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DayPeriodsStandalone]
45839    ];
45840    const amPm = getLastDefinedValue(amPmData, formStyle);
45841    return getLastDefinedValue(amPm, width);
45842}
45843/**
45844 * Retrieves days of the week for the given locale, using the Gregorian calendar.
45845 *
45846 * @param locale A locale code for the locale format rules to use.
45847 * @param formStyle The required grammatical form.
45848 * @param width The required character width.
45849 * @returns An array of localized name strings.
45850 * For example,`[Sunday, Monday, ... Saturday]` for `en-US`.
45851 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45852 *
45853 * @publicApi
45854 */
45855function getLocaleDayNames(locale, formStyle, width) {
45856    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45857    const daysData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DaysFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DaysStandalone]];
45858    const days = getLastDefinedValue(daysData, formStyle);
45859    return getLastDefinedValue(days, width);
45860}
45861/**
45862 * Retrieves months of the year for the given locale, using the Gregorian calendar.
45863 *
45864 * @param locale A locale code for the locale format rules to use.
45865 * @param formStyle The required grammatical form.
45866 * @param width The required character width.
45867 * @returns An array of localized name strings.
45868 * For example,  `[January, February, ...]` for `en-US`.
45869 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45870 *
45871 * @publicApi
45872 */
45873function getLocaleMonthNames(locale, formStyle, width) {
45874    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45875    const monthsData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].MonthsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].MonthsStandalone]];
45876    const months = getLastDefinedValue(monthsData, formStyle);
45877    return getLastDefinedValue(months, width);
45878}
45879/**
45880 * Retrieves Gregorian-calendar eras for the given locale.
45881 * @param locale A locale code for the locale format rules to use.
45882 * @param width The required character width.
45883
45884 * @returns An array of localized era strings.
45885 * For example, `[AD, BC]` for `en-US`.
45886 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45887 *
45888 * @publicApi
45889 */
45890function getLocaleEraNames(locale, width) {
45891    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45892    const erasData = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Eras];
45893    return getLastDefinedValue(erasData, width);
45894}
45895/**
45896 * Retrieves the first day of the week for the given locale.
45897 *
45898 * @param locale A locale code for the locale format rules to use.
45899 * @returns A day index number, using the 0-based week-day index for `en-US`
45900 * (Sunday = 0, Monday = 1, ...).
45901 * For example, for `fr-FR`, returns 1 to indicate that the first day is Monday.
45902 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45903 *
45904 * @publicApi
45905 */
45906function getLocaleFirstDayOfWeek(locale) {
45907    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45908    return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].FirstDayOfWeek];
45909}
45910/**
45911 * Range of week days that are considered the week-end for the given locale.
45912 *
45913 * @param locale A locale code for the locale format rules to use.
45914 * @returns The range of day values, `[startDay, endDay]`.
45915 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45916 *
45917 * @publicApi
45918 */
45919function getLocaleWeekEndRange(locale) {
45920    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45921    return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].WeekendRange];
45922}
45923/**
45924 * Retrieves a localized date-value formating string.
45925 *
45926 * @param locale A locale code for the locale format rules to use.
45927 * @param width The format type.
45928 * @returns The localized formating string.
45929 * @see `FormatWidth`
45930 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45931 *
45932 * @publicApi
45933 */
45934function getLocaleDateFormat(locale, width) {
45935    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45936    return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DateFormat], width);
45937}
45938/**
45939 * Retrieves a localized time-value formatting string.
45940 *
45941 * @param locale A locale code for the locale format rules to use.
45942 * @param width The format type.
45943 * @returns The localized formatting string.
45944 * @see `FormatWidth`
45945 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45946
45947 * @publicApi
45948 */
45949function getLocaleTimeFormat(locale, width) {
45950    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45951    return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].TimeFormat], width);
45952}
45953/**
45954 * Retrieves a localized date-time formatting string.
45955 *
45956 * @param locale A locale code for the locale format rules to use.
45957 * @param width The format type.
45958 * @returns The localized formatting string.
45959 * @see `FormatWidth`
45960 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45961 *
45962 * @publicApi
45963 */
45964function getLocaleDateTimeFormat(locale, width) {
45965    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45966    const dateTimeFormatData = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DateTimeFormat];
45967    return getLastDefinedValue(dateTimeFormatData, width);
45968}
45969/**
45970 * Retrieves a localized number symbol that can be used to replace placeholders in number formats.
45971 * @param locale The locale code.
45972 * @param symbol The symbol to localize.
45973 * @returns The character for the localized symbol.
45974 * @see `NumberSymbol`
45975 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
45976 *
45977 * @publicApi
45978 */
45979function getLocaleNumberSymbol(locale, symbol) {
45980    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
45981    const res = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][symbol];
45982    if (typeof res === 'undefined') {
45983        if (symbol === NumberSymbol.CurrencyDecimal) {
45984            return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][NumberSymbol.Decimal];
45985        }
45986        else if (symbol === NumberSymbol.CurrencyGroup) {
45987            return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][NumberSymbol.Group];
45988        }
45989    }
45990    return res;
45991}
45992/**
45993 * Retrieves a number format for a given locale.
45994 *
45995 * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`
45996 * when used to format the number 12345.678 could result in "12'345,678". That would happen if the
45997 * grouping separator for your language is an apostrophe, and the decimal separator is a comma.
45998 *
45999 * <b>Important:</b> The characters `.` `,` `0` `#` (and others below) are special placeholders
46000 * that stand for the decimal separator, and so on, and are NOT real characters.
46001 * You must NOT "translate" the placeholders. For example, don't change `.` to `,` even though in
46002 * your language the decimal point is written with a comma. The symbols should be replaced by the
46003 * local equivalents, using the appropriate `NumberSymbol` for your language.
46004 *
46005 * Here are the special characters used in number patterns:
46006 *
46007 * | Symbol | Meaning |
46008 * |--------|---------|
46009 * | . | Replaced automatically by the character used for the decimal point. |
46010 * | , | Replaced by the "grouping" (thousands) separator. |
46011 * | 0 | Replaced by a digit (or zero if there aren't enough digits). |
46012 * | # | Replaced by a digit (or nothing if there aren't enough). |
46013 * | ¤ | Replaced by a currency symbol, such as $ or USD. |
46014 * | % | Marks a percent format. The % symbol may change position, but must be retained. |
46015 * | E | Marks a scientific format. The E symbol may change position, but must be retained. |
46016 * | ' | Special characters used as literal characters are quoted with ASCII single quotes. |
46017 *
46018 * @param locale A locale code for the locale format rules to use.
46019 * @param type The type of numeric value to be formatted (such as `Decimal` or `Currency`.)
46020 * @returns The localized format string.
46021 * @see `NumberFormatStyle`
46022 * @see [CLDR website](http://cldr.unicode.org/translation/number-patterns)
46023 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46024 *
46025 * @publicApi
46026 */
46027function getLocaleNumberFormat(locale, type) {
46028    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
46029    return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberFormats][type];
46030}
46031/**
46032 * Retrieves the symbol used to represent the currency for the main country
46033 * corresponding to a given locale. For example, '$' for `en-US`.
46034 *
46035 * @param locale A locale code for the locale format rules to use.
46036 * @returns The localized symbol character,
46037 * or `null` if the main country cannot be determined.
46038 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46039 *
46040 * @publicApi
46041 */
46042function getLocaleCurrencySymbol(locale) {
46043    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
46044    return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].CurrencySymbol] || null;
46045}
46046/**
46047 * Retrieves the name of the currency for the main country corresponding
46048 * to a given locale. For example, 'US Dollar' for `en-US`.
46049 * @param locale A locale code for the locale format rules to use.
46050 * @returns The currency name,
46051 * or `null` if the main country cannot be determined.
46052 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46053 *
46054 * @publicApi
46055 */
46056function getLocaleCurrencyName(locale) {
46057    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
46058    return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].CurrencyName] || null;
46059}
46060/**
46061 * Retrieves the default currency code for the given locale.
46062 *
46063 * The default is defined as the first currency which is still in use.
46064 *
46065 * @param locale The code of the locale whose currency code we want.
46066 * @returns The code of the default currency for the given locale.
46067 *
46068 * @publicApi
46069 */
46070function getLocaleCurrencyCode(locale) {
46071    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵgetLocaleCurrencyCode"])(locale);
46072}
46073/**
46074 * Retrieves the currency values for a given locale.
46075 * @param locale A locale code for the locale format rules to use.
46076 * @returns The currency values.
46077 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46078 */
46079function getLocaleCurrencies(locale) {
46080    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
46081    return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Currencies];
46082}
46083/**
46084 * @alias core/ɵgetLocalePluralCase
46085 * @publicApi
46086 */
46087const getLocalePluralCase = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵgetLocalePluralCase"];
46088function checkFullData(data) {
46089    if (!data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData]) {
46090        throw new Error(`Missing extra locale data for the locale "${data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"]
46091            .LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`);
46092    }
46093}
46094/**
46095 * Retrieves locale-specific rules used to determine which day period to use
46096 * when more than one period is defined for a locale.
46097 *
46098 * There is a rule for each defined day period. The
46099 * first rule is applied to the first day period and so on.
46100 * Fall back to AM/PM when no rules are available.
46101 *
46102 * A rule can specify a period as time range, or as a single time value.
46103 *
46104 * This functionality is only available when you have loaded the full locale data.
46105 * See the ["I18n guide"](guide/i18n#i18n-pipes).
46106 *
46107 * @param locale A locale code for the locale format rules to use.
46108 * @returns The rules for the locale, a single time value or array of *from-time, to-time*,
46109 * or null if no periods are available.
46110 *
46111 * @see `getLocaleExtraDayPeriods()`
46112 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46113 *
46114 * @publicApi
46115 */
46116function getLocaleExtraDayPeriodRules(locale) {
46117    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
46118    checkFullData(data);
46119    const rules = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][2 /* ExtraDayPeriodsRules */] || [];
46120    return rules.map((rule) => {
46121        if (typeof rule === 'string') {
46122            return extractTime(rule);
46123        }
46124        return [extractTime(rule[0]), extractTime(rule[1])];
46125    });
46126}
46127/**
46128 * Retrieves locale-specific day periods, which indicate roughly how a day is broken up
46129 * in different languages.
46130 * For example, for `en-US`, periods are morning, noon, afternoon, evening, and midnight.
46131 *
46132 * This functionality is only available when you have loaded the full locale data.
46133 * See the ["I18n guide"](guide/i18n#i18n-pipes).
46134 *
46135 * @param locale A locale code for the locale format rules to use.
46136 * @param formStyle The required grammatical form.
46137 * @param width The required character width.
46138 * @returns The translated day-period strings.
46139 * @see `getLocaleExtraDayPeriodRules()`
46140 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46141 *
46142 * @publicApi
46143 */
46144function getLocaleExtraDayPeriods(locale, formStyle, width) {
46145    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
46146    checkFullData(data);
46147    const dayPeriodsData = [
46148        data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][0 /* ExtraDayPeriodFormats */],
46149        data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][1 /* ExtraDayPeriodStandalone */]
46150    ];
46151    const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
46152    return getLastDefinedValue(dayPeriods, width) || [];
46153}
46154/**
46155 * Retrieves the writing direction of a specified locale
46156 * @param locale A locale code for the locale format rules to use.
46157 * @publicApi
46158 * @returns 'rtl' or 'ltr'
46159 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46160 */
46161function getLocaleDirection(locale) {
46162    const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
46163    return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Directionality];
46164}
46165/**
46166 * Retrieves the first value that is defined in an array, going backwards from an index position.
46167 *
46168 * To avoid repeating the same data (as when the "format" and "standalone" forms are the same)
46169 * add the first value to the locale data arrays, and add other values only if they are different.
46170 *
46171 * @param data The data array to retrieve from.
46172 * @param index A 0-based index into the array to start from.
46173 * @returns The value immediately before the given index position.
46174 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46175 *
46176 * @publicApi
46177 */
46178function getLastDefinedValue(data, index) {
46179    for (let i = index; i > -1; i--) {
46180        if (typeof data[i] !== 'undefined') {
46181            return data[i];
46182        }
46183    }
46184    throw new Error('Locale data API: locale data undefined');
46185}
46186/**
46187 * Extracts the hours and minutes from a string like "15:45"
46188 */
46189function extractTime(time) {
46190    const [h, m] = time.split(':');
46191    return { hours: +h, minutes: +m };
46192}
46193/**
46194 * Retrieves the currency symbol for a given currency code.
46195 *
46196 * For example, for the default `en-US` locale, the code `USD` can
46197 * be represented by the narrow symbol `$` or the wide symbol `US$`.
46198 *
46199 * @param code The currency code.
46200 * @param format The format, `wide` or `narrow`.
46201 * @param locale A locale code for the locale format rules to use.
46202 *
46203 * @returns The symbol, or the currency code if no symbol is available.
46204 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46205 *
46206 * @publicApi
46207 */
46208function getCurrencySymbol(code, format, locale = 'en') {
46209    const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
46210    const symbolNarrow = currency[1 /* SymbolNarrow */];
46211    if (format === 'narrow' && typeof symbolNarrow === 'string') {
46212        return symbolNarrow;
46213    }
46214    return currency[0 /* Symbol */] || code;
46215}
46216// Most currencies have cents, that's why the default is 2
46217const DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
46218/**
46219 * Reports the number of decimal digits for a given currency.
46220 * The value depends upon the presence of cents in that particular currency.
46221 *
46222 * @param code The currency code.
46223 * @returns The number of decimal digits, typically 0 or 2.
46224 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46225 *
46226 * @publicApi
46227 */
46228function getNumberOfCurrencyDigits(code) {
46229    let digits;
46230    const currency = CURRENCIES_EN[code];
46231    if (currency) {
46232        digits = currency[2 /* NbOfDigits */];
46233    }
46234    return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
46235}
46236
46237/**
46238 * @license
46239 * Copyright Google LLC All Rights Reserved.
46240 *
46241 * Use of this source code is governed by an MIT-style license that can be
46242 * found in the LICENSE file at https://angular.io/license
46243 */
46244const ISO8601_DATE_REGEX = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
46245//    1        2       3         4          5          6          7          8  9     10      11
46246const NAMED_FORMATS = {};
46247const DATE_FORMATS_SPLIT = /((?:[^GyYMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?: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}|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]*)/;
46248var ZoneWidth;
46249(function (ZoneWidth) {
46250    ZoneWidth[ZoneWidth["Short"] = 0] = "Short";
46251    ZoneWidth[ZoneWidth["ShortGMT"] = 1] = "ShortGMT";
46252    ZoneWidth[ZoneWidth["Long"] = 2] = "Long";
46253    ZoneWidth[ZoneWidth["Extended"] = 3] = "Extended";
46254})(ZoneWidth || (ZoneWidth = {}));
46255var DateType;
46256(function (DateType) {
46257    DateType[DateType["FullYear"] = 0] = "FullYear";
46258    DateType[DateType["Month"] = 1] = "Month";
46259    DateType[DateType["Date"] = 2] = "Date";
46260    DateType[DateType["Hours"] = 3] = "Hours";
46261    DateType[DateType["Minutes"] = 4] = "Minutes";
46262    DateType[DateType["Seconds"] = 5] = "Seconds";
46263    DateType[DateType["FractionalSeconds"] = 6] = "FractionalSeconds";
46264    DateType[DateType["Day"] = 7] = "Day";
46265})(DateType || (DateType = {}));
46266var TranslationType;
46267(function (TranslationType) {
46268    TranslationType[TranslationType["DayPeriods"] = 0] = "DayPeriods";
46269    TranslationType[TranslationType["Days"] = 1] = "Days";
46270    TranslationType[TranslationType["Months"] = 2] = "Months";
46271    TranslationType[TranslationType["Eras"] = 3] = "Eras";
46272})(TranslationType || (TranslationType = {}));
46273/**
46274 * @ngModule CommonModule
46275 * @description
46276 *
46277 * Formats a date according to locale rules.
46278 *
46279 * @param value The date to format, as a Date, or a number (milliseconds since UTC epoch)
46280 * or an [ISO date-time string](https://www.w3.org/TR/NOTE-datetime).
46281 * @param format The date-time components to include. See `DatePipe` for details.
46282 * @param locale A locale code for the locale format rules to use.
46283 * @param timezone The time zone. A time zone offset from GMT (such as `'+0430'`),
46284 * or a standard UTC/GMT or continental US time zone abbreviation.
46285 * If not specified, uses host system settings.
46286 *
46287 * @returns The formatted date string.
46288 *
46289 * @see `DatePipe`
46290 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
46291 *
46292 * @publicApi
46293 */
46294function formatDate(value, format, locale, timezone) {
46295    let date = toDate(value);
46296    const namedFormat = getNamedFormat(locale, format);
46297    format = namedFormat || format;
46298    let parts = [];
46299    let match;
46300    while (format) {
46301        match = DATE_FORMATS_SPLIT.exec(format);
46302        if (match) {
46303            parts = parts.concat(match.slice(1));
46304            const part = parts.pop();
46305            if (!part) {
46306                break;
46307            }
46308            format = part;
46309        }
46310        else {
46311            parts.push(format);
46312            break;
46313        }
46314    }
46315    let dateTimezoneOffset = date.getTimezoneOffset();
46316    if (timezone) {
46317        dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
46318        date = convertTimezoneToLocal(date, timezone, true);
46319    }
46320    let text = '';
vendor: 9,496 bytes, lines 46321-46546
46321    parts.forEach(value => {
46322        const dateFormatter = getDateFormatter(value);
46323        text += dateFormatter ?
46324            dateFormatter(date, locale, dateTimezoneOffset) :
46325            value === '\'\'' ? '\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
46326    });
46327    return text;
46328}
46329/**
46330 * Create a new Date object with the given date value, and the time set to midnight.
46331 *
46332 * We cannot use `new Date(year, month, date)` because it maps years between 0 and 99 to 1900-1999.
46333 * See: https://github.com/angular/angular/issues/40377
46334 *
46335 * Note that this function returns a Date object whose time is midnight in the current locale's
46336 * timezone. In the future we might want to change this to be midnight in UTC, but this would be a
46337 * considerable breaking change.
46338 */
46339function createDate(year, month, date) {
46340    // The `newDate` is set to midnight (UTC) on January 1st 1970.
46341    // - In PST this will be December 31st 1969 at 4pm.
46342    // - In GMT this will be January 1st 1970 at 1am.
46343    // Note that they even have different years, dates and months!
46344    const newDate = new Date(0);
46345    // `setFullYear()` allows years like 0001 to be set correctly. This function does not
46346    // change the internal time of the date.
46347    // Consider calling `setFullYear(2019, 8, 20)` (September 20, 2019).
46348    // - In PST this will now be September 20, 2019 at 4pm
46349    // - In GMT this will now be September 20, 2019 at 1am
46350    newDate.setFullYear(year, month, date);
46351    // We want the final date to be at local midnight, so we reset the time.
46352    // - In PST this will now be September 20, 2019 at 12am
46353    // - In GMT this will now be September 20, 2019 at 12am
46354    newDate.setHours(0, 0, 0);
46355    return newDate;
46356}
46357function getNamedFormat(locale, format) {
46358    const localeId = getLocaleId(locale);
46359    NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {};
46360    if (NAMED_FORMATS[localeId][format]) {
46361        return NAMED_FORMATS[localeId][format];
46362    }
46363    let formatValue = '';
46364    switch (format) {
46365        case 'shortDate':
46366            formatValue = getLocaleDateFormat(locale, FormatWidth.Short);
46367            break;
46368        case 'mediumDate':
46369            formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);
46370            break;
46371        case 'longDate':
46372            formatValue = getLocaleDateFormat(locale, FormatWidth.Long);
46373            break;
46374        case 'fullDate':
46375            formatValue = getLocaleDateFormat(locale, FormatWidth.Full);
46376            break;
46377        case 'shortTime':
46378            formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);
46379            break;
46380        case 'mediumTime':
46381            formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);
46382            break;
46383        case 'longTime':
46384            formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);
46385            break;
46386        case 'fullTime':
46387            formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);
46388            break;
46389        case 'short':
46390            const shortTime = getNamedFormat(locale, 'shortTime');
46391            const shortDate = getNamedFormat(locale, 'shortDate');
46392            formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
46393            break;
46394        case 'medium':
46395            const mediumTime = getNamedFormat(locale, 'mediumTime');
46396            const mediumDate = getNamedFormat(locale, 'mediumDate');
46397            formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
46398            break;
46399        case 'long':
46400            const longTime = getNamedFormat(locale, 'longTime');
46401            const longDate = getNamedFormat(locale, 'longDate');
46402            formatValue =
46403                formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
46404            break;
46405        case 'full':
46406            const fullTime = getNamedFormat(locale, 'fullTime');
46407            const fullDate = getNamedFormat(locale, 'fullDate');
46408            formatValue =
46409                formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
46410            break;
46411    }
46412    if (formatValue) {
46413        NAMED_FORMATS[localeId][format] = formatValue;
46414    }
46415    return formatValue;
46416}
46417function formatDateTime(str, opt_values) {
46418    if (opt_values) {
46419        str = str.replace(/\{([^}]+)}/g, function (match, key) {
46420            return (opt_values != null && key in opt_values) ? opt_values[key] : match;
46421        });
46422    }
46423    return str;
46424}
46425function padNumber(num, digits, minusSign = '-', trim, negWrap) {
46426    let neg = '';
46427    if (num < 0 || (negWrap && num <= 0)) {
46428        if (negWrap) {
46429            num = -num + 1;
46430        }
46431        else {
46432            num = -num;
46433            neg = minusSign;
46434        }
46435    }
46436    let strNum = String(num);
46437    while (strNum.length < digits) {
46438        strNum = '0' + strNum;
46439    }
46440    if (trim) {
46441        strNum = strNum.substr(strNum.length - digits);
46442    }
46443    return neg + strNum;
46444}
46445function formatFractionalSeconds(milliseconds, digits) {
46446    const strMs = padNumber(milliseconds, 3);
46447    return strMs.substr(0, digits);
46448}
46449/**
46450 * Returns a date formatter that transforms a date into its locale digit representation
46451 */
46452function dateGetter(name, size, offset = 0, trim = false, negWrap = false) {
46453    return function (date, locale) {
46454        let part = getDatePart(name, date);
46455        if (offset > 0 || part > -offset) {
46456            part += offset;
46457        }
46458        if (name === DateType.Hours) {
46459            if (part === 0 && offset === -12) {
46460                part = 12;
46461            }
46462        }
46463        else if (name === DateType.FractionalSeconds) {
46464            return formatFractionalSeconds(part, size);
46465        }
46466        const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
46467        return padNumber(part, size, localeMinus, trim, negWrap);
46468    };
46469}
46470function getDatePart(part, date) {
46471    switch (part) {
46472        case DateType.FullYear:
46473            return date.getFullYear();
46474        case DateType.Month:
46475            return date.getMonth();
46476        case DateType.Date:
46477            return date.getDate();
46478        case DateType.Hours:
46479            return date.getHours();
46480        case DateType.Minutes:
46481            return date.getMinutes();
46482        case DateType.Seconds:
46483            return date.getSeconds();
46484        case DateType.FractionalSeconds:
46485            return date.getMilliseconds();
46486        case DateType.Day:
46487            return date.getDay();
46488        default:
46489            throw new Error(`Unknown DateType value "${part}".`);
46490    }
46491}
46492/**
46493 * Returns a date formatter that transforms a date into its locale string representation
46494 */
46495function dateStrGetter(name, width, form = FormStyle.Format, extended = false) {
46496    return function (date, locale) {
46497        return getDateTranslation(date, locale, name, width, form, extended);
46498    };
46499}
46500/**
46501 * Returns the locale translation of a date for a given form, type and width
46502 */
46503function getDateTranslation(date, locale, name, width, form, extended) {
46504    switch (name) {
46505        case TranslationType.Months:
46506            return getLocaleMonthNames(locale, form, width)[date.getMonth()];
46507        case TranslationType.Days:
46508            return getLocaleDayNames(locale, form, width)[date.getDay()];
46509        case TranslationType.DayPeriods:
46510            const currentHours = date.getHours();
46511            const currentMinutes = date.getMinutes();
46512            if (extended) {
46513                const rules = getLocaleExtraDayPeriodRules(locale);
46514                const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);
46515                const index = rules.findIndex(rule => {
46516                    if (Array.isArray(rule)) {
46517                        // morning, afternoon, evening, night
46518                        const [from, to] = rule;
46519                        const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes;
46520                        const beforeTo = (currentHours < to.hours ||
46521                            (currentHours === to.hours && currentMinutes < to.minutes));
46522                        // We must account for normal rules that span a period during the day (e.g. 6am-9am)
46523                        // where `from` is less (earlier) than `to`. But also rules that span midnight (e.g.
46524                        // 10pm - 5am) where `from` is greater (later!) than `to`.
46525                        //
46526                        // In the first case the current time must be BOTH after `from` AND before `to`
46527                        // (e.g. 8am is after 6am AND before 10am).
46528                        //
46529                        // In the second case the current time must be EITHER after `from` OR before `to`
46530                        // (e.g. 4am is before 5am but not after 10pm; and 11pm is not before 5am but it is
46531                        // after 10pm).
46532                        if (from.hours < to.hours) {
46533                            if (afterFrom && beforeTo) {
46534                                return true;
46535                            }
46536                        }
46537                        else if (afterFrom || beforeTo) {
46538                            return true;
46539                        }
46540                    }
46541                    else { // noon or midnight
46542                        if (rule.hours === currentHours && rule.minutes === currentMinutes) {
46543                            return true;
46544                        }
46545                    }
46546                    return false;
46547                });
46548                if (index !== -1) {
46549                    return dayPeriods[index];
46550                }
46551            }
46552            // if no rules for the day periods, we use am/pm by default
46553            return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1];
46554        case TranslationType.Eras:
46555            return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];
46556        default:
46557            // This default case is not needed by TypeScript compiler, as the switch is exhaustive.
46558            // However Closure Compiler does not understand that and reports an error in typed mode.
46559            // The `throw new Error` below works around the problem, and the unexpected: never variable
46560            // makes sure tsc still checks this code is unreachable.
46561            const unexpected = name;
46562            throw new Error(`unexpected translation type ${unexpected}`);
46563    }
46564}
46565/**
46566 * Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or
46567 * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30,
46568 * extended = +04:30)
46569 */
46570function timeZoneGetter(width) {
46571    return function (date, locale, offset) {
46572        const zone = -1 * offset;
46573        const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
46574        const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
46575        switch (width) {
46576            case ZoneWidth.Short:
46577                return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +
46578                    padNumber(Math.abs(zone % 60), 2, minusSign);
46579            case ZoneWidth.ShortGMT:
46580                return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);
46581            case ZoneWidth.Long:
46582                return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +
46583                    padNumber(Math.abs(zone % 60), 2, minusSign);
46584            case ZoneWidth.Extended:
46585                if (offset === 0) {
46586                    return 'Z';
46587                }
46588                else {
46589                    return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +
46590                        padNumber(Math.abs(zone % 60), 2, minusSign);
46591                }
46592            default:
46593                throw new Error(`Unknown zone width "${width}"`);
46594        }
46595    };
46596}
46597const JANUARY = 0;
46598const THURSDAY = 4;
46599function getFirstThursdayOfYear(year) {
46600    const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
46601    return createDate(year, 0, 1 + ((firstDayOfYear <= THURSDAY) ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
46602}
46603function getThursdayThisWeek(datetime) {
46604    return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + (THURSDAY - datetime.getDay()));
46605}
46606function weekGetter(size, monthBased = false) {
46607    return function (date, locale) {
46608        let result;
46609        if (monthBased) {
46610            const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
46611            const today = date.getDate();
46612            result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
46613        }
46614        else {
46615            const thisThurs = getThursdayThisWeek(date);
46616            // Some days of a year are part of next year according to ISO 8601.
46617            // Compute the firstThurs from the year of this week's Thursday
46618            const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());
46619            const diff = thisThurs.getTime() - firstThurs.getTime();
46620            result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week
46621        }
46622        return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
46623    };
46624}
46625/**
46626 * Returns a date formatter that provides the week-numbering year for the input date.
46627 */
46628function weekNumberingYearGetter(size, trim = false) {
46629    return function (date, locale) {
46630        const thisThurs = getThursdayThisWeek(date);
46631        const weekNumberingYear = thisThurs.getFullYear();
46632        return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);
46633    };
46634}
46635const DATE_FORMATS = {};
46636// Based on CLDR formats:
46637// See complete list: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
46638// See also explanations: http://cldr.unicode.org/translation/date-time
46639// TODO(ocombe): support all missing cldr formats: Y, U, Q, D, F, e, c, j, J, C, A, v, V, X, x
46640function getDateFormatter(format) {
46641    if (DATE_FORMATS[format]) {
46642        return DATE_FORMATS[format];
46643    }
46644    let formatter;
46645    switch (format) {
46646        // Era name (AD/BC)
46647        case 'G':
46648        case 'GG':
46649        case 'GGG':
46650            formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated);
46651            break;
46652        case 'GGGG':
46653            formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide);
46654            break;
46655        case 'GGGGG':
46656            formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow);
46657            break;
46658        // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)
46659        case 'y':
46660            formatter = dateGetter(DateType.FullYear, 1, 0, false, true);
46661            break;
46662        // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
46663        case 'yy':
46664            formatter = dateGetter(DateType.FullYear, 2, 0, true, true);
46665            break;
46666        // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)
46667        case 'yyy':
46668            formatter = dateGetter(DateType.FullYear, 3, 0, false, true);
46669            break;
46670        // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)
46671        case 'yyyy':
46672            formatter = dateGetter(DateType.FullYear, 4, 0, false, true);
46673            break;
46674        // 1 digit representation of the week-numbering year, e.g. (AD 1 => 1, AD 199 => 199)
46675        case 'Y':
46676            formatter = weekNumberingYearGetter(1);
46677            break;
46678        // 2 digit representation of the week-numbering year, padded (00-99). (e.g. AD 2001 => 01, AD
46679        // 2010 => 10)
46680        case 'YY':
46681            formatter = weekNumberingYearGetter(2, true);
46682            break;
46683        // 3 digit representation of the week-numbering year, padded (000-999). (e.g. AD 1 => 001, AD
46684        // 2010 => 2010)
46685        case 'YYY':
46686            formatter = weekNumberingYearGetter(3);
46687            break;
46688        // 4 digit representation of the week-numbering year (e.g. AD 1 => 0001, AD 2010 => 2010)
46689        case 'YYYY':
46690            formatter = weekNumberingYearGetter(4);
46691            break;
46692        // Month of the year (1-12), numeric
46693        case 'M':
46694        case 'L':
46695            formatter = dateGetter(DateType.Month, 1, 1);
46696            break;
46697        case 'MM':
46698        case 'LL':
46699            formatter = dateGetter(DateType.Month, 2, 1);
46700            break;
46701        // Month of the year (January, ...), string, format
46702        case 'MMM':
46703            formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated);
46704            break;
46705        case 'MMMM':
46706            formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide);
46707            break;
46708        case 'MMMMM':
46709            formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow);
46710            break;
46711        // Month of the year (January, ...), string, standalone
46712        case 'LLL':
46713            formatter =
46714                dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone);
46715            break;
46716        case 'LLLL':
46717            formatter =
46718                dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone);
46719            break;
46720        case 'LLLLL':
46721            formatter =
46722                dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone);
46723            break;
46724        // Week of the year (1, ... 52)
46725        case 'w':
46726            formatter = weekGetter(1);
46727            break;
46728        case 'ww':
46729            formatter = weekGetter(2);
46730            break;
46731        // Week of the month (1, ...)
46732        case 'W':
46733            formatter = weekGetter(1, true);
46734            break;
46735        // Day of the month (1-31)
46736        case 'd':
46737            formatter = dateGetter(DateType.Date, 1);
46738            break;
46739        case 'dd':
46740            formatter = dateGetter(DateType.Date, 2);
46741            break;
46742        // Day of the Week
46743        case 'E':
46744        case 'EE':
46745        case 'EEE':
46746            formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated);
46747            break;
46748        case 'EEEE':
46749            formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide);
46750            break;
46751        case 'EEEEE':
46752            formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow);
46753            break;
46754        case 'EEEEEE':
46755            formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short);
46756            break;
46757        // Generic period of the day (am-pm)
46758        case 'a':
46759        case 'aa':
46760        case 'aaa':
46761            formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated);
46762            break;
46763        case 'aaaa':
46764            formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide);
46765            break;
46766        case 'aaaaa':
46767            formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow);
46768            break;
46769        // Extended period of the day (midnight, at night, ...), standalone
46770        case 'b':
46771        case 'bb':
46772        case 'bbb':
46773            formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
46774            break;
46775        case 'bbbb':
46776            formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true);
46777            break;
46778        case 'bbbbb':
46779            formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true);
46780            break;
46781        // Extended period of the day (midnight, night, ...), standalone
46782        case 'B':
46783        case 'BB':
46784        case 'BBB':
46785            formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true);
46786            break;
46787        case 'BBBB':
46788            formatter =
46789                dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true);
46790            break;
46791        case 'BBBBB':
46792            formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true);
46793            break;
46794        // Hour in AM/PM, (1-12)
46795        case 'h':
46796            formatter = dateGetter(DateType.Hours, 1, -12);
46797            break;
46798        case 'hh':
46799            formatter = dateGetter(DateType.Hours, 2, -12);
46800            break;
46801        // Hour of the day (0-23)
46802        case 'H':
46803            formatter = dateGetter(DateType.Hours, 1);
46804            break;
46805        // Hour in day, padded (00-23)
46806        case 'HH':
46807            formatter = dateGetter(DateType.Hours, 2);
46808            break;
46809        // Minute of the hour (0-59)
46810        case 'm':
46811            formatter = dateGetter(DateType.Minutes, 1);
46812            break;
46813        case 'mm':
46814            formatter = dateGetter(DateType.Minutes, 2);
46815            break;
46816        // Second of the minute (0-59)
46817        case 's':
46818            formatter = dateGetter(DateType.Seconds, 1);
46819            break;
46820        case 'ss':
46821            formatter = dateGetter(DateType.Seconds, 2);
46822            break;
46823        // Fractional second
46824        case 'S':
46825            formatter = dateGetter(DateType.FractionalSeconds, 1);
46826            break;
46827        case 'SS':
46828            formatter = dateGetter(DateType.FractionalSeconds, 2);
46829            break;
46830        case 'SSS':
46831            formatter = dateGetter(DateType.FractionalSeconds, 3);
46832            break;
46833        // Timezone ISO8601 short format (-0430)
46834        case 'Z':
46835        case 'ZZ':
46836        case 'ZZZ':
46837            formatter = timeZoneGetter(ZoneWidth.Short);
46838            break;
46839        // Timezone ISO8601 extended format (-04:30)
46840        case 'ZZZZZ':
46841            formatter = timeZoneGetter(ZoneWidth.Extended);
46842            break;
46843        // Timezone GMT short format (GMT+4)
46844        case 'O':
46845        case 'OO':
46846        case 'OOO':
46847        // Should be location, but fallback to format O instead because we don't have the data yet
46848        case 'z':
46849        case 'zz':
46850        case 'zzz':
46851            formatter = timeZoneGetter(ZoneWidth.ShortGMT);
46852            break;
46853        // Timezone GMT long format (GMT+0430)
46854        case 'OOOO':
46855        case 'ZZZZ':
46856        // Should be location, but fallback to format O instead because we don't have the data yet
46857        case 'zzzz':
46858            formatter = timeZoneGetter(ZoneWidth.Long);
46859            break;
46860        default:
46861            return null;
46862    }
46863    DATE_FORMATS[format] = formatter;
46864    return formatter;
46865}
46866function timezoneToOffset(timezone, fallback) {
vendor: 23,068 bytes, lines 46867-47483
46867    // Support: IE 11 only, Edge 13-15+
46868    // IE/Edge do not "understand" colon (`:`) in timezone
46869    timezone = timezone.replace(/:/g, '');
46870    const requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
46871    return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
46872}
46873function addDateMinutes(date, minutes) {
46874    date = new Date(date.getTime());
46875    date.setMinutes(date.getMinutes() + minutes);
46876    return date;
46877}
46878function convertTimezoneToLocal(date, timezone, reverse) {
46879    const reverseValue = reverse ? -1 : 1;
46880    const dateTimezoneOffset = date.getTimezoneOffset();
46881    const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
46882    return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
46883}
46884/**
46885 * Converts a value to date.
46886 *
46887 * Supported input formats:
46888 * - `Date`
46889 * - number: timestamp
46890 * - string: numeric (e.g. "1234"), ISO and date strings in a format supported by
46891 *   [Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
46892 *   Note: ISO strings without time return a date without timeoffset.
46893 *
46894 * Throws if unable to convert to a date.
46895 */
46896function toDate(value) {
46897    if (isDate(value)) {
46898        return value;
46899    }
46900    if (typeof value === 'number' && !isNaN(value)) {
46901        return new Date(value);
46902    }
46903    if (typeof value === 'string') {
46904        value = value.trim();
46905        if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) {
46906            /* For ISO Strings without time the day, month and year must be extracted from the ISO String
46907            before Date creation to avoid time offset and errors in the new Date.
46908            If we only replace '-' with ',' in the ISO String ("2015,01,01"), and try to create a new
46909            date, some browsers (e.g. IE 9) will throw an invalid Date error.
46910            If we leave the '-' ("2015-01-01") and try to create a new Date("2015-01-01") the timeoffset
46911            is applied.
46912            Note: ISO months are 0 for January, 1 for February, ... */
46913            const [y, m = 1, d = 1] = value.split('-').map((val) => +val);
46914            return createDate(y, m - 1, d);
46915        }
46916        const parsedNb = parseFloat(value);
46917        // any string that only contains numbers, like "1234" but not like "1234hello"
46918        if (!isNaN(value - parsedNb)) {
46919            return new Date(parsedNb);
46920        }
46921        let match;
46922        if (match = value.match(ISO8601_DATE_REGEX)) {
46923            return isoStringToDate(match);
46924        }
46925    }
46926    const date = new Date(value);
46927    if (!isDate(date)) {
46928        throw new Error(`Unable to convert "${value}" into a date`);
46929    }
46930    return date;
46931}
46932/**
46933 * Converts a date in ISO8601 to a Date.
46934 * Used instead of `Date.parse` because of browser discrepancies.
46935 */
46936function isoStringToDate(match) {
46937    const date = new Date(0);
46938    let tzHour = 0;
46939    let tzMin = 0;
46940    // match[8] means that the string contains "Z" (UTC) or a timezone like "+01:00" or "+0100"
46941    const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;
46942    const timeSetter = match[8] ? date.setUTCHours : date.setHours;
46943    // if there is a timezone defined like "+01:00" or "+0100"
46944    if (match[9]) {
46945        tzHour = Number(match[9] + match[10]);
46946        tzMin = Number(match[9] + match[11]);
46947    }
46948    dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));
46949    const h = Number(match[4] || 0) - tzHour;
46950    const m = Number(match[5] || 0) - tzMin;
46951    const s = Number(match[6] || 0);
46952    // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)
46953    // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`
46954    // becomes `999ms`.
46955    const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);
46956    timeSetter.call(date, h, m, s, ms);
46957    return date;
46958}
46959function isDate(value) {
46960    return value instanceof Date && !isNaN(value.valueOf());
46961}
46962
46963/**
46964 * @license
46965 * Copyright Google LLC All Rights Reserved.
46966 *
46967 * Use of this source code is governed by an MIT-style license that can be
46968 * found in the LICENSE file at https://angular.io/license
46969 */
46970const NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
46971const MAX_DIGITS = 22;
46972const DECIMAL_SEP = '.';
46973const ZERO_CHAR = '0';
46974const PATTERN_SEP = ';';
46975const GROUP_SEP = ',';
46976const DIGIT_CHAR = '#';
46977const CURRENCY_CHAR = '¤';
46978const PERCENT_CHAR = '%';
46979/**
46980 * Transforms a number to a locale string based on a style and a format.
46981 */
46982function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) {
46983    let formattedText = '';
46984    let isZero = false;
46985    if (!isFinite(value)) {
46986        formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
46987    }
46988    else {
46989        let parsedNumber = parseNumber(value);
46990        if (isPercent) {
46991            parsedNumber = toPercent(parsedNumber);
46992        }
46993        let minInt = pattern.minInt;
46994        let minFraction = pattern.minFrac;
46995        let maxFraction = pattern.maxFrac;
46996        if (digitsInfo) {
46997            const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
46998            if (parts === null) {
46999                throw new Error(`${digitsInfo} is not a valid digit info`);
47000            }
47001            const minIntPart = parts[1];
47002            const minFractionPart = parts[3];
47003            const maxFractionPart = parts[5];
47004            if (minIntPart != null) {
47005                minInt = parseIntAutoRadix(minIntPart);
47006            }
47007            if (minFractionPart != null) {
47008                minFraction = parseIntAutoRadix(minFractionPart);
47009            }
47010            if (maxFractionPart != null) {
47011                maxFraction = parseIntAutoRadix(maxFractionPart);
47012            }
47013            else if (minFractionPart != null && minFraction > maxFraction) {
47014                maxFraction = minFraction;
47015            }
47016        }
47017        roundNumber(parsedNumber, minFraction, maxFraction);
47018        let digits = parsedNumber.digits;
47019        let integerLen = parsedNumber.integerLen;
47020        const exponent = parsedNumber.exponent;
47021        let decimals = [];
47022        isZero = digits.every(d => !d);
47023        // pad zeros for small numbers
47024        for (; integerLen < minInt; integerLen++) {
47025            digits.unshift(0);
47026        }
47027        // pad zeros for small numbers
47028        for (; integerLen < 0; integerLen++) {
47029            digits.unshift(0);
47030        }
47031        // extract decimals digits
47032        if (integerLen > 0) {
47033            decimals = digits.splice(integerLen, digits.length);
47034        }
47035        else {
47036            decimals = digits;
47037            digits = [0];
47038        }
47039        // format the integer digits with grouping separators
47040        const groups = [];
47041        if (digits.length >= pattern.lgSize) {
47042            groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));
47043        }
47044        while (digits.length > pattern.gSize) {
47045            groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));
47046        }
47047        if (digits.length) {
47048            groups.unshift(digits.join(''));
47049        }
47050        formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
47051        // append the decimal digits
47052        if (decimals.length) {
47053            formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');
47054        }
47055        if (exponent) {
47056            formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent;
47057        }
47058    }
47059    if (value < 0 && !isZero) {
47060        formattedText = pattern.negPre + formattedText + pattern.negSuf;
47061    }
47062    else {
47063        formattedText = pattern.posPre + formattedText + pattern.posSuf;
47064    }
47065    return formattedText;
47066}
47067/**
47068 * @ngModule CommonModule
47069 * @description
47070 *
47071 * Formats a number as currency using locale rules.
47072 *
47073 * @param value The number to format.
47074 * @param locale A locale code for the locale format rules to use.
47075 * @param currency A string containing the currency symbol or its name,
47076 * such as "$" or "Canadian Dollar". Used in output string, but does not affect the operation
47077 * of the function.
47078 * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
47079 * currency code, such as `USD` for the US dollar and `EUR` for the euro.
47080 * Used to determine the number of digits in the decimal part.
47081 * @param digitsInfo Decimal representation options, specified by a string in the following format:
47082 * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.
47083 *
47084 * @returns The formatted currency value.
47085 *
47086 * @see `formatNumber()`
47087 * @see `DecimalPipe`
47088 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
47089 *
47090 * @publicApi
47091 */
47092function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
47093    const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
47094    const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
47095    pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
47096    pattern.maxFrac = pattern.minFrac;
47097    const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
47098    return res
47099        .replace(CURRENCY_CHAR, currency)
47100        // if we have 2 time the currency character, the second one is ignored
47101        .replace(CURRENCY_CHAR, '')
47102        // If there is a spacing between currency character and the value and
47103        // the currency character is supressed by passing an empty string, the
47104        // spacing character would remain as part of the string. Then we
47105        // should remove it.
47106        .trim();
47107}
47108/**
47109 * @ngModule CommonModule
47110 * @description
47111 *
47112 * Formats a number as a percentage according to locale rules.
47113 *
47114 * @param value The number to format.
47115 * @param locale A locale code for the locale format rules to use.
47116 * @param digitsInfo Decimal representation options, specified by a string in the following format:
47117 * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.
47118 *
47119 * @returns The formatted percentage value.
47120 *
47121 * @see `formatNumber()`
47122 * @see `DecimalPipe`
47123 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
47124 * @publicApi
47125 *
47126 */
47127function formatPercent(value, locale, digitsInfo) {
47128    const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);
47129    const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
47130    const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);
47131    return res.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
47132}
47133/**
47134 * @ngModule CommonModule
47135 * @description
47136 *
47137 * Formats a number as text, with group sizing, separator, and other
47138 * parameters based on the locale.
47139 *
47140 * @param value The number to format.
47141 * @param locale A locale code for the locale format rules to use.
47142 * @param digitsInfo Decimal representation options, specified by a string in the following format:
47143 * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.
47144 *
47145 * @returns The formatted text string.
47146 * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)
47147 *
47148 * @publicApi
47149 */
47150function formatNumber(value, locale, digitsInfo) {
47151    const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);
47152    const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
47153    return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);
47154}
47155function parseNumberFormat(format, minusSign = '-') {
47156    const p = {
47157        minInt: 1,
47158        minFrac: 0,
47159        maxFrac: 0,
47160        posPre: '',
47161        posSuf: '',
47162        negPre: '',
47163        negSuf: '',
47164        gSize: 0,
47165        lgSize: 0
47166    };
47167    const patternParts = format.split(PATTERN_SEP);
47168    const positive = patternParts[0];
47169    const negative = patternParts[1];
47170    const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ?
47171        positive.split(DECIMAL_SEP) :
47172        [
47173            positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1),
47174            positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)
47175        ], integer = positiveParts[0], fraction = positiveParts[1] || '';
47176    p.posPre = integer.substr(0, integer.indexOf(DIGIT_CHAR));
47177    for (let i = 0; i < fraction.length; i++) {
47178        const ch = fraction.charAt(i);
47179        if (ch === ZERO_CHAR) {
47180            p.minFrac = p.maxFrac = i + 1;
47181        }
47182        else if (ch === DIGIT_CHAR) {
47183            p.maxFrac = i + 1;
47184        }
47185        else {
47186            p.posSuf += ch;
47187        }
47188    }
47189    const groups = integer.split(GROUP_SEP);
47190    p.gSize = groups[1] ? groups[1].length : 0;
47191    p.lgSize = (groups[2] || groups[1]) ? (groups[2] || groups[1]).length : 0;
47192    if (negative) {
47193        const trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR);
47194        p.negPre = negative.substr(0, pos).replace(/'/g, '');
47195        p.negSuf = negative.substr(pos + trunkLen).replace(/'/g, '');
47196    }
47197    else {
47198        p.negPre = minusSign + p.posPre;
47199        p.negSuf = p.posSuf;
47200    }
47201    return p;
47202}
47203// Transforms a parsed number into a percentage by multiplying it by 100
47204function toPercent(parsedNumber) {
47205    // if the number is 0, don't do anything
47206    if (parsedNumber.digits[0] === 0) {
47207        return parsedNumber;
47208    }
47209    // Getting the current number of decimals
47210    const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
47211    if (parsedNumber.exponent) {
47212        parsedNumber.exponent += 2;
47213    }
47214    else {
47215        if (fractionLen === 0) {
47216            parsedNumber.digits.push(0, 0);
47217        }
47218        else if (fractionLen === 1) {
47219            parsedNumber.digits.push(0);
47220        }
47221        parsedNumber.integerLen += 2;
47222    }
47223    return parsedNumber;
47224}
47225/**
47226 * Parses a number.
47227 * Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/
47228 */
47229function parseNumber(num) {
47230    let numStr = Math.abs(num) + '';
47231    let exponent = 0, digits, integerLen;
47232    let i, j, zeros;
47233    // Decimal point?
47234    if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
47235        numStr = numStr.replace(DECIMAL_SEP, '');
47236    }
47237    // Exponential form?
47238    if ((i = numStr.search(/e/i)) > 0) {
47239        // Work out the exponent.
47240        if (integerLen < 0)
47241            integerLen = i;
47242        integerLen += +numStr.slice(i + 1);
47243        numStr = numStr.substring(0, i);
47244    }
47245    else if (integerLen < 0) {
47246        // There was no decimal point or exponent so it is an integer.
47247        integerLen = numStr.length;
47248    }
47249    // Count the number of leading zeros.
47250    for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */
47251    }
47252    if (i === (zeros = numStr.length)) {
47253        // The digits are all zero.
47254        digits = [0];
47255        integerLen = 1;
47256    }
47257    else {
47258        // Count the number of trailing zeros
47259        zeros--;
47260        while (numStr.charAt(zeros) === ZERO_CHAR)
47261            zeros--;
47262        // Trailing zeros are insignificant so ignore them
47263        integerLen -= i;
47264        digits = [];
47265        // Convert string to array of digits without leading/trailing zeros.
47266        for (j = 0; i <= zeros; i++, j++) {
47267            digits[j] = Number(numStr.charAt(i));
47268        }
47269    }
47270    // If the number overflows the maximum allowed digits then use an exponent.
47271    if (integerLen > MAX_DIGITS) {
47272        digits = digits.splice(0, MAX_DIGITS - 1);
47273        exponent = integerLen - 1;
47274        integerLen = 1;
47275    }
47276    return { digits, exponent, integerLen };
47277}
47278/**
47279 * Round the parsed number to the specified number of decimal places
47280 * This function changes the parsedNumber in-place
47281 */
47282function roundNumber(parsedNumber, minFrac, maxFrac) {
47283    if (minFrac > maxFrac) {
47284        throw new Error(`The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`);
47285    }
47286    let digits = parsedNumber.digits;
47287    let fractionLen = digits.length - parsedNumber.integerLen;
47288    const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
47289    // The index of the digit to where rounding is to occur
47290    let roundAt = fractionSize + parsedNumber.integerLen;
47291    let digit = digits[roundAt];
47292    if (roundAt > 0) {
47293        // Drop fractional digits beyond `roundAt`
47294        digits.splice(Math.max(parsedNumber.integerLen, roundAt));
47295        // Set non-fractional digits beyond `roundAt` to 0
47296        for (let j = roundAt; j < digits.length; j++) {
47297            digits[j] = 0;
47298        }
47299    }
47300    else {
47301        // We rounded to zero so reset the parsedNumber
47302        fractionLen = Math.max(0, fractionLen);
47303        parsedNumber.integerLen = 1;
47304        digits.length = Math.max(1, roundAt = fractionSize + 1);
47305        digits[0] = 0;
47306        for (let i = 1; i < roundAt; i++)
47307            digits[i] = 0;
47308    }
47309    if (digit >= 5) {
47310        if (roundAt - 1 < 0) {
47311            for (let k = 0; k > roundAt; k--) {
47312                digits.unshift(0);
47313                parsedNumber.integerLen++;
47314            }
47315            digits.unshift(1);
47316            parsedNumber.integerLen++;
47317        }
47318        else {
47319            digits[roundAt - 1]++;
47320        }
47321    }
47322    // Pad out with zeros to get the required fraction length
47323    for (; fractionLen < Math.max(0, fractionSize); fractionLen++)
47324        digits.push(0);
47325    let dropTrailingZeros = fractionSize !== 0;
47326    // Minimal length = nb of decimals required + current nb of integers
47327    // Any number besides that is optional and can be removed if it's a trailing 0
47328    const minLen = minFrac + parsedNumber.integerLen;
47329    // Do any carrying, e.g. a digit was rounded up to 10
47330    const carry = digits.reduceRight(function (carry, d, i, digits) {
47331        d = d + carry;
47332        digits[i] = d < 10 ? d : d - 10; // d % 10
47333        if (dropTrailingZeros) {
47334            // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)
47335            if (digits[i] === 0 && i >= minLen) {
47336                digits.pop();
47337            }
47338            else {
47339                dropTrailingZeros = false;
47340            }
47341        }
47342        return d >= 10 ? 1 : 0; // Math.floor(d / 10);
47343    }, 0);
47344    if (carry) {
47345        digits.unshift(carry);
47346        parsedNumber.integerLen++;
47347    }
47348}
47349function parseIntAutoRadix(text) {
47350    const result = parseInt(text);
47351    if (isNaN(result)) {
47352        throw new Error('Invalid integer literal when parsing ' + text);
47353    }
47354    return result;
47355}
47356
47357/**
47358 * @license
47359 * Copyright Google LLC All Rights Reserved.
47360 *
47361 * Use of this source code is governed by an MIT-style license that can be
47362 * found in the LICENSE file at https://angular.io/license
47363 */
47364/**
47365 * @publicApi
47366 */
47367class NgLocalization {
47368}
47369/**
47370 * Returns the plural category for a given value.
47371 * - "=value" when the case exists,
47372 * - the plural category otherwise
47373 */
47374function getPluralCategory(value, cases, ngLocalization, locale) {
47375    let key = `=${value}`;
47376    if (cases.indexOf(key) > -1) {
47377        return key;
47378    }
47379    key = ngLocalization.getPluralCategory(value, locale);
47380    if (cases.indexOf(key) > -1) {
47381        return key;
47382    }
47383    if (cases.indexOf('other') > -1) {
47384        return 'other';
47385    }
47386    throw new Error(`No plural message found for value "${value}"`);
47387}
47388/**
47389 * Returns the plural case based on the locale
47390 *
47391 * @publicApi
47392 */
47393class NgLocaleLocalization extends NgLocalization {
47394    constructor(locale) {
47395        super();
47396        this.locale = locale;
47397    }
47398    getPluralCategory(value, locale) {
47399        const plural = getLocalePluralCase(locale || this.locale)(value);
47400        switch (plural) {
47401            case Plural.Zero:
47402                return 'zero';
47403            case Plural.One:
47404                return 'one';
47405            case Plural.Two:
47406                return 'two';
47407            case Plural.Few:
47408                return 'few';
47409            case Plural.Many:
47410                return 'many';
47411            default:
47412                return 'other';
47413        }
47414    }
47415}
47416NgLocaleLocalization.ɵfac = function NgLocaleLocalization_Factory(t) { return new (t || NgLocaleLocalization)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])); };
47417NgLocaleLocalization.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: NgLocaleLocalization, factory: NgLocaleLocalization.ɵfac });
47418NgLocaleLocalization.ctorParameters = () => [
47419    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
47420];
47421(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgLocaleLocalization, [{
47422        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"]
47423    }], function () { return [{ type: String, decorators: [{
47424                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
47425                args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]]
47426            }] }]; }, null); })();
47427
47428/**
47429 * @license
47430 * Copyright Google LLC All Rights Reserved.
47431 *
47432 * Use of this source code is governed by an MIT-style license that can be
47433 * found in the LICENSE file at https://angular.io/license
47434 */
47435/**
47436 * Register global data to be used internally by Angular. See the
47437 * ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale data.
47438 *
47439 * The signature registerLocaleData(data: any, extraData?: any) is deprecated since v5.1
47440 *
47441 * @publicApi
47442 */
47443function registerLocaleData(data, localeId, extraData) {
47444    return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵregisterLocaleData"])(data, localeId, extraData);
47445}
47446
47447/**
47448 * @license
47449 * Copyright Google LLC All Rights Reserved.
47450 *
47451 * Use of this source code is governed by an MIT-style license that can be
47452 * found in the LICENSE file at https://angular.io/license
47453 */
47454function parseCookieValue(cookieStr, name) {
47455    name = encodeURIComponent(name);
47456    for (const cookie of cookieStr.split(';')) {
47457        const eqIndex = cookie.indexOf('=');
47458        const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];
47459        if (cookieName.trim() === name) {
47460            return decodeURIComponent(cookieValue);
47461        }
47462    }
47463    return null;
47464}
47465
47466/**
47467 * @license
47468 * Copyright Google LLC All Rights Reserved.
47469 *
47470 * Use of this source code is governed by an MIT-style license that can be
47471 * found in the LICENSE file at https://angular.io/license
47472 */
47473/**
47474 * @ngModule CommonModule
47475 *
47476 * @usageNotes
47477 * ```
47478 *     <some-element [ngClass]="'first second'">...</some-element>
47479 *
47480 *     <some-element [ngClass]="['first', 'second']">...</some-element>
47481 *
47482 *     <some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element>
47483 *
47484 *     <some-element [ngClass]="stringExp|arrayExp|objExp">...</some-element>
47485 *
47486 *     <some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
47487 * ```
47488 *
47489 * @description
47490 *
47491 * Adds and removes CSS classes on an HTML element.
47492 *
47493 * The CSS classes are updated as follows, depending on the type of the expression evaluation:
47494 * - `string` - the CSS classes listed in the string (space delimited) are added,
47495 * - `Array` - the CSS classes declared as Array elements are added,
47496 * - `Object` - keys are CSS classes that get added when the expression given in the value
47497 *              evaluates to a truthy value, otherwise they are removed.
47498 *
47499 * @publicApi
47500 */
47501class NgClass {
47502    constructor(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) {
47503        this._iterableDiffers = _iterableDiffers;
47504        this._keyValueDiffers = _keyValueDiffers;
47505        this._ngEl = _ngEl;
47506        this._renderer = _renderer;
47507        this._iterableDiffer = null;
47508        this._keyValueDiffer = null;
47509        this._initialClasses = [];
47510        this._rawClass = null;
47511    }
47512    set klass(value) {
47513        this._removeClasses(this._initialClasses);
47514        this._initialClasses = typeof value === 'string' ? value.split(/\s+/) : [];
47515        this._applyClasses(this._initialClasses);
47516        this._applyClasses(this._rawClass);
47517    }
47518    set ngClass(value) {
47519        this._removeClasses(this._rawClass);
47520        this._applyClasses(this._initialClasses);
47521        this._iterableDiffer = null;
47522        this._keyValueDiffer = null;
47523        this._rawClass = typeof value === 'string' ? value.split(/\s+/) : value;
47524        if (this._rawClass) {
47525            if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisListLikeIterable"])(this._rawClass)) {
47526                this._iterableDiffer = this._iterableDiffers.find(this._rawClass).create();
47527            }
47528            else {
47529                this._keyValueDiffer = this._keyValueDiffers.find(this._rawClass).create();
47530            }
47531        }
47532    }
47533    ngDoCheck() {
47534        if (this._iterableDiffer) {
47535            const iterableChanges = this._iterableDiffer.diff(this._rawClass);
47536            if (iterableChanges) {
47537                this._applyIterableChanges(iterableChanges);
47538            }
47539        }
47540        else if (this._keyValueDiffer) {
47541            const keyValueChanges = this._keyValueDiffer.diff(this._rawClass);
47542            if (keyValueChanges) {
47543                this._applyKeyValueChanges(keyValueChanges);
47544            }
47545        }
47546    }
47547    _applyKeyValueChanges(changes) {
47548        changes.forEachAddedItem((record) => this._toggleClass(record.key, record.currentValue));
47549        changes.forEachChangedItem((record) => this._toggleClass(record.key, record.currentValue));
47550        changes.forEachRemovedItem((record) => {
47551            if (record.previousValue) {
47552                this._toggleClass(record.key, false);
47553            }
47554        });
47555    }
47556    _applyIterableChanges(changes) {
47557        changes.forEachAddedItem((record) => {
47558            if (typeof record.item === 'string') {
47559                this._toggleClass(record.item, true);
47560            }
47561            else {
47562                throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(record.item)}`);
47563            }
47564        });
47565        changes.forEachRemovedItem((record) => this._toggleClass(record.item, false));
47566    }
47567    /**
47568     * Applies a collection of CSS classes to the DOM element.
47569     *
47570     * For argument of type Set and Array CSS class names contained in those collections are always
47571     * added.
47572     * For argument of type Map CSS class name in the map's key is toggled based on the value (added
47573     * for truthy and removed for falsy).
47574     */
47575    _applyClasses(rawClassVal) {
47576        if (rawClassVal) {
47577            if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {
47578                rawClassVal.forEach((klass) => this._toggleClass(klass, true));
47579            }
47580            else {
47581                Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, !!rawClassVal[klass]));
47582            }
47583        }
47584    }
47585    /**
47586     * Removes a collection of CSS classes from the DOM element. This is mostly useful for cleanup
47587     * purposes.
47588     */
47589    _removeClasses(rawClassVal) {
47590        if (rawClassVal) {
47591            if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {
47592                rawClassVal.forEach((klass) => this._toggleClass(klass, false));
47593            }
47594            else {
47595                Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));
47596            }
47597        }
47598    }
47599    _toggleClass(klass, enabled) {
47600        klass = klass.trim();
47601        if (klass) {
47602            klass.split(/\s+/g).forEach(klass => {
47603                if (enabled) {
47604                    this._renderer.addClass(this._ngEl.nativeElement, klass);
47605                }
47606                else {
47607                    this._renderer.removeClass(this._ngEl.nativeElement, klass);
47608                }
47609            });
47610        }
47611    }
47612}
47613NgClass.ɵfac = function NgClass_Factory(t) { return new (t || NgClass)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"])); };
47614NgClass.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgClass, selectors: [["", "ngClass", ""]], inputs: { klass: ["class", "klass"], ngClass: "ngClass" } });
47615NgClass.ctorParameters = () => [
47616    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] },
47617    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] },
47618    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] },
47619    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }
47620];
47621NgClass.propDecorators = {
47622    klass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['class',] }],
47623    ngClass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngClass',] }]
47624};
47625(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgClass, [{
47626        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
47627        args: [{ selector: '[ngClass]' }]
47628    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }]; }, { klass: [{
47629            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"],
47630            args: ['class']
47631        }], ngClass: [{
47632            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"],
47633            args: ['ngClass']
47634        }] }); })();
47635
47636/**
47637 * @license
47638 * Copyright Google LLC All Rights Reserved.
47639 *
47640 * Use of this source code is governed by an MIT-style license that can be
47641 * found in the LICENSE file at https://angular.io/license
47642 */
47643/**
47644 * Instantiates a single {@link Component} type and inserts its Host View into current View.
47645 * `NgComponentOutlet` provides a declarative approach for dynamic component creation.
47646 *
47647 * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and
47648 * any existing component will get destroyed.
47649 *
47650 * @usageNotes
47651 *
47652 * ### Fine tune control
47653 *
47654 * You can control the component creation process by using the following optional attributes:
47655 *
47656 * * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for
47657 * the Component. Defaults to the injector of the current view container.
47658 *
47659 * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content
47660 * section of the component, if exists.
47661 *
47662 * * `ngComponentOutletNgModuleFactory`: Optional module factory to allow dynamically loading other
47663 * module, then load a component from that module.
47664 *
47665 * ### Syntax
47666 *
47667 * Simple
47668 * ```
47669 * <ng-container *ngComponentOutlet="componentTypeExpression"></ng-container>
47670 * ```
47671 *
47672 * Customized injector/content
47673 * ```
47674 * <ng-container *ngComponentOutlet="componentTypeExpression;
47675 *                                   injector: injectorExpression;
47676 *                                   content: contentNodesExpression;">
47677 * </ng-container>
47678 * ```
47679 *
47680 * Customized ngModuleFactory
47681 * ```
47682 * <ng-container *ngComponentOutlet="componentTypeExpression;
47683 *                                   ngModuleFactory: moduleFactory;">
47684 * </ng-container>
47685 * ```
47686 *
47687 * ### A simple example
47688 *
47689 * {@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}
47690 *
47691 * A more complete example with additional options:
47692 *
47693 * {@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}
47694 *
47695 * @publicApi
47696 * @ngModule CommonModule
47697 */
47698class NgComponentOutlet {
47699    constructor(_viewContainerRef) {
47700        this._viewContainerRef = _viewContainerRef;
47701        this._componentRef = null;
47702        this._moduleRef = null;
47703    }
47704    ngOnChanges(changes) {
47705        this._viewContainerRef.clear();
47706        this._componentRef = null;
47707        if (this.ngComponentOutlet) {
47708            const elInjector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
47709            if (changes['ngComponentOutletNgModuleFactory']) {
47710                if (this._moduleRef)
47711                    this._moduleRef.destroy();
47712                if (this.ngComponentOutletNgModuleFactory) {
47713                    const parentModule = elInjector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModuleRef"]);
47714                    this._moduleRef = this.ngComponentOutletNgModuleFactory.create(parentModule.injector);
47715                }
47716                else {
47717                    this._moduleRef = null;
47718                }
47719            }
47720            const componentFactoryResolver = this._moduleRef ? this._moduleRef.componentFactoryResolver :
47721                elInjector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ComponentFactoryResolver"]);
47722            const componentFactory = componentFactoryResolver.resolveComponentFactory(this.ngComponentOutlet);
47723            this._componentRef = this._viewContainerRef.createComponent(componentFactory, this._viewContainerRef.length, elInjector, this.ngComponentOutletContent);
47724        }
47725    }
47726    ngOnDestroy() {
47727        if (this._moduleRef)
47728            this._moduleRef.destroy();
47729    }
47730}
47731NgComponentOutlet.ɵfac = function NgComponentOutlet_Factory(t) { return new (t || NgComponentOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"])); };
47732NgComponentOutlet.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgComponentOutlet, selectors: [["", "ngComponentOutlet", ""]], inputs: { ngComponentOutlet: "ngComponentOutlet", ngComponentOutletInjector: "ngComponentOutletInjector", ngComponentOutletContent: "ngComponentOutletContent", ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] });
47733NgComponentOutlet.ctorParameters = () => [
47734    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }
47735];
47736NgComponentOutlet.propDecorators = {
47737    ngComponentOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
47738    ngComponentOutletInjector: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
47739    ngComponentOutletContent: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
47740    ngComponentOutletNgModuleFactory: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
47741};
47742(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgComponentOutlet, [{
47743        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
47744        args: [{ selector: '[ngComponentOutlet]' }]
47745    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }]; }, { ngComponentOutlet: [{
47746            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
47747        }], ngComponentOutletInjector: [{
47748            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
47749        }], ngComponentOutletContent: [{
47750            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
47751        }], ngComponentOutletNgModuleFactory: [{
47752            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
47753        }] }); })();
47754
47755/**
47756 * @license
47757 * Copyright Google LLC All Rights Reserved.
47758 *
47759 * Use of this source code is governed by an MIT-style license that can be
47760 * found in the LICENSE file at https://angular.io/license
47761 */
47762/**
47763 * @publicApi
47764 */
47765class NgForOfContext {
47766    constructor($implicit, ngForOf, index, count) {
47767        this.$implicit = $implicit;
47768        this.ngForOf = ngForOf;
47769        this.index = index;
47770        this.count = count;
47771    }
47772    get first() {
47773        return this.index === 0;
47774    }
47775    get last() {
47776        return this.index === this.count - 1;
47777    }
47778    get even() {
47779        return this.index % 2 === 0;
47780    }
47781    get odd() {
47782        return !this.even;
47783    }
47784}
47785/**
47786 * A [structural directive](guide/structural-directives) that renders
47787 * a template for each item in a collection.
47788 * The directive is placed on an element, which becomes the parent
47789 * of the cloned templates.
47790 *
47791 * The `ngForOf` directive is generally used in the
47792 * [shorthand form](guide/structural-directives#asterisk) `*ngFor`.
47793 * In this form, the template to be rendered for each iteration is the content
47794 * of an anchor element containing the directive.
47795 *
47796 * The following example shows the shorthand syntax with some options,
47797 * contained in an `<li>` element.
47798 *
47799 * ```
47800 * <li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>
47801 * ```
47802 *
47803 * The shorthand form expands into a long form that uses the `ngForOf` selector
47804 * on an `<ng-template>` element.
47805 * The content of the `<ng-template>` element is the `<li>` element that held the
47806 * short-form directive.
47807 *
47808 * Here is the expanded version of the short-form example.
47809 *
47810 * ```
47811 * <ng-template ngFor let-item [ngForOf]="items" let-i="index" [ngForTrackBy]="trackByFn">
47812 *   <li>...</li>
47813 * </ng-template>
47814 * ```
47815 *
47816 * Angular automatically expands the shorthand syntax as it compiles the template.
47817 * The context for each embedded view is logically merged to the current component
47818 * context according to its lexical position.
47819 *
47820 * When using the shorthand syntax, Angular allows only [one structural directive
47821 * on an element](guide/built-in-directives#one-per-element).
47822 * If you want to iterate conditionally, for example,
47823 * put the `*ngIf` on a container element that wraps the `*ngFor` element.
47824 * For futher discussion, see
47825 * [Structural Directives](guide/built-in-directives#one-per-element).
47826 *
47827 * @usageNotes
47828 *
47829 * ### Local variables
47830 *
47831 * `NgForOf` provides exported values that can be aliased to local variables.
47832 * For example:
47833 *
47834 *  ```
47835 * <li *ngFor="let user of users; index as i; first as isFirst">
47836 *    {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span>
47837 * </li>
47838 * ```
47839 *
47840 * The following exported values can be aliased to local variables:
47841 *
47842 * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).
47843 * - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is
47844 * more complex then a property access, for example when using the async pipe (`userStreams |
47845 * async`).
47846 * - `index: number`: The index of the current item in the iterable.
47847 * - `count: number`: The length of the iterable.
47848 * - `first: boolean`: True when the item is the first item in the iterable.
47849 * - `last: boolean`: True when the item is the last item in the iterable.
47850 * - `even: boolean`: True when the item has an even index in the iterable.
47851 * - `odd: boolean`: True when the item has an odd index in the iterable.
47852 *
47853 * ### Change propagation
47854 *
47855 * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:
47856 *
47857 * * When an item is added, a new instance of the template is added to the DOM.
47858 * * When an item is removed, its template instance is removed from the DOM.
47859 * * When items are reordered, their respective templates are reordered in the DOM.
47860 *
47861 * Angular uses object identity to track insertions and deletions within the iterator and reproduce
47862 * those changes in the DOM. This has important implications for animations and any stateful
47863 * controls that are present, such as `<input>` elements that accept user input. Inserted rows can
47864 * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state
47865 * such as user input.
47866 * For more on animations, see [Transitions and Triggers](guide/transition-and-triggers).
47867 *
47868 * The identities of elements in the iterator can change while the data does not.
47869 * This can happen, for example, if the iterator is produced from an RPC to the server, and that
47870 * RPC is re-run. Even if the data hasn't changed, the second response produces objects with
47871 * different identities, and Angular must tear down the entire DOM and rebuild it (as if all old
47872 * elements were deleted and all new elements inserted).
47873 *
47874 * To avoid this expensive operation, you can customize the default tracking algorithm.
47875 * by supplying the `trackBy` option to `NgForOf`.
47876 * `trackBy` takes a function that has two arguments: `index` and `item`.
47877 * If `trackBy` is given, Angular tracks changes by the return value of the function.
47878 *
47879 * @see [Structural Directives](guide/structural-directives)
47880 * @ngModule CommonModule
47881 * @publicApi
47882 */
47883class NgForOf {
47884    constructor(_viewContainer, _template, _differs) {
47885        this._viewContainer = _viewContainer;
47886        this._template = _template;
47887        this._differs = _differs;
47888        this._ngForOf = null;
47889        this._ngForOfDirty = true;
47890        this._differ = null;
47891    }
47892    /**
47893     * The value of the iterable expression, which can be used as a
47894     * [template input variable](guide/structural-directives#shorthand).
47895     */
47896    set ngForOf(ngForOf) {
47897        this._ngForOf = ngForOf;
47898        this._ngForOfDirty = true;
47899    }
47900    /**
47901     * A function that defines how to track changes for items in the iterable.
47902     *
47903     * When items are added, moved, or removed in the iterable,
47904     * the directive must re-render the appropriate DOM nodes.
47905     * To minimize churn in the DOM, only nodes that have changed
47906     * are re-rendered.
47907     *
47908     * By default, the change detector assumes that
47909     * the object instance identifies the node in the iterable.
47910     * When this function is supplied, the directive uses
47911     * the result of calling this function to identify the item node,
47912     * rather than the identity of the object itself.
47913     *
47914     * The function receives two inputs,
47915     * the iteration index and the associated node data.
47916     */
47917    set ngForTrackBy(fn) {
47918        if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') {
47919            // TODO(vicb): use a log service once there is a public one available
47920            if (console && console.warn) {
47921                console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` +
47922                    `See https://angular.io/api/common/NgForOf#change-propagation for more information.`);
47923            }
47924        }
47925        this._trackByFn = fn;
47926    }
47927    get ngForTrackBy() {
47928        return this._trackByFn;
47929    }
47930    /**
47931     * A reference to the template that is stamped out for each item in the iterable.
47932     * @see [template reference variable](guide/template-reference-variables)
47933     */
47934    set ngForTemplate(value) {
47935        // TODO(TS2.1): make TemplateRef<Partial<NgForRowOf<T>>> once we move to TS v2.1
47936        // The current type is too restrictive; a template that just uses index, for example,
47937        // should be acceptable.
47938        if (value) {
47939            this._template = value;
47940        }
47941    }
47942    /**
47943     * Applies the changes when needed.
47944     */
47945    ngDoCheck() {
47946        if (this._ngForOfDirty) {
47947            this._ngForOfDirty = false;
47948            // React on ngForOf changes only once all inputs have been initialized
47949            const value = this._ngForOf;
47950            if (!this._differ && value) {
47951                try {
47952                    this._differ = this._differs.find(value).create(this.ngForTrackBy);
47953                }
47954                catch (_a) {
47955                    throw new Error(`Cannot find a differ supporting object '${value}' of type '${getTypeName(value)}'. NgFor only supports binding to Iterables such as Arrays.`);
47956                }
47957            }
47958        }
47959        if (this._differ) {
47960            const changes = this._differ.diff(this._ngForOf);
47961            if (changes)
47962                this._applyChanges(changes);
47963        }
47964    }
47965    _applyChanges(changes) {
47966        const insertTuples = [];
47967        changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
47968            if (item.previousIndex == null) {
47969                // NgForOf is never "null" or "undefined" here because the differ detected
47970                // that a new item needs to be inserted from the iterable. This implies that
47971                // there is an iterable value for "_ngForOf".
47972                const view = this._viewContainer.createEmbeddedView(this._template, new NgForOfContext(null, this._ngForOf, -1, -1), currentIndex === null ? undefined : currentIndex);
47973                const tuple = new RecordViewTuple(item, view);
47974                insertTuples.push(tuple);
47975            }
47976            else if (currentIndex == null) {
47977                this._viewContainer.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);
47978            }
47979            else if (adjustedPreviousIndex !== null) {
47980                const view = this._viewContainer.get(adjustedPreviousIndex);
47981                this._viewContainer.move(view, currentIndex);
47982                const tuple = new RecordViewTuple(item, view);
47983                insertTuples.push(tuple);
47984            }
47985        });
47986        for (let i = 0; i < insertTuples.length; i++) {
47987            this._perViewChange(insertTuples[i].view, insertTuples[i].record);
47988        }
47989        for (let i = 0, ilen = this._viewContainer.length; i < ilen; i++) {
47990            const viewRef = this._viewContainer.get(i);
47991            viewRef.context.index = i;
47992            viewRef.context.count = ilen;
47993            viewRef.context.ngForOf = this._ngForOf;
47994        }
47995        changes.forEachIdentityChange((record) => {
47996            const viewRef = this._viewContainer.get(record.currentIndex);
47997            viewRef.context.$implicit = record.item;
47998        });
47999    }
48000    _perViewChange(view, record) {
48001        view.context.$implicit = record.item;
48002    }
48003    /**
48004     * Asserts the correct type of the context for the template that `NgForOf` will render.
48005     *
48006     * The presence of this method is a signal to the Ivy template type-check compiler that the
48007     * `NgForOf` structural directive renders its template with a specific context type.
48008     */
48009    static ngTemplateContextGuard(dir, ctx) {
48010        return true;
48011    }
48012}
48013NgForOf.ɵfac = function NgForOf_Factory(t) { return new (t || NgForOf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"])); };
48014NgForOf.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgForOf, selectors: [["", "ngFor", "", "ngForOf", ""]], inputs: { ngForOf: "ngForOf", ngForTrackBy: "ngForTrackBy", ngForTemplate: "ngForTemplate" } });
48015NgForOf.ctorParameters = () => [
48016    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
48017    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] },
48018    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] }
48019];
48020NgForOf.propDecorators = {
48021    ngForOf: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
48022    ngForTrackBy: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
48023    ngForTemplate: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
48024};
48025(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgForOf, [{
48026        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
48027        args: [{ selector: '[ngFor][ngForOf]' }]
48028    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["IterableDiffers"] }]; }, { ngForOf: [{
48029            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48030        }], ngForTrackBy: [{
48031            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48032        }], ngForTemplate: [{
48033            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48034        }] }); })();
48035class RecordViewTuple {
48036    constructor(record, view) {
48037        this.record = record;
48038        this.view = view;
48039    }
48040}
48041function getTypeName(type) {
48042    return type['name'] || typeof type;
48043}
48044
48045/**
48046 * @license
48047 * Copyright Google LLC All Rights Reserved.
48048 *
48049 * Use of this source code is governed by an MIT-style license that can be
48050 * found in the LICENSE file at https://angular.io/license
48051 */
48052/**
48053 * A structural directive that conditionally includes a template based on the value of
48054 * an expression coerced to Boolean.
48055 * When the expression evaluates to true, Angular renders the template
48056 * provided in a `then` clause, and when  false or null,
48057 * Angular renders the template provided in an optional `else` clause. The default
48058 * template for the `else` clause is blank.
48059 *
48060 * A [shorthand form](guide/structural-directives#asterisk) of the directive,
48061 * `*ngIf="condition"`, is generally used, provided
48062 * as an attribute of the anchor element for the inserted template.
48063 * Angular expands this into a more explicit version, in which the anchor element
48064 * is contained in an `<ng-template>` element.
48065 *
48066 * Simple form with shorthand syntax:
48067 *
48068 * ```
48069 * <div *ngIf="condition">Content to render when condition is true.</div>
48070 * ```
48071 *
48072 * Simple form with expanded syntax:
48073 *
48074 * ```
48075 * <ng-template [ngIf]="condition"><div>Content to render when condition is
48076 * true.</div></ng-template>
48077 * ```
48078 *
48079 * Form with an "else" block:
48080 *
48081 * ```
48082 * <div *ngIf="condition; else elseBlock">Content to render when condition is true.</div>
48083 * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
48084 * ```
48085 *
48086 * Shorthand form with "then" and "else" blocks:
48087 *
48088 * ```
48089 * <div *ngIf="condition; then thenBlock else elseBlock"></div>
48090 * <ng-template #thenBlock>Content to render when condition is true.</ng-template>
48091 * <ng-template #elseBlock>Content to render when condition is false.</ng-template>
48092 * ```
48093 *
48094 * Form with storing the value locally:
48095 *
48096 * ```
48097 * <div *ngIf="condition as value; else elseBlock">{{value}}</div>
48098 * <ng-template #elseBlock>Content to render when value is null.</ng-template>
48099 * ```
48100 *
48101 * @usageNotes
48102 *
48103 * The `*ngIf` directive is most commonly used to conditionally show an inline template,
48104 * as seen in the following  example.
48105 * The default `else` template is blank.
48106 *
48107 * {@example common/ngIf/ts/module.ts region='NgIfSimple'}
48108 *
48109 * ### Showing an alternative template using `else`
48110 *
48111 * To display a template when `expression` evaluates to false, use an `else` template
48112 * binding as shown in the following example.
48113 * The `else` binding points to an `<ng-template>`  element labeled `#elseBlock`.
48114 * The template can be defined anywhere in the component view, but is typically placed right after
48115 * `ngIf` for readability.
48116 *
48117 * {@example common/ngIf/ts/module.ts region='NgIfElse'}
48118 *
48119 * ### Using an external `then` template
48120 *
48121 * In the previous example, the then-clause template is specified inline, as the content of the
48122 * tag that contains the `ngIf` directive. You can also specify a template that is defined
48123 * externally, by referencing a labeled `<ng-template>` element. When you do this, you can
48124 * change which template to use at runtime, as shown in the following example.
48125 *
48126 * {@example common/ngIf/ts/module.ts region='NgIfThenElse'}
48127 *
48128 * ### Storing a conditional result in a variable
48129 *
48130 * You might want to show a set of properties from the same object. If you are waiting
48131 * for asynchronous data, the object can be undefined.
48132 * In this case, you can use `ngIf` and store the result of the condition in a local
48133 * variable as shown in the following example.
48134 *
48135 * {@example common/ngIf/ts/module.ts region='NgIfAs'}
48136 *
48137 * This code uses only one `AsyncPipe`, so only one subscription is created.
48138 * The conditional statement stores the result of `userStream|async` in the local variable `user`.
48139 * You can then bind the local `user` repeatedly.
48140 *
48141 * The conditional displays the data only if `userStream` returns a value,
48142 * so you don't need to use the
48143 * safe-navigation-operator (`?.`)
48144 * to guard against null values when accessing properties.
48145 * You can display an alternative template while waiting for the data.
48146 *
48147 * ### Shorthand syntax
48148 *
48149 * The shorthand syntax `*ngIf` expands into two separate template specifications
48150 * for the "then" and "else" clauses. For example, consider the following shorthand statement,
48151 * that is meant to show a loading page while waiting for data to be loaded.
48152 *
48153 * ```
48154 * <div class="hero-list" *ngIf="heroes else loading">
48155 *  ...
48156 * </div>
48157 *
48158 * <ng-template #loading>
48159 *  <div>Loading...</div>
48160 * </ng-template>
48161 * ```
48162 *
48163 * You can see that the "else" clause references the `<ng-template>`
48164 * with the `#loading` label, and the template for the "then" clause
48165 * is provided as the content of the anchor element.
48166 *
48167 * However, when Angular expands the shorthand syntax, it creates
48168 * another `<ng-template>` tag, with `ngIf` and `ngIfElse` directives.
48169 * The anchor element containing the template for the "then" clause becomes
48170 * the content of this unlabeled `<ng-template>` tag.
48171 *
48172 * ```
48173 * <ng-template [ngIf]="heroes" [ngIfElse]="loading">
48174 *  <div class="hero-list">
48175 *   ...
48176 *  </div>
48177 * </ng-template>
48178 *
48179 * <ng-template #loading>
48180 *  <div>Loading...</div>
48181 * </ng-template>
48182 * ```
48183 *
48184 * The presence of the implicit template object has implications for the nesting of
48185 * structural directives. For more on this subject, see
48186 * [Structural Directives](https://angular.io/guide/built-in-directives#one-per-element).
48187 *
48188 * @ngModule CommonModule
48189 * @publicApi
48190 */
48191class NgIf {
48192    constructor(_viewContainer, templateRef) {
48193        this._viewContainer = _viewContainer;
48194        this._context = new NgIfContext();
48195        this._thenTemplateRef = null;
48196        this._elseTemplateRef = null;
48197        this._thenViewRef = null;
48198        this._elseViewRef = null;
48199        this._thenTemplateRef = templateRef;
48200    }
48201    /**
48202     * The Boolean expression to evaluate as the condition for showing a template.
48203     */
48204    set ngIf(condition) {
48205        this._context.$implicit = this._context.ngIf = condition;
48206        this._updateView();
48207    }
48208    /**
48209     * A template to show if the condition expression evaluates to true.
48210     */
48211    set ngIfThen(templateRef) {
48212        assertTemplate('ngIfThen', templateRef);
48213        this._thenTemplateRef = templateRef;
48214        this._thenViewRef = null; // clear previous view if any.
48215        this._updateView();
48216    }
48217    /**
48218     * A template to show if the condition expression evaluates to false.
48219     */
48220    set ngIfElse(templateRef) {
48221        assertTemplate('ngIfElse', templateRef);
48222        this._elseTemplateRef = templateRef;
48223        this._elseViewRef = null; // clear previous view if any.
48224        this._updateView();
48225    }
48226    _updateView() {
48227        if (this._context.$implicit) {
48228            if (!this._thenViewRef) {
48229                this._viewContainer.clear();
48230                this._elseViewRef = null;
48231                if (this._thenTemplateRef) {
48232                    this._thenViewRef =
48233                        this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
48234                }
48235            }
48236        }
48237        else {
48238            if (!this._elseViewRef) {
48239                this._viewContainer.clear();
48240                this._thenViewRef = null;
48241                if (this._elseTemplateRef) {
48242                    this._elseViewRef =
48243                        this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
48244                }
48245            }
48246        }
48247    }
48248    /**
48249     * Asserts the correct type of the context for the template that `NgIf` will render.
48250     *
48251     * The presence of this method is a signal to the Ivy template type-check compiler that the
48252     * `NgIf` structural directive renders its template with a specific context type.
48253     */
48254    static ngTemplateContextGuard(dir, ctx) {
48255        return true;
48256    }
48257}
48258NgIf.ɵfac = function NgIf_Factory(t) { return new (t || NgIf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"])); };
48259NgIf.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgIf, selectors: [["", "ngIf", ""]], inputs: { ngIf: "ngIf", ngIfThen: "ngIfThe
48259n", ngIfElse: "ngIfElse" } });
48260NgIf.ctorParameters = () => [
48261    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
48262    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }
48263];
48264NgIf.propDecorators = {
48265    ngIf: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
48266    ngIfThen: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
48267    ngIfElse: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
48268};
48269(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgIf, [{
48270        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
48271        args: [{ selector: '[ngIf]' }]
48272    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }]; }, { ngIf: [{
48273            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48274        }], ngIfThen: [{
48275            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48276        }], ngIfElse: [{
48277            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48278        }] }); })();
48279/**
48280 * @publicApi
48281 */
48282class NgIfContext {
48283    constructor() {
48284        this.$implicit = null;
48285        this.ngIf = null;
48286    }
48287}
48288function assertTemplate(property, templateRef) {
48289    const isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView);
48290    if (!isTemplateRefOrNull) {
48291        throw new Error(`${property} must be a TemplateRef, but received '${Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(templateRef)}'.`);
48292    }
48293}
48294
48295/**
48296 * @license
48297 * Copyright Google LLC All Rights Reserved.
48298 *
48299 * Use of this source code is governed by an MIT-style license that can be
48300 * found in the LICENSE file at https://angular.io/license
48301 */
48302class SwitchView {
48303    constructor(_viewContainerRef, _templateRef) {
48304        this._viewContainerRef = _viewContainerRef;
48305        this._templateRef = _templateRef;
48306        this._created = false;
48307    }
48308    create() {
48309        this._created = true;
48310        this._viewContainerRef.createEmbeddedView(this._templateRef);
48311    }
48312    destroy() {
48313        this._created = false;
48314        this._viewContainerRef.clear();
48315    }
48316    enforceState(created) {
48317        if (created && !this._created) {
48318            this.create();
48319        }
48320        else if (!created && this._created) {
48321            this.destroy();
48322        }
48323    }
48324}
48325/**
48326 * @ngModule CommonModule
48327 *
48328 * @description
48329 * The `[ngSwitch]` directive on a container specifies an expression to match against.
48330 * The expressions to match are provided by `ngSwitchCase` directives on views within the container.
48331 * - Every view that matches is rendered.
48332 * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered.
48333 * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase`
48334 * or `ngSwitchDefault` directive are preserved at the location.
48335 *
48336 * @usageNotes
48337 * Define a container element for the directive, and specify the switch expression
48338 * to match against as an attribute:
48339 *
48340 * ```
48341 * <container-element [ngSwitch]="switch_expression">
48342 * ```
48343 *
48344 * Within the container, `*ngSwitchCase` statements specify the match expressions
48345 * as attributes. Include `*ngSwitchDefault` as the final case.
48346 *
48347 * ```
48348 * <container-element [ngSwitch]="switch_expression">
48349 *    <some-element *ngSwitchCase="match_expression_1">...</some-element>
48350 * ...
48351 *    <some-element *ngSwitchDefault>...</some-element>
48352 * </container-element>
48353 * ```
48354 *
48355 * ### Usage Examples
48356 *
48357 * The following example shows how to use more than one case to display the same view:
48358 *
48359 * ```
48360 * <container-element [ngSwitch]="switch_expression">
48361 *   <!-- the same view can be shown in more than one case -->
48362 *   <some-element *ngSwitchCase="match_expression_1">...</some-element>
48363 *   <some-element *ngSwitchCase="match_expression_2">...</some-element>
48364 *   <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
48365 *   <!--default case when there are no matches -->
48366 *   <some-element *ngSwitchDefault>...</some-element>
48367 * </container-element>
48368 * ```
48369 *
48370 * The following example shows how cases can be nested:
48371 * ```
48372 * <container-element [ngSwitch]="switch_expression">
48373 *       <some-element *ngSwitchCase="match_expression_1">...</some-element>
48374 *       <some-element *ngSwitchCase="match_expression_2">...</some-element>
48375 *       <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element>
48376 *       <ng-container *ngSwitchCase="match_expression_3">
48377 *         <!-- use a ng-container to group multiple root nodes -->
48378 *         <inner-element></inner-element>
48379 *         <inner-other-element></inner-other-element>
48380 *       </ng-container>
48381 *       <some-element *ngSwitchDefault>...</some-element>
48382 *     </container-element>
48383 * ```
48384 *
48385 * @publicApi
48386 * @see `NgSwitchCase`
48387 * @see `NgSwitchDefault`
48388 * @see [Structural Directives](guide/structural-directives)
48389 *
48390 */
48391class NgSwitch {
48392    constructor() {
48393        this._defaultUsed = false;
48394        this._caseCount = 0;
48395        this._lastCaseCheckIndex = 0;
48396        this._lastCasesMatched = false;
48397    }
48398    set ngSwitch(newValue) {
48399        this._ngSwitch = newValue;
48400        if (this._caseCount === 0) {
48401            this._updateDefaultCases(true);
48402        }
48403    }
48404    /** @internal */
48405    _addCase() {
48406        return this._caseCount++;
48407    }
48408    /** @internal */
48409    _addDefault(view) {
48410        if (!this._defaultViews) {
48411            this._defaultViews = [];
48412        }
48413        this._defaultViews.push(view);
48414    }
48415    /** @internal */
48416    _matchCase(value) {
48417        const matched = value == this._ngSwitch;
48418        this._lastCasesMatched = this._lastCasesMatched || matched;
48419        this._lastCaseCheckIndex++;
48420        if (this._lastCaseCheckIndex === this._caseCount) {
48421            this._updateDefaultCases(!this._lastCasesMatched);
48422            this._lastCaseCheckIndex = 0;
48423            this._lastCasesMatched = false;
48424        }
48425        return matched;
48426    }
48427    _updateDefaultCases(useDefault) {
48428        if (this._defaultViews && useDefault !== this._defaultUsed) {
48429            this._defaultUsed = useDefault;
48430            for (let i = 0; i < this._defaultViews.length; i++) {
48431                const defaultView = this._defaultViews[i];
48432                defaultView.enforceState(useDefault);
48433            }
48434        }
48435    }
48436}
48437NgSwitch.ɵfac = function NgSwitch_Factory(t) { return new (t || NgSwitch)(); };
48438NgSwitch.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSwitch, selectors: [["", "ngSwitch", ""]], inputs: { ngSwitch: "ngSwitch" } });
48439NgSwitch.propDecorators = {
48440    ngSwitch: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
48441};
48442(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitch, [{
48443        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
48444        args: [{ selector: '[ngSwitch]' }]
48445    }], function () { return []; }, { ngSwitch: [{
48446            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48447        }] }); })();
48448/**
48449 * @ngModule CommonModule
48450 *
48451 * @description
48452 * Provides a switch case expression to match against an enclosing `ngSwitch` expression.
48453 * When the expressions match, the given `NgSwitchCase` template is rendered.
48454 * If multiple match expressions match the switch expression value, all of them are displayed.
48455 *
48456 * @usageNotes
48457 *
48458 * Within a switch container, `*ngSwitchCase` statements specify the match expressions
48459 * as attributes. Include `*ngSwitchDefault` as the final case.
48460 *
48461 * ```
48462 * <container-element [ngSwitch]="switch_expression">
48463 *   <some-element *ngSwitchCase="match_expression_1">...</some-element>
48464 *   ...
48465 *   <some-element *ngSwitchDefault>...</some-element>
48466 * </container-element>
48467 * ```
48468 *
48469 * Each switch-case statement contains an in-line HTML template or template reference
48470 * that defines the subtree to be selected if the value of the match expression
48471 * matches the value of the switch expression.
48472 *
48473 * Unlike JavaScript, which uses strict equality, Angular uses loose equality.
48474 * This means that the empty string, `""` matches 0.
48475 *
48476 * @publicApi
48477 * @see `NgSwitch`
48478 * @see `NgSwitchDefault`
48479 *
48480 */
48481class NgSwitchCase {
48482    constructor(viewContainer, templateRef, ngSwitch) {
48483        this.ngSwitch = ngSwitch;
48484        ngSwitch._addCase();
48485        this._view = new SwitchView(viewContainer, templateRef);
48486    }
48487    /**
48488     * Performs case matching. For internal use only.
48489     */
48490    ngDoCheck() {
48491        this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
48492    }
48493}
48494NgSwitchCase.ɵfac = function NgSwitchCase_Factory(t) { return new (t || NgSwitchCase)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgSwitch, 1)); };
48495NgSwitchCase.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSwitchCase, selectors: [["", "ngSwitchCase", ""]], inputs: { ngSwitchCase: "ngSwitchCase" } });
48496NgSwitchCase.ctorParameters = () => [
48497    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
48498    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] },
48499    { type: NgSwitch, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] }
48500];
48501NgSwitchCase.propDecorators = {
48502    ngSwitchCase: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
48503};
48504(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitchCase, [{
48505        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
48506        args: [{ selector: '[ngSwitchCase]' }]
48507    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, { type: NgSwitch, decorators: [{
48508                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"]
48509            }] }]; }, { ngSwitchCase: [{
48510            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48511        }] }); })();
48512/**
48513 * @ngModule CommonModule
48514 *
48515 * @description
48516 *
48517 * Creates a view that is rendered when no `NgSwitchCase` expressions
48518 * match the `NgSwitch` expression.
48519 * This statement should be the final case in an `NgSwitch`.
48520 *
48521 * @publicApi
48522 * @see `NgSwitch`
48523 * @see `NgSwitchCase`
48524 *
48525 */
48526class NgSwitchDefault {
48527    constructor(viewContainer, templateRef, ngSwitch) {
48528        ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
48529    }
48530}
48531NgSwitchDefault.ɵfac = function NgSwitchDefault_Factory(t) { return new (t || NgSwitchDefault)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgSwitch, 1)); };
48532NgSwitchDefault.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgSwitchDefault, selectors: [["", "ngSwitchDefault", ""]] });
48533NgSwitchDefault.ctorParameters = () => [
48534    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
48535    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] },
48536    { type: NgSwitch, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] }
48537];
48538(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitchDefault, [{
48539        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
48540        args: [{ selector: '[ngSwitchDefault]' }]
48541    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, { type: NgSwitch, decorators: [{
48542                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"]
48543            }] }]; }, null); })();
48544
48545/**
48546 * @license
48547 * Copyright Google LLC All Rights Reserved.
48548 *
48549 * Use of this source code is governed by an MIT-style license that can be
48550 * found in the LICENSE file at https://angular.io/license
48551 */
48552/**
48553 * @ngModule CommonModule
48554 *
48555 * @usageNotes
48556 * ```
48557 * <some-element [ngPlural]="value">
48558 *   <ng-template ngPluralCase="=0">there is nothing</ng-template>
48559 *   <ng-template ngPluralCase="=1">there is one</ng-template>
48560 *   <ng-template ngPluralCase="few">there are a few</ng-template>
48561 * </some-element>
48562 * ```
48563 *
48564 * @description
48565 *
48566 * Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.
48567 *
48568 * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees
48569 * that match the switch expression's pluralization category.
48570 *
48571 * To use this directive you must provide a container element that sets the `[ngPlural]` attribute
48572 * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their
48573 * expression:
48574 * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value
48575 *   matches the switch expression exactly,
48576 * - otherwise, the view will be treated as a "category match", and will only display if exact
48577 *   value matches aren't found and the value maps to its category for the defined locale.
48578 *
48579 * See http://cldr.unicode.org/index/cldr-spec/plural-rules
48580 *
48581 * @publicApi
48582 */
48583class NgPlural {
48584    constructor(_localization) {
48585        this._localization = _localization;
48586        this._caseViews = {};
48587    }
48588    set ngPlural(value) {
48589        this._switchValue = value;
48590        this._updateView();
48591    }
48592    addCase(value, switchView) {
48593        this._caseViews[value] = switchView;
48594    }
48595    _updateView() {
48596        this._clearViews();
48597        const cases = Object.keys(this._caseViews);
48598        const key = getPluralCategory(this._switchValue, cases, this._localization);
48599        this._activateView(this._caseViews[key]);
48600    }
48601    _clearViews() {
48602        if (this._activeView)
48603            this._activeView.destroy();
48604    }
48605    _activateView(view) {
48606        if (view) {
48607            this._activeView = view;
48608            this._activeView.create();
48609        }
48610    }
48611}
48612NgPlural.ɵfac = function NgPlural_Factory(t) { return new (t || NgPlural)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgLocalization)); };
48613NgPlural.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgPlural, selectors: [["", "ngPlural", ""]], inputs: { ngPlural: "ngPlural" } });
48614NgPlural.ctorParameters = () => [
48615    { type: NgLocalization }
48616];
48617NgPlural.propDecorators = {
48618    ngPlural: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
48619};
48620(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgPlural, [{
48621        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
48622        args: [{ selector: '[ngPlural]' }]
48623    }], function () { return [{ type: NgLocalization }]; }, { ngPlural: [{
48624            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48625        }] }); })();
48626/**
48627 * @ngModule CommonModule
48628 *
48629 * @description
48630 *
48631 * Creates a view that will be added/removed from the parent {@link NgPlural} when the
48632 * given expression matches the plural expression according to CLDR rules.
48633 *
48634 * @usageNotes
48635 * ```
48636 * <some-element [ngPlural]="value">
48637 *   <ng-template ngPluralCase="=0">...</ng-template>
48638 *   <ng-template ngPluralCase="other">...</ng-template>
48639 * </some-element>
48640 *```
48641 *
48642 * See {@link NgPlural} for more details and example.
48643 *
48644 * @publicApi
48645 */
48646class NgPluralCase {
48647    constructor(value, template, viewContainer, ngPlural) {
48648        this.value = value;
48649        const isANumber = !isNaN(Number(value));
48650        ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
48651    }
48652}
48653NgPluralCase.ɵfac = function NgPluralCase_Factory(t) { return new (t || NgPluralCase)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinjectAttribute"]('ngPluralCase'), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgPlural, 1)); };
48654NgPluralCase.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgPluralCase, selectors: [["", "ngPluralCase", ""]] });
48655NgPluralCase.ctorParameters = () => [
48656    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Attribute"], args: ['ngPluralCase',] }] },
48657    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] },
48658    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] },
48659    { type: NgPlural, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"] }] }
48660];
48661(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgPluralCase, [{
48662        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
48663        args: [{ selector: '[ngPluralCase]' }]
48664    }], function () { return [{ type: String, decorators: [{
48665                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Attribute"],
48666                args: ['ngPluralCase']
48667            }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["TemplateRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }, { type: NgPlural, decorators: [{
48668                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Host"]
48669            }] }]; }, null); })();
48670
48671/**
48672 * @license
48673 * Copyright Google LLC All Rights Reserved.
48674 *
48675 * Use of this source code is governed by an MIT-style license that can be
48676 * found in the LICENSE file at https://angular.io/license
48677 */
48678/**
48679 * @ngModule CommonModule
48680 *
48681 * @usageNotes
48682 *
48683 * Set the font of the containing element to the result of an expression.
48684 *
48685 * ```
48686 * <some-element [ngStyle]="{'font-style': styleExp}">...</some-element>
48687 * ```
48688 *
48689 * Set the width of the containing element to a pixel value returned by an expression.
48690 *
48691 * ```
48692 * <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
48693 * ```
48694 *
48695 * Set a collection of style values using an expression that returns key-value pairs.
48696 *
48697 * ```
48698 * <some-element [ngStyle]="objExp">...</some-element>
48699 * ```
48700 *
48701 * @description
48702 *
48703 * An attribute directive that updates styles for the containing HTML element.
48704 * Sets one or more style properties, specified as colon-separated key-value pairs.
48705 * The key is a style name, with an optional `.<unit>` suffix
48706 * (such as 'top.px', 'font-style.em').
48707 * The value is an expression to be evaluated.
48708 * The resulting non-null value, expressed in the given unit,
48709 * is assigned to the given style property.
48710 * If the result of evaluation is null, the corresponding style is removed.
48711 *
48712 * @publicApi
48713 */
48714class NgStyle {
48715    constructor(_ngEl, _differs, _renderer) {
48716        this._ngEl = _ngEl;
48717        this._differs = _differs;
48718        this._renderer = _renderer;
48719        this._ngStyle = null;
48720        this._differ = null;
48721    }
48722    set ngStyle(values) {
48723        this._ngStyle = values;
48724        if (!this._differ && values) {
48725            this._differ = this._differs.find(values).create();
48726        }
48727    }
48728    ngDoCheck() {
48729        if (this._differ) {
48730            const changes = this._differ.diff(this._ngStyle);
48731            if (changes) {
48732                this._applyChanges(changes);
48733            }
48734        }
48735    }
48736    _setStyle(nameAndUnit, value) {
48737        const [name, unit] = nameAndUnit.split('.');
48738        value = value != null && unit ? `${value}${unit}` : value;
48739        if (value != null) {
48740            this._renderer.setStyle(this._ngEl.nativeElement, name, value);
48741        }
48742        else {
48743            this._renderer.removeStyle(this._ngEl.nativeElement, name);
48744        }
48745    }
48746    _applyChanges(changes) {
48747        changes.forEachRemovedItem((record) => this._setStyle(record.key, null));
48748        changes.forEachAddedItem((record) => this._setStyle(record.key, record.currentValue));
48749        changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
48750    }
48751}
48752NgStyle.ɵfac = function NgStyle_Factory(t) { return new (t || NgStyle)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"])); };
48753NgStyle.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgStyle, selectors: [["", "ngStyle", ""]], inputs: { ngStyle: "ngStyle" } });
48754NgStyle.ctorParameters = () => [
48755    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] },
48756    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] },
48757    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }
48758];
48759NgStyle.propDecorators = {
48760    ngStyle: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"], args: ['ngStyle',] }]
48761};
48762(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgStyle, [{
48763        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
48764        args: [{ selector: '[ngStyle]' }]
48765    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Renderer2"] }]; }, { ngStyle: [{
48766            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"],
48767            args: ['ngStyle']
48768        }] }); })();
48769
48770/**
48771 * @license
48772 * Copyright Google LLC All Rights Reserved.
48773 *
48774 * Use of this source code is governed by an MIT-style license that can be
48775 * found in the LICENSE file at https://angular.io/license
48776 */
48777/**
48778 * @ngModule CommonModule
48779 *
48780 * @description
48781 *
48782 * Inserts an embedded view from a prepared `TemplateRef`.
48783 *
48784 * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.
48785 * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding
48786 * by the local template `let` declarations.
48787 *
48788 * @usageNotes
48789 * ```
48790 * <ng-container *ngTemplateOutlet="templateRefExp; context: contextExp"></ng-container>
48791 * ```
48792 *
48793 * Using the key `$implicit` in the context object will set its value as default.
48794 *
48795 * ### Example
48796 *
48797 * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}
48798 *
48799 * @publicApi
48800 */
48801class NgTemplateOutlet {
48802    constructor(_viewContainerRef) {
48803        this._viewContainerRef = _viewContainerRef;
48804        this._viewRef = null;
48805        /**
48806         * A context object to attach to the {@link EmbeddedViewRef}. This should be an
48807         * object, the object's keys will be available for binding by the local template `let`
48808         * declarations.
48809         * Using the key `$implicit` in the context object will set its value as default.
48810         */
48811        this.ngTemplateOutletContext = null;
48812        /**
48813         * A string defining the template reference and optionally the context object for the template.
48814         */
48815        this.ngTemplateOutlet = null;
48816    }
48817    ngOnChanges(changes) {
48818        const recreateView = this._shouldRecreateView(changes);
48819        if (recreateView) {
48820            const viewContainerRef = this._viewContainerRef;
48821            if (this._viewRef) {
48822                viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));
48823            }
48824            this._viewRef = this.ngTemplateOutlet ?
48825                viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, this.ngTemplateOutletContext) :
48826                null;
48827        }
48828        else if (this._viewRef && this.ngTemplateOutletContext) {
48829            this._updateExistingContext(this.ngTemplateOutletContext);
48830        }
48831    }
48832    /**
48833     * We need to re-create existing embedded view if:
48834     * - templateRef has changed
48835     * - context has changes
48836     *
48837     * We mark context object as changed when the corresponding object
48838     * shape changes (new properties are added or existing properties are removed).
48839     * In other words we consider context with the same properties as "the same" even
48840     * if object reference changes (see https://github.com/angular/angular/issues/13407).
48841     */
48842    _shouldRecreateView(changes) {
48843        const ctxChange = changes['ngTemplateOutletContext'];
48844        return !!changes['ngTemplateOutlet'] || (ctxChange && this._hasContextShapeChanged(ctxChange));
48845    }
48846    _hasContextShapeChanged(ctxChange) {
48847        const prevCtxKeys = Object.keys(ctxChange.previousValue || {});
48848        const currCtxKeys = Object.keys(ctxChange.currentValue || {});
48849        if (prevCtxKeys.length === currCtxKeys.length) {
48850            for (let propName of currCtxKeys) {
48851                if (prevCtxKeys.indexOf(propName) === -1) {
48852                    return true;
48853                }
48854            }
48855            return false;
48856        }
48857        return true;
48858    }
48859    _updateExistingContext(ctx) {
48860        for (let propName of Object.keys(ctx)) {
48861            this._viewRef.context[propName] = this.ngTemplateOutletContext[propName];
48862        }
48863    }
48864}
48865NgTemplateOutlet.ɵfac = function NgTemplateOutlet_Factory(t) { return new (t || NgTemplateOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"])); };
48866NgTemplateOutlet.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: NgTemplateOutlet, selectors: [["", "ngTemplateOutlet", ""]], inputs: { ngTemplateOutletContext: "ngTemplateOutletContext", ngTemplateOutlet: "ngTemplateOutlet" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] });
48867NgTemplateOutlet.ctorParameters = () => [
48868    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }
48869];
48870NgTemplateOutlet.propDecorators = {
48871    ngTemplateOutletContext: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }],
48872    ngTemplateOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"] }]
48873};
48874(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgTemplateOutlet, [{
48875        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Directive"],
48876        args: [{ selector: '[ngTemplateOutlet]' }]
48877    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewContainerRef"] }]; }, { ngTemplateOutletContext: [{
48878            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48879        }], ngTemplateOutlet: [{
48880            type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"]
48881        }] }); })();
48882
48883/**
48884 * @license
48885 * Copyright Google LLC All Rights Reserved.
48886 *
48887 * Use of this source code is governed by an MIT-style license that can be
48888 * found in the LICENSE file at https://angular.io/license
48889 */
48890/**
48891 * A collection of Angular directives that are likely to be used in each and every Angular
48892 * application.
48893 */
48894const COMMON_DIRECTIVES = [
48895    NgClass,
48896    NgComponentOutlet,
48897    NgForOf,
48898    NgIf,
48899    NgTemplateOutlet,
48900    NgStyle,
48901    NgSwitch,
48902    NgSwitchCase,
48903    NgSwitchDefault,
48904    NgPlural,
48905    NgPluralCase,
48906];
48907
48908/**
48909 * @license
48910 * Copyright Google LLC All Rights Reserved.
48911 *
48912 * Use of this source code is governed by an MIT-style license that can be
48913 * found in the LICENSE file at https://angular.io/license
48914 */
48915function invalidPipeArgumentError(type, value) {
48916    return Error(`InvalidPipeArgument: '${value}' for pipe '${Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(type)}'`);
48917}
48918
48919/**
48920 * @license
48921 * Copyright Google LLC All Rights Reserved.
48922 *
48923 * Use of this source code is governed by an MIT-style license that can be
48924 * found in the LICENSE file at https://angular.io/license
48925 */
48926class SubscribableStrategy {
48927    createSubscription(async, updateLatestValue) {
48928        return async.subscribe({
48929            next: updateLatestValue,
48930            error: (e) => {
48931                throw e;
48932            }
48933        });
48934    }
48935    dispose(subscription) {
48936        subscription.unsubscribe();
48937    }
48938    onDestroy(subscription) {
48939        subscription.unsubscribe();
48940    }
48941}
48942class PromiseStrategy {
48943    createSubscription(async, updateLatestValue) {
48944        return async.then(updateLatestValue, e => {
48945            throw e;
48946        });
48947    }
48948    dispose(subscription) { }
48949    onDestroy(subscription) { }
48950}
48951const _promiseStrategy = new PromiseStrategy();
48952const _subscribableStrategy = new SubscribableStrategy();
48953/**
48954 * @ngModule CommonModule
48955 * @description
48956 *
48957 * Unwraps a value from an asynchronous primitive.
48958 *
48959 * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
48960 * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for
48961 * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
48962 * potential memory leaks.
48963 *
48964 * @usageNotes
48965 *
48966 * ### Examples
48967 *
48968 * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
48969 * promise.
48970 *
48971 * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
48972 *
48973 * It's also possible to use `async` with Observables. The example below binds the `time` Observable
48974 * to the view. The Observable continuously updates the view with the current time.
48975 *
48976 * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
48977 *
48978 * @publicApi
48979 */
48980class AsyncPipe {
48981    constructor(_ref) {
48982        this._ref = _ref;
48983        this._latestValue = null;
48984        this._subscription = null;
48985        this._obj = null;
48986        this._strategy = null;
48987    }
48988    ngOnDestroy() {
48989        if (this._subscription) {
48990            this._dispose();
48991        }
48992    }
48993    transform(obj) {
48994        if (!this._obj) {
48995            if (obj) {
48996                this._subscribe(obj);
48997            }
48998            return this._latestValue;
48999        }
49000        if (obj !== this._obj) {
49001            this._dispose();
49002            return this.transform(obj);
49003        }
49004        return this._latestValue;
49005    }
49006    _subscribe(obj) {
49007        this._obj = obj;
49008        this._strategy = this._selectStrategy(obj);
49009        this._subscription = this._strategy.createSubscription(obj, (value) => this._updateLatestValue(obj, value));
49010    }
49011    _selectStrategy(obj) {
49012        if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisPromise"])(obj)) {
49013            return _promiseStrategy;
49014        }
49015        if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisSubscribable"])(obj)) {
49016            return _subscribableStrategy;
49017        }
49018        throw invalidPipeArgumentError(AsyncPipe, obj);
49019    }
49020    _dispose() {
49021        this._strategy.dispose(this._subscription);
49022        this._latestValue = null;
49023        this._subscription = null;
49024        this._obj = null;
49025    }
49026    _updateLatestValue(async, value) {
49027        if (async === this._obj) {
49028            this._latestValue = value;
49029            this._ref.markForCheck();
49030        }
49031    }
49032}
49033AsyncPipe.ɵfac = function AsyncPipe_Factory(t) { return new (t || AsyncPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinjectPipeChangeDetectorRef"]()); };
49034AsyncPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "async", type: AsyncPipe, pure: false });
49035AsyncPipe.ctorParameters = () => [
49036    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"] }
49037];
49038(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AsyncPipe, [{
49039        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49040        args: [{ name: 'async', pure: false }]
49041    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ChangeDetectorRef"] }]; }, null); })();
49042
49043/**
49044 * @license
49045 * Copyright Google LLC All Rights Reserved.
49046 *
49047 * Use of this source code is governed by an MIT-style license that can be
49048 * found in the LICENSE file at https://angular.io/license
49049 */
49050/**
49051 * Transforms text to all lower case.
49052 *
49053 * @see `UpperCasePipe`
49054 * @see `TitleCasePipe`
49055 * @usageNotes
49056 *
49057 * The following example defines a view that allows the user to enter
49058 * text, and then uses the pipe to convert the input text to all lower case.
49059 *
49060 * <code-example path="common/pipes/ts/lowerupper_pipe.ts" region='LowerUpperPipe'></code-example>
49061 *
49062 * @ngModule CommonModule
49063 * @publicApi
49064 */
49065class LowerCasePipe {
49066    transform(value) {
49067        if (value == null)
49068            return null;
49069        if (typeof value !== 'string') {
49070            throw invalidPipeArgumentError(LowerCasePipe, value);
49071        }
49072        return value.toLowerCase();
49073    }
49074}
49075LowerCasePipe.ɵfac = function LowerCasePipe_Factory(t) { return new (t || LowerCasePipe)(); };
49076LowerCasePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "lowercase", type: LowerCasePipe, pure: true });
49077(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LowerCasePipe, [{
49078        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49079        args: [{ name: 'lowercase' }]
49080    }], null, null); })();
49081//
49082// Regex below matches any Unicode word and compatible with ES5. In ES2018 the same result
49083// can be achieved by using /\p{L}\S*/gu and also known as Unicode Property Escapes
49084// (https://2ality.com/2017/07/regexp-unicode-property-escapes.html). Since there is no
49085// transpilation of this functionality down to ES5 without external tool, the only solution is
49086// to use already transpiled form. Example can be found here -
49087// https://mothereff.in/regexpu#input=var+regex+%3D+/%5Cp%7BL%7D/u%3B&unicodePropertyEscape=1
49088//
49089const unicodeWordMatch = 
vendor: 7,066 bytes, line 49089
49089/(?:[A-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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\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-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\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-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\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\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\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]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\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-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])\S*/g;
49089
49090/**
49091 * Transforms text to title case.
49092 * Capitalizes the first letter of each word and transforms the
49093 * rest of the word to lower case.
49094 * Words are delimited by any whitespace character, such as a space, tab, or line-feed character.
49095 *
49096 * @see `LowerCasePipe`
49097 * @see `UpperCasePipe`
49098 *
49099 * @usageNotes
49100 * The following example shows the result of transforming various strings into title case.
49101 *
49102 * <code-example path="common/pipes/ts/titlecase_pipe.ts" region='TitleCasePipe'></code-example>
49103 *
49104 * @ngModule CommonModule
49105 * @publicApi
49106 */
49107class TitleCasePipe {
49108    transform(value) {
49109        if (value == null)
49110            return null;
49111        if (typeof value !== 'string') {
49112            throw invalidPipeArgumentError(TitleCasePipe, value);
49113        }
49114        return value.replace(unicodeWordMatch, (txt => txt[0].toUpperCase() + txt.substr(1).toLowerCase()));
49115    }
49116}
49117TitleCasePipe.ɵfac = function TitleCasePipe_Factory(t) { return new (t || TitleCasePipe)(); };
49118TitleCasePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "titlecase", type: TitleCasePipe, pure: true });
49119(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TitleCasePipe, [{
49120        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49121        args: [{ name: 'titlecase' }]
49122    }], null, null); })();
49123/**
49124 * Transforms text to all upper case.
49125 * @see `LowerCasePipe`
49126 * @see `TitleCasePipe`
49127 *
49128 * @ngModule CommonModule
49129 * @publicApi
49130 */
49131class UpperCasePipe {
49132    transform(value) {
49133        if (value == null)
49134            return null;
49135        if (typeof value !== 'string') {
49136            throw invalidPipeArgumentError(UpperCasePipe, value);
49137        }
49138        return value.toUpperCase();
49139    }
49140}
49141UpperCasePipe.ɵfac = function UpperCasePipe_Factory(t) { return new (t || UpperCasePipe)(); };
49142UpperCasePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "uppercase", type: UpperCasePipe, pure: true });
49143(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](UpperCasePipe, [{
49144        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49145        args: [{ name: 'uppercase' }]
49146    }], null, null); })();
49147
49148/**
49149 * @license
49150 * Copyright Google LLC All Rights Reserved.
49151 *
49152 * Use of this source code is governed by an MIT-style license that can be
49153 * found in the LICENSE file at https://angular.io/license
49154 */
49155// clang-format off
49156/**
49157 * @ngModule CommonModule
49158 * @description
49159 *
49160 * Formats a date value according to locale rules.
49161 *
49162 * Only the `en-US` locale data comes with Angular. To localize dates
49163 * in another language, you must import the corresponding locale data.
49164 * See the [I18n guide](guide/i18n#i18n-pipes) for more information.
49165 *
49166 * @see `formatDate()`
49167 *
49168 *
49169 * @usageNotes
49170 *
49171 * The result of this pipe is not reevaluated when the input is mutated. To avoid the need to
49172 * reformat the date on every change-detection cycle, treat the date as an immutable object
49173 * and change the reference when the pipe needs to run again.
49174 *
49175 * ### Pre-defined format options
49176 *
49177 * | Option        | Equivalent to                       | Examples (given in `en-US` locale)              |
49178 * |---------------|-------------------------------------|-------------------------------------------------|
49179 * | `'short'`     | `'M/d/yy, h:mm a'`                  | `6/15/15, 9:03 AM`                              |
49180 * | `'medium'`    | `'MMM d, y, h:mm:ss a'`             | `Jun 15, 2015, 9:03:01 AM`                      |
49181 * | `'long'`      | `'MMMM d, y, h:mm:ss a z'`          | `June 15, 2015 at 9:03:01 AM GMT+1`             |
49182 * | `'full'`      | `'EEEE, MMMM d, y, h:mm:ss a zzzz'` | `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00` |
49183 * | `'shortDate'` | `'M/d/yy'`                          | `6/15/15`                                       |
49184 * | `'mediumDate'`| `'MMM d, y'`                        | `Jun 15, 2015`                                  |
49185 * | `'longDate'`  | `'MMMM d, y'`                       | `June 15, 2015`                                 |
49186 * | `'fullDate'`  | `'EEEE, MMMM d, y'`                 | `Monday, June 15, 2015`                         |
49187 * | `'shortTime'` | `'h:mm a'`                          | `9:03 AM`                                       |
49188 * | `'mediumTime'`| `'h:mm:ss a'`                       | `9:03:01 AM`                                    |
49189 * | `'longTime'`  | `'h:mm:ss a z'`                     | `9:03:01 AM GMT+1`                              |
49190 * | `'fullTime'`  | `'h:mm:ss a zzzz'`                  | `9:03:01 AM GMT+01:00`                          |
49191 *
49192 * ### Custom format options
49193 *
49194 * You can construct a format string using symbols to specify the components
49195 * of a date-time value, as described in the following table.
49196 * Format details depend on the locale.
49197 * Fields marked with (*) are only available in the extra data set for the given locale.
49198 *
49199 *  | Field type         | Format      | Description                                                   | Example Value                                              |
49200 *  |--------------------|-------------|---------------------------------------------------------------|------------------------------------------------------------|
49201 *  | Era                | G, GG & GGG | Abbreviated                                                   | AD                                                         |
49202 *  |                    | GGGG        | Wide                                                          | Anno Domini                                                |
49203 *  |                    | GGGGG       | Narrow                                                        | A                                                          |
49204 *  | Year               | y           | Numeric: minimum digits                                       | 2, 20, 201, 2017, 20173                                    |
49205 *  |                    | yy          | Numeric: 2 digits + zero padded                               | 02, 20, 01, 17, 73                                         |
49206 *  |                    | yyy         | Numeric: 3 digits + zero padded                               | 002, 020, 201, 2017, 20173                                 |
49207 *  |                    | yyyy        | Numeric: 4 digits or more + zero padded                       | 0002, 0020, 0201, 2017, 20173                              |
49208 *  | Week-numbering year| Y           | Numeric: minimum digits                                       | 2, 20, 201, 2017, 20173                                    |
49209 *  |                    | YY          | Numeric: 2 digits + zero padded                               | 02, 20, 01, 17, 73                                         |
49210 *  |                    | YYY         | Numeric: 3 digits + zero padded                               | 002, 020, 201, 2017, 20173                                 |
49211 *  |                    | YYYY        | Numeric: 4 digits or more + zero padded                       | 0002, 0020, 0201, 2017, 20173                              |
49212 *  | Month              | M           | Numeric: 1 digit                                              | 9, 12                                                      |
49213 *  |                    | MM          | Numeric: 2 digits + zero padded                               | 09, 12                                                     |
49214 *  |                    | MMM         | Abbreviated                                                   | Sep                                                        |
49215 *  |                    | MMMM        | Wide                                                          | September                                                  |
49216 *  |                    | MMMMM       | Narrow                                                        | S                                                          |
49217 *  | Month standalone   | L           | Numeric: 1 digit                                              | 9, 12                                                      |
49218 *  |                    | LL          | Numeric: 2 digits + zero padded                               | 09, 12                                                     |
49219 *  |                    | LLL         | Abbreviated                                                   | Sep                                                        |
49220 *  |                    | LLLL        | Wide                                                          | September                                                  |
49221 *  |                    | LLLLL       | Narrow                                                        | S                                                          |
49222 *  | Week of year       | w           | Numeric: minimum digits                                       | 1... 53                                                    |
49223 *  |                    | ww          | Numeric: 2 digits + zero padded                               | 01... 53                                                   |
49224 *  | Week of month      | W           | Numeric: 1 digit                                              | 1... 5                                                     |
49225 *  | Day of month       | d           | Numeric: minimum digits                                       | 1                                                          |
49226 *  |                    | dd          | Numeric: 2 digits + zero padded                               | 01                                                          |
49227 *  | Week day           | E, EE & EEE | Abbreviated                                                   | Tue                                                        |
49228 *  |                    | EEEE        | Wide                                                          | Tuesday                                                    |
49229 *  |                    | EEEEE       | Narrow                                                        | T                                                          |
49230 *  |                    | EEEEEE      | Short                                                         | Tu                                                         |
49231 *  | Period             | a, aa & aaa | Abbreviated                                                   | am/pm or AM/PM                                             |
49232 *  |                    | aaaa        | Wide (fallback to `a` when missing)                           | ante meridiem/post meridiem                                |
49233 *  |                    | aaaaa       | Narrow                                                        | a/p                                                        |
49234 *  | Period*            | B, BB & BBB | Abbreviated                                                   | mid.                                                       |
49235 *  |                    | BBBB        | Wide                                                          | am, pm, midnight, noon, morning, afternoon, evening, night |
49236 *  |                    | BBBBB       | Narrow                                                        | md                                                         |
49237 *  | Period standalone* | b, bb & bbb | Abbreviated                                                   | mid.                                                       |
49238 *  |                    | bbbb        | Wide                                                          | am, pm, midnight, noon, morning, afternoon, evening, night |
49239 *  |                    | bbbbb       | Narrow                                                        | md                                                         |
49240 *  | Hour 1-12          | h           | Numeric: minimum digits                                       | 1, 12                                                      |
49241 *  |                    | hh          | Numeric: 2 digits + zero padded                               | 01, 12                                                     |
49242 *  | Hour 0-23          | H           | Numeric: minimum digits                                       | 0, 23                                                      |
49243 *  |                    | HH          | Numeric: 2 digits + zero padded                               | 00, 23                                                     |
49244 *  | Minute             | m           | Numeric: minimum digits                                       | 8, 59                                                      |
49245 *  |                    | mm          | Numeric: 2 digits + zero padded                               | 08, 59                                                     |
49246 *  | Second             | s           | Numeric: minimum digits                                       | 0... 59                                                    |
49247 *  |                    | ss          | Numeric: 2 digits + zero padded                               | 00... 59                                                   |
49248 *  | Fractional seconds | S           | Numeric: 1 digit                                              | 0... 9                                                     |
49249 *  |                    | SS          | Numeric: 2 digits + zero padded                               | 00... 99                                                   |
49250 *  |                    | SSS         | Numeric: 3 digits + zero padded (= milliseconds)              | 000... 999                                                 |
49251 *  | Zone               | z, zz & zzz | Short specific non location format (fallback to O)            | GMT-8                                                      |
49252 *  |                    | zzzz        | Long specific non location format (fallback to OOOO)          | GMT-08:00                                                  |
49253 *  |                    | Z, ZZ & ZZZ | ISO8601 basic format                                          | -0800                                                      |
49254 *  |                    | ZZZZ        | Long localized GMT format                                     | GMT-8:00                                                   |
49255 *  |                    | ZZZZZ       | ISO8601 extended format + Z indicator for offset 0 (= XXXXX)  | -08:00                                                     |
49256 *  |                    | O, OO & OOO | Short localized GMT format                                    | GMT-8                                                      |
49257 *  |                    | OOOO        | Long localized GMT format                                     | GMT-08:00                                                  |
49258 *
49259 *
49260 * ### Format examples
49261 *
49262 * These examples transform a date into various formats,
49263 * assuming that `dateObj` is a JavaScript `Date` object for
49264 * year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11,
49265 * given in the local time for the `en-US` locale.
49266 *
49267 * ```
49268 * {{ dateObj | date }}               // output is 'Jun 15, 2015'
49269 * {{ dateObj | date:'medium' }}      // output is 'Jun 15, 2015, 9:43:11 PM'
49270 * {{ dateObj | date:'shortTime' }}   // output is '9:43 PM'
49271 * {{ dateObj | date:'mm:ss' }}       // output is '43:11'
49272 * ```
49273 *
49274 * ### Usage example
49275 *
49276 * The following component uses a date pipe to display the current date in different formats.
49277 *
49278 * ```
49279 * @Component({
49280 *  selector: 'date-pipe',
49281 *  template: `<div>
49282 *    <p>Today is {{today | date}}</p>
49283 *    <p>Or if you prefer, {{today | date:'fullDate'}}</p>
49284 *    <p>The time is {{today | date:'h:mm a z'}}</p>
49285 *  </div>`
49286 * })
49287 * // Get the current date and time as a date-time value.
49288 * export class DatePipeComponent {
49289 *   today: number = Date.now();
49290 * }
49291 * ```
49292 *
49293 * @publicApi
49294 */
49295// clang-format on
49296class DatePipe {
49297    constructor(locale) {
49298        this.locale = locale;
49299    }
49300    transform(value, format = 'mediumDate', timezone, locale) {
49301        if (value == null || value === '' || value !== value)
49302            return null;
49303        try {
49304            return formatDate(value, format, locale || this.locale, timezone);
49305        }
49306        catch (error) {
49307            throw invalidPipeArgumentError(DatePipe, error.message);
49308        }
49309    }
49310}
49311DatePipe.ɵfac = function DatePipe_Factory(t) { return new (t || DatePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])); };
49312DatePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "date", type: DatePipe, pure: true });
49313DatePipe.ctorParameters = () => [
49314    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
49315];
49316(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DatePipe, [{
49317        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49318        args: [{ name: 'date', pure: true }]
49319    }], function () { return [{ type: String, decorators: [{
49320                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
49321                args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]]
49322            }] }]; }, null); })();
49323
49324/**
49325 * @license
49326 * Copyright Google LLC All Rights Reserved.
49327 *
49328 * Use of this source code is governed by an MIT-style license that can be
49329 * found in the LICENSE file at https://angular.io/license
49330 */
49331const _INTERPOLATION_REGEXP = /#/g;
49332/**
49333 * @ngModule CommonModule
49334 * @description
49335 *
49336 * Maps a value to a string that pluralizes the value according to locale rules.
49337 *
49338 * @usageNotes
49339 *
49340 * ### Example
49341 *
49342 * {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
49343 *
49344 * @publicApi
49345 */
49346class I18nPluralPipe {
49347    constructor(_localization) {
49348        this._localization = _localization;
49349    }
49350    /**
49351     * @param value the number to be formatted
49352     * @param pluralMap an object that mimics the ICU format, see
49353     * http://userguide.icu-project.org/formatparse/messages.
49354     * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
49355     * default).
49356     */
49357    transform(value, pluralMap, locale) {
49358        if (value == null)
49359            return '';
49360        if (typeof pluralMap !== 'object' || pluralMap === null) {
49361            throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);
49362        }
49363        const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
49364        return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
49365    }
49366}
49367I18nPluralPipe.ɵfac = function I18nPluralPipe_Factory(t) { return new (t || I18nPluralPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgLocalization)); };
49368I18nPluralPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "i18nPlural", type: I18nPluralPipe, pure: true });
49369I18nPluralPipe.ctorParameters = () => [
49370    { type: NgLocalization }
49371];
49372(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](I18nPluralPipe, [{
49373        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49374        args: [{ name: 'i18nPlural', pure: true }]
49375    }], function () { return [{ type: NgLocalization }]; }, null); })();
49376
49377/**
49378 * @license
49379 * Copyright Google LLC All Rights Reserved.
49380 *
49381 * Use of this source code is governed by an MIT-style license that can be
49382 * found in the LICENSE file at https://angular.io/license
49383 */
49384/**
49385 * @ngModule CommonModule
49386 * @description
49387 *
49388 * Generic selector that displays the string that matches the current value.
49389 *
49390 * If none of the keys of the `mapping` match the `value`, then the content
49391 * of the `other` key is returned when present, otherwise an empty string is returned.
49392 *
49393 * @usageNotes
49394 *
49395 * ### Example
49396 *
49397 * {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
49398 *
49399 * @publicApi
49400 */
49401class I18nSelectPipe {
49402    /**
49403     * @param value a string to be internationalized.
49404     * @param mapping an object that indicates the text that should be displayed
49405     * for different values of the provided `value`.
49406     */
49407    transform(value, mapping) {
49408        if (value == null)
49409            return '';
49410        if (typeof mapping !== 'object' || typeof value !== 'string') {
49411            throw invalidPipeArgumentError(I18nSelectPipe, mapping);
49412        }
49413        if (mapping.hasOwnProperty(value)) {
49414            return mapping[value];
49415        }
49416        if (mapping.hasOwnProperty('other')) {
49417            return mapping['other'];
49418        }
49419        return '';
49420    }
49421}
49422I18nSelectPipe.ɵfac = function I18nSelectPipe_Factory(t) { return new (t || I18nSelectPipe)(); };
49423I18nSelectPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "i18nSelect", type: I18nSelectPipe, pure: true });
49424(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](I18nSelectPipe, [{
49425        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49426        args: [{ name: 'i18nSelect', pure: true }]
49427    }], null, null); })();
49428
49429/**
49430 * @license
49431 * Copyright Google LLC All Rights Reserved.
49432 *
49433 * Use of this source code is governed by an MIT-style license that can be
49434 * found in the LICENSE file at https://angular.io/license
49435 */
49436/**
49437 * @ngModule CommonModule
49438 * @description
49439 *
49440 * Converts a value into its JSON-format representation.  Useful for debugging.
49441 *
49442 * @usageNotes
49443 *
49444 * The following component uses a JSON pipe to convert an object
49445 * to JSON format, and displays the string in both formats for comparison.
49446 *
49447 * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
49448 *
49449 * @publicApi
49450 */
49451class JsonPipe {
49452    /**
49453     * @param value A value of any type to convert into a JSON-format string.
49454     */
49455    transform(value) {
49456        return JSON.stringify(value, null, 2);
49457    }
49458}
49459JsonPipe.ɵfac = function JsonPipe_Factory(t) { return new (t || JsonPipe)(); };
49460JsonPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "json", type: JsonPipe, pure: false });
49461(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](JsonPipe, [{
49462        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49463        args: [{ name: 'json', pure: false }]
49464    }], null, null); })();
49465
49466/**
49467 * @license
49468 * Copyright Google LLC All Rights Reserved.
49469 *
49470 * Use of this source code is governed by an MIT-style license that can be
49471 * found in the LICENSE file at https://angular.io/license
49472 */
49473function makeKeyValuePair(key, value) {
49474    return { key: key, value: value };
49475}
49476/**
49477 * @ngModule CommonModule
49478 * @description
49479 *
49480 * Transforms Object or Map into an array of key value pairs.
49481 *
49482 * The output array will be ordered by keys.
49483 * By default the comparator will be by Unicode point value.
49484 * You can optionally pass a compareFn if your keys are complex types.
49485 *
49486 * @usageNotes
49487 * ### Examples
49488 *
49489 * This examples show how an Object or a Map can be iterated by ngFor with the use of this
49490 * keyvalue pipe.
49491 *
49492 * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'}
49493 *
49494 * @publicApi
49495 */
49496class KeyValuePipe {
49497    constructor(differs) {
49498        this.differs = differs;
49499        this.keyValues = [];
49500    }
49501    transform(input, compareFn = defaultComparator) {
49502        if (!input || (!(input instanceof Map) && typeof input !== 'object')) {
49503            return null;
49504        }
49505        if (!this.differ) {
49506            // make a differ for whatever type we've been passed in
49507            this.differ = this.differs.find(input).create();
49508        }
49509        const differChanges = this.differ.diff(input);
49510        if (differChanges) {
49511            this.keyValues = [];
49512            differChanges.forEachItem((r) => {
49513                this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));
49514            });
49515            this.keyValues.sort(compareFn);
49516        }
49517        return this.keyValues;
49518    }
49519}
49520KeyValuePipe.ɵfac = function KeyValuePipe_Factory(t) { return new (t || KeyValuePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"])); };
49521KeyValuePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "keyvalue", type: KeyValuePipe, pure: false });
49522KeyValuePipe.ctorParameters = () => [
49523    { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] }
49524];
49525(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](KeyValuePipe, [{
49526        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49527        args: [{ name: 'keyvalue', pure: false }]
49528    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["KeyValueDiffers"] }]; }, null); })();
49529function defaultComparator(keyValueA, keyValueB) {
49530    const a = keyValueA.key;
49531    const b = keyValueB.key;
49532    // if same exit with 0;
49533    if (a === b)
49534        return 0;
49535    // make sure that undefined are at the end of the sort.
49536    if (a === undefined)
49537        return 1;
49538    if (b === undefined)
49539        return -1;
49540    // make sure that nulls are at the end of the sort.
49541    if (a === null)
49542        return 1;
49543    if (b === null)
49544        return -1;
49545    if (typeof a == 'string' && typeof b == 'string') {
49546        return a < b ? -1 : 1;
49547    }
49548    if (typeof a == 'number' && typeof b == 'number') {
49549        return a - b;
49550    }
49551    if (typeof a == 'boolean' && typeof b == 'boolean') {
49552        return a < b ? -1 : 1;
49553    }
49554    // `a` and `b` are of different types. Compare their string values.
49555    const aString = String(a);
49556    const bString = String(b);
49557    return aString == bString ? 0 : aString < bString ? -1 : 1;
49558}
49559
49560/**
49561 * @license
49562 * Copyright Google LLC All Rights Reserved.
49563 *
49564 * Use of this source code is governed by an MIT-style license that can be
49565 * found in the LICENSE file at https://angular.io/license
49566 */
49567/**
49568 * @ngModule CommonModule
49569 * @description
49570 *
49571 * Formats a value according to digit options and locale rules.
49572 * Locale determines group sizing and separator,
49573 * decimal point character, and other locale-specific configurations.
49574 *
49575 * @see `formatNumber()`
49576 *
49577 * @usageNotes
49578 *
49579 * ### digitsInfo
49580 *
49581 * The value's decimal representation is specified by the `digitsInfo`
49582 * parameter, written in the following format:<br>
49583 *
49584 * ```
49585 * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
49586 * ```
49587 *
49588 *  - `minIntegerDigits`:
49589 * The minimum number of integer digits before the decimal point.
49590 * Default is 1.
49591 *
49592 * - `minFractionDigits`:
49593 * The minimum number of digits after the decimal point.
49594 * Default is 0.
49595 *
49596 *  - `maxFractionDigits`:
49597 * The maximum number of digits after the decimal point.
49598 * Default is 3.
49599 *
49600 * If the formatted value is truncated it will be rounded using the "to-nearest" method:
49601 *
49602 * ```
49603 * {{3.6 | number: '1.0-0'}}
49604 * <!--will output '4'-->
49605 *
49606 * {{-3.6 | number:'1.0-0'}}
49607 * <!--will output '-4'-->
49608 * ```
49609 *
49610 * ### locale
49611 *
49612 * `locale` will format a value according to locale rules.
49613 * Locale determines group sizing and separator,
49614 * decimal point character, and other locale-specific configurations.
49615 *
49616 * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
49617 *
49618 * See [Setting your app locale](guide/i18n#setting-up-the-locale-of-your-app).
49619 *
49620 * ### Example
49621 *
49622 * The following code shows how the pipe transforms values
49623 * according to various format specifications,
49624 * where the caller's default locale is `en-US`.
49625 *
49626 * <code-example path="common/pipes/ts/number_pipe.ts" region='NumberPipe'></code-example>
49627 *
49628 * @publicApi
49629 */
49630class DecimalPipe {
49631    constructor(_locale) {
49632        this._locale = _locale;
49633    }
49634    /**
49635     * @param value The value to be formatted.
49636     * @param digitsInfo Sets digit and decimal representation.
49637     * [See more](#digitsinfo).
49638     * @param locale Specifies what locale format rules to use.
49639     * [See more](#locale).
49640     */
49641    transform(value, digitsInfo, locale) {
49642        if (!isValue(value))
49643            return null;
49644        locale = locale || this._locale;
49645        try {
49646            const num = strToNumber(value);
49647            return formatNumber(num, locale, digitsInfo);
49648        }
49649        catch (error) {
49650            throw invalidPipeArgumentError(DecimalPipe, error.message);
49651        }
49652    }
49653}
49654DecimalPipe.ɵfac = function DecimalPipe_Factory(t) { return new (t || DecimalPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])); };
49655DecimalPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "number", type: DecimalPipe, pure: true });
49656DecimalPipe.ctorParameters = () => [
49657    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
49658];
49659(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DecimalPipe, [{
49660        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49661        args: [{ name: 'number' }]
49662    }], function () { return [{ type: String, decorators: [{
49663                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
49664                args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]]
49665            }] }]; }, null); })();
49666/**
49667 * @ngModule CommonModule
49668 * @description
49669 *
49670 * Transforms a number to a percentage
49671 * string, formatted according to locale rules that determine group sizing and
49672 * separator, decimal-point character, and other locale-specific
49673 * configurations.
49674 *
49675 * @see `formatPercent()`
49676 *
49677 * @usageNotes
49678 * The following code shows how the pipe transforms numbers
49679 * into text strings, according to various format specifications,
49680 * where the caller's default locale is `en-US`.
49681 *
49682 * <code-example path="common/pipes/ts/percent_pipe.ts" region='PercentPipe'></code-example>
49683 *
49684 * @publicApi
49685 */
49686class PercentPipe {
49687    constructor(_locale) {
49688        this._locale = _locale;
49689    }
49690    transform(value, digitsInfo, locale) {
49691        if (!isValue(value))
49692            return null;
49693        locale = locale || this._locale;
49694        try {
49695            const num = strToNumber(value);
49696            return formatPercent(num, locale, digitsInfo);
49697        }
49698        catch (error) {
49699            throw invalidPipeArgumentError(PercentPipe, error.message);
49700        }
49701    }
49702}
49703PercentPipe.ɵfac = function PercentPipe_Factory(t) { return new (t || PercentPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"])); };
49704PercentPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "percent", type: PercentPipe, pure: true });
49705PercentPipe.ctorParameters = () => [
49706    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] }
49707];
49708(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PercentPipe, [{
49709        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49710        args: [{ name: 'percent' }]
49711    }], function () { return [{ type: String, decorators: [{
49712                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
49713                args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]]
49714            }] }]; }, null); })();
49715/**
49716 * @ngModule CommonModule
49717 * @description
49718 *
49719 * Transforms a number to a currency string, formatted according to locale rules
49720 * that determine group sizing and separator, decimal-point character,
49721 * and other locale-specific configurations.
49722 *
49723 * {@a currency-code-deprecation}
49724 * <div class="alert is-helpful">
49725 *
49726 * **Deprecation notice:**
49727 *
49728 * The default currency code is currently always `USD` but this is deprecated from v9.
49729 *
49730 * **In v11 the default currency code will be taken from the current locale identified by
49731 * the `LOCALE_ID` token. See the [i18n guide](guide/i18n#setting-up-the-locale-of-your-app) for
49732 * more information.**
49733 *
49734 * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
49735 * your application `NgModule`:
49736 *
49737 * ```ts
49738 * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
49739 * ```
49740 *
49741 * </div>
49742 *
49743 * @see `getCurrencySymbol()`
49744 * @see `formatCurrency()`
49745 *
49746 * @usageNotes
49747 * The following code shows how the pipe transforms numbers
49748 * into text strings, according to various format specifications,
49749 * where the caller's default locale is `en-US`.
49750 *
49751 * <code-example path="common/pipes/ts/currency_pipe.ts" region='CurrencyPipe'></code-example>
49752 *
49753 * @publicApi
49754 */
49755class CurrencyPipe {
49756    constructor(_locale, _defaultCurrencyCode = 'USD') {
49757        this._locale = _locale;
49758        this._defaultCurrencyCode = _defaultCurrencyCode;
49759    }
49760    transform(value, currencyCode, display = 'symbol', digitsInfo, locale) {
49761        if (!isValue(value))
49762            return null;
49763        locale = locale || this._locale;
49764        if (typeof display === 'boolean') {
49765            if ((typeof ngDevMode === 'undefined' || ngDevMode) && console && console.warn) {
49766                console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`);
49767            }
49768            display = display ? 'symbol' : 'code';
49769        }
49770        let currency = currencyCode || this._defaultCurrencyCode;
49771        if (display !== 'code') {
49772            if (display === 'symbol' || display === 'symbol-narrow') {
49773                currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale);
49774            }
49775            else {
49776                currency = display;
49777            }
49778        }
49779        try {
49780            const num = strToNumber(value);
49781            return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
49782        }
49783        catch (error) {
49784            throw invalidPipeArgumentError(CurrencyPipe, error.message);
49785        }
49786    }
49787}
49788CurrencyPipe.ɵfac = function CurrencyPipe_Factory(t) { return new (t || CurrencyPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__["DEFAULT_CURRENCY_CODE"])); };
49789CurrencyPipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "currency", type: CurrencyPipe, pure: true });
49790CurrencyPipe.ctorParameters = () => [
49791    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"],] }] },
49792    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"], args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["DEFAULT_CURRENCY_CODE"],] }] }
49793];
49794(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CurrencyPipe, [{
49795        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49796        args: [{ name: 'currency' }]
49797    }], function () { return [{ type: String, decorators: [{
49798                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
49799                args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["LOCALE_ID"]]
49800            }] }, { type: String, decorators: [{
49801                type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Inject"],
49802                args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["DEFAULT_CURRENCY_CODE"]]
49803            }] }]; }, null); })();
49804function isValue(value) {
49805    return !(value == null || value === '' || value !== value);
49806}
49807/**
49808 * Transforms a string into a number (if needed).
49809 */
49810function strToNumber(value) {
49811    // Convert strings to numbers
49812    if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {
49813        return Number(value);
49814    }
49815    if (typeof value !== 'number') {
49816        throw new Error(`${value} is not a number`);
49817    }
49818    return value;
49819}
49820
49821/**
49822 * @license
49823 * Copyright Google LLC All Rights Reserved.
49824 *
49825 * Use of this source code is governed by an MIT-style license that can be
49826 * found in the LICENSE file at https://angular.io/license
49827 */
49828/**
49829 * @ngModule CommonModule
49830 * @description
49831 *
49832 * Creates a new `Array` or `String` containing a subset (slice) of the elements.
49833 *
49834 * @usageNotes
49835 *
49836 * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`
49837 * and `String.prototype.slice()`.
49838 *
49839 * When operating on an `Array`, the returned `Array` is always a copy even when all
49840 * the elements are being returned.
49841 *
49842 * When operating on a blank value, the pipe returns the blank value.
49843 *
49844 * ### List Example
49845 *
49846 * This `ngFor` example:
49847 *
49848 * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}
49849 *
49850 * produces the following:
49851 *
49852 * ```html
49853 * <li>
49853b</li>
49854 * <li>c</li>
49855 * ```
49856 *
49857 * ### String Examples
49858 *
49859 * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}
49860 *
49861 * @publicApi
49862 */
49863class SlicePipe {
49864    transform(value, start, end) {
49865        if (value == null)
49866            return null;
49867        if (!this.supports(value)) {
49868            throw invalidPipeArgumentError(SlicePipe, value);
49869        }
49870        return value.slice(start, end);
49871    }
49872    supports(obj) {
49873        return typeof obj === 'string' || Array.isArray(obj);
49874    }
49875}
49876SlicePipe.ɵfac = function SlicePipe_Factory(t) { return new (t || SlicePipe)(); };
49877SlicePipe.ɵpipe = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({ name: "slice", type: SlicePipe, pure: false });
49878(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](SlicePipe, [{
49879        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["Pipe"],
49880        args: [{ name: 'slice', pure: false }]
49881    }], null, null); })();
49882
49883/**
49884 * @license
49885 * Copyright Google LLC All Rights Reserved.
49886 *
49887 * Use of this source code is governed by an MIT-style license that can be
49888 * found in the LICENSE file at https://angular.io/license
49889 */
49890/**
49891 * A collection of Angular pipes that are likely to be used in each and every application.
49892 */
49893const COMMON_PIPES = [
49894    AsyncPipe,
49895    UpperCasePipe,
49896    LowerCasePipe,
49897    JsonPipe,
49898    SlicePipe,
49899    DecimalPipe,
49900    PercentPipe,
49901    TitleCasePipe,
49902    CurrencyPipe,
49903    DatePipe,
49904    I18nPluralPipe,
49905    I18nSelectPipe,
49906    KeyValuePipe,
49907];
49908
49909/**
49910 * @license
49911 * Copyright Google LLC All Rights Reserved.
49912 *
49913 * Use of this source code is governed by an MIT-style license that can be
49914 * found in the LICENSE file at https://angular.io/license
49915 */
49916// Note: This does not contain the location providers,
49917// as they need some platform specific implementations to work.
49918/**
49919 * Exports all the basic Angular directives and pipes,
49920 * such as `NgIf`, `NgForOf`, `DecimalPipe`, and so on.
49921 * Re-exported by `BrowserModule`, which is included automatically in the root
49922 * `AppModule` when you create a new app with the CLI `new` command.
49923 *
49924 * * The `providers` options configure the NgModule's injector to provide
49925 * localization dependencies to members.
49926 * * The `exports` options make the declared directives and pipes available for import
49927 * by other NgModules.
49928 *
49929 * @publicApi
49930 */
49931class CommonModule {
49932}
49933CommonModule.ɵfac = function CommonModule_Factory(t) { return new (t || CommonModule)(); };
49934CommonModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: CommonModule });
49935CommonModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ providers: [
49936        { provide: NgLocalization, useClass: NgLocaleLocalization },
49937    ] });
49938(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsetNgModuleScope"](CommonModule, { declarations: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe], exports: [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe] }); })();
49939(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CommonModule, [{
49940        type: _angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"],
49941        args: [{
49942                declarations: [COMMON_DIRECTIVES, COMMON_PIPES],
49943                exports: [COMMON_DIRECTIVES, COMMON_PIPES],
49944                providers: [
49945                    { provide: NgLocalization, useClass: NgLocaleLocalization },
49946                ]
49947            }]
49948    }], null, null); })();
49949
49950/**
49951 * @license
49952 * Copyright Google LLC All Rights Reserved.
49953 *
49954 * Use of this source code is governed by an MIT-style license that can be
49955 * found in the LICENSE file at https://angular.io/license
49956 */
49957const PLATFORM_BROWSER_ID = 'browser';
49958const PLATFORM_SERVER_ID = 'server';
49959const PLATFORM_WORKER_APP_ID = 'browserWorkerApp';
49960const PLATFORM_WORKER_UI_ID = 'browserWorkerUi';
49961/**
49962 * Returns whether a platform id represents a browser platform.
49963 * @publicApi
49964 */
49965function isPlatformBrowser(platformId) {
49966    return platformId === PLATFORM_BROWSER_ID;
49967}
49968/**
49969 * Returns whether a platform id represents a server platform.
49970 * @publicApi
49971 */
49972function isPlatformServer(platformId) {
49973    return platformId === PLATFORM_SERVER_ID;
49974}
49975/**
49976 * Returns whether a platform id represents a web worker app platform.
49977 * @publicApi
49978 */
49979function isPlatformWorkerApp(platformId) {
49980    return platformId === PLATFORM_WORKER_APP_ID;
49981}
49982/**
49983 * Returns whether a platform id represents a web worker UI platform.
49984 * @publicApi
49985 */
49986function isPlatformWorkerUi(platformId) {
49987    return platformId === PLATFORM_WORKER_UI_ID;
49988}
49989
49990/**
49991 * @license
49992 * Copyright Google LLC All Rights Reserved.
49993 *
49994 * Use of this source code is governed by an MIT-style license that can be
49995 * found in the LICENSE file at https://angular.io/license
49996 */
49997/**
49998 * @publicApi
49999 */
50000const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Version"]('11.2.11');
50001
50002/**
50003 * @license
50004 * Copyright Google LLC All Rights Reserved.
50005 *
50006 * Use of this source code is governed by an MIT-style license that can be
50007 * found in the LICENSE file at https://angular.io/license
50008 */
50009/**
50010 * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.
50011 *
50012 * @publicApi
50013 */
50014class ViewportScroller {
50015}
50016// De-sugared tree-shakable injection
50017// See #23917
50018/** @nocollapse */
50019ViewportScroller.ɵprov = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({
50020    token: ViewportScroller,
50021    providedIn: 'root',
50022    factory: () => new BrowserViewportScroller(Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(DOCUMENT), window)
50023}
50023);
50024/**
50025 * Manages the scroll position for a browser window.
50026 */
50027class BrowserViewportScroller {
50028    constructor(document, window) {
50029        this.document = document;
50030        this.window = window;
50031        this.offset = () => [0, 0];
50032    }
50033    /**
50034     * Configures the top offset used when scrolling to an anchor.
50035     * @param offset A position in screen coordinates (a tuple with x and y values)
50036     * or a function that returns the top offset position.
50037     *
50038     */
50039    setOffset(offset) {
50040        if (Array.isArray(offset)) {
50041            this.offset = () => offset;
50042        }
50043        else {
50044            this.offset = offset;
50045        }
50046    }
50047    /**
50048     * Retrieves the current scroll position.
50049     * @returns The position in screen coordinates.
50050     */
50051    getScrollPosition() {
50052        if (this.supportsScrolling()) {
50053            return [this.window.pageXOffset, this.window.pageYOffset];
50054        }
50055        else {
50056            return [0, 0];
50057        }
50058    }
50059    /**
50060     * Sets the scroll position.
50061     * @param position The new position in screen coordinates.
50062     */
50063    scrollToPosition(position) {
50064        if (this.supportsScrolling()) {
50065            this.window.scrollTo(position[0], position[1]);
50066        }
50067    }
50068    /**
50069     * Scrolls to an element and attempts to focus the element.
50070     *
50071     * Note that the function name here is misleading in that the target string may be an ID for a
50072     * non-anchor element.
50073     *
50074     * @param target The ID of an element or name of the anchor.
50075     *
50076     * @see https://html.spec.whatwg.org/#the-indicated-part-of-the-document
50077     * @see https://html.spec.whatwg.org/#scroll-to-fragid
50078     */
50079    scrollToAnchor(target) {
50080        if (!this.supportsScrolling()) {
50081            return;
50082        }
50083        // TODO(atscott): The correct behavior for `getElementsByName` would be to also verify that the
50084        // element is an anchor. However, this could be considered a breaking change and should be
50085        // done in a major version.
50086        const elSelected = findAnchorFromDocument(this.document, target);
50087        if (elSelected) {
50088            this.scrollToElement(elSelected);
50089            // After scrolling to the element, the spec dictates that we follow the focus steps for the
50090            // target. Rather than following the robust steps, simply attempt focus.
50091            this.attemptFocus(elSelected);
50092        }
50093    }
50094    /**
50095     * Disables automatic scroll restoration provided by the browser.
50096     */
50097    setHistoryScrollRestoration(scrollRestoration) {
50098        if (this.supportScrollRestoration()) {
50099            const history = this.window.history;
50100            if (history && history.scrollRestoration) {
50101                history.scrollRestoration = scrollRestoration;
50102            }
50103        }
50104    }
50105    /**
50106     * Scrolls to an element using the native offset and the specified offset set on this scroller.
50107     *
50108     * The offset can be used when we know that there is a floating header and scrolling naively to an
50109     * element (ex: `scrollIntoView`) leaves the element hidden behind the floating header.
50110     */
50111    scrollToElement(el) {
50112        const rect = el.getBoundingClientRect();
50113        const left = rect.left + this.window.pageXOffset;
50114        const top = rect.top + this.window.pageYOffset;
50115        const offset = this.offset();
50116        this.window.scrollTo(left - offset[0], top - offset[1]);
50117    }
50118    /**
50119     * Calls `focus` on the `focusTarget` and returns `true` if the element was focused successfully.
50120     *
50121     * If `false`, further steps may be necessary to determine a valid substitute to be focused
50122     * instead.
50123     *
50124     * @see https://html.spec.whatwg.org/#get-the-focusable-area
50125     * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus
50126     * @see https://html.spec.whatwg.org/#focusable-area
50127     */
50128    attemptFocus(focusTarget) {
50129        focusTarget.focus();
50130        return this.document.activeElement === focusTarget;
50131    }
50132    /**
50133     * We only support scroll restoration when we can get a hold of window.
50134     * This means that we do not support this behavior when running in a web worker.
50135     *
50136     * Lifting this restriction right now would require more changes in the dom adapter.
50137     * Since webworkers aren't widely used, we will lift it once RouterScroller is
50138     * battle-tested.
50139     */
50140    supportScrollRestoration() {
50141        try {
50142            if (!this.supportsScrolling()) {
50143                return false;
50144            }
50145            // The `scrollRestoration` property could be on the `history` instance or its prototype.
50146            const scrollRestorationDescriptor = getScrollRestorationProperty(this.window.history) ||
50147                getScrollRestorationProperty(Object.getPrototypeOf(this.window.history));
50148            // We can write to the `scrollRestoration` property if it is a writable data field or it has a
50149            // setter function.
50150            return !!scrollRestorationDescriptor &&
50151                !!(scrollRestorationDescriptor.writable || scrollRestorationDescriptor.set);
50152        }
50153        catch (_a) {
50154            return false;
50155        }
50156    }
50157    supportsScrolling() {
50158        try {
50159            return !!this.window && !!this.window.scrollTo && 'pageXOffset' in this.window;
50160        }
50161        catch (_a) {
50162            return false;
50163        }
50164    }
50165}
50166function getScrollRestorationProperty(obj) {
50167    return Object.getOwnPropertyDescriptor(obj, 'scrollRestoration');
50168}
50169function findAnchorFromDocument(document, target) {
50170    const documentResult = document.getElementById(target) || document.getElementsByName(target)[0];
50171    if (documentResult) {
50172        return documentResult;
50173    }
50174    // `getElementById` and `getElementsByName` won't pierce through the shadow DOM so we
50175    // have to traverse the DOM manually and do the lookup through the shadow roots.
50176    if (typeof document.createTreeWalker === 'function' && document.body &&
50177        (document.body.createShadowRoot || document.body.attachShadow)) {
50178        const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);
50179        let currentNode = treeWalker.currentNode;
50180        while (currentNode) {
50181            const shadowRoot = currentNode.shadowRoot;
50182            if (shadowRoot) {
50183                // Note that `ShadowRoot` doesn't support `getElementsByName`
50184                // so we have to fall back to `querySelector`.
50185                const result = shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name="${target}"]`);
50186                if (result) {
50187                    return result;
50188                }
50189            }
50190            currentNode = treeWalker.nextNode();
50191        }
50192    }
50193    return null;
50194}
50195/**
50196 * Provides an empty implementation of the viewport scroller.
50197 */
50198class NullViewportScroller {
50199    /**
50200     * Empty implementation
50201     */
50202    setOffset(offset) { }
50203    /**
50204     * Empty implementation
50205     */
50206    getScrollPosition() {
50207        return [0, 0];
50208    }
50209    /**
50210     * Empty implementation
50211     */
50212    scrollToPosition(position) { }
50213    /**
50214     * Empty implementation
50215     */
50216    scrollToAnchor(anchor) { }
50217    /**
50218     * Empty implementation
50219     */
50220    setHistoryScrollRestoration(scrollRestoration) { }
50221}
50222
50223/**
50224 * @license
50225 * Copyright Google LLC All Rights Reserved.
50226 *
50227 * Use of this source code is governed by an MIT-style license that can be
50228 * found in the LICENSE file at https://angular.io/license
50229 */
50230
50231/**
50232 * @license
50233 * Copyright Google LLC All Rights Reserved.
50234 *
50235 * Use of this source code is governed by an MIT-style license that can be
50236 * found in the LICENSE file at https://angular.io/license
50237 */
50238// This file only reexports content of the `src` folder. Keep it that way.
50239
50240/**
50241 * @license
50242 * Copyright Google LLC All Rights Reserved.
50243 *
50244 * Use of this source code is governed by an MIT-style license that can be
50245 * found in the LICENSE file at https://angular.io/license
50246 */
50247
50248/**
50249 * Generated bundle index. Do not edit.
50250 */
50251
50252
50253
50254//# sourceMappingURL=common.js.map
50255
50256/***/ }),
50257
50258/***/ "p9/F":
50259/*!*****************************************************************!*\
50260  !*** ./node_modules/rxjs/_esm2015/internal/operators/buffer.js ***!
50261  \*****************************************************************/
50262/*! exports provided: buffer */
50263/***/ (function(module, __webpack_exports__, __webpack_require__) {
50264
50265"use strict";
50266__webpack_require__.r(__webpack_exports__);
50267/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return buffer; });
50268/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
50269
50270function buffer(closingNotifier) {
50271    return function bufferOperatorFunction(source) {
50272        return source.lift(new BufferOperator(closingNotifier));
50273    };
50274}
50275class BufferOperator {
50276    constructor(closingNotifier) {
50277        this.closingNotifier = closingNotifier;
50278    }
50279    call(subscriber, source) {
50280        return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
50281    }
50282}
50283class BufferSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
50284    constructor(destination, closingNotifier) {
50285        super(destination);
50286        this.buffer = [];
50287        this.add(Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(closingNotifier, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this)));
50288    }
50289    _next(value) {
50290        this.buffer.push(value);
50291    }
50292    notifyNext() {
50293        const buffer = this.buffer;
50294        this.buffer = [];
50295        this.destination.next(buffer);
50296    }
50297}
50298//# sourceMappingURL=buffer.js.map
50299
50300/***/ }),
50301
50302/***/ "pLZG":
50303/*!*****************************************************************!*\
50304  !*** ./node_modules/rxjs/_esm2015/internal/operators/filter.js ***!
50305  \*****************************************************************/
50306/*! exports provided: filter */
50307/***/ (function(module, __webpack_exports__, __webpack_require__) {
50308
50309"use strict";
50310__webpack_require__.r(__webpack_exports__);
50311/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return filter; });
50312/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
50313
50314function filter(predicate, thisArg) {
50315    return function filterOperatorFunction(source) {
50316        return source.lift(new FilterOperator(predicate, thisArg));
50317    };
50318}
50319class FilterOperator {
50320    constructor(predicate, thisArg) {
50321        this.predicate = predicate;
50322        this.thisArg = thisArg;
50323    }
50324    call(subscriber, source) {
50325        return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
50326    }
50327}
50328class FilterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
50329    constructor(destination, predicate, thisArg) {
50330        super(destination);
50331        this.predicate = predicate;
50332        this.thisArg = thisArg;
50333        this.count = 0;
50334    }
50335    _next(value) {
50336        let result;
50337        try {
50338            result = this.predicate.call(this.thisArg, value, this.count++);
50339        }
50340        catch (err) {
50341            this.destination.error(err);
50342            return;
50343        }
50344        if (result) {
50345            this.destination.next(value);
50346        }
50347    }
50348}
50349//# sourceMappingURL=filter.js.map
50350
50351/***/ }),
50352
50353/***/ "pLzU":
50354/*!*************************************************************************!*\
50355  !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToIterable.js ***!
50356  \*************************************************************************/
50357/*! exports provided: subscribeToIterable */
50358/***/ (function(module, __webpack_exports__, __webpack_require__) {
50359
50360"use strict";
50361__webpack_require__.r(__webpack_exports__);
50362/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToIterable", function() { return subscribeToIterable; });
50363/* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/iterator */ "Lhse");
50364
50365const subscribeToIterable = (iterable) => (subscriber) => {
50366    const iterator = iterable[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]]();
50367    do {
50368        let item;
50369        try {
50370            item = iterator.next();
50371        }
50372        catch (err) {
50373            subscriber.error(err);
50374            return subscriber;
50375        }
50376        if (item.done) {
50377            subscriber.complete();
50378            break;
50379        }
50380        subscriber.next(item.value);
50381        if (subscriber.closed) {
50382            break;
50383        }
50384    } while (true);
50385    if (typeof iterator.return === 'function') {
50386        subscriber.add(() => {
50387            if (iterator.return) {
50388                iterator.return();
50389            }
50390        });
50391    }
50392    return subscriber;
50393};
50394//# sourceMappingURL=subscribeToIterable.js.map
50395
50396/***/ }),
50397
50398/***/ "pXlZ":
50399/*!*********************************************************************!*\
50400  !*** ./node_modules/rxjs/_esm2015/internal/operators/windowWhen.js ***!
50401  \*********************************************************************/
50402/*! exports provided: windowWhen */
50403/***/ (function(module, __webpack_exports__, __webpack_require__) {
50404
50405"use strict";
50406__webpack_require__.r(__webpack_exports__);
50407/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return windowWhen; });
50408/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "XNiG");
50409/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../OuterSubscriber */ "l7GE");
50410/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/subscribeToResult */ "ZUHj");
50411
50412
50413
50414function windowWhen(closingSelector) {
50415    return function windowWhenOperatorFunction(source) {
50416        return source.lift(new WindowOperator(closingSelector));
50417    };
50418}
50419class WindowOperator {
50420    constructor(closingSelector) {
50421        this.closingSelector = closingSelector;
50422    }
50423    call(subscriber, source) {
50424        return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));
50425    }
50426}
50427class WindowSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"] {
50428    constructor(destination, closingSelector) {
50429        super(destination);
50430        this.destination = destination;
50431        this.closingSelector = closingSelector;
50432        this.openWindow();
50433    }
50434    notifyNext(_outerValue, _innerValue, _outerIndex, _innerIndex, innerSub) {
50435        this.openWindow(innerSub);
50436    }
50437    notifyError(error) {
50438        this._error(error);
50439    }
50440    notifyComplete(innerSub) {
50441        this.openWindow(innerSub);
50442    }
50443    _next(value) {
50444        this.window.next(value);
50445    }
50446    _error(err) {
50447        this.window.error(err);
50448        this.destination.error(err);
50449        this.unsubscribeClosingNotification();
50450    }
50451    _complete() {
50452        this.window.complete();
50453        this.destination.complete();
50454        this.unsubscribeClosingNotification();
50455    }
50456    unsubscribeClosingNotification() {
50457        if (this.closingNotification) {
50458            this.closingNotification.unsubscribe();
50459        }
50460    }
50461    openWindow(innerSub = null) {
50462        if (innerSub) {
50463            this.remove(innerSub);
50464            innerSub.unsubscribe();
50465        }
50466        const prevWindow = this.window;
50467        if (prevWindow) {
50468            prevWindow.complete();
50469        }
50470        const window = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
50471        this.destination.next(window);
50472        let closingNotifier;
50473        try {
50474            const { closingSelector } = this;
50475            closingNotifier = closingSelector();
50476        }
50477        catch (e) {
50478            this.destination.error(e);
50479            this.window.error(e);
50480            return;
50481        }
50482        this.add(this.closingNotification = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, closingNotifier));
50483    }
50484}
50485//# sourceMappingURL=windowWhen.js.map
50486
50487/***/ }),
50488
50489/***/ "pjAE":
50490/*!*************************************************************************!*\
50491  !*** ./node_modules/rxjs/_esm2015/internal/util/UnsubscriptionError.js ***!
50492  \*************************************************************************/
50493/*! exports provided: UnsubscriptionError */
50494/***/ (function(module, __webpack_exports__, __webpack_require__) {
50495
50496"use strict";
50497__webpack_require__.r(__webpack_exports__);
50498/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
50498UnsubscriptionError", function() { return UnsubscriptionError; });
50499const UnsubscriptionErrorImpl = (() => {
50500    function UnsubscriptionErrorImpl(errors) {
50501        Error.call(this);
50502        this.message = errors ?
50503            `${errors.length} errors occurred during unsubscription:
50504${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n  ')}` : '';
50505        this.name = 'UnsubscriptionError';
50506        this.errors = errors;
50507        return this;
50508    }
50509    UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);
50510    return UnsubscriptionErrorImpl;
50511})();
50512const UnsubscriptionError = UnsubscriptionErrorImpl;
50513//# sourceMappingURL=UnsubscriptionError.js.map
50514
50515/***/ }),
50516
50517/***/ "pxpQ":
50518/*!********************************************************************!*\
50519  !*** ./node_modules/rxjs/_esm2015/internal/operators/observeOn.js ***!
50520  \********************************************************************/
50521/*! exports provided: observeOn, ObserveOnOperator, ObserveOnSubscriber, ObserveOnMessage */
50522/***/ (function(module, __webpack_exports__, __webpack_require__) {
50523
50524"use strict";
50525__webpack_require__.r(__webpack_exports__);
50526/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return observeOn; });
50527/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnOperator", function() { return ObserveOnOperator; });
50528/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnSubscriber", function() { return ObserveOnSubscriber; });
50529/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnMessage", function() { return ObserveOnMessage; });
50530/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
50531/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Notification */ "WMd4");
50532
50533
50534function observeOn(scheduler, delay = 0) {
50535    return function observeOnOperatorFunction(source) {
50536        return source.lift(new ObserveOnOperator(scheduler, delay));
50537    };
50538}
50539class ObserveOnOperator {
50540    constructor(scheduler, delay = 0) {
50541        this.scheduler = scheduler;
50542        this.delay = delay;
50543    }
50544    call(subscriber, source) {
50545        return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
50546    }
50547}
50548class ObserveOnSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
50549    constructor(destination, scheduler, delay = 0) {
50550        super(destination);
50551        this.scheduler = scheduler;
50552        this.delay = delay;
50553    }
50554    static dispatch(arg) {
50555        const { notification, destination } = arg;
50556        notification.observe(destination);
50557        this.unsubscribe();
50558    }
50559    scheduleMessage(notification) {
50560        const destination = this.destination;
50561        destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
50562    }
50563    _next(value) {
50564        this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createNext(value));
50565    }
50566    _error(err) {
50567        this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createError(err));
50568        this.unsubscribe();
50569    }
50570    _complete() {
50571        this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_1__["Notification"].createComplete());
50572        this.unsubscribe();
50573    }
50574}
50575class ObserveOnMessage {
50576    constructor(notification, destination) {
50577        this.notification = notification;
50578        this.destination = destination;
50579    }
50580}
50581//# sourceMappingURL=observeOn.js.map
50582
50583/***/ }),
50584
50585/***/ "q7zd":
50586/*!**********************************************************************!*\
50587  !*** ./node_modules/rxjs/_esm2015/internal/operators/concatMapTo.js ***!
50588  \**********************************************************************/
50589/*! exports provided: concatMapTo */
50590/***/ (function(module, __webpack_exports__, __webpack_require__) {
50591
50592"use strict";
50593__webpack_require__.r(__webpack_exports__);
50594/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return concatMapTo; });
50595/* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./concatMap */ "bOdf");
50596
50597function concatMapTo(innerObservable, resultSelector) {
50598    return Object(_concatMap__WEBPACK_IMPORTED_MODULE_0__["concatMap"])(() => innerObservable, resultSelector);
50599}
50600//# sourceMappingURL=concatMapTo.js.map
50601
50602/***/ }),
50603
50604/***/ "q92s":
50605/*!****************************************************************!*\
50606  !*** ./node_modules/rxjs/_esm2015/internal/operators/merge.js ***!
50607  \****************************************************************/
50608/*! exports provided: merge */
50609/***/ (function(module, __webpack_exports__, __webpack_require__) {
50610
50611"use strict";
50612__webpack_require__.r(__webpack_exports__);
50613/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
50614/* harmony import */ var _observable_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/merge */ "VRyK");
50615
50616function merge(...observables) {
50617    return (source) => source.lift.call(Object(_observable_merge__WEBPACK_IMPORTED_MODULE_0__["merge"])(source, ...observables));
50618}
50619//# sourceMappingURL=merge.js.map
50620
50621/***/ }),
50622
50623/***/ "qCKp":
50624/*!*********************************************!*\
50625  !*** ./node_modules/rxjs/_esm2015/index.js ***!
50626  \*********************************************/
50627/*! exports provided: Observable, ConnectableObservable, GroupedObservable, observable, Subject, BehaviorSubject, ReplaySubject, AsyncSubject, asap, asapScheduler, async, asyncScheduler, queue, queueScheduler, animationFrame, animationFrameScheduler, VirtualTimeScheduler, VirtualAction, Scheduler, Subscription, Subscriber, Notification, NotificationKind, pipe, noop, identity, isObservable, ArgumentOutOfRangeError, EmptyError, ObjectUnsubscribedError, UnsubscriptionError, TimeoutError, bindCallback, bindNodeCallback, combineLatest, concat, defer, empty, forkJoin, from, fromEvent, fromEventPattern, generate, iif, interval, merge, never, of, onErrorResumeNext, pairs, partition, race, range, throwError, timer, using, zip, scheduled, EMPTY, NEVER, config */
50628/***/ (function(module, __webpack_exports__, __webpack_require__) {
50629
50630"use strict";
50631__webpack_require__.r(__webpack_exports__);
50632/* harmony import */ var _internal_Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./internal/Observable */ "HDdC");
50633/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return _internal_Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]; });
50634
50635/* harmony import */ var _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/observable/ConnectableObservable */ "EQ5u");
50636/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__["ConnectableObservable"]; });
50637
50638/* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./internal/operators/groupBy */ "OQgR");
50639/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__["GroupedObservable"]; });
50640
50641/* harmony import */ var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./internal/symbol/observable */ "kJWO");
50642/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__["observable"]; });
50643
50644/* harmony import */ var _internal_Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./internal/Subject */ "XNiG");
50645/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return _internal_Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]; });
50646
50647/* harmony import */ var _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./internal/BehaviorSubject */ "2Vo4");
50648/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"]; });
50649
50650/* harmony import */ var _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./internal/ReplaySubject */ "jtHE");
50651/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__["ReplaySubject"]; });
50652
50653/* harmony import */ var _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./internal/AsyncSubject */ "NHP+");
50654/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__["AsyncSubject"]; });
50655
50656/* harmony import */ var _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./internal/scheduler/asap */ "7Hc7");
50657/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asap", function() { return _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__["asap"]; });
50658
50659/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__["asapScheduler"]; });
50660
50661/* harmony import */ var _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./internal/scheduler/async */ "D0XW");
50662/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "async", function() { return _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__["async"]; });
50663
50664/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__["asyncScheduler"]; });
50665
50666/* harmony import */ var _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internal/scheduler/queue */ "qgXg");
50667/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "queue", function() { return _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__["queue"]; });
50668
50669/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__["queueScheduler"]; });
50670
50671/* harmony import */ var _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./internal/scheduler/animationFrame */ "eNwd");
50672/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "animationFrame", function() { return _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__["animationFrame"]; });
50673
50674/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__["animationFrameScheduler"]; });
50675
50676/* harmony import */ var _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./internal/scheduler/VirtualTimeScheduler */ "iKkX");
50677/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualTimeScheduler"]; });
50678
50679/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualAction"]; });
50680
50681/* harmony import */ var _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./internal/Scheduler */ "Y/cZ");
50682/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__["Scheduler"]; });
50683
50684/* harmony import */ var _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./internal/Subscription */ "quSY");
50685/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__["Subscription"]; });
50686
50687/* harmony import */ var _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./internal/Subscriber */ "7o/Q");
50688/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__["Subscriber"]; });
50689
50690/* harmony import */ var _internal_Notification__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./internal/Notification */ "WMd4");
50691/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["Notification"]; });
50692
50693/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NotificationKind", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["NotificationKind"]; });
50694
50695/* harmony import */ var _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./internal/util/pipe */ "mCNh");
50696/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__["pipe"]; });
50697
50698/* harmony import */ var _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./internal/util/noop */ "KqfI");
50699/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__["noop"]; });
50700
50701/* harmony import */ var _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internal/util/identity */ "SpAZ");
50702/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__["identity"]; });
50703
50704/* harmony import */ var _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./internal/util/isObservable */ "7+OI");
50705/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__["isObservable"]; });
50706
50707/* harmony import */ var _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./internal/util/ArgumentOutOfRangeError */ "4I5i");
50708/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__["ArgumentOutOfRangeError"]; });
50709
50710/* harmony import */ var _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./internal/util/EmptyError */ "sVev");
50711/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__["EmptyError"]; });
50712
50713/* harmony import */ var _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./internal/util/ObjectUnsubscribedError */ "9ppp");
50714/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__["ObjectUnsubscribedError"]; });
50715
50716/* harmony import */ var _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./internal/util/UnsubscriptionError */ "pjAE");
50717/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
vendor: 13,152 bytes, lines 50717-50928
50717UnsubscriptionError", function() { return _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__["UnsubscriptionError"]; });
50718
50719/* harmony import */ var _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./internal/util/TimeoutError */ "Y6u4");
50720/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__["TimeoutError"]; });
50721
50722/* harmony import */ var _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./internal/observable/bindCallback */ "QqCr");
50723/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__["bindCallback"]; });
50724
50725/* harmony import */ var _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internal/observable/bindNodeCallback */ "4O5X");
50726/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__["bindNodeCallback"]; });
50727
50728/* harmony import */ var _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./internal/observable/combineLatest */ "itXk");
50729/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__["combineLatest"]; });
50730
50731/* harmony import */ var _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./internal/observable/concat */ "GyhO");
50732/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__["concat"]; });
50733
50734/* harmony import */ var _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./internal/observable/defer */ "NXyV");
50735/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__["defer"]; });
50736
50737/* harmony import */ var _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./internal/observable/empty */ "EY2u");
50738/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["empty"]; });
50739
50740/* harmony import */ var _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./internal/observable/forkJoin */ "cp0P");
50741/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__["forkJoin"]; });
50742
50743/* harmony import */ var _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./internal/observable/from */ "Cfvw");
50744/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "from", function() { return _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__["from"]; });
50745
50746/* harmony import */ var _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./internal/observable/fromEvent */ "xgIS");
50747/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__["fromEvent"]; });
50748
50749/* harmony import */ var _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./internal/observable/fromEventPattern */ "04ZW");
50750/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__["fromEventPattern"]; });
50751
50752/* harmony import */ var _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./internal/observable/generate */ "WPMC");
50753/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__["generate"]; });
50754
50755/* harmony import */ var _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./internal/observable/iif */ "r0o6");
50756/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__["iif"]; });
50757
50758/* harmony import */ var _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./internal/observable/interval */ "l5mm");
50759/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__["interval"]; });
50760
50761/* harmony import */ var _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./internal/observable/merge */ "VRyK");
50762/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__["merge"]; });
50763
50764/* harmony import */ var _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./internal/observable/never */ "5yfJ");
50765/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "never", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["never"]; });
50766
50767/* harmony import */ var _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./internal/observable/of */ "LRne");
50768/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "of", function() { return _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__["of"]; });
50769
50770/* harmony import */ var _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./internal/observable/onErrorResumeNext */ "Hkhx");
50771/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__["onErrorResumeNext"]; });
50772
50773/* harmony import */ var _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./internal/observable/pairs */ "hKy8");
50774/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__["pairs"]; });
50775
50776/* harmony import */ var _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./internal/observable/partition */ "2QGa");
50777/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_observable_partition__WEBPACK_IMPORTED_MODULE_44__["partition"]; });
50778
50779/* harmony import */ var _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./internal/observable/race */ "Nv8m");
50780/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_observable_race__WEBPACK_IMPORTED_MODULE_45__["race"]; });
50781
50782/* harmony import */ var _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./internal/observable/range */ "NNCq");
50783/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _internal_observable_range__WEBPACK_IMPORTED_MODULE_46__["range"]; });
50784
50785/* harmony import */ var _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./internal/observable/throwError */ "z6cu");
50786/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_47__["throwError"]; });
50787
50788/* harmony import */ var _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./internal/observable/timer */ "PqYM");
50789/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return _internal_observable_timer__WEBPACK_IMPORTED_MODULE_48__["timer"]; });
50790
50791/* harmony import */ var _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./internal/observable/using */ "Qn8I");
50792/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "using", function() { return _internal_observable_using__WEBPACK_IMPORTED_MODULE_49__["using"]; });
50793
50794/* harmony import */ var _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./internal/observable/zip */ "1uah");
50795/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_observable_zip__WEBPACK_IMPORTED_MODULE_50__["zip"]; });
50796
50797/* harmony import */ var _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./internal/scheduled/scheduled */ "7HRe");
50798/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scheduled", function() { return _internal_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_51__["scheduled"]; });
50799
50800/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["EMPTY"]; });
50801
50802/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["NEVER"]; });
50803
50804/* harmony import */ var _internal_config__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./internal/config */ "2fFW");
50805/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "config", function() { return _internal_config__WEBPACK_IMPORTED_MODULE_52__["config"]; });
50806
50807
50808
50809
50810
50811
50812
50813
50814
50815
50816
50817
50818
50819
50820
50821
50822
50823
50824
50825
50826
50827
50828
50829
50830
50831
50832
50833
50834
50835
50836
50837
50838
50839
50840
50841
50842
50843
50844
50845
50846
50847
50848
50849
50850
50851
50852
50853
50854
50855
50856
50857
50858
50859
50860
50861
50862//# sourceMappingURL=index.js.map
50863
50864/***/ }),
50865
50866/***/ "qZ0a":
50867/*!**********************************************************************!*\
50868  !*** ./node_modules/rxjs/_esm2015/internal/operators/publishLast.js ***!
50869  \**********************************************************************/
50870/*! exports provided: publishLast */
50871/***/ (function(module, __webpack_exports__, __webpack_require__) {
50872
50873"use strict";
50874__webpack_require__.r(__webpack_exports__);
50875/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return publishLast; });
50876/* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../AsyncSubject */ "NHP+");
50877/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multicast */ "oB13");
50878
50879
50880function publishLast() {
50881    return (source) => Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__["AsyncSubject"]())(source);
50882}
50883//# sourceMappingURL=publishLast.js.map
50884
50885/***/ }),
50886
50887/***/ "qgXg":
50888/*!****************************************************************!*\
50889  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/queue.js ***!
50890  \****************************************************************/
50891/*! exports provided: queueScheduler, queue */
50892/***/ (function(module, __webpack_exports__, __webpack_require__) {
50893
50894"use strict";
50895__webpack_require__.r(__webpack_exports__);
50896/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return queueScheduler; });
50897/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "queue", function() { return queue; });
50898/* harmony import */ var _QueueAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./QueueAction */ "YuR2");
50899/* harmony import */ var _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./QueueScheduler */ "Hh5Z");
50900
50901
50902const queueScheduler = new _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__["QueueScheduler"](_QueueAction__WEBPACK_IMPORTED_MODULE_0__["QueueAction"]);
50903const queue = queueScheduler;
50904//# sourceMappingURL=queue.js.map
50905
50906/***/ }),
50907
50908/***/ "quSY":
50909/*!*************************************************************!*\
50910  !*** ./node_modules/rxjs/_esm2015/internal/Subscription.js ***!
50911  \*************************************************************/
50912/*! exports provided: Subscription */
50913/***/ (function(module, __webpack_exports__, __webpack_require__) {
50914
50915"use strict";
50916__webpack_require__.r(__webpack_exports__);
50917/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return Subscription; });
50918/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/isArray */ "DH7j");
50919/* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/isObject */ "XoHu");
50920/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/isFunction */ "n6bG");
50921/* harmony import */ var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/UnsubscriptionError */ "pjAE");
50922
50923
50924
50925
50926class Subscription {
50927    constructor(unsubscribe) {
50928        this.closed = false;
50929        this._parentOrParents = null;
50930        this._subscriptions = null;
50931        if (unsubscribe) {
50932            this._ctorUnsubscribe = true;
50933            this._unsubscribe = unsubscribe;
50934        }
50935    }
50936    unsubscribe() {
50937        let errors;
50938        if (this.closed) {
50939            return;
50940        }
50941        let { _parentOrParents, _ctorUnsubscribe, _unsubscribe, _subscriptions } = this;
50942        this.closed = true;
50943        this._parentOrParents = null;
50944        this._subscriptions = null;
50945        if (_parentOrParents instanceof Subscription) {
50946            _parentOrParents.remove(this);
50947        }
50948        else if (_parentOrParents !== null) {
50949            for (let index = 0; index < _parentOrParents.length; ++index) {
50950                const parent = _parentOrParents[index];
50951                parent.remove(this);
50952            }
50953        }
50954        if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(_unsubscribe)) {
50955            if (_ctorUnsubscribe) {
50956                this._unsubscribe = undefined;
50957            }
50958            try {
50959                _unsubscribe.call(this);
50960            }
50961            catch (e) {
50962                errors = e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"] ? flattenUnsubscriptionErrors(e.errors) : [e];
50963            }
50964        }
50965        if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(_subscriptions)) {
50966            let index = -1;
50967            let len = _subscriptions.length;
50968            while (++index < len) {
50969                const sub = _subscriptions[index];
50970                if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_1__["isObject"])(sub)) {
50971                    try {
50972                        sub.unsubscribe();
50973                    }
50974                    catch (e) {
50975                        errors = errors || [];
50976                        if (e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"]) {
50977                            errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
50978                        }
50979                        else {
50980                            errors.push(e);
50981                        }
50982                    }
50983                }
50984            }
50985        }
50986        if (errors) {
50987            throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"](errors);
50988        }
50989    }
50990    add(teardown) {
50991        let subscription = teardown;
50992        if (!teardown) {
50993            return Subscription.EMPTY;
50994        }
50995        switch (typeof teardown) {
50996            case 'function':
50997                subscription = new Subscription(teardown);
50998            case 'object':
50999                if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
51000                    return subscription;
51001                }
51002                else if (this.closed) {
51003                    subscription.unsubscribe();
51004                    return subscription;
51005                }
51006                else if (!(subscription instanceof Subscription)) {
51007                    const tmp = subscription;
51008                    subscription = new Subscription();
51009                    subscription._subscriptions = [tmp];
51010                }
51011                break;
51012            default: {
51013                throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
51014            }
51015        }
51016        let { _parentOrParents } = subscription;
51017        if (_parentOrParents === null) {
51018            subscription._parentOrParents = this;
51019        }
51020        else if (_parentOrParents instanceof Subscription) {
51021            if (_parentOrParents === this) {
51022                return subscription;
51023            }
51024            subscription._parentOrParents = [_parentOrParents, this];
51025        }
51026        else if (_parentOrParents.indexOf(this) === -1) {
51027            _parentOrParents.push(this);
51028        }
51029        else {
51030            return subscription;
51031        }
51032        const subscriptions = this._subscriptions;
51033        if (subscriptions === null) {
51034            this._subscriptions = [subscription];
51035        }
51036        else {
51037            subscriptions.push(subscription);
51038        }
51039        return subscription;
51040    }
51041    remove(subscription) {
51042        const subscriptions = this._subscriptions;
51043        if (subscriptions) {
51044            const subscriptionIndex = subscriptions.indexOf(subscription);
51045            if (subscriptionIndex !== -1) {
51046                subscriptions.splice(subscriptionIndex, 1);
51047            }
51048        }
51049    }
51050}
51051Subscription.EMPTY = (function (empty) {
51052    empty.closed = true;
51053    return empty;
51054}(new Subscription()));
51055function flattenUnsubscriptionErrors(errors) {
51056    return errors.reduce((errs, err) => errs.concat((err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_3__["UnsubscriptionError"]) ? err.errors : err), []);
51057}
51058//# sourceMappingURL=Subscription.js.map
51059
51060/***/ }),
51061
51062/***/ "r0WS":
51063/*!********************************************************************!*\
51064  !*** ./node_modules/rxjs/_esm2015/internal/operators/timestamp.js ***!
51065  \********************************************************************/
51066/*! exports provided: timestamp, Timestamp */
51067/***/ (function(module, __webpack_exports__, __webpack_require__) {
51068
51069"use strict";
51070__webpack_require__.r(__webpack_exports__);
51071/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return timestamp; });
51072/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timestamp", function() { return Timestamp; });
51073/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
51074/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map */ "lJxs");
51075
51076
51077function timestamp(scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) {
51078    return Object(_map__WEBPACK_IMPORTED_MODULE_1__["map"])((value) => new Timestamp(value, scheduler.now()));
51079}
51080class Timestamp {
51081    constructor(value, timestamp) {
51082        this.value = value;
51083        this.timestamp = timestamp;
51084    }
51085}
51086//# sourceMappingURL=timestamp.js.map
51087
51088/***/ }),
51089
51090/***/ "r0o6":
51091/*!***************************************************************!*\
51092  !*** ./node_modules/rxjs/_esm2015/internal/observable/iif.js ***!
51093  \***************************************************************/
51094/*! exports provided: iif */
51095/***/ (function(module, __webpack_exports__, __webpack_require__) {
51096
51097"use strict";
51098__webpack_require__.r(__webpack_exports__);
51099/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return iif; });
51100/* harmony import */ var _defer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defer */ "NXyV");
51101/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./empty */ "EY2u");
51102
51103
51104function iif(condition, trueResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"], falseResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"]) {
51105    return Object(_defer__WEBPACK_IMPORTED_MODULE_0__["defer"])(() => condition() ? trueResult : falseResult);
51106}
51107//# sourceMappingURL=iif.js.map
51108
51109/***/ }),
51110
51111/***/ "sTY7":
51112/*!***********************************************************************!*\
51113  !*** ./node_modules/rxjs/_esm2015/internal/operators/windowToggle.js ***!
51114  \***********************************************************************/
51115/*! exports provided: windowToggle */
51116/***/ (function(module, __webpack_exports__, __webpack_require__) {
51117
51118"use strict";
51119__webpack_require__.r(__webpack_exports__);
51120/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return windowToggle; });
51121/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subject */ "XNiG");
51122/* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ "quSY");
51123/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../OuterSubscriber */ "l7GE");
51124/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/subscribeToResult */ "ZUHj");
51125
51126
51127
51128
51129function windowToggle(openings, closingSelector) {
51130    return (source) => source.lift(new WindowToggleOperator(openings, closingSelector));
51131}
51132class WindowToggleOperator {
51133    constructor(openings, closingSelector) {
51134        this.openings = openings;
51135        this.closingSelector = closingSelector;
51136    }
51137    call(subscriber, source) {
51138        return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector));
51139    }
51140}
51141class WindowToggleSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"] {
51142    constructor(destination, openings, closingSelector) {
51143        super(destination);
51144        this.openings = openings;
51145        this.closingSelector = closingSelector;
51146        this.contexts = [];
51147        this.add(this.openSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, openings, openings));
51148    }
51149    _next(value) {
51150        const { contexts } = this;
51151        if (contexts) {
51152            const len = contexts.length;
51153            for (let i = 0; i < len; i++) {
51154                contexts[i].window.next(value);
51155            }
51156        }
51157    }
51158    _error(err) {
51159        const { contexts } = this;
51160        this.contexts = null;
51161        if (contexts) {
51162            const len = contexts.length;
51163            let index = -1;
51164            while (++index < len) {
51165                const context = contexts[index];
51166                context.window.error(err);
51167                context.subscription.unsubscribe();
51168            }
51169        }
51170        super._error(err);
51171    }
51172    _complete() {
51173        const { contexts } = this;
51174        this.contexts = null;
51175        if (contexts) {
51176            const len = contexts.length;
51177            let index = -1;
51178            while (++index < len) {
51179                const context = contexts[index];
51180                context.window.complete();
51181                context.subscription.unsubscribe();
51182            }
51183        }
51184        super._complete();
51185    }
51186    _unsubscribe() {
51187        const { contexts } = this;
51188        this.contexts = null;
51189        if (contexts) {
51190            const len = contexts.length;
51191            let index = -1;
51192            while (++index < len) {
51193                const context = contexts[index];
51194                context.window.unsubscribe();
51195                context.subscription.unsubscribe();
51196            }
51197        }
51198    }
51199    notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {
51200        if (outerValue === this.openings) {
51201            let closingNotifier;
51202            try {
51203                const { closingSelector } = this;
51204                closingNotifier = closingSelector(innerValue);
51205            }
51206            catch (e) {
51207                return this.error(e);
51208            }
51209            const window = new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]();
51210            const subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
51211            const context = { window, subscription };
51212            this.contexts.push(context);
51213            const innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, closingNotifier, context);
51214            if (innerSubscription.closed) {
51215                this.closeWindow(this.contexts.length - 1);
51216            }
51217            else {
51218                innerSubscription.context = context;
51219                subscription.add(innerSubscription);
51220            }
51221            this.destination.next(window);
51222        }
51223        else {
51224            this.closeWindow(this.contexts.indexOf(outerValue));
51225        }
51226    }
51227    notifyError(err) {
51228        this.error(err);
51229    }
51230    notifyComplete(inner) {
51231        if (inner !== this.openSubscription) {
51232            this.closeWindow(this.contexts.indexOf(inner.context));
51233        }
51234    }
51235    closeWindow(index) {
51236        if (index === -1) {
51237            return;
51238        }
51239        const { contexts } = this;
51240        const context = contexts[index];
51241        const { window, subscription } = context;
51242        contexts.splice(index, 1);
51243        window.complete();
51244        subscription.unsubscribe();
51245    }
51246}
51247//# sourceMappingURL=windowToggle.js.map
51248
51249/***/ }),
51250
51251/***/ "sVev":
51252/*!****************************************************************!*\
51253  !*** ./node_modules/rxjs/_esm2015/internal/util/EmptyError.js ***!
51254  \****************************************************************/
51255/*! exports provided: EmptyError */
51256/***/ (function(module, __webpack_exports__, __webpack_require__) {
51257
51258"use strict";
51259__webpack_require__.r(__webpack_exports__);
51260/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return EmptyError; });
51261const EmptyErrorImpl = (() => {
51262    function EmptyErrorImpl() {
51263        Error.call(this);
51264        this.message = 'no elements in sequence';
51265        this.name = 'EmptyError';
51266        return this;
51267    }
51268    EmptyErrorImpl.prototype = Object.create(Error.prototype);
51269    return EmptyErrorImpl;
51270})();
51271const EmptyError = EmptyErrorImpl;
51272//# sourceMappingURL=EmptyError.js.map
51273
51274/***/ }),
51275
51276/***/ "syX2":
51277/*!**********************************************************************!*\
51278  !*** ./node_modules/rxjs/_esm2015/internal/operators/timeoutWith.js ***!
51279  \**********************************************************************/
51280/*! exports provided: timeoutWith */
51281/***/ (function(module, __webpack_exports__, __webpack_require__) {
51282
51283"use strict";
51284__webpack_require__.r(__webpack_exports__);
51285/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return timeoutWith; });
51286/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
51287/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isDate */ "mlxB");
51288/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
51289
51290
51291
51292function timeoutWith(due, withObservable, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) {
51293    return (source) => {
51294        let absoluteTimeout = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_1__["isDate"])(due);
51295        let waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
51296        return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));
51297    };
51298}
51299class TimeoutWithOperator {
51300    constructor(waitFor, absoluteTimeout, withObservable, scheduler) {
51301        this.waitFor = waitFor;
51302        this.absoluteTimeout = absoluteTimeout;
51303        this.withObservable = withObservable;
51304        this.scheduler = scheduler;
51305    }
51306    call(subscriber, source) {
51307        return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler));
51308    }
51309}
51310class TimeoutWithSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleOuterSubscriber"] {
51311    constructor(destination, absoluteTimeout, waitFor, withObservable, scheduler) {
51312        super(destination);
51313        this.absoluteTimeout = absoluteTimeout;
51314        this.waitFor = waitFor;
51315        this.withObservable = withObservable;
51316        this.scheduler = scheduler;
51317        this.scheduleTimeout();
51318    }
51319    static dispatchTimeout(subscriber) {
51320        const { withObservable } = subscriber;
51321        subscriber._unsubscribeAndRecycle();
51322        subscriber.add(Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["innerSubscribe"])(withObservable, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleInnerSubscriber"](subscriber)));
51323    }
51324    scheduleTimeout() {
51325        const { action } = this;
51326        if (action) {
51327            this.action = action.schedule(this, this.waitFor);
51328        }
51329        else {
51330            this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this));
51331        }
51332    }
51333    _next(value) {
51334        if (!this.absoluteTimeout) {
51335            this.scheduleTimeout();
51336        }
51337        super._next(value);
51338    }
51339    _unsubscribe() {
51340        this.action = undefined;
51341        this.scheduler = null;
51342        this.withObservable = null;
51343  
51343  }
51344}
51345//# sourceMappingURL=timeoutWith.js.map
51346
51347/***/ }),
51348
51349/***/ "tS1D":
51350/*!******************************************************************!*\
51351  !*** ./node_modules/rxjs/_esm2015/internal/operators/timeout.js ***!
51352  \******************************************************************/
51353/*! exports provided: timeout */
51354/***/ (function(module, __webpack_exports__, __webpack_require__) {
51355
51356"use strict";
51357__webpack_require__.r(__webpack_exports__);
51358/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; });
51359/* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ "D0XW");
51360/* harmony import */ var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/TimeoutError */ "Y6u4");
51361/* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./timeoutWith */ "syX2");
51362/* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/throwError */ "z6cu");
51363
51364
51365
51366
51367function timeout(due, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]) {
51368    return Object(_timeoutWith__WEBPACK_IMPORTED_MODULE_2__["timeoutWith"])(due, Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_3__["throwError"])(new _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__["TimeoutError"]()), scheduler);
51369}
51370//# sourceMappingURL=timeout.js.map
51371
51372/***/ }),
51373
51374/***/ "tf+s":
51375/*!**********************************************************************!*\
51376  !*** ./node_modules/rxjs/_esm2015/internal/operators/subscribeOn.js ***!
51377  \**********************************************************************/
51378/*! exports provided: subscribeOn */
51379/***/ (function(module, __webpack_exports__, __webpack_require__) {
51380
51381"use strict";
51382__webpack_require__.r(__webpack_exports__);
51383/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return subscribeOn; });
51384/* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/SubscribeOnObservable */ "O4y0");
51385
51386function subscribeOn(scheduler, delay = 0) {
51387    return function subscribeOnOperatorFunction(source) {
51388        return source.lift(new SubscribeOnOperator(scheduler, delay));
51389    };
51390}
51391class SubscribeOnOperator {
51392    constructor(scheduler, delay) {
51393        this.scheduler = scheduler;
51394        this.delay = delay;
51395    }
51396    call(subscriber, source) {
51397        return new _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__["SubscribeOnObservable"](source, this.delay, this.scheduler).subscribe(subscriber);
51398    }
51399}
51400//# sourceMappingURL=subscribeOn.js.map
51401
51402/***/ }),
51403
51404/***/ "tnsW":
51405/*!****************************************************************!*\
51406  !*** ./node_modules/rxjs/_esm2015/internal/operators/audit.js ***!
51407  \****************************************************************/
51408/*! exports provided: audit */
51409/***/ (function(module, __webpack_exports__, __webpack_require__) {
51410
51411"use strict";
51412__webpack_require__.r(__webpack_exports__);
51413/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return audit; });
51414/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
51415
51416function audit(durationSelector) {
51417    return function auditOperatorFunction(source) {
51418        return source.lift(new AuditOperator(durationSelector));
51419    };
51420}
51421class AuditOperator {
51422    constructor(durationSelector) {
51423        this.durationSelector = durationSelector;
51424    }
51425    call(subscriber, source) {
51426        return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));
51427    }
51428}
51429class AuditSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
51430    constructor(destination, durationSelector) {
51431        super(destination);
51432        this.durationSelector = durationSelector;
51433        this.hasValue = false;
51434    }
51435    _next(value) {
51436        this.value = value;
51437        this.hasValue = true;
51438        if (!this.throttled) {
51439            let duration;
51440            try {
51441                const { durationSelector } = this;
51442                duration = durationSelector(value);
51443            }
51444            catch (err) {
51445                return this.destination.error(err);
51446            }
51447            const innerSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(duration, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this));
51448            if (!innerSubscription || innerSubscription.closed) {
51449                this.clearThrottle();
51450            }
51451            else {
51452                this.add(this.throttled = innerSubscription);
51453            }
51454        }
51455    }
51456    clearThrottle() {
51457        const { value, hasValue, throttled } = this;
51458        if (throttled) {
51459            this.remove(throttled);
51460            this.throttled = undefined;
51461            throttled.unsubscribe();
51462        }
51463        if (hasValue) {
51464            this.value = undefined;
51465            this.hasValue = false;
51466            this.destination.next(value);
51467        }
51468    }
51469    notifyNext() {
51470        this.clearThrottle();
51471    }
51472    notifyComplete() {
51473        this.clearThrottle();
51474    }
51475}
51476//# sourceMappingURL=audit.js.map
51477
51478/***/ }),
51479
51480/***/ "tyNb":
51481/*!**********************************************************************!*\
51482  !*** ./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js ***!
51483  \**********************************************************************/
51484/*! exports provided: ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, provideRoutes, ɵEmptyOutletComponent, ɵROUTER_PROVIDERS, ɵangular_packages_router_router_a, ɵangular_packages_router_router_b, ɵangular_packages_router_router_c, ɵangular_packages_router_router_d, ɵangular_packages_router_router_e, ɵangular_packages_router_router_f, ɵangular_packages_router_router_g, ɵangular_packages_router_router_h, ɵangular_packages_router_router_i, ɵangular_packages_router_router_j, ɵangular_packages_router_router_k, ɵangular_packages_router_router_l, ɵangular_packages_router_router_m, ɵangular_packages_router_router_n, ɵangular_packages_router_router_o, ɵassignExtraOptionsToRouter, ɵflatten */
51485/***/ (function(module, __webpack_exports__, __webpack_require__) {
51486
51487"use strict";
51488__webpack_require__.r(__webpack_exports__);
51489/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivatedRoute", function() { return ActivatedRoute; });
51490/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivatedRouteSnapshot", function() { return ActivatedRouteSnapshot; });
51491/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivationEnd", function() { return ActivationEnd; });
51492/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActivationStart", function() { return ActivationStart; });
51493/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseRouteReuseStrategy", function() { return BaseRouteReuseStrategy; });
51494/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChildActivationEnd", function() { return ChildActivationEnd; });
51495/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChildActivationStart", function() { return ChildActivationStart; });
51496/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChildrenOutletContexts", function() { return ChildrenOutletContexts; });
51497/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultUrlSerializer", function() { return DefaultUrlSerializer; });
51498/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GuardsCheckEnd", function() { return GuardsCheckEnd; });
51499/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GuardsCheckStart", function() { return GuardsCheckStart; });
51500/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationCancel", function() { return NavigationCancel; });
51501/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationEnd", function() { return NavigationEnd; });
51502/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationError", function() { return NavigationError; });
51503/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationStart", function() { return NavigationStart; });
51504/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoPreloading", function() { return NoPreloading; });
51505/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutletContext", function() { return OutletContext; });
51506/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PRIMARY_OUTLET", function() { return PRIMARY_OUTLET; });
51507/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreloadAllModules", function() { return PreloadAllModules; });
51508/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreloadingStrategy", function() { return PreloadingStrategy; });
51509/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTER_CONFIGURATION", function() { return ROUTER_CONFIGURATION; });
51510/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTER_INITIALIZER", function() { return ROUTER_INITIALIZER; });
51511/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTES", function() { return ROUTES; });
51512/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolveEnd", function() { return ResolveEnd; });
51513/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolveStart", function() { return ResolveStart; });
51514/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouteConfigLoadEnd", function() { return RouteConfigLoadEnd; });
51515/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouteConfigLoadStart", function() { return RouteConfigLoadStart; });
51516/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouteReuseStrategy", function() { return RouteReuseStrategy; });
51517/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return Router; });
51518/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterEvent", function() { return RouterEvent; });
51519/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterLink", function() { return RouterLink; });
51520/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterLinkActive", function() { return RouterLinkActive; });
51521/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterLinkWithHref", function() { return RouterLinkWithHref; });
51522/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterModule", function() { return RouterModule; });
51523/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterOutlet", function() { return RouterOutlet; });
51524/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterPreloader", function() { return RouterPreloader; });
51525/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterState", function() { return RouterState; });
51526/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouterStateSnapshot", function() { return RouterStateSnapshot; });
51527/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RoutesRecognized", function() { return RoutesRecognized; });
51528/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scroll", function() { return Scroll; });
51529/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
51529UrlHandlingStrategy", function() { return UrlHandlingStrategy; });
51530/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlSegment", function() { return UrlSegment; });
51531/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlSegmentGroup", function() { return UrlSegmentGroup; });
51532/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlSerializer", function() { return UrlSerializer; });
51533/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlTree", function() { return UrlTree; });
51534/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
51535/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToParamMap", function() { return convertToParamMap; });
51536/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "provideRoutes", function() { return provideRoutes; });
51537/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵEmptyOutletComponent", function() { return ɵEmptyOutletComponent; });
51538/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵROUTER_PROVIDERS", function() { return ROUTER_PROVIDERS; });
51539/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_a", function() { return ROUTER_FORROOT_GUARD; });
51540/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_b", function() { return routerNgProbeToken; });
51541/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_c", function() { return createRouterScroller; });
51542/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_d", function() { return provideLocationStrategy; });
51543/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_e", function() { return provideForRootGuard; });
51544/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_f", function() { return setupRouter; });
51545/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_g", function() { return rootRoute; });
51546/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_h", function() { return RouterInitializer; });
51547/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_i", function() { return getAppInitializer; });
51548/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_j", function() { return getBootstrapListener; });
51549/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_k", function() { return provideRouterInitializer; });
51550/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_l", function() { return ɵEmptyOutletComponent; });
51551/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_m", function() { return Tree; });
51552/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_n", function() { return TreeNode; });
51553/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵangular_packages_router_router_o", function() { return RouterScroller; });
51554/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵassignExtraOptionsToRouter", function() { return assignExtraOptionsToRouter; });
51555/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵflatten", function() { return flatten; });
51556/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common */ "ofXK");
51557/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "fXoL");
51558/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "qCKp");
51559/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "kU1M");
51560/**
51561 * @license Angular v11.2.11
51562 * (c) 2010-2021 Google LLC. https://angular.io/
51563 * License: MIT
51564 */
51565
51566
51567
51568
51569
51570
51571/**
51572 * @license
51573 * Copyright Google LLC All Rights Reserved.
51574 *
51575 * Use of this source code is governed by an MIT-style license that can be
51576 * found in the LICENSE file at https://angular.io/license
51577 */
51578/**
51579 * Base for events the router goes through, as opposed to events tied to a specific
51580 * route. Fired one time for any given navigation.
51581 *
51582 * The following code shows how a class subscribes to router events.
51583 *
51584 * ```ts
51585 * class MyService {
51586 *   constructor(public router: Router, logger: Logger) {
51587 *     router.events.pipe(
51588 *        filter((e: Event): e is RouterEvent => e instanceof RouterEvent)
51589 *     ).subscribe((e: RouterEvent) => {
51590 *       logger.log(e.id, e.url);
51591 *     });
51592 *   }
51593 * }
51594 * ```
51595 *
51596 * @see `Event`
51597 * @see [Router events summary](guide/router#router-events)
51598 * @publicApi
51599 */
51600
51601
51602class RouterEvent {
51603    constructor(
51604    /** A unique ID that the router assigns to every router navigation. */
51605    id, 
51606    /** The URL that is the destination for this navigation. */
51607    url) {
51608        this.id = id;
51609        this.url = url;
51610    }
51611}
51612/**
51613 * An event triggered when a navigation starts.
51614 *
51615 * @publicApi
51616 */
51617class NavigationStart extends RouterEvent {
51618    constructor(
51619    /** @docsNotRequired */
51620    id, 
51621    /** @docsNotRequired */
51622    url, 
51623    /** @docsNotRequired */
51624    navigationTrigger = 'imperative', 
51625    /** @docsNotRequired */
51626    restoredState = null) {
51627        super(id, url);
51628        this.navigationTrigger = navigationTrigger;
51629        this.restoredState = restoredState;
51630    }
51631    /** @docsNotRequired */
51632    toString() {
51633        return `NavigationStart(id: ${this.id}, url: '${this.url}')`;
51634    }
51635}
51636/**
51637 * An event triggered when a navigation ends successfully.
51638 *
51639 * @see `NavigationStart`
51640 * @see `NavigationCancel`
51641 * @see `NavigationError`
51642 *
51643 * @publicApi
51644 */
51645class NavigationEnd extends RouterEvent {
51646    constructor(
51647    /** @docsNotRequired */
51648    id, 
51649    /** @docsNotRequired */
51650    url, 
51651    /** @docsNotRequired */
51652    urlAfterRedirects) {
51653        super(id, url);
51654        this.urlAfterRedirects = urlAfterRedirects;
51655    }
51656    /** @docsNotRequired */
51657    toString() {
51658        return `NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`;
51659    }
51660}
51661/**
51662 * An event triggered when a navigation is canceled, directly or indirectly.
51663 * This can happen when a route guard
51664 * returns `false` or initiates a redirect by returning a `UrlTree`.
51665 *
51666 * @see `NavigationStart`
51667 * @see `NavigationEnd`
51668 * @see `NavigationError`
51669 *
51670 * @publicApi
51671 */
51672class NavigationCancel extends RouterEvent {
51673    constructor(
51674    /** @docsNotRequired */
51675    id, 
51676    /** @docsNotRequired */
51677    url, 
51678    /** @docsNotRequired */
51679    reason) {
51680        super(id, url);
51681        this.reason = reason;
51682    }
51683    /** @docsNotRequired */
51684    toString() {
51685        return `NavigationCancel(id: ${this.id}, url: '${this.url}')`;
51686    }
51687}
51688/**
51689 * An event triggered when a navigation fails due to an unexpected error.
51690 *
51691 * @see `NavigationStart`
51692 * @see `NavigationEnd`
51693 * @see `NavigationCancel`
51694 *
51695 * @publicApi
51696 */
51697class NavigationError extends RouterEvent {
51698    constructor(
51699    /** @docsNotRequired */
51700    id, 
51701    /** @docsNotRequired */
51702    url, 
51703    /** @docsNotRequired */
51704    error) {
51705        super(id, url);
51706        this.error = error;
51707    }
51708    /** @docsNotRequired */
51709    toString() {
51710        return `NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`;
51711    }
51712}
51713/**
51714 * An event triggered when routes are recognized.
51715 *
51716 * @publicApi
51717 */
51718class RoutesRecognized extends RouterEvent {
51719    constructor(
51720    /** @docsNotRequired */
51721    id, 
51722    /** @docsNotRequired */
51723    url, 
51724    /** @docsNotRequired */
51725    urlAfterRedirects, 
51726    /** @docsNotRequired */
51727    state) {
51728        super(id, url);
51729        this.urlAfterRedirects = urlAfterRedirects;
51730        this.state = state;
51731    }
51732    /** @docsNotRequired */
51733    toString() {
51734        return `RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;
51735    }
51736}
51737/**
51738 * An event triggered at the start of the Guard phase of routing.
51739 *
51740 * @see `GuardsCheckEnd`
51741 *
51742 * @publicApi
51743 */
51744class GuardsCheckStart extends RouterEvent {
51745    constructor(
51746    /** @docsNotRequired */
51747    id, 
51748    /** @docsNotRequired */
51749    url, 
51750    /** @docsNotRequired */
51751    urlAfterRedirects, 
51752    /** @docsNotRequired */
51753    state) {
51754        super(id, url);
51755        this.urlAfterRedirects = urlAfterRedirects;
51756        this.state = state;
51757    }
51758    toString() {
51759        return `GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;
51760    }
51761}
51762/**
51763 * An event triggered at the end of the Guard phase of routing.
51764 *
51765 * @see `GuardsCheckStart`
51766 *
51767 * @publicApi
51768 */
51769class GuardsCheckEnd extends RouterEvent {
51770    constructor(
51771    /** @docsNotRequired */
51772    id, 
51773    /** @docsNotRequired */
51774    url, 
51775    /** @docsNotRequired */
51776    urlAfterRedirects, 
51777    /** @docsNotRequired */
51778    state, 
51779    /** @docsNotRequired */
51780    shouldActivate) {
51781        super(id, url);
51782        this.urlAfterRedirects = urlAfterRedirects;
51783        this.state = state;
51784        this.shouldActivate = shouldActivate;
51785    }
51786    toString() {
51787        return `GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`;
51788    }
51789}
51790/**
51791 * An event triggered at the start of the Resolve phase of routing.
51792 *
51793 * Runs in the "resolve" phase whether or not there is anything to resolve.
51794 * In future, may change to only run when there are things to be resolved.
51795 *
51796 * @see `ResolveEnd`
51797 *
51798 * @publicApi
51799 */
51800class ResolveStart extends RouterEvent {
51801    constructor(
51802    /** @docsNotRequired */
51803    id, 
51804    /** @docsNotRequired */
51805    url, 
51806    /** @docsNotRequired */
51807    urlAfterRedirects, 
51808    /** @docsNotRequired */
51809    state) {
51810        super(id, url);
51811        this.urlAfterRedirects = urlAfterRedirects;
51812        this.state = state;
51813    }
51814    toString() {
51815        return `ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;
51816    }
51817}
51818/**
51819 * An event triggered at the end of the Resolve phase of routing.
51820 * @see `ResolveStart`.
51821 *
51822 * @publicApi
51823 */
51824class ResolveEnd extends RouterEvent {
51825    constructor(
51826    /** @docsNotRequired */
51827    id, 
51828    /** @docsNotRequired */
51829    url, 
51830    /** @docsNotRequired */
51831    urlAfterRedirects, 
51832    /** @docsNotRequired */
51833    state) {
51834        super(id, url);
51835        this.urlAfterRedirects = urlAfterRedirects;
51836        this.state = state;
51837    }
51838    toString() {
51839        return `ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`;
51840    }
51841}
51842/**
51843 * An event triggered before lazy loading a route configuration.
51844 *
51845 * @see `RouteConfigLoadEnd`
51846 *
51847 * @publicApi
51848 */
51849class RouteConfigLoadStart {
51850    constructor(
51851    /** @docsNotRequired */
51852    route) {
51853        this.route = route;
51854    }
51855    toString() {
51856        return `RouteConfigLoadStart(path: ${this.route.path})`;
51857    }
51858}
51859/**
51860 * An event triggered when a route has been lazy loaded.
51861 *
51862 * @see `RouteConfigLoadStart`
51863 *
51864 * @publicApi
51865 */
51866class RouteConfigLoadEnd {
51867    constructor(
51868    /** @docsNotRequired */
51869    route) {
51870        this.route = route;
51871    }
51872    toString() {
51873        return `RouteConfigLoadEnd(path: ${this.route.path})`;
51874    }
51875}
51876/**
51877 * An event triggered at the start of the child-activation
51878 * part of the Resolve phase of routing.
51879 * @see  `ChildActivationEnd`
51880 * @see `ResolveStart`
51881 *
51882 * @publicApi
51883 */
51884class ChildActivationStart {
51885    constructor(
51886    /** @docsNotRequired */
51887    snapshot) {
51888        this.snapshot = snapshot;
51889    }
51890    toString() {
51891        const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';
51892        return `ChildActivationStart(path: '${path}')`;
51893    }
51894}
51895/**
51896 * An event triggered at the end of the child-activation part
51897 * of the Resolve phase of routing.
51898 * @see `ChildActivationStart`
51899 * @see `ResolveStart`
51900 * @publicApi
51901 */
51902class ChildActivationEnd {
51903    constructor(
51904    /** @docsNotRequired */
51905    snapshot) {
51906        this.snapshot = snapshot;
51907    }
51908    toString() {
51909        const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';
51910        return `ChildActivationEnd(path: '${path}')`;
51911    }
51912}
51913/**
51914 * An event triggered at the start of the activation part
51915 * of the Resolve phase of routing.
51916 * @see `ActivationEnd`
51917 * @see `ResolveStart`
51918 *
51919 * @publicApi
51920 */
51921class ActivationStart {
51922    constructor(
51923    /** @docsNotRequired */
51924    snapshot) {
51925        this.snapshot = snapshot;
51926    }
51927    toString() {
51928        const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';
51929        return `ActivationStart(path: '${path}')`;
51930    }
51931}
51932/**
51933 * An event triggered at the end of the activation part
51934 * of the Resolve phase of routing.
51935 * @see `ActivationStart`
51936 * @see `ResolveStart`
51937 *
51938 * @publicApi
51939 */
51940class ActivationEnd {
51941    constructor(
51942    /** @docsNotRequired */
51943    snapshot) {
51944        this.snapshot = snapshot;
51945    }
51946    toString() {
51947        const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || '';
51948        return `ActivationEnd(path: '${path}')`;
51949    }
51950}
51951/**
51952 * An event triggered by scrolling.
51953 *
51954 * @publicApi
51955 */
51956class Scroll {
51957    constructor(
51958    /** @docsNotRequired */
51959    routerEvent, 
51960    /** @docsNotRequired */
51961    position, 
51962    /** @docsNotRequired */
51963    anchor) {
51964        this.routerEvent = routerEvent;
51965        this.position = position;
51966        this.anchor = anchor;
51967    }
51968    toString() {
51969        const pos = this.position ? `${this.position[0]}, ${this.position[1]}` : null;
51970        return `Scroll(anchor: '${this.anchor}', position: '${pos}')`;
51971    }
51972}
51973
51974/**
51975 * @license
51976 * Copyright Google LLC All Rights Reserved.
51977 *
51978 * Use of this source code is governed by an MIT-style license that can be
51979 * found in the LICENSE file at https://angular.io/license
51980 */
51981/**
51982 * The primary routing outlet.
51983 *
51984 * @publicApi
51985 */
51986const PRIMARY_OUTLET = 'primary';
51987class ParamsAsMap {
51988    constructor(params) {
51989        this.params = params || {};
51990    }
51991    has(name) {
51992        return Object.prototype.hasOwnProperty.call(this.params, name);
51993    }
51994    get(name) {
51995        if (this.has(name)) {
51996            const v = this.params[name];
51997            return Array.isArray(v) ? v[0] : v;
51998        }
51999        return null;
52000    }
52001    getAll(name) {
52002        if (this.has(name)) {
52003            const v = this.params[name];
52004            return Array.isArray(v) ? v : [v];
52005        }
52006        return [];
52007    }
52008    get keys() {
52009        return Object.keys(this.params);
52010    }
52011}
52012/**
52013 * Converts a `Params` instance to a `ParamMap`.
52014 * @param params The instance to convert.
52015 * @returns The new map instance.
52016 *
52017 * @publicApi
52018 */
52019function convertToParamMap(params) {
52020    return new ParamsAsMap(params);
52021}
52022const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
52023function navigationCancelingError(message) {
52024    const error = Error('NavigationCancelingError: ' + message);
52025    error[NAVIGATION_CANCELING_ERROR] = true;
52026    return error;
52027}
52028function isNavigationCancelingError(error) {
52029    return error && error[NAVIGATION_CANCELING_ERROR];
52030}
52031// Matches the route configuration (`route`) against the actual URL (`segments`).
52032function defaultUrlMatcher(segments, segmentGroup, route) {
52033    const parts = route.path.split('/');
52034    if (parts.length > segments.length) {
52035        // The actual URL is shorter than the config, no match
52036        return null;
52037    }
52038    if (route.pathMatch === 'full' &&
52039        (segmentGroup.hasChildren() || parts.length < segments.length)) {
52040        // The config is longer than the actual URL but we are looking for a full match, return null
52041        return null;
52042    }
52043    const posParams = {};
52044    // Check each config part against the actual URL
52045    for (let index = 0; index < parts.length; index++) {
52046        const part = parts[index];
52047        const segment = segments[index];
52048        const isParameter = part.startsWith(':');
52049        if (isParameter) {
52050            posParams[part.substring(1)] = segment;
52051        }
52052        else if (part !== segment.path) {
52053            // The actual URL part does not match the config, no match
52054            return null;
52055        }
52056    }
52057    return { consumed: segments.slice(0, parts.length), posParams };
52058}
52059
52060/**
52061 * @license
52062 * Copyright Google LLC All Rights Reserved.
52063 *
52064 * Use of this source code is governed by an MIT-style license that can be
52065 * found in the LICENSE file at https://angular.io/license
52066 */
52067function shallowEqualArrays(a, b) {
52068    if (a.length !== b.length)
52069        return false;
52070    for (let i = 0; i < a.length; ++i) {
52071        if (!shallowEqual(a[i], b[i]))
52072            return false;
52073    }
52074    return true;
52075}
52076function shallowEqual(a, b) {
52077    // While `undefined` should never be possible, it would sometimes be the case in IE 11
52078    // and pre-chromium Edge. The check below accounts for this edge case.
52079    const k1 = a ? Object.keys(a) : undefined;
52080    const k2 = b ? Object.keys(b) : undefined;
52081    if (!k1 || !k2 || k1.length != k2.length) {
52082        return false;
52083    }
52084    let key;
52085    for (let i = 0; i < k1.length; i++) {
52086        key = k1[i];
52087        if (!equalArraysOrString(a[key], b[key])) {
52088            return false;
52089        }
52090    }
52091    return true;
52092}
52093/**
52094 * Test equality for arrays of strings or a string.
52095 */
52096function equalArraysOrString(a, b) {
52097    if (Array.isArray(a) && Array.isArray(b)) {
52098        if (a.length !== b.length)
52099            return false;
52100        const aSorted = [...a].sort();
52101        const bSorted = [...b].sort();
52102        return aSorted.every((val, index) => bSorted[index] === val);
52103    }
52104    else {
52105        return a === b;
52106    }
52107}
52108/**
52109 * Flattens single-level nested arrays.
52110 */
52111function flatten(arr) {
52112    return Array.prototype.concat.apply([], arr);
52113}
52114/**
52115 * Return the last element of an array.
52116 */
52117function last(a) {
52118    return a.length > 0 ? a[a.length - 1] : null;
52119}
52120/**
52121 * Verifys all booleans in an array are `true`.
52122 */
52123function and(bools) {
52124    return !bools.some(v => !v);
52125}
52126function forEach(map, callback) {
52127    for (const prop in map) {
52128        if (map.hasOwnProperty(prop)) {
52129            callback(map[prop], prop);
52130        }
52131    }
52132}
52133function wrapIntoObservable(value) {
52134    if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵisObservable"])(value)) {
52135        return value;
52136    }
52137    if (Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵisPromise"])(value)) {
52138        // Use `Promise.resolve()` to wrap promise-like instances.
52139        // Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the
52140        // change detection.
52141        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(Promise.resolve(value));
52142    }
52143    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(value);
52144}
52145
52146/**
52147 * @license
52148 * Copyright Google LLC All Rights Reserved.
52149 *
52150 * Use of this source code is governed by an MIT-style license that can be
52151 * found in the LICENSE file at https://angular.io/license
52152 */
52153function createEmptyUrlTree() {
52154    return new UrlTree(new UrlSegmentGroup([], {}), {}, null);
52155}
52156function containsTree(container, containee, exact) {
52157    if (exact) {
52158        return equalQueryParams(container.queryParams, containee.queryParams) &&
52159            equalSegmentGroups(container.root, containee.root);
52160    }
52161    return containsQueryParams(container.queryParams, containee.queryParams) &&
52162        containsSegmentGroup(container.root, containee.root);
52163}
52164function equalQueryParams(container, containee) {
52165    // TODO: This does not handle array params correctly.
52166    return shallowEqual(container, containee);
52167}
52168function equalSegmentGroups(container, containee) {
52169    if (!equalPath(container.segments, containee.segments))
52170        return false;
52171    if (container.numberOfChildren !== containee.numberOfChildren)
52172        return false;
52173    for (const c in containee.children) {
52174        if (!container.children[c])
52175            return false;
52176        if (!equalSegmentGroups(container.children[c], containee.children[c]))
52177            return false;
52178    }
52179    return true;
52180}
52181function containsQueryParams(container, containee) {
52182    return Object.keys(containee).length <= Object.keys(container).length &&
52183        Object.keys(containee).every(key => equalArraysOrString(container[key], containee[key]));
52184}
52185function containsSegmentGroup(container, containee) {
52186    return containsSegmentGroupHelper(container, containee, containee.segments);
52187}
52188function containsSegmentGroupHelper(container, containee, containeePaths) {
52189    if (container.segments.length > containeePaths.length) {
52190        const current = container.segments.slice(0, containeePaths.length);
52191        if (!equalPath(current, containeePaths))
52192            return false;
52193        if (containee.hasChildren())
52194            return false;
52195        return true;
52196    }
52197    else if (container.segments.length === containeePaths.length) {
52198        if (!equalPath(container.segments, containeePaths))
52199            return false;
52200        for (const c in containee.children) {
52201            if (!container.children[c])
52202                return false;
52203            if (!containsSegmentGroup(container.children[c], containee.children[c]))
52204                return false;
52205        }
52206        return true;
52207    }
52208    else {
52209        const current = containeePaths.slice(0, container.segments.length);
52210        const next = containeePaths.slice(container.segments.length);
52211        if (!equalPath(container.segments, current))
52212            return false;
52213        if (!container.children[PRIMARY_OUTLET])
52214            return false;
52215        return containsSegmentGroupHelper(container.children[PRIMARY_OUTLET], containee, next);
52216    }
52217}
52218/**
52219 * @description
52220 *
52221 * Represents the parsed URL.
52222 *
52223 * Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a
52224 * serialized tree.
52225 * UrlTree is a data structure that provides a lot of affordances in dealing with URLs
52226 *
52227 * @usageNotes
52228 * ### Example
52229 *
52230 * ```
52231 * @Component({templateUrl:'template.html'})
52232 * class MyComponent {
52233 *   constructor(router: Router) {
52234 *     const tree: UrlTree =
52235 *       router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment');
52236 *     const f = tree.fragment; // return 'fragment'
52237 *     const q = tree.queryParams; // returns {debug: 'true'}
52238 *     const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];
52239 *     const s: UrlSegment[] = g.segments; // returns 2 segments 'team' and '33'
52240 *     g.children[PRIMARY_OUTLET].segments; // returns 2 segments 'user' and 'victor'
52241 *     g.children['support'].segments; // return 1 segment 'help'
52242 *   }
52243 * }
52244 * ```
52245 *
52246 * @publicApi
52247 */
52248class UrlTree {
52249    /** @internal */
52250    constructor(
52251    /** The root segment group of the URL tree */
52252    root, 
52253    /** The query params of the URL */
52254    queryParams, 
52255    /** The fragment of the URL */
52256    fragment) {
52257        this.root = root;
52258        this.queryParams = queryParams;
52259        this.fragment = fragment;
52260    }
52261    get queryParamMap() {
52262        if (!this._queryParamMap) {
52263            this._queryParamMap = convertToParamMap(this.queryParams);
52264        }
52265        return this._queryParamMap;
52266    }
52267    /** @docsNotRequired */
52268    toString() {
52269        return DEFAULT_SERIALIZER.serialize(this);
52270    }
52271}
52272/**
52273 * @description
52274 *
52275 * Represents the parsed URL segment group.
52276 *
52277 * See `UrlTree` for more information.
52278 *
52279 * @publicApi
52280 */
52281class UrlSegmentGroup {
52282    constructor(
52283    /** The URL segments of this group. See `UrlSegment` for more information */
52284    segments, 
52285    /** The list of children of this group */
52286    children) {
52287        this.segments = segments;
52288        this.children = children;
52289        /** The parent node in the url tree */
52290        this.parent = null;
52291        forEach(children, (v, k) => v.parent = this);
52292    }
52293    /** Whether the segment has child segments */
52294    hasChildren() {
52295        return this.numberOfChildren > 0;
52296    }
52297    /** Number of child segments */
52298    get numberOfChildren() {
52299        return Object.keys(this.children).length;
52300    }
52301    /** @docsNotRequired */
52302    toString() {
52303        return serializePaths(this);
52304    }
52305}
52306/**
52307 * @description
52308 *
52309 * Represents a single URL segment.
52310 *
52311 * A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix
52312 * parameters associated with the segment.
52313 *
52314 * @usageNotes
52315 * ### Example
52316 *
52317 * ```
52318 * @Component({templateUrl:'template.html'})
52319 * class MyComponent {
52320 *   constructor(router: Router) {
52321 *     const tree: UrlTree = router.parseUrl('/team;id=33');
52322 *     const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];
52323 *     const s: UrlSegment[] = g.segments;
52324 *     s[0].path; // returns 'team'
52325 *     s[0].parameters; // returns {id: 33}
52326 *   }
52327 * }
52328 * ```
52329 *
52330 * @publicApi
52331 */
52332class UrlSegment {
52333    constructor(
52334    /** The path part of a URL segment */
52335    path, 
52336    /** The matrix parameters associated with a segment */
52337    parameters) {
52338        this.path = path;
52339        this.parameters = parameters;
52340    }
52341    get parameterMap() {
52342        if (!this._parameterMap) {
52343            this._parameterMap = convertToParamMap(this.parameters);
52344        }
52345        return this._parameterMap;
52346    }
52347    /** @docsNotRequired */
52348    toString() {
52349        return serializePath(this);
52350    }
52351}
52352function equalSegments(as, bs) {
52353    return equalPath(as, bs) && as.every((a, i) => shallowEqual(a.parameters, bs[i].parameters));
52354}
52355function equalPath(as, bs) {
52356    if (as.length !== bs.length)
52357        return false;
52358    return as.every((a, i) => a.path === bs[i].path);
52359}
52360function mapChildrenIntoArray(segment, fn) {
52361    let res = [];
52362    forEach(segment.children, (child, childOutlet) => {
52363        if (childOutlet === PRIMARY_OUTLET) {
52364            res = res.concat(fn(child, childOutlet));
52365        }
52366    });
52367    forEach(segment.children, (child, childOutlet) => {
52368        if (childOutlet !== PRIMARY_OUTLET) {
52369            res = res.concat(fn(child, childOutlet));
52370        }
52371    });
52372    return res;
52373}
52374/**
52375 * @description
52376 *
52377 * Serializes and deserializes a URL string into a URL tree.
52378 *
52379 * The url serialization strategy is customizable. You can
52380 * make all URLs case insensitive by providing a custom UrlSerializer.
52381 *
52382 * See `DefaultUrlSerializer` for an example of a URL serializer.
52383 *
52384 * @publicApi
52385 */
52386class UrlSerializer {
52387}
52388/**
52389 * @description
52390 *
52391 * A default implementation of the `UrlSerializer`.
52392 *
52393 * Example URLs:
52394 *
52395 * ```
52396 * /inbox/33(popup:compose)
52397 * /inbox/33;open=true/messages/44
52398 * ```
52399 *
52400 * DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the
52401 * colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to
52402 * specify route specific parameters.
52403 *
52404 * @publicApi
52405 */
52406class DefaultUrlSerializer {
52407    /** Parses a url into a `UrlTree` */
52408    parse(url) {
52409        const p = new UrlParser(url);
52410        return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment());
52411    }
52412    /** Converts a `UrlTree` into a url */
52413    serialize(tree) {
52414        const segment = `/${serializeSegment(tree.root, true)}`;
52415        const query = serializeQueryParams(tree.queryParams);
52416        const fragment = typeof tree.fragment === `string` ? `#${encodeUriFragment(tree.fragment)}` : '';
52417        return `${segment}${query}${fragment}`;
52418    }
52419}
52420const DEFAULT_SERIALIZER = new DefaultUrlSerializer();
52421function serializePaths(segment) {
52422    return segment.segments.map(p => serializePath(p)).join('/');
52423}
52424function serializeSegment(segment, root) {
52425    if (!segment.hasChildren()) {
52426        return serializePaths(segment);
52427    }
52428    if (root) {
52429        const primary = segment.children[PRIMARY_OUTLET] ?
52430            serializeSegment(segment.children[PRIMARY_OUTLET], false) :
52431            '';
52432        const children = [];
52433        forEach(segment.children, (v, k) => {
52434            if (k !== PRIMARY_OUTLET) {
52435                children.push(`${k}:${serializeSegment(v, false)}`);
52436            }
52437        });
52438        return children.length > 0 ? `${primary}(${children.join('//')})` : primary;
52439    }
52440    else {
52441        const children = mapChildrenIntoArray(segment, (v, k) => {
52442            if (k === PRIMARY_OUTLET) {
52443                return [serializeSegment(segment.children[PRIMARY_OUTLET], false)];
52444            }
52445            return [`${k}:${serializeSegment(v, false)}`];
52446        });
52447        // use no parenthesis if the only child is a primary outlet route
52448        if (Object.keys(segment.children).length === 1 && segment.children[PRIMARY_OUTLET] != null) {
52449            return `${serializePaths(segment)}/${children[0]}`;
52450        }
52451        return `${serializePaths(segment)}/(${children.join('//')})`;
52452    }
52453}
52454/**
52455 * Encodes a URI string with the default encoding. This function will only ever be called from
52456 * `encodeUriQuery` or `encodeUriSegment` as it's the base set of encodings to be used. We need
52457 * a custom encoding because encodeURIComponent is too aggressive and encodes stuff that doesn't
52458 * have to be encoded per https://url.spec.whatwg.org.
52459 */
52460function encodeUriString(s) {
52461    return encodeURIComponent(s)
52462        .replace(/%40/g, '@')
52463        .replace(/%3A/gi, ':')
52464        .replace(/%24/g, '$')
52465        .replace(/%2C/gi, ',');
52466}
52467/**
52468 * This function should be used to encode both keys and values in a query string key/value. In
52469 * the following URL, you need to call encodeUriQuery on "k" and "v":
52470 *
52471 * http://www.site.org/html;mk=mv?k=v#f
52472 */
52473function encodeUriQuery(s) {
52474    return encodeUriString(s).replace(/%3B/gi, ';');
52475}
52476/**
52477 * This function should be used to encode a URL fragment. In the following URL, you need to call
52478 * encodeUriFragment on "f":
52479 *
52480 * http://www.site.org/html;mk=mv?k=v#f
52481 */
52482function encodeUriFragment(s) {
52483    return encodeURI(s);
52484}
52485/**
52486 * This function should be run on any URI segment as well as the key and value in a key/value
52487 * pair for matrix params. In the following URL, you need to call encodeUriSegment on "html",
52488 * "mk", and "mv":
52489 *
52490 * http://www.site.org/html;mk=mv?k=v#f
52491 */
52492function encodeUriSegment(s) {
52493    return encodeUriString(s).replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/%26/gi, '&');
52494}
52495function decode(s) {
52496    return decodeURIComponent(s);
52497}
52498// Query keys/values should have the "+" replaced first, as "+" in a query string is " ".
52499// decodeURIComponent function will not decode "+" as a space.
52500function decodeQuery(s) {
52501    return decode(s.replace(/\+/g, '%20'));
52502}
52503function serializePath(path) {
52504    return `${encodeUriSegment(path.path)}${serializeMatrixParams(path.parameters)}`;
52505}
52506function serializeMatrixParams(params) {
52507    return Object.keys(params)
52508        .map(key => `;${encodeUriSegment(key)}=${encodeUriSegment(params[key])}`)
52509        .join('');
52510}
52511function serializeQueryParams(params) {
52512    const strParams = Object.keys(params).map((name) => {
52513        const value = params[name];
52514        return Array.isArray(value) ?
52515            value.map(v => `${encodeUriQuery(name)}=${encodeUriQuery(v)}`).join('&') :
52516            `${encodeUriQuery(name)}=${encodeUriQuery(value)}`;
52517    });
52518    return strParams.length ? `?${strParams.join('&')}` : '';
52519}
52520const SEGMENT_RE = /^[^\/()?;=#]+/;
52521function matchSegments(str) {
52522    const match = str.match(SEGMENT_RE);
52523    return match ? match[0] : '';
52524}
52525const QUERY_PARAM_RE = /^[^=?&#]+/;
52526// Return the name of the query param at the start of the string or an empty string
52527function matchQueryParams(str) {
52528    const match = str.match(QUERY_PARAM_RE);
52529    return match ? match[0] : '';
52530}
52531const QUERY_PARAM_VALUE_RE = /^[^?&#]+/;
52532// Return the value of the query param at the start of the string or an empty string
52533function matchUrlQueryParamValue(str) {
52534    const match = str.match(QUERY_PARAM_VALUE_RE);
52535    return match ? match[0] : '';
52536}
52537class UrlParser {
52538    constructor(url) {
52539        this.url = url;
52540        this.remaining = url;
52541    }
52542    parseRootSegment() {
52543        this.consumeOptional('/');
52544        if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) {
52545            return new UrlSegmentGroup([], {});
52546        }
52547        // The root segment group never has segments
52548        return new UrlSegmentGroup([], this.parseChildren());
52549    }
52550    parseQueryParams() {
52551        const params = {};
52552        if (this.consumeOptional('?')) {
52553            do {
52554                this.parseQueryParam(params);
52555            } while (this.consumeOptional('&'));
52556        }
52557        return params;
52558    }
52559    parseFragment() {
52560        return this.consumeOptional('#') ? decodeURIComponent(this.remaining) : null;
52561    }
52562    parseChildren() {
52563        if (this.remaining === '') {
52564            return {};
52565        }
52566        this.consumeOptional('/');
52567        const segments = [];
52568        if (!this.peekStartsWith('(')) {
52569            segments.push(this.parseSegment());
52570        }
52571        while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) {
52572            this.capture('/');
52573            segments.push(this.parseSegment());
52574        }
52575        let children = {};
52576        if (this.peekStartsWith('/(')) {
52577            this.capture('/');
52578            children = this.parseParens(true);
52579        }
52580        let res = {};
52581        if (this.peekStartsWith('(')) {
52582            res = this.parseParens(false);
52583        }
52584        if (segments.length > 0 || Object.keys(children).length > 0) {
52585            res[PRIMARY_OUTLET] = new UrlSegmentGroup(segments, children);
52586        }
52587        return res;
52588    }
52589    // parse a segment with its matrix parameters
52590    // ie `name;k1=v1;k2`
52591    parseSegment() {
52592        const path = matchSegments(this.remaining);
52593        if (path === '' && this.peekStartsWith(';')) {
52594            throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);
52595        }
52596        this.capture(path);
52597        return new UrlSegment(decode(path), this.parseMatrixParams());
52598    }
52599    parseMatrixParams() {
52600        const params = {};
52601        while (this.consumeOptional(';')) {
52602            this.parseParam(params);
52603        }
52604        return params;
52605    }
52606    parseParam(params) {
52607        const key = matchSegments(this.remaining);
52608        if (!key) {
52609            return;
52610        }
52611        this.capture(key);
52612        let value = '';
52613        if (this.consumeOptional('=')) {
52614            const valueMatch = matchSegments(this.remaining);
52615            if (valueMatch) {
52616                value = valueMatch;
52617                this.capture(value);
52618            }
52619        }
52620        params[decode(key)] = decode(value);
52621    }
52622    // Parse a single query parameter `name[=value]`
52623    parseQueryParam(params) {
52624        const key = matchQueryParams(this.remaining);
52625        if (!key) {
52626            return;
52627        }
52628        this.capture(key);
52629        let value = '';
52630        if (this.consumeOptional('=')) {
52631            const valueMatch = matchUrlQueryParamValue(this.remaining);
52632            if (valueMatch) {
52633                value = valueMatch;
52634                this.capture(value);
52635            }
52636        }
52637        const decodedKey = decodeQuery(key);
52638        const decodedVal = decodeQuery(value);
52639        if (params.hasOwnProperty(decodedKey)) {
52640            // Append to existing values
52641            let currentVal = params[decodedKey];
52642            if (!Array.isArray(currentVal)) {
52643                currentVal = [currentVal];
52644                params[decodedKey] = currentVal;
52645            }
52646            currentVal.push(decodedVal);
52647        }
52648        else {
52649            // Create a new value
52650            params[decodedKey] = decodedVal;
52651        }
52652    }
52653    // parse `(a/b//outlet_name:c/d)`
52654    parseParens(allowPrimary) {
52655        const segments = {};
52656        this.capture('(');
52657        while (!this.consumeOptional(')') && this.remaining.length > 0) {
52658            const path = matchSegments(this.remaining);
52659            const next = this.remaining[path.length];
52660            // if is is not one of these characters, then the segment was unescaped
52661            // or the group was not closed
52662            if (next !== '/' && next !== ')' && next !== ';') {
52663                throw new Error(`Cannot parse url '${this.url}'`);
52664            }
52665            let outletName = undefined;
52666            if (path.indexOf(':') > -1) {
52667                outletName = path.substr(0, path.indexOf(':'));
52668                this.capture(outletName);
52669                this.capture(':');
52670            }
52671            else if (allowPrimary) {
52672                outletName = PRIMARY_OUTLET;
52673            }
52674            const children = this.parseChildren();
52675            segments[outletName] = Object.keys(children).length === 1 ? children[PRIMARY_OUTLET] :
52676                new UrlSegmentGroup([], children);
52677            this.consumeOptional('//');
52678        }
52679        return segments;
52680    }
52681    peekStartsWith(str) {
52682        return this.remaining.startsWith(str);
52683    }
52684    // Consumes the prefix when it is present and returns whether it has been consumed
52685    consumeOptional(str) {
52686        if (this.peekStartsWith(str)) {
52687            this.remaining = this.remaining.substring(str.length);
52688            return true;
52689        }
52690        return false;
52691    }
52692    capture(str) {
52693        if (!this.consumeOptional(str)) {
52694            throw new Error(`Expected "${str}".`);
52695        }
52696    }
52697}
52698
52699/**
52700 * @license
52701 * Copyright Google LLC All Rights Reserved.
52702 *
52703 * Use of this source code is governed by an MIT-style license that can be
52704 * found in the LICENSE file at https://angular.io/license
52705 */
52706class Tree {
52707    constructor(root) {
52708        this._root = root;
52709    }
52710    get root() {
52711        return this._root.value;
52712    }
52713    /**
52714     * @internal
52715     */
52716    parent(t) {
52717        const p = this.pathFromRoot(t);
52718        return p.length > 1 ? p[p.length - 2] : null;
52719    }
52720    /**
52721     * @internal
52722     */
52723    children(t) {
52724        const n = findNode(t, this._root);
52725        return n ? n.children.map(t => t.value) : [];
52726    }
52727    /**
52728     * @internal
52729     */
52730    firstChild(t) {
52731        const n = findNode(t, this._root);
52732        return n && n.children.length > 0 ? n.children[0].value : null;
52733    }
52734    /**
52735     * @internal
52736     */
52737    siblings(t) {
52738        const p = findPath(t, this._root);
52739        if (p.length < 2)
52740            return [];
52741        const c = p[p.length - 2].children.map(c => c.value);
52742        return c.filter(cc => cc !== t);
52743    }
52744    /**
52745     * @internal
52746     */
52747    pathFromRoot(t) {
52748        return findPath(t, this._root).map(s => s.value);
52749    }
52750}
52751// DFS for the node matching the value
52752function findNode(value, node) {
52753    if (value === node.value)
52754        return node;
52755    for (const child of node.children) {
52756        const node = findNode(value, child);
52757        if (node)
52758            return node;
52759    }
52760    return null;
52761}
52762// Return the path to the node with the given value using DFS
52763function findPath(value, node) {
52764    if (value === node.value)
52765        return [node];
52766    for (const child of node.children) {
52767        const path = findPath(value, child);
52768        if (path.length) {
52769            path.unshift(node);
52770            return path;
52771        }
52772    }
52773    return [];
52774}
52775class TreeNode {
52776    constructor(value, children) {
52777        this.value = value;
52778        this.children = children;
52779    }
52780    toString() {
52781        return `TreeNode(${this.value})`;
52782    }
52783}
52784// Return the list of T indexed by outlet name
52785function nodeChildrenAsMap(node) {
52786    const map = {};
52787    if (node) {
52788        node.children.forEach(child => map[child.value.outlet] = child);
52789    }
52790    return map;
52791}
52792
52793/**
52794 * @license
52795 * Copyright Google LLC All Rights Reserved.
52796 *
52797 * Use of this source code is governed by an MIT-style license that can be
52798 * found in the LICENSE file at https://angular.io/license
52799 */
52800/**
52801 * Represents the state of the router as a tree of activated routes.
52802 *
52803 * @usageNotes
52804 *
52805 * Every node in the route tree is an `ActivatedRoute` instance
52806 * that knows about the "consumed" URL segments, the extracted parameters,
52807 * and the resolved data.
52808 * Use the `ActivatedRoute` properties to traverse the tree from any node.
52809 *
52810 * The following fragment shows how a component gets the root node
52811 * of the current state to establish its own route tree:
52812 *
52813 * ```
52814 * @Component({templateUrl:'template.html'})
52815 * class MyComponent {
52816 *   constructor(router: Router) {
52817 *     const state: RouterState = router.routerState;
52818 *     const root: ActivatedRoute = state.root;
52819 *     const child = root.firstChild;
52820 *     const id: Observable<string> = child.params.map(p => p.id);
52821 *     //...
52822 *   }
52823 * }
52824 * ```
52825 *
52826 * @see `ActivatedRoute`
52827 * @see [Getting route information](guide/router#getting-route-information)
52828 *
52829 * @publicApi
52830 */
52831class RouterState extends Tree {
52832    /** @internal */
52833    constructor(root, 
52834    /** The current snapshot of the router state */
52835    snapshot) {
52836        super(root);
52837        this.snapshot = snapshot;
52838        setRouterState(this, root);
52839    }
52840    toString() {
52841        return this.snapshot.toString();
52842    }
52843}
52844function createEmptyState(urlTree, rootComponent) {
52845    const snapshot = createEmptyStateSnapshot(urlTree, rootComponent);
52846    const emptyUrl = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]([new UrlSegment('', {})]);
52847    const emptyParams = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]({});
52848    const emptyData = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]({});
52849    const emptyQueryParams = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]({});
52850    const fragment = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]('');
52851    const activated = new ActivatedRoute(emptyUrl, emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, snapshot.root);
52852    activated.snapshot = snapshot.root;
52853    return new RouterState(new TreeNode(activated, []), snapshot);
52854}
52855function createEmptyStateSnapshot(urlTree, rootComponent) {
52856    const emptyParams = {};
52857    const emptyData = {};
52858    const emptyQueryParams = {};
52859    const fragment = '';
52860    const activated = new ActivatedRouteSnapshot([], emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, null, urlTree.root, -1, {});
52861    return new RouterStateSnapshot('', new TreeNode(activated, []));
52862}
52863/**
52864 * Provides access to information about a route associated with a component
52865 * that is loaded in an outlet.
52866 * Use to traverse the `RouterState` tree and extract information from nodes.
52867 *
52868 * The following example shows how to construct a component using information from a
52869 * currently activated route.
52870 *
52871 * {@example router/activated-route/module.ts region="activated-route"
52872 *     header="activated-route.component.ts"}
52873 *
52874 * @see [Getting route information](guide/router#getting-route-information)
52875 *
52876 * @publicApi
52877 */
52878class ActivatedRoute {
52879    /** @internal */
52880    constructor(
52881    /** An observable of the URL segments matched by this route. */
52882    url, 
52883    /** An observable of the matrix parameters scoped to this route. */
52884    params, 
52885    /** An observable of the query parameters shared by all the routes. */
52886    queryParams, 
52887    /** An observable of the URL fragment shared by all the routes. */
52888    fragment, 
52889    /** An observable of the static and resolved data of this route. */
52890    data, 
52891    /** The outlet name of the route, a constant. */
52892    outlet, 
52893    /** The component of the route, a constant. */
52894    // TODO(vsavkin): remove |string
52895    component, futureSnapshot) {
52896        this.url = url;
52897        this.params = params;
52898        this.queryParams = queryParams;
52899        this.fragment = fragment;
52900        this.data = data;
52901        this.outlet = outlet;
52902        this.component = component;
52903        this._futureSnapshot = futureSnapshot;
52904    }
52905    /** The configuration used to match this route. */
52906    get routeConfig() {
52907        return this._futureSnapshot.routeConfig;
52908    }
52909    /** The root of the router state. */
52910    get root() {
52911        return this._routerState.root;
52912    }
52913    /** The parent of this route in the router state tree. */
52914    get parent() {
52915        return this._routerState.parent(this);
52916    }
52917    /** The first child of this route in the router state tree. */
52918    get firstChild() {
52919        return this._routerState.firstChild(this);
52920    }
52921    /** The children of this route in the router state tree. */
52922    get children() {
52923        return this._routerState.children(this);
52924    }
52925    /** The path from the root of the router state tree to this route. */
52926    get pathFromRoot() {
52927        return this._routerState.pathFromRoot(this);
52928    }
52929    /**
52930     * An Observable that contains a map of the required and optional parameters
52931     * specific to the route.
52932     * The map supports retrieving single and multiple values from the same parameter.
52933     */
52934    get paramMap() {
52935        if (!this._paramMap) {
52936            this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((p) => convertToParamMap(p)));
52937        }
52938        return this._paramMap;
52939    }
52940    /**
52941     * An Observable that contains a map of the query parameters available to all routes.
52942     * The map supports retrieving single and multiple values from the query parameter.
52943     */
52944    get queryParamMap() {
52945        if (!this._queryParamMap) {
52946            this._queryParamMap =
52947                this.queryParams.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((p) => convertToParamMap(p)));
52948        }
52949        return this._queryParamMap;
52950    }
52951    toString() {
52952        return this.snapshot ? this.snapshot.toString() : `Future(${this._futureSnapshot})`;
52953    }
52954}
52955/**
52956 * Returns the inherited params, data, and resolve for a given route.
52957 * By default, this only inherits values up to the nearest path-less or component-less route.
52958 * @internal
52959 */
52960function inheritedParamsDataResolve(route, paramsInheritanceStrategy = 'emptyOnly') {
52961    const pathFromRoot = route.pathFromRoot;
52962    let inheritingStartingFrom = 0;
52963    if (paramsInheritanceStrategy !== 'always') {
52964        inheritingStartingFrom = pathFromRoot.length - 1;
52965        while (inheritingStartingFrom >= 1) {
52966            const current = pathFromRoot[inheritingStartingFrom];
52967            const parent = pathFromRoot[inheritingStartingFrom - 1];
52968            // current route is an empty path => inherits its parent's params and data
52969            if (current.routeConfig && current.routeConfig.path === '') {
52970                inheritingStartingFrom--;
52971                // parent is componentless => current route should inherit its params and data
52972            }
52973            else if (!parent.component) {
52974                inheritingStartingFrom--;
52975            }
52976            else {
52977                break;
52978            }
52979        }
52980    }
52981    return flattenInherited(pathFromRoot.slice(inheritingStartingFrom));
52982}
52983/** @internal */
52984function flattenInherited(pathFromRoot) {
52985    return pathFromRoot.reduce((res, curr) => {
52986        const params = Object.assign(Object.assign({}, res.params), curr.params);
52987        const data = Object.assign(Object.assign({}, res.data), curr.data);
52988        const resolve = Object.assign(Object.assign({}, res.resolve), curr._resolvedData);
52989        return { params, data, resolve };
52990    }, { params: {}, data: {}, resolve: {} });
52991}
52992/**
52993 * @description
52994 *
52995 * Contains the information about a route associated with a component loaded in an
52996 * outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to
52997 * traverse the router state tree.
52998 *
52999 * The following example initializes a component with route information extracted
53000 * from the snapshot of the root node at the time of creation.
53001 *
53002 * ```
53003 * @Component({templateUrl:'./my-component.html'})
53004 * class MyComponent {
53005 *   constructor(route: ActivatedRoute) {
53006 *     const id: string = route.snapshot.params.id;
53007 *     const url: string = route.snapshot.url.join('');
53008 *     const user = route.snapshot.data.user;
53009 *   }
53010 * }
53011 * ```
53012 *
53013 * @publicApi
53014 */
53015class ActivatedRouteSnapshot {
53016    /** @internal */
53017    constructor(
53018    /** The URL segments matched by this route */
53019    url, 
53020    /**
53021     *  The matrix parameters scoped to this route.
53022     *
53023     *  You can compute all params (or data) in the router state or to get params outside
53024     *  of an activated component by traversing the `RouterState` tree as in the following
53025     *  example:
53026     *  ```
53027     *  collectRouteParams(router: Router) {
53028     *    let params = {};
53029     *    let stack: ActivatedRouteSnapshot[] = [router.routerState.snapshot.root];
53030     *    while (stack.length > 0) {
53031     *      const route = stack.pop()!;
53032     *      params = {...params, ...route.params};
53033     *      stack.push(...route.children);
53034     *    }
53035     *    return params;
53036     *  }
53037     *  ```
53038     */
53039    params, 
53040    /** The query parameters shared by all the routes */
53041    queryParams, 
53042    /** The URL fragment shared by all the routes */
53043    fragment, 
53044    /** The static and resolved data of this route */
53045    data, 
53046    /** The outlet name of the route */
53047    outlet, 
53048    /** The component of the route */
53049    component, routeConfig, urlSegment, lastPathIndex, resolve) {
53050        this.url = url;
53051        this.params = params;
53052        this.queryParams = queryParams;
53053        this.fragment = fragment;
53054        this.data = data;
53055        this.outlet = outlet;
53056        this.component = component;
53057        this.routeConfig = routeConfig;
53058        this._urlSegment = urlSegment;
53059        this._lastPathIndex = lastPathIndex;
53060        this._resolve = resolve;
53061    }
53062    /** The root of the router state */
53063    get root() {
53064        return this._routerState.root;
53065    }
53066    /** The parent of this route in the router state tree */
53067    get parent() {
53068        return this._routerState.parent(this);
53069    }
53070    /** The first child of this route in the router state tree */
53071    get firstChild() {
53072        return this._routerState.firstChild(this);
53073    }
53074    /** The children of this route in the router state tree */
53075    get children() {
53076        return this._routerState.children(this);
53077    }
53078    /** The path from the root of the router state tree to this route */
53079    get pathFromRoot() {
53080        return this._routerState.pathFromRoot(this);
53081    }
53082    get paramMap() {
53083        if (!this._paramMap) {
53084            this._paramMap = convertToParamMap(this.params);
53085        }
53086        return this._paramMap;
53087    }
53088    get queryParamMap() {
53089        if (!this._queryParamMap) {
53090            this._queryParamMap = convertToParamMap(this.queryParams);
53091        }
53092        return this._queryParamMap;
53093    }
53094    toString() {
53095        const url = this.url.map(segment => segment.toString()).join('/');
53096        const matched = this.routeConfig ? this.routeConfig.path : '';
53097        return `Route(url:'${url}', path:'${matched}')`;
53098    }
53099}
53100/**
53101 * @description
53102 *
53103 * Represents the state of the router at a moment in time.
53104 *
53105 * This is a tree of activated route snapshots. Every node in this tree knows about
53106 * the "consumed" URL segments, the extracted parameters, and the resolved data.
53107 *
53108 * The following example shows how a component is initialized with information
53109 * from the snapshot of the root node's state at the time of creation.
53110 *
53111 * ```
53112 * @Component({templateUrl:'template.html'})
53113 * class MyComponent {
53114 *   constructor(router: Router) {
53115 *     const state: RouterState = router.routerState;
53116 *     const snapshot: RouterStateSnapshot = state.snapshot;
53117 *     const root: ActivatedRouteSnapshot = snapshot.root;
53118 *     const child = root.firstChild;
53119 *     const id: Observable<string> = child.params.map(p => p.id);
53120 *     //...
53121 *   }
53122 * }
53123 * ```
53124 *
53125 * @publicApi
53126 */
53127class RouterStateSnapshot extends Tree {
53128    /** @internal */
53129    constructor(
53130    /** The url from which this snapshot was created */
53131    url, root) {
53132        super(root);
53133        this.url = url;
53134        setRouterState(this, root);
53135    }
53136    toString() {
53137        return serializeNode(this._root);
53138    }
53139}
53140function setRouterState(state, node) {
53141    node.value._routerState = state;
53142    node.children.forEach(c => setRouterState(state, c));
53143}
53144function serializeNode(node) {
53145    const c = node.children.length > 0 ? ` { ${node.children.map(serializeNode).join(', ')} } ` : '';
53146    return `${node.value}${c}`;
53147}
53148/**
53149 * The expectation is that the activate route is created with the right set of parameters.
53150 * So we push new values into the observables only when they are not the initial values.
53151 * And we detect that by checking if the snapshot field is set.
53152 */
53153function advanceActivatedRoute(route) {
53154    if (route.snapshot) {
53155        const currentSnapshot = route.snapshot;
53156        const nextSnapshot = route._futureSnapshot;
53157        route.snapshot = nextSnapshot;
53158        if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) {
53159            route.queryParams.next(nextSnapshot.queryParams);
53160        }
53161        if (currentSnapshot.fragment !== nextSnapshot.fragment) {
53162            route.fragment.next(nextSnapshot.fragment);
53163        }
53164        if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {
53165            route.params.next(nextSnapshot.params);
53166        }
53167        if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {
53168            route.url.next(nextSnapshot.url);
53169        }
53170        if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {
53171            route.data.next(nextSnapshot.data);
53172        }
53173    }
53174    else {
53175        route.snapshot = route._futureSnapshot;
53176        // this is for resolved data
53177        route.data.next(route._futureSnapshot.data);
53178    }
53179}
53180function equalParamsAndUrlSegments(a, b) {
53181    const equalUrlParams = shallowEqual(a.params, b.params) && equalSegments(a.url, b.url);
53182    const parentsMismatch = !a.parent !== !b.parent;
53183    return equalUrlParams && !parentsMismatch &&
53184        (!a.parent || equalParamsAndUrlSegments(a.parent, b.parent));
53185}
53186
53187/**
53188 * @license
53189 * Copyright Google LLC All Rights Reserved.
53190 *
53191 * Use of this source code is governed by an MIT-style license that can be
53192 * found in the LICENSE file at https://angular.io/license
53193 */
53194function createRouterState(routeReuseStrategy, curr, prevState) {
53195    const root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined);
53196    return new RouterState(root, curr);
53197}
53198function createNode(routeReuseStrategy, curr, prevState) {
53199    // reuse an activated route that is currently displayed on the screen
53200    if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) {
53201        const value = prevState.value;
53202        value._futureSnapshot = curr.value;
53203        const children = createOrReuseChildren(routeReuseStrategy, curr, prevState);
53204        return new TreeNode(value, children);
53205    }
53206    else {
53207        if (routeReuseStrategy.shouldAttach(curr.value)) {
53208            // retrieve an activated route that is used to be displayed, but is not currently displayed
53209            const detachedRouteHandle = routeReuseStrategy.retrieve(curr.value);
53210            if (detachedRouteHandle !== null) {
53211                const tree = detachedRouteHandle.route;
53212                setFutureSnapshotsOfActivatedRoutes(curr, tree);
53213                return tree;
53214            }
53215        }
53216        const value = createActivatedRoute(curr.value);
53217        const children = curr.children.map(c => createNode(routeReuseStrategy, c));
53218        return new TreeNode(value, children);
53219    }
53220}
53221function setFutureSnapshotsOfActivatedRoutes(curr, result) {
53222    if (curr.value.routeConfig !== result.value.routeConfig) {
53223        throw new Error('Cannot reattach ActivatedRouteSnapshot created from a different route');
53224    }
53225    if (curr.children.length !== result.children.length) {
53226        throw new Error('Cannot reattach ActivatedRouteSnapshot with a different number of children');
53227    }
53228    result.value._futureSnapshot = curr.value;
53229    for (let i = 0; i < curr.children.length; ++i) {
53230        setFutureSnapshotsOfActivatedRoutes(curr.children[i], result.children[i]);
53231    }
53232}
53233function createOrReuseChildren(routeReuseStrategy, curr, prevState) {
53234    return curr.children.map(child => {
53235        for (const p of prevState.children) {
53236            if (routeReuseStrategy.shouldReuseRoute(child.value, p.value.snapshot)) {
53237                return createNode(routeReuseStrategy, child, p);
53238            }
53239        }
53240        return createNode(routeReuseStrategy, child);
53241    });
53242}
53243function createActivatedRoute(c) {
53244    return new ActivatedRoute(new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.url), new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.params), new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.queryParams), new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.fragment), new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"](c.data), c.outlet, c.component, c);
53245}
53246
53247/**
53248 * @license
53249 * Copyright Google LLC All Rights Reserved.
53250 *
53251 * Use of this source code is governed by an MIT-style license that can be
53252 * found in the LICENSE file at https://angular.io/license
53253 */
53254function createUrlTree(route, urlTree, commands, queryParams, fragment) {
53255    if (commands.length === 0) {
53256        return tree(urlTree.root, urlTree.root, urlTree, queryParams, fragment);
53257    }
53258    const nav = computeNavigation(commands);
53259    if (nav.toRoot()) {
53260        return tree(urlTree.root, new UrlSegmentGroup([], {}), urlTree, queryParams, fragment);
53261    }
53262    const startingPosition = findStartingPosition(nav, urlTree, route);
53263    const segmentGroup = startingPosition.processChildren ?
53264        updateSegmentGroupChildren(startingPosition.segmentGroup, startingPosition.index, nav.commands) :
53265        updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands);
53266    return tree(startingPosition.segmentGroup, segmentGroup, urlTree, queryParams, fragment);
53267}
53268function isMatrixParams(command) {
53269    return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;
53270}
53271/**
53272 * Determines if a given command has an `outlets` map. When we encounter a command
53273 * with an outlets k/v map, we need to apply each outlet individually to the existing segment.
53274 */
53275function isCommandWithOutlets(command) {
53276    return typeof command === 'object' && command != null && command.outlets;
53277}
53278function tree(oldSegmentGroup, newSegmentGroup, urlTree, queryParams, fragment) {
53279    let qp = {};
53280    if (queryParams) {
53281        forEach(queryParams, (value, name) => {
53282            qp[name] = Array.isArray(value) ? value.map((v) => `${v}`) : `${value}`;
53283        });
53284    }
53285    if (urlTree.root === oldSegmentGroup) {
53286        return new UrlTree(newSegmentGroup, qp, fragment);
53287    }
53288    return new UrlTree(replaceSegment(urlTree.root, oldSegmentGroup, newSegmentGroup), qp, fragment);
53289}
53290function replaceSegment(current, oldSegment, newSegment) {
53291    const children = {};
53292    forEach(current.children, (c, outletName) => {
53293        if (c === oldSegment) {
53294            children[outletName] = newSegment;
53295        }
53296        else {
53297            children[outletName] = replaceSegment(c, oldSegment, newSegment);
53298        }
53299    });
53300    return new UrlSegmentGroup(current.segments, children);
53301}
53302class Navigation {
53303    constructor(isAbsolute, numberOfDoubleDots, commands) {
53304        this.isAbsolute = isAbsolute;
53305        this.numberOfDoubleDots = numberOfDoubleDots;
53306        this.commands = commands;
53307        if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {
53308            throw new Error('Root segment cannot have matrix parameters');
53309        }
53310        const cmdWithOutlet = commands.find(isCommandWithOutlets);
53311        if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {
53312            throw new Error('{outlets:{}} has to be the last command');
53313        }
53314    }
53315    toRoot() {
53316        return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/';
53317    }
53318}
53319/** Transforms commands to a normalized `Navigation` */
53320function computeNavigation(commands) {
53321    if ((typeof commands[0] === 'string') && commands.length === 1 && commands[0] === '/') {
53322        return new Navigation(true, 0, commands);
53323    }
53324    let numberOfDoubleDots = 0;
53325    let isAbsolute = false;
53326    const res = commands.reduce((res, cmd, cmdIdx) => {
53327        if (typeof cmd === 'object' && cmd != null) {
53328            if (cmd.outlets) {
53329                const outlets = {};
53330                forEach(cmd.outlets, (commands, name) => {
53331                    outlets[name] = typeof commands === 'string' ? commands.split('/') : commands;
53332                });
53333                return [...res, { outlets }];
53334            }
53335            if (cmd.segmentPath) {
53336                return [...res, cmd.segmentPath];
53337            }
53338        }
53339        if (!(typeof cmd === 'string')) {
53340            return [...res, cmd];
53341        }
53342        if (cmdIdx === 0) {
53343            cmd.split('/').forEach((urlPart, partIndex) => {
53344                if (partIndex == 0 && urlPart === '.') {
53345                    // skip './a'
53346                }
53347                else if (partIndex == 0 && urlPart === '') { //  '/a'
53348                    isAbsolute = true;
53349                }
53350                else if (urlPart === '..') { //  '../a'
53351                    numberOfDoubleDots++;
53352                }
53353                else if (urlPart != '') {
53354                    res.push(urlPart);
53355                }
53356            });
53357            return res;
53358        }
53359        return [...res, cmd];
53360    }, []);
53361    return new Navigation(isAbsolute, numberOfDoubleDots, res);
53362}
53363class Position {
53364    constructor(segmentGroup, processChildren, index) {
53365        this.segmentGroup = segmentGroup;
53366        this.processChildren = processChildren;
53367        this.index = index;
53368    }
53369}
53370function findStartingPosition(nav, tree, route) {
53371    if (nav.isAbsolute) {
53372        return new Position(tree.root, true, 0);
53373    }
53374    if (route.snapshot._lastPathIndex === -1) {
53375        const segmentGroup = route.snapshot._urlSegment;
53376        // Pathless ActivatedRoute has _lastPathIndex === -1 but should not process children
53377        // see issue #26224, #13011, #35687
53378        // However, if the ActivatedRoute is the root we should process children like above.
53379        const processChildren = segmentGroup === tree.root;
53380        return new Position(segmentGroup, processChildren, 0);
53381    }
53382    const modifier = isMatrixParams(nav.commands[0]) ? 0 : 1;
53383    const index = route.snapshot._lastPathIndex + modifier;
53384    return createPositionApplyingDoubleDots(route.snapshot._urlSegment, index, nav.numberOfDoubleDots);
53385}
53386function createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {
53387    let g = group;
53388    let ci = index;
53389    let dd = numberOfDoubleDots;
53390    while (dd > ci) {
53391        dd -= ci;
53392        g = g.parent;
53393        if (!g) {
53394            throw new Error('Invalid number of \'../\'');
53395        }
53396        ci = g.segments.length;
53397    }
53398    return new Position(g, false, ci - dd);
53399}
53400function getOutlets(commands) {
53401    if (isCommandWithOutlets(commands[0])) {
53402        return commands[0].outlets;
53403    }
53404    return { [PRIMARY_OUTLET]: commands };
53405}
53406function updateSegmentGroup(segmentGroup, startIndex, commands) {
53407    if (!segmentGroup) {
53408        segmentGroup = new UrlSegmentGroup([], {});
53409    }
53410    if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
53411        return updateSegmentGroupChildren(segmentGroup, startIndex, commands);
53412    }
53413    const m = prefixedWith(segmentGroup, startIndex, commands);
53414    const slicedCommands = commands.slice(m.commandIndex);
53415    if (m.match && m.pathIndex < segmentGroup.segments.length) {
53416        const g = new UrlSegmentGroup(segmentGroup.segments.slice(0, m.pathIndex), {});
53417        g.children[PRIMARY_OUTLET] =
53418            new UrlSegmentGroup(segmentGroup.segments.slice(m.pathIndex), segmentGroup.children);
53419        return updateSegmentGroupChildren(g, 0, slicedCommands);
53420    }
53421    else if (m.match && slicedCommands.length === 0) {
53422        return new UrlSegmentGroup(segmentGroup.segments, {});
53423    }
53424    else if (m.match && !segmentGroup.hasChildren()) {
53425        return createNewSegmentGroup(segmentGroup, startIndex, commands);
53426    }
53427    else if (m.match) {
53428        return updateSegmentGroupChildren(segmentGroup, 0, slicedCommands);
53429    }
53430    else {
53431        return createNewSegmentGroup(segmentGroup, startIndex, commands);
53432    }
53433}
53434function updateSegmentGroupChildren(segmentGroup, startIndex, commands) {
53435    if (commands.length === 0) {
53436        return new UrlSegmentGroup(segmentGroup.segments, {});
53437    }
53438    else {
53439        const outlets = getOutlets(commands);
53440        const children = {};
53441        forEach(outlets, (commands, outlet) => {
53442            if (typeof commands === 'string') {
53443                commands = [commands];
53444            }
53445            if (commands !== null) {
53446                children[outlet] = updateSegmentGroup(segmentGroup.children[outlet], startIndex, commands);
53447            }
53448        });
53449        forEach(segmentGroup.children, (child, childOutlet) => {
53450            if (outlets[childOutlet] === undefined) {
53451                children[childOutlet] = child;
53452            }
53453        });
53454        return new UrlSegmentGroup(segmentGroup.segments, children);
53455    }
53456}
53457function prefixedWith(segmentGroup, startIndex, commands) {
53458    let currentCommandIndex = 0;
53459    let currentPathIndex = startIndex;
53460    const noMatch = { match: false, pathIndex: 0, commandIndex: 0 };
53461    while (currentPathIndex < segmentGroup.segments.length) {
53462        if (currentCommandIndex >= commands.length)
53463            return noMatch;
53464        const path = segmentGroup.segments[currentPathIndex];
53465        const command = commands[currentCommandIndex];
53466        // Do not try to consume command as part of the prefixing if it has outlets because it can
53467        // contain outlets other than the one being processed. Consuming the outlets command would
53468        // result in other outlets being ignored.
53469        if (isCommandWithOutlets(command)) {
53470            break;
53471        }
53472        const curr = `${command}`;
53473        const next = currentCommandIndex < commands.length - 1 ? commands[currentCommandIndex + 1] : null;
53474        if (currentPathIndex > 0 && curr === undefined)
53475            break;
53476        if (curr && next && (typeof next === 'object') && next.outlets === undefined) {
53477            if (!compare(curr, next, path))
53478                return noMatch;
53479            currentCommandIndex += 2;
53480        }
53481        else {
53482            if (!compare(curr, {}, path))
53483                return noMatch;
53484            currentCommandIndex++;
53485        }
53486        currentPathIndex++;
53487    }
53488    return { match: true, pathIndex: currentPathIndex, commandIndex: currentCommandIndex };
53489}
53490function createNewSegmentGroup(segmentGroup, startIndex, commands) {
53491    const paths = segmentGroup.segments.slice(0, startIndex);
53492    let i = 0;
53493    while (i < commands.length) {
53494        const command = commands[i];
53495        if (isCommandWithOutlets(command)) {
53496            const children = createNewSegmentChildren(command.outlets);
53497            return new UrlSegmentGroup(paths, children);
53498        }
53499        // if we start with an object literal, we need to reuse the path part from the segment
53500        if (i === 0 && isMatrixParams(commands[0])) {
53501            const p = segmentGroup.segments[startIndex];
53502            paths.push(new UrlSegment(p.path, stringify(commands[0])));
53503            i++;
53504            continue;
53505        }
53506        const curr = isCommandWithOutlets(command) ? command.outlets[PRIMARY_OUTLET] : `${command}`;
53507        const next = (i < commands.length - 1) ? commands[i + 1] : null;
53508        if (curr && next && isMatrixParams(next)) {
53509            paths.push(new UrlSegment(curr, stringify(next)));
53510            i += 2;
53511        }
53512        else {
53513            paths.push(new UrlSegment(curr, {}));
53514            i++;
53515        }
53516    }
53517    return new UrlSegmentGroup(paths, {});
53518}
53519function createNewSegmentChildren(outlets) {
53520    const children = {};
53521    forEach(outlets, (commands, outlet) => {
53522        if (typeof commands === 'string') {
53523            commands = [commands];
53524        }
53525        if (commands !== null) {
53526            children[outlet] = createNewSegmentGroup(new UrlSegmentGroup([], {}), 0, commands);
53527        }
53528    });
53529    return children;
53530}
53531function stringify(params) {
53532    const res = {};
53533    forEach(params, (v, k) => res[k] = `${v}`);
53534    return res;
53535}
53536function compare(path, params, segment) {
53537    return path == segment.path && shallowEqual(params, segment.parameters);
53538}
53539
53540/**
53541 * @license
53542 * Copyright Google LLC All Rights Reserved.
53543 *
53544 * Use of this source code is governed by an MIT-style license that can be
53545 * found in the LICENSE file at https://angular.io/license
53546 */
53547const activateRoutes = (rootContexts, routeReuseStrategy, forwardEvent) => Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(t => {
53548    new ActivateRoutes(routeReuseStrategy, t.targetRouterState, t.currentRouterState, forwardEvent)
53549        .activate(rootContexts);
53550    return t;
53551});
53552class ActivateRoutes {
53553    constructor(routeReuseStrategy, futureState, currState, forwardEvent) {
53554        this.routeReuseStrategy = routeReuseStrategy;
53555        this.futureState = futureState;
53556        this.currState = currState;
53557        this.forwardEvent = forwardEvent;
53558    }
53559    activate(parentContexts) {
53560        const futureRoot = this.futureState._root;
53561        const currRoot = this.currState ? this.currState._root : null;
53562        this.deactivateChildRoutes(futureRoot, currRoot, parentContexts);
53563        advanceActivatedRoute(this.futureState.root);
53564        this.activateChildRoutes(futureRoot, currRoot, parentContexts);
53565    }
53566    // De-activate the child route that are not re-used for the future state
53567    deactivateChildRoutes(futureNode, currNode, contexts) {
53568        const children = nodeChildrenAsMap(currNode);
53569        // Recurse on the routes active in the future state to de-activate deeper children
53570        futureNode.children.forEach(futureChild => {
53571            const childOutletName = futureChild.value.outlet;
53572            this.deactivateRoutes(futureChild, children[childOutletName], contexts);
53573            delete children[childOutletName];
53574        });
53575        // De-activate the routes that will not be re-used
53576        forEach(children, (v, childName) => {
53577            this.deactivateRouteAndItsChildren(v, contexts);
53578        });
53579    }
53580    deactivateRoutes(futureNode, currNode, parentContext) {
53581        const future = futureNode.value;
53582        const curr = currNode ? currNode.value : null;
53583        if (future === curr) {
53584            // Reusing the node, check to see if the children need to be de-activated
53585            if (future.component) {
53586                // If we have a normal route, we need to go through an outlet.
53587                const context = parentContext.getContext(future.outlet);
53588                if (context) {
53589                    this.deactivateChildRoutes(futureNode, currNode, context.children);
53590                }
53591            }
53592            else {
53593                // if we have a componentless route, we recurse but keep the same outlet map.
53594                this.deactivateChildRoutes(futureNode, currNode, parentContext);
53595            }
53596        }
53597        else {
53598            if (curr) {
53599                // Deactivate the current route which will not be re-used
53600                this.deactivateRouteAndItsChildren(currNode, parentContext);
53601            }
53602        }
53603    }
53604    deactivateRouteAndItsChildren(route, parentContexts) {
53605        if (this.routeReuseStrategy.shouldDetach(route.value.snapshot)) {
53606            this.detachAndStoreRouteSubtree(route, parentContexts);
53607        }
53608        else {
53609            this.deactivateRouteAndOutlet(route, parentContexts);
53610        }
53611    }
53612    detachAndStoreRouteSubtree(route, parentContexts) {
53613        const context = parentContexts.getContext(route.value.outlet);
53614        if (context && context.outlet) {
53615            const componentRef = context.outlet.detach();
53616            const contexts = context.children.onOutletDeactivated();
53617            this.routeReuseStrategy.store(route.value.snapshot, { componentRef, route, contexts });
53618        }
53619    }
53620    deactivateRouteAndOutlet(route, parentContexts) {
53621        const context = parentContexts.getContext(route.value.outlet);
53622        // The context could be `null` if we are on a componentless route but there may still be
53623        // children that need deactivating.
53624        const contexts = context && route.value.component ? context.children : parentContexts;
53625        const children = nodeChildrenAsMap(route);
53626        for (const childOutlet of Object.keys(children)) {
53627            this.deactivateRouteAndItsChildren(children[childOutlet], contexts);
53628        }
53629        if (context && context.outlet) {
53630            // Destroy the component
53631            context.outlet.deactivate();
53632            // Destroy the contexts for all the outlets that were in the component
53633            context.children.onOutletDeactivated();
53634            // Clear the information about the attached component on the context but keep the reference to
53635            // the outlet.
53636            context.attachRef = null;
53637            context.resolver = null;
53638            context.route = null;
53639        }
53640    }
53641    activateChildRoutes(futureNode, currNode, contexts) {
53642        const children = nodeChildrenAsMap(currNode);
53643        futureNode.children.forEach(c => {
53644            this.activateRoutes(c, children[c.value.outlet], contexts);
53645            this.forwardEvent(new ActivationEnd(c.value.snapshot));
53646        });
53647        if (futureNode.children.length) {
53648            this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot));
53649        }
53650    }
53651    activateRoutes(futureNode, currNode, parentContexts) {
53652        const future = futureNode.value;
53653        const curr = currNode ? currNode.value : null;
53654        advanceActivatedRoute(future);
53655        // reusing the node
53656        if (future === curr) {
53657            if (future.component) {
53658                // If we have a normal route, we need to go through an outlet.
53659                const context = parentContexts.getOrCreateContext(future.outlet);
53660                this.activateChildRoutes(futureNode, currNode, context.children);
53661            }
53662            else {
53663                // if we have a componentless route, we recurse but keep the same outlet map.
53664                this.activateChildRoutes(futureNode, currNode, parentContexts);
53665            }
53666        }
53667        else {
53668            if (future.component) {
53669                // if we have a normal route, we need to place the component into the outlet and recurse.
53670                const context = parentContexts.getOrCreateContext(future.outlet);
53671                if (this.routeReuseStrategy.shouldAttach(future.
53671snapshot)) {
53672                    const stored = this.routeReuseStrategy.retrieve(future.snapshot);
53673                    this.routeReuseStrategy.store(future.snapshot, null);
53674                    context.children.onOutletReAttached(stored.contexts);
53675                    context.attachRef = stored.componentRef;
53676                    context.route = stored.route.value;
53677                    if (context.outlet) {
53678                        // Attach right away when the outlet has already been instantiated
53679                        // Otherwise attach from `RouterOutlet.ngOnInit` when it is instantiated
53680                        context.outlet.attach(stored.componentRef, stored.route.value);
53681                    }
53682                    advanceActivatedRouteNodeAndItsChildren(stored.route);
53683                }
53684                else {
53685                    const config = parentLoadedConfig(future.snapshot);
53686                    const cmpFactoryResolver = config ? config.module.componentFactoryResolver : null;
53687                    context.attachRef = null;
53688                    context.route = future;
53689                    context.resolver = cmpFactoryResolver;
53690                    if (context.outlet) {
53691                        // Activate the outlet when it has already been instantiated
53692                        // Otherwise it will get activated from its `ngOnInit` when instantiated
53693                        context.outlet.activateWith(future, cmpFactoryResolver);
53694                    }
53695                    this.activateChildRoutes(futureNode, null, context.children);
53696                }
53697            }
53698            else {
53699                // if we have a componentless route, we recurse but keep the same outlet map.
53700                this.activateChildRoutes(futureNode, null, parentContexts);
53701            }
53702        }
53703    }
53704}
53705function advanceActivatedRouteNodeAndItsChildren(node) {
53706    advanceActivatedRoute(node.value);
53707    node.children.forEach(advanceActivatedRouteNodeAndItsChildren);
53708}
53709function parentLoadedConfig(snapshot) {
53710    for (let s = snapshot.parent; s; s = s.parent) {
53711        const route = s.routeConfig;
53712        if (route && route._loadedConfig)
53713            return route._loadedConfig;
53714        if (route && route.component)
53715            return null;
53716    }
53717    return null;
53718}
53719
53720/**
53721 * @license
53722 * Copyright Google LLC All Rights Reserved.
53723 *
53724 * Use of this source code is governed by an MIT-style license that can be
53725 * found in the LICENSE file at https://angular.io/license
53726 */
53727class LoadedRouterConfig {
53728    constructor(routes, module) {
53729        this.routes = routes;
53730        this.module = module;
53731    }
53732}
53733
53734/**
53735 * @license
53736 * Copyright Google LLC All Rights Reserved.
53737 *
53738 * Use of this source code is governed by an MIT-style license that can be
53739 * found in the LICENSE file at https://angular.io/license
53740 */
53741/**
53742 * Simple function check, but generic so type inference will flow. Example:
53743 *
53744 * function product(a: number, b: number) {
53745 *   return a * b;
53746 * }
53747 *
53748 * if (isFunction<product>(fn)) {
53749 *   return fn(1, 2);
53750 * } else {
53751 *   throw "Must provide the `product` function";
53752 * }
53753 */
53754function isFunction(v) {
53755    return typeof v === 'function';
53756}
53757function isBoolean(v) {
53758    return typeof v === 'boolean';
53759}
53760function isUrlTree(v) {
53761    return v instanceof UrlTree;
53762}
53763function isCanLoad(guard) {
53764    return guard && isFunction(guard.canLoad);
53765}
53766function isCanActivate(guard) {
53767    return guard && isFunction(guard.canActivate);
53768}
53769function isCanActivateChild(guard) {
53770    return guard && isFunction(guard.canActivateChild);
53771}
53772function isCanDeactivate(guard) {
53773    return guard && isFunction(guard.canDeactivate);
53774}
53775
53776/**
53777 * @license
53778 * Copyright Google LLC All Rights Reserved.
53779 *
53780 * Use of this source code is governed by an MIT-style license that can be
53781 * found in the LICENSE file at https://angular.io/license
53782 */
53783const INITIAL_VALUE = Symbol('INITIAL_VALUE');
53784function prioritizedGuardValue() {
53785    return Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["switchMap"])(obs => {
53786        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["combineLatest"])(obs.map(o => o.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["startWith"])(INITIAL_VALUE))))
53787            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["scan"])((acc, list) => {
53788            let isPending = false;
53789            return list.reduce((innerAcc, val, i) => {
53790                if (innerAcc !== INITIAL_VALUE)
53791                    return innerAcc;
53792                // Toggle pending flag if any values haven't been set yet
53793                if (val === INITIAL_VALUE)
53794                    isPending = true;
53795                // Any other return values are only valid if we haven't yet hit a pending
53796                // call. This guarantees that in the case of a guard at the bottom of the
53797                // tree that returns a redirect, we will wait for the higher priority
53798                // guard at the top to finish before performing the redirect.
53799                if (!isPending) {
53800                    // Early return when we hit a `false` value as that should always
53801                    // cancel navigation
53802                    if (val === false)
53803                        return val;
53804                    if (i === list.length - 1 || isUrlTree(val)) {
53805                        return val;
53806                    }
53807                }
53808                return innerAcc;
53809            }, acc);
53810        }, INITIAL_VALUE), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(item => item !== INITIAL_VALUE), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(item => isUrlTree(item) ? item : item === true), //
53811        Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["take"])(1));
53812    });
53813}
53814
53815/**
53816 * @license
53817 * Copyright Google LLC All Rights Reserved.
53818 *
53819 * Use of this source code is governed by an MIT-style license that can be
53820 * found in the LICENSE file at https://angular.io/license
53821 */
53822/**
53823 * This component is used internally within the router to be a placeholder when an empty
53824 * router-outlet is needed. For example, with a config such as:
53825 *
53826 * `{path: 'parent', outlet: 'nav', children: [...]}`
53827 *
53828 * In order to render, there needs to be a component on this config, which will default
53829 * to this `EmptyOutletComponent`.
53830 */
53831class ɵEmptyOutletComponent {
53832}
53833ɵEmptyOutletComponent.ɵfac = function ɵEmptyOutletComponent_Factory(t) { return new (t || ɵEmptyOutletComponent)(); };
53834ɵEmptyOutletComponent.ɵcmp = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: ɵEmptyOutletComponent, selectors: [["ng-component"]], decls: 1, vars: 0, template: function ɵEmptyOutletComponent_Template(rf, ctx) { if (rf & 1) {
53835        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelement"](0, "router-outlet");
53836    } }, directives: function () { return [RouterOutlet]; }, encapsulation: 2 });
53837(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](ɵEmptyOutletComponent, [{
53838        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"],
53839        args: [{ template: `<router-outlet></router-outlet>` }]
53840    }], null, null); })();
53841
53842/**
53843 * @license
53844 * Copyright Google LLC All Rights Reserved.
53845 *
53846 * Use of this source code is governed by an MIT-style license that can be
53847 * found in the LICENSE file at https://angular.io/license
53848 */
53849function validateConfig(config, parentPath = '') {
53850    // forEach doesn't iterate undefined values
53851    for (let i = 0; i < config.length; i++) {
53852        const route = config[i];
53853        const fullPath = getFullPath(parentPath, route);
53854        validateNode(route, fullPath);
53855    }
53856}
53857function validateNode(route, fullPath) {
53858    if (typeof ngDevMode === 'undefined' || ngDevMode) {
53859        if (!route) {
53860            throw new Error(`
53861      Invalid configuration of route '${fullPath}': Encountered undefined route.
53862      The reason might be an extra comma.
53863
53864      Example:
53865      const routes: Routes = [
53866        { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
53867        { path: 'dashboard',  component: DashboardComponent },, << two commas
53868        { path: 'detail/:id', component: HeroDetailComponent }
53869      ];
53870    `);
53871        }
53872        if (Array.isArray(route)) {
53873            throw new Error(`Invalid configuration of route '${fullPath}': Array cannot be specified`);
53874        }
53875        if (!route.component && !route.children && !route.loadChildren &&
53876            (route.outlet && route.outlet !== PRIMARY_OUTLET)) {
53877            throw new Error(`Invalid configuration of route '${fullPath}': a componentless route without children or loadChildren cannot have a named outlet set`);
53878        }
53879        if (route.redirectTo && route.children) {
53880            throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and children cannot be used together`);
53881        }
53882        if (route.redirectTo && route.loadChildren) {
53883            throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and loadChildren cannot be used together`);
53884        }
53885        if (route.children && route.loadChildren) {
53886            throw new Error(`Invalid configuration of route '${fullPath}': children and loadChildren cannot be used together`);
53887        }
53888        if (route.redirectTo && route.component) {
53889            throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and component cannot be used together`);
53890        }
53891        if (route.redirectTo && route.canActivate) {
53892            throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and canActivate cannot be used together. Redirects happen before activation ` +
53893                `so canActivate will never be executed.`);
53894        }
53895        if (route.path && route.matcher) {
53896            throw new Error(`Invalid configuration of route '${fullPath}': path and matcher cannot be used together`);
53897        }
53898        if (route.redirectTo === void 0 && !route.component && !route.children && !route.loadChildren) {
53899            throw new Error(`Invalid configuration of route '${fullPath}'. One of the following must be provided: component, redirectTo, children or loadChildren`);
53900        }
53901        if (route.path === void 0 && route.matcher === void 0) {
53902            throw new Error(`Invalid configuration of route '${fullPath}': routes must have either a path or a matcher specified`);
53903        }
53904        if (typeof route.path === 'string' && route.path.charAt(0) === '/') {
53905            throw new Error(`Invalid configuration of route '${fullPath}': path cannot start with a slash`);
53906        }
53907        if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {
53908            const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;
53909            throw new Error(`Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
53910        }
53911        if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {
53912            throw new Error(`Invalid configuration of route '${fullPath}': pathMatch can only be set to 'prefix' or 'full'`);
53913        }
53914    }
53915    if (route.children) {
53916        validateConfig(route.children, fullPath);
53917    }
53918}
53919function getFullPath(parentPath, currentRoute) {
53920    if (!currentRoute) {
53921        return parentPath;
53922    }
53923    if (!parentPath && !currentRoute.path) {
53924        return '';
53925    }
53926    else if (parentPath && !currentRoute.path) {
53927        return `${parentPath}/`;
53928    }
53929    else if (!parentPath && currentRoute.path) {
53930        return currentRoute.path;
53931    }
53932    else {
53933        return `${parentPath}/${currentRoute.path}`;
53934    }
53935}
53936/**
53937 * Makes a copy of the config and adds any default required properties.
53938 */
53939function standardizeConfig(r) {
53940    const children = r.children && r.children.map(standardizeConfig);
53941    const c = children ? Object.assign(Object.assign({}, r), { children }) : Object.assign({}, r);
53942    if (!c.component && (children || c.loadChildren) && (c.outlet && c.outlet !== PRIMARY_OUTLET)) {
53943        c.component = ɵEmptyOutletComponent;
53944    }
53945    return c;
53946}
53947/** Returns the `route.outlet` or PRIMARY_OUTLET if none exists. */
53948function getOutlet(route) {
53949    return route.outlet || PRIMARY_OUTLET;
53950}
53951/**
53952 * Sorts the `routes` such that the ones with an outlet matching `outletName` come first.
53953 * The order of the configs is otherwise preserved.
53954 */
53955function sortByMatchingOutlets(routes, outletName) {
53956    const sortedConfig = routes.filter(r => getOutlet(r) === outletName);
53957    sortedConfig.push(...routes.filter(r => getOutlet(r) !== outletName));
53958    return sortedConfig;
53959}
53960
53961/**
53962 * @license
53963 * Copyright Google LLC All Rights Reserved.
53964 *
53965 * Use of this source code is governed by an MIT-style license that can be
53966 * found in the LICENSE file at https://angular.io/license
53967 */
53968const noMatch = {
53969    matched: false,
53970    consumedSegments: [],
53971    lastChild: 0,
53972    parameters: {},
53973    positionalParamSegments: {}
53974};
53975function match(segmentGroup, route, segments) {
53976    var _a;
53977    if (route.path === '') {
53978        if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {
53979            return Object.assign({}, noMatch);
53980        }
53981        return {
53982            matched: true,
53983            consumedSegments: [],
53984            lastChild: 0,
53985            parameters: {},
53986            positionalParamSegments: {}
53987        };
53988    }
53989    const matcher = route.matcher || defaultUrlMatcher;
53990    const res = matcher(segments, segmentGroup, route);
53991    if (!res)
53992        return Object.assign({}, noMatch);
53993    const posParams = {};
53994    forEach(res.posParams, (v, k) => {
53995        posParams[k] = v.path;
53996    });
53997    const parameters = res.consumed.length > 0 ? Object.assign(Object.assign({}, posParams), res.consumed[res.consumed.length - 1].parameters) :
53998        posParams;
53999    return {
54000        matched: true,
54001        consumedSegments: res.consumed,
54002        lastChild: res.consumed.length,
54003        // TODO(atscott): investigate combining parameters and positionalParamSegments
54004        parameters,
54005        positionalParamSegments: (_a = res.posParams) !== null && _a !== void 0 ? _a : {}
54006    };
54007}
54008function split(segmentGroup, consumedSegments, slicedSegments, config, relativeLinkResolution = 'corrected') {
54009    if (slicedSegments.length > 0 &&
54010        containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) {
54011        const s = new UrlSegmentGroup(consumedSegments, createChildrenForEmptyPaths(segmentGroup, consumedSegments, config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));
54012        s._sourceSegment = segmentGroup;
54013        s._segmentIndexShift = consumedSegments.length;
54014        return { segmentGroup: s, slicedSegments: [] };
54015    }
54016    if (slicedSegments.length === 0 &&
54017        containsEmptyPathMatches(segmentGroup, slicedSegments, config)) {
54018        const s = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, config, segmentGroup.children, relativeLinkResolution));
54019        s._sourceSegment = segmentGroup;
54020        s._segmentIndexShift = consumedSegments.length;
54021        return { segmentGroup: s, slicedSegments };
54022    }
54023    const s = new UrlSegmentGroup(segmentGroup.segments, segmentGroup.children);
54024    s._sourceSegment = segmentGroup;
54025    s._segmentIndexShift = consumedSegments.length;
54026    return { segmentGroup: s, slicedSegments };
54027}
54028function addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, routes, children, relativeLinkResolution) {
54029    const res = {};
54030    for (const r of routes) {
54031        if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {
54032            const s = new UrlSegmentGroup([], {});
54033            s._sourceSegment = segmentGroup;
54034            if (relativeLinkResolution === 'legacy') {
54035                s._segmentIndexShift = segmentGroup.segments.length;
54036            }
54037            else {
54038                s._segmentIndexShift = consumedSegments.length;
54039            }
54040            res[getOutlet(r)] = s;
54041        }
54042    }
54043    return Object.assign(Object.assign({}, children), res);
54044}
54045function createChildrenForEmptyPaths(segmentGroup, consumedSegments, routes, primarySegment) {
54046    const res = {};
54047    res[PRIMARY_OUTLET] = primarySegment;
54048    primarySegment._sourceSegment = segmentGroup;
54049    primarySegment._segmentIndexShift = consumedSegments.length;
54050    for (const r of routes) {
54051        if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) {
54052            const s = new UrlSegmentGroup([], {});
54053            s._sourceSegment = segmentGroup;
54054            s._segmentIndexShift = consumedSegments.length;
54055            res[getOutlet(r)] = s;
54056        }
54057    }
54058    return res;
54059}
54060function containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, routes) {
54061    return routes.some(r => emptyPathMatch(segmentGroup, slicedSegments, r) && getOutlet(r) !== PRIMARY_OUTLET);
54062}
54063function containsEmptyPathMatches(segmentGroup, slicedSegments, routes) {
54064    return routes.some(r => emptyPathMatch(segmentGroup, slicedSegments, r));
54065}
54066function emptyPathMatch(segmentGroup, slicedSegments, r) {
54067    if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full') {
54068        return false;
54069    }
54070    return r.path === '';
54071}
54072/**
54073 * Determines if `route` is a path match for the `rawSegment`, `segments`, and `outlet` without
54074 * verifying that its children are a full match for the remainder of the `rawSegment` children as
54075 * well.
54076 */
54077function isImmediateMatch(route, rawSegment, segments, outlet) {
54078    // We allow matches to empty paths when the outlets differ so we can match a url like `/(b:b)` to
54079    // a config like
54080    // * `{path: '', children: [{path: 'b', outlet: 'b'}]}`
54081    // or even
54082    // * `{path: '', outlet: 'a', children: [{path: 'b', outlet: 'b'}]`
54083    //
54084    // The exception here is when the segment outlet is for the primary outlet. This would
54085    // result in a match inside the named outlet because all children there are written as primary
54086    // outlets. So we need to prevent child named outlet matches in a url like `/b` in a config like
54087    // * `{path: '', outlet: 'x' children: [{path: 'b'}]}`
54088    // This should only match if the url is `/(x:b)`.
54089    if (getOutlet(route) !== outlet &&
54090        (outlet === PRIMARY_OUTLET || !emptyPathMatch(rawSegment, segments, route))) {
54091        return false;
54092    }
54093    if (route.path === '**') {
54094        return true;
54095    }
54096    return match(rawSegment, route, segments).matched;
54097}
54098function noLeftoversInUrl(segmentGroup, segments, outlet) {
54099    return segments.length === 0 && !segmentGroup.children[outlet];
54100}
54101
54102/**
54103 * @license
54104 * Copyright Google LLC All Rights Reserved.
54105 *
54106 * Use of this source code is governed by an MIT-style license that can be
54107 * found in the LICENSE file at https://angular.io/license
54108 */
54109class NoMatch {
54110    constructor(segmentGroup) {
54111        this.segmentGroup = segmentGroup || null;
54112    }
54113}
54114class AbsoluteRedirect {
54115    constructor(urlTree) {
54116        this.urlTree = urlTree;
54117    }
54118}
54119function noMatch$1(segmentGroup) {
54120    return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"]((obs) => obs.error(new NoMatch(segmentGroup)));
54121}
54122function absoluteRedirect(newTree) {
54123    return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"]((obs) => obs.error(new AbsoluteRedirect(newTree)));
54124}
54125function namedOutletsRedirect(redirectTo) {
54126    return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"]((obs) => obs.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`)));
54127}
54128function canLoadFails(route) {
54129    return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"]((obs) => obs.error(navigationCancelingError(`Cannot load children because the guard of the route "path: '${route.path}'" returned false`)));
54130}
54131/**
54132 * Returns the `UrlTree` with the redirection applied.
54133 *
54134 * Lazy modules are loaded along the way.
54135 */
54136function applyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config) {
54137    return new ApplyRedirects(moduleInjector, configLoader, urlSerializer, urlTree, config).apply();
54138}
54139class ApplyRedirects {
54140    constructor(moduleInjector, configLoader, urlSerializer, urlTree, config) {
54141        this.configLoader = configLoader;
54142        this.urlSerializer = urlSerializer;
54143        this.urlTree = urlTree;
54144        this.config = config;
54145        this.allowRedirects = true;
54146        this.ngModule = moduleInjector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleRef"]);
54147    }
54148    apply() {
54149        const splitGroup = split(this.urlTree.root, [], [], this.config).segmentGroup;
54150        // TODO(atscott): creating a new segment removes the _sourceSegment _segmentIndexShift, which is
54151        // only necessary to prevent failures in tests which assert exact object matches. The `split` is
54152        // now shared between `applyRedirects` and `recognize` but only the `recognize` step needs these
54153        // properties. Before the implementations were merged, the `applyRedirects` would not assign
54154        // them. We should be able to remove this logic as a "breaking change" but should do some more
54155        // investigation into the failures first.
54156        const rootSegmentGroup = new UrlSegmentGroup(splitGroup.segments, splitGroup.children);
54157        const expanded$ = this.expandSegmentGroup(this.ngModule, this.config, rootSegmentGroup, PRIMARY_OUTLET);
54158        const urlTrees$ = expanded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((rootSegmentGroup) => {
54159            return this.createUrlTree(squashSegmentGroup(rootSegmentGroup), this.urlTree.queryParams, this.urlTree.fragment);
54160        }));
54161        return urlTrees$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])((e) => {
54162            if (e instanceof AbsoluteRedirect) {
54163                // after an absolute redirect we do not apply any more redirects!
54164                this.allowRedirects = false;
54165                // we need to run matching, so we can fetch all lazy-loaded modules
54166                return this.match(e.urlTree);
54167            }
54168            if (e instanceof NoMatch) {
54169                throw this.noMatchError(e);
54170            }
54171            throw e;
54172        }));
54173    }
54174    match(tree) {
54175        const expanded$ = this.expandSegmentGroup(this.ngModule, this.config, tree.root, PRIMARY_OUTLET);
54176        const mapped$ = expanded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((rootSegmentGroup) => {
54177            return this.createUrlTree(squashSegmentGroup(rootSegmentGroup), tree.queryParams, tree.fragment);
54178        }));
54179        return mapped$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])((e) => {
54180            if (e instanceof NoMatch) {
54181                throw this.noMatchError(e);
54182            }
54183            throw e;
54184        }));
54185    }
54186    noMatchError(e) {
54187        return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`);
54188    }
54189    createUrlTree(rootCandidate, queryParams, fragment) {
54190        const root = rootCandidate.segments.length > 0 ?
54191            new UrlSegmentGroup([], { [PRIMARY_OUTLET]: rootCandidate }) :
54192            rootCandidate;
54193        return new UrlTree(root, queryParams, fragment);
54194    }
54195    expandSegmentGroup(ngModule, routes, segmentGroup, outlet) {
54196        if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
54197            return this.expandChildren(ngModule, routes, segmentGroup)
54198                .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((children) => new UrlSegmentGroup([], children)));
54199        }
54200        return this.expandSegment(ngModule, segmentGroup, routes, segmentGroup.segments, outlet, true);
54201    }
54202    // Recursively expand segment groups for all the child outlets
54203    expandChildren(ngModule, routes, segmentGroup) {
54204        // Expand outlets one at a time, starting with the primary outlet. We need to do it this way
54205        // because an absolute redirect from the primary outlet takes precedence.
54206        const childOutlets = [];
54207        for (const child of Object.keys(segmentGroup.children)) {
54208            if (child === 'primary') {
54209                childOutlets.unshift(child);
54210            }
54211            else {
54212                childOutlets.push(child);
54213            }
54214        }
54215        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(childOutlets)
54216            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])(childOutlet => {
54217            const child = segmentGroup.children[childOutlet];
54218            // Sort the routes so routes with outlets that match the segment appear
54219            // first, followed by routes for other outlets, which might match if they have an
54220            // empty path.
54221            const sortedRoutes = sortByMatchingOutlets(routes, childOutlet);
54222            return this.expandSegmentGroup(ngModule, sortedRoutes, child, childOutlet)
54223                .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(s => ({ segment: s, outlet: childOutlet })));
54224        }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["scan"])((children, expandedChild) => {
54225            children[expandedChild.outlet] = expandedChild.segment;
54226            return children;
54227        }, {}), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["last"])());
54228    }
54229    expandSegment(ngModule, segmentGroup, routes, segments, outlet, allowRedirects) {
54230        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(routes).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])((r) => {
54231            const expanded$ = this.expandSegmentAgainstRoute(ngModule, segmentGroup, routes, r, segments, outlet, allowRedirects);
54232            return expanded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])((e) => {
54233                if (e instanceof NoMatch) {
54234                    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
54235                }
54236                throw e;
54237            }));
54238        }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])((s) => !!s), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])((e, _) => {
54239            if (e instanceof rxjs__WEBPACK_IMPORTED_MODULE_2__["
54239EmptyError"] || e.name === 'EmptyError') {
54240                if (noLeftoversInUrl(segmentGroup, segments, outlet)) {
54241                    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new UrlSegmentGroup([], {}));
54242                }
54243                throw new NoMatch(segmentGroup);
54244            }
54245            throw e;
54246        }));
54247    }
54248    expandSegmentAgainstRoute(ngModule, segmentGroup, routes, route, paths, outlet, allowRedirects) {
54249        if (!isImmediateMatch(route, segmentGroup, paths, outlet)) {
54250            return noMatch$1(segmentGroup);
54251        }
54252        if (route.redirectTo === undefined) {
54253            return this.matchSegmentAgainstRoute(ngModule, segmentGroup, route, paths, outlet);
54254        }
54255        if (allowRedirects && this.allowRedirects) {
54256            return this.expandSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, paths, outlet);
54257        }
54258        return noMatch$1(segmentGroup);
54259    }
54260    expandSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet) {
54261        if (route.path === '**') {
54262            return this.expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule, routes, route, outlet);
54263        }
54264        return this.expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet);
54265    }
54266    expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule, routes, route, outlet) {
54267        const newTree = this.applyRedirectCommands([], route.redirectTo, {});
54268        if (route.redirectTo.startsWith('/')) {
54269            return absoluteRedirect(newTree);
54270        }
54271        return this.lineralizeSegments(route, newTree).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])((newSegments) => {
54272            const group = new UrlSegmentGroup(newSegments, {});
54273            return this.expandSegment(ngModule, group, routes, newSegments, outlet, false);
54274        }));
54275    }
54276    expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet) {
54277        const { matched, consumedSegments, lastChild, positionalParamSegments } = match(segmentGroup, route, segments);
54278        if (!matched)
54279            return noMatch$1(segmentGroup);
54280        const newTree = this.applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments);
54281        if (route.redirectTo.startsWith('/')) {
54282            return absoluteRedirect(newTree);
54283        }
54284        return this.lineralizeSegments(route, newTree).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])((newSegments) => {
54285            return this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(segments.slice(lastChild)), outlet, false);
54286        }));
54287    }
54288    matchSegmentAgainstRoute(ngModule, rawSegmentGroup, route, segments, outlet) {
54289        if (route.path === '**') {
54290            if (route.loadChildren) {
54291                const loaded$ = route._loadedConfig ? Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(route._loadedConfig) :
54292                    this.configLoader.load(ngModule.injector, route);
54293                return loaded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((cfg) => {
54294                    route._loadedConfig = cfg;
54295                    return new UrlSegmentGroup(segments, {});
54296                }));
54297            }
54298            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new UrlSegmentGroup(segments, {}));
54299        }
54300        const { matched, consumedSegments, lastChild } = match(rawSegmentGroup, route, segments);
54301        if (!matched)
54302            return noMatch$1(rawSegmentGroup);
54303        const rawSlicedSegments = segments.slice(lastChild);
54304        const childConfig$ = this.getChildConfig(ngModule, route, segments);
54305        return childConfig$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])((routerConfig) => {
54306            const childModule = routerConfig.module;
54307            const childConfig = routerConfig.routes;
54308            const { segmentGroup: splitSegmentGroup, slicedSegments } = split(rawSegmentGroup, consumedSegments, rawSlicedSegments, childConfig);
54309            // See comment on the other call to `split` about why this is necessary.
54310            const segmentGroup = new UrlSegmentGroup(splitSegmentGroup.segments, splitSegmentGroup.children);
54311            if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
54312                const expanded$ = this.expandChildren(childModule, childConfig, segmentGroup);
54313                return expanded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((children) => new UrlSegmentGroup(consumedSegments, children)));
54314            }
54315            if (childConfig.length === 0 && slicedSegments.length === 0) {
54316                return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new UrlSegmentGroup(consumedSegments, {}));
54317            }
54318            const matchedOnOutlet = getOutlet(route) === outlet;
54319            const expanded$ = this.expandSegment(childModule, segmentGroup, childConfig, slicedSegments, matchedOnOutlet ? PRIMARY_OUTLET : outlet, true);
54320            return expanded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((cs) => new UrlSegmentGroup(consumedSegments.concat(cs.segments), cs.children)));
54321        }));
54322    }
54323    getChildConfig(ngModule, route, segments) {
54324        if (route.children) {
54325            // The children belong to the same module
54326            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new LoadedRouterConfig(route.children, ngModule));
54327        }
54328        if (route.loadChildren) {
54329            // lazy children belong to the loaded module
54330            if (route._loadedConfig !== undefined) {
54331                return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(route._loadedConfig);
54332            }
54333            return this.runCanLoadGuards(ngModule.injector, route, segments)
54334                .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])((shouldLoadResult) => {
54335                if (shouldLoadResult) {
54336                    return this.configLoader.load(ngModule.injector, route)
54337                        .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((cfg) => {
54338                        route._loadedConfig = cfg;
54339                        return cfg;
54340                    }));
54341                }
54342                return canLoadFails(route);
54343            }));
54344        }
54345        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(new LoadedRouterConfig([], ngModule));
54346    }
54347    runCanLoadGuards(moduleInjector, route, segments) {
54348        const canLoad = route.canLoad;
54349        if (!canLoad || canLoad.length === 0)
54350            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
54351        const canLoadObservables = canLoad.map((injectionToken) => {
54352            const guard = moduleInjector.get(injectionToken);
54353            let guardVal;
54354            if (isCanLoad(guard)) {
54355                guardVal = guard.canLoad(route, segments);
54356            }
54357            else if (isFunction(guard)) {
54358                guardVal = guard(route, segments);
54359            }
54360            else {
54361                throw new Error('Invalid CanLoad guard');
54362            }
54363            return wrapIntoObservable(guardVal);
54364        });
54365        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(canLoadObservables)
54366            .pipe(prioritizedGuardValue(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])((result) => {
54367            if (!isUrlTree(result))
54368                return;
54369            const error = navigationCancelingError(`Redirecting to "${this.urlSerializer.serialize(result)}"`);
54370            error.url = result;
54371            throw error;
54372        }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(result => result === true));
54373    }
54374    lineralizeSegments(route, urlTree) {
54375        let res = [];
54376        let c = urlTree.root;
54377        while (true) {
54378            res = res.concat(c.segments);
54379            if (c.numberOfChildren === 0) {
54380                return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(res);
54381            }
54382            if (c.numberOfChildren > 1 || !c.children[PRIMARY_OUTLET]) {
54383                return namedOutletsRedirect(route.redirectTo);
54384            }
54385            c = c.children[PRIMARY_OUTLET];
54386        }
54387    }
54388    applyRedirectCommands(segments, redirectTo, posParams) {
54389        return this.applyRedirectCreatreUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);
54390    }
54391    applyRedirectCreatreUrlTree(redirectTo, urlTree, segments, posParams) {
54392        const newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);
54393        return new UrlTree(newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams), urlTree.fragment);
54394    }
54395    createQueryParams(redirectToParams, actualParams) {
54396        const res = {};
54397        forEach(redirectToParams, (v, k) => {
54398            const copySourceValue = typeof v === 'string' && v.startsWith(':');
54399            if (copySourceValue) {
54400                const sourceName = v.substring(1);
54401                res[k] = actualParams[sourceName];
54402            }
54403            else {
54404                res[k] = v;
54405            }
54406        });
54407        return res;
54408    }
54409    createSegmentGroup(redirectTo, group, segments, posParams) {
54410        const updatedSegments = this.createSegments(redirectTo, group.segments, segments, posParams);
54411        let children = {};
54412        forEach(group.children, (child, name) => {
54413            children[name] = this.createSegmentGroup(redirectTo, child, segments, posParams);
54414        });
54415        return new UrlSegmentGroup(updatedSegments, children);
54416    }
54417    createSegments(redirectTo, redirectToSegments, actualSegments, posParams) {
54418        return redirectToSegments.map(s => s.path.startsWith(':') ? this.findPosParam(redirectTo, s, posParams) :
54419            this.findOrReturn(s, actualSegments));
54420    }
54421    findPosParam(redirectTo, redirectToUrlSegment, posParams) {
54422        const pos = posParams[redirectToUrlSegment.path.substring(1)];
54423        if (!pos)
54424            throw new Error(`Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`);
54425        return pos;
54426    }
54427    findOrReturn(redirectToUrlSegment, actualSegments) {
54428        let idx = 0;
54429        for (const s of actualSegments) {
54430            if (s.path === redirectToUrlSegment.path) {
54431                actualSegments.splice(idx);
54432                return s;
54433            }
54434            idx++;
54435        }
54436        return redirectToUrlSegment;
54437    }
54438}
54439/**
54440 * When possible, merges the primary outlet child into the parent `UrlSegmentGroup`.
54441 *
54442 * When a segment group has only one child which is a primary outlet, merges that child into the
54443 * parent. That is, the child segment group's segments are merged into the `s` and the child's
54444 * children become the children of `s`. Think of this like a 'squash', merging the child segment
54445 * group into the parent.
54446 */
54447function mergeTrivialChildren(s) {
54448    if (s.numberOfChildren === 1 && s.children[PRIMARY_OUTLET]) {
54449        const c = s.children[PRIMARY_OUTLET];
54450        return new UrlSegmentGroup(s.segments.concat(c.segments), c.children);
54451    }
54452    return s;
54453}
54454/**
54455 * Recursively merges primary segment children into their parents and also drops empty children
54456 * (those which have no segments and no children themselves). The latter prevents serializing a
54457 * group into something like `/a(aux:)`, where `aux` is an empty child segment.
54458 */
54459function squashSegmentGroup(segmentGroup) {
54460    const newChildren = {};
54461    for (const childOutlet of Object.keys(segmentGroup.children)) {
54462        const child = segmentGroup.children[childOutlet];
54463        const childCandidate = squashSegmentGroup(child);
54464        // don't add empty children
54465        if (childCandidate.segments.length > 0 || childCandidate.hasChildren()) {
54466            newChildren[childOutlet] = childCandidate;
54467        }
54468    }
54469    const s = new UrlSegmentGroup(segmentGroup.segments, newChildren);
54470    return mergeTrivialChildren(s);
54471}
54472
54473/**
54474 * @license
54475 * Copyright Google LLC All Rights Reserved.
54476 *
54477 * Use of this source code is governed by an MIT-style license that can be
54478 * found in the LICENSE file at https://angular.io/license
54479 */
54480function applyRedirects$1(moduleInjector, configLoader, urlSerializer, config) {
54481    return Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["switchMap"])(t => applyRedirects(moduleInjector, configLoader, urlSerializer, t.extractedUrl, config)
54482        .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(urlAfterRedirects => (Object.assign(Object.assign({}, t), { urlAfterRedirects })))));
54483}
54484
54485/**
54486 * @license
54487 * Copyright Google LLC All Rights Reserved.
54488 *
54489 * Use of this source code is governed by an MIT-style license that can be
54490 * found in the LICENSE file at https://angular.io/license
54491 */
54492class CanActivate {
54493    constructor(path) {
54494        this.path = path;
54495        this.route = this.path[this.path.length - 1];
54496    }
54497}
54498class CanDeactivate {
54499    constructor(component, route) {
54500        this.component = component;
54501        this.route = route;
54502    }
54503}
54504function getAllRouteGuards(future, curr, parentContexts) {
54505    const futureRoot = future._root;
54506    const currRoot = curr ? curr._root : null;
54507    return getChildRouteGuards(futureRoot, currRoot, parentContexts, [futureRoot.value]);
54508}
54509function getCanActivateChild(p) {
54510    const canActivateChild = p.routeConfig ? p.routeConfig.canActivateChild : null;
54511    if (!canActivateChild || canActivateChild.length === 0)
54512        return null;
54513    return { node: p, guards: canActivateChild };
54514}
54515function getToken(token, snapshot, moduleInjector) {
54516    const config = getClosestLoadedConfig(snapshot);
54517    const injector = config ? config.module.injector : moduleInjector;
54518    return injector.get(token);
54519}
54520function getClosestLoadedConfig(snapshot) {
54521    if (!snapshot)
54522        return null;
54523    for (let s = snapshot.parent; s; s = s.parent) {
54524        const route = s.routeConfig;
54525        if (route && route._loadedConfig)
54526            return route._loadedConfig;
54527    }
54528    return null;
54529}
54530function getChildRouteGuards(futureNode, currNode, contexts, futurePath, checks = {
54531    canDeactivateChecks: [],
54532    canActivateChecks: []
54533}) {
54534    const prevChildren = nodeChildrenAsMap(currNode);
54535    // Process the children of the future route
54536    futureNode.children.forEach(c => {
54537        getRouteGuards(c, prevChildren[c.value.outlet], contexts, futurePath.concat([c.value]), checks);
54538        delete prevChildren[c.value.outlet];
54539    });
54540    // Process any children left from the current route (not active for the future route)
54541    forEach(prevChildren, (v, k) => deactivateRouteAndItsChildren(v, contexts.getContext(k), checks));
54542    return checks;
54543}
54544function getRouteGuards(futureNode, currNode, parentContexts, futurePath, checks = {
54545    canDeactivateChecks: [],
54546    canActivateChecks: []
54547}) {
54548    const future = futureNode.value;
54549    const curr = currNode ? currNode.value : null;
54550    const context = parentContexts ? parentContexts.getContext(futureNode.value.outlet) : null;
54551    // reusing the node
54552    if (curr && future.routeConfig === curr.routeConfig) {
54553        const shouldRun = shouldRunGuardsAndResolvers(curr, future, future.routeConfig.runGuardsAndResolvers);
54554        if (shouldRun) {
54555            checks.canActivateChecks.push(new CanActivate(futurePath));
54556        }
54557        else {
54558            // we need to set the data
54559            future.data = curr.data;
54560            future._resolvedData = curr._resolvedData;
54561        }
54562        // If we have a component, we need to go through an outlet.
54563        if (future.component) {
54564            getChildRouteGuards(futureNode, currNode, context ? context.children : null, futurePath, checks);
54565            // if we have a componentless route, we recurse but keep the same outlet map.
54566        }
54567        else {
54568            getChildRouteGuards(futureNode, currNode, parentContexts, futurePath, checks);
54569        }
54570        if (shouldRun && context && context.outlet && context.outlet.isActivated) {
54571            checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, curr));
54572        }
54573    }
54574    else {
54575        if (curr) {
54576            deactivateRouteAndItsChildren(currNode, context, checks);
54577        }
54578        checks.canActivateChecks.push(new CanActivate(futurePath));
54579        // If we have a component, we need to go through an outlet.
54580        if (future.component) {
54581            getChildRouteGuards(futureNode, null, context ? context.children : null, futurePath, checks);
54582            // if we have a componentless route, we recurse but keep the same outlet map.
54583        }
54584        else {
54585            getChildRouteGuards(futureNode, null, parentContexts, futurePath, checks);
54586        }
54587    }
54588    return checks;
54589}
54590function shouldRunGuardsAndResolvers(curr, future, mode) {
54591    if (typeof mode === 'function') {
54592        return mode(curr, future);
54593    }
54594    switch (mode) {
54595        case 'pathParamsChange':
54596            return !equalPath(curr.url, future.url);
54597        case 'pathParamsOrQueryParamsChange':
54598            return !equalPath(curr.url, future.url) ||
54599                !shallowEqual(curr.queryParams, future.queryParams);
54600        case 'always':
54601            return true;
54602        case 'paramsOrQueryParamsChange':
54603            return !equalParamsAndUrlSegments(curr, future) ||
54604                !shallowEqual(curr.queryParams, future.queryParams);
54605        case 'paramsChange':
54606        default:
54607            return !equalParamsAndUrlSegments(curr, future);
54608    }
54609}
54610function deactivateRouteAndItsChildren(route, context, checks) {
54611    const children = nodeChildrenAsMap(route);
54612    const r = route.value;
54613    forEach(children, (node, childName) => {
54614        if (!r.component) {
54615            deactivateRouteAndItsChildren(node, context, checks);
54616        }
54617        else if (context) {
54618            deactivateRouteAndItsChildren(node, context.children.getContext(childName), checks);
54619        }
54620        else {
54621            deactivateRouteAndItsChildren(node, null, checks);
54622        }
54623    });
54624    if (!r.component) {
54625        checks.canDeactivateChecks.push(new CanDeactivate(null, r));
54626    }
54627    else if (context && context.outlet && context.outlet.isActivated) {
54628        checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, r));
54629    }
54630    else {
54631        checks.canDeactivateChecks.push(new CanDeactivate(null, r));
54632    }
54633}
54634
54635/**
54636 * @license
54637 * Copyright Google LLC All Rights Reserved.
54638 *
54639 * Use of this source code is governed by an MIT-style license that can be
54640 * found in the LICENSE file at https://angular.io/license
54641 */
54642function checkGuards(moduleInjector, forwardEvent) {
54643    return Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(t => {
54644        const { targetSnapshot, currentSnapshot, guards: { canActivateChecks, canDeactivateChecks } } = t;
54645        if (canDeactivateChecks.length === 0 && canActivateChecks.length === 0) {
54646            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(Object.assign(Object.assign({}, t), { guardsResult: true }));
54647        }
54648        return runCanDeactivateChecks(canDeactivateChecks, targetSnapshot, currentSnapshot, moduleInjector)
54649            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(canDeactivate => {
54650            return canDeactivate && isBoolean(canDeactivate) ?
54651                runCanActivateChecks(targetSnapshot, canActivateChecks, moduleInjector, forwardEvent) :
54652                Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(canDeactivate);
54653        }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(guardsResult => (Object.assign(Object.assign({}, t), { guardsResult }))));
54654    });
54655}
54656function runCanDeactivateChecks(checks, futureRSS, currRSS, moduleInjector) {
54657    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(checks).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(check => runCanDeactivate(check.component, check.route, currRSS, futureRSS, moduleInjector)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])(result => {
54658        return result !== true;
54659    }, true));
54660}
54661function runCanActivateChecks(futureSnapshot, checks, moduleInjector, forwardEvent) {
54662    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(checks).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])((check) => {
54663        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["concat"])(fireChildActivationStart(check.route.parent, forwardEvent), fireActivationStart(check.route, forwardEvent), runCanActivateChild(futureSnapshot, check.path, moduleInjector), runCanActivate(futureSnapshot, check.route, moduleInjector));
54664    }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])(result => {
54665        return result !== true;
54666    }, true));
54667}
54668/**
54669 * This should fire off `ActivationStart` events for each route being activated at this
54670 * level.
54671 * In other words, if you're activating `a` and `b` below, `path` will c
54671ontain the
54672 * `ActivatedRouteSnapshot`s for both and we will fire `ActivationStart` for both. Always
54673 * return
54674 * `true` so checks continue to run.
54675 */
54676function fireActivationStart(snapshot, forwardEvent) {
54677    if (snapshot !== null && forwardEvent) {
54678        forwardEvent(new ActivationStart(snapshot));
54679    }
54680    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
54681}
54682/**
54683 * This should fire off `ChildActivationStart` events for each route being activated at this
54684 * level.
54685 * In other words, if you're activating `a` and `b` below, `path` will contain the
54686 * `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always
54687 * return
54688 * `true` so checks continue to run.
54689 */
54690function fireChildActivationStart(snapshot, forwardEvent) {
54691    if (snapshot !== null && forwardEvent) {
54692        forwardEvent(new ChildActivationStart(snapshot));
54693    }
54694    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
54695}
54696function runCanActivate(futureRSS, futureARS, moduleInjector) {
54697    const canActivate = futureARS.routeConfig ? futureARS.routeConfig.canActivate : null;
54698    if (!canActivate || canActivate.length === 0)
54699        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
54700    const canActivateObservables = canActivate.map((c) => {
54701        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["defer"])(() => {
54702            const guard = getToken(c, futureARS, moduleInjector);
54703            let observable;
54704            if (isCanActivate(guard)) {
54705                observable = wrapIntoObservable(guard.canActivate(futureARS, futureRSS));
54706            }
54707            else if (isFunction(guard)) {
54708                observable = wrapIntoObservable(guard(futureARS, futureRSS));
54709            }
54710            else {
54711                throw new Error('Invalid CanActivate guard');
54712            }
54713            return observable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])());
54714        });
54715    });
54716    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(canActivateObservables).pipe(prioritizedGuardValue());
54717}
54718function runCanActivateChild(futureRSS, path, moduleInjector) {
54719    const futureARS = path[path.length - 1];
54720    const canActivateChildGuards = path.slice(0, path.length - 1)
54721        .reverse()
54722        .map(p => getCanActivateChild(p))
54723        .filter(_ => _ !== null);
54724    const canActivateChildGuardsMapped = canActivateChildGuards.map((d) => {
54725        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["defer"])(() => {
54726            const guardsMapped = d.guards.map((c) => {
54727                const guard = getToken(c, d.node, moduleInjector);
54728                let observable;
54729                if (isCanActivateChild(guard)) {
54730                    observable = wrapIntoObservable(guard.canActivateChild(futureARS, futureRSS));
54731                }
54732                else if (isFunction(guard)) {
54733                    observable = wrapIntoObservable(guard(futureARS, futureRSS));
54734                }
54735                else {
54736                    throw new Error('Invalid CanActivateChild guard');
54737                }
54738                return observable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])());
54739            });
54740            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(guardsMapped).pipe(prioritizedGuardValue());
54741        });
54742    });
54743    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(canActivateChildGuardsMapped).pipe(prioritizedGuardValue());
54744}
54745function runCanDeactivate(component, currARS, currRSS, futureRSS, moduleInjector) {
54746    const canDeactivate = currARS && currARS.routeConfig ? currARS.routeConfig.canDeactivate : null;
54747    if (!canDeactivate || canDeactivate.length === 0)
54748        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(true);
54749    const canDeactivateObservables = canDeactivate.map((c) => {
54750        const guard = getToken(c, currARS, moduleInjector);
54751        let observable;
54752        if (isCanDeactivate(guard)) {
54753            observable = wrapIntoObservable(guard.canDeactivate(component, currARS, currRSS, futureRSS));
54754        }
54755        else if (isFunction(guard)) {
54756            observable = wrapIntoObservable(guard(component, currARS, currRSS, futureRSS));
54757        }
54758        else {
54759            throw new Error('Invalid CanDeactivate guard');
54760        }
54761        return observable.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["first"])());
54762    });
54763    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(canDeactivateObservables).pipe(prioritizedGuardValue());
54764}
54765
54766/**
54767 * @license
54768 * Copyright Google LLC All Rights Reserved.
54769 *
54770 * Use of this source code is governed by an MIT-style license that can be
54771 * found in the LICENSE file at https://angular.io/license
54772 */
54773class NoMatch$1 {
54774}
54775function newObservableError(e) {
54776    // TODO(atscott): This pattern is used throughout the router code and can be `throwError` instead.
54777    return new rxjs__WEBPACK_IMPORTED_MODULE_2__["Observable"]((obs) => obs.error(e));
54778}
54779function recognize(rootComponentType, config, urlTree, url, paramsInheritanceStrategy = 'emptyOnly', relativeLinkResolution = 'legacy') {
54780    try {
54781        const result = new Recognizer(rootComponentType, config, urlTree, url, paramsInheritanceStrategy, relativeLinkResolution)
54782            .recognize();
54783        if (result === null) {
54784            return newObservableError(new NoMatch$1());
54785        }
54786        else {
54787            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(result);
54788        }
54789    }
54790    catch (e) {
54791        // Catch the potential error from recognize due to duplicate outlet matches and return as an
54792        // `Observable` error instead.
54793        return newObservableError(e);
54794    }
54795}
54796class Recognizer {
54797    constructor(rootComponentType, config, urlTree, url, paramsInheritanceStrategy, relativeLinkResolution) {
54798        this.rootComponentType = rootComponentType;
54799        this.config = config;
54800        this.urlTree = urlTree;
54801        this.url = url;
54802        this.paramsInheritanceStrategy = paramsInheritanceStrategy;
54803        this.relativeLinkResolution = relativeLinkResolution;
54804    }
54805    recognize() {
54806        const rootSegmentGroup = split(this.urlTree.root, [], [], this.config.filter(c => c.redirectTo === undefined), this.relativeLinkResolution)
54807            .segmentGroup;
54808        const children = this.processSegmentGroup(this.config, rootSegmentGroup, PRIMARY_OUTLET);
54809        if (children === null) {
54810            return null;
54811        }
54812        // Use Object.freeze to prevent readers of the Router state from modifying it outside of a
54813        // navigation, resulting in the router being out of sync with the browser.
54814        const root = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, {}, PRIMARY_OUTLET, this.rootComponentType, null, this.urlTree.root, -1, {});
54815        const rootNode = new TreeNode(root, children);
54816        const routeState = new RouterStateSnapshot(this.url, rootNode);
54817        this.inheritParamsAndData(routeState._root);
54818        return routeState;
54819    }
54820    inheritParamsAndData(routeNode) {
54821        const route = routeNode.value;
54822        const i = inheritedParamsDataResolve(route, this.paramsInheritanceStrategy);
54823        route.params = Object.freeze(i.params);
54824        route.data = Object.freeze(i.data);
54825        routeNode.children.forEach(n => this.inheritParamsAndData(n));
54826    }
54827    processSegmentGroup(config, segmentGroup, outlet) {
54828        if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
54829            return this.processChildren(config, segmentGroup);
54830        }
54831        return this.processSegment(config, segmentGroup, segmentGroup.segments, outlet);
54832    }
54833    /**
54834     * Matches every child outlet in the `segmentGroup` to a `Route` in the config. Returns `null` if
54835     * we cannot find a match for _any_ of the children.
54836     *
54837     * @param config - The `Routes` to match against
54838     * @param segmentGroup - The `UrlSegmentGroup` whose children need to be matched against the
54839     *     config.
54840     */
54841    processChildren(config, segmentGroup) {
54842        const children = [];
54843        for (const childOutlet of Object.keys(segmentGroup.children)) {
54844            const child = segmentGroup.children[childOutlet];
54845            // Sort the config so that routes with outlets that match the one being activated appear
54846            // first, followed by routes for other outlets, which might match if they have an empty path.
54847            const sortedConfig = sortByMatchingOutlets(config, childOutlet);
54848            const outletChildren = this.processSegmentGroup(sortedConfig, child, childOutlet);
54849            if (outletChildren === null) {
54850                // Configs must match all segment children so because we did not find a match for this
54851                // outlet, return `null`.
54852                return null;
54853            }
54854            children.push(...outletChildren);
54855        }
54856        // Because we may have matched two outlets to the same empty path segment, we can have multiple
54857        // activated results for the same outlet. We should merge the children of these results so the
54858        // final return value is only one `TreeNode` per outlet.
54859        const mergedChildren = mergeEmptyPathMatches(children);
54860        if (typeof ngDevMode === 'undefined' || ngDevMode) {
54861            // This should really never happen - we are only taking the first match for each outlet and
54862            // merge the empty path matches.
54863            checkOutletNameUniqueness(mergedChildren);
54864        }
54865        sortActivatedRouteSnapshots(mergedChildren);
54866        return mergedChildren;
54867    }
54868    processSegment(config, segmentGroup, segments, outlet) {
54869        for (const r of config) {
54870            const children = this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);
54871            if (children !== null) {
54872                return children;
54873            }
54874        }
54875        if (noLeftoversInUrl(segmentGroup, segments, outlet)) {
54876            return [];
54877        }
54878        return null;
54879    }
54880    processSegmentAgainstRoute(route, rawSegment, segments, outlet) {
54881        if (route.redirectTo || !isImmediateMatch(route, rawSegment, segments, outlet))
54882            return null;
54883        let snapshot;
54884        let consumedSegments = [];
54885        let rawSlicedSegments = [];
54886        if (route.path === '**') {
54887            const params = segments.length > 0 ? last(segments).parameters : {};
54888            snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));
54889        }
54890        else {
54891            const result = match(rawSegment, route, segments);
54892            if (!result.matched) {
54893                return null;
54894            }
54895            consumedSegments = result.consumedSegments;
54896            rawSlicedSegments = segments.slice(result.lastChild);
54897            snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));
54898        }
54899        const childConfig = getChildConfig(route);
54900        const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments, rawSlicedSegments, 
54901        // Filter out routes with redirectTo because we are trying to create activated route
54902        // snapshots and don't handle redirects here. That should have been done in
54903        // `applyRedirects`.
54904        childConfig.filter(c => c.redirectTo === undefined), this.relativeLinkResolution);
54905        if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
54906            const children = this.processChildren(childConfig, segmentGroup);
54907            if (children === null) {
54908                return null;
54909            }
54910            return [new TreeNode(snapshot, children)];
54911        }
54912        if (childConfig.length === 0 && slicedSegments.length === 0) {
54913            return [new TreeNode(snapshot, [])];
54914        }
54915        const matchedOnOutlet = getOutlet(route) === outlet;
54916        // If we matched a config due to empty path match on a different outlet, we need to continue
54917        // passing the current outlet for the segment rather than switch to PRIMARY.
54918        // Note that we switch to primary when we have a match because outlet configs look like this:
54919        // {path: 'a', outlet: 'a', children: [
54920        //  {path: 'b', component: B},
54921        //  {path: 'c', component: C},
54922        // ]}
54923        // Notice that the children of the named outlet are configured with the primary outlet
54924        const children = this.processSegment(childConfig, segmentGroup, slicedSegments, matchedOnOutlet ? PRIMARY_OUTLET : outlet);
54925        if (children === null) {
54926            return null;
54927        }
54928        return [new TreeNode(snapshot, children)];
54929    }
54930}
54931function sortActivatedRouteSnapshots(nodes) {
54932    nodes.sort((a, b) => {
54933        if (a.value.outlet === PRIMARY_OUTLET)
54934            return -1;
54935        if (b.value.outlet === PRIMARY_OUTLET)
54936            return 1;
54937        return a.value.outlet.localeCompare(b.value.outlet);
54938    });
54939}
54940function getChildConfig(route) {
54941    if (route.children) {
54942        return route.children;
54943    }
54944    if (route.loadChildren) {
54945        return route._loadedConfig.routes;
54946    }
54947    return [];
54948}
54949function hasEmptyPathConfig(node) {
54950    const config = node.value.routeConfig;
54951    return config && config.path === '' && config.redirectTo === undefined;
54952}
54953/**
54954 * Finds `TreeNode`s with matching empty path route configs and merges them into `TreeNode` with the
54955 * children from each duplicate. This is necessary because different outlets can match a single
54956 * empty path route config and the results need to then be merged.
54957 */
54958function mergeEmptyPathMatches(nodes) {
54959    const result = [];
54960    // The set of nodes which contain children that were merged from two duplicate empty path nodes.
54961    const mergedNodes = new Set();
54962    for (const node of nodes) {
54963        if (!hasEmptyPathConfig(node)) {
54964            result.push(node);
54965            continue;
54966        }
54967        const duplicateEmptyPathNode = result.find(resultNode => node.value.routeConfig === resultNode.value.routeConfig);
54968        if (duplicateEmptyPathNode !== undefined) {
54969            duplicateEmptyPathNode.children.push(...node.children);
54970            mergedNodes.add(duplicateEmptyPathNode);
54971        }
54972        else {
54973            result.push(node);
54974        }
54975    }
54976    // For each node which has children from multiple sources, we need to recompute a new `TreeNode`
54977    // by also merging those children. This is necessary when there are multiple empty path configs in
54978    // a row. Put another way: whenever we combine children of two nodes, we need to also check if any
54979    // of those children can be combined into a single node as well.
54980    for (const mergedNode of mergedNodes) {
54981        const mergedChildren = mergeEmptyPathMatches(mergedNode.children);
54982        result.push(new TreeNode(mergedNode.value, mergedChildren));
54983    }
54984    return result.filter(n => !mergedNodes.has(n));
54985}
54986function checkOutletNameUniqueness(nodes) {
54987    const names = {};
54988    nodes.forEach(n => {
54989        const routeWithSameOutletName = names[n.value.outlet];
54990        if (routeWithSameOutletName) {
54991            const p = routeWithSameOutletName.url.map(s => s.toString()).join('/');
54992            const c = n.value.url.map(s => s.toString()).join('/');
54993            throw new Error(`Two segments cannot have the same outlet name: '${p}' and '${c}'.`);
54994        }
54995        names[n.value.outlet] = n.value;
54996    });
54997}
54998function getSourceSegmentGroup(segmentGroup) {
54999    let s = segmentGroup;
55000    while (s._sourceSegment) {
55001        s = s._sourceSegment;
55002    }
55003    return s;
55004}
55005function getPathIndexShift(segmentGroup) {
55006    let s = segmentGroup;
55007    let res = (s._segmentIndexShift ? s._segmentIndexShift : 0);
55008    while (s._sourceSegment) {
55009        s = s._sourceSegment;
55010        res += (s._segmentIndexShift ? s._segmentIndexShift : 0);
55011    }
55012    return res - 1;
55013}
55014function getData(route) {
55015    return route.data || {};
55016}
55017function getResolve(route) {
55018    return route.resolve || {};
55019}
55020
55021/**
55022 * @license
55023 * Copyright Google LLC All Rights Reserved.
55024 *
55025 * Use of this source code is governed by an MIT-style license that can be
55026 * found in the LICENSE file at https://angular.io/license
55027 */
55028function recognize$1(rootComponentType, config, serializer, paramsInheritanceStrategy, relativeLinkResolution) {
55029    return Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(t => recognize(rootComponentType, config, t.urlAfterRedirects, serializer(t.urlAfterRedirects), paramsInheritanceStrategy, relativeLinkResolution)
55030        .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(targetSnapshot => (Object.assign(Object.assign({}, t), { targetSnapshot })))));
55031}
55032
55033/**
55034 * @license
55035 * Copyright Google LLC All Rights Reserved.
55036 *
55037 * Use of this source code is governed by an MIT-style license that can be
55038 * found in the LICENSE file at https://angular.io/license
55039 */
55040function resolveData(paramsInheritanceStrategy, moduleInjector) {
55041    return Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(t => {
55042        const { targetSnapshot, guards: { canActivateChecks } } = t;
55043        if (!canActivateChecks.length) {
55044            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(t);
55045        }
55046        let canActivateChecksResolved = 0;
55047        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(canActivateChecks)
55048            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])(check => runResolve(check.route, targetSnapshot, paramsInheritanceStrategy, moduleInjector)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])(() => canActivateChecksResolved++), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeLast"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(_ => canActivateChecksResolved === canActivateChecks.length ? Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(t) : rxjs__WEBPACK_IMPORTED_MODULE_2__["
55048EMPTY"]));
55049    });
55050}
55051function runResolve(futureARS, futureRSS, paramsInheritanceStrategy, moduleInjector) {
55052    const resolve = futureARS._resolve;
55053    return resolveNode(resolve, futureARS, futureRSS, moduleInjector)
55054        .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((resolvedData) => {
55055        futureARS._resolvedData = resolvedData;
55056        futureARS.data = Object.assign(Object.assign({}, futureARS.data), inheritedParamsDataResolve(futureARS, paramsInheritanceStrategy).resolve);
55057        return null;
55058    }));
55059}
55060function resolveNode(resolve, futureARS, futureRSS, moduleInjector) {
55061    const keys = Object.keys(resolve);
55062    if (keys.length === 0) {
55063        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])({});
55064    }
55065    const data = {};
55066    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(keys).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])((key) => getResolver(resolve[key], futureARS, futureRSS, moduleInjector)
55067        .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])((value) => {
55068        data[key] = value;
55069    }))), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeLast"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])(() => {
55070        // Ensure all resolvers returned values, otherwise don't emit any "next" and just complete
55071        // the chain which will cancel navigation
55072        if (Object.keys(data).length === keys.length) {
55073            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(data);
55074        }
55075        return rxjs__WEBPACK_IMPORTED_MODULE_2__["EMPTY"];
55076    }));
55077}
55078function getResolver(injectionToken, futureARS, futureRSS, moduleInjector) {
55079    const resolver = getToken(injectionToken, futureARS, moduleInjector);
55080    return resolver.resolve ? wrapIntoObservable(resolver.resolve(futureARS, futureRSS)) :
55081        wrapIntoObservable(resolver(futureARS, futureRSS));
55082}
55083
55084/**
55085 * @license
55086 * Copyright Google LLC All Rights Reserved.
55087 *
55088 * Use of this source code is governed by an MIT-style license that can be
55089 * found in the LICENSE file at https://angular.io/license
55090 */
55091/**
55092 * Perform a side effect through a switchMap for every emission on the source Observable,
55093 * but return an Observable that is identical to the source. It's essentially the same as
55094 * the `tap` operator, but if the side effectful `next` function returns an ObservableInput,
55095 * it will wait before continuing with the original value.
55096 */
55097function switchTap(next) {
55098    return Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["switchMap"])(v => {
55099        const nextResult = next(v);
55100        if (nextResult) {
55101            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(nextResult).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(() => v));
55102        }
55103        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(v);
55104    });
55105}
55106
55107/**
55108 * @license
55109 * Copyright Google LLC All Rights Reserved.
55110 *
55111 * Use of this source code is governed by an MIT-style license that can be
55112 * found in the LICENSE file at https://angular.io/license
55113 */
55114/**
55115 * @description
55116 *
55117 * Provides a way to customize when activated routes get reused.
55118 *
55119 * @publicApi
55120 */
55121class RouteReuseStrategy {
55122}
55123/**
55124 * @description
55125 *
55126 * This base route reuse strategy only reuses routes when the matched router configs are
55127 * identical. This prevents components from being destroyed and recreated
55128 * when just the fragment or query parameters change
55129 * (that is, the existing component is _reused_).
55130 *
55131 * This strategy does not store any routes for later reuse.
55132 *
55133 * Angular uses this strategy by default.
55134 *
55135 *
55136 * It can be used as a base class for custom route reuse strategies, i.e. you can create your own
55137 * class that extends the `BaseRouteReuseStrategy` one.
55138 * @publicApi
55139 */
55140class BaseRouteReuseStrategy {
55141    /**
55142     * Whether the given route should detach for later reuse.
55143     * Always returns false for `BaseRouteReuseStrategy`.
55144     * */
55145    shouldDetach(route) {
55146        return false;
55147    }
55148    /**
55149     * A no-op; the route is never stored since this strategy never detaches routes for later re-use.
55150     */
55151    store(route, detachedTree) { }
55152    /** Returns `false`, meaning the route (and its subtree) is never reattached */
55153    shouldAttach(route) {
55154        return false;
55155    }
55156    /** Returns `null` because this strategy does not store routes for later re-use. */
55157    retrieve(route) {
55158        return null;
55159    }
55160    /**
55161     * Determines if a route should be reused.
55162     * This strategy returns `true` when the future route config and current route config are
55163     * identical.
55164     */
55165    shouldReuseRoute(future, curr) {
55166        return future.routeConfig === curr.routeConfig;
55167    }
55168}
55169class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
55170}
55171
55172/**
55173 * @license
55174 * Copyright Google LLC All Rights Reserved.
55175 *
55176 * Use of this source code is governed by an MIT-style license that can be
55177 * found in the LICENSE file at https://angular.io/license
55178 */
55179/**
55180 * The [DI token](guide/glossary/#di-token) for a router configuration.
55181 * @see `ROUTES`
55182 * @publicApi
55183 */
55184const ROUTES = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('ROUTES');
55185class RouterConfigLoader {
55186    constructor(loader, compiler, onLoadStartListener, onLoadEndListener) {
55187        this.loader = loader;
55188        this.compiler = compiler;
55189        this.onLoadStartListener = onLoadStartListener;
55190        this.onLoadEndListener = onLoadEndListener;
55191    }
55192    load(parentInjector, route) {
55193        if (route._loader$) {
55194            return route._loader$;
55195        }
55196        if (this.onLoadStartListener) {
55197            this.onLoadStartListener(route);
55198        }
55199        const moduleFactory$ = this.loadModuleFactory(route.loadChildren);
55200        const loadRunner = moduleFactory$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((factory) => {
55201            if (this.onLoadEndListener) {
55202                this.onLoadEndListener(route);
55203            }
55204            const module = factory.create(parentInjector);
55205            // When loading a module that doesn't provide `RouterModule.forChild()` preloader
55206            // will get stuck in an infinite loop. The child module's Injector will look to
55207            // its parent `Injector` when it doesn't find any ROUTES so it will return routes
55208            // for it's parent module instead.
55209            return new LoadedRouterConfig(flatten(module.injector.get(ROUTES, undefined, _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectFlags"].Self | _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectFlags"].Optional))
55210                .map(standardizeConfig), module);
55211        }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])((err) => {
55212            route._loader$ = undefined;
55213            throw err;
55214        }));
55215        // Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much
55216        route._loader$ = new rxjs__WEBPACK_IMPORTED_MODULE_2__["ConnectableObservable"](loadRunner, () => new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]())
55217            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["refCount"])());
55218        return route._loader$;
55219    }
55220    loadModuleFactory(loadChildren) {
55221        if (typeof loadChildren === 'string') {
55222            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(this.loader.load(loadChildren));
55223        }
55224        else {
55225            return wrapIntoObservable(loadChildren()).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])((t) => {
55226                if (t instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactory"]) {
55227                    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(t);
55228                }
55229                else {
55230                    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(this.compiler.compileModuleAsync(t));
55231                }
55232            }));
55233        }
55234    }
55235}
55236
55237/**
55238 * @license
55239 * Copyright Google LLC All Rights Reserved.
55240 *
55241 * Use of this source code is governed by an MIT-style license that can be
55242 * found in the LICENSE file at https://angular.io/license
55243 */
55244/**
55245 * Store contextual information about a `RouterOutlet`
55246 *
55247 * @publicApi
55248 */
55249class OutletContext {
55250    constructor() {
55251        this.outlet = null;
55252        this.route = null;
55253        this.resolver = null;
55254        this.children = new ChildrenOutletContexts();
55255        this.attachRef = null;
55256    }
55257}
55258/**
55259 * Store contextual information about the children (= nested) `RouterOutlet`
55260 *
55261 * @publicApi
55262 */
55263class ChildrenOutletContexts {
55264    constructor() {
55265        // contexts for child outlets, by name.
55266        this.contexts = new Map();
55267    }
55268    /** Called when a `RouterOutlet` directive is instantiated */
55269    onChildOutletCreated(childName, outlet) {
55270        const context = this.getOrCreateContext(childName);
55271        context.outlet = outlet;
55272        this.contexts.set(childName, context);
55273    }
55274    /**
55275     * Called when a `RouterOutlet` directive is destroyed.
55276     * We need to keep the context as the outlet could be destroyed inside a NgIf and might be
55277     * re-created later.
55278     */
55279    onChildOutletDestroyed(childName) {
55280        const context = this.getContext(childName);
55281        if (context) {
55282            context.outlet = null;
55283        }
55284    }
55285    /**
55286     * Called when the corresponding route is deactivated during navigation.
55287     * Because the component get destroyed, all children outlet are destroyed.
55288     */
55289    onOutletDeactivated() {
55290        const contexts = this.contexts;
55291        this.contexts = new Map();
55292        return contexts;
55293    }
55294    onOutletReAttached(contexts) {
55295        this.contexts = contexts;
55296    }
55297    getOrCreateContext(childName) {
55298        let context = this.getContext(childName);
55299        if (!context) {
55300            context = new OutletContext();
55301            this.contexts.set(childName, context);
55302        }
55303        return context;
55304    }
55305    getContext(childName) {
55306        return this.contexts.get(childName) || null;
55307    }
55308}
55309
55310/**
55311 * @license
55312 * Copyright Google LLC All Rights Reserved.
55313 *
55314 * Use of this source code is governed by an MIT-style license that can be
55315 * found in the LICENSE file at https://angular.io/license
55316 */
55317/**
55318 * @description
55319 *
55320 * Provides a way to migrate AngularJS applications to Angular.
55321 *
55322 * @publicApi
55323 */
55324class UrlHandlingStrategy {
55325}
55326/**
55327 * @publicApi
55328 */
55329class DefaultUrlHandlingStrategy {
55330    shouldProcessUrl(url) {
55331        return true;
55332    }
55333    extract(url) {
55334        return url;
55335    }
55336    merge(newUrlPart, wholeUrl) {
55337        return newUrlPart;
55338    }
55339}
55340
55341/**
55342 * @license
55343 * Copyright Google LLC All Rights Reserved.
55344 *
55345 * Use of this source code is governed by an MIT-style license that can be
55346 * found in the LICENSE file at https://angular.io/license
55347 */
55348function defaultErrorHandler(error) {
55349    throw error;
55350}
55351function defaultMalformedUriErrorHandler(error, urlSerializer, url) {
55352    return urlSerializer.parse('/');
55353}
55354/**
55355 * @internal
55356 */
55357function defaultRouterHook(snapshot, runExtras) {
55358    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
55359}
55360/**
55361 * @description
55362 *
55363 * A service that provides navigation among views and URL manipulation capabilities.
55364 *
55365 * @see `Route`.
55366 * @see [Routing and Navigation Guide](guide/router).
55367 *
55368 * @ngModule RouterModule
55369 *
55370 * @publicApi
55371 */
55372class Router {
55373    /**
55374     * Creates the router service.
55375     */
55376    // TODO: vsavkin make internal after the final is out.
55377    constructor(rootComponentType, urlSerializer, rootContexts, location, injector, loader, compiler, config) {
55378        this.rootComponentType = rootComponentType;
55379        this.urlSerializer = urlSerializer;
55380        this.rootContexts = rootContexts;
55381        this.location = location;
55382        this.config = config;
55383        this.lastSuccessfulNavigation = null;
55384        this.currentNavigation = null;
55385        this.disposed = false;
55386        /**
55387         * Tracks the previously seen location change from the location subscription so we can compare
55388         * the two latest to see if they are duplicates. See setUpLocationChangeListener.
55389         */
55390        this.lastLocationChangeInfo = null;
55391        this.navigationId = 0;
55392        this.isNgZoneEnabled = false;
55393        /**
55394         * An event stream for routing events in this NgModule.
55395         */
55396        this.events = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
55397        /**
55398         * A handler for navigation errors in this NgModule.
55399         */
55400        this.errorHandler = defaultErrorHandler;
55401        /**
55402         * A handler for errors thrown by `Router.parseUrl(url)`
55403         * when `url` contains an invalid character.
55404         * The most common case is a `%` sign
55405         * that's not encoded and is not part of a percent encoded sequence.
55406         */
55407        this.malformedUriErrorHandler = defaultMalformedUriErrorHandler;
55408        /**
55409         * True if at least one navigation event has occurred,
55410         * false otherwise.
55411         */
55412        this.navigated = false;
55413        this.lastSuccessfulId = -1;
55414        /**
55415         * Hooks that enable you to pause navigation,
55416         * either before or after the preactivation phase.
55417         * Used by `RouterModule`.
55418         *
55419         * @internal
55420         */
55421        this.hooks = { beforePreactivation: defaultRouterHook, afterPreactivation: defaultRouterHook };
55422        /**
55423         * A strategy for extracting and merging URLs.
55424         * Used for AngularJS to Angular migrations.
55425         */
55426        this.urlHandlingStrategy = new DefaultUrlHandlingStrategy();
55427        /**
55428         * A strategy for re-using routes.
55429         */
55430        this.routeReuseStrategy = new DefaultRouteReuseStrategy();
55431        /**
55432         * How to handle a navigation request to the current URL. One of:
55433         * - `'ignore'` :  The router ignores the request.
55434         * - `'reload'` : The router reloads the URL. Use to implement a "refresh" feature.
55435         */
55436        this.onSameUrlNavigation = 'ignore';
55437        /**
55438         * How to merge parameters, data, and resolved data from parent to child
55439         * routes. One of:
55440         *
55441         * - `'emptyOnly'` : Inherit parent parameters, data, and resolved data
55442         * for path-less or component-less routes.
55443         * - `'always'` : Inherit parent parameters, data, and resolved data
55444         * for all child routes.
55445         */
55446        this.paramsInheritanceStrategy = 'emptyOnly';
55447        /**
55448         * Determines when the router updates the browser URL.
55449         * By default (`"deferred"`), updates the browser URL after navigation has finished.
55450         * Set to `'eager'` to update the browser URL at the beginning of navigation.
55451         * You can choose to update early so that, if navigation fails,
55452         * you can show an error message with the URL that failed.
55453         */
55454        this.urlUpdateStrategy = 'deferred';
55455        /**
55456         * Enables a bug fix that corrects relative link resolution in components with empty paths.
55457         * @see `RouterModule`
55458         */
55459        this.relativeLinkResolution = 'corrected';
55460        const onLoadStart = (r) => this.triggerEvent(new RouteConfigLoadStart(r));
55461        const onLoadEnd = (r) => this.triggerEvent(new RouteConfigLoadEnd(r));
55462        this.ngModule = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleRef"]);
55463        this.console = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"]);
55464        const ngZone = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"]);
55465        this.isNgZoneEnabled = ngZone instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"] && _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"].isInAngularZone();
55466        this.resetConfig(config);
55467        this.currentUrlTree = createEmptyUrlTree();
55468        this.rawUrlTree = this.currentUrlTree;
55469        this.browserUrlTree = this.currentUrlTree;
55470        this.configLoader = new RouterConfigLoader(loader, compiler, onLoadStart, onLoadEnd);
55471        this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);
55472        this.transitions = new rxjs__WEBPACK_IMPORTED_MODULE_2__["BehaviorSubject"]({
55473            id: 0,
55474            currentUrlTree: this.currentUrlTree,
55475            currentRawUrl: this.currentUrlTree,
55476            extractedUrl: this.urlHandlingStrategy.extract(this.currentUrlTree),
55477            urlAfterRedirects: this.urlHandlingStrategy.extract(this.currentUrlTree),
55478            rawUrl: this.currentUrlTree,
55479            extras: {},
55480            resolve: null,
55481            reject: null,
55482            promise: Promise.resolve(true),
55483            source: 'imperative',
55484            restoredState: null,
55485            currentSnapshot: this.routerState.snapshot,
55486            targetSnapshot: null,
55487            currentRouterState: this.routerState,
55488            targetRouterState: null,
55489            guards: { canActivateChecks: [], canDeactivateChecks: [] },
55490            guardsResult: null,
55491        });
55492        this.navigations = this.setupNavigations(this.transitions);
55493        this.processNavigations();
55494    }
55495    setupNavigations(transitions) {
55496        const eventsSubject = this.events;
55497        return transitions.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(t => t.id !== 0), 
55498        // Extract URL
55499        Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(t => (Object.assign(Object.assign({}, t), { extractedUrl: this.urlHandlingStrategy.extract(t.rawUrl) }))), 
55500        // Using switchMap so we cancel executing navigations when a new one comes in
55501        Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["switchMap"])(t => {
55502            let completed = false;
55503            let errored = false;
55504            return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(t).pipe(
55505            // Store the Navigation object
55506            Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])(t => {
55507                this.currentNavigation = {
55508                    id: t.id,
55509                    initialUrl: t.currentRawUrl,
55510                    extractedUrl: t.extractedUrl,
55511                    trigger: t.source,
55512                    extras: t.extras,
55513                    previousNavigation: this.lastSuccessfulNavigation ? Object.assign(Object.assign({}, this.lastSuccessfulNavigation), { previousNavigation: null }) :
55514                        null
55515                };
55516            }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["switchMap"])(t => {
55517                const urlTransition = !this.navigated ||
55518                    t.extractedUrl.toString() !== this.browserUrlTree.toString();
55519                const processCurrentUrl = (this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&
55520                    this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);
55521                if (processCurrentUrl) {
55522                    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(t).pipe(
55523                    // Fire NavigationStart event
55524                    Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["switchMap"])(t => {
55525                        const transition = this.transitions.getValue();
55526                        eventsSubject.next(new NavigationStart(t.id, this.serializeUrl(t.extractedUrl), t.source, t.restoredState));
55527                        if (transition !== this.transitions.getValue()) {
55528                            return rxjs__WEBPACK_IMPORTED_MODULE_2__["EMPTY"];
55529                        }
55530                        // This delay is required to match old behavior that forced
55531                        // navigation to always be async
55532                        return Promise.resolve(t);
55533                    }), 
55534                    // ApplyRedirects
55535                    applyRedirects$1(this.ngModule.injector, this.configLoader, this.urlSerializer, this.config), 
55536                    // Update the currentNavigation
55537                    Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])(t => {
55538                        this.currentNavigation = Object.assign(Object.assign({}, this.currentNavigation), { finalUrl: t.urlAfterRedirects });
55539                    }), 
55540                    // Recognize
55541                    recognize$1(this.rootComponentType, this.config, (url) => this.serializeUrl(url), this.paramsInheritanceStrategy, this.relativeLinkResolution), 
55542                    // Update URL if in `eager` update mode
55543                    Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])(t => {
55544                        if (this.urlUpdateStrategy === 'eager') {
55545                            if (!t.extras.skipLocationChange) {
55546                                this.setBrowserUrl(t.urlAfterRedirects, !!t.extras.replaceUrl, t.id, t.extras.state);
55547                            }
55548                            this.browserUrlTree = t.urlAfterRedirects;
55549                        }
55550                        // Fire RoutesRecognized
55551                        const routesRecognized = new RoutesRecognized(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);
55552                        eventsSubject.next(routesRecognized);
55553                    }));
55554                }
55555                else {
55556                    const processPreviousUrl = urlTransition && this.rawUrlTree &&
55557                        this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree);
55558                    /* When the current URL shouldn't be processed, but the previous one was,
55559                     * we handle this "error condition" by navigating to the previously
55560                     * successful URL, but leaving the URL intact.*/
55561                    if (processPreviousUrl) {
55562                        const { id, extractedUrl, source, restoredState, extras } = t;
55563                        const navStart = new NavigationStart(id, this.serializeUrl(extractedUrl), source, restoredState);
55564                        eventsSubject.next(navStart);
55565                        const targetSnapshot = createEmptyState(extractedUrl, this.rootComponentType).snapshot;
55566                        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(Object.assign(Object.assign({}, t), { targetSnapshot, urlAfterRedirects: extractedUrl, extras: Object.assign(Object.assign({}, extras), { skipLocationChange: false, replaceUrl: false }) }));
55567                    }
55568                    else {
55569                        /* When neither the current or previous URL can be processed, do nothing
55570                         * other than update router's internal reference to the current "settled"
55571                         * URL. This way the next navigation will be coming from the current URL
55572                         * in the browser.
55573                         */
55574                        this.rawUrlTree = t.rawUrl;
55575                        this.browserUrlTree = t.urlAfterRedirects;
55576                        t.resolve(null);
55577                        return rxjs__WEBPACK_IMPORTED_MODULE_2__["
55577EMPTY"];
55578                    }
55579                }
55580            }), 
55581            // Before Preactivation
55582            switchTap(t => {
55583                const { targetSnapshot, id: navigationId, extractedUrl: appliedUrlTree, rawUrl: rawUrlTree, extras: { skipLocationChange, replaceUrl } } = t;
55584                return this.hooks.beforePreactivation(targetSnapshot, {
55585                    navigationId,
55586                    appliedUrlTree,
55587                    rawUrlTree,
55588                    skipLocationChange: !!skipLocationChange,
55589                    replaceUrl: !!replaceUrl,
55590                });
55591            }), 
55592            // --- GUARDS ---
55593            Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])(t => {
55594                const guardsStart = new GuardsCheckStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);
55595                this.triggerEvent(guardsStart);
55596            }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])(t => (Object.assign(Object.assign({}, t), { guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.rootContexts) }))), checkGuards(this.ngModule.injector, (evt) => this.triggerEvent(evt)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])(t => {
55597                if (isUrlTree(t.guardsResult)) {
55598                    const error = navigationCancelingError(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);
55599                    error.url = t.guardsResult;
55600                    throw error;
55601                }
55602                const guardsEnd = new GuardsCheckEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot, !!t.guardsResult);
55603                this.triggerEvent(guardsEnd);
55604            }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])(t => {
55605                if (!t.guardsResult) {
55606                    this.resetUrlToCurrentUrlTree();
55607                    const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), '');
55608                    eventsSubject.next(navCancel);
55609                    t.resolve(false);
55610                    return false;
55611                }
55612                return true;
55613            }), 
55614            // --- RESOLVE ---
55615            switchTap(t => {
55616                if (t.guards.canActivateChecks.length) {
55617                    return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(t).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])(t => {
55618                        const resolveStart = new ResolveStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);
55619                        this.triggerEvent(resolveStart);
55620                    }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["switchMap"])(t => {
55621                        let dataResolved = false;
55622                        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(t).pipe(resolveData(this.paramsInheritanceStrategy, this.ngModule.injector), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])({
55623                            next: () => dataResolved = true,
55624                            complete: () => {
55625                                if (!dataResolved) {
55626                                    const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), `At least one route resolver didn't emit any value.`);
55627                                    eventsSubject.next(navCancel);
55628                                    t.resolve(false);
55629                                }
55630                            }
55631                        }));
55632                    }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])(t => {
55633                        const resolveEnd = new ResolveEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot);
55634                        this.triggerEvent(resolveEnd);
55635                    }));
55636                }
55637                return undefined;
55638            }), 
55639            // --- AFTER PREACTIVATION ---
55640            switchTap((t) => {
55641                const { targetSnapshot, id: navigationId, extractedUrl: appliedUrlTree, rawUrl: rawUrlTree, extras: { skipLocationChange, replaceUrl } } = t;
55642                return this.hooks.afterPreactivation(targetSnapshot, {
55643                    navigationId,
55644                    appliedUrlTree,
55645                    rawUrlTree,
55646                    skipLocationChange: !!skipLocationChange,
55647                    replaceUrl: !!replaceUrl,
55648                });
55649            }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((t) => {
55650                const targetRouterState = createRouterState(this.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
55651                return (Object.assign(Object.assign({}, t), { targetRouterState }));
55652            }), 
55653            /* Once here, we are about to activate syncronously. The assumption is this
55654               will succeed, and user code may read from the Router service. Therefore
55655               before activation, we need to update router properties storing the current
55656               URL and the RouterState, as well as updated the browser URL. All this should
55657               happen *before* activating. */
55658            Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])((t) => {
55659                this.currentUrlTree = t.urlAfterRedirects;
55660                this.rawUrlTree =
55661                    this.urlHandlingStrategy.merge(this.currentUrlTree, t.rawUrl);
55662                this.routerState = t.targetRouterState;
55663                if (this.urlUpdateStrategy === 'deferred') {
55664                    if (!t.extras.skipLocationChange) {
55665                        this.setBrowserUrl(this.rawUrlTree, !!t.extras.replaceUrl, t.id, t.extras.state);
55666                    }
55667                    this.browserUrlTree = t.urlAfterRedirects;
55668                }
55669            }), activateRoutes(this.rootContexts, this.routeReuseStrategy, (evt) => this.triggerEvent(evt)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["tap"])({
55670                next() {
55671                    completed = true;
55672                },
55673                complete() {
55674                    completed = true;
55675                }
55676            }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["finalize"])(() => {
55677                /* When the navigation stream finishes either through error or success, we
55678                 * set the `completed` or `errored` flag. However, there are some situations
55679                 * where we could get here without either of those being set. For instance, a
55680                 * redirect during NavigationStart. Therefore, this is a catch-all to make
55681                 * sure the NavigationCancel
55682                 * event is fired when a navigation gets cancelled but not caught by other
55683                 * means. */
55684                if (!completed && !errored) {
55685                    // Must reset to current URL tree here to ensure history.state is set. On a
55686                    // fresh page load, if a new navigation comes in before a successful
55687                    // navigation completes, there will be nothing in
55688                    // history.state.navigationId. This can cause sync problems with AngularJS
55689                    // sync code which looks for a value here in order to determine whether or
55690                    // not to handle a given popstate event or to leave it to the Angular
55691                    // router.
55692                    this.resetUrlToCurrentUrlTree();
55693                    const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), `Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`);
55694                    eventsSubject.next(navCancel);
55695                    t.resolve(false);
55696                }
55697                // currentNavigation should always be reset to null here. If navigation was
55698                // successful, lastSuccessfulTransition will have already been set. Therefore
55699                // we can safely set currentNavigation to null here.
55700                this.currentNavigation = null;
55701            }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])((e) => {
55702                errored = true;
55703                /* This error type is issued during Redirect, and is handled as a
55704                 * cancellation rather than an error. */
55705                if (isNavigationCancelingError(e)) {
55706                    const redirecting = isUrlTree(e.url);
55707                    if (!redirecting) {
55708                        // Set property only if we're not redirecting. If we landed on a page and
55709                        // redirect to `/` route, the new navigation is going to see the `/`
55710                        // isn't a change from the default currentUrlTree and won't navigate.
55711                        // This is only applicable with initial navigation, so setting
55712                        // `navigated` only when not redirecting resolves this scenario.
55713                        this.navigated = true;
55714                        this.resetStateAndUrl(t.currentRouterState, t.currentUrlTree, t.rawUrl);
55715                    }
55716                    const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), e.message);
55717                    eventsSubject.next(navCancel);
55718                    // When redirecting, we need to delay resolving the navigation
55719                    // promise and push it to the redirect navigation
55720                    if (!redirecting) {
55721                        t.resolve(false);
55722                    }
55723                    else {
55724                        // setTimeout is required so this navigation finishes with
55725                        // the return EMPTY below. If it isn't allowed to finish
55726                        // processing, there can be multiple navigations to the same
55727                        // URL.
55728                        setTimeout(() => {
55729                            const mergedTree = this.urlHandlingStrategy.merge(e.url, this.rawUrlTree);
55730                            const extras = {
55731                                skipLocationChange: t.extras.skipLocationChange,
55732                                replaceUrl: this.urlUpdateStrategy === 'eager'
55733                            };
55734                            this.scheduleNavigation(mergedTree, 'imperative', null, extras, { resolve: t.resolve, reject: t.reject, promise: t.promise });
55735                        }, 0);
55736                    }
55737                    /* All other errors should reset to the router's internal URL reference to
55738                     * the pre-error state. */
55739                }
55740                else {
55741                    this.resetStateAndUrl(t.currentRouterState, t.currentUrlTree, t.rawUrl);
55742                    const navError = new NavigationError(t.id, this.serializeUrl(t.extractedUrl), e);
55743                    eventsSubject.next(navError);
55744                    try {
55745                        t.resolve(this.errorHandler(e));
55746                    }
55747                    catch (ee) {
55748                        t.reject(ee);
55749                    }
55750                }
55751                return rxjs__WEBPACK_IMPORTED_MODULE_2__["EMPTY"];
55752            }));
55753            // TODO(jasonaden): remove cast once g3 is on updated TypeScript
55754        }));
55755    }
55756    /**
55757     * @internal
55758     * TODO: this should be removed once the constructor of the router made internal
55759     */
55760    resetRootComponentType(rootComponentType) {
55761        this.rootComponentType = rootComponentType;
55762        // TODO: vsavkin router 4.0 should make the root component set to null
55763        // this will simplify the lifecycle of the router.
55764        this.routerState.root.component = this.rootComponentType;
55765    }
55766    getTransition() {
55767        const transition = this.transitions.value;
55768        // This value needs to be set. Other values such as extractedUrl are set on initial navigation
55769        // but the urlAfterRedirects may not get set if we aren't processing the new URL *and* not
55770        // processing the previous URL.
55771        transition.urlAfterRedirects = this.browserUrlTree;
55772        return transition;
55773    }
55774    setTransition(t) {
55775        this.transitions.next(Object.assign(Object.assign({}, this.getTransition()), t));
55776    }
55777    /**
55778     * Sets up the location change listener and performs the initial navigation.
55779     */
55780    initialNavigation() {
55781        this.setUpLocationChangeListener();
55782        if (this.navigationId === 0) {
55783            this.navigateByUrl(this.location.path(true), { replaceUrl: true });
55784        }
55785    }
55786    /**
55787     * Sets up the location change listener. This listener detects navigations triggered from outside
55788     * the Router (the browser back/forward buttons, for example) and schedules a corresponding Router
55789     * navigation so that the correct events, guards, etc. are triggered.
55790     */
55791    setUpLocationChangeListener() {
55792        // Don't need to use Zone.wrap any more, because zone.js
55793        // already patch onPopState, so location change callback will
55794        // run into ngZone
55795        if (!this.locationSubscription) {
55796            this.locationSubscription = this.location.subscribe(event => {
55797                const currentChange = this.extractLocationChangeInfoFromEvent(event);
55798                if (this.shouldScheduleNavigation(this.lastLocationChangeInfo, currentChange)) {
55799                    // The `setTimeout` was added in #12160 and is likely to support Angular/AngularJS
55800                    // hybrid apps.
55801                    setTimeout(() => {
55802                        const { source, state, urlTree } = currentChange;
55803                        const extras = { replaceUrl: true };
55804                        if (state) {
55805                            const stateCopy = Object.assign({}, state);
55806                            delete stateCopy.navigationId;
55807                            if (Object.keys(stateCopy).length !== 0) {
55808                                extras.state = stateCopy;
55809                            }
55810                        }
55811                        this.scheduleNavigation(urlTree, source, state, extras);
55812                    }, 0);
55813                }
55814                this.lastLocationChangeInfo = currentChange;
55815            });
55816        }
55817    }
55818    /** Extracts router-related information from a `PopStateEvent`. */
55819    extractLocationChangeInfoFromEvent(change) {
55820        var _a;
55821        return {
55822            source: change['type'] === 'popstate' ? 'popstate' : 'hashchange',
55823            urlTree: this.parseUrl(change['url']),
55824            // Navigations coming from Angular router have a navigationId state
55825            // property. When this exists, restore the state.
55826            state: ((_a = change.state) === null || _a === void 0 ? void 0 : _a.navigationId) ? change.state : null,
55827            transitionId: this.getTransition().id
55828        };
55829    }
55830    /**
55831     * Determines whether two events triggered by the Location subscription are due to the same
55832     * navigation. The location subscription can fire two events (popstate and hashchange) for a
55833     * single navigation. The second one should be ignored, that is, we should not schedule another
55834     * navigation in the Router.
55835     */
55836    shouldScheduleNavigation(previous, current) {
55837        if (!previous)
55838            return true;
55839        const sameDestination = current.urlTree.toString() === previous.urlTree.toString();
55840        const eventsOccurredAtSameTime = current.transitionId === previous.transitionId;
55841        if (!eventsOccurredAtSameTime || !sameDestination) {
55842            return true;
55843        }
55844        if ((current.source === 'hashchange' && previous.source === 'popstate') ||
55845            (current.source === 'popstate' && previous.source === 'hashchange')) {
55846            return false;
55847        }
55848        return true;
55849    }
55850    /** The current URL. */
55851    get url() {
55852        return this.serializeUrl(this.currentUrlTree);
55853    }
55854    /**
55855     * Returns the current `Navigation` object when the router is navigating,
55856     * and `null` when idle.
55857     */
55858    getCurrentNavigation() {
55859        return this.currentNavigation;
55860    }
55861    /** @internal */
55862    triggerEvent(event) {
55863        this.events.next(event);
55864    }
55865    /**
55866     * Resets the route configuration used for navigation and generating links.
55867     *
55868     * @param config The route array for the new configuration.
55869     *
55870     * @usageNotes
55871     *
55872     * ```
55873     * router.resetConfig([
55874     *  { path: 'team/:id', component: TeamCmp, children: [
55875     *    { path: 'simple', component: SimpleCmp },
55876     *    { path: 'user/:name', component: UserCmp }
55877     *  ]}
55878     * ]);
55879     * ```
55880     */
55881    resetConfig(config) {
55882        validateConfig(config);
55883        this.config = config.map(standardizeConfig);
55884        this.navigated = false;
55885        this.lastSuccessfulId = -1;
55886    }
55887    /** @nodoc */
55888    ngOnDestroy() {
55889        this.dispose();
55890    }
55891    /** Disposes of the router. */
55892    dispose() {
55893        this.transitions.complete();
55894        if (this.locationSubscription) {
55895            this.locationSubscription.unsubscribe();
55896            this.locationSubscription = undefined;
55897        }
55898        this.disposed = true;
55899    }
55900    /**
55901     * Appends URL segments to the current URL tree to create a new URL tree.
55902     *
55903     * @param commands An array of URL fragments with which to construct the new URL tree.
55904     * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
55905     * segments, followed by the parameters for each segment.
55906     * The fragments are applied to the current URL tree or the one provided  in the `relativeTo`
55907     * property of the options object, if supplied.
55908     * @param navigationExtras Options that control the navigation strategy.
55909     * @returns The new URL tree.
55910     *
55911     * @usageNotes
55912     *
55913     * ```
55914     * // create /team/33/user/11
55915     * router.createUrlTree(['/team', 33, 'user', 11]);
55916     *
55917     * // create /team/33;expand=true/user/11
55918     * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);
55919     *
55920     * // you can collapse static segments like this (this works only with the first passed-in value):
55921     * router.createUrlTree(['/team/33/user', userId]);
55922     *
55923     * // If the first segment can contain slashes, and you do not want the router to split it,
55924     * // you can do the following:
55925     * router.createUrlTree([{segmentPath: '/one/two'}]);
55926     *
55927     * // create /team/33/(user/11//right:chat)
55928     * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);
55929     *
55930     * // remove the right secondary node
55931     * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);
55932     *
55933     * // assuming the current url is `/team/33/user/11` and the route points to `user/11`
55934     *
55935     * // navigate to /team/33/user/11/details
55936     * router.createUrlTree(['details'], {relativeTo: route});
55937     *
55938     * // navigate to /team/33/user/22
55939     * router.createUrlTree(['../22'], {relativeTo: route});
55940     *
55941     * // navigate to /team/44/user/22
55942     * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});
55943     *
55944     * Note that a value of `null` or `undefined` for `relativeTo` indicates that the
55945     * tree should be created relative to the root.
55946     * ```
55947     */
55948    createUrlTree(commands, navigationExtras = {}) {
55949        const { relativeTo, queryParams, fragment, queryParamsHandling, preserveFragment } = navigationExtras;
55950        const a = relativeTo || this.routerState.root;
55951        const f = preserveFragment ? this.currentUrlTree.fragment : fragment;
55952        let q = null;
55953        switch (queryParamsHandling) {
55954            case 'merge':
55955                q = Object.assign(Object.assign({}, this.currentUrlTree.queryParams), queryParams);
55956                break;
55957            case 'preserve':
55958                q = this.currentUrlTree.queryParams;
55959                break;
55960            default:
55961                q = queryParams || null;
55962        }
55963        if (q !== null) {
55964            q = this.removeEmptyProps(q);
55965        }
55966        return createUrlTree(a, this.currentUrlTree, commands, q, f);
55967    }
55968    /**
55969     * Navigates to a view using an absolute route path.
55970     *
55971     * @param url An absolute path for a defined route. The function does not apply any delta to the
55972     *     current URL.
55973     * @param extras An object containing properties that modify the navigation strategy.
55974     *
55975     * @returns A Promise that resolves to 'true' when navigation succeeds,
55976     * to 'false' when navigation fails, or is rejected on error.
55977     *
55978     * @usageNotes
55979     *
55980     * The following calls request navigation to an absolute path.
55981     *
55982     * ```
55983     * router.navigateByUrl("/team/33/user/11");
55984     *
55985     * // Navigate without updating the URL
55986     * router.navigateByUrl("/team/33/user/11", { skipLocationChange: true });
55987     * ```
55988     *
55989     * @see [Routing and Navigation guide](guide/router)
55990     *
55991     */
55992    navigateByUrl(url, extras = {
55993        skipLocationChange: false
55994    }) {
55995        if (typeof ngDevMode === 'undefined' ||
55996            ngDevMode && this.isNgZoneEnabled && !_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgZone"].isInAngularZone()) {
55997            this.console.warn(`Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?`);
55998        }
55999        const urlTree = isUrlTree(url) ? url : this.parseUrl(url);
56000        const mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);
56001        return this.scheduleNavigation(mergedTree, 'imperative', null, extras);
56002    }
56003    /**
56004     * Navigate based on the provided array of commands and a starting point.
56005     * If no starting route is provided, the navigation is absolute.
56006     *
56007     * @param commands An array of URL fragments with which to construct the target URL.
56008     * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
56009     * segments, followed by the parameters for each segment.
56010     * The fragments are applied to the current URL or the one provided  in the `relativeTo` property
56011     * of the options object, if supplied.
56012     * @param extras An options object that determines how the URL should be constructed or
56013     *     interpreted.
56014     *
56015     * @returns A Promise that resolves to `true` when navigation succeeds, to `false` when navigation
56016     *     fails,
56017     * or is rejected on error.
56018     *
56019     * @usageNotes
56020     *
56021     * The following calls request navigation to a dynamic route path relative to the current URL.
56022     *
56023     * ```
56024     * router.navigate(['team', 33, 'user', 11], {relativeTo: route});
56025     *
56026     * // Navigate without updating the URL, overriding the default behavior
56027     * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});
56028     * ```
56029     *
56030     * @see [Routing and Navigation guide](guide/router)
56031     *
56032     */
56033    navigate(commands, extras = { skipLocationChange: false }) {
56034        validateCommands(commands);
56035        return this.navigateByUrl(this.createUrlTree(commands, extras), extras);
56036    }
56037    /** Serializes a `UrlTree` into a string */
56038    serializeUrl(url) {
56039        return this.urlSerializer.serialize(url);
56040    }
56041    /** Parses a string into a `UrlTree` */
56042    parseUrl(url) {
56043        let urlTree;
56044        try {
56045            urlTree = this.urlSerializer.parse(url);
56046        }
56047        catch (e) {
56048            urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url);
56049        }
56050        return urlTree;
56051    }
56052    /** Returns whether the url is activated */
56053    isActive(url, exact) {
56054        if (isUrlTree(url)) {
56055            return containsTree(this.currentUrlTree, url, exact);
56056        }
56057        const urlTree = this.parseUrl(url);
56058        return containsTree(this.currentUrlTree, urlTree, exact);
56059    }
56060    removeEmptyProps(params) {
56061        return Object.keys(params).reduce((result, key) => {
56062            const value = params[key];
56063            if (value !== null && value !== undefined) {
56064                result[key] = value;
56065            }
56066            return result;
56067        }, {});
56068    }
56069    processNavigations() {
56070        this.navigations.subscribe(t => {
56071            this.navigated = true;
56072            this.lastSuccessfulId = t.id;
56073            this.events
56074                .next(new NavigationEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(this.currentUrlTree)));
56075            this.lastSuccessfulNavigation = this.currentNavigation;
56076            t.resolve(true);
56077        }, e => {
56078            this.console.warn(`Unhandled Navigation Error: `);
56079        });
56080    }
56081    scheduleNavigation(rawUrl, source, restoredState, extras, priorPromise) {
56082        if (this.disposed) {
56083            return Promise.resolve(false);
56084        }
56085        // * Imperative navigations (router.navigate) might trigger additional navigations to the same
56086        //   URL via a popstate event and the locationChangeListener. We should skip these duplicate
56087        //   navs. Duplicates may also be triggered by attempts to sync AngularJS and Angular router
56088        //   states.
56089        // * Imperative navigations can be cancelled by router guards, meaning the URL won't change. If
56090        //   the user follows that with a navigation using the back/forward button or manual URL change,
56091        //   the destination may be the same as the previous imperative attempt. We should not skip
56092        //   these navigations because it's a separate case from the one above -- it's not a duplicate
56093        //   navigation.
56094        const lastNavigation = this.getTransition();
56095        // We don't want to skip duplicate successful navs if they're imperative because
56096        // onSameUrlNavigation could be 'reload' (so the duplicate is intended).
56097        const browserNavPrecededByRouterNav = source !== 'imperative' && (lastNavigation === null || lastNavigation === void 0 ? void 0 : lastNavigation.source) === 'imperative';
56098        const lastNavigationSucceeded = this.lastSuccessfulId === lastNavigation.id;
56099        // If the last navigation succeeded or is in flight, we can use the rawUrl as the comparison.
56100        // However, if it failed, we should compare to the final result (urlAfterRedirects).
56101        const lastNavigationUrl = (lastNavigationSucceeded || this.currentNavigation) ?
56102            lastNavigation.rawUrl :
56103            lastNavigation.urlAfterRedirects;
56104        const duplicateNav = lastNavigationUrl.toString() === rawUrl.toString();
56105        if (browserNavPrecededByRouterNav && duplicateNav) {
56106            return Promise.resolve(true); // return value is not used
56107        }
56108        let resolve;
56109        let reject;
56110        let promise;
56111        if (priorPromise) {
56112            resolve = priorPromise.resolve;
56113            reject = priorPromise.reject;
56114            promise = priorPromise.promise;
56115        }
56116        else {
56117            promise = new Promise((res, rej) => {
56118                resolve = res;
56119                reject = rej;
56120            });
56121        }
56122        const id = ++this.navigationId;
56123        this.setTransition({
56124            id,
56125            source,
56126            restoredState,
56127            currentUrlTree: this.currentUrlTree,
56128            currentRawUrl: this.rawUrlTree,
56129            rawUrl,
56130            extras,
56131            resolve,
56132            reject,
56133            promise,
56134            currentSnapshot: this.routerState.snapshot,
56135            currentRouterState: this.routerState
56136        });
56137        // Make sure that the error is propagated even though `processNavigations` catch
56138        // handler does not rethrow
56139        return promise.catch((e) => {
56140            return Promise.reject(e);
56141        });
56142    }
56143    setBrowserUrl(url, replaceUrl, id, state) {
56144        const path = this.urlSerializer.serialize(url);
56145        state = state || {};
56146        if (this.location.isCurrentPathEqualTo(path) || replaceUrl) {
56147            // TODO(jasonaden): Remove first `navigationId` and rely on `ng` namespace.
56148            this.location.replaceState(path, '', Object.assign(Object.assign({}, state), { navigationId: id }));
56149        }
56150        else {
56151            this.location.go(path, '', Object.assign(Object.assign({}, state), { navigationId: id }));
56152        }
56153    }
56154    resetStateAndUrl(storedState, storedUrl, rawUrl) {
56155        this.routerState = storedState;
56156        this.currentUrlTree = storedUrl;
56157        this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);
56158        this.resetUrlToCurrentUrlTree();
56159    }
56160    resetUrlToCurrentUrlTree() {
56161        this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree), '', { navigationId: this.lastSuccessfulId });
56162    }
56163}
56164Router.ɵfac = function Router_Factory(t) { return new (t || Router)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Type"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](UrlSerializer), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](ChildrenOutletContexts), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["Location"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](undefined)); };
56165Router.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: Router, factory: Router.ɵfac });
56166Router.ctorParameters = () => [
56167    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Type"] },
56168    { type: UrlSerializer },
56169    { type: ChildrenOutletContexts },
56170    { type: _angular_common__WEBPACK_IMPORTED_MODULE_0__["Location"] },
56171    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] },
56172    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"] },
56173    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"] },
56174    { type: undefined }
56175];
56176(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](Router, [{
56177        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
56178    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Type"] }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: _angular_common__WEBPACK_IMPORTED_MODULE_0__["Location"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"] }, { type: undefined }]; }, null); })();
56179function validateCommands(commands) {
56180    for (let i = 0; i < commands.length; i++) {
56181        const cmd = commands[i];
56182        if (cmd == null) {
56183            throw new Error(`The requested path contains ${cmd} segment at index ${i}`);
56184        }
56185    }
56186}
56187
56188/**
56189 * @license
56190 * Copyright Google LLC All Rights Reserved.
56191 *
56192 * Use of this source code is governed by an MIT-style license that can be
56193 * found in the LICENSE file at https://angular.io/license
56194 */
56195/**
56196 * @description
56197 *
56198 * When applied to an element in a template, makes that element a link
56199 * that initiates navigation to a route. Navigation opens one or more routed components
56200 * in one or more `<router-outlet>` locations on the page.
56201 *
56202 * Given a route configuration `[{ path: 'user/:name', component: UserCmp }]`,
56203 * the following creates a static link to the route:
56204 * `<a routerLink="/user/bob">link to user component</a>`
56205 *
56206 * You can use dynamic values to generate the link.
56207 * For a dynamic link, pass an array of path segments,
56208 * followed by the params for each segment.
56209 * For example, `['/team', teamId, 'user', userName, {details: true}]`
56210 * generates a link to `/team/11/user/bob;details=true`.
56211 *
56212 * Multiple static segments can be merged into one term and combined with dynamic segements.
56213 * For example, `['/team/11/user', userName, {details: true}]`
56214 *
56215 * The input that you provide to the link is treated as a delta to the current URL.
56216 * For instance, suppose the current URL is `/user/(box//aux:team)`.
56217 * The link `<a [routerLink]="['/user/jim']">Jim</a>` creates the URL
56218 * `/user/(jim//aux:team)`.
56219 * See {@link Router#createUrlTree createUrlTree} for more information.
56220 *
56221 * @usageNotes
56222 *
56223 * You can use absolute or relative paths in a link, set query parameters,
56224 * control how parameters are handled, and keep a history of navigation states.
56225 *
56226 * ### Relative link paths
56227 *
56228 * The first segment name can be prepended with `/`, `./`, or `../`.
56229 * * If the first segment begins with `/`, the router looks up the route from the root of the
56230 *   app.
56231 * * If the first segment begins with `./`, or doesn't begin with a slash, the router
56232 *   looks in the children of the current activated route.
56233 * * If the first segment begins with `../`, the router goes up one level in the route tree.
56234 *
56235 * ### Setting and handling query params and fragments
56236 *
56237 * The following link adds a query parameter and a fragment to the generated URL:
56238 *
56239 * ```
56240 * <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">
56241 *   link to user component
56242 * </a>
56243 * ```
56244 * By default, the directive constructs the new URL using the given query parameters.
56245 * The example generates the link: `/user/bob?debug=true#education`.
56246 *
56247 * You can instruct the directive to handle query parameters differently
56248 * by specifying the `queryParamsHandling` option in the link.
56249 * Allowed values are:
56250 *
56251 *  - `'merge'`: Merge the given `queryParams` into the current query params.
56252 *  - `'preserve'`: Preserve the current query params.
56253 *
56254 * For example:
56255 *
56256 * ```
56257 * <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" queryParamsHandling="merge">
56258 *   link to user component
56259 * </a>
56260 * ```
56261 *
56262 * See {@link UrlCreationOptions.queryParamsHandling UrlCreationOptions#queryParamsHandling}.
56263 *
56264 * ### Preserving navigation history
56265 *
56266 * You can provide a `state` value to be persisted to the browser's
56267 * [`History.state` property](https://developer.mozilla.org/en-US/docs/Web/API/History#Properties).
56268 * For example:
56269 *
56270 * ```
56271 * <a [routerLink]="['/user/bob']" [state]="{tracingId: 123}">
56272 *   link to user component
56273 * </a>
56274 * ```
56275 *
56276 * Use {@link Router.getCurrentNavigation() Router#getCurrentNavigation} to retrieve a saved
56277 * navigation-state value. For example, to capture the `tracingId` during the `NavigationStart`
56278 * event:
56279 *
56280 * ```
56281 * // Get NavigationStart events
56282 * router.events.pipe(filter(e => e instanceof NavigationStart)).subscribe(e => {
56283 *   const navigation = router.getCurrentNavigation();
56284 *   tracingService.trace({id: navigation.extras.state.tracingId});
56285 * });
56286 * ```
56287 *
56288 * @ngModule RouterModule
56289 *
56290 * @publicApi
56291 */
56292class RouterLink {
56293    constructor(router, route, tabIndex, renderer, el) {
56294        this.router = router;
56295        this.route = route;
56296        this.commands = [];
56297        /** @internal */
56298        this.onChanges = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
56299        if (tabIndex == null) {
56300            renderer.setAttribute(el.nativeElement, 'tabindex', '0');
56301        }
56302    }
56303    /** @nodoc */
56304    ngOnChanges(changes) {
56305        // This is subscribed to by `RouterLinkActive` so that it knows to update when there are changes
56306        // to the RouterLinks it's tracking.
56307        this.onChanges.next(this);
56308    }
56309    /**
56310     * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
56311     *   - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
56312     *   - **string**: shorthand for array of commands with just the string, i.e. `['/route']`
56313     *   - **null|undefined**: shorthand for an empty array of commands, i.e. `[]`
56314     * @see {@link Router#createUrlTree Router#createUrlTree}
56315     */
56316    set routerLink(commands) {
56317        if (commands != null) {
56318            this.commands = Array.isArray(commands) ? commands : [commands];
56319        }
56320        else {
56321            this.commands = [];
56322        }
56323    }
56324    /** @nodoc */
56325    onClick() {
56326        const extras = {
56327            skipLocationChange: attrBoolValue(this.skipLocationChange),
56328            replaceUrl: attrBoolValue(this.replaceUrl),
56329            state: this.state,
56330        };
56331        this.router.navigateByUrl(this.urlTree, extras);
56332        return true;
56333    }
56334    get urlTree() {
56335        return this.router.createUrlTree(this.commands, {
56336            // If the `relativeTo` input is not defined, we want to use `this.route` by default.
56337            // Otherwise, we should use the value provided by the user in the input.
56338            relativeTo: this.relativeTo !== undefined ? this.relativeTo : this.route,
56339            queryParams: this.queryParams,
56340            fragment: this.fragment,
56341            queryParamsHandling: this.queryParamsHandling,
56342            preserveFragment: attrBoolValue(this.preserveFragment),
56343        });
56344    }
56345}
56346RouterLink.ɵfac = function RouterLink_Factory(t) { return new (t || RouterLink)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](Router), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](ActivatedRoute), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinjectAttribute"]('tabindex'), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"])); };
56347RouterLink.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: RouterLink, selectors: [["", "routerLink", "", 5, "a", 5, "area"]], hostBindings: function RouterLink_HostBindings(rf, ctx) { if (rf & 1) {
56348        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function RouterLink_click_HostBindingHandler() { return ctx.onClick(); });
56349    } }, inputs: { routerLink: "routerLink", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵNgOnChangesFeature"]] });
56350RouterLink.ctorParameters = () => [
56351    { type: Router },
56352    { type: ActivatedRoute },
56353    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['tabindex',] }] },
56354    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
56355    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }
56356];
56357RouterLink.propDecorators = {
56358    queryParams: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56359    fragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56360    queryParamsHandling: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56361    preserveFragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56362    skipLocationChange: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56363    replaceUrl: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56364    state: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56365    relativeTo: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56366    routerLink: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56367    onClick: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"], args: ['click',] }]
56368};
56369(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RouterLink, [{
56370        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"],
56371        args: [{ selector: ':not(a):not(area)[routerLink]' }]
56372    }], function () { return [{ type: Router }, { type: ActivatedRoute }, { type: String, decorators: [{
56373                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"],
56374                args: ['tabindex']
56375            }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }]; }, { routerLink: [{
56376            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56377        }], 
56378    /** @nodoc */
56379    onClick: [{
56380            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"],
56381            args: ['click']
56382        }], queryParams: [{
56383            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56384        }], fragment: [{
56385            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56386        }], queryParamsHandling: [{
56387            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56388        }], preserveFragment: [{
56389            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56390        }], skipLocationChange: [{
56391            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56392        }], replaceUrl: [{
56393            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56394        }], state: [{
56395            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56396        }], relativeTo: [{
56397            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56398        }] }); })();
56399/**
56400 * @description
56401 *
56402 * Lets you link to specific routes in your app.
56403 *
56404 * See `RouterLink` for more information.
56405 *
56406 * @ngModule RouterModule
56407 *
56408 * @publicApi
56409 */
56410class RouterLinkWithHref {
56411    constructor(router, route, locationStrategy) {
56412        this.router = router;
56413        this.route = route;
56414        this.locationStrategy = locationStrategy;
56415        this.commands = [];
56416        /** @internal */
56417        this.onChanges = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
56418        this.subscription = router.events.subscribe((s) => {
56419            if (s instanceof NavigationEnd) {
56420                this.updateTargetUrlAndHref();
56421            }
56422        });
56423    }
56424    /**
56425     * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
56426     *   - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
56427     *   - **string**: shorthand for array of commands with just the string, i.e. `['/route']`
56428     *   - **null|undefined**: shorthand for an empty array of commands, i.e. `[]`
56429     * @see {@link Router#createUrlTree Router#createUrlTree}
56430     */
56431    set routerLink(commands) {
56432        if (commands != null) {
56433            this.commands = Array.isArray(commands) ? commands : [commands];
56434        }
56435        else {
56436            this.commands = [];
56437        }
56438    }
56439    /** @nodoc */
56440    ngOnChanges(changes) {
56441        this.updateTargetUrlAndHref();
56442        this.onChanges.next(this);
56443    }
56444    /** @nodoc */
56445    ngOnDestroy() {
56446        this.subscription.unsubscribe();
56447    }
56448    /** @nodoc */
56449    onClick(button, ctrlKey, shiftKey, altKey, metaKey) {
56450        if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) {
56451            return true;
56452        }
56453        if (typeof this.target === 'string' && this.target != '_self') {
56454            return true;
56455        }
56456        const extras = {
56457            skipLocationChange: attrBoolValue(this.skipLocationChange),
56458            replaceUrl: attrBoolValue(this.replaceUrl),
56459            state: this.state
56460        };
56461        this.router.navigateByUrl(this.urlTree, extras);
56462        return false;
56463    }
56464    updateTargetUrlAndHref() {
56465        this.href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree));
56466    }
56467    get urlTree() {
56468        return this.router.createUrlTree(this.commands, {
56469            // If the `relativeTo` input is not defined, we want to use `this.route` by default.
56470            // Otherwise, we should use the value provided by the user in the input.
56471            relativeTo: this.relativeTo !== undefined ? this.relativeTo : this.route,
56472            queryParams: this.queryParams,
56473            fragment: this.fragment,
56474            queryParamsHandling: this.queryParamsHandling,
56475            preserveFragment: attrBoolValue(this.preserveFragment),
56476        });
56477    }
56478}
56479RouterLinkWithHref.ɵfac = function RouterLinkWithHref_Factory(t) { return new (t || RouterLinkWithHref)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](Router), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](ActivatedRoute), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["LocationStrategy"])); };
56480RouterLinkWithHref.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: RouterLinkWithHref, selectors: [["a", "routerLink", ""], ["area", "routerLink", ""]], hostVars: 2, hostBindings: function RouterLinkWithHref_HostBindings(rf, ctx) { if (rf & 1) {
56481        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click", function RouterLinkWithHref_click_HostBindingHandler($event) { return ctx.onClick($event.button, $event.ctrlKey, $event.shiftKey, $event.altKey, $event.metaKey); });
56482    } if (rf & 2) {
56483        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵhostProperty"]("href", ctx.href, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsanitizeUrl"]);
56484        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵattribute"]("target", ctx.target);
56485    } }, inputs: { routerLink: "routerLink", target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵNgOnChangesFeature"]] });
56486RouterLinkWithHref.ctorParameters = () => [
56487    { type: Router },
56488    { type: ActivatedRoute },
56489    { type: _angular_common__WEBPACK_IMPORTED_MODULE_0__["LocationStrategy"] }
56490];
56491RouterLinkWithHref.propDecorators = {
56492    target: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostBinding"], args: ['attr.target',] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56493    queryParams: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56494    fragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56495    queryParamsHandling: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56496    preserveFragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56497    skipLocationChange: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56498    replaceUrl: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56499    state: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56500    relativeTo: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56501    href: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostBinding"] }],
56502    routerLink: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56503    onClick: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"], args: ['click',
56504                ['$event.button', '$event.ctrlKey', '$event.shiftKey', '$event.altKey', '$event.metaKey'],] }]
56505};
56506(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RouterLinkWithHref, [{
56507        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"],
56508        args: [{ selector: 'a[routerLink],area[routerLink]' }]
56509    }], function () { return [{ type: Router }, { type: ActivatedRoute }, { type: _angular_common__WEBPACK_IMPORTED_MODULE_0__["LocationStrategy"] }]; }, { routerLink: [{
56510            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56511        }], 
56512    /** @nodoc */
56513    onClick: [{
56514            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostListener"],
56515            args: ['click',
56516                ['$event.button', '$event.ctrlKey', '$event.shiftKey', '$event.altKey', '$event.metaKey']]
56517        }], href: [{
56518            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostBinding"]
56519        }], target: [{
56520            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["HostBinding"],
56521            args: ['attr.target']
56522        }, {
56523            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56524        }], queryParams: [{
56525            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56526        }], fragment: [{
56527            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56528        }], queryParamsHandling: [{
56529            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56530        }], preserveFragment: [{
56531            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56532        }], skipLocationChange: [{
56533            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56534        }], replaceUrl: [{
56535            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56536        }], state: [{
56537            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56538        }], relativeTo: [{
56539            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56540        }] }); })();
56541function attrBoolValue(s) {
56542    return s === '' || !!s;
56543}
56544
56545/**
56546 * @license
56547 * Copyright Google LLC All Rights Reserved.
56548 *
56549 * Use of this source code is governed by an MIT-style license that can be
56550 * found in the LICENSE file at https://angular.io/license
56551 */
56552/**
56553 *
56554 * @description
56555 *
56556 * Tracks whether the linked route of an element is currently active, and allows you
56557 * to specify one or more CSS classes to add to the element when the linked route
56558 * is active.
56559 *
56560 * Use this directive to create a visual distinction for elements associated with an active route.
56561 * For example, the following code highlights the word "Bob" when the router
56562 * activates the associated route:
56563 *
56564 * ```
56565 * <a routerLink="/user/bob" routerLinkActive="active-link">Bob</a>
56566 * ```
56567 *
56568 * Whenever the URL is either '/user' or '/user/bob', the "active-link" class is
56569 * added to the anchor tag. If the URL changes, the class is removed.
56570 *
56571 * You can set more than one class using a space-separated string or an array.
56572 * For example:
56573 *
56574 * ```
56575 * <a routerLink="/user/bob" routerLinkActive="class1 class2">Bob</a>
56576 * <a routerLink="/user/bob" [routerLinkActive]="['class1', 'class2']">Bob</a>
56577 * ```
56578 *
56579 * To add the classes only when the URL matches the link exactly, add the option `exact: true`:
56580 *
56581 * ```
56582 * <a routerLink="/user/bob" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact:
56583 * true}">Bob</a>
56584 * ```
56585 *
56586 * To directly check the `isActive` status of the link, assign the `RouterLinkActive`
56587 * instance to a template variable.
56588 * For example, the following checks the status without assigning any CSS classes:
56589 *
56590 * ```
56591 * <a routerLink="/user/bob" routerLinkActive #rla="routerLinkActive">
56592 *   Bob {{ rla.isActive ? '(already open)' : ''}}
56593 * </a>
56594 * ```
56595 *
56596 * You can apply the `RouterLinkActive` directive to an ancestor of linked elements.
56597 * For example, the following sets the active-link class on the `<div>`  parent tag
56598 * when the URL is either '/user/jim' or '/user/bob'.
56599 *
56600 * ```
56601 * <div routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: true}">
56602 *   <a routerLink="/user/jim">Jim</a>
56603 *   <a routerLink="/user/bob">Bob</a>
56604 * </div>
56605 * ```
56606 *
56607 * @ngModule RouterModule
56608 *
56609 * @publicApi
56610 */
56611class RouterLinkActive {
56612    constructor(router, element, renderer, cdr, link, linkWithHref) {
56613        this.router = router;
56614        this.element = element;
56615        this.renderer = renderer;
56616        this.cdr = cdr;
56617        this.link = link;
56618        this.linkWithHref = linkWithHref;
56619        this.classes = [];
56620        this.isActive = false;
56621        this.routerLinkActiveOptions = { exact: false };
56622        this.routerEventsSubscription = router.events.subscribe((s) => {
56623            if (s instanceof NavigationEnd) {
56624                this.update();
56625            }
56626        });
56627    }
56628    /** @nodoc */
56629    ngAfterContentInit() {
56630        // `of(null)` is used to force subscribe body to execute once immediately (like `startWith`).
56631        Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(this.links.changes, this.linksWithHrefs.changes, Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null)).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeAll"])()).subscribe(_ => {
56632            this.update();
56633            this.subscribeToEachLinkOnChanges();
56634        });
56635    }
56636    subscribeToEachLinkOnChanges() {
56637        var _a;
56638        (_a = this.linkInputChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
56639        const allLinkChanges = [...this.links.toArray(), ...this.linksWithHrefs.toArray(), this.link, this.linkWithHref]
56640            .filter((link) => !!link)
56641            .map(link => link.onChanges);
56642        this.linkInputChangesSubscription = Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(allLinkChanges).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeAll"])()).subscribe(link => {
56643            if (this.isActive !== this.isLinkActive(this.router)(link)) {
56644                this.update();
56645            }
56646        });
56647    }
56648    set routerLinkActive(data) {
56649        const classes = Array.isArray(data) ? data : data.split(' ');
56650        this.classes = classes.filter(c => !!c);
56651    }
56652    /** @nodoc */
56653    ngOnChanges(changes) {
56654        this.update();
56655    }
56656    /** @nodoc */
56657    ngOnDestroy() {
56658        var _a;
56659        this.routerEventsSubscription.unsubscribe();
56660        (_a = this.linkInputChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
56661    }
56662    update() {
56663        if (!this.links || !this.linksWithHrefs || !this.router.navigated)
56664            return;
56665        Promise.resolve().then(() => {
56666            const hasActiveLinks = this.hasActiveLinks();
56667            if (this.isActive !== hasActiveLinks) {
56668                this.isActive = hasActiveLinks;
56669                this.cdr.markForCheck();
56670                this.classes.forEach((c) => {
56671                    if (hasActiveLinks) {
56672                        this.renderer.addClass(this.element.nativeElement, c);
56673                    }
56674                    else {
56675                        this.renderer.removeClass(this.element.nativeElement, c);
56676                    }
56677                });
56678            }
56679        });
56680    }
56681    isLinkActive(router) {
56682        return (link) => router.isActive(link.urlTree, this.routerLinkActiveOptions.exact);
56683    }
56684    hasActiveLinks() {
56685        const isActiveCheckFn = this.isLinkActive(this.router);
56686        return this.link && isActiveCheckFn(this.link) ||
56687            this.linkWithHref && isActiveCheckFn(this.linkWithHref) ||
56688            this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
56689    }
56690}
56691RouterLinkActive.ɵfac = function RouterLinkActive_Factory(t) { return new (t || RouterLinkActive)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](Router), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](RouterLink, 8), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](RouterLinkWithHref, 8)); };
56692RouterLinkActive.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: RouterLinkActive, selectors: [["", "routerLinkActive", ""]], contentQueries: function RouterLinkActive_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
56693        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵcontentQuery"](dirIndex, RouterLink, 1);
56694        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵcontentQuery"](dirIndex, RouterLinkWithHref, 1);
56695    } if (rf & 2) {
56696        let _t;
56697        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵloadQuery"]()) && (ctx.links = _t);
56698        _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵloadQuery"]()) && (ctx.linksWithHrefs = _t);
56699    } }, inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", routerLinkActive: "routerLinkActive" }, exportAs: ["routerLinkActive"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵNgOnChangesFeature"]] });
56700RouterLinkActive.ctorParameters = () => [
56701    { type: Router },
56702    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] },
56703    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] },
56704    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"] },
56705    { type: RouterLink, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }] },
56706    { type: RouterLinkWithHref, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }] }
56707];
56708RouterLinkActive.propDecorators = {
56709    links: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [RouterLink, { descendants: true },] }],
56710    linksWithHrefs: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"], args: [RouterLinkWithHref, { descendants: true },] }],
56711    routerLinkActiveOptions: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }],
56712    routerLinkActive: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"] }]
56713};
56714(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RouterLinkActive, [{
56715        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"],
56716        args: [{
56717                selector: '[routerLinkActive]',
56718                exportAs: 'routerLinkActive'
56719            }]
56720    }], function () { return [{ type: Router }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ElementRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Renderer2"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"] }, { type: RouterLink, decorators: [{
56721                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]
56722            }] }, { type: RouterLinkWithHref, decorators: [{
56723                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]
56724            }] }]; }, { routerLinkActiveOptions: [{
56725            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56726        }], routerLinkActive: [{
56727            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"]
56728        }], links: [{
56729            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"],
56730            args: [RouterLink, { descendants: true }]
56731        }], linksWithHrefs: [{
56732            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ContentChildren"],
56733            args: [RouterLinkWithHref, { descendants: true }]
56734        }] }); })();
56735
56736/**
56737 * @license
56738 * Copyright Google LLC All Rights Reserved.
56739 *
56740 * Use of this source code is governed by an MIT-style license that can be
56741 * found in the LICENSE file at https://angular.io/license
56742 */
56743/**
56744 * @description
56745 *
56746 * Acts as a placeholder that Angular dynamically fills based on the current router state.
56747 *
56748 * Each outlet can have a unique name, determined by the optional `name` attribute.
56749 * The name cannot be set or changed dynamically. If not set, default value is "primary".
56750 *
56751 * ```
56752 * <router-outlet></router-outlet>
56753 * <router-outlet name='left'></router-outlet>
56754 * <router-outlet name='right'></router-outlet>
56755 * ```
56756 *
56757 * Named outlets can be the targets of secondary routes.
56758 * The `Route` object for a secondary route has an `outlet` property to identify the target outlet:
56759 *
56760 * `{path: <base-path>, component: <component>, outlet: <target_outlet_name>}`
56761 *
56762 * Using named outlets and secondary routes, you can target multiple outlets in
56763 * the same `RouterLink` directive.
56764 *
56765 * The router keeps track of separate branches in a navigation tree for each named outlet and
56766 * generates a representation of that tree in the URL.
56767 * The URL for a secondary route uses the following syntax to specify both the primary and secondary
56768 * routes at the same time:
56769 *
56770 * `http://base-path/primary-route-path(outlet-name:route-path)`
56771 *
56772 * A router outlet emits an activate event when a new component is instantiated,
56773 * and a deactivate event when a component is destroyed.
56774 *
56775 * ```
56776 * <router-outlet
56777 *   (activate)='onActivate($event)'
56778 *   (deactivate)='onDeactivate($event)'></router-outlet>
56779 * ```
56780 *
56781 * @see [Routing tutorial](guide/router-tutorial-toh#named-outlets "Example of a named
56782 * outlet and secondary route configuration").
56783 * @see `RouterLink`
56784 * @see `Route`
56785 * @ngModule RouterModule
56786 *
56787 * @publicApi
56788 */
56789class RouterOutlet {
56790    constructor(parentContexts, location, resolver, name, changeDetector) {
56791        this.parentContexts = parentContexts;
56792        this.location = location;
56793        this.resolver = resolver;
56794        this.changeDetector = changeDetector;
56795        this.activated = null;
56796        this._activatedRoute = null;
56797        this.activateEvents = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
56798        this.deactivateEvents = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
56799        this.name = name || PRIMARY_OUTLET;
56800        parentContexts.onChildOutletCreated(this.name, this);
56801    }
56802    /** @nodoc */
56803    ngOnDestroy() {
56804        this.parentContexts.onChildOutletDestroyed(this.name);
56805    }
56806    /** @nodoc */
56807    ngOnInit() {
56808        if (!this.activated) {
56809            // If the outlet was not instantiated at the time the route got activated we need to populate
56810            // the outlet when it is initialized (ie inside a NgIf)
56811            const context = this.parentContexts.getContext(this.name);
56812            if (context && context.route) {
56813                if (context.attachRef) {
56814                    // `attachRef` is populated when there is an existing component to mount
56815                    this.attach(context.attachRef, context.route);
56816                }
56817                else {
56818                    // otherwise the component defined in the configuration is created
56819                    this.activateWith(context.route, context.resolver || null);
56820                }
56821            }
56822        }
56823    }
56824    get isActivated() {
56825        return !!this.activated;
56826    }
56827    get component() {
56828        if (!this.activated)
56829            throw new Error('Outlet is not activated');
56830        return this.activated.instance;
56831    }
56832    get activatedRoute() {
56833        if (!this.activated)
56834            throw new Error('Outlet is not activated');
56835        return this._activatedRoute;
56836    }
56837    get activatedRouteData() {
56838        if (this._activatedRoute) {
56839            return this._activatedRoute.snapshot.data;
56840        }
56841        return {};
56842    }
56843    /**
56844     * Called when the `RouteReuseStrategy` instructs to detach the subtree
56845     */
56846    detach() {
56847        if (!this.activated)
56848            throw new Error('Outlet is not activated');
56849        this.location.detach();
56850        const cmp = this.activated;
56851        this.activated = null;
56852        this._activatedRoute = null;
56853        return cmp;
56854    }
56855    /**
56856     * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree
56857     */
56858    attach(ref, activatedRoute) {
56859        this.activated = ref;
56860        this._activatedRoute = activatedRoute;
56861        this.location.insert(ref.hostView);
56862    }
56863    deactivate() {
56864        if (this.activated) {
56865            const c = this.component;
56866            this.activated.destroy();
56867            this.activated = null;
56868            this._activatedRoute = null;
56869            this.deactivateEvents.emit(c);
56870        }
56871    }
56872    activateWith(activatedRoute, resolver) {
56873        if (this.isActivated) {
56874            throw new Error('Cannot activate an already activated outlet');
56875        }
56876        this._activatedRoute = activatedRoute;
56877        const snapshot = activatedRoute._futureSnapshot;
56878        const component = snapshot.routeConfig.component;
56879        resolver = resolver || this.resolver;
56880        const factory = resolver.resolveComponentFactory(component);
56881        const childContexts = this.parentContexts.getOrCreateContext(this.name).children;
56882        const injector = new OutletInjector(activatedRoute, childContexts, this.location.injector);
56883        this.activated = this.location.createComponent(factory, this.location.length, injector);
56884        // Calling `markForCheck` to make sure we will run the change detection when the
56885        // `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component.
56886        this.changeDetector.markForCheck();
56887        this.activateEvents.emit(this.activated.instance);
56888    }
56889}
56890RouterOutlet.ɵfac = function RouterOutlet_Factory(t) { return new (t || RouterOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](ChildrenOutletContexts), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinjectAttribute"]('name'), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"])); };
56891RouterOutlet.ɵdir = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: RouterOutlet, selectors: [["router-outlet"]], outputs: { activateEvents: "activate", deactivateEvents: "deactivate" }, exportAs: ["outlet"] });
56892RouterOutlet.ctorParameters = () => [
56893    { type: ChildrenOutletContexts },
56894    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] },
56895    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"] },
56896    { type: String, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"], args: ['name',] }] },
56897    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"] }
56898];
56899RouterOutlet.propDecorators = {
56900    activateEvents: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['activate',] }],
56901    deactivateEvents: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"], args: ['deactivate',] }]
56902};
56903(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RouterOutlet, [{
56904        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Directive"],
56905        args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
56906    }], function () { return [{ type: ChildrenOutletContexts }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewContainerRef"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ComponentFactoryResolver"] }, { type: String, decorators: [{
56907                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Attribute"],
56908                args: ['name']
56909            }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ChangeDetectorRef"] }]; }, { activateEvents: [{
56910            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"],
56911            args: ['activate']
56912        }], deactivateEvents: [{
56913            type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"],
56914            args: ['deactivate']
56915        }] }); })();
56916class OutletInjector {
56917    constructor(route, childContexts, parent) {
56918        this.route = route;
56919        this.childContexts = childContexts;
56920        this.parent = parent;
56921    }
56922    get(token, notFoundValue) {
56923        if (token === ActivatedRoute) {
56924            return this.route;
56925        }
56926        if (token === ChildrenOutletContexts) {
56927            return this.childContexts;
56928        }
56929        return this.parent.get(token, notFoundValue);
56930    }
56931}
56932
56933/**
56934 * @license
56935 * Copyright Google LLC All Rights Reserved.
56936 *
56937 * Use of this source code is governed by an MIT-style license that can be
56938 * found in the LICENSE file at https://angular.io/license
56939 */
56940/**
56941 * @description
56942 *
56943 * Provides a preloading strategy.
56944 *
56945 * @publicApi
56946 */
56947class PreloadingStrategy {
56948}
56949/**
56950 * @description
56951 *
56952 * Provides a preloading strategy that preloads all modules as quickly as possible.
56953 *
56954 * ```
56955 * RouterModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules})
56956 * ```
56957 *
56958 * @publicApi
56959 */
56960class PreloadAllModules {
56961    preload(route, fn) {
56962        return fn().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(() => Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null)));
56963    }
56964}
56965/**
56966 * @description
56967 *
56968 * Provides a preloading strategy that does not preload any modules.
56969 *
56970 * This strategy is enabled by default.
56971 *
56972 * @publicApi
56973 */
56974class NoPreloading {
56975    preload(route, fn) {
56976        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
56977    }
56978}
56979/**
56980 * The preloader optimistically loads all router configurations to
56981 * make navigations into lazily-loaded sections of the application faster.
56982 *
56983 * The preloader runs in the background. When the router bootstraps, the preloader
56984 * starts listening to all navigation events. After every such event, the preloader
56985 * will check if any configurations can be loaded lazily.
56986 *
56987 * If a route is protected by `canLoad` guards, the preloaded will not load it.
56988 *
56989 * @publicApi
56990 */
56991class RouterPreloader {
56992    constructor(router, moduleLoader, compiler, injector, preloadingStrategy) {
56993        this.router = router;
56994        this.injector = injector;
56995        this.preloadingStrategy = preloadingStrategy;
56996        const onStartLoad = (r) => router.triggerEvent(new RouteConfigLoadStart(r));
56997        const onEndLoad = (r) => router.triggerEvent(new RouteConfigLoadEnd(r));
56998        this.loader = new RouterConfigLoader(moduleLoader, compiler, onStartLoad, onEndLoad);
56999    }
57000    setUpPreloading() {
57001        this.subscription =
57002            this.router.events
57003                .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["filter"])((e) => e instanceof NavigationEnd), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["concatMap"])(() => this.preload()))
57004                .subscribe(() => { });
57005    }
57006    preload() {
57007        const ngModule = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleRef"]);
57008        return this.processRoutes(ngModule, this.router.config);
57009    }
57010    /** @nodoc */
57011    ngOnDestroy() {
57012        if (this.subscription) {
57013            this.subscription.unsubscribe();
57014        }
57015    }
57016    processRoutes(ngModule, routes) {
57017        const res = [];
57018        for (const route of routes) {
57019            // we already have the config loaded, just recurse
57020            if (route.loadChildren && !route.canLoad && route._loadedConfig) {
57021                const childConfig = route._loadedConfig;
57022                res.push(this.processRoutes(childConfig.module, childConfig.routes));
57023                // no config loaded, fetch the config
57024            }
57025            else if (route.loadChildren && !route.canLoad) {
57026                res.push(this.preloadConfig(ngModule, route));
57027                // recurse into children
57028            }
57029            else if (route.children) {
57030                res.push(this.processRoutes(ngModule, route.children));
57031            }
57032        }
57033        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["from"])(res).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeAll"])(), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["map"])((_) => void 0));
57034    }
57035    preloadConfig(ngModule, route) {
57036        return this.preloadingStrategy.preload(route, () => {
57037            const loaded$ = route._loadedConfig ? Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(route._loadedConfig) :
57038                this.loader.load(ngModule.injector, route);
57039            return loaded$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["mergeMap"])((config) => {
57040                route._loadedConfig = config;
57041                return this.processRoutes(config.module, config.routes);
57042            }));
57043        });
57044    }
57045}
57046RouterPreloader.ɵfac = function RouterPreloader_Factory(t) { return new (t || RouterPreloader)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](Router), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](PreloadingStrategy)); };
57047RouterPreloader.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: RouterPreloader, factory: RouterPreloader.ɵfac });
57048RouterPreloader.ctorParameters = () => [
57049    { type: Router },
57050    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"] },
57051    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"] },
57052    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] },
57053    { type: PreloadingStrategy }
57054];
57055(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RouterPreloader, [{
57056        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
57057    }], function () { return [{ type: Router }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] }, { type: PreloadingStrategy }]; }, null); })();
57058
57059/**
57060 * @license
57061 * Copyright Google LLC All Rights Reserved.
57062 *
57063 * Use of this source code is governed by an MIT-style license that can be
57064 * found in the LICENSE file at https://angular.io/license
57065 */
57066class RouterScroller {
57067    constructor(router, 
57068    /** @docsNotRequired */ viewportScroller, options = {}) {
57069        this.router = router;
57070        this.viewportScroller = viewportScroller;
57071        this.options = options;
57072        this.lastId = 0;
57073        this.lastSource = 'imperative';
57074        this.restoredId = 0;
57075        this.store = {};
57076        // Default both options to 'disabled'
57077        options.scrollPositionRestoration = options.scrollPositionRestoration || 'disabled';
57078        options.anchorScrolling = options.anchorScrolling || 'disabled';
57079    }
57080    init() {
57081        // we want to disable the automatic scrolling because having two places
57082        // responsible for scrolling results race conditions, especially given
57083        // that browser don't implement this behavior consistently
57084        if (this.options.scrollPositionRestoration !== 'disabled') {
57085            this.viewportScroller.setHistoryScrollRestoration('manual');
57086        }
57087        this.routerEventsSubscription = this.createScrollEvents();
57088        this.scrollEventsSubscription = this.consumeScrollEvents();
57089    }
57090    createScrollEvents() {
57091        return this.router.events.subscribe(e => {
57092            if (e instanceof NavigationStart) {
57093                // store the scroll position of the current stable navigations.
57094                this.store[this.lastId] = this.viewportScroller.getScrollPosition();
57095                this.lastSource = e.navigationTrigger;
57096                this.restoredId = e.restoredState ? e.restoredState.navigationId : 0;
57097            }
57098            else if (e instanceof NavigationEnd) {
57099                this.lastId = e.id;
57100                this.scheduleScrollEvent(e, this.router.parseUrl(e.urlAfterRedirects).fragment);
57101            }
57102        });
57103    }
57104    consumeScrollEvents() {
57105        return this.router.events.subscribe(e => {
57106            if (!(e instanceof Scroll))
57107                return;
57108            // a popstate event. The pop state event will always ignore anchor scrolling.
57109            if (e.position) {
57110                if (this.options.scrollPositionRestoration === 'top') {
57111                    this.viewportScroller.scrollToPosition([0, 0]);
57112                }
57113                else if (this.options.scrollPositionRestoration === 'enabled') {
57114                    this.viewportScroller.scrollToPosition(e.position);
57115                }
57116                // imperative navigation "forward"
57117            }
57118            else {
57119                if (e.anchor && this.options.anchorScrolling === 'enabled') {
57120                    this.viewportScroller.scrollToAnchor(e.anchor);
57121                }
57122                else if (this.options.scrollPositionRestoration !== 'disabled') {
57123                    this.viewportScroller.scrollToPosition([0, 0]);
57124                }
57125            }
57126        });
57127    }
57128   
57128 scheduleScrollEvent(routerEvent, anchor) {
57129        this.router.triggerEvent(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor));
57130    }
57131    /** @nodoc */
57132    ngOnDestroy() {
57133        if (this.routerEventsSubscription) {
57134            this.routerEventsSubscription.unsubscribe();
57135        }
57136        if (this.scrollEventsSubscription) {
57137            this.scrollEventsSubscription.unsubscribe();
57138        }
57139    }
57140}
57141RouterScroller.ɵfac = function RouterScroller_Factory(t) { return new (t || RouterScroller)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](Router), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["ViewportScroller"]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](undefined)); };
57142RouterScroller.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: RouterScroller, factory: RouterScroller.ɵfac });
57143RouterScroller.ctorParameters = () => [
57144    { type: Router },
57145    { type: _angular_common__WEBPACK_IMPORTED_MODULE_0__["ViewportScroller"] },
57146    { type: undefined }
57147];
57148(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RouterScroller, [{
57149        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
57150    }], function () { return [{ type: Router }, { type: _angular_common__WEBPACK_IMPORTED_MODULE_0__["ViewportScroller"] }, { type: undefined }]; }, null); })();
57151
57152/**
57153 * @license
57154 * Copyright Google LLC All Rights Reserved.
57155 *
57156 * Use of this source code is governed by an MIT-style license that can be
57157 * found in the LICENSE file at https://angular.io/license
57158 */
57159/**
57160 * The directives defined in the `RouterModule`.
57161 */
57162const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent];
57163/**
57164 * A [DI token](guide/glossary/#di-token) for the router service.
57165 *
57166 * @publicApi
57167 */
57168const ROUTER_CONFIGURATION = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('ROUTER_CONFIGURATION');
57169/**
57170 * @docsNotRequired
57171 */
57172const ROUTER_FORROOT_GUARD = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('ROUTER_FORROOT_GUARD');
57173const ɵ0 = { enableTracing: false };
57174const ROUTER_PROVIDERS = [
57175    _angular_common__WEBPACK_IMPORTED_MODULE_0__["Location"],
57176    { provide: UrlSerializer, useClass: DefaultUrlSerializer },
57177    {
57178        provide: Router,
57179        useFactory: setupRouter,
57180        deps: [
57181            UrlSerializer, ChildrenOutletContexts, _angular_common__WEBPACK_IMPORTED_MODULE_0__["Location"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"], _angular_core__WEBPACK_IMPORTED_MODULE_1__["Compiler"],
57182            ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]()],
57183            [RouteReuseStrategy, new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]()]
57184        ]
57185    },
57186    ChildrenOutletContexts,
57187    { provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
57188    { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModuleFactoryLoader"], useClass: _angular_core__WEBPACK_IMPORTED_MODULE_1__["SystemJsNgModuleLoader"] },
57189    RouterPreloader,
57190    NoPreloading,
57191    PreloadAllModules,
57192    { provide: ROUTER_CONFIGURATION, useValue: ɵ0 },
57193];
57194function routerNgProbeToken() {
57195    return new _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgProbeToken"]('Router', Router);
57196}
57197/**
57198 * @description
57199 *
57200 * Adds directives and providers for in-app navigation among views defined in an application.
57201 * Use the Angular `Router` service to declaratively specify application states and manage state
57202 * transitions.
57203 *
57204 * You can import this NgModule multiple times, once for each lazy-loaded bundle.
57205 * However, only one `Router` service can be active.
57206 * To ensure this, there are two ways to register routes when importing this module:
57207 *
57208 * * The `forRoot()` method creates an `NgModule` that contains all the directives, the given
57209 * routes, and the `Router` service itself.
57210 * * The `forChild()` method creates an `NgModule` that contains all the directives and the given
57211 * routes, but does not include the `Router` service.
57212 *
57213 * @see [Routing and Navigation guide](guide/router) for an
57214 * overview of how the `Router` service should be used.
57215 *
57216 * @publicApi
57217 */
57218class RouterModule {
57219    // Note: We are injecting the Router so it gets created eagerly...
57220    constructor(guard, router) { }
57221    /**
57222     * Creates and configures a module with all the router providers and directives.
57223     * Optionally sets up an application listener to perform an initial navigation.
57224     *
57225     * When registering the NgModule at the root, import as follows:
57226     *
57227     * ```
57228     * @NgModule({
57229     *   imports: [RouterModule.forRoot(ROUTES)]
57230     * })
57231     * class MyNgModule {}
57232     * ```
57233     *
57234     * @param routes An array of `Route` objects that define the navigation paths for the application.
57235     * @param config An `ExtraOptions` configuration object that controls how navigation is performed.
57236     * @return The new `NgModule`.
57237     *
57238     */
57239    static forRoot(routes, config) {
57240        return {
57241            ngModule: RouterModule,
57242            providers: [
57243                ROUTER_PROVIDERS,
57244                provideRoutes(routes),
57245                {
57246                    provide: ROUTER_FORROOT_GUARD,
57247                    useFactory: provideForRootGuard,
57248                    deps: [[Router, new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"](), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["SkipSelf"]()]]
57249                },
57250                { provide: ROUTER_CONFIGURATION, useValue: config ? config : {} },
57251                {
57252                    provide: _angular_common__WEBPACK_IMPORTED_MODULE_0__["LocationStrategy"],
57253                    useFactory: provideLocationStrategy,
57254                    deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__["PlatformLocation"], [new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__["APP_BASE_HREF"]), new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]()], ROUTER_CONFIGURATION]
57255                },
57256                {
57257                    provide: RouterScroller,
57258                    useFactory: createRouterScroller,
57259                    deps: [Router, _angular_common__WEBPACK_IMPORTED_MODULE_0__["ViewportScroller"], ROUTER_CONFIGURATION]
57260                },
57261                {
57262                    provide: PreloadingStrategy,
57263                    useExisting: config && config.preloadingStrategy ? config.preloadingStrategy :
57264                        NoPreloading
57265                },
57266                { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgProbeToken"], multi: true, useFactory: routerNgProbeToken },
57267                provideRouterInitializer(),
57268            ],
57269        };
57270    }
57271    /**
57272     * Creates a module with all the router directives and a provider registering routes,
57273     * without creating a new Router service.
57274     * When registering for submodules and lazy-loaded submodules, create the NgModule as follows:
57275     *
57276     * ```
57277     * @NgModule({
57278     *   imports: [RouterModule.forChild(ROUTES)]
57279     * })
57280     * class MyNgModule {}
57281     * ```
57282     *
57283     * @param routes An array of `Route` objects that define the navigation paths for the submodule.
57284     * @return The new NgModule.
57285     *
57286     */
57287    static forChild(routes) {
57288        return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
57289    }
57290}
57291RouterModule.ɵfac = function RouterModule_Factory(t) { return new (t || RouterModule)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](ROUTER_FORROOT_GUARD, 8), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](Router, 8)); };
57292RouterModule.ɵmod = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: RouterModule });
57293RouterModule.ɵinj = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({});
57294RouterModule.ctorParameters = () => [
57295    { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"], args: [ROUTER_FORROOT_GUARD,] }] },
57296    { type: Router, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"] }] }
57297];
57298(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵsetNgModuleScope"](RouterModule, { declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] }); })();
57299(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RouterModule, [{
57300        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"],
57301        args: [{
57302                declarations: ROUTER_DIRECTIVES,
57303                exports: ROUTER_DIRECTIVES,
57304                entryComponents: [ɵEmptyOutletComponent]
57305            }]
57306    }], function () { return [{ type: undefined, decorators: [{
57307                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]
57308            }, {
57309                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Inject"],
57310                args: [ROUTER_FORROOT_GUARD]
57311            }] }, { type: Router, decorators: [{
57312                type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Optional"]
57313            }] }]; }, null); })();
57314function createRouterScroller(router, viewportScroller, config) {
57315    if (config.scrollOffset) {
57316        viewportScroller.setOffset(config.scrollOffset);
57317    }
57318    return new RouterScroller(router, viewportScroller, config);
57319}
57320function provideLocationStrategy(platformLocationStrategy, baseHref, options = {}) {
57321    return options.useHash ? new _angular_common__WEBPACK_IMPORTED_MODULE_0__["HashLocationStrategy"](platformLocationStrategy, baseHref) :
57322        new _angular_common__WEBPACK_IMPORTED_MODULE_0__["PathLocationStrategy"](platformLocationStrategy, baseHref);
57323}
57324function provideForRootGuard(router) {
57325    if ((typeof ngDevMode === 'undefined' || ngDevMode) && router) {
57326        throw new Error(`RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);
57327    }
57328    return 'guarded';
57329}
57330/**
57331 * Registers a [DI provider](guide/glossary#provider) for a set of routes.
57332 * @param routes The route configuration to provide.
57333 *
57334 * @usageNotes
57335 *
57336 * ```
57337 * @NgModule({
57338 *   imports: [RouterModule.forChild(ROUTES)],
57339 *   providers: [provideRoutes(EXTRA_ROUTES)]
57340 * })
57341 * class MyNgModule {}
57342 * ```
57343 *
57344 * @publicApi
57345 */
57346function provideRoutes(routes) {
57347    return [
57348        { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ANALYZE_FOR_ENTRY_COMPONENTS"], multi: true, useValue: routes },
57349        { provide: ROUTES, multi: true, useValue: routes },
57350    ];
57351}
57352function setupRouter(urlSerializer, contexts, location, injector, loader, compiler, config, opts = {}, urlHandlingStrategy, routeReuseStrategy) {
57353    const router = new Router(null, urlSerializer, contexts, location, injector, loader, compiler, flatten(config));
57354    if (urlHandlingStrategy) {
57355        router.urlHandlingStrategy = urlHandlingStrategy;
57356    }
57357    if (routeReuseStrategy) {
57358        router.routeReuseStrategy = routeReuseStrategy;
57359    }
57360    assignExtraOptionsToRouter(opts, router);
57361    if (opts.enableTracing) {
57362        const dom = Object(_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])();
57363        router.events.subscribe((e) => {
57364            dom.logGroup(`Router Event: ${e.constructor.name}`);
57365            dom.log(e.toString());
57366            dom.log(e);
57367            dom.logGroupEnd();
57368        });
57369    }
57370    return router;
57371}
57372function assignExtraOptionsToRouter(opts, router) {
57373    if (opts.errorHandler) {
57374        router.errorHandler = opts.errorHandler;
57375    }
57376    if (opts.malformedUriErrorHandler) {
57377        router.malformedUriErrorHandler = opts.malformedUriErrorHandler;
57378    }
57379    if (opts.onSameUrlNavigation) {
57380        router.onSameUrlNavigation = opts.onSameUrlNavigation;
57381    }
57382    if (opts.paramsInheritanceStrategy) {
57383        router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;
57384    }
57385    if (opts.relativeLinkResolution) {
57386        router.relativeLinkResolution = opts.relativeLinkResolution;
57387    }
57388    if (opts.urlUpdateStrategy) {
57389        router.urlUpdateStrategy = opts.urlUpdateStrategy;
57390    }
57391}
57392function rootRoute(router) {
57393    return router.routerState.root;
57394}
57395/**
57396 * Router initialization requires two steps:
57397 *
57398 * First, we start the navigation in a `APP_INITIALIZER` to block the bootstrap if
57399 * a resolver or a guard executes asynchronously.
57400 *
57401 * Next, we actually run activation in a `BOOTSTRAP_LISTENER`, using the
57402 * `afterPreactivation` hook provided by the router.
57403 * The router navigation starts, reaches the point when preactivation is done, and then
57404 * pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.
57405 */
57406class RouterInitializer {
57407    constructor(injector) {
57408        this.injector = injector;
57409        this.initNavigation = false;
57410        this.resultOfPreactivationDone = new rxjs__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
57411    }
57412    appInitializer() {
57413        const p = this.injector.get(_angular_common__WEBPACK_IMPORTED_MODULE_0__["LOCATION_INITIALIZED"], Promise.resolve(null));
57414        return p.then(() => {
57415            let resolve = null;
57416            const res = new Promise(r => resolve = r);
57417            const router = this.injector.get(Router);
57418            const opts = this.injector.get(ROUTER_CONFIGURATION);
57419            if (opts.initialNavigation === 'disabled') {
57420                router.setUpLocationChangeListener();
57421                resolve(true);
57422            }
57423            else if (
57424            // TODO: enabled is deprecated as of v11, can be removed in v13
57425            opts.initialNavigation === 'enabled' || opts.initialNavigation === 'enabledBlocking') {
57426                router.hooks.afterPreactivation = () => {
57427                    // only the initial navigation should be delayed
57428                    if (!this.initNavigation) {
57429                        this.initNavigation = true;
57430                        resolve(true);
57431                        return this.resultOfPreactivationDone;
57432                        // subsequent navigations should not be delayed
57433                    }
57434                    else {
57435                        return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["of"])(null);
57436                    }
57437                };
57438                router.initialNavigation();
57439            }
57440            else {
57441                resolve(true);
57442            }
57443            return res;
57444        });
57445    }
57446    bootstrapListener(bootstrappedComponentRef) {
57447        const opts = this.injector.get(ROUTER_CONFIGURATION);
57448        const preloader = this.injector.get(RouterPreloader);
57449        const routerScroller = this.injector.get(RouterScroller);
57450        const router = this.injector.get(Router);
57451        const ref = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ApplicationRef"]);
57452        if (bootstrappedComponentRef !== ref.components[0]) {
57453            return;
57454        }
57455        // Default case
57456        if (opts.initialNavigation === 'enabledNonBlocking' || opts.initialNavigation === undefined) {
57457            router.initialNavigation();
57458        }
57459        preloader.setUpPreloading();
57460        routerScroller.init();
57461        router.resetRootComponentType(ref.componentTypes[0]);
57462        this.resultOfPreactivationDone.next(null);
57463        this.resultOfPreactivationDone.complete();
57464    }
57465}
57466RouterInitializer.ɵfac = function RouterInitializer_Factory(t) { return new (t || RouterInitializer)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"])); };
57467RouterInitializer.ɵprov = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: RouterInitializer, factory: RouterInitializer.ɵfac });
57468RouterInitializer.ctorParameters = () => [
57469    { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] }
57470];
57471(function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](RouterInitializer, [{
57472        type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"]
57473    }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["Injector"] }]; }, null); })();
57474function getAppInitializer(r) {
57475    return r.appInitializer.bind(r);
57476}
57477function getBootstrapListener(r) {
57478    return r.bootstrapListener.bind(r);
57479}
57480/**
57481 * A [DI token](guide/glossary/#di-token) for the router initializer that
57482 * is called after the app is bootstrapped.
57483 *
57484 * @publicApi
57485 */
57486const ROUTER_INITIALIZER = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["InjectionToken"]('Router Initializer');
57487function provideRouterInitializer() {
57488    return [
57489        RouterInitializer,
57490        {
57491            provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_INITIALIZER"],
57492            multi: true,
57493            useFactory: getAppInitializer,
57494            deps: [RouterInitializer]
57495        },
57496        { provide: ROUTER_INITIALIZER, useFactory: getBootstrapListener, deps: [RouterInitializer] },
57497        { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["APP_BOOTSTRAP_LISTENER"], multi: true, useExisting: ROUTER_INITIALIZER },
57498    ];
57499}
57500
57501/**
57502 * @license
57503 * Copyright Google LLC All Rights Reserved.
57504 *
57505 * Use of this source code is governed by an MIT-style license that can be
57506 * found in the LICENSE file at https://angular.io/license
57507 */
57508/**
57509 * @publicApi
57510 */
57511const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["Version"]('11.2.11');
57512
57513/**
57514 * @license
57515 * Copyright Google LLC All Rights Reserved.
57516 *
57517 * Use of this source code is governed by an MIT-style license that can be
57518 * found in the LICENSE file at https://angular.io/license
57519 */
57520
57521/**
57522 * @license
57523 * Copyright Google LLC All Rights Reserved.
57524 *
57525 * Use of this source code is governed by an MIT-style license that can be
57526 * found in the LICENSE file at https://angular.io/license
57527 */
57528
57529/**
57530 * @license
57531 * Copyright Google LLC All Rights Reserved.
57532 *
57533 * Use of this source code is governed by an MIT-style license that can be
57534 * found in the LICENSE file at https://angular.io/license
57535 */
57536// This file only reexports content of the `src` folder. Keep it that way.
57537
57538/**
57539 * @license
57540 * Copyright Google LLC All Rights Reserved.
57541 *
57542 * Use of this source code is governed by an MIT-style license that can be
57543 * found in the LICENSE file at https://angular.io/license
57544 */
57545
57546/**
57547 * Generated bundle index. Do not edit.
57548 */
57549
57550
57551
57552//# sourceMappingURL=router.js.map
57553
57554/***/ }),
57555
57556/***/ "uTdr":
57557/*!****************************************************************************!*\
57558  !*** ./node_modules/rxjs/_esm2015/internal/operators/onErrorResumeNext.js ***!
57559  \****************************************************************************/
57560/*! exports provided: onErrorResumeNext, onErrorResumeNextStatic */
57561/***/ (function(module, __webpack_exports__, __webpack_require__) {
57562
57563"use strict";
57564__webpack_require__.r(__webpack_exports__);
57565/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; });
57566/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNextStatic", function() { return onErrorResumeNextStatic; });
57567/* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/from */ "Cfvw");
57568/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
57569/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
57570
57571
57572
57573function onErrorResumeNext(...nextSources) {
57574    if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(nextSources[0])) {
57575        nextSources = nextSources[0];
57576    }
57577    return (source) => source.lift(new OnErrorResumeNextOperator(nextSources));
57578}
57579function onErrorResumeNextStatic(...nextSources) {
57580    let source = undefined;
57581    if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(nextSources[0])) {
57582        nextSources = nextSources[0];
57583    }
57584    source = nextSources.shift();
57585    return Object(_observable_from__WEBPACK_IMPORTED_MODULE_0__["from"])(source).lift(new OnErrorResumeNextOperator(nextSources));
57586}
57587class OnErrorResumeNextOperator {
57588    constructor(nextSources) {
57589        this.nextSources = nextSources;
57590    }
57591    call(subscriber, source) {
57592        return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));
57593    }
57594}
57595class OnErrorResumeNextSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleOuterSubscriber"] {
57596    constructor(destination, nextSources) {
57597        super(destination);
57598        this.destination = destination;
57599        this.nextSources = nextSources;
57600    }
57601    notifyError() {
57602        this.subscribeToNextSource();
57603    }
57604    notifyComplete() {
57605        this.subscribeToNextSource();
57606    }
57607    _error(err) {
57608        this.subscribeToNextSource();
57609        this.unsubscribe();
57610    }
57611    _complete() {
57612        this.subscribeToNextSource();
57613        this.unsubscribe();
57614    }
57615    subscribeToNextSource() {
57616        const next = this.nextSources.shift();
57617        if (!!next) {
57618            const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["SimpleInnerSubscriber"](this);
57619            const destination = this.destination;
57620            destination.add(innerSubscriber);
57621            const innerSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_2__["innerSubscribe"])(next, innerSubscriber);
57622            if (innerSubscription !== innerSubscriber) {
57623                destination.add(innerSubscription);
57624            }
57625        }
57626        else {
57627            this.destination.complete();
57628        }
57629    }
57630}
57631//# sourceMappingURL=onErrorResumeNext.js.map
57632
57633/***/ }),
57634
57635/***/ "un/a":
57636/*!****************************************************************!*\
57637  !*** ./node_modules/rxjs/_esm2015/internal/operators/retry.js ***!
57638  \****************************************************************/
57639/*! exports provided: retry */
57640/***/ (function(module, __webpack_exports__, __webpack_require__) {
57641
57642"use strict";
57643__webpack_require__.r(__webpack_exports__);
57644/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return retry; });
57645/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
57646
57647function retry(count = -1) {
57648    return (source) => source.lift(new RetryOperator(count, source));
57649}
57650class RetryOperator {
57651    constructor(count, source) {
57652        this.count = count;
57653        this.source = source;
57654    }
57655    call(subscriber, source) {
57656        return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));
57657    }
57658}
57659class RetrySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
57660    constructor(destination, count, source) {
57661        super(destination);
57662        this.count = count;
57663        this.source = source;
57664    }
57665    error(err) {
57666        if (!this.isStopped) {
57667            const { source, count } = this;
57668            if (count === 0) {
57669                return super.error(err);
57670            }
57671            else if (count > -1) {
57672                this.count = count - 1;
57673            }
57674            source.subscribe(this._unsubscribeAndRecycle());
57675        }
57676    }
57677}
57678//# sourceMappingURL=retry.js.map
57679
57680/***/ }),
57681
57682/***/ "vkgz":
57683/*!**************************************************************!*\
57684  !*** ./node_modules/rxjs/_esm2015/internal/operators/tap.js ***!
57685  \**************************************************************/
57686/*! exports provided: tap */
57687/***/ (function(module, __webpack_exports__, __webpack_require__) {
57688
57689"use strict";
57690__webpack_require__.r(__webpack_exports__);
57691/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return tap; });
57692/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
57693/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/noop */ "KqfI");
57694/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ "n6bG");
57695
57696
57697
57698function tap(nextOrObserver, error, complete) {
57699    return function tapOperatorFunction(source) {
57700        return source.lift(new DoOperator(nextOrObserver, error, complete));
57701    };
57702}
57703class DoOperator {
57704    constructor(nextOrObserver, error, complete) {
57705        this.nextOrObserver = nextOrObserver;
57706        this.error = error;
57707        this.complete = complete;
57708    }
57709    call(subscriber, source) {
57710        return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
57711    }
57712}
57713class TapSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
57714    constructor(destination, observerOrNext, error, complete) {
57715        super(destination);
57716        this._tapNext = _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"];
57717        this._tapError = _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"];
57718        this._tapComplete = _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"];
57719        this._tapError = error || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"];
57720        this._tapComplete = complete || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"];
57721        if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(observerOrNext)) {
57722            this._context = this;
57723            this._tapNext = observerOrNext;
57724        }
57725        else if (observerOrNext) {
57726            this._context = observerOrNext;
57727            this._tapNext = observerOrNext.next || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"];
57728            this._tapError = observerOrNext.error || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"];
57729            this._tapComplete = observerOrNext.complete || _util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"];
57730        }
57731    }
57732    _next(value) {
57733        try {
57734            this._tapNext.call(this._context, value);
57735        }
57736        catch (err) {
57737            this.destination.error(err);
57738            return;
57739        }
57740        this.destination.next(value);
57741    }
57742    _error(err) {
57743        try {
57744            this._tapError.call(this._context, err);
57745        }
57746        catch (err) {
57747            this.destination.error(err);
57748            return;
57749        }
57750        this.destination.error(err);
57751    }
57752    _complete() {
57753        try {
57754            this._tapComplete.call(this._context);
57755        }
57756        catch (err) {
57757            this.destination.error(err);
57758            return;
57759        }
57760        return this.destination.complete();
57761    }
57762}
57763//# sourceMappingURL=tap.js.map
57764
57765/***/ }),
57766
57767/***/ "vqkR":
57768/*!********************************************************************!*\
57769  !*** ./node_modules/rxjs/_esm2015/internal/operators/skipUntil.js ***!
57770  \********************************************************************/
57771/*! exports provided: skipUntil */
57772/***/ (function(module, __webpack_exports__, __webpack_require__) {
57773
57774"use strict";
57775__webpack_require__.r(__webpack_exports__);
57776/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return skipUntil; });
57777/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
57778
57779function skipUntil(notifier) {
57780    return (source) => source.lift(new SkipUntilOperator(notifier));
57781}
57782class SkipUntilOperator {
57783    constructor(notifier) {
57784        this.notifier = notifier;
57785    }
57786    call(destination, source) {
57787        return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
57788    }
57789}
57790class SkipUntilSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
57791    constructor(destination, notifier) {
57792        super(destination);
57793        this.hasValue = false;
57794        const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this);
57795        this.add(innerSubscriber);
57796        this.innerSubscription = innerSubscriber;
57797        const innerSubscription = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(notifier, innerSubscriber);
57798        if (innerSubscription !== innerSubscriber) {
57799            this.add(innerSubscription);
57800            this.innerSubscription = innerSubscription;
57801        }
57802    }
57803    _next(value) {
57804        if (this.hasValue) {
57805            super._next(value);
57806        }
57807    }
57808    notifyNext() {
57809        this.hasValue = true;
57810        if (this.innerSubscription) {
57811            this.innerSubscription.unsubscribe();
57812        }
57813    }
57814    notifyComplete() {
57815    }
57816}
57817//# sourceMappingURL=skipUntil.js.map
57818
57819/***/ }),
57820
57821/***/ "w1tV":
57822/*!****************************************************************!*\
57823  !*** ./node_modules/rxjs/_esm2015/internal/operators/share.js ***!
57824  \****************************************************************/
57825/*! exports provided: share */
57826/***/ (function(module, __webpack_exports__, __webpack_require__) {
57827
57828"use strict";
57829__webpack_require__.r(__webpack_exports__);
57830/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return share; });
57831/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./multicast */ "oB13");
57832/* harmony import */ var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./refCount */ "x+ZX");
57833/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subject */ "XNiG");
57834
57835
57836
57837function shareSubjectFactory() {
57838    return new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]();
57839}
57840function share() {
57841    return (source) => Object(_refCount__WEBPACK_IMPORTED_MODULE_1__["refCount"])()(Object(_multicast__WEBPACK_IMPORTED_MODULE_0__["multicast"])(shareSubjectFactory)(source));
57842}
57843//# sourceMappingURL=share.js.map
57844
57845/***/ }),
57846
57847/***/ "wO+i":
57848/*!****************************************************************!*\
57849  !*** ./node_modules/rxjs/_esm2015/internal/operators/pluck.js ***!
57850  \****************************************************************/
57851/*! exports provided: pluck */
57852/***/ (function(module, __webpack_exports__, __webpack_require__) {
57853
57854"use strict";
57855__webpack_require__.r(__webpack_exports__);
57856/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return pluck; });
57857/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map */ "lJxs");
57858
57859function pluck(...properties) {
57860    const length = properties.length;
57861    if (length === 0) {
57862        throw new Error('list of properties cannot be empty.');
57863    }
57864    return (source) => Object(_map__WEBPACK_IMPORTED_MODULE_0__["map"])(plucker(properties, length))(source);
57865}
57866function plucker(props, length) {
57867    const mapper = (x) => {
57868        let currentProp = x;
57869        for (let i = 0; i < length; i++) {
57870            const p = currentProp != null ? currentProp[props[i]] : undefined;
57871            if (p !== void 0) {
57872                currentProp = p;
57873            }
57874            else {
57875                return undefined;
57876            }
57877        }
57878        return currentProp;
57879    };
57880    return mapper;
57881}
57882//# sourceMappingURL=pluck.js.map
57883
57884/***/ }),
57885
57886/***/ "x+ZX":
57887/*!*******************************************************************!*\
57888  !*** ./node_modules/rxjs/_esm2015/internal/operators/refCount.js ***!
57889  \*******************************************************************/
57890/*! exports provided: refCount */
57891/***/ (function(module, __webpack_exports__, __webpack_require__) {
57892
57893"use strict";
57894__webpack_require__.r(__webpack_exports__);
57895/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return refCount; });
57896/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
57897
57898function refCount() {
57899    return function refCountOperatorFunction(source) {
57900        return source.lift(new RefCountOperator(source));
57901    };
57902}
57903class RefCountOperator {
57904    constructor(connectable) {
57905        this.connectable = connectable;
57906    }
57907    call(subscriber, source) {
57908        const { connectable } = this;
57909        connectable._refCount++;
57910        const refCounter = new RefCountSubscriber(subscriber, connectable);
57911        const subscription = source.subscribe(refCounter);
57912        if (!refCounter.closed) {
57913            refCounter.connection = connectable.connect();
57914        }
57915        return subscription;
57916    }
57917}
57918class RefCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
57919    constructor(destination, connectable) {
57920        super(destination);
57921        this.connectable = connectable;
57922    }
57923    _unsubscribe() {
57924        const { connectable } = this;
57925        if (!connectable) {
57926            this.connection = null;
57927            return;
57928        }
57929        this.connectable = null;
57930        const refCount = connectable._refCount;
57931        if (refCount <= 0) {
57932            this.connection = null;
57933            return;
57934        }
57935        connectable._refCount = refCount - 1;
57936        if (refCount > 1) {
57937            this.connection = null;
57938            return;
57939        }
57940        const { connection } = this;
57941        const sharedConnection = connectable._connection;
57942        this.connection = null;
57943        if (sharedConnection && (!connection || sharedConnection === connection)) {
57944            sharedConnection.unsubscribe();
57945        }
57946    }
57947}
57948//# sourceMappingURL=refCount.js.map
57949
57950/***/ }),
57951
57952/***/ "xbPD":
57953/*!*************************************************************************!*\
57954  !*** ./node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js ***!
57955  \*************************************************************************/
57956/*! exports provided: defaultIfEmpty */
57957/***/ (function(module, __webpack_exports__, __webpack_require__) {
57958
57959"use strict";
57960__webpack_require__.r(__webpack_exports__);
57961/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return defaultIfEmpty; });
57962/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
57963
57964function defaultIfEmpty(defaultValue = null) {
57965    return (source) =>
57965 source.lift(new DefaultIfEmptyOperator(defaultValue));
57966}
57967class DefaultIfEmptyOperator {
57968    constructor(defaultValue) {
57969        this.defaultValue = defaultValue;
57970    }
57971    call(subscriber, source) {
57972        return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));
57973    }
57974}
57975class DefaultIfEmptySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
57976    constructor(destination, defaultValue) {
57977        super(destination);
57978        this.defaultValue = defaultValue;
57979        this.isEmpty = true;
57980    }
57981    _next(value) {
57982        this.isEmpty = false;
57983        this.destination.next(value);
57984    }
57985    _complete() {
57986        if (this.isEmpty) {
57987            this.destination.next(this.defaultValue);
57988        }
57989        this.destination.complete();
57990    }
57991}
57992//# sourceMappingURL=defaultIfEmpty.js.map
57993
57994/***/ }),
57995
57996/***/ "xgIS":
57997/*!*********************************************************************!*\
57998  !*** ./node_modules/rxjs/_esm2015/internal/observable/fromEvent.js ***!
57999  \*********************************************************************/
58000/*! exports provided: fromEvent */
58001/***/ (function(module, __webpack_exports__, __webpack_require__) {
58002
58003"use strict";
58004__webpack_require__.r(__webpack_exports__);
58005/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return fromEvent; });
58006/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
58007/* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ "DH7j");
58008/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ "n6bG");
58009/* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operators/map */ "lJxs");
58010
58011
58012
58013
58014const toString = (() => Object.prototype.toString)();
58015function fromEvent(target, eventName, options, resultSelector) {
58016    if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(options)) {
58017        resultSelector = options;
58018        options = undefined;
58019    }
58020    if (resultSelector) {
58021        return fromEvent(target, eventName, options).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(args => Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector(...args) : resultSelector(args)));
58022    }
58023    return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => {
58024        function handler(e) {
58025            if (arguments.length > 1) {
58026                subscriber.next(Array.prototype.slice.call(arguments));
58027            }
58028            else {
58029                subscriber.next(e);
58030            }
58031        }
58032        setupSubscription(target, eventName, handler, subscriber, options);
58033    });
58034}
58035function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
58036    let unsubscribe;
58037    if (isEventTarget(sourceObj)) {
58038        const source = sourceObj;
58039        sourceObj.addEventListener(eventName, handler, options);
58040        unsubscribe = () => source.removeEventListener(eventName, handler, options);
58041    }
58042    else if (isJQueryStyleEventEmitter(sourceObj)) {
58043        const source = sourceObj;
58044        sourceObj.on(eventName, handler);
58045        unsubscribe = () => source.off(eventName, handler);
58046    }
58047    else if (isNodeStyleEventEmitter(sourceObj)) {
58048        const source = sourceObj;
58049        sourceObj.addListener(eventName, handler);
58050        unsubscribe = () => source.removeListener(eventName, handler);
58051    }
58052    else if (sourceObj && sourceObj.length) {
58053        for (let i = 0, len = sourceObj.length; i < len; i++) {
58054            setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
58055        }
58056    }
58057    else {
58058        throw new TypeError('Invalid event target');
58059    }
58060    subscriber.add(unsubscribe);
58061}
58062function isNodeStyleEventEmitter(sourceObj) {
58063    return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
58064}
58065function isJQueryStyleEventEmitter(sourceObj) {
58066    return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
58067}
58068function isEventTarget(sourceObj) {
58069    return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
58070}
58071//# sourceMappingURL=fromEvent.js.map
58072
58073/***/ }),
58074
58075/***/ "yCtX":
58076/*!*********************************************************************!*\
58077  !*** ./node_modules/rxjs/_esm2015/internal/observable/fromArray.js ***!
58078  \*********************************************************************/
58079/*! exports provided: fromArray */
58080/***/ (function(module, __webpack_exports__, __webpack_require__) {
58081
58082"use strict";
58083__webpack_require__.r(__webpack_exports__);
58084/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromArray", function() { return fromArray; });
58085/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
58086/* harmony import */ var _util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToArray */ "ngJS");
58087/* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduled/scheduleArray */ "jZKg");
58088
58089
58090
58091function fromArray(input, scheduler) {
58092    if (!scheduler) {
58093        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__["subscribeToArray"])(input));
58094    }
58095    else {
58096        return Object(_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__["scheduleArray"])(input, scheduler);
58097    }
58098}
58099//# sourceMappingURL=fromArray.js.map
58100
58101/***/ }),
58102
58103/***/ "yI9Y":
58104/*!**************************************************************!*\
58105  !*** ./node_modules/rxjs/_esm2015/internal/operators/max.js ***!
58106  \**************************************************************/
58107/*! exports provided: max */
58108/***/ (function(module, __webpack_exports__, __webpack_require__) {
58109
58110"use strict";
58111__webpack_require__.r(__webpack_exports__);
58112/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; });
58113/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ "128B");
58114
58115function max(comparer) {
58116    const max = (typeof comparer === 'function')
58117        ? (x, y) => comparer(x, y) > 0 ? x : y
58118        : (x, y) => x > y ? x : y;
58119    return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(max);
58120}
58121//# sourceMappingURL=max.js.map
58122
58123/***/ }),
58124
58125/***/ "yuhW":
58126/*!*******************************************************************!*\
58127  !*** ./node_modules/rxjs/_esm2015/internal/operators/throttle.js ***!
58128  \*******************************************************************/
58129/*! exports provided: defaultThrottleConfig, throttle */
58130/***/ (function(module, __webpack_exports__, __webpack_require__) {
58131
58132"use strict";
58133__webpack_require__.r(__webpack_exports__);
58134/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultThrottleConfig", function() { return defaultThrottleConfig; });
58135/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return throttle; });
58136/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
58137
58138const defaultThrottleConfig = {
58139    leading: true,
58140    trailing: false
58141};
58142function throttle(durationSelector, config = defaultThrottleConfig) {
58143    return (source) =>
58143 source.lift(new ThrottleOperator(durationSelector, !!config.leading, !!config.trailing));
58144}
58145class ThrottleOperator {
58146    constructor(durationSelector, leading, trailing) {
58147        this.durationSelector = durationSelector;
58148        this.leading = leading;
58149        this.trailing = trailing;
58150    }
58151    call(subscriber, source) {
58152        return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));
58153    }
58154}
58155class ThrottleSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
58156    constructor(destination, durationSelector, _leading, _trailing) {
58157        super(destination);
58158        this.destination = destination;
58159        this.durationSelector = durationSelector;
58160        this._leading = _leading;
58161        this._trailing = _trailing;
58162        this._hasValue = false;
58163    }
58164    _next(value) {
58165        this._hasValue = true;
58166        this._sendValue = value;
58167        if (!this._throttled) {
58168            if (this._leading) {
58169                this.send();
58170            }
58171            else {
58172                this.throttle(value);
58173            }
58174        }
58175    }
58176    send() {
58177        const { _hasValue, _sendValue } = this;
58178        if (_hasValue) {
58179            this.destination.next(_sendValue);
58180            this.throttle(_sendValue);
58181        }
58182        this._hasValue = false;
58183        this._sendValue = undefined;
58184    }
58185    throttle(value) {
58186        const duration = this.tryDurationSelector(value);
58187        if (!!duration) {
58188            this.add(this._throttled = Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(duration, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this)));
58189        }
58190    }
58191    tryDurationSelector(value) {
58192        try {
58193            return this.durationSelector(value);
58194        }
58195        catch (err) {
58196            this.destination.error(err);
58197            return null;
58198        }
58199    }
58200    throttlingDone() {
58201        const { _throttled, _trailing } = this;
58202        if (_throttled) {
58203            _throttled.unsubscribe();
58204        }
58205        this._throttled = undefined;
58206        if (_trailing) {
58207            this.send();
58208        }
58209    }
58210    notifyNext() {
58211        this.throttlingDone();
58212    }
58213    notifyComplete() {
58214        this.throttlingDone();
58215    }
58216}
58217//# sourceMappingURL=throttle.js.map
58218
58219/***/ }),
58220
58221/***/ "z+Ro":
58222/*!*****************************************************************!*\
58223  !*** ./node_modules/rxjs/_esm2015/internal/util/isScheduler.js ***!
58224  \*****************************************************************/
58225/*! exports provided: isScheduler */
58226/***/ (function(module, __webpack_exports__, __webpack_require__) {
58227
58228"use strict";
58229__webpack_require__.r(__webpack_exports__);
58230/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isScheduler", function() { return isScheduler; });
58231function isScheduler(value) {
58232    return value && typeof value.schedule === 'function';
58233}
58234//# sourceMappingURL=isScheduler.js.map
58235
58236/***/ }),
58237
58238/***/ "z6cu":
58239/*!**********************************************************************!*\
58240  !*** ./node_modules/rxjs/_esm2015/internal/observable/throwError.js ***!
58241  \**********************************************************************/
58242/*! exports provided: throwError */
58243/***/ (function(module, __webpack_exports__, __webpack_require__) {
58244
58245"use strict";
58246__webpack_require__.r(__webpack_exports__);
58247/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return throwError; });
58248/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "HDdC");
58249
58250function throwError(error, scheduler) {
58251    if (!scheduler) {
58252        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => subscriber.error(error));
58253    }
58254    else {
58255        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](subscriber => scheduler.schedule(dispatch, 0, { error, subscriber }));
58256    }
58257}
58258function dispatch({ error, subscriber }) {
58259    subscriber.error(error);
58260}
58261//# sourceMappingURL=throwError.js.map
58262
58263/***/ }),
58264
58265/***/ "zP0r":
58266/*!***************************************************************!*\
58267  !*** ./node_modules/rxjs/_esm2015/internal/operators/skip.js ***!
58268  \***************************************************************/
58269/*! exports provided: skip */
58270/***/ (function(module, __webpack_exports__, __webpack_require__) {
58271
58272"use strict";
58273__webpack_require__.r(__webpack_exports__);
58274/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return skip; });
58275/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ "7o/Q");
58276
58277function skip(count) {
58278    return (source) => source.lift(new SkipOperator(count));
58279}
58280class SkipOperator {
58281    constructor(total) {
58282        this.total = total;
58283    }
58284    call(subscriber, source) {
58285        return source.subscribe(new SkipSubscriber(subscriber, this.total));
58286    }
58287}
58288class SkipSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
58289    constructor(destination, total) {
58290        super(destination);
58291        this.total = total;
58292        this.count = 0;
58293    }
58294    _next(x) {
58295        if (++this.count > this.total) {
58296            this.destination.next(x);
58297        }
58298    }
58299}
58300//# sourceMappingURL=skip.js.map
58301
58302/***/ }),
58303
58304/***/ "znLP":
58305/*!**********************************************************************************!*\
58306  !*** ./node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameScheduler.js ***!
58307  \**********************************************************************************/
58308/*! exports provided: AnimationFrameScheduler */
58309/***/ (function(module, __webpack_exports__, __webpack_require__) {
58310
58311"use strict";
58312__webpack_require__.r(__webpack_exports__);
58313/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameScheduler", function() { return AnimationFrameScheduler; });
58314/* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncScheduler */ "IjjT");
58315
58316class AnimationFrameScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__["AsyncScheduler"] {
58317    flush(action) {
58318        this.active = true;
58319        this.scheduled = undefined;
58320        const { actions } = this;
58321        let error;
58322        let index = -1;
58323        let count = actions.length;
58324        action = action || actions.shift();
58325        do {
58326            if (error = action.execute(action.state, action.delay)) {
58327                break;
58328            }
58329        } while (++index < count && (action = actions.shift()));
58330        this.active = false;
58331        if (error) {
58332            while (++index < count && (action = actions.shift())) {
58333                action.unsubscribe();
58334            }
58335            throw error;
58336        }
58337    }
58338}
58339//# sourceMappingURL=AnimationFrameScheduler.js.map
58340
58341/***/ }),
58342
58343/***/ "zp1y":
58344/*!*************************************************************************!*\
58345  !*** ./node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js ***!
58346  \*************************************************************************/
58347/*! exports provided: withLatestFrom */
58348/***/ (function(module, __webpack_exports__, __webpack_require__) {
58349
58350"use strict";
58351__webpack_require__.r(__webpack_exports__);
58352/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return withLatestFrom; });
58353/* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../OuterSubscriber */ "l7GE");
58354/* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToResult */ "ZUHj");
58355
58356
58357function withLatestFrom(...args) {
58358    return (source) => {
58359        let project;
58360        if (typeof args[args.length - 1] === 'function') {
58361            project = args.pop();
58362        }
58363        const observables = args;
58364        return source.lift(new WithLatestFromOperator(observables, project));
58365    };
58366}
58367class WithLatestFromOperator {
58368    constructor(observables, project) {
58369        this.observables = observables;
58370        this.project = project;
58371    }
58372    call(subscriber, source) {
58373        return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));
58374    }
58375}
58376class WithLatestFromSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_0__["OuterSubscriber"] {
58377    constructor(destination, observables, project) {
58378        super(destination);
58379        this.observables = observables;
58380        this.project = project;
58381        this.toRespond = [];
58382        const len = observables.length;
58383        this.values = new Array(len);
58384        for (let i = 0; i < len; i++) {
58385            this.toRespond.push(i);
58386        }
58387        for (let i = 0; i < len; i++) {
58388            let observable = observables[i];
58389            this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, observable, undefined, i));
58390        }
58391    }
58392    notifyNext(_outerValue, innerValue, outerIndex) {
58393        this.values[outerIndex] = innerValue;
58394        const toRespond = this.toRespond;
58395        if (toRespond.length > 0) {
58396            const found = toRespond.indexOf(outerIndex);
58397            if (found !== -1) {
58398                toRespond.splice(found, 1);
58399            }
58400        }
58401    }
58402    notifyComplete() {
58403    }
58404    _next(value) {
58405        if (this.toRespond.length === 0) {
58406            const args = [value, ...this.values];
58407            if (this.project) {
58408                this._tryProject(args);
58409            }
58410            else {
58411                this.destination.next(args);
58412            }
58413        }
58414    }
58415    _tryProject(args) {
58416        let result;
58417        try {
58418            result = this.project.apply(this, args);
58419        }
58420        catch (err) {
58421            this.destination.error(err);
58422            return;
58423        }
58424        this.destination.next(result);
58425    }
58426}
58427//# sourceMappingURL=withLatestFrom.js.map
58428
58429/***/ }),
58430
58431/***/ "zt7V":
58432/*!******************************************************************!*\
58433  !*** ./node_modules/rxjs/_esm2015/internal/operators/exhaust.js ***!
58434  \******************************************************************/
58435/*! exports provided: exhaust */
58436/***/ (function(module, __webpack_exports__, __webpack_require__) {
58437
58438"use strict";
58439__webpack_require__.r(__webpack_exports__);
58440/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return exhaust; });
58441/* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ "zx2A");
58442
58443function exhaust() {
58444    return (source) => source.lift(new SwitchFirstOperator());
58445}
58446class SwitchFirstOperator {
58447    call(subscriber, source) {
58448        return source.subscribe(new SwitchFirstSubscriber(subscriber));
58449    }
58450}
58451class SwitchFirstSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleOuterSubscriber"] {
58452    constructor(destination) {
58453        super(destination);
58454        this.hasCompleted = false;
58455        this.hasSubscription = false;
58456    }
58457    _next(value) {
58458        if (!this.hasSubscription) {
58459            this.hasSubscription = true;
58460            this.add(Object(_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["innerSubscribe"])(value, new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__["SimpleInnerSubscriber"](this)));
58461        }
58462    }
58463    _complete() {
58464        this.hasCompleted = true;
58465        if (!this.hasSubscription) {
58466            this.destination.complete();
58467        }
58468    }
58469    notifyComplete() {
58470        this.hasSubscription = false;
58471        if (this.hasCompleted) {
58472            this.destination.complete();
58473        }
58474    }
58475}
58476//# sourceMappingURL=exhaust.js.map
58477
58478/***/ }),
58479
58480/***/ "zx2A":
58481/*!***************************************************************!*\
58482  !*** ./node_modules/rxjs/_esm2015/internal/innerSubscribe.js ***!
58483  \***************************************************************/
58484/*! exports provided: SimpleInnerSubscriber, ComplexInnerSubscriber, SimpleOuterSubscriber, ComplexOuterSubscriber, innerSubscribe */
58485/***/ (function(module, __webpack_exports__, __webpack_require__) {
58486
58487"use strict";
58488__webpack_require__.r(__webpack_exports__);
58489/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleInnerSubscriber", function() { return SimpleInnerSubscriber; });
58490/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComplexInnerSubscriber", function() { return ComplexInnerSubscriber; });
58491/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleOuterSubscriber", function() { return SimpleOuterSubscriber; });
58492/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComplexOuterSubscriber", function() { return ComplexOuterSubscriber; });
58493/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "innerSubscribe", function() { return innerSubscribe; });
58494/* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ "7o/Q");
58495/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Observable */ "HDdC");
58496/* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/subscribeTo */ "SeVD");
58497
58498
58499
58500class SimpleInnerSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
58501    constructor(parent) {
58502        super();
58503        this.parent = parent;
58504    }
58505    _next(value) {
58506        this.parent.notifyNext(value);
58507    }
58508    _error(error) {
58509        this.parent.notifyError(error);
58510        this.unsubscribe();
58511    }
58512    _complete() {
58513        this.parent.notifyComplete();
58514        this.unsubscribe();
58515    }
58516}
58517class ComplexInnerSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
58518    constructor(parent, outerValue, outerIndex) {
58519        super();
58520        this.parent = parent;
58521        this.outerValue = outerValue;
58522        this.outerIndex = outerIndex;
58523    }
58524    _next(value) {
58525        this.parent.notifyNext(this.outerValue, value, this.outerIndex, this);
58526    }
58527    _error(error) {
58528        this.parent.notifyError(error);
58529        this.unsubscribe();
58530    }
58531    _complete() {
58532        this.parent.notifyComplete(this);
58533        this.unsubscribe();
58534    }
58535}
58536class SimpleOuterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
58537    notifyNext(innerValue) {
58538        this.destination.next(innerValue);
58539    }
58540    notifyError(err) {
58541        this.destination.error(err);
58542    }
58543    notifyComplete() {
58544        this.destination.complete();
58545    }
58546}
58547class ComplexOuterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"] {
58548    notifyNext(_outerValue, innerValue, _outerIndex, _innerSub) {
58549        this.destination.next(innerValue);
58550    }
58551    notifyError(error) {
58552        this.destination.error(error);
58553    }
58554    notifyComplete(_innerSub) {
58555        this.destination.complete();
58556    }
58557}
58558function innerSubscribe(result, innerSubscriber) {
58559    if (innerSubscriber.closed) {
58560        return undefined;
58561    }
58562    if (result instanceof _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]) {
58563        return result.subscribe(innerSubscriber);
58564    }
58565    let subscription;
58566    try {
58567        subscription = Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_2__["subscribeTo"])(result)(innerSubscriber);
58568    }
58569    catch (error) {
58570        innerSubscriber.error(error);
58571    }
58572    return subscription;
58573}
58574//# sourceMappingURL=innerSubscribe.js.map
58575
58576/***/ })
58577
58578}]);
58579//# sourceMappingURL=vendor-es2015.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.