(self["webpackChunkapp"] = self["webpackChunkapp"] || []).push([[7067],{ /***/ 84505: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/BehaviorSubject.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "BehaviorSubject": () => (/* binding */ BehaviorSubject) /* harmony export */ }); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ 92218); /* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ 89086); class BehaviorSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject { constructor(_value) { super(); this._value = _value; } get value() { return this.getValue(); } _subscribe(subscriber) { const subscription = super._subscribe(subscriber); if (subscription && !subscription.closed) { subscriber.next(this._value); } return subscription; } getValue() { if (this.hasError) { throw this.thrownError; } else if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_1__.ObjectUnsubscribedError(); } else { return this._value; } } next(value) { super.next(this._value = value); } } /***/ }), /***/ 30472: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/InnerSubscriber.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "InnerSubscriber": () => (/* binding */ InnerSubscriber) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ 60014); class InnerSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(parent, outerValue, outerIndex) { super(); this.parent = parent; this.outerValue = outerValue; this.outerIndex = outerIndex; this.index = 0; } _next(value) { this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this); } _error(error) { this.parent.notifyError(error, this); this.unsubscribe(); } _complete() { this.parent.notifyComplete(this); this.unsubscribe(); } } /***/ }), /***/ 12378: /*!***********************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/Observable.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Observable": () => (/* binding */ Observable) /* harmony export */ }); /* harmony import */ var _util_canReportError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/canReportError */ 85739); /* harmony import */ var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/toSubscriber */ 78333); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./symbol/observable */ 36831); /* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/pipe */ 36800); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config */ 20146); class Observable { constructor(subscribe) { this._isScalar = false; if (subscribe) { this._subscribe = subscribe; } } lift(operator) { const observable = new Observable(); observable.source = this; observable.operator = operator; return observable; } subscribe(observerOrNext, error, complete) { const { operator } = this; const sink = (0,_util_toSubscriber__WEBPACK_IMPORTED_MODULE_0__.toSubscriber)(observerOrNext, error, complete); if (operator) { sink.add(operator.call(sink, this.source)); } else { sink.add(this.source || _config__WEBPACK_IMPORTED_MODULE_1__.config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable ? this._subscribe(sink) : this._trySubscribe(sink)); } if (_config__WEBPACK_IMPORTED_MODULE_1__.config.useDeprecatedSynchronousErrorHandling) { if (sink.syncErrorThrowable) { sink.syncErrorThrowable = false; if (sink.syncErrorThrown) { throw sink.syncErrorValue; } } } return sink; } _trySubscribe(sink) { try { return this._subscribe(sink); } catch (err) { if (_config__WEBPACK_IMPORTED_MODULE_1__.config.useDeprecatedSynchronousErrorHandling) { sink.syncErrorThrown = true; sink.syncErrorValue = err; } if ((0,_util_canReportError__WEBPACK_IMPORTED_MODULE_2__.canReportError)(sink)) { sink.error(err); } else { console.warn(err); } } } forEach(next, promiseCtor) { promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor((resolve, reject) => { let subscription; subscription = this.subscribe(value => { try { next(value); } catch (err) { reject(err); if (subscription) { subscription.unsubscribe(); } } }, reject, resolve); }); } _subscribe(subscriber) { const { source } = this; return source && source.subscribe(subscriber); } [_symbol_observable__WEBPACK_IMPORTED_MODULE_3__.observable]() { return this; } pipe(...operations) { if (operations.length === 0) { return this; } return (0,_util_pipe__WEBPACK_IMPORTED_MODULE_4__.pipeFromArray)(operations)(this); } toPromise(promiseCtor) { promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor((resolve, reject) => { let value; this.subscribe(x => value = x, err => reject(err), () => resolve(value)); }); } } Observable.create = subscribe => { return new Observable(subscribe); }; function getPromiseCtor(promiseCtor) { if (!promiseCtor) { promiseCtor = _config__WEBPACK_IMPORTED_MODULE_1__.config.Promise || Promise; } if (!promiseCtor) { throw new Error('no Promise impl found'); } return promiseCtor; } /***/ }), /***/ 99957: /*!*********************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/Observer.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "empty": () => (/* binding */ empty) /* harmony export */ }); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ 20146); /* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/hostReportError */ 28897); const empty = { closed: true, next(value) {}, error(err) { if (_config__WEBPACK_IMPORTED_MODULE_0__.config.useDeprecatedSynchronousErrorHandling) { throw err; } else { (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_1__.hostReportError)(err); } }, complete() {} }; /***/ }), /***/ 75266: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/OuterSubscriber.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "OuterSubscriber": () => (/* binding */ OuterSubscriber) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ 60014); class OuterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.destination.next(innerValue); } notifyError(error, innerSub) { this.destination.error(error); } notifyComplete(innerSub) { this.destination.complete(); } } /***/ }), /***/ 92218: /*!********************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/Subject.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "AnonymousSubject": () => (/* binding */ AnonymousSubject), /* harmony export */ "Subject": () => (/* binding */ Subject), /* harmony export */ "SubjectSubscriber": () => (/* binding */ SubjectSubscriber) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Observable */ 12378); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ 60014); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Subscription */ 32425); /* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ 89086); /* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SubjectSubscription */ 61722); /* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ 61482); class SubjectSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination) { super(destination); this.destination = destination; } } class Subject extends _Observable__WEBPACK_IMPORTED_MODULE_1__.Observable { constructor() { super(); this.observers = []; this.closed = false; this.isStopped = false; this.hasError = false; this.thrownError = null; } [_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_2__.rxSubscriber]() { return new SubjectSubscriber(this); } lift(operator) { const subject = new AnonymousSubject(this, this); subject.operator = operator; return subject; } next(value) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } if (!this.isStopped) { const { observers } = this; const len = observers.length; const copy = observers.slice(); for (let i = 0; i < len; i++) { copy[i].next(value); } } } error(err) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } this.hasError = true; this.thrownError = err; this.isStopped = true; const { observers } = this; const len = observers.length; const copy = observers.slice(); for (let i = 0; i < len; i++) { copy[i].error(err); } this.observers.length = 0; } complete() { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } this.isStopped = true; const { observers } = this; const len = observers.length; const copy = observers.slice(); for (let i = 0; i < len; i++) { copy[i].complete(); } this.observers.length = 0; } unsubscribe() { this.isStopped = true; this.closed = true; this.observers = null; } _trySubscribe(subscriber) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } else { return super._trySubscribe(subscriber); } } _subscribe(subscriber) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_3__.ObjectUnsubscribedError(); } else if (this.hasError) { subscriber.error(this.thrownError); return _Subscription__WEBPACK_IMPORTED_MODULE_4__.Subscription.EMPTY; } else if (this.isStopped) { subscriber.complete(); return _Subscription__WEBPACK_IMPORTED_MODULE_4__.Subscription.EMPTY; } else { this.observers.push(subscriber); return new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__.SubjectSubscription(this, subscriber); } } asObservable() { const observable = new _Observable__WEBPACK_IMPORTED_MODULE_1__.Observable(); observable.source = this; return observable; } } Subject.create = (destination, source) => { return new AnonymousSubject(destination, source); }; class AnonymousSubject extends Subject { constructor(destination, source) { super(); this.destination = destination; this.source = source; } next(value) { const { destination } = this; if (destination && destination.next) { destination.next(value); } } error(err) { const { destination } = this; if (destination && destination.error) { this.destination.error(err); } } complete() { const { destination } = this; if (destination && destination.complete) { this.destination.complete(); } } _subscribe(subscriber) { const { source } = this; if (source) { return this.source.subscribe(subscriber); } else { return _Subscription__WEBPACK_IMPORTED_MODULE_4__.Subscription.EMPTY; } } } /***/ }), /***/ 61722: /*!********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/SubjectSubscription.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "SubjectSubscription": () => (/* binding */ SubjectSubscription) /* harmony export */ }); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscription */ 32425); class SubjectSubscription extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription { constructor(subject, subscriber) { super(); this.subject = subject; this.subscriber = subscriber; this.closed = false; } unsubscribe() { if (this.closed) { return; } this.closed = true; const subject = this.subject; const observers = subject.observers; this.subject = null; if (!observers || observers.length === 0 || subject.isStopped || subject.closed) { return; } const subscriberIndex = observers.indexOf(this.subscriber); if (subscriberIndex !== -1) { observers.splice(subscriberIndex, 1); } } } /***/ }), /***/ 60014: /*!***********************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/Subscriber.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "SafeSubscriber": () => (/* binding */ SafeSubscriber), /* harmony export */ "Subscriber": () => (/* binding */ Subscriber) /* harmony export */ }); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/isFunction */ 51900); /* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Observer */ 99957); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscription */ 32425); /* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../internal/symbol/rxSubscriber */ 61482); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ 20146); /* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/hostReportError */ 28897); class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription { constructor(destinationOrNext, error, complete) { super(); this.syncErrorValue = null; this.syncErrorThrown = false; this.syncErrorThrowable = false; this.isStopped = false; switch (arguments.length) { case 0: this.destination = _Observer__WEBPACK_IMPORTED_MODULE_1__.empty; break; case 1: if (!destinationOrNext) { this.destination = _Observer__WEBPACK_IMPORTED_MODULE_1__.empty; break; } if (typeof destinationOrNext === 'object') { if (destinationOrNext instanceof Subscriber) { this.syncErrorThrowable = destinationOrNext.syncErrorThrowable; this.destination = destinationOrNext; destinationOrNext.add(this); } else { this.syncErrorThrowable = true; this.destination = new SafeSubscriber(this, destinationOrNext); } break; } default: this.syncErrorThrowable = true; this.destination = new SafeSubscriber(this, destinationOrNext, error, complete); break; } } [_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_2__.rxSubscriber]() { return this; } static create(next, error, complete) { const subscriber = new Subscriber(next, error, complete); subscriber.syncErrorThrowable = false; return subscriber; } next(value) { if (!this.isStopped) { this._next(value); } } error(err) { if (!this.isStopped) { this.isStopped = true; this._error(err); } } complete() { if (!this.isStopped) { this.isStopped = true; this._complete(); } } unsubscribe() { if (this.closed) { return; } this.isStopped = true; super.unsubscribe(); } _next(value) { this.destination.next(value); } _error(err) { this.destination.error(err); this.unsubscribe(); } _complete() { this.destination.complete(); this.unsubscribe(); } _unsubscribeAndRecycle() { const { _parentOrParents } = this; this._parentOrParents = null; this.unsubscribe(); this.closed = false; this.isStopped = false; this._parentOrParents = _parentOrParents; return this; } } class SafeSubscriber extends Subscriber { constructor(_parentSubscriber, observerOrNext, error, complete) { super(); this._parentSubscriber = _parentSubscriber; let next; let context = this; if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_3__.isFunction)(observerOrNext)) { next = observerOrNext; } else if (observerOrNext) { next = observerOrNext.next; error = observerOrNext.error; complete = observerOrNext.complete; if (observerOrNext !== _Observer__WEBPACK_IMPORTED_MODULE_1__.empty) { context = Object.create(observerOrNext); if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_3__.isFunction)(context.unsubscribe)) { this.add(context.unsubscribe.bind(context)); } context.unsubscribe = this.unsubscribe.bind(this); } } this._context = context; this._next = next; this._error = error; this._complete = complete; } next(value) { if (!this.isStopped && this._next) { const { _parentSubscriber } = this; if (!_config__WEBPACK_IMPORTED_MODULE_4__.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(this._next, value); } else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) { this.unsubscribe(); } } } error(err) { if (!this.isStopped) { const { _parentSubscriber } = this; const { useDeprecatedSynchronousErrorHandling } = _config__WEBPACK_IMPORTED_MODULE_4__.config; if (this._error) { if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(this._error, err); this.unsubscribe(); } else { this.__tryOrSetError(_parentSubscriber, this._error, err); this.unsubscribe(); } } else if (!_parentSubscriber.syncErrorThrowable) { this.unsubscribe(); if (useDeprecatedSynchronousErrorHandling) { throw err; } (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__.hostReportError)(err); } else { if (useDeprecatedSynchronousErrorHandling) { _parentSubscriber.syncErrorValue = err; _parentSubscriber.syncErrorThrown = true; } else { (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__.hostReportError)(err); } this.unsubscribe(); } } } complete() { if (!this.isStopped) { const { _parentSubscriber } = this; if (this._complete) { const wrappedComplete = () => this._complete.call(this._context); if (!_config__WEBPACK_IMPORTED_MODULE_4__.config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(wrappedComplete); this.unsubscribe(); } else { this.__tryOrSetError(_parentSubscriber, wrappedComplete); this.unsubscribe(); } } else { this.unsubscribe(); } } } __tryOrUnsub(fn, value) { try { fn.call(this._context, value); } catch (err) { this.unsubscribe(); if (_config__WEBPACK_IMPORTED_MODULE_4__.config.useDeprecatedSynchronousErrorHandling) { throw err; } else { (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__.hostReportError)(err); } } } __tryOrSetError(parent, fn, value) { if (!_config__WEBPACK_IMPORTED_MODULE_4__.config.useDeprecatedSynchronousErrorHandling) { throw new Error('bad call'); } try { fn.call(this._context, value); } catch (err) { if (_config__WEBPACK_IMPORTED_MODULE_4__.config.useDeprecatedSynchronousErrorHandling) { parent.syncErrorValue = err; parent.syncErrorThrown = true; return true; } else { (0,_util_hostReportError__WEBPACK_IMPORTED_MODULE_5__.hostReportError)(err); return true; } } return false; } _unsubscribe() { const { _parentSubscriber } = this; this._context = null; this._parentSubscriber = null; _parentSubscriber.unsubscribe(); } } /***/ }), /***/ 32425: /*!*************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/Subscription.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Subscription": () => (/* binding */ Subscription) /* harmony export */ }); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/isArray */ 94327); /* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/isObject */ 36549); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/isFunction */ 51900); /* harmony import */ var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/UnsubscriptionError */ 37875); class Subscription { constructor(unsubscribe) { this.closed = false; this._parentOrParents = null; this._subscriptions = null; if (unsubscribe) { this._ctorUnsubscribe = true; this._unsubscribe = unsubscribe; } } unsubscribe() { let errors; if (this.closed) { return; } let { _parentOrParents, _ctorUnsubscribe, _unsubscribe, _subscriptions } = this; this.closed = true; this._parentOrParents = null; this._subscriptions = null; if (_parentOrParents instanceof Subscription) { _parentOrParents.remove(this); } else if (_parentOrParents !== null) { for (let index = 0; index < _parentOrParents.length; ++index) { const parent = _parentOrParents[index]; parent.remove(this); } } if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(_unsubscribe)) { if (_ctorUnsubscribe) { this._unsubscribe = undefined; } try { _unsubscribe.call(this); } catch (e) { errors = e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e]; } } if ((0,_util_isArray__WEBPACK_IMPORTED_MODULE_2__.isArray)(_subscriptions)) { let index = -1; let len = _subscriptions.length; while (++index < len) { const sub = _subscriptions[index]; if ((0,_util_isObject__WEBPACK_IMPORTED_MODULE_3__.isObject)(sub)) { try { sub.unsubscribe(); } catch (e) { errors = errors || []; if (e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError) { errors = errors.concat(flattenUnsubscriptionErrors(e.errors)); } else { errors.push(e); } } } } } if (errors) { throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError(errors); } } add(teardown) { let subscription = teardown; if (!teardown) { return Subscription.EMPTY; } switch (typeof teardown) { case 'function': subscription = new Subscription(teardown); case 'object': if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') { return subscription; } else if (this.closed) { subscription.unsubscribe(); return subscription; } else if (!(subscription instanceof Subscription)) { const tmp = subscription; subscription = new Subscription(); subscription._subscriptions = [tmp]; } break; default: { throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.'); } } let { _parentOrParents } = subscription; if (_parentOrParents === null) { subscription._parentOrParents = this; } else if (_parentOrParents instanceof Subscription) { if (_parentOrParents === this) { return subscription; } subscription._parentOrParents = [_parentOrParents, this]; } else if (_parentOrParents.indexOf(this) === -1) { _parentOrParents.push(this); } else { return subscription; } const subscriptions = this._subscriptions; if (subscriptions === null) { this._subscriptions = [subscription]; } else { subscriptions.push(subscription); } return subscription; } remove(subscription) { const subscriptions = this._subscriptions; if (subscriptions) { const subscriptionIndex = subscriptions.indexOf(subscription); if (subscriptionIndex !== -1) { subscriptions.splice(subscriptionIndex, 1); } } } } Subscription.EMPTY = function (empty) { empty.closed = true; return empty; }(new Subscription()); function flattenUnsubscriptionErrors(errors) { return errors.reduce((errs, err) => errs.concat(err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError ? err.errors : err), []); } /***/ }), /***/ 20146: /*!*******************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/config.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "config": () => (/* binding */ config) /* harmony export */ }); let _enable_super_gross_mode_that_will_cause_bad_things = false; const config = { Promise: undefined, set useDeprecatedSynchronousErrorHandling(value) { if (value) { const error = new Error(); console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack); } else if (_enable_super_gross_mode_that_will_cause_bad_things) { console.log('RxJS: Back to a better error behavior. Thank you. <3'); } _enable_super_gross_mode_that_will_cause_bad_things = value; }, get useDeprecatedSynchronousErrorHandling() { return _enable_super_gross_mode_that_will_cause_bad_things; } }; /***/ }), /***/ 52831: /*!***************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/innerSubscribe.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ComplexInnerSubscriber": () => (/* binding */ ComplexInnerSubscriber), /* harmony export */ "ComplexOuterSubscriber": () => (/* binding */ ComplexOuterSubscriber), /* harmony export */ "SimpleInnerSubscriber": () => (/* binding */ SimpleInnerSubscriber), /* harmony export */ "SimpleOuterSubscriber": () => (/* binding */ SimpleOuterSubscriber), /* harmony export */ "innerSubscribe": () => (/* binding */ innerSubscribe) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ 60014); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Observable */ 12378); /* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/subscribeTo */ 16983); class SimpleInnerSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(parent) { super(); this.parent = parent; } _next(value) { this.parent.notifyNext(value); } _error(error) { this.parent.notifyError(error); this.unsubscribe(); } _complete() { this.parent.notifyComplete(); this.unsubscribe(); } } class ComplexInnerSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(parent, outerValue, outerIndex) { super(); this.parent = parent; this.outerValue = outerValue; this.outerIndex = outerIndex; } _next(value) { this.parent.notifyNext(this.outerValue, value, this.outerIndex, this); } _error(error) { this.parent.notifyError(error); this.unsubscribe(); } _complete() { this.parent.notifyComplete(this); this.unsubscribe(); } } class SimpleOuterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { notifyNext(innerValue) { this.destination.next(innerValue); } notifyError(err) { this.destination.error(err); } notifyComplete() { this.destination.complete(); } } class ComplexOuterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { notifyNext(_outerValue, innerValue, _outerIndex, _innerSub) { this.destination.next(innerValue); } notifyError(error) { this.destination.error(error); } notifyComplete(_innerSub) { this.destination.complete(); } } function innerSubscribe(result, innerSubscriber) { if (innerSubscriber.closed) { return undefined; } if (result instanceof _Observable__WEBPACK_IMPORTED_MODULE_1__.Observable) { return result.subscribe(innerSubscriber); } let subscription; try { subscription = (0,_util_subscribeTo__WEBPACK_IMPORTED_MODULE_2__.subscribeTo)(result)(innerSubscriber); } catch (error) { innerSubscriber.error(error); } return subscription; } /***/ }), /***/ 64483: /*!*********************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/observable/ConnectableObservable.js ***! \*********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ConnectableObservable": () => (/* binding */ ConnectableObservable), /* harmony export */ "connectableObservableDescriptor": () => (/* binding */ connectableObservableDescriptor) /* harmony export */ }); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Subject */ 92218); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Subscriber */ 60014); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ 32425); /* harmony import */ var _operators_refCount__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/refCount */ 38331); class ConnectableObservable extends _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable { constructor(source, subjectFactory) { super(); this.source = source; this.subjectFactory = subjectFactory; this._refCount = 0; this._isComplete = false; } _subscribe(subscriber) { return this.getSubject().subscribe(subscriber); } getSubject() { const subject = this._subject; if (!subject || subject.isStopped) { this._subject = this.subjectFactory(); } return this._subject; } connect() { let connection = this._connection; if (!connection) { this._isComplete = false; connection = this._connection = new _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription(); connection.add(this.source.subscribe(new ConnectableSubscriber(this.getSubject(), this))); if (connection.closed) { this._connection = null; connection = _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription.EMPTY; } } return connection; } refCount() { return (0,_operators_refCount__WEBPACK_IMPORTED_MODULE_2__.refCount)()(this); } } const connectableObservableDescriptor = (() => { const connectableProto = ConnectableObservable.prototype; return { operator: { value: null }, _refCount: { value: 0, writable: true }, _subject: { value: null, writable: true }, _connection: { value: null, writable: true }, _subscribe: { value: connectableProto._subscribe }, _isComplete: { value: connectableProto._isComplete, writable: true }, getSubject: { value: connectableProto.getSubject }, connect: { value: connectableProto.connect }, refCount: { value: connectableProto.refCount } }; })(); class ConnectableSubscriber extends _Subject__WEBPACK_IMPORTED_MODULE_3__.SubjectSubscriber { constructor(destination, connectable) { super(destination); this.connectable = connectable; } _error(err) { this._unsubscribe(); super._error(err); } _complete() { this.connectable._isComplete = true; this._unsubscribe(); super._complete(); } _unsubscribe() { const connectable = this.connectable; if (connectable) { this.connectable = null; const connection = connectable._connection; connectable._refCount = 0; connectable._subject = null; connectable._connection = null; if (connection) { connection.unsubscribe(); } } } } class RefCountOperator { constructor(connectable) { this.connectable = connectable; } call(subscriber, source) { const { connectable } = this; connectable._refCount++; const refCounter = new RefCountSubscriber(subscriber, connectable); const subscription = source.subscribe(refCounter); if (!refCounter.closed) { refCounter.connection = connectable.connect(); } return subscription; } } class RefCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_4__.Subscriber { constructor(destination, connectable) { super(destination); this.connectable = connectable; } _unsubscribe() { const { connectable } = this; if (!connectable) { this.connection = null; return; } this.connectable = null; const refCount = connectable._refCount; if (refCount <= 0) { this.connection = null; return; } connectable._refCount = refCount - 1; if (refCount > 1) { this.connection = null; return; } const { connection } = this; const sharedConnection = connectable._connection; this.connection = null; if (sharedConnection && (!connection || sharedConnection === connection)) { sharedConnection.unsubscribe(); } } } /***/ }), /***/ 19193: /*!*************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/observable/combineLatest.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "CombineLatestOperator": () => (/* binding */ CombineLatestOperator), /* harmony export */ "CombineLatestSubscriber": () => (/* binding */ CombineLatestSubscriber), /* harmony export */ "combineLatest": () => (/* binding */ combineLatest) /* harmony export */ }); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isScheduler */ 27507); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArray */ 94327); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../OuterSubscriber */ 75266); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/subscribeToResult */ 60640); /* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fromArray */ 28005); const NONE = {}; function combineLatest(...observables) { let resultSelector = undefined; let scheduler = undefined; if ((0,_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__.isScheduler)(observables[observables.length - 1])) { scheduler = observables.pop(); } if (typeof observables[observables.length - 1] === 'function') { resultSelector = observables.pop(); } if (observables.length === 1 && (0,_util_isArray__WEBPACK_IMPORTED_MODULE_1__.isArray)(observables[0])) { observables = observables[0]; } return (0,_fromArray__WEBPACK_IMPORTED_MODULE_2__.fromArray)(observables, scheduler).lift(new CombineLatestOperator(resultSelector)); } class CombineLatestOperator { constructor(resultSelector) { this.resultSelector = resultSelector; } call(subscriber, source) { return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector)); } } class CombineLatestSubscriber extends _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__.OuterSubscriber { constructor(destination, resultSelector) { super(destination); this.resultSelector = resultSelector; this.active = 0; this.values = []; this.observables = []; } _next(observable) { this.values.push(NONE); this.observables.push(observable); } _complete() { const observables = this.observables; const len = observables.length; if (len === 0) { this.destination.complete(); } else { this.active = len; this.toRespond = len; for (let i = 0; i < len; i++) { const observable = observables[i]; this.add((0,_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__.subscribeToResult)(this, observable, undefined, i)); } } } notifyComplete(unused) { if ((this.active -= 1) === 0) { this.destination.complete(); } } notifyNext(_outerValue, innerValue, outerIndex) { const values = this.values; const oldVal = values[outerIndex]; const toRespond = !this.toRespond ? 0 : oldVal === NONE ? --this.toRespond : this.toRespond; values[outerIndex] = innerValue; if (toRespond === 0) { if (this.resultSelector) { this._tryResultSelector(values); } else { this.destination.next(values.slice()); } } } _tryResultSelector(values) { let result; try { result = this.resultSelector.apply(this, values); } catch (err) { this.destination.error(err); return; } this.destination.next(result); } } /***/ }), /***/ 55828: /*!******************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/observable/concat.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "concat": () => (/* binding */ concat) /* harmony export */ }); /* harmony import */ var _of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./of */ 64139); /* harmony import */ var _operators_concatAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operators/concatAll */ 12692); function concat(...observables) { return (0,_operators_concatAll__WEBPACK_IMPORTED_MODULE_0__.concatAll)()((0,_of__WEBPACK_IMPORTED_MODULE_1__.of)(...observables)); } /***/ }), /***/ 1635: /*!*****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/observable/defer.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "defer": () => (/* binding */ defer) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); /* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ 24383); /* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty */ 26439); function defer(observableFactory) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { let input; try { input = observableFactory(); } catch (err) { subscriber.error(err); return undefined; } const source = input ? (0,_from__WEBPACK_IMPORTED_MODULE_1__.from)(input) : (0,_empty__WEBPACK_IMPORTED_MODULE_2__.empty)(); return source.subscribe(subscriber); }); } /***/ }), /***/ 26439: /*!*****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/observable/empty.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "EMPTY": () => (/* binding */ EMPTY), /* harmony export */ "empty": () => (/* binding */ empty) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); const EMPTY = new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => subscriber.complete()); function empty(scheduler) { return scheduler ? emptyScheduled(scheduler) : EMPTY; } function emptyScheduled(scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => scheduler.schedule(() => subscriber.complete())); } /***/ }), /***/ 24383: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/observable/from.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "from": () => (/* binding */ from) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); /* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeTo */ 16983); /* harmony import */ var _scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduled/scheduled */ 12476); function from(input, scheduler) { if (!scheduler) { if (input instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable) { return input; } return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable((0,_util_subscribeTo__WEBPACK_IMPORTED_MODULE_1__.subscribeTo)(input)); } else { return (0,_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_2__.scheduled)(input, scheduler); } } /***/ }), /***/ 28005: /*!*********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/observable/fromArray.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "fromArray": () => (/* binding */ fromArray) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); /* harmony import */ var _util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/subscribeToArray */ 5414); /* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../scheduled/scheduleArray */ 58403); function fromArray(input, scheduler) { if (!scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable((0,_util_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__.subscribeToArray)(input)); } else { return (0,_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_2__.scheduleArray)(input, scheduler); } } /***/ }), /***/ 64139: /*!**************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/observable/of.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "of": () => (/* binding */ of) /* harmony export */ }); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isScheduler */ 27507); /* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fromArray */ 28005); /* harmony import */ var _scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduled/scheduleArray */ 58403); function of(...args) { let scheduler = args[args.length - 1]; if ((0,_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__.isScheduler)(scheduler)) { args.pop(); return (0,_scheduled_scheduleArray__WEBPACK_IMPORTED_MODULE_1__.scheduleArray)(args, scheduler); } else { return (0,_fromArray__WEBPACK_IMPORTED_MODULE_2__.fromArray)(args); } } /***/ }), /***/ 66587: /*!**********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/observable/throwError.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "throwError": () => (/* binding */ throwError) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); function throwError(error, scheduler) { if (!scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => subscriber.error(error)); } else { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => scheduler.schedule(dispatch, 0, { error, subscriber })); } } function dispatch({ error, subscriber }) { subscriber.error(error); } /***/ }), /***/ 47418: /*!*********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/catchError.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "catchError": () => (/* binding */ catchError) /* harmony export */ }); /* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../innerSubscribe */ 52831); function catchError(selector) { return function catchErrorOperatorFunction(source) { const operator = new CatchOperator(selector); const caught = source.lift(operator); return operator.caught = caught; }; } class CatchOperator { constructor(selector) { this.selector = selector; } call(subscriber, source) { return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught)); } } class CatchSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__.SimpleOuterSubscriber { constructor(destination, selector, caught) { super(destination); this.selector = selector; this.caught = caught; } error(err) { if (!this.isStopped) { let result; try { result = this.selector(err, this.caught); } catch (err2) { super.error(err2); return; } this._unsubscribeAndRecycle(); const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_0__.SimpleInnerSubscriber(this); this.add(innerSubscriber); const innerSubscription = (0,_innerSubscribe__WEBPACK_IMPORTED_MODULE_0__.innerSubscribe)(result, innerSubscriber); if (innerSubscription !== innerSubscriber) { this.add(innerSubscription); } } } } /***/ }), /***/ 12692: /*!********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/concatAll.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "concatAll": () => (/* binding */ concatAll) /* harmony export */ }); /* harmony import */ var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeAll */ 76675); function concatAll() { return (0,_mergeAll__WEBPACK_IMPORTED_MODULE_0__.mergeAll)(1); } /***/ }), /***/ 11133: /*!********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/concatMap.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "concatMap": () => (/* binding */ concatMap) /* harmony export */ }); /* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ 80522); function concatMap(project, resultSelector) { return (0,_mergeMap__WEBPACK_IMPORTED_MODULE_0__.mergeMap)(project, resultSelector, 1); } /***/ }), /***/ 9701: /*!*************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "defaultIfEmpty": () => (/* binding */ defaultIfEmpty) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); function defaultIfEmpty(defaultValue = null) { return source => source.lift(new DefaultIfEmptyOperator(defaultValue)); } class DefaultIfEmptyOperator { constructor(defaultValue) { this.defaultValue = defaultValue; } call(subscriber, source) { return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue)); } } class DefaultIfEmptySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, defaultValue) { super(destination); this.defaultValue = defaultValue; this.isEmpty = true; } _next(value) { this.isEmpty = false; this.destination.next(value); } _complete() { if (this.isEmpty) { this.destination.next(this.defaultValue); } this.destination.complete(); } } /***/ }), /***/ 59151: /*!*****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/filter.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "filter": () => (/* binding */ filter) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); function filter(predicate, thisArg) { return function filterOperatorFunction(source) { return source.lift(new FilterOperator(predicate, thisArg)); }; } class FilterOperator { constructor(predicate, thisArg) { this.predicate = predicate; this.thisArg = thisArg; } call(subscriber, source) { return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg)); } } class FilterSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, predicate, thisArg) { super(destination); this.predicate = predicate; this.thisArg = thisArg; this.count = 0; } _next(value) { let result; try { result = this.predicate.call(this.thisArg, value, this.count++); } catch (err) { this.destination.error(err); return; } if (result) { this.destination.next(value); } } } /***/ }), /***/ 44661: /*!*******************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/finalize.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "finalize": () => (/* binding */ finalize) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ 32425); function finalize(callback) { return source => source.lift(new FinallyOperator(callback)); } class FinallyOperator { constructor(callback) { this.callback = callback; } call(subscriber, source) { return source.subscribe(new FinallySubscriber(subscriber, this.callback)); } } class FinallySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, callback) { super(destination); this.add(new _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription(callback)); } } /***/ }), /***/ 25670: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/first.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "first": () => (/* binding */ first) /* harmony export */ }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/EmptyError */ 90213); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter */ 59151); /* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./take */ 83910); /* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultIfEmpty */ 9701); /* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./throwIfEmpty */ 72013); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ 1356); function first(predicate, defaultValue) { const hasDefaultValue = arguments.length >= 2; return source => source.pipe(predicate ? (0,_filter__WEBPACK_IMPORTED_MODULE_0__.filter)((v, i) => predicate(v, i, source)) : _util_identity__WEBPACK_IMPORTED_MODULE_1__.identity, (0,_take__WEBPACK_IMPORTED_MODULE_2__.take)(1), hasDefaultValue ? (0,_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__.defaultIfEmpty)(defaultValue) : (0,_throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__.throwIfEmpty)(() => new _util_EmptyError__WEBPACK_IMPORTED_MODULE_5__.EmptyError())); } /***/ }), /***/ 35690: /*!***************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/last.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "last": () => (/* binding */ last) /* harmony export */ }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/EmptyError */ 90213); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter */ 59151); /* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./takeLast */ 52160); /* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./throwIfEmpty */ 72013); /* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultIfEmpty */ 9701); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ 1356); function last(predicate, defaultValue) { const hasDefaultValue = arguments.length >= 2; return source => source.pipe(predicate ? (0,_filter__WEBPACK_IMPORTED_MODULE_0__.filter)((v, i) => predicate(v, i, source)) : _util_identity__WEBPACK_IMPORTED_MODULE_1__.identity, (0,_takeLast__WEBPACK_IMPORTED_MODULE_2__.takeLast)(1), hasDefaultValue ? (0,_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__.defaultIfEmpty)(defaultValue) : (0,_throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__.throwIfEmpty)(() => new _util_EmptyError__WEBPACK_IMPORTED_MODULE_5__.EmptyError())); } /***/ }), /***/ 86942: /*!**************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/map.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "MapOperator": () => (/* binding */ MapOperator), /* harmony export */ "map": () => (/* binding */ map) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); function map(project, thisArg) { return function mapOperation(source) { if (typeof project !== 'function') { throw new TypeError('argument is not a function. Are you looking for `mapTo()`?'); } return source.lift(new MapOperator(project, thisArg)); }; } class MapOperator { constructor(project, thisArg) { this.project = project; this.thisArg = thisArg; } call(subscriber, source) { return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg)); } } class MapSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, project, thisArg) { super(destination); this.project = project; this.count = 0; this.thisArg = thisArg || this; } _next(value) { let result; try { result = this.project.call(this.thisArg, value, this.count++); } catch (err) { this.destination.error(err); return; } this.destination.next(result); } } /***/ }), /***/ 29361: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/mapTo.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "mapTo": () => (/* binding */ mapTo) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); function mapTo(value) { return source => source.lift(new MapToOperator(value)); } class MapToOperator { constructor(value) { this.value = value; } call(subscriber, source) { return source.subscribe(new MapToSubscriber(subscriber, this.value)); } } class MapToSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, value) { super(destination); this.value = value; } _next(x) { this.destination.next(this.value); } } /***/ }), /***/ 76675: /*!*******************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeAll.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "mergeAll": () => (/* binding */ mergeAll) /* harmony export */ }); /* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ 80522); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ 1356); function mergeAll(concurrent = Number.POSITIVE_INFINITY) { return (0,_mergeMap__WEBPACK_IMPORTED_MODULE_0__.mergeMap)(_util_identity__WEBPACK_IMPORTED_MODULE_1__.identity, concurrent); } /***/ }), /***/ 80522: /*!*******************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/mergeMap.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "MergeMapOperator": () => (/* binding */ MergeMapOperator), /* harmony export */ "MergeMapSubscriber": () => (/* binding */ MergeMapSubscriber), /* harmony export */ "flatMap": () => (/* binding */ flatMap), /* harmony export */ "mergeMap": () => (/* binding */ mergeMap) /* harmony export */ }); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map */ 86942); /* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/from */ 24383); /* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../innerSubscribe */ 52831); function mergeMap(project, resultSelector, concurrent = Number.POSITIVE_INFINITY) { if (typeof resultSelector === 'function') { return source => source.pipe(mergeMap((a, i) => (0,_observable_from__WEBPACK_IMPORTED_MODULE_0__.from)(project(a, i)).pipe((0,_map__WEBPACK_IMPORTED_MODULE_1__.map)((b, ii) => resultSelector(a, b, i, ii))), concurrent)); } else if (typeof resultSelector === 'number') { concurrent = resultSelector; } return source => source.lift(new MergeMapOperator(project, concurrent)); } class MergeMapOperator { constructor(project, concurrent = Number.POSITIVE_INFINITY) { this.project = project; this.concurrent = concurrent; } call(observer, source) { return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent)); } } class MergeMapSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__.SimpleOuterSubscriber { constructor(destination, project, concurrent = Number.POSITIVE_INFINITY) { super(destination); this.project = project; this.concurrent = concurrent; this.hasCompleted = false; this.buffer = []; this.active = 0; this.index = 0; } _next(value) { if (this.active < this.concurrent) { this._tryNext(value); } else { this.buffer.push(value); } } _tryNext(value) { let result; const index = this.index++; try { result = this.project(value, index); } catch (err) { this.destination.error(err); return; } this.active++; this._innerSub(result); } _innerSub(ish) { const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__.SimpleInnerSubscriber(this); const destination = this.destination; destination.add(innerSubscriber); const innerSubscription = (0,_innerSubscribe__WEBPACK_IMPORTED_MODULE_2__.innerSubscribe)(ish, innerSubscriber); if (innerSubscription !== innerSubscriber) { destination.add(innerSubscription); } } _complete() { this.hasCompleted = true; if (this.active === 0 && this.buffer.length === 0) { this.destination.complete(); } this.unsubscribe(); } notifyNext(innerValue) { this.destination.next(innerValue); } notifyComplete() { const buffer = this.buffer; this.active--; if (buffer.length > 0) { this._next(buffer.shift()); } else if (this.active === 0 && this.hasCompleted) { this.destination.complete(); } } } const flatMap = mergeMap; /***/ }), /***/ 38331: /*!*******************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/refCount.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "refCount": () => (/* binding */ refCount) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); function refCount() { return function refCountOperatorFunction(source) { return source.lift(new RefCountOperator(source)); }; } class RefCountOperator { constructor(connectable) { this.connectable = connectable; } call(subscriber, source) { const { connectable } = this; connectable._refCount++; const refCounter = new RefCountSubscriber(subscriber, connectable); const subscription = source.subscribe(refCounter); if (!refCounter.closed) { refCounter.connection = connectable.connect(); } return subscription; } } class RefCountSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, connectable) { super(destination); this.connectable = connectable; } _unsubscribe() { const { connectable } = this; if (!connectable) { this.connection = null; return; } this.connectable = null; const refCount = connectable._refCount; if (refCount <= 0) { this.connection = null; return; } connectable._refCount = refCount - 1; if (refCount > 1) { this.connection = null; return; } const { connection } = this; const sharedConnection = connectable._connection; this.connection = null; if (sharedConnection && (!connection || sharedConnection === connection)) { sharedConnection.unsubscribe(); } } } /***/ }), /***/ 32647: /*!***************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/scan.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "scan": () => (/* binding */ scan) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); function scan(accumulator, seed) { let hasSeed = false; if (arguments.length >= 2) { hasSeed = true; } return function scanOperatorFunction(source) { return source.lift(new ScanOperator(accumulator, seed, hasSeed)); }; } class ScanOperator { constructor(accumulator, seed, hasSeed = false) { this.accumulator = accumulator; this.seed = seed; this.hasSeed = hasSeed; } call(subscriber, source) { return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed)); } } class ScanSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, accumulator, _seed, hasSeed) { super(destination); this.accumulator = accumulator; this._seed = _seed; this.hasSeed = hasSeed; this.index = 0; } get seed() { return this._seed; } set seed(value) { this.hasSeed = true; this._seed = value; } _next(value) { if (!this.hasSeed) { this.seed = value; this.destination.next(value); } else { return this._tryNext(value); } } _tryNext(value) { const index = this.index++; let result; try { result = this.accumulator(this.seed, value, index); } catch (err) { this.destination.error(err); } this.seed = result; this.destination.next(result); } } /***/ }), /***/ 25722: /*!********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/startWith.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "startWith": () => (/* binding */ startWith) /* harmony export */ }); /* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/concat */ 55828); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isScheduler */ 27507); function startWith(...array) { const scheduler = array[array.length - 1]; if ((0,_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__.isScheduler)(scheduler)) { array.pop(); return source => (0,_observable_concat__WEBPACK_IMPORTED_MODULE_1__.concat)(array, source, scheduler); } else { return source => (0,_observable_concat__WEBPACK_IMPORTED_MODULE_1__.concat)(array, source); } } /***/ }), /***/ 59095: /*!********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/switchMap.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "switchMap": () => (/* binding */ switchMap) /* harmony export */ }); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map */ 86942); /* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/from */ 24383); /* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../innerSubscribe */ 52831); function switchMap(project, resultSelector) { if (typeof resultSelector === 'function') { return source => source.pipe(switchMap((a, i) => (0,_observable_from__WEBPACK_IMPORTED_MODULE_0__.from)(project(a, i)).pipe((0,_map__WEBPACK_IMPORTED_MODULE_1__.map)((b, ii) => resultSelector(a, b, i, ii))))); } return source => source.lift(new SwitchMapOperator(project)); } class SwitchMapOperator { constructor(project) { this.project = project; } call(subscriber, source) { return source.subscribe(new SwitchMapSubscriber(subscriber, this.project)); } } class SwitchMapSubscriber extends _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__.SimpleOuterSubscriber { constructor(destination, project) { super(destination); this.project = project; this.index = 0; } _next(value) { let result; const index = this.index++; try { result = this.project(value, index); } catch (error) { this.destination.error(error); return; } this._innerSub(result); } _innerSub(result) { const innerSubscription = this.innerSubscription; if (innerSubscription) { innerSubscription.unsubscribe(); } const innerSubscriber = new _innerSubscribe__WEBPACK_IMPORTED_MODULE_2__.SimpleInnerSubscriber(this); const destination = this.destination; destination.add(innerSubscriber); this.innerSubscription = (0,_innerSubscribe__WEBPACK_IMPORTED_MODULE_2__.innerSubscribe)(result, innerSubscriber); if (this.innerSubscription !== innerSubscriber) { destination.add(this.innerSubscription); } } _complete() { const { innerSubscription } = this; if (!innerSubscription || innerSubscription.closed) { super._complete(); } this.unsubscribe(); } _unsubscribe() { this.innerSubscription = undefined; } notifyComplete() { this.innerSubscription = undefined; if (this.isStopped) { super._complete(); } } notifyNext(innerValue) { this.destination.next(innerValue); } } /***/ }), /***/ 83910: /*!***************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/take.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "take": () => (/* binding */ take) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ 60014); /* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ 2846); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/empty */ 26439); function take(count) { return source => { if (count === 0) { return (0,_observable_empty__WEBPACK_IMPORTED_MODULE_0__.empty)(); } else { return source.lift(new TakeOperator(count)); } }; } class TakeOperator { constructor(total) { this.total = total; if (this.total < 0) { throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__.ArgumentOutOfRangeError(); } } call(subscriber, source) { return source.subscribe(new TakeSubscriber(subscriber, this.total)); } } class TakeSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__.Subscriber { constructor(destination, total) { super(destination); this.total = total; this.count = 0; } _next(value) { const total = this.total; const count = ++this.count; if (count <= total) { this.destination.next(value); if (count === total) { this.destination.complete(); this.unsubscribe(); } } } } /***/ }), /***/ 52160: /*!*******************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/takeLast.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "takeLast": () => (/* binding */ takeLast) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ 60014); /* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/ArgumentOutOfRangeError */ 2846); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/empty */ 26439); function takeLast(count) { return function takeLastOperatorFunction(source) { if (count === 0) { return (0,_observable_empty__WEBPACK_IMPORTED_MODULE_0__.empty)(); } else { return source.lift(new TakeLastOperator(count)); } }; } class TakeLastOperator { constructor(total) { this.total = total; if (this.total < 0) { throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_1__.ArgumentOutOfRangeError(); } } call(subscriber, source) { return source.subscribe(new TakeLastSubscriber(subscriber, this.total)); } } class TakeLastSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_2__.Subscriber { constructor(destination, total) { super(destination); this.total = total; this.ring = new Array(); this.count = 0; } _next(value) { const ring = this.ring; const total = this.total; const count = this.count++; if (ring.length < total) { ring.push(value); } else { const index = count % total; ring[index] = value; } } _complete() { const destination = this.destination; let count = this.count; if (count > 0) { const total = this.count >= this.total ? this.total : this.count; const ring = this.ring; for (let i = 0; i < total; i++) { const idx = count++ % total; destination.next(ring[idx]); } } destination.complete(); } } /***/ }), /***/ 45050: /*!********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/takeWhile.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "takeWhile": () => (/* binding */ takeWhile) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); function takeWhile(predicate, inclusive = false) { return source => source.lift(new TakeWhileOperator(predicate, inclusive)); } class TakeWhileOperator { constructor(predicate, inclusive) { this.predicate = predicate; this.inclusive = inclusive; } call(subscriber, source) { return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive)); } } class TakeWhileSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, predicate, inclusive) { super(destination); this.predicate = predicate; this.inclusive = inclusive; this.index = 0; } _next(value) { const destination = this.destination; let result; try { result = this.predicate(value, this.index++); } catch (err) { destination.error(err); return; } this.nextOrComplete(value, result); } nextOrComplete(value, predicateResult) { const destination = this.destination; if (Boolean(predicateResult)) { destination.next(value); } else { if (this.inclusive) { destination.next(value); } destination.complete(); } } } /***/ }), /***/ 88759: /*!**************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/tap.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "tap": () => (/* binding */ tap) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); /* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/noop */ 76882); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ 51900); function tap(nextOrObserver, error, complete) { return function tapOperatorFunction(source) { return source.lift(new DoOperator(nextOrObserver, error, complete)); }; } class DoOperator { constructor(nextOrObserver, error, complete) { this.nextOrObserver = nextOrObserver; this.error = error; this.complete = complete; } call(subscriber, source) { return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete)); } } class TapSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, observerOrNext, error, complete) { super(destination); this._tapNext = _util_noop__WEBPACK_IMPORTED_MODULE_1__.noop; this._tapError = _util_noop__WEBPACK_IMPORTED_MODULE_1__.noop; this._tapComplete = _util_noop__WEBPACK_IMPORTED_MODULE_1__.noop; this._tapError = error || _util_noop__WEBPACK_IMPORTED_MODULE_1__.noop; this._tapComplete = complete || _util_noop__WEBPACK_IMPORTED_MODULE_1__.noop; if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_2__.isFunction)(observerOrNext)) { this._context = this; this._tapNext = observerOrNext; } else if (observerOrNext) { this._context = observerOrNext; this._tapNext = observerOrNext.next || _util_noop__WEBPACK_IMPORTED_MODULE_1__.noop; this._tapError = observerOrNext.error || _util_noop__WEBPACK_IMPORTED_MODULE_1__.noop; this._tapComplete = observerOrNext.complete || _util_noop__WEBPACK_IMPORTED_MODULE_1__.noop; } } _next(value) { try { this._tapNext.call(this._context, value); } catch (err) { this.destination.error(err); return; } this.destination.next(value); } _error(err) { try { this._tapError.call(this._context, err); } catch (err) { this.destination.error(err); return; } this.destination.error(err); } _complete() { try { this._tapComplete.call(this._context); } catch (err) { this.destination.error(err); return; } return this.destination.complete(); } } /***/ }), /***/ 72013: /*!***********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "throwIfEmpty": () => (/* binding */ throwIfEmpty) /* harmony export */ }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/EmptyError */ 90213); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); function throwIfEmpty(errorFactory = defaultErrorFactory) { return source => { return source.lift(new ThrowIfEmptyOperator(errorFactory)); }; } class ThrowIfEmptyOperator { constructor(errorFactory) { this.errorFactory = errorFactory; } call(subscriber, source) { return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory)); } } class ThrowIfEmptySubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, errorFactory) { super(destination); this.errorFactory = errorFactory; this.hasValue = false; } _next(value) { this.hasValue = true; this.destination.next(value); } _complete() { if (!this.hasValue) { let err; try { err = this.errorFactory(); } catch (e) { err = e; } this.destination.error(err); } else { return this.destination.complete(); } } } function defaultErrorFactory() { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__.EmptyError(); } /***/ }), /***/ 58403: /*!************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduleArray.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "scheduleArray": () => (/* binding */ scheduleArray) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ 32425); function scheduleArray(input, scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription(); let i = 0; sub.add(scheduler.schedule(function () { if (i === input.length) { subscriber.complete(); return; } subscriber.next(input[i++]); if (!subscriber.closed) { sub.add(this.schedule()); } })); return sub; }); } /***/ }), /***/ 91232: /*!***************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduleIterable.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "scheduleIterable": () => (/* binding */ scheduleIterable) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ 32425); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../symbol/iterator */ 12803); function scheduleIterable(input, scheduler) { if (!input) { throw new Error('Iterable cannot be null'); } return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription(); let iterator; sub.add(() => { if (iterator && typeof iterator.return === 'function') { iterator.return(); } }); sub.add(scheduler.schedule(() => { iterator = input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__.iterator](); sub.add(scheduler.schedule(function () { if (subscriber.closed) { return; } let value; let done; try { const result = iterator.next(); value = result.value; done = result.done; } catch (err) { subscriber.error(err); return; } if (done) { subscriber.complete(); } else { subscriber.next(value); this.schedule(); } })); })); return sub; }); } /***/ }), /***/ 61145: /*!*****************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduleObservable.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "scheduleObservable": () => (/* binding */ scheduleObservable) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ 32425); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../symbol/observable */ 36831); function scheduleObservable(input, scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription(); sub.add(scheduler.schedule(() => { const observable = input[_symbol_observable__WEBPACK_IMPORTED_MODULE_2__.observable](); sub.add(observable.subscribe({ next(value) { sub.add(scheduler.schedule(() => subscriber.next(value))); }, error(err) { sub.add(scheduler.schedule(() => subscriber.error(err))); }, complete() { sub.add(scheduler.schedule(() => subscriber.complete())); } })); })); return sub; }); } /***/ }), /***/ 20467: /*!**************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/scheduled/schedulePromise.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "schedulePromise": () => (/* binding */ schedulePromise) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 12378); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ 32425); function schedulePromise(input, scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { const sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription(); sub.add(scheduler.schedule(() => input.then(value => { sub.add(scheduler.schedule(() => { subscriber.next(value); sub.add(scheduler.schedule(() => subscriber.complete())); })); }, err => { sub.add(scheduler.schedule(() => subscriber.error(err))); }))); return sub; }); } /***/ }), /***/ 12476: /*!********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/scheduled/scheduled.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "scheduled": () => (/* binding */ scheduled) /* harmony export */ }); /* harmony import */ var _scheduleObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scheduleObservable */ 61145); /* harmony import */ var _schedulePromise__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./schedulePromise */ 20467); /* harmony import */ var _scheduleArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./scheduleArray */ 58403); /* harmony import */ var _scheduleIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./scheduleIterable */ 91232); /* harmony import */ var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isInteropObservable */ 5781); /* harmony import */ var _util_isPromise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isPromise */ 25192); /* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isArrayLike */ 55122); /* harmony import */ var _util_isIterable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/isIterable */ 99674); function scheduled(input, scheduler) { if (input != null) { if ((0,_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_0__.isInteropObservable)(input)) { return (0,_scheduleObservable__WEBPACK_IMPORTED_MODULE_1__.scheduleObservable)(input, scheduler); } else if ((0,_util_isPromise__WEBPACK_IMPORTED_MODULE_2__.isPromise)(input)) { return (0,_schedulePromise__WEBPACK_IMPORTED_MODULE_3__.schedulePromise)(input, scheduler); } else if ((0,_util_isArrayLike__WEBPACK_IMPORTED_MODULE_4__.isArrayLike)(input)) { return (0,_scheduleArray__WEBPACK_IMPORTED_MODULE_5__.scheduleArray)(input, scheduler); } else if ((0,_util_isIterable__WEBPACK_IMPORTED_MODULE_6__.isIterable)(input) || typeof input === 'string') { return (0,_scheduleIterable__WEBPACK_IMPORTED_MODULE_7__.scheduleIterable)(input, scheduler); } } throw new TypeError((input !== null && typeof input || input) + ' is not observable'); } /***/ }), /***/ 12803: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/symbol/iterator.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "$$iterator": () => (/* binding */ $$iterator), /* harmony export */ "getSymbolIterator": () => (/* binding */ getSymbolIterator), /* harmony export */ "iterator": () => (/* binding */ iterator) /* harmony export */ }); function getSymbolIterator() { if (typeof Symbol !== 'function' || !Symbol.iterator) { return '@@iterator'; } return Symbol.iterator; } const iterator = getSymbolIterator(); const $$iterator = iterator; /***/ }), /***/ 36831: /*!******************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/symbol/observable.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "observable": () => (/* binding */ observable) /* harmony export */ }); const observable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')(); /***/ }), /***/ 61482: /*!********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/symbol/rxSubscriber.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "$$rxSubscriber": () => (/* binding */ $$rxSubscriber), /* harmony export */ "rxSubscriber": () => (/* binding */ rxSubscriber) /* harmony export */ }); const rxSubscriber = (() => typeof Symbol === 'function' ? Symbol('rxSubscriber') : '@@rxSubscriber_' + Math.random())(); const $$rxSubscriber = rxSubscriber; /***/ }), /***/ 2846: /*!*****************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ArgumentOutOfRangeError": () => (/* binding */ ArgumentOutOfRangeError) /* harmony export */ }); const ArgumentOutOfRangeErrorImpl = (() => { function ArgumentOutOfRangeErrorImpl() { Error.call(this); this.message = 'argument out of range'; this.name = 'ArgumentOutOfRangeError'; return this; } ArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype); return ArgumentOutOfRangeErrorImpl; })(); const ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl; /***/ }), /***/ 90213: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/EmptyError.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "EmptyError": () => (/* binding */ EmptyError) /* harmony export */ }); const EmptyErrorImpl = (() => { function EmptyErrorImpl() { Error.call(this); this.message = 'no elements in sequence'; this.name = 'EmptyError'; return this; } EmptyErrorImpl.prototype = Object.create(Error.prototype); return EmptyErrorImpl; })(); const EmptyError = EmptyErrorImpl; /***/ }), /***/ 89086: /*!*****************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ObjectUnsubscribedError": () => (/* binding */ ObjectUnsubscribedError) /* harmony export */ }); const ObjectUnsubscribedErrorImpl = (() => { function ObjectUnsubscribedErrorImpl() { Error.call(this); this.message = 'object unsubscribed'; this.name = 'ObjectUnsubscribedError'; return this; } ObjectUnsubscribedErrorImpl.prototype = Object.create(Error.prototype); return ObjectUnsubscribedErrorImpl; })(); const ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl; /***/ }), /***/ 37875: /*!*************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/UnsubscriptionError.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "UnsubscriptionError": () => (/* binding */ UnsubscriptionError) /* harmony export */ }); const UnsubscriptionErrorImpl = (() => { function UnsubscriptionErrorImpl(errors) { Error.call(this); this.message = errors ? `${errors.length} errors occurred during unsubscription: ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : ''; this.name = 'UnsubscriptionError'; this.errors = errors; return this; } UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype); return UnsubscriptionErrorImpl; })(); const UnsubscriptionError = UnsubscriptionErrorImpl; /***/ }), /***/ 85739: /*!********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/canReportError.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "canReportError": () => (/* binding */ canReportError) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); function canReportError(observer) { while (observer) { const { closed, destination, isStopped } = observer; if (closed || isStopped) { return false; } else if (destination && destination instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber) { observer = destination; } else { observer = null; } } return true; } /***/ }), /***/ 28897: /*!*********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/hostReportError.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "hostReportError": () => (/* binding */ hostReportError) /* harmony export */ }); function hostReportError(err) { setTimeout(() => { throw err; }, 0); } /***/ }), /***/ 1356: /*!**************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/identity.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "identity": () => (/* binding */ identity) /* harmony export */ }); function identity(x) { return x; } /***/ }), /***/ 94327: /*!*************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/isArray.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isArray": () => (/* binding */ isArray) /* harmony export */ }); const isArray = (() => Array.isArray || (x => x && typeof x.length === 'number'))(); /***/ }), /***/ 55122: /*!*****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/isArrayLike.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isArrayLike": () => (/* binding */ isArrayLike) /* harmony export */ }); const isArrayLike = x => x && typeof x.length === 'number' && typeof x !== 'function'; /***/ }), /***/ 51900: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/isFunction.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isFunction": () => (/* binding */ isFunction) /* harmony export */ }); function isFunction(x) { return typeof x === 'function'; } /***/ }), /***/ 5781: /*!*************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/isInteropObservable.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isInteropObservable": () => (/* binding */ isInteropObservable) /* harmony export */ }); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ 36831); function isInteropObservable(input) { return input && typeof input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__.observable] === 'function'; } /***/ }), /***/ 99674: /*!****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/isIterable.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isIterable": () => (/* binding */ isIterable) /* harmony export */ }); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/iterator */ 12803); function isIterable(input) { return input && typeof input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__.iterator] === 'function'; } /***/ }), /***/ 36549: /*!**************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/isObject.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isObject": () => (/* binding */ isObject) /* harmony export */ }); function isObject(x) { return x !== null && typeof x === 'object'; } /***/ }), /***/ 25192: /*!***************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/isPromise.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isPromise": () => (/* binding */ isPromise) /* harmony export */ }); function isPromise(value) { return !!value && typeof value.subscribe !== 'function' && typeof value.then === 'function'; } /***/ }), /***/ 27507: /*!*****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/isScheduler.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isScheduler": () => (/* binding */ isScheduler) /* harmony export */ }); function isScheduler(value) { return value && typeof value.schedule === 'function'; } /***/ }), /***/ 76882: /*!**********************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/noop.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "noop": () => (/* binding */ noop) /* harmony export */ }); function noop() {} /***/ }), /***/ 36800: /*!**********************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/pipe.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "pipe": () => (/* binding */ pipe), /* harmony export */ "pipeFromArray": () => (/* binding */ pipeFromArray) /* harmony export */ }); /* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity */ 1356); function pipe(...fns) { return pipeFromArray(fns); } function pipeFromArray(fns) { if (fns.length === 0) { return _identity__WEBPACK_IMPORTED_MODULE_0__.identity; } if (fns.length === 1) { return fns[0]; } return function piped(input) { return fns.reduce((prev, fn) => fn(prev), input); }; } /***/ }), /***/ 16983: /*!*****************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeTo.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "subscribeTo": () => (/* binding */ subscribeTo) /* harmony export */ }); /* harmony import */ var _subscribeToArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./subscribeToArray */ 5414); /* harmony import */ var _subscribeToPromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./subscribeToPromise */ 14276); /* harmony import */ var _subscribeToIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./subscribeToIterable */ 66473); /* harmony import */ var _subscribeToObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscribeToObservable */ 81492); /* harmony import */ var _isArrayLike__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike */ 55122); /* harmony import */ var _isPromise__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isPromise */ 25192); /* harmony import */ var _isObject__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isObject */ 36549); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../symbol/iterator */ 12803); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ 36831); const subscribeTo = result => { if (!!result && typeof result[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__.observable] === 'function') { return (0,_subscribeToObservable__WEBPACK_IMPORTED_MODULE_1__.subscribeToObservable)(result); } else if ((0,_isArrayLike__WEBPACK_IMPORTED_MODULE_2__.isArrayLike)(result)) { return (0,_subscribeToArray__WEBPACK_IMPORTED_MODULE_3__.subscribeToArray)(result); } else if ((0,_isPromise__WEBPACK_IMPORTED_MODULE_4__.isPromise)(result)) { return (0,_subscribeToPromise__WEBPACK_IMPORTED_MODULE_5__.subscribeToPromise)(result); } else if (!!result && typeof result[_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__.iterator] === 'function') { return (0,_subscribeToIterable__WEBPACK_IMPORTED_MODULE_7__.subscribeToIterable)(result); } else { const value = (0,_isObject__WEBPACK_IMPORTED_MODULE_8__.isObject)(result) ? 'an invalid object' : `'${result}'`; const msg = `You provided ${value} where a stream was expected.` + ' You can provide an Observable, Promise, Array, or Iterable.'; throw new TypeError(msg); } }; /***/ }), /***/ 5414: /*!**********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToArray.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "subscribeToArray": () => (/* binding */ subscribeToArray) /* harmony export */ }); const subscribeToArray = array => subscriber => { for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) { subscriber.next(array[i]); } subscriber.complete(); }; /***/ }), /***/ 66473: /*!*************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToIterable.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "subscribeToIterable": () => (/* binding */ subscribeToIterable) /* harmony export */ }); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/iterator */ 12803); const subscribeToIterable = iterable => subscriber => { const iterator = iterable[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__.iterator](); do { let item; try { item = iterator.next(); } catch (err) { subscriber.error(err); return subscriber; } if (item.done) { subscriber.complete(); break; } subscriber.next(item.value); if (subscriber.closed) { break; } } while (true); if (typeof iterator.return === 'function') { subscriber.add(() => { if (iterator.return) { iterator.return(); } }); } return subscriber; }; /***/ }), /***/ 81492: /*!***************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToObservable.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "subscribeToObservable": () => (/* binding */ subscribeToObservable) /* harmony export */ }); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ 36831); const subscribeToObservable = obj => subscriber => { const obs = obj[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__.observable](); if (typeof obs.subscribe !== 'function') { throw new TypeError('Provided object does not correctly implement Symbol.observable'); } else { return obs.subscribe(subscriber); } }; /***/ }), /***/ 14276: /*!************************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToPromise.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "subscribeToPromise": () => (/* binding */ subscribeToPromise) /* harmony export */ }); /* harmony import */ var _hostReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hostReportError */ 28897); const subscribeToPromise = promise => subscriber => { promise.then(value => { if (!subscriber.closed) { subscriber.next(value); subscriber.complete(); } }, err => subscriber.error(err)).then(null, _hostReportError__WEBPACK_IMPORTED_MODULE_0__.hostReportError); return subscriber; }; /***/ }), /***/ 60640: /*!***********************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "subscribeToResult": () => (/* binding */ subscribeToResult) /* harmony export */ }); /* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../InnerSubscriber */ 30472); /* harmony import */ var _subscribeTo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subscribeTo */ 16983); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Observable */ 12378); function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, innerSubscriber = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__.InnerSubscriber(outerSubscriber, outerValue, outerIndex)) { if (innerSubscriber.closed) { return undefined; } if (result instanceof _Observable__WEBPACK_IMPORTED_MODULE_1__.Observable) { return result.subscribe(innerSubscriber); } return (0,_subscribeTo__WEBPACK_IMPORTED_MODULE_2__.subscribeTo)(result)(innerSubscriber); } /***/ }), /***/ 78333: /*!******************************************************************!*\ !*** ./node_modules/rxjs/_esm2015/internal/util/toSubscriber.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "toSubscriber": () => (/* binding */ toSubscriber) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 60014); /* harmony import */ var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../symbol/rxSubscriber */ 61482); /* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Observer */ 99957); function toSubscriber(nextOrObserver, error, complete) { if (nextOrObserver) { if (nextOrObserver instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber) { return nextOrObserver; } if (nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__.rxSubscriber]) { return nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__.rxSubscriber](); } } if (!nextOrObserver && !error && !complete) { return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber(_Observer__WEBPACK_IMPORTED_MODULE_2__.empty); } return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber(nextOrObserver, error, complete); } /***/ }), /***/ 34497: /*!******************************************************************************!*\ !*** ./node_modules/@angular/platform-browser/fesm2020/platform-browser.mjs ***! \******************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "BrowserModule": () => (/* binding */ BrowserModule), /* harmony export */ "BrowserTransferStateModule": () => (/* binding */ BrowserTransferStateModule), /* harmony export */ "By": () => (/* binding */ By), /* harmony export */ "DomSanitizer": () => (/* binding */ DomSanitizer), /* harmony export */ "EVENT_MANAGER_PLUGINS": () => (/* binding */ EVENT_MANAGER_PLUGINS), /* harmony export */ "EventManager": () => (/* binding */ EventManager), /* harmony export */ "HAMMER_GESTURE_CONFIG": () => (/* binding */ HAMMER_GESTURE_CONFIG), /* harmony export */ "HAMMER_LOADER": () => (/* binding */ HAMMER_LOADER), /* harmony export */ "HammerGestureConfig": () => (/* binding */ HammerGestureConfig), /* harmony export */ "HammerModule": () => (/* binding */ HammerModule), /* harmony export */ "Meta": () => (/* binding */ Meta), /* harmony export */ "Title": () => (/* binding */ Title), /* harmony export */ "TransferState": () => (/* binding */ TransferState), /* harmony export */ "VERSION": () => (/* binding */ VERSION), /* harmony export */ "bootstrapApplication": () => (/* binding */ bootstrapApplication), /* harmony export */ "createApplication": () => (/* binding */ createApplication), /* harmony export */ "disableDebugTools": () => (/* binding */ disableDebugTools), /* harmony export */ "enableDebugTools": () => (/* binding */ enableDebugTools), /* harmony export */ "makeStateKey": () => (/* binding */ makeStateKey), /* harmony export */ "platformBrowser": () => (/* binding */ platformBrowser), /* harmony export */ "provideProtractorTestingSupport": () => (/* binding */ provideProtractorTestingSupport), /* harmony export */ "ɵBrowserDomAdapter": () => (/* binding */ BrowserDomAdapter), /* harmony export */ "ɵBrowserGetTestability": () => (/* binding */ BrowserGetTestability), /* harmony export */ "ɵDomEventsPlugin": () => (/* binding */ DomEventsPlugin), /* harmony export */ "ɵDomRendererFactory2": () => (/* binding */ DomRendererFactory2), /* harmony export */ "ɵDomSanitizerImpl": () => (/* binding */ DomSanitizerImpl), /* harmony export */ "ɵDomSharedStylesHost": () => (/* binding */ DomSharedStylesHost), /* harmony export */ "ɵHammerGesturesPlugin": () => (/* binding */ HammerGesturesPlugin), /* harmony export */ "ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS": () => (/* binding */ INTERNAL_BROWSER_PLATFORM_PROVIDERS), /* harmony export */ "ɵKeyEventsPlugin": () => (/* binding */ KeyEventsPlugin), /* harmony export */ "ɵNAMESPACE_URIS": () => (/* binding */ NAMESPACE_URIS), /* harmony export */ "ɵSharedStylesHost": () => (/* binding */ SharedStylesHost), /* harmony export */ "ɵTRANSITION_ID": () => (/* binding */ TRANSITION_ID), /* harmony export */ "ɵescapeHtml": () => (/* binding */ escapeHtml), /* harmony export */ "ɵflattenStyles": () => (/* binding */ flattenStyles), /* harmony export */ "ɵgetDOM": () => (/* reexport safe */ _angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"]), /* harmony export */ "ɵinitDomAdapter": () => (/* binding */ initDomAdapter), /* harmony export */ "ɵshimContentAttribute": () => (/* binding */ shimContentAttribute), /* harmony export */ "ɵshimHostAttribute": () => (/* binding */ shimHostAttribute) /* harmony export */ }); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common */ 90944); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 45449); /** * @license Angular v14.3.0 * (c) 2010-2022 Google LLC. https://angular.io/ * License: MIT */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Provides DOM operations in any browser environment. * * @security Tread carefully! Interacting with the DOM directly is dangerous and * can introduce XSS risks. */ class GenericBrowserDomAdapter extends _angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵDomAdapter"] { constructor() { super(...arguments); this.supportsDOMEvents = true; } } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * A `DomAdapter` powered by full browser DOM APIs. * * @security Tread carefully! Interacting with the DOM directly is dangerous and * can introduce XSS risks. */ /* tslint:disable:requireParameterType no-console */ class BrowserDomAdapter extends GenericBrowserDomAdapter { static makeCurrent() { (0,_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵsetRootDomAdapter"])(new BrowserDomAdapter()); } onAndCancel(el, evt, listener) { el.addEventListener(evt, listener, false); // Needed to follow Dart's subscription semantic, until fix of // https://code.google.com/p/dart/issues/detail?id=17406 return () => { el.removeEventListener(evt, listener, false); }; } dispatchEvent(el, evt) { el.dispatchEvent(evt); } remove(node) { if (node.parentNode) { node.parentNode.removeChild(node); } } createElement(tagName, doc) { doc = doc || this.getDefaultDocument(); return doc.createElement(tagName); } createHtmlDocument() { return document.implementation.createHTMLDocument('fakeTitle'); } getDefaultDocument() { return document; } isElementNode(node) { return node.nodeType === Node.ELEMENT_NODE; } isShadowRoot(node) { return node instanceof DocumentFragment; } /** @deprecated No longer being used in Ivy code. To be removed in version 14. */ getGlobalEventTarget(doc, target) { if (target === 'window') { return window; } if (target === 'document') { return doc; } if (target === 'body') { return doc.body; } return null; } getBaseHref(doc) { const href = getBaseElementHref(); return href == null ? null : relativePath(href); } resetBaseElement() { baseElement = null; } getUserAgent() { return window.navigator.userAgent; } getCookie(name) { return (0,_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵparseCookieValue"])(document.cookie, name); } } let baseElement = null; function getBaseElementHref() { baseElement = baseElement || document.querySelector('base'); return baseElement ? baseElement.getAttribute('href') : null; } // based on urlUtils.js in AngularJS 1 let urlParsingNode; function relativePath(url) { urlParsingNode = urlParsingNode || document.createElement('a'); urlParsingNode.setAttribute('href', url); const pathName = urlParsingNode.pathname; return pathName.charAt(0) === '/' ? pathName : `/${pathName}`; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * An id that identifies a particular application being bootstrapped, that should * match across the client/server boundary. */ const TRANSITION_ID = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('TRANSITION_ID'); function appInitializerFactory(transitionId, document, injector) { return () => { // Wait for all application initializers to be completed before removing the styles set by // the server. injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ApplicationInitStatus).donePromise.then(() => { const dom = (0,_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])(); const styles = document.querySelectorAll(`style[ng-transition="${transitionId}"]`); for (let i = 0; i < styles.length; i++) { dom.remove(styles[i]); } }); }; } const SERVER_TRANSITION_PROVIDERS = [{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.APP_INITIALIZER, useFactory: appInitializerFactory, deps: [TRANSITION_ID, _angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT, _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injector], multi: true }]; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ class BrowserGetTestability { addToWindow(registry) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].getAngularTestability = (elem, findInAncestors = true) => { const testability = registry.findTestabilityInTree(elem, findInAncestors); if (testability == null) { throw new Error('Could not find testability for element.'); } return testability; }; _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].getAllAngularTestabilities = () => registry.getAllTestabilities(); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].getAllAngularRootElements = () => registry.getAllRootElements(); const whenAllStable = (callback /** TODO #9100 */ ) => { const testabilities = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].getAllAngularTestabilities(); let count = testabilities.length; let didWork = false; const decrement = function (didWork_ /** TODO #9100 */ ) { didWork = didWork || didWork_; count--; if (count == 0) { callback(didWork); } }; testabilities.forEach(function (testability /** TODO #9100 */ ) { testability.whenStable(decrement); }); }; if (!_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].frameworkStabilizers) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].frameworkStabilizers = []; } _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].frameworkStabilizers.push(whenAllStable); } findTestabilityInTree(registry, elem, findInAncestors) { if (elem == null) { return null; } const t = registry.getTestability(elem); if (t != null) { return t; } else if (!findInAncestors) { return null; } if ((0,_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().isShadowRoot(elem)) { return this.findTestabilityInTree(registry, elem.host, true); } return this.findTestabilityInTree(registry, elem.parentElement, true); } } /** * A factory for `HttpXhrBackend` that uses the `XMLHttpRequest` browser API. */ class BrowserXhr { build() { return new XMLHttpRequest(); } } BrowserXhr.ɵfac = function BrowserXhr_Factory(t) { return new (t || BrowserXhr)(); }; BrowserXhr.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: BrowserXhr, factory: BrowserXhr.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](BrowserXhr, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable }], null, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * The injection token for the event-manager plug-in service. * * @publicApi */ const EVENT_MANAGER_PLUGINS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('EventManagerPlugins'); /** * An injectable service that provides event management for Angular * through a browser plug-in. * * @publicApi */ class EventManager { /** * Initializes an instance of the event-manager service. */ constructor(plugins, _zone) { this._zone = _zone; this._eventNameToPlugin = new Map(); plugins.forEach(p => p.manager = this); this._plugins = plugins.slice().reverse(); } /** * Registers a handler for a specific element and event. * * @param element The HTML element to receive event notifications. * @param eventName The name of the event to listen for. * @param handler A function to call when the notification occurs. Receives the * event object as an argument. * @returns A callback function that can be used to remove the handler. */ addEventListener(element, eventName, handler) { const plugin = this._findPluginFor(eventName); return plugin.addEventListener(element, eventName, handler); } /** * Registers a global handler for an event in a target view. * * @param target A target for global event notifications. One of "window", "document", or "body". * @param eventName The name of the event to listen for. * @param handler A function to call when the notification occurs. Receives the * event object as an argument. * @returns A callback function that can be used to remove the handler. * @deprecated No longer being used in Ivy code. To be removed in version 14. */ addGlobalEventListener(target, eventName, handler) { const plugin = this._findPluginFor(eventName); return plugin.addGlobalEventListener(target, eventName, handler); } /** * Retrieves the compilation zone in which event listeners are registered. */ getZone() { return this._zone; } /** @internal */ _findPluginFor(eventName) { const plugin = this._eventNameToPlugin.get(eventName); if (plugin) { return plugin; } const plugins = this._plugins; for (let i = 0; i < plugins.length; i++) { const plugin = plugins[i]; if (plugin.supports(eventName)) { this._eventNameToPlugin.set(eventName, plugin); return plugin; } } throw new Error(`No event manager plugin found for event ${eventName}`); } } EventManager.ɵ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)); }; EventManager.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: EventManager, factory: EventManager.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](EventManager, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable }], function () { return [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [EVENT_MANAGER_PLUGINS] }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone }]; }, null); })(); class EventManagerPlugin { constructor(_doc) { this._doc = _doc; } addGlobalEventListener(element, eventName, handler) { const target = (0,_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().getGlobalEventTarget(this._doc, element); if (!target) { throw new Error(`Unsupported event target ${target} for event ${eventName}`); } return this.addEventListener(target, eventName, handler); } } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ class SharedStylesHost { constructor() { /** @internal */ this._stylesSet = new Set(); } addStyles(styles) { const additions = new Set(); styles.forEach(style => { if (!this._stylesSet.has(style)) { this._stylesSet.add(style); additions.add(style); } }); this.onStylesAdded(additions); } onStylesAdded(additions) {} getAllStyles() { return Array.from(this._stylesSet); } } SharedStylesHost.ɵfac = function SharedStylesHost_Factory(t) { return new (t || SharedStylesHost)(); }; SharedStylesHost.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: SharedStylesHost, factory: SharedStylesHost.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](SharedStylesHost, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable }], null, null); })(); class DomSharedStylesHost extends SharedStylesHost { constructor(_doc) { super(); this._doc = _doc; // Maps all registered host nodes to a list of style nodes that have been added to the host node. this._hostNodes = new Map(); this._hostNodes.set(_doc.head, []); } _addStylesToHost(styles, host, styleNodes) { styles.forEach(style => { const styleEl = this._doc.createElement('style'); styleEl.textContent = style; styleNodes.push(host.appendChild(styleEl)); }); } addHost(hostNode) { const styleNodes = []; this._addStylesToHost(this._stylesSet, hostNode, styleNodes); this._hostNodes.set(hostNode, styleNodes); } removeHost(hostNode) { const styleNodes = this._hostNodes.get(hostNode); if (styleNodes) { styleNodes.forEach(removeStyle); } this._hostNodes.delete(hostNode); } onStylesAdded(additions) { this._hostNodes.forEach((styleNodes, hostNode) => { this._addStylesToHost(additions, hostNode, styleNodes); }); } ngOnDestroy() { this._hostNodes.forEach(styleNodes => styleNodes.forEach(removeStyle)); } } DomSharedStylesHost.ɵfac = function DomSharedStylesHost_Factory(t) { return new (t || DomSharedStylesHost)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT)); }; DomSharedStylesHost.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomSharedStylesHost, factory: DomSharedStylesHost.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomSharedStylesHost, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable }], function () { return [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT] }] }]; }, null); })(); function removeStyle(styleNode) { (0,_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().remove(styleNode); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NAMESPACE_URIS = { 'svg': 'http://www.w3.org/2000/svg', 'xhtml': 'http://www.w3.org/1999/xhtml', 'xlink': 'http://www.w3.org/1999/xlink', 'xml': 'http://www.w3.org/XML/1998/namespace', 'xmlns': 'http://www.w3.org/2000/xmlns/', 'math': 'http://www.w3.org/1998/MathML/' }; const COMPONENT_REGEX = /%COMP%/g; const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode; const COMPONENT_VARIABLE = '%COMP%'; const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`; const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`; function shimContentAttribute(componentShortId) { return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId); } function shimHostAttribute(componentShortId) { return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId); } function flattenStyles(compId, styles, target) { for (let i = 0; i < styles.length; i++) { let style = styles[i]; if (Array.isArray(style)) { flattenStyles(compId, style, target); } else { style = style.replace(COMPONENT_REGEX, compId); target.push(style); } } return target; } function decoratePreventDefault(eventHandler) { // `DebugNode.triggerEventHandler` needs to know if the listener was created with // decoratePreventDefault or is a listener added outside the Angular context so it can handle the // two differently. In the first case, the special '__ngUnwrap__' token is passed to the unwrap // the listener (see below). return event => { // Ivy uses '__ngUnwrap__' as a special token that allows us to unwrap the function // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`. The debug_node // can inspect the listener toString contents for the existence of this special token. Because // the token is a string literal, it is ensured to not be modified by compiled code. if (event === '__ngUnwrap__') { return eventHandler; } const allowDefaultBehavior = eventHandler(event); if (allowDefaultBehavior === false) { // TODO(tbosch): move preventDefault into event plugins... event.preventDefault(); event.returnValue = false; } return undefined; }; } let hasLoggedNativeEncapsulationWarning = false; class DomRendererFactory2 { constructor(eventManager, sharedStylesHost, appId) { this.eventManager = eventManager; this.sharedStylesHost = sharedStylesHost; this.appId = appId; this.rendererByCompId = new Map(); this.defaultRenderer = new DefaultDomRenderer2(eventManager); } createRenderer(element, type) { if (!element || !type) { return this.defaultRenderer; } switch (type.encapsulation) { case _angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewEncapsulation.Emulated: { let renderer = this.rendererByCompId.get(type.id); if (!renderer) { renderer = new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type, this.appId); this.rendererByCompId.set(type.id, renderer); } renderer.applyToHost(element); return renderer; } // @ts-ignore TODO: Remove as part of FW-2290. TS complains about us dealing with an enum // value that is not known (but previously was the value for ViewEncapsulation.Native) case 1: case _angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewEncapsulation.ShadowDom: // TODO(FW-2290): remove the `case 1:` fallback logic and the warning in v12. if ((typeof ngDevMode === 'undefined' || ngDevMode) && // @ts-ignore TODO: Remove as part of FW-2290. TS complains about us dealing with an // enum value that is not known (but previously was the value for // ViewEncapsulation.Native) !hasLoggedNativeEncapsulationWarning && type.encapsulation === 1) { hasLoggedNativeEncapsulationWarning = true; console.warn('ViewEncapsulation.Native is no longer supported. Falling back to ViewEncapsulation.ShadowDom. The fallback will be removed in v12.'); } return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type); default: { if (!this.rendererByCompId.has(type.id)) { const styles = flattenStyles(type.id, type.styles, []); this.sharedStylesHost.addStyles(styles); this.rendererByCompId.set(type.id, this.defaultRenderer); } return this.defaultRenderer; } } } begin() {} end() {} } DomRendererFactory2.ɵ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)); }; DomRendererFactory2.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomRendererFactory2, factory: DomRendererFactory2.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomRendererFactory2, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable }], function () { return [{ type: EventManager }, { type: DomSharedStylesHost }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.APP_ID] }] }]; }, null); })(); class DefaultDomRenderer2 { constructor(eventManager) { this.eventManager = eventManager; this.data = Object.create(null); this.destroyNode = null; } destroy() {} createElement(name, namespace) { if (namespace) { // TODO: `|| namespace` was added in // https://github.com/angular/angular/commit/2b9cc8503d48173492c29f5a271b61126104fbdb to // support how Ivy passed around the namespace URI rather than short name at the time. It did // not, however extend the support to other parts of the system (setAttribute, setAttribute, // and the ServerRenderer). We should decide what exactly the semantics for dealing with // namespaces should be and make it consistent. // Related issues: // https://github.com/angular/angular/issues/44028 // https://github.com/angular/angular/issues/44883 return document.createElementNS(NAMESPACE_URIS[namespace] || namespace, name); } return document.createElement(name); } createComment(value) { return document.createComment(value); } createText(value) { return document.createTextNode(value); } appendChild(parent, newChild) { const targetParent = isTemplateNode(parent) ? parent.content : parent; targetParent.appendChild(newChild); } insertBefore(parent, newChild, refChild) { if (parent) { const targetParent = isTemplateNode(parent) ? parent.content : parent; targetParent.insertBefore(newChild, refChild); } } removeChild(parent, oldChild) { if (parent) { parent.removeChild(oldChild); } } selectRootElement(selectorOrNode, preserveContent) { let el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) : selectorOrNode; if (!el) { throw new Error(`The selector "${selectorOrNode}" did not match any elements`); } if (!preserveContent) { el.textContent = ''; } return el; } parentNode(node) { return node.parentNode; } nextSibling(node) { return node.nextSibling; } setAttribute(el, name, value, namespace) { if (namespace) { name = namespace + ':' + name; const namespaceUri = NAMESPACE_URIS[namespace]; if (namespaceUri) { el.setAttributeNS(namespaceUri, name, value); } else { el.setAttribute(name, value); } } else { el.setAttribute(name, value); } } removeAttribute(el, name, namespace) { if (namespace) { const namespaceUri = NAMESPACE_URIS[namespace]; if (namespaceUri) { el.removeAttributeNS(namespaceUri, name); } else { el.removeAttribute(`${namespace}:${name}`); } } else { el.removeAttribute(name); } } addClass(el, name) { el.classList.add(name); } removeClass(el, name) { el.classList.remove(name); } setStyle(el, style, value, flags) { if (flags & (_angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererStyleFlags2.DashCase | _angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererStyleFlags2.Important)) { el.style.setProperty(style, value, flags & _angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererStyleFlags2.Important ? 'important' : ''); } else { el.style[style] = value; } } removeStyle(el, style, flags) { if (flags & _angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererStyleFlags2.DashCase) { el.style.removeProperty(style); } else { // IE requires '' instead of null // see https://github.com/angular/angular/issues/7916 el.style[style] = ''; } } setProperty(el, name, value) { NG_DEV_MODE$1 && checkNoSyntheticProp(name, 'property'); el[name] = value; } setValue(node, value) { node.nodeValue = value; } listen(target, event, callback) { NG_DEV_MODE$1 && checkNoSyntheticProp(event, 'listener'); if (typeof target === 'string') { return this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback)); } return this.eventManager.addEventListener(target, event, decoratePreventDefault(callback)); } } const AT_CHARCODE = (() => '@'.charCodeAt(0))(); function checkNoSyntheticProp(name, nameKind) { if (name.charCodeAt(0) === AT_CHARCODE) { throw new Error(`Unexpected synthetic ${nameKind} ${name} found. Please make sure that: - Either \`BrowserAnimationsModule\` or \`NoopAnimationsModule\` are imported in your application. - There is corresponding configuration for the animation named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.io/api/core/Component#animations).`); } } function isTemplateNode(node) { return node.tagName === 'TEMPLATE' && node.content !== undefined; } class EmulatedEncapsulationDomRenderer2 extends DefaultDomRenderer2 { constructor(eventManager, sharedStylesHost, component, appId) { super(eventManager); this.component = component; const styles = flattenStyles(appId + '-' + component.id, component.styles, []); sharedStylesHost.addStyles(styles); this.contentAttr = shimContentAttribute(appId + '-' + component.id); this.hostAttr = shimHostAttribute(appId + '-' + component.id); } applyToHost(element) { super.setAttribute(element, this.hostAttr, ''); } createElement(parent, name) { const el = super.createElement(parent, name); super.setAttribute(el, this.contentAttr, ''); return el; } } class ShadowDomRenderer extends DefaultDomRenderer2 { constructor(eventManager, sharedStylesHost, hostEl, component) { super(eventManager); this.sharedStylesHost = sharedStylesHost; this.hostEl = hostEl; this.shadowRoot = hostEl.attachShadow({ mode: 'open' }); this.sharedStylesHost.addHost(this.shadowRoot); const styles = flattenStyles(component.id, component.styles, []); for (let i = 0; i < styles.length; i++) { const styleEl = document.createElement('style'); styleEl.textContent = styles[i]; this.shadowRoot.appendChild(styleEl); } } nodeOrShadowRoot(node) { return node === this.hostEl ? this.shadowRoot : node; } destroy() { this.sharedStylesHost.removeHost(this.shadowRoot); } appendChild(parent, newChild) { return super.appendChild(this.nodeOrShadowRoot(parent), newChild); } insertBefore(parent, newChild, refChild) { return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild); } removeChild(parent, oldChild) { return super.removeChild(this.nodeOrShadowRoot(parent), oldChild); } parentNode(node) { return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node))); } } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ class DomEventsPlugin extends EventManagerPlugin { constructor(doc) { super(doc); } // This plugin should come last in the list of plugins, because it accepts all // events. supports(eventName) { return true; } addEventListener(element, eventName, handler) { element.addEventListener(eventName, handler, false); return () => this.removeEventListener(element, eventName, handler); } removeEventListener(target, eventName, callback) { return target.removeEventListener(eventName, callback); } } DomEventsPlugin.ɵfac = function DomEventsPlugin_Factory(t) { return new (t || DomEventsPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT)); }; DomEventsPlugin.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomEventsPlugin, factory: DomEventsPlugin.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomEventsPlugin, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable }], function () { return [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT] }] }]; }, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Defines supported modifiers for key events. */ const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift']; // The following values are here for cross-browser compatibility and to match the W3C standard // cf https://www.w3.org/TR/DOM-Level-3-Events-key/ const _keyMap = { '\b': 'Backspace', '\t': 'Tab', '\x7F': 'Delete', '\x1B': 'Escape', 'Del': 'Delete', 'Esc': 'Escape', 'Left': 'ArrowLeft', 'Right': 'ArrowRight', 'Up': 'ArrowUp', 'Down': 'ArrowDown', 'Menu': 'ContextMenu', 'Scroll': 'ScrollLock', 'Win': 'OS' }; /** * Retrieves modifiers from key-event objects. */ const MODIFIER_KEY_GETTERS = { 'alt': event => event.altKey, 'control': event => event.ctrlKey, 'meta': event => event.metaKey, 'shift': event => event.shiftKey }; /** * @publicApi * A browser plug-in that provides support for handling of key events in Angular. */ class KeyEventsPlugin extends EventManagerPlugin { /** * Initializes an instance of the browser plug-in. * @param doc The document in which key events will be detected. */ constructor(doc) { super(doc); } /** * Reports whether a named key event is supported. * @param eventName The event name to query. * @return True if the named key event is supported. */ supports(eventName) { return KeyEventsPlugin.parseEventName(eventName) != null; } /** * Registers a handler for a specific element and key event. * @param element The HTML element to receive event notifications. * @param eventName The name of the key event to listen for. * @param handler A function to call when the notification occurs. Receives the * event object as an argument. * @returns The key event that was registered. */ addEventListener(element, eventName, handler) { const parsedEvent = KeyEventsPlugin.parseEventName(eventName); const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone()); return this.manager.getZone().runOutsideAngular(() => { return (0,_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().onAndCancel(element, parsedEvent['domEventName'], outsideHandler); }); } /** * Parses the user provided full keyboard event definition and normalizes it for * later internal use. It ensures the string is all lowercase, converts special * characters to a standard spelling, and orders all the values consistently. * * @param eventName The name of the key event to listen for. * @returns an object with the full, normalized string, and the dom event name * or null in the case when the event doesn't match a keyboard event. */ static parseEventName(eventName) { const parts = eventName.toLowerCase().split('.'); const domEventName = parts.shift(); if (parts.length === 0 || !(domEventName === 'keydown' || domEventName === 'keyup')) { return null; } const key = KeyEventsPlugin._normalizeKey(parts.pop()); let fullKey = ''; let codeIX = parts.indexOf('code'); if (codeIX > -1) { parts.splice(codeIX, 1); fullKey = 'code.'; } MODIFIER_KEYS.forEach(modifierName => { const index = parts.indexOf(modifierName); if (index > -1) { parts.splice(index, 1); fullKey += modifierName + '.'; } }); fullKey += key; if (parts.length != 0 || key.length === 0) { // returning null instead of throwing to let another plugin process the event return null; } // NOTE: Please don't rewrite this as so, as it will break JSCompiler property renaming. // The code must remain in the `result['domEventName']` form. // return {domEventName, fullKey}; const result = {}; result['domEventName'] = domEventName; result['fullKey'] = fullKey; return result; } /** * Determines whether the actual keys pressed match the configured key code string. * The `fullKeyCode` event is normalized in the `parseEventName` method when the * event is attached to the DOM during the `addEventListener` call. This is unseen * by the end user and is normalized for internal consistency and parsing. * * @param event The keyboard event. * @param fullKeyCode The normalized user defined expected key event string * @returns boolean. */ static matchEventFullKeyCode(event, fullKeyCode) { let keycode = _keyMap[event.key] || event.key; let key = ''; if (fullKeyCode.indexOf('code.') > -1) { keycode = event.code; key = 'code.'; } // the keycode could be unidentified so we have to check here if (keycode == null || !keycode) return false; keycode = keycode.toLowerCase(); if (keycode === ' ') { keycode = 'space'; // for readability } else if (keycode === '.') { keycode = 'dot'; // because '.' is used as a separator in event names } MODIFIER_KEYS.forEach(modifierName => { if (modifierName !== keycode) { const modifierGetter = MODIFIER_KEY_GETTERS[modifierName]; if (modifierGetter(event)) { key += modifierName + '.'; } } }); key += keycode; return key === fullKeyCode; } /** * Configures a handler callback for a key event. * @param fullKey The event name that combines all simultaneous keystrokes. * @param handler The function that responds to the key event. * @param zone The zone in which the event occurred. * @returns A callback function. */ static eventCallback(fullKey, handler, zone) { return event => { if (KeyEventsPlugin.matchEventFullKeyCode(event, fullKey)) { zone.runGuarded(() => handler(event)); } }; } /** @internal */ static _normalizeKey(keyName) { // TODO: switch to a Map if the mapping grows too much switch (keyName) { case 'esc': return 'escape'; default: return keyName; } } } KeyEventsPlugin.ɵfac = function KeyEventsPlugin_Factory(t) { return new (t || KeyEventsPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT)); }; KeyEventsPlugin.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: KeyEventsPlugin, factory: KeyEventsPlugin.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](KeyEventsPlugin, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable }], function () { return [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT] }] }]; }, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode; /** * Bootstraps an instance of an Angular application and renders a standalone component as the * application's root component. More information about standalone components can be found in [this * guide](guide/standalone-components). * * @usageNotes * The root component passed into this function *must* be a standalone one (should have the * `standalone: true` flag in the `@Component` decorator config). * * ```typescript * @Component({ * standalone: true, * template: 'Hello world!' * }) * class RootComponent {} * * const appRef: ApplicationRef = await bootstrapApplication(RootComponent); * ``` * * You can add the list of providers that should be available in the application injector by * specifying the `providers` field in an object passed as the second argument: * * ```typescript * await bootstrapApplication(RootComponent, { * providers: [ * {provide: BACKEND_URL, useValue: 'https://yourdomain.com/api'} * ] * }); * ``` * * The `importProvidersFrom` helper method can be used to collect all providers from any * existing NgModule (and transitively from all NgModules that it imports): * * ```typescript * await bootstrapApplication(RootComponent, { * providers: [ * importProvidersFrom(SomeNgModule) * ] * }); * ``` * * Note: the `bootstrapApplication` method doesn't include [Testability](api/core/Testability) by * default. You can add [Testability](api/core/Testability) by getting the list of necessary * providers using `provideProtractorTestingSupport()` function and adding them into the `providers` * array, for example: * * ```typescript * import {provideProtractorTestingSupport} from '@angular/platform-browser'; * * await bootstrapApplication(RootComponent, {providers: [provideProtractorTestingSupport()]}); * ``` * * @param rootComponent A reference to a standalone component that should be rendered. * @param options Extra configuration for the bootstrap operation, see `ApplicationConfig` for * additional info. * @returns A promise that returns an `ApplicationRef` instance once resolved. * * @publicApi * @developerPreview */ function bootstrapApplication(rootComponent, options) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵinternalCreateApplication"])({ rootComponent, ...createProvidersConfig(options) }); } /** * Create an instance of an Angular application without bootstrapping any components. This is useful * for the situation where one wants to decouple application environment creation (a platform and * associated injectors) from rendering components on a screen. Components can be subsequently * bootstrapped on the returned `ApplicationRef`. * * @param options Extra configuration for the application environment, see `ApplicationConfig` for * additional info. * @returns A promise that returns an `ApplicationRef` instance once resolved. * * @publicApi * @developerPreview */ function createApplication(options) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵinternalCreateApplication"])(createProvidersConfig(options)); } function createProvidersConfig(options) { var _options$providers; return { appProviders: [...BROWSER_MODULE_PROVIDERS, ...((_options$providers = options === null || options === void 0 ? void 0 : options.providers) !== null && _options$providers !== void 0 ? _options$providers : [])], platformProviders: INTERNAL_BROWSER_PLATFORM_PROVIDERS }; } /** * Returns a set of providers required to setup [Testability](api/core/Testability) for an * application bootstrapped using the `bootstrapApplication` function. The set of providers is * needed to support testing an application with Protractor (which relies on the Testability APIs * to be present). * * @returns An array of providers required to setup Testability for an application and make it * available for testing using Protractor. * * @developerPreview * @publicApi */ function provideProtractorTestingSupport() { // Return a copy to prevent changes to the original array in case any in-place // alterations are performed to the `provideProtractorTestingSupport` call results in app code. return [...TESTABILITY_PROVIDERS]; } function initDomAdapter() { BrowserDomAdapter.makeCurrent(); } function errorHandler() { return new _angular_core__WEBPACK_IMPORTED_MODULE_1__.ErrorHandler(); } function _document() { // Tell ivy about the global document (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetDocument"])(document); return document; } const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.PLATFORM_ID, useValue: _angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵPLATFORM_BROWSER_ID"] }, { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true }, { provide: _angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT, useFactory: _document, deps: [] }]; /** * A factory function that returns a `PlatformRef` instance associated with browser service * providers. * * @publicApi */ const platformBrowser = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.createPlatformFactory)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS); /** * Internal marker to signal whether providers from the `BrowserModule` are already present in DI. * This is needed to avoid loading `BrowserModule` providers twice. We can't rely on the * `BrowserModule` presence itself, since the standalone-based bootstrap just imports * `BrowserModule` providers without referencing the module itself. */ const BROWSER_MODULE_PROVIDERS_MARKER = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(NG_DEV_MODE ? 'BrowserModule Providers Marker' : ''); const TESTABILITY_PROVIDERS = [{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵTESTABILITY_GETTER"], useClass: BrowserGetTestability, deps: [] }, { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵTESTABILITY"], useClass: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Testability, deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone, _angular_core__WEBPACK_IMPORTED_MODULE_1__.TestabilityRegistry, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵTESTABILITY_GETTER"]] }, { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Testability, useClass: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Testability, deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone, _angular_core__WEBPACK_IMPORTED_MODULE_1__.TestabilityRegistry, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵTESTABILITY_GETTER"]] }]; const BROWSER_MODULE_PROVIDERS = [{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵINJECTOR_SCOPE"], useValue: 'root' }, { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ErrorHandler, useFactory: errorHandler, deps: [] }, { provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT, _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone, _angular_core__WEBPACK_IMPORTED_MODULE_1__.PLATFORM_ID] }, { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT] }, { provide: DomRendererFactory2, useClass: DomRendererFactory2, deps: [EventManager, DomSharedStylesHost, _angular_core__WEBPACK_IMPORTED_MODULE_1__.APP_ID] }, { provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererFactory2, useExisting: DomRendererFactory2 }, { provide: SharedStylesHost, useExisting: DomSharedStylesHost }, { provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT] }, { provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone] }, { provide: _angular_common__WEBPACK_IMPORTED_MODULE_0__.XhrFactory, useClass: BrowserXhr, deps: [] }, NG_DEV_MODE ? { provide: BROWSER_MODULE_PROVIDERS_MARKER, useValue: true } : []]; /** * Exports required infrastructure for all Angular apps. * Included by default in all Angular apps created with the CLI * `new` command. * Re-exports `CommonModule` and `ApplicationModule`, making their * exports and providers available to all apps. * * @publicApi */ class BrowserModule { constructor(providersAlreadyPresent) { if (NG_DEV_MODE && providersAlreadyPresent) { throw new Error(`Providers from the \`BrowserModule\` have already been loaded. If you need access ` + `to common directives such as NgIf and NgFor, import the \`CommonModule\` instead.`); } } /** * Configures a browser-based app to transition from a server-rendered app, if * one is present on the page. * * @param params An object containing an identifier for the app to transition. * The ID must match between the client and server versions of the app. * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`. */ static withServerTransition(params) { return { ngModule: BrowserModule, providers: [{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.APP_ID, useValue: params.appId }, { provide: TRANSITION_ID, useExisting: _angular_core__WEBPACK_IMPORTED_MODULE_1__.APP_ID }, SERVER_TRANSITION_PROVIDERS] }; } } BrowserModule.ɵfac = function BrowserModule_Factory(t) { return new (t || BrowserModule)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](BROWSER_MODULE_PROVIDERS_MARKER, 12)); }; BrowserModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: BrowserModule }); BrowserModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS], imports: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.CommonModule, _angular_core__WEBPACK_IMPORTED_MODULE_1__.ApplicationModule] }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](BrowserModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule, args: [{ providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS], exports: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.CommonModule, _angular_core__WEBPACK_IMPORTED_MODULE_1__.ApplicationModule] }] }], function () { return [{ type: undefined, 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: [BROWSER_MODULE_PROVIDERS_MARKER] }] }]; }, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Factory to create a `Meta` service instance for the current DOM document. */ function createMeta() { return new Meta((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT)); } /** * A service for managing HTML `` tags. * * Properties of the `MetaDefinition` object match the attributes of the * HTML `` tag. These tags define document metadata that is important for * things like configuring a Content Security Policy, defining browser compatibility * and security settings, setting HTTP Headers, defining rich content for social sharing, * and Search Engine Optimization (SEO). * * To identify specific `` tags in a document, use an attribute selection * string in the format `"tag_attribute='value string'"`. * For example, an `attrSelector` value of `"name='description'"` matches a tag * whose `name` attribute has the value `"description"`. * Selectors are used with the `querySelector()` Document method, * in the format `meta[{attrSelector}]`. * * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta) * @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector) * * * @publicApi */ class Meta { constructor(_doc) { this._doc = _doc; this._dom = (0,_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])(); } /** * Retrieves or creates a specific `` tag element in the current HTML document. * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute * values in the provided tag definition, and verifies that all other attribute values are equal. * If an existing element is found, it is returned and is not modified in any way. * @param tag The definition of a `` element to match or create. * @param forceCreation True to create a new element without checking whether one already exists. * @returns The existing element with the same attributes and values if found, * the new element if no match is found, or `null` if the tag parameter is not defined. */ addTag(tag, forceCreation = false) { if (!tag) return null; return this._getOrCreateElement(tag, forceCreation); } /** * Retrieves or creates a set of `` tag elements in the current HTML document. * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute * values in the provided tag definition, and verifies that all other attribute values are equal. * @param tags An array of tag definitions to match or create. * @param forceCreation True to create new elements without checking whether they already exist. * @returns The matching elements if found, or the new elements. */ addTags(tags, forceCreation = false) { if (!tags) return []; return tags.reduce((result, tag) => { if (tag) { result.push(this._getOrCreateElement(tag, forceCreation)); } return result; }, []); } /** * Retrieves a `` tag element in the current HTML document. * @param attrSelector The tag attribute and value to match against, in the format * `"tag_attribute='value string'"`. * @returns The matching element, if any. */ getTag(attrSelector) { if (!attrSelector) return null; return this._doc.querySelector(`meta[${attrSelector}]`) || null; } /** * Retrieves a set of `` tag elements in the current HTML document. * @param attrSelector The tag attribute and value to match against, in the format * `"tag_attribute='value string'"`. * @returns The matching elements, if any. */ getTags(attrSelector) { if (!attrSelector) return []; const list /*NodeList*/ = this._doc.querySelectorAll(`meta[${attrSelector}]`); return list ? [].slice.call(list) : []; } /** * Modifies an existing `` tag element in the current HTML document. * @param tag The tag description with which to replace the existing tag content. * @param selector A tag attribute and value to match against, to identify * an existing tag. A string in the format `"tag_attribute=`value string`"`. * If not supplied, matches a tag with the same `name` or `property` attribute value as the * replacement tag. * @return The modified element. */ updateTag(tag, selector) { if (!tag) return null; selector = selector || this._parseSelector(tag); const meta = this.getTag(selector); if (meta) { return this._setMetaElementAttributes(tag, meta); } return this._getOrCreateElement(tag, true); } /** * Removes an existing `` tag element from the current HTML document. * @param attrSelector A tag attribute and value to match against, to identify * an existing tag. A string in the format `"tag_attribute=`value string`"`. */ removeTag(attrSelector) { this.removeTagElement(this.getTag(attrSelector)); } /** * Removes an existing `` tag element from the current HTML document. * @param meta The tag definition to match against to identify an existing tag. */ removeTagElement(meta) { if (meta) { this._dom.remove(meta); } } _getOrCreateElement(meta, forceCreation = false) { if (!forceCreation) { const selector = this._parseSelector(meta); // It's allowed to have multiple elements with the same name so it's not enough to // just check that element with the same name already present on the page. We also need to // check if element has tag attributes const elem = this.getTags(selector).filter(elem => this._containsAttributes(meta, elem))[0]; if (elem !== undefined) return elem; } const element = this._dom.createElement('meta'); this._setMetaElementAttributes(meta, element); const head = this._doc.getElementsByTagName('head')[0]; head.appendChild(element); return element; } _setMetaElementAttributes(tag, el) { Object.keys(tag).forEach(prop => el.setAttribute(this._getMetaKeyMap(prop), tag[prop])); return el; } _parseSelector(tag) { const attr = tag.name ? 'name' : 'property'; return `${attr}="${tag[attr]}"`; } _containsAttributes(tag, elem) { return Object.keys(tag).every(key => elem.getAttribute(this._getMetaKeyMap(key)) === tag[key]); } _getMetaKeyMap(prop) { return META_KEYS_MAP[prop] || prop; } } Meta.ɵfac = function Meta_Factory(t) { return new (t || Meta)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT)); }; Meta.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: Meta, factory: function Meta_Factory(t) { let r = null; if (t) { r = new t(); } else { r = createMeta(); } return r; }, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](Meta, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root', useFactory: createMeta, deps: [] }] }], function () { return [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT] }] }]; }, null); })(); /** * Mapping for MetaDefinition properties with their correct meta attribute names */ const META_KEYS_MAP = { httpEquiv: 'http-equiv' }; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Factory to create Title service. */ function createTitle() { return new Title((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT)); } /** * A service that can be used to get and set the title of a current HTML document. * * Since an Angular application can't be bootstrapped on the entire HTML document (`` tag) * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements * (representing the `` tag). Instead, this service can be used to set and get the current * title value. * * @publicApi */ class Title { constructor(_doc) { this._doc = _doc; } /** * Get the title of the current HTML document. */ getTitle() { return this._doc.title; } /** * Set the title of the current HTML document. * @param newTitle */ setTitle(newTitle) { this._doc.title = newTitle || ''; } } Title.ɵfac = function Title_Factory(t) { return new (t || Title)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT)); }; Title.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: Title, factory: function Title_Factory(t) { let r = null; if (t) { r = new t(); } else { r = createTitle(); } return r; }, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](Title, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root', useFactory: createTitle, deps: [] }] }], function () { return [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT] }] }]; }, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const CAMEL_CASE_REGEXP = /([A-Z])/g; const DASH_CASE_REGEXP = /-([a-z])/g; function camelCaseToDashCase(input) { return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase()); } function dashCaseToCamelCase(input) { return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase()); } /** * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if * `name` is `'probe'`. * @param name Name under which it will be exported. Keep in mind this will be a property of the * global `ng` object. * @param value The value to export. */ function exportNgVar(name, value) { if (typeof COMPILED === 'undefined' || !COMPILED) { // Note: we can't export `ng` when using closure enhanced optimization as: // - closure declares globals itself for minified names, which sometimes clobber our `ng` global // - we can't declare a closure extern as the namespace `ng` is already used within Google // for typings for angularJS (via `goog.provide('ng....')`). const ng = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].ng = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵglobal"].ng || {}; ng[name] = value; } } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const win = typeof window !== 'undefined' && window || {}; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ class ChangeDetectionPerfRecord { constructor(msPerTick, numTicks) { this.msPerTick = msPerTick; this.numTicks = numTicks; } } /** * Entry point for all Angular profiling-related debug tools. This object * corresponds to the `ng.profiler` in the dev console. */ class AngularProfiler { constructor(ref) { this.appRef = ref.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ApplicationRef); } // tslint:disable:no-console /** * Exercises change detection in a loop and then prints the average amount of * time in milliseconds how long a single round of change detection takes for * the current state of the UI. It runs a minimum of 5 rounds for a minimum * of 500 milliseconds. * * Optionally, a user may pass a `config` parameter containing a map of * options. Supported options are: * * `record` (boolean) - causes the profiler to record a CPU profile while * it exercises the change detector. Example: * * ``` * ng.profiler.timeChangeDetection({record: true}) * ``` */ timeChangeDetection(config) { const record = config && config['record']; const profileName = 'Change Detection'; // Profiler is not available in Android browsers without dev tools opened const isProfilerAvailable = win.console.profile != null; if (record && isProfilerAvailable) { win.console.profile(profileName); } const start = performanceNow(); let numTicks = 0; while (numTicks < 5 || performanceNow() - start < 500) { this.appRef.tick(); numTicks++; } const end = performanceNow(); if (record && isProfilerAvailable) { win.console.profileEnd(profileName); } const msPerTick = (end - start) / numTicks; win.console.log(`ran ${numTicks} change detection cycles`); win.console.log(`${msPerTick.toFixed(2)} ms per check`); return new ChangeDetectionPerfRecord(msPerTick, numTicks); } } function performanceNow() { return win.performance && win.performance.now ? win.performance.now() : new Date().getTime(); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const PROFILER_GLOBAL_NAME = 'profiler'; /** * Enabled Angular debug tools that are accessible via your browser's * developer console. * * Usage: * * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j) * 1. Type `ng.` (usually the console will show auto-complete suggestion) * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()` * then hit Enter. * * @publicApi */ function enableDebugTools(ref) { exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref)); return ref; } /** * Disables Angular tools. * * @publicApi */ function disableDebugTools() { exportNgVar(PROFILER_GLOBAL_NAME, null); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function escapeHtml(text) { const escapedText = { '&': '&a;', '"': '&q;', '\'': '&s;', '<': '&l;', '>': '&g;' }; return text.replace(/[&"'<>]/g, s => escapedText[s]); } function unescapeHtml(text) { const unescapedText = { '&a;': '&', '&q;': '"', '&s;': '\'', '&l;': '<', '&g;': '>' }; return text.replace(/&[^;]+;/g, s => unescapedText[s]); } /** * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`. * * Example: * * ``` * const COUNTER_KEY = makeStateKey<number>('counter'); * let value = 10; * * transferState.set(COUNTER_KEY, value); * ``` * * @publicApi */ function makeStateKey(key) { return key; } /** * A key value store that is transferred from the application on the server side to the application * on the client side. * * The `TransferState` is available as an injectable token. * On the client, just inject this token using DI and use it, it will be lazily initialized. * On the server it's already included if `renderApplication` function is used. Otherwise, import * the `ServerTransferStateModule` module to make the `TransferState` available. * * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only * boolean, number, string, null and non-class objects will be serialized and deserialized in a * non-lossy manner. * * @publicApi */ class TransferState { constructor() { this.store = {}; this.onSerializeCallbacks = {}; } /** * Get the value corresponding to a key. Return `defaultValue` if key is not found. */ get(key, defaultValue) { return this.store[key] !== undefined ? this.store[key] : defaultValue; } /** * Set the value corresponding to a key. */ set(key, value) { this.store[key] = value; } /** * Remove a key from the store. */ remove(key) { delete this.store[key]; } /** * Test whether a key exists in the store. */ hasKey(key) { return this.store.hasOwnProperty(key); } /** * Indicates whether the state is empty. */ get isEmpty() { return Object.keys(this.store).length === 0; } /** * Register a callback to provide the value for a key when `toJson` is called. */ onSerialize(key, callback) { this.onSerializeCallbacks[key] = callback; } /** * Serialize the current state of the store to JSON. */ toJson() { // Call the onSerialize callbacks and put those values into the store. for (const key in this.onSerializeCallbacks) { if (this.onSerializeCallbacks.hasOwnProperty(key)) { try { this.store[key] = this.onSerializeCallbacks[key](); } catch (e) { console.warn('Exception in onSerialize callback: ', e); } } } return JSON.stringify(this.store); } } TransferState.ɵfac = function TransferState_Factory(t) { return new (t || TransferState)(); }; TransferState.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: TransferState, factory: function () { return (() => { const doc = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT); const appId = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.APP_ID); const state = new TransferState(); state.store = retrieveTransferredState(doc, appId); return state; })(); }, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TransferState, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root', useFactory: () => { const doc = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT); const appId = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.APP_ID); const state = new TransferState(); state.store = retrieveTransferredState(doc, appId); return state; } }] }], null, null); })(); function retrieveTransferredState(doc, appId) { // Locate the script tag with the JSON data transferred from the server. // The id of the script tag is set to the Angular appId + 'state'. const script = doc.getElementById(appId + '-state'); let initialState = {}; if (script && script.textContent) { try { // Avoid using any here as it triggers lint errors in google3 (any is not allowed). initialState = JSON.parse(unescapeHtml(script.textContent)); } catch (e) { console.warn('Exception while restoring TransferState for app ' + appId, e); } } return initialState; } /** * NgModule to install on the client side while using the `TransferState` to transfer state from * server to client. * * @publicApi * @deprecated no longer needed, you can inject the `TransferState` in an app without providing * this module. */ class BrowserTransferStateModule {} BrowserTransferStateModule.ɵfac = function BrowserTransferStateModule_Factory(t) { return new (t || BrowserTransferStateModule)(); }; BrowserTransferStateModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: BrowserTransferStateModule }); BrowserTransferStateModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({}); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](BrowserTransferStateModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule, args: [{}] }], null, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Predicates for use with {@link DebugElement}'s query functions. * * @publicApi */ class By { /** * Match all nodes. * * @usageNotes * ### Example * * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'} */ static all() { return () => true; } /** * Match elements by the given CSS selector. * * @usageNotes * ### Example * * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'} */ static css(selector) { return debugElement => { return debugElement.nativeElement != null ? elementMatches(debugElement.nativeElement, selector) : false; }; } /** * Match nodes that have the given directive present. * * @usageNotes * ### Example * * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'} */ static directive(type) { return debugNode => debugNode.providerTokens.indexOf(type) !== -1; } } function elementMatches(n, selector) { if ((0,_angular_common__WEBPACK_IMPORTED_MODULE_0__["ɵgetDOM"])().isElementNode(n)) { return n.matches && n.matches(selector) || n.msMatchesSelector && n.msMatchesSelector(selector) || n.webkitMatchesSelector && n.webkitMatchesSelector(selector); } return false; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Supported HammerJS recognizer event names. */ const EVENT_NAMES = { // pan 'pan': true, 'panstart': true, 'panmove': true, 'panend': true, 'pancancel': true, 'panleft': true, 'panright': true, 'panup': true, 'pandown': true, // pinch 'pinch': true, 'pinchstart': true, 'pinchmove': true, 'pinchend': true, 'pinchcancel': true, 'pinchin': true, 'pinchout': true, // press 'press': true, 'pressup': true, // rotate 'rotate': true, 'rotatestart': true, 'rotatemove': true, 'rotateend': true, 'rotatecancel': true, // swipe 'swipe': true, 'swipeleft': true, 'swiperight': true, 'swipeup': true, 'swipedown': true, // tap 'tap': true, 'doubletap': true }; /** * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular. * @see `HammerGestureConfig` * * @ngModule HammerModule * @publicApi */ const HAMMER_GESTURE_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('HammerGestureConfig'); /** * Injection token used to provide a {@link HammerLoader} to Angular. * * @publicApi */ const HAMMER_LOADER = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('HammerLoader'); /** * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager) * for gesture recognition. Configures specific event recognition. * @publicApi */ class HammerGestureConfig { constructor() { /** * A set of supported event names for gestures to be used in Angular. * Angular supports all built-in recognizers, as listed in * [HammerJS documentation](https://hammerjs.github.io/). */ this.events = []; /** * Maps gesture event names to a set of configuration options * that specify overrides to the default values for specific properties. * * The key is a supported event name to be configured, * and the options object contains a set of properties, with override values * to be applied to the named recognizer event. * For example, to disable recognition of the rotate event, specify * `{"rotate": {"enable": false}}`. * * Properties that are not present take the HammerJS default values. * For information about which properties are supported for which events, * and their allowed and default values, see * [HammerJS documentation](https://hammerjs.github.io/). * */ this.overrides = {}; } /** * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager) * and attaches it to a given HTML element. * @param element The element that will recognize gestures. * @returns A HammerJS event-manager object. */ buildHammer(element) { const mc = new Hammer(element, this.options); mc.get('pinch').set({ enable: true }); mc.get('rotate').set({ enable: true }); for (const eventName in this.overrides) { mc.get(eventName).set(this.overrides[eventName]); } return mc; } } HammerGestureConfig.ɵfac = function HammerGestureConfig_Factory(t) { return new (t || HammerGestureConfig)(); }; HammerGestureConfig.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HammerGestureConfig, factory: HammerGestureConfig.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](HammerGestureConfig, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable }], null, null); })(); /** * Event plugin that adds Hammer support to an application. * * @ngModule HammerModule */ class HammerGesturesPlugin extends EventManagerPlugin { constructor(doc, _config, console, loader) { super(doc); this._config = _config; this.console = console; this.loader = loader; this._loaderPromise = null; } supports(eventName) { if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) { return false; } if (!window.Hammer && !this.loader) { if (typeof ngDevMode === 'undefined' || ngDevMode) { this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` + `loaded and no custom loader has been specified.`); } return false; } return true; } addEventListener(element, eventName, handler) { const zone = this.manager.getZone(); eventName = eventName.toLowerCase(); // If Hammer is not present but a loader is specified, we defer adding the event listener // until Hammer is loaded. if (!window.Hammer && this.loader) { this._loaderPromise = this._loaderPromise || zone.runOutsideAngular(() => this.loader()); // This `addEventListener` method returns a function to remove the added listener. // Until Hammer is loaded, the returned function needs to *cancel* the registration rather // than remove anything. let cancelRegistration = false; let deregister = () => { cancelRegistration = true; }; zone.runOutsideAngular(() => this._loaderPromise.then(() => { // If Hammer isn't actually loaded when the custom loader resolves, give up. if (!window.Hammer) { if (typeof ngDevMode === 'undefined' || ngDevMode) { this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`); } deregister = () => {}; return; } if (!cancelRegistration) { // Now that Hammer is loaded and the listener is being loaded for real, // the deregistration function changes from canceling registration to // removal. deregister = this.addEventListener(element, eventName, handler); } }).catch(() => { if (typeof ngDevMode === 'undefined' || ngDevMode) { this.console.warn(`The "${eventName}" event cannot be bound because the custom ` + `Hammer.JS loader failed.`); } deregister = () => {}; })); // Return a function that *executes* `deregister` (and not `deregister` itself) so that we // can change the behavior of `deregister` once the listener is added. Using a closure in // this way allows us to avoid any additional data structures to track listener removal. return () => { deregister(); }; } return zone.runOutsideAngular(() => { // Creating the manager bind events, must be done outside of angular const mc = this._config.buildHammer(element); const callback = function (eventObj) { zone.runGuarded(function () { handler(eventObj); }); }; mc.on(eventName, callback); return () => { mc.off(eventName, callback); // destroy mc to prevent memory leak if (typeof mc.destroy === 'function') { mc.destroy(); } }; }); } isCustomEvent(eventName) { return this._config.events.indexOf(eventName) > -1; } } HammerGesturesPlugin.ɵ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)); }; HammerGesturesPlugin.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HammerGesturesPlugin, factory: HammerGesturesPlugin.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](HammerGesturesPlugin, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable }], function () { return [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT] }] }, { type: HammerGestureConfig, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [HAMMER_GESTURE_CONFIG] }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵConsole"] }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Optional }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [HAMMER_LOADER] }] }]; }, null); })(); /** * Adds support for HammerJS. * * Import this module at the root of your application so that Angular can work with * HammerJS to detect gesture events. * * Note that applications still need to include the HammerJS script itself. This module * simply sets up the coordination layer between HammerJS and Angular's EventManager. * * @publicApi */ class HammerModule {} HammerModule.ɵfac = function HammerModule_Factory(t) { return new (t || HammerModule)(); }; HammerModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: HammerModule }); HammerModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ providers: [{ provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true, 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]] }, { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] }] }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](HammerModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule, args: [{ providers: [{ provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true, 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]] }, { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] }] }] }], null, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing * values to be safe to use in the different DOM contexts. * * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on * the website. * * In specific situations, it might be necessary to disable sanitization, for example if the * application genuinely needs to produce a `javascript:` style link with a dynamic value in it. * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...` * methods, and then binding to that value from the template. * * These situations should be very rare, and extraordinary care must be taken to avoid creating a * Cross Site Scripting (XSS) security bug! * * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as * close as possible to the source of the value, to make it easy to verify no security bug is * created by its use. * * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous * code. The sanitizer leaves safe values intact. * * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in * sanitization for the value passed in. Carefully check and audit all values and code paths going * into this call. Make sure any user data is appropriately escaped for this security context. * For more detail, see the [Security Guide](https://g.co/ng/security). * * @publicApi */ class DomSanitizer {} DomSanitizer.ɵfac = function DomSanitizer_Factory(t) { return new (t || DomSanitizer)(); }; DomSanitizer.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomSanitizer, factory: function DomSanitizer_Factory(t) { let r = null; if (t) { r = new (t || DomSanitizer)(); } else { r = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](DomSanitizerImpl); } return r; }, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomSanitizer, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root', useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(() => DomSanitizerImpl) }] }], null, null); })(); function domSanitizerImplFactory(injector) { return new DomSanitizerImpl(injector.get(_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT)); } class DomSanitizerImpl extends DomSanitizer { constructor(_doc) { super(); this._doc = _doc; } sanitize(ctx, value) { if (value == null) return null; switch (ctx) { case _angular_core__WEBPACK_IMPORTED_MODULE_1__.SecurityContext.NONE: return value; case _angular_core__WEBPACK_IMPORTED_MODULE_1__.SecurityContext.HTML: if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "HTML" /* BypassType.Html */ )) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); } return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵ_sanitizeHtml"])(this._doc, String(value)).toString(); case _angular_core__WEBPACK_IMPORTED_MODULE_1__.SecurityContext.STYLE: if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "Style" /* BypassType.Style */ )) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); } return value; case _angular_core__WEBPACK_IMPORTED_MODULE_1__.SecurityContext.SCRIPT: if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "Script" /* BypassType.Script */ )) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); } throw new Error('unsafe value used in a script context'); case _angular_core__WEBPACK_IMPORTED_MODULE_1__.SecurityContext.URL: if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "URL" /* BypassType.Url */ )) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); } return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵ_sanitizeUrl"])(String(value)); case _angular_core__WEBPACK_IMPORTED_MODULE_1__.SecurityContext.RESOURCE_URL: if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵallowSanitizationBypassAndThrow"])(value, "ResourceURL" /* BypassType.ResourceUrl */ )) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵunwrapSafeValue"])(value); } throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)'); default: throw new Error(`Unexpected SecurityContext ${ctx} (see https://g.co/ng/security#xss)`); } } bypassSecurityTrustHtml(value) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustHtml"])(value); } bypassSecurityTrustStyle(value) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustStyle"])(value); } bypassSecurityTrustScript(value) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustScript"])(value); } bypassSecurityTrustUrl(value) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustUrl"])(value); } bypassSecurityTrustResourceUrl(value) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵbypassSanitizationTrustResourceUrl"])(value); } } DomSanitizerImpl.ɵfac = function DomSanitizerImpl_Factory(t) { return new (t || DomSanitizerImpl)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT)); }; DomSanitizerImpl.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: DomSanitizerImpl, factory: function DomSanitizerImpl_Factory(t) { let r = null; if (t) { r = new t(); } else { r = domSanitizerImplFactory(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.Injector)); } return r; }, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](DomSanitizerImpl, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root', useFactory: domSanitizerImplFactory, deps: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.Injector] }] }], function () { return [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [_angular_common__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT] }] }]; }, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @publicApi */ const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.Version('14.3.0'); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // This file only reexports content of the `src` folder. Keep it that way. /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Generated bundle index. Do not edit. */ /***/ }), /***/ 60124: /*!**********************************************************!*\ !*** ./node_modules/@angular/router/fesm2020/router.mjs ***! \**********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ActivatedRoute": () => (/* binding */ ActivatedRoute), /* harmony export */ "ActivatedRouteSnapshot": () => (/* binding */ ActivatedRouteSnapshot), /* harmony export */ "ActivationEnd": () => (/* binding */ ActivationEnd), /* harmony export */ "ActivationStart": () => (/* binding */ ActivationStart), /* harmony export */ "BaseRouteReuseStrategy": () => (/* binding */ BaseRouteReuseStrategy), /* harmony export */ "ChildActivationEnd": () => (/* binding */ ChildActivationEnd), /* harmony export */ "ChildActivationStart": () => (/* binding */ ChildActivationStart), /* harmony export */ "ChildrenOutletContexts": () => (/* binding */ ChildrenOutletContexts), /* harmony export */ "DefaultTitleStrategy": () => (/* binding */ DefaultTitleStrategy), /* harmony export */ "DefaultUrlSerializer": () => (/* binding */ DefaultUrlSerializer), /* harmony export */ "GuardsCheckEnd": () => (/* binding */ GuardsCheckEnd), /* harmony export */ "GuardsCheckStart": () => (/* binding */ GuardsCheckStart), /* harmony export */ "NavigationCancel": () => (/* binding */ NavigationCancel), /* harmony export */ "NavigationEnd": () => (/* binding */ NavigationEnd), /* harmony export */ "NavigationError": () => (/* binding */ NavigationError), /* harmony export */ "NavigationStart": () => (/* binding */ NavigationStart), /* harmony export */ "NoPreloading": () => (/* binding */ NoPreloading), /* harmony export */ "OutletContext": () => (/* binding */ OutletContext), /* harmony export */ "PRIMARY_OUTLET": () => (/* binding */ PRIMARY_OUTLET), /* harmony export */ "PreloadAllModules": () => (/* binding */ PreloadAllModules), /* harmony export */ "PreloadingStrategy": () => (/* binding */ PreloadingStrategy), /* harmony export */ "ROUTER_CONFIGURATION": () => (/* binding */ ROUTER_CONFIGURATION), /* harmony export */ "ROUTER_INITIALIZER": () => (/* binding */ ROUTER_INITIALIZER), /* harmony export */ "ROUTES": () => (/* binding */ ROUTES), /* harmony export */ "ResolveEnd": () => (/* binding */ ResolveEnd), /* harmony export */ "ResolveStart": () => (/* binding */ ResolveStart), /* harmony export */ "RouteConfigLoadEnd": () => (/* binding */ RouteConfigLoadEnd), /* harmony export */ "RouteConfigLoadStart": () => (/* binding */ RouteConfigLoadStart), /* harmony export */ "RouteReuseStrategy": () => (/* binding */ RouteReuseStrategy), /* harmony export */ "Router": () => (/* binding */ Router), /* harmony export */ "RouterEvent": () => (/* binding */ RouterEvent), /* harmony export */ "RouterLink": () => (/* binding */ RouterLink), /* harmony export */ "RouterLinkActive": () => (/* binding */ RouterLinkActive), /* harmony export */ "RouterLinkWithHref": () => (/* binding */ RouterLinkWithHref), /* harmony export */ "RouterModule": () => (/* binding */ RouterModule), /* harmony export */ "RouterOutlet": () => (/* binding */ RouterOutlet), /* harmony export */ "RouterPreloader": () => (/* binding */ RouterPreloader), /* harmony export */ "RouterState": () => (/* binding */ RouterState), /* harmony export */ "RouterStateSnapshot": () => (/* binding */ RouterStateSnapshot), /* harmony export */ "RoutesRecognized": () => (/* binding */ RoutesRecognized), /* harmony export */ "Scroll": () => (/* binding */ Scroll), /* harmony export */ "TitleStrategy": () => (/* binding */ TitleStrategy), /* harmony export */ "UrlHandlingStrategy": () => (/* binding */ UrlHandlingStrategy), /* harmony export */ "UrlSegment": () => (/* binding */ UrlSegment), /* harmony export */ "UrlSegmentGroup": () => (/* binding */ UrlSegmentGroup), /* harmony export */ "UrlSerializer": () => (/* binding */ UrlSerializer), /* harmony export */ "UrlTree": () => (/* binding */ UrlTree), /* harmony export */ "VERSION": () => (/* binding */ VERSION), /* harmony export */ "convertToParamMap": () => (/* binding */ convertToParamMap), /* harmony export */ "createUrlTreeFromSnapshot": () => (/* binding */ createUrlTreeFromSnapshot), /* harmony export */ "defaultUrlMatcher": () => (/* binding */ defaultUrlMatcher), /* harmony export */ "provideRouter": () => (/* binding */ provideRouter), /* harmony export */ "provideRoutes": () => (/* binding */ provideRoutes), /* harmony export */ "withDebugTracing": () => (/* binding */ withDebugTracing), /* harmony export */ "withDisabledInitialNavigation": () => (/* binding */ withDisabledInitialNavigation), /* harmony export */ "withEnabledBlockingInitialNavigation": () => (/* binding */ withEnabledBlockingInitialNavigation), /* harmony export */ "withInMemoryScrolling": () => (/* binding */ withInMemoryScrolling), /* harmony export */ "withPreloading": () => (/* binding */ withPreloading), /* harmony export */ "withRouterConfig": () => (/* binding */ withRouterConfig), /* harmony export */ "ɵEmptyOutletComponent": () => (/* binding */ ɵEmptyOutletComponent), /* harmony export */ "ɵROUTER_PROVIDERS": () => (/* binding */ ROUTER_PROVIDERS), /* harmony export */ "ɵassignExtraOptionsToRouter": () => (/* binding */ assignExtraOptionsToRouter), /* harmony export */ "ɵflatten": () => (/* binding */ flatten), /* harmony export */ "ɵwithPreloading": () => (/* binding */ withPreloading) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 45449); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 24383); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 64139); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 84505); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 90213); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 19193); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs */ 55828); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs */ 1635); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs */ 36800); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! rxjs */ 66587); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! rxjs */ 12378); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! rxjs */ 26439); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! rxjs */ 64483); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! rxjs */ 92218); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ 90944); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 86942); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 59095); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 83910); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ 25722); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ 59151); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 80522); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ 25670); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs/operators */ 11133); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 88759); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! rxjs/operators */ 47418); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! rxjs/operators */ 32647); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! rxjs/operators */ 35690); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! rxjs/operators */ 45050); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! rxjs/operators */ 9701); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! rxjs/operators */ 52160); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! rxjs/operators */ 29361); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! rxjs/operators */ 44661); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! rxjs/operators */ 38331); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! rxjs/operators */ 76675); /* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @angular/platform-browser */ 34497); /** * @license Angular v14.3.0 * (c) 2010-2022 Google LLC. https://angular.io/ * License: MIT */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * The primary routing outlet. * * @publicApi */ const PRIMARY_OUTLET = 'primary'; /** * A private symbol used to store the value of `Route.title` inside the `Route.data` if it is a * static string or `Route.resolve` if anything else. This allows us to reuse the existing route * data/resolvers to support the title feature without new instrumentation in the `Router` pipeline. */ const RouteTitleKey = Symbol('RouteTitle'); class ParamsAsMap { constructor(params) { this.params = params || {}; } has(name) { return Object.prototype.hasOwnProperty.call(this.params, name); } get(name) { if (this.has(name)) { const v = this.params[name]; return Array.isArray(v) ? v[0] : v; } return null; } getAll(name) { if (this.has(name)) { const v = this.params[name]; return Array.isArray(v) ? v : [v]; } return []; } get keys() { return Object.keys(this.params); } } /** * Converts a `Params` instance to a `ParamMap`. * @param params The instance to convert. * @returns The new map instance. * * @publicApi */ function convertToParamMap(params) { return new ParamsAsMap(params); } /** * Matches the route configuration (`route`) against the actual URL (`segments`). * * When no matcher is defined on a `Route`, this is the matcher used by the Router by default. * * @param segments The remaining unmatched segments in the current navigation * @param segmentGroup The current segment group being matched * @param route The `Route` to match against. * * @see UrlMatchResult * @see Route * * @returns The resulting match information or `null` if the `route` should not match. * @publicApi */ function defaultUrlMatcher(segments, segmentGroup, route) { const parts = route.path.split('/'); if (parts.length > segments.length) { // The actual URL is shorter than the config, no match return null; } if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || parts.length < segments.length)) { // The config is longer than the actual URL but we are looking for a full match, return null return null; } const posParams = {}; // Check each config part against the actual URL for (let index = 0; index < parts.length; index++) { const part = parts[index]; const segment = segments[index]; const isParameter = part.startsWith(':'); if (isParameter) { posParams[part.substring(1)] = segment; } else if (part !== segment.path) { // The actual URL part does not match the config, no match return null; } } return { consumed: segments.slice(0, parts.length), posParams }; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function shallowEqualArrays(a, b) { if (a.length !== b.length) return false; for (let i = 0; i < a.length; ++i) { if (!shallowEqual(a[i], b[i])) return false; } return true; } function shallowEqual(a, b) { // While `undefined` should never be possible, it would sometimes be the case in IE 11 // and pre-chromium Edge. The check below accounts for this edge case. const k1 = a ? Object.keys(a) : undefined; const k2 = b ? Object.keys(b) : undefined; if (!k1 || !k2 || k1.length != k2.length) { return false; } let key; for (let i = 0; i < k1.length; i++) { key = k1[i]; if (!equalArraysOrString(a[key], b[key])) { return false; } } return true; } /** * Test equality for arrays of strings or a string. */ function equalArraysOrString(a, b) { if (Array.isArray(a) && Array.isArray(b)) { if (a.length !== b.length) return false; const aSorted = [...a].sort(); const bSorted = [...b].sort(); return aSorted.every((val, index) => bSorted[index] === val); } else { return a === b; } } /** * Flattens single-level nested arrays. */ function flatten(arr) { return Array.prototype.concat.apply([], arr); } /** * Return the last element of an array. */ function last(a) { return a.length > 0 ? a[a.length - 1] : null; } /** * Verifys all booleans in an array are `true`. */ function and(bools) { return !bools.some(v => !v); } function forEach(map, callback) { for (const prop in map) { if (map.hasOwnProperty(prop)) { callback(map[prop], prop); } } } function wrapIntoObservable(value) { if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisObservable"])(value)) { return value; } if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisPromise"])(value)) { // Use `Promise.resolve()` to wrap promise-like instances. // Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the // change detection. return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(Promise.resolve(value)); } return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(value); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE$9 = typeof ngDevMode === 'undefined' || ngDevMode; function createEmptyUrlTree() { return new UrlTree(new UrlSegmentGroup([], {}), {}, null); } const pathCompareMap = { 'exact': equalSegmentGroups, 'subset': containsSegmentGroup }; const paramCompareMap = { 'exact': equalParams, 'subset': containsParams, 'ignored': () => true }; function containsTree(container, containee, options) { return pathCompareMap[options.paths](container.root, containee.root, options.matrixParams) && paramCompareMap[options.queryParams](container.queryParams, containee.queryParams) && !(options.fragment === 'exact' && container.fragment !== containee.fragment); } function equalParams(container, containee) { // TODO: This does not handle array params correctly. return shallowEqual(container, containee); } function equalSegmentGroups(container, containee, matrixParams) { if (!equalPath(container.segments, containee.segments)) return false; if (!matrixParamsMatch(container.segments, containee.segments, matrixParams)) { return false; } if (container.numberOfChildren !== containee.numberOfChildren) return false; for (const c in containee.children) { if (!container.children[c]) return false; if (!equalSegmentGroups(container.children[c], containee.children[c], matrixParams)) return false; } return true; } function containsParams(container, containee) { return Object.keys(containee).length <= Object.keys(container).length && Object.keys(containee).every(key => equalArraysOrString(container[key], containee[key])); } function containsSegmentGroup(container, containee, matrixParams) { return containsSegmentGroupHelper(container, containee, containee.segments, matrixParams); } function containsSegmentGroupHelper(container, containee, containeePaths, matrixParams) { if (container.segments.length > containeePaths.length) { const current = container.segments.slice(0, containeePaths.length); if (!equalPath(current, containeePaths)) return false; if (containee.hasChildren()) return false; if (!matrixParamsMatch(current, containeePaths, matrixParams)) return false; return true; } else if (container.segments.length === containeePaths.length) { if (!equalPath(container.segments, containeePaths)) return false; if (!matrixParamsMatch(container.segments, containeePaths, matrixParams)) return false; for (const c in containee.children) { if (!container.children[c]) return false; if (!containsSegmentGroup(container.children[c], containee.children[c], matrixParams)) { return false; } } return true; } else { const current = containeePaths.slice(0, container.segments.length); const next = containeePaths.slice(container.segments.length); if (!equalPath(container.segments, current)) return false; if (!matrixParamsMatch(container.segments, current, matrixParams)) return false; if (!container.children[PRIMARY_OUTLET]) return false; return containsSegmentGroupHelper(container.children[PRIMARY_OUTLET], containee, next, matrixParams); } } function matrixParamsMatch(containerPaths, containeePaths, options) { return containeePaths.every((containeeSegment, i) => { return paramCompareMap[options](containerPaths[i].parameters, containeeSegment.parameters); }); } /** * @description * * Represents the parsed URL. * * Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a * serialized tree. * UrlTree is a data structure that provides a lot of affordances in dealing with URLs * * @usageNotes * ### Example * * ``` * @Component({templateUrl:'template.html'}) * class MyComponent { * constructor(router: Router) { * const tree: UrlTree = * router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment'); * const f = tree.fragment; // return 'fragment' * const q = tree.queryParams; // returns {debug: 'true'} * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET]; * const s: UrlSegment[] = g.segments; // returns 2 segments 'team' and '33' * g.children[PRIMARY_OUTLET].segments; // returns 2 segments 'user' and 'victor' * g.children['support'].segments; // return 1 segment 'help' * } * } * ``` * * @publicApi */ class UrlTree { /** @internal */ constructor( /** The root segment group of the URL tree */ root, /** The query params of the URL */ queryParams, /** The fragment of the URL */ fragment) { this.root = root; this.queryParams = queryParams; this.fragment = fragment; } get queryParamMap() { if (!this._queryParamMap) { this._queryParamMap = convertToParamMap(this.queryParams); } return this._queryParamMap; } /** @docsNotRequired */ toString() { return DEFAULT_SERIALIZER.serialize(this); } } /** * @description * * Represents the parsed URL segment group. * * See `UrlTree` for more information. * * @publicApi */ class UrlSegmentGroup { constructor( /** The URL segments of this group. See `UrlSegment` for more information */ segments, /** The list of children of this group */ children) { this.segments = segments; this.children = children; /** The parent node in the url tree */ this.parent = null; forEach(children, (v, k) => v.parent = this); } /** Whether the segment has child segments */ hasChildren() { return this.numberOfChildren > 0; } /** Number of child segments */ get numberOfChildren() { return Object.keys(this.children).length; } /** @docsNotRequired */ toString() { return serializePaths(this); } } /** * @description * * Represents a single URL segment. * * A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix * parameters associated with the segment. * * @usageNotes * ### Example * * ``` * @Component({templateUrl:'template.html'}) * class MyComponent { * constructor(router: Router) { * const tree: UrlTree = router.parseUrl('/team;id=33'); * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET]; * const s: UrlSegment[] = g.segments; * s[0].path; // returns 'team' * s[0].parameters; // returns {id: 33} * } * } * ``` * * @publicApi */ class UrlSegment { constructor( /** The path part of a URL segment */ path, /** The matrix parameters associated with a segment */ parameters) { this.path = path; this.parameters = parameters; } get parameterMap() { if (!this._parameterMap) { this._parameterMap = convertToParamMap(this.parameters); } return this._parameterMap; } /** @docsNotRequired */ toString() { return serializePath(this); } } function equalSegments(as, bs) { return equalPath(as, bs) && as.every((a, i) => shallowEqual(a.parameters, bs[i].parameters)); } function equalPath(as, bs) { if (as.length !== bs.length) return false; return as.every((a, i) => a.path === bs[i].path); } function mapChildrenIntoArray(segment, fn) { let res = []; forEach(segment.children, (child, childOutlet) => { if (childOutlet === PRIMARY_OUTLET) { res = res.concat(fn(child, childOutlet)); } }); forEach(segment.children, (child, childOutlet) => { if (childOutlet !== PRIMARY_OUTLET) { res = res.concat(fn(child, childOutlet)); } }); return res; } /** * @description * * Serializes and deserializes a URL string into a URL tree. * * The url serialization strategy is customizable. You can * make all URLs case insensitive by providing a custom UrlSerializer. * * See `DefaultUrlSerializer` for an example of a URL serializer. * * @publicApi */ class UrlSerializer {} UrlSerializer.ɵfac = function UrlSerializer_Factory(t) { return new (t || UrlSerializer)(); }; UrlSerializer.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: UrlSerializer, factory: function () { return (() => new DefaultUrlSerializer())(); }, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](UrlSerializer, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }] }], null, null); })(); /** * @description * * A default implementation of the `UrlSerializer`. * * Example URLs: * * ``` * /inbox/33(popup:compose) * /inbox/33;open=true/messages/44 * ``` * * DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the * colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to * specify route specific parameters. * * @publicApi */ class DefaultUrlSerializer { /** Parses a url into a `UrlTree` */ parse(url) { const p = new UrlParser(url); return new UrlTree(p.parseRootSegment(), p.parseQueryParams(), p.parseFragment()); } /** Converts a `UrlTree` into a url */ serialize(tree) { const segment = `/${serializeSegment(tree.root, true)}`; const query = serializeQueryParams(tree.queryParams); const fragment = typeof tree.fragment === `string` ? `#${encodeUriFragment(tree.fragment)}` : ''; return `${segment}${query}${fragment}`; } } const DEFAULT_SERIALIZER = new DefaultUrlSerializer(); function serializePaths(segment) { return segment.segments.map(p => serializePath(p)).join('/'); } function serializeSegment(segment, root) { if (!segment.hasChildren()) { return serializePaths(segment); } if (root) { const primary = segment.children[PRIMARY_OUTLET] ? serializeSegment(segment.children[PRIMARY_OUTLET], false) : ''; const children = []; forEach(segment.children, (v, k) => { if (k !== PRIMARY_OUTLET) { children.push(`${k}:${serializeSegment(v, false)}`); } }); return children.length > 0 ? `${primary}(${children.join('//')})` : primary; } else { const children = mapChildrenIntoArray(segment, (v, k) => { if (k === PRIMARY_OUTLET) { return [serializeSegment(segment.children[PRIMARY_OUTLET], false)]; } return [`${k}:${serializeSegment(v, false)}`]; }); // use no parenthesis if the only child is a primary outlet route if (Object.keys(segment.children).length === 1 && segment.children[PRIMARY_OUTLET] != null) { return `${serializePaths(segment)}/${children[0]}`; } return `${serializePaths(segment)}/(${children.join('//')})`; } } /** * Encodes a URI string with the default encoding. This function will only ever be called from * `encodeUriQuery` or `encodeUriSegment` as it's the base set of encodings to be used. We need * a custom encoding because encodeURIComponent is too aggressive and encodes stuff that doesn't * have to be encoded per https://url.spec.whatwg.org. */ function encodeUriString(s) { return encodeURIComponent(s).replace(/%40/g, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ','); } /** * This function should be used to encode both keys and values in a query string key/value. In * the following URL, you need to call encodeUriQuery on "k" and "v": * * http://www.site.org/html;mk=mv?k=v#f */ function encodeUriQuery(s) { return encodeUriString(s).replace(/%3B/gi, ';'); } /** * This function should be used to encode a URL fragment. In the following URL, you need to call * encodeUriFragment on "f": * * http://www.site.org/html;mk=mv?k=v#f */ function encodeUriFragment(s) { return encodeURI(s); } /** * This function should be run on any URI segment as well as the key and value in a key/value * pair for matrix params. In the following URL, you need to call encodeUriSegment on "html", * "mk", and "mv": * * http://www.site.org/html;mk=mv?k=v#f */ function encodeUriSegment(s) { return encodeUriString(s).replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/%26/gi, '&'); } function decode(s) { return decodeURIComponent(s); } // Query keys/values should have the "+" replaced first, as "+" in a query string is " ". // decodeURIComponent function will not decode "+" as a space. function decodeQuery(s) { return decode(s.replace(/\+/g, '%20')); } function serializePath(path) { return `${encodeUriSegment(path.path)}${serializeMatrixParams(path.parameters)}`; } function serializeMatrixParams(params) { return Object.keys(params).map(key => `;${encodeUriSegment(key)}=${encodeUriSegment(params[key])}`).join(''); } function serializeQueryParams(params) { const strParams = Object.keys(params).map(name => { const value = params[name]; return Array.isArray(value) ? value.map(v => `${encodeUriQuery(name)}=${encodeUriQuery(v)}`).join('&') : `${encodeUriQuery(name)}=${encodeUriQuery(value)}`; }).filter(s => !!s); return strParams.length ? `?${strParams.join('&')}` : ''; } const SEGMENT_RE = /^[^\/()?;=#]+/; function matchSegments(str) { const match = str.match(SEGMENT_RE); return match ? match[0] : ''; } const QUERY_PARAM_RE = /^[^=?&#]+/; // Return the name of the query param at the start of the string or an empty string function matchQueryParams(str) { const match = str.match(QUERY_PARAM_RE); return match ? match[0] : ''; } const QUERY_PARAM_VALUE_RE = /^[^&#]+/; // Return the value of the query param at the start of the string or an empty string function matchUrlQueryParamValue(str) { const match = str.match(QUERY_PARAM_VALUE_RE); return match ? match[0] : ''; } class UrlParser { constructor(url) { this.url = url; this.remaining = url; } parseRootSegment() { this.consumeOptional('/'); if (this.remaining === '' || this.peekStartsWith('?') || this.peekStartsWith('#')) { return new UrlSegmentGroup([], {}); } // The root segment group never has segments return new UrlSegmentGroup([], this.parseChildren()); } parseQueryParams() { const params = {}; if (this.consumeOptional('?')) { do { this.parseQueryParam(params); } while (this.consumeOptional('&')); } return params; } parseFragment() { return this.consumeOptional('#') ? decodeURIComponent(this.remaining) : null; } parseChildren() { if (this.remaining === '') { return {}; } this.consumeOptional('/'); const segments = []; if (!this.peekStartsWith('(')) { segments.push(this.parseSegment()); } while (this.peekStartsWith('/') && !this.peekStartsWith('//') && !this.peekStartsWith('/(')) { this.capture('/'); segments.push(this.parseSegment()); } let children = {}; if (this.peekStartsWith('/(')) { this.capture('/'); children = this.parseParens(true); } let res = {}; if (this.peekStartsWith('(')) { res = this.parseParens(false); } if (segments.length > 0 || Object.keys(children).length > 0) { res[PRIMARY_OUTLET] = new UrlSegmentGroup(segments, children); } return res; } // parse a segment with its matrix parameters // ie `name;k1=v1;k2` parseSegment() { const path = matchSegments(this.remaining); if (path === '' && this.peekStartsWith(';')) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4009 /* RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS */ , NG_DEV_MODE$9 && `Empty path url segment cannot have parameters: '${this.remaining}'.`); } this.capture(path); return new UrlSegment(decode(path), this.parseMatrixParams()); } parseMatrixParams() { const params = {}; while (this.consumeOptional(';')) { this.parseParam(params); } return params; } parseParam(params) { const key = matchSegments(this.remaining); if (!key) { return; } this.capture(key); let value = ''; if (this.consumeOptional('=')) { const valueMatch = matchSegments(this.remaining); if (valueMatch) { value = valueMatch; this.capture(value); } } params[decode(key)] = decode(value); } // Parse a single query parameter `name[=value]` parseQueryParam(params) { const key = matchQueryParams(this.remaining); if (!key) { return; } this.capture(key); let value = ''; if (this.consumeOptional('=')) { const valueMatch = matchUrlQueryParamValue(this.remaining); if (valueMatch) { value = valueMatch; this.capture(value); } } const decodedKey = decodeQuery(key); const decodedVal = decodeQuery(value); if (params.hasOwnProperty(decodedKey)) { // Append to existing values let currentVal = params[decodedKey]; if (!Array.isArray(currentVal)) { currentVal = [currentVal]; params[decodedKey] = currentVal; } currentVal.push(decodedVal); } else { // Create a new value params[decodedKey] = decodedVal; } } // parse `(a/b//outlet_name:c/d)` parseParens(allowPrimary) { const segments = {}; this.capture('('); while (!this.consumeOptional(')') && this.remaining.length > 0) { const path = matchSegments(this.remaining); const next = this.remaining[path.length]; // if is is not one of these characters, then the segment was unescaped // or the group was not closed if (next !== '/' && next !== ')' && next !== ';') { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4010 /* RuntimeErrorCode.UNPARSABLE_URL */ , NG_DEV_MODE$9 && `Cannot parse url '${this.url}'`); } let outletName = undefined; if (path.indexOf(':') > -1) { outletName = path.slice(0, path.indexOf(':')); this.capture(outletName); this.capture(':'); } else if (allowPrimary) { outletName = PRIMARY_OUTLET; } const children = this.parseChildren(); segments[outletName] = Object.keys(children).length === 1 ? children[PRIMARY_OUTLET] : new UrlSegmentGroup([], children); this.consumeOptional('//'); } return segments; } peekStartsWith(str) { return this.remaining.startsWith(str); } // Consumes the prefix when it is present and returns whether it has been consumed consumeOptional(str) { if (this.peekStartsWith(str)) { this.remaining = this.remaining.substring(str.length); return true; } return false; } capture(str) { if (!this.consumeOptional(str)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4011 /* RuntimeErrorCode.UNEXPECTED_VALUE_IN_URL */ , NG_DEV_MODE$9 && `Expected "${str}".`); } } } function createRoot(rootCandidate) { return rootCandidate.segments.length > 0 ? new UrlSegmentGroup([], { [PRIMARY_OUTLET]: rootCandidate }) : rootCandidate; } /** * Recursively merges primary segment children into their parents and also drops empty children * (those which have no segments and no children themselves). The latter prevents serializing a * group into something like `/a(aux:)`, where `aux` is an empty child segment. */ function squashSegmentGroup(segmentGroup) { const newChildren = {}; for (const childOutlet of Object.keys(segmentGroup.children)) { const child = segmentGroup.children[childOutlet]; const childCandidate = squashSegmentGroup(child); // don't add empty children if (childCandidate.segments.length > 0 || childCandidate.hasChildren()) { newChildren[childOutlet] = childCandidate; } } const s = new UrlSegmentGroup(segmentGroup.segments, newChildren); return mergeTrivialChildren(s); } /** * When possible, merges the primary outlet child into the parent `UrlSegmentGroup`. * * When a segment group has only one child which is a primary outlet, merges that child into the * parent. That is, the child segment group's segments are merged into the `s` and the child's * children become the children of `s`. Think of this like a 'squash', merging the child segment * group into the parent. */ function mergeTrivialChildren(s) { if (s.numberOfChildren === 1 && s.children[PRIMARY_OUTLET]) { const c = s.children[PRIMARY_OUTLET]; return new UrlSegmentGroup(s.segments.concat(c.segments), c.children); } return s; } function isUrlTree(v) { return v instanceof UrlTree; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE$8 = typeof ngDevMode === 'undefined' || ngDevMode; /** * Creates a `UrlTree` relative to an `ActivatedRouteSnapshot`. * * @publicApi * * * @param relativeTo The `ActivatedRouteSnapshot` to apply the commands to * @param commands An array of URL fragments with which to construct the new URL tree. * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path * segments, followed by the parameters for each segment. * The fragments are applied to the one provided in the `relativeTo` parameter. * @param queryParams The query parameters for the `UrlTree`. `null` if the `UrlTree` does not have * any query parameters. * @param fragment The fragment for the `UrlTree`. `null` if the `UrlTree` does not have a fragment. * * @usageNotes * * ``` * // create /team/33/user/11 * createUrlTreeFromSnapshot(snapshot, ['/team', 33, 'user', 11]); * * // create /team/33;expand=true/user/11 * createUrlTreeFromSnapshot(snapshot, ['/team', 33, {expand: true}, 'user', 11]); * * // you can collapse static segments like this (this works only with the first passed-in value): * createUrlTreeFromSnapshot(snapshot, ['/team/33/user', userId]); * * // If the first segment can contain slashes, and you do not want the router to split it, * // you can do the following: * createUrlTreeFromSnapshot(snapshot, [{segmentPath: '/one/two'}]); * * // create /team/33/(user/11//right:chat) * createUrlTreeFromSnapshot(snapshot, ['/team', 33, {outlets: {primary: 'user/11', right: * 'chat'}}], null, null); * * // remove the right secondary node * createUrlTreeFromSnapshot(snapshot, ['/team', 33, {outlets: {primary: 'user/11', right: null}}]); * * // For the examples below, assume the current URL is for the `/team/33/user/11` and the * `ActivatedRouteSnapshot` points to `user/11`: * * // navigate to /team/33/user/11/details * createUrlTreeFromSnapshot(snapshot, ['details']); * * // navigate to /team/33/user/22 * createUrlTreeFromSnapshot(snapshot, ['../22']); * * // navigate to /team/44/user/22 * createUrlTreeFromSnapshot(snapshot, ['../../team/44/user/22']); * ``` */ function createUrlTreeFromSnapshot(relativeTo, commands, queryParams = null, fragment = null) { const relativeToUrlSegmentGroup = createSegmentGroupFromRoute(relativeTo); return createUrlTreeFromSegmentGroup(relativeToUrlSegmentGroup, commands, queryParams, fragment); } function createSegmentGroupFromRoute(route) { var _targetGroup; let targetGroup; function createSegmentGroupFromRouteRecursive(currentRoute) { const childOutlets = {}; for (const childSnapshot of currentRoute.children) { const root = createSegmentGroupFromRouteRecursive(childSnapshot); childOutlets[childSnapshot.outlet] = root; } const segmentGroup = new UrlSegmentGroup(currentRoute.url, childOutlets); if (currentRoute === route) { targetGroup = segmentGroup; } return segmentGroup; } const rootCandidate = createSegmentGroupFromRouteRecursive(route.root); const rootSegmentGroup = createRoot(rootCandidate); return (_targetGroup = targetGroup) !== null && _targetGroup !== void 0 ? _targetGroup : rootSegmentGroup; } function createUrlTreeFromSegmentGroup(relativeTo, commands, queryParams, fragment) { let root = relativeTo; while (root.parent) { root = root.parent; } // There are no commands so the `UrlTree` goes to the same path as the one created from the // `UrlSegmentGroup`. All we need to do is update the `queryParams` and `fragment` without // applying any other logic. if (commands.length === 0) { return tree(root, root, root, queryParams, fragment); } const nav = computeNavigation(commands); if (nav.toRoot()) { return tree(root, root, new UrlSegmentGroup([], {}), queryParams, fragment); } const position = findStartingPositionForTargetGroup(nav, root, relativeTo); const newSegmentGroup = position.processChildren ? updateSegmentGroupChildren(position.segmentGroup, position.index, nav.commands) : updateSegmentGroup(position.segmentGroup, position.index, nav.commands); return tree(root, position.segmentGroup, newSegmentGroup, queryParams, fragment); } function createUrlTree(route, urlTree, commands, queryParams, fragment) { var _route$snapshot2; if (commands.length === 0) { return tree(urlTree.root, urlTree.root, urlTree.root, queryParams, fragment); } const nav = computeNavigation(commands); if (nav.toRoot()) { return tree(urlTree.root, urlTree.root, new UrlSegmentGroup([], {}), queryParams, fragment); } function createTreeUsingPathIndex(lastPathIndex) { var _route$snapshot; const startingPosition = findStartingPosition(nav, urlTree, (_route$snapshot = route.snapshot) === null || _route$snapshot === void 0 ? void 0 : _route$snapshot._urlSegment, lastPathIndex); const segmentGroup = startingPosition.processChildren ? updateSegmentGroupChildren(startingPosition.segmentGroup, startingPosition.index, nav.commands) : updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands); return tree(urlTree.root, startingPosition.segmentGroup, segmentGroup, queryParams, fragment); } // Note: The types should disallow `snapshot` from being `undefined` but due to test mocks, this // may be the case. Since we try to access it at an earlier point before the refactor to add the // warning for `relativeLinkResolution: 'legacy'`, this may cause failures in tests where it // didn't before. const result = createTreeUsingPathIndex((_route$snapshot2 = route.snapshot) === null || _route$snapshot2 === void 0 ? void 0 : _route$snapshot2._lastPathIndex); // Check if application is relying on `relativeLinkResolution: 'legacy'` if (typeof ngDevMode === 'undefined' || !!ngDevMode) { var _route$snapshot3; const correctedResult = createTreeUsingPathIndex((_route$snapshot3 = route.snapshot) === null || _route$snapshot3 === void 0 ? void 0 : _route$snapshot3._correctedLastPathIndex); if (correctedResult.toString() !== result.toString()) { console.warn(`relativeLinkResolution: 'legacy' is deprecated and will be removed in a future version of Angular. The link to ${result.toString()} will change to ${correctedResult.toString()} if the code is not updated before then.`); } } return result; } function isMatrixParams(command) { return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath; } /** * Determines if a given command has an `outlets` map. When we encounter a command * with an outlets k/v map, we need to apply each outlet individually to the existing segment. */ function isCommandWithOutlets(command) { return typeof command === 'object' && command != null && command.outlets; } function tree(oldRoot, oldSegmentGroup, newSegmentGroup, queryParams, fragment) { let qp = {}; if (queryParams) { forEach(queryParams, (value, name) => { qp[name] = Array.isArray(value) ? value.map(v => `${v}`) : `${value}`; }); } let rootCandidate; if (oldRoot === oldSegmentGroup) { rootCandidate = newSegmentGroup; } else { rootCandidate = replaceSegment(oldRoot, oldSegmentGroup, newSegmentGroup); } const newRoot = createRoot(squashSegmentGroup(rootCandidate)); return new UrlTree(newRoot, qp, fragment); } /** * Replaces the `oldSegment` which is located in some child of the `current` with the `newSegment`. * This also has the effect of creating new `UrlSegmentGroup` copies to update references. This * shouldn't be necessary but the fallback logic for an invalid ActivatedRoute in the creation uses * the Router's current url tree. If we don't create new segment groups, we end up modifying that * value. */ function replaceSegment(current, oldSegment, newSegment) { const children = {}; forEach(current.children, (c, outletName) => { if (c === oldSegment) { children[outletName] = newSegment; } else { children[outletName] = replaceSegment(c, oldSegment, newSegment); } }); return new UrlSegmentGroup(current.segments, children); } class Navigation { constructor(isAbsolute, numberOfDoubleDots, commands) { this.isAbsolute = isAbsolute; this.numberOfDoubleDots = numberOfDoubleDots; this.commands = commands; if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4003 /* RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS */ , NG_DEV_MODE$8 && 'Root segment cannot have matrix parameters'); } const cmdWithOutlet = commands.find(isCommandWithOutlets); if (cmdWithOutlet && cmdWithOutlet !== last(commands)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4004 /* RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND */ , NG_DEV_MODE$8 && '{outlets:{}} has to be the last command'); } } toRoot() { return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/'; } } /** Transforms commands to a normalized `Navigation` */ function computeNavigation(commands) { if (typeof commands[0] === 'string' && commands.length === 1 && commands[0] === '/') { return new Navigation(true, 0, commands); } let numberOfDoubleDots = 0; let isAbsolute = false; const res = commands.reduce((res, cmd, cmdIdx) => { if (typeof cmd === 'object' && cmd != null) { if (cmd.outlets) { const outlets = {}; forEach(cmd.outlets, (commands, name) => { outlets[name] = typeof commands === 'string' ? commands.split('/') : commands; }); return [...res, { outlets }]; } if (cmd.segmentPath) { return [...res, cmd.segmentPath]; } } if (!(typeof cmd === 'string')) { return [...res, cmd]; } if (cmdIdx === 0) { cmd.split('/').forEach((urlPart, partIndex) => { if (partIndex == 0 && urlPart === '.') {// skip './a' } else if (partIndex == 0 && urlPart === '') { // '/a' isAbsolute = true; } else if (urlPart === '..') { // '../a' numberOfDoubleDots++; } else if (urlPart != '') { res.push(urlPart); } }); return res; } return [...res, cmd]; }, []); return new Navigation(isAbsolute, numberOfDoubleDots, res); } class Position { constructor(segmentGroup, processChildren, index) { this.segmentGroup = segmentGroup; this.processChildren = processChildren; this.index = index; } } function findStartingPositionForTargetGroup(nav, root, target) { if (nav.isAbsolute) { return new Position(root, true, 0); } if (!target) { // `NaN` is used only to maintain backwards compatibility with incorrectly mocked // `ActivatedRouteSnapshot` in tests. In prior versions of this code, the position here was // determined based on an internal property that was rarely mocked, resulting in `NaN`. In // reality, this code path should _never_ be touched since `target` is not allowed to be falsey. return new Position(root, false, NaN); } if (target.parent === null) { return new Position(target, true, 0); } const modifier = isMatrixParams(nav.commands[0]) ? 0 : 1; const index = target.segments.length - 1 + modifier; return createPositionApplyingDoubleDots(target, index, nav.numberOfDoubleDots); } function findStartingPosition(nav, tree, segmentGroup, lastPathIndex) { if (nav.isAbsolute) { return new Position(tree.root, true, 0); } if (lastPathIndex === -1) { // Pathless ActivatedRoute has _lastPathIndex === -1 but should not process children // see issue #26224, #13011, #35687 // However, if the ActivatedRoute is the root we should process children like above. const processChildren = segmentGroup === tree.root; return new Position(segmentGroup, processChildren, 0); } const modifier = isMatrixParams(nav.commands[0]) ? 0 : 1; const index = lastPathIndex + modifier; return createPositionApplyingDoubleDots(segmentGroup, index, nav.numberOfDoubleDots); } function createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) { let g = group; let ci = index; let dd = numberOfDoubleDots; while (dd > ci) { dd -= ci; g = g.parent; if (!g) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4005 /* RuntimeErrorCode.INVALID_DOUBLE_DOTS */ , NG_DEV_MODE$8 && 'Invalid number of \'../\''); } ci = g.segments.length; } return new Position(g, false, ci - dd); } function getOutlets(commands) { if (isCommandWithOutlets(commands[0])) { return commands[0].outlets; } return { [PRIMARY_OUTLET]: commands }; } function updateSegmentGroup(segmentGroup, startIndex, commands) { if (!segmentGroup) { segmentGroup = new UrlSegmentGroup([], {}); } if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) { return updateSegmentGroupChildren(segmentGroup, startIndex, commands); } const m = prefixedWith(segmentGroup, startIndex, commands); const slicedCommands = commands.slice(m.commandIndex); if (m.match && m.pathIndex < segmentGroup.segments.length) { const g = new UrlSegmentGroup(segmentGroup.segments.slice(0, m.pathIndex), {}); g.children[PRIMARY_OUTLET] = new UrlSegmentGroup(segmentGroup.segments.slice(m.pathIndex), segmentGroup.children); return updateSegmentGroupChildren(g, 0, slicedCommands); } else if (m.match && slicedCommands.length === 0) { return new UrlSegmentGroup(segmentGroup.segments, {}); } else if (m.match && !segmentGroup.hasChildren()) { return createNewSegmentGroup(segmentGroup, startIndex, commands); } else if (m.match) { return updateSegmentGroupChildren(segmentGroup, 0, slicedCommands); } else { return createNewSegmentGroup(segmentGroup, startIndex, commands); } } function updateSegmentGroupChildren(segmentGroup, startIndex, commands) { if (commands.length === 0) { return new UrlSegmentGroup(segmentGroup.segments, {}); } else { const outlets = getOutlets(commands); const children = {}; forEach(outlets, (commands, outlet) => { if (typeof commands === 'string') { commands = [commands]; } if (commands !== null) { children[outlet] = updateSegmentGroup(segmentGroup.children[outlet], startIndex, commands); } }); forEach(segmentGroup.children, (child, childOutlet) => { if (outlets[childOutlet] === undefined) { children[childOutlet] = child; } }); return new UrlSegmentGroup(segmentGroup.segments, children); } } function prefixedWith(segmentGroup, startIndex, commands) { let currentCommandIndex = 0; let currentPathIndex = startIndex; const noMatch = { match: false, pathIndex: 0, commandIndex: 0 }; while (currentPathIndex < segmentGroup.segments.length) { if (currentCommandIndex >= commands.length) return noMatch; const path = segmentGroup.segments[currentPathIndex]; const command = commands[currentCommandIndex]; // Do not try to consume command as part of the prefixing if it has outlets because it can // contain outlets other than the one being processed. Consuming the outlets command would // result in other outlets being ignored. if (isCommandWithOutlets(command)) { break; } const curr = `${command}`; const next = currentCommandIndex < commands.length - 1 ? commands[currentCommandIndex + 1] : null; if (currentPathIndex > 0 && curr === undefined) break; if (curr && next && typeof next === 'object' && next.outlets === undefined) { if (!compare(curr, next, path)) return noMatch; currentCommandIndex += 2; } else { if (!compare(curr, {}, path)) return noMatch; currentCommandIndex++; } currentPathIndex++; } return { match: true, pathIndex: currentPathIndex, commandIndex: currentCommandIndex }; } function createNewSegmentGroup(segmentGroup, startIndex, commands) { const paths = segmentGroup.segments.slice(0, startIndex); let i = 0; while (i < commands.length) { const command = commands[i]; if (isCommandWithOutlets(command)) { const children = createNewSegmentChildren(command.outlets); return new UrlSegmentGroup(paths, children); } // if we start with an object literal, we need to reuse the path part from the segment if (i === 0 && isMatrixParams(commands[0])) { const p = segmentGroup.segments[startIndex]; paths.push(new UrlSegment(p.path, stringify(commands[0]))); i++; continue; } const curr = isCommandWithOutlets(command) ? command.outlets[PRIMARY_OUTLET] : `${command}`; const next = i < commands.length - 1 ? commands[i + 1] : null; if (curr && next && isMatrixParams(next)) { paths.push(new UrlSegment(curr, stringify(next))); i += 2; } else { paths.push(new UrlSegment(curr, {})); i++; } } return new UrlSegmentGroup(paths, {}); } function createNewSegmentChildren(outlets) { const children = {}; forEach(outlets, (commands, outlet) => { if (typeof commands === 'string') { commands = [commands]; } if (commands !== null) { children[outlet] = createNewSegmentGroup(new UrlSegmentGroup([], {}), 0, commands); } }); return children; } function stringify(params) { const res = {}; forEach(params, (v, k) => res[k] = `${v}`); return res; } function compare(path, params, segment) { return path == segment.path && shallowEqual(params, segment.parameters); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Base for events the router goes through, as opposed to events tied to a specific * route. Fired one time for any given navigation. * * The following code shows how a class subscribes to router events. * * ```ts * import {Event, RouterEvent, Router} from '@angular/router'; * * class MyService { * constructor(public router: Router) { * router.events.pipe( * filter((e: Event): e is RouterEvent => e instanceof RouterEvent) * ).subscribe((e: RouterEvent) => { * // Do something * }); * } * } * ``` * * @see `Event` * @see [Router events summary](guide/router-reference#router-events) * @publicApi */ class RouterEvent { constructor( /** A unique ID that the router assigns to every router navigation. */ id, /** The URL that is the destination for this navigation. */ url) { this.id = id; this.url = url; } } /** * An event triggered when a navigation starts. * * @publicApi */ class NavigationStart extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ navigationTrigger = 'imperative', /** @docsNotRequired */ restoredState = null) { super(id, url); this.type = 0 /* EventType.NavigationStart */ ; this.navigationTrigger = navigationTrigger; this.restoredState = restoredState; } /** @docsNotRequired */ toString() { return `NavigationStart(id: ${this.id}, url: '${this.url}')`; } } /** * An event triggered when a navigation ends successfully. * * @see `NavigationStart` * @see `NavigationCancel` * @see `NavigationError` * * @publicApi */ class NavigationEnd extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.type = 1 /* EventType.NavigationEnd */ ; } /** @docsNotRequired */ toString() { return `NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`; } } /** * An event triggered when a navigation is canceled, directly or indirectly. * This can happen for several reasons including when a route guard * returns `false` or initiates a redirect by returning a `UrlTree`. * * @see `NavigationStart` * @see `NavigationEnd` * @see `NavigationError` * * @publicApi */ class NavigationCancel extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** * A description of why the navigation was cancelled. For debug purposes only. Use `code` * instead for a stable cancellation reason that can be used in production. */ reason, /** * A code to indicate why the navigation was canceled. This cancellation code is stable for * the reason and can be relied on whereas the `reason` string could change and should not be * used in production. */ code) { super(id, url); this.reason = reason; this.code = code; this.type = 2 /* EventType.NavigationCancel */ ; } /** @docsNotRequired */ toString() { return `NavigationCancel(id: ${this.id}, url: '${this.url}')`; } } /** * An event triggered when a navigation fails due to an unexpected error. * * @see `NavigationStart` * @see `NavigationEnd` * @see `NavigationCancel` * * @publicApi */ class NavigationError extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ error, /** * The target of the navigation when the error occurred. * * Note that this can be `undefined` because an error could have occurred before the * `RouterStateSnapshot` was created for the navigation. */ target) { super(id, url); this.error = error; this.target = target; this.type = 3 /* EventType.NavigationError */ ; } /** @docsNotRequired */ toString() { return `NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`; } } /** * An event triggered when routes are recognized. * * @publicApi */ class RoutesRecognized extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.type = 4 /* EventType.RoutesRecognized */ ; } /** @docsNotRequired */ toString() { return `RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`; } } /** * An event triggered at the start of the Guard phase of routing. * * @see `GuardsCheckEnd` * * @publicApi */ class GuardsCheckStart extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.type = 7 /* EventType.GuardsCheckStart */ ; } toString() { return `GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`; } } /** * An event triggered at the end of the Guard phase of routing. * * @see `GuardsCheckStart` * * @publicApi */ class GuardsCheckEnd extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state, /** @docsNotRequired */ shouldActivate) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.shouldActivate = shouldActivate; this.type = 8 /* EventType.GuardsCheckEnd */ ; } toString() { return `GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`; } } /** * An event triggered at the start of the Resolve phase of routing. * * Runs in the "resolve" phase whether or not there is anything to resolve. * In future, may change to only run when there are things to be resolved. * * @see `ResolveEnd` * * @publicApi */ class ResolveStart extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.type = 5 /* EventType.ResolveStart */ ; } toString() { return `ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`; } } /** * An event triggered at the end of the Resolve phase of routing. * @see `ResolveStart`. * * @publicApi */ class ResolveEnd extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.type = 6 /* EventType.ResolveEnd */ ; } toString() { return `ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`; } } /** * An event triggered before lazy loading a route configuration. * * @see `RouteConfigLoadEnd` * * @publicApi */ class RouteConfigLoadStart { constructor( /** @docsNotRequired */ route) { this.route = route; this.type = 9 /* EventType.RouteConfigLoadStart */ ; } toString() { return `RouteConfigLoadStart(path: ${this.route.path})`; } } /** * An event triggered when a route has been lazy loaded. * * @see `RouteConfigLoadStart` * * @publicApi */ class RouteConfigLoadEnd { constructor( /** @docsNotRequired */ route) { this.route = route; this.type = 10 /* EventType.RouteConfigLoadEnd */ ; } toString() { return `RouteConfigLoadEnd(path: ${this.route.path})`; } } /** * An event triggered at the start of the child-activation * part of the Resolve phase of routing. * @see `ChildActivationEnd` * @see `ResolveStart` * * @publicApi */ class ChildActivationStart { constructor( /** @docsNotRequired */ snapshot) { this.snapshot = snapshot; this.type = 11 /* EventType.ChildActivationStart */ ; } toString() { const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || ''; return `ChildActivationStart(path: '${path}')`; } } /** * An event triggered at the end of the child-activation part * of the Resolve phase of routing. * @see `ChildActivationStart` * @see `ResolveStart` * @publicApi */ class ChildActivationEnd { constructor( /** @docsNotRequired */ snapshot) { this.snapshot = snapshot; this.type = 12 /* EventType.ChildActivationEnd */ ; } toString() { const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || ''; return `ChildActivationEnd(path: '${path}')`; } } /** * An event triggered at the start of the activation part * of the Resolve phase of routing. * @see `ActivationEnd` * @see `ResolveStart` * * @publicApi */ class ActivationStart { constructor( /** @docsNotRequired */ snapshot) { this.snapshot = snapshot; this.type = 13 /* EventType.ActivationStart */ ; } toString() { const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || ''; return `ActivationStart(path: '${path}')`; } } /** * An event triggered at the end of the activation part * of the Resolve phase of routing. * @see `ActivationStart` * @see `ResolveStart` * * @publicApi */ class ActivationEnd { constructor( /** @docsNotRequired */ snapshot) { this.snapshot = snapshot; this.type = 14 /* EventType.ActivationEnd */ ; } toString() { const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || ''; return `ActivationEnd(path: '${path}')`; } } /** * An event triggered by scrolling. * * @publicApi */ class Scroll { constructor( /** @docsNotRequired */ routerEvent, /** @docsNotRequired */ position, /** @docsNotRequired */ anchor) { this.routerEvent = routerEvent; this.position = position; this.anchor = anchor; this.type = 15 /* EventType.Scroll */ ; } toString() { const pos = this.position ? `${this.position[0]}, ${this.position[1]}` : null; return `Scroll(anchor: '${this.anchor}', position: '${pos}')`; } } function stringifyEvent(routerEvent) { var _routerEvent$snapshot, _routerEvent$snapshot2, _routerEvent$snapshot3, _routerEvent$snapshot4; if (!('type' in routerEvent)) { return `Unknown Router Event: ${routerEvent.constructor.name}`; } switch (routerEvent.type) { case 14 /* EventType.ActivationEnd */ : return `ActivationEnd(path: '${((_routerEvent$snapshot = routerEvent.snapshot.routeConfig) === null || _routerEvent$snapshot === void 0 ? void 0 : _routerEvent$snapshot.path) || ''}')`; case 13 /* EventType.ActivationStart */ : return `ActivationStart(path: '${((_routerEvent$snapshot2 = routerEvent.snapshot.routeConfig) === null || _routerEvent$snapshot2 === void 0 ? void 0 : _routerEvent$snapshot2.path) || ''}')`; case 12 /* EventType.ChildActivationEnd */ : return `ChildActivationEnd(path: '${((_routerEvent$snapshot3 = routerEvent.snapshot.routeConfig) === null || _routerEvent$snapshot3 === void 0 ? void 0 : _routerEvent$snapshot3.path) || ''}')`; case 11 /* EventType.ChildActivationStart */ : return `ChildActivationStart(path: '${((_routerEvent$snapshot4 = routerEvent.snapshot.routeConfig) === null || _routerEvent$snapshot4 === void 0 ? void 0 : _routerEvent$snapshot4.path) || ''}')`; case 8 /* EventType.GuardsCheckEnd */ : return `GuardsCheckEnd(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state}, shouldActivate: ${routerEvent.shouldActivate})`; case 7 /* EventType.GuardsCheckStart */ : return `GuardsCheckStart(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`; case 2 /* EventType.NavigationCancel */ : return `NavigationCancel(id: ${routerEvent.id}, url: '${routerEvent.url}')`; case 1 /* EventType.NavigationEnd */ : return `NavigationEnd(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}')`; case 3 /* EventType.NavigationError */ : return `NavigationError(id: ${routerEvent.id}, url: '${routerEvent.url}', error: ${routerEvent.error})`; case 0 /* EventType.NavigationStart */ : return `NavigationStart(id: ${routerEvent.id}, url: '${routerEvent.url}')`; case 6 /* EventType.ResolveEnd */ : return `ResolveEnd(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`; case 5 /* EventType.ResolveStart */ : return `ResolveStart(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`; case 10 /* EventType.RouteConfigLoadEnd */ : return `RouteConfigLoadEnd(path: ${routerEvent.route.path})`; case 9 /* EventType.RouteConfigLoadStart */ : return `RouteConfigLoadStart(path: ${routerEvent.route.path})`; case 4 /* EventType.RoutesRecognized */ : return `RoutesRecognized(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`; case 15 /* EventType.Scroll */ : const pos = routerEvent.position ? `${routerEvent.position[0]}, ${routerEvent.position[1]}` : null; return `Scroll(anchor: '${routerEvent.anchor}', position: '${pos}')`; } } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ class Tree { constructor(root) { this._root = root; } get root() { return this._root.value; } /** * @internal */ parent(t) { const p = this.pathFromRoot(t); return p.length > 1 ? p[p.length - 2] : null; } /** * @internal */ children(t) { const n = findNode(t, this._root); return n ? n.children.map(t => t.value) : []; } /** * @internal */ firstChild(t) { const n = findNode(t, this._root); return n && n.children.length > 0 ? n.children[0].value : null; } /** * @internal */ siblings(t) { const p = findPath(t, this._root); if (p.length < 2) return []; const c = p[p.length - 2].children.map(c => c.value); return c.filter(cc => cc !== t); } /** * @internal */ pathFromRoot(t) { return findPath(t, this._root).map(s => s.value); } } // DFS for the node matching the value function findNode(value, node) { if (value === node.value) return node; for (const child of node.children) { const node = findNode(value, child); if (node) return node; } return null; } // Return the path to the node with the given value using DFS function findPath(value, node) { if (value === node.value) return [node]; for (const child of node.children) { const path = findPath(value, child); if (path.length) { path.unshift(node); return path; } } return []; } class TreeNode { constructor(value, children) { this.value = value; this.children = children; } toString() { return `TreeNode(${this.value})`; } } // Return the list of T indexed by outlet name function nodeChildrenAsMap(node) { const map = {}; if (node) { node.children.forEach(child => map[child.value.outlet] = child); } return map; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Represents the state of the router as a tree of activated routes. * * @usageNotes * * Every node in the route tree is an `ActivatedRoute` instance * that knows about the "consumed" URL segments, the extracted parameters, * and the resolved data. * Use the `ActivatedRoute` properties to traverse the tree from any node. * * The following fragment shows how a component gets the root node * of the current state to establish its own route tree: * * ``` * @Component({templateUrl:'template.html'}) * class MyComponent { * constructor(router: Router) { * const state: RouterState = router.routerState; * const root: ActivatedRoute = state.root; * const child = root.firstChild; * const id: Observable<string> = child.params.map(p => p.id); * //... * } * } * ``` * * @see `ActivatedRoute` * @see [Getting route information](guide/router#getting-route-information) * * @publicApi */ class RouterState extends Tree { /** @internal */ constructor(root, /** The current snapshot of the router state */ snapshot) { super(root); this.snapshot = snapshot; setRouterState(this, root); } toString() { return this.snapshot.toString(); } } function createEmptyState(urlTree, rootComponent) { const snapshot = createEmptyStateSnapshot(urlTree, rootComponent); const emptyUrl = new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject([new UrlSegment('', {})]); const emptyParams = new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject({}); const emptyData = new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject({}); const emptyQueryParams = new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject({}); const fragment = new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject(''); const activated = new ActivatedRoute(emptyUrl, emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, snapshot.root); activated.snapshot = snapshot.root; return new RouterState(new TreeNode(activated, []), snapshot); } function createEmptyStateSnapshot(urlTree, rootComponent) { const emptyParams = {}; const emptyData = {}; const emptyQueryParams = {}; const fragment = ''; const activated = new ActivatedRouteSnapshot([], emptyParams, emptyQueryParams, fragment, emptyData, PRIMARY_OUTLET, rootComponent, null, urlTree.root, -1, {}); return new RouterStateSnapshot('', new TreeNode(activated, [])); } /** * Provides access to information about a route associated with a component * that is loaded in an outlet. * Use to traverse the `RouterState` tree and extract information from nodes. * * The following example shows how to construct a component using information from a * currently activated route. * * Note: the observables in this class only emit when the current and previous values differ based * on shallow equality. For example, changing deeply nested properties in resolved `data` will not * cause the `ActivatedRoute.data` `Observable` to emit a new value. * * {@example router/activated-route/module.ts region="activated-route" * header="activated-route.component.ts"} * * @see [Getting route information](guide/router#getting-route-information) * * @publicApi */ class ActivatedRoute { /** @internal */ constructor( /** An observable of the URL segments matched by this route. */ url, /** An observable of the matrix parameters scoped to this route. */ params, /** An observable of the query parameters shared by all the routes. */ queryParams, /** An observable of the URL fragment shared by all the routes. */ fragment, /** An observable of the static and resolved data of this route. */ data, /** The outlet name of the route, a constant. */ outlet, /** The component of the route, a constant. */ component, futureSnapshot) { var _this$data$pipe, _this$data; this.url = url; this.params = params; this.queryParams = queryParams; this.fragment = fragment; this.data = data; this.outlet = outlet; this.component = component; /** An Observable of the resolved route title */ this.title = (_this$data$pipe = (_this$data = this.data) === null || _this$data === void 0 ? void 0 : _this$data.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(d => d[RouteTitleKey]))) !== null && _this$data$pipe !== void 0 ? _this$data$pipe : (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(undefined); this._futureSnapshot = futureSnapshot; } /** The configuration used to match this route. */ get routeConfig() { return this._futureSnapshot.routeConfig; } /** The root of the router state. */ get root() { return this._routerState.root; } /** The parent of this route in the router state tree. */ get parent() { return this._routerState.parent(this); } /** The first child of this route in the router state tree. */ get firstChild() { return this._routerState.firstChild(this); } /** The children of this route in the router state tree. */ get children() { return this._routerState.children(this); } /** The path from the root of the router state tree to this route. */ get pathFromRoot() { return this._routerState.pathFromRoot(this); } /** * An Observable that contains a map of the required and optional parameters * specific to the route. * The map supports retrieving single and multiple values from the same parameter. */ get paramMap() { if (!this._paramMap) { this._paramMap = this.params.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(p => convertToParamMap(p))); } return this._paramMap; } /** * An Observable that contains a map of the query parameters available to all routes. * The map supports retrieving single and multiple values from the query parameter. */ get queryParamMap() { if (!this._queryParamMap) { this._queryParamMap = this.queryParams.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(p => convertToParamMap(p))); } return this._queryParamMap; } toString() { return this.snapshot ? this.snapshot.toString() : `Future(${this._futureSnapshot})`; } } /** * Returns the inherited params, data, and resolve for a given route. * By default, this only inherits values up to the nearest path-less or component-less route. * @internal */ function inheritedParamsDataResolve(route, paramsInheritanceStrategy = 'emptyOnly') { const pathFromRoot = route.pathFromRoot; let inheritingStartingFrom = 0; if (paramsInheritanceStrategy !== 'always') { inheritingStartingFrom = pathFromRoot.length - 1; while (inheritingStartingFrom >= 1) { const current = pathFromRoot[inheritingStartingFrom]; const parent = pathFromRoot[inheritingStartingFrom - 1]; // current route is an empty path => inherits its parent's params and data if (current.routeConfig && current.routeConfig.path === '') { inheritingStartingFrom--; // parent is componentless => current route should inherit its params and data } else if (!parent.component) { inheritingStartingFrom--; } else { break; } } } return flattenInherited(pathFromRoot.slice(inheritingStartingFrom)); } /** @internal */ function flattenInherited(pathFromRoot) { return pathFromRoot.reduce((res, curr) => { var _curr$routeConfig; const params = { ...res.params, ...curr.params }; const data = { ...res.data, ...curr.data }; const resolve = { ...curr.data, ...res.resolve, ...((_curr$routeConfig = curr.routeConfig) === null || _curr$routeConfig === void 0 ? void 0 : _curr$routeConfig.data), ...curr._resolvedData }; return { params, data, resolve }; }, { params: {}, data: {}, resolve: {} }); } /** * @description * * Contains the information about a route associated with a component loaded in an * outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to * traverse the router state tree. * * The following example initializes a component with route information extracted * from the snapshot of the root node at the time of creation. * * ``` * @Component({templateUrl:'./my-component.html'}) * class MyComponent { * constructor(route: ActivatedRoute) { * const id: string = route.snapshot.params.id; * const url: string = route.snapshot.url.join(''); * const user = route.snapshot.data.user; * } * } * ``` * * @publicApi */ class ActivatedRouteSnapshot { /** @internal */ constructor( /** The URL segments matched by this route */ url, /** * The matrix parameters scoped to this route. * * You can compute all params (or data) in the router state or to get params outside * of an activated component by traversing the `RouterState` tree as in the following * example: * ``` * collectRouteParams(router: Router) { * let params = {}; * let stack: ActivatedRouteSnapshot[] = [router.routerState.snapshot.root]; * while (stack.length > 0) { * const route = stack.pop()!; * params = {...params, ...route.params}; * stack.push(...route.children); * } * return params; * } * ``` */ params, /** The query parameters shared by all the routes */ queryParams, /** The URL fragment shared by all the routes */ fragment, /** The static and resolved data of this route */ data, /** The outlet name of the route */ outlet, /** The component of the route */ component, routeConfig, urlSegment, lastPathIndex, resolve, correctedLastPathIndex) { var _this$data2; this.url = url; this.params = params; this.queryParams = queryParams; this.fragment = fragment; this.data = data; this.outlet = outlet; this.component = component; /** The resolved route title */ this.title = (_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2[RouteTitleKey]; this.routeConfig = routeConfig; this._urlSegment = urlSegment; this._lastPathIndex = lastPathIndex; this._correctedLastPathIndex = correctedLastPathIndex !== null && correctedLastPathIndex !== void 0 ? correctedLastPathIndex : lastPathIndex; this._resolve = resolve; } /** The root of the router state */ get root() { return this._routerState.root; } /** The parent of this route in the router state tree */ get parent() { return this._routerState.parent(this); } /** The first child of this route in the router state tree */ get firstChild() { return this._routerState.firstChild(this); } /** The children of this route in the router state tree */ get children() { return this._routerState.children(this); } /** The path from the root of the router state tree to this route */ get pathFromRoot() { return this._routerState.pathFromRoot(this); } get paramMap() { if (!this._paramMap) { this._paramMap = convertToParamMap(this.params); } return this._paramMap; } get queryParamMap() { if (!this._queryParamMap) { this._queryParamMap = convertToParamMap(this.queryParams); } return this._queryParamMap; } toString() { const url = this.url.map(segment => segment.toString()).join('/'); const matched = this.routeConfig ? this.routeConfig.path : ''; return `Route(url:'${url}', path:'${matched}')`; } } /** * @description * * Represents the state of the router at a moment in time. * * This is a tree of activated route snapshots. Every node in this tree knows about * the "consumed" URL segments, the extracted parameters, and the resolved data. * * The following example shows how a component is initialized with information * from the snapshot of the root node's state at the time of creation. * * ``` * @Component({templateUrl:'template.html'}) * class MyComponent { * constructor(router: Router) { * const state: RouterState = router.routerState; * const snapshot: RouterStateSnapshot = state.snapshot; * const root: ActivatedRouteSnapshot = snapshot.root; * const child = root.firstChild; * const id: Observable<string> = child.params.map(p => p.id); * //... * } * } * ``` * * @publicApi */ class RouterStateSnapshot extends Tree { /** @internal */ constructor( /** The url from which this snapshot was created */ url, root) { super(root); this.url = url; setRouterState(this, root); } toString() { return serializeNode(this._root); } } function setRouterState(state, node) { node.value._routerState = state; node.children.forEach(c => setRouterState(state, c)); } function serializeNode(node) { const c = node.children.length > 0 ? ` { ${node.children.map(serializeNode).join(', ')} } ` : ''; return `${node.value}${c}`; } /** * The expectation is that the activate route is created with the right set of parameters. * So we push new values into the observables only when they are not the initial values. * And we detect that by checking if the snapshot field is set. */ function advanceActivatedRoute(route) { if (route.snapshot) { const currentSnapshot = route.snapshot; const nextSnapshot = route._futureSnapshot; route.snapshot = nextSnapshot; if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) { route.queryParams.next(nextSnapshot.queryParams); } if (currentSnapshot.fragment !== nextSnapshot.fragment) { route.fragment.next(nextSnapshot.fragment); } if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) { route.params.next(nextSnapshot.params); } if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) { route.url.next(nextSnapshot.url); } if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) { route.data.next(nextSnapshot.data); } } else { route.snapshot = route._futureSnapshot; // this is for resolved data route.data.next(route._futureSnapshot.data); } } function equalParamsAndUrlSegments(a, b) { const equalUrlParams = shallowEqual(a.params, b.params) && equalSegments(a.url, b.url); const parentsMismatch = !a.parent !== !b.parent; return equalUrlParams && !parentsMismatch && (!a.parent || equalParamsAndUrlSegments(a.parent, b.parent)); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function createRouterState(routeReuseStrategy, curr, prevState) { const root = createNode(routeReuseStrategy, curr._root, prevState ? prevState._root : undefined); return new RouterState(root, curr); } function createNode(routeReuseStrategy, curr, prevState) { // reuse an activated route that is currently displayed on the screen if (prevState && routeReuseStrategy.shouldReuseRoute(curr.value, prevState.value.snapshot)) { const value = prevState.value; value._futureSnapshot = curr.value; const children = createOrReuseChildren(routeReuseStrategy, curr, prevState); return new TreeNode(value, children); } else { if (routeReuseStrategy.shouldAttach(curr.value)) { // retrieve an activated route that is used to be displayed, but is not currently displayed const detachedRouteHandle = routeReuseStrategy.retrieve(curr.value); if (detachedRouteHandle !== null) { const tree = detachedRouteHandle.route; tree.value._futureSnapshot = curr.value; tree.children = curr.children.map(c => createNode(routeReuseStrategy, c)); return tree; } } const value = createActivatedRoute(curr.value); const children = curr.children.map(c => createNode(routeReuseStrategy, c)); return new TreeNode(value, children); } } function createOrReuseChildren(routeReuseStrategy, curr, prevState) { return curr.children.map(child => { for (const p of prevState.children) { if (routeReuseStrategy.shouldReuseRoute(child.value, p.value.snapshot)) { return createNode(routeReuseStrategy, child, p); } } return createNode(routeReuseStrategy, child); }); } function createActivatedRoute(c) { return new ActivatedRoute(new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject(c.url), new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject(c.params), new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject(c.queryParams), new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject(c.fragment), new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject(c.data), c.outlet, c.component, c); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError'; function redirectingNavigationError(urlSerializer, redirect) { const { redirectTo, navigationBehaviorOptions } = isUrlTree(redirect) ? { redirectTo: redirect, navigationBehaviorOptions: undefined } : redirect; const error = navigationCancelingError(ngDevMode && `Redirecting to "${urlSerializer.serialize(redirectTo)}"`, 0 /* NavigationCancellationCode.Redirect */ , redirect); error.url = redirectTo; error.navigationBehaviorOptions = navigationBehaviorOptions; return error; } function navigationCancelingError(message, code, redirectUrl) { const error = new Error('NavigationCancelingError: ' + (message || '')); error[NAVIGATION_CANCELING_ERROR] = true; error.cancellationCode = code; if (redirectUrl) { error.url = redirectUrl; } return error; } function isRedirectingNavigationCancelingError$1(error) { return isNavigationCancelingError$1(error) && isUrlTree(error.url); } function isNavigationCancelingError$1(error) { return error && error[NAVIGATION_CANCELING_ERROR]; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Store contextual information about a `RouterOutlet` * * @publicApi */ class OutletContext { constructor() { this.outlet = null; this.route = null; /** * @deprecated Passing a resolver to retrieve a component factory is not required and is * deprecated since v14. */ this.resolver = null; this.injector = null; this.children = new ChildrenOutletContexts(); this.attachRef = null; } } /** * Store contextual information about the children (= nested) `RouterOutlet` * * @publicApi */ class ChildrenOutletContexts { constructor() { // contexts for child outlets, by name. this.contexts = new Map(); } /** Called when a `RouterOutlet` directive is instantiated */ onChildOutletCreated(childName, outlet) { const context = this.getOrCreateContext(childName); context.outlet = outlet; this.contexts.set(childName, context); } /** * Called when a `RouterOutlet` directive is destroyed. * We need to keep the context as the outlet could be destroyed inside a NgIf and might be * re-created later. */ onChildOutletDestroyed(childName) { const context = this.getContext(childName); if (context) { context.outlet = null; context.attachRef = null; } } /** * Called when the corresponding route is deactivated during navigation. * Because the component get destroyed, all children outlet are destroyed. */ onOutletDeactivated() { const contexts = this.contexts; this.contexts = new Map(); return contexts; } onOutletReAttached(contexts) { this.contexts = contexts; } getOrCreateContext(childName) { let context = this.getContext(childName); if (!context) { context = new OutletContext(); this.contexts.set(childName, context); } return context; } getContext(childName) { return this.contexts.get(childName) || null; } } ChildrenOutletContexts.ɵfac = function ChildrenOutletContexts_Factory(t) { return new (t || ChildrenOutletContexts)(); }; ChildrenOutletContexts.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ChildrenOutletContexts, factory: ChildrenOutletContexts.ɵfac, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ChildrenOutletContexts, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root' }] }], null, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE$7 = typeof ngDevMode === 'undefined' || ngDevMode; /** * @description * * Acts as a placeholder that Angular dynamically fills based on the current router state. * * Each outlet can have a unique name, determined by the optional `name` attribute. * The name cannot be set or changed dynamically. If not set, default value is "primary". * * ``` * <router-outlet></router-outlet> * <router-outlet name='left'></router-outlet> * <router-outlet name='right'></router-outlet> * ``` * * Named outlets can be the targets of secondary routes. * The `Route` object for a secondary route has an `outlet` property to identify the target outlet: * * `{path: <base-path>, component: <component>, outlet: <target_outlet_name>}` * * Using named outlets and secondary routes, you can target multiple outlets in * the same `RouterLink` directive. * * The router keeps track of separate branches in a navigation tree for each named outlet and * generates a representation of that tree in the URL. * The URL for a secondary route uses the following syntax to specify both the primary and secondary * routes at the same time: * * `http://base-path/primary-route-path(outlet-name:route-path)` * * A router outlet emits an activate event when a new component is instantiated, * deactivate event when a component is destroyed. * An attached event emits when the `RouteReuseStrategy` instructs the outlet to reattach the * subtree, and the detached event emits when the `RouteReuseStrategy` instructs the outlet to * detach the subtree. * * ``` * <router-outlet * (activate)='onActivate($event)' * (deactivate)='onDeactivate($event)' * (attach)='onAttach($event)' * (detach)='onDetach($event)'></router-outlet> * ``` * * @see [Routing tutorial](guide/router-tutorial-toh#named-outlets "Example of a named * outlet and secondary route configuration"). * @see `RouterLink` * @see `Route` * @ngModule RouterModule * * @publicApi */ class RouterOutlet { constructor(parentContexts, location, name, changeDetector, environmentInjector) { this.parentContexts = parentContexts; this.location = location; this.changeDetector = changeDetector; this.environmentInjector = environmentInjector; this.activated = null; this._activatedRoute = null; this.activateEvents = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); this.deactivateEvents = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); /** * Emits an attached component instance when the `RouteReuseStrategy` instructs to re-attach a * previously detached subtree. **/ this.attachEvents = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); /** * Emits a detached component instance when the `RouteReuseStrategy` instructs to detach the * subtree. */ this.detachEvents = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); this.name = name || PRIMARY_OUTLET; parentContexts.onChildOutletCreated(this.name, this); } /** @nodoc */ ngOnDestroy() { var _this$parentContexts$; // Ensure that the registered outlet is this one before removing it on the context. if (((_this$parentContexts$ = this.parentContexts.getContext(this.name)) === null || _this$parentContexts$ === void 0 ? void 0 : _this$parentContexts$.outlet) === this) { this.parentContexts.onChildOutletDestroyed(this.name); } } /** @nodoc */ ngOnInit() { if (!this.activated) { // If the outlet was not instantiated at the time the route got activated we need to populate // the outlet when it is initialized (ie inside a NgIf) const context = this.parentContexts.getContext(this.name); if (context && context.route) { if (context.attachRef) { // `attachRef` is populated when there is an existing component to mount this.attach(context.attachRef, context.route); } else { // otherwise the component defined in the configuration is created this.activateWith(context.route, context.injector); } } } } get isActivated() { return !!this.activated; } /** * @returns The currently activated component instance. * @throws An error if the outlet is not activated. */ get component() { if (!this.activated) throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */ , NG_DEV_MODE$7 && 'Outlet is not activated'); return this.activated.instance; } get activatedRoute() { if (!this.activated) throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */ , NG_DEV_MODE$7 && 'Outlet is not activated'); return this._activatedRoute; } get activatedRouteData() { if (this._activatedRoute) { return this._activatedRoute.snapshot.data; } return {}; } /** * Called when the `RouteReuseStrategy` instructs to detach the subtree */ detach() { if (!this.activated) throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */ , NG_DEV_MODE$7 && 'Outlet is not activated'); this.location.detach(); const cmp = this.activated; this.activated = null; this._activatedRoute = null; this.detachEvents.emit(cmp.instance); return cmp; } /** * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree */ attach(ref, activatedRoute) { this.activated = ref; this._activatedRoute = activatedRoute; this.location.insert(ref.hostView); this.attachEvents.emit(ref.instance); } deactivate() { if (this.activated) { const c = this.component; this.activated.destroy(); this.activated = null; this._activatedRoute = null; this.deactivateEvents.emit(c); } } activateWith(activatedRoute, resolverOrInjector) { if (this.isActivated) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4013 /* RuntimeErrorCode.OUTLET_ALREADY_ACTIVATED */ , NG_DEV_MODE$7 && 'Cannot activate an already activated outlet'); } this._activatedRoute = activatedRoute; const location = this.location; const snapshot = activatedRoute._futureSnapshot; const component = snapshot.component; const childContexts = this.parentContexts.getOrCreateContext(this.name).children; const injector = new OutletInjector(activatedRoute, childContexts, location.injector); if (resolverOrInjector && isComponentFactoryResolver(resolverOrInjector)) { const factory = resolverOrInjector.resolveComponentFactory(component); this.activated = location.createComponent(factory, location.length, injector); } else { const environmentInjector = resolverOrInjector !== null && resolverOrInjector !== void 0 ? resolverOrInjector : this.environmentInjector; this.activated = location.createComponent(component, { index: location.length, injector, environmentInjector }); } // Calling `markForCheck` to make sure we will run the change detection when the // `RouterOutlet` is inside a `ChangeDetectionStrategy.OnPush` component. this.changeDetector.markForCheck(); this.activateEvents.emit(this.activated.instance); } } RouterOutlet.ɵfac = function RouterOutlet_Factory(t) { return new (t || RouterOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ChildrenOutletContexts), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinjectAttribute"]('name'), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.EnvironmentInjector)); }; RouterOutlet.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: RouterOutlet, selectors: [["router-outlet"]], outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], standalone: true }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RouterOutlet, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ selector: 'router-outlet', exportAs: 'outlet', standalone: true }] }], function () { return [{ type: ChildrenOutletContexts }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Attribute, args: ['name'] }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.EnvironmentInjector }]; }, { activateEvents: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output, args: ['activate'] }], deactivateEvents: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output, args: ['deactivate'] }], attachEvents: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output, args: ['attach'] }], detachEvents: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output, args: ['detach'] }] }); })(); class OutletInjector { constructor(route, childContexts, parent) { this.route = route; this.childContexts = childContexts; this.parent = parent; } get(token, notFoundValue) { if (token === ActivatedRoute) { return this.route; } if (token === ChildrenOutletContexts) { return this.childContexts; } return this.parent.get(token, notFoundValue); } } function isComponentFactoryResolver(item) { return !!item.resolveComponentFactory; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * This component is used internally within the router to be a placeholder when an empty * router-outlet is needed. For example, with a config such as: * * `{path: 'parent', outlet: 'nav', children: [...]}` * * In order to render, there needs to be a component on this config, which will default * to this `EmptyOutletComponent`. */ class ɵEmptyOutletComponent {} ɵEmptyOutletComponent.ɵfac = function ɵEmptyOutletComponent_Factory(t) { return new (t || ɵEmptyOutletComponent)(); }; ɵEmptyOutletComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: ɵEmptyOutletComponent, selectors: [["ng-component"]], standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵStandaloneFeature"]], decls: 1, vars: 0, template: function ɵEmptyOutletComponent_Template(rf, ctx) { if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "router-outlet"); } }, dependencies: [RouterOutlet], encapsulation: 2 }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ɵEmptyOutletComponent, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component, args: [{ template: `<router-outlet></router-outlet>`, imports: [RouterOutlet], standalone: true }] }], null, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Creates an `EnvironmentInjector` if the `Route` has providers and one does not already exist * and returns the injector. Otherwise, if the `Route` does not have `providers`, returns the * `currentInjector`. * * @param route The route that might have providers * @param currentInjector The parent injector of the `Route` */ function getOrCreateRouteInjectorIfNeeded(route, currentInjector) { var _route$_injector; if (route.providers && !route._injector) { route._injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.createEnvironmentInjector)(route.providers, currentInjector, `Route: ${route.path}`); } return (_route$_injector = route._injector) !== null && _route$_injector !== void 0 ? _route$_injector : currentInjector; } function getLoadedRoutes(route) { return route._loadedRoutes; } function getLoadedInjector(route) { return route._loadedInjector; } function getLoadedComponent(route) { return route._loadedComponent; } function getProvidersInjector(route) { return route._injector; } function validateConfig(config, parentPath = '', requireStandaloneComponents = false) { // forEach doesn't iterate undefined values for (let i = 0; i < config.length; i++) { const route = config[i]; const fullPath = getFullPath(parentPath, route); validateNode(route, fullPath, requireStandaloneComponents); } } function assertStandalone(fullPath, component) { if (component && !(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisStandalone"])(component)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}'. The component must be standalone.`); } } function validateNode(route, fullPath, requireStandaloneComponents) { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (!route) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , ` Invalid configuration of route '${fullPath}': Encountered undefined route. The reason might be an extra comma. Example: const routes: Routes = [ { path: '', redirectTo: '/dashboard', pathMatch: 'full' }, { path: 'dashboard', component: DashboardComponent },, << two commas { path: 'detail/:id', component: HeroDetailComponent } ]; `); } if (Array.isArray(route)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': Array cannot be specified`); } if (!route.redirectTo && !route.component && !route.loadComponent && !route.children && !route.loadChildren && route.outlet && route.outlet !== PRIMARY_OUTLET) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': a componentless route without children or loadChildren cannot have a named outlet set`); } if (route.redirectTo && route.children) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': redirectTo and children cannot be used together`); } if (route.redirectTo && route.loadChildren) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': redirectTo and loadChildren cannot be used together`); } if (route.children && route.loadChildren) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': children and loadChildren cannot be used together`); } if (route.redirectTo && (route.component || route.loadComponent)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': redirectTo and component/loadComponent cannot be used together`); } if (route.component && route.loadComponent) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': component and loadComponent cannot be used together`); } if (route.redirectTo && route.canActivate) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': redirectTo and canActivate cannot be used together. Redirects happen before activation ` + `so canActivate will never be executed.`); } if (route.path && route.matcher) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': path and matcher cannot be used together`); } if (route.redirectTo === void 0 && !route.component && !route.loadComponent && !route.children && !route.loadChildren) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren`); } if (route.path === void 0 && route.matcher === void 0) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': routes must have either a path or a matcher specified`); } if (typeof route.path === 'string' && route.path.charAt(0) === '/') { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '${fullPath}': path cannot start with a slash`); } if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) { const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`; throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */ , `Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`); } if (requireStandaloneComponents) { assertStandalone(fullPath, route.component); } } if (route.children) { validateConfig(route.children, fullPath, requireStandaloneComponents); } } function getFullPath(parentPath, currentRoute) { if (!currentRoute) { return parentPath; } if (!parentPath && !currentRoute.path) { return ''; } else if (parentPath && !currentRoute.path) { return `${parentPath}/`; } else if (!parentPath && currentRoute.path) { return currentRoute.path; } else { return `${parentPath}/${currentRoute.path}`; } } /** * Makes a copy of the config and adds any default required properties. */ function standardizeConfig(r) { const children = r.children && r.children.map(standardizeConfig); const c = children ? { ...r, children } : { ...r }; if (!c.component && !c.loadComponent && (children || c.loadChildren) && c.outlet && c.outlet !== PRIMARY_OUTLET) { c.component = ɵEmptyOutletComponent; } return c; } /** Returns the `route.outlet` or PRIMARY_OUTLET if none exists. */ function getOutlet(route) { return route.outlet || PRIMARY_OUTLET; } /** * Sorts the `routes` such that the ones with an outlet matching `outletName` come first. * The order of the configs is otherwise preserved. */ function sortByMatchingOutlets(routes, outletName) { const sortedConfig = routes.filter(r => getOutlet(r) === outletName); sortedConfig.push(...routes.filter(r => getOutlet(r) !== outletName)); return sortedConfig; } /** * Gets the first injector in the snapshot's parent tree. * * If the `Route` has a static list of providers, the returned injector will be the one created from * those. If it does not exist, the returned injector may come from the parents, which may be from a * loaded config or their static providers. * * Returns `null` if there is neither this nor any parents have a stored injector. * * Generally used for retrieving the injector to use for getting tokens for guards/resolvers and * also used for getting the correct injector to use for creating components. */ function getClosestRouteInjector(snapshot) { var _snapshot$routeConfig; if (!snapshot) return null; // If the current route has its own injector, which is created from the static providers on the // route itself, we should use that. Otherwise, we start at the parent since we do not want to // include the lazy loaded injector from this route. if ((_snapshot$routeConfig = snapshot.routeConfig) !== null && _snapshot$routeConfig !== void 0 && _snapshot$routeConfig._injector) { return snapshot.routeConfig._injector; } for (let s = snapshot.parent; s; s = s.parent) { const route = s.routeConfig; // Note that the order here is important. `_loadedInjector` stored on the route with // `loadChildren: () => NgModule` so it applies to child routes with priority. The `_injector` // is created from the static providers on that parent route, so it applies to the children as // well, but only if there is no lazy loaded NgModuleRef injector. if (route !== null && route !== void 0 && route._loadedInjector) return route._loadedInjector; if (route !== null && route !== void 0 && route._injector) return route._injector; } return null; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const activateRoutes = (rootContexts, routeReuseStrategy, forwardEvent) => (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(t => { new ActivateRoutes(routeReuseStrategy, t.targetRouterState, t.currentRouterState, forwardEvent).activate(rootContexts); return t; }); class ActivateRoutes { constructor(routeReuseStrategy, futureState, currState, forwardEvent) { this.routeReuseStrategy = routeReuseStrategy; this.futureState = futureState; this.currState = currState; this.forwardEvent = forwardEvent; } activate(parentContexts) { const futureRoot = this.futureState._root; const currRoot = this.currState ? this.currState._root : null; this.deactivateChildRoutes(futureRoot, currRoot, parentContexts); advanceActivatedRoute(this.futureState.root); this.activateChildRoutes(futureRoot, currRoot, parentContexts); } // De-activate the child route that are not re-used for the future state deactivateChildRoutes(futureNode, currNode, contexts) { const children = nodeChildrenAsMap(currNode); // Recurse on the routes active in the future state to de-activate deeper children futureNode.children.forEach(futureChild => { const childOutletName = futureChild.value.outlet; this.deactivateRoutes(futureChild, children[childOutletName], contexts); delete children[childOutletName]; }); // De-activate the routes that will not be re-used forEach(children, (v, childName) => { this.deactivateRouteAndItsChildren(v, contexts); }); } deactivateRoutes(futureNode, currNode, parentContext) { const future = futureNode.value; const curr = currNode ? currNode.value : null; if (future === curr) { // Reusing the node, check to see if the children need to be de-activated if (future.component) { // If we have a normal route, we need to go through an outlet. const context = parentContext.getContext(future.outlet); if (context) { this.deactivateChildRoutes(futureNode, currNode, context.children); } } else { // if we have a componentless route, we recurse but keep the same outlet map. this.deactivateChildRoutes(futureNode, currNode, parentContext); } } else { if (curr) { // Deactivate the current route which will not be re-used this.deactivateRouteAndItsChildren(currNode, parentContext); } } } deactivateRouteAndItsChildren(route, parentContexts) { // If there is no component, the Route is never attached to an outlet (because there is no // component to attach). if (route.value.component && this.routeReuseStrategy.shouldDetach(route.value.snapshot)) { this.detachAndStoreRouteSubtree(route, parentContexts); } else { this.deactivateRouteAndOutlet(route, parentContexts); } } detachAndStoreRouteSubtree(route, parentContexts) { const context = parentContexts.getContext(route.value.outlet); const contexts = context && route.value.component ? context.children : parentContexts; const children = nodeChildrenAsMap(route); for (const childOutlet of Object.keys(children)) { this.deactivateRouteAndItsChildren(children[childOutlet], contexts); } if (context && context.outlet) { const componentRef = context.outlet.detach(); const contexts = context.children.onOutletDeactivated(); this.routeReuseStrategy.store(route.value.snapshot, { componentRef, route, contexts }); } } deactivateRouteAndOutlet(route, parentContexts) { const context = parentContexts.getContext(route.value.outlet); // The context could be `null` if we are on a componentless route but there may still be // children that need deactivating. const contexts = context && route.value.component ? context.children : parentContexts; const children = nodeChildrenAsMap(route); for (const childOutlet of Object.keys(children)) { this.deactivateRouteAndItsChildren(children[childOutlet], contexts); } if (context && context.outlet) { // Destroy the component context.outlet.deactivate(); // Destroy the contexts for all the outlets that were in the component context.children.onOutletDeactivated(); // Clear the information about the attached component on the context but keep the reference to // the outlet. context.attachRef = null; context.resolver = null; context.route = null; } } activateChildRoutes(futureNode, currNode, contexts) { const children = nodeChildrenAsMap(currNode); futureNode.children.forEach(c => { this.activateRoutes(c, children[c.value.outlet], contexts); this.forwardEvent(new ActivationEnd(c.value.snapshot)); }); if (futureNode.children.length) { this.forwardEvent(new ChildActivationEnd(futureNode.value.snapshot)); } } activateRoutes(futureNode, currNode, parentContexts) { const future = futureNode.value; const curr = currNode ? currNode.value : null; advanceActivatedRoute(future); // reusing the node if (future === curr) { if (future.component) { // If we have a normal route, we need to go through an outlet. const context = parentContexts.getOrCreateContext(future.outlet); this.activateChildRoutes(futureNode, currNode, context.children); } else { // if we have a componentless route, we recurse but keep the same outlet map. this.activateChildRoutes(futureNode, currNode, parentContexts); } } else { if (future.component) { // if we have a normal route, we need to place the component into the outlet and recurse. const context = parentContexts.getOrCreateContext(future.outlet); if (this.routeReuseStrategy.shouldAttach(future.snapshot)) { const stored = this.routeReuseStrategy.retrieve(future.snapshot); this.routeReuseStrategy.store(future.snapshot, null); context.children.onOutletReAttached(stored.contexts); context.attachRef = stored.componentRef; context.route = stored.route.value; if (context.outlet) { // Attach right away when the outlet has already been instantiated // Otherwise attach from `RouterOutlet.ngOnInit` when it is instantiated context.outlet.attach(stored.componentRef, stored.route.value); } advanceActivatedRoute(stored.route.value); this.activateChildRoutes(futureNode, null, context.children); } else { var _injector$get; const injector = getClosestRouteInjector(future.snapshot); const cmpFactoryResolver = (_injector$get = injector === null || injector === void 0 ? void 0 : injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.ComponentFactoryResolver)) !== null && _injector$get !== void 0 ? _injector$get : null; context.attachRef = null; context.route = future; context.resolver = cmpFactoryResolver; context.injector = injector; if (context.outlet) { // Activate the outlet when it has already been instantiated // Otherwise it will get activated from its `ngOnInit` when instantiated context.outlet.activateWith(future, context.injector); } this.activateChildRoutes(futureNode, null, context.children); } } else { // if we have a componentless route, we recurse but keep the same outlet map. this.activateChildRoutes(futureNode, null, parentContexts); } } } } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ class CanActivate { constructor(path) { this.path = path; this.route = this.path[this.path.length - 1]; } } class CanDeactivate { constructor(component, route) { this.component = component; this.route = route; } } function getAllRouteGuards(future, curr, parentContexts) { const futureRoot = future._root; const currRoot = curr ? curr._root : null; return getChildRouteGuards(futureRoot, currRoot, parentContexts, [futureRoot.value]); } function getCanActivateChild(p) { const canActivateChild = p.routeConfig ? p.routeConfig.canActivateChild : null; if (!canActivateChild || canActivateChild.length === 0) return null; return { node: p, guards: canActivateChild }; } function getTokenOrFunctionIdentity(tokenOrFunction, injector) { const NOT_FOUND = Symbol(); const result = injector.get(tokenOrFunction, NOT_FOUND); if (result === NOT_FOUND) { if (typeof tokenOrFunction === 'function' && !(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisInjectable"])(tokenOrFunction)) { // We think the token is just a function so return it as-is return tokenOrFunction; } else { // This will throw the not found error return injector.get(tokenOrFunction); } } return result; } function getChildRouteGuards(futureNode, currNode, contexts, futurePath, checks = { canDeactivateChecks: [], canActivateChecks: [] }) { const prevChildren = nodeChildrenAsMap(currNode); // Process the children of the future route futureNode.children.forEach(c => { getRouteGuards(c, prevChildren[c.value.outlet], contexts, futurePath.concat([c.value]), checks); delete prevChildren[c.value.outlet]; }); // Process any children left from the current route (not active for the future route) forEach(prevChildren, (v, k) => deactivateRouteAndItsChildren(v, contexts.getContext(k), checks)); return checks; } function getRouteGuards(futureNode, currNode, parentContexts, futurePath, checks = { canDeactivateChecks: [], canActivateChecks: [] }) { const future = futureNode.value; const curr = currNode ? currNode.value : null; const context = parentContexts ? parentContexts.getContext(futureNode.value.outlet) : null; // reusing the node if (curr && future.routeConfig === curr.routeConfig) { const shouldRun = shouldRunGuardsAndResolvers(curr, future, future.routeConfig.runGuardsAndResolvers); if (shouldRun) { checks.canActivateChecks.push(new CanActivate(futurePath)); } else { // we need to set the data future.data = curr.data; future._resolvedData = curr._resolvedData; } // If we have a component, we need to go through an outlet. if (future.component) { getChildRouteGuards(futureNode, currNode, context ? context.children : null, futurePath, checks); // if we have a componentless route, we recurse but keep the same outlet map. } else { getChildRouteGuards(futureNode, currNode, parentContexts, futurePath, checks); } if (shouldRun && context && context.outlet && context.outlet.isActivated) { checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, curr)); } } else { if (curr) { deactivateRouteAndItsChildren(currNode, context, checks); } checks.canActivateChecks.push(new CanActivate(futurePath)); // If we have a component, we need to go through an outlet. if (future.component) { getChildRouteGuards(futureNode, null, context ? context.children : null, futurePath, checks); // if we have a componentless route, we recurse but keep the same outlet map. } else { getChildRouteGuards(futureNode, null, parentContexts, futurePath, checks); } } return checks; } function shouldRunGuardsAndResolvers(curr, future, mode) { if (typeof mode === 'function') { return mode(curr, future); } switch (mode) { case 'pathParamsChange': return !equalPath(curr.url, future.url); case 'pathParamsOrQueryParamsChange': return !equalPath(curr.url, future.url) || !shallowEqual(curr.queryParams, future.queryParams); case 'always': return true; case 'paramsOrQueryParamsChange': return !equalParamsAndUrlSegments(curr, future) || !shallowEqual(curr.queryParams, future.queryParams); case 'paramsChange': default: return !equalParamsAndUrlSegments(curr, future); } } function deactivateRouteAndItsChildren(route, context, checks) { const children = nodeChildrenAsMap(route); const r = route.value; forEach(children, (node, childName) => { if (!r.component) { deactivateRouteAndItsChildren(node, context, checks); } else if (context) { deactivateRouteAndItsChildren(node, context.children.getContext(childName), checks); } else { deactivateRouteAndItsChildren(node, null, checks); } }); if (!r.component) { checks.canDeactivateChecks.push(new CanDeactivate(null, r)); } else if (context && context.outlet && context.outlet.isActivated) { checks.canDeactivateChecks.push(new CanDeactivate(context.outlet.component, r)); } else { checks.canDeactivateChecks.push(new CanDeactivate(null, r)); } } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Simple function check, but generic so type inference will flow. Example: * * function product(a: number, b: number) { * return a * b; * } * * if (isFunction<product>(fn)) { * return fn(1, 2); * } else { * throw "Must provide the `product` function"; * } */ function isFunction(v) { return typeof v === 'function'; } function isBoolean(v) { return typeof v === 'boolean'; } function isCanLoad(guard) { return guard && isFunction(guard.canLoad); } function isCanActivate(guard) { return guard && isFunction(guard.canActivate); } function isCanActivateChild(guard) { return guard && isFunction(guard.canActivateChild); } function isCanDeactivate(guard) { return guard && isFunction(guard.canDeactivate); } function isCanMatch(guard) { return guard && isFunction(guard.canMatch); } function isRedirectingNavigationCancelingError(error) { return isNavigationCancelingError(error) && isUrlTree(error.url); } function isNavigationCancelingError(error) { return error && error[NAVIGATION_CANCELING_ERROR]; } function isEmptyError(e) { return e instanceof rxjs__WEBPACK_IMPORTED_MODULE_6__.EmptyError || (e === null || e === void 0 ? void 0 : e.name) === 'EmptyError'; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const INITIAL_VALUE = Symbol('INITIAL_VALUE'); function prioritizedGuardValue() { return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(obs => { return (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.combineLatest)(obs.map(o => o.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.take)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.startWith)(INITIAL_VALUE)))).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(results => { for (const result of results) { if (result === true) { // If result is true, check the next one continue; } else if (result === INITIAL_VALUE) { // If guard has not finished, we need to stop processing. return INITIAL_VALUE; } else if (result === false || result instanceof UrlTree) { // Result finished and was not true. Return the result. // Note that we only allow false/UrlTree. Other values are considered invalid and // ignored. return result; } } // Everything resolved to true. Return true. return true; }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.filter)(item => item !== INITIAL_VALUE), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.take)(1)); }); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function checkGuards(injector, forwardEvent) { return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(t => { const { targetSnapshot, currentSnapshot, guards: { canActivateChecks, canDeactivateChecks } } = t; if (canDeactivateChecks.length === 0 && canActivateChecks.length === 0) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)({ ...t, guardsResult: true }); } return runCanDeactivateChecks(canDeactivateChecks, targetSnapshot, currentSnapshot, injector).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(canDeactivate => { return canDeactivate && isBoolean(canDeactivate) ? runCanActivateChecks(targetSnapshot, canActivateChecks, injector, forwardEvent) : (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(canDeactivate); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(guardsResult => ({ ...t, guardsResult }))); }); } function runCanDeactivateChecks(checks, futureRSS, currRSS, injector) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(checks).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(check => runCanDeactivate(check.component, check.route, currRSS, futureRSS, injector)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.first)(result => { return result !== true; }, true)); } function runCanActivateChecks(futureSnapshot, checks, injector, forwardEvent) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(checks).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.concatMap)(check => { return (0,rxjs__WEBPACK_IMPORTED_MODULE_15__.concat)(fireChildActivationStart(check.route.parent, forwardEvent), fireActivationStart(check.route, forwardEvent), runCanActivateChild(futureSnapshot, check.path, injector), runCanActivate(futureSnapshot, check.route, injector)); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.first)(result => { return result !== true; }, true)); } /** * This should fire off `ActivationStart` events for each route being activated at this * level. * In other words, if you're activating `a` and `b` below, `path` will contain the * `ActivatedRouteSnapshot`s for both and we will fire `ActivationStart` for both. Always * return * `true` so checks continue to run. */ function fireActivationStart(snapshot, forwardEvent) { if (snapshot !== null && forwardEvent) { forwardEvent(new ActivationStart(snapshot)); } return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(true); } /** * This should fire off `ChildActivationStart` events for each route being activated at this * level. * In other words, if you're activating `a` and `b` below, `path` will contain the * `ActivatedRouteSnapshot`s for both and we will fire `ChildActivationStart` for both. Always * return * `true` so checks continue to run. */ function fireChildActivationStart(snapshot, forwardEvent) { if (snapshot !== null && forwardEvent) { forwardEvent(new ChildActivationStart(snapshot)); } return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(true); } function runCanActivate(futureRSS, futureARS, injector) { const canActivate = futureARS.routeConfig ? futureARS.routeConfig.canActivate : null; if (!canActivate || canActivate.length === 0) return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(true); const canActivateObservables = canActivate.map(canActivate => { return (0,rxjs__WEBPACK_IMPORTED_MODULE_16__.defer)(() => { var _getClosestRouteInjec; const closestInjector = (_getClosestRouteInjec = getClosestRouteInjector(futureARS)) !== null && _getClosestRouteInjec !== void 0 ? _getClosestRouteInjec : injector; const guard = getTokenOrFunctionIdentity(canActivate, closestInjector); const guardVal = isCanActivate(guard) ? guard.canActivate(futureARS, futureRSS) : closestInjector.runInContext(() => guard(futureARS, futureRSS)); return wrapIntoObservable(guardVal).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.first)()); }); }); return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(canActivateObservables).pipe(prioritizedGuardValue()); } function runCanActivateChild(futureRSS, path, injector) { const futureARS = path[path.length - 1]; const canActivateChildGuards = path.slice(0, path.length - 1).reverse().map(p => getCanActivateChild(p)).filter(_ => _ !== null); const canActivateChildGuardsMapped = canActivateChildGuards.map(d => { return (0,rxjs__WEBPACK_IMPORTED_MODULE_16__.defer)(() => { const guardsMapped = d.guards.map(canActivateChild => { var _getClosestRouteInjec2; const closestInjector = (_getClosestRouteInjec2 = getClosestRouteInjector(d.node)) !== null && _getClosestRouteInjec2 !== void 0 ? _getClosestRouteInjec2 : injector; const guard = getTokenOrFunctionIdentity(canActivateChild, closestInjector); const guardVal = isCanActivateChild(guard) ? guard.canActivateChild(futureARS, futureRSS) : closestInjector.runInContext(() => guard(futureARS, futureRSS)); return wrapIntoObservable(guardVal).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.first)()); }); return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(guardsMapped).pipe(prioritizedGuardValue()); }); }); return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(canActivateChildGuardsMapped).pipe(prioritizedGuardValue()); } function runCanDeactivate(component, currARS, currRSS, futureRSS, injector) { const canDeactivate = currARS && currARS.routeConfig ? currARS.routeConfig.canDeactivate : null; if (!canDeactivate || canDeactivate.length === 0) return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(true); const canDeactivateObservables = canDeactivate.map(c => { var _getClosestRouteInjec3; const closestInjector = (_getClosestRouteInjec3 = getClosestRouteInjector(currARS)) !== null && _getClosestRouteInjec3 !== void 0 ? _getClosestRouteInjec3 : injector; const guard = getTokenOrFunctionIdentity(c, closestInjector); const guardVal = isCanDeactivate(guard) ? guard.canDeactivate(component, currARS, currRSS, futureRSS) : closestInjector.runInContext(() => guard(component, currARS, currRSS, futureRSS)); return wrapIntoObservable(guardVal).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.first)()); }); return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(canDeactivateObservables).pipe(prioritizedGuardValue()); } function runCanLoadGuards(injector, route, segments, urlSerializer) { const canLoad = route.canLoad; if (canLoad === undefined || canLoad.length === 0) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(true); } const canLoadObservables = canLoad.map(injectionToken => { const guard = getTokenOrFunctionIdentity(injectionToken, injector); const guardVal = isCanLoad(guard) ? guard.canLoad(route, segments) : injector.runInContext(() => guard(route, segments)); return wrapIntoObservable(guardVal); }); return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(canLoadObservables).pipe(prioritizedGuardValue(), redirectIfUrlTree(urlSerializer)); } function redirectIfUrlTree(urlSerializer) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_17__.pipe)((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(result => { if (!isUrlTree(result)) return; throw redirectingNavigationError(urlSerializer, result); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(result => result === true)); } function runCanMatchGuards(injector, route, segments, urlSerializer) { const canMatch = route.canMatch; if (!canMatch || canMatch.length === 0) return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(true); const canMatchObservables = canMatch.map(injectionToken => { const guard = getTokenOrFunctionIdentity(injectionToken, injector); const guardVal = isCanMatch(guard) ? guard.canMatch(route, segments) : injector.runInContext(() => guard(route, segments)); return wrapIntoObservable(guardVal); }); return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(canMatchObservables).pipe(prioritizedGuardValue(), redirectIfUrlTree(urlSerializer)); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const noMatch$1 = { matched: false, consumedSegments: [], remainingSegments: [], parameters: {}, positionalParamSegments: {} }; function matchWithChecks(segmentGroup, route, segments, injector, urlSerializer) { const result = match(segmentGroup, route, segments); if (!result.matched) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(result); } // Only create the Route's `EnvironmentInjector` if it matches the attempted // navigation injector = getOrCreateRouteInjectorIfNeeded(route, injector); return runCanMatchGuards(injector, route, segments, urlSerializer).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(v => v === true ? result : { ...noMatch$1 })); } function match(segmentGroup, route, segments) { var _res$posParams; if (route.path === '') { if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) { return { ...noMatch$1 }; } return { matched: true, consumedSegments: [], remainingSegments: segments, parameters: {}, positionalParamSegments: {} }; } const matcher = route.matcher || defaultUrlMatcher; const res = matcher(segments, segmentGroup, route); if (!res) return { ...noMatch$1 }; const posParams = {}; forEach(res.posParams, (v, k) => { posParams[k] = v.path; }); const parameters = res.consumed.length > 0 ? { ...posParams, ...res.consumed[res.consumed.length - 1].parameters } : posParams; return { matched: true, consumedSegments: res.consumed, remainingSegments: segments.slice(res.consumed.length), // TODO(atscott): investigate combining parameters and positionalParamSegments parameters, positionalParamSegments: (_res$posParams = res.posParams) !== null && _res$posParams !== void 0 ? _res$posParams : {} }; } function split(segmentGroup, consumedSegments, slicedSegments, config, relativeLinkResolution = 'corrected') { if (slicedSegments.length > 0 && containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) { const s = new UrlSegmentGroup(consumedSegments, createChildrenForEmptyPaths(segmentGroup, consumedSegments, config, new UrlSegmentGroup(slicedSegments, segmentGroup.children))); s._sourceSegment = segmentGroup; s._segmentIndexShift = consumedSegments.length; return { segmentGroup: s, slicedSegments: [] }; } if (slicedSegments.length === 0 && containsEmptyPathMatches(segmentGroup, slicedSegments, config)) { const s = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, config, segmentGroup.children, relativeLinkResolution)); s._sourceSegment = segmentGroup; s._segmentIndexShift = consumedSegments.length; return { segmentGroup: s, slicedSegments }; } const s = new UrlSegmentGroup(segmentGroup.segments, segmentGroup.children); s._sourceSegment = segmentGroup; s._segmentIndexShift = consumedSegments.length; return { segmentGroup: s, slicedSegments }; } function addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, routes, children, relativeLinkResolution) { const res = {}; for (const r of routes) { if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) { const s = new UrlSegmentGroup([], {}); s._sourceSegment = segmentGroup; if (relativeLinkResolution === 'legacy') { s._segmentIndexShift = segmentGroup.segments.length; if (typeof ngDevMode === 'undefined' || !!ngDevMode) { s._segmentIndexShiftCorrected = consumedSegments.length; } } else { s._segmentIndexShift = consumedSegments.length; } res[getOutlet(r)] = s; } } return { ...children, ...res }; } function createChildrenForEmptyPaths(segmentGroup, consumedSegments, routes, primarySegment) { const res = {}; res[PRIMARY_OUTLET] = primarySegment; primarySegment._sourceSegment = segmentGroup; primarySegment._segmentIndexShift = consumedSegments.length; for (const r of routes) { if (r.path === '' && getOutlet(r) !== PRIMARY_OUTLET) { const s = new UrlSegmentGroup([], {}); s._sourceSegment = segmentGroup; s._segmentIndexShift = consumedSegments.length; res[getOutlet(r)] = s; } } return res; } function containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, routes) { return routes.some(r => emptyPathMatch(segmentGroup, slicedSegments, r) && getOutlet(r) !== PRIMARY_OUTLET); } function containsEmptyPathMatches(segmentGroup, slicedSegments, routes) { return routes.some(r => emptyPathMatch(segmentGroup, slicedSegments, r)); } function emptyPathMatch(segmentGroup, slicedSegments, r) { if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full') { return false; } return r.path === ''; } /** * Determines if `route` is a path match for the `rawSegment`, `segments`, and `outlet` without * verifying that its children are a full match for the remainder of the `rawSegment` children as * well. */ function isImmediateMatch(route, rawSegment, segments, outlet) { // We allow matches to empty paths when the outlets differ so we can match a url like `/(b:b)` to // a config like // * `{path: '', children: [{path: 'b', outlet: 'b'}]}` // or even // * `{path: '', outlet: 'a', children: [{path: 'b', outlet: 'b'}]` // // The exception here is when the segment outlet is for the primary outlet. This would // result in a match inside the named outlet because all children there are written as primary // outlets. So we need to prevent child named outlet matches in a url like `/b` in a config like // * `{path: '', outlet: 'x' children: [{path: 'b'}]}` // This should only match if the url is `/(x:b)`. if (getOutlet(route) !== outlet && (outlet === PRIMARY_OUTLET || !emptyPathMatch(rawSegment, segments, route))) { return false; } if (route.path === '**') { return true; } return match(rawSegment, route, segments).matched; } function noLeftoversInUrl(segmentGroup, segments, outlet) { return segments.length === 0 && !segmentGroup.children[outlet]; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE$6 = typeof ngDevMode === 'undefined' || ngDevMode; class NoMatch$1 { constructor(segmentGroup) { this.segmentGroup = segmentGroup || null; } } class AbsoluteRedirect { constructor(urlTree) { this.urlTree = urlTree; } } function noMatch(segmentGroup) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_19__.throwError)(new NoMatch$1(segmentGroup)); } function absoluteRedirect(newTree) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_19__.throwError)(new AbsoluteRedirect(newTree)); } function namedOutletsRedirect(redirectTo) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_19__.throwError)(new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4000 /* RuntimeErrorCode.NAMED_OUTLET_REDIRECT */ , NG_DEV_MODE$6 && `Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`)); } function canLoadFails(route) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_19__.throwError)(navigationCancelingError(NG_DEV_MODE$6 && `Cannot load children because the guard of the route "path: '${route.path}'" returned false`, 3 /* NavigationCancellationCode.GuardRejected */ )); } /** * Returns the `UrlTree` with the redirection applied. * * Lazy modules are loaded along the way. */ function applyRedirects$1(injector, configLoader, urlSerializer, urlTree, config) { return new ApplyRedirects(injector, configLoader, urlSerializer, urlTree, config).apply(); } class ApplyRedirects { constructor(injector, configLoader, urlSerializer, urlTree, config) { this.injector = injector; this.configLoader = configLoader; this.urlSerializer = urlSerializer; this.urlTree = urlTree; this.config = config; this.allowRedirects = true; } apply() { const splitGroup = split(this.urlTree.root, [], [], this.config).segmentGroup; // TODO(atscott): creating a new segment removes the _sourceSegment _segmentIndexShift, which is // only necessary to prevent failures in tests which assert exact object matches. The `split` is // now shared between `applyRedirects` and `recognize` but only the `recognize` step needs these // properties. Before the implementations were merged, the `applyRedirects` would not assign // them. We should be able to remove this logic as a "breaking change" but should do some more // investigation into the failures first. const rootSegmentGroup = new UrlSegmentGroup(splitGroup.segments, splitGroup.children); const expanded$ = this.expandSegmentGroup(this.injector, this.config, rootSegmentGroup, PRIMARY_OUTLET); const urlTrees$ = expanded$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(rootSegmentGroup => { return this.createUrlTree(squashSegmentGroup(rootSegmentGroup), this.urlTree.queryParams, this.urlTree.fragment); })); return urlTrees$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.catchError)(e => { if (e instanceof AbsoluteRedirect) { // After an absolute redirect we do not apply any more redirects! // If this implementation changes, update the documentation note in `redirectTo`. this.allowRedirects = false; // we need to run matching, so we can fetch all lazy-loaded modules return this.match(e.urlTree); } if (e instanceof NoMatch$1) { throw this.noMatchError(e); } throw e; })); } match(tree) { const expanded$ = this.expandSegmentGroup(this.injector, this.config, tree.root, PRIMARY_OUTLET); const mapped$ = expanded$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(rootSegmentGroup => { return this.createUrlTree(squashSegmentGroup(rootSegmentGroup), tree.queryParams, tree.fragment); })); return mapped$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.catchError)(e => { if (e instanceof NoMatch$1) { throw this.noMatchError(e); } throw e; })); } noMatchError(e) { return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4002 /* RuntimeErrorCode.NO_MATCH */ , NG_DEV_MODE$6 && `Cannot match any routes. URL Segment: '${e.segmentGroup}'`); } createUrlTree(rootCandidate, queryParams, fragment) { const root = createRoot(rootCandidate); return new UrlTree(root, queryParams, fragment); } expandSegmentGroup(injector, routes, segmentGroup, outlet) { if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) { return this.expandChildren(injector, routes, segmentGroup).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(children => new UrlSegmentGroup([], children))); } return this.expandSegment(injector, segmentGroup, routes, segmentGroup.segments, outlet, true); } // Recursively expand segment groups for all the child outlets expandChildren(injector, routes, segmentGroup) { // Expand outlets one at a time, starting with the primary outlet. We need to do it this way // because an absolute redirect from the primary outlet takes precedence. const childOutlets = []; for (const child of Object.keys(segmentGroup.children)) { if (child === 'primary') { childOutlets.unshift(child); } else { childOutlets.push(child); } } return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(childOutlets).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.concatMap)(childOutlet => { const child = segmentGroup.children[childOutlet]; // Sort the routes so routes with outlets that match the segment appear // first, followed by routes for other outlets, which might match if they have an // empty path. const sortedRoutes = sortByMatchingOutlets(routes, childOutlet); return this.expandSegmentGroup(injector, sortedRoutes, child, childOutlet).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(s => ({ segment: s, outlet: childOutlet }))); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_21__.scan)((children, expandedChild) => { children[expandedChild.outlet] = expandedChild.segment; return children; }, {}), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_22__.last)()); } expandSegment(injector, segmentGroup, routes, segments, outlet, allowRedirects) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(routes).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.concatMap)(r => { const expanded$ = this.expandSegmentAgainstRoute(injector, segmentGroup, routes, r, segments, outlet, allowRedirects); return expanded$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.catchError)(e => { if (e instanceof NoMatch$1) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(null); } throw e; })); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.first)(s => !!s), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.catchError)((e, _) => { if (isEmptyError(e)) { if (noLeftoversInUrl(segmentGroup, segments, outlet)) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(new UrlSegmentGroup([], {})); } return noMatch(segmentGroup); } throw e; })); } expandSegmentAgainstRoute(injector, segmentGroup, routes, route, paths, outlet, allowRedirects) { if (!isImmediateMatch(route, segmentGroup, paths, outlet)) { return noMatch(segmentGroup); } if (route.redirectTo === undefined) { return this.matchSegmentAgainstRoute(injector, segmentGroup, route, paths, outlet); } if (allowRedirects && this.allowRedirects) { return this.expandSegmentAgainstRouteUsingRedirect(injector, segmentGroup, routes, route, paths, outlet); } return noMatch(segmentGroup); } expandSegmentAgainstRouteUsingRedirect(injector, segmentGroup, routes, route, segments, outlet) { if (route.path === '**') { return this.expandWildCardWithParamsAgainstRouteUsingRedirect(injector, routes, route, outlet); } return this.expandRegularSegmentAgainstRouteUsingRedirect(injector, segmentGroup, routes, route, segments, outlet); } expandWildCardWithParamsAgainstRouteUsingRedirect(injector, routes, route, outlet) { const newTree = this.applyRedirectCommands([], route.redirectTo, {}); if (route.redirectTo.startsWith('/')) { return absoluteRedirect(newTree); } return this.lineralizeSegments(route, newTree).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(newSegments => { const group = new UrlSegmentGroup(newSegments, {}); return this.expandSegment(injector, group, routes, newSegments, outlet, false); })); } expandRegularSegmentAgainstRouteUsingRedirect(injector, segmentGroup, routes, route, segments, outlet) { const { matched, consumedSegments, remainingSegments, positionalParamSegments } = match(segmentGroup, route, segments); if (!matched) return noMatch(segmentGroup); const newTree = this.applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments); if (route.redirectTo.startsWith('/')) { return absoluteRedirect(newTree); } return this.lineralizeSegments(route, newTree).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(newSegments => { return this.expandSegment(injector, segmentGroup, routes, newSegments.concat(remainingSegments), outlet, false); })); } matchSegmentAgainstRoute(injector, rawSegmentGroup, route, segments, outlet) { if (route.path === '**') { // Only create the Route's `EnvironmentInjector` if it matches the attempted navigation injector = getOrCreateRouteInjectorIfNeeded(route, injector); if (route.loadChildren) { const loaded$ = route._loadedRoutes ? (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)({ routes: route._loadedRoutes, injector: route._loadedInjector }) : this.configLoader.loadChildren(injector, route); return loaded$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(cfg => { route._loadedRoutes = cfg.routes; route._loadedInjector = cfg.injector; return new UrlSegmentGroup(segments, {}); })); } return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(new UrlSegmentGroup(segments, {})); } return matchWithChecks(rawSegmentGroup, route, segments, injector, this.urlSerializer).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(({ matched, consumedSegments, remainingSegments }) => { var _route$_injector2; if (!matched) return noMatch(rawSegmentGroup); // If the route has an injector created from providers, we should start using that. injector = (_route$_injector2 = route._injector) !== null && _route$_injector2 !== void 0 ? _route$_injector2 : injector; const childConfig$ = this.getChildConfig(injector, route, segments); return childConfig$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(routerConfig => { var _routerConfig$injecto; const childInjector = (_routerConfig$injecto = routerConfig.injector) !== null && _routerConfig$injecto !== void 0 ? _routerConfig$injecto : injector; const childConfig = routerConfig.routes; const { segmentGroup: splitSegmentGroup, slicedSegments } = split(rawSegmentGroup, consumedSegments, remainingSegments, childConfig); // See comment on the other call to `split` about why this is necessary. const segmentGroup = new UrlSegmentGroup(splitSegmentGroup.segments, splitSegmentGroup.children); if (slicedSegments.length === 0 && segmentGroup.hasChildren()) { const expanded$ = this.expandChildren(childInjector, childConfig, segmentGroup); return expanded$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(children => new UrlSegmentGroup(consumedSegments, children))); } if (childConfig.length === 0 && slicedSegments.length === 0) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(new UrlSegmentGroup(consumedSegments, {})); } const matchedOnOutlet = getOutlet(route) === outlet; const expanded$ = this.expandSegment(childInjector, segmentGroup, childConfig, slicedSegments, matchedOnOutlet ? PRIMARY_OUTLET : outlet, true); return expanded$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(cs => new UrlSegmentGroup(consumedSegments.concat(cs.segments), cs.children))); })); })); } getChildConfig(injector, route, segments) { if (route.children) { // The children belong to the same module return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)({ routes: route.children, injector }); } if (route.loadChildren) { // lazy children belong to the loaded module if (route._loadedRoutes !== undefined) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)({ routes: route._loadedRoutes, injector: route._loadedInjector }); } return runCanLoadGuards(injector, route, segments, this.urlSerializer).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(shouldLoadResult => { if (shouldLoadResult) { return this.configLoader.loadChildren(injector, route).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(cfg => { route._loadedRoutes = cfg.routes; route._loadedInjector = cfg.injector; })); } return canLoadFails(route); })); } return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)({ routes: [], injector }); } lineralizeSegments(route, urlTree) { let res = []; let c = urlTree.root; while (true) { res = res.concat(c.segments); if (c.numberOfChildren === 0) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(res); } if (c.numberOfChildren > 1 || !c.children[PRIMARY_OUTLET]) { return namedOutletsRedirect(route.redirectTo); } c = c.children[PRIMARY_OUTLET]; } } applyRedirectCommands(segments, redirectTo, posParams) { return this.applyRedirectCreateUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams); } applyRedirectCreateUrlTree(redirectTo, urlTree, segments, posParams) { const newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams); return new UrlTree(newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams), urlTree.fragment); } createQueryParams(redirectToParams, actualParams) { const res = {}; forEach(redirectToParams, (v, k) => { const copySourceValue = typeof v === 'string' && v.startsWith(':'); if (copySourceValue) { const sourceName = v.substring(1); res[k] = actualParams[sourceName]; } else { res[k] = v; } }); return res; } createSegmentGroup(redirectTo, group, segments, posParams) { const updatedSegments = this.createSegments(redirectTo, group.segments, segments, posParams); let children = {}; forEach(group.children, (child, name) => { children[name] = this.createSegmentGroup(redirectTo, child, segments, posParams); }); return new UrlSegmentGroup(updatedSegments, children); } createSegments(redirectTo, redirectToSegments, actualSegments, posParams) { return redirectToSegments.map(s => s.path.startsWith(':') ? this.findPosParam(redirectTo, s, posParams) : this.findOrReturn(s, actualSegments)); } findPosParam(redirectTo, redirectToUrlSegment, posParams) { const pos = posParams[redirectToUrlSegment.path.substring(1)]; if (!pos) throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4001 /* RuntimeErrorCode.MISSING_REDIRECT */ , NG_DEV_MODE$6 && `Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`); return pos; } findOrReturn(redirectToUrlSegment, actualSegments) { let idx = 0; for (const s of actualSegments) { if (s.path === redirectToUrlSegment.path) { actualSegments.splice(idx); return s; } idx++; } return redirectToUrlSegment; } } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function applyRedirects(environmentInjector, configLoader, urlSerializer, config) { return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(t => applyRedirects$1(environmentInjector, configLoader, urlSerializer, t.extractedUrl, config).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(urlAfterRedirects => ({ ...t, urlAfterRedirects })))); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE$5 = typeof ngDevMode === 'undefined' || !!ngDevMode; class NoMatch {} function newObservableError(e) { // TODO(atscott): This pattern is used throughout the router code and can be `throwError` instead. return new rxjs__WEBPACK_IMPORTED_MODULE_23__.Observable(obs => obs.error(e)); } function recognize$1(injector, rootComponentType, config, urlTree, url, urlSerializer, paramsInheritanceStrategy = 'emptyOnly', relativeLinkResolution = 'legacy') { return new Recognizer(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy, relativeLinkResolution, urlSerializer).recognize().pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(result => { if (result === null) { return newObservableError(new NoMatch()); } else { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(result); } })); } class Recognizer { constructor(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy, relativeLinkResolution, urlSerializer) { this.injector = injector; this.rootComponentType = rootComponentType; this.config = config; this.urlTree = urlTree; this.url = url; this.paramsInheritanceStrategy = paramsInheritanceStrategy; this.relativeLinkResolution = relativeLinkResolution; this.urlSerializer = urlSerializer; } recognize() { const rootSegmentGroup = split(this.urlTree.root, [], [], this.config.filter(c => c.redirectTo === undefined), this.relativeLinkResolution).segmentGroup; return this.processSegmentGroup(this.injector, this.config, rootSegmentGroup, PRIMARY_OUTLET).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(children => { if (children === null) { return null; } // Use Object.freeze to prevent readers of the Router state from modifying it outside of a // navigation, resulting in the router being out of sync with the browser. const root = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, {}, PRIMARY_OUTLET, this.rootComponentType, null, this.urlTree.root, -1, {}); const rootNode = new TreeNode(root, children); const routeState = new RouterStateSnapshot(this.url, rootNode); this.inheritParamsAndData(routeState._root); return routeState; })); } inheritParamsAndData(routeNode) { const route = routeNode.value; const i = inheritedParamsDataResolve(route, this.paramsInheritanceStrategy); route.params = Object.freeze(i.params); route.data = Object.freeze(i.data); routeNode.children.forEach(n => this.inheritParamsAndData(n)); } processSegmentGroup(injector, config, segmentGroup, outlet) { if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) { return this.processChildren(injector, config, segmentGroup); } return this.processSegment(injector, config, segmentGroup, segmentGroup.segments, outlet); } /** * Matches every child outlet in the `segmentGroup` to a `Route` in the config. Returns `null` if * we cannot find a match for _any_ of the children. * * @param config - The `Routes` to match against * @param segmentGroup - The `UrlSegmentGroup` whose children need to be matched against the * config. */ processChildren(injector, config, segmentGroup) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(Object.keys(segmentGroup.children)).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.concatMap)(childOutlet => { const child = segmentGroup.children[childOutlet]; // Sort the config so that routes with outlets that match the one being activated // appear first, followed by routes for other outlets, which might match if they have // an empty path. const sortedConfig = sortByMatchingOutlets(config, childOutlet); return this.processSegmentGroup(injector, sortedConfig, child, childOutlet); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_21__.scan)((children, outletChildren) => { if (!children || !outletChildren) return null; children.push(...outletChildren); return children; }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_24__.takeWhile)(children => children !== null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_25__.defaultIfEmpty)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_22__.last)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(children => { if (children === null) return null; // Because we may have matched two outlets to the same empty path segment, we can have // multiple activated results for the same outlet. We should merge the children of // these results so the final return value is only one `TreeNode` per outlet. const mergedChildren = mergeEmptyPathMatches(children); if (NG_DEV_MODE$5) { // This should really never happen - we are only taking the first match for each // outlet and merge the empty path matches. checkOutletNameUniqueness(mergedChildren); } sortActivatedRouteSnapshots(mergedChildren); return mergedChildren; })); } processSegment(injector, routes, segmentGroup, segments, outlet) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(routes).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.concatMap)(r => { var _r$_injector; return this.processSegmentAgainstRoute((_r$_injector = r._injector) !== null && _r$_injector !== void 0 ? _r$_injector : injector, r, segmentGroup, segments, outlet); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.first)(x => !!x), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.catchError)(e => { if (isEmptyError(e)) { if (noLeftoversInUrl(segmentGroup, segments, outlet)) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)([]); } return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(null); } throw e; })); } processSegmentAgainstRoute(injector, route, rawSegment, segments, outlet) { if (route.redirectTo || !isImmediateMatch(route, rawSegment, segments, outlet)) return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(null); let matchResult; if (route.path === '**') { var _ref, _route$component; const params = segments.length > 0 ? last(segments).parameters : {}; const pathIndexShift = getPathIndexShift(rawSegment) + segments.length; const snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), (_ref = (_route$component = route.component) !== null && _route$component !== void 0 ? _route$component : route._loadedComponent) !== null && _ref !== void 0 ? _ref : null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route), // NG_DEV_MODE is used to prevent the getCorrectedPathIndexShift function from affecting // production bundle size. This value is intended only to surface a warning to users // depending on `relativeLinkResolution: 'legacy'` in dev mode. NG_DEV_MODE$5 ? getCorrectedPathIndexShift(rawSegment) + segments.length : pathIndexShift); matchResult = (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)({ snapshot, consumedSegments: [], remainingSegments: [] }); } else { matchResult = matchWithChecks(rawSegment, route, segments, injector, this.urlSerializer).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(({ matched, consumedSegments, remainingSegments, parameters }) => { var _ref2, _route$component2; if (!matched) { return null; } const pathIndexShift = getPathIndexShift(rawSegment) + consumedSegments.length; const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), (_ref2 = (_route$component2 = route.component) !== null && _route$component2 !== void 0 ? _route$component2 : route._loadedComponent) !== null && _ref2 !== void 0 ? _ref2 : null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route), NG_DEV_MODE$5 ? getCorrectedPathIndexShift(rawSegment) + consumedSegments.length : pathIndexShift); return { snapshot, consumedSegments, remainingSegments }; })); } return matchResult.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(result => { var _route$_injector3, _route$_loadedInjecto; if (result === null) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(null); } const { snapshot, consumedSegments, remainingSegments } = result; // If the route has an injector created from providers, we should start using that. injector = (_route$_injector3 = route._injector) !== null && _route$_injector3 !== void 0 ? _route$_injector3 : injector; const childInjector = (_route$_loadedInjecto = route._loadedInjector) !== null && _route$_loadedInjecto !== void 0 ? _route$_loadedInjecto : injector; const childConfig = getChildConfig(route); const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments, remainingSegments, // Filter out routes with redirectTo because we are trying to create activated route // snapshots and don't handle redirects here. That should have been done in // `applyRedirects`. childConfig.filter(c => c.redirectTo === undefined), this.relativeLinkResolution); if (slicedSegments.length === 0 && segmentGroup.hasChildren()) { return this.processChildren(childInjector, childConfig, segmentGroup).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(children => { if (children === null) { return null; } return [new TreeNode(snapshot, children)]; })); } if (childConfig.length === 0 && slicedSegments.length === 0) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)([new TreeNode(snapshot, [])]); } const matchedOnOutlet = getOutlet(route) === outlet; // If we matched a config due to empty path match on a different outlet, we need to // continue passing the current outlet for the segment rather than switch to PRIMARY. // Note that we switch to primary when we have a match because outlet configs look like // this: {path: 'a', outlet: 'a', children: [ // {path: 'b', component: B}, // {path: 'c', component: C}, // ]} // Notice that the children of the named outlet are configured with the primary outlet return this.processSegment(childInjector, childConfig, segmentGroup, slicedSegments, matchedOnOutlet ? PRIMARY_OUTLET : outlet).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(children => { if (children === null) { return null; } return [new TreeNode(snapshot, children)]; })); })); } } function sortActivatedRouteSnapshots(nodes) { nodes.sort((a, b) => { if (a.value.outlet === PRIMARY_OUTLET) return -1; if (b.value.outlet === PRIMARY_OUTLET) return 1; return a.value.outlet.localeCompare(b.value.outlet); }); } function getChildConfig(route) { if (route.children) { return route.children; } if (route.loadChildren) { return route._loadedRoutes; } return []; } function hasEmptyPathConfig(node) { const config = node.value.routeConfig; return config && config.path === '' && config.redirectTo === undefined; } /** * Finds `TreeNode`s with matching empty path route configs and merges them into `TreeNode` with * the children from each duplicate. This is necessary because different outlets can match a * single empty path route config and the results need to then be merged. */ function mergeEmptyPathMatches(nodes) { const result = []; // The set of nodes which contain children that were merged from two duplicate empty path nodes. const mergedNodes = new Set(); for (const node of nodes) { if (!hasEmptyPathConfig(node)) { result.push(node); continue; } const duplicateEmptyPathNode = result.find(resultNode => node.value.routeConfig === resultNode.value.routeConfig); if (duplicateEmptyPathNode !== undefined) { duplicateEmptyPathNode.children.push(...node.children); mergedNodes.add(duplicateEmptyPathNode); } else { result.push(node); } } // For each node which has children from multiple sources, we need to recompute a new `TreeNode` // by also merging those children. This is necessary when there are multiple empty path configs // in a row. Put another way: whenever we combine children of two nodes, we need to also check // if any of those children can be combined into a single node as well. for (const mergedNode of mergedNodes) { const mergedChildren = mergeEmptyPathMatches(mergedNode.children); result.push(new TreeNode(mergedNode.value, mergedChildren)); } return result.filter(n => !mergedNodes.has(n)); } function checkOutletNameUniqueness(nodes) { const names = {}; nodes.forEach(n => { const routeWithSameOutletName = names[n.value.outlet]; if (routeWithSameOutletName) { const p = routeWithSameOutletName.url.map(s => s.toString()).join('/'); const c = n.value.url.map(s => s.toString()).join('/'); throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4006 /* RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET */ , NG_DEV_MODE$5 && `Two segments cannot have the same outlet name: '${p}' and '${c}'.`); } names[n.value.outlet] = n.value; }); } function getSourceSegmentGroup(segmentGroup) { let s = segmentGroup; while (s._sourceSegment) { s = s._sourceSegment; } return s; } function getPathIndexShift(segmentGroup) { var _s$_segmentIndexShift; let s = segmentGroup; let res = (_s$_segmentIndexShift = s._segmentIndexShift) !== null && _s$_segmentIndexShift !== void 0 ? _s$_segmentIndexShift : 0; while (s._sourceSegment) { var _s$_segmentIndexShift2; s = s._sourceSegment; res += (_s$_segmentIndexShift2 = s._segmentIndexShift) !== null && _s$_segmentIndexShift2 !== void 0 ? _s$_segmentIndexShift2 : 0; } return res - 1; } function getCorrectedPathIndexShift(segmentGroup) { var _ref3, _s$_segmentIndexShift3; let s = segmentGroup; let res = (_ref3 = (_s$_segmentIndexShift3 = s._segmentIndexShiftCorrected) !== null && _s$_segmentIndexShift3 !== void 0 ? _s$_segmentIndexShift3 : s._segmentIndexShift) !== null && _ref3 !== void 0 ? _ref3 : 0; while (s._sourceSegment) { var _ref4, _s$_segmentIndexShift4; s = s._sourceSegment; res += (_ref4 = (_s$_segmentIndexShift4 = s._segmentIndexShiftCorrected) !== null && _s$_segmentIndexShift4 !== void 0 ? _s$_segmentIndexShift4 : s._segmentIndexShift) !== null && _ref4 !== void 0 ? _ref4 : 0; } return res - 1; } function getData(route) { return route.data || {}; } function getResolve(route) { return route.resolve || {}; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function recognize(injector, rootComponentType, config, serializer, paramsInheritanceStrategy, relativeLinkResolution) { return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(t => recognize$1(injector, rootComponentType, config, t.urlAfterRedirects, serializer.serialize(t.urlAfterRedirects), serializer, paramsInheritanceStrategy, relativeLinkResolution).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(targetSnapshot => ({ ...t, targetSnapshot })))); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function resolveData(paramsInheritanceStrategy, injector) { return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(t => { const { targetSnapshot, guards: { canActivateChecks } } = t; if (!canActivateChecks.length) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(t); } let canActivateChecksResolved = 0; return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(canActivateChecks).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.concatMap)(check => runResolve(check.route, targetSnapshot, paramsInheritanceStrategy, injector)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(() => canActivateChecksResolved++), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_26__.takeLast)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(_ => canActivateChecksResolved === canActivateChecks.length ? (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(t) : rxjs__WEBPACK_IMPORTED_MODULE_27__.EMPTY)); }); } function runResolve(futureARS, futureRSS, paramsInheritanceStrategy, injector) { const config = futureARS.routeConfig; const resolve = futureARS._resolve; if ((config === null || config === void 0 ? void 0 : config.title) !== undefined && !hasStaticTitle(config)) { resolve[RouteTitleKey] = config.title; } return resolveNode(resolve, futureARS, futureRSS, injector).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(resolvedData => { futureARS._resolvedData = resolvedData; futureARS.data = inheritedParamsDataResolve(futureARS, paramsInheritanceStrategy).resolve; if (config && hasStaticTitle(config)) { futureARS.data[RouteTitleKey] = config.title; } return null; })); } function resolveNode(resolve, futureARS, futureRSS, injector) { const keys = getDataKeys(resolve); if (keys.length === 0) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)({}); } const data = {}; return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(keys).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(key => getResolver(resolve[key], futureARS, futureRSS, injector).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.first)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(value => { data[key] = value; }))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_26__.takeLast)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_28__.mapTo)(data), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.catchError)(e => isEmptyError(e) ? rxjs__WEBPACK_IMPORTED_MODULE_27__.EMPTY : (0,rxjs__WEBPACK_IMPORTED_MODULE_19__.throwError)(e))); } function getDataKeys(obj) { return [...Object.keys(obj), ...Object.getOwnPropertySymbols(obj)]; } function getResolver(injectionToken, futureARS, futureRSS, injector) { var _getClosestRouteInjec4; const closestInjector = (_getClosestRouteInjec4 = getClosestRouteInjector(futureARS)) !== null && _getClosestRouteInjec4 !== void 0 ? _getClosestRouteInjec4 : injector; const resolver = getTokenOrFunctionIdentity(injectionToken, closestInjector); const resolverValue = resolver.resolve ? resolver.resolve(futureARS, futureRSS) : closestInjector.runInContext(() => resolver(futureARS, futureRSS)); return wrapIntoObservable(resolverValue); } function hasStaticTitle(config) { return typeof config.title === 'string' || config.title === null; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Perform a side effect through a switchMap for every emission on the source Observable, * but return an Observable that is identical to the source. It's essentially the same as * the `tap` operator, but if the side effectful `next` function returns an ObservableInput, * it will wait before continuing with the original value. */ function switchTap(next) { return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(v => { const nextResult = next(v); if (nextResult) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(nextResult).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(() => v)); } return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(v); }); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Provides a strategy for setting the page title after a router navigation. * * The built-in implementation traverses the router state snapshot and finds the deepest primary * outlet with `title` property. Given the `Routes` below, navigating to * `/base/child(popup:aux)` would result in the document title being set to "child". * ``` * [ * {path: 'base', title: 'base', children: [ * {path: 'child', title: 'child'}, * ], * {path: 'aux', outlet: 'popup', title: 'popupTitle'} * ] * ``` * * This class can be used as a base class for custom title strategies. That is, you can create your * own class that extends the `TitleStrategy`. Note that in the above example, the `title` * from the named outlet is never used. However, a custom strategy might be implemented to * incorporate titles in named outlets. * * @publicApi * @see [Page title guide](guide/router#setting-the-page-title) */ class TitleStrategy { /** * @returns The `title` of the deepest primary route. */ buildTitle(snapshot) { let pageTitle; let route = snapshot.root; while (route !== undefined) { var _this$getResolvedTitl; pageTitle = (_this$getResolvedTitl = this.getResolvedTitleForRoute(route)) !== null && _this$getResolvedTitl !== void 0 ? _this$getResolvedTitl : pageTitle; route = route.children.find(child => child.outlet === PRIMARY_OUTLET); } return pageTitle; } /** * Given an `ActivatedRouteSnapshot`, returns the final value of the * `Route.title` property, which can either be a static string or a resolved value. */ getResolvedTitleForRoute(snapshot) { return snapshot.data[RouteTitleKey]; } } TitleStrategy.ɵfac = function TitleStrategy_Factory(t) { return new (t || TitleStrategy)(); }; TitleStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: TitleStrategy, factory: function () { return (() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DefaultTitleStrategy))(); }, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TitleStrategy, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root', useFactory: () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DefaultTitleStrategy) }] }], null, null); })(); /** * The default `TitleStrategy` used by the router that updates the title using the `Title` service. */ class DefaultTitleStrategy extends TitleStrategy { constructor(title) { super(); this.title = title; } /** * Sets the title of the browser to the given value. * * @param title The `pageTitle` from the deepest primary route. */ updateTitle(snapshot) { const title = this.buildTitle(snapshot); if (title !== undefined) { this.title.setTitle(title); } } } DefaultTitleStrategy.ɵfac = function DefaultTitleStrategy_Factory(t) { return new (t || DefaultTitleStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_platform_browser__WEBPACK_IMPORTED_MODULE_29__.Title)); }; DefaultTitleStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: DefaultTitleStrategy, factory: DefaultTitleStrategy.ɵfac, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DefaultTitleStrategy, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root' }] }], function () { return [{ type: _angular_platform_browser__WEBPACK_IMPORTED_MODULE_29__.Title }]; }, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Exists to aid internal migration off of the deprecated relativeLinkResolution option. */ function assignRelativeLinkResolution(router) {} /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @description * * Provides a way to customize when activated routes get reused. * * @publicApi */ class RouteReuseStrategy {} /** * @description * * This base route reuse strategy only reuses routes when the matched router configs are * identical. This prevents components from being destroyed and recreated * when just the route parameters, query parameters or fragment change * (that is, the existing component is _reused_). * * This strategy does not store any routes for later reuse. * * Angular uses this strategy by default. * * * It can be used as a base class for custom route reuse strategies, i.e. you can create your own * class that extends the `BaseRouteReuseStrategy` one. * @publicApi */ class BaseRouteReuseStrategy { /** * Whether the given route should detach for later reuse. * Always returns false for `BaseRouteReuseStrategy`. * */ shouldDetach(route) { return false; } /** * A no-op; the route is never stored since this strategy never detaches routes for later re-use. */ store(route, detachedTree) {} /** Returns `false`, meaning the route (and its subtree) is never reattached */ shouldAttach(route) { return false; } /** Returns `null` because this strategy does not store routes for later re-use. */ retrieve(route) { return null; } /** * Determines if a route should be reused. * This strategy returns `true` when the future route config and current route config are * identical. */ shouldReuseRoute(future, curr) { return future.routeConfig === curr.routeConfig; } } class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {} /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE$4 = typeof ngDevMode === 'undefined' || !!ngDevMode; /** * A [DI token](guide/glossary/#di-token) for the router service. * * @publicApi */ const ROUTER_CONFIGURATION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(NG_DEV_MODE$4 ? 'router config' : '', { providedIn: 'root', factory: () => ({}) }); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE$3 = typeof ngDevMode === 'undefined' || !!ngDevMode; /** * The [DI token](guide/glossary/#di-token) for a router configuration. * * `ROUTES` is a low level API for router configuration via dependency injection. * * We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`, * `RouterModule.forChild()`, `provideRoutes`, or `Router.resetConfig()`. * * @publicApi */ const ROUTES = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('ROUTES'); class RouterConfigLoader { constructor(injector, compiler) { this.injector = injector; this.compiler = compiler; this.componentLoaders = new WeakMap(); this.childrenLoaders = new WeakMap(); } loadComponent(route) { if (this.componentLoaders.get(route)) { return this.componentLoaders.get(route); } else if (route._loadedComponent) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(route._loadedComponent); } if (this.onLoadStartListener) { this.onLoadStartListener(route); } const loadRunner = wrapIntoObservable(route.loadComponent()).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(component => { var _route$path; if (this.onLoadEndListener) { this.onLoadEndListener(route); } NG_DEV_MODE$3 && assertStandalone((_route$path = route.path) !== null && _route$path !== void 0 ? _route$path : '', component); route._loadedComponent = component; }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_30__.finalize)(() => { this.componentLoaders.delete(route); })); // Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much const loader = new rxjs__WEBPACK_IMPORTED_MODULE_31__.ConnectableObservable(loadRunner, () => new rxjs__WEBPACK_IMPORTED_MODULE_32__.Subject()).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_33__.refCount)()); this.componentLoaders.set(route, loader); return loader; } loadChildren(parentInjector, route) { if (this.childrenLoaders.get(route)) { return this.childrenLoaders.get(route); } else if (route._loadedRoutes) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)({ routes: route._loadedRoutes, injector: route._loadedInjector }); } if (this.onLoadStartListener) { this.onLoadStartListener(route); } const moduleFactoryOrRoutes$ = this.loadModuleFactoryOrRoutes(route.loadChildren); const loadRunner = moduleFactoryOrRoutes$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(factoryOrRoutes => { if (this.onLoadEndListener) { this.onLoadEndListener(route); } // This injector comes from the `NgModuleRef` when lazy loading an `NgModule`. There is no // injector associated with lazy loading a `Route` array. let injector; let rawRoutes; let requireStandaloneComponents = false; if (Array.isArray(factoryOrRoutes)) { rawRoutes = factoryOrRoutes; requireStandaloneComponents = true; } else { injector = factoryOrRoutes.create(parentInjector).injector; // When loading a module that doesn't provide `RouterModule.forChild()` preloader // will get stuck in an infinite loop. The child module's Injector will look to // its parent `Injector` when it doesn't find any ROUTES so it will return routes // for it's parent module instead. rawRoutes = flatten(injector.get(ROUTES, [], _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectFlags.Self | _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectFlags.Optional)); } const routes = rawRoutes.map(standardizeConfig); NG_DEV_MODE$3 && validateConfig(routes, route.path, requireStandaloneComponents); return { routes, injector }; }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_30__.finalize)(() => { this.childrenLoaders.delete(route); })); // Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much const loader = new rxjs__WEBPACK_IMPORTED_MODULE_31__.ConnectableObservable(loadRunner, () => new rxjs__WEBPACK_IMPORTED_MODULE_32__.Subject()).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_33__.refCount)()); this.childrenLoaders.set(route, loader); return loader; } loadModuleFactoryOrRoutes(loadChildren) { return wrapIntoObservable(loadChildren()).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(t => { if (t instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModuleFactory || Array.isArray(t)) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(t); } else { return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(this.compiler.compileModuleAsync(t)); } })); } } RouterConfigLoader.ɵfac = function RouterConfigLoader_Factory(t) { return new (t || RouterConfigLoader)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.Compiler)); }; RouterConfigLoader.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: RouterConfigLoader, factory: RouterConfigLoader.ɵfac, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RouterConfigLoader, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root' }] }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Compiler }]; }, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @description * * Provides a way to migrate AngularJS applications to Angular. * * @publicApi */ class UrlHandlingStrategy {} /** * @publicApi */ class DefaultUrlHandlingStrategy { shouldProcessUrl(url) { return true; } extract(url) { return url; } merge(newUrlPart, wholeUrl) { return newUrlPart; } } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE$2 = typeof ngDevMode === 'undefined' || !!ngDevMode; function defaultErrorHandler(error) { throw error; } function defaultMalformedUriErrorHandler(error, urlSerializer, url) { return urlSerializer.parse('/'); } /** * The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `true` * (exact = true). */ const exactMatchOptions = { paths: 'exact', fragment: 'ignored', matrixParams: 'ignored', queryParams: 'exact' }; /** * The equivalent `IsActiveMatchOptions` options for `Router.isActive` is called with `false` * (exact = false). */ const subsetMatchOptions = { paths: 'subset', fragment: 'ignored', matrixParams: 'ignored', queryParams: 'subset' }; function assignExtraOptionsToRouter(opts, router) { if (opts.errorHandler) { router.errorHandler = opts.errorHandler; } if (opts.malformedUriErrorHandler) { router.malformedUriErrorHandler = opts.malformedUriErrorHandler; } if (opts.onSameUrlNavigation) { router.onSameUrlNavigation = opts.onSameUrlNavigation; } if (opts.paramsInheritanceStrategy) { router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy; } if (opts.relativeLinkResolution) { router.relativeLinkResolution = opts.relativeLinkResolution; } if (opts.urlUpdateStrategy) { router.urlUpdateStrategy = opts.urlUpdateStrategy; } if (opts.canceledNavigationResolution) { router.canceledNavigationResolution = opts.canceledNavigationResolution; } } function setupRouter() { var _inject, _inject2; const urlSerializer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(UrlSerializer); const contexts = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(ChildrenOutletContexts); const location = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_1__.Location); const injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector); const compiler = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Compiler); const config = (_inject = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(ROUTES, { optional: true })) !== null && _inject !== void 0 ? _inject : []; const opts = (_inject2 = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(ROUTER_CONFIGURATION, { optional: true })) !== null && _inject2 !== void 0 ? _inject2 : {}; const defaultTitleStrategy = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DefaultTitleStrategy); const titleStrategy = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(TitleStrategy, { optional: true }); const urlHandlingStrategy = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(UrlHandlingStrategy, { optional: true }); const routeReuseStrategy = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(RouteReuseStrategy, { optional: true }); const router = new Router(null, urlSerializer, contexts, location, injector, compiler, flatten(config)); if (urlHandlingStrategy) { router.urlHandlingStrategy = urlHandlingStrategy; } if (routeReuseStrategy) { router.routeReuseStrategy = routeReuseStrategy; } router.titleStrategy = titleStrategy !== null && titleStrategy !== void 0 ? titleStrategy : defaultTitleStrategy; assignExtraOptionsToRouter(opts, router); assignRelativeLinkResolution(router); return router; } /** * @description * * A service that provides navigation among views and URL manipulation capabilities. * * @see `Route`. * @see [Routing and Navigation Guide](guide/router). * * @ngModule RouterModule * * @publicApi */ class Router { /** * Creates the router service. */ // TODO: vsavkin make internal after the final is out. constructor(rootComponentType, urlSerializer, rootContexts, location, injector, compiler, config) { this.rootComponentType = rootComponentType; this.urlSerializer = urlSerializer; this.rootContexts = rootContexts; this.location = location; this.config = config; this.lastSuccessfulNavigation = null; this.currentNavigation = null; this.disposed = false; this.navigationId = 0; /** * The id of the currently active page in the router. * Updated to the transition's target id on a successful navigation. * * This is used to track what page the router last activated. When an attempted navigation fails, * the router can then use this to compute how to restore the state back to the previously active * page. */ this.currentPageId = 0; this.isNgZoneEnabled = false; /** * An event stream for routing events in this NgModule. */ this.events = new rxjs__WEBPACK_IMPORTED_MODULE_32__.Subject(); /** * A handler for navigation errors in this NgModule. */ this.errorHandler = defaultErrorHandler; /** * A handler for errors thrown by `Router.parseUrl(url)` * when `url` contains an invalid character. * The most common case is a `%` sign * that's not encoded and is not part of a percent encoded sequence. */ this.malformedUriErrorHandler = defaultMalformedUriErrorHandler; /** * True if at least one navigation event has occurred, * false otherwise. */ this.navigated = false; this.lastSuccessfulId = -1; /** * Hook that enables you to pause navigation after the preactivation phase. * Used by `RouterModule`. * * @internal */ this.afterPreactivation = () => (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(void 0); /** * A strategy for extracting and merging URLs. * Used for AngularJS to Angular migrations. */ this.urlHandlingStrategy = new DefaultUrlHandlingStrategy(); /** * A strategy for re-using routes. */ this.routeReuseStrategy = new DefaultRouteReuseStrategy(); /** * How to handle a navigation request to the current URL. One of: * * - `'ignore'` : The router ignores the request. * - `'reload'` : The router reloads the URL. Use to implement a "refresh" feature. * * Note that this only configures whether the Route reprocesses the URL and triggers related * action and events like redirects, guards, and resolvers. By default, the router re-uses a * component instance when it re-navigates to the same component type without visiting a different * component first. This behavior is configured by the `RouteReuseStrategy`. In order to reload * routed components on same url navigation, you need to set `onSameUrlNavigation` to `'reload'` * _and_ provide a `RouteReuseStrategy` which returns `false` for `shouldReuseRoute`. */ this.onSameUrlNavigation = 'ignore'; /** * How to merge parameters, data, resolved data, and title from parent to child * routes. One of: * * - `'emptyOnly'` : Inherit parent parameters, data, and resolved data * for path-less or component-less routes. * - `'always'` : Inherit parent parameters, data, and resolved data * for all child routes. */ this.paramsInheritanceStrategy = 'emptyOnly'; /** * Determines when the router updates the browser URL. * By default (`"deferred"`), updates the browser URL after navigation has finished. * Set to `'eager'` to update the browser URL at the beginning of navigation. * You can choose to update early so that, if navigation fails, * you can show an error message with the URL that failed. */ this.urlUpdateStrategy = 'deferred'; /** * Enables a bug fix that corrects relative link resolution in components with empty paths. * @see `RouterModule` * * @deprecated */ this.relativeLinkResolution = 'corrected'; /** * Configures how the Router attempts to restore state when a navigation is cancelled. * * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the * router before the navigation started. This means that if the URL of the browser is updated * _before_ the navigation is canceled, the Router will simply replace the item in history rather * than trying to restore to the previous location in the session history. This happens most * frequently with `urlUpdateStrategy: 'eager'` and navigations with the browser back/forward * buttons. * * 'computed' - Will attempt to return to the same index in the session history that corresponds * to the Angular route when the navigation gets cancelled. For example, if the browser back * button is clicked and the navigation is cancelled, the Router will trigger a forward navigation * and vice versa. * * Note: the 'computed' option is incompatible with any `UrlHandlingStrategy` which only * handles a portion of the URL because the history restoration navigates to the previous place in * the browser history rather than simply resetting a portion of the URL. * * The default value is `replace`. * */ this.canceledNavigationResolution = 'replace'; const onLoadStart = r => this.triggerEvent(new RouteConfigLoadStart(r)); const onLoadEnd = r => this.triggerEvent(new RouteConfigLoadEnd(r)); this.configLoader = injector.get(RouterConfigLoader); this.configLoader.onLoadEndListener = onLoadEnd; this.configLoader.onLoadStartListener = onLoadStart; this.ngModule = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModuleRef); this.console = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵConsole"]); const ngZone = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone); this.isNgZoneEnabled = ngZone instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone && _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone.isInAngularZone(); this.resetConfig(config); this.currentUrlTree = createEmptyUrlTree(); this.rawUrlTree = this.currentUrlTree; this.browserUrlTree = this.currentUrlTree; this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType); this.transitions = new rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject({ id: 0, targetPageId: 0, currentUrlTree: this.currentUrlTree, currentRawUrl: this.currentUrlTree, extractedUrl: this.urlHandlingStrategy.extract(this.currentUrlTree), urlAfterRedirects: this.urlHandlingStrategy.extract(this.currentUrlTree), rawUrl: this.currentUrlTree, extras: {}, resolve: null, reject: null, promise: Promise.resolve(true), source: 'imperative', restoredState: null, currentSnapshot: this.routerState.snapshot, targetSnapshot: null, currentRouterState: this.routerState, targetRouterState: null, guards: { canActivateChecks: [], canDeactivateChecks: [] }, guardsResult: null }); this.navigations = this.setupNavigations(this.transitions); this.processNavigations(); } /** * The ɵrouterPageId of whatever page is currently active in the browser history. This is * important for computing the target page id for new navigations because we need to ensure each * page id in the browser history is 1 more than the previous entry. */ get browserPageId() { var _this$location$getSta; return (_this$location$getSta = this.location.getState()) === null || _this$location$getSta === void 0 ? void 0 : _this$location$getSta.ɵrouterPageId; } setupNavigations(transitions) { const eventsSubject = this.events; return transitions.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.filter)(t => t.id !== 0), // Extract URL (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(t => ({ ...t, extractedUrl: this.urlHandlingStrategy.extract(t.rawUrl) })), // Using switchMap so we cancel executing navigations when a new one comes in (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(overallTransitionState => { let completed = false; let errored = false; return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(overallTransitionState).pipe( // Store the Navigation object (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(t => { this.currentNavigation = { id: t.id, initialUrl: t.rawUrl, extractedUrl: t.extractedUrl, trigger: t.source, extras: t.extras, previousNavigation: this.lastSuccessfulNavigation ? { ...this.lastSuccessfulNavigation, previousNavigation: null } : null }; }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(t => { const browserUrlTree = this.browserUrlTree.toString(); const urlTransition = !this.navigated || t.extractedUrl.toString() !== browserUrlTree || // Navigations which succeed or ones which fail and are cleaned up // correctly should result in `browserUrlTree` and `currentUrlTree` // matching. If this is not the case, assume something went wrong and // try processing the URL again. browserUrlTree !== this.currentUrlTree.toString(); const processCurrentUrl = (this.onSameUrlNavigation === 'reload' ? true : urlTransition) && this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl); if (processCurrentUrl) { // If the source of the navigation is from a browser event, the URL is // already updated. We already need to sync the internal state. if (isBrowserTriggeredNavigation(t.source)) { this.browserUrlTree = t.extractedUrl; } return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(t).pipe( // Fire NavigationStart event (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(t => { const transition = this.transitions.getValue(); eventsSubject.next(new NavigationStart(t.id, this.serializeUrl(t.extractedUrl), t.source, t.restoredState)); if (transition !== this.transitions.getValue()) { return rxjs__WEBPACK_IMPORTED_MODULE_27__.EMPTY; } // This delay is required to match old behavior that forced // navigation to always be async return Promise.resolve(t); }), // ApplyRedirects applyRedirects(this.ngModule.injector, this.configLoader, this.urlSerializer, this.config), // Update the currentNavigation // `urlAfterRedirects` is guaranteed to be set after this point (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(t => { this.currentNavigation = { ...this.currentNavigation, finalUrl: t.urlAfterRedirects }; overallTransitionState.urlAfterRedirects = t.urlAfterRedirects; }), // Recognize recognize(this.ngModule.injector, this.rootComponentType, this.config, this.urlSerializer, this.paramsInheritanceStrategy, this.relativeLinkResolution), // Update URL if in `eager` update mode (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(t => { overallTransitionState.targetSnapshot = t.targetSnapshot; if (this.urlUpdateStrategy === 'eager') { if (!t.extras.skipLocationChange) { const rawUrl = this.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl); this.setBrowserUrl(rawUrl, t); } this.browserUrlTree = t.urlAfterRedirects; } // Fire RoutesRecognized const routesRecognized = new RoutesRecognized(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot); eventsSubject.next(routesRecognized); })); } else { const processPreviousUrl = urlTransition && this.rawUrlTree && this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree); /* When the current URL shouldn't be processed, but the previous one * was, we handle this "error condition" by navigating to the * previously successful URL, but leaving the URL intact.*/ if (processPreviousUrl) { const { id, extractedUrl, source, restoredState, extras } = t; const navStart = new NavigationStart(id, this.serializeUrl(extractedUrl), source, restoredState); eventsSubject.next(navStart); const targetSnapshot = createEmptyState(extractedUrl, this.rootComponentType).snapshot; overallTransitionState = { ...t, targetSnapshot, urlAfterRedirects: extractedUrl, extras: { ...extras, skipLocationChange: false, replaceUrl: false } }; return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(overallTransitionState); } else { /* When neither the current or previous URL can be processed, do * nothing other than update router's internal reference to the * current "settled" URL. This way the next navigation will be coming * from the current URL in the browser. */ this.rawUrlTree = t.rawUrl; t.resolve(null); return rxjs__WEBPACK_IMPORTED_MODULE_27__.EMPTY; } } }), // --- GUARDS --- (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(t => { const guardsStart = new GuardsCheckStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot); this.triggerEvent(guardsStart); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(t => { overallTransitionState = { ...t, guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.rootContexts) }; return overallTransitionState; }), checkGuards(this.ngModule.injector, evt => this.triggerEvent(evt)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(t => { overallTransitionState.guardsResult = t.guardsResult; if (isUrlTree(t.guardsResult)) { throw redirectingNavigationError(this.urlSerializer, t.guardsResult); } const guardsEnd = new GuardsCheckEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot, !!t.guardsResult); this.triggerEvent(guardsEnd); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.filter)(t => { if (!t.guardsResult) { this.restoreHistory(t); this.cancelNavigationTransition(t, '', 3 /* NavigationCancellationCode.GuardRejected */ ); return false; } return true; }), // --- RESOLVE --- switchTap(t => { if (t.guards.canActivateChecks.length) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(t).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(t => { const resolveStart = new ResolveStart(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot); this.triggerEvent(resolveStart); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(t => { let dataResolved = false; return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(t).pipe(resolveData(this.paramsInheritanceStrategy, this.ngModule.injector), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)({ next: () => dataResolved = true, complete: () => { if (!dataResolved) { this.restoreHistory(t); this.cancelNavigationTransition(t, NG_DEV_MODE$2 ? `At least one route resolver didn't emit any value.` : '', 2 /* NavigationCancellationCode.NoDataFromResolver */ ); } } })); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(t => { const resolveEnd = new ResolveEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot); this.triggerEvent(resolveEnd); })); } return undefined; }), // --- LOAD COMPONENTS --- switchTap(t => { const loadComponents = route => { var _route$routeConfig; const loaders = []; if ((_route$routeConfig = route.routeConfig) !== null && _route$routeConfig !== void 0 && _route$routeConfig.loadComponent && !route.routeConfig._loadedComponent) { loaders.push(this.configLoader.loadComponent(route.routeConfig).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(loadedComponent => { route.component = loadedComponent; }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(() => void 0))); } for (const child of route.children) { loaders.push(...loadComponents(child)); } return loaders; }; return (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.combineLatest)(loadComponents(t.targetSnapshot.root)).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_25__.defaultIfEmpty)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.take)(1)); }), switchTap(() => this.afterPreactivation()), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(t => { const targetRouterState = createRouterState(this.routeReuseStrategy, t.targetSnapshot, t.currentRouterState); overallTransitionState = { ...t, targetRouterState }; return overallTransitionState; }), /* Once here, we are about to activate synchronously. The assumption is this will succeed, and user code may read from the Router service. Therefore before activation, we need to update router properties storing the current URL and the RouterState, as well as updated the browser URL. All this should happen *before* activating. */ (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)(t => { this.currentUrlTree = t.urlAfterRedirects; this.rawUrlTree = this.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl); this.routerState = t.targetRouterState; if (this.urlUpdateStrategy === 'deferred') { if (!t.extras.skipLocationChange) { this.setBrowserUrl(this.rawUrlTree, t); } this.browserUrlTree = t.urlAfterRedirects; } }), activateRoutes(this.rootContexts, this.routeReuseStrategy, evt => this.triggerEvent(evt)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.tap)({ next() { completed = true; }, complete() { completed = true; } }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_30__.finalize)(() => { var _this$currentNavigati; /* When the navigation stream finishes either through error or success, * we set the `completed` or `errored` flag. However, there are some * situations where we could get here without either of those being set. * For instance, a redirect during NavigationStart. Therefore, this is a * catch-all to make sure the NavigationCancel event is fired when a * navigation gets cancelled but not caught by other means. */ if (!completed && !errored) { const cancelationReason = NG_DEV_MODE$2 ? `Navigation ID ${overallTransitionState.id} is not equal to the current navigation id ${this.navigationId}` : ''; this.cancelNavigationTransition(overallTransitionState, cancelationReason, 1 /* NavigationCancellationCode.SupersededByNewNavigation */ ); } // Only clear current navigation if it is still set to the one that // finalized. if (((_this$currentNavigati = this.currentNavigation) === null || _this$currentNavigati === void 0 ? void 0 : _this$currentNavigati.id) === overallTransitionState.id) { this.currentNavigation = null; } }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.catchError)(e => { errored = true; /* This error type is issued during Redirect, and is handled as a * cancellation rather than an error. */ if (isNavigationCancelingError$1(e)) { if (!isRedirectingNavigationCancelingError$1(e)) { // Set property only if we're not redirecting. If we landed on a page // and redirect to `/` route, the new navigation is going to see the // `/` isn't a change from the default currentUrlTree and won't // navigate. This is only applicable with initial navigation, so // setting `navigated` only when not redirecting resolves this // scenario. this.navigated = true; this.restoreHistory(overallTransitionState, true); } const navCancel = new NavigationCancel(overallTransitionState.id, this.serializeUrl(overallTransitionState.extractedUrl), e.message, e.cancellationCode); eventsSubject.next(navCancel); // When redirecting, we need to delay resolving the navigation // promise and push it to the redirect navigation if (!isRedirectingNavigationCancelingError$1(e)) { overallTransitionState.resolve(false); } else { const mergedTree = this.urlHandlingStrategy.merge(e.url, this.rawUrlTree); const extras = { skipLocationChange: overallTransitionState.extras.skipLocationChange, // The URL is already updated at this point if we have 'eager' URL // updates or if the navigation was triggered by the browser (back // button, URL bar, etc). We want to replace that item in history // if the navigation is rejected. replaceUrl: this.urlUpdateStrategy === 'eager' || isBrowserTriggeredNavigation(overallTransitionState.source) }; this.scheduleNavigation(mergedTree, 'imperative', null, extras, { resolve: overallTransitionState.resolve, reject: overallTransitionState.reject, promise: overallTransitionState.promise }); } /* All other errors should reset to the router's internal URL reference * to the pre-error state. */ } else { var _overallTransitionSta; this.restoreHistory(overallTransitionState, true); const navError = new NavigationError(overallTransitionState.id, this.serializeUrl(overallTransitionState.extractedUrl), e, (_overallTransitionSta = overallTransitionState.targetSnapshot) !== null && _overallTransitionSta !== void 0 ? _overallTransitionSta : undefined); eventsSubject.next(navError); try { overallTransitionState.resolve(this.errorHandler(e)); } catch (ee) { overallTransitionState.reject(ee); } } return rxjs__WEBPACK_IMPORTED_MODULE_27__.EMPTY; })); // TODO(jasonaden): remove cast once g3 is on updated TypeScript })); } /** * @internal * TODO: this should be removed once the constructor of the router made internal */ resetRootComponentType(rootComponentType) { this.rootComponentType = rootComponentType; // TODO: vsavkin router 4.0 should make the root component set to null // this will simplify the lifecycle of the router. this.routerState.root.component = this.rootComponentType; } setTransition(t) { this.transitions.next({ ...this.transitions.value, ...t }); } /** * Sets up the location change listener and performs the initial navigation. */ initialNavigation() { this.setUpLocationChangeListener(); if (this.navigationId === 0) { this.navigateByUrl(this.location.path(true), { replaceUrl: true }); } } /** * Sets up the location change listener. This listener detects navigations triggered from outside * the Router (the browser back/forward buttons, for example) and schedules a corresponding Router * navigation so that the correct events, guards, etc. are triggered. */ setUpLocationChangeListener() { // Don't need to use Zone.wrap any more, because zone.js // already patch onPopState, so location change callback will // run into ngZone if (!this.locationSubscription) { this.locationSubscription = this.location.subscribe(event => { const source = event['type'] === 'popstate' ? 'popstate' : 'hashchange'; if (source === 'popstate') { // The `setTimeout` was added in #12160 and is likely to support Angular/AngularJS // hybrid apps. setTimeout(() => { var _event$state; const extras = { replaceUrl: true }; // Navigations coming from Angular router have a navigationId state // property. When this exists, restore the state. const state = (_event$state = event.state) !== null && _event$state !== void 0 && _event$state.navigationId ? event.state : null; if (state) { const stateCopy = { ...state }; delete stateCopy.navigationId; delete stateCopy.ɵrouterPageId; if (Object.keys(stateCopy).length !== 0) { extras.state = stateCopy; } } const urlTree = this.parseUrl(event['url']); this.scheduleNavigation(urlTree, source, state, extras); }, 0); } }); } } /** The current URL. */ get url() { return this.serializeUrl(this.currentUrlTree); } /** * Returns the current `Navigation` object when the router is navigating, * and `null` when idle. */ getCurrentNavigation() { return this.currentNavigation; } /** @internal */ triggerEvent(event) { this.events.next(event); } /** * Resets the route configuration used for navigation and generating links. * * @param config The route array for the new configuration. * * @usageNotes * * ``` * router.resetConfig([ * { path: 'team/:id', component: TeamCmp, children: [ * { path: 'simple', component: SimpleCmp }, * { path: 'user/:name', component: UserCmp } * ]} * ]); * ``` */ resetConfig(config) { NG_DEV_MODE$2 && validateConfig(config); this.config = config.map(standardizeConfig); this.navigated = false; this.lastSuccessfulId = -1; } /** @nodoc */ ngOnDestroy() { this.dispose(); } /** Disposes of the router. */ dispose() { this.transitions.complete(); if (this.locationSubscription) { this.locationSubscription.unsubscribe(); this.locationSubscription = undefined; } this.disposed = true; } /** * Appends URL segments to the current URL tree to create a new URL tree. * * @param commands An array of URL fragments with which to construct the new URL tree. * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path * segments, followed by the parameters for each segment. * The fragments are applied to the current URL tree or the one provided in the `relativeTo` * property of the options object, if supplied. * @param navigationExtras Options that control the navigation strategy. * @returns The new URL tree. * * @usageNotes * * ``` * // create /team/33/user/11 * router.createUrlTree(['/team', 33, 'user', 11]); * * // create /team/33;expand=true/user/11 * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]); * * // you can collapse static segments like this (this works only with the first passed-in value): * router.createUrlTree(['/team/33/user', userId]); * * // If the first segment can contain slashes, and you do not want the router to split it, * // you can do the following: * router.createUrlTree([{segmentPath: '/one/two'}]); * * // create /team/33/(user/11//right:chat) * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]); * * // remove the right secondary node * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]); * * // assuming the current url is `/team/33/user/11` and the route points to `user/11` * * // navigate to /team/33/user/11/details * router.createUrlTree(['details'], {relativeTo: route}); * * // navigate to /team/33/user/22 * router.createUrlTree(['../22'], {relativeTo: route}); * * // navigate to /team/44/user/22 * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route}); * * Note that a value of `null` or `undefined` for `relativeTo` indicates that the * tree should be created relative to the root. * ``` */ createUrlTree(commands, navigationExtras = {}) { const { relativeTo, queryParams, fragment, queryParamsHandling, preserveFragment } = navigationExtras; const a = relativeTo || this.routerState.root; const f = preserveFragment ? this.currentUrlTree.fragment : fragment; let q = null; switch (queryParamsHandling) { case 'merge': q = { ...this.currentUrlTree.queryParams, ...queryParams }; break; case 'preserve': q = this.currentUrlTree.queryParams; break; default: q = queryParams || null; } if (q !== null) { q = this.removeEmptyProps(q); } return createUrlTree(a, this.currentUrlTree, commands, q, f !== null && f !== void 0 ? f : null); } /** * Navigates to a view using an absolute route path. * * @param url An absolute path for a defined route. The function does not apply any delta to the * current URL. * @param extras An object containing properties that modify the navigation strategy. * * @returns A Promise that resolves to 'true' when navigation succeeds, * to 'false' when navigation fails, or is rejected on error. * * @usageNotes * * The following calls request navigation to an absolute path. * * ``` * router.navigateByUrl("/team/33/user/11"); * * // Navigate without updating the URL * router.navigateByUrl("/team/33/user/11", { skipLocationChange: true }); * ``` * * @see [Routing and Navigation guide](guide/router) * */ navigateByUrl(url, extras = { skipLocationChange: false }) { if (typeof ngDevMode === 'undefined' || ngDevMode && this.isNgZoneEnabled && !_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone.isInAngularZone()) { this.console.warn(`Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?`); } const urlTree = isUrlTree(url) ? url : this.parseUrl(url); const mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree); return this.scheduleNavigation(mergedTree, 'imperative', null, extras); } /** * Navigate based on the provided array of commands and a starting point. * If no starting route is provided, the navigation is absolute. * * @param commands An array of URL fragments with which to construct the target URL. * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path * segments, followed by the parameters for each segment. * The fragments are applied to the current URL or the one provided in the `relativeTo` property * of the options object, if supplied. * @param extras An options object that determines how the URL should be constructed or * interpreted. * * @returns A Promise that resolves to `true` when navigation succeeds, to `false` when navigation * fails, * or is rejected on error. * * @usageNotes * * The following calls request navigation to a dynamic route path relative to the current URL. * * ``` * router.navigate(['team', 33, 'user', 11], {relativeTo: route}); * * // Navigate without updating the URL, overriding the default behavior * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true}); * ``` * * @see [Routing and Navigation guide](guide/router) * */ navigate(commands, extras = { skipLocationChange: false }) { validateCommands(commands); return this.navigateByUrl(this.createUrlTree(commands, extras), extras); } /** Serializes a `UrlTree` into a string */ serializeUrl(url) { return this.urlSerializer.serialize(url); } /** Parses a string into a `UrlTree` */ parseUrl(url) { let urlTree; try { urlTree = this.urlSerializer.parse(url); } catch (e) { urlTree = this.malformedUriErrorHandler(e, this.urlSerializer, url); } return urlTree; } isActive(url, matchOptions) { let options; if (matchOptions === true) { options = { ...exactMatchOptions }; } else if (matchOptions === false) { options = { ...subsetMatchOptions }; } else { options = matchOptions; } if (isUrlTree(url)) { return containsTree(this.currentUrlTree, url, options); } const urlTree = this.parseUrl(url); return containsTree(this.currentUrlTree, urlTree, options); } removeEmptyProps(params) { return Object.keys(params).reduce((result, key) => { const value = params[key]; if (value !== null && value !== undefined) { result[key] = value; } return result; }, {}); } processNavigations() { this.navigations.subscribe(t => { var _this$titleStrategy; this.navigated = true; this.lastSuccessfulId = t.id; this.currentPageId = t.targetPageId; this.events.next(new NavigationEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(this.currentUrlTree))); this.lastSuccessfulNavigation = this.currentNavigation; (_this$titleStrategy = this.titleStrategy) === null || _this$titleStrategy === void 0 ? void 0 : _this$titleStrategy.updateTitle(this.routerState.snapshot); t.resolve(true); }, e => { this.console.warn(`Unhandled Navigation Error: ${e}`); }); } scheduleNavigation(rawUrl, source, restoredState, extras, priorPromise) { if (this.disposed) { return Promise.resolve(false); } let resolve; let reject; let promise; if (priorPromise) { resolve = priorPromise.resolve; reject = priorPromise.reject; promise = priorPromise.promise; } else { promise = new Promise((res, rej) => { resolve = res; reject = rej; }); } const id = ++this.navigationId; let targetPageId; if (this.canceledNavigationResolution === 'computed') { const isInitialPage = this.currentPageId === 0; if (isInitialPage) { restoredState = this.location.getState(); } // If the `ɵrouterPageId` exist in the state then `targetpageId` should have the value of // `ɵrouterPageId`. This is the case for something like a page refresh where we assign the // target id to the previously set value for that page. if (restoredState && restoredState.ɵrouterPageId) { targetPageId = restoredState.ɵrouterPageId; } else { // If we're replacing the URL or doing a silent navigation, we do not want to increment the // page id because we aren't pushing a new entry to history. if (extras.replaceUrl || extras.skipLocationChange) { var _this$browserPageId; targetPageId = (_this$browserPageId = this.browserPageId) !== null && _this$browserPageId !== void 0 ? _this$browserPageId : 0; } else { var _this$browserPageId2; targetPageId = ((_this$browserPageId2 = this.browserPageId) !== null && _this$browserPageId2 !== void 0 ? _this$browserPageId2 : 0) + 1; } } } else { // This is unused when `canceledNavigationResolution` is not computed. targetPageId = 0; } this.setTransition({ id, targetPageId, source, restoredState, currentUrlTree: this.currentUrlTree, currentRawUrl: this.rawUrlTree, rawUrl, extras, resolve, reject, promise, currentSnapshot: this.routerState.snapshot, currentRouterState: this.routerState }); // Make sure that the error is propagated even though `processNavigations` catch // handler does not rethrow return promise.catch(e => { return Promise.reject(e); }); } setBrowserUrl(url, t) { const path = this.urlSerializer.serialize(url); const state = { ...t.extras.state, ...this.generateNgRouterState(t.id, t.targetPageId) }; if (this.location.isCurrentPathEqualTo(path) || !!t.extras.replaceUrl) { this.location.replaceState(path, '', state); } else { this.location.go(path, '', state); } } /** * Performs the necessary rollback action to restore the browser URL to the * state before the transition. */ restoreHistory(t, restoringFromCaughtError = false) { if (this.canceledNavigationResolution === 'computed') { var _this$currentNavigati2, _this$currentNavigati3; const targetPagePosition = this.currentPageId - t.targetPageId; // The navigator change the location before triggered the browser event, // so we need to go back to the current url if the navigation is canceled. // Also, when navigation gets cancelled while using url update strategy eager, then we need to // go back. Because, when `urlUpdateStrategy` is `eager`; `setBrowserUrl` method is called // before any verification. const browserUrlUpdateOccurred = t.source === 'popstate' || this.urlUpdateStrategy === 'eager' || this.currentUrlTree === ((_this$currentNavigati2 = this.currentNavigation) === null || _this$currentNavigati2 === void 0 ? void 0 : _this$currentNavigati2.finalUrl); if (browserUrlUpdateOccurred && targetPagePosition !== 0) { this.location.historyGo(targetPagePosition); } else if (this.currentUrlTree === ((_this$currentNavigati3 = this.currentNavigation) === null || _this$currentNavigati3 === void 0 ? void 0 : _this$currentNavigati3.finalUrl) && targetPagePosition === 0) { // We got to the activation stage (where currentUrlTree is set to the navigation's // finalUrl), but we weren't moving anywhere in history (skipLocationChange or replaceUrl). // We still need to reset the router state back to what it was when the navigation started. this.resetState(t); // TODO(atscott): resetting the `browserUrlTree` should really be done in `resetState`. // Investigate if this can be done by running TGP. this.browserUrlTree = t.currentUrlTree; this.resetUrlToCurrentUrlTree(); } else {// The browser URL and router state was not updated before the navigation cancelled so // there's no restoration needed. } } else if (this.canceledNavigationResolution === 'replace') { // TODO(atscott): It seems like we should _always_ reset the state here. It would be a no-op // for `deferred` navigations that haven't change the internal state yet because guards // reject. For 'eager' navigations, it seems like we also really should reset the state // because the navigation was cancelled. Investigate if this can be done by running TGP. if (restoringFromCaughtError) { this.resetState(t); } this.resetUrlToCurrentUrlTree(); } } resetState(t) { this.routerState = t.currentRouterState; this.currentUrlTree = t.currentUrlTree; // Note here that we use the urlHandlingStrategy to get the reset `rawUrlTree` because it may be // configured to handle only part of the navigation URL. This means we would only want to reset // the part of the navigation handled by the Angular router rather than the whole URL. In // addition, the URLHandlingStrategy may be configured to specifically preserve parts of the URL // when merging, such as the query params so they are not lost on a refresh. this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, t.rawUrl); } resetUrlToCurrentUrlTree() { this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree), '', this.generateNgRouterState(this.lastSuccessfulId, this.currentPageId)); } cancelNavigationTransition(t, reason, code) { const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), reason, code); this.triggerEvent(navCancel); t.resolve(false); } generateNgRouterState(navigationId, routerPageId) { if (this.canceledNavigationResolution === 'computed') { return { navigationId, ɵrouterPageId: routerPageId }; } return { navigationId }; } } Router.ɵfac = function Router_Factory(t) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinvalidFactory"](); }; Router.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: Router, factory: function () { return setupRouter(); }, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](Router, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root', useFactory: setupRouter }] }], function () { return [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: _angular_common__WEBPACK_IMPORTED_MODULE_1__.Location }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Compiler }, { type: undefined }]; }, null); })(); function validateCommands(commands) { for (let i = 0; i < commands.length; i++) { const cmd = commands[i]; if (cmd == null) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4008 /* RuntimeErrorCode.NULLISH_COMMAND */ , NG_DEV_MODE$2 && `The requested path contains ${cmd} segment at index ${i}`); } } } function isBrowserTriggeredNavigation(source) { return source !== 'imperative'; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @description * * When applied to an element in a template, makes that element a link * that initiates navigation to a route. Navigation opens one or more routed components * in one or more `<router-outlet>` locations on the page. * * Given a route configuration `[{ path: 'user/:name', component: UserCmp }]`, * the following creates a static link to the route: * `<a routerLink="/user/bob">link to user component</a>` * * You can use dynamic values to generate the link. * For a dynamic link, pass an array of path segments, * followed by the params for each segment. * For example, `['/team', teamId, 'user', userName, {details: true}]` * generates a link to `/team/11/user/bob;details=true`. * * Multiple static segments can be merged into one term and combined with dynamic segments. * For example, `['/team/11/user', userName, {details: true}]` * * The input that you provide to the link is treated as a delta to the current URL. * For instance, suppose the current URL is `/user/(box//aux:team)`. * The link `<a [routerLink]="['/user/jim']">Jim</a>` creates the URL * `/user/(jim//aux:team)`. * See {@link Router#createUrlTree createUrlTree} for more information. * * @usageNotes * * You can use absolute or relative paths in a link, set query parameters, * control how parameters are handled, and keep a history of navigation states. * * ### Relative link paths * * The first segment name can be prepended with `/`, `./`, or `../`. * * If the first segment begins with `/`, the router looks up the route from the root of the * app. * * If the first segment begins with `./`, or doesn't begin with a slash, the router * looks in the children of the current activated route. * * If the first segment begins with `../`, the router goes up one level in the route tree. * * ### Setting and handling query params and fragments * * The following link adds a query parameter and a fragment to the generated URL: * * ``` * <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education"> * link to user component * </a> * ``` * By default, the directive constructs the new URL using the given query parameters. * The example generates the link: `/user/bob?debug=true#education`. * * You can instruct the directive to handle query parameters differently * by specifying the `queryParamsHandling` option in the link. * Allowed values are: * * - `'merge'`: Merge the given `queryParams` into the current query params. * - `'preserve'`: Preserve the current query params. * * For example: * * ``` * <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" queryParamsHandling="merge"> * link to user component * </a> * ``` * * See {@link UrlCreationOptions.queryParamsHandling UrlCreationOptions#queryParamsHandling}. * * ### Preserving navigation history * * You can provide a `state` value to be persisted to the browser's * [`History.state` property](https://developer.mozilla.org/en-US/docs/Web/API/History#Properties). * For example: * * ``` * <a [routerLink]="['/user/bob']" [state]="{tracingId: 123}"> * link to user component * </a> * ``` * * Use {@link Router.getCurrentNavigation() Router#getCurrentNavigation} to retrieve a saved * navigation-state value. For example, to capture the `tracingId` during the `NavigationStart` * event: * * ``` * // Get NavigationStart events * router.events.pipe(filter(e => e instanceof NavigationStart)).subscribe(e => { * const navigation = router.getCurrentNavigation(); * tracingService.trace({id: navigation.extras.state.tracingId}); * }); * ``` * * @ngModule RouterModule * * @publicApi */ class RouterLink { constructor(router, route, tabIndexAttribute, renderer, el) { this.router = router; this.route = route; this.tabIndexAttribute = tabIndexAttribute; this.renderer = renderer; this.el = el; this._preserveFragment = false; this._skipLocationChange = false; this._replaceUrl = false; this.commands = null; /** @internal */ this.onChanges = new rxjs__WEBPACK_IMPORTED_MODULE_32__.Subject(); this.setTabIndexIfNotOnNativeEl('0'); } /** * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the * `UrlCreationOptions`. * @see {@link UrlCreationOptions#preserveFragment UrlCreationOptions#preserveFragment} * @see {@link Router#createUrlTree Router#createUrlTree} */ set preserveFragment(preserveFragment) { this._preserveFragment = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵcoerceToBoolean"])(preserveFragment); } get preserveFragment() { return this._preserveFragment; } /** * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the * `NavigationBehaviorOptions`. * @see {@link NavigationBehaviorOptions#skipLocationChange NavigationBehaviorOptions#skipLocationChange} * @see {@link Router#navigateByUrl Router#navigateByUrl} */ set skipLocationChange(skipLocationChange) { this._skipLocationChange = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵcoerceToBoolean"])(skipLocationChange); } get skipLocationChange() { return this._skipLocationChange; } /** * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the * `NavigationBehaviorOptions`. * @see {@link NavigationBehaviorOptions#replaceUrl NavigationBehaviorOptions#replaceUrl} * @see {@link Router#navigateByUrl Router#navigateByUrl} */ set replaceUrl(replaceUrl) { this._replaceUrl = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵcoerceToBoolean"])(replaceUrl); } get replaceUrl() { return this._replaceUrl; } /** * Modifies the tab index if there was not a tabindex attribute on the element during * instantiation. */ setTabIndexIfNotOnNativeEl(newTabIndex) { if (this.tabIndexAttribute != null /* both `null` and `undefined` */ ) { return; } const renderer = this.renderer; const nativeElement = this.el.nativeElement; if (newTabIndex !== null) { renderer.setAttribute(nativeElement, 'tabindex', newTabIndex); } else { renderer.removeAttribute(nativeElement, 'tabindex'); } } /** @nodoc */ ngOnChanges(changes) { // This is subscribed to by `RouterLinkActive` so that it knows to update when there are changes // to the RouterLinks it's tracking. this.onChanges.next(this); } /** * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}. * - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}. * - **string**: shorthand for array of commands with just the string, i.e. `['/route']` * - **null|undefined**: effectively disables the `routerLink` * @see {@link Router#createUrlTree Router#createUrlTree} */ set routerLink(commands) { if (commands != null) { this.commands = Array.isArray(commands) ? commands : [commands]; this.setTabIndexIfNotOnNativeEl('0'); } else { this.commands = null; this.setTabIndexIfNotOnNativeEl(null); } } /** @nodoc */ onClick() { if (this.urlTree === null) { return true; } const extras = { skipLocationChange: this.skipLocationChange, replaceUrl: this.replaceUrl, state: this.state }; this.router.navigateByUrl(this.urlTree, extras); return true; } get urlTree() { if (this.commands === null) { return null; } return this.router.createUrlTree(this.commands, { // If the `relativeTo` input is not defined, we want to use `this.route` by default. // Otherwise, we should use the value provided by the user in the input. relativeTo: this.relativeTo !== undefined ? this.relativeTo : this.route, queryParams: this.queryParams, fragment: this.fragment, queryParamsHandling: this.queryParamsHandling, preserveFragment: this.preserveFragment }); } } RouterLink.ɵfac = function RouterLink_Factory(t) { return new (t || RouterLink)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](Router), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ActivatedRoute), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinjectAttribute"]('tabindex'), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef)); }; RouterLink.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: RouterLink, selectors: [["", "routerLink", "", 5, "a", 5, "area"]], hostBindings: function RouterLink_HostBindings(rf, ctx) { if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function RouterLink_click_HostBindingHandler() { return ctx.onClick(); }); } }, inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", routerLink: "routerLink" }, standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RouterLink, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ selector: ':not(a):not(area)[routerLink]', standalone: true }] }], function () { return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Attribute, args: ['tabindex'] }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2 }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef }]; }, { queryParams: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], fragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], queryParamsHandling: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], state: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], relativeTo: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], preserveFragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], skipLocationChange: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], replaceUrl: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], routerLink: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], onClick: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener, args: ['click'] }] }); })(); /** * @description * * Lets you link to specific routes in your app. * * See `RouterLink` for more information. * * @ngModule RouterModule * * @publicApi */ class RouterLinkWithHref { constructor(router, route, locationStrategy) { this.router = router; this.route = route; this.locationStrategy = locationStrategy; this._preserveFragment = false; this._skipLocationChange = false; this._replaceUrl = false; this.commands = null; // the url displayed on the anchor element. // @HostBinding('attr.href') is used rather than @HostBinding() because it removes the // href attribute when it becomes `null`. this.href = null; /** @internal */ this.onChanges = new rxjs__WEBPACK_IMPORTED_MODULE_32__.Subject(); this.subscription = router.events.subscribe(s => { if (s instanceof NavigationEnd) { this.updateTargetUrlAndHref(); } }); } /** * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the * `UrlCreationOptions`. * @see {@link UrlCreationOptions#preserveFragment UrlCreationOptions#preserveFragment} * @see {@link Router#createUrlTree Router#createUrlTree} */ set preserveFragment(preserveFragment) { this._preserveFragment = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵcoerceToBoolean"])(preserveFragment); } get preserveFragment() { return this._preserveFragment; } /** * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the * `NavigationBehaviorOptions`. * @see {@link NavigationBehaviorOptions#skipLocationChange NavigationBehaviorOptions#skipLocationChange} * @see {@link Router#navigateByUrl Router#navigateByUrl} */ set skipLocationChange(skipLocationChange) { this._skipLocationChange = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵcoerceToBoolean"])(skipLocationChange); } get skipLocationChange() { return this._skipLocationChange; } /** * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the * `NavigationBehaviorOptions`. * @see {@link NavigationBehaviorOptions#replaceUrl NavigationBehaviorOptions#replaceUrl} * @see {@link Router#navigateByUrl Router#navigateByUrl} */ set replaceUrl(replaceUrl) { this._replaceUrl = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵcoerceToBoolean"])(replaceUrl); } get replaceUrl() { return this._replaceUrl; } /** * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}. * - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}. * - **string**: shorthand for array of commands with just the string, i.e. `['/route']` * - **null|undefined**: Disables the link by removing the `href` * @see {@link Router#createUrlTree Router#createUrlTree} */ set routerLink(commands) { if (commands != null) { this.commands = Array.isArray(commands) ? commands : [commands]; } else { this.commands = null; } } /** @nodoc */ ngOnChanges(changes) { this.updateTargetUrlAndHref(); this.onChanges.next(this); } /** @nodoc */ ngOnDestroy() { this.subscription.unsubscribe(); } /** @nodoc */ onClick(button, ctrlKey, shiftKey, altKey, metaKey) { if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) { return true; } if (typeof this.target === 'string' && this.target != '_self' || this.urlTree === null) { return true; } const extras = { skipLocationChange: this.skipLocationChange, replaceUrl: this.replaceUrl, state: this.state }; this.router.navigateByUrl(this.urlTree, extras); return false; } updateTargetUrlAndHref() { this.href = this.urlTree !== null ? this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree)) : null; } get urlTree() { if (this.commands === null) { return null; } return this.router.createUrlTree(this.commands, { // If the `relativeTo` input is not defined, we want to use `this.route` by default. // Otherwise, we should use the value provided by the user in the input. relativeTo: this.relativeTo !== undefined ? this.relativeTo : this.route, queryParams: this.queryParams, fragment: this.fragment, queryParamsHandling: this.queryParamsHandling, preserveFragment: this.preserveFragment }); } } RouterLinkWithHref.ɵfac = function RouterLinkWithHref_Factory(t) { return new (t || RouterLinkWithHref)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](Router), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](ActivatedRoute), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.LocationStrategy)); }; RouterLinkWithHref.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: RouterLinkWithHref, selectors: [["a", "routerLink", ""], ["area", "routerLink", ""]], hostVars: 2, hostBindings: function RouterLinkWithHref_HostBindings(rf, ctx) { if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function RouterLinkWithHref_click_HostBindingHandler($event) { return ctx.onClick($event.button, $event.ctrlKey, $event.shiftKey, $event.altKey, $event.metaKey); }); } if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("target", ctx.target)("href", ctx.href, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeUrl"]); } }, inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", routerLink: "routerLink" }, standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RouterLinkWithHref, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ selector: 'a[routerLink],area[routerLink]', standalone: true }] }], function () { return [{ type: Router }, { type: ActivatedRoute }, { type: _angular_common__WEBPACK_IMPORTED_MODULE_1__.LocationStrategy }]; }, { target: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding, args: ['attr.target'] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], queryParams: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], fragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], queryParamsHandling: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], state: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], relativeTo: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], href: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding, args: ['attr.href'] }], preserveFragment: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], skipLocationChange: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], replaceUrl: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], routerLink: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], onClick: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener, args: ['click', ['$event.button', '$event.ctrlKey', '$event.shiftKey', '$event.altKey', '$event.metaKey']] }] }); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * * @description * * Tracks whether the linked route of an element is currently active, and allows you * to specify one or more CSS classes to add to the element when the linked route * is active. * * Use this directive to create a visual distinction for elements associated with an active route. * For example, the following code highlights the word "Bob" when the router * activates the associated route: * * ``` * <a routerLink="/user/bob" routerLinkActive="active-link">Bob</a> * ``` * * Whenever the URL is either '/user' or '/user/bob', the "active-link" class is * added to the anchor tag. If the URL changes, the class is removed. * * You can set more than one class using a space-separated string or an array. * For example: * * ``` * <a routerLink="/user/bob" routerLinkActive="class1 class2">Bob</a> * <a routerLink="/user/bob" [routerLinkActive]="['class1', 'class2']">Bob</a> * ``` * * To add the classes only when the URL matches the link exactly, add the option `exact: true`: * * ``` * <a routerLink="/user/bob" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: * true}">Bob</a> * ``` * * To directly check the `isActive` status of the link, assign the `RouterLinkActive` * instance to a template variable. * For example, the following checks the status without assigning any CSS classes: * * ``` * <a routerLink="/user/bob" routerLinkActive #rla="routerLinkActive"> * Bob {{ rla.isActive ? '(already open)' : ''}} * </a> * ``` * * You can apply the `RouterLinkActive` directive to an ancestor of linked elements. * For example, the following sets the active-link class on the `<div>` parent tag * when the URL is either '/user/jim' or '/user/bob'. * * ``` * <div routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: true}"> * <a routerLink="/user/jim">Jim</a> * <a routerLink="/user/bob">Bob</a> * </div> * ``` * * The `RouterLinkActive` directive can also be used to set the aria-current attribute * to provide an alternative distinction for active elements to visually impaired users. * * For example, the following code adds the 'active' class to the Home Page link when it is * indeed active and in such case also sets its aria-current attribute to 'page': * * ``` * <a routerLink="/" routerLinkActive="active" ariaCurrentWhenActive="page">Home Page</a> * ``` * * @ngModule RouterModule * * @publicApi */ class RouterLinkActive { constructor(router, element, renderer, cdr, link, linkWithHref) { this.router = router; this.element = element; this.renderer = renderer; this.cdr = cdr; this.link = link; this.linkWithHref = linkWithHref; this.classes = []; this.isActive = false; /** * Options to configure how to determine if the router link is active. * * These options are passed to the `Router.isActive()` function. * * @see Router.isActive */ this.routerLinkActiveOptions = { exact: false }; /** * * You can use the output `isActiveChange` to get notified each time the link becomes * active or inactive. * * Emits: * true -> Route is active * false -> Route is inactive * * ``` * <a * routerLink="/user/bob" * routerLinkActive="active-link" * (isActiveChange)="this.onRouterLinkActive($event)">Bob</a> * ``` */ this.isActiveChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); this.routerEventsSubscription = router.events.subscribe(s => { if (s instanceof NavigationEnd) { this.update(); } }); } /** @nodoc */ ngAfterContentInit() { // `of(null)` is used to force subscribe body to execute once immediately (like `startWith`). (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(this.links.changes, this.linksWithHrefs.changes, (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(null)).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_34__.mergeAll)()).subscribe(_ => { this.update(); this.subscribeToEachLinkOnChanges(); }); } subscribeToEachLinkOnChanges() { var _this$linkInputChange; (_this$linkInputChange = this.linkInputChangesSubscription) === null || _this$linkInputChange === void 0 ? void 0 : _this$linkInputChange.unsubscribe(); const allLinkChanges = [...this.links.toArray(), ...this.linksWithHrefs.toArray(), this.link, this.linkWithHref].filter(link => !!link).map(link => link.onChanges); this.linkInputChangesSubscription = (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(allLinkChanges).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_34__.mergeAll)()).subscribe(link => { if (this.isActive !== this.isLinkActive(this.router)(link)) { this.update(); } }); } set routerLinkActive(data) { const classes = Array.isArray(data) ? data : data.split(' '); this.classes = classes.filter(c => !!c); } /** @nodoc */ ngOnChanges(changes) { this.update(); } /** @nodoc */ ngOnDestroy() { var _this$linkInputChange2; this.routerEventsSubscription.unsubscribe(); (_this$linkInputChange2 = this.linkInputChangesSubscription) === null || _this$linkInputChange2 === void 0 ? void 0 : _this$linkInputChange2.unsubscribe(); } update() { if (!this.links || !this.linksWithHrefs || !this.router.navigated) return; Promise.resolve().then(() => { const hasActiveLinks = this.hasActiveLinks(); if (this.isActive !== hasActiveLinks) { this.isActive = hasActiveLinks; this.cdr.markForCheck(); this.classes.forEach(c => { if (hasActiveLinks) { this.renderer.addClass(this.element.nativeElement, c); } else { this.renderer.removeClass(this.element.nativeElement, c); } }); if (hasActiveLinks && this.ariaCurrentWhenActive !== undefined) { this.renderer.setAttribute(this.element.nativeElement, 'aria-current', this.ariaCurrentWhenActive.toString()); } else { this.renderer.removeAttribute(this.element.nativeElement, 'aria-current'); } // Emit on isActiveChange after classes are updated this.isActiveChange.emit(hasActiveLinks); } }); } isLinkActive(router) { const options = isActiveMatchOptions(this.routerLinkActiveOptions) ? this.routerLinkActiveOptions : // While the types should disallow `undefined` here, it's possible without strict inputs this.routerLinkActiveOptions.exact || false; return link => link.urlTree ? router.isActive(link.urlTree, options) : false; } hasActiveLinks() { const isActiveCheckFn = this.isLinkActive(this.router); return this.link && isActiveCheckFn(this.link) || this.linkWithHref && isActiveCheckFn(this.linkWithHref) || this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn); } } RouterLinkActive.ɵfac = function RouterLinkActive_Factory(t) { return new (t || RouterLinkActive)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](Router), _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), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](RouterLink, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](RouterLinkWithHref, 8)); }; RouterLinkActive.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({ type: RouterLinkActive, selectors: [["", "routerLinkActive", ""]], contentQueries: function RouterLinkActive_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵcontentQuery"](dirIndex, RouterLink, 5); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵcontentQuery"](dirIndex, RouterLinkWithHref, 5); } if (rf & 2) { let _t; _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.links = _t); _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.linksWithHrefs = _t); } }, inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, exportAs: ["routerLinkActive"], standalone: true, features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]] }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RouterLinkActive, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive, args: [{ selector: '[routerLinkActive]', exportAs: 'routerLinkActive', standalone: true }] }], function () { return [{ type: Router }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2 }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef }, { type: RouterLink, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional }] }, { type: RouterLinkWithHref, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional }] }]; }, { links: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ContentChildren, args: [RouterLink, { descendants: true }] }], linksWithHrefs: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ContentChildren, args: [RouterLinkWithHref, { descendants: true }] }], routerLinkActiveOptions: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], ariaCurrentWhenActive: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }], isActiveChange: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output }], routerLinkActive: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input }] }); })(); /** * Use instead of `'paths' in options` to be compatible with property renaming */ function isActiveMatchOptions(options) { return !!options.paths; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @description * * Provides a preloading strategy. * * @publicApi */ class PreloadingStrategy {} /** * @description * * Provides a preloading strategy that preloads all modules as quickly as possible. * * ``` * RouterModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules}) * ``` * * @publicApi */ class PreloadAllModules { preload(route, fn) { return fn().pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.catchError)(() => (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(null))); } } PreloadAllModules.ɵfac = function PreloadAllModules_Factory(t) { return new (t || PreloadAllModules)(); }; PreloadAllModules.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: PreloadAllModules, factory: PreloadAllModules.ɵfac, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PreloadAllModules, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root' }] }], null, null); })(); /** * @description * * Provides a preloading strategy that does not preload any modules. * * This strategy is enabled by default. * * @publicApi */ class NoPreloading { preload(route, fn) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(null); } } NoPreloading.ɵfac = function NoPreloading_Factory(t) { return new (t || NoPreloading)(); }; NoPreloading.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: NoPreloading, factory: NoPreloading.ɵfac, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NoPreloading, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root' }] }], null, null); })(); /** * The preloader optimistically loads all router configurations to * make navigations into lazily-loaded sections of the application faster. * * The preloader runs in the background. When the router bootstraps, the preloader * starts listening to all navigation events. After every such event, the preloader * will check if any configurations can be loaded lazily. * * If a route is protected by `canLoad` guards, the preloaded will not load it. * * @publicApi */ class RouterPreloader { constructor(router, compiler, injector, preloadingStrategy, loader) { this.router = router; this.injector = injector; this.preloadingStrategy = preloadingStrategy; this.loader = loader; } setUpPreloading() { this.subscription = this.router.events.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.filter)(e => e instanceof NavigationEnd), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.concatMap)(() => this.preload())).subscribe(() => {}); } preload() { return this.processRoutes(this.injector, this.router.config); } /** @nodoc */ ngOnDestroy() { if (this.subscription) { this.subscription.unsubscribe(); } } processRoutes(injector, routes) { const res = []; for (const route of routes) { var _route$_injector4, _route$_loadedInjecto2; if (route.providers && !route._injector) { route._injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.createEnvironmentInjector)(route.providers, injector, `Route: ${route.path}`); } const injectorForCurrentRoute = (_route$_injector4 = route._injector) !== null && _route$_injector4 !== void 0 ? _route$_injector4 : injector; const injectorForChildren = (_route$_loadedInjecto2 = route._loadedInjector) !== null && _route$_loadedInjecto2 !== void 0 ? _route$_loadedInjecto2 : injectorForCurrentRoute; // Note that `canLoad` is only checked as a condition that prevents `loadChildren` and not // `loadComponent`. `canLoad` guards only block loading of child routes by design. This // happens as a consequence of needing to descend into children for route matching immediately // while component loading is deferred until route activation. Because `canLoad` guards can // have side effects, we cannot execute them here so we instead skip preloading altogether // when present. Lastly, it remains to be decided whether `canLoad` should behave this way // at all. Code splitting and lazy loading is separate from client-side authorization checks // and should not be used as a security measure to prevent loading of code. if (route.loadChildren && !route._loadedRoutes && route.canLoad === undefined || route.loadComponent && !route._loadedComponent) { res.push(this.preloadConfig(injectorForCurrentRoute, route)); } else if (route.children || route._loadedRoutes) { var _route$children; res.push(this.processRoutes(injectorForChildren, (_route$children = route.children) !== null && _route$children !== void 0 ? _route$children : route._loadedRoutes)); } } return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)(res).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_34__.mergeAll)()); } preloadConfig(injector, route) { return this.preloadingStrategy.preload(route, () => { let loadedChildren$; if (route.loadChildren && route.canLoad === undefined) { loadedChildren$ = this.loader.loadChildren(injector, route); } else { loadedChildren$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(null); } const recursiveLoadChildren$ = loadedChildren$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.mergeMap)(config => { var _config$injector; if (config === null) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(void 0); } route._loadedRoutes = config.routes; route._loadedInjector = config.injector; // If the loaded config was a module, use that as the module/module injector going // forward. Otherwise, continue using the current module/module injector. return this.processRoutes((_config$injector = config.injector) !== null && _config$injector !== void 0 ? _config$injector : injector, config.routes); })); if (route.loadComponent && !route._loadedComponent) { const loadComponent$ = this.loader.loadComponent(route); return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.from)([recursiveLoadChildren$, loadComponent$]).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_34__.mergeAll)()); } else { return recursiveLoadChildren$; } }); } } RouterPreloader.ɵfac = function RouterPreloader_Factory(t) { return new (t || RouterPreloader)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](Router), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.Compiler), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.EnvironmentInjector), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PreloadingStrategy), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](RouterConfigLoader)); }; RouterPreloader.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: RouterPreloader, factory: RouterPreloader.ɵfac, providedIn: 'root' }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RouterPreloader, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable, args: [{ providedIn: 'root' }] }], function () { return [{ type: Router }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Compiler }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; }, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const ROUTER_SCROLLER = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(''); class RouterScroller { constructor(router, /** @docsNotRequired */ viewportScroller, options = {}) { this.router = router; this.viewportScroller = viewportScroller; this.options = options; this.lastId = 0; this.lastSource = 'imperative'; this.restoredId = 0; this.store = {}; // Default both options to 'disabled' options.scrollPositionRestoration = options.scrollPositionRestoration || 'disabled'; options.anchorScrolling = options.anchorScrolling || 'disabled'; } init() { // we want to disable the automatic scrolling because having two places // responsible for scrolling results race conditions, especially given // that browser don't implement this behavior consistently if (this.options.scrollPositionRestoration !== 'disabled') { this.viewportScroller.setHistoryScrollRestoration('manual'); } this.routerEventsSubscription = this.createScrollEvents(); this.scrollEventsSubscription = this.consumeScrollEvents(); } createScrollEvents() { return this.router.events.subscribe(e => { if (e instanceof NavigationStart) { // store the scroll position of the current stable navigations. this.store[this.lastId] = this.viewportScroller.getScrollPosition(); this.lastSource = e.navigationTrigger; this.restoredId = e.restoredState ? e.restoredState.navigationId : 0; } else if (e instanceof NavigationEnd) { this.lastId = e.id; this.scheduleScrollEvent(e, this.router.parseUrl(e.urlAfterRedirects).fragment); } }); } consumeScrollEvents() { return this.router.events.subscribe(e => { if (!(e instanceof Scroll)) return; // a popstate event. The pop state event will always ignore anchor scrolling. if (e.position) { if (this.options.scrollPositionRestoration === 'top') { this.viewportScroller.scrollToPosition([0, 0]); } else if (this.options.scrollPositionRestoration === 'enabled') { this.viewportScroller.scrollToPosition(e.position); } // imperative navigation "forward" } else { if (e.anchor && this.options.anchorScrolling === 'enabled') { this.viewportScroller.scrollToAnchor(e.anchor); } else if (this.options.scrollPositionRestoration !== 'disabled') { this.viewportScroller.scrollToPosition([0, 0]); } } }); } scheduleScrollEvent(routerEvent, anchor) { this.router.triggerEvent(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor)); } /** @nodoc */ ngOnDestroy() { if (this.routerEventsSubscription) { this.routerEventsSubscription.unsubscribe(); } if (this.scrollEventsSubscription) { this.scrollEventsSubscription.unsubscribe(); } } } RouterScroller.ɵfac = function RouterScroller_Factory(t) { _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinvalidFactory"](); }; RouterScroller.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: RouterScroller, factory: RouterScroller.ɵfac }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RouterScroller, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable }], function () { return [{ type: Router }, { type: _angular_common__WEBPACK_IMPORTED_MODULE_1__.ViewportScroller }, { type: undefined }]; }, null); })(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || ngDevMode; /** * Sets up providers necessary to enable `Router` functionality for the application. * Allows to configure a set of routes as well as extra features that should be enabled. * * @usageNotes * * Basic example of how you can add a Router to your application: * ``` * const appRoutes: Routes = []; * bootstrapApplication(AppComponent, { * providers: [provideRouter(appRoutes)] * }); * ``` * * You can also enable optional features in the Router by adding functions from the `RouterFeatures` * type: * ``` * const appRoutes: Routes = []; * bootstrapApplication(AppComponent, * { * providers: [ * provideRouter(appRoutes, * withDebugTracing(), * withRouterConfig({paramsInheritanceStrategy: 'always'})) * ] * } * ); * ``` * * @see `RouterFeatures` * * @publicApi * @developerPreview * @param routes A set of `Route`s to use for the application routing table. * @param features Optional features to configure additional router behaviors. * @returns A set of providers to setup a Router. */ function provideRouter(routes, ...features) { return [provideRoutes(routes), { provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] }, { provide: _angular_core__WEBPACK_IMPORTED_MODULE_0__.APP_BOOTSTRAP_LISTENER, multi: true, useFactory: getBootstrapListener }, features.map(feature => feature.ɵproviders) // TODO: All options used by the `assignExtraOptionsToRouter` factory need to be reviewed for // how we want them to be configured. This API doesn't currently have a way to configure them // and we should decide what the _best_ way to do that is rather than just sticking with the // status quo of how it's done today. ]; } function rootRoute(router) { return router.routerState.root; } /** * Helper function to create an object that represents a Router feature. */ function routerFeature(kind, providers) { return { ɵkind: kind, ɵproviders: providers }; } /** * Registers a [DI provider](guide/glossary#provider) for a set of routes. * @param routes The route configuration to provide. * * @usageNotes * * ``` * @NgModule({ * providers: [provideRoutes(ROUTES)] * }) * class LazyLoadedChildModule {} * ``` * * @publicApi */ function provideRoutes(routes) { return [{ provide: ROUTES, multi: true, useValue: routes }]; } /** * Enables customizable scrolling behavior for router navigations. * * @usageNotes * * Basic example of how you can enable scrolling feature: * ``` * const appRoutes: Routes = []; * bootstrapApplication(AppComponent, * { * providers: [ * provideRouter(appRoutes, withInMemoryScrolling()) * ] * } * ); * ``` * * @see `provideRouter` * @see `ViewportScroller` * * @publicApi * @developerPreview * @param options Set of configuration parameters to customize scrolling behavior, see * `InMemoryScrollingOptions` for additional information. * @returns A set of providers for use with `provideRouter`. */ function withInMemoryScrolling(options = {}) { const providers = [{ provide: ROUTER_SCROLLER, useFactory: () => { const router = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(Router); const viewportScroller = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_1__.ViewportScroller); return new RouterScroller(router, viewportScroller, options); } }]; return routerFeature(4 /* RouterFeatureKind.InMemoryScrollingFeature */ , providers); } function getBootstrapListener() { const injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector); return bootstrappedComponentRef => { var _injector$get2, _injector$get3; const ref = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.ApplicationRef); if (bootstrappedComponentRef !== ref.components[0]) { return; } const router = injector.get(Router); const bootstrapDone = injector.get(BOOTSTRAP_DONE); if (injector.get(INITIAL_NAVIGATION) === 1 /* InitialNavigation.EnabledNonBlocking */ ) { router.initialNavigation(); } (_injector$get2 = injector.get(ROUTER_PRELOADER, null, _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectFlags.Optional)) === null || _injector$get2 === void 0 ? void 0 : _injector$get2.setUpPreloading(); (_injector$get3 = injector.get(ROUTER_SCROLLER, null, _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectFlags.Optional)) === null || _injector$get3 === void 0 ? void 0 : _injector$get3.init(); router.resetRootComponentType(ref.componentTypes[0]); if (!bootstrapDone.closed) { bootstrapDone.next(); bootstrapDone.unsubscribe(); } }; } /** * A subject used to indicate that the bootstrapping phase is done. When initial navigation is * `enabledBlocking`, the first navigation waits until bootstrapping is finished before continuing * to the activation phase. */ const BOOTSTRAP_DONE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(NG_DEV_MODE$1 ? 'bootstrap done indicator' : '', { factory: () => { return new rxjs__WEBPACK_IMPORTED_MODULE_32__.Subject(); } }); const INITIAL_NAVIGATION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(NG_DEV_MODE$1 ? 'initial navigation' : '', { providedIn: 'root', factory: () => 1 /* InitialNavigation.EnabledNonBlocking */ }); /** * Configures initial navigation to start before the root component is created. * * The bootstrap is blocked until the initial navigation is complete. This value is required for * [server-side rendering](guide/universal) to work. * * @usageNotes * * Basic example of how you can enable this navigation behavior: * ``` * const appRoutes: Routes = []; * bootstrapApplication(AppComponent, * { * providers: [ * provideRouter(appRoutes, withEnabledBlockingInitialNavigation()) * ] * } * ); * ``` * * @see `provideRouter` * * @publicApi * @developerPreview * @returns A set of providers for use with `provideRouter`. */ function withEnabledBlockingInitialNavigation() { const providers = [{ provide: INITIAL_NAVIGATION, useValue: 0 /* InitialNavigation.EnabledBlocking */ }, { provide: _angular_core__WEBPACK_IMPORTED_MODULE_0__.APP_INITIALIZER, multi: true, deps: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector], useFactory: injector => { const locationInitialized = injector.get(_angular_common__WEBPACK_IMPORTED_MODULE_1__.LOCATION_INITIALIZED, Promise.resolve()); let initNavigation = false; /** * Performs the given action once the router finishes its next/current navigation. * * If the navigation is canceled or errors without a redirect, the navigation is considered * complete. If the `NavigationEnd` event emits, the navigation is also considered complete. */ function afterNextNavigation(action) { const router = injector.get(Router); router.events.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.filter)(e => e instanceof NavigationEnd || e instanceof NavigationCancel || e instanceof NavigationError), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(e => { if (e instanceof NavigationEnd) { // Navigation assumed to succeed if we get `ActivationStart` return true; } const redirecting = e instanceof NavigationCancel ? e.code === 0 /* NavigationCancellationCode.Redirect */ || e.code === 1 /* NavigationCancellationCode.SupersededByNewNavigation */ : false; return redirecting ? null : false; }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.filter)(result => result !== null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.take)(1)).subscribe(() => { action(); }); } return () => { return locationInitialized.then(() => { return new Promise(resolve => { const router = injector.get(Router); const bootstrapDone = injector.get(BOOTSTRAP_DONE); afterNextNavigation(() => { // Unblock APP_INITIALIZER in case the initial navigation was canceled or errored // without a redirect. resolve(true); initNavigation = true; }); router.afterPreactivation = () => { // Unblock APP_INITIALIZER once we get to `afterPreactivation`. At this point, we // assume activation will complete successfully (even though this is not // guaranteed). resolve(true); // only the initial navigation should be delayed until bootstrapping is done. if (!initNavigation) { return bootstrapDone.closed ? (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(void 0) : bootstrapDone; // subsequent navigations should not be delayed } else { return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(void 0); } }; router.initialNavigation(); }); }); }; } }]; return routerFeature(2 /* RouterFeatureKind.EnabledBlockingInitialNavigationFeature */ , providers); } /** * Disables initial navigation. * * Use if there is a reason to have more control over when the router starts its initial navigation * due to some complex initialization logic. * * @usageNotes * * Basic example of how you can disable initial navigation: * ``` * const appRoutes: Routes = []; * bootstrapApplication(AppComponent, * { * providers: [ * provideRouter(appRoutes, withDisabledInitialNavigation()) * ] * } * ); * ``` * * @see `provideRouter` * * @returns A set of providers for use with `provideRouter`. * * @publicApi * @developerPreview */ function withDisabledInitialNavigation() { const providers = [{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_0__.APP_INITIALIZER, multi: true, useFactory: () => { const router = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(Router); return () => { router.setUpLocationChangeListener(); }; } }, { provide: INITIAL_NAVIGATION, useValue: 2 /* InitialNavigation.Disabled */ }]; return routerFeature(3 /* RouterFeatureKind.DisabledInitialNavigationFeature */ , providers); } /** * Enables logging of all internal navigation events to the console. * Extra logging might be useful for debugging purposes to inspect Router event sequence. * * @usageNotes * * Basic example of how you can enable debug tracing: * ``` * const appRoutes: Routes = []; * bootstrapApplication(AppComponent, * { * providers: [ * provideRouter(appRoutes, withDebugTracing()) * ] * } * ); * ``` * * @see `provideRouter` * * @returns A set of providers for use with `provideRouter`. * * @publicApi * @developerPreview */ function withDebugTracing() { let providers = []; if (NG_DEV_MODE$1) { providers = [{ provide: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ENVIRONMENT_INITIALIZER, multi: true, useFactory: () => { const router = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(Router); return () => router.events.subscribe(e => { var _console$group, _console, _console$groupEnd, _console2; // tslint:disable:no-console (_console$group = (_console = console).group) === null || _console$group === void 0 ? void 0 : _console$group.call(_console, `Router Event: ${e.constructor.name}`); console.log(stringifyEvent(e)); console.log(e); (_console$groupEnd = (_console2 = console).groupEnd) === null || _console$groupEnd === void 0 ? void 0 : _console$groupEnd.call(_console2); // tslint:enable:no-console }); } }]; } else { providers = []; } return routerFeature(1 /* RouterFeatureKind.DebugTracingFeature */ , providers); } const ROUTER_PRELOADER = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(NG_DEV_MODE$1 ? 'router preloader' : ''); /** * Allows to configure a preloading strategy to use. The strategy is configured by providing a * reference to a class that implements a `PreloadingStrategy`. * * @usageNotes * * Basic example of how you can configure preloading: * ``` * const appRoutes: Routes = []; * bootstrapApplication(AppComponent, * { * providers: [ * provideRouter(appRoutes, withPreloading(PreloadAllModules)) * ] * } * ); * ``` * * @see `provideRouter` * * @param preloadingStrategy A reference to a class that implements a `PreloadingStrategy` that * should be used. * @returns A set of providers for use with `provideRouter`. * * @publicApi * @developerPreview */ function withPreloading(preloadingStrategy) { const providers = [{ provide: ROUTER_PRELOADER, useExisting: RouterPreloader }, { provide: PreloadingStrategy, useExisting: preloadingStrategy }]; return routerFeature(0 /* RouterFeatureKind.PreloadingFeature */ , providers); } /** * Allows to provide extra parameters to configure Router. * * @usageNotes * * Basic example of how you can provide extra configuration options: * ``` * const appRoutes: Routes = []; * bootstrapApplication(AppComponent, * { * providers: [ * provideRouter(appRoutes, withRouterConfig({ * onSameUrlNavigation: 'reload' * })) * ] * } * ); * ``` * * @see `provideRouter` * * @param options A set of parameters to configure Router, see `RouterConfigOptions` for * additional information. * @returns A set of providers for use with `provideRouter`. * * @publicApi * @developerPreview */ function withRouterConfig(options) { const providers = [{ provide: ROUTER_CONFIGURATION, useValue: options }]; return routerFeature(5 /* RouterFeatureKind.RouterConfigurationFeature */ , providers); } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode; /** * The directives defined in the `RouterModule`. */ const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent]; /** * @docsNotRequired */ const ROUTER_FORROOT_GUARD = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(NG_DEV_MODE ? 'router duplicate forRoot guard' : 'ROUTER_FORROOT_GUARD'); // TODO(atscott): All of these except `ActivatedRoute` are `providedIn: 'root'`. They are only kept // here to avoid a breaking change whereby the provider order matters based on where the // `RouterModule`/`RouterTestingModule` is imported. These can/should be removed as a "breaking" // change in a major version. const ROUTER_PROVIDERS = [_angular_common__WEBPACK_IMPORTED_MODULE_1__.Location, { provide: UrlSerializer, useClass: DefaultUrlSerializer }, { provide: Router, useFactory: setupRouter }, ChildrenOutletContexts, { provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] }, RouterConfigLoader]; function routerNgProbeToken() { return new _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgProbeToken('Router', Router); } /** * @description * * Adds directives and providers for in-app navigation among views defined in an application. * Use the Angular `Router` service to declaratively specify application states and manage state * transitions. * * You can import this NgModule multiple times, once for each lazy-loaded bundle. * However, only one `Router` service can be active. * To ensure this, there are two ways to register routes when importing this module: * * * The `forRoot()` method creates an `NgModule` that contains all the directives, the given * routes, and the `Router` service itself. * * The `forChild()` method creates an `NgModule` that contains all the directives and the given * routes, but does not include the `Router` service. * * @see [Routing and Navigation guide](guide/router) for an * overview of how the `Router` service should be used. * * @publicApi */ class RouterModule { constructor(guard) {} /** * Creates and configures a module with all the router providers and directives. * Optionally sets up an application listener to perform an initial navigation. * * When registering the NgModule at the root, import as follows: * * ``` * @NgModule({ * imports: [RouterModule.forRoot(ROUTES)] * }) * class MyNgModule {} * ``` * * @param routes An array of `Route` objects that define the navigation paths for the application. * @param config An `ExtraOptions` configuration object that controls how navigation is performed. * @return The new `NgModule`. * */ static forRoot(routes, config) { return { ngModule: RouterModule, providers: [ROUTER_PROVIDERS, NG_DEV_MODE ? config !== null && config !== void 0 && config.enableTracing ? withDebugTracing().ɵproviders : [] : [], provideRoutes(routes), { provide: ROUTER_FORROOT_GUARD, useFactory: provideForRootGuard, deps: [[Router, new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf()]] }, { provide: ROUTER_CONFIGURATION, useValue: config ? config : {} }, config !== null && config !== void 0 && config.useHash ? provideHashLocationStrategy() : providePathLocationStrategy(), provideRouterScroller(), config !== null && config !== void 0 && config.preloadingStrategy ? withPreloading(config.preloadingStrategy).ɵproviders : [], { provide: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgProbeToken, multi: true, useFactory: routerNgProbeToken }, config !== null && config !== void 0 && config.initialNavigation ? provideInitialNavigation(config) : [], provideRouterInitializer()] }; } /** * Creates a module with all the router directives and a provider registering routes, * without creating a new Router service. * When registering for submodules and lazy-loaded submodules, create the NgModule as follows: * * ``` * @NgModule({ * imports: [RouterModule.forChild(ROUTES)] * }) * class MyNgModule {} * ``` * * @param routes An array of `Route` objects that define the navigation paths for the submodule. * @return The new NgModule. * */ static forChild(routes) { return { ngModule: RouterModule, providers: [provideRoutes(routes)] }; } } RouterModule.ɵfac = function RouterModule_Factory(t) { return new (t || RouterModule)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](ROUTER_FORROOT_GUARD, 8)); }; RouterModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({ type: RouterModule }); RouterModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ imports: [ɵEmptyOutletComponent] }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RouterModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule, args: [{ imports: ROUTER_DIRECTIVES, exports: ROUTER_DIRECTIVES }] }], function () { return [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject, args: [ROUTER_FORROOT_GUARD] }] }]; }, null); })(); /** * For internal use by `RouterModule` only. Note that this differs from `withInMemoryRouterScroller` * because it reads from the `ExtraOptions` which should not be used in the standalone world. */ function provideRouterScroller() { return { provide: ROUTER_SCROLLER, useFactory: () => { const router = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(Router); const viewportScroller = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_1__.ViewportScroller); const config = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(ROUTER_CONFIGURATION); if (config.scrollOffset) { viewportScroller.setOffset(config.scrollOffset); } return new RouterScroller(router, viewportScroller, config); } }; } // Note: For internal use only with `RouterModule`. Standalone setup via `provideRouter` should // provide hash location directly via `{provide: LocationStrategy, useClass: HashLocationStrategy}`. function provideHashLocationStrategy() { return { provide: _angular_common__WEBPACK_IMPORTED_MODULE_1__.LocationStrategy, useClass: _angular_common__WEBPACK_IMPORTED_MODULE_1__.HashLocationStrategy }; } // Note: For internal use only with `RouterModule`. Standalone setup via `provideRouter` does not // need this at all because `PathLocationStrategy` is the default factory for `LocationStrategy`. function providePathLocationStrategy() { return { provide: _angular_common__WEBPACK_IMPORTED_MODULE_1__.LocationStrategy, useClass: _angular_common__WEBPACK_IMPORTED_MODULE_1__.PathLocationStrategy }; } function provideForRootGuard(router) { if (NG_DEV_MODE && router) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](4007 /* RuntimeErrorCode.FOR_ROOT_CALLED_TWICE */ , `The Router was provided more than once. This can happen if 'forRoot' is used outside of the root injector.` + ` Lazy loaded modules should use RouterModule.forChild() instead.`); } return 'guarded'; } // Note: For internal use only with `RouterModule`. Standalone router setup with `provideRouter` // users call `withXInitialNavigation` directly. function provideInitialNavigation(config) { return [config.initialNavigation === 'disabled' ? withDisabledInitialNavigation().ɵproviders : [], config.initialNavigation === 'enabledBlocking' ? withEnabledBlockingInitialNavigation().ɵproviders : []]; } // TODO(atscott): This should not be in the public API /** * A [DI token](guide/glossary/#di-token) for the router initializer that * is called after the app is bootstrapped. * * @publicApi */ const ROUTER_INITIALIZER = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(NG_DEV_MODE ? 'Router Initializer' : ''); function provideRouterInitializer() { return [// ROUTER_INITIALIZER token should be removed. It's public API but shouldn't be. We can just // have `getBootstrapListener` directly attached to APP_BOOTSTRAP_LISTENER. { provide: ROUTER_INITIALIZER, useFactory: getBootstrapListener }, { provide: _angular_core__WEBPACK_IMPORTED_MODULE_0__.APP_BOOTSTRAP_LISTENER, multi: true, useExisting: ROUTER_INITIALIZER }]; } /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @publicApi */ const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Version('14.3.0'); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // This file only reexports content of the `src` folder. Keep it that way. /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Generated bundle index. Do not edit. */ /***/ }) }]) //# sourceMappingURL=7067.js.map